code_text
stringlengths
604
999k
repo_name
stringlengths
4
100
file_path
stringlengths
4
873
language
stringclasses
23 values
license
stringclasses
15 values
size
int32
1.02k
999k
(function() { var aa=encodeURIComponent,ca=window,da=Object,ea=Infinity,fa=document,ga=isNaN,h=Math,ha=Array,ia=Number,ja=NaN,m=Error,ka=Boolean,la=parseInt,ma=parseFloat,na=isFinite,oa=decodeURIComponent;function pa(a,b){return a.width=b}function ra(a,b){return a.data=b}function sa(a,b){return a.ceil=b}function ta(a,b){return a.floor=b}function ua(a,b){return a.format=b}function va(a,b){return a.remove=b}function wa(a,b){return a.clear=b}function xa(a,b){return a.getColumnIndex=b} function za(a,b){return a.stroke=b}function Ba(a,b){return a.getTime=b}function Ca(a,b){return a.fill=b}function Da(a,b){return a.toString=b}function Ea(a,b){return a.position=b}function Fa(a,b){return a.toJSON=b}function Ga(a,b){return a.next=b}function Ia(a,b){return a.constructor=b}function Ja(a,b){return a.fontSize=b}function Ka(a,b){return a.message=b}function La(a,b){return a.start=b}function Ma(a,b){return a.init=b}function Na(a,b){return a.bottom=b}function Oa(a,b){return a.scale=b} function Pa(a,b){return a.contains=b}function Qa(a,b){return a.label=b}function Ra(a,b){return a.display=b}function Sa(a,b){return a.height=b}function Ta(a,b){return a.right=b}function Ua(a,b){return a.isEmpty=b}function Va(a,b){return a.round=b}function Wa(a,b){return a.innerHTML=b}function Xa(a,b){return a.color=b}function Ya(a,b){return a.left=b}function Za(a,b){return a.equals=b}function $a(a,b){return a.cssText=b}function ab(a,b){return a.type=b}function bb(a,b){return a.tabIndex=b} function db(a,b){return a.translate=b}function eb(a,b){return a.name=b}function fb(a,b){return a.getValue=b}function gb(a,b){return a.parse=b}function hb(a,b){return a.visibility=b}function ib(a,b){return a.bold=b}function jb(a,b){return a.length=b}function kb(a,b){return a.prototype=b}function lb(a,b){return a.className=b}function mb(a,b){return a.opacity=b}function nb(a,b){return a.sort=b} var p="appendChild",ob="filter",pb="activeElement",qb="getBoundingClientRect",rb="shift",sb="exec",r="width",tb="collapse",ub="pattern",vb="replace",wb="toFixed",xb="ceil",t="floor",yb="content",zb="offsetWidth",Ab="concat",Bb="charAt",Cb="createTextNode",Db="getDate",Eb="insertBefore",Fb="targetTouches",Gb="screenX",Hb="screenY",Ib="match",Jb="getUTCFullYear",Kb="format",Lb="getBoxObjectFor",Nb="cols",Ob="remove",Pb="querySelector",Qb="createElement",Rb="scrollHeight",Sb="firstChild",Tb="forEach", Ub="clientLeft",v="setAttribute",Vb="clientTop",Wb="clear",Xb="childNodes",Yb="stroke",Zb="bind",$b="getHours",ac="nextSibling",bc="getTime",cc="getElementsByTagName",dc="documentElement",ec="substr",fc="fill",gc="previousSibling",hc="toString",ic="propertyIsEnumerable",jc="position",lc="getDay",mc="sourceIndex",nc="index",oc="next",pc="split",qc="offsetParent",rc="constructor",sc="userAgent",tc="location",uc="fontSize",vc="hasOwnProperty",x="style",wc="ownerDocument",xc="search",yc="lastChild",zc= "getUTCMonth",Ac="getYear",Bc="scrollWidth",y="start",Cc="random",Dc="setProperty",Ec="getFullYear",Fc="init",Gc="scrollLeft",Hc="bottom",Ic="href",Jc="setTime",Kc="rows",Lc="contains",Mc="apply",Nc="tagName",Pc="removeAttribute",Qc="getMinutes",Rc="label",Sc="display",Tc="offsetTop",A="height",Uc="offsetHeight",Vc="Range",Xc="execScript",Yc="nodeValue",Zc="right",C="push",$c="isEmpty",ad="valueOf",bd="test",cd="text",D="round",dd="slice",ed="nodeType",fd="load",gd="getElementById",hd="innerHTML", id="value",jd="item",ld="indexOf",E="color",md="compareDocumentPosition",nd="nodeName",od="createRange",G="left",pd="setMonth",qd="fromCharCode",rd="setFullYear",sd="atan2",td="children",ud="sqrt",vd="Format",wd="parentElement",H="type",xd="defaultView",yd="name",I="getValue",zd="clientX",Ad="clientY",Bd="setDate",Cd="scrollTop",Dd="getMonth",Ed="bold",J="length",K="prototype",Fd="className",Gd="clientWidth",Hd="document",Id="getSeconds",Jd="getUTCDate",Kd="opacity",Ld="getMilliseconds",Md="visualization", Nd="disabled",Od="offsetLeft",Pd="body",Qd="removeChild",L="call",Rd="lastIndexOf",Sd="getAttribute",Td="querySelectorAll",Ud="setUTCMonth",Wd="clientHeight",Xd="charCodeAt",Yd="compatMode",Zd="sort",$d="currentStyle",ae="substring",be="documentMode",ce="every",de="getUTCMinutes",ee="getUTCHours",fe="parentNode",ge="toUpperCase",he="splice",ie="join",je="unshift",ke="toLowerCase",le="getTimezoneOffset",O="",me="\n",ne=" ",aaa=" and ",baa=" does not match type ",caa=' name="',daa=' type="',oe='"', pe='" />',qe="#",eaa="#$1$1$2$2$3$3",re="#000000",se="#808080",te="#fff",ue="#ffffff",ve="$",faa="$1",we="%",xe="&",ye="&#39;",ze="&amp;",gaa="&client=google-gviz",Ae="&gt;",Be="&lt;",De="&quot;",Ee="'",haa="''",Fe="(",iaa="(^",Ge=")",jaa=")([a-z])",He="*",Ie="+",Je=",",Ke=", ",Le="-",kaa="-moz",laa="-ms",maa="-o",naa="-transform",oaa="-webkit",Me=".",Ne="...",paa='.png" height="12" width="',qaa="//ajax.googleapis.com/ajax",raa="/static/modules/gviz/",saa="/util/bar_",taa="/util/format.css",Oe="0", Pe="0.5",Qe="0.6",Re="00",Se="000",uaa="0000000000000000",Te="1",vaa="1.0",waa="1.9",Ue="10",Ve="3",We="9",Xe=":",Ye=";",Ze="<",xaa="</span>\u00a0",yaa="</table>",zaa="</tr>",$e="<br>",Aaa='<img style="padding: 0" src="',Baa='<span style="padding: 0; float: left; white-space: nowrap;">',Caa="<table>",Daa="<td>&nbsp;</td>",Eaa="<td></td>",Faa="<tr>",af="=",bf=">",cf="?",Gaa="@",df="A",Haa="APPLET",Iaa="AREA",Jaa="BASE",ef="BR",ff="BUTTON",Kaa="COL",Laa="COMMAND",gf="CSS1Compat",Maa="Can't combine significant digits and minimum fraction digits", hf="Container is not defined",jf="DAY",kf="DIV",Naa="Date(",lf="December",mf="E",Oaa="EMBED",Paa="Etc/GMT",nf="F",Qaa="FRAME",of="February",Raa="G",Saa="GMT",Taa="H",Uaa="HOUR",pf="HR",Vaa="IFRAME",Waa="IMG",qf="INPUT",Xaa="ISINDEX",Yaa="JavaScript",Zaa="K",$aa="KEYGEN",rf="L",aba="LINK",sf="M",bba="META",tf="MILLISECOND",cba="MINUTE",uf="MMM d",vf="MONTH",wf="MSIE",dba="Moz",eba="MozOpacity",xf="N",fba="NOFRAMES",gba="NOSCRIPT",yf="November",zf="O",hba="OBJECT",iba="PARAM",Af="Q",jba="Q yyyy",Bf= "QUARTER",Cf="S",Df="SCRIPT",kba="SECOND",Ef="SELECT",Ff="SOURCE",lba="STYLE",mba="SVG",If="Saturday",Kf="September",nba="Style",Lf="T",Mf="TEXTAREA",Nf="TL",Of="TR",oba="TRACK",Pf="Thursday",pba="Too many percent/permill",qba="Type mismatch. Value ",rba="UTC",sba="Uneven number of arguments",Qf="W",tba="WBR",uba="WEEK",vba="Webkit",Rf="Wednesday",wba="Width",Sf="YEAR",Vf="Z",xba="[",yba="[object Array]",zba="[object Function]",Aba="[object Window]",Bba="\\",Cba="\\$1",Yf="\\\\",Zf="\\s",Dba="\\u", Eba="\\x08",$f="]",Fba="]+",Gba="_bar_format_old_value",ag="_default_",bg="a",cg="absolute",Hba="alpha(opacity=",Iba="amp",Jba="aria-",dg="array",eg="auto",fg="b",gg="background-color:",Kba="bar.groupWidth",hg="body",jg="boolean",Lba="borderBottom",Mba="borderBottomWidth",Nba="borderLeft",Oba="borderLeftWidth",Pba="borderRight",Qba="borderRightWidth",Rba="borderTop",Sba="borderTopWidth",kg="both",lg="c",Tba="call",Uba="callee",Vba="class",Wba="className",Xba="clearMinutes",Yba="color:",mg="column", Zba="columnFilters[",$ba="compare",ng="d",aca="data-",og="date",pg="datetime",bca="decimalSymbol",cca="desc",qg="direction",rg="display",Q="div",dca="document",vg="f",wg="false",xg="filter",yg="fixed",zg="focus",eca="for",fca="formatType",gca="fractionDigits",Ag="full",Bg="function",Cg="g",hca="google-visualization-formatters-arrow-dr",ica="google-visualization-formatters-arrow-empty",jca="google-visualization-formatters-arrow-ug",kca="google.loader.GoogleApisBase",lca="google.maps.DirectionsService", mca="google.visualization.",nca="google.visualization.ModulePath",oca="google.visualization.NumberFormat",pca="google.visualization.Version",qca="groupingSymbol",rca="gt",Dg="h",Eg="h:mm a",Fg="h:mm:ss a",Gg="head",Hg="height",sca="hex",Ig="hidden",Jg="horizontal",Kg="href",Mg="html",Ng="https",Og="inline",tca="innerText",Pg="k",Qg="left",Rg="link",Sg="long",uca="lt",Tg="m",vca="maps",Ug="maxValue",Vg="medium",Wg="minValue",wca="ms",xca="named",yca="native code",zca="negativeColor",Aca="negativeParens", Bca="new ",R="none",Xg="null",Yg="number",Zg="o",$g="object",ah="on",bh="opacity",Cca="outerHTML",ch="overflow",Dca="paddingBottom",Eca="paddingLeft",Fca="paddingRight",Gca="paddingTop",dh="pattern",Hca="pixelHeight",Ica="pixelLeft",Jca="pixelWidth",eh="position",Kca="prefix",S="px",Lca="quot",fh="r",gh="relative",hh="rgb",ih="role",jh="rtl",kh="s",Mca="scaleFactor",lh="script",mh="selection",Nca="sensor=false",nh="short",oh="single",ph="solid",Oca="sortColumns",Pca="sortColumns[",Qca="sourceIndex", Rca="splice",qh="static",rh="string",sh="style",Sca="stylesheet",th="suffix",Tca="tabIndex",Uca="tabindex",Vca="text/css",uh="text/javascript",Wca="textContent",vh="time",Xca="timeZone",wh="timeofday",xh="transform",yh="transparent",zh="true",Ah="type",Bh="unselectable",Ch="v",Dh="value",Yca="valueType",Zca="var ",$ca="var _et_ = 1;",Eh="vertical",Fh="visible",ada="visualization",Gh="w",Hh="white",Ih="width",Jh="y",Kh="z",Lh="{",bda="{0}",cda="{1}",dda="|[",Mh="}",Nh="\u00a0",eda="\u00a4",fda="\u2030", T,Oh=Oh||{},Ph=this;function Qh(a){return void 0!==a}function V(a,b,c){a=a[pc](Me);c=c||Ph;a[0]in c||!c[Xc]||c[Xc](Zca+a[0]);for(var d;a[J]&&(d=a[rb]());)!a[J]&&Qh(b)?c[d]=b:c=c[d]?c[d]:c[d]={}}function Sh(a,b){for(var c=a[pc](Me),d=b||Ph,e;e=c[rb]();)if(null!=d[e])d=d[e];else return null;return d}function Th(){}function Uh(a){a.Xb=function(){return a.Xca?a.Xca:a.Xca=new a}} function Vh(a){var b=typeof a;if(b==$g)if(a){if(a instanceof ha)return dg;if(a instanceof da)return b;var c=da[K][hc][L](a);if(c==Aba)return $g;if(c==yba||typeof a[J]==Yg&&"undefined"!=typeof a[he]&&"undefined"!=typeof a[ic]&&!a[ic](Rca))return dg;if(c==zba||"undefined"!=typeof a[L]&&"undefined"!=typeof a[ic]&&!a[ic](Tba))return Bg}else return Xg;else if(b==Bg&&"undefined"==typeof a[L])return $g;return b}function Wh(a){return null===a}function Xh(a){return null!=a} function Yh(a){return Vh(a)==dg}function Zh(a){var b=Vh(a);return b==dg||b==$g&&typeof a[J]==Yg}function $h(a){return ai(a)&&typeof a[Ec]==Bg}function bi(a){return typeof a==rh}function ci(a){return typeof a==jg}function di(a){return typeof a==Yg}function ei(a){return Vh(a)==Bg}function ai(a){var b=typeof a;return b==$g&&null!=a||b==Bg}function fi(a){return a[gda]||(a[gda]=++hda)}var gda="closure_uid_"+(1E9*h[Cc]()>>>0),hda=0;function ida(a,b,c){return a[L][Mc](a[Zb],arguments)} function jda(a,b,c){if(!a)throw m();if(2<arguments[J]){var d=ha[K][dd][L](arguments,2);return function(){var c=ha[K][dd][L](arguments);ha[K][je][Mc](c,d);return a[Mc](b,c)}}return function(){return a[Mc](b,arguments)}}function W(a,b,c){W=Function[K][Zb]&&-1!=Function[K][Zb][hc]()[ld](yca)?ida:jda;return W[Mc](null,arguments)}function gi(a,b){var c=ha[K][dd][L](arguments,1);return function(){var b=c[dd]();b[C][Mc](b,arguments);return a[Mc](this,b)}}var hi=Date.now||function(){return+new Date}; function kda(a){if(Ph[Xc])Ph[Xc](a,Yaa);else if(Ph.eval)if(null==ii&&(Ph.eval($ca),"undefined"!=typeof Ph._et_?(delete Ph._et_,ii=!0):ii=!1),ii)Ph.eval(a);else{var b=Ph[Hd],c=b[Qb](lh);ab(c,uh);c.defer=!1;c[p](b[Cb](a));b[Pd][p](c);b[Pd][Qd](c)}else throw m("goog.globalEval not available");}var ii=null;function X(a,b){function c(){}kb(c,b[K]);a.e=b[K];kb(a,new c);Ia(a[K],a);a.Ud=function(a,c,f){var g=ha[K][dd][L](arguments,2);return b[K][c][Mc](a,g)}};var google=google||ca.google||{};function ji(a){if(m.captureStackTrace)m.captureStackTrace(this,ji);else{var b=m().stack;b&&(this.stack=b)}a&&Ka(this,String(a))}X(ji,m);eb(ji[K],"CustomError");var lda;function ki(a,b){return 0==a[Rd](b,0)}function mda(a){var b=a[J]-1;return 0<=b&&a[ld](we,b)==b}function li(a){return/^[\s\xa0]*$/[bd](a)}function mi(a){return li(ni(a))}function oi(a){return!/[^0-9]/[bd](a)}function nda(a){return a[vb](/[\t\r\n ]+/g,ne)[vb](/^[\t\r\n ]+|[\t\r\n ]+$/g,O)}function pi(a){return a[vb](/^[\s\xa0]+|[\s\xa0]+$/g,O)} function qi(a,b){if(b)return a[vb](oda,ze)[vb](pda,Be)[vb](qda,Ae)[vb](rda,De)[vb](sda,ye);if(!tda[bd](a))return a;-1!=a[ld](xe)&&(a=a[vb](oda,ze));-1!=a[ld](Ze)&&(a=a[vb](pda,Be));-1!=a[ld](bf)&&(a=a[vb](qda,Ae));-1!=a[ld](oe)&&(a=a[vb](rda,De));-1!=a[ld](Ee)&&(a=a[vb](sda,ye));return a}var oda=/&/g,pda=/</g,qda=/>/g,rda=/"/g,sda=/'/g,tda=/[&<>"']/;function uda(a){return ri(a,xe)?dca in Ph?vda(a):wda(a):a} function vda(a){var b={"&amp;":xe,"&lt;":Ze,"&gt;":bf,"&quot;":oe},c;c=fa[Qb](Q);return a[vb](xda,function(a,e){var f=b[a];if(f)return f;if(e[Bb](0)==qe){var g=ia(Oe+e[ec](1));ga(g)||(f=String[qd](g))}f||(Wa(c,a+ne),f=c[Sb][Yc][dd](0,-1));return b[a]=f})}function wda(a){return a[vb](/&([^;]+);/g,function(a,c){switch(c){case Iba:return xe;case uca:return Ze;case rca:return bf;case Lca:return oe;default:if(c[Bb](0)==qe){var d=ia(Oe+c[ec](1));if(!ga(d))return String[qd](d)}return a}})}var xda=/&([^;\s<&]+);?/g; function si(a,b){a[J]>b&&(a=a[ae](0,b-3)+Ne);return a}function ri(a,b){return-1!=a[ld](b)}function ti(a,b){return ha(b+1)[ie](a)}function ui(a,b){var c=Qh(void 0)?a[wb](void 0):String(a),d=c[ld](Me);-1==d&&(d=c[J]);return ti(Oe,h.max(0,b-d))+c}function ni(a){return null==a?O:String(a)}function yda(a){return ha[K][ie][L](arguments,O)} function vi(a,b){for(var c=0,d=pi(String(a))[pc](Me),e=pi(String(b))[pc](Me),f=h.max(d[J],e[J]),g=0;0==c&&g<f;g++){var k=d[g]||O,l=e[g]||O,n=/(\d*)(\D*)/g,q=/(\d*)(\D*)/g;do{var s=n[sb](k)||[O,O,O],u=q[sb](l)||[O,O,O];if(0==s[0][J]&&0==u[0][J])break;c=wi(0==s[1][J]?0:la(s[1],10),0==u[1][J]?0:la(u[1],10))||wi(0==s[2][J],0==u[2][J])||wi(s[2],u[2])}while(0==c)}return c}function wi(a,b){return a<b?-1:a>b?1:0}function xi(a){for(var b=0,c=0;c<a[J];++c)b=31*b+a[Xd](c),b%=4294967296;return b} var zda=2147483648*h[Cc]()|0;function yi(a){var b=ia(a);return 0==b&&li(a)?ja:b}function zi(a){return String(a)[vb](/\-([a-z])/g,function(a,c){return c[ge]()})}function Ada(a){var b=bi(void 0)?"undefined"[vb](/([-()\[\]{}+?*.$\^|,:#<!\\])/g,Cba)[vb](/\x08/g,Eba):Zf;return a[vb](new RegExp(iaa+(b?dda+b+Fba:O)+jaa,Cg),function(a,b,e){return b+e[ge]()})};function Ai(a){return a[a[J]-1]}var Bi=ha[K],Ci=Bi[ld]?function(a,b,c){return Bi[ld][L](a,b,c)}:function(a,b,c){c=null==c?0:0>c?h.max(0,a[J]+c):c;if(bi(a))return bi(b)&&1==b[J]?a[ld](b,c):-1;for(;c<a[J];c++)if(c in a&&a[c]===b)return c;return-1},Y=Bi[Tb]?function(a,b,c){Bi[Tb][L](a,b,c)}:function(a,b,c){for(var d=a[J],e=bi(a)?a[pc](O):a,f=0;f<d;f++)f in e&&b[L](c,e[f],f,a)};function Ei(a,b,c){for(var d=a[J],e=bi(a)?a[pc](O):a,d=d-1;0<=d;--d)d in e&&b[L](c,e[d],d,a)} var Fi=Bi[ob]?function(a,b,c){return Bi[ob][L](a,b,c)}:function(a,b,c){for(var d=a[J],e=[],f=0,g=bi(a)?a[pc](O):a,k=0;k<d;k++)if(k in g){var l=g[k];b[L](c,l,k,a)&&(e[f++]=l)}return e},Gi=Bi.map?function(a,b,c){return Bi.map[L](a,b,c)}:function(a,b,c){for(var d=a[J],e=ha(d),f=bi(a)?a[pc](O):a,g=0;g<d;g++)g in f&&(e[g]=b[L](c,f[g],g,a));return e},Hi=Bi.reduce?function(a,b,c,d){d&&(b=W(b,d));return Bi.reduce[L](a,b,c)}:function(a,b,c,d){var e=c;Y(a,function(c,g){e=b[L](d,e,c,g,a)});return e},Mi=Bi.some? function(a,b,c){return Bi.some[L](a,b,c)}:function(a,b,c){for(var d=a[J],e=bi(a)?a[pc](O):a,f=0;f<d;f++)if(f in e&&b[L](c,e[f],f,a))return!0;return!1},Ni=Bi[ce]?function(a,b,c){return Bi[ce][L](a,b,c)}:function(a,b,c){for(var d=a[J],e=bi(a)?a[pc](O):a,f=0;f<d;f++)if(f in e&&!b[L](c,e[f],f,a))return!1;return!0};function Oi(a,b){var c=Pi(a,b,void 0);return 0>c?null:bi(a)?a[Bb](c):a[c]}function Pi(a,b,c){for(var d=a[J],e=bi(a)?a[pc](O):a,f=0;f<d;f++)if(f in e&&b[L](c,e[f],f,a))return f;return-1} function Qi(a,b){var c;t:{var d=a[J];c=bi(a)?a[pc](O):a;for(d-=1;0<=d;d--)if(d in c&&b[L](void 0,c[d],d,a)){c=d;break t}c=-1}return 0>c?null:bi(a)?a[Bb](c):a[c]}function Ri(a,b){return 0<=Ci(a,b)}function Si(a){return 0==a[J]}function Ti(a){if(!Yh(a))for(var b=a[J]-1;0<=b;b--)delete a[b];jb(a,0)}function Ui(a,b,c){Vi(a,c,0,b)}function Wi(a,b){var c=Ci(a,b),d;(d=0<=c)&&Bi[he][L](a,c,1);return d}function Xi(a){return Bi[Ab][Mc](Bi,arguments)} function Yi(a){var b=a[J];if(0<b){for(var c=ha(b),d=0;d<b;d++)c[d]=a[d];return c}return[]}function Zi(a,b){for(var c=1;c<arguments[J];c++){var d=arguments[c],e;if(Yh(d)||(e=Zh(d))&&da[K][vc][L](d,Uba))a[C][Mc](a,d);else if(e)for(var f=a[J],g=d[J],k=0;k<g;k++)a[f+k]=d[k];else a[C](d)}}function Vi(a,b,c,d){return Bi[he][Mc](a,$i(arguments,1))}function $i(a,b,c){return 2>=arguments[J]?Bi[dd][L](a,b):Bi[dd][L](a,b,c)} function Bda(a){for(var b={},c=0,d=0;d<a[J];){var e=a[d++],f=ai(e)?Zg+fi(e):(typeof e)[Bb](0)+e;da[K][vc][L](b,f)||(b[f]=!0,a[c++]=e)}jb(a,c)}function aj(a,b,c){return Cda(a,c||bj,!1,b)}function Dda(a,b,c){return Cda(a,b,!0,void 0,c)}function Cda(a,b,c,d,e){for(var f=0,g=a[J],k;f<g;){var l=f+g>>1,n;n=c?b[L](e,a[l],l,a):b(d,a[l]);0<n?f=l+1:(g=l,k=!n)}return k?f:~f}function cj(a,b){a[Zd](b||bj)} function dj(a,b){for(var c=0;c<a[J];c++)a[c]={index:c,value:a[c]};var d=b||bj;cj(a,function(a,b){return d(a[id],b[id])||a[nc]-b[nc]});for(c=0;c<a[J];c++)a[c]=a[c][id]}function Eda(a){var b=bj;cj(a,function(a,d){return b(a.x,d.x)})}function ej(a,b){if(!Zh(a)||!Zh(b)||a[J]!=b[J])return!1;for(var c=a[J],d=Fda,e=0;e<c;e++)if(!d(a[e],b[e]))return!1;return!0}function bj(a,b){return a>b?1:a<b?-1:0}function Fda(a,b){return a===b} function Gda(a,b){for(var c={},d=0;d<a[J];d++){var e=a[d],f=b[L](void 0,e,d,a);Qh(f)&&(c[f]||(c[f]=[]))[C](e)}return c}function fj(a){var b=[];if(0>1*(a-0))return[];for(var c=0;c<a;c+=1)b[C](c);return b}function gj(a,b){for(var c=[],d=0;d<b;d++)c[d]=a;return c}function ij(a){for(var b=[],c=0;c<arguments[J];c++){var d=arguments[c];Yh(d)?b[C][Mc](b,ij[Mc](null,d)):b[C](d)}return b} function Hda(a){if(!arguments[J])return[];for(var b=[],c=0;;c++){for(var d=[],e=0;e<arguments[J];e++){var f=arguments[e];if(c>=f[J])return b;d[C](f[c])}b[C](d)}};function jj(a){return function(){return a}}var Ida=jj(!0),Jda=jj(null);function kj(a){return a}function Kda(a){return function(){throw a;}}function Lda(a){var b;b=b||0;return function(){return a[Mc](this,ha[K][dd][L](arguments,0,b))}};function nj(a,b,c){return h.min(h.max(a,b),c)}function oj(a,b){var c=a%b;return 0>c*b?c+b:c}function pj(a,b,c){return a+c*(b-a)}function qj(a){return a*h.PI/180}function rj(a,b){return b*h.cos(qj(a))}function sj(a,b){return b*h.sin(qj(a))}function tj(a,b,c,d){return oj(180*h[sd](d-b,c-a)/h.PI,360)}function uj(a){return 0==a?0:0>a?-1:1}function Mda(a){return Hi(arguments,function(a,c){return a+c},0)}function vj(a){return Mda[Mc](null,arguments)/arguments[J]}function wj(a){return na(a)&&0==a%1} function xj(a){return na(a)&&!ga(a)};var yj="StopIteration"in Ph?Ph.StopIteration:m("StopIteration");function zj(){}Ga(zj[K],function(){throw yj;});zj[K].fs=function(){return this};function Aj(a){if(a instanceof zj)return a;if(typeof a.fs==Bg)return a.fs(!1);if(Zh(a)){var b=0,c=new zj;Ga(c,function(){for(;;){if(b>=a[J])throw yj;if(b in a)return a[b++];b++}});return c}throw m("Not implemented");} function Bj(a,b,c){if(Zh(a))try{Y(a,b,c)}catch(d){if(d!==yj)throw d;}else{a=Aj(a);try{for(;;)b[L](c,a[oc](),void 0,a)}catch(e){if(e!==yj)throw e;}}}function Cj(a,b,c){var d=0,e=a,f=c||1;1<arguments[J]&&(d=a,e=b);if(0==f)throw m("Range step argument must not be zero");var g=new zj;Ga(g,function(){if(0<f&&d>=e||0>f&&d<=e)throw yj;var a=d;d+=f;return a});return g}function Nda(a,b,c){var d=Aj(a);a=new zj;Ga(a,function(){var a=d[oc]();return b[L](c,a,void 0,d)});return a} function Oda(a){var b=Aj(arguments),c=new zj,d=null;Ga(c,function(){for(;;){if(null==d){var a=b[oc]();d=Aj(a)}try{return d[oc]()}catch(c){if(c!==yj)throw c;d=null}}});return c}function Pda(a){if(Zh(a))return Yi(a);a=Aj(a);var b=[];Bj(a,function(a){b[C](a)});return b}function Qda(a){try{return Aj(a)[oc]()}catch(b){if(b!=yj)throw b;return null}};function Dj(a,b,c){for(var d in a)b[L](c,a[d],d,a)}function Ej(a,b,c){var d={},e;for(e in a)d[e]=b[L](c,a[e],e,a);return d}function Fj(a,b){for(var c in a)if(b[L](void 0,a[c],c,a))return!0;return!1}function Rda(a,b,c){for(var d in a)if(!b[L](c,a[d],d,a))return!1;return!0}function Sda(a){var b=0,c;for(c in a)b++;return b}function Gj(a){for(var b in a)return a[b]}function Hj(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b}function Ij(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b} function Jj(a,b){for(var c in a)if(a[c]==b)return!0;return!1}function Kj(a){for(var b in a)return!1;return!0}function Lj(a,b){b in a&&delete a[b]}function Mj(a,b,c){if(b in a)throw m('The object already contains the key "'+b+oe);a[b]=c}function Nj(a,b){return b in a?a[b]:void 0}function Oj(a,b,c){return b in a?a[b]:a[b]=c}function Pj(a){var b={},c;for(c in a)b[c]=a[c];return b} function Qj(a){var b=Vh(a);if(b==$g||b==dg){if(a.o)return a.o();var b=b==dg?[]:{},c;for(c in a)b[c]=Qj(a[c]);return b}return a}function Rj(a){var b={},c;for(c in a)b[a[c]]=c;return b}var Tda="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Sj(a,b){for(var c,d,e=1;e<arguments[J];e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<Tda[J];f++)c=Tda[f],da[K][vc][L](d,c)&&(a[c]=d[c])}} function Uda(a){var b=arguments[J];if(1==b&&Yh(arguments[0]))return Uda[Mc](null,arguments[0]);if(b%2)throw m(sba);for(var c={},d=0;d<b;d+=2)c[arguments[d]]=arguments[d+1];return c}function Tj(a){var b=arguments[J];if(1==b&&Yh(arguments[0]))return Tj[Mc](null,arguments[0]);for(var c={},d=0;d<b;d++)c[arguments[d]]=!0;return c};function Uj(a,b){this.ab={};this.Yd=[];this.Tx=this.Mb=0;var c=arguments[J];if(1<c){if(c%2)throw m(sba);for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.Q0(a)}T=Uj[K];T.Lc=function(){return this.Mb};T.La=function(){Vj(this);for(var a=[],b=0;b<this.Yd[J];b++)a[C](this.ab[this.Yd[b]]);return a};T.hk=function(){Vj(this);return this.Yd[Ab]()};T.$e=function(a){return Wj(this.ab,a)};T.$R=function(a){for(var b=0;b<this.Yd[J];b++){var c=this.Yd[b];if(Wj(this.ab,c)&&this.ab[c]==a)return!0}return!1}; Za(T,function(a,b){if(this===a)return!0;if(this.Mb!=a.Lc())return!1;var c=b||Vda;Vj(this);for(var d,e=0;d=this.Yd[e];e++)if(!c(this.get(d),a.get(d)))return!1;return!0});function Vda(a,b){return a===b}Ua(T,function(){return 0==this.Mb});wa(T,function(){this.ab={};jb(this.Yd,0);this.Tx=this.Mb=0});va(T,function(a){return Wj(this.ab,a)?(delete this.ab[a],this.Mb--,this.Tx++,this.Yd[J]>2*this.Mb&&Vj(this),!0):!1}); function Vj(a){if(a.Mb!=a.Yd[J]){for(var b=0,c=0;b<a.Yd[J];){var d=a.Yd[b];Wj(a.ab,d)&&(a.Yd[c++]=d);b++}jb(a.Yd,c)}if(a.Mb!=a.Yd[J]){for(var e={},c=b=0;b<a.Yd[J];)d=a.Yd[b],Wj(e,d)||(a.Yd[c++]=d,e[d]=1),b++;jb(a.Yd,c)}}T.get=function(a,b){return Wj(this.ab,a)?this.ab[a]:b};T.set=function(a,b){Wj(this.ab,a)||(this.Mb++,this.Yd[C](a),this.Tx++);this.ab[a]=b};T.Q0=function(a){var b;a instanceof Uj?(b=a.hk(),a=a.La()):(b=Ij(a),a=Hj(a));for(var c=0;c<b[J];c++)this.set(b[c],a[c])}; T.forEach=function(a,b){for(var c=this.hk(),d=0;d<c[J];d++){var e=c[d],f=this.get(e);a[L](b,f,e,this)}};T.o=function(){return new Uj(this)};T.transpose=function(){for(var a=new Uj,b=0;b<this.Yd[J];b++){var c=this.Yd[b];a.set(this.ab[c],c)}return a};T.fs=function(a){Vj(this);var b=0,c=this.Yd,d=this.ab,e=this.Tx,f=this,g=new zj;Ga(g,function(){for(;;){if(e!=f.Tx)throw m("The map has changed since the iterator was created");if(b>=c[J])throw yj;var g=c[b++];return a?g:d[g]}});return g}; function Wj(a,b){return da[K][vc][L](a,b)};function Wda(a){return typeof a.Lc==Bg?a.Lc():Zh(a)||bi(a)?a[J]:Sda(a)}function Xj(a){if(typeof a.La==Bg)return a.La();if(bi(a))return a[pc](O);if(Zh(a)){for(var b=[],c=a[J],d=0;d<c;d++)b[C](a[d]);return b}return Hj(a)}function ak(a){if(typeof a.hk==Bg)return a.hk();if(typeof a.La!=Bg){if(Zh(a)||bi(a)){var b=[];a=a[J];for(var c=0;c<a;c++)b[C](c);return b}return Ij(a)}} function bk(a,b,c){if(typeof a[Tb]==Bg)a[Tb](b,c);else if(Zh(a)||bi(a))Y(a,b,c);else for(var d=ak(a),e=Xj(a),f=e[J],g=0;g<f;g++)b[L](c,e[g],d&&d[g],a)}function Xda(a,b,c){if(typeof a[ob]==Bg)return a[ob](b,c);if(Zh(a)||bi(a))return Fi(a,b,c);var d,e=ak(a),f=Xj(a),g=f[J];if(e){d={};for(var k=0;k<g;k++)b[L](c,f[k],e[k],a)&&(d[e[k]]=f[k])}else for(d=[],k=0;k<g;k++)b[L](c,f[k],void 0,a)&&d[C](f[k]);return d} function Yda(a,b,c){if(typeof a.map==Bg)return a.map(b,c);if(Zh(a)||bi(a))return Gi(a,b,c);var d,e=ak(a),f=Xj(a),g=f[J];if(e){d={};for(var k=0;k<g;k++)d[e[k]]=b[L](c,f[k],e[k],a)}else for(d=[],k=0;k<g;k++)d[k]=b[L](c,f[k],void 0,a);return d}function Zda(a,b,c){if(typeof a[ce]==Bg)return a[ce](b,c);if(Zh(a)||bi(a))return Ni(a,b,c);for(var d=ak(a),e=Xj(a),f=e[J],g=0;g<f;g++)if(!b[L](c,e[g],d&&d[g],a))return!1;return!0};function ck(a){this.ab=new Uj;a&&this.Q0(a)}function dk(a){var b=typeof a;return b==$g&&a||b==Bg?Zg+fi(a):b[ec](0,1)+a}T=ck[K];T.Lc=function(){return this.ab.Lc()};T.add=function(a){this.ab.set(dk(a),a)};T.Q0=function(a){a=Xj(a);for(var b=a[J],c=0;c<b;c++)this.add(a[c])};T.oc=function(a){a=Xj(a);for(var b=a[J],c=0;c<b;c++)this[Ob](a[c])};va(T,function(a){return this.ab[Ob](dk(a))});wa(T,function(){this.ab[Wb]()});Ua(T,function(){return this.ab[$c]()});Pa(T,function(a){return this.ab.$e(dk(a))}); T.Ky=function(a){var b=new ck;a=Xj(a);for(var c=0;c<a[J];c++){var d=a[c];this[Lc](d)&&b.add(d)}return b};T.Il=function(a){var b=this.o();b.oc(a);return b};T.La=function(){return this.ab.La()};T.o=function(){return new ck(this)};Za(T,function(a){return this.Lc()==Wda(a)&&this.rS(a)});T.rS=function(a){var b=Wda(a);if(this.Lc()>b)return!1;!(a instanceof ck)&&5<b&&(a=new ck(a));return Zda(this,function(b){var d=a;return typeof d[Lc]==Bg?d[Lc](b):typeof d.$R==Bg?d.$R(b):Zh(d)||bi(d)?Ri(d,b):Jj(d,b)})}; T.fs=function(){return this.ab.fs(!1)};var ek;t:{var $da=Ph.navigator;if($da){var aea=$da[sc];if(aea){ek=aea;break t}}ek=O};var fk,gk,hk,bea;function ik(){return Ph.navigator||null}var jk=ri(ek,"Opera")||ri(ek,"OPR"),kk=ri(ek,"Trident")||ri(ek,wf),lk=ri(ek,"Gecko")&&!ri(ek[ke](),"webkit")&&!(ri(ek,"Trident")||ri(ek,wf)),mk=ri(ek[ke](),"webkit"),cea=mk&&ri(ek,"Mobile"),dea=ik(),nk=dea&&dea.platform||O;fk=ri(nk,"Mac");gk=ri(nk,"Win");hk=ri(nk,"Linux");bea=!!ik()&&ri(ik().appVersion||O,"X11");var ok=ek;ok&&ri(ok,"Android");ok&&ri(ok,"iPhone");ok&&ri(ok,"iPad");function eea(){var a=Ph[Hd];return a?a[be]:void 0} var pk=function(){var a=O,b;if(jk&&Ph.opera)return a=Ph.opera.version,ei(a)?a():a;lk?b=/rv\:([^\);]+)(\)|;)/:kk?b=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:mk&&(b=/WebKit\/(\S+)/);b&&(a=(a=b[sb](ek))?a[1]:O);return kk&&(b=eea(),b>ma(a))?String(b):a}(),fea={};function qk(a){return fea[a]||(fea[a]=0<=vi(pk,a))}function rk(a){return kk&&gea>=a}var hea=Ph[Hd],gea=hea&&kk?eea()||(hea[Yd]==gf?la(pk,10):5):void 0;function sk(a,b){this.x=Qh(a)?a:0;this.y=Qh(b)?b:0}T=sk[K];T.o=function(){return new sk(this.x,this.y)};function tk(a,b){return a==b?!0:a&&b?a.x==b.x&&a.y==b.y:!1}function uk(a,b){var c=a.x-b.x,d=a.y-b.y;return h[ud](c*c+d*d)}function vk(a,b){return new sk(a.x-b.x,a.y-b.y)}function wk(a,b){return new sk(a.x+b.x,a.y+b.y)}sa(T,function(){this.x=h[xb](this.x);this.y=h[xb](this.y);return this});ta(T,function(){this.x=h[t](this.x);this.y=h[t](this.y);return this}); Va(T,function(){this.x=h[D](this.x);this.y=h[D](this.y);return this});db(T,function(a,b){a instanceof sk?(this.x+=a.x,this.y+=a.y):(this.x+=a,di(b)&&(this.y+=b));return this});Oa(T,function(a,b){var c=di(b)?b:a;this.x*=a;this.y*=c;return this});function xk(a,b){pa(this,a);Sa(this,b)}function yk(a,b){return a==b?!0:a&&b?a[r]==b[r]&&a[A]==b[A]:!1}T=xk[K];T.o=function(){return new xk(this[r],this[A])};function zk(a){return h.min(a[r],a[A])}T.area=function(){return this[r]*this[A]};Ua(T,function(){return!this.area()});sa(T,function(){pa(this,h[xb](this[r]));Sa(this,h[xb](this[A]));return this});ta(T,function(){pa(this,h[t](this[r]));Sa(this,h[t](this[A]));return this});Va(T,function(){pa(this,h[D](this[r]));Sa(this,h[D](this[A]));return this}); Oa(T,function(a,b){var c=di(b)?b:a;pa(this,this[r]*a);Sa(this,this[A]*c);return this});var iea=!kk||rk(9),jea=!lk&&!kk||kk&&rk(9)||lk&&qk("1.9.1"),kea=kk&&!qk(We),lea=kk||jk||mk;function Ak(a){a=a[Fd];return bi(a)&&a[Ib](/\S+/g)||[]}function Bk(a,b){for(var c=Ak(a),d=$i(arguments,1),e=c[J]+d[J],f=c,g=0;g<d[J];g++)Ri(f,d[g])||f[C](d[g]);f=c[ie](ne);lb(a,f);return c[J]==e}function Ck(a,b){var c=Ak(a),d=$i(arguments,1),c=mea(c,d)[ie](ne);lb(a,c)}function mea(a,b){return Fi(a,function(a){return!Ri(b,a)})}function Dk(a,b,c){c?Bk(a,b):Ck(a,b)};function Ek(a){return a?new Fk(Gk(a)):lda||(lda=new Fk)}function Hk(a){return bi(a)?fa[gd](a):a}function Ik(a,b,c){return Jk(fa,a,b,c)}function Mk(a,b){var c=b||fa;return c[Td]&&c[Pb]?c[Td](Me+a):Jk(fa,He,a,b)}function Nk(a,b){var c=b||fa,d=null;return(d=c[Td]&&c[Pb]?c[Pb](Me+a):Jk(fa,He,a,b)[0])||null} function Jk(a,b,c,d){a=d||a;b=b&&b!=He?b[ge]():O;if(a[Td]&&a[Pb]&&(b||c))return a[Td](b+(c?Me+c:O));if(c&&a.getElementsByClassName){a=a.getElementsByClassName(c);if(b){d={};for(var e=0,f=0,g;g=a[f];f++)b==g[nd]&&(d[e++]=g);jb(d,e);return d}return a}a=a[cc](b||He);if(c){d={};for(f=e=0;g=a[f];f++)b=g[Fd],typeof b[pc]==Bg&&Ri(b[pc](/\s+/),c)&&(d[e++]=g);jb(d,e);return d}return a} function Ok(a,b){Dj(b,function(b,d){d==sh?$a(a[x],b):d==Vba?lb(a,b):d==eca?a.htmlFor=b:d in nea?a[v](nea[d],b):ki(d,Jba)||ki(d,aca)?a[v](d,b):a[d]=b})}var nea={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:Hg,maxlength:"maxLength",role:ih,rowspan:"rowSpan",type:Ah,usemap:"useMap",valign:"vAlign",width:Ih};function Pk(a){a=a[Hd];a=a[Yd]==gf?a[dc]:a[Pd];return new xk(a[Gd],a[Wd])}function oea(a){return mk||a[Yd]!=gf?a[Pd]||a[dc]:a[dc]} function Qk(a){return a?a.parentWindow||a[xd]:ca}function Rk(a,b,c){return pea(fa,arguments)}function pea(a,b){var c=b[0],d=b[1];if(!iea&&d&&(d[yd]||d[H])){c=[Ze,c];d[yd]&&c[C](caa,qi(d[yd]),oe);if(d[H]){c[C](daa,qi(d[H]),oe);var e={};Sj(e,d);delete e[H];d=e}c[C](bf);c=c[ie](O)}c=a[Qb](c);d&&(bi(d)?lb(c,d):Yh(d)?Bk[Mc](null,[c][Ab](d)):Ok(c,d));2<b[J]&&qea(a,c,b,2);return c} function qea(a,b,c,d){function e(c){c&&b[p](bi(c)?a[Cb](c):c)}for(;d<c[J];d++){var f=c[d];Zh(f)&&!Sk(f)?Y(rea(f)?Yi(f):f,e):e(f)}}function Tk(a){return fa[Qb](a)}function Uk(a){if(1!=a[ed])return!1;switch(a[Nc]){case Haa:case Iaa:case Jaa:case ef:case Kaa:case Laa:case Oaa:case Qaa:case pf:case Waa:case qf:case Vaa:case Xaa:case $aa:case aba:case fba:case gba:case bba:case hba:case iba:case Df:case Ff:case lba:case oba:case tba:return!1}return!0}function sea(a,b){a[p](b)} function Vk(a,b){qea(Gk(a),a,arguments,1)}function Wk(a){for(var b;b=a[Sb];)a[Qd](b)}function Xk(a,b){b[fe]&&b[fe][Eb](a,b)}function Yk(a,b){b[fe]&&b[fe][Eb](a,b[ac])}function Zk(a){return a&&a[fe]?a[fe][Qd](a):null}function $k(a){return jea&&void 0!=a[td]?a[td]:Fi(a[Xb],function(a){return 1==a[ed]})}function al(a){return void 0!=a.firstElementChild?a.firstElementChild:tea(a[Sb])}function tea(a){for(;a&&1!=a[ed];)a=a[ac];return a}function Sk(a){return ai(a)&&0<a[ed]} function bl(a){return ai(a)&&1==a[ed]}function cl(a){var b;if(lea&&!(kk&&qk(We)&&!qk(Ue)&&Ph.SVGElement&&a instanceof Ph.SVGElement)&&(b=a[wd]))return b;b=a[fe];return bl(b)?b:null}function dl(a,b){if(a[Lc]&&1==b[ed])return a==b||a[Lc](b);if("undefined"!=typeof a[md])return a==b||ka(a[md](b)&16);for(;b&&a!=b;)b=b[fe];return b==a} function uea(a,b){if(a==b)return 0;if(a[md])return a[md](b)&2?1:-1;if(kk&&!rk(9)){if(9==a[ed])return-1;if(9==b[ed])return 1}if(Qca in a||a[fe]&&Qca in a[fe]){var c=1==a[ed],d=1==b[ed];if(c&&d)return a[mc]-b[mc];var e=a[fe],f=b[fe];return e==f?vea(a,b):!c&&dl(e,b)?-1*wea(a,b):!d&&dl(f,a)?wea(b,a):(c?a[mc]:e[mc])-(d?b[mc]:f[mc])}d=Gk(a);c=d[od]();c.selectNode(a);c[tb](!0);d=d[od]();d.selectNode(b);d[tb](!0);return c.compareBoundaryPoints(Ph[Vc].START_TO_END,d)} function wea(a,b){var c=a[fe];if(c==b)return-1;for(var d=b;d[fe]!=c;)d=d[fe];return vea(d,a)}function vea(a,b){for(var c=b;c=c[gc];)if(c==a)return-1;return 1}function Gk(a){return 9==a[ed]?a:a[wc]||a[Hd]}function el(a,b){if(Wca in a)a.textContent=b;else if(3==a[ed])ra(a,b);else if(a[Sb]&&3==a[Sb][ed]){for(;a[yc]!=a[Sb];)a[Qd](a[yc]);ra(a[Sb],b)}else{Wk(a);var c=Gk(a);a[p](c[Cb](String(b)))}}function xea(a){if(Cca in a)return a.outerHTML;var b=Gk(a)[Qb](Q);b[p](a.cloneNode(!0));return b[hd]} function yea(a,b){var c=[];return fl(a,b,c,!0)?c[0]:void 0}function zea(a,b){var c=[];fl(a,b,c,!1);return c}function fl(a,b,c,d){if(null!=a)for(a=a[Sb];a;){if(b(a)&&(c[C](a),d)||fl(a,b,c,d))return!0;a=a[ac]}return!1}var Aea={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},Bea={IMG:ne,BR:me};function gl(a,b){b?bb(a,0):(bb(a,-1),a[Pc](Tca))}function hl(a){a=a.getAttributeNode(Uca);return null!=a&&a.specified}function il(a){a=a.tabIndex;return di(a)&&0<=a&&32768>a} function jl(a){if(kea&&tca in a)a=a.innerText[vb](/(\r\n|\r|\n)/g,me);else{var b=[];kl(a,b,!0);a=b[ie](O)}a=a[vb](/ \xAD /g,ne)[vb](/\xAD/g,O);a=a[vb](/\u200B/g,O);kea||(a=a[vb](/ +/g,ne));a!=ne&&(a=a[vb](/^\s*/,O));return a}function ll(a){var b=[];kl(a,b,!1);return b[ie](O)}function kl(a,b,c){if(!(a[nd]in Aea))if(3==a[ed])c?b[C](String(a[Yc])[vb](/(\r\n|\r|\n)/g,O)):b[C](a[Yc]);else if(a[nd]in Bea)b[C](Bea[a[nd]]);else for(a=a[Sb];a;)kl(a,b,c),a=a[ac]} function rea(a){if(a&&typeof a[J]==Yg){if(ai(a))return typeof a[jd]==Bg||typeof a[jd]==rh;if(ei(a))return typeof a[jd]==Bg}return!1}function Cea(a){return ml(a,function(a){return a[nd]==mba&&!0},!0)}function ml(a,b,c){c||(a=a[fe]);for(c=0;a;){if(b(a))return a;a=a[fe];c++}return null}function nl(a){try{return a&&a[pb]}catch(b){}return null}function Fk(a){this.of=a||Ph[Hd]||fa}T=Fk[K];T.ea=Ek;T.$b=function(){return this.of};T.a=function(a){return bi(a)?this.of[gd](a):a}; T.Kv=function(a,b){return Nk(a,b||this.of)};T.kv=Ok;T.h=function(a,b,c){return pea(this.of,arguments)};T.createElement=function(a){return this.of[Qb](a)};T.createTextNode=function(a){return this.of[Cb](String(a))};T.Xda=function(a,b,c){var d=this.of,e=!!c;c=[Faa];for(var f=0;f<b;f++)c[C](e?Daa:Eaa);c[C](zaa);c=c[ie](O);b=[Caa];for(f=0;f<a;f++)b[C](c);b[C](yaa);a=d[Qb](kf);Wa(a,b[ie](O));return a[Qd](a[Sb])}; function ol(a,b){var c;var d=a.of;c=d[Qb](Q);kk?(Wa(c,$e+b),c[Qd](c[Sb])):Wa(c,b);if(1==c[Xb][J])c=c[Qd](c[Sb]);else{for(d=d.createDocumentFragment();c[Sb];)d[p](c[Sb]);c=d}return c}function pl(a){return a.of[Yd]==gf}T.xB=function(){var a=this.of;return a.parentWindow||a[xd]};function ql(a){var b=a.of;a=oea(b);b=b.parentWindow||b[xd];return kk&&qk(Ue)&&b.pageYOffset!=a[Cd]?new sk(a[Gc],a[Cd]):new sk(b.pageXOffset||a[Gc],b.pageYOffset||a[Cd])}T.bE=function(a){return nl(a||this.of)};T.appendChild=sea; T.append=Vk;T.cd=Wk;T.FX=Xk;T.zga=Yk;T.removeNode=Zk;T.$f=$k;T.n9=al;T.mK=Sk;T.Zia=bl;Pa(T,dl);T.yna=el;T.Jq=function(a){var b;(b=a[Nc]==df||a[Nc]==qf||a[Nc]==Mf||a[Nc]==Ef||a[Nc]==ff?!a[Nd]&&(!hl(a)||il(a)):hl(a)&&il(a))&&kk?(a=ei(a[qb])?a[qb]():{height:a[Uc],width:a[zb]},a=null!=a&&0<a[A]&&0<a[r]):a=b;return a};function Dea(){return mk?vba:lk?dba:kk?wca:jk?zf:null}function Eea(){return mk?oaa:lk?kaa:kk?laa:jk?maa:null};function rl(a,b,c,d){this.top=a;Ta(this,b);Na(this,c);Ya(this,d)}T=rl[K];T.o=function(){return new rl(this.top,this[Zc],this[Hc],this[G])};Pa(T,function(a){return this&&a?a instanceof rl?a[G]>=this[G]&&a[Zc]<=this[Zc]&&a.top>=this.top&&a[Hc]<=this[Hc]:a.x>=this[G]&&a.x<=this[Zc]&&a.y>=this.top&&a.y<=this[Hc]:!1}); T.expand=function(a,b,c,d){ai(a)?(this.top-=a.top,Ta(this,this[Zc]+a[Zc]),Na(this,this[Hc]+a[Hc]),Ya(this,this[G]-a[G])):(this.top-=a,Ta(this,this[Zc]+b),Na(this,this[Hc]+c),Ya(this,this[G]-d));return this};function tl(a,b){Ya(a,h.min(a[G],b[G]));a.top=h.min(a.top,b.top);Ta(a,h.max(a[Zc],b[Zc]));Na(a,h.max(a[Hc],b[Hc]))}function ul(a,b){return a[G]<=b[Zc]&&b[G]<=a[Zc]&&a.top<=b[Hc]&&b.top<=a[Hc]} sa(T,function(){this.top=h[xb](this.top);Ta(this,h[xb](this[Zc]));Na(this,h[xb](this[Hc]));Ya(this,h[xb](this[G]));return this});ta(T,function(){this.top=h[t](this.top);Ta(this,h[t](this[Zc]));Na(this,h[t](this[Hc]));Ya(this,h[t](this[G]));return this});Va(T,function(){this.top=h[D](this.top);Ta(this,h[D](this[Zc]));Na(this,h[D](this[Hc]));Ya(this,h[D](this[G]));return this}); db(T,function(a,b){a instanceof sk?(Ya(this,this[G]+a.x),Ta(this,this[Zc]+a.x),this.top+=a.y,Na(this,this[Hc]+a.y)):(Ya(this,this[G]+a),Ta(this,this[Zc]+a),di(b)&&(this.top+=b,Na(this,this[Hc]+b)));return this});Oa(T,function(a,b){var c=di(b)?b:a;Ya(this,this[G]*a);Ta(this,this[Zc]*a);this.top*=c;Na(this,this[Hc]*c);return this});function vl(a,b,c,d){Ya(this,a);this.top=b;pa(this,c);Sa(this,d)}T=vl[K];T.o=function(){return new vl(this[G],this.top,this[r],this[A])};function wl(a){return new rl(a.top,a[G]+a[r],a.top+a[A],a[G])}function xl(a){return new vl(a[G],a.top,a[Zc]-a[G],a[Hc]-a.top)}function yl(a,b){return a==b?!0:a&&b?a[G]==b[G]&&a[r]==b[r]&&a.top==b.top&&a[A]==b[A]:!1} T.Ky=function(a){var b=h.max(this[G],a[G]),c=h.min(this[G]+this[r],a[G]+a[r]);if(b<=c){var d=h.max(this.top,a.top);a=h.min(this.top+this[A],a.top+a[A]);if(d<=a)return Ya(this,b),this.top=d,pa(this,c-b),Sa(this,a-d),!0}return!1};function Fea(a,b){var c=h.max(a[G],b[G]),d=h.min(a[G]+a[r],b[G]+b[r]);if(c<=d){var e=h.max(a.top,b.top),f=h.min(a.top+a[A],b.top+b[A]);if(e<=f)return new vl(c,e,d-c,f-e)}return null} T.Il=function(a){var b=Fea(this,a);if(b&&b[A]&&b[r]){var b=[],c=this.top,d=this[A],e=this[G]+this[r],f=this.top+this[A],g=a[G]+a[r],k=a.top+a[A];a.top>this.top&&(b[C](new vl(this[G],this.top,this[r],a.top-this.top)),c=a.top,d-=a.top-this.top);k<f&&(b[C](new vl(this[G],k,this[r],f-k)),d=k-c);a[G]>this[G]&&b[C](new vl(this[G],c,a[G]-this[G],d));g<e&&b[C](new vl(g,c,e-g,d));a=b}else a=[this.o()];return a}; Pa(T,function(a){return a instanceof vl?this[G]<=a[G]&&this[G]+this[r]>=a[G]+a[r]&&this.top<=a.top&&this.top+this[A]>=a.top+a[A]:a.x>=this[G]&&a.x<=this[G]+this[r]&&a.y>=this.top&&a.y<=this.top+this[A]});function Gea(a,b){var c=b.x<a[G]?a[G]-b.x:h.max(b.x-(a[G]+a[r]),0),d=b.y<a.top?a.top-b.y:h.max(b.y-(a.top+a[A]),0);return c*c+d*d}T.distance=function(a){return h[ud](Gea(this,a))};T.Ub=function(){return new xk(this[r],this[A])}; T.getCenter=function(){return new sk(this[G]+this[r]/2,this.top+this[A]/2)};sa(T,function(){Ya(this,h[xb](this[G]));this.top=h[xb](this.top);pa(this,h[xb](this[r]));Sa(this,h[xb](this[A]));return this});ta(T,function(){Ya(this,h[t](this[G]));this.top=h[t](this.top);pa(this,h[t](this[r]));Sa(this,h[t](this[A]));return this});Va(T,function(){Ya(this,h[D](this[G]));this.top=h[D](this.top);pa(this,h[D](this[r]));Sa(this,h[D](this[A]));return this}); db(T,function(a,b){a instanceof sk?(Ya(this,this[G]+a.x),this.top+=a.y):(Ya(this,this[G]+a),di(b)&&(this.top+=b));return this});Oa(T,function(a,b){var c=di(b)?b:a;Ya(this,this[G]*a);pa(this,this[r]*a);this.top*=c;Sa(this,this[A]*c);return this});function zl(a,b,c){bi(b)?Hea(a,c,b):Dj(b,gi(Hea,a))}function Hea(a,b,c){(c=Iea(a,c))&&(a[x][c]=b)}function Iea(a,b){var c=zi(b);if(void 0===a[x][c]){var d=Dea()+Ada(b);if(void 0!==a[x][d])return d}return c}function Jea(a,b){var c=a[x][zi(b)];return"undefined"!==typeof c?c:a[x][Iea(a,b)]||O}function Al(a,b){var c=Gk(a);return c[xd]&&c[xd].getComputedStyle&&(c=c[xd].getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||O:O}function Bl(a,b){return Al(a,b)||(a[$d]?a[$d][b]:null)||a[x]&&a[x][b]} function Cl(a){return Bl(a,eh)}function Dl(a,b,c){var d,e=lk&&(fk||bea)&&qk(waa);b instanceof sk?(d=b.x,b=b.y):(d=b,b=c);Ya(a[x],El(d,e));a[x].top=El(b,e)}function Fl(a){return new sk(a[Od],a[Tc])}function Gl(a){a=a?Gk(a):fa;return!kk||rk(9)||pl(Ek(a))?a[dc]:a[Pd]}function Hl(a){var b;try{b=a[qb]()}catch(c){return{left:0,top:0,right:0,bottom:0}}kk&&a[wc][Pd]&&(a=a[wc],Ya(b,b[G]-(a[dc][Ub]+a[Pd][Ub])),b.top-=a[dc][Vb]+a[Pd][Vb]);return b} function Kea(a){if(kk&&!rk(8))return a[qc];var b=Gk(a),c=Bl(a,eh),d=c==yg||c==cg;for(a=a[fe];a&&a!=b;a=a[fe])if(c=Bl(a,eh),d=d&&c==qh&&a!=b[dc]&&a!=b[Pd],!d&&(a[Bc]>a[Gd]||a[Rb]>a[Wd]||c==yg||c==cg||c==gh))return a;return null} function Il(a){for(var b=new rl(0,ea,ea,0),c=Ek(a),d=c.$b()[Pd],e=c.$b()[dc],f=oea(c.of);a=Kea(a);)if(!(kk&&0==a[Gd]||mk&&0==a[Wd]&&a==d||a==d||a==e||Bl(a,ch)==Fh)){var g=Jl(a),k;k=a;if(lk&&!qk(waa)){var l=ma(Al(k,Oba));if(Kl(k))var n=k[zb]-k[Gd]-l-ma(Al(k,Qba)),l=l+n;k=new sk(l,ma(Al(k,Sba)))}else k=new sk(k[Ub],k[Vb]);g.x+=k.x;g.y+=k.y;b.top=h.max(b.top,g.y);Ta(b,h.min(b[Zc],g.x+a[Gd]));Na(b,h.min(b[Hc],g.y+a[Wd]));Ya(b,h.max(b[G],g.x))}d=f[Gc];f=f[Cd];Ya(b,h.max(b[G],d));b.top=h.max(b.top,f);c= c.xB();c=Pk(c||ca);Ta(b,h.min(b[Zc],d+c[r]));Na(b,h.min(b[Hc],f+c[A]));return 0<=b.top&&0<=b[G]&&b[Hc]>b.top&&b[Zc]>b[G]?b:null} function Jl(a){var b,c=Gk(a),d=Bl(a,eh),e=lk&&c[Lb]&&!a[qb]&&d==cg&&(b=c[Lb](a))&&(0>b[Gb]||0>b[Hb]),f=new sk(0,0),g=Gl(c);if(a==g)return f;if(a[qb])b=Hl(a),a=ql(Ek(c)),f.x=b[G]+a.x,f.y=b.top+a.y;else if(c[Lb]&&!e)b=c[Lb](a),a=c[Lb](g),f.x=b[Gb]-a[Gb],f.y=b[Hb]-a[Hb];else{b=a;do{f.x+=b[Od];f.y+=b[Tc];b!=a&&(f.x+=b[Ub]||0,f.y+=b[Vb]||0);if(mk&&Cl(b)==yg){f.x+=c[Pd][Gc];f.y+=c[Pd][Cd];break}b=b[qc]}while(b&&b!=a);if(jk||mk&&d==cg)f.y-=c[Pd][Tc];for(b=a;(b=Kea(b))&&b!=c[Pd]&&b!=g;)f.x-=b[Gc],jk&&b[Nc]== Of||(f.y-=b[Cd])}return f}function Ll(a,b){var c=Ml(a),d=Ml(b);return new sk(c.x-d.x,c.y-d.y)}function Lea(a){var b;if(a[qb])b=Hl(a),b=new sk(b[G],b.top);else{b=ql(Ek(a));var c=Jl(a);b=new sk(c.x-b.x,c.y-b.y)}if(lk&&!qk(12)){i:{c=zi(xh);if(void 0===a[x][c]&&(c=Dea()+Ada(xh),void 0!==a[x][c])){c=Eea()+naa;break i}c=xh}a=(a=Bl(a,c)||Bl(a,xh))?(a=a[Ib](Mea))?new sk(ma(a[1]),ma(a[2])):new sk(0,0):new sk(0,0);a=wk(b,a)}else a=b;return a} function Ml(a){if(1==a[ed])return Lea(a);var b=ei(a.Rpa),c=a;a[Fb]?c=a[Fb][0]:b&&a.Ka[Fb]&&(c=a.Ka[Fb][0]);return new sk(c[zd],c[Ad])}function Nl(a,b,c){if(b instanceof xk)c=b[A],b=b[r];else if(void 0==c)throw m("missing height argument");pa(a[x],El(b,!0));Sa(a[x],El(c,!0))}function El(a,b){typeof a==Yg&&(a=(b?h[D](a):a)+S);return a}function Ol(a){return Pl(a)} function Pl(a){var b=Nea;if(Bl(a,rg)!=R)return b(a);var c=a[x],d=c[Sc],e=c.visibility,f=c[jc];hb(c,Ig);Ea(c,cg);Ra(c,Og);a=b(a);Ra(c,d);Ea(c,f);hb(c,e);return a}function Nea(a){var b=a[zb],c=a[Uc],d=mk&&!b&&!c;return Qh(b)&&!d||!a[qb]?new xk(b,c):(a=Hl(a),new xk(a[Zc]-a[G],a[Hc]-a.top))}function Ql(a){var b=Jl(a);a=Pl(a);return new vl(b.x,b.y,a[r],a[A])}function Rl(a,b){var c=a[x];bh in c?mb(c,b):eba in c?c.MozOpacity=b:xg in c&&(c.filter=b===O?O:Hba+100*b+Ge)}function Sl(a,b){Ra(a[x],b?O:R)} function Tl(a){var b=Ek(void 0),c=null,c=b.$b();if(kk&&c.createStyleSheet)b=c=c.createStyleSheet(),kk&&Qh(b.cssText)?$a(b,a):Wa(b,a);else{var d=Jk(b.of,Gg,void 0,void 0)[0];d||(c=Jk(b.of,hg,void 0,void 0)[0],d=b.h(Gg),c[fe][Eb](d,c));var e=c=b.h(sh);kk&&Qh(e.cssText)?$a(e,a):Wa(e,a);b[p](d,c)}return c}function Kl(a){return jh==Bl(a,qg)}var Ul=lk?"MozUserSelect":mk?"WebkitUserSelect":null; function Vl(a,b,c){c=c?null:a[cc](He);if(Ul){if(b=b?R:O,a[x][Ul]=b,c){a=0;for(var d;d=c[a];a++)d[x][Ul]=b}}else if(kk||jk)if(b=b?ah:O,a[v](Bh,b),c)for(a=0;d=c[a];a++)d[v](Bh,b)}function Wl(a){var b=Gk(a),c=kk&&a[$d];if(c&&pl(Ek(b))&&c[r]!=eg&&c[A]!=eg&&!c.boxSizing)return b=Xl(a,c[r],Ih,Jca),a=Xl(a,c[A],Hg,Hca),new xk(b,a);c=new xk(a[zb],a[Uc]);b=Yl(a);a=Zl(a);return new xk(c[r]-a[G]-b[G]-b[Zc]-a[Zc],c[A]-a.top-b.top-b[Hc]-a[Hc])} function Xl(a,b,c,d){if(/^\d+px?$/[bd](b))return la(b,10);var e=a[x][c],f=a.runtimeStyle[c];a.runtimeStyle[c]=a[$d][c];a[x][c]=b;b=a[x][d];a[x][c]=e;a.runtimeStyle[c]=f;return b}function $l(a,b){var c=a[$d]?a[$d][b]:null;return c?Xl(a,c,Qg,Ica):0}function Yl(a){if(kk){var b=$l(a,Eca),c=$l(a,Fca),d=$l(a,Gca);a=$l(a,Dca);return new rl(d,c,a,b)}b=Al(a,Eca);c=Al(a,Fca);d=Al(a,Gca);a=Al(a,Dca);return new rl(ma(d),ma(c),ma(a),ma(b))}var Oea={thin:2,medium:4,thick:6}; function am(a,b){if((a[$d]?a[$d][b+nba]:null)==R)return 0;var c=a[$d]?a[$d][b+wba]:null;return c in Oea?Oea[c]:Xl(a,c,Qg,Ica)}function Zl(a){if(kk&&!rk(9)){var b=am(a,Nba),c=am(a,Pba),d=am(a,Rba);a=am(a,Lba);return new rl(d,c,a,b)}b=Al(a,Oba);c=Al(a,Qba);d=Al(a,Sba);a=Al(a,Mba);return new rl(ma(d),ma(c),ma(a),ma(b))}function bm(a){var b={};Y(a[pc](/\s*;\s*/),function(a){a=a[pc](/\s*:\s*/);2==a[J]&&(b[zi(a[0][ke]())]=a[1])});return b}var Mea=/matrix\([0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, ([0-9\.\-]+)p?x?, ([0-9\.\-]+)p?x?\)/;var Pea=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");function cm(a){if(dm){dm=!1;var b=Ph[tc];if(b){var c=b[Ic];if(c&&(c=em(c))&&c!=b.hostname)throw dm=!0,m();}}return a[Ib](Pea)}var dm=mk;function em(a){return(a=cm(a)[3]||null)&&oa(a)}function fm(a){return(a=cm(a)[5]||null)&&oa(a)} function gm(a,b,c,d){for(var e=c[J];0<=(b=a[ld](c,b))&&b<d;){var f=a[Xd](b-1);if(38==f||63==f)if(f=a[Xd](b+e),!f||61==f||38==f||35==f)return b;b+=e+1}return-1}var hm=/#|$/;function im(a,b){var c=a[xc](hm),d=gm(a,0,b,c);if(0>d)return null;var e=a[ld](xe,d);if(0>e||e>c)e=c;d+=b[J]+1;return oa(a[ec](d,e-d)[vb](/\+/g,ne))}var Qea=/[?&]($|#)/;function jm(a,b){for(var c=a[xc](hm),d=0,e,f=[];0<=(e=gm(a,d,b,c));)f[C](a[ae](d,e)),d=h.min(a[ld](xe,e)+1||c,c);f[C](a[ec](d));return f[ie](O)[vb](Qea,faa)} function km(a,b,c){a=[jm(a,b),xe,b];null!=c&&a[C](af,aa(String(c)));a[1]&&(c=a[0],b=c[ld](qe),0<=b&&(a[C](c[ec](b)),a[0]=c=c[ec](0,b)),b=c[ld](cf),0>b?a[1]=cf:b==c[J]-1&&(a[1]=void 0));return a[ie](O)};var lm={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:re,blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9", darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff", gold:"#ffd700",goldenrod:"#daa520",gray:se,green:"#008000",greenyellow:"#adff2f",grey:se,honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa", lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead", navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d", silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:ue,whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function mm(a){var b={};a=String(a);var c=a[Bb](0)==qe?a:qe+a;if(nm[bd](c))return b.vd=om(c),ab(b,sca),b;c=Rea(a);if(c[J])return b.vd=pm(c),ab(b,hh),b;if(lm&&(c=lm[a[ke]()]))return b.vd=c,ab(b,xca),b;throw m(a+" is not a valid color string");}function qm(a){return!!(nm[bd](a[Bb](0)==qe?a:qe+a)||Rea(a)[J]||lm&&lm[a[ke]()])}var Sea=/#(.)(.)(.)/;function om(a){if(!nm[bd](a))throw m(Ee+a+"' is not a valid hex color");4==a[J]&&(a=a[vb](Sea,eaa));return a[ke]()} function rm(a){a=om(a);return[la(a[ec](1,2),16),la(a[ec](3,2),16),la(a[ec](5,2),16)]}function sm(a,b,c){a=ia(a);b=ia(b);c=ia(c);if(ga(a)||0>a||255<a||ga(b)||0>b||255<b||ga(c)||0>c||255<c)throw m('"('+a+Je+b+Je+c+'") is not a valid RGB color');a=tm(a[hc](16));b=tm(b[hc](16));c=tm(c[hc](16));return qe+a+b+c}function pm(a){return sm(a[0],a[1],a[2])} function Tea(a){var b=a[0]/255,c=a[1]/255;a=a[2]/255;var d=h.max(b,c,a),e=h.min(b,c,a),f=0,g=0,k=0.5*(d+e);d!=e&&(d==b?f=60*(c-a)/(d-e):d==c?f=60*(a-b)/(d-e)+120:d==a&&(f=60*(b-c)/(d-e)+240),g=0<k&&0.5>=k?(d-e)/(2*k):(d-e)/(2-2*k));return[h[D](f+360)%360,g,k]}function um(a,b,c){0>c?c+=1:1<c&&(c-=1);return 1>6*c?a+6*(b-a)*c:1>2*c?b:2>3*c?a+(b-a)*(2/3-c)*6:a} function Uea(a){var b=a[1],c=a[2],d=0,e=0,f=0;a=a[0]/360;if(0==b)d=e=f=255*c;else var g=f=0,g=0.5>c?c*(1+b):c+b-b*c,f=2*c-g,d=255*um(f,g,a+1/3),e=255*um(f,g,a),f=255*um(f,g,a-1/3);return[h[D](d),h[D](e),h[D](f)]}var nm=/^#(?:[0-9a-f]{3}){1,2}$/i,Vea=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function Rea(a){var b=a[Ib](Vea);if(b){a=ia(b[1]);var c=ia(b[2]),b=ia(b[3]);if(0<=a&&255>=a&&0<=c&&255>=c&&0<=b&&255>=b)return[a,c,b]}return[]} function tm(a){return 1==a[J]?Oe+a:a}function vm(a,b,c){c=nj(c,0,1);return[h[D](c*a[0]+(1-c)*b[0]),h[D](c*a[1]+(1-c)*b[1]),h[D](c*a[2]+(1-c)*b[2])]}function wm(a,b){return vm([0,0,0],a,b)}function xm(a,b){return vm([255,255,255],a,b)}function ym(a,b){for(var c=[],d=0;d<b[J];d++)c[C]({color:b[d],eh:Wea(b[d],a)+Xea(b[d],a)});c[Zd](function(a,b){return b.eh-a.eh});return c[0][E]}function Wea(a,b){return h.abs(h[D]((299*a[0]+587*a[1]+114*a[2])/1E3)-h[D]((299*b[0]+587*b[1]+114*b[2])/1E3))} function Xea(a,b){return h.abs(a[0]-b[0])+h.abs(a[1]-b[1])+h.abs(a[2]-b[2])};function zm(a,b){La(this,a<b?a:b);this.end=a<b?b:a}zm[K].o=function(){return new zm(this[y],this.end)};zm[K].getLength=function(){return this.end-this[y]};function Am(a,b){La(a,h.min(a[y],b));a.end=h.max(a.end,b)}function Bm(a,b){return a[y]<=b&&a.end>=b};function Cm(a,b){a&&(a.logicalname=b)}function Yea(a){return(a=ml(a,function(a){return null!=a.logicalname},!0))?a.logicalname:ag};function Dm(a){return a==R||a==O||a==yh?R:mm(a).vd}function Em(a){if(a==R)return R;a=rm(a);a=h[D]((a[0]+a[1]+a[2])/3);return sm(a,a,a)}function Zea(a){a=Pj(a);null==a[Ed]&&ib(a,!0);return a}function $ea(a,b){var c=a.h(b[yd],b.fd);a.kv(c,{style:b[x]});if(null!=b[yb]){var d=Yh(b[yb])?b[yb]:[b[yb]];Y(d,function(b){if(bi(b))a[p](c,a[Cb](b));else b=bi(b[yb])&&b.ela?ol(a,b[yb]):$ea(a,b),a[p](c,b)})}null!=b.id&&Cm(c,b.id);return c};function Mm(a,b,c){return a&&a!=R?b&&b!=R?pm(vm(rm(a),rm(b),c)):a:b}function Nm(a,b){if(null==b)return a;var c=new zm(b,b);return a?new zm(h.min(a[y],c[y]),h.max(a.end,c.end)):c}function afa(a,b,c){var d=null!=b?b:a&&null!=c&&c<a[y]?c:a?a[y]:null;a=null!=c?c:a&&null!=b&&b>a.end?b:a?a.end:null;return null!=d&&null!=a?new zm(d,a):null}function Om(a){if(0==a[J])return null;for(var b=a[0].o(),c=1;c<a[J];c++)tl(b,a[c]);return b} function Pm(a,b){var c=aj(a,b);if(0<=c)return b;c=-(c+1);if(0==c)return a[0];if(c==a[J])return Ai(a);var d=a[c-1],c=a[c];return h.abs(b-d)<=h.abs(b-c)?d:c};function Qm(a,b,c){this.Ge=a;this.qk=Dm(b);this.yx=Dm(null!=c?c:ue)}Qm[K].Hd=function(){return this.qk};Qm[K].qr=function(){return this.yx};Qm[K].o=function(){return new Qm(this.Ge,this.qk,this.yx)};Qm[K].lF=function(){return new Qm(this.Ge,Em(this.qk),Em(this.yx))};function Rm(a){a=a||{};this.aB=R;null!=a[fc]&&this.pe(a[fc]);this.Oe=1;null!=a.ae&&this.dh(a.ae);this.Qd=R;null!=a[Yb]&&this.dd(a[Yb]);this.Hb=1;null!=a.qa&&this.yk(a.qa);this.Ai=1;null!=a.Cg&&Sm(this,a.Cg);this.Hk=ph;null!=a.cO&&(this.Hk=a.cO);this.mA=null!=a.ji?a.ji:null;this.nA=null!=a.ki?a.ki:null;this.Qg=null;a.gh&&(this.Qg=Pj(a.gh),this.Qg.lg=Dm(this.Qg.lg),this.Qg.Tf=Dm(this.Qg.Tf));this.fe=null;a[ub]&&(this.fe=a[ub]);this.VW=null}T=Rm[K]; T.sm=function(){return{fill:this.gb(),ae:this.Oe,stroke:this.Qd,qa:this.Hb,Cg:this.Ai,cO:this.Hk,ji:this.mA,ki:this.nA,gh:Qj(this.Qg),pattern:Qj(this.fe)}}; Fa(T,function(){var a=this.Qg||null;a&&(a={color1:a.lg,color2:a.Tf,opacity1:a.Wy,opacity2:a.Xy,x1:a.x1,y1:a.y1,x2:a.hb,y2:a.kb,useObjectBoundingBoxUnits:a.sv,sharpTransition:a.uK});var b=this.fe||null;b&&(b={style:b.Ge,color:b.Hd(),bgcolor:b.qr()});a={fill:this.gb(),fillOpacity:this.Oe,stroke:this.Qd,strokeWidth:this.Hb,strokeOpacity:this.Ai,strokeDashStyle:this.Hk,rx:this.mA,ry:this.nA,gradient:a,pattern:b};return"undefined"!==typeof JSON&&JSON.stringify?JSON.stringify(a):Tm(a)});T.o=function(){return new Rm(this.sm())}; T.lF=function(){var a=this.o();a.pe(Em(this.aB));a.dd(Em(this.Qd));if(this.Qg){var b=Pj(this.Qg);b.lg=Em(this.Qg.lg);b.Tf=Em(this.Qg.Tf);a.gh=b}this.fe&&(b=this.fe.lF(),a.fe=b);return a};function bfa(a){return null==a||a==R}T.pe=function(a){this.aB=Dm(a)};T.gb=function(){return this.aB};T.dh=function(a){this.Oe=nj(a,0,1)};T.dd=function(a,b){this.Qd=Dm(a);null!=b&&this.yk(b)};T.Yaa=function(){return this.Qd};T.yk=function(a){this.Hb=a};function Um(a){return Vm(a)?a.Hb:0} function Sm(a,b){a.Ai=nj(b,0,1)}T.setShadow=function(a){this.VW=a};T.getShadow=function(){return this.VW};function Wm(a){return 0<a.Oe&&(!bfa(a.aB)||null!=a.Qg||null!=a.fe)}function Vm(a){return 0<a.Hb&&0<a.Ai&&!bfa(a.Qd)}function Xm(a){return Wm(a)&&1<=a.Oe}var Ym=new Rm({ae:0,fill:Hh,Cg:0,stroke:Hh});function Zm(a,b){return new Rm({stroke:R,fill:a,ae:null!=b?b:1})}function $m(a,b,c,d){return new Rm({stroke:a,qa:b,Cg:null!=d?d:1,fill:null!=c&&c?te:R})} function cfa(a,b){var c;if(a===b)c=!0;else if(null==a||null==b)c=!1;else if(c=a.aB==b.aB)if(c=a.Oe==b.Oe)if(c=a.Qd==b.Qd)if(c=a.Hb==b.Hb)if(c=a.Ai==b.Ai)if(c=a.Hk==b.Hk)if(c=a.mA==b.mA)if(c=a.nA==b.nA){c=a.gh;var d=b.gh;if(c=c===d?!0:null==c||null==d?!1:c.lg==d.lg&&c.Tf==d.Tf&&c.x1==d.x1&&c.y1==d.y1&&c.hb==d.hb&&c.kb==d.kb&&c.sv===d.sv)c=a.fe,d=b.fe,c=c===d?!0:null==c||null==d?!1:c.yx==d.yx&&c.qk==d.qk&&c.Ge==d.Ge}return c};var an,bn="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),dfa=["Sunday","Monday","Tuesday",Rf,Pf,"Friday",If]; an={ERAS:["BC","AD"],ERANAMES:["Before Christ","Anno Domini"],NARROWMONTHS:["J",nf,sf,df,sf,"J","J",df,Cf,zf,xf,"D"],STANDALONENARROWMONTHS:["J",nf,sf,df,sf,"J","J",df,Cf,zf,xf,"D"],MONTHS:["January",of,"March","April","May","June","July","August",Kf,"October",yf,lf],STANDALONEMONTHS:["January",of,"March","April","May","June","July","August",Kf,"October",yf,lf],SHORTMONTHS:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),STANDALONESHORTMONTHS:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), WEEKDAYS:["Sunday","Monday","Tuesday",Rf,Pf,"Friday",If],STANDALONEWEEKDAYS:["Sunday","Monday","Tuesday",Rf,Pf,"Friday",If],SHORTWEEKDAYS:"Sun Mon Tue Wed Thu Fri Sat".split(" "),STANDALONESHORTWEEKDAYS:"Sun Mon Tue Wed Thu Fri Sat".split(" "),NARROWWEEKDAYS:[Cf,sf,Lf,Qf,Lf,nf,Cf],STANDALONENARROWWEEKDAYS:[Cf,sf,Lf,Qf,Lf,nf,Cf],SHORTQUARTERS:["Q1","Q2","Q3","Q4"],QUARTERS:["1st quarter","2nd quarter","3rd quarter","4th quarter"],AMPMS:["AM","PM"],DATEFORMATS:["EEEE, MMMM d, y","MMMM d, y","MMM d, y", "M/d/yy"],TIMEFORMATS:["h:mm:ss a zzzz","h:mm:ss a z",Fg,Eg],DATETIMEFORMATS:["{1} 'at' {0}","{1} 'at' {0}","{1}, {0}","{1}, {0}"],FIRSTDAYOFWEEK:6,WEEKENDRANGE:[5,6],FIRSTWEEKCUTOFFDAY:5};function cn(a,b){switch(b){case 1:return 0!=a%4||0==a%100&&0!=a%400?28:29;case 5:case 8:case 10:case 3:return 30}return 31}function efa(a,b){var c=b||new Date(hi());return a[Ec]()==c[Ec]()}function dn(a,b,c){di(a)?(this.qb=ffa(a,b||0,c||1),en(this,c||1)):ai(a)?(this.qb=ffa(a[Ec](),a[Dd](),a[Db]()),en(this,a[Db]())):(this.qb=new Date(hi()),this.qb.setHours(0),this.qb.setMinutes(0),this.qb.setSeconds(0),this.qb.setMilliseconds(0))} function ffa(a,b,c){b=new Date(a,b,c);0<=a&&100>a&&b[rd](b[Ec]()-1900);return b}T=dn[K];T.Kca=an.FIRSTDAYOFWEEK;T.Lca=an.FIRSTWEEKCUTOFFDAY;T.o=function(){var a=new dn(this.qb);a.Kca=this.Kca;a.Lca=this.Lca;return a};T.getFullYear=function(){return this.qb[Ec]()};T.getYear=function(){return this[Ec]()};T.getMonth=function(){return this.qb[Dd]()};T.getDate=function(){return this.qb[Db]()};Ba(T,function(){return this.qb[bc]()});T.getDay=function(){return this.qb[lc]()};T.getUTCFullYear=function(){return this.qb[Jb]()}; T.getUTCMonth=function(){return this.qb[zc]()};T.getUTCDate=function(){return this.qb[Jd]()};T.getUTCHours=function(){return this.qb[ee]()};T.getUTCMinutes=function(){return this.qb[de]()};T.getTimezoneOffset=function(){return this.qb[le]()};T.set=function(a){this.qb=new Date(a[Ec](),a[Dd](),a[Db]())};T.setFullYear=function(a){this.qb[rd](a)};T.setMonth=function(a){this.qb[pd](a)};T.setDate=function(a){this.qb[Bd](a)};T.setTime=function(a){this.qb[Jc](a)};T.setUTCFullYear=function(a){this.qb.setUTCFullYear(a)}; T.setUTCMonth=function(a){this.qb[Ud](a)};T.setUTCDate=function(a){this.qb.setUTCDate(a)};T.add=function(a){if(a.years||a.months){var b=this[Dd]()+a.months+12*a.years,c=this[Ac]()+h[t](b/12),b=b%12;0>b&&(b+=12);var d=h.min(cn(c,b),this[Db]());this[Bd](1);this[rd](c);this[pd](b);this[Bd](d)}a.days&&(a=new Date((new Date(this[Ac](),this[Dd](),this[Db](),12))[bc]()+864E5*a.days),this[Bd](1),this[rd](a[Ec]()),this[pd](a[Dd]()),this[Bd](a[Db]()),en(this,a[Db]()))}; T.kta=function(){return[this[Ec](),ui(this[Dd]()+1,2),ui(this[Db](),2)][ie](O)+O};Za(T,function(a){return!(!a||this[Ac]()!=a[Ac]()||this[Dd]()!=a[Dd]()||this[Db]()!=a[Db]())});Da(T,function(){return this.kta()});function en(a,b){a[Db]()!=b&&a.qb.setUTCHours(a.qb[ee]()+(a[Db]()<b?1:-1))}T.valueOf=function(){return this.qb[ad]()};function fn(a,b){return a[bc]()-b[bc]()};function gn(a,b){if(null==a&&null==b)return a===b;if(a===b)return!0;var c=Vh(a),d=Vh(b);if(c!=d)return!1;var d=$h(a),e=$h(b);if(d!=e)return!1;switch(c){case $g:if(d&&e)return 0==fn(a,b);for(var f in a)if(a[vc](f)&&(!b[vc](f)||!gn(a[f],b[f])))return!1;for(var g in b)if(b[vc](g)&&!a[vc](g))return!1;return!0;case dg:if(a[J]!=b[J])return!1;for(c=0;c<a[J];++c)if(!gn(a[c],b[c]))return!1;return!0;case Bg:return!0;case rh:case Yg:case jg:return!1;default:throw m("Error while comparing "+a+aaa+b+": unexpected type of obj1 "+ c);}}function hn(a){if($h(a)){var b=new Date;b[Jc](a[ad]());return b}var c=Vh(a);if(c==$g||c==dg){if(a.o)return a.o();c=c==dg?[]:{};for(b in a)c[b]=hn(a[b]);return c}return a};function jn(a){this.Vj=a||[{}]}function kn(a,b){Ui(a.Vj,b,1)}function gfa(a,b){for(var c in b)ai(b[c])&&a[c]?gfa(a[c],b[c]):a[c]=b[c]}function hfa(a,b){Dj(b,function(b,d){ai(b)&&!Yh(b)?(a[d]=a[d]||{},hfa(a[d],b)):null!=b&&(a[d]=b)})}function ln(a){var b={};Ei(a.Vj,function(a){hfa(b,a)});return b}function mn(a,b,c){t:{b=b[pc](Me);a=a||Ph;for(var d=0;d<b[J];d++){var e=b[d];if(null!=a[e])a=a[e];else{b=null;break t}}b=a}return null!=b&&ei(c)?c(b):b} jn[K].R=function(a,b,c){for(var d=null,e=0;e<this.Vj[J];e++){t:{var d=this.Vj[e],f=a,g=c;if(bi(f))d=mn(d,f,g);else{for(var k=0;k<f[J];++k){var l=mn(d,f[k],g);if(null!=l){d=l;break t}}d=null}}if(null!=d)return d}d=b;return Qh(d)?d:null};function nn(a,b,c,d){c=null!=c?Pj(c):{};for(var e=a.Vj[J]-1;0<=e;e--){var f=c,g=a.Vj[e],k=b,l=d;bi(k)&&(k=[k]);for(var n=k[J]-1;0<=n;--n){var q=mn(g,k[n],l)||{};Sj(f,q)}}return c} function on(a){if(null==a)return null;if(typeof a==jg)return a;a=String(a);return a==Te||a[ke]()==zh?!0:a==Oe||a[ke]()==wg?!1:null}function pn(a,b,c){a=a.R(b,null,on);if(null!=a)return a;Qh(c)||(c=!1);return c}function qn(a){if(null==a)return null;if(typeof a==Yg)return a;a=yi(String(a));return ga(a)?null:a}function rn(a){return null!=a?Yh(a)?Gi(a,qn):null:null}function ifa(a){if(null==a)return null;if(di(a))return a;a=ia(a);return ga(a)?null:a} function sn(a,b,c){a=tn(a,b);if(null!=a)return a;Qh(c)||(c=0);return c}function jfa(a,b,c){a=a.R(b,null,ifa);if(null!=a)return a;Qh(c)||(c=0);return c}function tn(a,b){return a.R(b,null,qn)}function un(a){a=qn(a);return null!=a&&0<=a?a:null}function vn(a,b,c){a=a.R(b,null,un);if(null!=a)return a;Qh(c)||(c=0);return c}function wn(a){a=un(a);return null!=a?nj(a,0,1):null}function xn(a,b,c){a=a.R(b,null,wn);if(null!=a)return a;Qh(c)||(c=0);return c}function yn(a){return null!=a?String(a):null} function zn(a,b,c){Qh(c)||(c=O);return a.R(b,c,yn)}function An(a,b){return a.R(b,null,yn)}function Bn(a,b){var c=yn(a);if(!c)return null;if(Ri(b||[],c))return c;try{return Dm(c)}catch(d){return null}}function Cn(a,b,c){return a.R(b,c,Bn)}function Dn(a,b,c,d){return a.R(b,d,function(a){return Bn(a,c)})}function En(a,b){return a.R(b,null,Bn)}function kfa(a){return null!=a?Yh(a)?Gi(a,String):null:null}function Fn(a,b){var c=yn(b);return Jj(a,c)?c:null} function Gn(a,b,c,d){return a.R(b,d,W(Fn,null,c))}function Hn(a,b,c){return a.R(b,null,W(Fn,null,c))}function In(a,b,c){Qh(c)||(c=null);return a.R(b,c)} function Jn(a,b,c){c=c?c.sm():null;a=nn(a,b,c,function(a){ai(a)||(a={fill:a});var b={},c=Bn(a[fc]);null!=c&&Ca(b,c);c=wn(a.fillOpacity);null!=c&&(b.ae=c);c=Bn(a[Yb]);null!=c&&za(b,c);c=un(a.strokeWidth);null!=c&&(b.qa=c);c=wn(a.strokeOpacity);null!=c&&(b.Cg=c);c=rn(a.strokeDashStyle);null!=c&&Yh(c)&&(b.cO=c);c=qn(a.rx);null!=c&&(b.ji=c);c=qn(a.ry);null!=c&&(b.ki=c);(a=a.gradient)&&null!=a.color1&&null!=a.color2&&null!=a.x1&&null!=a.y1&&null!=a.x2&&null!=a.y2&&(c={},c.lg=Bn(a.color1),c.Tf=Bn(a.color2), c.Wy=wn(a.opacity1),c.Xy=wn(a.opacity2),c.x1=a.x1,c.y1=a.y1,c.hb=a.x2,c.kb=a.y2,c.sv=on(a.useObjectBoundingBoxUnits),b.gh=c);return b});a=new Rm(a);Wm(a)||(a.pe(Ym.gb()),a.dh(Ym.Oe));Vm(a)||(a.dd(Ym.Qd),Sm(a,Ym.Ai));return a} function Kn(a,b){var c={},d=Bn(a[E],b);null!=d&&Xa(c,d);d=wn(a[Kd]);null!=d&&mb(c,d);d=Bn(a.auraColor,b);null!=d&&(c.Tb=d);if(d=yn(a.fontName))c.Va=d;(d=un(a[uc]))&&Ja(c,d);d=on(a[Ed]);null!=d&&ib(c,d);d=on(a.italic);null!=d&&(c.Ic=d);d=on(a.underline);null!=d&&(c.De=d);return c}function Ln(a,b,c){return nn(a,b,c,function(a){return Kn(a)})}function lfa(a,b,c,d){return nn(a,b,d,function(a){return Kn(a,c)})} function mfa(a,b){var c=null,d=qn(b);if(null!=d)c=d;else if(d=yn(b),null!=d&&mda(d)){var c=d[J]-1,e=d;0<=c&&c<d[J]&&(e=d[ec](0,c)+d[ec](c+1,d[J]-c-1));c=a*yi(e)/100}null!=c&&(c=nj(c,0,a));return c}function nfa(a,b){var c,d=Mn(a,Kba,b);if(null!=d)return d;Qh(c)||(c=0);return c}function Mn(a,b,c){return a.R(b,null,W(mfa,null,c))}var ofa={Hva:"multiple",gwa:oh},Nn={NONE:R,Ura:zg,asa:mh,Vx:kg},pfa={NONE:R,Ura:zg,asa:mh,Vx:kg},qfa={xS:Jg,yS:Eh,Vx:kg};function rfa(){this.Um=!1;this.p2=[]}Uh(rfa);function sfa(a,b,c){var d=c.callback;c.callback=function(){var b=d[Mc](this,arguments);0<a.p2[J]?(a.p2[rb]()(),a.Um=!0):a.Um=!1;return b};b=W(google[fd],Ph.google,ada,b,c);if(a.Um)a.p2[C](b);else a.Um=!0,b()};function On(a,b,c){return b.R(Ih,null,un)||Wl(a)[r]||c||400}function Pn(a,b,c){return b.R(Hg,null,un)||Wl(a)[A]||c||200}function Qn(a,b,c,d){return b&&(b=b[r],bi(b)&&oi(b)&&(b=la(b,10)),typeof b==Yg&&30<=b&&(!d||b<=d))||a&&(b=a[Gd],30<=b&&(!d||b<=d))?b:c||400}function Rn(a,b,c,d,e){return b&&(b=b[A],bi(b)&&oi(b)&&(b=la(b,10)),typeof b==Yg&&b>=(e||30)&&(!d||b<=d))||a&&(b=a[Wd],b>=(e||30)&&(!d||b<=d))?b:c||200}function tfa(a){var b=ufa,c=a&&a.colors;c&&0!=c[J]||(c=(a=a&&a[E])?[a]:b);return c} function Wn(){var a=Sh(nca);if(null!=a)return a;a=Sh(kca);null!=a||(a=qaa);var b=Sh(pca);null!=b||(b=vaa);return a+raa+b}function vfa(){if(0==fa[cc](Gg)[J]){var a=fa[cc](Mg)[0],b=fa[cc](hg)[0],c=fa[Qb](Gg);a[Eb](c,b)}return fa[cc](Gg)[0]}function Xn(a){a=Wn()+a;for(var b=fa[cc](aba),c=0;c<b[J];c++)if(b[c]&&b[c][Sd](Kg)&&b[c][Sd](Kg)===a)return;b=fa[Qb](Rg);b.href=a;b.rel=Sca;ab(b,Vca);vfa()[p](b)}var Yn=[]; function wfa(a){function b(){if(xfa()){var a=Yn;Yn=[];Y(a,function(a){a()})}else throw m("Error: cannot load Maps API.");}xfa()?a():(Yn[C](a),1==Yn[J]&&(a=Nca,yfa()&&(a+=gaa),google[fd](vca,Ve,{callback:b,other_params:a})))}function yfa(){var a=Ph[tc][Ic];if(!mi(a)){if((cm(a)[1]||null)!=Ng)return!1;a=em(a);if(!mi(a)){var b=/^ajax\.googleapis\.com$/[bd](a);return/\.google\.com$/[bd](a)||b}}return!1}function xfa(){return!!Sh(lca)} function Zn(a){var b=null,c=Ph.google;(c=c&&c[Md]&&c[Md].Locale)&&c.packages&&c.packages[a]&&(b=c.locale);return b}function $n(a,b){var c=Vh(a);b=(31*b+xi(c))%67108864;switch(c){case $g:if(a[rc]==Date)b=(31*b+xi(og))%67108864,b=$n(a[bc](),b);else{c=Ij(a);cj(c);var c=Tj(c),d;for(d in c)b=$n(a[d],$n(d,b))}break;case dg:for(d=0;d<a[J];d++)b=$n(a[d],$n(String(d),b));break;default:b=(31*b+xi(String(a)))%67108864}return b}function ao(a){if(!Sk(a))throw m(hf);return a} function bo(a){var b=Sh(mca+a);ei(b)||(b=Sh(a),ei(b)||(b=null));return b};function co(a){this.b=a||{};Xn(taa)}ua(co[K],function(a,b){if(a.D(b)==Yg)for(var c=this.b.base||0,d=0;d<a.M();d++){var e=a[I](d,b),f=null,f=e<c?hca:e>c?jca:ica;a[Dc](d,b,Wba,f)}});function eo(a){a=String(a);if(/^\s*$/[bd](a)?0:/^[\],:{}\s\u2028\u2029]*$/[bd](a[vb](/\\["\\\/bfnrtu]/g,Gaa)[vb](/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,$f)[vb](/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,O)))try{return eval(Fe+a+Ge)}catch(b){}throw m("Invalid JSON string: "+a);}function fo(a){return eval(Fe+a+Ge)}function Tm(a){return(new zfa(void 0)).Hn(a)}function zfa(a){this.GS=a}zfa[K].Hn=function(a){var b=[];go(this,a,b);return b[ie](O)}; function go(a,b,c){switch(typeof b){case rh:Afa(b,c);break;case Yg:c[C](na(b)&&!ga(b)?b:Xg);break;case jg:c[C](b);break;case "undefined":c[C](Xg);break;case $g:if(null==b){c[C](Xg);break}if(Yh(b)){var d=b[J];c[C](xba);for(var e=O,f=0;f<d;f++)c[C](e),e=b[f],go(a,a.GS?a.GS[L](b,String(f),e):e,c),e=Je;c[C]($f);break}c[C](Lh);d=O;for(f in b)da[K][vc][L](b,f)&&(e=b[f],typeof e!=Bg&&(c[C](d),Afa(f,c),c[C](Xe),go(a,a.GS?a.GS[L](b,f,e):e,c),d=Je));c[C](Mh);break;case Bg:break;default:throw m("Unknown type: "+ typeof b);}}var ho={'"':'\\"',"\\":Yf,"/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Bfa=/\uffff/[bd]("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;function Afa(a,b){b[C](oe,a[vb](Bfa,function(a){if(a in ho)return ho[a];var b=a[Xd](0),e=Dba;16>b?e+=Se:256>b?e+=Re:4096>b&&(e+=Oe);return ho[a]=e+b[hc](16)}),oe)};function io(a){return Tm(jo(a,ko))}function lo(a){eo(a);return Cfa(a)}function Cfa(a){a=mo(a);return eval(Fe+a+Ge)}function jo(a,b){a=b(a);var c=Vh(a);if(c==$g||c==dg){var c=c==dg?[]:{},d;for(d in a)if(a[vc](d)){var e=jo(a[d],b);Qh(e)&&(c[d]=e)}}else c=a;return c}function mo(a){return a[vb](/"(Date\([\d,\s]*\))"/g,function(a,c){return Bca+c})} function ko(a){$h(a)&&(a=0!==a[Ld]()?[a[Ec](),a[Dd](),a[Db](),a[$b](),a[Qc](),a[Id](),a[Ld]()]:0!==a[Id]()||0!==a[Qc]()||0!==a[$b]()?[a[Ec](),a[Dd](),a[Db](),a[$b](),a[Qc](),a[Id]()]:[a[Ec](),a[Dd](),a[Db]()],a=Naa+a[ie](Ke)+Ge);return a};var Dfa={Cva:tf,awa:kba,Dva:cba,ava:Uaa,Nua:jf,Hwa:uba,Fva:vf,Xva:Bf,Lwa:Sf};function no(a){switch(a){case tf:return 1;case kba:return 1E3;case cba:return 6E4;case Uaa:return 36E5;case jf:return 864E5;case uba:return 6048E5;case vf:return 2629746E3;case Bf:return 7889238E3;case Sf:return 31556952E3}return 0};function oo(){}function po(a){if(typeof a==Yg){var b=new oo;b.qda=a;var c;c=a;if(0==c)c=Paa;else{var d=[Paa,0>c?Le:Ie];c=h.abs(c);d[C](h[t](c/60)%100);c%=60;0!=c&&d[C](Xe,ui(c,2));c=d[ie](O)}b.rda=c;0==a?a=rba:(c=[rba,0>a?Ie:Le],a=h.abs(a),c[C](h[t](a/60)%100),a%=60,0!=a&&c[C](Xe,a),a=c[ie](O));b.k2=[a,a];b.vC=[];return b}b=new oo;b.rda=a.id;b.qda=-a.std_offset;b.k2=a.names;b.vC=a.transitions;return b}T=oo[K]; T.getDaylightAdjustment=function(a){a=Date.UTC(a[Jb](),a[zc](),a[Jd](),a[ee](),a[de]())/36E5;for(var b=0;b<this.vC[J]&&a>=this.vC[b];)b+=2;return 0==b?0:this.vC[b-1]};T.getGMTString=function(a){a=this.getOffset(a);var b=[Saa];b[C](0>=a?Ie:Le);a=h.abs(a);b[C](ui(h[t](a/60)%100,2),Xe,ui(a%60,2));return b[ie](O)};T.getLongName=function(a){return this.k2[this.isDaylightTime(a)?3:1]};T.getOffset=function(a){return this.qda-this.getDaylightAdjustment(a)}; T.getRFCTimeZoneString=function(a){a=-this.getOffset(a);var b=[0>a?Le:Ie];a=h.abs(a);b[C](ui(h[t](a/60)%100,2),ui(a%60,2));return b[ie](O)};T.getShortName=function(a){return this.k2[this.isDaylightTime(a)?2:0]};T.getTimeZoneId=function(){return this.rda};T.isDaylightTime=function(a){return 0<this.getDaylightAdjustment(a)};function qo(a,b){this.qS=[];this.df=b||an;typeof a==Yg?this.fR(a):this.ls(a)}var Efa=[/^\'(?:[^\']|\'\')*\'/,/^(?:G+|y+|M+|k+|S+|E+|a+|h+|K+|H+|c+|L+|Q+|d+|m+|s+|v+|w+|z+|Z+)/,/^[^\'GyMkSEahKHcLQdmsvwzZ]+/];qo[K].ls=function(a){for(;a;)for(var b=0;b<Efa[J];++b){var c=a[Ib](Efa[b]);if(c){c=c[0];a=a[ae](c[J]);0==b&&(c==haa?c=Ee:(c=c[ae](1,c[J]-1),c=c[vb](/\'\'/,Ee)));this.qS[C]({text:c,type:b});break}}}; ua(qo[K],function(a,b){if(!a)throw m("The date to format must be non-null.");var c=b?6E4*(a[le]()-b.getOffset(a)):0,d=c?new Date(a[bc]()+c):a,e=d;b&&d[le]()!=a[le]()&&(c+=0<c?-864E5:864E5,e=new Date(a[bc]()+c));for(var c=[],f=0;f<this.qS[J];++f){var g=this.qS[f][cd];1==this.qS[f][H]?c[C](Ffa(this,g,a,d,e,b)):c[C](g)}return c[ie](O)}); qo[K].fR=function(a){var b;if(4>a)b=this.df.DATEFORMATS[a];else if(8>a)b=this.df.TIMEFORMATS[a-4];else if(12>a)b=this.df.DATETIMEFORMATS[a-8],b=b[vb](cda,this.df.DATEFORMATS[a-8]),b=b[vb](bda,this.df.TIMEFORMATS[a-8]);else{this.fR(10);return}this.ls(b)};function ro(a,b){var c;c=String(b);var d=a.df||an;if(void 0!==d.Fqa){for(var e=[],f=0;f<c[J];f++){var g=c[Xd](f);e[C](48<=g&&57>=g?String[qd](d.Fqa+g-48):c[Bb](f))}c=e[ie](O)}return c} function so(a){if(!(a[$b]&&a[Id]&&a[Qc]))throw m("The date to format has no time (probably a goog.date.Date). Use Date or goog.date.DateTime, or use a pattern without time fields.");} function Ffa(a,b,c,d,e,f){var g=b[J];switch(b[Bb](0)){case Raa:return c=0<d[Ec]()?1:0,4<=g?a.df.ERANAMES[c]:a.df.ERAS[c];case Jh:return c=d[Ec](),0>c&&(c=-c),2==g&&(c%=100),ro(a,ui(c,g));case sf:t:switch(c=d[Dd](),g){case 5:a=a.df.NARROWMONTHS[c];break t;case 4:a=a.df.MONTHS[c];break t;case 3:a=a.df.SHORTMONTHS[c];break t;default:a=ro(a,ui(c+1,g))}return a;case Pg:return so(e),ro(a,ui(e[$b]()||24,g));case Cf:return c=e[bc]()%1E3/1E3,ro(a,c[wb](h.min(3,g))[ec](2)+(3<g?ui(0,g-3):O));case mf:return c= d[lc](),4<=g?a.df.WEEKDAYS[c]:a.df.SHORTWEEKDAYS[c];case bg:return so(e),g=e[$b](),a.df.AMPMS[12<=g&&24>g?1:0];case Dg:return so(e),ro(a,ui(e[$b]()%12||12,g));case Zaa:return so(e),ro(a,ui(e[$b]()%12,g));case Taa:return so(e),ro(a,ui(e[$b](),g));case lg:t:switch(c=d[lc](),g){case 5:a=a.df.STANDALONENARROWWEEKDAYS[c];break t;case 4:a=a.df.STANDALONEWEEKDAYS[c];break t;case 3:a=a.df.STANDALONESHORTWEEKDAYS[c];break t;default:a=ro(a,ui(c,1))}return a;case rf:t:switch(c=d[Dd](),g){case 5:a=a.df.STANDALONENARROWMONTHS[c]; break t;case 4:a=a.df.STANDALONEMONTHS[c];break t;case 3:a=a.df.STANDALONESHORTMONTHS[c];break t;default:a=ro(a,ui(c+1,g))}return a;case Af:return c=h[t](d[Dd]()/3),4>g?a.df.SHORTQUARTERS[c]:a.df.QUARTERS[c];case ng:return ro(a,ui(d[Db](),g));case Tg:return so(e),ro(a,ui(e[Qc](),g));case kh:return so(e),ro(a,ui(e[Id](),g));case Ch:return a=f||po(c[le]()),a.getTimeZoneId();case Gh:return c=new Date(e[Ec](),e[Dd](),e[Db]()),b=a.df.FIRSTDAYOFWEEK||0,c=c[ad]()+864E5*(((a.df.FIRSTWEEKCUTOFFDAY||3)-b+7)% 7-((c[lc]()+6)%7-b+7)%7),c=h[t](h[D]((c-(new Date((new Date(c))[Ec](),0,1))[ad]())/864E5)/7)+1,ro(a,ui(c,g));case Kh:return a=f||po(c[le]()),4>g?a.getShortName(c):a.getLongName(c);case Vf:return b=f||po(c[le]()),4>g?b.getRFCTimeZoneString(c):ro(a,b.getGMTString(c));default:return O}};var Gfa={YEAR_FULL:Jh,YEAR_FULL_WITH_ERA:"y G",YEAR_MONTH_ABBR:"MMM y",YEAR_MONTH_FULL:"MMMM y",MONTH_DAY_ABBR:uf,MONTH_DAY_FULL:"MMMM dd",MONTH_DAY_SHORT:"M/d",MONTH_DAY_MEDIUM:"MMMM d",MONTH_DAY_YEAR_MEDIUM:"MMM d, y",WEEKDAY_MONTH_DAY_MEDIUM:"EEE, MMM d",WEEKDAY_MONTH_DAY_YEAR_MEDIUM:"EEE, MMM d, y",DAY_ABBR:ng},Hfa=Gfa,Hfa=Gfa;var Ifa={oqa:{1E3:{other:"0K"},1E4:{other:"00K"},1E5:{other:"000K"},1E6:{other:"0M"},1E7:{other:"00M"},1E8:{other:"000M"},1E9:{other:"0B"},1E10:{other:"00B"},1E11:{other:"000B"},1E12:{other:"0T"},1E13:{other:"00T"},1E14:{other:"000T"}},nqa:{1E3:{other:"0 thousand"},1E4:{other:"00 thousand"},1E5:{other:"000 thousand"},1E6:{other:"0 million"},1E7:{other:"00 million"},1E8:{other:"000 million"},1E9:{other:"0 billion"},1E10:{other:"00 billion"},1E11:{other:"000 billion"},1E12:{other:"0 trillion"},1E13:{other:"00 trillion"}, 1E14:{other:"000 trillion"}}},to=Ifa,to=Ifa;function Jfa(a){var b=uo.Qra,c=[Oe];a=vo[a][0]&7;if(0<a){c[C](Me);for(var d=0;d<a;d++)c[C](Oe)}return b[vb](/0.00/g,c[ie](O))} var vo={AED:[2,"dh","\u062f.\u0625.","DH"],ALL:[0,"Lek","Lek"],AUD:[2,ve,"AU$"],BDT:[2,"\u09f3","Tk"],BGN:[2,"lev","lev"],BRL:[2,"R$","R$"],CAD:[2,ve,"C$"],CDF:[2,"FrCD","CDF"],CHF:[2,"CHF","CHF"],CLP:[0,ve,"CL$"],CNY:[2,"\u00a5","RMB\u00a5"],COP:[0,ve,"COL$"],CRC:[0,"\u20a1","CR\u20a1"],CZK:[50,"K\u010d","K\u010d"],DKK:[18,"kr","kr"],DOP:[2,ve,"RD$"],EGP:[2,"\u00a3","LE"],ETB:[2,"Birr","Birr"],EUR:[2,"\u20ac","\u20ac"],GBP:[2,"\u00a3","GB\u00a3"],HKD:[2,ve,"HK$"],HRK:[2,"kn","kn"],HUF:[0,"Ft","Ft"], IDR:[0,"Rp","Rp"],ILS:[2,"\u20aa","IL\u20aa"],INR:[2,"\u20b9","Rs"],IRR:[0,"Rial","IRR"],ISK:[0,"kr","kr"],JMD:[2,ve,"JA$"],JPY:[0,"\u00a5","JP\u00a5"],KRW:[0,"\u20a9","KR\u20a9"],LKR:[2,"Rs","SLRs"],LTL:[2,"Lt","Lt"],LVL:[2,"Ls","Ls"],MNT:[0,"\u20ae","MN\u20ae"],MXN:[2,ve,"Mex$"],MYR:[2,"RM","RM"],NOK:[50,"kr","NOkr"],PAB:[2,"B/.","B/."],PEN:[2,"S/.","S/."],PHP:[2,"\u20b1","Php"],PKR:[0,"Rs","PKRs."],PLN:[50,"z\u0142","z\u0142"],RON:[2,"RON","RON"],RSD:[0,"din","RSD"],RUB:[50,"\u0440\u0443\u0431.", "\u0440\u0443\u0431."],SAR:[2,"Rial","Rial"],SEK:[2,"kr","kr"],SGD:[2,ve,"S$"],THB:[2,"\u0e3f","THB"],TRY:[2,Nf,"YTL"],TWD:[2,"NT$","NT$"],TZS:[0,"TSh","TSh"],UAH:[2,"\u20b4","UAH"],USD:[2,ve,"US$"],UYU:[2,ve,"$U"],VND:[0,"\u20ab","VN\u20ab"],YER:[0,"Rial","Rial"],ZAR:[2,"R","ZAR"]};var Kfa={DECIMAL_SEP:Me,GROUP_SEP:Je,o1:we,z1:Oe,Lqa:Ie,Kqa:Le,nca:mf,jca:fda,P0:"\u221e",Noa:"NaN",DECIMAL_PATTERN:"#,##0.###",Gqa:"#E0",Z1:"#,##0%",Qra:"\u00a4#,##0.00",Ona:"USD"},uo=Kfa,uo=Kfa;function wo(a,b,c){this.jJ=b||uo.Ona;this.Dna=c||0;this.NQ=40;this.po=1;this.fy=0;this.Yx=3;this.cR=this.hs=0;this.Xaa=this.xaa=!1;this.QI=this.Ux=O;this.Fu=Le;this.rC=O;this.Vi=1;this.b0=3;this.OQ=this.waa=!1;this.$I=0;this.Aaa=null;typeof a==Yg?this.fR(a):this.ls(a)}var xo=!1;T=wo[K];T.setMinimumFractionDigits=function(a){if(0<this.fy&&0<a)throw m(Maa);this.hs=a;return this};T.setMaximumFractionDigits=function(a){this.Yx=a;return this}; T.setSignificantDigits=function(a){if(0<this.hs&&0<=a)throw m(Maa);this.fy=a;return this}; T.ls=function(a){this.fe=a[vb](/ /g,Nh);var b=[0];this.Ux=yo(this,a,b);for(var c=b[0],d=-1,e=0,f=0,g=0,k=-1,l=a[J],n=!0;b[0]<l&&n;b[0]++)switch(a[Bb](b[0])){case qe:0<f?g++:e++;0<=k&&0>d&&k++;break;case Oe:if(0<g)throw m('Unexpected "0" in pattern "'+a+oe);f++;0<=k&&0>d&&k++;break;case Je:k=0;break;case Me:if(0<=d)throw m('Multiple decimal separators in pattern "'+a+oe);d=e+f+g;break;case mf:if(this.OQ)throw m('Multiple exponential symbols in pattern "'+a+oe);this.OQ=!0;this.cR=0;b[0]+1<l&&a[Bb](b[0]+ 1)==Ie&&(b[0]++,this.xaa=!0);for(;b[0]+1<l&&a[Bb](b[0]+1)==Oe;)b[0]++,this.cR++;if(1>e+f||1>this.cR)throw m('Malformed exponential pattern "'+a+oe);n=!1;break;default:b[0]--,n=!1}0==f&&0<e&&0<=d&&(f=d,0==f&&f++,g=e-f,e=f-1,f=1);if(0>d&&0<g||0<=d&&(d<e||d>e+f)||0==k)throw m('Malformed pattern "'+a+oe);g=e+f+g;this.Yx=0<=d?g-d:0;0<=d&&(this.hs=e+f-d,0>this.hs&&(this.hs=0));this.po=(0<=d?d:g)-e;this.OQ&&(this.NQ=e+this.po,0==this.Yx&&0==this.po&&(this.po=1));this.b0=h.max(0,k);this.waa=0==d||d==g;c= b[0]-c;this.QI=yo(this,a,b);b[0]<a[J]&&a[Bb](b[0])==Ye?(b[0]++,this.Fu=yo(this,a,b),b[0]+=c,this.rC=yo(this,a,b)):(this.Fu=this.Ux+this.Fu,this.rC+=this.QI)};T.fR=function(a){switch(a){case 1:this.ls(uo.DECIMAL_PATTERN);break;case 2:this.ls(uo.Gqa);break;case 3:this.ls(uo.Z1);break;case 4:this.ls(Jfa(this.jJ));break;case 5:Lfa(this,1);break;case 6:Lfa(this,2);break;default:throw m("Unsupported pattern type.");}}; function Lfa(a,b){a.$I=b;a.ls(uo.DECIMAL_PATTERN);a.setMinimumFractionDigits(0);a.setMaximumFractionDigits(2);a.setSignificantDigits(2)} gb(T,function(a,b){var c=b||[0];if(0!=this.$I)throw m("Parsing of compact numbers is unimplemented");var d=ja;a=a[vb](/ /g,Nh);var e=a[ld](this.Ux,c[0])==c[0],f=a[ld](this.Fu,c[0])==c[0];e&&f&&(this.Ux[J]>this.Fu[J]?f=!1:this.Ux[J]<this.Fu[J]&&(e=!1));e?c[0]+=this.Ux[J]:f&&(c[0]+=this.Fu[J]);if(a[ld](uo.P0,c[0])==c[0])c[0]+=uo.P0[J],d=ea;else{var d=a,g=!1,k=!1,l=!1,n=1,q=uo.DECIMAL_SEP,s=uo.GROUP_SEP,u=uo.nca;if(0!=this.$I)throw m("Parsing of compact style numbers is not implemented");for(var w=O;c[0]< d[J];c[0]++){var z=d[Bb](c[0]),B=Mfa(z);if(0<=B&&9>=B)w+=B,l=!0;else if(z==q[Bb](0)){if(g||k)break;w+=Me;g=!0}else if(z==s[Bb](0)&&(Nh!=s[Bb](0)||c[0]+1<d[J]&&0<=Mfa(d[Bb](c[0]+1)))){if(g||k)break}else if(z==u[Bb](0)){if(k)break;w+=mf;k=!0}else if(z==Ie||z==Le)w+=z;else if(z==uo.o1[Bb](0)){if(1!=n)break;n=100;if(l){c[0]++;break}}else if(z==uo.jca[Bb](0)){if(1!=n)break;n=1E3;if(l){c[0]++;break}}else break}d=ma(w)/n}if(e){if(a[ld](this.QI,c[0])!=c[0])return ja;c[0]+=this.QI[J]}else if(f){if(a[ld](this.rC, c[0])!=c[0])return ja;c[0]+=this.rC[J]}return f?-d:d}); ua(T,function(a){if(ga(a))return uo.Noa;var b=[],c;var d=null===this.Aaa?a:this.Aaa,e=a;0==this.$I?c=zo:(d=h.abs(d),e=h.abs(e),c=Nfa(this,1>=d?0:Ao(d)).S0,e/=h.pow(10,c),Bo(this,e),d/=h.pow(10,c),d=Bo(this,d),c=Nfa(this,c+Ao(d.cba)));a/=h.pow(10,c.S0);b[C](c.prefix);d=0>a||0==a&&0>1/a;b[C](d?this.Fu:this.Ux);if(na(a))if(a=a*(d?-1:1)*this.Vi,this.OQ)if(0==a)Co(this,a,this.po,b),Ofa(this,0,b);else{e=h.log(a)/h.log(10);e=h[t](e+2E-15);a/=h.pow(10,e);var f=this.po;if(1<this.NQ&&this.NQ>this.po){for(;0!= e%this.NQ;)a*=10,e--;f=1}else 1>this.po?(e++,a/=10):(e-=this.po-1,a*=h.pow(10,this.po-1));Co(this,a,f,b);Ofa(this,e,b)}else Co(this,a,this.po,b);else b[C](uo.P0);b[C](d?this.rC:this.QI);b[C](c.zg);return b[ie](O)});function Bo(a,b){var c=h.pow(10,a.Yx),d=0>=a.fy?h[D](b*c):h[t](Pfa(b*c,a.fy,a.Yx)),e;na(d)?(e=h[t](d/c),c=h[t](d-e*c)):(e=b,c=0);return{cba:e,Ypa:c}} function Co(a,b,c,d){if(a.hs>a.Yx)throw m("Min value must be less than max value");b=Bo(a,b);var e=h.pow(10,a.Yx),f=b.cba,g=b.Ypa,k=0==f?0:Ao(f)+1,l=0<a.hs||0<g||a.Xaa&&k<a.fy;b=a.hs;l&&(b=a.Xaa&&0<a.fy?a.fy-k:a.hs);for(var n=O,k=f;1E20<k;)n=Oe+n,k=h[D](k/10);var n=k+n,q=uo.DECIMAL_SEP,s=uo.GROUP_SEP,k=xo?48:uo.z1[Xd](0),u=n[J];if(0<f||0<c){for(f=u;f<c;f++)d[C](String[qd](k));for(f=0;f<u;f++)d[C](String[qd](k+1*n[Bb](f))),1<u-f&&0<a.b0&&1==(u-f)%a.b0&&d[C](s)}else l||d[C](String[qd](k));(a.waa||l)&& d[C](q);a=O+(g+e);for(c=a[J];a[Bb](c-1)==Oe&&c>b+1;)c--;for(f=1;f<c;f++)d[C](String[qd](k+1*a[Bb](f)))}function Ofa(a,b,c){c[C](uo.nca);0>b?(b=-b,c[C](uo.Kqa)):a.xaa&&c[C](uo.Lqa);b=O+b;for(var d=xo?Oe:uo.z1,e=b[J];e<a.cR;e++)c[C](d);c[C](b)}function Mfa(a){a=a[Xd](0);if(48<=a&&58>a)return a-48;var b=uo.z1[Xd](0);return b<=a&&a<b+10?a-b:-1} function yo(a,b,c){for(var d=O,e=!1,f=b[J];c[0]<f;c[0]++){var g=b[Bb](c[0]);if(g==Ee)c[0]+1<f&&b[Bb](c[0]+1)==Ee?(c[0]++,d+=Ee):e=!e;else if(e)d+=g;else switch(g){case qe:case Oe:case Je:case Me:case Ye:return d;case eda:if(c[0]+1<f&&b[Bb](c[0]+1)==eda)c[0]++,d+=a.jJ;else switch(a.Dna){case 0:d+=vo[a.jJ][1];break;case 2:var g=a.jJ,k=vo[g],d=d+(g==k[1]?g:g+ne+k[1]);break;case 1:d+=vo[a.jJ][2]}break;case we:if(1!=a.Vi)throw m(pba);a.Vi=100;d+=uo.o1;break;case fda:if(1!=a.Vi)throw m(pba);a.Vi=1E3;d+= uo.jca;break;default:d+=g}}return d}var zo={prefix:O,zg:O,S0:0};function Nfa(a,b){var c=1==a.$I?to.oqa:to.nqa;if(3>b)return zo;b=h.min(14,b);c=c[h.pow(10,b)];if(!c)return zo;c=c.other;return c&&c!=Oe?(c=/([^0]*)(0+)(.*)/[sb](c))?{prefix:c[1],zg:c[3],S0:b-(c[2][J]-1)}:zo:zo}function Ao(a){for(var b=0;1<=(a/=10);)b++;return b}function Pfa(a,b,c){if(!a)return a;b=b-Ao(a)-1;if(b<-c)return c=h.pow(10,c),h[D](a/c)*c;c=h.pow(10,b);return h[D](a*c)/c};ua(qo[K],qo[K][Kb]);qo.Format={FULL_DATE:0,LONG_DATE:1,MEDIUM_DATE:2,SHORT_DATE:3,FULL_TIME:4,LONG_TIME:5,MEDIUM_TIME:6,SHORT_TIME:7,FULL_DATETIME:8,LONG_DATETIME:9,MEDIUM_DATETIME:10,SHORT_DATETIME:11};var Do=Hfa;ua(wo[K],wo[K][Kb]);wo.setEnforceAsciiDigits=function(a){xo=a};wo.isEnforceAsciiDigits=function(){return xo};var Eo=uo;oo.createTimeZone=po;function Fo(){}Fo[K].Ee=function(a){return this.$da(a)};function Go(a){this[Fc](a)}X(Go,Fo);Ma(Go[K],function(a){a=new jn([a||{},{formatType:nh,valueType:pg}]);this.fe=a.R(dh);this.le=null;this.Ena=Hn(a,fca,Qfa);this.wna=Hn(a,Yca,Rfa);this.Cna=pn(a,Xba,!1);this.bba=null;a=tn(a,Xca);null!=a&&(this.bba=oo.createTimeZone(60*-a))});var Ho=qo[vd],Qfa={Vua:Ag,qva:Sg,wva:Vg,SHORT:nh},Rfa={Sra:og,Tra:pg,uwa:vh}; function Sfa(a,b){switch(a){case og:switch(b){case Ag:return qo[vd].FULL_DATE;case Sg:return qo[vd].LONG_DATE;case Vg:return qo[vd].MEDIUM_DATE;case nh:return qo[vd].SHORT_DATE}case pg:switch(b){case Ag:return qo[vd].FULL_DATETIME;case Sg:return qo[vd].LONG_DATETIME;case Vg:return qo[vd].MEDIUM_DATETIME;case nh:return qo[vd].SHORT_DATETIME}case vh:switch(b){case Ag:return qo[vd].FULL_TIME;case Sg:return qo[vd].LONG_TIME;case Vg:return qo[vd].MEDIUM_TIME;case nh:return qo[vd].SHORT_TIME}default:return qo[vd].FULL_DATETIME}} Go[K].Dk=function(a){switch(a){case Sf:a=Do.YEAR_FULL;break;case Bf:a=jba;break;case vf:a=Do.YEAR_MONTH_ABBR;break;case jf:a=qo[vd].SHORT_DATE;break;default:a=qo[vd].SHORT_DATETIME}this[Fc]({pattern:a,timeZone:0})};ua(Go[K],function(a,b){var c=Fn(Rfa,a.D(b));if(c==og||c==pg)for(var c=this.cN(c),d=a.M(),e=0;e<d;e++){var f=a[I](e,b),f=Tfa(this,c,f);a.uH(e,b,f)}});Go[K].$da=function(a){this.le||(this.le=this.cN(this.wna));return Tfa(this,this.le,a)}; Go[K].cN=function(a){var b=this.fe;null!=b||(b=Sfa(a,this.Ena));return new qo(b)};function Tfa(a,b,c){if(null===c)return O;var d=a.bba;null==d&&(d=oo.createTimeZone(c[le]()));c=new Date(c[bc]());a.Cna&&c.setMinutes(0);return b[Kb](c,d)};function Io(a){var b=new jn([a||{},{decimalSymbol:Ufa,groupingSymbol:Vfa,fractionDigits:2,negativeParens:!1,prefix:O,suffix:O,scaleFactor:1}]);this.oy=vn(b,gca);a&&di(a.fractionDigits)&&ga(a.fractionDigits)&&(this.oy=ja);this.Ipa=zn(b,bca);this.v1=zn(b,qca);this.uca=zn(b,Kca);this.vca=zn(b,th);this.p$=En(b,zca);this.tca=pn(b,Aca);this.fe=An(b,dh);this.QG=sn(b,Mca);if(0>=this.QG)throw m("Scale factor must be a positive number.");}X(Io,Fo);var Ufa=Eo.DECIMAL_SEP,Vfa=Eo.GROUP_SEP,Jo=Eo.DECIMAL_PATTERN; ua(Io[K],function(a,b){if(a.D(b)==Yg)for(var c=0;c<a.M();c++){var d=a[I](c,b);if(null!=d){var e=this.Ee(d);a.uH(c,b,e);!mi(this.p$)&&0>d&&a[Dc](c,b,sh,Yba+this.p$+Ye)}}}); Io[K].$da=function(a){var b=null,b=a/this.QG;if(null===this.fe){if(ga(this.oy))return String(a);this.tca&&(b=h.abs(b));var c=b;0==this.oy&&(c=h[D](c));b=[];0>c&&(c=-c,b[C](Le));var d=h.pow(10,this.oy),e=h[D](c*d),c=String(h[t](e/d)),d=String(e%d);if(3<c[J]&&this.v1)for(e=c[J]%3,0<e&&(b[C](c[ae](0,e),this.v1),c=c[ae](e));3<c[J];)b[C](c[ae](0,3),this.v1),c=c[ae](3);b[C](c);0<this.oy&&(b[C](this.Ipa),d[J]<this.oy&&(d=uaa+d),b[C](d[ae](d[J]-this.oy)));b=b[ie](O);b=this.uca+b+this.vca;this.tca&&0>a&&(b= Fe+b+Ge)}else a=(new wo(this.fe))[Kb](b),b=this.uca+a+this.vca;return b};function Wfa(a){return null==a?null:ei(a.Mx)?a:Yh(a)?Xfa(a):new Ko(a)}function Yfa(a){var b={};if(Vh(a)!=$g||$h(a))b.v=null!=a?a:null,b.f=null;else{b.v="undefined"==typeof a.v?null:a.v;var c=typeof a.f;if("undefined"==c||c==Xg)b.f=null;else if(c==rh)b.f=a.f;else throw m("Formatted value ('f'), if specified, must be a string.");c=typeof a.p;if(c==$g)b.p=a.p;else if(c!=Xg&&"undefined"!=c)throw m("Properties ('p'), if specified, must be an Object.");}return{v:b.v,f:b.f,p:b.p}} function Zfa(a,b,c){if(typeof b==$g&&mg in b){if(cca in b&&typeof b.desc!=jg)throw m('Property "desc" in '+c+" must be boolean.");if($ba in b&&!ei(b.compare))throw m('Property "compare" in '+c+" must be a function.");}else throw m(c+' must be an object with a "column" property.');Lo(a,b.column)} function $fa(a,b,c){function d(d,e){for(var f=0;f<c[J];f++){var g=c[f],k=g.column,l=b(d,k),B=b(e,k),k=g.compare?null===l?null===B?0:-1:null===B?1:g.compare(l,B):Mo(a.D(k),l,B);if(0!=k)return k*(g.desc?-1:1)}return 0}if(ei(c))d=c;else if(typeof c==Yg)Lo(a,c),c=[{column:c}];else if(typeof c==$g)if(Zh(c)){if(1>c[J])throw m("sortColumns is an empty array. Must have at least one element.");for(var e={},f=[],g=0;g<c[J];g++){var k,l=c[g];if(typeof c[g]==Yg)k=c[g],Lo(a,k),l={column:c[g]};else if(typeof c[g]== $g)k=c[g].column,Zfa(a,c[g],Pca+g+$f);else throw m("sortColumns is an array, but not composed of only objects or numbers.");if(k in e)throw m("Column index "+k+" is duplicated in sortColumns.");e[k]=!0;f[C](l)}c=f}else Zfa(a,c,Oca),c=[c];return d}function No(a,b){var c=a.M();if(0<c){if(h[t](b)!==b||0>b||b>=c)throw m("Invalid row index "+b+". Should be in the range [0-"+(c-1)+"].");}else throw m("Table has no rows.");} function Lo(a,b){var c=a.H();if(0<c){if(h[t](b)!==b||0>b||b>=c)throw m("Invalid column index "+b+". Should be an integer in the range [0-"+(c-1)+"].");}else throw m("Table has no columns.");}function Oo(a,b,c){a=a.D(b);if(!aga(c,a))throw m(qba+c+baa+a+" in column index "+b);} function aga(a,b){if(null==a)return!0;var c=typeof a;switch(b){case Yg:if(c==Yg)return!0;break;case rh:if(c==rh)return!0;break;case jg:if(c==jg)return!0;break;case og:case pg:if($h(a))return!0;break;case wh:if(Zh(a)&&2<a[J]&&5>a[J]){for(var c=!0,d=0;d<a[J];d++){var e=a[d];if(typeof e!=Yg||e!=h[t](e)){c=!1;break}}if(0>a[0]||0>a[1]||59<a[1]||0>a[2]||59<a[2])c=!1;4==a[J]&&(0>a[3]||999<a[3])&&(c=!1);if(c)return!0}}return!1} function Mo(a,b,c){if(null==b)return null==c?0:-1;if(null==c)return 1;switch(a){case wh:for(a=0;3>a;a++){if(b[a]<c[a])return-1;if(c[a]<b[a])return 1}b=4>b[J]?0:b[3];c=4>c[J]?0:c[3];return b<c?-1:c<b?1:0;default:return b<c?-1:c<b?1:0}}function bga(a,b){Lo(a,b);var c=a.D(b),d=null,e=null,f,g,k=a.M();for(f=0;f<k;f++)if(g=a[I](f,b),null!=g){e=d=g;break}if(null==d)return{min:null,max:null};for(f++;f<k;f++)g=a[I](f,b),null!=g&&(0>Mo(c,g,d)?d=g:0>Mo(c,e,g)&&(e=g));return{min:d,max:e}} function cga(a,b){for(var c=$fa(a,function(b,c){return a[I](b,c)},b),d=[],e=a.M(),f=0;f<e;f++)d[C](f);dj(d,c);return d}function dga(a,b){Lo(a,b);var c=a.M();if(0==c)return[];for(var d=[],e=0;e<c;++e)d[C](a[I](e,b));var f=a.D(b);dj(d,function(a,b){return Mo(f,a,b)});var c=d[0],g=[];g[C](c);for(e=1;e<d[J];e++){var k=d[e];0!=Mo(f,k,c)&&g[C](k);c=k}return g} function ega(a,b,c){if(ei(b))return b(a,c);for(var d=0;d<b[J];d++){var e=b[d],f=e.column,g=a[I](c,f),k=a.D(f);if(Dh in e){if(0!==Mo(k,g,e[id]))return!1}else if(null!=e.minValue||null!=e.maxValue)if(null==g||null!=e.minValue&&0>Mo(k,g,e.minValue)||null!=e.maxValue&&0<Mo(k,g,e.maxValue))return!1;if(ei(e[bd])&&!e[bd](g,c,f,a))return!1}return!0} function fga(a,b){if(!ei(b)){if(!Zh(b)||0==b[J])throw m("columnFilters must be a non-empty array");for(var c={},d=0;d<b[J];d++){if(typeof b[d]!=$g||!(mg in b[d])){if(!(Dh in b[d]||Wg in b[d]||Ug in b[d]))throw m(Zba+d+'] must have properties "column" and "value", "minValue"or "maxValue"');if(Dh in b[d]&&(Wg in b[d]||Ug in b[d]))throw m(Zba+d+'] must specify either "value" or range properties ("minValue" and/or "maxValue"');}var e=b[d].column;if(e in c)throw m("Column index "+e+" is duplicate in columnFilters."); Lo(a,e);Oo(a,e,b[d][id]);c[e]=!0}}c=[];d=a.M();for(e=0;e<d;e++)ega(a,b,e)&&c[C](e);return c}function Po(a,b){var c;b==wh?(c=[],c[C](a[0]),c[C]((10>a[1]?Oe:O)+a[1]),c[C]((10>a[2]?Oe:O)+a[2]),c=c[ie](Xe),3<a[J]&&0<a[3]&&(c+=Me+(10>a[3]?Re:100>a[3]?Oe:O)+a[3])):b==og?(c=new Go({formatType:Vg,valueType:og}),c=c.Ee(a)):b==pg?(c=new Go({formatType:Vg,valueType:pg}),c=c.Ee(a)):b==Yg?(c=new Io({fractionDigits:ja}),c=c.Ee(a)):c=null!=a?String(a):O;return c} function gga(a,b){var c={};if(!Yh(a))throw m("Not an array");if(0<a[J]){var d=!b,e,f;if(d)e=Gi(a[0],function(a){if(bi(a))return{label:a};if(ai(a))return Pj(a);throw m("Unknown header type: "+a);});else{e=[];f=0;Yh(a[0])?f=a[0][J]:ai(a[0])&&lg in a[0]&&Yh(a[0].c)&&(f=a[0].c[J]);for(var g=0;g<f;g++)e[C]({type:void 0})}c.cols=e;c.rows=[];f=e[J];for(var k=ha(e[J]),d=d?$i(a,1):a,g=0;g<d[J];g++){var l=d[g];if(Yh(l))l={c:l};else if(!(ai(l)&&lg in l))throw m("Invalid row type for row "+g);if(l.c[J]!==e[J])throw m("Row "+ g+" has "+l.c[J]+" columns, but must have "+e[J]);l.c=Yi(l.c);c[Kc][C](l);for(var n=0;n<f;n++){var q=rh,q=l.c[n];ai(q)&&(Ch in q||vg in q)?q=q.v:l.c[n]={v:q};if(null==e[n][H]&&(null==k[n]||k[n]===og)&&null!=q){if(bi(q))q=rh;else if(di(q))q=Yg;else if(Yh(q))q=wh;else if(ci(q))q=jg;else if($h(q))q=new Date(q),q=0!==q[$b]()+q[Qc]()+q[Id]()+q[Ld]()?pg:og;else throw m("Unknown type of value in "+g+Je+n);k[n]=q}}}Y(c[Nb],function(a,b){null!=a[H]||ab(a,k[b]||rh)})}return c} function Xfa(a,b){return new Ko(gga(a,b))}function hga(a,b,c,d){for(var e=null,f=a.M();(d?0<=b:b<f)&&null===e;)e=a[I](b,c),b+=d?-1:1;return e};var iga={Fwa:Pe,Gwa:Qe};function Ko(a,b){this.Tx=b===Pe?Pe:Qe;if(!ei(this.Mx))throw m('You called google.visualization.DataTable() without the "new" keyword');a?(bi(a)?a=lo(a):jga(a),this.uf=[],this.tf=[],this.vs=a.p||null,null!=a[Nb]&&Y(a[Nb],W(function(a){this.mg(a)},this)),null!=a[Kc]&&(this.tf=a[Kc])):(this.uf=[],this.tf=[],this.vs=null);this.Ad=[]}var kga={rua:jg,Kva:Yg,pwa:rh,Sra:og,wwa:wh,Tra:pg}; function jga(a){var b=a[Nb]||[];a=a[Kc]||[];for(var c=b[J],d=0;d<c;d++){var e=b[d][H];if(e==og||e==pg)for(var e=a[J],f=0;f<e;f++){var g=a[f].c[d];if(g){var k=g.v;if($h(k))return;bi(k)&&(g=io(g),g=lo(g),a[f].c[d]=g)}}}}T=Ko[K];T.uf=null;T.Tx=null;T.tf=null;T.vs=null;T.Ad=null;T.M=function(){return this.tf[J]};T.H=function(){return this.uf[J]};T.jf=function(a){Lo(this,a);return this.uf[a].id||O};xa(T,function(a){for(var b=this.uf,c=0;c<b[J];c++)if(b[c].id==a)return c;return-1}); T.cb=function(a){Lo(this,a);return this.uf[a][Rc]||O};T.ju=function(a){Lo(this,a);return this.uf[a][ub]};T.Ss=function(a){a=this.Li(a,ih);return a=bi(a)?a:O};T.D=function(a){Lo(this,a);return this.uf[a][H]};fb(T,function(a,b){No(this,a);Lo(this,b);var c=this.Pr(a,b),d=null;c&&(d=c.v,d=Qh(d)?d:null);return d});T.Pr=function(a,b){return this.tf[a].c[b]}; T.Aa=function(a,b){No(this,a);Lo(this,b);var c=this.Pr(a,b),d=O;if(c)if("undefined"!=typeof c.f&&null!=c.f)d=c.f;else{this.Ad[a]=this.Ad[a]||[];var e=this.Ad[a],c=e[b]||{};e[b]=c;Qh(c.Pe)?d=c.Pe:(e=this[I](a,b),null===e||(d=Po(e,this.D(b))),c.Pe=d)}return d};T.Ao=function(a,b,c){No(this,a);Lo(this,b);return(a=(a=this.Pr(a,b))&&a.p)&&c in a?a[c]:null};T.sm=function(a,b){No(this,a);Lo(this,b);var c=this.Pr(a,b);c||(c={v:null,f:null},this.tf[a].c[b]=c);c.p||(c.p={});return c.p};T.Mx=function(){return this.vs}; T.uR=function(a){var b=this.vs;return b&&a in b?b[a]:null};T.gta=function(a){this.vs=a};T.hta=function(a,b){this.vs||(this.vs={});this.vs[a]=b};T.wa=function(a,b,c){this.al(a,b,c,void 0,void 0)};T.uH=function(a,b,c){this.al(a,b,void 0,c,void 0)};T.kv=function(a,b,c){this.al(a,b,void 0,void 0,c)};T.setProperty=function(a,b,c,d){this.sm(a,b)[c]=d}; T.al=function(a,b,c,d,e){No(this,a);Lo(this,b);var f=this.Ad[a];f&&f[b]&&(f[b]={});f=this.Pr(a,b);f||(f={},this.tf[a].c[b]=f);"undefined"!=typeof c&&(this.D(b)==Yg&&bi(c)&&!ga(c)?f.v=ia(c):(Oo(this,b,c),f.v=c));"undefined"!=typeof d&&(f.f=d);Qh(e)&&(f.p=ai(e)?e:{})};T.fta=function(a,b){No(this,a);this.tf[a].p=b};T.s4=function(a,b,c){this.mJ(a)[b]=c};T.Yq=function(a,b){No(this,a);var c=this.tf[a];return(c=c&&c.p)&&b in c?c[b]:null};T.mJ=function(a){No(this,a);a=this.tf[a];a.p||(a.p={});return a.p}; T.Tsa=function(a,b){Lo(this,a);Qa(this.uf[a],b)};T.paa=function(a,b){Lo(this,a);this.uf[a].p=b};T.Sv=function(a,b,c){this.Sq(a)[b]=c};T.Li=function(a,b){Lo(this,a);var c=this.uf[a];return(c=c&&c.p)&&b in c?c[b]:null};T.Sq=function(a){Lo(this,a);a=this.uf[a];a.p||(a.p={});return a.p}; T.jda=function(a,b,c,d){a!==this.uf[J]&&(this.Ad=[],Lo(this,a));ai(b)||(b={id:d||O,label:c||O,pattern:O,type:b});c=b[H];if(!Jj(kga,c))throw m("Invalid type, "+c+', for column "'+(b[Rc]||b.id||a)+'".');if(c=b.role)d=b.p||{},null==d.role&&(d.role=c,b.p=d);this.uf[he](a,0,b);for(b=0;b<this.tf[J];b++)this.tf[b].c[he](a,0,{v:null,f:null})};T.mg=function(a,b,c){this.jda(this.uf[J],a,b,c);return this.uf[J]-1};function lga(a,b,c){c=Yfa(c);Oo(a,b,c.v);return c} T.sY=function(a,b){a!==this.tf[J]&&(this.Ad=[],No(this,a));var c;if(Yh(b))c=b;else if(typeof b==Yg){if(b!=h[t](b)||0>b)throw m("Invalid value for numOrArray: "+b+". If numOrArray is a number it should be a nonnegative integer.");c=gj(null,b)}else throw m("Invalid value for numOrArray. Should be a number or an array of arrays of cells.");for(var d=[],e=0;e<c[J];e++){var f=c[e],g=[];if(null===f)for(f=0;f<this.uf[J];f++)g[C]({v:null,f:null});else if(Yh(f)){if(f[J]!=this.uf[J])throw m("Row given with size different than "+ this.uf[J]+" (the number of columns in the table).");for(var k=0;k<f[J];k++)g[C](lga(this,k,f[k]))}else throw m("Every row given must be either null or an array.");f={};f.c=g;d[C](f);1E4==d[J]&&(g=d,gi(Vi,this.tf,a,0)[Mc](null,g),a+=d[J],d=[])}c=d;gi(Vi,this.tf,a,0)[Mc](null,c);return a+d[J]-1};T.Cz=function(a){if(typeof a==Yg||Yh(a))return this.sY(this.tf[J],a);throw m("Argument given to addRows must be either a number or an array");}; T.lq=function(a){if(Yh(a))return this.Cz([a]);if(null!=a)throw m("If argument is given to addRow, it must be an array, or null");return this.Cz(1)};T.qp=function(a){return bga(this,a)};T.Co=function(a){return cga(this,a)};nb(T,function(a){this.Ad=[];a=$fa(this,function(a,c){var d=a.c[c];return d?d.v:null},a);dj(this.tf,a)});T.sR=function(a){Lo(this,a);return a};T.pR=function(a){No(this,a);return a};T.o=function(){return new Ko(this.Ir())}; T.Ir=function(){return jo({cols:this.uf,rows:this.tf,p:this.vs},ko)};Fa(T,function(){return Tm(this.Ir())});T.QR=function(a){return dga(this,a)};T.WJ=function(a){return fga(this,a)};T.hea=function(a,b){0>=b||(this.Ad=[],No(this,a),a+b>this.tf[J]&&(b=this.tf[J]-a),this.tf[he](a,b))};T.mB=function(a){this.hea(a,1)};T.gea=function(a,b){if(!(0>=b)){this.Ad=[];Lo(this,a);a+b>this.uf[J]&&(b=this.uf[J]-a);this.uf[he](a,b);for(var c=0;c<this.tf[J];c++)this.tf[c].c[he](a,b)}};T.a2=function(a){this.gea(a,1)};function Qo(a){this.b=a||{};So||(So=Wn()+saa)}var So=null,mga={red:fh,blue:fg,green:Cg};function To(a,b,c){0<b&&c[C](Aaa,So,a,paa,b,pe)} ua(Qo[K],function(a,b){if(a.D(b)==Yg){var c=this.b,d=c.min,e=c.max,f=null;if(null==d||null==e)f=a.qp(b),null==e&&(e=f.max),null==d&&(d=h.min(0,f.min));d>=e&&(f=f||a.qp(b),e=f.max,d=f.min);d==e&&(0==d?e=1:0<d?d=0:e=0);var f=e-d,g=c.base||0,g=h.max(d,h.min(e,g)),k=c[r]||100,l=c.showValue;null==l&&(l=!0);for(var n=h[D]((g-d)/f*k),q=k-n,s=0;s<a.M();s++){var u=a[I](s,b),w=[],u=h.max(d,h.min(e,u)),z=h[xb]((u-d)/f*k);w[C](Baa);To(kh,1,w);var B=nga(c.colorPositive,fg),F=nga(c.colorNegative,fh),M=c.drawZeroLine? 1:0;0<n?u<g?(To(Gh,z,w),To(F,n-z,w),0<M&&To(Kh,M,w),To(Gh,q,w)):(To(Gh,n,w),0<M&&To(Kh,M,w),To(B,z-n,w),To(Gh,k-z,w)):(To(B,z,w),To(Gh,k-z,w));To(kh,1,w);u=a.Ao(s,b,Gba);null==u&&(u=a.Aa(s,b),a[Dc](s,b,Gba,u));l&&(w[C](Nh),w[C](u));w[C](xaa);a.uH(s,b,w[ie](O))}}});function nga(a,b){a=(a||O)[ke]();return mga[a]||b};function Yo(a,b,c,d){$h(a)&&(a=a[bc]());$h(b)&&(b=b[bc]());Yh(a)&&(a=Zo(a));Yh(b)&&(b=Zo(b));this.Zca=a;this.Bqa=b;this.qk=c;this.yx=d}Pa(Yo[K],function(a){var b=this.Zca,c=this.Bqa;if(null==a)return null==b&&null==c;$h(a)?a=a[bc]():Yh(a)&&(a=Zo(a));return(null==b||a>=b)&&(null==c||a<c)});Yo[K].Hd=function(){return this.qk};Yo[K].qr=function(){return this.yx};function $o(a,b,c,d,e){Yo[L](this,a,b,c,O);this.I1=b-a;0>=this.I1&&(this.I1=1);this.cqa=rm(mm(d).vd);this.dqa=rm(mm(e).vd)}X($o,Yo); $o[K].qr=function(a){if(!di(a))return O;a=vm(this.cqa,this.dqa,1-(a-this.Zca)/this.I1);return sm(a[0],a[1],a[2])};function ap(){this.BQ=[]}ap[K].addRange=function(a,b,c,d){this.BQ[C](new Yo(a,b,c,d))};ap[K].msa=function(a,b,c,d,e){this.BQ[C](new $o(a,b,c,d,e))}; ua(ap[K],function(a,b){var c=a.D(b);if(c==Yg||c==rh||c==og||c==pg||c==wh)for(c=0;c<a.M();c++){for(var d=a[I](c,b),e=O,f=0;f<this.BQ[J];f++){var g=this.BQ[f];if(g[Lc](d)){f=g.Hd();d=g.qr(d);f&&(e+=Yba+f+Ye);d&&(e+=gg+d+Ye);break}}a[Dc](c,b,sh,e)}});function Zo(a){return 36E5*a[0]+6E4*a[1]+1E3*a[2]+(4==a[J]?a[3]:0)};function bp(a){this.fe=a||O}function oga(a,b,c,d,e,f,g){return 0<f&&g[f-1]==Bba?d:b.Aa(a,c[la(e,10)])}ua(bp[K],function(a,b,c,d){var e=b[0];null!=c&&Vh(c)==Yg&&(e=c);c=d||null;for(d=0;d<a.M();d++){var f=this.fe[vb](/{(\d+)}/g,gi(oga,d,a,b)),f=f[vb](/\\(.)/g,faa);c?a[Dc](d,e,c,f):a.uH(d,e,f)}});V(oca,Io,void 0);ua(Io[K],Io[K][Kb]);Io[K].formatValue=Io[K].Ee;V("google.visualization.NumberFormat.useNativeCharactersIfAvailable",function(a){wo.setEnforceAsciiDigits(!a)},void 0);V("google.visualization.NumberFormat.DECIMAL_SEP",Ufa,void 0);V("google.visualization.NumberFormat.GROUP_SEP",Vfa,void 0);V("google.visualization.NumberFormat.DECIMAL_PATTERN",Jo,void 0);V("google.visualization.ColorFormat",ap,void 0);ua(ap[K],ap[K][Kb]);ap[K].addRange=ap[K].addRange;ap[K].addGradientRange=ap[K].msa; V("google.visualization.BarFormat",Qo,void 0);ua(Qo[K],Qo[K][Kb]);V("google.visualization.ArrowFormat",co,void 0);ua(co[K],co[K][Kb]);V("google.visualization.PatternFormat",bp,void 0);ua(bp[K],bp[K][Kb]);V("google.visualization.DateFormat",Go,void 0);ua(Go[K],Go[K][Kb]);Go[K].formatValue=Go[K].Ee;V(oca,Io,void 0);ua(Io[K],Io[K][Kb]);V("google.visualization.TableColorFormat",ap,void 0);V("google.visualization.TableBarFormat",Qo,void 0);ua(Qo[K],Qo[K][Kb]); V("google.visualization.TableArrowFormat",co,void 0);ua(co[K],co[K][Kb]);V("google.visualization.TablePatternFormat",bp,void 0);ua(bp[K],bp[K][Kb]);V("google.visualization.TableDateFormat",Go,void 0);;window.google&&window.google.loader&&window.google.loader.eval&&window.google.loader.eval.visualization&&(window.google.loader.eval.visualization=function(){eval(arguments[0])}); function cp(a,b){return a.onload=b}function dp(a,b){return a.dispatchEvent=b}function ep(a,b){return a.setPath=b}function fp(a,b){return a.screenX=b}function gp(a,b){return a.screenY=b}function hp(a,b){return a.send=b}function ip(a,b){return a.getName=b}function jp(a,b){return a.keyCode=b}function kp(a,b){return a.handleEvent=b}function lp(a,b){return a.bind=b}function mp(a,b){return a.altKey=b}function np(a,b){return a.index=b}function op(a,b){return a.setOptions=b} function pp(a,b){return a.getOption=b}function qp(a,b){return a.state=b}function rp(a,b){return a.options=b}function sp(a,b){return a.getState=b}function tp(a,b){return a.onreadystatechange=b}function up(a,b){return a.cancel=b}function vp(a,b){return a.metaKey=b}function wp(a,b){return a.currentTarget=b}function xp(a,b){return a.clientX=b}function yp(a,b){return a.clientY=b}function zp(a,b){return a.stop=b}function Ap(a,b){return a.title=b}function Bp(a,b){return a.abort=b} function Cp(a,b){return a.visualization=b}function Dp(a,b){return a.target=b}function Ep(a,b){return a.draw=b} var Fp="relatedTarget",Gp="clearTimeout",Z="data",Hp="preventDefault",$="dispatchEvent",Ip="setPath",Jp="MAX_VALUE",Kp="send",Lp="getName",Mp="charCode",Np="keyCode",Op="LatLng",Pp="handleEvent",Qp="getColumnIndex",Rp="source",Sp="bounds",Tp="altKey",Up="create",Vp="table",Wp="toJSON",Xp="LatLngBounds",Yp="setTimeout",Zp="stopPropagation",$p="setOptions",aq="message",bq="maps",cq="getOption",dq="state",eq="options",fq="protocol",hq="getState",kq="removeNode",lq="offsetX",mq="offsetY",nq="gadgets", oq="open",pq="cancel",qq="RequestParameters",rq="button",Cq="metaKey",Dq="currentTarget",Eq="readyState",Fq="addEventListener",Gq="parse",Hq="stop",Iq="abort",Jq="ctrlKey",Kq="getPath",Lq="view",Mq="target",Nq="draw",Oq="shiftKey",pga="\n\x3c/script>",qga="\r",rga=" [",sga=" at line ",tga=" does not fit either the Control or Visualization specification.",uga=" does not fit the Control specification while handling 'ready' event.",vga=" does not fit the Control specification.",Pq=" must be of type '", wga='""',xga='">\n',yga="%22",zga="%27",Aga="&requireauth=1&",Qq="'.",Rq="..",Bga="./",Sq=".format",Tq="/",Cga="/.",Dga="//",Ega="/chart.html",Fga="/chart.js",Gga="/gviz/tq",Uq="/tq",Vq="528",Wq="8",Hga=":\n",Iga=";sig:",Jga=";type:",Xq="<CRLF>",Kga="<EMPTY>",Yq="<EOF>",Zq="<EOR>",Lga='<script type="text/javascript" src="',$q="AnnotatedTimeLine",ar="AreaChart",br="AreaChart-stacked",cr="BarChart",dr="BubbleChart",er="CandlestickChart",Mga="Cannot bind a control to itself.",fr="ColumnChart",gr="ComboChart", Nga="Content-Type",Oga="Custom response handler must be a function.",Pga="Dashboard",Qga="GET",hr="Gauge",ir="GeoChart",jr="Histogram",kr="ImageRadarChart",lr="ImageSparkLine",Rga="Incompatible data table: ",Sga="Invalid DataView column type.",mr="Invalid data table format: column #",Tga="Invalid data table format: must have 3 columns.",nr="LineChart",Uga="MSXML2.XMLHTTP",Vga="MSXML2.XMLHTTP.3.0",Wga="MSXML2.XMLHTTP.6.0",or="Map",Xga="Microsoft.XMLHTTP",pr="MotionChart",Yga="Name",Zga="One or more participants failed to draw()", qr="OrgChart",rr="POST",sr="PieChart",$ga="Request timed out",tr="ScatterChart",ur="SteppedAreaChart",vr="Table",aha="The requested control and participant cannot be bound together, as this would introduce a dependency cycle",bha="Timed out after ",wr="Timeline",xr="TreeMap",cha="Type",yr="WordTree",dha="\\c",zr="^",eha="_table_query_refresh_interval",fha="_table_query_url",gha="a String",hha="abort",Ar="addTrendLine",Br="address",iha="an Array",Cr="annotatedtimeline",jha="application/x-www-form-urlencoded;charset=utf-8", Dr="block",Er="chart",Fr="click",Gr="complete",kha="content-type",lha="control",Hr="controls",Ir="corechart",mha="dashboard",Jr="data",Kr="datatable",nha="date|datetime",oha="detailed_message",pha="display: none; padding-top: 2px",Lr="domain",qha="domainAxis",rha="draw",Mr="drawing",sha="emptyString",Nr="error",Or="focusin",Pr="focusout",tha="gadgets.io.makeRequest",uha="gadgets.io.makeRequest failed",Qr="gauge",Rr="geochart",vha="google.maps.Geocoder",wha="google.visualization.LoadArgs",xha="google.visualization.Query", yha="google.visualization.events.addListener",zha="google.visualization.events.addOneTimeListener",Aha="google.visualization.events.removeAllListeners",Bha="google.visualization.events.removeListener",Cha="google.visualization.events.trigger",Sr="hasLabelsColumn",Dha="hl",Tr="http",Eha="http%",Fha="http://dummy.com",Gha="https%",Hha="identity",Ur="imagesparkline",Vr="img",Iha="invalid_query",Wr="json",Xr="keypress",Yr="latlng",Zr="linktable",as="makeRequest",Jha="make_request_failed",bs="map",cs= "markers",Kha="message",Lha="modifier",ds="motionchart",es="mousedown",fs="mouseout",gs="mouseover",Mha="ms, aborting",Nha="nodetable",Oha="not_modified",Pha="options",us="orgchart",Qha="padding: 2px",vs="pending",Rha="percent",Sha="position: absolute; top: 0; left: 0; z-index: 1;",Tha="pub",ws="ready",Uha="readystatechange",Vha="reason",Wha="refresh",xs="regioncode",ys="regions",Xha="reqId:",zs="right",As="select",Yha="series.1.lineWidth",Zha="series.1.pointSize",$ha="series.1.visibleInLegend",aia= "sig:",Bs="span",Cs="statechange",bia="stringify",cia="success",Ds="table",dia="targetAxes.0",eia="targetAxes.1",fia="targetAxis",Es="text",gia="the wrong type of data",Fs="tick",Gs="timeline",hia="timeline.taskMajor",iia="timeout",Hs="tooltip",jia="tqrt",Is="treemap",Js="ui",kia="ui.type",Ks="uichange",lia="user_not_authenticated",Ls="vAxis",Ms="warning",mia="window.event",nia="withCredentials",Ns="xhr",Os="xhrpost",oia="zx",Ps="|",pia="\u00d7"; function Qs(a){this.sna=qia(a);this.l0=a.status;this.Ku=[];this.Lu=[];this.Lu=a.warnings||[];this.Ku=a.errors||[];ria(this.Lu);ria(this.Ku);this.l0!=Nr&&(this.Z_=a.sig,this.t=new Ko(a[Vp],this.sna))}function ria(a){for(var b=0;b<a[J];b++){var c=a[b].detailed_message;if(c){var d=a[b],c=c?c[Ib](sia)&&!c[Ib](tia)?c:c[vb](/&/g,ze)[vb](/</g,Be)[vb](/>/g,Ae)[vb](/\"/g,De):O;d.detailed_message=c}}} var sia=/^[^<]*(<a(( )+target=('_blank')?("_blank")?)?( )+(href=('[^']*')?("[^"]*")?)>[^<]*<\/a>[^<]*)*$/,tia=/javascript((s)?( )?)*:/;function qia(a){a=a.version||Qe;return Jj(iga,a)?a:Qe}T=Qs[K];T.Z_=null;T.t=null;T.Ni=function(){return this.l0==Nr};T.f1=function(){return this.l0==Ms};function uia(a){for(var b=0;b<a.Ku[J];b++)if(a.Ku[b].reason==Oha)return!0;for(b=0;b<a.Lu[J];b++)if(a.Lu[b].reason==Oha)return!0;return!1}T.Pa=function(){return this.t}; function Rs(a,b){return a.Ni()&&a.Ku&&a.Ku[0]&&a.Ku[0][b]?a.Ku[0][b]:a.f1()&&a.Lu&&a.Lu[0]&&a.Lu[0][b]?a.Lu[0][b]:null}T.mca=function(){var a=Rs(this,Vha);return null!=a&&a!=O?[a]:[]};T.fI=function(){return Rs(this,Kha)||O};T.I0=function(){return Rs(this,oha)||O};var Ss={D2:"google-visualization-errors"};Ss.haa=Ss.D2+Le;Ss.kca=Ss.D2+Xe;Ss.t2=Ss.D2+"-all-";Ss.r_=Ss.kca+" container is null";Ss.Ima="background-color: #c00000; color: white; padding: 2px;";Ss.Kma="background-color: #fff4c2; color: black; white-space: nowrap; padding: 2px; border: 1px solid black;";Ss.Lma="font: normal 0.8em arial,sans-serif; margin-bottom: 5px;";Ss.Jma="font-size: 1.1em; color: #0000cc; font-weight: bold; cursor: pointer; padding-left: 10px; color: black;text-align: right; vertical-align: top;"; Ss.caa=0; Ss.td=function(a,b,c,d){if(!Ss.ME(a))throw m(Ss.r_+". message: "+b);c=Ss.Nma(b,c,d);var e=c.errorMessage;b=c.detailedMessage;c=c[eq];var f=null!=c.showInTooltip?!!c.showInTooltip:!0,g=(c[H]==Ms?Ms:Nr)==Nr?Ss.Ima:Ss.Kma,g=g+(c[x]?c[x]:O),k=!!c.removable;d=Ek();var e=d.h(Bs,{style:g},d[Cb](e)),g=Ss.haa+Ss.caa++,l=d.h(Q,{id:g,style:Ss.Lma},e);b&&(f?Ap(e,b):(f=fa[Qb](Bs),Wa(f,b),d[p](l,d.h(Q,{style:Qha},f))));k&&(b=d.h(Bs,{style:Ss.Jma},d[Cb](pia)),b.onclick=gi(Ss.N_,l),d[p](e,b));Ss.Mma(a,l);c.removeDuplicates&& Ss.Oma(a,l);return g};Ss.oc=function(a){if(!Ss.ME(a))throw m(Ss.r_);if(a=Ss.j2(a,!1))Ra(a[x],R),Wk(a)};Ss.TB=function(a,b){if(!Ss.ME(a))throw m(Ss.r_);if(!b)throw m(Ss.kca+" response is null");if(!b.Ni()&&!b.f1())return null;var c=b.mca(),d=!0;b.Ni()&&(d=!(Ri(c,lia)||Ri(c,Iha)));var c=b.fI(),e=b.I0(),d={showInTooltip:d};ab(d,b.Ni()?Nr:Ms);d.removeDuplicates=!0;return Ss.td(a,c,e,d)};Ss.Qsa=function(a){a=fa[gd](a);return Ss.w2(a)?(Ss.N_(a),!0):!1}; Ss.ac=function(a){a=fa[gd](a);return Ss.w2(a)?a[fe][fe]:null};Ss.UP=function(a,b){return function(){try{a[Mc](null,arguments)}catch(c){ei(b)?b(c):Ss.td(b,c[aq])}}};Ss.N_=function(a){var b=a[fe];Zk(a);0==b[Xb][J]&&Ra(b[x],R)};Ss.w2=function(a){return Sk(a)&&a.id&&ki(a.id,Ss.haa)&&(a=a[fe])&&a.id&&ki(a.id,Ss.t2)&&a[fe]?!0:!1}; Ss.Nma=function(a,b,c){var d=null!=a&&a?a:Nr,e=O,f={},g=arguments[J];2==g?b&&Vh(b)==$g?f=b:e=null!=b?b:e:3==g&&(e=null!=b?b:e,f=c||{});d=pi(d);e=pi(e);return{errorMessage:d,detailedMessage:e,options:f}};Ss.ME=function(a){return null!=a&&Sk(a)};Ss.j2=function(a,b){for(var c=a[Xb],d=null,e=Ek(),f=0;f<c[J];f++)if(c[f].id&&ki(c[f].id,Ss.t2)){d=c[f];e[kq](d);break}!d&&b&&(d=Ss.t2+Ss.caa++,d=Rk(Q,{id:d,style:pha},null));d&&((c=a[Sb])?e.FX(d,c):e[p](a,d));return d}; Ss.Mma=function(a,b){var c=Ss.j2(a,!0);Ra(c[x],Dr);c[p](b)};Ss.vra=function(a,b){var c=Ss.j2(a,!0);Y(c&&c[Xb],function(a){Ss.w2(a)&&b(a)})};Ss.Oma=function(a,b){var c=/id="?google-visualization-errors-[0-9]*"?/,d=xea(b),d=d[vb](c,O),e=[];Ss.vra(a,function(a){if(a!=b){var g=xea(a),g=g[vb](c,O);g==d&&e[C](a)}});Y(e,Ss.N_)};function Ts(a){var b;if(0==fa[cc](Gg)[J]){b=fa[cc](Mg)[0];var c=fa[cc](hg)[0],d=fa[Qb](Gg);b[Eb](d,c)}b=fa[cc](Gg)[0];c=fa[Qb](lh);ab(c,uh);c.src=a;b[p](c)}function via(a){return function(b){Ss.oc(a);var c=b.Ni();c&&Ss.TB(a,b);return!c}};function Us(){}Us[K].Mj=!1;Us[K].Bg=function(){return this.Mj};Us[K].W=function(){this.Mj||(this.Mj=!0,this.w())};function Vs(a,b){var c=gi(Ws,b);a.aK||(a.aK=[]);a.aK[C](W(c,void 0))}Us[K].w=function(){if(this.aK)for(;this.aK[J];)this.aK[rb]()()};function Ws(a){a&&typeof a.W==Bg&&a.W()}function wia(a){for(var b=0,c=arguments[J];b<c;++b){var d=arguments[b];Zh(d)?wia[Mc](null,d):Ws(d)}};function Xs(a,b){ab(this,a);Dp(this,b);wp(this,this[Mq]);this.defaultPrevented=this.xy=!1;this.zba=!0}Xs[K].w=function(){};Xs[K].W=function(){};Xs[K].stopPropagation=function(){this.xy=!0};Xs[K].preventDefault=function(){this.defaultPrevented=!0;this.zba=!1};function Ys(a){a[Hp]()};function Zs(a){Zs[ne](a);return a}Zs[ne]=Th;var xia=!kk||rk(9),yia=!kk||rk(9),zia=kk&&!qk(We);!mk||qk(Vq);lk&&qk("1.9b")||kk&&qk(Wq)||jk&&qk("9.5")||mk&&qk(Vq);lk&&!qk(Wq)||kk&&qk(We);var Aia=kk?Or:"DOMFocusIn",Bia=kk?Pr:"DOMFocusOut";function $s(a,b){Xs[L](this,a?a[H]:O);Dp(this,null);wp(this,null);this.relatedTarget=null;this.offsetY=this.offsetX=0;xp(this,0);yp(this,0);fp(this,0);gp(this,0);this.button=0;jp(this,0);this.charCode=0;this.ctrlKey=!1;mp(this,!1);this.shiftKey=!1;vp(this,!1);qp(this,null);this.O0=!1;this.Ka=null;a&&this[Fc](a,b)}X($s,Xs);var Cia=[1,4,2];T=$s[K]; Ma(T,function(a,b){var c=ab(this,a[H]);Dp(this,a[Mq]||a.srcElement);wp(this,b);var d=a[Fp];if(d){if(lk){var e;t:{try{Zs(d[nd]);e=!0;break t}catch(f){}e=!1}e||(d=null)}}else c==gs?d=a.fromElement:c==fs&&(d=a.toElement);this.relatedTarget=d;this.offsetX=mk||void 0!==a[lq]?a[lq]:a.layerX;this.offsetY=mk||void 0!==a[mq]?a[mq]:a.layerY;xp(this,void 0!==a[zd]?a[zd]:a.pageX);yp(this,void 0!==a[Ad]?a[Ad]:a.pageY);fp(this,a[Gb]||0);gp(this,a[Hb]||0);this.button=a[rq];jp(this,a[Np]||0);this.charCode=a[Mp]|| (c==Xr?a[Np]:0);this.ctrlKey=a[Jq];mp(this,a[Tp]);this.shiftKey=a[Oq];vp(this,a[Cq]);this.O0=fk?a[Cq]:a[Jq];qp(this,a[dq]);this.Ka=a;a.defaultPrevented&&this[Hp]()});function at(a,b){return xia?a.Ka[rq]==b:a[H]==Fr?0==b:!!(a.Ka[rq]&Cia[b])}function bt(a){return at(a,0)&&!(mk&&fk&&a[Jq])}T.stopPropagation=function(){$s.e[Zp][L](this);this.Ka[Zp]?this.Ka[Zp]():this.Ka.cancelBubble=!0}; T.preventDefault=function(){$s.e[Hp][L](this);var a=this.Ka;if(a[Hp])a[Hp]();else if(a.returnValue=!1,zia)try{(a[Jq]||112<=a[Np]&&123>=a[Np])&&jp(a,-1)}catch(b){}};T.Rpa=function(){return this.Ka};T.w=function(){};var ct="closure_listenable_"+(1E6*h[Cc]()|0);function dt(a){try{return!(!a||!a[ct])}catch(b){return!1}}var Dia=0;function Eia(a,b,c,d,e){this.ro=a;this.OR=null;this.src=b;ab(this,c);this.OC=!!d;this.Na=e;this.key=++Dia;this.GC=this.DR=!1}function et(a){a.GC=!0;a.ro=null;a.OR=null;a.src=null;a.Na=null};function ft(a){this.src=a;this.bh={};this.OJ=0}T=ft[K];T.add=function(a,b,c,d,e){var f=a[hc]();a=this.bh[f];a||(a=this.bh[f]=[],this.OJ++);var g=gt(a,b,d,e);-1<g?(b=a[g],c||(b.DR=!1)):(b=new Eia(b,this.src,f,!!d,e),b.DR=c,a[C](b));return b};va(T,function(a,b,c,d){a=a[hc]();if(!(a in this.bh))return!1;var e=this.bh[a];b=gt(e,b,c,d);return-1<b?(et(e[b]),Bi[he][L](e,b,1),0==e[J]&&(delete this.bh[a],this.OJ--),!0):!1}); function ht(a,b){var c=b[H];if(!(c in a.bh))return!1;var d=Wi(a.bh[c],b);d&&(et(b),0==a.bh[c][J]&&(delete a.bh[c],a.OJ--));return d}T.oc=function(a){a=a&&a[hc]();var b=0,c;for(c in this.bh)if(!a||c==a){for(var d=this.bh[c],e=0;e<d[J];e++)++b,et(d[e]);delete this.bh[c];this.OJ--}return b};T.eS=function(a,b){var c=this.bh[a[hc]()],d=[];if(c)for(var e=0;e<c[J];++e){var f=c[e];f.OC==b&&d[C](f)}return d};T.yJ=function(a,b,c,d){a=this.bh[a[hc]()];var e=-1;a&&(e=gt(a,b,c,d));return-1<e?a[e]:null}; T.sS=function(a,b){var c=Qh(a),d=c?a[hc]():O,e=Qh(b);return Fj(this.bh,function(a){for(var g=0;g<a[J];++g)if(!(c&&a[g][H]!=d||e&&a[g].OC!=b))return!0;return!1})};function gt(a,b,c,d){for(var e=0;e<a[J];++e){var f=a[e];if(!f.GC&&f.ro==b&&f.OC==!!c&&f.Na==d)return e}return-1};var it="closure_lm_"+(1E6*h[Cc]()|0),jt={},Fia=0;function kt(a,b,c,d,e){if(Yh(b)){for(var f=0;f<b[J];f++)kt(a,b[f],c,d,e);return null}c=lt(c);return dt(a)?a.l(b,c,d,e):Gia(a,b,c,!1,d,e)}function Gia(a,b,c,d,e,f){if(!b)throw m("Invalid event type");var g=!!e,k=mt(a);k||(a[it]=k=new ft(a));c=k.add(b,c,d,e,f);if(c.OR)return c;d=Hia();c.OR=d;d.src=a;d.ro=c;a[Fq]?a[Fq](b[hc](),d,g):a.attachEvent(Iia(b[hc]()),d);Fia++;return c} function Hia(){var a=Jia,b=yia?function(c){return a[L](b.src,b.ro,c)}:function(c){c=a[L](b.src,b.ro,c);if(!c)return c};return b}function nt(a,b,c,d,e){if(Yh(b)){for(var f=0;f<b[J];f++)nt(a,b[f],c,d,e);return null}c=lt(c);return dt(a)?a.sB(b,c,d,e):Gia(a,b,c,!0,d,e)}function ot(a,b,c,d,e){if(Yh(b))for(var f=0;f<b[J];f++)ot(a,b[f],c,d,e);else c=lt(c),dt(a)?a.uc(b,c,d,e):a&&(a=mt(a))&&(b=a.yJ(b,c,!!d,e))&&pt(b)} function pt(a){if(di(a)||!a||a.GC)return!1;var b=a.src;if(dt(b))return ht(b.rl,a);var c=a[H],d=a.OR;b.removeEventListener?b.removeEventListener(c,d,a.OC):b.detachEvent&&b.detachEvent(Iia(c),d);Fia--;(c=mt(b))?(ht(c,a),0==c.OJ&&(c.src=null,b[it]=null)):et(a);return!0}function qt(a){if(!a)return 0;if(dt(a))return a.rl?a.rl.oc(void 0):0;a=mt(a);if(!a)return 0;var b=0,c;for(c in a.bh)for(var d=Yi(a.bh[c]),e=0;e<d[J];++e)pt(d[e])&&++b;return b} function Kia(a){if(dt(a))return a.sS(es,!1);a=mt(a);return!!a&&a.sS(es,!1)}function Iia(a){return a in jt?jt[a]:jt[a]=ah+a}function Lia(a,b,c,d){var e=1;if(a=mt(a))if(b=a.bh[b[hc]()])for(b=Yi(b),a=0;a<b[J];a++){var f=b[a];f&&f.OC==c&&!f.GC&&(e&=!1!==Mia(f,d))}return ka(e)}function Mia(a,b){var c=a.ro,d=a.Na||a.src;a.DR&&pt(a);return c[L](d,b)} function Jia(a,b){if(a.GC)return!0;if(!yia){var c=b||Sh(mia),d=new $s(c,this),e=!0;if(!(0>c[Np]||void 0!=c.returnValue)){t:{var f=!1;if(0==c[Np])try{jp(c,-1);break t}catch(g){f=!0}if(f||void 0==c.returnValue)c.returnValue=!0}c=[];for(f=d[Dq];f;f=f[fe])c[C](f);for(var f=a[H],k=c[J]-1;!d.xy&&0<=k;k--)wp(d,c[k]),e&=Lia(c[k],f,!0,d);for(k=0;!d.xy&&k<c[J];k++)wp(d,c[k]),e&=Lia(c[k],f,!1,d)}return e}return Mia(a,new $s(b,this))}function mt(a){a=a[it];return a instanceof ft?a:null} var Nia="__closure_events_fn_"+(1E9*h[Cc]()>>>0);function lt(a){return ei(a)?a:a[Nia]||(a[Nia]=function(b){return a[Pp](b)})};function rt(){this.rl=new ft(this);this.vqa=this}X(rt,Us);rt[K][ct]=!0;T=rt[K];T.KB=null;T.Az=function(a){this.KB=a};T.addEventListener=function(a,b,c,d){kt(this,a,b,c,d)};T.removeEventListener=function(a,b,c,d){ot(this,a,b,c,d)}; dp(T,function(a){var b,c=this.KB;if(c)for(b=[];c;c=c.KB)b[C](c);var c=this.vqa,d=a[H]||a;if(bi(a))a=new Xs(a,c);else if(a instanceof Xs)Dp(a,a[Mq]||c);else{var e=a;a=new Xs(d,c);Sj(a,e)}var e=!0,f;if(b)for(var g=b[J]-1;!a.xy&&0<=g;g--)f=wp(a,b[g]),e=st(f,d,!0,a)&&e;a.xy||(f=wp(a,c),e=st(f,d,!0,a)&&e,a.xy||(e=st(f,d,!1,a)&&e));if(b)for(g=0;!a.xy&&g<b[J];g++)f=wp(a,b[g]),e=st(f,d,!1,a)&&e;return e});T.w=function(){rt.e.w[L](this);this.rl&&this.rl.oc(void 0);this.KB=null}; T.l=function(a,b,c,d){return this.rl.add(String(a),b,!1,c,d)};T.sB=function(a,b,c,d){return this.rl.add(String(a),b,!0,c,d)};T.uc=function(a,b,c,d){return this.rl[Ob](String(a),b,c,d)};function st(a,b,c,d){b=a.rl.bh[String(b)];if(!b)return!0;b=Yi(b);for(var e=!0,f=0;f<b[J];++f){var g=b[f];if(g&&!g.GC&&g.OC==c){var k=g.ro,l=g.Na||g.src;g.DR&&ht(a.rl,g);e=!1!==k[L](l,d)&&e}}return e&&!1!=d.zba}T.eS=function(a,b){return this.rl.eS(String(a),b)}; T.yJ=function(a,b,c,d){return this.rl.yJ(String(a),b,c,d)};T.sS=function(a,b){return this.rl.sS(Qh(a)?String(a):void 0,b)};function tt(a,b){rt[L](this);this.Nu=a||1;this.QB=b||Ph;this.r1=W(this.n1,this);this.ZC=hi()}X(tt,rt);T=tt[K];T.is=!1;T.Sc=null;T.n1=function(){if(this.is){var a=hi()-this.ZC;0<a&&a<0.8*this.Nu?this.Sc=this.QB[Yp](this.r1,this.Nu-a):(this.Sc&&(this.QB[Gp](this.Sc),this.Sc=null),this[$](Fs),this.is&&(this.Sc=this.QB[Yp](this.r1,this.Nu),this.ZC=hi()))}};La(T,function(){this.is=!0;this.Sc||(this.Sc=this.QB[Yp](this.r1,this.Nu),this.ZC=hi())}); zp(T,function(){this.is=!1;this.Sc&&(this.QB[Gp](this.Sc),this.Sc=null)});T.w=function(){tt.e.w[L](this);this[Hq]();delete this.QB};function ut(a,b,c){if(ei(a))c&&(a=W(a,c));else if(a&&typeof a[Pp]==Bg)a=W(a[Pp],a);else throw m("Invalid listener argument");return 2147483647<b?-1:Ph[Yp](a,b||0)}function vt(a){Ph[Gp](a)};function wt(){}wt[K].Wda=null;wt[K].Vc=function(){var a;(a=this.Wda)||(a={},Oia(this)&&(a[0]=!0,a[1]=!0),a=this.Wda=a);return a};var xt;function Pia(){}X(Pia,wt);function Qia(a){return(a=Oia(a))?new ActiveXObject(a):new XMLHttpRequest}function Oia(a){if(!a.cea&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=[Wga,Vga,Uga,Xga],c=0;c<b[J];c++){var d=b[c];try{return new ActiveXObject(d),a.cea=d}catch(e){}}throw m("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.cea}xt=new Pia;function yt(a){rt[L](this);this.headers=new Uj;this.cQ=a||null;this.au=!1;this.ZP=this.pd=null;this.Cx=this.$Z=O;this.mx=this.IZ=this.WP=this.ZZ=!1;this.bQ=0;this.aQ=null;this.h$=O;this.VZ=this.T7=!1}X(yt,rt);var Ria=/^https?$/i,Sia=[rr,"PUT"],Tia=[];T=yt[K];T.Sla=function(){this.W();Wi(Tia,this)}; hp(T,function(a,b,c,d){if(this.pd)throw m("[goog.net.XhrIo] Object is active with another request="+this.$Z+"; newUri="+a);b=b?b[ge]():Qga;this.$Z=a;this.Cx=O;this.ZZ=!1;this.au=!0;this.pd=this.cQ?Qia(this.cQ):Qia(xt);this.ZP=this.cQ?this.cQ.Vc():xt.Vc();tp(this.pd,W(this.m$,this));try{this.IZ=!0,this.pd[oq](b,String(a),!0),this.IZ=!1}catch(e){this.Lr(5,e);return}a=c||O;var f=this.headers.o();d&&bk(d,function(a,b){f.set(b,a)});d=Oi(f.hk(),Uia);c=Ph.FormData&&a instanceof Ph.FormData;!Ri(Sia,b)||d|| c||f.set(Nga,jha);f[Tb](function(a,b){this.pd.setRequestHeader(b,a)},this);this.h$&&(this.pd.responseType=this.h$);nia in this.pd&&(this.pd.withCredentials=this.T7);try{Via(this),0<this.bQ&&((this.VZ=Wia(this.pd))?(this.pd.timeout=this.bQ,this.pd.ontimeout=W(this.Ve,this)):this.aQ=ut(this.Ve,this.bQ,this)),this.WP=!0,this.pd[Kp](a),this.WP=!1}catch(g){this.Lr(5,g)}});function Wia(a){return kk&&qk(9)&&di(a.timeout)&&Qh(a.ontimeout)}function Uia(a){return kha==a[ke]()} T.Ve=function(){"undefined"!=typeof Oh&&this.pd&&(this.Cx=bha+this.bQ+Mha,this[$](iia),this[Iq](8))};T.Lr=function(a,b){this.au=!1;this.pd&&(this.mx=!0,this.pd[Iq](),this.mx=!1);this.Cx=b;Xia(this);zt(this)};function Xia(a){a.ZZ||(a.ZZ=!0,a[$](Gr),a[$](Nr))}Bp(T,function(){this.pd&&this.au&&(this.au=!1,this.mx=!0,this.pd[Iq](),this.mx=!1,this[$](Gr),this[$](hha),zt(this))});T.w=function(){this.pd&&(this.au&&(this.au=!1,this.mx=!0,this.pd[Iq](),this.mx=!1),zt(this,!0));yt.e.w[L](this)}; T.m$=function(){this.Mj||(this.IZ||this.WP||this.mx?Yia(this):this.rqa())};T.rqa=function(){Yia(this)};function Yia(a){if(a.au&&"undefined"!=typeof Oh&&(!a.ZP[1]||4!=At(a)||2!=Bt(a)))if(a.WP&&4==At(a))ut(a.m$,0,a);else if(a[$](Uha),4==At(a)){a.au=!1;try{if(Zia(a))a[$](Gr),a[$](cia);else{var b;try{b=2<At(a)?a.pd.statusText:O}catch(c){b=O}a.Cx=b+rga+Bt(a)+$f;Xia(a)}}finally{zt(a)}}} function zt(a,b){if(a.pd){Via(a);var c=a.pd,d=a.ZP[0]?Th:null;a.pd=null;a.ZP=null;b||a[$](ws);try{tp(c,d)}catch(e){}}}function Via(a){a.pd&&a.VZ&&(a.pd.ontimeout=null);di(a.aQ)&&(vt(a.aQ),a.aQ=null)}T.nk=function(){return!!this.pd};function Zia(a){var b=Bt(a),c;t:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:c=!0;break t;default:c=!1}if(!c){if(b=0===b)a=cm(String(a.$Z))[1]||null,!a&&self[tc]&&(a=self[tc][fq],a=a[ec](0,a[J]-1)),b=!Ria[bd](a?a[ke]():O);c=b}return c} function At(a){return a.pd?a.pd[Eq]:0}function Bt(a){try{return 2<At(a)?a.pd.status:-1}catch(b){return-1}}function $ia(a){return bi(a.Cx)?a.Cx:String(a.Cx)};function Ct(a,b){var c;if(a instanceof Ct)this.Km=Qh(b)?b:a.Km,Dt(this,a.Zk),c=a.Sx,Et(this),this.Sx=c,Ft(this,a.Au),Gt(this,a.zu),this[Ip](a[Kq]()),Ht(this,a.Oi.o()),c=a.Rx,Et(this),this.Rx=c;else if(a&&(c=cm(String(a)))){this.Km=!!b;Dt(this,c[1]||O,!0);var d=c[2]||O;Et(this);this.Sx=It(d);Ft(this,c[3]||O,!0);Gt(this,c[4]);this[Ip](c[5]||O,!0);Ht(this,c[6]||O,!0);c=c[7]||O;Et(this);this.Rx=It(c)}else this.Km=!!b,this.Oi=new Jt(null,0,this.Km)}T=Ct[K];T.Zk=O;T.Sx=O;T.Au=O;T.zu=null;T.sk=O;T.Rx=O; T.Nsa=!1;T.Km=!1;Da(T,function(){var a=[],b=this.Zk;b&&a[C](Kt(b,aja),Xe);if(b=this.Au){a[C](Dga);var c=this.Sx;c&&a[C](Kt(c,aja),Gaa);a[C](aa(String(b)));b=this.zu;null!=b&&a[C](Xe,String(b))}if(b=this[Kq]())this.Au&&b[Bb](0)!=Tq&&a[C](Tq),a[C](Kt(b,b[Bb](0)==Tq?bja:cja));(b=this.Oi[hc]())&&a[C](cf,b);(b=this.Rx)&&a[C](qe,Kt(b,dja));return a[ie](O)}); T.resolve=function(a){var b=this.o(),c=!!a.Zk;c?Dt(b,a.Zk):c=!!a.Sx;if(c){var d=a.Sx;Et(b);b.Sx=d}else c=!!a.Au;c?Ft(b,a.Au):c=null!=a.zu;d=a[Kq]();if(c)Gt(b,a.zu);else if(c=!!a.sk){if(d[Bb](0)!=Tq)if(this.Au&&!this.sk)d=Tq+d;else{var e=b[Kq]()[Rd](Tq);-1!=e&&(d=b[Kq]()[ec](0,e+1)+d)}e=d;if(e==Rq||e==Me)d=O;else if(ri(e,Bga)||ri(e,Cga)){for(var d=ki(e,Tq),e=e[pc](Tq),f=[],g=0;g<e[J];){var k=e[g++];k==Me?d&&g==e[J]&&f[C](O):k==Rq?((1<f[J]||1==f[J]&&f[0]!=O)&&f.pop(),d&&g==e[J]&&f[C](O)):(f[C](k),d= !0)}d=f[ie](Tq)}else d=e}c?b[Ip](d):c=a.Oi[hc]()!==O;c?Ht(b,It(a.Oi[hc]())):c=!!a.Rx;c&&(a=a.Rx,Et(b),b.Rx=a);return b};T.o=function(){return new Ct(this)};function Dt(a,b,c){Et(a);a.Zk=c?It(b):b;a.Zk&&(a.Zk=a.Zk[vb](/:$/,O))}function Ft(a,b,c){Et(a);a.Au=c?It(b):b}function Gt(a,b){Et(a);if(b){b=ia(b);if(ga(b)||0>b)throw m("Bad port number "+b);a.zu=b}else a.zu=null}T.getPath=function(){return this.sk};ep(T,function(a,b){Et(this);this.sk=b?It(a):a;return this}); function Ht(a,b,c){Et(a);b instanceof Jt?(a.Oi=b,a.Oi.R1(a.Km)):(c||(b=Kt(b,eja)),a.Oi=new Jt(b,0,a.Km));return a}T.fk=function(a,b){return Ht(this,a,b)};T.On=function(){return this.Oi[hc]()};T.Oc=function(a,b){Et(this);this.Oi.set(a,b);return this};function fja(a,b,c){Et(a);Yh(c)||(c=[String(c)]);a.Oi.setValues(b,c)}function Lt(a,b){return a.Oi.get(b)}T.s1=function(a){Et(this);this.Oi[Ob](a);return this};function Et(a){if(a.Nsa)throw m("Tried to modify a read-only Uri");} T.R1=function(a){this.Km=a;this.Oi&&this.Oi.R1(a);return this};function gja(a){return a instanceof Ct?a.o():new Ct(a,void 0)}function It(a){return a?oa(a):O}function Kt(a,b){return bi(a)?encodeURI(a)[vb](b,hja):null}function hja(a){a=a[Xd](0);return we+(a>>4&15)[hc](16)+(a&15)[hc](16)}var aja=/[#\/\?@]/g,cja=/[\#\?:]/g,bja=/[\#\?]/g,eja=/[\#\?@]/g,dja=/#/g;function Jt(a,b,c){this.Al=a||null;this.Km=!!c} function Mt(a){if(!a.Rf&&(a.Rf=new Uj,a.Mb=0,a.Al))for(var b=a.Al[pc](xe),c=0;c<b[J];c++){var d=b[c][ld](af),e=null,f=null;0<=d?(e=b[c][ae](0,d),f=b[c][ae](d+1)):e=b[c];e=oa(e[vb](/\+/g,ne));e=Nt(a,e);a.add(e,f?oa(f[vb](/\+/g,ne)):O)}}T=Jt[K];T.Rf=null;T.Mb=null;T.Lc=function(){Mt(this);return this.Mb};T.add=function(a,b){Mt(this);this.Al=null;a=Nt(this,a);var c=this.Rf.get(a);c||this.Rf.set(a,c=[]);c[C](b);this.Mb++;return this}; va(T,function(a){Mt(this);a=Nt(this,a);return this.Rf.$e(a)?(this.Al=null,this.Mb-=this.Rf.get(a)[J],this.Rf[Ob](a)):!1});wa(T,function(){this.Rf=this.Al=null;this.Mb=0});Ua(T,function(){Mt(this);return 0==this.Mb});T.$e=function(a){Mt(this);a=Nt(this,a);return this.Rf.$e(a)};T.$R=function(a){var b=this.La();return Ri(b,a)};T.hk=function(){Mt(this);for(var a=this.Rf.La(),b=this.Rf.hk(),c=[],d=0;d<b[J];d++)for(var e=a[d],f=0;f<e[J];f++)c[C](b[d]);return c}; T.La=function(a){Mt(this);var b=[];if(bi(a))this.$e(a)&&(b=Xi(b,this.Rf.get(Nt(this,a))));else{a=this.Rf.La();for(var c=0;c<a[J];c++)b=Xi(b,a[c])}return b};T.set=function(a,b){Mt(this);this.Al=null;a=Nt(this,a);this.$e(a)&&(this.Mb-=this.Rf.get(a)[J]);this.Rf.set(a,[b]);this.Mb++;return this};T.get=function(a,b){var c=a?this.La(a):[];return 0<c[J]?String(c[0]):b};T.setValues=function(a,b){this[Ob](a);0<b[J]&&(this.Al=null,this.Rf.set(Nt(this,a),Yi(b)),this.Mb+=b[J])}; Da(T,function(){if(this.Al)return this.Al;if(!this.Rf)return O;for(var a=[],b=this.Rf.hk(),c=0;c<b[J];c++)for(var d=b[c],e=aa(String(d)),d=this.La(d),f=0;f<d[J];f++){var g=e;d[f]!==O&&(g+=af+aa(String(d[f])));a[C](g)}return this.Al=a[ie](xe)});T.o=function(){var a=new Jt;a.Al=this.Al;this.Rf&&(a.Rf=this.Rf.o(),a.Mb=this.Mb);return a};function Nt(a,b){var c=String(b);a.Km&&(c=c[ke]());return c} T.R1=function(a){a&&!this.Km&&(Mt(this),this.Al=null,this.Rf[Tb](function(a,c){var d=c[ke]();c!=d&&(this[Ob](c),this.setValues(d,a))},this));this.Km=a};T.extend=function(a){for(var b=0;b<arguments[J];b++)bk(arguments[b],function(a,b){this.add(b,a)},this)};var ija=/\/spreadsheet/,jja=/\/(ccc|tq|pub)$/,kja=/^spreadsheets?[0-9]?\.google\.com$/,lja=/^docs\.google\.com*$/,mja=/^(trix|spreadsheets|docs|webdrive)(-[a-z]+)?\.(corp|sandbox)\.google\.com/,nja=/^(\w*\.){1,2}corp\.google\.com$/,oja=/\/spreadsheets(\/d\/[^/]+)?/,pja=/\/(edit|gviz\/tq|)$/,qja=/^docs\.google\.com*$/,rja=/^docs\.sandbox\.google\.com*$/,sja=/^(\w*\.){1,2}corp\.google\.com$/,tja=/^\/a\/([\w-]+\.)+\w+/,Ot=/^(\/a\/([\w-]+\.)+\w+)?/,uja=/^[a-z]+\d+\:[a-z]+\d+$/i,vja=/^[a-z]+\d+$/i; function Pt(a){var b=em(a),c=kja[bd](b),d=mja[bd](b),e=nja[bd](b),b=lja[bd](b),f=fm(a),g=new RegExp(Ot[Rp]+jja[Rp]),f=(a=(new RegExp(Ot[Rp]+ija[Rp]+jja[Rp]))[bd](f))||g[bd](f);return b&&a||(d||e||c)&&f}function wja(a){var b=em(a),c=rja[bd](b),d=sja[bd](b),b=qja[bd](b);a=fm(a);a=(new RegExp(Ot[Rp]+oja[Rp]+pja[Rp]))[bd](a);return(b||c||d)&&a} function xja(a){if(!vja[bd](a))return null;a=a[ge]();for(var b,c=O,d=0;d<a[J];d++){var e=a[Xd](d);if(65>e||90<e){c=a[ae](0,d);b=a[ae](d);break}}a=0;d=1;for(e=c[J]-1;0<=e;e--)a+=d*(c[Xd](e)-64),d*=26;c=a;b=la(b,10);return ga(b)||0>=b||0>c?null:new sk(c,b)};var yja={firstLineIsHeader:!1};function Qt(a,b,c,d){b=b[pc](/\r?\n/)[c];Ka(this,a+sga+(c+1)+Hga+b);Ka(this,this[aq]+(me+ti(ne,-1==d?b[J]:d)+zr))}X(Qt,m);V("vis.csv.ParseError",Qt,void 0);eb(Qt[K],"ParseError");function Rt(a){this.b=a||{};Dj(yja,function(a,c){Oj(this.b,c,a)},this)}V("vis.csv.Parser",Rt,void 0); gb(Rt[K],function(a){function b(a){a==Xq&&(l--,n=q);s=a}function c(){q=n;if(null!=s){var b=s;b==Xq&&(l++,n=0);s=null;return b}if(k>=g)return Yq;b=a[Bb](k++);n++;var c=!1;b==me?c=!0:b==qga&&(k<g&&a[Bb](k)==me&&k++,c=!0);return c?(l++,n=0,Xq):b}function d(){var d=k,e=u;u=!1;var f=c();if(f==Kga)return Zq;if(f==Yq||f==Xq)return e?(b(Kga),O):Zq;if(f==oe){d=k;e=null;for(f=c();f!=Yq;f=c())if(f==oe)if(e=k-1,f=c(),f==oe)e=null;else{if(f==Je||f==Yq||f==Xq){f==Xq&&b(f);break}throw new Qt('Unexpected character "'+ f+'" after quote mark',a,l,n-1);}if(null==e)throw new Qt("Unexpected end of text after open quote",a,l,n);return a[ae](d,e)[vb](/""/g,oe)}for(;f!=Yq&&f!=Je&&f!=Xq;f=c())if(f==oe)throw new Qt("Unexpected quote mark",a,l,n-1);f==Je&&(u=!0);f!=Yq&&f!=Xq||b(f);return a[ae](d,f==Yq?k:k-1)[vb](/[\r\n]+/g,O)}function e(){if(k>=g)return Yq;for(var a=[],b=d();b!=Zq;b=d())a[C](b);return a}var f=this.b.firstLineIsHeader,g=a[J],k=0,l=0,n=0,q=0,s=null,u=!1,w=[],z=[],B=null;f&&(w=e(),B=w[J]);for(var F=e();F!=Yq;F= e()){null==B&&(B=F[J]);if(F[J]!=B)throw new Qt("Record has "+F[J]+" field"+(1==F[J]?O:kh)+", but expected "+B,a,l-1,-1);if(f){for(var M={},N=0;N<F[J];N++)M[w[N]]=F[N];z[C](M)}else z[C](F)}return z});gb(Rt[K],Rt[K][Gq]);function zja(a,b,c){this.Xna=new Rt;this.ZQ=null!=c?c:!1;this.Wna=a;for(a=0;a<b[J];a++)if(c=b[a],!Aja[c])throw m("Unsupported type: "+c);this.Yna=b;this.Ib=[]}var Aja={number:function(a){var b=ma(a);if(ga(b))throw m("Not a number "+a);return b},string:function(a){return a},"boolean":function(a){return a[ke]()===zh},date:function(a){return new Date(a)},datetime:function(a){return new Date(a)},timeofday:function(a){return a[pc](Je)}};function St(a,b){var c=b||{};this.v9=Qh(c.csvColumns);this.lna=c.csvColumns;this.ZQ=!!c.csvHasHeader;this.n_=c.sendMethod||eg;this.Jla=!!c.xhrWithCredentials;if(!Jj(Bja,this.n_))throw m("Send method not supported: "+this.n_);this.d$=c.makeRequestParams_||{};if(wja(a)){var d=a,c=new Ct(d);433==c.zu&&Gt(c,null);var e=c[Kq](),e=e[vb](/\/edit$/,Gga);c[Ip](e);e=em(d);d=!Wh(ia(cm(d)[4]||null)||null);d=sja[bd](e)&&d;Dt(c,d?Tr:Ng);a=c[hc]()}else if(Pt(a)){e=a;c=new Ct(e);433==c.zu&&Gt(c,null);d=c[Kq]();d= d[vb](/\/ccc$/,Uq);/\/pub$/[bd](d)&&(d=d[vb](/\/pub$/,Uq),c.Oc(Tha,Te));c[Ip](d);var d=em(e),e=null!=(ia(cm(e)[4]||null)||null),f=mja[bd](d),d=nja[bd](d)&&!f&&e;Dt(c,d?Tr:Ng);a=c[hc]()}d=a;c=Pt(d);d=fm(d);d=tja[bd](d);(c=c&&d)||(d=a,c=wja(d),d=fm(d),d=tja[bd](d),c=c&&d);this.Ila=c;this.Hla=a;this.m_=Cja++;Tt[C](this)}var Bja={Jwa:Ns,Kwa:Os,$va:"scriptInjection",sva:as,Oda:eg},Dja=new Uj({"X-DataSource-Auth":bg}),Cja=0,Ut={};St[K].Eda=30;var Tt=[],Vt=Ph[nq]; function Eja(){for(var a=0;a<Tt[J];a++){var b=Tt[a];b.H1&&b.ct()}}function Fja(a,b){var c=a[ld](qe);-1!=c&&(a=a[ae](0,c));var d=a[ld](cf),e=c=O,f=[];-1==d?c=a:(c=a[ae](0,d),e=a[ae](d+1),f=e[pc](xe));d=[];for(e=0;e<f[J];e++){var g=f[e][pc](af),k={};eb(k,g[0]);k.P2=f[e];d[C](k)}for(var l in b){f=b[l];g=!1;for(e=0;e<d[J];e++)if(d[e][yd]==l){d[e].P2=l+af+aa(f);g=!0;break}g||(e={},eb(e,l),e.P2=l+af+aa(f),d[C](e))}l=c;if(0<d[J]){l+=cf;c=[];for(e=0;e<d[J];e++)c[C](d[e].P2);l+=c[ie](xe)}return l}T=St[K]; T.Wla=function(a,b){if(Zia(b[Mq])){var c;var d=b[Mq];try{c=d.pd?d.pd.responseText:O}catch(e){c=O}c=pi(c);if(this.v9){var f=new zja(c,this.lna,this.ZQ),d=f.Xna[Gq](f.Wna);c=new Ko;if(d&&0<d[J]){for(var g=[],k=f.Yna,l=0,n=k[J];l<n;l++)g[C]({type:k[l],label:[]});if(f.ZQ)for(k=0,n=g[J];k<n;k++)g[k][Rc][C](d[0][k]);k=0;for(n=g[J];k<n;k++)l=g[k],c.mg(l[H],l[Rc][ie](ne));f.Ib=g;g=f.Ib;n=f=f.ZQ?1:0;for(k=d[J];n<k;n++){c.lq();for(var l=0,q=g[J];l<q;l++)c.al(n-f,l,Aja[g[l][H]](d[n][l]))}}d={};d.table=c[Wp](); d.version=qia(d);d.reqId=a;Wt(d)}else c[Ib](/^({.*})$/)?(c=Cfa(c),Wt(c)):kda(mo(c))}else if(this.xu)Xt(this,xha,$ia(b[Mq]));else throw m("google.visualization.Query: "+$ia(b[Mq]));};function Wt(a){var b=a.reqId,c=Ut[b];if(c)Ut[b]=null,c.aD(a);else throw m("Missing query for request id: "+b);}T.xu=null;T.oS=null;T.wS=null;T.lj=null;T.w_=null;T.iC=null;T.H1=!0;T.cl=0;T.nI=null;T.nk=!1;T.Vm=function(a){if(typeof a!=Yg||0>a)throw m("Refresh interval must be a non-negative number");this.cl=a;Yt(this)}; function Zt(a){a.wS&&(ca[Gp](a.wS),a.wS=null)}function Xt(a,b,c,d){a.aD({version:Qe,status:Nr,errors:[{reason:b,message:c,detailed_message:d}]})} T.ct=function(){var a;a=this.Hla;var b={};this.lj&&(b.tq=String(this.lj));var c=Xha+String(this.m_),d=this.nI;d&&(c+=Iga+d);this.w_&&(c+=Jga+this.w_);b.tqx=c;if(this.iC){var c=[],e;for(e in this.iC)c[C](e+Xe+this.iC[e]);b.tqh=c[ie](Ye)}a=Fja(a,b);this.cl&&(a=new Ct(a),mk&&(Et(a),a.Oc(oia,h[t](2147483648*h[Cc]())[hc](36)+h.abs(h[t](2147483648*h[Cc]())^hi())[hc](36))),a=a[hc]());e={};Ut[String(this.m_)]=this;c=this.n_;b=Qga;c==Os&&(c=Ns,b=rr);c==eg&&(c={},/[?&]alt=gviz(&[^&]*)*$/[bd](a)?e=as:(d=im(a, jia)||eg,d=d[pc](Xe),e=d[0],e!==Ns&&e!==Os||!Ri(d,nia)||(c.xhrWithCredentials=!0),Jj(Bja,e)||(e=eg)),e={sendMethod:e,options:c},c=e.sendMethod,e=e[eq]);if(c==as)if(Sh(tha))b=this.d$,null==b[Vt.io[qq].CONTENT_TYPE]&&(b[Vt.io[qq].CONTENT_TYPE]=Vt.io.ContentType.TEXT),null==b[Vt.io[qq].AUTHORIZATION]&&(b[Vt.io[qq].AUTHORIZATION]=Vt.io.AuthorizationType.SIGNED),null==b.OAUTH_ENABLE_PRIVATE_NETWORK&&(b.OAUTH_ENABLE_PRIVATE_NETWORK=!0),null==b.OAUTH_ADD_EMAIL&&(b.OAUTH_ADD_EMAIL=!0),Vt.io.makeRequest(a, W(this.Vla,this),b),$t(this);else throw m("gadgets.io.makeRequest is not defined.");else{if(!(d=c==Ns)){if(c=c==eg)d=Ph[tc][Ic],c=(new Ct(d)).resolve(new Ct(a))[hc](),d=cm(d),c=cm(c),c=d[3]==c[3]&&d[1]==c[1]&&d[4]==c[4];d=c}if(d){c=void 0;d=a;b==rr&&(a=a[pc](cf),1<=a[J]&&(d=a[0]),2<=a[J]&&(c=a[1]));a=d;d=W(gi(this.Wla,this.m_),this);e=this.Jla||!!e.xhrWithCredentials;var f=new yt;Tia[C](f);d&&f.l(Gr,d);f.sB(ws,f.Sla);e&&(f.T7=e);f[Kp](a,b,c,Dja)}else{if(this.v9)throw m("CSV files on other domains are not supported. Please use sendMethod: 'xhr' or 'auto' and serve your .csv file from the same domain as this page."); b=fa[cc](hg)[0];e=null===this.nI;this.Ila&&e?(e=fa[Qb](Vr),Gja(this,e,a),b[p](e)):($t(this),Ts(a),Yt(this))}}};function Gja(a,b,c){b.onerror=function(){$t(a);Ts(c);Yt(a)};cp(b,function(){$t(a);Ts(c);Yt(a)});Ra(b[x],R);var d=c+Aga+(new Date)[bc]();b.src=d}T.Vla=function(a){if(null!=a&&a[Z])kda(mo(a[Z]));else{var b=O;a&&a.errors&&(b=a.errors[ie](ne));Xt(this,Jha,uha,b)}};function $t(a){Zt(a);a.wS=ca[Yp](function(){Xt(a,iia,$ga)},1E3*a.Eda)}function Hja(a){a.oS&&(ca[Gp](a.oS),a.oS=null)} function Yt(a){Hja(a);0!=a.cl&&a.H1&&a.nk&&(a.oS=ca[Yp](function(){a.ct()},1E3*a.cl))}hp(T,function(a){this.nk=!0;this.xu=a;this.ct()});T.makeRequest=function(a,b){this.nk=!0;this.xu=a;this.Zta=as;this.d$=b||{};this.ct()};Bp(T,function(){this.nk=!1;Zt(this);Hja(this)});T.aD=function(a){Zt(this);a=new Qs(a);if(!uia(a)){this.nI=a.Ni()?null:a.Z_;var b=this.xu;b[L](b,a)}};T.setTimeout=function(a){if(typeof a!=Yg||ga(a)||0>=a)throw m("Timeout must be a positive number");this.Eda=a}; T.eta=function(a){if(typeof a!=jg)throw m("Refreshable must be a boolean");return this.H1=a};T.fk=function(a){if(typeof a!=rh)throw m("queryString must be a string");this.lj=a};T.ata=function(a){this.w_=a;null!=a&&this.Fda(Ah,a)};T.Fda=function(a,b){a=a[vb](/\\/g,Yf);b=b[vb](/\\/g,Yf);a=a[vb](/:/g,dha);b=b[vb](/:/g,dha);a=a[vb](/;/g,Zf);b=b[vb](/;/g,Zf);this.iC||(this.iC={});this.iC[a]=b};function au(){Ija||(Ija=!0,Ph.jra&&Ph.jra.cua(Eja,{pollingInterval:100}),Ph[nq]&&(Jja(),this.vda()));var a=Ik(hg)[0];this.nra=via(a)}var Ija=!1;au[K].Kda=200;function bu(){return!!Ph[nq]&&!!Ph[nq].rpc}au[K].vda=function(){if(bu()){var a=Ph[nq];ei(a.rpc.register)&&a.rpc.register(Wha,Eja)}else 0<this.Kda&&(this.Kda--,ca[Yp](W(this.vda,this),100))};au[K].rsa=function(a){var b=a.getString(fha),c=b[ke]();if(0==c[ld](Eha)||0==c[ld](Gha))b=oa(b);b=new St(b);a=a.getInt(eha);b.Vm(a);return b};au[K].lta=function(a){return this.nra(a)}; function Jja(){if(bu()){var a=Ph[nq];try{a.rpc.getRelayUrl(Rq)||a.rpc.setRelayUrl(Rq,Fha)}catch(b){ei(a.rpc.setRelayUrl)&&a.rpc.setRelayUrl(Rq,Fha)}}}Ph[nq]&&!bu()&&Ts("//www-opensocial.googleusercontent.com/gadgets/rpc/rpc.v.js");Jja();var eu=Ph.__gvizguard__?Sh(yha):function(a,b,c){a=cu(a);b=kt(a,b,Kja(c));return new du(b)},fu=Ph.__gvizguard__?Sh(zha):function(a,b,c){a=cu(a);b=nt(a,b,Kja(c));return new du(b)},hu=Ph.__gvizguard__?Sh(Cha):function(a,b,c){cu(a)[$](new gu(b,c))},iu=Ph.__gvizguard__?Sh(Bha):function(a){return(a=a&&ei(a.getKey)&&a.getKey())?pt(a):!1},ju=Ph.__gvizguard__?Sh(Aha):function(a){var b=cu(a),b=qt(b);Ws(a.__eventTarget);a.__eventTarget=void 0;return b}; function cu(a){var b=a.__eventTarget;null==b&&(b=new rt,a.__eventTarget=b);return a=b}function Kja(a){return function(b){b&&b.wra?a(b.Mda):a()}}function du(a){this.Osa=a}du[K].getKey=function(){return this.Osa};function gu(a,b){Xs[L](this,a);this.Mda=b}X(gu,Xs);gu[K].wra=function(){return this.Mda};function ku(a){this.t=a;var b=[];a=a.H();for(var c=0;c<a;c++)b[C](c);this.Ib=b;this.Qr=!0;this.Or=null;this.a_=[];this.ax=!0}T=ku[K];T.Pa=function(){return this.t};function Lja(a){for(var b=[],c=a.t.M(),d=0;d<c;d++)b[C](d);a.Or=b;a.ax=!0} T.yq=function(a){for(var b=this.t,c=Ij(Mja),d=0;d<a[J];d++){var e=a[d];if(di(e))Lo(b,e);else if(ai(e)){var f=e.sourceColumn,e=e.calc;if(bi(e)){if(!c||c&&!Ri(c,e))throw m('Unknown function "'+e+oe);null!=f&&Lo(b,f)}}else throw m("Invalid column input, expected either a number or an object.");}this.Ib=Qj(a);a=this.t;b=this.Ib;for(c=0;c<b[J];c++)if(d=b[c],ai(d)){if(f=d.role)e=d.properties||{},e.role=f,d.properties=e;f=d.sourceColumn;di(f)&&(Lo(a,f),d.calc=d.calc||Hha,ab(d,d[H]||a.D(f)))}this.ax=!0}; function Nja(a,b,c){if(Yh(b)){if(Qh(c))throw m("If the first parameter is an array, no second parameter is expected");for(var d=0;d<b[J];d++)No(a.t,b[d]);return Yi(b)}if(Vh(b)==Yg){if(!Vh(c)==Yg)throw m("If first parameter is a number, second parameter must be specified and be a number.");if(b>c)throw m("The first parameter (min) must be smaller than or equal to the second parameter (max).");No(a.t,b);No(a.t,c);a=[];for(d=b;d<=c;d++)a[C](d);return a}throw m("First parameter must be a number or an array."); }T.qn=function(a,b){this.Or=Nja(this,a,b);this.Qr=!1;this.ax=!0};T.N9=function(){return Qj(this.Ib)};T.oca=function(){if(this.Qr){for(var a=[],b=this.t.M(),c=0;c<b;c++)a[C](c);return a}return Yi(this.Or)};T.Ksa=function(a){this.yq(Fi(this.Ib,function(b){return!Ri(a,b)}));this.ax=!0};T.Lsa=function(a,b){var c=Nja(this,a,b);this.Qr&&(Lja(this),this.Qr=!1);this.qn(Fi(this.Or,function(a){return!Ri(c,a)}));this.ax=!0}; T.Daa=function(a){for(var b=0;b<this.Ib[J];b++){var c=this.Ib[b];if(c==a||ai(c)&&c.sourceColumn==a)return b}return-1};T.Isa=function(a){return this.Qr?0>a||a>=this.t.M()?-1:a:Ci(this.Or,a)};T.jF=function(a){Lo(this,a);a=this.Ib[a];return di(a)?a:ai(a)&&di(a.sourceColumn)?a.sourceColumn:-1};T.sR=function(a){a=this.jF(a);return-1==a?a:a=this.t.sR(a)};T.cn=function(a){No(this,a);return this.Qr?a:this.Or[a]};T.pR=function(a){a=this.cn(a);return a=this.t.pR(a)}; T.M=function(){return this.Qr?this.t.M():this.Or[J]};T.H=function(){return this.Ib[J]};T.jf=function(a){Lo(this,a);a=this.Ib[a];return di(a)?this.t.jf(a):a.id||O};xa(T,function(a){for(var b=0;b<this.Ib[J];b++){var c=this.Ib[b];if(ai(c)&&c.id==a)return b}a=this.t[Qp](a);return this.Daa(a)});T.cb=function(a){Lo(this,a);a=this.Ib[a];return di(a)?this.t.cb(a):a[Rc]||O};T.ju=function(a){Lo(this,a);a=this.Ib[a];return di(a)?this.t.ju(a):null};T.Ss=function(a){a=this.Li(a,ih);return a=bi(a)?a:O}; T.D=function(a){Lo(this,a);a=this.Ib[a];return di(a)?this.t.D(a):a[H]}; T.Pr=function(a,b){Lo(this,b);var c=this.Ib[b],d=null,e=this.cn(a);if(ai(c)){if(this.ax){for(c=0;c<this.Ib[J];c++)ai(this.Ib[c])&&(this.a_[c]=[]);this.ax=!1}c=this.a_[b][e];if(!Qh(c)){var c=null,d=this.Ib[b],f=d.calc;bi(f)?(f=Mja[f],c=f(this.t,e,d)):ei(f)&&(c=f[L](null,this.t,e));c=Yfa(c);d=d[H];f=c.v;if(mi(d))throw m('"type" must be specified');if(!aga(f,d))throw m(qba+f+baa+d);this.a_[b][e]=c}d=c;d.p=ai(d.p)?d.p:{}}else if(di(c))d={v:this.t[I](e,c),f:null,p:null};else throw m("Invalid column definition: "+ d);return d};fb(T,function(a,b){return this.Pr(a,b).v});T.Aa=function(a,b){var c=this.Pr(a,b);if(null==c.f){var d=this.Ib[b];if(ai(d))d=this.D(b),c.f=null!=c.v?Po(c.v,d):O;else if(di(d)){var e=this.cn(a);c.f=this.t.Aa(e,d)}}return c.f};T.Ao=function(a,b,c){a=this.sm(a,b)[c];return Qh(a)?a:null};T.sm=function(a,b){var c=this.Pr(a,b);if(!c.p){var c=this.cn(a),d=this.jF(b);return this.t.sm(c,d)}return c.p};T.Li=function(a,b){Lo(this,a);var c=this.Ib[a];return di(c)?this.t.Li(c,b):this.Sq(a)[b]||null}; T.Sq=function(a){Lo(this,a);a=this.Ib[a];return di(a)?this.t.Sq(a):a.properties||{}};T.uR=function(a){return this.t.uR(a)};T.Mx=function(){return this.t.Mx()};T.Yq=function(a,b){var c=this.cn(a);return this.t.Yq(c,b)};T.mJ=function(a){No(this,a);a=this.cn(a);return this.t.mJ(a)};T.qp=function(a){return bga(this,a)};T.QR=function(a){return dga(this,a)};T.Co=function(a){return cga(this,a)};T.WJ=function(a){return fga(this,a)}; T.ww=function(){var a=this.t;ei(a.ww)&&(a=a.ww());var a=a.Ir(),b=this.H(),c=this.M(),d,e,f,g=[],k=[];for(d=0;d<b;d++){f=this.Ib[d];if(ai(f))e=Pj(f),delete e.calc,delete e.sourceColumn;else if(di(f))e=a[Nb][f];else throw m(Sga);g[C](e)}for(e=0;e<c;e++){var l=a[Kc][this.Qr?e:this.Or[e]],n=[];for(d=0;d<b;d++){f=this.Ib[d];if(ai(f))f={v:this[I](e,d)};else if(di(f))f=l.c[this.Ib[d]];else throw m(Sga);n[C](f)}l.c=n;k[C](l)}a.cols=g;a.rows=k;return a=new Ko(a)}; T.Ir=function(){for(var a={},b=[],c=0;c<this.Ib[J];c++){var d=this.Ib[c];ai(d)&&!bi(d.calc)||b[C](d)}Si(b)||(a.columns=b);this.Qr||(a.rows=Yi(this.Or));return a};Fa(T,function(){return io(this.Ir())});function lu(a,b){bi(b)&&(b=lo(b));var c=new ku(a),d=b.columns,e=b[Kc];null!=d&&c.yq(d);null!=e&&c.qn(e);return c} var Mja={emptyString:function(){return O},error:function(a,b,c){var d=c.sourceColumn,e=c.magnitude;if(!di(d)||!di(e))return null;a=a[I](b,d);return di(a)?c.errorType==Rha?a+e/100*a:a+e:null},stringify:function(a,b,c){c=c.sourceColumn;return di(c)?a.Aa(b,c):O},fillFromTop:function(a,b,c){c=c.sourceColumn;return di(c)?hga(a,b,c,!0):null},fillFromBottom:function(a,b,c){c=c.sourceColumn;return di(c)?hga(a,b,c,!1):null},identity:function(a,b,c){c=c.sourceColumn;return di(c)?a[I](b,c):null}};function mu(a,b,c){this.QN=a;this.m=b;a=Cl(b);a!=O&&a!=qh||zl(b,eh,gh);this.hJ=null;c&&(this.hJ=Rk(Q,{style:Sha}))}function Oja(a){return a.hJ?(a.hJ[fe]!=a.m&&a.m[p](a.hJ),a.hJ):a.m}mu[K].td=function(a){Pja(this,a,Nr)};function nu(a,b){Pja(a,b,Ms)}function Pja(a,b,c){var d=Oja(a);c={removable:!0,type:c};b={id:Ss.td(d,b,null,c),message:b,detailedMessage:O,options:c};hu(a.QN,Nr,b)}mu[K].oc=function(){var a=Oja(this);Ss.oc(a)};function ou(a,b,c){try{b[L](c)}catch(d){a.td(d[aq])}};function Qja(a){this.yc=a;this.LR=!1}Qja[K].$pa=function(a,b){return W(function(){if(!this.LR){var c=arguments;ou(this.yc,function(){a[Mc](b,c)})}},this)};function pu(a){this.lb=ao(a);this.tu=new mu(this,this.lb);this.Tu=null}X(pu,Us);pu[K].ac=function(){return this.lb};Ep(pu[K],function(a,b,c){ou(this.tu,W(function(){this.We(a,b,c)},this))});pu[K].We=function(a,b,c){if(!a)throw m("Data table is not defined.");if(!ei(a.Mx))throw b=gia,Yh(a)?b=iha:bi(a)&&(b=gha),m("You called the draw() method with "+b+" rather than a DataTable or DataView");this.Tu&&(this.Tu.LR=!0);this.Tu=new Qja(this.tu);var d=W(this.Tu.$pa,this.Tu);this.Ym(d,a,b,c)}; pu[K].Yf=function(){this.Tu&&(this.Tu.LR=!0,this.Tu=null);this.Wg()};function qu(a,b,c,d){this.lj=a;this.QN=b;this.b=c||{};this.m=d;this.yc=null;d&&(this.yc=this.VY=via(d));if(!(b&&rha in b&&typeof b[Nq]==Bg))throw m("Visualization must have a draw method.");}T=qu[K];T.VY=null;T.JC=null;T.fJ=null;T.t=null;op(T,function(a){this.b=a||{}});Ep(T,function(){this.t&&this.QN[Nq](this.t,this.b)});T.Wsa=function(a){var b=this.m;this.yc=a?a:b?this.yc=this.VY:null}; T.xC=function(){if(!this.yc)throw m("If no container was supplied, a custom error handler must be supplied instead.");var a=this;this.lj[Kp](function(b){var c=a.JC;c&&c(b);a.aD(b);(c=a.fJ)&&c(b)})};T.aD=function(a){var b=this.yc;b(a)&&(this.t=a.Pa(),this.QN[Nq](this.t,this.b))};T.yR=function(a){if(null!=a){if(typeof a!=Bg)throw m(Oga);this.JC=a}};T.xR=function(a){if(null!=a){if(typeof a!=Bg)throw m("Custom post response handler must be a function.");this.fJ=a}};Bp(T,function(){this.lj[Iq]()});function ru(a,b){this.Qe=b;this.kqa=a}hp(ru[K],function(a){this.xu=a;this.ct()});ru[K].ct=function(){var a;a=this.Qe;var b={},c,d=this.nI;d&&(c=aia+d);c&&(b.tqx=c,a=Fja(a,b));this.kqa[L](this,W(this.aD,this),a)};ru[K].aD=function(a){a=new Qs(a);if(!uia(a)){this.nI=a.Ni()?null:a.Z_;var b=this.xu;b[L](b,a)}};function su(){this.Xp=this.Ec=0;this.Fa=[]}function tu(a){if(a.Ec!=a.Xp){var b=a.Fa[a.Ec];delete a.Fa[a.Ec];a.Ec++;return b}}T=su[K];T.zO=function(){return this.Ec==this.Xp?void 0:this.Fa[this.Ec]};T.Lc=function(){return this.Xp-this.Ec};Ua(T,function(){return 0==this.Xp-this.Ec});wa(T,function(){jb(this.Fa,0);this.Xp=this.Ec=0});Pa(T,function(a){return Ri(this.Fa,a)});va(T,function(a){a=Ci(this.Fa,a);if(0>a)return!1;a==this.Ec?tu(this):(Bi[he][L](this.Fa,a,1),this.Xp--);return!0}); T.La=function(){return this.Fa[dd](this.Ec,this.Xp)};function uu(){if(!Sh(vha))throw m("your page is missing the google maps API");this.YC=new google[bq].Geocoder;this.Ad={};this.Ad[Tm({address:O})]={response:[],status:google[bq].GeocoderStatus.ZERO_RESULTS};this.Um=new ck;this.Bu=new Uj;this.mC=new su}Uh(uu);function vu(a,b,c){this.os=a||[];this.NJ=0;this.Yr=b;this.UQ=!1;this.gS=new Uj;this.Jpa=c||this.os[J]}up(vu[K],function(){this.UQ=!0}); vu[K].finish=function(a,b){var c=Tm(a);this.gS.$e(c)||this.gS.set(c,b);c=[];if(!this.UQ){for(var d=h.min(this.NJ+this.Jpa,this.os[J]),e=this.NJ;e<d;e++){var f=Tm(this.os[e]);if(!this.gS.$e(f))return;f=this.gS.get(f);null!=f&&(f=f.response);c[C](f)}this.NJ+=c[J];this.Yr(c);this.NJ>=this.os[J]&&this[pq]()}};function wu(){this.os=[];this.YC=null}wu[K].add=function(a){this.os[C](a)}; wu[K].create=function(a,b,c){if(null!=this.YC){var d=new vu(a,b,c);this.add(d);this.YC.geocode(d)}else wfa(W(function(){null==this.YC&&(this.YC=uu.Xb());this[Up](a,b,c)},this))};up(wu[K],function(){Y(this.os,function(a){a[pq]()});this.os=[]});uu[K].geocode=function(a){Y(a.os,W(function(b){var c=Tm(b);if(c in this.Ad)a.finish(b,this.Ad[c]);else{if(!this.Bu.$e(c)){var d=this.mC;d.Fa[d.Xp++]=b;this.Bu.set(c,[])}this.Bu.get(c)[C](a)}},this));this.eba()}; uu[K].eba=function(){if(0!==this.mC.Lc()||0!==this.Um.Lc()){var a=0<this.Um.Lc()?eo(this.Um.La()[0]):this.mC.zO(),b=Tm(a);if(b in this.Ad){var c=this.Bu.get(b),c=this.Ad[b];tu(this.mC);this.rR(a,c.response,c.status);this.Bu[Ob](b)}else 0===this.Um.Lc()&&0<this.mC.Lc()?(tu(this.mC),c=this.Bu.get(b),Ni(c,function(a){return a.UQ})?this.rR(a,null,null):(this.Um.add(b),Rja(this,a,W(this.rR,this,a)))):0<this.Um.Lc()&&Rja(this,a,W(this.rR,this,a))}}; function Rja(a,b,c){if(ai(b)&&(b=Qj(b),b[Sp])){var d=b[Sp];b.bounds=new google[bq][Xp](new google[bq][Op](d.lo.lat,d.lo.lng),new google[bq][Op](d.hi.lat,d.hi.lng))}a.YC.geocode(b,c)}function Sja(a,b,c){var d=Tm(b),e=a.Bu.get(d);null!=e&&Y(e,function(a){a.UQ||a.finish(b,c)});a.Um[Ob](d);a.Bu[Ob](d)} uu[K].rR=function(a,b,c){var d=0;if(c==google[bq].GeocoderStatus.OVER_QUERY_LIMIT)d=520;else if(c==google[bq].GeocoderStatus.OK){var e=Tm(a);b={response:b,status:c};this.Ad[e]=b;Sja(this,a,b)}else Sja(this,a,null);this.LR=!1;ut(W(this.eba,this),d,this)};function xu(){}function yu(a){if(!(ai(a)&&ei(a.H)&&ei(a.M)))throw m("Invalid data table.");}T=xu[K];T.Ij=function(a){return this.Lb(a)?2:0};T.Ua=function(a,b,c){return a.H()>b&&c==a.D(b)};function Tja(a,b,c,d){for(var e=0;e<d[J];e++)if(a.Ua(b,c,d[e]))return!0;return!1}T.indexOf=function(a,b){for(var c=0;c<a.H();c++)if(a.D(c)==b)return c;return-1};function zu(a,b,c){for(var d=0;d<b[J];++d){var e=b[d];if(e>=a.H()||a.D(e)!=c[d])return!1}return!0} function Au(a,b,c){return a.Ua(b,c,Yg)?Bu(b,c,function(a){return 0<=a}):!1}function Bu(a,b,c){for(var d=h.min(a.M(),20),e=0;e<d;e++){var f=a[I](e,b);if(null!=f&&!c(f))return!1}return!0}T.tna=function(a){return Bm(new zm(-90,90),a)&&!wj(a)};T.una=function(a){return Bm(new zm(-180,180),a)&&!wj(a)};function Uja(a){for(var b=a.QR(0),c=h.min(a.M(),20),d=0,e=0;e<c;e++){var f=a[I](e,1);f&&!Ri(b,f)||d++}return 0.6<d/c};function Cu(){}X(Cu,xu);Cu[K].Lb=function(a){try{this.xd(a)}catch(b){return!1}return!0};Cu[K].xd=function(a){yu(a);var b=a.H();if(2>b)throw m("Invalid data table format: must have at least 2 columns.");for(var c=!0,d=[],e=0;e<b;e++){var f=a.Ss(e);li(f)&&(c?(f=Lr,c=!1):f=Jr);d[C](f)}if(d[0]!==Lr)throw m("Invalid data format: first column must be domain.");a=Vja(d);return{Ng:a.Ng,fw:Gi(a.Df,function(a){return{gm:a.Af,Ng:a.Ng,k:Gi(a.Df,function(a){return{RK:a.Af,Ng:a.Ng}})}})}}; function Vja(a){for(var b=[Lr,Jr],c={Df:[],Ng:{}},d=[c],e=-1,f=0;f<a[J];f++){var g=a[f],k=Ci(b,g),l=null;0<=k&&(l={Af:f,Iv:g,Df:[],Ng:{}});if(0<=k&&k<e){e-=k;for(g=0;g<=e;g++)d.pop();e=k;k=d[d[J]-1];d[C](l);k.Df[C](l)}else 0<=e&&g===b[e]?(d.pop(),k=d[d[J]-1],d[C](l),k.Df[C](l)):e+1<b[J]&&g===b[e+1]?(k=d[d[J]-1],e++,d[C](l),k.Df[C](l)):(k=d[d[J]-1],g in k.Ng||(k.Ng[g]=[]),k.Ng[g][C](f))}return c};function Du(){}X(Du,xu);Du[K].Lb=function(a){yu(a);var b=a.H();if(2>b)return!1;var c=a.D(0);if(c!=og&&c!=pg||a.D(1)!=Yg)return!1;for(var c=0,d=1;d<b;d++){var e=a.D(d);if(e==Yg)c=0;else if(e==rh){if(c++,2<c)return!1}else return!1}return!0};Du[K].Ij=function(a){if(!this.Lb(a))return 0;var b=!1,c=0<this[ld](a,rh),b=a.M(),d=a.Co(0);if(50<b)b=!0;else{for(var e=ia[Jp],f=ia.MIN_VALUE,g=1;g<b;g++)var k=h.abs(a[I](d[g-1],0)-a[I](d[g],0)),e=0<k&&k<e?k:e,f=k>f?k:f;b=0!=e&&50<f/e?!0:!1}return c&&b?3:c||b?2:1};function Eu(a){this.C$=!!(a||{}).Ida}X(Eu,xu);Eu[K].Lb=function(a){yu(a);var b=0,c=a.H();if(1>c)return!1;if(!this.Ua(a,0,Yg)&&(b++,this.C$))for(;b<c&&this.Ua(a,b,rh);)b++;for(var d=null;b<c;){var e=a.D(b);if(e==Yg)d={};else if(this.C$&&e==rh){if(!d)return!1}else if(e==jg){if(!d||d.Qv)return!1;d.Qv=b}else return!1;b++}return null!==d};function Fu(a){this.GO=a&&a.Dd||!1;Eu[L](this,a)}X(Fu,Eu);Fu[K].Lb=function(a){yu(a);if(!Fu.e.Lb[L](this,a))return!1;var b=a.H();if(this.GO)for(var c=1;c<b;c++)if(this.Ua(a,c,Yg)&&!Au(this,a,c))return!1;return!0};Fu[K].Ij=function(a){for(var b=a.H(),c=a.M(),d=0,e=!1,f=0;f<b;f++)this.Ua(a,f,Yg)&&(d++,Au(this,a,f)||(e=!0));return this.Lb(a)?1==c||e||this.Ua(a,0,rh)?1:2<d&&this.GO?3:1!=d||this.GO?1:2:0};function Gu(){}X(Gu,xu);Gu[K].Lb=function(a){yu(a);var b=a.H();return 3>b||5<b||!this.Ua(a,0,rh)||!this.Ua(a,1,Yg)||!this.Ua(a,2,Yg)||3<b&&!this.Ua(a,3,rh)||4<b&&!this.Ua(a,4,Yg)?!1:!0};Gu[K].Ij=function(a){if(this.Lb(a)){var b;if(this.Ua(a,3,rh)){b={};for(var c=0,d=h.min(a.M(),20),e=0;e<d;e++){var f=a[I](e,3);b[f]||c++;b[f]=!0}b=10>c}else b=!1;a=b?3:this.Ua(a,3,rh)?1:2}else a=0;return a};function Hu(){}X(Hu,xu);Hu[K].Lb=function(a){try{this.xd(a)}catch(b){return!1}return!0};Hu[K].xd=function(a){yu(a);var b=a.H();if(2!==b&&3!==b)throw m("Invalid data table format: must have 2 or 3 columns.");var c=1,d=2;2===b&&(c--,d--);this.Db(a,0,rh);this.Db(a,c,rh);this.Db(a,d,Yg);return{vt:c,zja:0,oB:d}};Hu[K].Db=function(a,b,c){if(!this.Ua(a,b,c))throw m(mr+b+Pq+c+Qq);};function Iu(a){this.Jm=a;this.b8=new Uj}np(Iu[K],function(){return this.Jm});function Ju(){}X(Ju,xu);Ju[K].Lb=function(a){try{this.xd(a)}catch(b){return!1}return!0};Ju[K].xd=function(a){yu(a);for(var b=[],c=a.H(),d=0;d<c;++d){var e=a.Ss(d);if(e===O)b[C](new Iu(d));else{if(1>b[J])throw m("At least 1 data column must come before any role column.");Ai(b).b8.set(e,d)}}if(2!=b[J])throw m("Invalid data table format: must have 2 data columns.");c=b[0];b=b[1];this.Db(a,c[nc](),nha);this.Db(a,b[nc](),Yg);return{yX:c,oB:b}}; Ju[K].Db=function(a,b,c){if(!Mi(c[pc](Ps),function(c){return this.Ua(a,b,c)},this))throw m(mr+b+Pq+c+Qq);};function Ku(){}X(Ku,xu);Ku[K].Lb=function(a){yu(a);var b=a.H();if(5>b||6<b||!(this.Ua(a,0,rh)&&this.Ua(a,1,Yg)&&this.Ua(a,2,Yg)&&this.Ua(a,3,Yg)&&this.Ua(a,4,Yg))||6==b&&!this.Ua(a,5,rh))return!1;for(var b=h.min(a.M(),20),c=0;c<b;c++){var d=a[I](c,1),e=a[I](c,2),f=a[I](c,3),g=a[I](c,4);if(d!=h.min(d,e,f,g)||g!=h.max(d,e,f,g))return!1}return!0};Ku[K].Ij=function(a){return this.Lb(a)?3:0};function Lu(){Eu[L](this)}X(Lu,Eu);Lu[K].Ij=function(a){var b=this.Ua(a,0,Yg),c=a.H();b||c--;return this.Lb(a)?2>c?1:2:0};function Mu(){this.Lr=null}X(Mu,xu);Mu[K].Lb=function(a){return!!Wja(this,a)};Mu[K].xd=function(a){a=Wja(this,a);if(null!=a)return a;throw m(this.Lr);};function Wja(a,b){var c=new Iu(0),d=new Iu(1),e=new Iu(2),f=new Iu(3),g=new Iu(4),k=new Iu(5),l=new Iu(6);return a.Db(b,c[nc](),rh)&&a.Db(b,d[nc](),rh)&&a.Db(b,e[nc](),og)&&a.Db(b,f[nc](),og)&&a.Db(b,g[nc](),Yg)&&a.Db(b,k[nc](),Yg)&&a.Db(b,l[nc](),rh)?{zpa:c,vt:d,OF:e,NF:f,vpa:g,Apa:k,upa:l}:null} Mu[K].Db=function(a,b,c){return this.Ua(a,b,c)?!0:(this.Lr=mr+b+Pq+c+Qq,!1)};function Nu(){}X(Nu,xu);Nu[K].Lb=function(a){yu(a);var b;b=a.H();if(1>b||2<b)b=!1;else{var c=!0;2==b&&(c=c&&this.Ua(a,0,rh));b=c=c&&Au(this,a,b-1)}if(!b)if(b=a.H(),c=a.M(),0==b||1!=c)b=!1;else{for(var c=!0,d=0;d<b;d++)if(!this.Ua(a,d,Yg)){c=!1;break}b=c}return b};Nu[K].Ij=function(a){return this.Lb(a)?1<a.M()?2:3:0};function Ou(){}X(Ou,xu);var Xja={Zva:ys,uva:cs,TEXT:Es,Oda:eg};Ou[K].Lb=function(a){var b=a.H();if(1>b||2<b)return!1;var c=this.Ua(a,0,rh);2==b&&(c=c&&this.Ua(a,1,Yg));return c};Ou[K].Ij=function(a){return this.Lb(a)?1:0}; Ou[K].xd=function(a,b,c){try{b=b||eg;var d=0,e,f=-1,g=-1,k=-1,l=-1;if(zu(a,[d,d+1],[Yg,Yg])){e=Yr;k=d;l=d+1;d+=2;if(b===ys)throw m("displayMode must be set to Markers when using lat/long addresses.");b===eg&&(b=cs)}else if(zu(a,[d],[rh])){switch(b){case eg:e=xs;b=ys;f=d;break;case ys:e=xs;f=d;break;case cs:case Es:e=Br;g=d;break;default:throw m("Unknown displayMode: "+b);}d+=1}else throw m("Unknown address type.");var n=null;zu(a,[d],[rh])&&Hs!=a.Li(d,ih)&&(n=d++);var q=null,s=null;zu(a,[d],[Yg])&& (q=d++,zu(a,[d],[Yg])&&(s=d++));var u=null;zu(a,[d],[rh])&&Hs==a.Li(d,ih)&&(u=d++);e!=xs&&null!=q&&null==s&&(s=q);if(a.H()!=d)throw m("Table contains more columns than expected (Expecting "+d+" columns)");return{xX:e,a3:b,pG:f,qG:g,FA:k,HA:l,RG:n,xt:q,YA:s,rY:u}}catch(w){return c&&c.td(Rga+w),null}};function Pu(){}X(Pu,xu);Pu[K].Lb=function(a){try{this.xd(a)}catch(b){return!1}return!0};Pu[K].xd=function(a){yu(a);if(5!=a.H())throw m("Invalid data table format: must have 5 columns.");this.Db(a,0,Yg);this.Db(a,1,Yg);this.Db(a,2,Yg);this.Db(a,3,Yg);this.Db(a,4,rh);return{Tga:0,Uga:1,Sga:2,Kta:3,Rga:4}};Pu[K].Db=function(a,b,c){if(!this.Ua(a,b,c))throw m(mr+b+Pq+c+Qq);};function Qu(a){Eu[L](this,a)}X(Qu,Eu);Qu[K].Lb=function(a){yu(a);if(!Qu.e.Lb[L](this,a))return!1;var b=a.H();if(this.GO)for(var c=1;c<b;c++)if(this.Ua(a,c,Yg)&&!Au(this,a,c))return!1;return!0};Qu[K].Ij=function(a){for(var b=a.H(),c=a.M(),d=0,e=0,f=0;f<b;f++)this.Ua(a,f,Yg)?d++:this.Ua(a,f,og)&&e++;return this.Lb(a)?10>c?1:2>d&&0==e?3:2:0};function Ru(){}X(Ru,xu);Ru[K].Lb=function(a){return Yja(this,a)||Zja(this,a)};Ru[K].Ij=function(a){var b=Yja(this,a);a=Zja(this,a);return b||a?a?1:3:0};function Yja(a,b){yu(b);var c=b.H();if(2>c||3<c)return!1;var d=a.Ua(b,0,Yg),d=d&&a.Ua(b,1,Yg);3==c&&(d=d&&a.Ua(b,2,rh));if(c=d)a.Ua(b,0,Yg)&&a.Ua(b,1,Yg)?(c=W(a.tna,a),d=W(a.una,a),c=Bu(b,0,c)&&Bu(b,1,d)):c=!1;return c}function Zja(a,b){yu(b);var c=b.H();return 1>c||2<c||!a.Ua(b,0,rh)||2==c&&!a.Ua(b,1,rh)?!1:!0};function Su(){}X(Su,xu);Su[K].Lb=function(a){yu(a);var b=a.H();if(3>b||a.D(0)!=rh)return!1;var c=a.D(1);if(c!=Yg&&c!=og&&c!=rh||c==rh&&!$ja(a)&&!aka(a)||c==Yg&&!Bu(a,1,function(a){return wj(a)}))return!1;for(c=2;c<b;c++){var d=a.D(c);if(d!=Yg&&d!=rh)return!1}return!0};Su[K].Ij=function(a){return this.Lb(a)?this.Ua(a,1,Yg)&&!bka(a)?1:3:0};function bka(a){return Bu(a,1,function(a){return 1900<a&&2100>a})} function $ja(a){return Bu(a,1,function(a){return 7!=a[J]||ga(a[ae](0,3))||a[Bb](4)!=Qf||ga(a[ae](6,7))?!1:!0})}function aka(a){return Bu(a,1,function(a){return 6!=a[J]||ga(a[ae](0,3))||a[Bb](4)!=Af||ga(a[Bb](5))?!1:!0})};function Tu(){}X(Tu,xu);Tu[K].Lb=function(a){yu(a);var b=a.H();if(2>b||3<b)return!1;var c=this.Ua(a,0,rh)&&this.Ua(a,1,rh);3==b&&(c=c&&this.Ua(a,2,rh));return c&&Uja(a)};Tu[K].Ij=function(a){return this.Lb(a)?3:0};function $u(){}X($u,xu);$u[K].Lb=function(a){yu(a);var b=a.H();if(1>b||2<b)return!1;var c=this.Ua(a,b-1,Yg);return c=c&&Au(this,a,b-1)};$u[K].Ij=function(a){if(this.Lb(a))if(1==a.M())a=1;else{var b;if(!(b=!this.Ua(a,0,rh))&&!(b=25<a.M())){for(var c=b=0;c<a.M();c++)b+=a[I](c,1);b=!(97<b&&103>b||0.97<b&&1.03>b)}a=b?2:3}else a=0;return a};function av(){}X(av,xu);av[K].Lb=function(a){yu(a);var b=a.H();if(0==b)return!1;for(var c=this.Ua(a,0,rh)?1:0,d=b>c;c<b;c++)if(!this.Ua(a,c,Yg)){d=!1;break}return d};function bv(){}X(bv,xu);bv[K].Lb=function(a){try{this.xd(a)}catch(b){return!1}return!0}; bv[K].xd=function(a){if(Yh(a)){var b=a[0];a=a[1];var c=b.H();if(3!==c)throw m("Invalid linkTable format: must have 3 columns.");this.Db(Zr,b,0,Yg);this.Db(Zr,b,1,Yg);this.Db(Zr,b,2,Yg);c=a.H();if(1!==c&&2!==c)throw m("Invalid nodeTable format: must have 1 or 2 columns.");this.Db(Nha,a,0,rh);2===c&&this.Db(Nha,a,1,rh);for(var d=[],e=[],f=0,g=b.M();f<g;++f){var k=b[I](f,0),l=b[I](f,1),n=b[I](f,2);e[C]({source:k,target:l,value:n})}f=0;for(g=a.M();f<g;++f)d[C]({name:a[I](f,0),jb:2===c?a[I](f,1):O});return{links:e, nodes:d}}yu(a);if(3!==a.H())throw m(Tga);this.Db(Kr,a,0,rh);this.Db(Kr,a,1,rh);this.Db(Kr,a,2,Yg);b=new Uj;c=[];d=[];e=0;for(f=a.M();e<f;++e)g=cka(b,c,a[I](e,0)),k=cka(b,c,a[I](e,1)),l=a[I](e,2),d[C]({source:g,target:k,value:l});return{links:d,nodes:c}};function cka(a,b,c){if(a.$e(c))return a.get(c);a.set(c,b[J]);b[C]({name:c,jb:O});return b[J]-1}bv[K].Db=function(a,b,c,d){if(!this.Ua(b,c,d))throw m("Invalid format in "+a+": column #"+c+Pq+d+Qq);};function cv(){}X(cv,xu);cv[K].Lb=function(a){yu(a);var b=a.H();if(2>b||this.Ua(a,0,jg)||this.Ua(a,0,rh))return!1;for(var c=1,d=0,e=0;c<b;){var f=a.D(c);if(f==Yg)d++,e=0;else if(f==jg){if(e++,0==d||1<e)return!1}else return!1;c++}return 0<d};function dv(){}X(dv,xu);dv[K].Lb=function(a){yu(a);for(var b=!0,c=a.H(),d=0;d<c;d++)if(!this.Ua(a,d,Yg)){b=!1;break}return b};dv[K].Ij=function(a){return this.Lb(a)?2>a.H()?1:2:0};function ev(){}X(ev,xu);ev[K].Lb=function(a){try{this.xd(a)}catch(b){return!1}return!0};ev[K].xd=function(a){yu(a);var b=a.H();if(1>b)throw m("Invalid data table format: must have at least 1 column.");this.Db(a,0,og);for(var c=[],d=1;d<b;d++)this.Db(a,d,Yg),c[C](d);return{yX:0,rja:c}};ev[K].Db=function(a,b,c){if(!this.Ua(a,b,c))throw m(mr+b+Pq+c+Qq);};function fv(){}X(fv,xu);fv[K].Lb=function(a){try{this.xd(a)}catch(b){return!1}return!0};fv[K].xd=function(a){yu(a);if(3!=a.H())throw m(Tga);this.Db(a,0,rh);this.Db(a,1,Yg);this.Db(a,2,rh);return{vt:0,rka:2,oB:1}};fv[K].Db=function(a,b,c){if(!this.Ua(a,b,c))throw m(mr+b+Pq+c+Qq);};function gv(){}X(gv,xu);gv[K].Lb=function(){return!0};function hv(a){this.b=a||new jn([])}X(hv,xu);var dka=[og,Yg,pg];hv[K].Lb=function(a){try{this.xd(a)}catch(b){return!1}return!0}; hv[K].xd=function(a){yu(a);for(var b=[],c=a.H(),d=0;d<c;++d){var e=a.Ss(d);if(e===O)b[C]({index:d,Ng:{}});else{if(1>b[J])throw m("At least 1 data column must come before any role columns");Ai(b).Ng[e]=d}}c=b[J];if(3!==c&&4!==c)throw m("Invalid data table format: must have 3 or 4 data columns.");d=4==c;this.Db(a,b[0][nc],rh);d&&this.Db(a,b[1][nc],rh);this.Db(a,b[d?2:1][nc],dka);this.Db(a,b[d?3:2][nc],dka);return 4===c?(a=!pn(this.b,hia,!0),{vt:b[a?1:0],lA:b[a?0:1],OF:b[2],NF:b[3]}):{vt:b[0],lA:null, OF:b[1],NF:b[2]}};hv[K].Db=function(a,b,c){Yh(c)||(c=[c]);if(!Tja(this,a,b,c))throw m(mr+b+Pq+c+Qq);};function iv(){}X(iv,xu);iv[K].Lb=function(a){try{this.xd(a)}catch(b){return!1}return!0};iv[K].xd=function(a){yu(a);if(2>a.H())throw m("Invalid data table format: must have 2 columns.");this.Db(a,0,og);this.Db(a,1,Yg);return{Qta:0,Rta:1}};iv[K].Db=function(a,b,c){Yh(c)||(c=[c]);if(!Tja(this,a,b,c))throw m(mr+b+Pq+c+Qq);};function jv(){}X(jv,xu);jv[K].Lb=function(a){yu(a);var b=a.H();if(2>b||4<b)return!1;var c=this.Ua(a,0,rh)&&this.Ua(a,1,rh);2<b&&(c=c&&Au(this,a,2))&&3<b&&(c=c&&this.Ua(a,3,Yg));return c&&Uja(a)};jv[K].Ij=function(a){return this.Lb(a)?3:0};function kv(a){this.xk=Yh(a)?a:Hj(eka)}kv[K].kU=function(a){var b=[];Dj(this.xk,function(c){var d=fka[c],e=d&&d[Kb];e&&(e=e.Ij(a),0!=e&&b[C]({type:c,Hca:e,oe:d.oe}))});gka(b);return Gi(b,function(a){return a[H]})};function gka(a){dj(a,function(a,c){var d=a.Hca-c.Hca;0==d&&(d=a.oe-c.oe);return-d})} var eka={hua:$q,Gra:ar,nua:cr,yua:dr,Aua:er,Iua:fr,Kra:gr,Wua:hr,Xua:ir,Wra:jr,bva:kr,cva:lr,Gva:pr,Xra:nr,Tva:sr,tva:or,Lva:qr,$ra:tr,kwa:br,nwa:ur,l5:vr,vwa:wr,xwa:xr,gsa:yr},fka={AnnotatedTimeLine:{format:new Du,oe:3},AreaChart:{format:new Fu({Ida:!0}),oe:2},BarChart:{format:new Eu,oe:2},BubbleChart:{format:new Gu,oe:2},CandlestickChart:{format:new Ku,oe:2},ColumnChart:{format:new Eu,oe:2},ComboChart:{format:new Lu,oe:2},Gauge:{format:new Nu,oe:1},GeoChart:{format:new Ou,oe:3},Histogram:{format:new Qu, oe:3},LineChart:{format:new Eu({Ida:!0}),oe:2},ImageRadarChart:{format:new av,oe:1},ImageSparkLine:{format:new dv,oe:1},Map:{format:new Ru,oe:2},MotionChart:{format:new Su,oe:3},OrgChart:{format:new Tu,oe:2},PieChart:{format:new $u,oe:2},ScatterChart:{format:new cv,oe:2},"AreaChart-stacked":{format:new Fu({Dd:!0}),oe:2},SteppedAreaChart:{format:new Fu,oe:2},Table:{format:new gv,oe:0},Timeline:{format:new hv,oe:2},TreeMap:{format:new jv,oe:2},WordTree:{format:new Ou,oe:2}};V("google.visualization.ChartSelection",kv,void 0);kv[K].calculateChartTypes=kv[K].kU;var hka={AnnotatedTimeLine:Cr,AnnotationChart:"annotationchart",AreaChart:Ir,BarChart:Ir,BubbleChart:Ir,CandlestickChart:Ir,ColumnChart:Ir,ComboChart:Ir,Gauge:Qr,GeoChart:Rr,GeoMap:"geomap",Histogram:Ir,ImageAreaChart:"imageareachart",ImageBarChart:"imagebarchart",ImageCandlestickChart:"imagechart",ImageChart:"imagechart",ImageLineChart:"imagelinechart",ImagePieChart:"imagepiechart",ImageSparkLine:Ur,IntensityMap:"intensitymap",LineChart:Ir,Map:bs,MotionChart:ds,OrgChart:us,PieChart:Ir,RangeSelector:Ir, ScatterChart:Ir,SparklineChart:Ir,SteppedAreaChart:Ir,Table:Ds,Timeline:Gs,TreeMap:Is,StringFilter:Hr,DateRangeFilter:Hr,NumberRangeFilter:Hr,CategoryFilter:Hr,ChartRangeFilter:Hr,NumberRangeSetter:Hr,ColumnSelector:Hr,Dashboard:Hr};function lv(a,b){var c=a.useFormatFromData;ci(c)&&!c||!mi(a[Kb])||(b=Fi(b,function(a){return!mi(a)}),Bda(b),1==b[J]&&(c=ika(b[0]),ua(a,c)))}function ika(a){mi(a)||(a=a[vb](/\d/g,Oe),a=a[vb](/#{10,}/,ti(qe,10)));return a};function jka(a){var b=kka(a),c=new ku(a);c.yq([0,1,{type:Yg,calc:function(c,e){var f=mv(a,e);return null!=f?b.gJ*f.x+b.coa:null}}]);return c}function kka(a){var b;b=a.M();for(var c=new sk,d=0;d<b;d++){var e=mv(a,d);null!=e&&(c.x+=e.x,c.y+=e.y)}b=new sk(c.x/b,c.y/b);for(e=d=c=0;e<a.M();e++){var f=mv(a,e);null!=f&&(f=new sk(f.x-b.x,f.y-b.y),c+=f.x*f.y,d+=f.x*f.x)}a={};a.gJ=c/d||1;a.coa=b.y-a.gJ*b.x;return a}function mv(a,b){var c=a[I](b,0),d=a[I](b,1);return null==c||null==d?null:new sk(c,d)};function lka(a){var b=a.Vb(),c=a.Pa();a=a.Vc();var d;t:if(d=a.useFormatFromData,ci(d)&&!d)d=!1;else{d=[Ls,fia,dia,eia,qha];for(var e=0;e<d[J];e++)if(Sh(d[e]+Sq,a)){d=!1;break t}d=!0}if(d)if(b==dr)3>c.H()||(b=c.ju(1),d=a.hAxis||{},lv(d,[b]),a.hAxis=d,c=c.ju(2),b=a.vAxes||{},d=b[0]||{},lv(d,[c]),b[0]=d,a.vAxes=b);else{d=a.vAxes||[{},{}];for(var e=a.hAxis||{},f=d[0]||{},g=d[1]||{},k=[],l=[],n=c&&c.H()||0,q=0;q<n;q++)if(c.D(q)==Yg){var s=c.ju(q),u;u=q;0==u?u=null:(u--,u=((a.series||{})[u]||{}).targetAxisIndex|| 0);switch(u){case 0:k[C](s);break;case 1:l[C](s)}}b==cr?lv(e,k):(lv(f,k),lv(g,l));0<n&&c.D(0)!=rh&&(b=b==cr?f:e,s=c.ju(0),lv(b,[s]));d[0]=f;d[1]=g;a.vAxes=d;a.hAxis=e}}function mka(a){if(a[cq](Ar)){var b=a.Pa();a.Vb()==tr&&2==b.H()&&(b=jka(b),a.jg(b),a.K(Yha,2),a.K(Zha,0),a.K($ha,!1));a.K(Ar,null)}}function nka(a){var b=a.Pa(),c=a.In;if(Yh(c))for(var d=0;d<c[J];d++)b=lu(b,c[d]);else null!=c&&(b=lu(b,c));a.PB(null);a.jg(b)} function oka(a){var b=a.Vb();if((hka[b]||null)==Ir&&b!=tr){var b=a.Pa(),c=a[cq](Sr);if(null!=c){for(var d=[{calc:c?bia:sha,sourceColumn:0,type:rh}],e=b.H(),c=c?1:0;c<e;c++)d[C](c);b=new ku(b);b.yq(d);a.K(Sr,null);a.jg(b)}}};function nv(a,b){var c=b||{};bi(c)&&(c=lo(c));this.$F=c.containerId||null;this.fM=a;this.rg=c[a+cha]||null;this.Oh=c[a+Yga]||null;this.wA=null;Cp(this,null);this.hN=null;this.Qe=c.dataSourceUrl||null;this.t=null;this.jg(c.dataTable);this.b=c[eq]||{};this.n=c[dq]||{};var d=c.packages;this.xM=Qh(d)?d:null;this.lj=c.query||null;this.cl=c.refreshInterval||null;this.In=c[Lq]||null;this.FE=null;this.r6=[nka,oka,lka,mka];this.l7=c.isDefaultVisualization||!Qh(c.isDefaultVisualization)}X(nv,Us);T=nv[K]; T.saa=null;T.pS=null;T.m=null;T.o=function(){var a=new this[rc](this[Wp]());a.FE=this.FE;return a};T.w=function(){this[Wb]();nv.e.w[L](this)};wa(T,function(){ov(this)}); Ep(T,function(a){a=Hk(a||O);if(!Sk(a)){var b=this.$F;a=Hk(b);if(!Sk(a))throw m("The container #"+b+" is null or not defined.");}this.m=a;try{if(null==this.Vb())throw m("The "+this.fM+" type is not defined.");if(bo(this.Vb()))this.O$(a);else{var c=W(this.O$,this,a),c=Ss.UP(c,W(this.Ip,this,a)),d=this.xM;if(null==d){var e=this.Vb(),e=e[vb](mca,O),d=hka[e]||null;if(null==d)throw m("Invalid visualization type: "+e);}bi(d)&&(d=[d]);var d={packages:d,callback:c},f=Sh(pca);null===f&&(f=vaa);d=d?d:{callback:Th}; d.callback=d.callback||Th;var g,e=null,k=Sh(wha);k&&0<=gm(k,0,Dha,k[xc](hm))&&(e=im(k,Dha));(g=e)&&!d.language&&(d.language=g);sfa(rfa.Xb(),f,d)}}catch(l){this.Ip(a,l)}});Fa(T,function(){return io(pka(this,this.Pa()))});T.Ir=function(){return pka(this,this.saa||this.Pa())}; function pka(a,b){var c=a.xM,d=void 0;null===b||(d=ei(b.ww)?b.ww().Ir():b.Ir());c={containerId:a.$F||void 0,dataSourceUrl:a.Qe||void 0,dataTable:d,options:a.Vc()||void 0,state:a[hq]()||void 0,packages:null===c?void 0:c,refreshInterval:a.cl||void 0,query:a.On()||void 0,view:a.In||void 0,isDefaultVisualization:a.Waa()};c[a.fM+cha]=a.Vb()||void 0;c[a.fM+Yga]=a[Lp]()||void 0;a.Vaa(c);return c}T.Vaa=function(){};T.CS=function(){return this.Qe};T.Pa=function(){return this.t};T.Vb=function(){return this.rg}; ip(T,function(){return this.Oh});T.N2=function(){return this[Md]};T.zS=function(){return this.$F};T.On=function(){return this.lj};T.DS=function(){return this.cl};pp(T,function(a,b){return pv(this.b,a,b)});function pv(a,b,c){a=-1==b[ld](Me)?a[b]:Sh(b,a);c=Qh(c)?c:null;return null!=a?a:c}T.Vc=function(){return this.b};sp(T,function(){return this.n});T.Waa=function(){return this.l7};T.qi=function(a){this.Qe=a};T.Xsa=function(a){this.FE=a};T.Dsa=function(){return this.FE};T.jg=function(a){this.t=Wfa(a)}; T.Du=function(a){this.rg=a};T.An=function(a){this.Oh=a};T.HS=function(a){this.$F=a};T.fk=function(a){this.lj=a};T.Vm=function(a){this.cl=a};T.K=function(a,b){qka(this.b,a,b)};function qka(a,b,c){null==c?Wh(pv(a,b))||(c=b[pc](Me),1<c[J]&&(b=c.pop(),a=pv(a,c[ie](Me))),delete a[b]):V(b,c,a)}op(T,function(a){this.b=a||{}});T.setProperty=function(a,b){var c=a[pc](Me);if(0<c[J]){var d=c[rb]();if(d=rka[d])if(0===c[J])d.set[Mc](this,b);else d=d.get[Mc](this),qka(d,c[ie](Me),b)}}; T.vc=function(a){this.n=a||{}};T.gI=function(a){this.xM=a};T.PB=function(a){this.In=a};T.ita=function(a){a!=this[Md]&&(this.hN=a)};T.R3=function(a){this.l7=a};T.$Q=function(){return new this[rc](this.Ir())};T.FS=function(){return this.In};T.K2=function(){return this.xM};T.Ip=function(a,b){var c=b&&b[aq]||Nr,d=Ss.td(a,c);hu(this,Nr,{id:d,message:c})}; T.PP=function(a,b){var c=bo(this.Vb());if(!c)throw m("Invalid "+this.fM+" type: "+this.Vb());this.hN&&(ov(this),Cp(this,this.hN),this.hN=null);var d;if(d=this[Md])if(d=this[Md][rc]==c)d=(d=this[Md])&&ei(d.ac)?d.ac()==a:!1;d?c=this[Md]:(ov(this),c=new c(a));this.wA&&this.wA!=c&&ei(this.wA.Yf)&&this.wA.Yf();this.wA=c;ska(this,c);this.saa=b;d=hn(this.Vc());d=new qv({chartType:this.Vb(),dataTable:b,options:d,view:this.In});for(var e=0;e<this.r6[J];e++)this.r6[e](d);c[Nq](d.Pa(),d.Vc(),this[hq]())}; T.Psa=function(a){Yh(this.In)?this.In[C](a):this.In=null===this.In?[a]:[this.In,a]};T.Toa=function(a,b){if(b.Ni()){var c=b.fI(),d=b.I0(),e=Ss.TB(a,b);hu(this,Nr,{id:e,message:c,detailedMessage:d})}else this.PP(a,b.Pa())};function ska(a,b){tka(a);var c=[];Y([ws,As,Nr,Cs],function(d){var e=eu(b,d,function(c){d==ws&&(a.wA=null,Cp(a,b));d!=ws&&d!=Cs||!ei(b[hq])||a.vc(b[hq][L](b));hu(a,d,c)});c[C](e)});a.pS=c} T.O$=function(a){var b=this.Pa();if(b)this.PP(a,b);else if(null!=this.Qe)b=W(this.Toa,this,a),b=Ss.UP(b,W(this.Ip,this,a)),this.KQ(b,!0);else throw m("Cannot draw chart: no data specified.");};T.KQ=function(a,b){var c=ci(b)?b:!1,d=new St(this.Qe||O),e=this.cl;e&&c&&d.Vm(e);(c=this.On())&&d.fk(c);d[Kp](a)};function ov(a){a[Md]&&ei(a[Md].Yf)&&a[Md].Yf();Ws(a[Md]);Cp(a,null)}function tka(a){Yh(a.pS)&&(Y(a.pS,function(a){iu(a)}),a.pS=null)} var rka={name:{get:nv[K][Lp],set:nv[K].An},type:{get:nv[K].Vb,set:nv[K].Du},containerId:{get:nv[K].zS,set:nv[K].HS},options:{get:nv[K].Vc,set:nv[K][$p]},state:{get:nv[K][hq],set:nv[K].vc},dataSourceUrl:{get:nv[K].CS,set:nv[K].qi},dataTable:{get:nv[K].Pa,set:nv[K].jg},refreshInterval:{get:nv[K].DS,set:nv[K].Vm},query:{get:nv[K].On,set:nv[K].fk},view:{get:nv[K].FS,set:nv[K].PB}};function qv(a){nv[L](this,Er,a)}X(qv,nv);T=qv[K];T.Sd=nv[K].N2;T.xL=nv[K].ita;T.Gd=nv[K].Du;T.Ya=nv[K].Vb;T.oW=nv[K].An; T.nW=nv[K][Lp];function rv(a){nv[L](this,lha,a)}X(rv,nv);T=rv[K];T.eR=nv[K].N2;T.Vsa=nv[K].Du;T.Csa=nv[K].Vb;T.Usa=nv[K].An;T.Bsa=nv[K][Lp];function sv(a){this.Td=a;this.Yd={}}X(sv,Us);var uka=[];T=sv[K];T.l=function(a,b,c,d){return tv(this,a,b,c,d)};function uv(a,b,c,d,e){tv(a,b,c,d,!1,e)}function tv(a,b,c,d,e,f){Yh(c)||(c&&(uka[0]=c[hc]()),c=uka);for(var g=0;g<c[J];g++){var k=kt(b,c[g],d||a[Pp],e||!1,f||a.Td||a);if(!k)break;a.Yd[k.key]=k}return a}T.sB=function(a,b,c,d){return vka(this,a,b,c,d)}; function vka(a,b,c,d,e,f){if(Yh(c))for(var g=0;g<c[J];g++)vka(a,b,c[g],d,e,f);else{b=nt(b,c,d||a[Pp],e,f||a.Td||a);if(!b)return a;a.Yd[b.key]=b}return a}T.uc=function(a,b,c,d,e){if(Yh(b))for(var f=0;f<b[J];f++)this.uc(a,b[f],c,d,e);else c=c||this[Pp],e=e||this.Td||this,c=lt(c),d=!!d,b=dt(a)?a.yJ(b,c,d,e):a?(a=mt(a))?a.yJ(b,c,d,e):null:null,b&&(pt(b),delete this.Yd[b.key]);return this};T.oc=function(){Dj(this.Yd,pt);this.Yd={}};T.w=function(){sv.e.w[L](this);this.oc()}; kp(T,function(){throw m("EventHandler.handleEvent not implemented");});function vv(a){this.m=a;this.C=new sv(this)}X(vv,Us);T=vv[K];T.w=function(){this[Wb]();vv.e.w[L](this)};wa(T,function(){this.C.oc();Ws(this.C);Wk(this.m)});T.ac=function(){return this.m};T.addEventListener=function(a,b,c,d,e){e?tv(this.C,a,b,c,d,e):this.C.l(a,b,c,d)};Ep(T,function(){});sp(T,function(){return{}});function wv(a){this.m=ao(a);this.yc=new mu(this,this.m);this.yaa=[]}X(wv,Us);T=wv[K];T.w=function(){this[Wb]();wv.e.w[L](this)};wa(T,function(){wka(this)});T.xa=null;T.lz=null;T.b=null;T.Mc=null;T.XG=null;T.$W=null;T.n=null;T.Ut=null;T.Pa=function(){return this.xa};T.Vc=function(){return this.b};T.uj=function(){return{}};T.$k=function(a,b){return In(b,Js,{})};T.Ar=function(){return O};T.Rba=function(a){this.yaa=a};T.sP=function(){return this.yaa};T.zp=function(){}; sp(T,function(){return this.n?lo(io(this.n)):null});Ep(T,function(a,b,c){this.xa=a;this.lz=b||{};this.$W=c||{};ou(this.yc,this.wz,this)}); T.wz=function(){if(this.xa){this.n=this.$W||{};if(!ai(this.n))throw m("Control state must be an object.");this.Ut=this.Ut||this.n;this.b=new jn([this.lz,this.uj()||{}]);this.zp(this.xa,this.b,this.n);wka(this);var a=zn(this.b,kia,this.Ar());this.Mc=(a=bo(a))?new a(this.m):null;if(!this.Mc)throw m("Invalid Ui instance.");this.XG=eu(this.Mc,Ks,W(this.uia,this));this.Mc[Nq](this.n,this.$k(this.xa,this.b));this.n=this.Mc[hq]();hu(this,ws,null)}}; function wka(a){a.XG&&(iu(a.XG),Ws(a.XG),a.XG=null);Ws(a.Mc);a.Mc=null;Wk(a.m)}T.uia=function(a){this.n=this.Mc[hq]();hu(this,Cs,a)};T.zs=function(){ou(this.yc,this.mqa,this)};T.mqa=function(){this.Ut&&(this.$W=this.Ut,this.wz())};function xv(){this.Vg=new Uj;this.ts=new Uj;this.Iu=new Uj}function xka(a,b,c){yka(a,b,c)||(a.Vg.set(yv(b),b),a.Vg.set(yv(c),c),zka(b,c,a.ts),zka(c,b,a.Iu))}T=xv[K];wa(T,function(){this.Vg[Wb]();this.ts[Wb]();this.Iu[Wb]()});Ua(T,function(){return this.Vg[$c]()});T.Lc=function(){return this.Vg.Lc()};T.La=function(){return this.Vg.La()};Pa(T,function(a){return this.Vg.$e(yv(a))});function yka(a,b,c){b=yv(b);return a.ts.$e(b)&&a.ts.get(b)[Lc](yv(c))} function zv(a,b){if(!a[Lc](b))return null;var c=a.Iu.get(yv(b));return c?Yda(c,function(a){return this.Vg.get(a)},a):null}T.$f=function(a){return this[Lc](a)?(a=this.ts.get(yv(a)))?Yda(a,function(a){return this.Vg.get(a)},this):null:null};function Av(a){if(a.Vg[$c]())return[];var b=[];bk(a.ts,function(a,d){this.Iu.$e(d)||b[C](this.Vg.get(d))},a);if(0==b[J])throw m("Invalid state: DAG has not root node(s).");return b} function Aka(a){for(var b=Bka(a.Iu),c=[],d=Gi(Av(a),function(a){return yv(a)},a);0<d[J];){for(var e=[],f=0;f<d[J];f++){var g=d[f];c[C](a.Vg.get(g));var k=a.ts.get(g);k&&bk(k,function(a){b.get(a)[Ob](g);b.get(a)[$c]()&&(b[Ob](a),e[C](a))})}d=e}if(c[J]!=a.Vg.Lc())throw m("cycle detected");}T.o=function(){return this[$c]()?new xv:xv[K].tR[Mc](this,Av(this))};T.tR=function(a){var b=new xv;if(0==arguments[J])return b;for(var c=0;c<arguments[J];c++)Cka(this,arguments[c],b);return b}; function Cka(a,b,c){var d=a.$f(b);d&&bk(d,function(a){xka(c,b,a);Cka(this,a,c)},a)}function yv(a){var b=typeof a;return b==$g&&a||b==Bg?Zg+fi(a):b[ec](0,1)+a}function zka(a,b,c){var d=c.get(yv(a));d||(d=new ck,c.set(yv(a),d));d.add(yv(b))}function Dka(a,b,c){var d=c.get(yv(a));d[Ob](yv(b));d[$c]()&&c[Ob](yv(a))}function Eka(a,b){return!a.ts.$e(yv(b))&&!a.Iu.$e(yv(b))}function Bka(a){var b=new Uj;bk(a,function(a,d){b.set(d,a.o())});return b};function Bv(a){this.Yg=new xv;this.kR=null;this.xJ=[];this.yc=new mu(this,a);this.Tm=null}X(Bv,Us);T=Bv[K];T.w=function(){this[Wb]();Bv.e.w[L](this)};wa(T,function(){Y(this.xJ,function(a){iu(a)});this.xJ=[];this.Tm=null;this.Yg[Wb]()});T.Ip=function(a){this.yc.td(a)}; lp(T,function(a,b){if(Fka(a))if(Gka(b)){var c=fi(a);if(fi(b)==c)this.Ip(Mga);else{c=[];this.Yg[Lc](a)||c[C](a);this.Yg[Lc](b)||c[C](b);xka(this.Yg,a,b);var d;try{Aka(this.Yg),d=!0}catch(e){d=!1}d?d=!0:(this.Ip(aha),d=!1);if(d)for(d=0;d<c[J];d++)this.xJ[C](eu(c[d],Cs,W(this.ypa,this,c[d]))),this.xJ[C](eu(c[d],ws,W(this.xpa,this,c[d]))),this.xJ[C](eu(c[d],Nr,W(this.wpa,this,c[d])));else c=this.Yg,yka(c,a,b)&&(Dka(a,b,c.ts),Dka(b,a,c.Iu),Eka(c,a)&&c.Vg[Ob](yv(a)),Eka(c,b)&&c.Vg[Ob](yv(b)))}}else this.Ip(b+ tga);else this.Ip(a+vga)});Ep(T,function(a){if(a&&!this.Yg[$c]()){this.kR=Wfa(a);this.Tm=new Cv(this);a=Av(this.Yg);for(var b=0;b<a[J];b++)a[b].jg(this.kR);this.Tm[y](a)}});function Gka(a){return ai(a)&&ei(a[Nq])&&ei(a.setDataTable)}function Fka(a){return Gka(a)&&ei(a.getControl)}T.ypa=function(a){this.Tm=this.Tm||new Cv(this);Hka(this.Tm,a)}; T.xpa=function(a){var b;if(b=Fka(a)){b=a.eR();var c;if(c=ai(b)){if(ei(b.applyOperator))t:{b=this.Yg;c=b.tR(a);for(var d=c.La(),e=0;e<d[J];e++){var f=d[e];if(f!=a&&zv(c,f)[J]!=zv(b,f)[J]){b=!1;break t}}b=!0}else b=ei(b[Mc]);c=b}b=!c}b?this.Ip(a+uga):(this.Tm=this.Tm||new Cv(this),Hka(this.Tm,a))};T.wpa=function(a){this.Tm&&this.Tm.handleError(a)};function Ika(a,b){b?hu(a,ws,null):a.Ip(Zga);a.Tm=null} function Jka(a,b){if(1==b[J])return b[0];for(var c=b[0],d=$i(b,1),e=new ck(Kka(a,d[0])),f=1;f<d[J]&&(e=e.Ky(Kka(a,d[f])),!e[$c]());f++);for(var f=[],g=0;g<c.M();g++)e[Lc](Lka(a,c,g))&&f[C](g);e=new ck(Mka(a,d[0]));for(g=1;g<d[J]&&(e=e.Ky(Mka(a,d[g])),!e[$c]());g++);d=[];for(g=0;g<c.H();g++)e[Lc](Nka(a,c,g))&&d[C](g);c=new ku(c);c.qn(f);c.yq(d);return c}function Kka(a,b){for(var c=[],d=0;d<b.M();d++){var e=Lka(a,b,d);null!=e&&c[C](e)}return c} function Lka(a,b,c){for(;b!==a.kR;)c=b.cn(c),b=b.Pa();return c}function Mka(a,b){for(var c=[],d=0;d<b.H();d++){var e=Nka(a,b,d);null!=e&&c[C](e)}return c}function Nka(a,b,c){for(;b!==a.kR&&-1!==c;)c=b.jF(c),b=b.Pa();-1==c&&(c=null);return c}function Cv(a){this.xr=a;this.Yg=a.Yg.o();this.Qp={};a=this.Yg.La();for(var b=0;b<a[J];b++)this.Qp[fi(a[b])]=ws}La(Cv[K],function(a){Cv[K].Jca[Mc](this,a);for(var b=0;b<a[J];b++)this.We(a[b])}); function Hka(a,b){if(a.Yg[Lc](b)){switch(a.Qp[fi(b)]){case vs:break;case Nr:break;case Mr:a.Qp[fi(b)]=ws;Oka(a,b);break;case ws:a.Jca(b);Oka(a,b);break;default:fi(b)}Pka(a)}}Cv[K].handleError=function(a){if(this.Yg[Lc](a)){switch(this.Qp[fi(a)]){case vs:case ws:case Nr:break;case Mr:this.Qp[fi(a)]=Nr;a=this.Yg.tR(a).La();for(var b=1;b<a[J];b++)this.Qp[fi(a[b])]=Nr;break;default:fi(a)}Pka(this)}}; function Pka(a){var b=0;Rda(a.Qp,function(a){if(a==Nr)b++;else if(a!=ws)return!1;return!0},a)&&Ika(a.xr,0==b)}Cv[K].Jca=function(a){for(var b=xv[K].tR[Mc](this.Yg,arguments),c=b.La(),d=0;d<c[J];d++){var e=b,f=c[d];if(!e[Lc](f)||e.Iu.$e(yv(f)))this.Qp[fi(c[d])]=vs}};Cv[K].We=function(a){this.Qp[fi(a)]=Mr;var b=Ss.UP(function(){a[Nq]()},W(this.handleError,this,a));ut(b)}; function Oka(a,b){var c=a.Yg.$f(b);if(c){var d=b.eR();d.Rba&&d.Rba(c);for(d=0;d<c[J];d++){var e=c[d],f;t:{f=a;var g=zv(f.Yg,e);if(g)for(var k=0;k<g[J];k++)if(f.Qp[fi(g[k])]!=ws){f=!1;break t}f=!0}f&&(f=Qka(a,e),e.jg(f),a.We(e))}}}function Qka(a,b){var c=Gi(zv(a.Yg,b),function(a){a=a.eR();if(ei(a[Mc]))return a[Mc][L](a)});return Jka(a.xr,c)};function Dv(a){this.m=a;this.xr=new Bv(a);Ws(this.hY);this.hY=eu(this.xr,ws,W(this.Gaa,this,ws));Ws(this.gY);this.gY=eu(this.xr,Nr,W(this.Gaa,this,Nr))}X(Dv,Us);T=Dv[K];T.w=function(){this[Wb]();Ws(this.hY);Ws(this.gY);Ws(this.xr);Dv.e.w[L](this)};wa(T,function(){iu(this.hY);iu(this.gY);this.xr[Wb]()});lp(T,function(a,b){Yh(a)||(a=[a]);Yh(b)||(b=[b]);for(var c=0;c<a[J];c++)for(var d=0;d<b[J];d++)this.xr[Zb](a[c],b[d]);return this});Ep(T,function(a){this.xr[Nq](a)});T.ac=function(){return this.m}; T.Gaa=function(a,b){hu(this,a,b||null)};function Ev(a){nv[L](this,mha,a);a=a||{};bi(a)&&(a=lo(a));this.Vp=a.wrappers||null;this.kC=a.bindings||null;this.Du(a.dashboardType||Pga);Fv(this)}X(Ev,nv);T=Ev[K];T.PP=function(a,b){function c(a){return f[a]}Ws(this[Md]);a=ao(a);for(var d=new Dv(a),e=this.kC||[],f=this.Vp,g=e[J],k=0;k<g;k++){var l=Gi(e[k].controls,c),n=Gi(e[k].participants,c);d[Zb](l,n)}Cp(this,d);Ev.e.PP[L](this,a,b)};T.Vaa=function(a){a.wrappers=this.Vp?Gi(this.Vp,function(a){return a[Wp]()}):void 0;a.bindings=this.kC||void 0}; T.jta=function(a){this.Vp=a||null;Fv(this)};T.Jsa=function(){return this.Vp};T.Ssa=function(a){this.kC=a||null;Fv(this)};T.xsa=function(){return this.kC};T.Esa=nv[K].N2;T.Zsa=nv[K].An;T.Fsa=nv[K][Lp];function Fv(a){var b=a.Vp;if(null!==b&&!Yh(b)){var c=[];Dj(b,function(a,b){ei(a[Wp])||(a=Gv(a));a.An(b);c[C](a)},a);b=c}var d=a.kC;Hv(b)&&Hv(d)||(a.Vp=Gi(b,a.q_,a),a.kC=Gi(d,a.lqa,a))}T.q_=function(a){ei(a[Wp])||(a=Gv(a));a.jg(null);a.qi(null);return a}; T.lqa=function(a){var b=a.controls,c=a.participants;if(Hv(b)||Hv(c))throw m("invalid binding: "+a);b=Gi(b,this.Yda,this);c=Gi(c,this.Yda,this);return{controls:b,participants:c}};T.Yda=function(a){var b=a,c=/^{.*}$/;if(ai(a)||bi(a)&&c[bd](a))return ei(b[Wp])||(b=Gv(b)),this.Vp[C](b),this.Vp[J]-1;a=Rka(this);a=mi(b)?-1:Ci(a,b);if(-1==a)throw m("Invalid wrapper name: "+b);return a};function Rka(a){return Gi(a.Vp,function(a){return a[Lp]()})}function Hv(a){return Yh(a)?Si(a):!0};function Iv(a,b){Gv(a)[Nq](b)}function Gv(a){a=a||{};bi(a)&&(a=lo(a));return a.controlType?new rv(a):a.dashboardType?new Ev(a):new qv(a)};function Jv(a,b,c){var d=b.D(c),e=b.jf(c),f=b.cb(c),d=a.mg(d,f,e);a.paa(d,b.Sq(c))}function Kv(a){for(var b=0,c=0;c<a[J];c++)b+=a[c];return b}function Ska(a){return a[J]}function Tka(a){return Kv(a)/a[J]} function Lv(a,b,c){function d(a,b,c,d){return b[L](null,c[I](d,a))}var e=[],f=[];Y(b,function(a){if(di(a))e[C](a);else if(Vh(a)==$g){var b=a.column;Lha in a&&f[C]([b,{calc:gi(d,b,a.modifier),type:a[H],label:a[Rc],id:a.id}]);e[C](b)}});if(!Si(f)){for(var g=new ku(a),k=g.N9(),l=a.M(),n=0;n<l;n++)Y(f,function(a){k[a[0]]=a[1]});g.yq(k);a=g}var q=new Ko,s=[];Y(e,function(c,d){var e=a.D(c),f=b[d][Rc]||a.cb(c),g=null!=b[d].id?b[d].id:a.jf(c);q.mg(e,f,g);s[C](e)});c=c||[];Y(c,function(b){var c=b.column,d= b[Rc]||a.cb(c),c=null!=b.id?b.id:a.jf(c);q.mg(b[H],d,c)});var u=[];Y(e,function(a){u[C]({column:a})});for(var w=a.Co(u),z=[],B=0;B<c[J];B++)z[C]([]);for(B=0;B<w[J];B++){Y(c,function(b,c){z[c][C](a[I](w[B],b.column))});g=!1;if(B<w[J]-1)for(g=!0,l=0;l<e[J];l++){var n=a[I](w[B],e[l]),F=a[I](w[B+1],e[l]);if(0!=Mo(s[l],n,F)){g=!1;break}}if(!g){var M=q.lq();Y(e,function(b,c){q.wa(M,c,a[I](w[B],b))});var N=b[J];Y(c,function(a,b){var c=a.aggregation[L](null,z[b]);q.wa(M,N+b,c)});for(g=0;g<c[J];g++)z[g]=[]}}return q} ;V("google.visualization.drawChart",Iv,void 0);V("google.visualization.drawFromUrl",function(a,b){var c=new Ct(b||fa[tc][Ic]),d=Lt(c,Wr),e;null!=d?e=d:(e={},Y(c.Oi.hk(),function(a){var b=Lt(c,a);try{null!=b&&(b=lo(b))}catch(d){}e[a]=b}),rp(e,Qj(e)));Iv(e,a)},void 0); V("google.visualization.createUrl",function(a,b){bi(a)&&(a=lo(a));var c=[],d,e;for(e in a)if(e==Pha){var f=a[e],g;for(g in f)d=f[g],bi(d)||(d=io(d)),c[C](g+af+aa(String(d)))}else d=a[e],bi(d)||(d=ei(d[Wp])?d[Wp]():io(d)),c[C](e+af+aa(String(d)));d=Wn()+Ega;d=d[vb](/^https?:/,O);c=(b||d)+cf+c[ie](xe);c=c[vb](/'/g,zga);return c=c[vb](/"/g,yga)},void 0); V("google.visualization.createSnippet",function(a){var b=Wn()+Fga,b=b[vb](/^https?:/,O),b=Lga+b+xga;a=Gv(a)[Wp]();a=a[vb](/</g,Be);a=a[vb](/>/g,Ae);return b=b+a+pga},void 0);V("google.visualization.createWrapper",Gv,void 0);V("google.visualization.ChartWrapper",qv,void 0);wa(qv[K],qv[K][Wb]);Ep(qv[K],qv[K][Nq]);qv[K].clone=qv[K].o;Fa(qv[K],qv[K][Wp]);qv[K].getSnapshot=qv[K].$Q;qv[K].getDataSourceUrl=qv[K].CS;qv[K].getDataTable=qv[K].Pa;qv[K].getChartName=qv[K].nW;qv[K].getChartType=qv[K].Ya; qv[K].getChart=qv[K].Sd;qv[K].getContainerId=qv[K].zS;qv[K].getPackages=qv[K].K2;qv[K].getQuery=qv[K].On;qv[K].getRefreshInterval=qv[K].DS;qv[K].getView=qv[K].FS;pp(qv[K],qv[K][cq]);qv[K].getOptions=qv[K].Vc;sp(qv[K],qv[K][hq]);qv[K].getCustomRequestHandler=qv[K].Dsa;qv[K].isDefaultVisualization=qv[K].Waa;qv[K].pushView=qv[K].Psa;qv[K].sendQuery=qv[K].KQ;qv[K].setDataSourceUrl=qv[K].qi;qv[K].setDataTable=qv[K].jg;qv[K].setChart=qv[K].xL;qv[K].setChartName=qv[K].oW;qv[K].setChartType=qv[K].Gd; qv[K].setContainerId=qv[K].HS;qv[K].setIsDefaultVisualization=qv[K].R3;qv[K].setPackages=qv[K].gI;qv[K].setQuery=qv[K].fk;qv[K].setRefreshInterval=qv[K].Vm;qv[K].setView=qv[K].PB;qv[K].setOption=qv[K].K;op(qv[K],qv[K][$p]);qv[K].setState=qv[K].vc;qv[K].setCustomRequestHandler=qv[K].Xsa;V("google.visualization.ControlWrapper",rv,void 0);wa(rv[K],rv[K][Wb]);Ep(rv[K],rv[K][Nq]);Fa(rv[K],rv[K][Wp]);rv[K].getSnapshot=rv[K].$Q;rv[K].getDataSourceUrl=rv[K].CS;rv[K].getDataTable=rv[K].Pa; rv[K].getControlName=rv[K].Bsa;rv[K].getControlType=rv[K].Csa;rv[K].getControl=rv[K].eR;rv[K].getContainerId=rv[K].zS;rv[K].getPackages=rv[K].K2;rv[K].getQuery=rv[K].On;rv[K].getRefreshInterval=rv[K].DS;rv[K].getView=rv[K].FS;pp(rv[K],rv[K][cq]);rv[K].getOptions=rv[K].Vc;sp(rv[K],rv[K][hq]);rv[K].sendQuery=rv[K].KQ;rv[K].setDataSourceUrl=rv[K].qi;rv[K].setDataTable=rv[K].jg;rv[K].setControlName=rv[K].Usa;rv[K].setControlType=rv[K].Vsa;rv[K].setContainerId=rv[K].HS;rv[K].setPackages=rv[K].gI; rv[K].setQuery=rv[K].fk;rv[K].setRefreshInterval=rv[K].Vm;rv[K].setView=rv[K].PB;rv[K].setOption=rv[K].K;op(rv[K],rv[K][$p]);rv[K].setState=rv[K].vc;V("google.visualization.DashboardWrapper",Ev,void 0);wa(Ev[K],Ev[K][Wb]);Ep(Ev[K],Ev[K][Nq]);Fa(Ev[K],Ev[K][Wp]);Ev[K].getBindings=Ev[K].xsa;Ev[K].getDataSourceUrl=Ev[K].CS;Ev[K].getDataTable=Ev[K].Pa;Ev[K].getDashboard=Ev[K].Esa;Ev[K].getDashboardName=Ev[K].Fsa;Ev[K].getContainerId=Ev[K].zS;Ev[K].getPackages=Ev[K].K2;Ev[K].getQuery=Ev[K].On; Ev[K].getRefreshInterval=Ev[K].DS;Ev[K].getView=Ev[K].FS;Ev[K].getWrappers=Ev[K].Jsa;Ev[K].setBindings=Ev[K].Ssa;Ev[K].setDataSourceUrl=Ev[K].qi;Ev[K].setDataTable=Ev[K].jg;Ev[K].setDashboardName=Ev[K].Zsa;Ev[K].setContainerId=Ev[K].HS;Ev[K].setPackages=Ev[K].gI;Ev[K].setQuery=Ev[K].fk;Ev[K].setRefreshInterval=Ev[K].Vm;Ev[K].setView=Ev[K].PB;Ev[K].getSnapshot=Ev[K].$Q;Ev[K].setWrappers=Ev[K].jta;V("google.visualization.data.avg",Tka,void 0);V("google.visualization.data.count",Ska,void 0);V("google.visualization.data.group",Lv,void 0); V("google.visualization.data.join",function(a,b,c,d,e,f){var g=c==Qg||c==Ag,k=c==zs||c==Ag,l=new Ko,n=[];Y(d,function(c){var d=a.D(c[0]),e=b.D(c[1]);if(d!=e)throw m("Key types do not match:"+d+Ke+e);Jv(l,a,c[0]);n[C](d)});var q=[],s=[];Y(d,function(a){q[C]({column:a[0]});s[C]({column:a[1]})});var u=a.Co(q),w=b.Co(s);Y(e,function(b){Jv(l,a,b)});Y(f,function(a){Jv(l,b,a)});for(var z=!1,B=0,F=0,M=0;B<u[J]||F<w[J];){var N=0,P=[];if(F>=w[J])if(g)P[0]=u[B],N=-1;else break;else if(B>=u[J])if(k)P[1]=w[F], N=1;else break;else{P[0]=u[B];P[1]=w[F];for(var ba=0;ba<d[J];ba++){var N=a[I](P[0],d[ba][0]),U=b[I](P[1],d[ba][1]),N=Mo(n[ba],N,U);if(0!=N)break}}if(z&&0!=N)z=!1,F++;else{if(-1==N&&g||1==N&&k||0==N){l.lq();var qa,ya;-1==N&&g||0==N&&c!=zs?(qa=a,ya=0):(qa=b,ya=1);Y(d,function(a,b){c==Ag?l.wa(M,b,qa[I](P[ya],a[ya])):l.al(M,b,qa[I](P[ya],a[ya]),qa.Aa(P[ya],a[ya]),qa.sm(P[ya],a[ya]))});if(-1==N&&g||0==N){var Ha=d[J];Y(e,function(b,c){l.al(M,c+Ha,a[I](P[0],b),a.Aa(P[0],b),a.sm(P[0],b))})}if(1==N&&k||0== N)Ha=e[J]+d[J],Y(f,function(a,c){l.al(M,c+Ha,b[I](P[1],a),b.Aa(P[1],a),b.sm(P[1],a))});M++}1==N?F++:B++;0==N&&(z=!0)}}return l},void 0);V("google.visualization.data.max",function(a){if(0==a[J])return null;for(var b=a[0],c=1;c<a[J];c++){var d=a[c];null!=d&&d>b&&(b=d)}return b},void 0);V("google.visualization.data.min",function(a){if(0==a[J])return null;for(var b=a[0],c=1;c<a[J];c++){var d=a[c];null!=d&&d<b&&(b=d)}return b},void 0);V("google.visualization.data.month",function(a){return a[Dd]()+1},void 0); V("google.visualization.data.sum",Kv,void 0);V("__gvizguard__",!0,void 0);V(xha,St,void 0);St[K].makeRequest=St[K].makeRequest;St[K].setRefreshInterval=St[K].Vm;St[K].setQuery=St[K].fk;hp(St[K],St[K][Kp]);St[K].setRefreshable=St[K].eta;St[K].setTimeout=St[K][Yp];St[K].setHandlerType=St[K].ata;St[K].setHandlerParameter=St[K].Fda;St.setResponse=Wt;Bp(St[K],St[K][Iq]);V("google.visualization.CustomQuery",ru,void 0);hp(ru[K],ru[K][Kp]);V("google.visualization.QueryResponse",Qs,void 0);Qs[K].getDataTable=Qs[K].Pa;Qs[K].isError=Qs[K].Ni; Qs[K].hasWarning=Qs[K].f1;Qs[K].getReasons=Qs[K].mca;Qs[K].getMessage=Qs[K].fI;Qs[K].getDetailedMessage=Qs[K].I0;V("google.visualization.DataTable",Ko,void 0);Ko[K].addColumn=Ko[K].mg;Ko[K].addRow=Ko[K].lq;Ko[K].addRows=Ko[K].Cz;Ko[K].clone=Ko[K].o;Ko[K].getColumnId=Ko[K].jf;xa(Ko[K],Ko[K][Qp]);Ko[K].getColumnLabel=Ko[K].cb;Ko[K].getColumnPattern=Ko[K].ju;Ko[K].getColumnProperty=Ko[K].Li;Ko[K].getColumnProperties=Ko[K].Sq;Ko[K].getColumnRange=Ko[K].qp;Ko[K].getColumnRole=Ko[K].Ss; Ko[K].getColumnType=Ko[K].D;Ko[K].getDistinctValues=Ko[K].QR;Ko[K].getFilteredRows=Ko[K].WJ;Ko[K].getFormattedValue=Ko[K].Aa;Ko[K].getNumberOfColumns=Ko[K].H;Ko[K].getNumberOfRows=Ko[K].M;Ko[K].getProperties=Ko[K].sm;Ko[K].getProperty=Ko[K].Ao;Ko[K].getRowProperty=Ko[K].Yq;Ko[K].getRowProperties=Ko[K].mJ;Ko[K].getSortedRows=Ko[K].Co;Ko[K].getTableProperty=Ko[K].uR;Ko[K].getTableProperties=Ko[K].Mx;Ko[K].getUnderlyingTableColumnIndex=Ko[K].sR;Ko[K].getUnderlyingTableRowIndex=Ko[K].pR;fb(Ko[K],Ko[K][I]); Ko[K].insertColumn=Ko[K].jda;Ko[K].insertRows=Ko[K].sY;Ko[K].removeColumn=Ko[K].a2;Ko[K].removeColumns=Ko[K].gea;Ko[K].removeRow=Ko[K].mB;Ko[K].removeRows=Ko[K].hea;Ko[K].setCell=Ko[K].al;Ko[K].setColumnLabel=Ko[K].Tsa;Ko[K].setColumnProperties=Ko[K].paa;Ko[K].setColumnProperty=Ko[K].Sv;Ko[K].setFormattedValue=Ko[K].uH;Ko[K].setProperties=Ko[K].kv;Ko[K].setProperty=Ko[K][Dc];Ko[K].setRowProperties=Ko[K].fta;Ko[K].setRowProperty=Ko[K].s4;Ko[K].setTableProperties=Ko[K].gta;Ko[K].setTableProperty=Ko[K].hta; Ko[K].setValue=Ko[K].wa;nb(Ko[K],Ko[K][Zd]);Fa(Ko[K],Ko[K][Wp]);V("google.visualization.DataView",ku,void 0);ku.fromJSON=lu;ku[K].getColumnId=ku[K].jf;xa(ku[K],ku[K][Qp]);ku[K].getColumnLabel=ku[K].cb;ku[K].getColumnPattern=ku[K].ju;ku[K].getColumnProperty=ku[K].Li;ku[K].getColumnProperty=ku[K].Li;ku[K].getColumnProperties=ku[K].Sq;ku[K].getColumnRange=ku[K].qp;ku[K].getColumnRole=ku[K].Ss;ku[K].getColumnType=ku[K].D;ku[K].getDistinctValues=ku[K].QR;ku[K].getFilteredRows=ku[K].WJ; ku[K].getFormattedValue=ku[K].Aa;ku[K].getNumberOfColumns=ku[K].H;ku[K].getNumberOfRows=ku[K].M;ku[K].getProperties=ku[K].sm;ku[K].getProperty=ku[K].Ao;ku[K].getRowProperty=ku[K].Yq;ku[K].getRowProperties=ku[K].mJ;ku[K].getSortedRows=ku[K].Co;ku[K].getTableColumnIndex=ku[K].jF;ku[K].getUnderlyingTableColumnIndex=ku[K].sR;ku[K].getTableRowIndex=ku[K].cn;ku[K].getUnderlyingTableRowIndex=ku[K].pR;ku[K].getTableProperty=ku[K].uR;ku[K].getTableProperties=ku[K].Mx;fb(ku[K],ku[K][I]); ku[K].getViewColumnIndex=ku[K].Daa;ku[K].getViewColumns=ku[K].N9;ku[K].getViewRowIndex=ku[K].Isa;ku[K].getViewRows=ku[K].oca;ku[K].hideColumns=ku[K].Ksa;ku[K].hideRows=ku[K].Lsa;ku[K].setColumns=ku[K].yq;ku[K].setRows=ku[K].qn;ku[K].toDataTable=ku[K].ww;Fa(ku[K],ku[K][Wp]);V("google.visualization.errors",Ss,void 0);Ss.addError=Ss.td;Ss.removeAll=Ss.oc;Ss.removeError=Ss.Qsa;Ss.addErrorFromQueryResponse=Ss.TB;Ss.getContainer=Ss.ac;Ss.createProtectedCallback=Ss.UP;V(yha,eu,void 0);V(zha,fu,void 0); V(Cha,hu,void 0);V(Bha,iu,void 0);V(Aha,ju,void 0);V("google.visualization.QueryWrapper",qu,void 0);op(qu[K],qu[K][$p]);Ep(qu[K],qu[K][Nq]);qu[K].setCustomErrorHandler=qu[K].Wsa;qu[K].sendAndDraw=qu[K].xC;qu[K].setCustomPostResponseHandler=qu[K].xR;qu[K].setCustomResponseHandler=qu[K].yR;Bp(qu[K],qu[K][Iq]);V("google.visualization.arrayToDataTable",Xfa,void 0);V("google.visualization.datautils.compareValues",Mo,void 0); V("google.visualization.dataTableToCsv",function(a){for(var b=O,c=0;c<a.M();c++){for(var d=0;d<a.H();d++){0<d&&(b+=Je);var e=a.Aa(c,d),e=e[vb](/"/g,wga),f=-1!=e[ld](Je),g=-1!=e[ld](me),k=-1!=e[ld](oe);if(f||g||k)e=oe+e+oe;b+=e}b+=me}return b},void 0);V("google.visualization.GadgetHelper",au,void 0);au[K].createQueryFromPrefs=au[K].rsa;au[K].validateResponse=au[K].lta;;window.google&&window.google.loader&&window.google.loader.eval&&window.google.loader.eval.visualization&&(window.google.loader.eval.visualization=function(){eval(arguments[0])}); var Mv=unescape,Nv=escape,Ov=setTimeout,Pv=navigator;function Qv(a,b){return a.direction=b}function Rv(a,b){return a.filled=b}function Sv(a,b){return a.weight=b}function Tv(a,b){return a.collapse=b}function Uv(a,b){return a.selected=b}function Vv(a,b){return a.stroked=b}function Wv(a,b){return a.fillcolor=b}function Xv(a,b){return a.select=b}function Yv(a,b){return a.setRadius=b}function Zv(a,b){return a.setSelection=b}function $v(a,b){return a.depth=b}function aw(a,b){return a.refresh=b} function bw(a,b){return a.items=b}function cw(a,b){return a.whiteSpace=b}function dw(a,b){return a.strokeweight=b}function ew(a,b){return a.fillStyle=b}function fw(a,b){return a.setVisible=b}function gw(a,b){return a.marginWidth=b}function hw(a,b){return a.cursor=b}function iw(a,b){return a.size=b}function jw(a,b){return a.setVisibleChartRange=b}function kw(a,b){return a.coordorigin=b}function lw(a,b){return a.style=b}function mw(a,b){return a.close=b}function nw(a,b){return a.ticks=b} function ow(a,b){return a.parent=b}function pw(a,b){return a.getPosition=b}function qw(a,b){return a.isEnabled=b}function rw(a,b){return a.range=b}function sw(a,b){return a.marginHeight=b}function tw(a,b){return a.coordinates=b}function uw(a,b){return a.action=b}function vw(a,b){return a.reset=b}function ww(a,b){return a.startTime=b}function xw(a,b){return a.node=b}function yw(a,b){return a.root=b}function zw(a,b){return a.lineWidth=b}function Aw(a,b){return a.frameBorder=b} function Bw(a,b){return a.text=b}function Cw(a,b){return a.annotations=b}function Dw(a,b){return a.createCaption=b}function Ew(a,b){return a.fontFamily=b}function Fw(a,b){return a.value=b}function Gw(a,b){return a.move=b}function Hw(a,b){return a.strokeStyle=b}function Iw(a,b){return a.strokecolor=b}function Jw(a,b){return a.radius=b}function Kw(a,b){return a.getHeight=b}function Lw(a,b){return a.scrolling=b}function Mw(a,b){return a.orientation=b}function Nw(a,b){return a.setContent=b} function Ow(a,b){return a.getContent=b}function Pw(a,b){return a.visible=b}function Qw(a,b){return a.fontWeight=b}function Rw(a,b){return a.scrollTop=b}function Sw(a,b){return a.getColors=b}function Tw(a,b){return a.getSelection=b}function Uw(a,b){return a.disabled=b}function Vw(a,b){return a.textAlign=b}function Ww(a,b){return a.background=b}function Xw(a,b){return a.fontStyle=b}function Yw(a,b){return a.getId=b}function Zw(a,b){return a.anchor=b}function $w(a,b){return a.coords=b} function ax(a,b){return a.coordsize=b}function bx(a,b){return a.setPosition=b}function cx(a,b){return a.element=b}function dx(a,b){return a.update=b}function ex(a,b){return a.transform=b} var gx="origin",ix="order",jx="direction",kx="shape",lx="fillColor",mx="getParent",nx="center",ox="classList",px="selection",qx="inRange",rx="reverse",sx="extend",tx="layout",ux="selected",vx="collapsed",wx="insert",xx="interval",yx="geometry",zx="setEnd",Ax="strokeColor",Bx="registerElement",Cx="write",Dx="definition",Ex="fillText",Fx="focus",Gx="select",Hx="values",Vx="padding",Wx="elements",Xx="moveTo",Yx="setSelection",Zx="depth",$x="getBounds",ay="datum",by="offset",cy="items",dy="contentWindow", ey="duplicate",fy="time",gy="caption",hy="setVisible",iy="cursor",jy="html",ky="views",ly="size",my="MapTypeId",ny="createElementNS",oy="setVisibleChartRange",py="handle",qy="save",ry="nodes",sy="rotate",ty="moveToElementText",uy="addListener",vy="close",wy="ticks",xy="parent",yy="dataType",zy="getPosition",Ay="isEnabled",By="range",Cy="multiple",Dy="fireEvent",Ey="coordinates",Fy="scale",Gy="restore",Hy="action",Iy="startTime",Jy="fillRect",Ky="attributes",Ly="node",My="compact",Ny="lineWidth",Oy= "closePath",Py="isCollapsed",Qy="margin",Ry="lineTo",Sy="icon",Ty="replaceChild",Uy="annotations",Vy="getCenter",Wy="createCaption",Xy="blur",Yy="move",Zy="backgroundColor",$y="domain",az="updateOptions",bz="radius",cz="equals",dz="beginPath",ez="getHeight",fz="play",gz="path",hz="detach",iz="getContext",jz="translate",kz="LN10",lz="orientation",mz="setContent",nz="getContent",oz="visible",pz="setActive",qz="strokeRect",rz="frames",sz="setStart",tz="getColors",uz="title",vz="labels",wz="getSelection", xz="duration",yz="scope",zz="rect",Az="then",Bz="alpha",Cz="Circle",Dz="background",Ez="entries",Fz="getId",Gz="anchor",Hz="moveEnd",Iz="coords",Jz="compareEndPoints",Kz="addColorStop",Lz="setPosition",Mz="element",Nz="contentDocument",Oz="axis",Pz="update",Qz="areas",Rz="append",Sz="transform",Tz="event",Uka="\n M/d",Vka="\n a",Wka="\n yyyy",Xka="\x0B",Yka=" (",Zka=" (count)",$ka=" * ",ala=" + ",Uz=" - ",bla=" - Flash Player Installation",cla=" / ",dla=" 0 ",ela=" = ",fla=" [+]",gla=" _loaded = true;", hla=" already defined.",ila=" does not have a domain column.",Vz=' id="',jla=" loaded, but verification object ",kla=' onload="CHART_loaded()"',Wz=" to ",lla=" was not defined.",mla=' xmlns:svg="http://www.w3.org/2000/svg"',nla=' xmlns:xlink="http://www.w3.org/1999/xlink">',Xz='" ',ola='" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="',pla='" height="',qla='" name="',rla='" src="http://www.google.com/ig/ifr?url=',sla='" style="',Yz='" value="',tla='" width="',Zz='">',$z='"></div>',ula= "#.###",aA="#000",vla="#000020",bA="#00f",cA="#0f0",dA="#109618",eA="#222222",fA="#333333",gA="#3399CC",hA="#444444",iA="#666",jA="#666666",wla="#7993ad",xla="#7f9a6b",yla="#8080ff",kA="#994499",lA="#999",mA="#999999",zla="#9a9a9a",Ala="#9bbdde",nA="#CCCCCC",oA="#DC3912",Bla="#DDD",pA="#EFE6DC",qA="#FF9900",rA="#FFFFFF",Cla="#a2c488",Dla="#a992ad",Ela="#ad7d79",Fla="#aea971",sA="#b7b7b7",Gla="#c991ff",tA="#ccc",uA="#cccccc",Hla="#cdc785",Ila="#ce9839",Jla="#d2feb0",Kla="#d6b9db",vA="#dc3912",Lla= "#dea19b",Mla="#default#VML",wA="#e0e0e0",xA="#eee",Nla="#eeee5b",Ola="#eeeeac",Pla="#eeeeee",yA="#f00",Qla="#ff9900",Rla="#ffbc46",Sla="#ffd1c9",Tla="#fff0db",Ula="#visualization",Vla="$version",Wla="%s",Xla="%s's administration (under dispute)",Yla="%s://www.gstatic.com/charts/%s/%s/",zA="&nbsp;",Zla="&up_",$la="&up__table_query_url=",ama="').send(\n function(response) {\n new ",bma="']});\n\n function drawVisualization() {\n new google.visualization.Query('",cma='(\n document.getElementById(\'visualization\')).\n draw(response.getDataTable(), null);\n });\n }\n\n google.setOnLoadCallback(drawVisualization);\n \x3c/script>\n </head>\n <body>\n <div id="visualization" style="width: 500px; height: 500px;"></div>\n </body>\n</html>', dma=") translate(",ema=",0,",fma="--",gma="-10000px",hma="-1000px",ima="-active",jma="-bg",kma="-buttons",AA="-caption",lma="-checkbox",mma="-checked",nma="-collapse-left",oma="-collapse-right",BA="-content",CA="-default",DA="-disabled",EA="-dropdown",pma="-focused",qma="-highlight",rma="-horizontal",sma="-hover",tma="-inner-box",uma="-mag",vma="-open",wma="-outer-box",xma="-rtl",yma="-selected",zma="-title",Ama="-title-close",Bma="-title-draggable",Cma="-title-text",Dma="-unchecked",Ema="-undetermined", Fma="-vertical",Gma="-webkit-user-select:none;",Hma="../../shapes/rect-util",FA="./abstract_shape",GA="./circle",HA="./ellipse",Ima="./group",IA="./line",JA="./path",Jma="./path-util",KA="./rect",Kma="./shapes",LA="./svg-util",MA="./text",Lma=".annotations.",Mma=".color",Nma=".enableInteractivity",Oma=".gif",Pma=".hole",Qma=".js",Rma=".lbl",Sma=".offset",Tma=".style",Uma=".textStyle",Vma=".type",Wma=".visibleInLegend",Xma="//chart.googleapis.com/chart",Yma="/>",Zma="/core/patterns/",NA="/core/tooltip.css", OA="0 0",$ma="0 0 4 4",PA="0%",ana="1.8",bna="1/",QA="100%",cna="12pt Times New Roman",RA="15px",SA="1e12",TA="1px",dna="1px solid infotext",UA="2",ena="200px",VA="2d",YA="4",fna="420+",gna="49.99%",hna="5.5",ina="50%",jna="525",kna="531",lna="532.0",mna="533.17.9",ZA="6",$A="636363",aB="7",nna="808080",ona="9.0",pna="90%",qna="9e9e9e",bB=": ",rna=":m",cB=":mm",sna=":ss",tna=":|",una=";color: #333333;margin:0;font-style:",vna=";font-weight:",wna=";height:",xna=";overflow-y:",yna=";stop-opacity:", zna=";text-decoration:",Ana=";width:",Bna="< ",dB="</body>",eB="</div>",fB="</head>",gB="</html>",Cna="</object>",Dna="\x3c/script>",hB="</span>",Ena='<?xml version="1.0"?>',Fna='<body marginwidth="0" marginheight="0"',Gna="<default>",Hna='<div id="chartArea"></div>',Ina='<div id="renderers"></div>',Jna='<embed type="application/x-shockwave-flash" src="',iB="<head>",Kna='<html xmlns:v="urn:schemas-microsoft-com:vml">',Lna='<html xmlns="http://www.w3.org/1999/xhtml"',Mna='<html>\n <head>\n <title>Google Visualization API</title>\n <script type="text/javascript" src="http://www.google.com/jsapi">\x3c/script>\n <script type="text/javascript">\n google.load(\'visualization\', \'1\', {packages: [\'', Nna='<iframe style="',Ona='<object id="',Pna='<param name="',Qna='<param name="flashvars" value="',Rna='<param name="movie" value="',Sna='<script type="text/javascript">',Tna='<span style="color:',jB="<style> v\\:* { behavior:url(#default#VML);}</style>",kB='="',Una="A ",Vna="A chart.",lB="AT",Wna="ActiveX",Xna="Add to iGoogle",Yna="All data columns of the same series must be of the same data type",Zna="All domains must be of the same data type",mB="Area",nB="Arial",$na="B",oB="BACKGROUND",aoa="BODY", pB="Bars",boa="Billion",qB="C",rB="CELL",coa="COLUMN_INDEX",sB="COM",tB="COUNTRIES",doa="Cancel",eoa="Chart options",foa="Circle",goa="Click",hoa="Click to expand annotations",ioa="Close",IB="Column ",JB="Columns",KB="Component already rendered",joa="Copy-Paste this code to an HTML page",koa="Current: ",loa="DOMMouseScroll",moa="Data has no columns.",noa="Data must contain at least two columns.",LB="Data table is not defined",ooa="DblClick",poa="Drawing_Frame_",qoa="Each values column may be followed by one or two annotation columns. column number ", roa="Ellipse",MB="End",soa="EndToEnd",toa="Error while loading script ",uoa="Export data as CSV",voa="Export data as HTML",woa='Failed geocoding "',xoa="First column must be a domain column",yoa="First column must contain date, or date and time.",zoa="GViz is Great.",Aoa="Geocoding failed for all data points",Boa="Google Visualization",Coa="Google_Visualization",Doa="Group",Eoa="HEAD",NB="HH:mm",Foa="HH:mm MMMM dd, yyyy",Goa="HH:mm:ss",Hoa="HTML",Ioa="HoverIn",Joa="HoverOut",Koa="Items",Loa="Javascript code", Moa="Jsloader error (code #",Noa="L ",OB="LI",Ooa="Last domain does not have enough data columns (missing ",PB="Line",QB="Lines",Poa="M ",Qoa="METROS",RB="MMM",SB="MMMM dd, yyyy",Roa="Million",Soa="MouseDown",Toa="MouseUp",TB="No data",Uoa="OK",Voa="Only one data column with role 'tooltip' per series is allowed",Woa="Other",Xoa="PROVINCES",Yoa="Path",UB="Pie",Zoa="PlugIn",$oa="Previous data",apa="Previous: ",bpa="Promise cannot resolve to itself",cpa="Publish to web page",dpa="Quadrillion",epa="REGIONS", VB="ROW",WB="ROW_INDEX",fpa="Rect",gpa="Requested map does not exist.",hpa="RightClick",XB="Roboto2",YB="Roboto2-light",ipa="SU",jpa="SUBREGIONS",ZB="SUBTYPE",$B="Scatter",kpa="Script ",lpa="Scroll",mpa="Shockwave Flash",npa="ShockwaveFlash.ShockwaveFlash",opa="ShockwaveFlash.ShockwaveFlash.",ppa="ShockwaveFlash.ShockwaveFlash.6",qpa="ShockwaveFlash.ShockwaveFlash.7",rpa="SourceAlpha",spa="SourceGraphic",aC="Start",tpa="Start and end points must be 2D",upa="StartToEnd",vpa="StartToStart",bC="TD", cC="Text",wpa="The columns type does not match the supported data format. See documentation for supported formats.",xpa="The visualization is not ready yet.",ypa="Timeout reached for loading script ",dC="To",zpa="Trendline ",Apa="Trillion",Bpa="UK",Cpa="UL",eC="US",fC="US-",Dpa="UTF-8",Epa="Unable to set parent component",Fpa="Unexpected domain column (column #",Gpa="Unknown granularity.",gC="Value",Hpa="Verification object ",Ipa="WA",Jpa="Windows CE",hC="X",Kpa="Y",Lpa="Your browser does not support charts", iC="_",Mpa="_ABSTRACT_RENDERER_ID_",Npa="__",Opa="__DISPUTED__",Ppa="__DISPUTED__All",Qpa="__internal_",Rpa="_callbacks_.",jC="_focusedLabels",kC="_selectedLabels",Spa="_trendline",Tpa="charts-button",Upa="charts-checkbox",Vpa="charts-container",Wpa="charts-control",Xpa="charts-custom-button",Ypa="charts-flat-button",lC="charts-inline-block",mC="charts-inline-block ",Zpa="charts-link-button", nC="charts-menu",$pa="charts-menu-button",aqa="charts-menuheader",bqa="charts-menuitem",cqa="charts-menuitem-accel",dqa="charts-menuitem-mnemonic-separator",oC="charts-menuseparator",eqa="charts-modalpopup",pC="charts-option",fqa="charts-option-selected",gqa="charts-select",hqa="charts-serverchart-image",iqa="charts-slider-disabled", jqa="charts-slider-dragging",kqa="charts-slider-thumb-dragging",qC="action",lqa="actionsMenu.disabledTextStyle",mqa="actionsMenu.textStyle",nqa="actionsMenuEntry",oqa="actionsMenuEntryClick",pqa="actionsMenuEntryHoverIn",qqa="actionsMenuEntryHoverOut",rqa="activate",rC="activedescendant",sqa="additions text",tqa="ae",sC="afterhide",tC="aftershow",uqa="aggregationTarget",uC="allValuesSuffix",vqa="allowContainerBoundaryTextCufoff",vC="always",wqa="alwaysOutside",xqa="angle", yqa="animate",wC="animation.duration",zqa="animation.easing",Aqa="animation.maxFramesPerSecond",Bqa="animationEasing",Cqa="animationfinish",Dqa="animationframefinish",xC="annotation",Eqa="annotation.",Fqa="annotationClick",Gqa="annotationHoverIn",Hqa="annotationHoverOut",Iqa="annotations.alwaysOutside",Jqa="annotations.boxStyle",Kqa="annotations.datum.alwaysOutside",Lqa="annotations.datum.boxStyle",Mqa="annotations.datum.highContrast",Nqa="annotations.datum.stemColor",Oqa="annotations.datum.style", Pqa="annotations.datum.textStyle",Qqa="annotations.domain.boxStyle",Rqa="annotations.domain.stemColor",Sqa="annotations.domain.style",Tqa="annotations.domain.textStyle",Uqa="annotations.highContrast",Vqa="annotations.stemColor",Wqa="annotations.style",yC="annotations.textStyle",zC="annotationtext",AC="arc",BC="area",Xqa="area.",CC="areaOpacity",Yqa="aria-activedescendant",Zqa="aria-hidden",DC="aria-label",EC="arial",$qa="attachToEnd",ara="attachToStart",FC="axis",bra="axisBackgroundColor",cra="axisLabelFormatter", dra="axisTitlesPosition",GC="background",HC="backgroundColor",IC="backgroundColor.fill",JC="bar",era="bar.",fra="barWidth",KC="bars",LC="baseline",gra="baselineColor",MC="beforedrag",NC="beforehide",OC="beforeshow",hra="begin",ira="bfbfbf",jra="bg",PC="bhg",QC="bhs",RC="black",SC="blue",TC="blur",UC="bold",kra="bold ",lra="border",VC="border-box",mra="border:0;vertical-align:bottom;",WC="bottom",XC="bottom-space",YC="bottom-vert",ZC="bottom_left",nra="bound",$C="bounds",aD="box",ora="boxStyle",pra= "boxWidth",qra="boxes",bD="br",cD="bubble",rra="bubble.opacity",sra="bubble.stroke",tra="bubble.textStyle",dD="bubbles",eD="button",fD="bvg",gD="bvs",ura="callImmediate",vra="callback",hD="cancel",iD="candlestick",wra="candlestick.fallingColor",xra="candlestick.hollowIsRising",yra="candlestick.risingColor",jD="candlesticks",kD="canvas",lD="category",zra="categoryClick",Ara="categoryHoverIn",Bra="categoryHoverOut",mD="categorypoint",nD="categorysensitivityarea",Cra="cccccc",oD="cell",pD="center",Dra= "centerSelectionAroundData",qD="change",rD="character",sD="chartArea",Era="chartArea.backgroundColor",tD="chartArea.height",uD="chartArea.left",vD="chartArea.top",wD="chartArea.width",Fra="chartClick",Gra="chartDblClick",Hra="chartDrag",Ira="chartDragEnd",Jra="chartDragStart",Kra="chartHoverIn",Lra="chartHoverOut",Mra="chartMouseDown",Nra="chartMouseMove",Ora="chartMouseUp",Pra="chartOptions",Qra="chartPinch",Rra="chartPinchEnd",Sra="chartPinchStart",Tra="chartRightClick",Ura="chartScroll",xD="chartType", yD="chartarea",Vra="charteditor",zD="chco",Wra="chd",Xra="chdl",Yra="check",AD="checkbox",BD="checked",Zra="chf",$ra="chl",asa="chld",CD="chs",DD="cht",bsa="chtt",csa="chxl",dsa="chxt",ED="circle",FD="classdef",esa="clear",fsa="clip-path",gsa="clipPath",GD="clipped",hsa="clone",HD="close",ID="closedPhase",JD="col-resize",isa="collapse",KD="color",jsa="color2",LD="colorAxis.colors",ksa="colorAxis.legend.numberFormat",lsa="colorAxis.legend.position",msa="colorAxis.legend.textStyle",nsa="colorAxis.maxValue", osa="colorAxis.minValue",psa="colorAxis.values",qsa="colorAxis.values must not contain nulls",MD="colorBar",rsa="colorbar",ND="colors",ssa="columns",tsa="connectSteps",OD="contextmenu",usa="continents",vsa="corners.bottomleft.rx",wsa="corners.bottomleft.ry",xsa="corners.bottomright.rx",ysa="corners.bottomright.ry",zsa="corners.rx",Asa="corners.ry",Bsa="corners.topleft.rx",Csa="corners.topleft.ry",Dsa="corners.topright.rx",Esa="corners.topright.ry",PD="countries",Fsa="countries_en",Gsa="country",Hsa= "crosshair.color",Isa="crosshair.focused.color",Jsa="crosshair.focused.opacity",Ksa="crosshair.focused.orientation",Lsa="crosshair.opacity",Msa="crosshair.orientation",Nsa="crosshair.selected.color",Osa="crosshair.selected.opacity",Psa="crosshair.selected.orientation",Qsa="crosshair.trigger",Rsa="csv",Ssa="cursor:default;-webkit-user-select:none;",QD="curve",RD="curveType",Tsa="cut",SD="cx",TD="cy",UD="dash",Usa="dataOpacity",Vsa="datalessRegionColor",VD="dateFormat",WD="datum",Wsa="datumClick",Xsa= "datumHoverIn",Ysa="datumHoverOut",XD="day",YD="dblclick",Zsa="deactivate",ZD="default",$sa="defaultColor",$D="defs",ata="degree",bta="destroy",cta="detectflash",aE="dialogselect",dta="diamond",eta="diff.innerCircle.borderFactor",fta="diff.innerCircle.radiusFactor",bE="diff.newData.opacity",gta="diff.newData.tooltip.prefix",hta="diff.newData.widthFactor",ita="diff.oldData.color",jta="diff.oldData.inCenter",cE="diff.oldData.opacity",kta="diff.oldData.tooltip.prefix",dE="disable",lta="disabled",mta= "display:table-cell;padding: 0;margin: 0;border: 0",nta="display:table;position:absolute;padding:0;margin:0;border:0",ota="displayAnnotations",pta="displayDateBarSeparator",qta="displayLegendDots",rta="displayLegendValues",sta="displayMode",eE="displayRangeSelector",tta="displayTinySlicesInLegend",fE="displayZoomButtons",uta="disputed",gE="dive",hE="doExpressInstall",vta="down",iE="drag",wta="dragToPan",xta="dragToZoom",yta="dragend",zta="dragstart",Ata="drawCircle",Bta="drawEllipse",Cta="drawLine", Dta="drawRect",Eta="drawShape",Fta="drawText",Gta="drop",Hta="dx",Ita="dy",jE="e",Jta="earlycancel",Kta="easing",Lta="elaborated",Mta="elaborated.isDisputed",Nta="elaborated.origin.x",Ota="elaborated.origin.y",Pta="elaborated.rowId",kE="ellipse",Qta="empty",lE="en",mE="enable",nE="enableInteractivity",Rta="enableRegionInteractivity",Sta="enableScrollWheel",oE="end",pE="enter",Tta="exp",Uta="expanded",qE="explicit",rE="explorer",sE="explorer.actions",Vta="explorer.axis",Wta="explorer.axis.",Xta="explorer.keepInBounds", Yta="explorer.maxZoomIn",Zta="explorer.maxZoomOut",$ta="explorer.zoomDelta",aua="feComponentTransfer",bua="feFuncA",cua="feGaussianBlur",dua="feMerge",tE="feMergeNode",eua="feOffset",uE="feature",vE="featureClick",wE="featureHover",xE="featureMove",yE="fgrid",zE="fill",AE="fill-opacity",fua="fill.color",gua="fill.opacity",hua="fillColor",iua="fillOpacity",BE="finish",jua="firstVisibleText",kua="fixedRangeSize",lua='flashvars="',CE="focusTarget",mua="focusedFeature",nua="focusedMarker",oua="font-family", pua="font-family:",qua="font-size",DE="font-style",EE="font-weight",rua="font.family",sua="font.size",FE="fontColor",tua="fontFamily",GE="fontName",HE="fontSize",IE="forceIFrame",JE="format",uua="formatOptions",KE="formatOptions.prefix",LE="formatOptions.scaleFactor",ME="formatOptions.suffix",vua="formatter.numDecimals",wua="formatter.numSignificantDigits",xua="formatter.unit",yua="formatter.useMagnitudes",zua="function CHART_loaded() {",Aua="g_vml_",Bua="g_vml_:",Cua="g_vml_\\:*{behavior:url(#default#VML)}", Dua="geocodingContext",NE="get",Eua="goog_",Fua="google-visualization-toolbar-big-dialog",Gua="google-visualization-toolbar-html-code-explanation",Hua="google-visualization-toolbar-small-dialog",OE="google-visualization-tooltip",Iua="google-visualization-tooltip-action",Jua="google-visualization-tooltip-action-list",Kua="google-visualization-tooltip-item",Lua="google-visualization-tooltip-item-list",Mua="google-visualization-tooltip-separator",Nua="google-visualization-tooltip-square",Oua="google.visualization.AreaChart", Pua="google.visualization.BarChart",Qua="google.visualization.ColumnChart",Rua="google.visualization.LineChart",Sua="google.visualization.PieChart",Tua="google.visualization.ScatterChart",Uua="google_visualization_geochart_",Vua="google_visualization_geochart_boundingBoxes",Wua="google_visualization_geochart_mapList",PE="gradient",Xua="gradientUnits",QE="gray",RE="green",SE="grid",TE="gridline",Yua="gridlineColor",Zua="gridlines.allowMinor",$ua="gridlines.color",ava="gridlines.count",bva="gridlines.minMajorTextDistance", cva="gridlines.minMinorTextDistance",dva="gridlines.minNotchDistance",eva="gridlines.minStrongLineDistance",fva="gridlines.minStrongToWeakLineDistance",gva="gridlines.minWeakLineDistance",hva="gridlines.minorGridlineOpacity",iva="gridlines.minorTextOpacity",jva="gridlines.newTimeline",kva="gridlines.unitThreshold",UE="group",lva="hAxes.",VE="hAxis",mva="hAxis#",WE="halign",XE="haspopup",YE="headerColor",ZE="headerHeight",nva="height:",$E="hide",aF="high",ova="highContrast",bF="highlight",cF="histogram", pva="histogram.bucketSize",dF="histogram.hideBucketItems",qva="histogram.lastBucketPercentile",rva="histogram.maxBucketNumber",sva="histogram.minBucketNumber",tva="histogram.sortBucketItems",uva="histogramBucketItems",vva="histogramBuckets",wva="histogramElementIndexes",xva="hour",yva="hover",eF="hoverIn",fF="hoverOut",zva="htmlcode",Ava="http:",Bva="http://www.google.com/ig/adde?moduleurl=",Cva="http://www.w3.org/1999/xlink",gF="http://www.w3.org/2000/svg",hF="https:",iF="hybrid",jF="i",kF="id", Dva="identifier",lF="iframe",Eva="igoogle",Fva="image",Gva="image/png",Hva="image/svg+xml",mF="in",nF="inAndOut",Iva="inTextPosition",Jva="info/boundingBoxes.js",Kva="info/mapList.js",Lva="infobackground",oF="input",pF="inside",Mva="interactivityModel",qF="interpolateNulls",rF="interval",Nva="interval.",Ova="intervals.",sF="is3D",Pva="isDiff",tF="isStacked",uF="italic",Qva="italic ",Rva='javascript:""',Sva="jscode",Tva="kavrayskiy-vii",Uva="keepAspectRatio",vF="key",wF="keydown",xF="keyup",yF="l", zF="label",AF="labelInLegend",BF="labeled",CF="labelledby",Vva="leave",DF="legend",Wva="legend.alignment",Xva="legend.bar.length",Yva="legend.iconWidthScaleFactor",Zva="legend.labeledValueText",$va="legend.maxLines",awa="legend.newLegend",bwa="legend.numberFormat",cwa="legend.orientation",dwa="legend.pagingTextStyle",ewa="legend.position",fwa="legend.scrollArrows.activeColor",gwa="legend.scrollArrows.inactiveColor",hwa="legend.scrollArrows.orientation",iwa="legend.showPageIndex",jwa="legend.textStyle", kwa="legendEntry",Bwa="legendEntryClick",Cwa="legendEntryHoverIn",Dwa="legendEntryHoverOut",Ewa="legendFontSize",Fwa="legendScrollButton",Gwa="legendScrollButtonClick",Hwa="legendTextColor",EF="legendTextStyle",FF="legendentry",GF="legendscrollbutton",HF="letter",IF="li",JF="line",KF="line.",Iwa="lineColor",Jwa="lineDashStyle",Kwa="lineSize",Lwa="lineSpacing",Mwa="lineWeight",LF="lineWidth",MF="linear",Nwa="linearGradient",NF="links",Owa="listbox",Pwa="load",Qwa="loaded",OF="log",PF="logScale",Rwa= "logScaleX",Swa="losecapture",Twa="low",QF="ltr",Uwa="magnifyingGlass.enable",Vwa="magnifyingGlass.zoomFactor",RF="magnifyingGlassBorder",SF="magnifyingGlassTriangle",Wwa="majorAxisTextColor",Xwa="mapLoaded",TF="mapType",Ywa="mapfiles/%s.js",UF="marker",Zwa="marker.style.stroke",$wa="marker.style.stroke.color",axa="marker.style.stroke.width",VF="markerClick",mG="markerHover",bxa="markerMove",cxa="markerOpacity",nG="math",dxa="matrix(",oG="max",exa="maxAlternation",pG="maxColor",fxa="maxColorValue", qG="maxDepth",gxa="maxTextLines",rG="maximized",hxa="menu",ixa="menuitem",sG="menuitemcheckbox",tG="menuitemradio",uG="mercator",jxa="meta",vG="metros",wG="midColor",xG="middle",yG="min",zG="minColor",kxa="minColorValue",lxa="minRangeSize",mxa="minTextSpacing",nxa="minorAxisTextColor",AG="minorGridlines.color",oxa="minorGridlines.count",BG="mirrorLog",CG="mixed",pxa="modal-dialog",DG="month",qxa="mouseenter",rxa="mouseleave",EG="mousemove",FG="mouseup",GG="mousewheel",HG="move",IG="move_offscreen", JG="name",KG="natural",LG="no",sxa="nodeType",MG="normal",txa="notime",NG="nowrap",uxa="objectBoundingBox",vxa="ocean",OG="off",PG="offset",QG="ok",RG="old-data",wxa="onmousedown",SG="onmousemove",TG="onmouseout",UG="onmouseover",xxa="onmouseup",yxa="onreadystatechange",zxa="onunload",Axa="opacity2",VG="opaque",Bxa="open",Cxa="optimizeQuality",Dxa="option",WG="orientation",XG="out",Exa="out:csv;",Fxa="out:html;",Gxa="outTextPosition",YG="outside",Hxa="oval",Ixa="overflow:auto;position:absolute;top:0;width:100px;height:100px", Jxa="overflow:hidden;position:relative;width:",Kxa="overflowX",Lxa="overlaybox",ZG="owns",$G="p",Mxa="p3",Nxa="package",Oxa="paste",aH="path",Pxa="pathinterval",Qxa="patternUnits",Rxa="pc",bH="percentage",Sxa="phase",cH="pie",dH="pieHole",Txa="pieResidueSliceColor",Uxa="pieResidueSliceLabel",eH="pieSliceBorderColor",fH="pieSliceText",Vxa="pieSliceTextStyle",Wxa="pieStartAngle",gH="piecewiseLinear",Xxa="pinchToZoom",Yxa="pixelsPerLabel",hH="play",iH="point",Zxa="point.",$xa="pointShape",jH="pointSize", kH="pointer",lH="points",mH="pointsensitivityarea",nH="polygon",aya="position:absolute;display:none;",bya="position:relative;overflow:hidden",cya="pre",dya="preserveAspectRatio",eya="pressed",oH="pretty",pH="primarydiagonalstripes",fya="projection",gya="propertychange",qH="provinces",hya="pt",iya="purple",jya="px ",rH="px;",kya="px;overflow-x:",lya="px;position: absolute;top:0;left:0;",sH="quadtree",mya="rablshadow",tH="range",nya="rangeChangeEventFiringRate",uH="rangechange",vH="rect",oya="rect(", wH="red",xH="redirectUrl",yH="redraw",zH="region",pya="regionClick",AH="remove",qya="removeSerieButton",rya="removeSerieButtonClick",sya="removeSerieButtonHoverIn",tya="removeSerieButtonHoverOut",uya="removeShape",vya="removeserie",wya="removeseriebutton",xya="renderers",BH="renderers/abstract/abstractrenderer",yya="renderers/canvas/canvas",zya="renderers/canvas/circle",Aya="renderers/canvas/ellipse",Bya="renderers/canvas/line",Cya="renderers/canvas/path",Dya="renderers/canvas/rect",Eya="renderers/canvas/shapes", Fya="renderers/canvas/text",Gya="renderers/svg/circle",Hya="renderers/svg/ellipse",Iya="renderers/svg/group",Jya="renderers/svg/line",Kya="renderers/svg/path",Lya="renderers/svg/path-util",Mya="renderers/svg/rect",Nya="renderers/svg/shapes",Oya="renderers/svg/svg",Pya="renderers/svg/svg-util",Qya="renderers/svg/text",Rya="repeat",Sya="reset",CH="resize",DH="resolution",Tya="resume",Uya="reverse",Vya="reverseAxis",EH="reverseCategories",Wya="rgb(",Xya="rgba(",FH="rgba(0,0,0,0)",GH="right-space",Yya= "rightClickToReset",HH="rightclick",Zya="rotate",IH="rotate(",JH="row",$ya="row-resize",KH="rowlabels",LH="rows",MH="rx",NH="ry",OH="sans-serif",aza="scale(",PH="scaleType",QH="scatter",bza="scene",RH="screen",SH="scroll",cza="scrollToZoom",dza="secondarydiagonalstripes",TH="selected",UH="selectedRows",eza="selectionMode",VH="separator",fza="serie",gza="serieClick",hza="serieHoverIn",iza="serieHoverOut",WH="series",XH="series-color",YH="series-color-dark",jza="series-color-light",ZH="series.",kza= "seriesType",$H="set",lza="shadow.opacity",mza="shadow.radius",nza="shadow.x-offset",oza="shadow.xOffset",pza="shadow.xoffset",qza="shadow.y-offset",rza="shadow.yOffset",sza="shadow.yoffset",aI="shape",tza="shapes/abstract_shape",uza="shapes/circle",vza="shapes/ellipse",wza="shapes/group",xza="shapes/line",yza="shapes/path",zza="shapes/rect",Aza="shapes/rect-util",bI="shapes/shapes",Bza="shapes/text",Cza="shortBarWidth",Dza="shortdash",cI="show",Eza="showChartButtons",Fza="showGeocodeWarnings",dI= "showLine",Gza="showR2",Hza="showRemoveSeriesButton",Iza="showScale",Jza="showSidePanel",Kza="showTextEvery",Lza="showTextEveryMode",eI="showTip",fI="showTooltips",Mza="sideScreenColor",Nza="sizeAxis.logScale",Oza="sizeAxis.maxSize",Pza="sizeAxis.maxValue",Qza="sizeAxis.minSize",Rza="sizeAxis.minValue",Sza="sizeAxis.scaleType",Tza="slantedText",Uza="slantedTextAngle",gI="slice",Vza="sliceVisibilityThreshold",Wza="slices.",hI="slider",Xza="slope",iI="smoothingFactor",Yza="snapToData",Zza="sortBubblesBySize", $za="sparkline",jI="square",kI="src",lI="stack",aAa="stageShape",mI="star",nI="start",oI="state",bAa="stdDeviation",cAa="stemColor",pI="step",qI="steppedArea",rI="steppedareabar",dAa="sticks",sI="stop",tI="stop-color:",uI="stroke",eAa="stroke-dasharray",fAa="stroke-linecap",vI="stroke-opacity",wI="stroke-width",gAa="stroke.color",hAa="stroke.opacity",iAa="stroke.width",jAa="strokeColor",kAa="strokeOpacity",lAa="strokeWidth",mAa="subcontinents",nAa="submit",xI="svg",yI="swf",zI="t",oAa="targetAxes.", AI="targetAxisIndex",BI="tbody",CI="td",DI="text-anchor",pAa="text-decoration",qAa="textColor",rAa="textFontSize",sAa="textPosition",EI="textStyle",tAa="textpath",FI="textpathok",uAa="thickness",vAa="tickScoringWeights",GI="ticks",wAa="timeGranularity",HI="title",xAa="titleColor",II="titleFontSize",yAa="titlePosition",JI="titleTextStyle",zAa="titleX",KI="titleY",LI="toggle_display",AAa="tooltip.isHtml",BAa="tooltip.showColorCode",CAa="tooltip.showDisputedText",DAa="tooltip.showEmpty",EAa="tooltip.showTitle", FAa="tooltip.text",GAa="tooltip.textStyle",MI="tooltip.trigger",HAa="tooltipFontSize",IAa="tooltipHoverIn",JAa="tooltipHoverOut",KAa="tooltipText",LAa="tooltipTextColor",MAa="tooltipTextStyle",NAa="tooltipTrigger",NI="top",OI="top-space",PI="top_left",OAa="top_right",PAa="touchcancel",QAa="touchend",RAa="touchmove",QI="touchstart",SAa="tqx",RI="tr",TAa="track",UAa="translate(",VAa="trendlines.",WAa="triangle",XAa="trigger",YAa="type_error:SafeHtml",SI="ul",ZAa="unbound",$Aa="uncheck",TI="underline", UI="unhighlight",aBa="unselect",bBa="up",cBa="uritoolong",dBa="url(",VI="url(#",eBa="urn:schemas-microsoft-com:vml",fBa="useExpressInstall",gBa="useLargeControl",hBa="useMapTypeControl",WI="userSpaceOnUse",XI="v-text-align",YI="v:fill",iBa="v:group",ZI="v:oval",$I="v:path",jBa="v:rect",aJ="v:shape",kBa="v:stroke",lBa="v:textpath",mBa="vAxes.",nBa="vAxis#",bJ="valign",oBa="value-and-percentage",pBa="valueFormatter",qBa="valuemax",rBa="valuemin",sBa="valuenow",tBa="valuetext",uBa="var _loaded = false;", cJ="version",dJ="viewBox",eJ="viewWindow.max",fJ="viewWindow.min",vBa="viewWindow.numericMax",wBa="viewWindow.numericMin",gJ="viewWindowMode",hJ="visibleInLegend",xBa="week",iJ="width: ",yBa="width: 700px; height: 500px;",zBa="width:100px;height:100px;overflow:scroll;position:absolute;visibility:hidden;",jJ="wordtree",kJ="world",lJ="x",mJ="x1",nJ="x2",ABa="xiRedirectUrl",oJ="y1",pJ="y2",qJ="year",rJ="yyyy",BBa="zOrder",CBa="zoomAroundSelection",DBa="zoomLevel",EBa="zoomOut",sJ="{}",FBa="\u00b0"; function GBa(a,b){var c=b||HBa;return function(){var b=this||Ph,b=b.closure_memoize_cache_||(b.closure_memoize_cache_={}),e=c(fi(a),arguments);return b[vc](e)?b[e]:b[e]=a[Mc](this,arguments)}}function HBa(a,b){for(var c=[a],d=b[J]-1;0<=d;--d)c[C](typeof b[d],b[d]);return c[ie](Xka)};Tj([BC,"base",bD,"col","command","embed","hr",Vr,oF,"keygen",Rg,jxa,"param","source",TAa,"wbr"]);var IBa=/<[^>]*>|&[^;]+;/g;function tJ(a,b){return b?a[vb](IBa,O):a} var JBa=/[A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]/,KBa=/^[^A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\u200f\ufb1d-\ufdff\ufe70-\ufefc]/,LBa=/^http:\/\/.*/,MBa=RegExp("^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Arab|Hebr|Thaa|Nkoo|Tfng))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)",jF);function uJ(){return MBa[bd](Zn(Vra)||lE)} var NBa=/\s+/,OBa=/\d/;function PBa(a,b){for(var c=0,d=0,e=!1,f=tJ(a,b)[pc](NBa),g=0;g<f[J];g++){var k=f[g];KBa[bd](tJ(k,void 0))?(c++,d++):LBa[bd](k)?e=!0:JBa[bd](tJ(k,void 0))?d++:OBa[bd](k)&&(e=!0)}return 0==d?e?1:0:0.4<c/d?-1:1};function vJ(){this.b2=O;this.hra=QBa;this.zda=null}vJ[K].cra=!0;vJ[K].f2=function(){return this.zda};vJ[K].dra=!0;function wJ(a){return a instanceof vJ&&a[rc]===vJ&&a.hra===QBa?a.b2:YAa}function xJ(a){var b=null;a.cra&&(b=a.f2());return yJ(qi(a.dra?a.b2:String(a)),b)}Tj(qC,"cite",Jr,"formaction",Kg,"manifest","poster",kI);Tj(Rg,lh,sh);var QBa={};function yJ(a,b){var c=new vJ;c.b2=a;c.zda=b;return c}var zJ=xJ(O);function AJ(a,b){Wa(a,wJ(b))};function RBa(a){var b=a[Od],c=a[qc];c||Cl(a)!=yg||(c=Gk(a)[dc]);if(!c)return b;if(lk)var d=Zl(c),b=b+d[G];else rk(8)&&(d=Zl(c),b-=d[G]);return Kl(c)?c[Gd]-(b+a[zb]):b};function BJ(a,b,c,d,e,f,g,k,l){var n=CJ(c),q=Ql(a),s=Il(a);s&&q.Ky(xl(s));var s=Ek(a),u=Ek(c);if(s.$b()!=u.$b()){var w=s.$b()[Pd],u=u.xB(),z=new sk(0,0),B=Qk(Gk(w)),F=w;do{var M=B==u?Jl(F):Lea(F);z.x+=M.x;z.y+=M.y}while(B&&B!=u&&(F=B.frameElement)&&(B=B[xy]));w=vk(z,Jl(w));kk&&!pl(s)&&(w=vk(w,ql(s)));Ya(q,q[G]+w.x);q.top+=w.y}a=DJ(a,b);q=new sk(a&2?q[G]+q[r]:q[G],a&1?q.top+q[A]:q.top);q=vk(q,n);e&&(q.x+=(a&2?-1:1)*e.x,q.y+=(a&1?-1:1)*e.y);var N;if(g)if(l)N=l;else if(N=Il(c))N.top-=n.y,Ta(N,N[Zc]- n.x),Na(N,N[Hc]-n.y),Ya(N,N[G]-n.x);return EJ(q,c,d,f,N,g,k)}function CJ(a){var b;if(a=a[qc]){var c=a[Nc]==Hoa||a[Nc]==aoa;c&&Cl(a)==qh||(b=Jl(a),c||(c=(c=Kl(a))&&lk?-a[Gc]:!c||kk&&qk(Wq)||Bl(a,Kxa)==Fh?a[Gc]:a[Bc]-a[Gd]-a[Gc],b=vk(b,new sk(c,a[Cd]))))}return b||new sk} function EJ(a,b,c,d,e,f,g){a=a.o();var k=0,l=DJ(b,c);c=Pl(b);g=g?g.o():c.o();if(d||0!=l)l&2?a.x-=g[r]+(d?d[Zc]:0):d&&(a.x+=d[G]),l&1?a.y-=g[A]+(d?d[Hc]:0):d&&(a.y+=d.top);if(f&&(e?(k=a,d=0,65==(f&65)&&(k.x<e[G]||k.x>=e[Zc])&&(f&=-2),132==(f&132)&&(k.y<e.top||k.y>=e[Hc])&&(f&=-5),k.x<e[G]&&f&1&&(k.x=e[G],d|=1),k.x<e[G]&&k.x+g[r]>e[Zc]&&f&16&&(pa(g,h.max(g[r]-(k.x+g[r]-e[Zc]),0)),d|=4),k.x+g[r]>e[Zc]&&f&1&&(k.x=h.max(e[Zc]-g[r],e[G]),d|=1),f&2&&(d=d|(k.x<e[G]?16:0)|(k.x+g[r]>e[Zc]?32:0)),k.y<e.top&& f&4&&(k.y=e.top,d|=2),k.y<=e.top&&k.y+g[A]<e[Hc]&&f&32&&(Sa(g,h.max(g[A]-(e.top-k.y),0)),k.y=e.top,d|=8),k.y>=e.top&&k.y+g[A]>e[Hc]&&f&32&&(Sa(g,h.max(g[A]-(k.y+g[A]-e[Hc]),0)),d|=8),k.y+g[A]>e[Hc]&&f&4&&(k.y=h.max(e[Hc]-g[A],e.top),d|=2),f&8&&(d=d|(k.y<e.top?64:0)|(k.y+g[A]>e[Hc]?128:0)),k=d):k=256,k&496))return k;Dl(b,a);yk(c,g)||(a=Gk(b),e=pl(Ek(a)),!kk||e&&qk(Wq)?(b=b[x],lk?b.MozBoxSizing=VC:mk?b.WebkitBoxSizing=VC:b.boxSizing=VC,pa(b,h.max(g[r],0)+S),Sa(b,h.max(g[A],0)+S)):(a=b[x],e?(e=Yl(b), b=Zl(b),a.pixelWidth=g[r]-b[G]-e[G]-e[Zc]-b[Zc],a.pixelHeight=g[A]-b.top-e.top-e[Hc]-b[Hc]):(a.pixelWidth=g[r],a.pixelHeight=g[A])));return k}function DJ(a,b){return(b&4&&Kl(a)?b^2:b)&-5};function FJ(){}FJ[K].Ie=function(){};function GJ(a,b,c){cx(this,a);this.fH=b;this.pra=c}X(GJ,FJ);GJ[K].Ie=function(a,b,c){BJ(this[Mz],this.fH,a,b,void 0,c,this.pra)};function HJ(a,b){this.aa=a instanceof sk?a:new sk(a,b)}X(HJ,FJ);HJ[K].Ie=function(a,b,c,d){BJ(Gl(a),0,a,b,this.aa,c,null,d)};function IJ(a,b,c,d){GJ[L](this,a,b);this.XN=c?5:0;this.r2=d||void 0}X(IJ,GJ);IJ[K].Eia=function(){return this.XN};IJ[K].Ie=function(a,b,c,d){var e=BJ(this[Mz],this.fH,a,b,null,c,10,d,this.r2);if(e&496){var f=JJ(e,this.fH);b=JJ(e,b);e=BJ(this[Mz],f,a,b,null,c,10,d,this.r2);e&496&&(f=JJ(e,f),b=JJ(e,b),BJ(this[Mz],f,a,b,null,c,this.XN,d,this.r2))}};function JJ(a,b){a&48&&(b^=2);a&192&&(b^=1);return b};function KJ(a,b){this.aa=a instanceof sk?a:new sk(a,b)}X(KJ,FJ);KJ[K].Ie=function(a,b,c,d){var e;e=Gk(a);var f=e[Pd];e=e[dc];e=new sk(f[Gc]||e[Gc],f[Cd]||e[Cd]);f=this.aa.x+e.x;e=this.aa.y+e.y;var g=CJ(a),f=f-g.x;e-=g.y;EJ(new sk(f,e),a,b,c,null,null,d)};function SBa(a){if(a[Tp]&&!a[Jq]||a[Cq]||112<=a[Np]&&123>=a[Np])return!1;switch(a[Np]){case 18:case 20:case 93:case 17:case 40:case 35:case 27:case 36:case 45:case 37:case 224:case 91:case 144:case 12:case 34:case 33:case 19:case 255:case 44:case 39:case 145:case 16:case 38:case 224:case 92:return!1;case 0:return!lk;default:return 166>a[Np]||183<a[Np]}} function TBa(a,b,c,d,e){if(!(kk||mk&&qk(jna)))return!0;if(fk&&e)return LJ(a);if(e&&!d)return!1;di(b)&&(b=MJ(b));if(!c&&(17==b||18==b||fk&&91==b))return!1;if(mk&&d&&c)switch(a){case 220:case 219:case 221:case 192:case 186:case 189:case 187:case 188:case 190:case 191:case 192:case 222:return!1}if(kk&&d&&b==a)return!1;switch(a){case 13:return!(kk&&rk(9));case 27:return!mk}return LJ(a)} function LJ(a){if(48<=a&&57>=a||96<=a&&106>=a||65<=a&&90>=a||mk&&0==a)return!0;switch(a){case 32:case 63:case 107:case 109:case 110:case 111:case 186:case 59:case 189:case 187:case 61:case 188:case 190:case 191:case 192:case 222:case 219:case 220:case 221:return!0;default:return!1}}function MJ(a){if(lk)a=UBa(a);else if(fk&&mk)t:switch(a){case 93:a=91;break t}return a} function UBa(a){switch(a){case 61:return 187;case 59:return 186;case 173:return 189;case 224:return 91;case 0:return 224;default:return a}};function NJ(a,b){rt[L](this);this.Td=new sv(this);this.hF(a||null);b&&this.Du(b)}X(NJ,rt);T=NJ[K];T.q=null;T.B9=!0;T.aba=null;T.MB=!1;T.pna=!1;T.hZ=-1;T.Cka=!1;T.Bna=!0;T.rg=LI;T.Vb=function(){return this.rg};T.Du=function(a){this.rg=a};T.a=function(){return this.q};T.hF=function(a){VBa(this);this.q=a};T.uL=function(a){VBa(this);this.B9=a};T.NM=function(a,b){this.zA=a;this.kB=b};T.hc=function(){return this.Td}; function VBa(a){if(a.MB)throw m("Can not change this state of the popup while showing.");}T.O=function(){return this.MB};fw(T,function(a){this.zA&&this.zA[Hq]();this.kB&&this.kB[Hq]();a?this.R0():this.lC()});T.Ie=Th; T.R0=function(){if(!this.MB&&this.JW()){if(!this.q)throw m("Caller must call setElement before trying to show the popup");this.Ie();var a=Gk(this.q);this.Cka&&this.Td.l(a,wF,this.Dka,!0);if(this.B9)if(this.Td.l(a,es,this.D9,!0),kk){var b;try{b=a[pb]}catch(c){}for(;b&&b[nd]==Vaa;){try{var d=b[Nz]||b[dy][Hd]}catch(e){break}a=d;b=a[pb]}this.Td.l(a,es,this.D9,!0);this.Td.l(a,Zsa,this.C9)}else this.Td.l(a,TC,this.C9);this.rg==LI?(hb(this.q[x],Fh),Sl(this.q,!0)):this.rg==IG&&this.Ie();this.MB=!0;this.hZ= hi();this.zA?(nt(this.zA,oE,this.E9,!1,this),this.zA[fz]()):this.E9()}};T.lC=function(a){if(!this.MB||!this[$]({type:NC,target:a}))return!1;this.Td&&this.Td.oc();this.MB=!1;hi();this.kB?(nt(this.kB,oE,gi(this.ica,a),!1,this),this.kB[fz]()):this.ica(a);return!0};T.ica=function(a){this.rg==LI?this.pna?ut(this.Jaa,0,this):this.Jaa():this.rg==IG&&(this.q[x].top=gma);this.WX(a)};T.Jaa=function(){hb(this.q[x],Ig);Sl(this.q,!1)};T.JW=function(){return this[$](OC)};T.E9=function(){this[$](cI)}; T.WX=function(a){this[$]({type:$E,target:a})};T.D9=function(a){a=a[Mq];dl(this.q,a)||this.aba&&!dl(this.aba,a)||150>hi()-this.hZ||this.lC(a)};T.Dka=function(a){27==a[Np]&&this.lC(a[Mq])&&(a[Hp](),a[Zp]())};T.C9=function(a){if(this.Bna){var b=Gk(this.q);if("undefined"!=typeof fa[pb]){if(a=b[pb],!a||dl(this.q,a)||a[Nc]==aoa)return}else if(a[Mq]!=b)return;150>hi()-this.hZ||this.lC()}};T.w=function(){NJ.e.w[L](this);this.Td.W();Ws(this.zA);Ws(this.kB);delete this.q;delete this.Td};function OJ(a,b){this.b7=4;this.ya=b||void 0;NJ[L](this,a)}X(OJ,NJ);pw(OJ[K],function(){return this.ya||null});bx(OJ[K],function(a){this.ya=a||void 0;this.O()&&this.Ie()});OJ[K].Ie=function(){if(this.ya){var a=!this.O()&&this.Vb()!=IG,b=this.a();a&&(hb(b[x],Ig),Sl(b,!0));this.ya.Ie(b,this.b7,this.wta);a&&Sl(b,!1)}};function PJ(a,b,c){this.P=c||(a?Ek(Hk(a)):Ek());OJ[L](this,this.P.h(Q,{style:aya}));this.ub=new sk(1,1);this.Fa=new ck;a&&this.cz(a);null!=b&&this.$q(b)}X(PJ,OJ);var QJ=[];T=PJ[K];T.Lf=null;lb(T,"charts-tooltip");T.UM=500;T.S7=0;T.ea=function(){return this.P};T.cz=function(a){a=Hk(a);this.Fa.add(a);kt(a,gs,this.En,!1,this);kt(a,fs,this.YR,!1,this);kt(a,EG,this.Zba,!1,this);kt(a,zg,this.Pt,!1,this);kt(a,TC,this.YR,!1,this)}; T.detach=function(a){if(a)a=Hk(a),WBa(this,a),this.Fa[Ob](a);else{for(var b=this.Fa.La(),c=0;a=b[c];c++)WBa(this,a);this.Fa[Wb]()}};function WBa(a,b){ot(b,gs,a.En,!1,a);ot(b,fs,a.YR,!1,a);ot(b,EG,a.Zba,!1,a);ot(b,zg,a.Pt,!1,a);ot(b,TC,a.YR,!1,a)}T.$q=function(a){el(this.a(),a)};T.F_=function(a){var b=this.a();b&&AJ(b,a)};T.hF=function(a){var b=this.a();b&&Zk(b);PJ.e.hF[L](this,a);a&&(b=this.P.$b()[Pd],b[Eb](a,b[yc]))};T.Mu=function(){return jl(this.a())};T.G5=function(){return this.a()[hd]}; sp(T,function(){return this.Hu?this.O()?4:1:this.vH?3:this.O()?2:0});T.JW=function(){if(!NJ[K].JW[L](this))return!1;if(this[Gz])for(var a,b=0;a=QJ[b];b++)dl(a.a(),this[Gz])||a[hy](!1);Ri(QJ,this)||QJ[C](this);a=this.a();lb(a,this[Fd]);RJ(this);kt(a,gs,this.y9,!1,this);kt(a,fs,this.x9,!1,this);SJ(this);return!0}; T.WX=function(){Wi(QJ,this);for(var a=this.a(),b,c=0;b=QJ[c];c++)b[Gz]&&dl(a,b[Gz])&&b[hy](!1);this.z9&&TJ(this.z9);ot(a,gs,this.y9,!1,this);ot(a,fs,this.x9,!1,this);Zw(this,void 0);0==this[hq]()&&(this.lO=!1);NJ[K].WX[L](this)};T.Mca=function(a,b){this[Gz]==a&&this.Fa[Lc](this[Gz])&&(this.lO||!this.Jta?(this[hy](!1),this.O()||(Zw(this,a),this[Lz](b||this.ON(0)),this[hy](!0))):Zw(this,void 0));this.Hu=void 0};T.j_=function(){return this.Fa};T.bE=function(){return this.Lf}; T.gra=function(a){this.vH=void 0;a==this[Gz]&&(null!=this.Lf&&(this.Lf==this.a()||this.Fa[Lc](this.Lf))||this.O8&&this.O8.Lf||this[hy](!1))};function XBa(a,b){var c=ql(a.P);a.ub.x=b[zd]+c.x;a.ub.y=b[Ad]+c.y}T.En=function(a){var b=UJ(this,a[Mq]);this.Lf=b;RJ(this);b!=this[Gz]&&(Zw(this,b),this.Hu||(this.Hu=ut(W(this.Mca,this,b,void 0),this.UM)),YBa(this),XBa(this,a))};function UJ(a,b){try{for(;b&&!a.Fa[Lc](b);)b=b[fe];return b}catch(c){return null}}T.Zba=function(a){XBa(this,a);this.lO=!0}; T.Pt=function(a){this.Lf=a=UJ(this,a[Mq]);this.lO=!0;if(this[Gz]!=a){Zw(this,a);var b=this.ON(1);RJ(this);this.Hu||(this.Hu=ut(W(this.Mca,this,a,b),this.UM));YBa(this)}};T.ON=function(a){return 0==a?(a=this.ub.o(),new VJ(a)):new WJ(this.Lf)};function YBa(a){if(a[Gz])for(var b,c=0;b=QJ[c];c++)dl(b.a(),a[Gz])&&(b.O8=a,a.z9=b)}T.YR=function(a){var b=UJ(this,a[Mq]),c=UJ(this,a[Fp]);b!=c&&(b==this.Lf&&(this.Lf=null),SJ(this),this.lO=!1,!this.O()||a[Fp]&&dl(this.a(),a[Fp])?Zw(this,void 0):TJ(this))}; T.y9=function(){var a=this.a();this.Lf!=a&&(RJ(this),this.Lf=a)};T.x9=function(a){var b=this.a();this.Lf!=b||a[Fp]&&dl(b,a[Fp])||(this.Lf=null,TJ(this))};function SJ(a){a.Hu&&(vt(a.Hu),a.Hu=void 0)}function TJ(a){2==a[hq]()&&(a.vH=ut(W(a.gra,a,a[Gz]),a.S7))}function RJ(a){a.vH&&(vt(a.vH),a.vH=void 0)}T.w=function(){this[hy](!1);SJ(this);this[hz]();this.a()&&Zk(this.a());this.Lf=null;delete this.P;PJ.e.w[L](this)};function VJ(a,b){HJ[L](this,a,b)}X(VJ,HJ); VJ[K].Ie=function(a,b,c){b=Gl(a);b=Il(b);c=c?new rl(c.top+10,c[Zc],c[Hc],c[G]+10):new rl(10,0,0,10);EJ(this.aa,a,4,c,b,9)&496&&EJ(this.aa,a,4,c,b,5)};function WJ(a){GJ[L](this,a,3)}X(WJ,GJ);WJ[K].Ie=function(a,b,c){var d=new sk(10,0);BJ(this[Mz],this.fH,a,b,d,c,9)&496&&BJ(this[Mz],2,a,1,d,c,5)};function XJ(a){var b=null,c=null;ei(a)?b=a:c=a;this.Hna=b;this.q=c;this.qR=null}XJ[K].zn=function(a){this.qR=a;this.q&&Cm(this.q,a)};XJ[K].Er=function(){return this.q?Yea(this.q):this.qR};XJ[K].a=function(){this.q||(this.q=this.Hna(),null===this.qR||Cm(this.q,this.qR));return this.q};function YJ(){this.Yc=[]}T=YJ[K];T.qj=function(a){this.Yc[C](a)};Gw(T,function(a,b){this.qj(ZJ(a,b))});T.Z=function(a,b){this.qj({type:JF,data:{x:a,y:b}})};T.Zj=function(a,b,c,d,e,f){this.qj({type:QD,data:{x1:a,y1:b,hb:c,kb:d,x:e,y:f}})};T.Wf=function(a,b,c,d,e,f,g){this.qj({type:AC,data:{WA:a,XA:b,ji:c,ki:d,ew:e,Rq:f,c$:g}})}; function $J(a,b,c){if(0!=b[J])if(0==a.Yc[J]?a[Yy](b[0].x,b[0].y):a.Z(b[0].x,b[0].y),c)for(var d=1;d<b[J];++d)a.Zj(c[d-1][1].x,c[d-1][1].y,c[d][0].x,c[d][0].y,b[d].x,b[d].y);else for(d=1;d<b[J];++d)a.Z(b[d].x,b[d].y)}mw(T,function(){this.qj({type:HD,data:null})});function ZJ(a,b){return{type:HG,data:{x:a,y:b}}}function aK(a,b){var c=new YJ;0<a[J]&&($J(c,a),b||c[vy]());return c};function bK(a,b,c){switch(c){case nI:c=a;a+=b;break;case oE:c=a-b;break;case pD:c=a-b/2;a+=b/2;break;default:c=a=ja}return{start:c,end:a}}function cK(a,b,c){switch(c){case oE:return b;case pD:return vj(a,b);default:return a}};function dK(a,b){this.lb=a;this.fC=b;this.Cs=null;this.vf=GBa(W(function(a,b){return this.hC(a,b)},this),function(a,b){var e=[a,b[0]];Dj(b[1],function(a,b){e[C](a);e[C](b)});return e[ie](iC)});this.Uu=null}X(dK,Us);function eK(){Ph.__googleVisualizationAbstractRendererElementsCount__=Ph.__googleVisualizationAbstractRendererElementsCount__||0;var a=Mpa+Ph.__googleVisualizationAbstractRendererElementsCount__[hc]();Ph.__googleVisualizationAbstractRendererElementsCount__++;return a}T=dK[K];pa(T,0); Sa(T,0);T.wk=function(a,b){var c=this.qP(a,b);c.zn(ag);return this.Cs=c};T.deleteContents=function(a){this.J2(a)};T.flush=function(){};wa(T,function(){this.Wg()});T.Wg=function(){this.Cs=null};T.w=function(){this.Wg();dK.e.w[L](this)};T.ac=function(){return this.lb};T.zn=function(a,b){a&&(a[rc]==XJ?a.zn(b):Cm(a,b))};T.Er=function(a){return Yea(a)};T.appendChild=function(a,b){if(b){var c;if(b[rc]==XJ){if(!b.q)return;c=b.a()}else c=b;a.a()[p](c)}};T.replaceChild=function(a,b,c){a.a()[Ty](b,c)}; T.cd=function(a){if(a.q){var b=a.a();this.nt.cd(b);a.a()}};T.za=function(a){a=null!=a?a:!1;var b=new XJ(W(this.oZ,this));a||b.a();return b};T.JU=function(){};T.tba=function(){return null};T.uba=function(){};function fK(a,b,c,d,e,f){var g=new YJ;g[Yy](b,c);g.Z(d,e);return a.tc(g,f)} T.tc=function(a,b){for(var c=[],d=0;d<a.Yc[J];d++){var e=c,f=a.Yc[d];switch(f[H]){case HG:f=f[Z];this.Zc(e,f.x,f.y);break;case JF:f=f[Z];this.va(e,f.x,f.y);break;case QD:f=f[Z];this.Cq(e,f.x1,f.y1,f.hb,f.kb,f.x,f.y);break;case AC:f=f[Z];this.rm(e,f.WA,f.XA,f.ji,f.ki,f.ew,f.Rq,f.c$);break;case HD:this.vi(e)}}return this.f_(c,b)}; function ZBa(a,b,c,d,e,f,g,k){b=b[pc](me);var l=[],n=f;f=qj(f+90);c-=h.cos(f)*k*b[J];d-=h.sin(f)*k*b[J];for(var q=0,s=b[J];q<s;q++)l[C](a.Jp(b[q],c,d,e,n,pD,nI,g)),c+=h.cos(f)*k,d+=h.sin(f)*k;return l}T.Zd=function(a,b,c,d,e){a=this.Uv(a,b,c,d);this[p](e,a);return a};T.Nj=function(a,b,c,d,e,f){a=this.I2(a,b,c,d,e);this[p](f,a);return a};T.rb=function(a,b,c,d,e,f){a=this.Ak(a,b,c,d,e);this[p](f,a);return a};T.eK=function(a,b,c,d,e,f){a=fK(this,a,b,c,d,e);this[p](f,a);return a}; T.na=function(a,b,c){a=this.tc(a,b);this[p](c,a);return a};T.Pd=function(a,b,c,d,e,f,g,k){a=this.qt(a,b,c,d,e,f,g);this[p](k,a);return a};T.mi=function(a,b,c,d,e,f,g,k,l){a=this.nJ(a,b,c,d,e,f,g,k);this[p](l,a);return a};function $Ba(a,b,c,d,e,f,g,k,l,n){b=a.Jp(b,c,d,e,f,g,k,l);a[p](n,b)}T.Gk=function(a,b){return this.vf(a,b)[r]};function aCa(a,b,c){var d;d=d||0;b=b[pc](me);for(var e=0,f=0,g=0,k=b[J];g<k;g++){var l=a.vf(b[g],c),e=h.max(e,l[r]),f=f+l[A];0<g&&(f+=d)}return new xk(e,f)}T.qB=function(){return!1};function bCa(a){return ml(a,function(a){return a.referencepoint},!0)}function gK(a){var b=bCa(a[Mq]);return Ll(a,b)};function hK(a,b){dK[L](this,a,b);this.nt=Ek(a);this.pN=this.nt.$b();this.Aq=[];this.C=new sv}X(hK,dK);function cCa(a,b,c,d){b=new PJ(b);var e=a.nt.h(Q);c=c[pc](me);e[p](a.nt[Cb](c[0]));for(var f=1;f<c[J];++f)e[p](a.nt.h(bD)),e[p](a.nt[Cb](c[f]));zl(e,d);b.a()[p](e);b.UM=100;b.S7=100;a.Aq[C](b)}T=hK[K];T.Ff=function(a){this.nt[kq](a);qt(a)};wa(T,function(){this.C.oc();Ws(this.C);this.C=new sv;hK.e[Wb][L](this)}); T.Wg=function(){hK.e.Wg[L](this);Y(this.Aq,function(a){Ws(a)});Ti(this.Aq);this.nt.cd(this.lb);this.C.oc();Ws(this.C)};T.Nk=function(a){var b=bCa(a);return b?(b=Ll(a,b),a=Pl(a),new rl(b.y,b.x+a[r],b.y+a[A],b.x)):null};T.Fb=function(a,b,c){a[rc]==XJ&&(a=a.a());this.C.l(a,b,c)};T.replaceChild=function(a,b,c){hK.e[Ty][L](this,a,b,c);qt(c)};function iK(a,b,c,d){this.x0=a;this.y0=b;this.x1=c;this.y1=d}iK[K].o=function(){return new iK(this.x0,this.y0,this.x1,this.y1)};Za(iK[K],function(a){return this.x0==a.x0&&this.y0==a.y0&&this.x1==a.x1&&this.y1==a.y1});function dCa(a){var b=a.x1-a.x0;a=a.y1-a.y0;return h[ud](b*b+a*a)}function jK(a,b){return new sk(pj(a.x0,a.x1,b),pj(a.y0,a.y1,b))};function kK(a,b){this.x=a;this.y=b}X(kK,sk);T=kK[K];T.o=function(){return new kK(this.x,this.y)};T.hba=function(){return h[ud](this.x*this.x+this.y*this.y)};Oa(T,sk[K][Fy]);T.add=function(a){this.x+=a.x;this.y+=a.y;return this};T.w0=function(a){this.x-=a.x;this.y-=a.y;return this};T.rotate=function(a){var b=h.cos(a);a=h.sin(a);var c=this.y*b+this.x*a;this.x=this.x*b-this.y*a;this.y=c;return this};Za(T,function(a){return this==a||!!a&&this.x==a.x&&this.y==a.y}); function lK(a,b){return new kK(a.x+b.x,a.y+b.y)}function mK(a,b){return new kK(a.x-b.x,a.y-b.y)};function nK(a,b){hK[L](this,a,b);this.ha=null;var c=Ek(b)[Qb](kD);this.fC[p](c);this.dca=c[iz](VA);this.h1=null}X(nK,hK);function oK(a){a.Xba||(a.ha[dz](),a.Xba=!0)}T=nK[K];T.qP=function(a,b){var c=Ek(this.lb)[Qb](kD);c[v](Ih,a);c[v](Hg,b);this.lb[p](c);this.ha=c[iz](VA);return new XJ(c)};T.J2=function(){var a=this.Cs.a();this.ha.clearRect(0,0,a[r],a[A])};function pK(a){return Ek(a.lb)[Qb](Qta)}function qK(a,b){if(a==R)return FH;b==R&&(b=1);return Xya+rm(a)+Je+b+Ge} function rK(a,b){"undefined"!==typeof a.setLineDash?a.setLineDash(b):a.Nwa=b} T.$h=function(a){Hw(this.ha,qK(a.Qd,a.Ai));ew(this.ha,qK(a.gb(),a.Oe));var b=a.Hk;null!=b&&b==UD?rK(this.ha,[8,2]):Yh(b)?rK(this.ha,b):rK(this.ha,[]);var b=a.fe,c=a.Qg;if(null!=b){var d;switch(b.Ge){case pH:c=this.pN[Qb](kD),c[v](Ih,4),c[v](Hg,4),d=c[iz](VA),ew(d,b.qr()),d[Jy](0,0,4,4),Hw(d,b.Hd()),d[dz](),zw(d,2),d.lineCap=jI,d[Xx](2,0),d[Ry](4,2),d[Xx](0,2),d[Ry](2,4),d[Yb](),d=c}ew(this.ha,this.ha.createPattern(d,Rya))}else null!=c&&(b=this.ha.createLinearGradient(+c.x1,+c.y1,+c.hb,+c.kb),b[Kz](0, c.lg),b[Kz](1,c.Tf),ew(this.ha,b));zw(this.ha,a.Hb)};function eCa(a,b){b.Tb&&b.Tb!=R?(Hw(a,b.Tb),zw(a,3)):Hw(a,FH);ew(a,qK(b[E],b[Kd]?b[Kd]:1));rK(a,[]);var c=O;b.Ic&&(c=Qva);b[Ed]&&(c+=kra);c+=b[uc]+jya+b.Va;a.font=c}T.Uv=function(a,b,c,d){this.ha[dz]();this.$h(d);this.ha.arc(a,b,c,0,2*h.PI);this.ha[Oy]();this.ha[fc]();this.ha[Yb]();return pK(this)}; T.I2=function(a,b,c,d,e){this.ha[qy]();this.$h(e);this.ha[jz](a,b);c>d?(this.ha[Fy](1,d/c),a=c):(this.ha[Fy](c/d,1),a=d);this.ha.arc(0,0,a,0,2*h.PI,!1);this.ha[fc]();this.ha[Yb]();this.ha[Gy]();return pK(this)};T.Ak=function(a,b,c,d,e){this.$h(e);this.ha[Jy](a,b,c,d);this.ha[qz](a,b,c,d);return pK(this)};T.pZ=function(){return pK(this)};T.f_=function(a,b){this.$h(b);this.ha[fc]();this.ha[Yb]();this.Xba=!1;return pK(this)};T.qt=function(a,b,c,d,e,f,g){return this.Jp(a,b,c,d,0,e,f,g)}; T.nJ=function(a,b,c,d,e,f,g,k){var l=cK(b,d,f),n=cK(c,e,f),q=dCa(new iK(b,c,d,e));return this.Jp(a,l,n,q,tj(b,c,d,e),f,g,k)}; T.Jp=function(a,b,c,d,e,f,g,k){eCa(this.ha,k);this.ha[qy]();e=qj(e);d=b*h.sin(-e)+c*h.cos(-e);b=b*h.cos(-e)-c*h.sin(-e);this.ha[sy](e);g==nI?d+=4*k[uc]/5:g==pD?d+=k[uc]/3:g==oE&&(d-=k[uc]/5);f!=nI&&(f==pD?b-=this.hC(a,k)[r]/2:f==oE&&(b-=this.hC(a,k)[r]));this.ha.strokeText(a,b,d);this.ha[Ex](a,b,d);k.De&&(this.ha[dz](),e=k[uc]/15,d+=e+1,1>e&&(e=1),zw(this.ha,e),this.ha[Xx](b,d),this.ha[Ry](this.ha.measureText(a)[r]+b,d),Hw(this.ha,this.ha.fillStyle),this.ha[Yb]());this.ha[Gy]();return pK(this)}; T.oZ=function(){return pK(this)};T.JU=function(a){this.h1=a;this.ha[qy]();this.ha[dz]();ew(this.ha,FH);this.ha[zz](a[G],a.top,a[r],a[A]);this.ha[Yb]();this.ha.clip();return pK(this)};T.uba=function(){this.h1=null;this.ha[Gy]()};T.tba=function(){return this.h1};T.cE=function(){return pK(this)};T.Zc=function(a,b,c){oK(this);this.ha[Xx](b,c)};T.va=function(a,b,c){oK(this);this.ha[Ry](b,c)};T.Cq=function(a,b,c,d,e,f,g){oK(this);this.ha.bezierCurveTo(b,c,d,e,f,g)};T.vi=function(){oK(this);this.ha[Oy]()}; T.rm=function(a,b,c,d,e,f,g,k){oK(this);f=qj(f-90);g=qj(g-90);a=h.max(d,e);this.ha[qy]();this.ha[jz](b,c);this.ha[Fy](d/a,e/a);this.ha.arc(0,0,a,f,g,!k);this.ha[Gy]()};T.em=function(){};T.sl=function(){};T.Ex=function(){};T.jQ=function(){};T.kQ=function(){};T.dd=function(){};T.hC=function(a,b){eCa(this.dca,b);return new xk(this.dca.measureText(a)[r],b[uc])};T.i0=function(){return pK(this)};T.Ri=function(){};function sK(a){this.m=a;this.C=new sv}X(sK,Us);T=sK[K];T.ac=function(){return this.m};wa(T,function(){this.TE();this.C=new sv});T.TE=function(){Wk(this.m);this.C.oc();Ws(this.C)};T.w=function(){this.TE();sK.e.w[L](this)};T.Fb=function(a,b,c){this.C.l(a,b,c)};function tK(a,b){hK[L](this,a,b);this.$o=null;this.qO={};this.SX={};this.hC(zoa,{fontSize:8,Va:nB,bold:!1,Ic:!1})}X(tK,hK);function fCa(a,b){a.$o=a.Ra($D);a.$o[v](kF,$D);a.qO={};a.SX={};a.D8={};b[p](a.$o)}T=tK[K];T.qP=function(a,b){pa(this,a);Sa(this,b);var c=this.Ra(xI);c[v](Ih,a);c[v](Hg,b);c[x].overflow=Ig;c[v](DC,Vna);this.lb[p](c);fCa(this,c);return new XJ(c)}; T.Nk=function(a){if(a instanceof Ph.SVGElement&&a[Nc][ke]()!==aH){var b=a.getBBox();return b.y|b.x|b[A]|b[r]?new rl(b.y,b.x+b[r],b.y+b[A],b.x):tK.e.Nk[L](this,a)}return tK.e.Nk[L](this,a)};T.J2=function(){for(var a=this.Cs.a(),b=a[Xb],c=b[J];1<c;)a[Qd](b[0]),c--;fCa(this,a)};T.Jna=function(){return this.lb[hd]};Va(T,function(a){return h[D](100*a)/100});T.Uv=function(a,b,c,d){var e=this.Ra(ED);e[v](SD,a);e[v](TD,b);e[v](fh,c);this.Ri(e,d);return e}; T.I2=function(a,b,c,d,e){var f=this.Ra(kE);f[v](SD,a);f[v](TD,b);f[v](MH,c);f[v](NH,d);this.Ri(f,e);return f};T.Ak=function(a,b,c,d,e){var f=this.Ra(vH);f[v](lJ,a);f[v](Jh,b);f[v](Ih,c);f[v](Hg,d);this.Ri(f,e);return f};T.pZ=function(a,b,c,d,e,f,g){b=nva+c+kya+(f?SH:Ig)+xna+(g?SH:Ig)+Ana+b+lya;d=this.qP(d,e);if(Zh(a))for(e=0,c=a[J];e<c;e++)this[p](d,a[e]);else this[p](d,a);a=Rk(Q,{style:b},d.a());this.lb[p](a);return{append:[],w6:[d.a()]}}; T.f_=function(a,b){var c=this.Ra(aH);0<a[J]&&c[v](ng,a[ie](O));this.Ri(c,b);return c};T.qt=function(a,b,c,d,e,f,g){return this.Jp(a,b,c,d,0,e,f,g)};T.nJ=function(a,b,c,d,e,f,g,k){var l=cK(b,d,f),n=cK(c,e,f),q=dCa(new iK(b,c,d,e));return this.Jp(a,l,n,q,tj(b,c,d,e),f,g,k)}; T.Jp=function(a,b,c,d,e,f,g,k){var l=Qh(k[Kd])?k[Kd]:1,n=new Rm({fill:k[E],ae:l});if(k[E]&&k[E]!=R&&k.Tb&&k.Tb!=R){var l=new Rm({fill:k[E],ae:l,stroke:k.Tb,Cg:l,qa:3}),q=this.za();this.tH(a,b,c,d,e,f,g,k,l,q);this.tH(a,b,c,d,e,f,g,k,n,q);return q.a()}return this.sH(a,b,c,d,e,f,g,k,n)}; T.sH=function(a,b,c,d,e,f,g,k,l){d=this.Ra(Es);g=bK(0,k[uc],g);g=cK(g[y],g.end,oE);g-=0.15*k[uc];g=new kK(0,g);g[sy](qj(e));c=new kK(b,c);c.add(g);b=c.x;c=c.y;d[p](this.pN[Cb](a));switch(f){case nI:d[v](DI,nI);break;case pD:d[v](DI,xG);break;case oE:d[v](DI,oE)}d[v](lJ,b);d[v](Jh,c);d[v](oua,k.Va);d[v](qua,k[uc]||0);k[Ed]&&d[v](EE,UC);k.Ic&&d[v](DE,uF);k.De&&d[v](pAa,TI);0!=e&&d[v](xh,IH+e+ne+b+ne+c+Ge);this.Ri(d,l);return d}; T.tH=function(a,b,c,d,e,f,g,k,l,n){a=this.sH(a,b,c,d,e,f,g,k,l);this[p](n,a);return a};T.oZ=function(){return this.Ra(Cg)};T.cE=function(a,b,c){var d=eK(),e=this.Ra(gsa);c?(c=this.Ra(kE),c[v](SD,b[G]+b[r]/2),c[v](TD,b.top+b[A]/2),c[v](MH,b[r]/2),c[v](NH,b[A]/2)):(c=this.Ra(vH),c[v](lJ,b[G]),c[v](Jh,b.top),c[v](Ih,b[r]),c[v](Hg,b[A]));e[p](c);e[v](kF,d);this.$o[p](e);a=a.a();b=O;lk&&(b=ca[tc][Ic][pc](qe)[0]);a[v](fsa,dBa+b+qe+d+Ge);return a};T.Zc=function(a,b,c){a[C](sf+b+Je+c)}; T.va=function(a,b,c){a[C](rf+b+Je+c)};T.Cq=function(a,b,c,d,e,f,g){a[C](qB+b+Je+c+Je+d+Je+e+Je+f+Je+g)};T.vi=function(a){a[C](Vf)};T.rm=function(a,b,c,d,e,f,g,k){f=oj(f,360);g=oj(g,360);var l=rj(g-90,d),n=sj(g-90,e);f=k?g-f:f-g;0>f&&(f+=360);a[C](df+d+Je+e+ema+(180<f?1:0)+Je+(k?1:0)+Je+h[t](1E5*(b+l))/1E5+Je+h[t](1E5*(c+n))/1E5)};T.em=function(a,b,c){a[v](xh,UAa+b+Ke+c+Ge)};T.sl=function(a,b){a[v](Ih,b)};T.Ex=function(a,b){a[v](Hg,b)};T.jQ=function(a,b){a[v](lJ,b)};T.kQ=function(a,b){a[v](Jh,b)}; T.dd=function(a,b,c){a[v](wI,c);b&&a[v](uI,b)};T.hC=function(a,b){var c=this.fC;ra(c[Sb],a);var d=c[x];Ew(d,b.Va);Ja(d,b[uc]+S);Qw(d,b[Ed]?UC:O);Xw(d,b.Ic?uF:O);Ra(d,Dr);var e=c[Gd],c=c[Wd];Ra(d,R);return new xk(e,c)};T.i0=function(){if(null!=this.Uu)return this.Uu;var a=Tk(Q);$a(a[x],Ixa);var b=Tk(Q);Nl(b,ena,ena);a[p](b);fa[Pd][p](a);b=a[zb]-a[Gd];Zk(a);return this.Uu=b};T.Ra=function(a){return this.pN[ny](gF,a)}; T.Ri=function(a,b){Vm(b)?(a[v](uI,b.Qd),a[v](wI,b.Hb),Vm(b)&&1<=b.Ai?a[Pc](vI):a[v](vI,b.Ai),b.Hk!=ph?a[v](eAa,gCa(b.Hk,b.Hb)):a[Pc](eAa)):(a[v](uI,R),a[v](wI,0));Xm(b)?a[Pc](AE):a[v](AE,b.Oe);var c=b.mA;di(c)&&a[v](MH,c);c=b.nA;di(c)&&a[v](NH,c);var d=b.Qg;if(d){var e=$n(d,1)[hc](),c=this.SX[e];if(!c){c=eK();this.SX[e]=c;var e=this.Ra(Nwa),f=d.x1,g=d.hb,k=d.y1,l=d.kb,n=d.lg,q=d.Tf,s=d.Wy||1,u=d.Xy||1,w=d.sv?uxa:WI;e[v](kF,c);e[v](mJ,f);e[v](oJ,k);e[v](nJ,g);e[v](pJ,l);e[v](Xua,w);f=tI+n+yna+s;q= tI+q+yna+u;u=this.Ra(sI);u[v](PG,PA);u[v](sh,f);e[p](u);d.uK&&(d=this.Ra(sI),d[v](PG,gna),d[v](sh,f),e[p](d),d=this.Ra(sI),d[v](PG,ina),d[v](sh,q),e[p](d));d=this.Ra(sI);d[v](PG,QA);d[v](sh,q);e[p](d);this.$o[p](e)}a[v](zE,VI+c+Ge)}else if(null!=b.fe){e=b.fe;c=e.Ge+iC+e.Hd()+iC+e.qr();if(!(c in this.qO)){d=null;switch(e.Ge){case pH:d=this.Ra(dh);d[v](Qxa,WI);d[v](lJ,Oe);d[v](Jh,Oe);d[v](Ih,YA);d[v](Hg,YA);d[v](dJ,$ma);q=this.Ra(vH);q[v](lJ,Oe);q[v](Jh,Oe);q[v](Ih,YA);q[v](Hg,YA);q[v](zE,e.qr());d[p](q); q=this.Ra(Cg);q[v](uI,e.Hd());q[v](fAa,jI);e=this.Ra(JF);e[v](mJ,UA);e[v](oJ,Oe);e[v](nJ,YA);e[v](pJ,UA);e[v](wI,UA);q[p](e);e=this.Ra(JF);e[v](mJ,Oe);e[v](oJ,UA);e[v](nJ,UA);e[v](pJ,YA);e[v](wI,UA);q[p](e);d[p](q);break;case dza:d=this.Ra(dh),d[v](Qxa,WI),d[v](lJ,Oe),d[v](Jh,Oe),d[v](Ih,ZA),d[v](Hg,ZA),d[v](dJ,$ma),q=this.Ra(vH),q[v](lJ,Oe),q[v](Jh,Oe),q[v](Ih,YA),q[v](Hg,YA),q[v](zE,e.qr()),d[p](q),q=this.Ra(Cg),q[v](uI,e.Hd()),q[v](fAa,jI),e=this.Ra(JF),e[v](mJ,UA),e[v](oJ,Oe),e[v](nJ,Oe),e[v](pJ, UA),e[v](wI,UA),q[p](e),e=this.Ra(JF),e[v](mJ,YA),e[v](oJ,UA),e[v](nJ,UA),e[v](pJ,YA),e[v](wI,UA),q[p](e),d[p](q)}e=eK();d[v](kF,e);this.$o[p](d);this.qO[c]=e}c=this.qO[c];a[v](zE,VI+c+Ge)}else a[v](zE,b.gb());null!=b.VW&&(d=b.getShadow(),e=$n(d,1)[hc](),c=this.D8[e],c||(c=eK(),this.D8[e]=c,e=this.Ra(xg),e[v](kF,c),q=this.Ra(cua),q[v](mF,rpa),q[v](bAa,d[bz]),e[p](q),q=this.Ra(eua),q[v](Hta,d.dia||0),q[v](Ita,d.eia||0),e[p](q),null!=d[Kd]&&(q=this.Ra(aua),u=this.Ra(bua),u[v](Ah,MF),u[v](Xza,d[Kd]), q[p](u),e[p](q)),d=this.Ra(dua),q=this.Ra(tE),d[p](q),q=this.Ra(tE),q[v](mF,spa),d[p](q),e[p](d),this.$o[p](e)),a[v](xg,VI+c+Ge))};function gCa(a,b){if(Yh(a))return a[ie](Je);switch(a){case ph:return Oe;case UD:return String(4*b)+Je+String(b);default:return gCa(ph,b)}};function uK(a,b){hK[L](this,a,b);this.ru=null}X(uK,hK);T=uK[K];T.qP=function(a,b){pa(this,a);Sa(this,b);var c=this.Vd(Q);this.tj(c,-5E4,-5E4,this[r]+1E5,this[A]+1E5);this.lb[p](c);var d=this.za(),e=d.a();kw(e,OA);ax(e,a+ne+b);e[x].top=5E4;Ya(e[x],5E4);c[p](e);return d};T.J2=function(){for(var a=this.Cs.a(),b=a[Xb],c=b[J];1<c;)a[Qd](b[0]),c--};Va(T,function(a){return h[D](a)});T.Uv=function(a,b,c,d){var e=this.Vd(ZI),f=2*c;this.tj(e,a-c,b-c,f,f);this.Ri(e,d,!1);return e}; T.I2=function(a,b,c,d,e){var f=this.Vd(ZI);this.tj(f,a-c,b-d,2*c,2*d);this.Ri(f,e,!1);return f};T.Ak=function(a,b,c,d,e){var f=this.Vd(jBa),g=Xm(e)&&1<=d&&1<=c&&null==e.Qg;this.Ri(f,e,g);if(Vm(e)||g)c=h.max(c-1,0),d=h.max(d-1,0);this.tj(f,a,b,c,d);return f};T.pZ=function(a,b,c,d,e,f,g){b=Rk(Q,{style:nva+c+kya+(f?SH:Ig)+xna+(g?SH:Ig)+Ana+b+rH});b=new XJ(b);if(Zh(a))for(c=0,d=a[J];c<d;c++)this[p](b,a[c]);else this[p](b,a);return{append:[b.a()],w6:[]}}; T.f_=function(a,b){for(var c=this.Vd(aJ),d=this.Vd($I);0<a[J]&&ki(Ai(a),sf);)a=$i(a,0,a[J]-1);d[v](Ch,a[ie](O));this.tj(c,0,0,this[r],this[A]);c[p](d);this.Ri(c,b,!1);return c};T.qt=function(a,b,c,d,e,f,g){b=bK(b,d,e);c=bK(c,g[uc],f);f=pD;c=cK(c[y],c.end,f);return this.nJ(a,b[y],c,b.end,c,e,f,g)}; T.nJ=function(a,b,c,d,e,f,g,k){var l=new Rm({fill:k[E]});if(k[E]&&k[E]!=R&&k.Tb&&k.Tb!=R){var n=new Rm({fill:k[E],stroke:k.Tb,qa:2}),q=this.za();this.tH(a,b,c,d,e,f,g,k,n,q);this.tH(a,b,c,d,e,f,g,k,l,q);return q.a()}return this.sH(a,b,c,d,e,f,g,k,l)};T.Jp=function(a,b,c,d,e,f,g,k){e=qj(e);d=bK(b,d,f);b=new kK(b,c);var l=new kK(d[y],c),l=l.o().w0(b)[sy](e).add(b);c=new kK(d.end,c);c=c.o().w0(b)[sy](e).add(b);return this.nJ(a,l.x,l.y,c.x,c.y,f,g,k)}; T.sH=function(a,b,c,d,e,f,g,k,l){var n=this.Vd(aJ);this.tj(n,0,0,this[r],this[A]);g!=pD&&(g=bK(0,k[uc],g),g=cK(g[y],g.end,pD),g=new kK(0,g),g[sy](qj(tj(b,c,d,e))),c=new kK(b,c),e=new kK(d,e),c.add(g),e.add(g),b=c.x,c=c.y,d=e.x,e=e.y);b=h[D](b);c=h[D](c);d=h[D](d);e=h[D](e);g=this.Vd($I);g[v](Ch,sf+b+Je+c+rf+d+Je+e+mf);g[v](FI,zh);b=this.Vd(lBa);b[v](ah,zh);d=b[x];Ja(d,k[uc]||O);Ew(d,k.Va||O);switch(f){case nI:d[v](XI,Qg);break;case pD:d[v](XI,pD);break;case oE:d[v](XI,zs)}k[Ed]&&Qw(d,UC);k.Ic&&Xw(d, uF);b[v](rh,a);n[p](g);n[p](b);this.Ri(n,l,!1);return n};T.tH=function(a,b,c,d,e,f,g,k,l,n){a=this.sH(a,b,c,d,e,f,g,k,l);this[p](n,a);return a};T.oZ=function(){var a=this.Vd(iBa);this.tj(a,0,0,this[r],this[A]);return a};T.cE=function(a,b){var c=this.Vd(Q),d=[this.Rb(5E4+b.top),this.Rb(5E4+b[G]+b[r]),this.Rb(5E4+b.top+b[A]),this.Rb(5E4+b[G])];c[x].clip=oya+d[ie](Ke)+Ge;this.tj(c,0,0,this[r]+1E5,this[A]+1E5);a.a();d=new XJ(c);this[p](d,a);this.rb(1,1,1,1,new Rm({fill:Hh}),d);return c}; T.Zc=function(a,b,c){a[C](sf+h[D](b)+Je+h[D](c))};T.va=function(a,b,c){a[C](rf+h[D](b)+Je+h[D](c))};T.Cq=function(a,b,c,d,e,f,g){a[C](qB+h[D](b)+Je+h[D](c)+Je+h[D](d)+Je+h[D](e)+Je+h[D](f)+Je+h[D](g))};T.vi=function(a){a[C](hC)}; T.rm=function(a,b,c,d,e,f,g,k){f=oj(f,360);g=oj(g,360);var l=h[D](rj(f-90,d)),n=h[D](sj(f-90,e)),q=h[D](rj(g-90,d)),s=h[D](sj(g-90,e));d=h[D](d);e=h[D](e);b=h[D](b);c=h[D](c);l===q&&n===s&&(k&&180>oj(g-f,360)||!k&&180>oj(f-g,360))||a[C]((k?Ipa:lB)+(b-d)+Je+(c-e)+Je+(b+d)+Je+(c+e)+Je+(b+l)+Je+(c+n)+Je+(b+q)+Je+(c+s))};T.em=function(a,b,c){a[x].top=this.Rb(c);Ya(a[x],this.Rb(b))};T.sl=function(a,b){pa(a[x],this.Rb(b))};T.Ex=function(a,b){Sa(a[x],this.Rb(b))};T.jQ=function(a,b){Ya(a[x],this.Rb(b))}; T.kQ=function(a,b){a[x].top=this.Rb(b)};T.dd=function(a,b,c){0==c?Vv(a,!1):(Vv(a,!0),b&&Iw(a,b),dw(a,c))};T.hC=function(a,b){var c=this.fC;ra(c[Sb],a);var d=c[x];Ew(d,b.Va);Ja(d,this.Rb(b[uc]||0));Qw(d,b[Ed]?UC:O);Xw(d,b.Ic?uF:O);Ra(d,Dr);var e=c[Gd],c=c[Wd];Ra(d,R);b[Ed]&&(e*=1.1);b.Ic&&(e*=0.9);return new xk(e,c)};T.i0=function(){if(null!=this.Uu)return this.Uu;var a=Rk(Q,{style:zBa});this.fC[p](a);Ra(this.fC[x],Dr);this.Uu=a[zb]-a[Gd];Ra(this.fC[x],R);Zk(a);return this.Uu}; T.Rb=function(a){return h[D](a)+S};T.Vd=function(a){return this.pN[Qb](a)}; T.Ri=function(a,b,c){for(var d=a[td],e=0;e<d[J];e++)a[td][e][Nc]!=zE&&a[td][e][Nc]!=uI||a[Qd](d[e]);c=null!=c?c:!0;if(Vm(b)){if(Vv(a,!0),dw(a,b.Hb),Iw(a,b.Qd),c=!(Vm(b)&&1<=b.Ai),d=b.Hk!=ph,c||d)e=this.Vd(kBa),c&&mb(e,String(h[D](100*b.Ai))+we),d&&(e.dashstyle=hCa(b.Hk)),a[p](e)}else c&&Xm(b)?(Vv(a,!0),dw(a,1),Iw(a,b.gb())):Vv(a,!1);Qh(a.filled)&&Rv(a,!0);c=b.Qg;if(null!=c){b=this.Vd(YI);b[v](KD,c.lg);b[v](jsa,c.Tf);b[v](bh,c.Wy||1);b[v](Axa,c.Xy||1);var d=c.x1,e=c.y1,f=c.hb;c=c.kb;typeof d==rh&& (d=la(d,10));typeof e==rh&&(e=la(e,10));typeof f==rh&&(f=la(f,10));typeof c==rh&&(c=la(c,10));c=tj(d,e,f,c);c=oj(270-c,360);b[v](xqa,c);b[v](Ah,PE);a[p](b)}else b.fe?(c=b.fe,b=this.Vd(YI),b[v](Ah,dh),b[v](KD,c.Hd()),b[v](jsa,c.qr()),c=Wn()+Zma+c.Ge+Oma,b[v](kI,c),a[p](b)):b.gb()==R?Rv(a,!1):Xm(b)?Wv(a,b.gb()):(c=this.Vd(YI),mb(c,String(h[D](100*b.Oe))+we),Xa(c,b.gb()),a[p](c))};T.tj=function(a,b,c,d,e){a=a[x];Ea(a,cg);Ya(a,this.Rb(b));a.top=this.Rb(c);pa(a,this.Rb(d));Sa(a,this.Rb(e))};T.qB=function(){return!0}; function hCa(a){if(Yh(a))return a[ie](ne);switch(a){case ph:return ph;case UD:return Dza;default:return hCa(ph)}};function vK(a,b,c,d){if(!(kk?0<=vi(pk,hna):lk?0<=vi(pk,ana):jk?0<=vi(pk,ona):mk&&0<=vi(pk,fna)))throw m("Graphics is not supported");for(var e=h[t](1E5*h[Cc]());ca[rz][poa+e];)e++;this.ak=poa+e;(a=this.m=a)&&(a.referencepoint=!0);Wa(this.m,O);this.Dp=b;this.hm=Ek(this.m);this.CX=this.ym=null;this.tr=!1;this.hO=[];this.si=null;this.mma=(b=kk?null!=fa[be]?9>fa[be]:!qk(We):!1)?uK:tK;if(this.fO=b||d)d=this.hm[Qb](lF),eb(d,this.ak),d.id=this.ak,pa(d,this.Dp[r][hc]()),Sa(d,this.Dp[A][hc]()),Aw(d,0),Lw(d, LG),sw(d,0),gw(d,0),d.allowTransparency=zh,b||ab(d,Hva),this.hm[p](this.m,d),d=d[Nz]||d[dy][Hd],d[oq](),a=[],b?(a[C](Kna),a[C](iB),a[C](jB)):(a[C](Ena),a[C](Lna),a[C](mla),a[C](nla),a[C](iB)),a[C](Sna),a[C](uBa),a[C](zua),a[C](gla),a[C](Mh),a[C](Dna),a[C](fB),a[C](Fna),a[C](kla),a[C](bf),a[C](Ina),a[C](dB),a[C](gB),d[Cx](a[ie](me)),d[vy]();iCa(this,c)}X(vK,Us);function iCa(a,b){var c=W(a.Dra,a),d=W(a.Era,a);wK(c,d,b)}T=vK[K]; T.Era=function(){if(this.fO){var a;a=(a=this.hm.a(this.ak))?a[Nz]||a[dy][Hd]:null;var b=this.ym=a[gd](xya);b&&(b.referencepoint=!0);this.CX=xK(a[Pd],this.Dp)}else this.ym=this.hm[Qb](Q),zl(this.ym,eh,gh),Nl(this.ym,this.Dp),this.ym.dir=QF,this.m[p](this.ym),this.CX=xK(this.m,this.Dp);this.tr=!0};function xK(a,b){var c=Ek(a),d=c[Qb](Q),e=d[x];Ra(e,R);Ea(e,cg);e.top=b[A]+10+S;Ya(e,b[r]+10+S);cw(e,NG);e=c.$b();c[p](d,e[Cb](ne));c[p](a,d);return d} T.Dra=function(){if(!this.fO)return!0;var a;return(a=(a=this.hm.a(this.ak))?a[dy]||Qk(a[Nz]||a[dy][Hd]):null)&&a._loaded};T.eb=function(a){if(!this.tr)return null;for(a=null!=a?a:0;this.hO[J]<=a;){var b=Ek(this.ym)[Qb](Q);zl(b,eh,cg);Dl(b,0,0);Nl(b,QA,QA);this.ym[p](b);b=new this.mma(b,this.CX);Vs(this,b);this.hO[C](b)}return this.hO[a]};T.Av=function(){if(!this.tr)return null;if(!this.si){var a;a=this.hm[Qb](Q);this.si=new sK(a);this.hm[p](this.m,this.si.ac())}return this.si}; T.Io=function(a,b){wK(W(function(){return null!=this.ym},this),a,b)};dx(T,function(a,b){if(!yk(this.Dp,a))if(this.Dp=a,this.fO){var c=this.hm.a(this.ak);c&&(pa(c,this.Dp[r][hc]()),Sa(c,this.Dp[A][hc]()))}else this.tr&&Nl(this.ym,this.Dp);this.tr||iCa(this,b)});function wK(a,b,c,d){a[L]()?b[L]():jCa(a,b,c,d)}function jCa(a,b,c,d){var e=null!=d?d:10;ca[Yp](c(function(){wK(a,b,c,e)}),e)}T.w=function(){this.hm.cd(this.m);Ws(this.si);Y(this.hO,function(a){Ws(a)});vK.e.w[L](this)};function yK(){this.Yc=[]}T=yK[K];T.qj=function(a,b){this.Yc[C]({brush:a,JX:b})};Gw(T,function(a,b){this.qj(null,ZJ(a,b))});T.Z=function(a,b,c){this.qj(a,{type:JF,data:{x:b,y:c}})};T.Zj=function(a,b,c,d,e,f,g){this.qj(a,{type:QD,data:{x1:b,y1:c,hb:d,kb:e,x:f,y:g}})};T.Wf=function(a,b,c,d,e,f,g,k){this.qj(a,{type:AC,data:{WA:b,XA:c,ji:d,ki:e,ew:f,Rq:g,c$:k}})};mw(T,function(a){var b=this.Yc[0].JX[Z];this.Z(a,b.x,b.y)}); function kCa(a){switch(a[H]){case HG:case JF:case QD:return a=a[Z],new sk(a.x,a.y);case AC:a=a[Z];var b=oj(a.Rq,360);return new sk(a.WA+rj(b-90,a.ji),a.XA+sj(b-90,a.ki));default:return new sk(0,0)}} T.tc=function(a){for(var b=[],c=null,d=0;d<this.Yc[J];d++){var e=this.Yc[d],f=e.JX;if(f[H]==HG)c=kCa(f);else{t:{for(var e=e.brush,g=0;g<b[J];g++){var k=b[g];if(cfa(e,k.brush)){e=k;break t}}k={brush:e,Yc:new YJ,Gh:null};b[C](k);e=k}tk(e.Gh,c)||e.Yc[Yy](c.x,c.y);e.Yc.qj(f);c=e.Gh=kCa(f)}}if(Si(b))a=null;else if(1==b[J])a=a.tc(b[0].Yc,b[0].brush);else{c=a.za();for(d=0;d<b[J];d++)f=b[d],f=a.tc(f.Yc,f.brush),a[p](c,f);a=c.a()}return a}; function lCa(a){for(var b=new YJ,c=0;c<a.Yc[J];c++)b.qj(a.Yc[c].JX);return b};function mCa(a,b){var c=new YJ,d=a.Yc;if(0==d[J]||1==d[J])return c;for(var e=[null],f=0;f<d[J];f++){var g=d[f];g[Z]&&e[C](new sk(g[Z].x,g[Z].y))}e[C](null);var g=d[d[J]-1][H]==HD,f=e[1].o(),k=e[2].o(),l=e[e[J]-3].o(),n=e[e[J]-2].o();g?(e[0]=n,e[e[J]-1]=f):tk(f,n)?(e[0]=l,e[e[J]-1]=k):(e[0]=jK(new iK(f.x,f.y,k.x,k.y),-1),e[e[J]-1]=jK(new iK(n.x,n.y,l.x,l.y),-1));for(var k=0>b,q=null,s=null,n=null,l=e[J]-2,f=0;f<=l;f++)if(!tk(e[f],e[f+1])){var u;u=e[f];var w=e[f+1],z,B=(w.y-u.y)/(w.x-u.x);z=na(B)?{kl:B, no:u.y-B*u.x}:{kl:ea,no:u.x};B=z.kl;z=z.no;if(B==ea)u={kl:ea,no:0>w.y-u.y?z+b:z-b};else{var F=b*h[ud](1+B*B);u={kl:B,no:0<w.x-u.x?z+F:z-F}}q?(w=zK(q,u),ai(w)?(B=zK(AK(s,e[f]),q),z=zK(AK(e[f],s),q),B=Bm(new zm(B.x,z.x),w.x)&&Bm(new zm(B.y,z.y),w.y)):B=w==ea,q=B&&w!=ea?w:zK(AK(e[f],s),q),c.qj(nCa(n,q)),B||(n=zK(AK(e[f],e[f+1]),u),c.Wf(e[f].x,e[f].y,h.abs(b),h.abs(b),180-180*h[sd](q.x-e[f].x,q.y-e[f].y)/h.PI,180-180*h[sd](n.x-e[f].x,n.y-e[f].y)/h.PI,k)),q=u,s=e[f],n=d[f]):(q=u,s=e[f],n=ZJ(d[f].x,d[f].y))}g&& c[vy]();return c}function nCa(a,b){var c=Qj(a);switch(a[H]){case HG:case JF:c[Z].x=b.x;c[Z].y=b.y;break;case QD:c[Z].x=b.x;c[Z].y=b.y;var d=b.x-a[Z].x,e=b.y-a[Z].y;c[Z].x1+=d;c[Z].y1+=e;c[Z].hb+=d;c[Z].kb+=e}return c}function AK(a,b){var c=(a.x-b.x)/(b.y-a.y),d;na(c)?d=a.y-c*a.x:(c=ea,d=a.x);return{kl:c,no:d}} function zK(a,b){var c=a.kl,d=a.no,e=b.kl,f=b.no;na(c)||(c=ea);na(e)||(e=ea);if(c==e||1E-5>=h.abs(c-e))return d==f||1E-5>=h.abs(d-f)?ea:null;if(c==ea)return new sk(d,e*d+f);if(e==ea)return new sk(f,c*f+d);var g=e-c;return new sk(-(f-d)/g,(d*e-c*f)/g)};var BK=function(){function a(a,b){if(-1===b[ld](Me))return b;var c=a[pc](Tq);c.pop();var d=b[pc](Tq),l=d.pop();if(d[0]===Me)d[he][Mc](d,[0,1][Ab](c));else{for(var n=0,q=d[J];n<q;n++)if(d[n]===Rq)c.pop(),d[he](n,1),n--;else break;d=c[Ab](d)}d[C](l);return d[ie](Tq)}function b(b,c,g){for(var k=[],l=0,n=c[J];l<n;l++)k[C](d[a(b,c[l])]);d[b]=g[Mc](this,k)}var c,d={};b(sH,[],function(){function a(b,c){if(!b||b.x1>=b.hb||b.y1>=b.kb)throw"Error constructing QuadTree: invalid bounds given.";this.v4=c||0;this.bounds= b;this.nodes=ha(4);this.Tz=!1;bw(this,[])}function b(a,c){if(this.Tz){var d=this.KU(c);b[L](this[ry][d],a,c)}a[C][Mc](a,this[cy]);return a}kb(a,{insert:function(a){var b=a.Nk();if(this.Tz){var c=this.KU(b),c=this[ry][c],d=c[Sp];b.x1>=d.x1&&b.hb<=d.hb&&b.y1>=d.y1&&b.kb<=d.kb?c[wx](a):this[cy][C](a)}else if(this[cy][C](a),4>this.v4&&4<this[cy][J]){this[pc]();a=0;for(b=this[cy][J];a<b;a++)this[wx](this[cy][a]);bw(this,this[cy][J]>b?this[cy][he](b,this[cy][J]-b):[])}},clear:function(){bw(this,[]);if(this.Tz){for(var a= 0,b=this[ry][J];a<b;a++)this[ry][a][Wb]();delete this[ry];this.nodes=ha(4);this.Tz=!1}},query:function(a){return b[L](this,[],a)},KU:function(a){var b=!(a.y1>(this[Sp].y1+this[Sp].kb)/2),c=0;a.x1>(this[Sp].x1+this[Sp].hb)/2?c=b?1:2:b||(c=3);return c},split:function(){var b=(this[Sp].hb-this[Sp].x1)/2,c=(this[Sp].kb-this[Sp].y1)/2,d=this[Sp].x1,f=this[Sp].y1,q=this.v4+1;this[ry][0]=new a({x1:d,y1:f,hb:d+b,kb:f+c},q);this[ry][1]=new a({x1:d+b,y1:f,hb:d+b+b,kb:f+c},q);this[ry][2]=new a({x1:d+b,y1:f+ c,hb:d+b+b,kb:f+c+c},q);this[ry][3]=new a({x1:d,y1:f+c,hb:d+b,kb:f+c+c},q);this.Tz=!0},remove:function(a){var b=this[cy][ld](a);return 0<=b?(this[cy][he](b,1),!0):this.Tz?!this[ry][ce](function(b){return!b[Ob](a)}):!1}});return a});b(FD,[],function(){function a(){}function b(c){kb(a,c);return new a}function c(a){return function(){throw'abstract method "'+a+'" not implemented.';}}var d={};d.Vq=da[Up]||b;d.Bfa=c;d.vfa=function(a){for(var b=[Ata,Bta,Cta,Dta,Eta,Fta,uya,aAa,esa],d,e=0,f=b[J];e<f;e++)d= b[e],a[K][d]=c(d)};return d});b(BH,[FD],function(a){function b(a,c,d){this.V=c;this.Oa=d}a.vfa(b);return b});b(tza,[FD],function(a){function b(a){this.DL={click:[],mousemove:[],mouseenter:[],mouseleave:[],box:[],redraw:[],remove:[]};ow(this,null);this.xa=null;yw(this,null);this.children=null;this.Ge=a||{}}function c(a){if(!this.DL[vc](a))throw'event type "'+a+'" unknown.';}ra(b[K],function(a){return void 0!==a?(this.xa=a,this):this.xa});lw(b[K],function(a,b){if(void 0!==b){var c=this.Ge,d;d=a[pc](Me); for(var e=0,f=d[J];e<f;e++)if(e<f-1){if(typeof c[d[e]]!==$g||null==c[d[e]])c[d[e]]={};c=c[d[e]]}else c[d[e]]=b;this[Dy](yH,[this]);return this}c=this.Ge;if(null!=a)for(d=a[pc](Me),e=0,f=d[J];e<f&&typeof c===$g&&null!=c;e++)c=c[d[e]];return c});b[K].l=function(a,b){c[L](this,a);this.DL[a][C](b);return this};b[K].uc=function(a,b){c[L](this,a);for(var d=this.DL[a],e=0,f=d[J];e<f;e++)if(d[e]===b)return delete d[e],!0;return!1};b[K].Nk=function(){if(!this[Dy](aD,[this])||null==this.Of)if(!this.Rz()||null== this.Of)throw"cannot determine bounding box until inserted into a scene.";return this.Of};b[K].Rz=function(){return!1};b[K].fireEvent=function(a,b){c[L](this,a);for(var d=this.DL[a],e=0,f=d[J];e<f;e++)d[e][Mc](this,b);return 0<f};b[K].o=a.Bfa(hsa);return b});b(wza,[FA,FD],function(a,b){function c(b,f){a[L](this,f);this.ng=b||[];this.OU=d[Zb](this)}function d(){this[Dy](yH,[this])}kb(c,b.Vq(a[K]));Ia(c[K],c);c.xh=Doa;c[K].add=function(a){this.ng[C](a);a.l(yH,this.OU);this[Dy](yH,[this]);return this}; wa(c[K],function(){for(var a=0,b=this.ng[J];a<b;a++)this.ng[a].uc(yH,this.OU),this[Dy](AH,[this.ng[a]]);this.ng=[];this[Dy](yH,[this]);return this});va(c[K],function(a){a.uc(yH,this.OU);var b=this.ng[ld](a);if(0>b)throw"Shape does not exist.";this.ng[he](b,1);this[Dy](AH,[a]);return this});c[K].NU=function(){return this.ng};return c});b(uza,[FA,FD],function(a,b){function c(b,d,f,g){g=g||{};g.r=null==b?g.r:b;g.x=null==d?g.x:d;g.y=null==f?g.y:f;a[L](this,g)}kb(c,b.Vq(a[K]));Ia(c[K],c);c.xh=foa;c[K].Rz= function(){var a=this[x](fh),b=this[x](lJ),c=this[x](Jh);this.Of={x:b-a,y:c-a,width:2*a,height:2*a};return!0};return c});b(vza,[FA,FD],function(a,b){function c(b,d,f,g,s){s=s||{};s.rx=null==b?s.rx:b;s.ry=null==d?s.ry:d;s.x=null==f?s.x:f;s.y=null==g?s.y:g;a[L](this,s)}kb(c,b.Vq(a[K]));Ia(c[K],c);c.xh=roa;c[K].Rz=function(){var a=this[x](MH),b=this[x](NH),c=this[x](lJ),d=this[x](Jh);this.Of={x:c-a,y:d-b,width:2*a,height:2*b};return!0};return c});b(xza,[FA,FD],function(a,b){function c(b,d,f,g,s){s=s|| {};s.x1=null==b?s.x1:b;s.y1=null==d?s.y1:d;s.x2=null==f?s.x2:f;s.y2=null==g?s.y2:g;a[L](this,s)}kb(c,b.Vq(a[K]));Ia(c[K],c);c.xh=PB;c[K].Rz=function(){var a=this[x](mJ),b=this[x](oJ),c=this[x](nJ),d=this[x](pJ);this.Of={x:h.min(a,c),y:h.min(b,d),width:h.abs(c-a),height:h.abs(d-b)};return!0};return c});b(nG,[],function(){function a(b,c){var d=b%c;return 0>d*c?d+c:d}function b(c,d,f){c=a(c,360);d=a(d,360);d<c&&(d+=360);f=a(f,360);f<c&&(f+=360);return f<=d}return{EL:a,yfa:function(c,d,l,n,q,s,u){q=a(q, 360);s=a(s,360);var w=q/180*h.PI,z=q/180*h.PI,B=c+l*h.cos(w),w=d+n*h.sin(w),F=c+l*h.cos(z),z=d+n*h.sin(z);u||(u=q,q=s,s=u);u=b(q,s,0)?c+l:h.max(B,F);var M=b(q,s,90)?d+n:h.max(w,z);c=b(q,s,180)?c-l:h.min(B,F);d=b(q,s,270)?d-n:h.min(w,z);return{x1:c,y1:d,hb:u,kb:M}},zfa:function(a,b,c,d){function e(q){var w=1-q,z=w*w,B=q*q,F=z*w,z=3*q*z,w=3*w*B;q*=B;f[C](a.x*F+b.x*z+c.x*w+d.x*q);u[C](a.y*F+b.y*z+c.y*w+d.y*q)}var f=[a.x,d.x],u=[a.y,d.y],w=2*a.x-4*b.x+2*c.x,z=b.x-a.x,B=-a.x+3*b.x+d.x-3*c.x,F=(-w+h[ud](w* w-4*z*B))/(2*B),w=(-w-h[ud](w*w-4*z*B))/(2*B);h.abs(F)>SA&&(F=0.5);h.abs(w)>SA&&(w=0.5);0<F&&1>F&&e(F);0<w&&1>w&&e(w);w=2*a.y-4*b.y+2*c.y;z=b.y-a.y;B=-a.y+3*b.y+d.y-3*c.y;F=(-w+h[ud](w*w-4*z*B))/(2*B);w=(-w-h[ud](w*w-4*z*B))/(2*B);h.abs(F)>SA&&(F=0.5);h.abs(w)>SA&&(w=0.5);0<F&&1>F&&e(F);0<w&&1>w&&e(w);F={x1:h.min[Mc](h,f),y1:h.min[Mc](h,u),hb:h.max[Mc](h,f),kb:h.max[Mc](h,u)};pa(F,F.hb-F.x1);Sa(F,F.kb-F.y1);return F}}});b(yza,[FA,FD,nG],function(a,b,c){function d(b){a[L](this,b);this.Of={x1:null, y1:null,hb:null,kb:null,width:0,height:0};this.rt=[];this.Uz=null}function l(a){if(null==a)throw"Point cannot be null.";null==this.Of.x1&&(this.Of.x1=ea);null==this.Of.y1&&(this.Of.y1=ea);null==this.Of.hb&&(this.Of.hb=-ea);null==this.Of.kb&&(this.Of.kb=-ea);var b=h.min(this.Of.x1,a.x),c=h.min(this.Of.y1,a.y),d=h.max(this.Of.hb,a.x);a=h.max(this.Of.kb,a.y);this.Of={x1:b,y1:c,hb:d,kb:a,width:d-b,height:a-c}}function n(){var a=this.rt[this.rt[J]-1][pc](ne);switch(a[0]){case rf:l[L](this,this.Uz);l[L](this, {x:a[1],y:a[2]});break;case qB:a=c.zfa(this.Uz,{x:+a[1],y:+a[2]},{x:+a[3],y:+a[4]},{x:+a[5],y:+a[6]});l[L](this,{x:a.x1,y:a.y1});l[L](this,{x:a.hb,y:a.kb});break;case df:a=c.yfa(+a[1],+a[2],+a[3],+a[4],+a[5],+a[6],+a[7]);l[L](this,{x:a.x1,y:a.y1});l[L](this,{x:a.hb,y:a.kb});break;default:throw"unknown command.";}}kb(d,b.Vq(a[K]));Ia(d[K],d);d.xh=Yoa;d[K].Rz=function(){return!0};Gw(d[K],function(a,b){this.rt[C](Poa+a+ne+b);this.Uz={x:a,y:b};return this});d[K].line=function(a,b){this.rt[C](Noa+a+ne+ b);n[L](this);this.Uz={x:a,y:b};return this};d[K].arc=function(a,b,d,e,f,k,l){f=c.EL(f,360);k=c.EL(k,360);this.rt[C](Una+a+ne+b+ne+d+ne+e+ne+f+ne+k+ne+ia(l));n[L](this);this.Uz={x:a,y:b};return this};mw(d[K],function(){this.rt[C](Vf);this.Uz=null;return this});return d});b(zza,[FA,FD],function(a,b){function c(b,d,f,g,s){s=s||{};s.x=null==b?s.x:b;s.y=null==d?s.y:d;pa(s,null==f?s[r]:f);Sa(s,null==g?s[A]:g);a[L](this,s)}kb(c,b.Vq(a[K]));Ia(c[K],c);c.xh=fpa;c[K].Rz=function(){this.Of={x:this[x](lJ),y:this[x](Jh), width:this[x](Ih),height:this[x](Hg)};return!0};c[K].o=function(){return new c(this[x](lJ),this[x](Jh),this[x](Ih),this[x](Hg),this[x]())};return c});b(Bza,[FA,FD],function(a,b){function c(b,d,f,g){g=g||{};g.x=null==b?g.x:b;g.y=null==d?g.y:d;Bw(g,null==f?g[cd]:f);a[L](this,g)}kb(c,b.Vq(a[K]));Ia(c[K],c);c.xh=cC;return c});b(bI,[Ima,GA,HA,IA,JA,KA,MA],function(a,b,c,d,l,n,q){return{h4:a,Circle:b,pF:c,ot:d,rU:l,Xj:n,Nv:q}});b(Pya,[],function(){function a(e,q,s){var u=q[x](mza)||0,w=q[x](lza)||0;if(u|| w){var z=q[x](oza)||q[x](nza)||q[x](pza)||0,B=q[x](rza)||q[x](qza)||q[x](sza)||0,F=[u,w,z,B][ie](),M=q.iw;if(q=M?c[F]:b[F])N=q[Sd](kF);else{q=fa[ny](gF,xg);var N=mya+(M?l++:d++);q[v](kF,N);var P=fa[ny](gF,cua);P[v](mF,rpa);P[v](bAa,u);u=fa[ny](gF,eua);u[v](Hta,z);u[v](Ita,B);if(null!=w){var ba=fa[ny](gF,aua),U=fa[ny](gF,bua);U[v](Ah,MF);U[v](Xza,w)}var z=fa[ny](gF,dua),B=fa[ny](gF,tE),qa=fa[ny](gF,tE);qa[v](mF,spa);q[p](P);q[p](u);null!=w&&(ba[p](U),q[p](ba));z[p](B);z[p](qa);q[p](z);for(M?c[F]=q: b[F]=q;s[nd]!==xI;)s=s[fe];s=s[Pb]($D)||s;s[Eb](q,s[Sb])}e[v](xg,VI+N+Ge)}}var b={},c={},d=0,l=0;return{nta:a,Qz:function(b,c,d){var f=c[x](fua)||c[x](hua);typeof f!==rh&&typeof f!==Yg||b[v](zE,f);f=c[x](gua)||c[x](iua)||c[x](AE);typeof f!==rh&&typeof f!==Yg||b[v](AE,f);f=c[x](gAa)||c[x](jAa)||c[x](uI);typeof f!==rh&&typeof f!==Yg||b[v](uI,f);f=c[x](hAa)||c[x](kAa)||c[x](vI);typeof f!==rh&&typeof f!==Yg||b[v](vI,f);f=c[x](iAa)||c[x](lAa)||c[x](wI);typeof f!==rh&&typeof f!==Yg||b[v](wI,f);a(b,c,d)}, wfa:function(){for(var a in b)if(b[vc](a)){var c=b[a];c[fe][Qd](c);delete b[a]}d=0;b={}}}});b(Gya,[LA],function(a){function b(c,d,f){f=f||fa[ny](gF,ED);f[v](SD,c[x](lJ));f[v](TD,c[x](Jh));f[v](fh,c[x](fh));a.Qz(f,c,d);d&&d[p](f);return f}var c={};Ep(c,b);c.Mg=function(a,c,d){b(a,c,d);return[]};return c});b(Hya,[LA],function(a){function b(c,d,f){f=f||fa[ny](gF,kE);f[v](SD,c[x](lJ));f[v](TD,c[x](Jh));f[v](MH,c[x](MH));f[v](NH,c[x](NH));a.Qz(f,c,d);d&&d[p](f);return f}var c={};Ep(c,b);c.Mg=function(a, c,d){b(a,c,d);return[]};return c});b(Jya,[LA],function(a){function b(c,d,f){f=f||fa[ny](gF,JF);f[v](mJ,c[x](mJ));f[v](oJ,c[x](oJ));f[v](nJ,c[x](nJ));f[v](pJ,c[x](pJ));a.Qz(f,c,d);d&&d[p](f);return f}var c={};Ep(c,b);c.Mg=function(a,c,d){b(a,c,d);return[]};return c});b(Lya,[nG,LA],function(a,b){return{u4:function(c,d,l){for(var n=l||fa[ny](gF,aH),q=d.rt,s=[],u=0,w=q[J];u<w;u++){var z=q[u];if(z[0]===df){var B=z[pc](ne),F=+B[1],M=+B[2],z=+B[3],N=+B[4],P=a.EL(+B[5],360),ba=a.EL(+B[6],360),B=!!+B[7],F= F+h.cos(ba/180*h.PI)*z,M=M+h.sin(ba/180*h.PI)*N,P=B?ba-P:P-ba;0>P&&(P+=360);z=Una+z+ne+N+dla+ia(180<P)+ne+ia(B)+ne+F+ne+M}s[C](z)}l||n[v](ng,s[ie](ne));b.Qz(n,d,c);return n}}});b(Kya,[Jma,LA],function(a){function b(c,d,f){c=a.u4(d,c,f);d&&d[p](c);return c}var c={};Ep(c,b);c.Mg=function(a,c,d){b(a,c,d);return[]};return c});b(Aza,[JA],function(a){return{Afa:function(a){var b=a[x](Bsa)||0,c=a[x](Csa)||0,d=a[x](Dsa)||0,e=a[x](Esa)||0,q=a[x](vsa)||0,s=a[x](wsa)||0,u=a[x](xsa)||0;a=a[x](ysa)||0;return b|| c||d||e||q||s||u||a},xfa:function(b){var c=b[x](Bsa)||0,d=b[x](Csa)||0,l=b[x](Dsa)||0,n=b[x](Esa)||0,q=b[x](vsa)||0,s=b[x](wsa)||0,u=b[x](xsa)||0,w=b[x](ysa)||0,z=b[x](Ih),B=b[x](Hg),F=b[x](lJ),M=b[x](Jh),F=0<=z?F:F+z,M=0<=B?M:M+B,z=h.abs(z),B=h.abs(B);if(c+l>z)var N=z/(c+l),c=c*N,d=d*N,l=l*N,n=n*N;q+u>z&&(N=z/(q+u),q*=N,s*=N,u*=N,w*=N);d+s>B&&(N=B/(d+s),c*=N,d*=N,q*=N,s*=N);n+w>B&&(N=B/(n+w),l*=N,n*=N,u*=N,w*=N);return(new a(b[x]()))[Yy](F+z-l,M).arc(F+z-l,M+n,l,n,270,0,!0).line(F+z,M+B-w).arc(F+ z-u,M+B-w,u,w,0,90,!0).line(F+q,M+B).arc(F+q,M+B-s,q,s,90,180,!0).line(F,M+d).arc(F+c,M+d,c,d,180,270,!0)[vy]()}}});b(Mya,[Hma,Jma,LA],function(a,b,c){function d(k,l,s){var u=k[x](zsa),w=k[x](Asa),z=k[x](Ih),B=k[x](Hg),F=k[x](lJ),M=k[x](Jh),F=0<=z?F:F+z,M=0<=B?M:M+B,z=h.abs(z),B=h.abs(B);typeof u===Yg&&typeof w===Yg||!a.Afa(k)?(s=s||fa[ny](gF,vH),s[v](lJ,F),s[v](Jh,M),s[v](Ih,z),s[v](Hg,B),null!=u&&typeof u===Yg&&s[v](MH,u),null!=w&&typeof w===Yg&&s[v](NH,w),c.Qz(s,k,l)):(k=a.xfa(k),s=b.u4(l,k,s)); l&&l[p](s);return s}var l={};Ep(l,d);l.Mg=function(a,b,c){d(a,b,c);return[]};return l});b(Qya,[LA],function(a){function b(c,d,f,g,k,l){var B=f[x](rua)||f[x](tua)||f[x](GE),F=f[x](sua)||f[x](HE);g=g||fa[ny](gF,Es);g[v](lJ,null==k?f[x](lJ):k);g[v](Jh,null==l?f[x](Jh):l);g[v](sh,Ssa);g.textContent=d;a.Qz(g,f,c);typeof B===rh&&Ew(g[x],B);typeof F!==rh&&typeof F!==Yg||Ja(g[x],F);return g}function c(a,d,e,g,k){var l=null!=g;g=b(k,a,d,g,null,e);l||k[p](g);return g}function d(a,e,k){var l,w,z;z=a[x](Lwa)|| 0;var B=a[x](Es)[pc](me),F=a[x](Jh),M=[];k=k||fa[ny](gF,Cg);e&&e[p](k);for(var N=0,P=B[J];N<P;N++){var ba=B[N];l=a;w=F;var U=k,qa=l[x](Lwa)||0,ya=l[x](Ih)||ea,Ha=c(ba,l,w,null,U),Aa=Ha.getBBox();if(Aa[r]>ya){for(var Wc=b(U,zA,l,Ha,100,100).getBBox(),ba=ba[pc](ne),Aa=[],cb=0,kc=ba[J];cb<kc;cb++)Aa[C](b(U,ba[cb],l,Ha,null,0).getBBox());for(var kd=[],Mb=0,cb=0,kc=ba[J];cb<kc;cb++){var Oc;if(Oc=1<cb-Mb){for(var Vd=Oc=0,Tf=Mb,Uf=h.min(cb,Aa[J]);Tf<Uf;Tf++)Oc=h.max(Oc,Aa[Tf][A]),0<Tf&&(Vd+=Wc[r]),Vd+=Aa[Tf][r]; Oc=Vd>ya}Oc&&(kd[C]([Mb,cb]),Mb=cb)}0<cb-Mb&&kd[C]([Mb,cb]);Aa=null;ya=[];cb=0;for(kc=kd[J];cb<kc;cb++){Wc=kd[cb];Ha=c(ba[dd](Wc[0],Wc[1])[ie](ne),l,w,0===cb?Ha:null,U);Vd=Ha.getBBox();w+=qa+Vd[A];ya[C](Ha);if(null==Aa)Wc=Vd;else{var Tf=Aa.x,Mb=Aa.y,Wc=Aa[r]+Tf,Aa=Aa[A]+Mb,Ce=Vd.x,Uf=Vd.y;Oc=Vd[r]+Ce;Vd=Vd[A]+Uf;Tf=h.min(Tf,Ce);Mb=h.min(Mb,Uf);Wc=h.max(Wc,Oc);Aa=h.max(Aa,Vd);Wc={x:Tf,y:Mb,width:Wc-Tf,height:Aa-Mb}}Aa=Wc}l=ya}else l=[Ha];w=Aa;U=0;for(qa=l[J];U<qa;U++)M[C](l[U]);F+=w[A]+z}z=k===e?M[0]: k;e&&e[p](z);e=h.max(0,h.min(1,a[x](WE)||0));if(ga(e)||!na(e))e=0;B=a[x](bJ);if(typeof B===Yg){if(B=h.max(0,h.min(1,B)),ga(B)||!na(B))B=0}else B=LC;F=z.getBBox();k=a[x](Jh)-F.y;N=M[M[J]-1].getBBox().y-F.y;P=0;for(l=M[J];P<l;P++){w=M[P];U=w.getBBox();w[v](lJ,a[x](lJ)-U[r]*e);U=U.y;if(typeof B===Yg)U+=2*k,U-=F[A]*B;else if(B===LC)U=U+k-N;else throw"Unrecognized valign value: "+B;w[v](Jh,U)}M=a[x](Zya);null!=M&&0!=M&&z[v](xh,IH+M+ne+a[x](lJ)+ne+a[x](Jh)+Ge);return z}var l={};Ep(l,d);l.Mg=function(a, b,c){for(;c&&c[Sb];)c[Qd](c[Sb]);d(a,b,c);return[]};return l});b(Iya,[GA,HA,IA,JA,KA,MA],function(a,b,c,d,l,n){var q={draw:function(a,b){var c=fa[ny](gF,Cg),d=[c];b[p](c);for(var e=a.ng,f=0,g=e[J];f<g;f++){var k=e[f];d[C](s[k[rc].xh][Nq](k,c))}return d},Mg:function(a){return a.ng}},s={Circle:a,Ellipse:b,Line:c,Path:d,Rect:l,Text:n,Group:q};return q});b(Nya,[bI,Ima,GA,HA,IA,JA,KA,MA],function(a,b,c,d,l,n,q,s){var u={};u[a.h4.xh]=b;u[a[Cz].xh]=c;u[a.pF.xh]=d;u[a.ot.xh]=l;u[a.rU.xh]=n;u[a.Xj.xh]=q;u[a.Nv.xh]= s;return u});b(Oya,[sH,BH,FD,bI,Kma,LA],function(a,b,c,d,l,n){function q(c,d,g){b[L](this,c,d,g);var k=this.svg=fa[ny](gF,xI);k[v](Ih,d);k[v](Hg,g);F[L]({svg:c,Wq:{clear:function(){}}});k[p](fa[ny](gF,$D));c[p](k);c=u[Zb](this);k[Fq](Fr,c);k[Fq](EG,c);k[Fq](qxa,c);k[Fq](rxa,c);this.Wq=new a({x1:0,y1:0,hb:d,kb:g});this.st=[];this.elements=[]}function s(a){var b=this.st[ld](a);if(0>b)return!1;a.iw||(this[Wx][b][fe][Qd](this[Wx][b]),this.Wq[Ob](a));this.st[he](b,1);this[Wx][he](b,1);return!0}function u(a){for(var b= {x1:a[lq],y1:a[mq],hb:a[lq],kb:a[mq]},c=[],d=a[Mq];d!==this.svg;)c[C](d),d=d[fe];for(var d=this.Wq.query(b),e=0,f=d[J];e<f;e++){var g=d[e];if(!(0>c[ld](B[L](this,g)))){g[Dy](a[H],[{point:{x:b.x1,y:b.y1}}]);break}}}function w(a){for(a=[a];0<a[J];){var b=a.pop(),c=b[rc].xh,d=B[L](this,b);a=a[Ab](l[c].Mg(b,this.svg,d)||[])}}function z(a){if(a[rc].xh!==Yoa){if(a.iw){var b;if(!this.w4){b=this.w4=fa[Qb](Q);Ea(b[x],cg);b[x].top=hma;Ya(b[x],hma);cw(b[x],NG);var c=fa[ny](gF,xI);b[p](c);fa[Pd][p](b)}b=this.w4; Ra(b[x],Dr);c=l[a[rc].xh][Nq](a,b[Sb])}else c=B[L](this,a);var d=c.getBBox();a.Of={width:d[r],height:d[A],x:d.x,y:d.y};a.iw&&(Ra(b[x],R),c[wd][Qd](c))}}function B(a){a=this.st[ld](a);return 0>a?null:this[Wx][a]}function F(){for(var a=this.svg,b;a[Sb];)a[Sb][Nc]===$D&&(b=!0),a[Qd](a[Sb]);b&&a[p](fa[ny](gF,$D));this.st=[];this.elements=[];this.Wq[Wb]();n.wfa()}kb(q,c.Vq(b[K]));Ia(q[K],q);q[K].Rs=function(a){var b=B[L](this,a);if(b)return a[Dy](yH,[a]),a;var b=l[a[rc].xh][Nq](a,this.svg),b=[][Ab](b), c=[a];for(a.NU&&(c=c[Ab](a.ng));0<c[J];){var d=c[rb](),e=b[rb]();if(d.NU&&e[rb])var f=e[rb](),b=b[Ab](e),c=c[Ab](d.ng),e=f;f=this.st[ld](d);if(0<=f){if(null!=this[Wx][f]||!d.iw)throw"Shape exists and is not a staged shape.";d.iw=!1;this[Wx][f]=e}else this.st[C](d),this[Wx][C](e);d.l(aD,z[Zb](this));d.l(yH,w[Zb](this));d.l(AH,s[Zb](this));this.Wq[wx](d)}return a};q[K].Zd=function(a,b,c,e){a=new d[Cz](a,b,c,e);return this.Rs(a)};q[K].Nj=function(a,b,c,e,f){a=new d.pF(a,b,c,e,f);return this.Rs(a)};q[K].rb= function(a,b,c,e,f){a=new d.Xj(a,b,c,e,f);return this.Rs(a)};q[K].eK=function(a,b,c,e,f){a=new d.ot(a,b,c,e,f);return this.Rs(a)};q[K].Pd=function(a,b,c,e){c=new d.Nv(a,b,c,e);return this.Rs(c)};q[K].IU=s;q[K].Cfa=function(a){if(a.iw)throw m("can't stage a shape that's already staged.");if(-1!==this.st[ld](a))throw m("can't stage a shape that's already drawn.");a.iw=!0;this.st[C](a);this[Wx][C](null);a.l(aD,z[Zb](this))};wa(q[K],F);return q});b(zya,[],function(){return{draw:function(a,b){b[dz](); b.arc(a.x,a.y,a.lt,0,2*h.PI,!1);b[Oy]();b[fc]()},Sz:function(a,b){var c=a.x-b.x,d=a.y-b.y;return h[ud](c*c+d*d)<=a.lt}}});b(Aya,[],function(){return{draw:function(a,b){b[qy]();b[dz]();b[jz](a.x-a.ji,a.y-a.ki);b[Fy](a.ji,a.ki);b.arc(1,1,1,0,2*h.PI,!1);ew(b,yA);b[fc]();b[Gy]()},Sz:function(a,b){var c=(b.x-a.x)/a.ji,d=(b.y-a.y)/a.ki;return 1>=c*c+d*d}}});b(Bya,[],function(){return{draw:function(a,b){b[qy]();b[dz]();b[Xx](a.x1,a.y1);b[Ry](a.hb,a.kb);b[Oy]();Hw(b,iya);b[Yb]();b[Gy]()},Sz:function(a,b){var c= (a.y1-a.kb)/(a.x1-a.hb);return 0.5>h.abs(c*b.x+(a.y1-c*a.x1)-b.y)}}});b(Cya,[],function(){function a(b,c){c[dz]();for(var d=b.rt,e=0,n=d[J];e<n;e++){var q=d[e][pc](ne);switch(q[0]){case sf:c[Xx](q[1],q[2]);break;case rf:c[Ry](q[1],q[2]);break;case qB:c.bezierCurveTo(q[1],q[2],q[3],q[4],q[5],q[6]);break;case Vf:c[Oy]();return;default:throw'unknown path command "'+d[e]+'".';}}}return{draw:function(b,c){c[qy]();a(b,c);ew(c,bA);c[fc]();c[Gy]()},Sz:function(b,c){var d=fa[Qb](kD)[iz](VA);a(b,d);return d.isPointInPath(c.x, c.y)||d.ota(c.x,c.y)}}});b(Dya,[],function(){return{draw:function(a,b){b[qy]();b[dz]();b[zz](a.x,a.y,a[r],a[A]);ew(b,cA);b[fc]();b[Gy]()},Sz:function(a,b){return b.x>a.x&&b.x<a.x+a[r]&&b.y>a.y&&b.y<a.y+a[A]}}});b(Fya,[],function(){return{draw:function(a,b){b.font=cna;b[Ex](a.zq,a.x,a.y)},Sz:function(a,b){var c=a.Nk();return b.x>c.x&&b.x<c.x+c[r]&&b.y>c.y&&b.y<c.y+c[A]}}});b(Eya,[GA,HA,IA,JA,KA,MA],function(a,b,c,d,l,n){return{Circle:a,pF:b,ot:c,rU:d,Xj:l,Nv:n}});b(yya,[sH,BH,FD,bI,Kma],function(a, b,c,d,l){function n(c,d,g){b[L](this,c,d,g);var k=this.canvas=fa[Qb](kD);k[v](Ih,d);k[v](Hg,g);k[v](sh,Gma);c[p](k);this.hw=k[iz](VA);this.Wq=new a({x1:0,y1:0,hb:d,kb:g});this.all=[];c[Fq](Fr,s[Zb](this))}function q(a){this.all[C](a);a.l(aD,u[Zb](this));this.Wq[wx](a);return a}function s(a){var b={x:a[lq],y:a[mq]};a=[];for(var c=this.Wq.query({x1:b.x,y1:b.y,hb:b.x,kb:b.y}),d=0,e=c[J];d<e;d++){var f=c[d];l[f[rc][yd]].Sz(f,b)&&a[C](f)}if(a[J]){b=-1;c=a[0];d=0;for(e=a[J];d<e;d++)f=this.all[ld](a[d]), f>b&&(b=f,c=a[d]);c[Dy](Fr)}}function u(a){a[rc][yd]===cC&&(a.Of={width:this.hw.measureText(a.zq)[r],height:12,x:a.x,y:a.y})}kb(n,c.Vq(b[K]));Ia(n[K],n);n[K].Rs=function(a){l[a[rc][yd]][Nq](a,this.hw);return q[L](this,a)};n[K].Zd=function(a,b,c){a=new d[Cz](a,b,c);l[Cz][Nq](a,this.hw);return q[L](this,a)};n[K].Nj=function(a,b,c,e){a=new d.pF(a,b,c,e);l.pF[Nq](a,this.hw);return q[L](this,a)};n[K].rb=function(a,b,c,e){a=new d.Xj(a,b,c,e);l.Xj[Nq](a,this.hw);return q[L](this,a)};n[K].eK=function(a,b, c,e){a=new d.ot(a,b,c,e);l.ot[Nq](a,this.hw);return q[L](this,a)};n[K].IU=function(a){var b=this.all[ld](a);if(0>b)return!1;this.Wq[Ob](a);this.all[he](b,1);pa(this.canvas,this.canvas[r]);a=0;for(b=this.all[J];a<b;a++){var c=this.all[a];c&&l[c[rc][yd]][Nq](c,this.hw)}return!0};return n});b(bza,[Oya,yya,bI],function(a,b,d){function k(c,k,u,w){var z;u===xI?z=a:u===kD&&(z=b);n.G=z;n.Gg=d;n.X3=l;return new z(w,c,k)}function l(a){return function(b,c){var e=new d.Nv(0,0,b,c);a.Cfa(e);var f=e.Nk();a.IU(e); delete f.x;delete f.y;return f}}var n=c=function(a,b,c,d,e){var f=function(){return this}(),g,l=!1;e&&e.fonts&&f.WebFont?WebFont[fd]({custom:{families:e.fonts},active:function(){g&&g(k(a,b,c,d))},fontinactive:function(){throw m("one or more fonts could not be loaded.");}}):l=!0;return{then:function(e){if(l)f[Yp](e[Zb](f,k(a,b,c,d)),0);else g=e}}};n.Gg=d});return c}();function CK(a,b,c,d){var e=this;(new BK(b[r]||0,b[A]||0,xI,a,d?{fonts:[XB,YB]}:void 0))[Az](function(a){e.Aw=a;e.Aw.vf=BK.Ac=BK.X3(e.Aw);e.ym={}})}X(CK,vK);T=CK[K];T.eb=function(){return this.Aw};T.Av=function(){return{}};T.Io=function(a,b){CK.e.Io[L](this,a,b)};dx(T,function(){});T.w=function(){};function DK(a,b,c,d,e){this.eg=!!b;a&&this[Lz](a,d);$v(this,void 0!=e?e:this.rk||0);this.eg&&$v(this,-1*this[Zx]);this.lS=!c}X(DK,zj);T=DK[K];xw(T,null);T.rk=0;T.a1=!1;bx(T,function(a,b,c){xw(this,a);a&&(this.rk=di(b)?b:1!=this[Ly][ed]?0:this.eg?-1:1);di(c)&&$v(this,c)});T.TP=function(a){xw(this,a[Ly]);this.rk=a.rk;$v(this,a[Zx]);this.eg=a.eg;this.lS=a.lS};T.o=function(){return new DK(this[Ly],this.eg,!this.lS,this.rk,this[Zx])}; Ga(T,function(){var a;if(this.a1){if(!this[Ly]||this.lS&&0==this[Zx])throw yj;a=this[Ly];var b=this.eg?-1:1;if(this.rk==b){var c=this.eg?a[yc]:a[Sb];c?this[Lz](c):this[Lz](a,-1*b)}else(c=this.eg?a[gc]:a[ac])?this[Lz](c):this[Lz](a[fe],-1*b);$v(this,this[Zx]+this.rk*(this.eg?-1:1))}else this.a1=!0;a=this[Ly];if(!this[Ly])throw yj;return a});Za(T,function(a){return a[Ly]==this[Ly]&&(!this[Ly]||a.rk==this.rk)}); T.splice=function(a){var b=this[Ly],c=this.eg?1:-1;this.rk==c&&(this.rk=-1*c,$v(this,this[Zx]+this.rk*(this.eg?-1:1)));this.eg=!this.eg;DK[K][oc][L](this);this.eg=!this.eg;for(var c=Zh(arguments[0])?arguments[0]:arguments,d=c[J]-1;0<=d;d--)Yk(c[d],b);Zk(b)};function EK(){}EK[K].vba=function(){return!1};EK[K].$b=function(){return Gk(kk?this.ac():this.Si())};EK[K].xB=function(){return Qk(this.$b())};EK[K].containsNode=function(a,b){return this.uC(oCa(a),b)};function pCa(a,b){DK[L](this,a,b,!0)}X(pCa,DK);function FK(a,b,c,d,e){var f;a&&(this.Nd=a,this.Md=b,this.qd=c,this.Ld=d,1==a[ed]&&a[Nc]!=ef&&(a=a[Xb],(b=a[b])?(this.Nd=b,this.Md=0):(a[J]&&(this.Nd=Ai(a)),f=!0)),1==c[ed]&&((this.qd=c[Xb][d])?this.Ld=0:this.qd=c));DK[L](this,e?this.qd:this.Nd,e,!0);if(f)try{this[oc]()}catch(g){if(g!=yj)throw g;}}X(FK,pCa);T=FK[K];T.Nd=null;T.qd=null;T.Md=0;T.Ld=0;T.Si=function(){return this.Nd};T.tl=function(){return this.qd};T.xma=function(){return this.a1&&this[Ly]==this.qd&&(!this.Ld||1!=this.rk)}; Ga(T,function(){if(this.xma())throw yj;return FK.e[oc][L](this)});T.TP=function(a){this.Nd=a.Nd;this.qd=a.qd;this.Md=a.Md;this.Ld=a.Ld;this.Vn=a.Vn;FK.e.TP[L](this,a)};T.o=function(){var a=new FK(this.Nd,this.Md,this.qd,this.Ld,this.Vn);a.TP(this);return a};function GK(){}GK[K].uC=function(a,b){var c=b&&!a[Py](),d=a.Sa;try{return c?0<=this.Gm(d,0,1)&&0>=this.Gm(d,1,0):0<=this.Gm(d,0,0)&&0>=this.Gm(d,1,1)}catch(e){if(!kk)throw e;return!1}};GK[K].containsNode=function(a,b){return this.uC(HK(a),b)};GK[K].fs=function(){return new FK(this.Si(),this.Em(),this.tl(),this.bo())};function IK(a){this.Sa=a}X(IK,GK);function JK(a){var b=Gk(a)[od]();if(3==a[ed])b[sz](a,0),b[zx](a,a[J]);else if(KK(a)){for(var c,d=a;(c=d[Sb])&&KK(c);)d=c;b[sz](d,0);for(d=a;(c=d[yc])&&KK(c);)d=c;b[zx](d,1==d[ed]?d[Xb][J]:d[J])}else c=a[fe],a=Ci(c[Xb],a),b[sz](c,a),b[zx](c,a+1);return b}function LK(a,b,c,d){var e=Gk(a)[od]();e[sz](a,b);e[zx](c,d);return e}T=IK[K];T.o=function(){return new this[rc](this.Sa.cloneRange())};T.ac=function(){return this.Sa.commonAncestorContainer};T.Si=function(){return this.Sa.startContainer}; T.Em=function(){return this.Sa.startOffset};T.tl=function(){return this.Sa.endContainer};T.bo=function(){return this.Sa.endOffset};T.Gm=function(a,b,c){return this.Sa.compareBoundaryPoints(1==c?1==b?Ph[Vc].START_TO_START:Ph[Vc].START_TO_END:1==b?Ph[Vc].END_TO_START:Ph[Vc].END_TO_END,a)};T.isCollapsed=function(){return this.Sa[vx]};T.Mu=function(){return this.Sa[hc]()};Xv(T,function(a){var b=Qk(Gk(this.Si()));this.EI(b[wz](),a)});T.EI=function(a){a.removeAllRanges();a.addRange(this.Sa)};Tv(T,function(a){this.Sa[tb](a)});function MK(a){this.Sa=a}X(MK,IK);MK[K].EI=function(a,b){if(!b||this[Py]())MK.e.EI[L](this,a,b);else a[tb](this.tl(),this.bo()),a[sx](this.Si(),this.Em())};function NK(a,b){this.Sa=a;this.wj=b}X(NK,GK);function OK(a){var b=Gk(a)[Pd].createTextRange();if(1==a[ed])b[ty](a),KK(a)&&!a[Xb][J]&&b[tb](!1);else{for(var c=0,d=a;d=d[gc];){var e=d[ed];if(3==e)c+=d[J];else if(1==e){b[ty](d);break}}d||b[ty](a[fe]);b[tb](!d);c&&b[Yy](rD,c);b[Hz](rD,a[J])}return b}T=NK[K];T.ms=null;T.Nd=null;T.qd=null;T.Md=-1;T.Ld=-1;T.o=function(){var a=new NK(this.Sa[ey](),this.wj);a.ms=this.ms;a.Nd=this.Nd;a.qd=this.qd;return a}; T.ac=function(){if(!this.ms){var a=this.Sa[cd],b=this.Sa[ey](),c=a[vb](/ +$/,O);(c=a[J]-c[J])&&b[Hz](rD,-c);c=b[wd]();b=b.htmlText[vb](/(\r\n|\r|\n)+/g,ne)[J];if(this[Py]()&&0<b)return this.ms=c;for(;b>c.outerHTML[vb](/(\r\n|\r|\n)+/g,ne)[J];)c=c[fe];for(;1==c[Xb][J]&&c.innerText==qCa(c[Sb])&&KK(c[Sb]);)c=c[Sb];0==a[J]&&(c=rCa(this,c));this.ms=c}return this.ms}; function rCa(a,b){for(var c=b[Xb],d=0,e=c[J];d<e;d++){var f=c[d];if(KK(f)){var g=OK(f),k=g.htmlText!=f.outerHTML;if(a[Py]()&&k?0<=a.Gm(g,1,1)&&0>=a.Gm(g,1,0):a.Sa[qx](g))return rCa(a,f)}}return b}T.Si=function(){this.Nd||(this.Nd=PK(this,1),this[Py]()&&(this.qd=this.Nd));return this.Nd};T.Em=function(){0>this.Md&&(this.Md=this.WC(1),this[Py]()&&(this.Ld=this.Md));return this.Md};T.tl=function(){if(this[Py]())return this.Si();this.qd||(this.qd=PK(this,0));return this.qd}; T.bo=function(){if(this[Py]())return this.Em();0>this.Ld&&(this.Ld=this.WC(0),this[Py]()&&(this.Md=this.Ld));return this.Ld};T.Gm=function(a,b,c){return this.Sa[Jz]((1==b?aC:MB)+dC+(1==c?aC:MB),a)}; function PK(a,b,c){c=c||a.ac();if(!c||!c[Sb])return c;for(var d=1==b,e=0,f=c[Xb][J];e<f;e++){var g=d?e:f-e-1,k=c[Xb][g],l;try{l=HK(k)}catch(n){continue}var q=l.Sa;if(a[Py]())if(!KK(k)){if(0==a.Gm(q,1,1)){a.Md=a.Ld=g;break}}else{if(l.uC(a))return PK(a,b,k)}else{if(a.uC(l)){if(!KK(k)){d?a.Md=g:a.Ld=g+1;break}return PK(a,b,k)}if(0>a.Gm(q,1,0)&&0<a.Gm(q,0,1))return PK(a,b,k)}}return c} T.WC=function(a,b){var c=1==a,d=b||(c?this.Si():this.tl());if(1==d[ed]){for(var d=d[Xb],e=d[J],f=c?1:-1,g=c?0:e-1;0<=g&&g<e;g+=f){var k=d[g];if(!KK(k)&&0==this.Sa[Jz]((1==a?aC:MB)+dC+(1==a?aC:MB),HK(k).Sa))return c?g:g+1}return-1==g?0:g}e=this.Sa[ey]();f=OK(d);e.setEndPoint(c?soa:vpa,f);e=e[cd][J];return c?d[J]-e:e};function qCa(a){return 3==a[ed]?a[Yc]:a.innerText}T.isCollapsed=function(){return 0==this.Sa[Jz](upa,this.Sa)};T.Mu=function(){return this.Sa[cd]};Xv(T,function(){this.Sa[Gx]()}); Tv(T,function(a){this.Sa[tb](a);a?(this.qd=this.Nd,this.Ld=this.Md):(this.Nd=this.qd,this.Md=this.Ld)});function QK(a){this.Sa=a}X(QK,IK);QK[K].EI=function(a){a[tb](this.Si(),this.Em());this.tl()==this.Si()&&this.bo()==this.Em()||a[sx](this.tl(),this.bo());0==a.rangeCount&&a.addRange(this.Sa)};function RK(a){this.Sa=a}X(RK,IK);RK[K].Gm=function(a,b,c){return qk(Vq)?RK.e.Gm[L](this,a,b,c):this.Sa.compareBoundaryPoints(1==c?1==b?Ph[Vc].START_TO_START:Ph[Vc].END_TO_START:1==b?Ph[Vc].START_TO_END:Ph[Vc].END_TO_END,a)};RK[K].EI=function(a,b){a.removeAllRanges();b?a.setBaseAndExtent(this.tl(),this.bo(),this.Si(),this.Em()):a.setBaseAndExtent(this.Si(),this.Em(),this.tl(),this.bo())};function HK(a){if(kk&&!rk(9)){var b=new NK(OK(a),Gk(a));if(KK(a)){for(var c,d=a;(c=d[Sb])&&KK(c);)d=c;b.Nd=d;b.Md=0;for(d=a;(c=d[yc])&&KK(c);)d=c;b.qd=d;b.Ld=1==d[ed]?d[Xb][J]:d[J];b.ms=a}else b.Nd=b.qd=b.ms=a[fe],b.Md=Ci(b.ms[Xb],a),b.Ld=b.Md+1;a=b}else a=mk?new RK(JK(a)):lk?new MK(JK(a)):jk?new QK(JK(a)):new IK(JK(a));return a}function KK(a){return Uk(a)||3==a[ed]};function SK(){}X(SK,EK);T=SK[K];T.$x=null;T.Nd=null;T.Md=null;T.qd=null;T.Ld=null;T.Vn=!1;T.o=function(){var a=new SK;a.$x=this.$x;a.Nd=this.Nd;a.Md=this.Md;a.qd=this.qd;a.Ld=this.Ld;a.Vn=this.Vn;return a};T.Vb=function(){return Es}; function TK(a){var b;if(!(b=a.$x)){b=a.Si();var c=a.Em(),d=a.tl(),e=a.bo();if(kk&&!rk(9)){var f=b,g=c,k=d,l=e,n=!1;1==f[ed]&&(g=f[Xb][g],n=!g,f=g||f[yc]||f,g=0);var q=OK(f);g&&q[Yy](rD,g);if(f==k&&g==l)q[tb](!0);else n&&q[tb](!1),n=!1,1==k[ed]&&(k=(g=k[Xb][l])||k[yc]||k,l=0,n=!g),f=OK(k),f[tb](!n),l&&f[Hz](rD,l),q.setEndPoint(soa,f);l=new NK(q,Gk(b));l.Nd=b;l.Md=c;l.qd=d;l.Ld=e;b=l}else b=mk?new RK(LK(b,c,d,e)):lk?new MK(LK(b,c,d,e)):jk?new QK(LK(b,c,d,e)):new IK(LK(b,c,d,e));b=a.$x=b}return b} T.ac=function(){return TK(this).ac()};T.Si=function(){return this.Nd||(this.Nd=TK(this).Si())};T.Em=function(){return null!=this.Md?this.Md:this.Md=TK(this).Em()};T.tl=function(){return this.qd||(this.qd=TK(this).tl())};T.bo=function(){return null!=this.Ld?this.Ld:this.Ld=TK(this).bo()};T.vba=function(){return this.Vn};T.uC=function(a,b){var c=a.Vb();return c==Es?TK(this).uC(TK(a),b):c==lha?(c=a.j_(),(b?Mi:Ni)(c,function(a){return this.containsNode(a,b)},this)):!1};T.isCollapsed=function(){return TK(this)[Py]()}; T.Mu=function(){return TK(this).Mu()};T.fs=function(){return new FK(this.Si(),this.Em(),this.tl(),this.bo())};Xv(T,function(){TK(this)[Gx](this.Vn)});Tv(T,function(a){a=this.vba()?!a:a;this.$x&&this.$x[tb](a);a?(this.qd=this.Nd,this.Ld=this.Md):(this.Nd=this.qd,this.Md=this.Ld);this.Vn=!1});function oCa(a){a=HK(a);var b=new SK;b.$x=a;b.Vn=!1;return b}function sCa(a,b,c,d){if(a==c)return d<b;var e;if(1==a[ed]&&b)if(e=a[Xb][b])a=e,b=0;else if(dl(a,c))return!0;if(1==c[ed]&&d)if(e=c[Xb][d])c=e,d=0;else if(dl(c,a))return!1;return 0<(uea(a,c)||b-d)};function UK(){}Uh(UK);UK[K].hqa=0;function VK(a){rt[L](this);this.P=a||Ek();this.jo=tCa}X(VK,rt);VK[K].gqa=UK.Xb();var tCa=null;function uCa(a,b){switch(a){case 1:return b?dE:mE;case 2:return b?bF:UI;case 4:return b?rqa:Zsa;case 8:return b?As:aBa;case 16:return b?Yra:$Aa;case 32:return b?zg:TC;case 64:return b?Bxa:HD}throw m("Invalid component state");}T=VK[K];T.bc=null;T.yb=!1;T.q=null;T.jo=null;T.Uk=null;T.Kd=null;T.ie=null;T.un=null;T.K5=!1;Yw(T,function(){return this.bc||(this.bc=Xe+(this.gqa.hqa++)[hc](36))}); T.jw=function(a){this.Kd&&this.Kd.un&&(Lj(this.Kd.un,this.bc),Mj(this.Kd.un,a,this));this.bc=a};T.a=function(){return this.q};T.Kv=function(a){return this.q?this.P.Kv(a,this.q):null};T.hc=function(){this.Lw||(this.Lw=new sv(this));return this.Lw};function WK(a,b){if(a==b)throw m(Epa);if(b&&a.Kd&&a.bc&&a.Kd.ut(a.bc)&&a.Kd!=b)throw m(Epa);a.Kd=b;VK.e.Az[L](a,b)}T.getParent=function(){return this.Kd};T.Az=function(a){if(this.Kd&&this.Kd!=a)throw m("Method not supported");VK.e.Az[L](this,a)};T.ea=function(){return this.P}; T.h=function(){this.q=this.P[Qb](Q)};T.B=function(a){this.Hy(a)};T.Hy=function(a,b){if(this.yb)throw m(KB);this.q||this.h();a?a[Eb](this.q,b||null):this.P.$b()[Pd][p](this.q);this.Kd&&!this.Kd.yb||this.Bb()};T.Ia=function(a){if(this.yb)throw m(KB);if(a&&this.Ah(a)){this.K5=!0;var b=Gk(a);this.P&&this.P.$b()==b||(this.P=Ek(a));this.mf(a);this.Bb()}else throw m("Invalid element to decorate");};T.Ah=function(){return!0};T.mf=function(a){this.q=a}; T.Bb=function(){this.yb=!0;XK(this,function(a){!a.yb&&a.a()&&a.Bb()})};T.ve=function(){XK(this,function(a){a.yb&&a.ve()});this.Lw&&this.Lw.oc();this.yb=!1};T.w=function(){this.yb&&this.ve();this.Lw&&(this.Lw.W(),delete this.Lw);XK(this,function(a){a.W()});!this.K5&&this.q&&Zk(this.q);this.Kd=this.Uk=this.q=this.un=this.ie=null;VK.e.w[L](this)};function YK(a){return a.Uk}T.ua=function(a,b){this.qx(a,this.Zf(),b)}; T.qx=function(a,b,c){if(a.yb&&(c||!this.yb))throw m(KB);if(0>b||b>this.Zf())throw m("Child component index out of bounds");this.un&&this.ie||(this.un={},this.ie=[]);if(a[mx]()==this){var d=a[Fz]();this.un[d]=a;Wi(this.ie,a)}else Mj(this.un,a[Fz](),a);WK(a,this);Ui(this.ie,a,b);a.yb&&this.yb&&a[mx]()==this?(c=this.$a(),c[Eb](a.a(),c[Xb][b]||null)):c?(this.q||this.h(),b=this.ff(b+1),a.Hy(this.$a(),b?b.q:null)):this.yb&&!a.yb&&a.q&&a.q[fe]&&1==a.q[fe][ed]&&a.Bb()};T.$a=function(){return this.q}; T.Lg=function(){null==this.jo&&(this.jo=Kl(this.yb?this.q:this.P.$b()[Pd]));return this.jo};T.rv=function(a){if(this.yb)throw m(KB);this.jo=a};T.Zf=function(){return this.ie?this.ie[J]:0};T.ut=function(a){return this.un&&a?Nj(this.un,a)||null:null};T.ff=function(a){return this.ie?this.ie[a]||null:null};function XK(a,b,c){a.ie&&Y(a.ie,b,c)}function ZK(a,b){return a.ie&&b?Ci(a.ie,b):-1} T.removeChild=function(a,b){if(a){var c=bi(a)?a:a[Fz]();a=this.ut(c);c&&a&&(Lj(this.un,c),Wi(this.ie,a),b&&(a.ve(),a.q&&Zk(a.q)),WK(a,null))}if(!a)throw m("Child is not in parent component");return a};function vCa(a,b){return a[Qd](a.ff(0),b)}T.cd=function(a){for(var b=[];this.ie&&0!=this.ie[J];)b[C](vCa(this,a));return b};var $K;function aL(a,b){b?a[v](ih,b):a[Pc](ih)}function bL(a,b,c){Zh(c)&&(c=c[ie](ne));var d=Jba+b;if(c===O||void 0==c)$K||($K={atomic:!1,autocomplete:R,dropeffect:R,haspopup:!1,live:OG,multiline:!1,multiselectable:!1,orientation:Eh,readonly:!1,relevant:sqa,required:!1,sort:R,busy:!1,disabled:!1,hidden:!1,invalid:wg}),c=$K,b in c?a[v](d,c[b]):a[Pc](d);else a[v](d,c)}function cL(a){a=a[Sd](DC);return null==a||void 0==a?O:String(a)};function dL(a){if(a[ox])return a[ox];a=a[Fd];return bi(a)&&a[Ib](/\S+/g)||[]}function wCa(a,b){lb(a,b)}function eL(a,b){return a[ox]?a[ox][Lc](b):Ri(dL(a),b)}function fL(a,b){a[ox]?a[ox].add(b):eL(a,b)||lb(a,a[Fd]+(0<a[Fd][J]?ne+b:b))}function gL(a,b){if(a[ox])Y(b,function(b){fL(a,b)});else{var c={};Y(dL(a),function(a){c[a]=!0});Y(b,function(a){c[a]=!0});lb(a,O);for(var d in c)lb(a,a[Fd]+(0<a[Fd][J]?ne+d:d))}} function hL(a,b){if(a[ox])a[ox][Ob](b);else eL(a,b)&&lb(a,Fi(dL(a),function(a){return a!=b})[ie](ne))}function iL(a,b){a[ox]?Y(b,function(b){hL(a,b)}):lb(a,Fi(dL(a),function(a){return!Ri(b,a)})[ie](ne))}function jL(a,b,c){c?fL(a,b):hL(a,b)};function kL(a,b,c){rt[L](this);Dp(this,a);this.handle=b||a;this.B0=c||new vl(ja,ja,ja,ja);this.of=Gk(a);this.C=new sv(this);Vs(this,this.C);kt(this[py],[QI,es],this.n8,!1,this)}X(kL,rt);var lL=kk||lk&&qk("1.9.3");T=kL[K];xp(T,0);yp(T,0);fp(T,0);gp(T,0);T.Qt=0;T.Tl=0;T.Nt=0;T.lr=0;T.qg=!0;T.Ep=!1;T.p9=0;T.zM=0;T.Gka=!1;T.nx=!1;T.wt=function(a){this.nx=a};T.hc=function(){return this.C};function mL(a,b){a.B0=b||new vl(ja,ja,ja,ja)}T.Ga=function(a){this.qg=a}; T.w=function(){kL.e.w[L](this);ot(this[py],[QI,es],this.n8,!1,this);this.C.oc();lL&&this.of.releaseCapture();Dp(this,null);this.handle=null};T.sG=function(){Qh(this.jo)||(this.jo=Kl(this[Mq]));return this.jo}; T.n8=function(a){var b=a[H]==es;if(!this.qg||this.Ep||b&&!bt(a))this[$](Jta);else{nL(a);if(0==this.p9)if(this[$](new oL(nI,this,a[zd],a[Ad],a)))this.Ep=!0,a[Hp]();else return;else a[Hp]();var b=this.of,c=b[dc],d=!lL;this.C.l(b,[RAa,EG],this.EK,d);this.C.l(b,[QAa,FG],this.zP,d);lL?(c.setCapture(!1),this.C.l(c,Swa,this.zP)):this.C.l(Qk(b),TC,this.zP);kk&&this.Gka&&this.C.l(b,zta,Ys);this.Ika&&this.C.l(this.Ika,SH,this.Hka,d);xp(this,this.Qt=a[zd]);yp(this,this.Tl=a[Ad]);fp(this,a[Gb]);gp(this,a[Hb]); this.Nt=this.nx?RBa(this[Mq]):this[Mq][Od];this.lr=this[Mq][Tc];this.kZ=ql(Ek(this.of));this.zM=hi()}};T.zP=function(a){this.C.oc();lL&&this.of.releaseCapture();if(this.Ep){nL(a);this.Ep=!1;var b=xCa(this,this.Nt),c=yCa(this,this.lr);this[$](new oL(oE,this,a[zd],a[Ad],a,b,c))}else this[$](Jta)};function nL(a){var b=a[H];b==QI||b==RAa?a[Fc](a.Ka[Fb][0],a[Dq]):b!=QAa&&b!=PAa||a[Fc](a.Ka.changedTouches[0],a[Dq])} T.EK=function(a){if(this.qg){nL(a);var b=(this.nx&&this.sG()?-1:1)*(a[zd]-this[zd]),c=a[Ad]-this[Ad];xp(this,a[zd]);yp(this,a[Ad]);fp(this,a[Gb]);gp(this,a[Hb]);if(!this.Ep){var d=this.Qt-this[zd],e=this.Tl-this[Ad];if(d*d+e*e>this.p9)if(this[$](new oL(nI,this,a[zd],a[Ad],a)))this.Ep=!0;else{this.Mj||this.zP(a);return}}c=zCa(this,b,c);b=c.x;c=c.y;this.Ep&&this[$](new oL(MC,this,a[zd],a[Ad],a,b,c))&&(ACa(this,a,b,c),a[Hp]())}}; function zCa(a,b,c){var d=ql(Ek(a.of));b+=d.x-a.kZ.x;c+=d.y-a.kZ.y;a.kZ=d;a.Nt+=b;a.lr+=c;b=xCa(a,a.Nt);a=yCa(a,a.lr);return new sk(b,a)}T.Hka=function(a){var b=zCa(this,0,0);xp(a,this[zd]);yp(a,this[Ad]);ACa(this,a,b.x,b.y)};function ACa(a,b,c,d){a.Jw(c,d);a[$](new oL(iE,a,b[zd],b[Ad],b,c,d))}function xCa(a,b){var c=a.B0,d=ga(c[G])?null:c[G],c=ga(c[r])?0:c[r];return h.min(null!=d?d+c:ea,h.max(null!=d?d:-ea,b))} function yCa(a,b){var c=a.B0,d=ga(c.top)?null:c.top,c=ga(c[A])?0:c[A];return h.min(null!=d?d+c:ea,h.max(null!=d?d:-ea,b))}T.Jw=function(a,b){this.nx&&this.sG()?Ta(this[Mq][x],a+S):Ya(this[Mq][x],a+S);this[Mq][x].top=b+S};function oL(a,b,c,d,e,f,g){Xs[L](this,a);xp(this,c);yp(this,d);this.xja=e;Ya(this,Qh(f)?f:b.Nt);this.top=Qh(g)?g:b.lr;this.XX=b}X(oL,Xs);function pL(a){rt[L](this);this.q=a;a=kk?Pr:TC;this.Dja=kt(this.q,kk?Or:zg,this,!kk);this.Eja=kt(this.q,a,this,!kk)}X(pL,rt);kp(pL[K],function(a){var b=new $s(a.Ka);ab(b,a[H]==Or||a[H]==zg?Or:Pr);this[$](b)});pL[K].w=function(){pL.e.w[L](this);pt(this.Dja);pt(this.Eja);delete this.q};function qL(a,b){VK[L](this,b);this.hla=!!a;this.$H=null}X(qL,VK);T=qL[K];T.dV=null;T.Rd=!1;T.Vk=null;T.Ii=null;T.Dn=null;T.QY=!1;T.$=function(){return eqa};T.xA=function(){return this.Vk};T.h=function(){qL.e.h[L](this);var a=this.a(),b=pi(this.$())[pc](ne);gL(a,b);gl(a,!0);Sl(a,!1);BCa(this);CCa(this)};function BCa(a){if(a.hla&&!a.Ii){var b;b=a.ea().h(lF,{frameborder:0,style:mra,src:Rva});a.Ii=b;lb(a.Ii,a.$()+jma);Sl(a.Ii,!1);Rl(a.Ii,0)}a.Vk||(a.Vk=a.ea().h(Q,a.$()+jma),Sl(a.Vk,!1))} function CCa(a){a.Dn||(a.Dn=a.ea()[Qb](Bs),Sl(a.Dn,!1),gl(a.Dn,!0),Ea(a.Dn[x],cg))}T.g9=function(){this.QY=!1};T.Ah=function(a){return!!a&&a[Nc]==kf};T.mf=function(a){qL.e.mf[L](this,a);a=pi(this.$())[pc](ne);gL(this.a(),a);BCa(this);CCa(this);Sl(this.a(),!1)};T.Bb=function(){this.Ii&&Xk(this.Ii,this.a());Xk(this.Vk,this.a());qL.e.Bb[L](this);Yk(this.Dn,this.a());this.dV=new pL(this.ea().$b());this.hc().l(this.dV,Or,this.Aga);rL(this,!1)}; T.ve=function(){this.O()&&this[hy](!1);Ws(this.dV);qL.e.ve[L](this);Zk(this.Ii);Zk(this.Vk);Zk(this.Dn)};fw(T,function(a){a!=this.Rd&&(this.Gw&&this.Gw[Hq](),this.KA&&this.KA[Hq](),this.Uw&&this.Uw[Hq](),this.lB&&this.lB[Hq](),this.yb&&rL(this,a),a?this.R0():this.lC())});function rL(a,b){for(var c=a.ea().$b()[Pd][Sb];c;c=c[ac])if(1==c[ed]){var d=c;b?bL(d,Ig,b):d[Pc](Zqa)}c=a.q;(d=!b)?bL(c,Ig,d):c[Pc](Zqa)}T.NM=function(a,b,c,d){this.Gw=a;this.Uw=b;this.KA=c;this.lB=d}; T.R0=function(){if(this[$](OC)){try{this.$H=this.ea().$b()[pb]}catch(a){}this.YY();this.Ie();this.hc().l(this.ea().xB(),CH,this.YY);DCa(this,!0);this[Fx]();this.Rd=!0;this.Gw&&this.KA?(nt(this.Gw,oE,this.kO,!1,this),this.KA[fz](),this.Gw[fz]()):this.kO()}}; T.lC=function(){if(this[$](NC)){this.hc().uc(this.ea().xB(),CH,this.YY);this.Rd=!1;this.Uw&&this.lB?(nt(this.Uw,oE,this.LO,!1,this),this.lB[fz](),this.Uw[fz]()):this.LO();try{var a=this.ea().$b()[Pd],b=this.ea().$b()[pb]||a;this.$H&&b==a&&this.$H!=a&&this.$H[Fx]()}catch(c){}this.$H=null}};function DCa(a,b){a.Ii&&Sl(a.Ii,b);a.Vk&&Sl(a.Vk,b);Sl(a.a(),b);Sl(a.Dn,b)}T.kO=function(){this[$](cI)};T.LO=function(){DCa(this,!1);this[$]($E)};T.O=function(){return this.Rd};T.focus=function(){this.mda()}; T.YY=function(){this.Ii&&Sl(this.Ii,!1);this.Vk&&Sl(this.Vk,!1);var a=this.ea().$b(),b=Pk(Qk(a)||ca||ca),c=h.max(b[r],h.max(a[Pd][Bc],a[dc][Bc])),a=h.max(b[A],h.max(a[Pd][Rb],a[dc][Rb]));this.Ii&&(Sl(this.Ii,!0),Nl(this.Ii,c,a));this.Vk&&(Sl(this.Vk,!0),Nl(this.Vk,c,a))};T.Ie=function(){var a=this.ea().$b(),b=Qk(a)||ca;if(Cl(this.a())==yg)var c=a=0;else c=ql(this.ea()),a=c.x,c=c.y;var d=Ol(this.a()),b=Pk(b||ca),a=h.max(a+b[r]/2-d[r]/2,0),c=h.max(c+b[A]/2-d[A]/2,0);Dl(this.a(),a,c);Dl(this.Dn,a,c)}; T.Aga=function(a){this.QY?this.g9():a[Mq]==this.Dn&&ut(this.mda,0,this)};T.mda=function(){try{kk&&this.ea().$b()[Pd][Fx](),this.a()[Fx]()}catch(a){}};T.w=function(){Ws(this.Gw);this.Gw=null;Ws(this.Uw);this.Uw=null;Ws(this.KA);this.KA=null;Ws(this.lB);this.lB=null;qL.e.w[L](this)};function sL(a,b,c){qL[L](this,b,c);this.hj=a||pxa;this.Mh=(new tL).Ti(uL,!0).Ti(vL,!1,!0)}X(sL,qL);T=sL[K];T.oka=!0;T.RD=!0;T.DD=!0;T.O5=!0;T.kL=0.5;T.Bf=O;T.ph=null;T.rj=null;T.gH=!1;T.$j=null;T.ej=null;T.lL=null;T.wi=null;T.ck=null;T.kh=null;T.bK="dialog";T.$=function(){return this.hj};T.setTitle=function(a){this.Bf=a;this.ej&&el(this.ej,a)};T.getTitle=function(){return this.Bf};Nw(T,function(a){this.ph=a=yJ(a,null);this.ck&&AJ(this.ck,a)});Ow(T,function(){return null!=this.ph?wJ(this.ph):O}); T.vv=function(){return this.bK};T.iea=function(a){this.bK=a};function wL(a){a.a()||a.B()}T.$a=function(){wL(this);return this.ck};function ECa(a){wL(a);return a.a()}T.xA=function(){wL(this);return sL.e.xA[L](this)};function xL(a,b){a.kL=b;if(a.a()){var c=a.xA();c&&Rl(c,a.kL)}}function yL(a,b){a.DD=b;if(a.yb){var c=a.ea(),d=a.xA(),e=a.Ii;b?(e&&c.FX(e,a.a()),c.FX(d,a.a())):(c[kq](e),c[kq](d))}a.O()&&rL(a,b)}T.getDraggable=function(){return this.O5}; function FCa(a,b){var c=pi(a.hj+Bma)[pc](ne);a.a()&&(b?gL(a.$j,c):iL(a.$j,c));if(b&&!a.rj){var d;d=new kL(a.a(),a.$j);a.rj=d;gL(a.$j,c);kt(a.rj,nI,a.NX,!1,a)}else!b&&a.rj&&(a.rj.W(),a.rj=null)} T.h=function(){sL.e.h[L](this);var a=this.a(),b=this.ea();this.$j=b.h(Q,this.hj+zma,this.ej=b.h(Bs,{className:this.hj+Cma,id:this[Fz]()},this.Bf),this.wi=b.h(Bs,this.hj+Ama));Vk(a,this.$j,this.ck=b.h(Q,this.hj+BA),this.kh=b.h(Q,this.hj+kma));aL(this.wi,eD);gl(this.wi,!0);bL(this.wi,zF,ioa);this.lL=this.ej.id;aL(a,this.vv());bL(a,CF,this.lL||O);this.ph&&AJ(this.ck,this.ph);Sl(this.wi,this.RD);this.Mh&&(a=this.Mh,a.q=this.kh,a.B());Sl(this.kh,!!this.Mh);xL(this,this.kL)}; T.mf=function(a){sL.e.mf[L](this,a);a=this.a();var b=this.hj+BA;this.ck=Ik(null,b,a)[0];this.ck||(this.ck=this.ea().h(Q,b),this.ph&&AJ(this.ck,this.ph),a[p](this.ck));var b=this.hj+zma,c=this.hj+Cma,d=this.hj+Ama;(this.$j=Ik(null,b,a)[0])?(this.ej=Ik(null,c,this.$j)[0],this.wi=Ik(null,d,this.$j)[0]):(this.$j=this.ea().h(Q,b),a[Eb](this.$j,this.ck));this.ej?(this.Bf=jl(this.ej),this.ej.id||(this.ej.id=this[Fz]())):(this.ej=Rk(Bs,{className:c,id:this[Fz]()}),this.$j[p](this.ej));this.lL=this.ej.id; bL(a,CF,this.lL||O);this.wi||(this.wi=this.ea().h(Bs,d),this.$j[p](this.wi));Sl(this.wi,this.RD);b=this.hj+kma;(this.kh=Ik(null,b,a)[0])?(this.Mh=new tL(this.ea()),this.Mh.Ia(this.kh)):(this.kh=this.ea().h(Q,b),a[p](this.kh),this.Mh&&(a=this.Mh,a.q=this.kh,a.B()),Sl(this.kh,!!this.Mh));xL(this,this.kL)}; T.Bb=function(){sL.e.Bb[L](this);this.hc().l(this.a(),wF,this.P5).l(this.a(),Xr,this.P5);this.hc().l(this.kh,Fr,this.$ga);FCa(this,this.O5);this.hc().l(this.wi,Fr,this.aha);var a=this.a();aL(a,this.vv());this.ej.id!==O&&bL(a,CF,this.ej.id);this.DD||yL(this,!1)};T.ve=function(){this.O()&&this[hy](!1);FCa(this,!1);sL.e.ve[L](this)};fw(T,function(a){a!=this.O()&&(this.yb||this.B(),sL.e[hy][L](this,a))});T.kO=function(){sL.e.kO[L](this);this[$](tC)}; T.LO=function(){sL.e.LO[L](this);this[$](sC);this.gH&&this.W()};T.NX=function(){var a=this.ea().$b(),b=Pk(Qk(a)||ca||ca),c=h.max(a[Pd][Bc],b[r]),a=h.max(a[Pd][Rb],b[A]),d=Ol(this.a());Cl(this.a())==yg?mL(this.rj,new vl(0,0,h.max(0,b[r]-d[r]),h.max(0,b[A]-d[A]))):mL(this.rj,new vl(0,0,c-d[r],a-d[A]))};T.aha=function(){zL(this)};function zL(a){if(a.RD){var b=a.Mh,c=b&&b.OY;if(c)b=b.get(c),a[$](new AL(c,b))&&a[hy](!1);else a[hy](!1)}}T.YS=function(a){this.gH=a};T.w=function(){this.kh=this.wi=null;sL.e.w[L](this)}; T.$ga=function(a){t:{for(a=a[Mq];null!=a&&a!=this.kh;){if(a[Nc]==ff)break t;a=a[fe]}a=null}if(a&&!a[Nd]){a=a[yd];var b=this.Mh.get(a);this[$](new AL(a,b))&&this[hy](!1)}}; T.P5=function(a){var b=!1,c=!1,d=this.Mh,e=a[Mq];if(a[H]==wF)if(this.oka&&27==a[Np]){var f=d&&d.OY,e=e[Nc]==Ef&&!e[Nd];f&&!e?(c=!0,b=d.get(f),b=this[$](new AL(f,b))):e||(b=!0)}else{if(9==a[Np]&&a[Oq]&&e==this.a()){this.QY=!0;try{this.Dn[Fx]()}catch(g){}ut(this.g9,0,this)}}else if(13==a[Np]){if(e[Nc]==ff&&!e[Nd])f=e[yd];else if(e==this.wi)zL(this);else if(d){var k=d.NW,l=k&&BL(d,k),e=(e[Nc]==Mf||e[Nc]==Ef||e[Nc]==df)&&!e[Nd];!l||l[Nd]||e||(f=k)}f&&d&&(c=!0,b=this[$](new AL(f,String(d.get(f)))))}else e== this.wi&&32==a[Np]&&zL(this);if(b||c)a[Zp](),a[Hp]();b&&this[hy](!1)};function AL(a,b){ab(this,aE);this.key=a;this.caption=b}X(AL,Xs);function tL(a){this.P=a||Ek();Uj[L](this)}X(tL,Uj);T=tL[K];T.hj="charts-buttonset";T.NW=null;T.q=null;T.OY=null;T.set=function(a,b,c,d){Uj[K].set[L](this,a,b);c&&(this.NW=a);d&&(this.OY=a);return this};T.Ti=function(a,b,c){return this.set(a.key,a[gy],b,c)}; T.B=function(){if(this.q){AJ(this.q,zJ);var a=Ek(this.q);this[Tb](function(b,c){var d=a.h(eD,{name:c},b);c==this.NW&&lb(d,this.hj+CA);this.q[p](d)},this)}};T.Ia=function(a){if(a&&1==a[ed]){this.q=a;a=this.q[cc](eD);for(var b=0,c,d,e;c=a[b];b++)if(d=c[yd]||c.id,e=jl(c)||c[id],d){var f=0==b;this.set(d,e,f,c[yd]==hD);f&&fL(c,this.hj+CA)}}};T.a=function(){return this.q};T.ea=function(){return this.P};function BL(a,b){for(var c=a.q[cc](ff),d=0,e;e=c[d];d++)if(e[yd]==b||e.id==b)return e;return null} var uL={key:QG,caption:Uoa},vL={key:hD,caption:doa},GCa={key:"yes",caption:"Yes"},HCa={key:LG,caption:"No"},ICa={key:"save",caption:"Save"},JCa={key:"continue",caption:"Continue"};"undefined"!=typeof fa&&((new tL).Ti(uL,!0,!0),(new tL).Ti(uL,!0).Ti(vL,!1,!0),(new tL).Ti(GCa,!0).Ti(HCa,!1,!0),(new tL).Ti(GCa).Ti(HCa,!0).Ti(vL,!1,!0),(new tL).Ti(JCa).Ti(ICa).Ti(vL,!0,!0));function CL(a,b){rt[L](this);a&&this.cz(a,b)}X(CL,rt);T=CL[K];T.q=null;T.aR=null;T.c0=null;T.bR=null;T.El=-1;T.Eu=-1;T.k1=!1; var KCa={3:13,12:144,63232:38,63233:40,63234:37,63235:39,63236:112,63237:113,63238:114,63239:115,63240:116,63241:117,63242:118,63243:119,63244:120,63245:121,63246:122,63247:123,63248:44,63272:46,63273:36,63275:35,63276:33,63277:34,63289:144,63302:45},LCa={Up:38,Down:40,Left:37,Right:39,Enter:13,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,"U+007F":46,Home:36,End:35,PageUp:33,PageDown:34,Insert:45},MCa=kk||mk&&qk(jna),NCa=fk&&lk;T=CL[K]; T.mm=function(a){mk&&(17==this.El&&!a[Jq]||18==this.El&&!a[Tp]||fk&&91==this.El&&!a[Cq])&&(this.Eu=this.El=-1);-1==this.El&&(a[Jq]&&17!=a[Np]?this.El=17:a[Tp]&&18!=a[Np]?this.El=18:a[Cq]&&91!=a[Np]&&(this.El=91));if(MCa&&!TBa(a[Np],this.El,a[Oq],a[Jq],a[Tp]))this[Pp](a);else this.Eu=MJ(a[Np]),NCa&&(this.k1=a[Tp])};T.ona=function(a){this.Eu=this.El=-1;this.k1=a[Tp]}; kp(T,function(a){var b=a.Ka,c,d,e=b[Tp];kk&&a[H]==Xr?(c=this.Eu,d=13!=c&&27!=c?b[Np]:0):mk&&a[H]==Xr?(c=this.Eu,d=0<=b[Mp]&&63232>b[Mp]&&LJ(c)?b[Mp]:0):jk?(c=this.Eu,d=LJ(c)?b[Np]:0):(c=b[Np]||this.Eu,d=b[Mp]||0,NCa&&(e=this.k1),fk&&63==d&&224==c&&(c=191));var f=c=MJ(c),g=b.keyIdentifier;c?63232<=c&&c in KCa?f=KCa[c]:25==c&&a[Oq]&&(f=9):g&&g in LCa&&(f=LCa[g]);a=f==this.El;this.El=f;b=new OCa(f,d,a,b);mp(b,e);this[$](b)});T.a=function(){return this.q}; T.cz=function(a,b){this.bR&&this[hz]();this.q=a;this.aR=kt(this.q,Xr,this,b);this.c0=kt(this.q,wF,this.mm,b,this);this.bR=kt(this.q,xF,this.ona,b,this)};T.detach=function(){this.aR&&(pt(this.aR),pt(this.c0),pt(this.bR),this.bR=this.c0=this.aR=null);this.q=null;this.Eu=this.El=-1};T.w=function(){CL.e.w[L](this);this[hz]()};function OCa(a,b,c,d){$s[L](this,d);ab(this,vF);jp(this,a);this.charCode=b;this.repeat=c}X(OCa,$s);function DL(){}var EL;Uh(DL);function PCa(a){var b=new FL;b.$=function(){return a};return b}var QCa={button:eya,checkbox:BD,menuitem:TH,menuitemcheckbox:BD,menuitemradio:BD,radio:BD,tab:TH,treeitem:TH};T=DL[K];T.yj=function(){};T.h=function(a){var b=a.ea().h(Q,this.ol(a)[ie](ne),a[nz]());GL(this,a,b);return b};T.$a=function(a){return a};T.fr=function(a,b,c){if(a=a.a?a.a():a){var d=[b];kk&&!qk(aB)&&(d=HL(dL(a),b),d[C](b));(c?gL:iL)(a,d)}};T.Ah=function(){return!0}; T.Ia=function(a,b){b.id&&a.jw(b.id);var c=this.$a(b);c&&c[Sb]?a.zz(c[Sb][ac]?Yi(c[Xb]):c[Sb]):a.zz(null);var d=0,e=this.$(),f=this.$(),g=!1,k=!1,c=!1,l=Yi(dL(b));Y(l,function(a){g||a!=e?k||a!=f?d|=this.qY(a):k=!0:(g=!0,f==e&&(k=!0))},this);a.n=d;g||(l[C](e),f==e&&(k=!0));k||l[C](f);var n=a.Ln;n&&l[C][Mc](l,n);if(kk&&!qk(aB)){var q=HL(l);0<q[J]&&(l[C][Mc](l,q),c=!0)}g&&k&&!n&&!c||wCa(b,l[ie](ne));GL(this,a,b);return b};T.im=function(a){a.Lg()&&this.rv(a.a(),!0);a[Ay]()&&this.kn(a,a.O())}; function IL(a,b,c){if(a=c||a.yj())c=b[Sd](ih)||null,a!=c&&aL(b,a)}function GL(a,b,c){b.O()||bL(c,Ig,!b.O());b[Ay]()||a.op(c,1,!b[Ay]());JL(b,8)&&a.op(c,8,b.rP());JL(b,16)&&a.op(c,16,b.Xl());JL(b,64)&&a.op(c,64,KL(b,64))}T.HF=function(a,b){Vl(a,!b,!kk&&!jk)};T.rv=function(a,b){this.fr(a,this.$()+xma,b)};T.Jq=function(a){var b;return JL(a,32)&&(b=a.pg())?hl(b)&&il(b):!1}; T.kn=function(a,b){var c;if(JL(a,32)&&(c=a.pg())){if(!b&&KL(a,32)){try{c[Xy]()}catch(d){}KL(a,32)&&a.Hw(null)}(hl(c)&&il(c))!=b&&gl(c,b)}};fw(T,function(a,b){Sl(a,b);a&&bL(a,Ig,!b)});T.vc=function(a,b,c){var d=a.a();if(d){var e=this.yG(b);e&&this.fr(a,e,c);this.op(d,b,c)}};T.op=function(a,b,c){EL||(EL={1:lta,8:TH,16:BD,64:Uta});b=EL[b];var d=a[Sd](ih)||null;d&&(d=QCa[d]||b,b=b==BD||b==TH?d:b);b&&bL(a,b,c)}; Nw(T,function(a,b){var c=this.$a(a);if(c&&(Wk(c),b))if(bi(b))el(c,b);else{var d=function(a){if(a){var b=Gk(c);c[p](bi(a)?b[Cb](a):a)}};Yh(b)?Y(b,d):!Zh(b)||sxa in b?d(b):Y(Yi(b),d)}});T.pg=function(a){return a.a()};T.$=function(){return Wpa};T.ol=function(a){var b=this.$(),c=[b],d=this.$();d!=b&&c[C](d);b=a[hq]();for(d=[];b;){var e=b&-b;d[C](this.yG(e));b&=~e}c[C][Mc](c,d);(a=a.Ln)&&c[C][Mc](c,a);kk&&!qk(aB)&&c[C][Mc](c,HL(c));return c}; function HL(a,b){var c=[];b&&(a=a[Ab]([b]));Y([],function(d){!Ni(d,gi(Ri,a))||b&&!Ri(d,b)||c[C](d[ie](iC))});return c}T.yG=function(a){this.XR||RCa(this);return this.XR[a]};T.qY=function(a){this.Dda||(this.XR||RCa(this),this.Dda=Rj(this.XR));a=la(this.Dda[a],10);return ga(a)?0:a};function RCa(a){var b=a.$();ri(b[vb](/\xa0|\s/g,ne),ne);a.XR={1:b+DA,2:b+sma,4:b+ima,8:b+yma,16:b+mma,32:b+pma,64:b+vma}};function ML(a,b){if(!a)throw m("Invalid class name "+a);if(!ei(b))throw m("Invalid decorator function "+b);NL[a]=b}function SCa(a){var b;a=dL(a);for(var c=0,d=a[J];c<d;c++)if(b=a[c],b=b in NL?NL[b]():null)return b;return null}var TCa={},NL={};function UCa(a){var b=SCa(a);b&&b.Ia(a);return b};function OL(a,b,c){VK[L](this,c);if(!b){b=this[rc];for(var d;b;){d=fi(b);if(d=TCa[d])break;b=b.e?b.e[rc]:null}b=d?ei(d.Xb)?d.Xb():new d:null}this.g=b;this.zz(Qh(a)?a:null)}X(OL,VK);T=OL[K];T.ph=null;T.n=0;T.wG=39;T.Br=255;T.$r=0;T.Rd=!0;T.Ln=null;T.sL=!0;T.XL=!1;T.bK=null;function PL(a,b){a.yb&&b!=a.sL&&VCa(a,b);a.sL=b}T.pg=function(){return this.g.pg(this)};T.rN=function(){return this.lf||(this.lf=new CL)};T.eb=function(){return this.g}; T.L$=function(a){if(this.yb)throw m(KB);this.a()&&(this.q=null);this.g=a};T.en=function(a){a&&(this.Ln?Ri(this.Ln,a)||this.Ln[C](a):this.Ln=[a],this.g.fr(this,a,!0))};T.fr=function(a,b){b?this.en(a):a&&this.Ln&&Wi(this.Ln,a)&&(0==this.Ln[J]&&(this.Ln=null),this.g.fr(this,a,!1))};T.h=function(){var a=this.g.h(this);this.q=a;IL(this.g,a,this.vv());this.XL||this.g.HF(a,!1);this.O()||this.g[hy](a,!1)};T.vv=function(){return this.bK};T.iea=function(a){this.bK=a};T.$a=function(){return this.g.$a(this.a())}; T.Ah=function(a){return this.g.Ah(a)};T.mf=function(a){this.q=a=this.g.Ia(this,a);IL(this.g,a,this.vv());this.XL||this.g.HF(a,!1);this.Rd=a[x][Sc]!=R};T.Bb=function(){OL.e.Bb[L](this);this.g.im(this);if(this.wG&-2&&(this.sL&&VCa(this,!0),JL(this,32))){var a=this.pg();if(a){var b=this.rN();b.cz(a);this.hc().l(b,vF,this.Ci).l(a,zg,this.Pt).l(a,TC,this.Hw)}}}; function VCa(a,b){var c=a.hc(),d=a.a();b?(c.l(d,gs,a.En).l(d,es,a.Le).l(d,FG,a.np).l(d,fs,a.uM),a.bH!=Th&&c.l(d,OD,a.bH),kk&&c.l(d,YD,a.k7)):(c.uc(d,gs,a.En).uc(d,es,a.Le).uc(d,FG,a.np).uc(d,fs,a.uM),a.bH!=Th&&c.uc(d,OD,a.bH),kk&&c.uc(d,YD,a.k7))}T.ve=function(){OL.e.ve[L](this);this.lf&&this.lf[hz]();this.O()&&this[Ay]()&&this.g.kn(this,!1)};T.w=function(){OL.e.w[L](this);this.lf&&(this.lf.W(),delete this.lf);delete this.g;this.Ln=this.ph=null};Ow(T,function(){return this.ph}); Nw(T,function(a){this.g[mz](this.a(),a);this.zz(a)});T.zz=function(a){this.ph=a};T.Tk=function(){var a=this[nz]();if(!a)return O;a=bi(a)?a:Yh(a)?Gi(a,ll)[ie](O):jl(a);return nda(a)};T.rv=function(a){OL.e.rv[L](this,a);var b=this.a();b&&this.g.rv(b,a)};T.HF=function(a){this.XL=a;var b=this.a();b&&this.g.HF(b,a)};T.O=function(){return this.Rd};fw(T,function(a,b){if(b||this.Rd!=a&&this[$](a?cI:$E)){var c=this.a();c&&this.g[hy](c,a);this[Ay]()&&this.g.kn(this,a);this.Rd=a;return!0}return!1}); qw(T,function(){return!KL(this,1)});T.Ga=function(a){var b=this[mx]();b&&typeof b[Ay]==Bg&&!b[Ay]()||!QL(this,1,!a)||(a||(this[pz](!1),this.uh(!1)),this.O()&&this.g.kn(this,a),this.vc(1,!a))};T.uh=function(a){QL(this,2,a)&&this.vc(2,a)};T.nk=function(){return KL(this,4)};T.setActive=function(a){QL(this,4,a)&&this.vc(4,a)};T.rP=function(){return KL(this,8)};T.Fn=function(a){QL(this,8,a)&&this.vc(8,a)};T.Xl=function(){return KL(this,16)};T.Dg=function(a){QL(this,16,a)&&this.vc(16,a)}; T.pC=function(a){QL(this,32,a)&&this.vc(32,a)};T.ad=function(a){QL(this,64,a)&&this.vc(64,a)};sp(T,function(){return this.n});function KL(a,b){return!!(a.n&b)}T.vc=function(a,b){JL(this,a)&&b!=KL(this,a)&&(this.g.vc(this,a,b),this.n=b?this.n|a:this.n&~a)};function JL(a,b){return!!(a.wG&b)}function RL(a,b,c){if(a.yb&&KL(a,b)&&!c)throw m(KB);!c&&KL(a,b)&&a.vc(b,!1);a.wG=c?a.wG|b:a.wG&~b}function SL(a,b){return!!(a.Br&b)&&JL(a,b)} function QL(a,b,c){return JL(a,b)&&KL(a,b)!=c&&(!(a.$r&b)||a[$](uCa(b,c)))&&!a.Mj}T.En=function(a){!WCa(a,this.a())&&this[$](pE)&&this[Ay]()&&SL(this,2)&&this.uh(!0)};T.uM=function(a){!WCa(a,this.a())&&this[$](Vva)&&(SL(this,4)&&this[pz](!1),SL(this,2)&&this.uh(!1))};T.bH=Th;function WCa(a,b){return!!a[Fp]&&dl(b,a[Fp])}T.Le=function(a){this[Ay]()&&(SL(this,2)&&this.uh(!0),bt(a)&&(SL(this,4)&&this[pz](!0),this.g.Jq(this)&&this.pg()[Fx]()));!this.XL&&bt(a)&&a[Hp]()}; T.np=function(a){this[Ay]()&&(SL(this,2)&&this.uh(!0),this.nk()&&this.Wh(a)&&SL(this,4)&&this[pz](!1))};T.k7=function(a){this[Ay]()&&this.Wh(a)};T.Wh=function(a){SL(this,16)&&this.Dg(!this.Xl());SL(this,8)&&this.Fn(!0);SL(this,64)&&this.ad(!KL(this,64));var b=new Xs(qC,this);a&&(mp(b,a[Tp]),b.ctrlKey=a[Jq],vp(b,a[Cq]),b.shiftKey=a[Oq],b.O0=a.O0);return this[$](b)};T.Pt=function(){SL(this,32)&&this.pC(!0)};T.Hw=function(){SL(this,4)&&this[pz](!1);SL(this,32)&&this.pC(!1)}; T.Ci=function(a){return this.O()&&this[Ay]()&&this.ml(a)?(a[Hp](),a[Zp](),!0):!1};T.ml=function(a){return 13==a[Np]&&this.Wh(a)};if(!ei(OL))throw m("Invalid component class "+OL);if(!ei(DL))throw m("Invalid renderer class "+DL);var XCa=fi(OL);TCa[XCa]=DL;ML(Wpa,function(){return new OL(null)});function TL(){this.j1=[]}X(TL,DL);Uh(TL);function UL(a,b){var c=a.j1[b];if(!c){switch(b){case 0:c=a.$()+qma;break;case 1:c=a.$()+lma;break;case 2:c=a.$()+BA}a.j1[b]=c}return c}T=TL[K];T.yj=function(){return ixa};T.h=function(a){var b=a.ea().h(Q,this.ol(a)[ie](ne),YCa(this,a[nz](),a.ea()));VL(this,a,b,JL(a,8)||JL(a,16));GL(this,a,b);ZCa(this,a,b);return b};T.$a=function(a){return a&&a[Sb]}; T.Ia=function(a,b){var c=al(b),d=UL(this,2);c&&eL(c,d)||b[p](YCa(this,b[Xb],a.ea()));eL(b,pC)&&(a.nN(!0),this.nN(a,b,!0));return TL.e.Ia[L](this,a,b)};Nw(T,function(a,b){var c=this.$a(a),d=WL(this,a)?c[Sb]:null;TL.e[mz][L](this,a,b);d&&!WL(this,a)&&c[Eb](d,c[Sb]||null)});function YCa(a,b,c){a=UL(a,2);return c.h(Q,a,b)}T.IY=function(a,b,c){b&&(aL(b,c?tG:this.yj()),VL(this,a,b,c))};T.nN=function(a,b,c){b&&(aL(b,c?sG:this.yj()),VL(this,a,b,c))}; function WL(a,b){var c=a.$a(b);if(c){var c=c[Sb],d=UL(a,1);return!!c&&bl(c)&&eL(c,d)}return!1}function VL(a,b,c,d){if(d!=WL(a,c))if(jL(c,pC,d),c=a.$a(c),d)a=UL(a,1),c[Eb](b.ea().h(Q,a),c[Sb]||null);else c[Qd](c[Sb])}T.yG=function(a){switch(a){case 2:return UL(this,0);case 16:case 8:return fqa;default:return TL.e.yG[L](this,a)}};T.qY=function(a){var b=UL(this,0);switch(a){case fqa:return 16;case b:return 2;default:return TL.e.qY[L](this,a)}};T.$=function(){return bqa}; function ZCa(a,b,c){(JL(b,8)||JL(b,16))&&IL(a,c,JL(b,16)?sG:tG)};function XL(a,b,c,d){OL[L](this,a,d||TL.Xb(),c);this.wa(b)}X(XL,OL);T=XL[K];fb(T,function(){var a=this.Uk;return null!=a?a:this.Tk()});T.wa=function(a){this.Uk=a};T.IY=function(a){RL(this,8,a);this.Xl()&&!a&&this.Dg(!1);var b=this.a();b&&this.eb().IY(this,b,a)};T.nN=function(a){RL(this,16,a);var b=this.a();b&&this.eb().nN(this,b,a)};T.Tk=function(){var a=this[nz]();return Yh(a)?(a=Gi(a,function(a){return bl(a)&&(eL(a,cqa)||eL(a,dqa))?O:ll(a)})[ie](O),nda(a)):XL.e.Tk[L](this)}; T.np=function(a){var b=this[mx]();if(b){var c=b.n$;b.n$=null;if(c&&di(a[zd])&&tk(c,new sk(a[zd],a[Ad])))return}XL.e.np[L](this,a)};T.ml=function(a){return a[Np]==this.FZ&&this.Wh(a)?!0:XL.e.ml[L](this,a)};T.Tla=function(){return this.FZ};ML(bqa,function(){return new XL(null)});XL[K].h=function(){XL.e.h[L](this);ZCa(this.eb(),this,this.a())};XL[K].vv=function(){return JL(this,16)?sG:JL(this,8)?tG:XL.e.vv[L](this)};function YL(a,b,c,d){IJ[L](this,a,b,c||d);if(c||d)this.XN=65|(d?32:132)}X(YL,IJ);var ZL,$L;$L=ZL=!1;var aM=ek;aM&&(-1!=aM[ld]("Firefox")||-1!=aM[ld]("Camino")||(-1!=aM[ld]("iPhone")||-1!=aM[ld]("iPod")?ZL=!0:-1!=aM[ld]("iPad")?$L=!0:-1!=aM[ld]("Chrome")||-1!=aM[ld]("Android")||aM[ld]("Safari")));var $Ca=ZL,aDa=$L;function bM(){}X(bM,DL);Uh(bM);T=bM[K];T.yj=function(){return eD};T.op=function(a,b,c){switch(b){case 8:case 16:bL(a,eya,c);break;default:case 64:case 1:bM.e.op[L](this,a,b,c)}};T.h=function(a){var b=bM.e.h[L](this,a);this.Rh(b,a.gk());var c=a[I]();c&&this.wa(b,c);JL(a,16)&&this.op(b,16,a.Xl());return b};T.Ia=function(a,b){b=bM.e.Ia[L](this,a,b);var c=this[I](b);a.hd=c;a.tA(this.gk(b));JL(a,16)&&this.op(b,16,a.Xl());return b};fb(T,Th);T.wa=Th;T.gk=function(a){return a[uz]}; T.Rh=function(a,b){a&&b&&Ap(a,b)};T.tt=function(a,b){var c=a.Lg(),d=this.$()+nma,e=this.$()+oma;a.fr(c?e:d,!!(b&1));a.fr(c?d:e,!!(b&2))};T.$=function(){return Tpa};function cM(){}X(cM,bM);Uh(cM);T=cM[K];T.yj=function(){};T.h=function(a){PL(a,!1);a.Br&=-256;RL(a,32,!1);return a.ea().h(eD,{"class":this.ol(a)[ie](ne),disabled:!a[Ay](),title:a.gk()||O,value:a[I]()||O},a.Tk()||O)};T.Ah=function(a){return a[Nc]==ff||a[Nc]==qf&&(a[H]==eD||a[H]==nAa||a[H]==Sya)};T.Ia=function(a,b){PL(a,!1);a.Br&=-256;RL(a,32,!1);if(b[Nd]){var c=this.yG(1);fL(b,c)}return cM.e.Ia[L](this,a,b)};T.im=function(a){a.hc().l(a.a(),Fr,a.Wh)};T.HF=Th;T.rv=Th;T.Jq=function(a){return a[Ay]()}; T.kn=Th;T.vc=function(a,b,c){cM.e.vc[L](this,a,b,c);(a=a.a())&&1==b&&Uw(a,c)};fb(T,function(a){return a[id]});T.wa=function(a,b){a&&Fw(a,b)};T.op=Th;function dM(a,b,c){OL[L](this,a,b||cM.Xb(),c)}X(dM,OL);T=dM[K];fb(T,function(){return this.hd});T.wa=function(a){this.hd=a;this.eb().wa(this.a(),a)};T.gk=function(){return this.ka};T.Rh=function(a){this.ka=a;this.eb().Rh(this.a(),a)};T.tA=function(a){this.ka=a};T.tt=function(a){this.eb().tt(this,a)};T.w=function(){dM.e.w[L](this);delete this.hd;delete this.ka};T.Bb=function(){dM.e.Bb[L](this);if(JL(this,32)){var a=this.pg();a&&this.hc().l(a,xF,this.ml)}}; T.ml=function(a){return 13==a[Np]&&a[H]==vF||32==a[Np]&&a[H]==xF?this.Wh(a):32==a[Np]};ML(Tpa,function(){return new dM(null)});function eM(a){this.vS=a}Uh(eM);T=eM[K];T.yj=function(){return this.vS};function fM(a,b){a&&bb(a,b?0:-1)}T.h=function(a){return a.ea().h(Q,this.ol(a)[ie](ne))};T.$a=function(a){return a};T.Ah=function(a){return a[Nc]==kf};T.Ia=function(a,b){b.id&&a.jw(b.id);var c=this.$(),d=!1,e=dL(b);e&&Y(e,function(b){b==c?d=!0:b&&this.tZ(a,b,c)},this);d||fL(b,c);bDa(this,a,this.$a(b));return b};T.tZ=function(a,b,c){b==c+DA?a.Ga(!1):b==c+rma?a.HG(Jg):b==c+Fma&&a.HG(Eh)}; function bDa(a,b,c){if(c)for(var d=c[Sb],e;d&&d[fe]==c;){e=d[ac];if(1==d[ed]){var f=a.iY(d);f&&(f.q=d,b[Ay]()||f.Ga(!1),b.ua(f),f.Ia(d))}else d[Yc]&&pi(d[Yc])!=O||c[Qd](d);d=e}}T.iY=function(a){return SCa(a)};T.im=function(a){a=a.a();Vl(a,!0,lk);kk&&(a.hideFocus=!0);var b=this.yj();b&&aL(a,b)};T.pg=function(a){return a.a()};T.$=function(){return Vpa};T.ol=function(a){var b=this.$(),c=[b,a.Dr()==Jg?b+rma:b+Fma];a[Ay]()||c[C](b+DA);return c};function gM(a,b,c){VK[L](this,c);this.g=b||eM.Xb();this.ib=a||Eh}X(gM,VK);T=gM[K];T.FW=null;T.lf=null;T.g=null;T.ib=null;T.Rd=!0;T.qg=!0;T.U0=!0;T.qf=-1;T.Rg=null;T.nn=!1;T.Ala=!1;T.Qja=!0;T.Xq=null;T.pg=function(){return this.FW||this.g.pg(this)};T.rN=function(){return this.lf||(this.lf=new CL(this.pg()))};T.eb=function(){return this.g};T.L$=function(a){if(this.a())throw m(KB);this.g=a};T.h=function(){this.q=this.g.h(this)};T.$a=function(){return this.g.$a(this.a())};T.Ah=function(a){return this.g.Ah(a)}; T.mf=function(a){this.q=this.g.Ia(this,a);a[x][Sc]==R&&(this.Rd=!1)};T.Bb=function(){gM.e.Bb[L](this);XK(this,function(a){a.yb&&cDa(this,a)},this);var a=this.a();this.g.im(this);this[hy](this.Rd,!0);this.hc().l(this,pE,this.PU).l(this,bF,this.BU).l(this,UI,this.DU).l(this,Bxa,this.Hfa).l(this,HD,this.Ffa).l(a,es,this.Le).l(Gk(a),FG,this.Gfa).l(a,[es,FG,gs,fs,OD],this.Efa);this.Jq()&&dDa(this,!0)}; function dDa(a,b){var c=a.hc(),d=a.pg();b?c.l(d,zg,a.Pt).l(d,TC,a.Hw).l(a.rN(),vF,a.Ci):c.uc(d,zg,a.Pt).uc(d,TC,a.Hw).uc(a.rN(),vF,a.Ci)}T.ve=function(){this.nf(-1);this.Rg&&this.Rg.ad(!1);this.nn=!1;gM.e.ve[L](this)};T.w=function(){gM.e.w[L](this);this.lf&&(this.lf.W(),this.lf=null);this.g=this.Rg=this.Xq=this.FW=null};T.PU=function(){return!0}; T.BU=function(a){var b=ZK(this,a[Mq]);if(-1<b&&b!=this.qf){var c=hM(this);c&&c.uh(!1);this.qf=b;c=hM(this);this.nn&&c[pz](!0);this.Qja&&this.Rg&&c!=this.Rg&&(JL(c,64)?c.ad(!0):this.Rg.ad(!1))}b=this.a();null!=a[Mq].a()&&bL(b,rC,a[Mq].a().id)};T.DU=function(a){a[Mq]==hM(this)&&(this.qf=-1);this.a()[Pc](Yqa)};T.Hfa=function(a){(a=a[Mq])&&a!=this.Rg&&a[mx]()==this&&(this.Rg&&this.Rg.ad(!1),this.Rg=a)};T.Ffa=function(a){a[Mq]==this.Rg&&(this.Rg=null)}; T.Le=function(a){this.qg&&(this.nn=!0);var b=this.pg();b&&hl(b)&&il(b)?b[Fx]():a[Hp]()};T.Gfa=function(){this.nn=!1};T.Efa=function(a){var b;t:{b=a[Mq];if(this.Xq)for(var c=this.a();b&&b!==c;){var d=b.id;if(d in this.Xq){b=this.Xq[d];break t}b=b[fe]}b=null}if(b)switch(a[H]){case es:b.Le(a);break;case FG:b.np(a);break;case gs:b.En(a);break;case fs:b.uM(a);break;case OD:b.bH(a)}};T.Pt=function(){};T.Hw=function(){this.nf(-1);this.nn=!1;this.Rg&&this.Rg.ad(!1)}; T.Ci=function(a){return this[Ay]()&&this.O()&&(0!=this.Zf()||this.FW)&&this.ml(a)?(a[Hp](),a[Zp](),!0):!1}; T.ml=function(a){var b=hM(this);if(b&&typeof b.Ci==Bg&&b.Ci(a)||this.Rg&&this.Rg!=b&&typeof this.Rg.Ci==Bg&&this.Rg.Ci(a))return!0;if(a[Oq]||a[Jq]||a[Cq]||a[Tp])return!1;switch(a[Np]){case 27:if(this.Jq())this.pg()[Xy]();else return!1;break;case 36:eDa(this);break;case 35:fDa(this);break;case 38:if(this.ib==Eh)iM(this);else return!1;break;case 37:if(this.ib==Jg)this.Lg()?jM(this):iM(this);else return!1;break;case 40:if(this.ib==Eh)jM(this);else return!1;break;case 39:if(this.ib==Jg)this.Lg()?iM(this): jM(this);else return!1;break;default:return!1}return!0};function cDa(a,b){var c=b.a(),c=c.id||(c.id=b[Fz]());a.Xq||(a.Xq={});a.Xq[c]=b}T.ua=function(a,b){gM.e.ua[L](this,a,b)};T.qx=function(a,b,c){a.$r|=2;a.$r|=64;!this.Jq()&&this.Ala||RL(a,32,!1);PL(a,!1);gM.e.qx[L](this,a,b,c);a.yb&&this.yb&&cDa(this,a);b<=this.qf&&this.qf++}; T.removeChild=function(a,b){if(a=bi(a)?this.ut(a):a){var c=ZK(this,a);-1!=c&&(c==this.qf?(a.uh(!1),this.qf=-1):c<this.qf&&this.qf--);(c=a.a())&&c.id&&this.Xq&&Lj(this.Xq,c.id)}a=gM.e[Qd][L](this,a,b);PL(a,!0);return a};T.Dr=function(){return this.ib};T.HG=function(a){if(this.a())throw m(KB);this.ib=a};T.O=function(){return this.Rd};fw(T,function(a,b){if(b||this.Rd!=a&&this[$](a?cI:$E)){this.Rd=a;var c=this.a();c&&(Sl(c,a),this.Jq()&&fM(this.pg(),this.qg&&this.Rd),b||this[$](this.Rd?tC:sC));return!0}return!1}); qw(T,function(){return this.qg});T.Ga=function(a){this.qg!=a&&this[$](a?mE:dE)&&(a?(this.qg=!0,XK(this,function(a){a.qba?delete a.qba:a.Ga(!0)})):(XK(this,function(a){a[Ay]()?a.Ga(!1):a.qba=!0}),this.nn=this.qg=!1),this.Jq()&&fM(this.pg(),a&&this.Rd))};T.Jq=function(){return this.U0};T.kn=function(a){a!=this.U0&&this.yb&&dDa(this,a);this.U0=a;this.qg&&this.Rd&&fM(this.pg(),a)};T.nf=function(a){(a=this.ff(a))?a.uh(!0):-1<this.qf&&hM(this).uh(!1)};T.uh=function(a){this.nf(ZK(this,a))}; function hM(a){return a.ff(a.qf)}function eDa(a){kM(a,function(a,c){return(a+1)%c},a.Zf()-1)}function fDa(a){kM(a,function(a,c){a--;return 0>a?c-1:a},0)}function jM(a){kM(a,function(a,c){return(a+1)%c},a.qf)}function iM(a){kM(a,function(a,c){a--;return 0>a?c-1:a},a.qf)}function kM(a,b,c){c=0>c?ZK(a,a.Rg):c;var d=a.Zf();c=b[L](a,c,d);for(var e=0;e<=d;){var f=a.ff(c);if(f&&a.rca(f)){a.i_(c);break}e++;c=b[L](a,c,d)}}T.rca=function(a){return a.O()&&a[Ay]()&&JL(a,2)};T.i_=function(a){this.nf(a)};function lM(){}X(lM,DL);Uh(lM);lM[K].$=function(){return aqa};function mM(a,b,c){OL[L](this,a,c||lM.Xb(),b);RL(this,1,!1);RL(this,2,!1);RL(this,4,!1);RL(this,32,!1);this.n=1}X(mM,OL);ML(aqa,function(){return new mM(null)});function nM(){}X(nM,DL);Uh(nM);nM[K].h=function(a){return a.ea().h(Q,this.$())};nM[K].Ia=function(a,b){b.id&&a.jw(b.id);if(b[Nc]==pf){var c=b;b=this.h(a);Xk(b,c);Zk(c)}else fL(b,this.$());return b};Nw(nM[K],function(){});nM[K].$=function(){return oC};function oM(a,b){OL[L](this,null,a||nM.Xb(),b);RL(this,1,!1);RL(this,2,!1);RL(this,4,!1);RL(this,32,!1);this.n=1}X(oM,OL);oM[K].Bb=function(){oM.e.Bb[L](this);var a=this.a();aL(a,VH)};ML(oC,function(){return new oM});function pM(a){this.vS=a||hxa}X(pM,eM);Uh(pM);T=pM[K];T.Ah=function(a){return a[Nc]==Cpa||pM.e.Ah[L](this,a)};T.iY=function(a){return a[Nc]==pf?new oM:pM.e.iY[L](this,a)};T.zr=function(a,b){return dl(a.a(),b)};T.$=function(){return nC};T.im=function(a){pM.e.im[L](this,a);a=a.a();bL(a,XE,zh)};ML(oC,function(){return new oM});function qM(a,b){gM[L](this,Eh,b||pM.Xb(),a);this.kn(!1)}X(qM,gM);T=qM[K];T.YG=!0;T.x$=!1;T.$=function(){return this.eb().$()};T.zr=function(a){if(this.eb().zr(this,a))return!0;for(var b=0,c=this.Zf();b<c;b++){var d=this.ff(b);if(typeof d.zr==Bg&&d.zr(a))return!0}return!1};T.bj=function(a){this.ua(a,!0)};T.uu=function(a,b){this.qx(a,b,!0)};T.bd=function(a){return this.ff(a)};T.Ig=function(){return this.Zf()};T.vA=function(){var a=[];XK(this,function(b){a[C](b)});return a}; bx(T,function(a,b){var c=this.O();c||Sl(this.a(),!0);var d=this.a(),e=a,f=b,g=Jl(d);e instanceof sk&&(f=e.y,e=e.x);Dl(d,d[Od]+(e-g.x),d[Tc]+(f-g.y));c||Sl(this.a(),!1)});pw(T,function(){return this.O()?Jl(this.a()):null});fw(T,function(a,b,c){(b=qM.e[hy][L](this,a,b))&&a&&this.yb&&this.YG&&this.pg()[Fx]();this.n$=a&&c&&di(c[zd])?new sk(c[zd],c[Ad]):null;return b});T.PU=function(a){this.YG&&this.pg()[Fx]();return qM.e.PU[L](this,a)};T.rca=function(a){return(this.x$||a[Ay]())&&a.O()&&JL(a,2)}; T.mf=function(a){var b=this.eb(),c;c=this.ea();var d=b.$()+BA;c=Jk(c.of,Q,d,a);for(var d=c[J],e=0;e<d;e++)bDa(b,this,c[e]);qM.e.mf[L](this,a)};T.ml=function(a){var b=qM.e.ml[L](this,a);b||XK(this,function(c){!b&&c.Tla&&c.FZ==a[Np]&&(this[Ay]()&&this.uh(c),b=c.Ci(a))},this);return b}; T.nf=function(a){qM.e.nf[L](this,a);if(a=this.ff(a)){var b=a.a();a=this.a();var c=Jl(b),d=Jl(a),e=Zl(a),f=c.x-d.x-e[G],c=c.y-d.y-e.top,d=a[Wd]-b[Uc],e=a[Gc],g=a[Cd],e=e+h.min(f,h.max(f-(a[Gd]-b[zb]),0)),g=g+h.min(c,h.max(c-d,0)),b=new sk(e,g);a.scrollLeft=b.x;Rw(a,b.y)}};function rM(){}X(rM,bM);Uh(rM);T=rM[K];T.h=function(a){var b={"class":mC+this.ol(a)[ie](ne)},b=a.ea().h(Q,b,this.UN(a[nz](),a.ea()));this.Rh(b,a.gk());GL(this,a,b);return b};T.yj=function(){return eD};T.$a=function(a){return a&&a[Sb][Sb]};T.UN=function(a,b){return b.h(Q,mC+(this.$()+wma),b.h(Q,mC+(this.$()+tma),a))};T.Ah=function(a){return a[Nc]==kf}; T.Ia=function(a,b){gDa(b,!0);gDa(b,!1);var c;t:{c=a.ea().n9(b);var d=this.$()+wma;if(c&&eL(c,d)&&(c=a.ea().n9(c),d=this.$()+tma,c&&eL(c,d))){c=!0;break t}c=!1}c||b[p](this.UN(b[Xb],a.ea()));gL(b,[lC,this.$()]);return rM.e.Ia[L](this,a,b)};T.$=function(){return Xpa};function gDa(a,b){if(a)for(var c=b?a[Sb]:a[yc],d;c&&c[fe]==a;){d=b?c[ac]:c[gc];if(3==c[ed]){var e=c[Yc];if(pi(e)==O)a[Qd](c);else{c.nodeValue=b?e[vb](/^[\s\xa0]+/,O):e[vb](/[\s\xa0]+$/,O);break}}else break;c=d}};function sM(){}X(sM,rM);Uh(sM);T=sM[K];T.$a=function(a){return sM.e.$a[L](this,a&&a[Sb])};T.Ia=function(a,b){var c=Ik(He,nC,b)[0];if(c){Sl(c,!1);Gk(c)[Pd][p](c);var d=new qM;d.Ia(c);a.jm(d)}return sM.e.Ia[L](this,a,b)};T.UN=function(a,b){return sM.e.UN[L](this,[this[Wy](a,b),this.DN(b)],b)};Dw(T,function(a,b){return tM(a,this.$(),b)});function tM(a,b,c){return c.h(Q,mC+(b+AA),a)}T.DN=function(a){return a.h(Q,mC+(this.$()+EA),Nh)};T.$=function(){return $pa};function uM(a,b,c,d,e){dM[L](this,a,c||sM.Xb(),d);RL(this,64,!0);this.wN=new YL(null,5);b&&this.jm(b);this.gia=null;this.Sc=new tt(500);!$Ca&&!aDa||qk(mna)||(this.rz=!0);this.qma=e||pM.Xb()}X(uM,dM);T=uM[K];T.rz=!1;T.gfa=!1;T.Bb=function(){uM.e.Bb[L](this);hDa(this,!0);this.Y&&vM(this,this.Y,!0);bL(this.q,XE,!!this.Y)};T.ve=function(){uM.e.ve[L](this);hDa(this,!1);if(this.Y){this.ad(!1);this.Y.ve();vM(this,this.Y,!1);var a=this.Y.a();a&&Zk(a)}}; T.w=function(){uM.e.w[L](this);this.Y&&(this.Y.W(),delete this.Y);delete this.Xfa;this.Sc.W()};T.Le=function(a){uM.e.Le[L](this,a);this.nk()&&(this.ad(!KL(this,64),a),this.Y&&(this.Y.nn=KL(this,64)))};T.np=function(a){uM.e.np[L](this,a);this.Y&&!this.nk()&&(this.Y.nn=!1)};T.Wh=function(){this[pz](!1);return!0};T.dfa=function(a){this.Y&&this.Y.O()&&!this.zr(a[Mq])&&this.ad(!1)};T.zr=function(a){return a&&dl(this.a(),a)||this.Y&&this.Y.zr(a)||!1}; T.ml=function(a){if(32==a[Np]){if(a[Hp](),a[H]!=xF)return!0}else if(a[H]!=vF)return!1;if(this.Y&&this.Y.O()){var b=this.Y.Ci(a);return 27==a[Np]?(this.ad(!1),!0):b}return 40==a[Np]||38==a[Np]||32==a[Np]||13==a[Np]?(this.ad(!0,a),!0):!1};T.Hr=function(){this.ad(!1)};T.efa=function(){this.nk()||this.ad(!1)};T.Hw=function(a){this.rz||this.ad(!1);uM.e.Hw[L](this,a)};T.bg=function(){this.Y||this.jm(new qM(this.ea(),this.qma));return this.Y||null}; T.jm=function(a){var b=this.Y;if(a!=b&&(b&&(this.ad(!1),this.yb&&vM(this,b,!1),delete this.Y),this.yb&&bL(this.q,XE,!!a),a)){this.Y=a;WK(a,this);a[hy](!1);var c=this.rz;(a.YG=c)&&a.kn(!0);this.yb&&vM(this,a,!0)}return b};T.bj=function(a){this.bg().ua(a,!0)};T.uu=function(a,b){this.bg().qx(a,b,!0)};T.bd=function(a){return this.Y?this.Y.ff(a):null};T.Ig=function(){return this.Y?this.Y.Zf():0};fw(T,function(a,b){var c=uM.e[hy][L](this,a,b);c&&!this.O()&&this.ad(!1);return c}); T.Ga=function(a){uM.e.Ga[L](this,a);this[Ay]()||this.ad(!1)};T.iaa=function(){this.ad(!0)};T.ev=function(){this.ad(!1)}; T.ad=function(a,b){uM.e.ad[L](this,a);if(this.Y&&KL(this,64)==a){if(a){if(!this.Y.yb)if(this.gfa){var c;c=this.a();(c=void 0!=c.nextElementSibling?c.nextElementSibling:tea(c[ac]))?this.Y.Hy(c[fe],c):this.Y.B(this.a()[fe])}else this.Y.B();this.W3=Il(this.a());this.V3=Ql(this.a());this.TK();this.Y.nf(!b||40!=b[Np]&&38!=b[Np]?-1:0)}else{this[pz](!1);this.Y.nn=!1;if(c=this.a())bL(c,rC,O),bL(c,ZG,O);null!=this.ZK&&(this.ZK=void 0,(c=this.Y.a())&&Nl(c,O,O))}this.Y[hy](a,!1,b);if(!this.Mj){c=this.hc();var d= a?c.l:c.uc;d[L](c,this.ea().$b(),es,this.dfa,!0);this.rz&&d[L](c,this.Y,TC,this.efa);d[L](c,this.Sc,Fs,this.ffa);a?this.Sc[y]():this.Sc[Hq]()}}};T.TK=function(){if(this.Y.yb){var a=this.Xfa||this.a(),b=this.wN;cx(this.wN,a);a=this.Y.a();this.Y.O()||(hb(a[x],Ig),Sl(a,!0));!this.ZK&&this.wN.Eia&&this.wN.XN&32&&(this.ZK=Pl(a));b.Ie(a,b.fH^1,this.gia,this.ZK);this.Y.O()||(Sl(a,!1),hb(a[x],Fh))}}; T.ffa=function(){var a=Ql(this.a()),b=Il(this.a()),c;(c=!yl(this.V3,a))||(c=this.W3,c=!(c==b||c&&b&&c.top==b.top&&c[Zc]==b[Zc]&&c[Hc]==b[Hc]&&c[G]==b[G]));c&&(this.V3=a,this.W3=b,this.TK())};function vM(a,b,c){var d=a.hc();c=c?d.l:d.uc;c[L](d,b,qC,a.Hr);c[L](d,b,bF,a.BU);c[L](d,b,UI,a.DU)}function hDa(a,b){var c=a.hc();(b?c.l:c.uc)[L](c,a.a(),wF,a.Tia)}T.BU=function(a){var b=this.a();null!=a[Mq].a()&&(bL(b,rC,a[Mq].a().id),bL(b,ZG,a[Mq].a().id))}; T.Tia=function(a){JL(this,32)&&this.pg()&&this.Y&&this.Y.O()&&a[Zp]()};T.DU=function(){if(!hM(this.Y)){var a=this.a();bL(a,rC,O);bL(a,ZG,O)}};ML($pa,function(){return new uM(null)});function wM(a){rt[L](this);this.Mr=[];iDa(this,a)}X(wM,rt);T=wM[K];T.wx=null;T.zN=null;T.Ig=function(){return this.Mr[J]};T.bd=function(a){return this.Mr[a]||null};function iDa(a,b){b&&(Y(b,function(a){this.zB(a,!1)},a),Zi(a.Mr,b))}T.bj=function(a){this.uu(a,this.Ig())};T.uu=function(a,b){a&&(this.zB(a,!1),Ui(this.Mr,a,b))};T.Ke=function(){return this.wx};T.vA=function(){return Yi(this.Mr)};T.lk=function(a){a!=this.wx&&(this.zB(this.wx,!1),this.wx=a,this.zB(a,!0));this[$](As)}; T.sr=function(){var a=this.wx;return a?Ci(this.Mr,a):-1};T.Ok=function(a){this.lk(this.bd(a))};wa(T,function(){Ti(this.Mr);this.wx=null});T.w=function(){wM.e.w[L](this);delete this.Mr;this.wx=null};T.zB=function(a,b){a&&(typeof this.zN==Bg?this.zN(a,b):typeof a.Fn==Bg&&a.Fn(b))};function xM(a,b,c,d,e){uM[L](this,a,b,c,d,e||new pM(Owa));this.oF=this[nz]();this.PX=null}X(xM,uM);T=xM[K];T.pa=null;T.Bb=function(){xM.e.Bb[L](this);yM(this);jDa(this)};T.mf=function(a){xM.e.mf[L](this,a);(a=this.Tk())?(this.oF=a,yM(this)):this.Ke()||this.Ok(0)};T.w=function(){xM.e.w[L](this);this.pa&&(this.pa.W(),this.pa=null);this.oF=null};T.Hr=function(a){this.lk(a[Mq]);xM.e.Hr[L](this,a);a[Zp]();this[$](qC)};T.jY=function(){var a=this.Ke();xM.e.wa[L](this,a&&a[I]());yM(this)}; T.jm=function(a){var b=xM.e.jm[L](this,a);a!=b&&(this.pa&&this.pa[Wb](),a&&(this.pa?XK(a,function(a){zM(a);this.pa.bj(a)},this):AM(this,a)));return b};T.bj=function(a){zM(a);xM.e.bj[L](this,a);this.pa?this.pa.bj(a):AM(this,this.bg())};T.uu=function(a,b){zM(a);xM.e.uu[L](this,a,b);this.pa?this.pa.uu(a,b):AM(this,this.bg())};T.lk=function(a){if(this.pa){var b=this.Ke();this.pa.lk(a);a!=b&&this[$](qD)}};T.Ok=function(a){this.pa&&this.lk(this.pa.bd(a))}; T.wa=function(a){if(null!=a&&this.pa)for(var b=0,c;c=this.pa.bd(b);b++)if(c&&typeof c[I]==Bg&&c[I]()==a){this.lk(c);return}this.lk(null)};fb(T,function(){var a=this.Ke();return a?a[I]():null});T.Ke=function(){return this.pa?this.pa.Ke():null};T.sr=function(){return this.pa?this.pa.sr():-1};function AM(a,b){a.pa=new wM;b&&XK(b,function(a){zM(a);this.pa.bj(a)},a);jDa(a)}function jDa(a){a.pa&&a.hc().l(a.pa,As,a.jY)} function yM(a){var b=a.Ke();a[mz](b?b.Tk():a.oF);var c=a.eb().$a(a.a());c&&a.ea().Zia(c)&&(null==a.PX&&(a.PX=cL(c)),a=(b=b?b.a():null)?cL(b):a.PX,bL(c,zF,a))}function zM(a){a.iea(a instanceof XL?Dxa:VH)}T.ad=function(a,b){xM.e.ad[L](this,a,b);KL(this,64)&&this.bg().nf(this.sr())};ML(gqa,function(){return new xM(null)});function BM(a,b){this.P=Ek();this.m=a;this.o$=[];this.We(b)}BM[K].nB=null; function kDa(a,b){var c=Ek(),d,e,f=null;switch(a){case 2:d=new sL(Hua);f=tH+d[Fz]();e=c.h(Q,null,c.h(Q,{"class":Gua},joa),c.h(bD,null),c.h(cya,null,c.h(Q,{id:f},b[aq])));break;case 3:d=new sL(Fua);e=c.h(Q,null,c.h(Q,{"class":Gua},joa),c.h(bD,null));var g=c.h(Q,null,c.h(cya,null,b[aq]));c[p](e,g)}d[mz](e[hd]);c=d;wL(c);Wa(c.ej,Boa);c=d;wL(c);Wa(c.kh,O);d[hy](!0);if(f){d=c=Hk(f);f=0;e=1;g=new SK;g.Vn=sCa(d,f,c,e);if(bl(d)&&!Uk(d)){var k=d[fe],f=Ci(k[Xb],d);d=k}bl(c)&&!Uk(c)&&(k=c[fe],e=Ci(k[Xb],c), c=k);g.Vn?(g.Nd=c,g.Md=e,g.qd=d,g.Ld=f):(g.Nd=d,g.Md=f,g.qd=c,g.Ld=e);g[Gx]()}} BM[K].We=function(a){a=a||[];var b=this.m,c=this.P;c.cd(b);if(!b)throw m(hf);var d=c.h(Bs,null),e=[c.h(Bs,null,eoa)];this.nB=new xM(e);if(a)for(e=0;e<a[J];e++){var f=null,f=a[e],g=f.datasource,k=f.gadget,l=f.userprefs,n=f[Md],q=f[Nxa],s=f[x]||yBa;switch(f[H]){case Rsa:f=CM(this,e,gi(function(a){ca[oq]((new Ct(a)).Oc(SAa,Exa),Coa)},g),uoa);break;case zva:f=CM(this,e,gi(function(a,b){kDa(2,{message:Nna+s+rla+aa(a)+$la+aa(b)+lDa(l)+pe})},k,g),cpa);break;case Sva:f=CM(this,e,gi(function(a,b,c){kDa(3, {message:Mna+aa(b)+bma+a+ama+aa(c)+cma})},g,q,n),Loa);break;case Mg:f=CM(this,e,gi(function(a){ca[oq]((new Ct(a)).Oc(SAa,Fxa),Coa)},g),voa);break;case Eva:f=CM(this,e,gi(function(a,b,c){ca[oq](Bva+aa(a)+$la+aa(b)+lDa(c))},k,g,l),Xna);break;default:throw m("No such toolbar component as: "+f.toSource());}f&&this.nB.bj(f)}kt(this.nB,qC,W(this.Pia,this));this.nB.B(d);c[p](b,d)};BM[K].Pia=function(){var a=this.nB.sr();this.o$[a]();this.nB.Ok(-1)};function CM(a,b,c,d){d=new XL(d);a.o$[b]=c;return d} function lDa(a){if(!a)return O;var b=O,c;for(c in a)b+=Zla+c+af+aa(a[c]);return b};function FL(){}X(FL,DL);Uh(FL);FL[K].h=function(a){var b=a.ea().h(Bs,this.ol(a)[ie](ne));mDa(this,b,a.lp);return b};FL[K].Ia=function(a,b){b=FL.e.Ia[L](this,a,b);var c=dL(b),d=!1;Ri(c,KM(this,null))?d=null:Ri(c,KM(this,!0))?d=!0:Ri(c,KM(this,!1))&&(d=!1);a.lp=d;bL(b,BD,null==d?CG:!0==d?zh:wg);return b};FL[K].yj=function(){return AD};function mDa(a,b,c){if(b){var d=KM(a,c);eL(b,d)||(Dj(nDa,function(a){a=KM(this,a);jL(b,a,a==d)},a),bL(b,BD,null==c?CG:!0==c?zh:wg))}}FL[K].$=function(){return Upa}; function KM(a,b){var c=a.$();if(!0==b)return c+mma;if(!1==b)return c+Dma;if(null==b)return c+Ema;throw m("Invalid checkbox state: "+b);};function LM(a,b,c){c=c||FL.Xb();OL[L](this,null,c,b);this.lp=Qh(a)?a:!1}X(LM,OL);var nDa={Fua:!0,Bwa:!1,Cwa:null};T=LM[K];T.Gb=null;T.Xl=function(){return!0==this.lp};T.Dg=function(a){a!=this.lp&&(this.lp=a,mDa(this.eb(),this.a(),this.lp))};T.Zl=function(a){this.yb?(this.ve(),this.Gb=a,this.Bb()):this.Gb=a};T.toggle=function(){this.Dg(this.lp?!1:!0)}; T.Bb=function(){LM.e.Bb[L](this);if(this.sL){var a=this.hc();this.Gb&&a.l(this.Gb,Fr,this.OV).l(this.Gb,gs,this.En).l(this.Gb,fs,this.uM).l(this.Gb,es,this.Le).l(this.Gb,FG,this.np);a.l(this.a(),Fr,this.OV)}if(this.Gb){if(!this.Gb.id){var a=this.Gb,b;b=this[Fz]()+Rma;a.id=b}a=this.a();bL(a,CF,this.Gb.id)}};T.Ga=function(a){LM.e.Ga[L](this,a);(a=this.a())&&bb(a,this[Ay]()?0:-1)};T.OV=function(a){a[Zp]();var b=this.lp?$Aa:Yra;this[Ay]()&&!a[Mq][Ic]&&this[$](b)&&(a[Hp](),this.toggle(),this[$](qD))}; T.ml=function(a){32==a[Np]&&this.OV(a);return!1};ML(Upa,function(){return new LM});function MM(a,b){rt[L](this);this.q=a;var c=bl(this.q)?this.q:this.q?this.q[Pd]:null;this.ena=!!c&&Kl(c);this.H8=kt(this.q,lk?loa:GG,this,b)}X(MM,rt); kp(MM[K],function(a){var b=0,c=0,d=0;a=a.Ka;if(a[H]==GG){c=1;if(kk||mk&&(gk||qk(lna)))c=40;d=$M(-a.wheelDelta,c);Qh(a.wheelDeltaX)?(b=$M(-a.wheelDeltaX,c),c=$M(-a.wheelDeltaY,c)):c=d}else d=a.detail,100<d?d=3:-100>d&&(d=-3),Qh(a[Oz])&&a[Oz]===a.HORIZONTAL_AXIS?b=d:c=d;di(this.yca)&&(b=nj(b,-this.yca,this.yca));di(this.zca)&&(c=nj(c,-this.zca,this.zca));this.ena&&(b=-b);b=new oDa(d,a,b,c);this[$](b)});function $M(a,b){return mk&&(fk||hk)&&0!=a%b?a:a/b} MM[K].w=function(){MM.e.w[L](this);pt(this.H8);this.H8=null};function oDa(a,b,c,d){$s[L](this,b);ab(this,GG);this.detail=a;this.Nt=c;this.lr=d}X(oDa,$s);function aN(){rt[L](this);this.n=0;ww(this,null);this.Ks=null}X(aN,rt);aN[K].Zt=function(){return 1==this.n};aN[K].nH=function(){this.Qi(hra)};aN[K].Zw=function(){this.Qi(oE)};aN[K].Qi=function(a){this[$](a)};function bN(){aN[L](this);this.Cr=[]}X(bN,aN);bN[K].add=function(a){Ri(this.Cr,a)||(this.Cr[C](a),kt(a,BE,this.uda,!1,this))};va(bN[K],function(a){Wi(this.Cr,a)&&ot(a,BE,this.uda,!1,this)});bN[K].w=function(){Y(this.Cr,function(a){a.W()});jb(this.Cr,0);bN.e.w[L](this)};function cN(){bN[L](this);this.R_=0}X(cN,bN); cN[K].play=function(a){if(0==this.Cr[J])return!1;if(a||0==this.n)this.R_=0,this.nH();else if(this.Zt())return!1;this.Qi(hH);-1==this.n&&this.Qi(Tya);var b=-1==this.n&&!a;ww(this,hi());this.Ks=null;this.n=1;Y(this.Cr,function(c){b&&-1!=c.n||c[fz](a)});return!0};zp(cN[K],function(a){Y(this.Cr,function(b){0==b.n||b[Hq](a)});this.n=0;this.Ks=hi();this.Qi(sI);this.Zw()});cN[K].uda=function(){this.R_++;this.R_==this.Cr[J]&&(this.Ks=hi(),this.n=0,this.Qi(BE),this.Zw())};function dN(a,b,c){this.yr=a;this.Nu=b||0;this.Td=c;this.Yr=W(this.zJ,this)}X(dN,Us);T=dN[K];T.bc=0;T.w=function(){dN.e.w[L](this);this[Hq]();delete this.yr;delete this.Td};La(T,function(a){this[Hq]();this.bc=ut(this.Yr,Qh(a)?a:this.Nu)});zp(T,function(){this.nk()&&vt(this.bc);this.bc=0});T.VR=function(){this[Hq]();this.zJ()};T.nk=function(){return 0!=this.bc};T.zJ=function(){this.bc=0;this.yr&&this.yr[L](this.Td)};var eN={},fN=null;function gN(a){a=fi(a);delete eN[a];Kj(eN)&&fN&&fN[Hq]()}function pDa(){fN||(fN=new dN(function(){qDa()},20));var a=fN;a.nk()||a[y]()}function qDa(){var a=hi();Dj(eN,function(b){rDa(b,a)});Kj(eN)||pDa()};function hN(a,b,c,d){aN[L](this);if(!Yh(a)||!Yh(b))throw m("Start and end parameters must be arrays");if(a[J]!=b[J])throw m("Start and end points must be the same length");this.Ei=a;this.Iq=b;this.duration=c;this.Yca=d;$w(this,[]);this.nx=!1}X(hN,aN);T=hN[K];T.wt=function(a){this.nx=a};T.Nm=0; T.play=function(a){if(a||0==this.n)this.Nm=0,$w(this,this.Ei);else if(this.Zt())return!1;gN(this);a=hi();ww(this,a);-1==this.n&&ww(this,this[Iy]-this[xz]*this.Nm);this.Ks=this[Iy]+this[xz];this.Nm||this.nH();this.Qi(hH);-1==this.n&&this.Qi(Tya);this.n=1;var b=fi(this);b in eN||(eN[b]=this);pDa();rDa(this,a);return!0};zp(T,function(a){gN(this);this.n=0;a&&(this.Nm=1);sDa(this,this.Nm);this.Qi(sI);this.Zw()});T.w=function(){0==this.n||this[Hq](!1);this.Qi(bta);hN.e.w[L](this)}; function rDa(a,b){a.Nm=(b-a[Iy])/(a.Ks-a[Iy]);1<=a.Nm&&(a.Nm=1);sDa(a,a.Nm);1==a.Nm?(a.n=0,gN(a),a.Qi(BE),a.Zw()):a.Zt()&&a.bZ()}function sDa(a,b){ei(a.Yca)&&(b=a.Yca(b));$w(a,ha(a.Ei[J]));for(var c=0;c<a.Ei[J];c++)a[Iz][c]=(a.Iq[c]-a.Ei[c])*b+a.Ei[c]}T.bZ=function(){this.Qi(yqa)};T.Qi=function(a){this[$](new tDa(a,this))};function tDa(a,b){Xs[L](this,a);$w(this,b[Iz]);this.x=b[Iz][0];this.y=b[Iz][1];this.z=b[Iz][2];this.duration=b[xz];this.Nm=b.Nm;qp(this,b.n)}X(tDa,Xs);function iN(a,b,c,d,e){hN[L](this,b,c,d,e);cx(this,a)}X(iN,hN);T=iN[K];T.Px=Th;T.Lg=function(){Qh(this.jo)||(this.jo=Kl(this[Mz]));return this.jo};T.bZ=function(){this.Px();iN.e.bZ[L](this)};T.Zw=function(){this.Px();iN.e.Zw[L](this)};T.nH=function(){this.Px();iN.e.nH[L](this)};function jN(a,b,c,d,e){if(2!=b[J]||2!=c[J])throw m(tpa);iN[Mc](this,arguments)}X(jN,iN);jN[K].Px=function(){var a=this.nx&&this.Lg()?zs:Qg;this[Mz][x][a]=h[D](this[Iz][0])+S;this[Mz][x].top=h[D](this[Iz][1])+S}; function kN(a,b,c,d,e){if(2!=b[J]||2!=c[J])throw m(tpa);iN[Mc](this,arguments)}X(kN,iN);kN[K].Px=function(){pa(this[Mz][x],h[D](this[Iz][0])+S);Sa(this[Mz][x],h[D](this[Iz][1])+S)};function lN(a,b,c,d,e){iN[L](this,a,[b],[c],d,e)}X(lN,iN);lN[K].Px=function(){pa(this[Mz][x],h[D](this[Iz][0])+S)};function mN(a,b,c,d,e){iN[L](this,a,[b],[c],d,e)}X(mN,iN);mN[K].Px=function(){Sa(this[Mz][x],h[D](this[Iz][0])+S)};function nN(){rt[L](this)}X(nN,rt);T=nN[K];T.hd=0;T.qo=0;T.Sm=100;T.Gl=0;T.Ui=1;T.tk=!1;T.Lx=!1;T.wa=function(a){a=oN(this,a);this.hd!=a&&(this.hd=a+this.Gl>this.Sm?this.Sm-this.Gl:a<this.qo?this.qo:a,this.tk||this.Lx||this[$](qD))};fb(T,function(){return oN(this,this.hd)});T.VQ=function(a){a=oN(this,a);this.Gl!=a&&(this.Gl=0>a?0:this.hd+a>this.Sm?this.Sm-this.hd:a,this.tk||this.Lx||this[$](qD))};T.fl=function(){var a=this.Gl;return null==this.Ui?a:h[D](a/this.Ui)*this.Ui}; T.Gs=function(a){if(this.qo!=a){var b=this.tk;this.tk=!0;this.qo=a;a+this.Gl>this.Sm&&(this.Gl=this.Sm-this.qo);a>this.hd&&this.wa(a);a>this.Sm&&(this.Gl=0,this.nq(a),this.wa(a));(this.tk=b)||this.Lx||this[$](qD)}};T.Ye=function(){return oN(this,this.qo)};T.nq=function(a){a=oN(this,a);if(this.Sm!=a){var b=this.tk;this.tk=!0;this.Sm=a;a<this.hd+this.Gl&&this.wa(a-this.Gl);a<this.qo&&(this.Gl=0,this.Gs(a),this.wa(this.Sm));a<this.qo+this.Gl&&(this.Gl=this.Sm-this.qo);(this.tk=b)||this.Lx||this[$](qD)}}; T.Xe=function(){return oN(this,this.Sm)};T.dI=function(){return this.Ui};T.GQ=function(a){this.Ui!=a&&(this.Ui=a,a=this.tk,this.tk=!0,this.nq(this.Xe()),this.VQ(this.fl()),this.wa(this[I]()),(this.tk=a)||this.Lx||this[$](qD))};function oN(a,b){return null==a.Ui?b:a.qo+h[D]((b-a.qo)/a.Ui)*a.Ui};function pN(a,b){VK[L](this,a);this.J9=null;this.ze=new nN;this.$ja=b||Jda;kt(this.ze,qD,this.Kaa,!1,this)}X(pN,VK);var uDa={yS:Eh,xS:Jg};T=pN[K];T.ib=Jg;T.BP=!1;T.nia=!1;T.Im=10;T.PQ=0;T.e7=!0;T.zM=0;T.mia=1E3;T.qg=!0;T.Yk=!1;T.h=function(){pN.e.h[L](this);var a=this.ea().h(Q,this.$(this.ib));this.mf(a)};T.mf=function(a){pN.e.mf[L](this,a);fL(a,this.$(this.ib));this.Vha();a=this.a();aL(a,hI);vDa(this)}; T.Bb=function(){pN.e.Bb[L](this);this.Sk=new kL(this.ld);this.dp=new kL(this.Bi);this.Sk.wt(this.Yk);this.dp.wt(this.Yk);this.Sk.Jw=this.dp.Jw=Th;this.lf=new CL(this.a());wDa(this,!0);bb(this.a(),0);qN(this)}; function wDa(a,b){b?(a.hc().l(a.Sk,MC,a.FN).l(a.dp,MC,a.FN).l(a.Sk,[nI,oE],a.Tt).l(a.dp,[nI,oE],a.Tt).l(a.lf,vF,a.mm).l(a.a(),Fr,a.JN).l(a.a(),es,a.JN),a.e7&&xDa(a,!0)):(a.hc().uc(a.Sk,MC,a.FN).uc(a.dp,MC,a.FN).uc(a.Sk,[nI,oE],a.Tt).uc(a.dp,[nI,oE],a.Tt).uc(a.lf,vF,a.mm).uc(a.a(),Fr,a.JN).uc(a.a(),es,a.JN),a.e7&&xDa(a,!1))}T.ve=function(){pN.e.ve[L](this);wia(this.Sk,this.dp,this.lf,this.Rl)}; T.FN=function(a){var b=a.XX==this.Sk?this.ld:this.Bi,c;this.ib==Eh?(c=this.a()[Wd]-b[Uc],c=(c-a.top)/c*(this.Xe()-this.Ye())+this.Ye()):(c=this.a()[Gd]-b[zb],c=a[G]/c*(this.Xe()-this.Ye())+this.Ye());c=a.XX==this.Sk?h.min(h.max(c,this.Ye()),this[I]()+this.fl()):h.min(h.max(c,this[I]()),this.Xe());rN(this,b,c)};T.Tt=function(a){var b=a[H]==nI;jL(this.a(),jqa,b);jL(a[Mq][py],kqa,b);a=a.XX==this.Sk;b?(this[$](jE),this[$](a?bg:lg)):(this[$](vg),this[$](a?fg:ng))}; T.mm=function(a){var b=!0;switch(a[Np]){case 36:sN(this,this.Ye());break;case 35:sN(this,this.Xe());break;case 33:tN(this,this.Im);break;case 34:tN(this,-this.Im);break;case 37:var c=this.Yk&&this.Lg()?1:-1;tN(this,a[Oq]?c*this.Im:c*this.Qx);break;case 40:tN(this,a[Oq]?-this.Im:-this.Qx);break;case 39:c=this.Yk&&this.Lg()?-1:1;tN(this,a[Oq]?c*this.Im:c*this.Qx);break;case 38:tN(this,a[Oq]?this.Im:this.Qx);break;default:b=!1}b&&a[Hp]()}; T.JN=function(a){this.a()[Fx]&&this.a()[Fx]();var b=a[Mq];dl(this.ld,b)||dl(this.Bi,b)||(b=a[H]==Fr,b&&hi()<this.zM+this.mia||(b||(this.zM=hi()),this.nia?sN(this,yDa(this,a)):(this.UW(a),this.xm=zDa(this,yDa(this,a)),this.W6=this.ib==Eh?this.tw<this.xm[Tc]:this.tw>uN(this,this.xm)+this.xm[zb],a=Gk(this.a()),this.hc().l(a,FG,this.QW,!0).l(this.a(),EG,this.UW),this.kt||(this.kt=new tt(200),this.hc().l(this.kt,Fs,this.X6)),this.X6(),this.kt[y]())))}; T.G7=function(a){tN(this,(0<a.detail?-1:1)*this.Qx);a[Hp]()};T.X6=function(){var a;if(this.ib==Eh){var b=this.tw,c=this.xm[Tc];this.W6?b<c&&(a=vN(this,this.xm)+this.Im):b>c+this.xm[Uc]&&(a=vN(this,this.xm)-this.Im)}else b=this.tw,c=uN(this,this.xm),this.W6?b>c+this.xm[zb]&&(a=vN(this,this.xm)+this.Im):b<c&&(a=vN(this,this.xm)-this.Im);Qh(a)&&rN(this,this.xm,a)};T.QW=function(){this.kt&&this.kt[Hq]();var a=Gk(this.a());this.hc().uc(a,FG,this.QW,!0).uc(this.a(),EG,this.UW)}; function wN(a,b){var c=Ll(b,a.a());return a.ib==Eh?c.y:a.Yk&&a.Lg()?a.a()[Gd]-c.x:c.x}T.UW=function(a){this.tw=wN(this,a)};function yDa(a,b){var c=a.Ye(),d=a.Xe();if(a.ib==Eh){var e=a.ld[Uc],f=a.a()[Wd]-e,e=wN(a,b)-e/2;return(d-c)*(f-e)/f+c}e=a.ld[zb];f=a.a()[Gd]-e;e=wN(a,b)-e/2;return(d-c)*e/f+c}function vN(a,b){if(b==a.ld)return a.ze[I]();if(b==a.Bi)return a.ze[I]()+a.ze.fl();throw m("Illegal thumb element. Neither minThumb nor maxThumb");} function tN(a,b){h.abs(b)<a.dI()&&(b=uj(b)*a.dI());var c=vN(a,a.ld)+b,d=vN(a,a.Bi)+b,c=nj(c,a.Ye(),a.Xe()-a.PQ),d=nj(d,a.Ye()+a.PQ,a.Xe());xN(a,c,d-c)}function rN(a,b,c){var d=oN(a.ze,c);c=b==a.ld?d:a.ze[I]();b=b==a.Bi?d:a.ze[I]()+a.ze.fl();c>=a.Ye()&&b>=c+a.PQ&&a.Xe()>=b&&xN(a,c,b-c)}function xN(a,b,c){a.Ye()<=b&&b<=a.Xe()-c&&a.PQ<=c&&c<=a.Xe()-b&&(b!=a[I]()||c!=a.fl())&&(a.ze.Lx=!0,a.ze.VQ(0),a.ze.wa(b),a.ze.VQ(c),a.ze.Lx=!1,a.Kaa())}T.Ye=function(){return this.ze.Ye()};T.Gs=function(a){this.ze.Gs(a)}; T.Xe=function(){return this.ze.Xe()};T.nq=function(a){this.ze.nq(a)};function zDa(a,b){return b<=a.ze[I]()+a.ze.fl()/2?a.ld:a.Bi}T.Kaa=function(){qN(this);vDa(this);this[$](qD)}; function qN(a){if(a.ld&&!a.BP){var b=yN(a,vN(a,a.ld)),c=yN(a,vN(a,a.Bi));if(a.ib==Eh)a.ld[x].top=b.y+S,a.Bi[x].top=c.y+S,a.cg&&(b=zN(c.y,b.y,a.ld[Uc]),a.cg[x].top=b[by]+S,Sa(a.cg[x],b[ly]+S));else{var d=a.Yk&&a.Lg()?zs:Qg;a.ld[x][d]=b.x+S;a.Bi[x][d]=c.x+S;a.cg&&(b=zN(b.x,c.x,a.ld[zb]),a.cg[x][d]=b[by]+S,pa(a.cg[x],b[ly]+S))}}}function zN(a,b,c){var d=h[xb](c/2);return{offset:a+d,size:h.max(b-a+c-2*d,0)}} function yN(a,b){var c=new sk;if(a.ld){var d=a.Ye(),e=a.Xe(),d=b==d&&d==e?0:(b-d)/(e-d);a.ib==Eh?(e=a.ld[Uc],e=a.a()[Wd]-e,d=h[D](d*e),c.x=uN(a,a.ld),c.y=e-d):(e=a.a()[Gd]-a.ld[zb],d=h[D](d*e),c.x=d,c.y=a.ld[Tc])}return c} function sN(a,b){b=nj(b,a.Ye(),a.Xe());a.BP&&a.QM[Hq](!0);var c=new cN,d,e=zDa(a,b),f=a[I](),g=a.fl(),k=vN(a,e),l=yN(a,k);d=a.dI();h.abs(b-k)<d&&(b=nj(k+(b>k?d:-d),a.Ye(),a.Xe()));rN(a,e,b);k=yN(a,vN(a,e));d=a.ib==Eh?[uN(a,e),k.y]:[k.x,e[Tc]];l=new jN(e,[l.x,l.y],d,100);l.wt(a.Yk);c.add(l);a.cg&&ADa(a,e,f,g,k,c);a.J9&&(e=a.J9.Eta(f,b,100),Y(e,function(a){c.add(a)}));a.QM=c;a.hc().l(c,oE,a.jla);a.BP=!0;c[fz](!1)} function ADa(a,b,c,d,e,f){var g=yN(a,c),k=yN(a,c+d);c=g;d=k;b==a.ld?c=e:d=e;a.ib==Eh?(b=zN(k.y,g.y,a.ld[Uc]),g=zN(d.y,c.y,a.ld[Uc]),e=new jN(a.cg,[uN(a,a.cg),b[by]],[uN(a,a.cg),g[by]],100),b=new mN(a.cg,b[ly],g[ly],100)):(b=zN(g.x,k.x,a.ld[zb]),g=zN(c.x,d.x,a.ld[zb]),e=new jN(a.cg,[b[by],a.cg[Tc]],[g[by],a.cg[Tc]],100),b=new lN(a.cg,b[ly],g[ly],100));e.wt(a.Yk);b.wt(a.Yk);f.add(e);f.add(b)}T.jla=function(){this.BP=!1}; T.HG=function(a){if(this.ib!=a){var b=this.$(this.ib),c=this.$(a);this.ib=a;this.a()&&(a=this.a(),eL(a,b)&&(hL(a,b),fL(a,c)),b=this.Yk&&this.Lg()?zs:Qg,this.ld[x][b]=this.ld[x].top=O,this.Bi[x][b]=this.Bi[x].top=O,this.cg&&(this.cg[x][b]=this.cg[x].top=O,pa(this.cg[x],Sa(this.cg[x],O))),qN(this))}};T.Dr=function(){return this.ib}; T.w=function(){pN.e.w[L](this);this.kt&&this.kt.W();delete this.kt;this.QM&&this.QM.W();delete this.QM;delete this.ld;delete this.Bi;this.cg&&delete this.cg;this.ze.W();delete this.ze;this.lf&&(this.lf.W(),delete this.lf);this.Rl&&(this.Rl.W(),delete this.Rl);this.Sk&&(this.Sk.W(),delete this.Sk);this.dp&&(this.dp.W(),delete this.dp)};T.Qx=1;T.dI=function(){return this.ze.dI()};T.GQ=function(a){this.ze.GQ(a)};fb(T,function(){return this.ze[I]()});T.wa=function(a){rN(this,this.ld,a)};T.fl=function(){return this.ze.fl()}; T.VQ=function(a){rN(this,this.Bi,this.ze[I]()+a)};fw(T,function(a){Sl(this.a(),a);a&&qN(this)});function vDa(a){var b=a.a();b&&(bL(b,rBa,a.Ye()),bL(b,qBa,a.Xe()),bL(b,sBa,a[I]()),bL(b,tBa,a.$ja(a[I]())||O))}function xDa(a,b){b?(a.Rl||(a.Rl=new MM(a.a())),a.hc().l(a.Rl,GG,a.G7)):a.hc().uc(a.Rl,GG,a.G7)}T.Ga=function(a){this.qg!=a&&this[$](a?mE:dE)&&(this.qg=a,wDa(this,a),a||this.QW(),jL(this.a(),iqa,!a))};qw(T,function(){return this.qg});function uN(a,b){return a.Yk?RBa(b):b[Od]};V("google.visualization.drawToolbar",function(a,b){new BM(a,b)},void 0);var BDa=h.log(10);function AN(a){return a[ie](qe)}var CDa=["minorgridline",TE,BC,rI,JC,Pxa,LC,rF,JF,iD,cD,xC,mH,iH,HI,"axistick","axistitle",nD,zC,DF,GF,FF,rsa,Hs,qC];function BN(a,b,c){return{html:DDa(a),Eca:!1,Fca:c,anchor:c,Dca:b,Gca:20,margin:5}}function DDa(a){if(0==a[Ez][J])return{name:Q,content:[],fd:{className:OE}};var b=Pi(a[Ez],function(a){return a[H]==VH}),c;-1==b?c=EDa(a[Ez]):(c=EDa($i(a[Ez],0,b)),a=FDa($i(a[Ez],b+1)),c=Xi(c,{name:Q,fd:{className:Mua}},a));return{name:Q,content:c,fd:{className:OE}}}function EDa(a){return{name:SI,fd:{className:Lua},content:Gi(a,function(a){return{name:IF,content:GDa(a[Z]),fd:{className:Kua}}})}} function FDa(a){return{name:SI,fd:{className:Jua},content:Gi(a,function(a){return{name:IF,id:AN([qC,a[Z].id]),content:GDa(a[Z]),fd:{className:Iua}}})}}function GDa(a){return Gi(a[cy],function(a,c){switch(a[H]){case Es:var d=a[Z][x];return{name:Bs,style:pua+d.Va+una+(d.Ic?uF:R)+zna+(d.De?TI:R)+vna+(d[Ed]?UC:R)+Ye,ela:!!a[jy],content:(0==c?O:ne)+a[Z][cd]};case jI:return{name:Q,style:gg+(a[Z].brush&&a[Z].brush.gb())+Ye,fd:{className:Nua}}}})};function CN(a,b,c,d,e,f,g,k,l){var n={items:[]};null!=e&&(e=Zm(e,f),n[cy][C]({type:jI,data:{size:b[uc]/2,brush:e}}));null!=g&&n[cy][C](DN(g,b));if(null!=c){if(null==d)throw m("Line title is specified without a text style.");c=DN(c+Xe,d);n[cy][C](c)}c=DN(a,b,k);n[cy][C](c);null!=l&&(n.id=l,Ww(n,{brush:Ym}));return{type:JF,data:n}}function HDa(a){return{type:JF,data:{items:Gi(a,function(a){if(null!=a[cd])return DN(a[cd],a[x],a[jy]);throw m("Unrecognized item.");})}}} function IDa(){return{type:VH,data:{brush:$m(xA,1)}}}function DN(a,b,c){a={type:Es,data:{text:a,style:b}};c&&(a.html=!0);return a} function EN(a,b,c,d,e,f,g,k){if(k)return BN(a,e,f);for(var l=k=0;l<a[Ez][J];l++){var n=a[Ez][l];if(n[H]==JF)for(var n=n[Z],q=0;q<n[cy][J];q++){var s=n[cy][q];s[H]==Es&&(k=h.max(k,s[Z][x][uc]))}}0==k&&(k=g||0);var u;g=k;for(q=l=n=0;q<a[Ez][J];q++)switch(s=a[Ez][q],s[H]){case JF:s=JDa(s[Z],b);l+=s[A]+(0<q?s.Ou:0);n=h.max(n,s[r]);break;case VH:l+=1.5*g+s[Z].brush.Hb}n=h.max(n,2*g);n=h[D](n+2*g/1.618);g=h[D](l+2*g/1.618);u=new xk(n,g);var l=uj(d.x-f.x),n=uj(d.y-f.y),w=null,w=c?new sk(d.x+l*k,d.y+n*(k+ u[A]/2)):new sk(d.x+l*u[r]/2,d.y+n*u[A]/2),q=w.x-u[r]/2,s=q+u[r],z=w.y-u[A]/2,B=z+u[A];g={};c&&(c=new sk(w.x,pj(d.y,w.y,k/(k+u[A]/2))),w=new sk(pj(w.x,d.x,-1),c.y),c.x=h[D](c.x),c.y=h[D](c.y),w.x=h[D](w.x),w.y=h[D](w.y),g.zj=1==l*n?[c,d,w]:[w,d,c]);g.la=new rl(h[D](z),h[D](s),h[D](B),h[D](q));d=e[G]+5;c=e[Zc]-5;if(!(g.la[G]>=d&&g.la[Zc]<=c)){l=Qj(g);n=l.la[G];Ya(l.la,pj(f.x,l.la[Zc],-1));Ta(l.la,pj(f.x,n,-1));if(n=l.zj)q=n[0],n[0]=n[2],n[2]=q,n[0].x=pj(f.x,n[0].x,-1),n[1].x=pj(f.x,n[1].x,-1),n[2].x= pj(f.x,n[2].x,-1);l.la[G]>=d&&l.la[Zc]<=c?(g.la=l.la,g.zj=l.zj):(g.zj&&(n=new zm(d+4,c-4),q=new zm(l.zj[0].x,l.zj[2].x),s=new zm(g.zj[0].x,g.zj[2].x),!(n[y]<=s[y]&&n.end>=s.end)&&n[y]<=q[y]&&n.end>=q.end&&(g.la=l.la,g.zj=l.zj)),g.la[Zc]>c&&(Ya(g.la,g.la[G]-(g.la[Zc]-c)),Ta(g.la,c)),g.la[G]<d&&(Ta(g.la,g.la[Zc]+(d-g.la[G])),Ya(g.la,d)))}d=e.top+5;e=e[Hc]-5;if(!(g.la.top>=d&&g.la[Hc]<=e)){c=Qj(g);l=c.la.top;c.la.top=pj(f.y,c.la[Hc],-1);Na(c.la,pj(f.y,l,-1));if(l=c.zj)n=l[0],l[0]=l[2],l[2]=n,l[0].y= pj(f.y,l[0].y,-1),l[1].y=pj(f.y,l[1].y,-1),l[2].y=pj(f.y,l[2].y,-1);c.la.top>=d&&c.la[Hc]<=e?(g.la=c.la,g.zj=c.zj):(g.la[Hc]>e&&(g.la.top-=g.la[Hc]-e,Na(g.la,e)),g.la.top<d&&(Na(g.la,g.la[Hc]+(d-g.la.top)),g.la.top=d),delete g.zj)}f=k;e={};k=f/1.618;k=new rl(g.la.top+k,g.la[Zc]-k,g.la[Hc]-k,g.la[G]+k);d=[];var F=k.top,l=a[Ez][J],M=!1;for(c=0;c<l;c++)if(a[Ez][c].UI){M=!0;break}var N=[],n=[];for(c=0;c<l;c++)if(u=a[Ez][c],u[H]===JF){var P=u[Z],q=[];n[C](q);B=0;for(w=P[cy][J];B<w;B++){var ba=KDa(P[cy][B], b);q[C](ba);u.UI&&(B>N[J]-1?N[C](ba[r]):N[B]=h.max(N[B],ba[r]))}}q=[];s=[];z=0;if(M)for(c=0;c<l;c++)if(u=a[Ez][c],u[H]==JF){M=[];s[C](M);var U=0;if(u.UI)for(P=u[Z],B=0,w=P[cy][J];B<w;B++)ba=n[z][B],u=N[B]-ba[r],M[C](u),U+=u;q[C](U);z++}for(c=z=0;c<l;c++){u=a[Ez][c];N={ih:u,data:{}};switch(u[H]){case JF:P=u[Z];M=N[Z];U=JDa(P,b);u.UI&&pa(U,U[r]+q[z]);0<c&&(F+=U.Ou);P[Dz]&&Ww(M,{la:new rl(F-U.Ou/2,g.la[Zc],F+U[A]+U.Ou,g.la[G])});for(var qa=[],ya=k[G],B=0,w=P[cy][J];B<w;B++){P={};ba=n[z][B];u.UI&&pa(ba, ba[r]+s[z][B]);0<B&&(ya+=ba.iR);var Ha=F+(U[A]-ba[A])/2;P.la=new rl(h[D](Ha),h[D](ya+ba[r]),h[D](Ha+ba[A]),h[D](ya));qa[C](P);ya+=ba[r]}bw(M,qa);F+=U[A];z++;break;case VH:B=u[Z],w=F+f+B.brush.Hb/2,N[Z].line=new iK(g.la[G],w,g.la[Zc],w),F+=1.5*f+B.brush.Hb/2}d[C](N)}e.entries=d;return{outline:g,qH:e}}function JDa(a,b){for(var c=0,d=0,e=0,f=0;f<a[cy][J];f++)var g=KDa(a[cy][f],b),c=c+(g[r]+(0<f?g.iR:0)),d=h.max(d,g[A]),e=h.max(e,g[A]/2+g.Ou);return{width:c,height:d,Ou:e-d/2}} function KDa(a,b){switch(a[H]){case Es:var c=a[Z][x];return{width:b?b(String(a[Z][cd]),c)[r]:0,height:c[uc],Ou:c[uc]/3.236,iR:c[uc]/3.236};case jI:var d=c=a[Z][ly];return{width:c,height:c,Ou:d,iR:d};default:return d=c=a[Z][ly],{width:c,height:c,Ou:d,iR:d}}};function FN(){this.sc=new ck;this.uk=new ck;this.bi=new ck}T=FN[K];wa(T,function(){this.sc=new ck;this.uk=new ck;this.bi=new ck});T.o=function(){var a=new FN;a.sc=new ck(this.sc.La());a.uk=new ck(this.uk.La());a.bi=new ck(this.bi.La());return a};Za(T,function(a){return this.sc[cz](a.sc)&&this.uk[cz](a.uk)&&this.bi[cz](a.bi)});function GN(a,b){var c=[];Bj(b==JH?a.sc:a.uk,function(a){c[C](la(a,10))});return c}function HN(a){return GN(a,JH)} function IN(a){var b=[];Bj(a.bi,function(a){a=a[pc](Je);b[C]({row:la(a[0],10),column:la(a[1],10)})});return b}Tw(T,function(){for(var a=[],b=HN(this),c=GN(this,mg),d=IN(this),e=0;e<b[J];e++){var f={};f.row=b[e];f.column=null;a[C](f)}for(e=0;e<c[J];e++)f={row:null},f.column=c[e],a[C](f);for(e=0;e<d[J];e++)f={},f.row=d[e].row,f.column=d[e].column,a[C](f);return a});function JN(a,b){return a.sc[Lc](String(b))}function KN(a,b){return a.uk[Lc](String(b))} function LN(a,b,c){if(b==JH?JN(a,c[0]):b==mg?KN(a,c[0]):a.bi[Lc](String(c[0]+Je+c[1])))return!1;b==JH?a.sc.add(String(c[0])):b==mg?a.uk.add(String(c[0])):a.bi.add(String(c[0]+Je+c[1]));return!0}T.lq=function(a){return LN(this,JH,[a])};T.mg=function(a){return LN(this,mg,[a])};function MN(a,b,c){var d=JN(a,b);c&&a[Wb]();d?a.mB(b):a.lq(b)}function NN(a,b,c){var d=KN(a,b);c&&a[Wb]();d?a.a2(b):a.mg(b)} function ON(a,b,c,d){var e=a.bi[Lc](String(b+Je+c));d&&a[Wb]();e?a.bi[Lc](String(b+Je+c))&&a.bi[Ob](String(b+Je+c)):LN(a,oD,[b,c])}T.mB=function(a){if(!JN(this,a))return!1;this.sc[Ob](String(a));return!0};T.a2=function(a){if(!KN(this,a))return!1;this.uk[Ob](String(a));return!0}; Zv(T,function(a){var b=new ck,c=new ck,d=new ck;a||(a=[]);for(var e=0;e<a[J];e++){var f=a[e];null!=f.row&&null!=f.column?d.add(String(f.row+Je+f.column)):null!=f.row?b.add(String(f.row)):null!=f.column&&c.add(String(f.column))}var g=b.Il(this.sc),k=c.Il(this.uk),l=d.Il(this.bi);a=this.sc.Il(b);e=this.uk.Il(c);f=this.bi.Il(d);this.sc=b;this.uk=c;this.bi=d;b=new FN;b.sc=g;b.uk=k;b.bi=l;c=new FN;c.sc=a;c.uk=e;c.bi=f;return new LDa(b,c)});function LDa(a,b){this.eG=a;this.fG=b};function PN(a,b){if(a instanceof PN)this.rd=a.ZB();else{var c;if(c=Zh(a))t:{for(var d=c=0;d<a[J];d++){if(!Zh(a[d])||0<c&&a[d][J]!=c){c=!1;break t}for(var e=0;e<a[d][J];e++)if(!di(a[d][e])){c=!1;break t}0==c&&(c=a[d][J])}c=0!=c}if(c)this.rd=Yi(a);else if(a instanceof xk)this.rd=MDa(a[A],a[r]);else if(di(a)&&di(b)&&0<a&&0<b)this.rd=MDa(a,b);else throw m("Invalid argument(s) for Matrix contructor");}this.da=new xk(this.rd[0][J],this.rd[J])} function QN(a,b,c){for(var d=0;d<a.Ub()[A];d++)for(var e=0;e<a.Ub()[r];e++)b[L](c,a.rd[d][e],d,e,a)}function RN(a,b){var c=new PN(a.Ub());QN(a,function(d,e,f){c.rd[e][f]=b[L](void 0,d,e,f,a)});return c}function MDa(a,b){for(var c=[],d=0;d<a;d++){c[d]=[];for(var e=0;e<b;e++)c[d][e]=0}return c}T=PN[K];T.add=function(a){if(!yk(this.da,a.Ub()))throw m("Matrix summation is only supported on arrays of equal size");return RN(this,function(b,c,d){return b+a.rd[c][d]})}; function NDa(a,b){if(a.da[A]!=b.Ub()[A])throw m("The given matrix has height "+b.da[A]+", but needs to have height "+a.da[A]+Me);var c=new PN(a.da[A],a.da[r]+b.da[r]);QN(a,function(a,b,f){c.rd[b][f]=a});QN(b,function(a,b,f){c.rd[b][this.da[r]+f]=a},a);return c}Za(T,function(a,b){if(this.da[r]!=a.da[r]||this.da[A]!=a.da[A])return!1;for(var c=b||0,d=0;d<this.da[A];d++)for(var e=0;e<this.da[r];e++)if(!(h.abs(this.rd[d][e]-a.rd[d][e])<=(c||1E-6)))return!1;return!0}); T.bma=function(){if(this.da[r]!=this.da[A])throw m("An inverse can only be taken on a square matrix.");if(1==this.Ub()[r]){var a=SN(this,0,0);return 0==a?null:new PN([[1/a]])}for(var a=this.da[A],b=[],c=0;c<a;c++){b[c]=[];for(var d=0;d<a;d++)b[c][d]=c==d?1:0}a=new PN(b);b=ODa(NDa(this,a));return PDa(b,0,a.da[r]-1,a.da[A]-1)[cz](a)?PDa(b,a.da[r]):null}; function ODa(a){for(var b=new PN(a),c=0,d=0;d<b.da[A]&&!(c>=b.da[r]);d++){for(var e=d;0==b.rd[e][c];)if(e++,e==b.da[A]&&(e=d,c++,c==b.da[r]))return b;var f=a,g=d,k=f.rd[e];f.rd[e]=f.rd[g];f.rd[g]=k;e=b.rd[d][c];for(f=c;f<b.da[r];f++)b.rd[d][f]/=e;for(e=0;e<b.da[A];e++)if(e!=d)for(g=b.rd[e][c],f=c;f<b.da[r];f++)b.rd[e][f]-=g*b.rd[d][f];c++}return b}T.Ub=function(){return this.da};function TN(a){var b=new PN(a.da[r],a.da[A]);QN(a,function(a,d,e){b.rd[e][d]=a});return b} function SN(a,b,c){return 0<=b&&b<a.da[A]&&0<=c&&c<a.da[r]?a.rd[b][c]:null}T.multiply=function(a){if(a instanceof PN){if(this.da[r]!=a.Ub()[A])throw m("Invalid matrices for multiplication. Second matrix should have the same number of rows as the first has columns.");return QDa(this,a)}if(di(a))return RDa(this,a);throw m("A matrix can only be multiplied by a number or another matrix.");}; T.w0=function(a){if(!yk(this.da,a.Ub()))throw m("Matrix subtraction is only supported on arrays of equal size.");return RN(this,function(b,c,d){return b-a.rd[c][d]})};T.ZB=function(){return this.rd};function PDa(a,b,c,d){var e=new PN((c?c:a.da[A]-1)-0+1,(d?d:a.da[r]-1)-b+1);QN(e,function(a,c,d){e.rd[c][d]=this.rd[0+c][b+d]},a);return e} function QDa(a,b){var c=new PN(a.da[A],b.Ub()[r]);QN(c,function(a,e,f){for(var g=a=0;g<this.da[r];g++)a+=SN(this,e,g)*SN(b,g,f);if(!(0<=e&&e<c.da[A]&&0<=f&&f<c.da[r]))throw m("Index out of bounds when setting matrix value, ("+e+Je+f+") in size ("+c.da[A]+Je+c.da[r]+Ge);c.rd[e][f]=a},a);return c}function RDa(a,b){return RN(a,function(a){return a*b})};function UN(a,b,c,d,e,f){var g=null!=e?e:1;if(0==g)return{F:[],ge:!1,Kg:0};e=[];b=SDa(b,e,d,g,null!=f?f:!1,function(b){return a(b,c)[r]});return{F:e,ge:b.qs,Kg:b.Kg}} function SDa(a,b,c,d,e,f){var g=f(a);if(g<=c)return a&&Zi(b,a[hc]()[pc](me)),{qs:!1,Kg:g};if(1<d){for(var k=0,l=0,g=1;g<a[J];g++){var n=a[Bb](g);if(n==ne||n==me){var q=f(a[ec](0,g));if(q<=c)if(l=q,k=g,n==me)break;else continue;break}}if(0<k)return b[C](a[ec](0,k)),b=SDa(a[ec](k+1),b,c,d-1,!1,f),{qs:b.qs,Kg:h.max(l,b.Kg)}}if(e&&(d=f(a[ec](0,1)+Ne),c<d)){for(g=h.min(a[J],5);1<=g;g--)if(d=f(a[ec](0,g)),d<=c)return b[C](a[ec](0,g)),{qs:!0,Kg:d};return{qs:!0,Kg:0}}d=f(Ne);if(c<d){for(g=2;1<=g;g--)if(a= f("..."[ec](0,g)),a<=c)return b[C]("..."[ec](0,g)),{qs:!0,Kg:a};return{qs:!0,Kg:0}}for(g=a[J]-1;1<=g;g--)if(e=a[ec](0,g)+Ne,l=f(e),l<=c)return b[C](e),{qs:!0,Kg:l};b[C](Ne);return{qs:!0,Kg:d}}function TDa(a){var b={background:Lva,padding:TA,border:dna};null!=a[uc]&&(Ja(b,a[uc]+S),b.margin=a[uc]+S);null!=a.Va&&Ew(b,a.Va);return b};function VN(a){this.Yr=a;this.es=ea;this.ZC=0;a=new tt(15);Vs(this,a);kt(a,Fs,W(this.n1,this));this.Sc=a}X(VN,Us);function WN(a,b){var c=a.es;a.es=h.min(a.es,b);xj(a.es)?xj(c)||a.Sc[y]():a.Sc[Hq]()}VN[K].n1=function(){var a=hi();this.es-=a-this.ZC;this.ZC=a;0>=this.es&&(this.Yr(),this.es=ea,this.Sc[Hq]())};function XN(a,b){var c=b?UDa:VDa,d=c[J];this.Kk=[];for(var e=1+h[t]((a-1)/d),f=h[xb](a/e),g=[],k=0;k<d;k++)c[k][1]<f&&g[C](c[k][0]);for(k=0;k<a;k++){var c=g[b?k%f:h[t](k/e)],l=h.pow(b?0.7:0.85,b?h[t](k/f):k%e);this.Kk[k]=Gi(c,function(a){return~~(l*a+255*(1-l))})}} var VDa=[[[67,69,157],6],[[67,116,224],0],[[83,168,251],1],[[26,135,99],7],[[95,150,84],4],[[185,194,70],9],[[241,202,58],2],[[228,147,7],3],[[231,113,27],8],[[211,54,45],5],[[135,27,71],10]],UDa=[[[67,69,157],6],[[83,168,251],8],[[95,150,84],10],[[241,202,58],2],[[231,113,27],5],[[135,27,71],4],[[67,116,224],0],[[26,135,99],1],[[185,194,70],9],[[228,147,7],7],[[211,54,45],3]];XN[K].Ub=function(){return this.Kk[J]};XN[K].Hd=function(a){return Wya+this.Kk[a]+Ge}; function YN(a,b){function c(a){a=a[hc](16);1==a[J]&&(a=Oe+a);return a}var d=a.Kk[b];return qe+(c(d[0])+c(d[1])+c(d[2]))[ge]()};function ZN(){this.$C=this.z2=null}function WDa(a){var b=new ZN;b.z2=a;return b}function XDa(a){var b=new ZN;b.$C=a;return b}function $N(a){if(null!=a.z2)return a.z2;throw m("AbstractRenderer not set");}ZN[K].Aw=function(){if(null!=this.$C)return this.$C;throw m("Scene not set");};function aO(a,b){this.rg=a;this.dc=null!=b&&Pj(b)||{}}function bO(a){return cO(new aO(VB),WB,a)}function dO(a,b){return cO(cO(new aO(rB),WB,b),coa,a)}function eO(a){a=eo(a);return new aO(a.rg,a.dc)}aO[K].o=function(){return eO(this.Hn())};Za(aO[K],function(a){if(!a||this.rg!=a.rg)return!1;var b=Ij(this.dc);return b[J]!==Ij(a.dc)[J]?!1:Ni(Gi(b,W(function(b){return this.dc[b]===a.dc[b]},this)),kj)});function cO(a,b,c){a.dc[b]=c;return a}ab(aO[K],function(){return this.rg});aO[K].Hn=function(){return Tm(this)};function YDa(a){ab(this,a);ra(this,null)}function fO(a,b){bi(a)&&(a=new YDa(a));this.Gp=a;this.Fp=[];b&&this.Fp[C](b)}function ZDa(){this.Wr=[];this.Xr=[];this.HQ=!1};function gO(){Uv(this,new FN);this.ci=this.Qm=this.af=null}gO[K].o=function(){var a=new gO;Uv(a,this[ux].o());a.af=this.af?this.af.o():null;a.Qm=this.Qm?this.Qm.o():null;a.ci=this.ci?this.ci.o():null;return a};Za(gO[K],function(a){return this[ux][cz](a[ux])&&(this.af?this.af[cz](a.af):!a.af)&&(this.Qm?this.Qm[cz](a.Qm):!a.Qm)&&(this.ci?this.ci[cz](a.ci):!a.ci)});function $Da(a){this.n=null;this.eu=[];this.iI=a}T=$Da[K];T.hI=function(a){if(this.n[cz](a))return{HQ:!1,Wr:[],Xr:[]};var b=this.eu;a=this.ql(a);return this.XI(a,b)};T.ql=function(a){if(null==this.iI)return[];var b=Hi(this.iI,function(b,d){Zi(b,d.ql(a));return b},[],this);this.eu=b;this.n=a.o();return b};T.XI=function(a,b){var c=this.Wu(a),d=this.Wu(b),e=c.Il(d),c=d.Il(c),d=new ZDa;d.Wr=this.Xu(e);d.Xr=this.Xu(c);return d};T.Wu=function(a){a=Gi(a,function(a){return Tm(a)});return new ck(a)}; T.Xu=function(a){a=a.La();return Gi(a,function(a){a=eo(a);a.Fp=Gi(a.Fp,function(a){return new aO(a.rg,a.dc)});return a})};function hO(a,b){this.Tma=new ck(a);this.Uma=new ck(b)};function iO(a){hO[L](this,a,[eF,fF])}X(iO,hO);iO[K].SQ=function(a,b,c){if(b==eF){if(!a[cz](c.af))return c.af=a,!0}else if(null!=c.af)return c.af=null,!0;return!1};iO[K].ql=function(a){return null!=a.af?[new fO(zg,a.af)]:[]};function aEa(){};function jO(a,b,c,d,e){this.WB=a;this.G=b;this.Wd=WDa(b);this.Pq=c;this.hu=null;this.Ax=bEa;this.ur=d;this.FQ=e;this.eo=null}X(jO,aEa);T=jO[K];Ep(T,function(a){this.hu={};var b=this.G;b[Wb]();this.eo=this.WB.yu(a,this.Pq);a=this.eo.Ub();a=b.wk(a[r],a[A]);for(var c=0;c<this.Ax[J];c++){var d=this.Ax[c],e=b.za();b[p](a,e);this.hu[d]=e}this.eo[Nq](this);this.z_(a)});T.MI=function(a){this.Ax=a};aw(T,function(a){this.YJ(a.Xr,!1);this.YJ(a.Wr,!0);this.eo[Nq](this)}); T.YJ=function(a,b){for(var c=0;c<a[J];c++)for(var d=a[c],e=d.Fp,f=0;f<e[J];f++)this.eo.Pm(e[f],d.Gp,b)};T.z_=function(a){var b=this.G;b.Fb(a,OD,Ys);b.Fb(a,gs,this.FQ(W(this[Pp],this,eF)));b.Fb(a,fs,this.FQ(W(this[Pp],this,fF)));b.Fb(a,Fr,this.FQ(W(this[Pp],this,Fr)))};kp(T,function(a,b){b[Zp]&&b[Zp]();var c=this.G.Er(b[Mq]);c!=ag&&(c=eO(c),this.ur(c,a))});T.eb=function(){return this.Wd};T.qe=function(a,b,c,d){null!=b?this.s2(a,b):this.Cn(a,c,d)}; T.Cn=function(a,b,c){this.G[p](this.hu[c],a);this.G.zn(a,b.Hn())};T.s2=function(a,b){cl(b)[Ty](a,b);var c=this.G.Er(b);this.G.zn(a,c)};T.Ff=function(a){this.G.Ff(a)};var bEa=[GC,LH,KH,kC,jC];function kO(a){this.hy=a;this.n=null}kO[K].vc=function(a){this.n=a.o()};kO[K].nv=function(a){var b=this.n;a[ux][cz](b[ux])||this[$](As,null);null===a.ci||a.ci[cz](b.ci)||this[$](As,null);var c=a.af,d=b.af,e=c;if(!c&&d||c&&!c[cz](d)){var b=UG,f;if(!d)f=c.dc.ROW_INDEX;else if(!c)b=TG,f=d.dc.ROW_INDEX,e=d;else if(d[H]()!==c[H]()||d.dc.ROW_INDEX!==c.dc.ROW_INDEX)f=c.dc.ROW_INDEX;c={row:f};e&&(e=e.dc.DATE,null!=e&&(c.date=e));this[$](b,c)}this.n=a.o()};dp(kO[K],function(a,b){hu(this.hy,a,b)});function lO(a,b){this.n=null;this.iI=b;this.Xa=new VN(a);Vs(this,this.Xa)}X(lO,Us);lO[K].vc=function(a){this.n=a};lO[K].eI=function(){return W(this[Pp],this)};kp(lO[K],function(a,b){if(null!=this.iI){var c=!1;Y(this.iI,function(d){d.Tma[Lc](a[H]())&&d.Uma[Lc](b)&&(d=d.SQ(a,b,this.n),c=c||d)},this);c&&WN(this.Xa,50)}});function mO(a,b,c,d,e){this.WB=a;qp(this,null);this.qI=null;a=this.WB.my();this.I$=new $Da(a);var f=e(W(this.Lh,this,!0));this.ur=new lO(f,a);Vs(this,this.ur);this.H$=this.WB.Hx(b,c,this.ur.eI(),e);this.D_=new kO(d)}X(mO,Us);Ep(mO[K],function(a,b){qp(this,b.o());this.ur.vc(this[dq]);this.D_.vc(this[dq]);var c=this.I$.ql(this[dq]);this.H$[Nq](a,c);this.qI=this[dq].o();this.D_[$](ws,null)});mO[K].Lh=function(a){var b=this.I$.hI(this[dq]);this.H$.refresh(b);this.qI=this[dq].o();a&&this.D_.nv(this[dq])}; Zv(mO[K],function(a){this.Lh(!0);this[dq][ux][Yx](a);this.Lh(!1)});Tw(mO[K],function(){if(null==this.qI.ci)return this.qI[ux][wz]();var a=this.qI.ci,b={};null!=a.dc.DATE&&(b.date=a.dc.DATE);null!=a.dc.ROW_INDEX&&(b.row=a.dc.ROW_INDEX);return[b]});function nO(a){pu[L](this,a)}X(nO,pu);nO[K].my=function(){return null};nO[K].Wg=function(){Ws(this.Bd);this.Bd=null};Zv(nO[K],function(a){this.Bd&&this.Bd[Yx](a)});Tw(nO[K],function(){return this.Bd?this.Bd[wz]():[]});function oO(a){pu[L](this,a);this.$n=null}X(oO,nO);T=oO[K];T.Hx=function(a,b,c,d){if(null==b)throw m("Internal error: missing overlayArea");a=$N(a);return new jO(this,a,b,c,d)};T.Ym=function(a,b,c){Ss.oc(this.lb);c=new jn([c||{},this.uj()||{}]);var d=On(this.lb,c),e=Pn(this.lb,c),d=new xk(d,e),e=pn(c,IE);this.wba(d,a,e);this.$n.Io(W(this.xn,this,b,c,d,a),a)};T.wba=function(a,b,c){null!=this.$n?this.$n[Pz](a,b):this.$n=new vK(this.lb,a,b,c)}; T.xn=function(a,b,c,d){var e=this.$n.eb(),f=this.$n.Av();a=this.ps(a,b,W(e.vf,e),c).Zh();Ws(this.Bd);e=e instanceof dK?WDa(e):XDa(e);this.Bd=new mO(this,e,f,this,d);b=new gO(nn(b,oI));this.Bd[Nq](a,b)};T.Wg=function(){oO.e.Wg[L](this);Ws(this.$n);this.$n=null};function pO(){this.Kk=null;this.KJ=new Uj}pO[K].Ly=function(a){this.KJ.$e(a)||this.KJ.set(a,this.KJ.Lc())};pO[K].Ev=function(a){null==this.Kk&&(this.Kk=new XN(this.KJ.Lc()));return YN(this.Kk,this.KJ.get(a))};function qO(a,b,c){this.tm=a;this.Ot=b.o();this.ll=c};function rO(){this.cs=new Uj;this.JQ=null;this.D$=!0}rO[K].Sba=function(){return[]};Ep(rO[K],function(a){if(null==this.JQ){this.JQ=new Uj;var b=this.Sba(a);Y(b,W(this.Tba,this,a,this.JQ))}var b=this.EJ(a),c=new ck(this.cs.hk());Y(b,function(b){var e=b.Ot.Hn();c[Ob](e);this.Tba(a,this.cs,b)},this);this.D$&&Bj(c,function(b){var c=this.cs.get(b);a.Ff(c.tm);this.cs[Ob](b)},this)}); rO[K].Tba=function(a,b,c){var d=c.Ot.Hn(),e=b.get(d,null);e&&e.V0&&a.Ff(e.V0);c.ll[0]===iC?(Sl(e.tm,!1),e.V0=c.tm,e.Qoa=c.ll,a.Cn(e.V0,e.Ot,e.Qoa)):(null===e||e.ll!==c.ll?(null!=e&&a.Ff(e.tm),a.Cn(c.tm,c.Ot,c.ll)):a.qe(c.tm,e.tm,c.Ot,c.ll),b.set(d,c))};function cEa(a,b){dEa(b);return 0==b[J]?null===a?0:a:Hi(b,function(a,b){return a+b},0)}function eEa(a,b){dEa(b);if(0==b[J])return a;var c=Fi(b,function(a){return null!=a});return 0==c[J]?null:cEa(a,c)/c[J]}function dEa(a){Y(a,function(){})};function sO(a){this.Vj=gj({},a);this.i2=gj({},a)}function tO(a,b,c){var d=a.Vj[J];for(a.Vj[b]=c;b<d;++b)a.i2[b]=uO(a,0==b?{}:a.i2[b-1],a.Vj[b])}function fEa(a){var b=Vh(a);return b!=$g&&b!=dg||b==$g&&ei(a.o)||$h(a)}function uO(a,b,c){if(fEa(c)||fEa(b)||Vh(c)==dg)return c;if(Vh(b)==$g){var d=Pj(b);Dj(c,function(a,c){d[c]=c in b&&null!=b[c]?uO(this,b[c],a):a},a)}else d=Yi(b),Dj(c,function(a,c){d[c]=uO(this,b[c],a)},a);return d}sO[K].compact=function(){return Ai(this.i2)};function vO(a,b){this.bc=a;this.Oh=b}X(vO,Us);var gEa=[];T=vO[K];T.Kd=null;T.ie=null;T.jw=function(a){this.bc=a};Yw(T,function(){return this.bc});ip(T,function(){return this.Oh});T.getParent=function(){return this.Kd};T.dF=function(){return!this.Zf()};T.$f=function(){return this.ie||gEa};T.ff=function(a){return this.$f()[a]||null};T.Zf=function(){return this.$f()[J]};Kw(T,function(){var a=this.$f();return Hi(a,function(a,c){return h.max(a,c[ez]())},-1)+1}); function hEa(a){var b=[];for(a=a[mx]();a;)b[C](a),a=a[mx]();return b}Pa(T,function(a){do a=a[mx]();while(a&&a!=this);return ka(a)});T.eJ=function(a,b){function c(d,e){!1!==a[L](b,d,e)&&Y(d.$f(),function(a){c(a,e+1)})}c(this,0)};T.find=function(a,b){var c=[];this.eJ(function(d){a[L](b,d)&&c[C](d)});return c};T.vR=function(a,b,c,d){for(var e=a[L](d,this),f=[],g=this.$f(),k=0;k<g[J];k++){var l=g[k].vR(a,b,c,d);f[C](l)}a=b[L](d,e,f);c&&c[L](d,this,a);return a}; T.ua=function(a){a.Kd=this;this.ie=this.ie||[];this.ie[C](a);Vs(this,a)};function wO(a,b,c){vO[L](this,c,a);this.t=b}X(wO,vO);T=wO[K];T.Pa=function(){return this.t};function iEa(a){return a.Aa(0)||a[Lp]()}T.Yq=function(a){return this.P_(this.t.Yq,a)};fb(T,function(a){return this.P_(this.t[I],a)});T.Aa=function(a){return this.P_(this.t.Aa,a)};T.P_=function(a,b){var c=this[Fz]();return null!=c?(c=[c],Zi(c,$i(arguments,1)),a[Mc](this.t,c)):null};function xO(){this.hp=[];this.Rw={}}X(xO,Us);T=xO[K];T.NB=function(a){var b=a[Fz]();null!=b&&(this.Rw[b]=a)};Kw(T,function(){return Hi(this.hp,function(a,b){return h.max(a,b[ez]())},-1)});T.eJ=function(a,b){for(var c=this.hp,d=0;d<c[J];d++)c[d].eJ(a,b)};T.find=function(a,b){for(var c=[],d=this.hp,e=0;e<d[J];e++)Zi(c,d[e].find(a,b));return c};T.vR=function(a,b,c,d){for(var e=this.hp,f=0;f<e[J];f++)e[f].vR(a,b,c,d)};function yO(a,b){xO[L](this);if(2>a.H())throw m("Data table should have at least 2 columns");if(a.D(0)!=rh)throw m("Column 0 must be of type string");if(a.D(1)!=rh)throw m("Column 1 must be of type string");for(var c=this.rq(b),d=c.x5,e=c.y5,c=c.z5,f={},g=[],k=0;k<a.M();k++){var l=a[I](k,0);if(l){var n=f[l];n?null==n[Fz]()&&n.jw(k):(f[l]=n=new wO(l,a,k),g[C](n));if(l=n[I](1)){var q=f[l];q||(f[l]=q=new wO(l,a,null),g[C](q));if(n[mx]()){if(e)throw m("More than one row with the same id ("+n[Lp]()+")."); }else if(n!=q&&!n[Lc](q))q.ua(n);else if(d)throw m("Data contains a cycle: "+jEa(Xi(q,hEa(q)))+Me);}}}for(d=0;d<g[J];d++){n=g[d];if(c&&Wh(n[Fz]()))throw m('Failed to find row with id "'+n[Lp]()+'".');n[mx]()?this.NB(n):(e=n,this.hp[C](e),Vs(this,e),this.NB(e))}}X(yO,xO);function jEa(a){return Gi(a,function(a){return a[Lp]()})[hc]()}yO[K].rq=function(a){var b=new sO(2);tO(b,0,{x5:!0,y5:!0,z5:!0});null!=a&&tO(b,1,a);return b[My]()};function zO(a,b,c){xO[L](this);a=a.hp;for(var d=0;d<a[J];d++){var e=kEa(this,a[d],b,c);this.hp[C](e);Vs(this,e);this.NB(e)}}X(zO,xO);function kEa(a,b,c,d){var e=c[L](d,b);b=b.$f();for(var f=0;f<b[J];f++){var g=kEa(a,b[f],c,d);a.NB(g);e.ua(g)}return e};function AO(){};function lEa(a){this.vsa=a||String}var mEa={number:function(a,b){return b.vsa(a[id])},identifier:function(a){return a[yd]},"+":function(){return ala},"-":function(){return Uz},"--":function(){return Le},"=":function(){return ela},"*":function(){return $ka},"(":function(){return Fe},")":function(){return Ge},",":function(){return Ke},"^":function(){return zr}};lEa[K].B=function(a){return Gi(a,function(a){return mEa[a.vo()](a,this)},this)[ie](O)};function BO(){}X(BO,AO);BO[K].vo=function(){return Le};function CO(){}X(CO,AO);CO[K].vo=function(){return Ie};Th[K].zl=function(){return this};Th[K].Kx=function(){return!1};Th[K].J$=function(){return!1};function DO(a){this.$g=a}X(DO,Th);DO[K].join=function(a){var b=[];Y(this.$g,function(c,d){0<d&&b[C](a);Zi(b,c.Qk())});return b};DO[K].zl=function(){if(1===this.$g[J])return this.$g[0];var a=[];Y(this.$g,function(b){a[C](b.zl())});this.$g=a;return this};function EO(a){this.$g=a}X(EO,DO);EO[K].Qk=function(){var a=[];Y(this.$g,function(b){var c=b.Kx();0<a[J]&&c?(a[C](new BO),b=(new FO(b)).zl()):0<a[J]&&a[C](new CO);a=Xi(a,b.Qk())});return a};function GO(){}X(GO,AO);GO[K].vo=function(){return Ge};function HO(a){eb(this,a)}X(HO,AO);HO[K].vo=function(){return Dva};function IO(){}X(IO,AO);IO[K].vo=function(){return Fe};function JO(){}X(JO,AO);JO[K].vo=function(){return Je};function KO(a,b){this.$g=b;eb(this,a)}X(KO,DO);KO[K].zl=function(){return this};KO[K].Qk=function(){var a=[new HO(this[yd]),new IO];Zi(a,this[ie](new JO),[new GO]);return a};function LO(){}X(LO,AO);LO[K].vo=function(){return af};function MO(a){this.$g=a}X(MO,DO);MO[K].Qk=function(){return this[ie](new LO)};function NO(){}X(NO,AO);NO[K].vo=function(){return He};function OO(){}X(OO,AO);OO[K].vo=function(){return fma};function nEa(a){this.$g=[a]}X(nEa,DO);function FO(a){this.$g=[a]}X(FO,nEa);FO[K].zl=function(){var a=this.$g[0].zl();if(a.Kx()){if(a instanceof FO)return a.$g[0];if(a instanceof PO)return new PO(-a[I]());throw m("Unknown type of negative.");}return new FO(a)};FO[K].Qk=function(){return Xi([new OO],this.$g[0].Qk())};FO[K].Kx=function(){return this.zl()instanceof FO};function QO(a){Fw(this,a)}X(QO,AO);QO[K].vo=function(){return Yg};function PO(a){Fw(this,a)}X(PO,Th);PO[K].Qk=function(){return[new QO(this[id])]};PO[K].Kx=function(){return 0>this[id]};fb(PO[K],function(){return this[id]});PO[K].J$=function(){return!0};function RO(a,b){this.$g=a;this.z$=null!=b?b:!1}X(RO,DO);RO[K].zl=function(){RO.e.zl[L](this);var a=0,b=[],c=1;Y(this.$g,function(d){d.Kx()&&(d=(new FO(d)).zl(),a++);d.J$()&&(c*=d[I](),d=null);d&&b[C](d)});1!==c&&Vi(b,0,0,new PO(c));var d=new RO(b,this.z$);a%2&&(d=new FO(d));return d};RO[K].Qk=function(){return this.z$?Xi[Mc](null,Gi(this.$g,function(a){return a.Qk()})):this[ie](new NO)};RO[K].Kx=function(){var a=0;Y(this.$g,function(b){b.Kx()&&a++});return!!(a%2)};function oEa(a,b){this.xa=[];this.pca=a;this.qca=b}function SO(a,b){if(0<a.xa[J]){var c=a.xa[a.xa[J]-1][0],d=b-c;if(d>a.pca&&(d=h[D](d/a.pca),1<d))for(var e=1;e<d;e++){var f=e/d*(b-c)+c;a.xa[C]([f,a.qca(f)])}}a.xa[C]([b,a.qca(b)])}oEa[K].jq=function(){return this.xa};function pEa(a,b,c,d){a=qEa(a,b,c,{range:d[By],Oaa:d.Oaa,jz:1});return null===a||ga(a.So)?null:{data:a[Z],So:a.So,$s:{offset:a.oI[0],gJ:a.oI[1]}}};function TO(a,b){return 0>b?a/h.pow(10,-b):a*h.pow(10,b)}function UO(a){a=h.abs(0.4342944819032518*h.log(a));return 1E-7>h.abs(a-h[D](a))}function VO(a){return h[t](0.4342944819032518*h.log(a))}function WO(a){return h[xb](0.4342944819032518*h.log(a))};function rEa(){return{transform:function(a){return a},inverse:function(a){return a}}}function sEa(a){var b=tEa(a);return{transform:function(a){var d=uEa(b,a,function(a){return a[Rp]});return null===d?a:d[Mq]+(a-d[Rp])*d.kD},inverse:function(a){var d=uEa(b,a,function(a){return a[Mq]});return null===d?a:0==d.kD?d[Rp]:d[Rp]+(a-d[Mq])/d.kD}}} function tEa(a){for(var b=[],c=0,d=null,e=0;e<a[J];e++){var f=a[e],g=f.Zka,k=f[y],f=f.end,l=g/(f-k);null===d||d!=k?(d={source:k,target:k+c,kD:l},b[C](d)):(d=b[b[J]-1],d.kD=l);b[C]({source:f,target:k+c+g,kD:1});c+=g-(f-k);d=f}return b}function uEa(a,b,c){b=aj(a,{source:b,target:b,kD:0},function(a,b){var f=c(a),g=c(b);return f<g?-1:f>g?1:0});0>b&&(b=-b-2);return 0>b?null:a[b]}function vEa(){return{transform:function(a){return h.log(a)/h[kz]},inverse:function(a){return h.pow(10,a)}}} function wEa(a){return{transform:function(b){return b>a?h.log(b/a)/h[kz]:b<-a?-h.log(-b/a)/h[kz]:0},inverse:function(b){return 0<b?h.pow(10,b)*a:0>b?-h.pow(10,-b)*a:0}}}var xEa={Sva:gH,pva:OF,Eva:BG};function XO(a,b,c){return(c=Hn(a,c,xEa))?c:pn(a,b)?OF:gH}function yEa(a,b,c){switch(a){case gH:return Si(c)?rEa():sEa(c);case OF:return vEa();case BG:return wEa(b);default:return rEa()}};function zEa(a,b){return h.abs(a-b)}function AEa(a,b,c){if(!a||!b)return!0;var d=c||zEa;return Rda(a,function(a,c){var g=b[c];return!Qh(b[c])||0.05>=d(a,g)})}function BEa(a,b,c){if(0==a.x||0==b.x)return{x:0,y:(0==a.x&&0==b.x?0:0==a.x?a.y:b.y)*c/6};c=c/3*h.min(h.abs(a.x),h.abs(b.x));b=(a.y/a.x+b.y/b.x)/2;return 0<a.x?{x:c,y:c*b}:{x:-c,y:-c*b}}function CEa(a,b,c){var d=a.hba(),e=b.hba();if(0==d||0==e)return new kK(0,0);d=h[ud](d/e);a=lK(a.o()[Fy](1/d),b.o()[Fy](d));a[Fy](c/6);return a} function YO(a,b,c,d,e){c=c?BEa:CEa;for(var f=[],g=0;g<a[J];++g){var k,l;e?(k=DEa(a,g,1,d),l=DEa(a,g,-1,d)):(k=d?(g+1)%a[J]:g+1,l=d?(a[J]+g-1)%a[J]:g-1);null!=k&&null!=l&&null!=a[g]&&null!=a[l]&&null!=a[k]?(k=c(mK(a[g],a[l]),mK(a[k],a[g]),b),f[C]([mK(a[g],k),lK(a[g],k)])):null!=a[g]?f[C]([a[g].o(),a[g].o()]):f[C](null)}return f}function DEa(a,b,c,d){var e=b+c;for(d&&(e=(e+a[J])%a[J]);e!=b&&0<=e&&e<a[J];){if(null!=a[e])return e;e+=c;d&&(e=(e+a[J])%a[J])}return null} function ZO(a,b,c){c=c||0;var d=Pi(b,function(b){return b[c]>a});return-1==d?b[J]-1:0==d?0:b[d][c]-a<a-b[d-1][c]?d:d-1}function EEa(a,b,c){var d;d=d||0;c=c||0;if(0<b[J]&&a<=Ai(b))return c=ZO(a,b,d),[c,b[c][d]];var e=b[J]-1-c,f=Ai(b)[d],g=b[e][d],k=f-g,l=h[t]((a-f)/k);a=a-f-l*k;e=Gi($i(b,e),function(a){return[a[d]-g]});a=ZO(a,e,0);return[b[J]-1+l*c+a,f+l*k+e[a][0]]}function $O(a,b,c){for(var d=[],e=0;e<a;e++)d[e]=b[L](c,e);return d}function FEa(a){return null!=a.max?a.max:a.min} function GEa(a,b,c,d){Qh(c)||(c=0);Qh(d)||(d=a[J]);c=b-c;for(var e=0,f=0<=c?0:null,g=0,k=0,l=null,n=null;e<a[J];){var q=a[e].min,s=FEa(a[e])-q,g=g+q;if(g<=c)var f=e+1,u=h.min(c-g,s),k=g+u,n=q+u;if(g>b)return e>=d?{no:e,last:l,VJ:b-(g-q)}:null===f?null:{no:f,last:n,VJ:c-k};u=h.min(b-g,s);g+=u;l=q+u;e++}return{no:e,last:l,VJ:b-g}}function HEa(a,b,c){a=Gi(a,c||kj);cj(a);for(var d=c=0;d<a[J];d++){var e=a[J]-d,f=(a[d]-c)*e;if(f<=b)c=a[d],b-=f;else{c+=b/e;b=0;break}}return{Xpa:c,VJ:b}} function aP(a,b,c,d){var e=GEa(a,b,c,d);if(!e)return null;b=e.VJ;c=$i(a,0,e.no);d=Hi(c,function(a,b){return h.max(a,b.Tc[J])},0);var f=Gi(c,FEa);0<f[J]&&(f[f[J]-1]=e.last);for(var g=0;g<d;g++){e=HEa(c,b,function(a){return a.Tc[g]||0});b=e.VJ;for(var k=0;k<f[J];k++)f[k]+=h.min(e.Xpa,a[k].Tc[g]||0);if(0==b)break}return f}function bP(a,b){var c=aP(a,b,void 0,void 0),d={};Y(a,function(a,b){var g=a.key;null!=d[g]||(d[g]=[]);b<c[J]&&d[g][C](c[b])});return d} function IEa(a,b){for(var c=$i(arguments,1),d=[],e=0;e<c[J];e+=2){var f=h.min(c[e],a[J]),g=h.min(c[e+1],a[J]),f=$i(a,f,g);Zi(d,f)}return d}function JEa(a){if(0==a)return 0;a=h.abs(a);for(var b=0;16>b;++b){if(h.abs(a-h[D](a))<1E-7*a)return b;a*=10}return 16}function cP(a){var b=Jo;if(0>=a)return b[ec](0,b[Rd](Me));for(var b=b[ec](0,b[Rd](Me)+1),c=0;c<a;c++)b+=qe;return b}function KEa(a,b){return bi(a)?[a+Me+b]:Gi(a,function(a){return a+Me+b})}function dP(a,b,c){return 0>b||0>c?null:a[b][c]} function LEa(a,b,c,d,e,f){var g=[],k=dP(c,d-1,e);k&&g[C]({iS:k,Kl:k.Kl+1,RJ:d-1,jS:null,SJ:null,kS:null});(k=dP(c,d,e-1))&&g[C]({iS:k,Kl:k.Kl+1,RJ:null,jS:null,SJ:e-1,kS:null});(c=dP(c,d-1,e-1))&&f(a[d-1],b[e-1])&&g[C]({iS:c,Kl:c.Kl,RJ:d-1,jS:e-1,SJ:e-1,kS:d-1});cj(g,function(a,b){return a.Kl-b.Kl});return 0<g[J]?g[0]:{iS:null,Kl:0,RJ:null,jS:null,SJ:null,kS:null}} function eP(a,b,c){var d=c||function(a,b){return a==b};c=[];for(var e=0,f=a[J];e<=f;e++){c[e]=c[e]||[];for(var g=0,k=b[J];g<=k;g++)c[e][g]=LEa(a,b,c,e,g,d)}a={};b={};k=c[f][k];for(c=k.Kl;k;)null!=k.RJ&&(a[k.RJ]=k.jS),null!=k.SJ&&(b[k.SJ]=k.kS),k=k.iS;return{Kl:c,lV:a,mV:b}} function MEa(a,b,c){function d(a,b,c){if(null==c)return 0;if(c===b[J]-1||null==a)return c;var d=f(b[c]);if(null==d)return c+1;b=f(b[c+1]);return null==b?c:h.abs(a-d)<=h.abs(a-b)?c:c+1}if(!a||!b||0===a[J]||0===b[J])return null;for(var e=[],f=c||kj,g=c=0,k,l;c<a[J]||g<b[J];)c<a[J]&&(k=f(a[c])),g<b[J]&&(l=f(b[g])),c<a[J]&&g<b[J]&&k==l?(e[C]({value:k,HC:c,IC:g}),c++,g++):c<a[J]&&(null==k||g==b[J]||k<l)?(e[C]({value:k,HC:c,IC:null}),c++):g<b[J]&&(null==l||c==a[J]||l<k)&&(e[C]({value:l,HC:null,IC:g}),g++); var n=null,q=null;Y(e,function(c){null==c.HC?c.HC=d(c[id],a,n):n=c.HC;null==c.IC?c.IC=d(c[id],b,q):q=c.IC});return e}function fP(a,b){for(var c in a)if(!Ri(b,c))return!1;return!0}function NEa(a,b,c,d){for(var e=1,f=0;1E3>f;f++){var g=OEa(a,b,c,e),k=OEa(a,b,c,0),l=AEa(a,g,d),k=AEa(a,k,d);if(l&&k)break;a=g;e*=0.99}return a}function OEa(a,b,c,d){var e={};Dj(a,function(f,g){for(var k=f,l=0;l<b[J];l++)var n=(0,b[l])(a,g,d),k=c(k,n);e[g]=k});return e} function gP(a,b,c){if(c)return hP(Fi(a,Xh),b);var d=-1;for(c=0;c<a[J];c++)if(null===a[c]){d=$i(a,d+1,c);d=hP(d,b);if(null!==d)return d;d=c}a=$i(a,d+1);return hP(a,b)}function hP(a,b){var c=aj(a,b,function(a,b){return bj(a,b.x)});if(0<=c)return a[c].y;var d=-(c+1);if(0==d||d==a[J])return null;c=a[d-1];d=a[d];return jK(new iK(c.x,c.y,d.x,d.y),(b-c.x)/(d.x-c.x)).y};function iP(){}T=iP[K];Ma(T,function(a,b,c){this.b=a;this.CE=b;this.Ap=null===c||0>c?this.P8():2<c?c-1:1;nw(this,[]);this.jc=ea;this.ic=-ea;ua(this,An(a,this.Ha(JE)));a.R(this.Ha(pBa),function(a,b){return b});this.eA=null}); T.$A=function(a,b){var c=XO(this.b,this.Ha(PF),this.Ha(PH));if(!Si(b)&&c!=gH)throw m("Non-linear scale with gaps is not supported.");for(var d=[],e=0;e<b[J];e++){var f;t:{var g=b[e];f=this.wZ(g.wia);var k=this.jI(g.wc),g=this.jI(g.xe);if(0<f)if(k+f<g)k+=f;else{f=null;break t}f={Zka:0,start:k,end:g}}f&&d[C](f)}this.eA=yEa(c,TO(1,VO(a)),d)};T.Ha=function(a){return KEa(this.CE,a)};T.P8=function(){return-1}; function PEa(a,b,c,d){d&&(a.fc(jP(a,b)),a.fc(jP(a,c)));a.jc==ea&&a.ic==-ea&&(a.jc=0,a.ic=1);a.jc==ea&&(a.jc=a.ic);a.ic==-ea&&(a.ic=a.jc);a.jc==a.ic&&(0==a.jc?(a.jc=-1,a.ic=1):0<a.jc?(a.jc/=2,a.ic*=2):(a.jc*=2,a.ic/=2));a.cH(a.jc,a.ic,d);a.N0(a.jc,a.ic,d);a.pH();a.Ap=h.max(1,a[wy][J]-1)}T.cH=function(){};T.Ro=function(a){nw(this,a)};function kP(a){a.le||a.pH();return a.le}function jP(a,b){var c=lP(a,b);if(null==c)return null;c=a.eA[Sz](c);return na(c)?c:null} function lP(a,b){return null!=b?a.jI(b):null}T.fc=function(a){null!=a&&(this.jc=h.min(this.jc,a),this.ic=h.max(this.ic,a))};T.Po=function(a){return this.xE(this.eA.inverse(a))};T.K8=function(a,b){return a<b?-1:a>b?1:0};function mP(a){eb(this,a)}X(mP,Th);mP[K].Qk=function(){return[new HO(this[yd])]};ip(mP[K],function(){return this[yd]});function nP(){}X(nP,AO);nP[K].vo=function(){return zr};function oP(a){this.$g=a}X(oP,DO);oP[K].Qk=function(){return this[ie](new nP)};function QEa(a){this.zR=a.jz+1;this.Sa=a[By];this.Vna=a.Oaa;this.s0=this.F0=0;this.xa=[]}QEa[K].add=function(a,b){if(0<this.xa[J]){var c=a-this.xa[this.xa[J]-1].x;0<c&&(this.F0+=c)}this.s0+=b;this.xa[C]({x:a,y:b})};function REa(a){var b=a.Vna||null!=a.Sa&&null!=a.Sa.min&&xj(a.Sa.min)&&null!=a.Sa.max&&xj(a.Sa.max)&&(a.Sa.max-a.Sa.min)/100||void 0;null!=b&&xj(b)||(b=a.F0/(a.xa[J]-1));return b}function SEa(a,b){return Hi(a.xa,function(a,d){return a+h.pow(d.x,b)},0)} function TEa(a,b){return Hi(a.xa,function(a,d){return a+h.pow(d.x,b)*d.y},0)}function UEa(a){for(var b=[],c=a.zR,d=0;d<c;d++){for(var e=ha(c+1),f=0;f<=c;f++)e[f]=f<c?SEa(a,d+f):TEa(a,d);b[C](e)}return new PN(b)}function VEa(a){var b=ODa(UEa(a));return Gi(fj(a.zR),function(a){return SN(b,a,this.zR)},a)}function WEa(a,b){var c=a.zR;return function(a){for(var e=0,f=0;f<c;f++)e+=b[f]*h.pow(a,f);return e}} function XEa(a,b){var c=WEa(a,b),d=REa(a);if(null==d||ga(d)||!xj(d)||0===d)return null;var d=new oEa(d,c),e=a.xa;cj(e,function(a,b){return a.x>b.x?1:a.x<b.x?-1:0});var f=a.s0/e[J],g=a.Sa;null!=a.Sa&&null!=a.Sa.min&&xj(a.Sa.min)&&g.min<e[0].x&&SO(d,g.min);for(var k=0,l=0,n=0;n<e[J];n++){var q=e[n].x,s=e[n].y;SO(d,q);k+=h.pow(s-c(q),2);l+=h.pow(s-f,2)}c=1-k/l;null!=a.Sa&&null!=a.Sa.max&&xj(a.Sa.max)&&g.max>e[e[J]-1].x&&SO(d,g.max);return{data:d.jq(),So:c}} function YEa(a){var b=VEa(a),c;c=[];for(var d=b[J]-1;0<=d;d--){var e=b[d];if(null!=e&&0<e){e=new PO(e);if(0<d){var f=new mP(lJ);1<d&&(f=new oP([f,new PO(d)]));e=new RO([e,f],!0)}c[C](e)}}c=new MO([new mP(Jh),new EO(c)]);a=XEa(a,b);return null!=a&&0!==a[Z][J]?{oI:b,data:a[Z],So:a.So,$s:c.zl()}:null};function qEa(a,b,c,d){var e=new QEa(d);Bj(Cj(a),function(a){var d=b(a);a=c(a);null!=d&&xj(d)&&null!=a&&xj(a)&&e.add(d,a)});return YEa(e)};var ZEa={LINEAR:MF,Tua:"exponential",Uva:"polynomial"},$Ea={linear:function(a,b,c,d){a=pEa(a,b,c,d);if(null===a)return null;b=new MO([new mP(Jh),new EO([new RO([new PO(a.$s.gJ),new mP(lJ)]),new PO(a.$s[by])])]);return{data:a[Z],So:a.So,$s:b.zl()}},exponential:function(a,b,c,d){for(var e=ea,f=0;f<a;f++){var g=b(f),k=c(f);null!=k&&k<e&&(e=k)}e=0<e?null:e-1;a=pEa(a,b,function(a){a=c(a);if(null==a)return null;null!=e&&(a-=e);return h.log(a)},d);if(null===a)return null;b=[];for(f=0;f<a[Z][J];f++)g=a[Z][f][0], k=h.exp(a[Z][f][1]),null!=e&&(k+=e),b[C]([g,k]);f=new KO(Tta,[new EO([new RO([new PO(a.$s.gJ),new mP(lJ)]),new PO(a.$s[by])])]);null===e||(f=new EO([f,new PO(e)]));f=(new MO([new mP(Jh),f])).zl();return{data:b,So:a.So,$s:f}}};$Ea.polynomial=qEa;var aFa={NONE:R,Rva:cH,Vra:Bg,Zra:QH,wua:cD,Wra:cF},bFa={NONE:R,Rda:JF,Fra:BC,mwa:qI,Hra:KC,zua:jD,Zra:QH,xua:dD},cFa={Hra:KC,owa:dAa,vua:qra,POINTS:lH,Rda:JF,Fra:BC,NONE:R},dFa={Lua:YH,ova:jza,Hua:XH},eFa={Pda:lD,Vda:Dh,Bua:mD},fFa={Vva:oH,vva:rG,Sua:qE},gFa={NONE:R,RIGHT:zs,LEFT:Qg,TOP:NI,BOTTOM:WC,Qda:mF,lva:BF,sua:YC},hFa={NONE:R,TOP:NI,BOTTOM:WC,Qda:mF},pP={yS:Eh,xS:Jg},iFa={lwa:nI,Cua:pD,Qua:oE},qP={NONE:R,Qda:mF,Nva:XG},jFa={tua:nra,Awa:ZAa},kFa={$ua:aF,rva:Twa},lFa={NONE:R,kva:zF,Vda:Dh,Yra:bH, Ewa:oBa},mFa={Vx:kg,Vda:Dh,Yra:bH},nFa={DEFAULT:ZD,Oua:gE},oFa={Mua:WD,Pda:lD,bsa:WH},pFa={Oda:eg,Pda:lD,bsa:WH,NONE:R},rP={NONE:R,Vra:Bg,Qva:Sxa,Gua:ID},qFa={mua:ara,lua:$qa},sP={nva:HF,Rda:JF},tP=[{color:"#3366CC",lighter:"#45AFE2"},{color:oA,lighter:"#FF3300"},{color:qA,lighter:"#FFCC00"},{color:dA,lighter:"#14C21D"},{color:"#990099",lighter:"#DF51FD"},{color:"#0099C6",lighter:"#15CBFF"},{color:"#DD4477",lighter:"#FF97D2"},{color:"#66AA00",lighter:"#97FB00"},{color:"#B82E2E",lighter:"#DB6651"}, {color:"#316395",lighter:"#518BC6"},{color:kA,lighter:"#BD6CBD"},{color:"#22AA99",lighter:"#35D7C2"},{color:"#AAAA11",lighter:"#E9E91F"},{color:"#6633CC",lighter:"#9877DD"},{color:"#E67300",lighter:"#FF8F20"},{color:"#8B0707",lighter:"#D20B0B"},{color:"#651067",lighter:"#B61DBA"},{color:"#329262",lighter:"#40BD7E"},{color:"#5574A6",lighter:"#6AA7C4"},{color:"#3B3EAC",lighter:"#6D70CD"},{color:"#B77322",lighter:"#DA9136"},{color:"#16D620",lighter:"#2DEA36"},{color:"#B91383",lighter:"#E81EA6"},{color:"#F4359E", lighter:"#F558AE"},{color:"#9C5935",lighter:"#C07145"},{color:"#A9C413",lighter:"#D7EE53"},{color:"#2A778D",lighter:"#3EA7C6"},{color:"#668D1C",lighter:"#97D129"},{color:"#BEA413",lighter:"#E9CA1D"},{color:"#0C5922",lighter:"#149638"},{color:"#743411",lighter:"#C5571D"}],rFa={color:"#EEEEEE",lighter:"#FEFEFE"},sFa=[[5],[2,5],[2,5],[2,4,6,8],[2,4,6,8],[2,3,4,5,6,7],[2,3,4,5,6,7,8],[2,3,4,5,6,7,8,9]],tFa={titleTextStyle:{color:eA,italic:!0},gridlines:{baseline:eg,minorTextOpacity:0.7,minorGridlineOpacity:0.4, newTimeline:!1,allowMinor:!0,minStrongLineDistance:40,minWeakLineDistance:40,minStrongToWeakLineDistance:5,minNotchDistance:10,minMajorTextDistance:10,minMinorTextDistance:5,unitThreshold:1.5}},uFa={histogram:{hAxis:{baselineColor:R,gridlines:{color:R}},bar:{groupWidth:QA}}},vFa={vAxis:tFa,hAxis:tFa,sizeAxis:{minSize:5,maxSize:30},fontName:nB,titleTextStyle:{color:re,bold:!0},bubble:{textStyle:{color:re}},candlestick:{hollowIsRising:!1},annotations:{datum:{textStyle:{color:XH},stemColor:mA},domain:{textStyle:{color:eA}, stemColor:mA}},majorAxisTextColor:eA,minorAxisTextColor:hA,backgroundColor:{fill:te,stroke:jA,strokeWidth:0},chartArea:{backgroundColor:{fill:R}},tooltip:{textStyle:{color:re}},baselineColor:fA,gridlineColor:uA,pieSliceBorderColor:ue,pieResidueSliceColor:uA,pieSliceTextStyle:{color:ue},areaOpacity:0.3,intervals:{style:KC,color:YH,lineWidth:1,fillOpacity:0.3,barWidth:0.25,shortBarWidth:0.1,boxWidth:0.25,dataOpacity:1,pointSize:6},actionsMenu:{textStyle:{color:re},disabledTextStyle:{color:"#c0c0c0"}}, legend:{newLegend:!1,textStyle:{color:eA},pagingTextStyle:{color:"#0011cc"},scrollArrows:{activeColor:"#0011cc",inactiveColor:uA}},aggregationTarget:eg,colorAxis:{legend:{textStyle:{color:re}}},bar:{groupWidth:100/1.618+we},histogram:{lastBucketPercentile:0,hideBucketItems:!1,bucketSize:-1,minBucketNumer:5,maxBucketNumber:50}};function uP(a,b){this.x=a||0;this.y=b||0}uP[K].o=function(){return new uP(this.x,this.y)};function vP(){this.sqa=GBa(W(this.sra,this));ua(this,W(this.tra,this))}Uh(vP);vP[K].tra=function(a,b){return this.sqa(a).Ee(b)};vP[K].sra=function(a){return new Go({pattern:a,valueType:vh})};function wP(a,b,c){Qa(this,a);this.X=b;Vw(this,c||null)}wP[K].qc=function(a){for(var b=this[Rc][pc](me),c=0,d=0,e=b[J];d<e;d++)c=h.max(c,a(b[d],this.X));return c};function xP(a,b,c,d,e,f,g){this.V=a;this.wc=b;this.xe=c;this.zv=e;this.Bja=f;this.nm=!0;this.xg=[];this.tY=d;this.Tl=null;this.$E=0;this.Kka=g||null;a=W(this.vma,this);b=Dygraph.pickDateTickGranularity(this.wc,this.xe,this.V,a);this.Mn=Dygraph.getDateAxis(this.wc,this.xe,b,a);this.Mn[0].v[ad]()>this.wc&&(this.Mn[je]({v:this.wc,label:O}),this.xg[je](new wP(O,{})));this.wc=h.min(this.Mn[0].v[ad](),this.wc);a=this.Mn[this.Mn[J]-1].v[ad]();a>this.xe[ad]()&&(this.xe=a);this.gX=this.V/(this.xe-this.wc); this.kp=[];a=0;for(b=this.Mn[J];a<b;a++)this.kp[C](this[Fy](this.Mn[a].v))} Ep(xP[K],function(a,b){if(this.nm){if(null==this.Tl)throw"startY must be set before calling draw().";var c=this.Mn[J]-1;if(0!==c){var d=W(a.Gk,a),e=this.xg[c],f=this.xg[c-1],g=e.qc(d),k=f.qc(d);g/2+this.kp[c]-this.Bja>this.V+this.tY&&(Vw(e,oE),k/2+this.kp[c-1]>this.kp[c]-g&&(Qa(f,O),f.X={Tb:O,bold:!1,color:RC,Va:nB,fontSize:13,Ic:!1,De:!1}));c=this.xg[0];e=this.xg[1];f=c.qc(d);d=e.qc(d);this.kp[0]-f/2<this.tY-this.zv&&(Vw(c,nI),this.kp[0]+f>this.kp[1]-d/2&&(Qa(e,O),e.X={Tb:O,bold:!1,color:RC,Va:nB, fontSize:13,Ic:!1,De:!1}))}d={};c=0;for(e=this.Mn[J];c<e;c++)if(!(this.wc>this.Mn[c].v)){for(var l=this.xg[c],f=a,g=this.kp[c],k=this.Tl+10,n=l.textAlign||pD,q=l.X,l=l[Rc][pc](me),s=[],u=0,w=l[J];u<w;u++)s[C](f.qt(l[u],g,k,15,n,nI,q)),k+=15;f=s;g=0;for(k=f[J];g<k;g++)b(f[g],null,d)}this.nm=!1}});Oa(xP[K],function(a){return(a-this.wc)*this.gX+this.tY}); xP[K].vma=function(a){function b(a,b){return e(c.Kka||a,b)}var c=this,d=!0,e=vP.Xb()[Kb];switch(a){case cra:return function(a,e){var k,l;c.$E=e;if(e<=Dygraph.THIRTY_SECONDLY)return l=b(kh,a),c.xg[C](new wP(l,{Tb:O,bold:!1,color:RC,Va:nB,fontSize:13,Ic:!1,De:!1})),c.xg[J]-1+O;if(e<=Dygraph.THIRTY_MINUTELY)return l=cB,0===a[Qc]()||d?(k=!0,l=NB):k=!1,d=!1,l=b(l,a),c.xg[C](new wP(l,{Tb:O,bold:k,color:RC,Va:nB,fontSize:13,Ic:!1,De:!1})),c.xg[J]-1+O;if(e<=Dygraph.SIX_HOURLY)return l=Dg,k=a[$b](),0!==a[Qc]()&& (l+=rna),k=12===k||0===k||d,d=c.wc>a[ad]()?!0:!1,k&&(l+=Vka),l=b(l,a),c.xg[C](new wP(l,{Tb:O,bold:k,color:RC,Va:nB,fontSize:13,Ic:!1,De:!1})),c.xg[J]-1+O;if(e<=Dygraph.DAILY)return l=mf,0===a[lc]()||d?(l+=Uka,k=!0):k=!1,d=!1,l=b(l,a),c.xg[C](new wP(l,{Tb:O,bold:k,color:RC,Va:nB,fontSize:13,Ic:!1,De:!1})),c.xg[J]-1+O;if(e<=Dygraph.WEEKLY)return k=d,d=!1,l=b(uf,a),c.xg[C](new wP(l,{Tb:O,bold:k,color:RC,Va:nB,fontSize:13,Ic:!1,De:!1})),c.xg[J]-1+O;if(e<=Dygraph.BIANNUAL)return l=RB,k=0===a[Dd]()||d, d=c.wc>a[ad]()?!0:!1,k&&(l+=Wka),l=b(l,a),c.xg[C](new wP(l,{Tb:O,bold:k,color:RC,Va:nB,fontSize:13,Ic:!1,De:!1})),c.xg[J]-1+O;if(e<=Dygraph.CENTENNIAL)return l=b(rJ,a),c.xg[C](new wP(l,{Tb:O,bold:!1,color:RC,Va:nB,fontSize:13,Ic:!1,De:!1})),c.xg[J]-1+O;throw Gpa;};case Yxa:return 50}};function yP(a,b){var c=a[jy],c=$ea(Ek(b),c);b[p](c);a.Eca&&Wa(c,a[jy][yb]);var d,e=a.Fca;d=a.Dca;var f=a.Gca,g=a[Qy],k=new xk(c[Gd],c[Wd]),l=d[Zc]-e.x>=k[r]+g,n=d[Hc]-e.y>=k[A]+g,q=e.y-d.top>=k[A]+g,s=e.y+(f+k[A]/2)*(q||l?-1:1),e=nj(e.x+(f+k[r]/2)*(e.x-d[G]>=k[r]+g&&!l&&!n&&!q?-1:1)-k[r]/2,d[G]+g,d[Zc]-g-k[r]);d=nj(s-k[A]/2,d.top+g,d[Hc]-g-k[A]);d=new sk(e,d);pa(c[x],c[Gd]+1+S);Sa(c[x],c[Wd]+S);Ya(c[x],d.x+S);c[x].top=d.y+S;return c};function zP(a,b,c){var d=b.za(),e=a.outline,f=new YJ,g=new rl(e.la.top+0.5,e.la[Zc]+0.5,e.la[Hc]+0.5,e.la[G]+0.5),k=e.zj;f[Yy](g[G]+1,g[Hc]);f.Wf(g[G]+1,g[Hc]-1,1,1,180,270,!0);f.Z(g[G],g.top+1);f.Wf(g[G]+1,g.top+1,1,1,270,0,!0);if(null!=k&&k[0].y==e.la.top)for(var l=0;3>l;++l)f.Z(k[l].x+0.5,k[l].y+0.5);f.Z(g[Zc]-1,g.top);f.Wf(g[Zc]-1,g.top+1,1,1,0,90,!0);f.Z(g[Zc],g[Hc]-1);f.Wf(g[Zc]-1,g[Hc]-1,1,1,90,180,!0);if(null!=k&&k[0].y==e.la[Hc])for(l=0;3>l;++l)f.Z(k[l].x+0.5,k[l].y+0.5);f[vy]();e=[new Rm({fill:Hh, stroke:tA,qa:1}),new Rm({fill:tA,qa:0,ae:0.6}),new Rm({fill:tA,qa:0,ae:0.4})];for(g=e[J]-1;0<=g;--g)k=b.na(f,e[g],d),b.em(k,g,g);a=a.qH;for(f=0;f<a[Ez][J];f++)switch(k=a[Ez][f],g=k.ih,e=b.za(),b[p](d,e),g[H]){case JF:g=g[Z];k=k[Z];k[Dz]&&b.rb(k[Dz].la[G],k[Dz].la.top,k[Dz].la[Zc]-k[Dz].la[G],k[Dz].la[Hc]-k[Dz].la.top,g[Dz].brush,e);for(l=0;l<k[cy][J];l++){var n=g[cy][l],q=k[cy][l];switch(n[H]){case Es:b.Pd(n[Z][cd],q.la[G],q.la.top,1,nI,nI,n[Z][x],e);break;case jI:b.rb(q.la[G],q.la.top,q.la[Zc]-q.la[G], q.la[Hc]-q.la.top,n[Z].brush,e)}}null!=g.id&&(g=AN([qC,g.id]),b.zn(e,g));break;case VH:g=g[Z],k=k[Z],l=new YJ,l[Yy](k.line.x0,k.line.y0),l.Z(k.line.x1,k.line.y1),b.na(l,g.brush,e)}b[p](c,d);return d};function AP(){this.Hj=[];this.Mb=[];this.Jl=[]}AP[K].Zp=null;AP[K].Ag=null;AP[K].Fx=!0;var wFa=[2,2,6,6,0];T=AP[K];wa(T,function(){jb(this.Hj,0);jb(this.Mb,0);jb(this.Jl,0);delete this.Zp;delete this.Ag;delete this.Fx;return this});T.moveTo=function(a,b){0==Ai(this.Hj)?jb(this.Jl,this.Jl[J]-2):(this.Hj[C](0),this.Mb[C](1));this.Jl[C](a,b);this.Ag=this.Zp=[a,b];return this}; T.lineTo=function(a){var b=Ai(this.Hj);if(null==b)throw m("Path cannot start with lineTo");1!=b&&(this.Hj[C](1),this.Mb[C](0));for(b=0;b<arguments[J];b+=2){var c=arguments[b],d=arguments[b+1];this.Jl[C](c,d)}this.Mb[this.Mb[J]-1]+=b/2;this.Ag=[c,d];return this}; T.lda=function(a){var b=Ai(this.Hj);if(null==b)throw m("Path cannot start with curve");2!=b&&(this.Hj[C](2),this.Mb[C](0));for(b=0;b<arguments[J];b+=6){var c=arguments[b+4],d=arguments[b+5];this.Jl[C](arguments[b],arguments[b+1],arguments[b+2],arguments[b+3],c,d)}this.Mb[this.Mb[J]-1]+=b/6;this.Ag=[c,d];return this};mw(T,function(){var a=Ai(this.Hj);if(null==a)throw m("Path cannot start with close");4!=a&&(this.Hj[C](4),this.Mb[C](1),this.Ag=this.Zp);return this}); T.arc=function(a,b,c,d,e,f,g){a+=rj(e,c);b+=sj(e,d);g?this.Ag&&a==this.Ag[0]&&b==this.Ag[1]||this[Ry](a,b):this[Xx](a,b);return this.arcTo(c,d,e,f)};T.arcTo=function(a,b,c,d){var e=this.Ag[0]-rj(c,a)+rj(c+d,a),f=this.Ag[1]-sj(c,b)+sj(c+d,b);this.Hj[C](3);this.Mb[C](1);this.Jl[C](a,b,c,d,e,f);this.Fx=!1;this.Ag=[e,f];return this}; T.nsa=function(a,b,c,d){var e=this.Ag[0]-rj(c,a),f=this.Ag[1]-sj(c,b),g=qj(d);d=h[xb](h.abs(g)/h.PI*2);g/=d;c=qj(c);for(var k=0;k<d;k++){var l=h.cos(c),n=h.sin(c),q=4/3*h.sin(g/2)/(1+h.cos(g/2)),s=e+(l-q*n)*a,u=f+(n+q*l)*b;c+=g;l=h.cos(c);n=h.sin(c);this.lda(s,u,e+(l+q*n)*a,f+(n-q*l)*b,e+l*a,f+n*b)}return this};function BP(a,b){for(var c=a.Jl,d=0,e=0,f=a.Hj[J];e<f;e++){var g=a.Hj[e],k=wFa[g]*a.Mb[e];b(g,c[dd](d,d+k));d+=k}} T.o=function(){var a=new this[rc];a.Hj=this.Hj[Ab]();a.Mb=this.Mb[Ab]();a.Jl=this.Jl[Ab]();a.Zp=this.Zp&&this.Zp[Ab]();a.Ag=this.Ag&&this.Ag[Ab]();a.Fx=this.Fx;return a};var CP={};CP[0]=AP[K][Xx];CP[1]=AP[K][Ry];CP[4]=AP[K][vy];CP[2]=AP[K].lda;CP[3]=AP[K].nsa;function xFa(a){if(a.Fx)return a.o();var b=new AP;BP(a,function(a,d){CP[a][Mc](b,d)});return b} ex(AP[K],function(a){if(!this.Fx)throw m("Non-simple path");a[Sz](this.Jl,0,this.Jl,0,this.Jl[J]/2);this.Zp&&a[Sz](this.Zp,0,this.Zp,0,1);this.Ag&&this.Zp!=this.Ag&&a[Sz](this.Ag,0,this.Ag,0,1);return this});Ua(AP[K],function(){return 0==this.Hj[J]});function DP(a,b,c,d,e){VK[L](this,e);pa(this,a);Sa(this,b);this.Jn=c||null;this.RF=d||null}X(DP,VK);T=DP[K];T.Kf=null;T.Dt=0;T.qw=0;function EP(a){return a.Jn?new xk(a.Jn,a.RF):a.ik()}T.Ub=function(){return this.ik()};T.ik=function(){return this.yb?Ol(this.a()):di(this[r])&&di(this[A])?new xk(this[r],this[A]):null};function FP(a){var b=a.ik();return b?b[r]/EP(a)[r]:0}T.Ff=function(a){Zk(a.a())};T.Zd=function(a,b,c,d,e,f){return this.Nj(a,b,c,c,d,e,f)}; T.Pd=function(a,b,c,d,e,f,g,k,l,n,q){var s=k[ly]/2;c=g==WC?c+e-s:g==pD?c+e/2:c+s;return this.mi(a,b,c,b+d,c,f,k,l,n,q)};T.tc=function(){return new AP};function GP(a,b,c,d,e,f){if(6==arguments[J])this.setTransform(a,b,c,d,e,f);else{if(0!=arguments[J])throw m("Insufficient matrix parameters");this.Ej=this.Gj=1;this.Wi=this.Fj=this.Bj=this.Cj=0}}T=GP[K];T.o=function(){return new GP(this.Ej,this.Wi,this.Fj,this.Gj,this.Bj,this.Cj)};T.setTransform=function(a,b,c,d,e,f){if(!(di(a)&&di(b)&&di(c)&&di(d)&&di(e)&&di(f)))throw m("Invalid transform parameters");this.Ej=a;this.Wi=b;this.Fj=c;this.Gj=d;this.Bj=e;this.Cj=f;return this}; T.TP=function(a){this.Ej=a.Ej;this.Wi=a.Wi;this.Fj=a.Fj;this.Gj=a.Gj;this.Bj=a.Bj;this.Cj=a.Cj;return this};Oa(T,function(a,b){this.Ej*=a;this.Wi*=a;this.Fj*=b;this.Gj*=b;return this});db(T,function(a,b){this.Bj+=a*this.Ej+b*this.Fj;this.Cj+=a*this.Wi+b*this.Gj;return this}); T.rotate=function(a,b,c){var d=new GP,e=h.cos(a);a=h.sin(a);b=d.setTransform(e,a,-a,e,b-b*e+c*a,c-b*a-c*e);c=this.Ej;d=this.Fj;this.Ej=b.Ej*c+b.Wi*d;this.Fj=b.Fj*c+b.Gj*d;this.Bj+=b.Bj*c+b.Cj*d;c=this.Wi;d=this.Gj;this.Wi=b.Ej*c+b.Wi*d;this.Gj=b.Fj*c+b.Gj*d;this.Cj+=b.Bj*c+b.Cj*d;return this};Da(T,function(){return dxa+[this.Ej,this.Wi,this.Fj,this.Gj,this.Bj,this.Cj][ie]()+Ge}); ex(T,function(a,b,c,d,e){var f=b;for(b+=2*e;f<b;){e=a[f++];var g=a[f++];c[d++]=e*this.Ej+g*this.Fj+this.Bj;c[d++]=e*this.Wi+g*this.Gj+this.Cj}});Za(T,function(a){return this==a?!0:a?this.Ej==a.Ej&&this.Fj==a.Fj&&this.Bj==a.Bj&&this.Wi==a.Wi&&this.Gj==a.Gj&&this.Cj==a.Cj:!1});function HP(a,b){rt[L](this);this.q=a;this.jd=b;this[ct]=!1}X(HP,rt);T=HP[K];T.jd=null;T.q=null;T.dR=null;T.a=function(){return this.q};T.bea=function(){return this.jd};T.addEventListener=function(a,b,c,d){kt(this.q,a,b,c,d)};T.removeEventListener=function(a,b,c,d){ot(this.q,a,b,c,d)};T.w=function(){HP.e.w[L](this);qt(this.q)};function IP(a,b,c,d){HP[L](this,a,b);this.dd(c);this.pe(d)}X(IP,HP);T=IP[K];Ca(T,null);T.Qd=null;T.pe=function(a){Ca(this,a);this.jd.U1(this,a)};T.gb=function(){return this[fc]};T.dd=function(a){this.Qd=a;this.jd.B1(this,a)};T.Yaa=function(){return this.Qd};function JP(a,b,c,d){IP[L](this,a,b,c,d)}X(JP,IP);function KP(a,b){HP[L](this,a,b)}X(KP,HP);function LP(a,b){HP[L](this,a,b)}X(LP,HP);function MP(a,b,c,d){IP[L](this,a,b,c,d)}X(MP,IP);function NP(a,b,c,d){IP[L](this,a,b,c,d)}X(NP,IP);function OP(a,b,c,d){IP[L](this,a,b,c,d)}X(OP,IP);function PP(a){HP[L](this,null,a);this.ie=[]}X(PP,KP);wa(PP[K],function(){this.ie[J]&&(jb(this.ie,0),this.jd.Mg())});PP[K].Je=function(){};PP[K].appendChild=function(a){this.ie[C](a)};Ep(PP[K],function(){for(var a=0,b=this.ie[J];a<b;a++)this.jd.qe(this.ie[a])});function QP(a,b,c,d,e,f,g,k){IP[L](this,a,b,g,k);this.Vca=c;this.Wca=d;this.J1=e;this.K1=f;this.sk=new AP;RP(this);this.L1=new SP(null,b,this.sk,g,k)}X(QP,JP); function RP(a){a.sk[Wb]();a.sk[Xx](a.Vca+rj(0,a.J1),a.Wca+sj(0,a.K1));a.sk.arcTo(a.J1,a.K1,0,360);a.sk[vy]()}QP[K].setCenter=function(a,b){this.Vca=a;this.Wca=b;RP(this);this.L1[Ip](this.sk)};Yv(QP[K],function(a,b){this.J1=a;this.K1=b;RP(this);this.L1[Ip](this.sk)});Ep(QP[K],function(a){this.L1[Nq](a)});function TP(a,b,c,d,e,f,g,k){IP[L](this,a,b,g,k);this.Ru=c;this.Su=d;this.ky=e;this.jy=f}X(TP,NP);bx(TP[K],function(a,b){this.Ru=a;this.Su=b;this.Yp&&this.jd.Mg()});TP[K].Yp=!1; TP[K].Je=function(a,b){this.ky=a;this.jy=b;this.Yp&&this.jd.Mg()};Ep(TP[K],function(a){this.Yp=!0;a[dz]();a[Xx](this.Ru,this.Su);a[Ry](this.Ru,this.Su+this.jy);a[Ry](this.Ru+this.ky,this.Su+this.jy);a[Ry](this.Ru+this.ky,this.Su);a[Oy]()});function SP(a,b,c,d,e){IP[L](this,a,b,d,e);this[Ip](c)}X(SP,MP);SP[K].Yp=!1;ep(SP[K],function(a){this.sk=a.Fx?a:xFa(a);this.Yp&&this.jd.Mg()}); Ep(SP[K],function(a){this.Yp=!0;a[dz]();BP(this.sk,function(b,c){switch(b){case 0:a[Xx](c[0],c[1]);break;case 1:for(var d=0;d<c[J];d+=2)a[Ry](c[d],c[d+1]);break;case 2:for(d=0;d<c[J];d+=6)a.bezierCurveTo(c[d],c[d+1],c[d+2],c[d+3],c[d+4],c[d+5]);break;case 3:throw m("Canvas paths cannot contain arcs");case 4:a[Oy]()}})}); function UP(a,b,c,d,e,f,g,k,l,n){var q=Rk(kf,{style:nta});IP[L](this,q,a,l,n);this.zq=b;this.d8=c;this.nja=d;this.e8=e;this.oja=f;this.lja=g||Qg;this.mja=k;this.wO=Rk(kf,{style:mta});c=this.d8;k=this.e8;d=this.nja;e=this.oja;l=this.lja;f=this.mja;b=this.a()[x];g=FP(this.jd);n=this.jd;var s=n.ik();n=s?s[A]/EP(n)[A]:0;c==k?(b.lineHeight=pna,this.wO[x].verticalAlign=l==pD?xG:l==Qg?d<e?NI:WC:d<e?WC:NI,Vw(b,pD),k=f[ly]*g,b.top=h[D](h.min(d,e)*n)+S,Ya(b,h[D]((c-k/2)*g)+S),pa(b,h[D](k)+S),Sa(b,h.abs(d-e)* n+S),Ja(b,0.6*f[ly]*n+hya)):(b.lineHeight=QA,this.wO[x].verticalAlign=NI,Vw(b,l),b.top=h[D](((d+e)/2-2*f[ly]/3)*n)+S,Ya(b,h[D](c*g)+S),pa(b,h[D](h.abs(k-c)*g)+S),Sa(b,eg),Ja(b,f[ly]*n+hya));Qw(b,f[Ed]?UC:MG);Xw(b,f.Ic?uF:MG);Ew(b,f.family);c=this.gb();Xa(b,c.Hd()||c.x7());yFa(this);a.a()[p](q);q[p](this.wO)}X(UP,OP);UP[K].$q=function(a){this.zq=a;yFa(this)};UP[K].pe=function(a){Ca(this,a);var b=this.a();b&&Xa(b[x],a.Hd()||a.x7())};UP[K].dd=function(){};Ep(UP[K],function(){}); function yFa(a){Wa(a.wO,a.d8==a.e8?Gi(a.zq[pc](O),function(a){return qi(a)})[ie]($e):qi(a.zq))}function VP(a,b,c,d,e,f,g){HP[L](this,a,b);this.Ru=c;this.Su=d;this.ky=e;this.jy=f;this.Tpa=g}X(VP,LP);T=VP[K];T.Yp=!1;bx(T,function(a,b){this.Ru=a;this.Su=b;this.Yp&&this.jd.Mg()});T.Je=function(a,b){this.ky=a;this.jy=b;this.Yp&&this.jd.Mg()};Ep(T,function(a){this.Qba?(this.ky&&this.jy&&a.drawImage(this.Qba,this.Ru,this.Su,this.ky,this.jy),this.Yp=!0):(a=new Image,cp(a,W(this.Vpa,this,a)),a.src=this.Tpa)}); T.Vpa=function(a){this.Qba=a;this.jd.Mg()};function zFa(){};function WP(a,b){this.qk=a;this.Vl=null==b?1:b}X(WP,zFa);WP[K].Hd=function(){return this.qk};function XP(a,b,c,d,e){DP[L](this,a,b,c,d,e)}X(XP,DP);T=XP[K];T.U1=function(){this.Mg()};T.B1=function(){this.Mg()};function AFa(a,b){var c=a[iz]();c[qy]();var d=b.dR?b.dR.o():new GP,e=d.Bj,f=d.Cj;(e||f)&&c[jz](e,f);(d=d.Wi)&&c[sy](h.asin(d))}T.h=function(){var a=this.P.h(Q,{style:bya});this.q=a;this.gc=this.P.h(kD);a[p](this.gc);this.eY=this.Kf=new PP(this);this.tja=0;YP(this)};T.getContext=function(){this.a()||this.h();this.gA||(this.gA=this.gc[iz](VA),this.gA[qy]());return this.gA}; T.Je=function(a,b){pa(this,a);Sa(this,b);YP(this);this.Mg()};T.ik=function(){var a=this[r],b=this[A],c=bi(a)&&-1!=a[ld](we),d=bi(b)&&-1!=b[ld](we);if(!this.yb&&(c||d))return null;var e,f;c&&(e=this.a()[fe],f=Pl(e),a=ma(a)*f[r]/100);d&&(e=e||this.a()[fe],f=f||Pl(e),b=ma(b)*f[A]/100);return new xk(a,b)};function YP(a){Nl(a.a(),a[r],a[A]);var b=a.ik();b&&(Nl(a.gc,b[r],b[A]),pa(a.gc,b[r]),Sa(a.gc,b[A]),a.gA=null)} vw(T,function(){var a=this[iz]();a[Gy]();var b=this.ik();b[r]&&b[A]&&a.clearRect(0,0,b[r],b[A]);a[qy]()});wa(T,function(){this.reset();this.Kf[Wb]();for(var a=this.a();1<a[Xb][J];)a[Qd](a[yc])});T.Mg=function(){if(!this.Tta&&this.yb){this.reset();if(this.Jn){var a=this.ik();this[iz]()[Fy](a[r]/this.Jn,a[A]/this.RF)}(this.Dt||this.qw)&&this[iz]()[jz](-this.Dt,-this.qw);AFa(this,this.Kf);this.Kf[Nq](this.gA);this[iz]()[Gy]()}}; T.qe=function(a){if(!(a instanceof UP)){var b=this[iz]();AFa(this,a);if(a.gb&&a.Yaa){var c=a.gb();if(c)if(c instanceof WP)0!=c.Vl&&(b.globalAlpha=c.Vl,ew(b,c.Hd()),a[Nq](b),b[fc](),b.globalAlpha=1);else{var d=b.createLinearGradient(c.Mta(),c.Ota(),c.Nta(),c.Pta());d[Kz](0,c.x7());d[Kz](1,c.Lta());ew(b,d);a[Nq](b);b[fc]()}if(c=a.Qd)a[Nq](b),Hw(b,c.Hd()),a=c.qc(),bi(a)&&-1!=a[ld](S)&&(a=ma(a)/FP(this)),zw(b,a),b[Yb]()}else a[Nq](b);this[iz]()[Gy]()}};T.Mm=function(a,b){this[Rz](a,b)}; T.append=function(a,b){b=b||this.Kf;b[p](a);!this.yb||this.tja||b!=this.Kf&&b!=this.eY||this.qe(a)};T.Nj=function(a,b,c,d,e,f,g){a=new QP(null,this,a,b,c,d,e,f);this[Rz](a,g);return a};T.rb=function(a,b,c,d,e,f,g){a=new TP(null,this,a,b,c,d,e,f);this[Rz](a,g);return a};T.drawImage=function(a,b,c,d,e,f){a=new VP(null,this,a,b,c,d,e);this[Rz](a,f);return a};T.mi=function(a,b,c,d,e,f,g,k,l,n){a=new UP(this,a,b,c,d,e,f,g,k,l);this[Rz](a,n);return a}; T.na=function(a,b,c,d){a=new SP(null,this,a,b,c);this[Rz](a,d);return a};T.za=function(a){var b=new PP(this);a=a||this.Kf;if(a==this.Kf||a==this.eY)this.eY=b;this[Rz](b,a);return b};T.w=function(){this.gA=null;XP.e.w[L](this)};T.Bb=function(){var a=this.ik();XP.e.Bb[L](this);a||(YP(this),this[$](CH));this.Mg()};function ZP(a,b){this.V=a;this.qk=b}ZP[K].qc=function(){return this.V};ZP[K].Hd=function(){return this.qk};function $P(a,b){HP[L](this,a,b)}X($P,KP);wa($P[K],function(){Wk(this.a())});$P[K].Je=function(a,b){aQ(this.a(),{width:a,height:b})};function bQ(a,b,c,d){IP[L](this,a,b,c,d)}X(bQ,JP);bQ[K].setCenter=function(a,b){aQ(this.a(),{cx:a,cy:b})};Yv(bQ[K],function(a,b){aQ(this.a(),{rx:a,ry:b})});function cQ(a,b,c,d){IP[L](this,a,b,c,d)}X(cQ,NP);bx(cQ[K],function(a,b){aQ(this.a(),{x:a,y:b})});cQ[K].Je=function(a,b){aQ(this.a(),{width:a,height:b})};function dQ(a,b,c,d){IP[L](this,a,b,c,d)}X(dQ,MP); ep(dQ[K],function(a){aQ(this.a(),{d:BFa(a)})});function eQ(a,b,c,d){IP[L](this,a,b,c,d)}X(eQ,OP);eQ[K].$q=function(a){ra(this.a()[Sb],a)};function fQ(a,b){HP[L](this,a,b)}X(fQ,LP);bx(fQ[K],function(a,b){aQ(this.a(),{x:a,y:b})});fQ[K].Je=function(a,b){aQ(this.a(),{width:a,height:b})};function gQ(a,b,c,d,e){DP[L](this,a,b,c,d,e);this.$o={};this.SU=mk&&!qk(526);this.Td=new sv(this)}var hQ;X(gQ,DP);T=gQ[K];T.Ra=function(a,b){var c=this.P.$b()[ny](gF,a);b&&aQ(c,b);return c};function aQ(a,b){for(var c in b)a[v](c,b[c])}T.Mm=function(a,b){(b||this.Kf).a()[p](a.a())};T.U1=function(a,b){var c=a.a();if(b instanceof WP)c[v](zE,b.Hd()),c[v](AE,b.Vl);else c[v](zE,R)}; T.B1=function(a,b){var c=a.a();if(b){c[v](uI,b.Hd());var d=b.qc();bi(d)&&-1!=d[ld](S)?c[v](wI,ma(d)/FP(this)):c[v](wI,d)}else c[v](uI,R)};T.h=function(){var a=this.Ra(xI,{width:this[r],height:this[A],overflow:Ig}),b=this.Ra(Cg);this.zV=this.Ra($D);this.Kf=new $P(b,this);a[p](this.zV);a[p](b);this.q=a;if(this.Jn||this.Dt||this.qw)this.a()[v](dya,R),this.SU?this.JL():this.a()[v](dJ,this.Dt+ne+this.qw+ne+(this.Jn?this.Jn+ne+this.RF:O))}; T.JL=function(){if(this.yb&&(this.Jn||this.Dt||!this.qw)){var a=this.ik();if(0==a[r])hb(this.a()[x],Ig);else{hb(this.a()[x],O);var b=-this.Dt,c=-this.qw,d=a[r]/this.Jn,a=a[A]/this.RF;this.Kf.a()[v](xh,aza+d+ne+a+dma+b+ne+c+Ge)}}};T.Je=function(a,b){Nl(this.a(),a,b)}; T.ik=function(){if(!lk)return this.yb?Ol(this.a()):gQ.e.ik[L](this);var a=this[r],b=this[A],c=bi(a)&&-1!=a[ld](we),d=bi(b)&&-1!=b[ld](we);if(!this.yb&&(c||d))return null;var e,f;c&&(e=this.a()[fe],f=Pl(e),a=ma(a)*f[r]/100);d&&(e=e||this.a()[fe],f=f||Pl(e),b=ma(b)*f[A]/100);return new xk(a,b)};wa(T,function(){this.Kf[Wb]();Wk(this.zV);this.$o={}});T.Nj=function(a,b,c,d,e,f,g){a=this.Ra(kE,{cx:a,cy:b,rx:c,ry:d});e=new bQ(a,this,e,f);this.Mm(e,g);return e}; T.rb=function(a,b,c,d,e,f,g){a=this.Ra(vH,{x:a,y:b,width:c,height:d});e=new cQ(a,this,e,f);this.Mm(e,g);return e};T.drawImage=function(a,b,c,d,e,f){a=this.Ra(Fva,{x:a,y:b,width:c,height:d,"image-rendering":Cxa,preserveAspectRatio:R});a.setAttributeNS(Cva,Kg,e);e=new fQ(a,this);this.Mm(e,f);return e}; T.mi=function(a,b,c,d,e,f,g,k,l,n){var q=h[D](tj(b,c,d,e));d-=b;e-=c;e=h[D](h[ud](d*d+e*e));var s=g[ly];d={"font-family":g.family,"font-size":s};var u=h[D](0.85*s),s=h[D](c-s/2+u),u=b;f==pD?(u+=h[D](e/2),d[DI]=xG):f==zs&&(u+=e,d[DI]=oE);d.x=u;d.y=s;g[Ed]&&(d[EE]=UC);g.Ic&&(d[DE]=uF);0!=q&&ex(d,IH+q+ne+b+ne+c+Ge);b=this.Ra(Es,d);b[p](this.P.$b()[Cb](a));null==k&&lk&&fk&&(a=RC,l instanceof WP&&(a=l.Hd()),k=new ZP(1,a));l=new eQ(b,this,k,l);this.Mm(l,n);return l}; T.na=function(a,b,c,d){a=this.Ra(aH,{d:BFa(a)});b=new dQ(a,this,b,c);this.Mm(b,d);return b};function BFa(a){var b=[];BP(a,function(a,d){switch(a){case 0:b[C](sf);ha[K][C][Mc](b,d);break;case 1:b[C](rf);ha[K][C][Mc](b,d);break;case 2:b[C](qB);ha[K][C][Mc](b,d);break;case 3:var e=d[3];b[C](df,d[0],d[1],0,180<h.abs(e)?1:0,0<e?1:0,d[4],d[5]);break;case 4:b[C](Vf)}});return b[ie](ne)}T.za=function(a){var b=this.Ra(Cg);(a||this.Kf).a()[p](b);return new $P(b,this)};T.Gk=function(){}; T.Bb=function(){var a=this.ik();gQ.e.Bb[L](this);a||this[$](CH);if(this.SU){var a=this[r],b=this[A];typeof a==rh&&-1!=a[ld](we)&&typeof b==rh&&-1!=b[ld](we)&&this.Td.l(CFa(),Fs,this.JL);this.JL()}};T.ve=function(){gQ.e.ve[L](this);this.SU&&this.Td.uc(CFa(),Fs,this.JL)};T.w=function(){delete this.$o;delete this.zV;delete this.Kf;gQ.e.w[L](this)};function CFa(){hQ||(hQ=new tt(400),hQ[y]());return hQ};function iQ(){return this.q=this.jd.P.a(this.bc)||this.q}function jQ(a,b){this.bc=a.id;HP[L](this,a,b)}X(jQ,KP);jQ[K].a=iQ;wa(jQ[K],function(){Wk(this.a())});jQ[K].Je=function(a,b){var c=this.a(),d=c[x];pa(d,kQ(a)+S);Sa(d,kQ(b)+S);ax(c,kQ(a)+ne+kQ(b));this.jd.Kf!=this&&kw(c,OA)};function lQ(a,b,c,d,e,f,g,k){this.bc=a.id;IP[L](this,a,b,g,k);this.WA=c;this.XA=d;this.ji=e;this.ki=f}X(lQ,JP);lQ[K].a=iQ;lQ[K].setCenter=function(a,b){this.WA=a;this.XA=b;mQ(this.a(),a-this.ji,b-this.ki,2*this.ji,2*this.ki)}; Yv(lQ[K],function(a,b){this.ji=a;this.ki=b;mQ(this.a(),this.WA-a,this.XA-b,2*a,2*b)});function nQ(a,b,c,d){this.bc=a.id;IP[L](this,a,b,c,d)}X(nQ,NP);nQ[K].a=iQ;bx(nQ[K],function(a,b){var c=this.a()[x];Ya(c,oQ(a));c.top=oQ(b)});nQ[K].Je=function(a,b){var c=this.a()[x];pa(c,kQ(a)+S);Sa(c,kQ(b)+S)};function pQ(a,b,c,d){this.bc=a.id;IP[L](this,a,b,c,d)}X(pQ,MP);pQ[K].a=iQ;ep(pQ[K],function(a){qQ(this.a(),aH,DFa(a))});function rQ(a,b,c,d){this.bc=a.id;IP[L](this,a,b,c,d)}X(rQ,OP);rQ[K].a=iQ; rQ[K].$q=function(a){qQ(this.a()[Xb][1],rh,a)};function sQ(a,b){this.bc=a.id;HP[L](this,a,b)}X(sQ,LP);sQ[K].a=iQ;bx(sQ[K],function(a,b){var c=this.a()[x];Ya(c,oQ(a));c.top=oQ(b)});sQ[K].Je=function(a,b){var c=this.a()[x];pa(c,oQ(a));Sa(c,oQ(b))};function tQ(a,b,c,d,e){DP[L](this,a,b,c,d,e);this.Td=new sv(this)}X(tQ,DP);var uQ=fa[be]&&8<=fa[be];function EFa(a){return bi(a)&&mda(a)?a:ma(a[hc]())+S}function vQ(a){return h[D](100*(ma(a[hc]())-0.5))}function oQ(a){return vQ(a)+S}function kQ(a){return h[D](100*ma(a[hc]()))}function qQ(a,b,c){uQ?a[b]=c:a[v](b,c)}function wQ(a,b){var c=a.P[Qb](Bua+b);c.id=Eua+zda++;return c}function xQ(a){uQ&&a.yb&&Wa(a.a(),a.a()[hd])}tQ[K].Mm=function(a,b){(b||this.Kf).a()[p](a.a());xQ(this)}; tQ[K].U1=function(a,b){var c=a.a();Wv(c,O);for(var d=0;d<c[Xb][J];d++){var e=c[Xb][d];e[Nc]==zE&&c[Qd](e)}b instanceof WP?b.Hd()==yh?Rv(c,!1):1!=b.Vl?(Rv(c,!0),d=wQ(this,zE),mb(d,h[D](100*b.Vl)+we),Xa(d,b.Hd()),c[p](d)):(Rv(c,!0),Wv(c,b.Hd())):Rv(c,!1);xQ(this)};tQ[K].B1=function(a,b){var c=a.a();if(b){Vv(c,!0);var d=b.qc(),d=bi(d)&&-1==d[ld](S)?ma(d):d*FP(this),e=c[cc](uI)[0];1>d?(e=e||wQ(this,uI),mb(e,d),Sv(e,TA),Xa(e,b.Hd()),c[p](e)):(e&&c[Qd](e),Iw(c,b.Hd()),dw(c,d+S))}else Vv(c,!1);xQ(this)}; function mQ(a,b,c,d,e){var f=a[x];Ea(f,cg);Ya(f,oQ(b));f.top=oQ(c);pa(f,kQ(d)+S);Sa(f,kQ(e)+S);a[Nc]==aI&&ax(a,kQ(d)+ne+kQ(e))}function yQ(a,b){var c=wQ(a,b),d=EP(a);mQ(c,0,0,d[r],d[A]);return c}try{eval("document.namespaces")}catch(FFa){}T=tQ[K]; T.h=function(){var a=this.P.$b();a.namespaces.g_vml_||(uQ?a.namespaces.add(Aua,eBa,Mla):a.namespaces.add(Aua,eBa),$a(a.createStyleSheet(),Cua));var a=this[r],b=this[A],c=this.P.h(Q,{style:Jxa+EFa(a)+wna+EFa(b)});this.q=c;var d=wQ(this,UE),e=d[x];Ea(e,cg);Ya(e,e.top=0);pa(e,this[r]);Sa(e,this[A]);ax(d,this.Jn?kQ(this.Jn)+ne+kQ(this.RF):kQ(a)+ne+kQ(b));kw(d,Qh(this.Dt)?kQ(this.Dt)+ne+kQ(this.qw):OA);c[p](d);this.Kf=new jQ(d,this);kt(c,CH,W(this.cU,this))}; T.cU=function(){var a=Ol(this.a()),b=this.Kf.a()[x];if(a[r])pa(b,a[r]+S),Sa(b,a[A]+S);else{for(a=this.a();a&&a[$d]&&a[$d][Sc]!=R;)a=a[fe];a&&a[$d]&&this.Td.l(a,gya,this.cU)}this[$](CH)};T.Je=function(a,b){Nl(this.a(),a,b)};T.ik=function(){var a=this.a();return new xk(a[x].pixelWidth||a[zb]||1,a[x].pixelHeight||a[Uc]||1)};wa(T,function(){this.Kf[Wb]()});T.Nj=function(a,b,c,d,e,f,g){var k=wQ(this,Hxa);mQ(k,a-c,b-d,2*c,2*d);a=new lQ(k,this,a,b,c,d,e,f);this.Mm(a,g);return a}; T.rb=function(a,b,c,d,e,f,g){var k=wQ(this,vH);mQ(k,a,b,c,d);a=new nQ(k,this,e,f);this.Mm(a,g);return a};T.drawImage=function(a,b,c,d,e,f){var g=wQ(this,Fva);mQ(g,a,b,c,d);qQ(g,kI,e);a=new sQ(g,this);this.Mm(a,f);return a}; T.mi=function(a,b,c,d,e,f,g,k,l,n){var q=yQ(this,aI),s=wQ(this,aH);b=sf+vQ(b)+Je+vQ(c)+rf+vQ(d)+Je+vQ(e)+mf;qQ(s,Ch,b);qQ(s,FI,zh);b=wQ(this,tAa);b[v](ah,zh);c=b[x];Ja(c,g[ly]*FP(this));Ew(c,g.family);null!=f&&(c[XI]=f);g[Ed]&&Qw(c,UC);g.Ic&&Xw(c,uF);qQ(b,rh,a);q[p](s);q[p](b);a=new rQ(q,this,k,l);this.Mm(a,n);return a};T.na=function(a,b,c,d){var e=yQ(this,aI);qQ(e,aH,DFa(a));a=new pQ(e,this,b,c);this.Mm(a,d);return a}; function DFa(a){var b=[];BP(a,function(a,d){switch(a){case 0:b[C](Tg);ha[K][C][Mc](b,Gi(d,kQ));break;case 1:b[C](yF);ha[K][C][Mc](b,Gi(d,kQ));break;case 2:b[C](lg);ha[K][C][Mc](b,Gi(d,kQ));break;case 4:b[C](lJ);break;case 3:var e=d[2]+d[3],f=kQ(d[4]-rj(e,d[0])),e=kQ(d[5]-sj(e,d[1])),g=kQ(d[0]),k=kQ(d[1]),l=h[D](-65536*d[2]),n=h[D](-65536*d[3]);b[C](tqa,f,e,g,k,l,n)}});return b[ie](ne)}T.za=function(a){var b=yQ(this,UE);(a||this.Kf).a()[p](b);return new jQ(b,this)};T.Gk=function(){return 0}; T.Bb=function(){tQ.e.Bb[L](this);this.cU();xQ(this)};T.w=function(){this.Kf=null;tQ.e.w[L](this)};function zQ(a,b,c,d,e){VK[L](this,d);this.ye=new Ct(e||Xma);this.xG=O;this.wd=[];this.vz=[];this.aO=[];this.It=[];this.Uia=[];this.Xia=[];this.iH=[];this.wX={};this.Via={};this.bO={};this.Wia={};this.Du(a);this.Je(b,c);this.Ca=AQ(this)?0:ea}X(zQ,VK);T=zQ[K];T.p5=2048;T.ija=0;T.jja=0;T.mb=-ea;T.Bf=null;T.uW=null;T.h=function(){var a=this.Ub();this.q=this.ea().h(Vr,{src:BQ(this),"class":hqa,width:a[0],height:a[1]})};T.mf=function(a){a.src=BQ(this);this.q=a}; function BQ(a){var b;a.xG!=O?b=CQ(a,a.xG):(b=CQ(a,jE))||(b=CQ(a,kh));b||a[$](new GFa(a.ye[hc]()));return a.ye}function HFa(a,b){var c=[];Y(b,function(a){a.area=a.area||jra;a.Gp=a.Gp||kh;c[C]([a.area,a.Gp,a[E]][ie]())});c=c[ie](Ps);a.Oc(Zra,c)}T.Du=function(a){this.ye.Oc(DD,a)};T.Vb=function(){return Lt(this.ye,DD)};T.Je=function(a,b){var c=[a||300,b||150][ie](lJ);this.ye.Oc(CD,c)};T.Ub=function(){return Lt(this.ye,CD)[pc](lJ)};T.eN=function(a){this.Ca=a};T.dN=function(a){this.mb=a}; function DQ(a,b){a.It=b;a.ye.Oc($ra,a.It[ie](Ps))}function EQ(a){a=a.Vb();return a==bD||a==PC||a==QC||a==fD||a==gD}function AQ(a){a=a.Vb();return a==$G||a==Mxa||a==Rxa}function IFa(a){a=a.Vb();return a==bD||a==PC||a==QC}function JFa(a){a=a.Vb();return a==bD||a==QC||a==gD}T.Oc=function(a,b){this.ye.Oc(a,b)};T.s1=function(a){this.ye.s1(a)};T.setTitle=function(a){this.Bf=a;this.ye.Oc(bsa,this.Bf[vb](/\n/g,Ps))};function FQ(a,b){a.iH[C](b);a.ye.Oc(dsa,a.iH[ie](Je));return a.iH[J]-1} function GQ(a,b,c){a.wX[b]=c;b=KFa(a,a.wX,tna,Ps);a.ye.Oc(csa,b)}function HQ(a,b,c,d){var e;e=ea;for(var f=0,g=b[J];f<g;++f){var k=b[f];null!=k&&k<e&&(e=k)}e<a.Ca&&(a.Ca=e);e=-ea;f=0;for(g=b[J];f<g;++f)k=b[f],null!=k&&k>e&&(e=k);e>a.mb&&(a.mb=e);if(Qh(d)){if(a.aO[J]<a.wd[J])throw m("Cannot start adding legends text after first element.");a.aO[C](d);a.ye.Oc(Xra,a.aO[ie](Ps))}a.wd[C](b);a.vz[C](c);a.ye.Oc(zD,a.vz[ie](Je))}T.getData=function(a){return Qh(a)?this.wd[a]:this.wd}; function CQ(a,b){for(var c=[],d=0,e=a.wd[J];d<e;++d){var f=c,g=d,k;k=a;for(var l=a.wd[d],n=a.Ca,q=a.mb,s=b,u=[],w=0,z=l[J];w<z;++w)u[C](LFa(l[w],n,q,s));k=u[ie](k.xG==zI?Je:O);f[g]=k}c=c[ie](b==zI?Ps:Je);c=null==a.uW?yda(b,Xe,c):yda(b,a.uW,Xe,c);a.ye.Oc(Wra,c);return a.ye[hc]()[J]<a.p5}function KFa(a,b,c,d){var e=[],f=0;for(a=a.iH[J];f<a;++f)b[f]&&e[C](f+c+b[f][ie](d));return e[ie](Ps)}var MFa=h.pow(64,2)-1; function LFa(a,b,c,d){var e=d==jE;if(null===a||!Qh(a)||ga(a)||a<b||a>c)return e?Npa:iC;if(d==zI)return String(a);d=0.5;c>b&&(d=(a-b)/(c-b));if(e)return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-."[Bb](h[t](d*MFa/64))+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-."[Bb](h[t](d*MFa%64));a=h[D](61*d);return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"[Bb](a)} zQ[K].w=function(){zQ.e.w[L](this);delete this.It;delete this.Uia;delete this.Xia;delete this.ija;delete this.jja;delete this.vz;delete this.aO;delete this.wd;this.ye=null;delete this.Ca;delete this.mb;this.Bf=null;delete this.iH;delete this.wX;delete this.Via;delete this.bO;delete this.Wia};function GFa(a){Xs[L](this,cBa);this.uri=a}X(GFa,Xs);function IQ(a){hO[L](this,a,[eF,fF])}X(IQ,hO);IQ[K].SQ=function(a,b,c){if(b==eF){if(!a[cz](c.Qm))return c.Qm=a,!0}else if(null!=c.Qm)return c.Qm=null,!0;return!1};IQ[K].ql=function(a){return null!=a.Qm?[new fO(Hs,a.af)]:[]};function JQ(a,b,c,d,e){this.WB=a;this.G=b.Aw();this.Wd=b;this.hu=null;this.Ax=NFa;this.ur=d;this.FQ=e;this.eo=null}X(JQ,aEa);T=JQ[K];Ep(T,function(a){this.hu={};this.G[Wb]();this.eo=this.WB.yu(a,null);this.eo.Ub();for(a=0;a<this.Ax[J];a++)this.hu[this.Ax[a]]=new BK.Gg.h4;this.eo[Nq](this)});function OFa(a){var b=a.Wd.Aw();Y(Hj(a.hu),function(a){b.Rs(a)},a)}T.MI=function(a){this.Ax=a};aw(T,function(a){this.YJ(a.Xr,!1);this.YJ(a.Wr,!0);this.eo[Nq](this)}); T.YJ=function(a,b){for(var c=0;c<a[J];c++)for(var d=a[c],e=d.Fp,f=0;f<e[J];f++)this.eo.Pm(e[f],d.Gp,b)};T.z_=function(a){function b(a,b){return function(e){a[Mc](b,[this,e])}}a.l(Fr,b(function(a){this[Pp](Fr,a)},this));a.l(EG,b(function(a){this[Pp](eF,a)},this));a.l(rxa,b(function(a){this[Pp](fF,a)},this))};kp(T,function(a,b){var c=b[Z]().idStr;c!=ag&&(c=eO(c),this.ur(c,a))});T.eb=function(){return this.Wd};T.Cn=function(a,b){var c=a[Z]()||{};c.idStr=b.Hn();a[Z](c);this.z_(a)}; T.qe=function(a,b,c,d){b&&this.Ff(b);this.Cn(a,c,d)};T.Ff=function(a){a&&this.G.IU(a)};var NFa=[GC,LH,KH,kC,jC];function KQ(a,b){var c=ha[K][dd][L](arguments),d=c[rb]();if("undefined"==typeof d)throw m("[goog.string.format] Template required");return d[vb](/%([0\-\ \+]*)(\d+)?(\.(\d+))?([%sfdiu])/g,function(a,b,d,k,l,n,q,s){if(n==we)return we;var u=c[rb]();if("undefined"==typeof u)throw m("[goog.string.format] Not enough arguments");arguments[0]=u;return LQ[n][Mc](null,arguments)})} var LQ={s:function(a,b,c){return ga(c)||c==O||a[J]>=c?a:a=-1<b[ld](Le,0)?a+ti(ne,c-a[J]):ti(ne,c-a[J])+a},f:function(a,b,c,d,e){d=a[hc]();ga(e)||e==O||(d=a[wb](e));var f;f=0>a?Le:0<=b[ld](Ie)?Ie:0<=b[ld](ne)?ne:O;0<=a&&(d=f+d);if(ga(c)||d[J]>=c)return d;d=ga(e)?h.abs(a)[hc]():h.abs(a)[wb](e);a=c-d[J]-f[J];0<=b[ld](Le,0)?d=f+d+ti(ne,a):(b=0<=b[ld](Oe,0)?Oe:ne,d=f+ti(b,a)+d);return d},d:function(a,b,c,d,e,f,g,k){return LQ.f(la(a,10),b,c,d,0,f,g,k)}};LQ.i=LQ.d;LQ.u=LQ.d;function MQ(a,b){var c;c=Ph[tc][Ic];c=mi(c)||(cm(c)[1]||null)!=Tr?Ng:Tr;return KQ(Yla,c,a,b)};function PFa(a,b){if(a){if(b[J]!=a[J])throw m("colorsScale and valuesScale must be of the same length");}else if(1!=b[J])throw m("colorsScale must contain exactly one element when no valueScale is provided");this.mk=a;this.iu=Gi(b,function(a){return mm(a).vd})}var QFa=[pA,dA],RFa=[oA,pA,dA]; function NQ(a,b){if(!a.mk)return a.iu[0];if(b>=a.mk[a.mk[J]-1])return a.iu[a.iu[J]-1];if(b<=a.mk[0])return a.iu[0];var c=aj(a.mk,b);if(0<=c)return a.iu[c];var d=-c-2,c=-c-1;return Mm(a.iu[c],a.iu[d],(b-a.mk[d])/(a.mk[c]-a.mk[d]))} function SFa(a,b){b&&0!=b[J]?1==b[J]&&(b=[QFa[0],b[0]]):b=a&&3==a[J]?RFa:QFa;if(!a||2>a[J])return{values:null,b1:[Ai(b)]};var c=a[0],d=a[a[J]-1],e=d-c;if(0==e)return{values:[d],b1:[Ai(b)]};if(2==a[J])for(a=[],d=e/(b[J]-1),e=0;e<b[J];e++)a[C](c+d*e);return{values:a,b1:b}} function TFa(a,b){var c=null,d=a.R(psa);if(d&&0<d[J]){1==d[J]&&(d=[d[0],d[0]]);b&&(null==d[0]&&(d[0]=b[y]),null==d[d[J]-1]&&(d[d[J]-1]=b.end));if(null==d[0])throw m(qsa);for(c=1;c<d[J];c++){if(null==d[c])throw m(qsa);if(d[c]<d[c-1])throw m("colorAxis.values must be a monotonically increasing series");}c=d}else{var d=tn(a,osa),e=tn(a,nsa);if(null!=d&&null!=e&&d>e)throw m("colorAxis.minValue ("+d+") must be at most colorAxis.maxValue ("+e+Ge);(d=afa(b,d,e))&&(c=[d[y],d.end])}d=a.R(ND);d=a.R(LD,d);c= SFa(c,d);return new PFa(c[Hx],c.b1)};function OQ(a){var b=Gi(a.F,function(b){var d=a[Gz]?a[Gz]:{x:0,y:0},e=bK(b.x+d.x,b[J],a.Cc);b=bK(b.y+d.y,a.X[uc],a.Bc);return e[y]==e.end||b[y]==b.end?null:new rl(b[y],e.end,b.end,e[y])}),b=Fi(b,Xh);return Om(b)};function UFa(a){a=VFa(a);ei(Ph.setImmediate)?Ph.setImmediate(a):(PQ||(PQ=WFa()),PQ(a))}var PQ; function WFa(){if(Ph.Hda&&Ph.Hda.resolve){var a=Ph.Hda.resolve();return function(b){a[Az](function(){try{b()}catch(a){Ph[Yp](Kda(a),0)}})}}var b=Ph.MessageChannel;"undefined"===typeof b&&"undefined"!==typeof ca&&ca.postMessage&&ca[Fq]&&(b=function(){var a=fa[Qb](lF);Ra(a[x],R);a.src=O;fa[dc][p](a);var b=a[dy],a=b[Hd];a[oq]();a[Cx](O);a[vy]();var c=ura+h[Cc](),d=b[tc][fq]+Dga+b[tc].host,a=W(function(a){if(a[gx]==d||a[Z]==c)this.port1.onmessage()},this);b[Fq](Kha,a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c, d)}}});if("undefined"!==typeof b){var c=new b,d={},e=d;c.port1.onmessage=function(){d=d[oc];var a=d.Jda;d.Jda=null;a()};return function(a){Ga(e,{Jda:a});e=e[oc];c.port2.postMessage(0)}}return"undefined"!==typeof fa&&yxa in fa[Qb](lh)?function(a){var b=fa[Qb](lh);tp(b,function(){tp(b,null);b[fe][Qd](b);b=null;a();a=null});fa[dc][p](b)}:function(a){Ph[Yp](a,0)}}var VFa=kj;function XFa(a){UFa(function(){throw a;})}function QQ(a,b){RQ||(UFa(YFa),RQ=!0);SQ[C](new ZFa(a,b))}var RQ=!1,SQ=[];function YFa(){for(;SQ[J];){var a=SQ;SQ=[];for(var b=0;b<a[J];b++){var c=a[b];try{c.usa[L](c[yz])}catch(d){XFa(d)}}}RQ=!1}function ZFa(a,b){this.usa=a;this.scope=b};function $Fa(a){a[K].then=a[K][Az];a[K].$goog_Thenable=!0}function aGa(a){if(!a)return!1;try{return!!a.$goog_Thenable}catch(b){return!1}};function TQ(a,b){this.n=0;this.bs=void 0;this.Om=this.Kd=null;this.TQ=this.S_=!1;try{var c=this;a[L](b,function(a){UQ(c,2,a)},function(a){UQ(c,3,a)})}catch(d){UQ(this,3,d)}}TQ[K].then=function(a,b,c){return bGa(this,ei(a)?a:null,ei(b)?b:null,c)};$Fa(TQ);up(TQ[K],function(a){0==this.n&&QQ(function(){var b=new VQ(a);cGa(this,b)},this)}); function cGa(a,b){if(0==a.n)if(a.Kd){var c=a.Kd;if(c.Om){for(var d=0,e=-1,f=0,g;g=c.Om[f];f++)if(g=g.YQ)if(d++,g==a&&(e=f),0<=e&&1<d)break;0<=e&&(0==c.n&&1==d?cGa(c,b):(d=c.Om[he](e,1)[0],dGa(c,d,3,b)))}}else UQ(a,3,b)}function eGa(a,b){a.Om&&a.Om[J]||2!=a.n&&3!=a.n||fGa(a);a.Om||(a.Om=[]);a.Om[C](b)} function bGa(a,b,c,d){var e={YQ:null,Sca:null,Tca:null};e.YQ=new TQ(function(a,g){e.Sca=b?function(c){try{var e=b[L](d,c);a(e)}catch(n){g(n)}}:a;e.Tca=c?function(b){try{var e=c[L](d,b);!Qh(e)&&b instanceof VQ?g(b):a(e)}catch(n){g(n)}}:g});e.YQ.Kd=a;eGa(a,e);return e.YQ}TQ[K].Paa=function(a){this.n=0;UQ(this,2,a)};TQ[K].Qaa=function(a){this.n=0;UQ(this,3,a)}; function UQ(a,b,c){if(0==a.n){if(a==c)b=3,c=new TypeError(bpa);else{if(aGa(c)){a.n=1;c[Az](a.Paa,a.Qaa,a);return}if(ai(c))try{var d=c[Az];if(ei(d)){gGa(a,c,d);return}}catch(e){b=3,c=e}}a.bs=c;a.n=b;fGa(a);3!=b||c instanceof VQ||hGa(a,c)}}function gGa(a,b,c){function d(b){f||(f=!0,a.Qaa(b))}function e(b){f||(f=!0,a.Paa(b))}a.n=1;var f=!1;try{c[L](b,e,d)}catch(g){d(g)}}function fGa(a){a.S_||(a.S_=!0,QQ(a.ura,a))} TQ[K].ura=function(){for(;this.Om&&this.Om[J];){var a=this.Om;this.Om=[];for(var b=0;b<a[J];b++)dGa(this,a[b],this.n,this.bs)}this.S_=!1};function dGa(a,b,c,d){if(2==c)b.Sca(d);else{for(;a&&a.TQ;a=a.Kd)a.TQ=!1;b.Tca(d)}}function hGa(a,b){a.TQ=!0;QQ(function(){a.TQ&&iGa[L](null,b)})}var iGa=XFa;function VQ(a){ji[L](this,a)}X(VQ,ji);eb(VQ[K],hD);/* Portions of this code are from MochiKit, received by The Closure Authors under the MIT license. All other code is Copyright 2005-2009 The Closure Authors. All Rights Reserved. */ function WQ(a,b){this.Ne=[];this.Mba=a;this.Raa=b||null;this.iJ=this.BC=!1;this.bs=void 0;this.X0=this.vna=this.p0=!1;this.lR=0;this.Kd=null;this.m0=0}T=WQ[K];up(T,function(a){if(this.BC)this.bs instanceof WQ&&this.bs[pq]();else{if(this.Kd){var b=this.Kd;delete this.Kd;if(a)b[pq](a);else b.m0--,0>=b.m0&&b[pq]()}this.Mba?this.Mba[L](this.Raa,this):this.X0=!0;this.BC||XQ(this,new YQ)}});T.jba=function(a,b){this.p0=!1;ZQ(this,a,b)};function ZQ(a,b,c){a.BC=!0;a.bs=c;a.iJ=!b;jGa(a)} T.Et=function(){if(this.BC){if(!this.X0)throw new $Q;this.X0=!1}};T.cda=function(a){this.Et();ZQ(this,!0,a)};function XQ(a,b){a.Et();ZQ(a,!1,b)}function kGa(a,b){aR(a,b,null,void 0)}function lGa(a,b){aR(a,null,b,void 0)}function aR(a,b,c,d){a.Ne[C]([b,c,d]);a.BC&&jGa(a)}T.then=function(a,b,c){var d,e,f=new TQ(function(a,b){d=a;e=b});aR(this,d,function(a){a instanceof YQ?f[pq]():e(a)});return f[Az](a,b,c)};$Fa(WQ);WQ[K].Ni=function(a){return a instanceof m}; function mGa(a){return Mi(a.Ne,function(a){return ei(a[1])})} function jGa(a){if(a.lR&&a.BC&&mGa(a)){var b=a.lR,c=bR[b];c&&(Ph[Gp](c.bc),delete bR[b]);a.lR=0}a.Kd&&(a.Kd.m0--,delete a.Kd);for(var b=a.bs,d=c=!1;a.Ne[J]&&!a.p0;){var e=a.Ne[rb](),f=e[0],g=e[1],e=e[2];if(f=a.iJ?g:f)try{var k=f[L](e||a.Raa,b);Qh(k)&&(a.iJ=a.iJ&&(k==b||a.Ni(k)),a.bs=b=k);aGa(b)&&(d=!0,a.p0=!0)}catch(l){b=l,a.iJ=!0,mGa(a)||(c=!0)}}a.bs=b;if(d)if(k=W(a.jba,a,!0),d=W(a.jba,a,!1),b instanceof WQ)aR(b,k,d),b.vna=!0;else b[Az](k,d);c&&(b=new nGa(b),bR[b.bc]=b,a.lR=b.bc)} function oGa(a){var b=new WQ;XQ(b,a);return b}function $Q(){ji[L](this)}X($Q,ji);Ka($Q[K],"Deferred has already fired");eb($Q[K],"AlreadyCalledError");function YQ(){ji[L](this)}X(YQ,ji);Ka(YQ[K],"Deferred was canceled");eb(YQ[K],"CanceledError");function nGa(a){this.bc=Ph[Yp](W(this.Zpa,this),0);this.Lr=a}nGa[K].Zpa=function(){delete bR[this.bc];throw this.Lr;};var bR={};function pGa(a,b){var c=b||{},d=c[Hd]||fa,e=Tk(Df),f={eda:e,Ve:void 0},g=new WQ(qGa,f),k=null,l=null!=c.timeout?c.timeout:5E3;0<l&&(k=ca[Yp](function(){cR(e,!0);XQ(g,new dR(1,ypa+a))},l),f.Ve=k);cp(e,tp(e,function(){e[Eq]&&e[Eq]!=Qwa&&e[Eq]!=Gr||(cR(e,c.Y$||!1,k),g.cda(null))}));e.onerror=function(){cR(e,!0,k);XQ(g,new dR(0,toa+a))};Ok(e,{type:uh,charset:Dpa,src:a});rGa(d)[p](e);return g} function eR(a,b){Ph.closure_verification||(Ph.closure_verification={});var c=Ph.closure_verification;if(Qh(c[b]))return oGa(new dR(3,Hpa+b+hla));var d=pGa(a,{Y$:!0}),e=new WQ(W(d[pq],d));kGa(d,function(){var d=c[b];Qh(d)?(e.cda(d),delete c[b]):XQ(e,new dR(2,kpa+a+jla+b+lla))});lGa(d,function(a){Qh(c[b])&&delete c[b];XQ(e,a)});return e}function rGa(a){var b=a[cc](Eoa);return!b||Si(b)?a[dc]:b[0]}function qGa(){if(this&&this.eda){var a=this.eda;a&&a[Nc]==Df&&cR(a,!0,this.Ve)}} function cR(a,b,c){null!=c&&Ph[Gp](c);cp(a,Th);a.onerror=Th;tp(a,Th);b&&ca[Yp](function(){Zk(a)},0)}function dR(a,b){var c=Moa+a+Ge;b&&(c+=bB+b);ji[L](this,c);this.code=a}X(dR,ji);var __flash_unloadHandler,__flash_savedUnloadHandler;/* SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License: http://www.opensource.org/licenses/mit-license.php */ function fR(a,b,c,d,e,f,g,k,l,n){if(fa[gd]){this.ppa=n?n:cta;t:{n=this.ppa;var q=fa[tc][xc]||fa[tc].hash;if(null==n)n=q;else{if(q)for(var q=q[ae](1)[pc](xe),s=0;s<q[J];s++)if(q[s][ae](0,q[s][ld](af))==n){n=q[s][ae](q[s][ld](af)+1);break t}n=O}}this.jpa=n;this.Ta={};this.wm={};this.attributes=[];a&&this[v](yI,a);b&&this[v](kF,b);c&&this[v](Ih,c);d&&this[v](Hg,d);e&&this[v](cJ,new gR(e[hc]()[pc](Me)));t:if(a=new gR([0,0,0]),Pv.plugins&&Pv.mimeTypes[J])(b=Pv.plugins[mpa])&&b.description&&(a=new gR(b.description[vb](/([a-zA-Z]|\s)+/, O)[vb](/(\s+r|\s+b[0-9]+)/,Me)[pc](Me)));else if(Pv[sc]&&0<=Pv[sc][ld](Jpa))for(b=1,c=3;b;)try{c++,b=new ActiveXObject(opa+c),a=new gR([c,0,0])}catch(u){b=null}else{b=null;try{b=new ActiveXObject(qpa)}catch(w){try{b=new ActiveXObject(ppa),a=new gR([6,0,21]),b.Uta=vC}catch(z){if(6==a.dD)break t}try{b=new ActiveXObject(npa)}catch(B){}}null!=b&&(a=new gR(b.GetVariable(Vla)[pc](ne)[1][pc](Je)))}this.aS=a;!ca.opera&&fa.all&&7<this.aS.dD&&(sGa=!0);f&&(this.Ta.bgcolor=f);this.Ta.quality=g?g:aF;this[v](fBa, !1);this[v](hE,!1);this[v](ABa,k?k:ca[tc]);this[v](xH,O);l&&this[v](xH,l)}}var sGa; kb(fR,{setAttribute:function(a,b){this[Ky][a]=b},getAttribute:function(a){return this[Ky][a]},getParams:function(){return this.Ta},write:function(a){if(this[Sd](fBa)&&hR(this.aS,new gR([6,0,65]))&&!hR(this.aS,this[Sd](cJ))){this[v](hE,!0);var b=Nv(this[Sd](ABa));this.wm.MMredirectURL=b;Ap(fa,fa[uz][dd](0,47)+bla);this.wm.MMdoctitle=fa[uz]}if(this.jpa||this[Sd](hE)||hR(this.aS,this[Sd](cJ))){a=typeof a==rh?fa[gd](a):a;b=O;if(Pv.plugins&&Pv.mimeTypes&&Pv.mimeTypes[J]){this[Sd](hE)&&(this.wm.MMplayerType= Zoa,this[v](yI,this.Jqa));var b=Jna+this[Sd](yI)+tla+this[Sd](Ih)+pla+this[Sd](Hg)+sla+this[Sd](sh)+oe,b=b+(Vz+this[Sd](kF)+qla+this[Sd](kF)+Xz),c=this.getParams(),d;for(d in c)b+=[d]+kB+c[d]+Xz;d=tGa(this)[ie](xe);0<d[J]&&(b+=lua+d+oe);b+=Yma}else{this[Sd](hE)&&(this.wm.MMplayerType=Wna,this[v](yI,this.Jqa));b=Ona+this[Sd](kF)+ola+this[Sd](Ih)+pla+this[Sd](Hg)+sla+this[Sd](sh)+Zz;b+=Rna+this[Sd](yI)+pe;c=this.getParams();for(d in c)b+=Pna+d+Yz+c[d]+pe;d=tGa(this)[ie](xe);0<d[J]&&(b+=Qna+d+pe);b+= Cna}Wa(a,b);return!0}this[Sd](xH)!=O&&fa[tc][vb](this[Sd](xH));return!1}});function tGa(a){var b=[],c;a=a.wm;for(c in a)b[b[J]]=c+af+a[c];return b}function gR(a){this.dD=null!=a[0]?la(a[0],10):0;this.uS=null!=a[1]?la(a[1],10):0;this.rev=null!=a[2]?la(a[2],10):0}function hR(a,b){return a.dD<b.dD?!1:a.dD>b.dD?!0:a.uS<b.uS?!1:a.uS>b.uS?!0:a.rev<b.rev?!1:!0}function uGa(){for(var a=fa[cc](hba),b=a[J]-1;0<=b;b--){Ra(a[b][x],R);for(var c in a[b])typeof a[b][c]==Bg&&(a[b][c]=function(){})}} if(sGa&&!vGa){ca.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};ca.attachEvent(zxa,uGa)});var vGa=!0}!fa[gd]&&fa.all&&(fa.getElementById=function(a){return fa.all[a]});function wGa(a){this.ssa=a}var xGa=MQ("regioncoder",Oe)+"geocodes",iR={};function yGa(a,b){a=pi(a[ke]());a=aa(String(a));var c=iR[a];if(null==c){iR[a]=[b];var c=xGa+Tq+a+Qma,d=vfa(),e=fa[Qb](lh);ab(e,uh);e.src=c;d[p](e);ut(gi(zGa,a,null),5E3)}else Vh(c)==dg?Ri(c,b)||c[C](b):ut(gi(b,c),0)}function zGa(a,b){if(b){var c=new wGa(b),d=iR[a];if(Vh(d)==dg){iR[a]=c;for(var e=0;e<d[J];e++)d[e](c)}}else if(d=iR[a],Vh(d)==dg)for(iR[a]=null,e=0;e<d[J];e++)d[e](null)} function AGa(a,b){b=pi(b[ke]());return a.ssa[b]} var BGa=["AD","AE","AF","AG","AL","AM","AO","AR",lB,"AU","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BN","BO",ef,"BS","BT","BW","BY","BZ","CA","CD","CF","CG","CH","CI","CL","CM","CN","CO","CR","CS","CU","CV","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","ER","ES","ET","FI","FJ","FM","FR","GA","GB","GD","GE","GH","GM","GN","GQ","GR","GT","GW","GY","HN",pf,"HT","HU","ID","IE","IL","IN","IQ","IR","IS","IT","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KZ","LA","LB",OB, "LK","LR","LS","LT","LU","LV","LY","MA","MD","ME","MG","MH","MK","ML","MM","MN","MR","MT","MU","MV","MW","MX","MY","MZ","NA","NE","NG","NI","NL","NO","NP","NR","NZ","OM","PA","PE","PG","PH","PK","PL","PT","PW","PY","QA","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SK","SL","SM","SN","SO","SR","ST","SV","SY","SZ",bC,"TG","TH","TJ",Nf,"TM","TN","TO",Of,"TT","TV","TW","TZ","UA","UG","UM",eC,"UY","UZ","VC","VE","VN","VU","WS","YE","YU","ZA","ZM","ZW"];V("gviz.util.RegionCoder.dictionaryReady",zGa,void 0);var CGa={xS:Jg,yS:Eh}; function jR(a,b,c,d){var e={},f={},g=b.K6||Jo;if(b[lz]==Jg){var f=b.X,e=a.mk[0],k=a.mk[a.mk[J]-1],g=new Io({pattern:g}),e=g.Ee(e),k=g.Ee(k),f={Hh:{text:e,width:d?d(e,f)[r]:0,height:f[uc]},Zi:{text:k,width:d?d(k,f)[r]:0,height:f[uc]}};d=f.Hh[A]/4;e=new vl(f.Hh[r]+d,0,b[r]-(f.Hh[r]+f.Zi[r]+2*d),b[A])}else e=new vl(0,0,b[r],b[A]);d=0.33*e[A];var k=2*(d/h[ud](3)),g=new vl(e[G]+k/2,e.top+d+1,e[r]-k,e[A]-d-1),l=a.iu,n=a.mk,q=n[n[J]-1]-n[0],s;if(0==q)s=[{Xg:new vl(g[G],g.top,g[r],g[A]),brush:new Rm({fill:l[0]})}]; else{s=[];for(var q=g[r]/q,u=g[G],w=0,z=0;z<n[J]-1;++z)w=u+(n[z+1]-n[z])*q,s[z]={Xg:new vl(u,g.top,w-u,g[A]),brush:new Rm({gh:{x1:u,y1:0,hb:w,kb:0,lg:l[z],Tf:l[z+1]}})},u=w}g=s;if(null!=g&&0<g[J]&&(0>g[0].Xg[r]||0>g[0].Xg[A]))return null;l=e;n=b.J6;e=[];for(s=0;s<c[J];++s)q=c[s][id],u=a.mk,q<u[0]?q=0:(w=l[r]-k,q>u[u[J]-1]?q=w:(z=u[u[J]-1]-u[0],q=0==z?0.5*w:(q-u[0])/z*w)),q=l[G]+q+k/2,q=[q-k/2,l.top,q+k/2,l.top,q,l.top+d],u=new Rm({fill:n,stroke:n}),e[s]={path:q,brush:u};a=[];b[lz]==Jg&&(a=f,c=[], c[0]={x:0,y:b[A]-a.Hh[A],text:a.Hh[cd],style:b.X},c[1]={x:b[r]-a.Zi[r],y:b[A]-a.Zi[A],text:a.Zi[cd],style:b.X},a=c);a={pW:g,qW:e,rW:a};f=a.pW;for(c=0;c<f[J];++c)d=f[c],b[lz]==Eh&&(k=d.Xg[G],Ya(d.Xg,d.Xg.top),d.Xg.top=k,k=d.Xg[r],pa(d.Xg,d.Xg[A]),Sa(d.Xg,k)),Ya(d.Xg,d.Xg[G]+b[G]),d.Xg.top+=b.top,k=d.brush.o(),d.brush=k,d=k.Qg,b[lz]==Eh&&(d.y1=d.x1,d.x1=0,d.kb=d.hb,d.hb=0),null!=d&&(d.x1+=b[G],d.y1+=b.top,d.hb+=b[G],d.kb+=b.top);f=a.qW;for(c=0;c<f[J];++c)for(d=0;3>d;++d)b[lz]==Eh&&(k=f[c][gz][2*d], f[c][gz][2*d]=f[c][gz][2*d+1],f[c][gz][2*d+1]=k),f[c][gz][2*d]+=b[G],f[c][gz][2*d+1]+=b.top;f=a.rW;for(c=0;c<f[J];++c)f[c].x+=b[G],f[c].y+=b.top;return a};var DGa={Jua:usa,qwa:mAa,Kua:PD,Wva:qH,Ava:vG};function kR(a){this.b=a||{}}kR[K].uV=function(){return 1.618};kR[K].set=function(a,b){this.b[a]=b};kR[K].Vc=function(){return Qj(this.b)};function lR(a){var b=0,c=0;if(a.boundingBox)var d=a.boundingBox.lo,c=a.boundingBox.hi,b=(c[0]-d[0])/2+d[0],c=(c[1]-d[1])/2+d[1];d=[29.5,45.5];b={parallels:d,origin:{lat:b,lng:c}};c=b[gx];a[gx]&&Sj(c,a[gx]);Sj(b,a);b.origin=c;b.Dl&&0!==b.Dl[J]?2>b.Dl[J]&&(b.Dl[1]=h.abs(b.Dl[0]-d[0])>h.abs(b.Dl[0]-d[1])?d[0]:d[1]):b.Dl=d;this.b=a||{};this.v_=b[gx].lat/(180/h.PI);this.rQ=b[gx].lng/(180/h.PI);this.mo=Gi(b.parallels,function(a){return a/(180/h.PI)})}X(lR,kR); lR[K].iD=function(a){return Gi(arguments,W(function(a){var c=a[0]/(180/h.PI),d=0.5*(h.sin(this.mo[0])+h.sin(this.mo[1]));a=d*(a[1]/(180/h.PI)-this.rQ);var e=h.cos(this.mo[0]),e=e*e+2*d*h.sin(this.mo[0]),c=h[ud](e-2*d*h.sin(c))/d,d=h[ud](e-2*d*h.sin(this.v_))/d;return{x:180/h.PI*h.sin(a)*c,y:180/h.PI*(d-c*h.cos(a))}},this))};function mR(a){this.b=a||{}}X(mR,kR);mR[K].uV=function(){return 2.2};mR[K].iD=function(a){return Gi(arguments,function(a){var c=a[0]/(180/h.PI);a=a[1]/(180/h.PI)*3/(2*h.PI)*(180/h.PI);return{x:h[ud](h.PI*h.PI/3-c*c)*a,y:c}})};function nR(a){var b=0,c=0;if(a.boundingBox)var d=a.boundingBox.lo,c=a.boundingBox.hi,b=(c[0]-d[0])/2+d[0],c=(c[1]-d[1])/2+d[1];d=[20,50];b={parallels:d,origin:{lat:b,lng:c}};c=b[gx];a[gx]&&Sj(c,a[gx]);Sj(b,a);b.origin=c;b.Dl&&0!==b.Dl[J]?2>b.Dl[J]&&(b.Dl[1]=h.abs(b.Dl[0]-d[0])>h.abs(b.Dl[0]-d[1])?d[0]:d[1]):b.Dl=d;this.b=a||{};this.v_=b[gx].lat/(180/h.PI);this.rQ=b[gx].lng/(180/h.PI);this.mo=Gi(b.parallels,function(a){return a/(180/h.PI)})}X(nR,kR); nR[K].iD=function(a){return Gi(arguments,W(function(a){var c=a[0]/(180/h.PI);a=a[1]/(180/h.PI);var d=h.log(1/h.cos(this.mo[1])*h.cos(this.mo[0]))/h.log(h.tan(0.25*h.PI+0.5*this.mo[1])*(1/h.tan(0.25*h.PI+0.5*this.mo[0]))),e=h.cos(this.mo[0])*h.pow(h.tan(0.25*h.PI+0.5*this.mo[0]),d)/d,c=e*h.pow(1/h.tan(0.25*h.PI+0.5*c),d),e=e*h.pow(1/h.tan(0.25*h.PI+0.5*this.v_),d);return{x:180/h.PI*h.sin(d*(a-this.rQ))*c,y:e-180/h.PI*h.cos(d*(a-this.rQ))*c}},this))};function oR(a){return 180/h.PI*(h.atan(h.exp(a/(180/h.PI)))-h.PI/4)*2}function pR(){this.bq={}}pR[K].aqa=function(a){Y(arguments,W(function(a){for(var c in a)if(a[vc](c)){c in this.bq||(this.bq[c]={min:ea,max:-ea});if(!this.bq[c].min||a[c]<this.bq[c].min)this.bq[c].min=a[c];if(!this.bq[c].max||a[c]>this.bq[c].max)this.bq[c].max=a[c]}},this))};pR[K].getBounds=function(a){return{min:this.bq[a].min,max:this.bq[a].max}};function qR(a){this.b=a||{}}X(qR,kR);qR[K].iD=function(a){return Gi(arguments,function(a){return{x:a[1],y:180/h.PI*h.log(h.tan(a[0]/180*0.5*h.PI+h.PI/4))}})};var EGa={gua:"albers",jva:Tva,mva:"lambert",zva:uG},rR={};rR.mercator=qR;rR[Tva]=mR;rR.albers=lR;rR.lambert=nR;var FGa={NONE:R,TOP_LEFT:PI,TOP_RIGHT:OAa,BOTTOM_LEFT:ZC,BOTTOM_RIGHT:"bottom_right"},GGa={NONE:R,Yva:zH,uua:$C,Vx:kg};function HGa(a){return nn(a,fya,{name:uG},function(a){ai(a)||(a={name:a});var c=a[yd];if(null!=c&&!Jj(EGa,yn(c)))throw m("The projection you specified is not valid.");return a})} var IGa={region:kJ,resolution:PD,domain:sB,displayMode:eg,showGeocodeWarnings:!1,backgroundColor:{fill:Hh,stroke:iA,strokeWidth:0},datalessRegionColor:"F5F5F5",defaultColor:"267114",markerOpacity:1,selectionMode:oh,fontName:nB,geocodingContext:zH,tooltip:{isHtml:!1,textStyle:{fontName:nB,fontSize:13,color:RC},trigger:zg,showDisputedText:!1,showTitle:!0},colorAxis:{minValue:null,maxValue:null,values:null},sizeAxis:{minValue:null,maxValue:null,minSize:3,maxSize:12},legend:{position:ZC,orientation:Jg, textStyle:{color:RC,auraColor:Hh}},marker:{style:{stroke:{color:tA,width:1}}},projection:uG,keepAspectRatio:!0,magnifyingGlass:{enable:!0,zoomFactor:5}};function sR(a){this.yc=a;this.wC=null;this.Faa=!0;this.oJ=null;this.To=new wu;this.Kpa=/^([a-zA-Z][a-zA-Z]|[a-zA-Z][a-zA-Z]\-[a-zA-Z0-9](|[a-zA-Z0-9](|[a-zA-Z0-9]))|\d\d\d)$/;this.epa=/^\d\d\d$/}X(sR,Us);T=sR[K];T.g1=function(a){this.wC=a;null!=this.ora&&this.ora(a)};function JGa(a,b,c,d,e,f){a.Faa=e;if(0==b.M())ut(function(){f([],[],!0)});else switch(c.xX){case Yr:a.gW(b,c,f);break;case xs:KGa(a,b,c,d,f);break;case Br:a.fW(b,c,d,f)}} T.gW=function(a,b,c){for(var d=[],e=0;e<a.M();e++){var f=a[I](e,b.FA),g=a[I](e,b.HA);d[e]=null==f||null==g?null:{lat:ni(f),lng:ni(g)}}ut(function(){c([],d,!0)})};function KGa(a,b,c,d,e){for(var f=[],g=0;g<b.M();g++)f[C](b[I](g,c.pG));d.Rm==vG||d.Rm==usa||d.Rm==mAa?a.cW(d,f,e):a.dW(d,f,e)}T.cW=function(a,b,c){a=ki(a.Ju,eC)&&a.Rm==vG;for(var d=[],e=0;e<b[J];e++){var f=ni(b[e]);a&&this.epa[bd](f)&&(f=fC+f);d[C](f[ge]())}ut(function(){c(d,[],!0)})}; T.dW=function(a,b,c){var d=a.Ju,e;e=a.Rm==qH&&0<=aj(BGa,d)?d:Fsa;if(a.Rm==qH&&d==eC)for(a=0;a<b[J];++a){var f=b[a];2==f[J]&&(b[a]=fC+f)}yGa(e,this.Fi(function(a){a=this.NY(b,a);for(var e=[],f=0;f<b[J];f++)if(null==a[f]){var n=b[f];e[C]({f0:n,Uaa:f,Taa:null});a[f]=n}Si(e)?c(a,[],!0):(c(a,[],!1),LGa(this,e,d,c,a))}))};T.NY=function(a,b){for(var c=[],d=0;d<a[J];++d){var e=pi(ni(a[d]))[ke](),f=b&&AGa(b,e),e=f?f:this.Kpa[bd](e)?e[ge]():null;c[C](e)}return c};function tR(a,b){a.Faa&&a.yc&&nu(a.yc,b)} T.fW=function(a,b,c,d){var e=[];c=c.Ju;2==c[J]&&(c=c[ge](),c=c[vb](/GB/,Bpa),c=c[vb](/RU/,ipa),c=c[vb](/TP/,Nf));for(var f=0;f<a.M();f++){var g=ni(a[I](f,b.qG));MGa(this,c)&&(g+=ne+c);e[C]({f0:g,Taa:f,Uaa:null})}LGa(this,e,c,d,[])};function MGa(a,b){return b==kJ||oi(b)?!1:a.oJ===zH||a.oJ===kg} function NGa(a){var b=ea,c=ea,d=-ea,e=-ea;if(null!=a.wC&&0!==a.wC[ky][J])return Y(a.wC[ky],function(a){a=a.bt;b=h.min(b,a.Og[0]);c=h.min(b,a.Og[1]);d=h.max(d,a.Uh[0]);e=h.max(d,a.Uh[1])}),{lo:{lat:b,lng:c},hi:{lat:d,lng:e}}}function LGa(a,b,c,d,e){for(var f=[],g=0;g<b[J];g++){var k={address:b[g].f0};MGa(a,c)&&(k.region=c);a.oJ!==$C&&a.oJ!==kg||(k.bounds=NGa(a));f[C](k)}b=Yi(b);d=W(a.$Y,a,b,d,e,[]);a.To[Up](f,d,1)} T.$Y=function(a,b,c,d,e){for(var f=e[J],g=0;g<f;g++){var k=a[g],l=k.f0,n=k.Uaa,q=k.Taa;if(e[g]&&e[g][0]){k=e[g][0];if(null!=n){var s=c,u=n,w=k.address_components,z=null;1==w[J]&&0<=Ci(w[0].types,Gsa)?z=w[0].short_name:2==w[J]&&w[1].short_name==eC&&(z=fC+w[0].short_name);s[u]=z;c[n]||(tR(this,woa+l+oe),c[n]=l)}null!=q&&(l=d,n=q,k={lat:k[yx][tc].lat(),lng:k[yx][tc].lng()},l[n]=k)}else null!=n&&(c[n]=null),null!=q&&(d[q]=null),tR(this,woa+l+oe)}Vi(a,0,f);(a=Si(a))&&Ni(c,Wh)&&Ni(d,Wh)&&tR(this,Aoa);b(c, d,a)};T.Fi=function(a){return W(a,this)};T.w=function(){this.To[pq]();sR.e.w[L](this)};function OGa(a,b,c){for(var d=0;d<a[J];++d)b.rb(a[d].Xg[G],a[d].Xg.top,a[d].Xg[r],a[d].Xg[A],a[d].brush,c)}function PGa(a,b,c){for(var d=0;d<a[J];++d){var e=new YJ;e[Yy](a[d][gz][0],a[d][gz][1]);e.Z(a[d][gz][2],a[d][gz][3]);e.Z(a[d][gz][4],a[d][gz][5]);e[vy]();b.na(e,a[d].brush,c)}}function QGa(a,b,c){for(var d=0;d<a[J];++d)b.Pd(a[d][cd],a[d].x,a[d].y,1,nI,nI,a[d][x],c)};function uR(a){return a[ie](Me)};function vR(a,b,c){this.g=b;this.vf=W(this.g.vf,this.g);this.si=a;this.iN=[];this.Za=c;this.ed={};this.pc=new rt;this.SW=this.Jv=this.Yv=this.Xv=this.Pv=this.mt=this.Fz=null}X(vR,Us);vR[K].l=function(a,b){kt(this.pc,a,b)}; function RGa(a,b){var c=a.g;c[Wb]();var d=c.wk(b[r],b[A]);a.ed={};var e=c.za();SGa(a,e,b,new vl(0,0,b[r],b[A]),!1);var f=c.za(),g=a.g,k=g.za();a.Pv=g.za();for(var l=0;l<b[ky][J];++l)TGa(a,k,b,b[ky][l],!1),UGa(a,b,b[ky][l]);a.mt=g.za();wR(a,a.mt,b.Fy,!1,b.Kj);g[p](f,k);g[p](f,a.Pv);g[p](f,a.mt);g=b.bfa;f=c.cE(f,a.qB()?new vl(g[G],g.top,g[r]-1,g[A]-1):g);a.Yv=c.za();VGa(a,b);a.Jv=c.za();WGa(a,b);a.Xv=c.za();XGa(a,b);c[p](d,e);c[p](e,f);c[p](e,a.Yv);c[p](e,a.Jv);c[p](e,a.Xv);a.Fz=b;YGa(a,d)} function xR(a,b,c){c=c||!1;a.g.cd(a.Xv);XGa(a,b);if(c||!gn(a.Fz.nz,b.nz))for(a.g.cd(a.Pv),c=0;c<b[ky][J];++c)UGa(a,b,b[ky][c]);ZGa(a,b);a.g.cd(a.Yv);VGa(a,b);a.SW!=(b.UD?b.UD.bn:null)&&(a.g.cd(a.Jv),WGa(a,b));a.Fz=b}function UGa(a,b,c){var d=a.g.za();c=Fi(c.N,function(a){return Ri(b.nz,a.id)});for(var e=0;e<c[J];++e)$Ga(a,d,b,c[e]);a.g[p](a.Pv,d)}function aHa(a,b){var c=a.g;Y($k(a.mt.a()),function(a){Y($k(a),function(a){c.Ff(a)},this)},a);wR(a,a.mt,b.Fy,!1,b.Kj)} var bHa=new Rm({qa:Ve,stroke:RC,Cg:"0.2"}),cHa=new Rm({qa:Te,stroke:RC,Cg:"0.1"});function $Ga(a,b,c,d){a.qB()||(c=c.hz[d.id].ce,yR(a,b,d,!1,!1,[bHa,cHa,c[fc]]),Si(d.Cm)||(yR(a,b,d,!0,!1,[c.Cm]),yR(a,b,d,!1,!1,[c.border])))} function WGa(a,b){var c=b.UD;if(c){var d=a.Jv,e=a.g,f=c[Lq].Zy,g=f[G]+f[r]/2,k=f.top+f[A]/2,l=f[r]/2,n=f[A]/2,q=c.A5.x,s=c.A5.y,u=new Rm({fill:nna,ae:0.25}),w=new YJ;w[Yy](q,s);w.Z(q,s+(k>s?n:-n));w.Z(q+(g>q?l:-l),s);w[vy]();q=e.na(w,u,d);zR(a,q,SF,!0);q=new Rm({fill:Hh});q=e.Nj(g,k,l,n,q,d);zR(a,q,RF,!0);q=new Rm({stroke:ira,qa:1.5});q=e.Nj(g,k,l,n,q,d);zR(a,q,RF,!0);q=e.za();f=e.cE(q,new vl(f[G]+3.5,f.top+3.5,f[r]-7,f[A]-7),!0);e[p](d,f);f=new Rm({stroke:Cra,qa:1.5});d=e.Nj(g,k,l-3.5,n-3.5,f,d); zR(a,d,RF,!0);d=c[Lq];SGa(a,q,b,d.Zy,!0);TGa(a,q,b,d,!0);wR(a,q,c.Fy,!0,b.Kj);a.SW=c.bn}else a.SW=null}function XGa(a,b){0<a.iN[J]&&(Gi(a.iN,function(a){this.g.Ff(a)},a),a.iN=[]);a.iN=0<b.Aq[J]?Gi(b.Aq,function(a){return a[jy]?yP(a,this.si.ac()):zP(a,this.g,this.Xv).a()},a):[]}function dHa(a,b){Dj(b.hz,function(a,b){var e=a.ce;AR(this,b,uE,e[fc]);AR(this,b,uta,e.Cm);AR(this,b,lra,e.border)},a)}function AR(a,b,c,d){b=uR([c,b]);b=a.ed[b];if(null!=b)for(c=0;c<b[J];++c)a.g.Ri(b[c],d)} function YGa(a,b){var c=a.Fi(function(a){var b=eHa(this,a[Mq]);if(b&&b.oO){var c=fHa(a[H],b[H]),d=b.cu,b=Pj(b[Z]);a[H]==fs?b.jn=!1:a[H]==gs&&(b.jn=!0);b.ub=gK(a);this.pc[$]({type:c,cu:d,data:b})}}),d=a.g;d.Fb(b,EG,c);d.Fb(b,fs,c);d.Fb(b,gs,c);d.Fb(b,Fr,c)}function fHa(a,b){switch(b){case uE:switch(a){case Fr:return vE;case EG:return xE;case fs:case gs:return wE}case UF:switch(a){case Fr:return VF;case EG:return bxa;case fs:case gs:return mG}}return null} function zR(a,b,c,d){BR(a,b,[nf,c,Te,d?Te:Oe,O,Oe])}function BR(a,b,c){c=c[ie](qe);a.g.zn(b,c)}function eHa(a,b){var c=a.g.Er(b);if(!c||c==ag)return null;var c=c[pc](qe),d=c[1],e=c[2]==Te?!0:!1,f=c[3]==Te?!0:!1;switch(c[0]){case nf:return{type:uE,cu:d,oO:e,data:{WH:f,Ot:c[4]?c[4]:null,zF:c[5]==Te?!0:!1}};case sf:return{type:UF,cu:d,oO:e,data:{WH:f,bn:c[4],ri:yi(c[5]),Ty:c[6]==Te?!0:!1}};default:return null}}function SGa(a,b,c,d,e){b=a.g.rb(d[G],d.top,d[r],d[A],c.nD,b);zR(a,b,vxa,e)} function TGa(a,b,c,d,e){for(var f=a.g.za(),g=0;g<d.N[J];++g){var k=a,l=f,n=d.N[g],q=e,s=c.hz[n.id].ce;yR(k,l,n,!1,q,[s[fc]],uE);Si(n.Cm)||(yR(k,l,n,!0,q,[s.Cm],uta),yR(k,l,n,!1,q,[s.border],lra))}a.g[p](b,f)} function yR(a,b,c,d,e,f,g){var k=d?c.Cm:c.IB,l=c.id;(g=null!=g?uR([g,l]):null)&&(a.ed[g]=a.ed[g]||[]);for(l=0;l<k[J];++l){var n;n=k[l];var q=new YJ;gHa(q,n.lI,KG);for(var s=0;s<n.kI[J];s++)gHa(q,n.kI[s],Uya);n=q;if(0<n.Yc[J])for(q=0;q<f[J];++q)if(s=a.g.na(n,f[q],b))BR(a,s,[nf,uE,c.oO?Te:Oe,e?Te:Oe,c.id,d?Te:Oe]),g&&a.ed[g][C](s)}} function gHa(a,b,c){b=b.j;var d=b[J];if(!(1>=d)){var e=c==KG?0:d-1,d=c==KG?d:-1;c=c==KG?1:-1;for(var f=e;f!=d;f+=c){var g=b[f][0],k=b[f][1];f==e?a[Yy](g,k):a.Z(g,k)}a[vy]()}} function wR(a,b,c,d,e){var f=a.g;c=Yi(c);cj(c,function(a,b){return b[ly]-a[ly]});for(var g=0;g<c[J];++g){var k=c[g],l=f.za();BR(a,l,[sf,UF,Te,d?Te:Oe,k.bn,k.ri,k.Ty?Te:Oe]);f[p](b,l);a.Za.a3===Es?f.Pd(k[Rc],k.x,k.y,20,pD,pD,{Va:e,fontSize:k[ly],color:k.brush.gb(),opacity:k.brush.Oe,Tb:O,bold:!1,De:!1,Ic:!1},l):f.Zd(k.x,k.y,k[ly],k.brush,l);k=uR([UF,k.bn]);a.ed[k]=l.a()}} function ZGa(a,b){var c=a.g,d=a.Fz.sz;Y(d,function(a){if(!Ri(b.sz,a)){a=uR([UF,a]);a=$k(this.ed[a]);for(var d=1;d<a[J];++d)c.Ff(a[d])}},a);Y(b.sz,function(a){if(!Ri(d,a)){a=uR([UF,a]);a=this.ed[a];var b=al(a).cloneNode(!0);c.Ri(b,bHa);a[p](b)}},a)}function VGa(a,b){if(b.gi){var c=b.gi,d=a.g,e=a.Yv;OGa(c.pW,d,e);PGa(c.qW,d,e);QGa(c.rW,d,e)}} vR[K].w=function(){qt(this.pc);null!=this.kga&&this.g.Ff(this.kga);this.g[Wb]();Ws(this.Fz);this.Fz=null;this.mt&&this.g.Ff(this.mt.a());this.mt=null;this.Pv&&this.g.Ff(this.Pv.a());this.Pv=null;this.Xv&&this.g.Ff(this.Xv.a());this.Xv=null;this.Yv&&this.g.Ff(this.Yv.a());this.Yv=null;this.Jv&&this.g.Ff(this.Jv.a());this.Jv=null;vR.e.w[L](this)};vR[K].Fi=function(a){return W(a,this)};vR[K].qB=function(){return this.g.qB()};function CR(a){this.selection=new FN;this.Ft=this.sj=this.mG=this.af=null;if(null!=a){this[px][Yx](a[px]);var b=new jn([a]);this.af=An(b,mua);this.mG=An(b,nua);if(null!=nn(b,Lta)){a=tn(b,Pta);var c=b.R(Mta,null,on),d=tn(b,Nta),b=tn(b,Ota);null!=a&&null!=d&&null!=b&&null!=c&&(this.sj={ri:a,zF:c,origin:{x:d,y:b}})}}}CR[K].o=function(){var a=new CR;a.selection=this[px].o();a.af=Qj(this.af);a.sj=Qj(this.sj);a.Ft=Qj(this.Ft);return a};Za(CR[K],function(a){return Tm(this)==Tm(a)});function hHa(a,b){var c=new rl(-5,-5,-5,-5);this.tn=b.o().expand(c);c=2*zk(a)/5;this.y7=new xk(c,c)}hHa[K].j9=function(a,b,c){var d=b.FT,e=b.Zy.Ub();b=ma(a.lat);a=ma(a.lng);a<d.Og[1]?a+=360:a>d.Uh[1]&&(a-=360);c=zk(this.y7)/2/c/(e[A]/(d.Uh[0]-d.Og[0]));return{Uh:[b+c,a+c],Og:[b-c,a-c]}};function iHa(a,b){var c=Oi(a.Fy,function(a){return a.ri==b});if(!c)return!1;var d=a[Lq].Zy,c=uk(new sk(c.x,c.y),new sk(d[G]+d[r]/2,d.top+d[A]/2)),d=zk(d.Ub())/2;return c<0.9*d};function DR(a,b,c,d){this.qg=!a.qB()&&pn(b,Uwa);this.n=c;this.Xa=d;this.dC=this.wI=null}kp(DR[K],function(a,b){if(!this.qg)return!1;if(jHa(this,a)||kHa(this,a,b))return!0;var c=a.cu==uE;return a[Z].WH&&c?!0:!1});function kHa(a,b,c){if(b[H]!=mG)return!1;if(b[Z].jn){if(!b[Z].Ty)return!1;if(c&&iHa(c,b[Z].ri))return!0;lHa(a);a.wI=ca[Yp](a.Fi(function(){this.wI=null;this.n.Ft={bn:b[Z].bn,ri:b[Z].ri};WN(this.Xa,0)}),300);return!0}lHa(a);return!1} function jHa(a,b){if(!a.n.Ft)return!1;switch(b[H]){case VF:case vE:var c;b[Z].WH?c=!1:(ER(a),c=!0);return c;case mG:case wE:if(b[Z].jn){c=b.cu==UF;var d=b.cu==SF;b[Z].WH&&!d?FR(a):c&&(b[Z].Ty?FR(a):ER(a))}else null===a.dC&&(c=b.cu==UF,(b[Z].WH||c)&&mHa(a));return!1;case xE:return b.cu==SF?(mHa(a),c=!0):c=!1,c;default:return!1}}function mHa(a){FR(a);a.dC=ca[Yp](a.Fi(function(){this.dC=null;ER(this)}),500)}function ER(a){a.n.Ft=null;WN(a.Xa,0)}function lHa(a){null!==a.wI&&(Ph[Gp](a.wI),a.wI=null)} function FR(a){null!==a.dC&&(Ph[Gp](a.dC),a.dC=null)}DR[K].Fi=function(a){return W(a,this)};function nHa(a,b,c,d){this.P1=h.pow(a,2);this.O1=h.pow(b,2);this.qqa=b;this.Q1=(this.aq=c?new zm(d[Sz](c[y]),d[Sz](c.end)):null)?this.aq.end-this.aq[y]:null;this.dda=d}function oHa(a,b){var c=null;null!=b&&null!=a.dda&&(b=a.dda[Sz](b));if(null!=b&&null!=a.aq)0===a.Q1&&b===a.aq[y]?c=(a.O1+a.P1)/2:b<=a.aq[y]?c=a.P1:b>=a.aq.end&&(c=a.O1);else if(!a.Q1||null==b)return a.qqa;null==c&&(b=nj(b,a.aq[y],a.aq.end),c=pj(a.P1,a.O1,(b-a.aq[y])/a.Q1));return h[D](h[ud](c))} function pHa(a,b){var c=vn(a,Qza),d=vn(a,Oza);if(c>d)throw m("sizeAxis.minSize ("+c+") must be at most sizeAxis.maxSize ("+d+Ge);var e=tn(a,Rza),f=tn(a,Pza);if(null!=e&&null!=f&&e>f)throw m("sizeAxis.minValue ("+e+") must be at most sizeAxis.maxValue ("+f+Ge);e=afa(b,e,f);f=XO(a,Nza,Sza);f=yEa(f,ja,[]);return new nHa(c,d,e,f)};function GR(a){this.b=a||{}}X(GR,kR);GR[K].uV=function(){return 1};GR[K].iD=function(a){return Gi(arguments,function(a){return{x:a[1],y:a[0]}})};function qHa(a,b,c,d,e,f){this.b=a;var g=HGa(a);this.mT=new rR[g[yd]](g);this.V=b;this.Oa=c;var k=Um(Jn(a,HC)),g=b-k,k=c-k,l=h[D]((b-g)/2),n=h[D]((c-k)/2);this.Gq=new vl(l,n,g,k);l=this.Gq;if(a.R(Uva,null,on))var q=l[r],n=l[A],s=this.mT.uV(),g=h.min(q,h[D](n*s)),k=h[D]((q-g)/2)+l[G],q=h.min(n,h[D](q/s)),l=h[D]((n-q)/2)+l.top,g=new vl(k,l,g,q);else g=l.o();this.Us=g;this.Wc=d;this.t=e;this.Za=f;this.v3=vn(a,HE,h[D](h.pow(2*(this.Gq[r]+this.Gq[A]),1/3)));this.ifa=Cn(a,[$wa,Zwa],tA);this.jfa=vn(a,axa, 1);this.lT=zn(a,GE);this.iq=rHa(this);this.rD=sHa(this);d=a.R(DF);this.Lfa=Vh(d)==$g;this.LL=Gn(a,ewa,FGa,ZC);this.I4=xn(a,Xva,1/3);this.KL=Gn(a,cwa,CGa,Jg);this.J4=Ln(a,jwa,{Va:this.lT,fontSize:this.v3});this.RT=An(a,bwa);this.Dfa=Cn(a,Vsa,O);this.YK=Cn(a,$sa,O);this.s3=tHa(this);this.kfa=uHa(this);d=Ln(a,GAa);e=Zea(d);this.kz=Gn(a,MI,Nn,zg);this.As=this.kz!=R;this.Kq={normal:d,bold:e};d=pn(a,CAa);this.qfa=pn(a,EAa);this.pfa=d?Xla:Wla;this.FU=pn(a,AAa);this.cga=10;this.sT=this.Oo=this.pz=null;this.Yy= tA;this.YD=null;this.hfa=xn(a,cxa);this.ofa=new hHa(this.Us.Ub(),new rl(0,b,c,0))}function vHa(a,b){for(var c=0,d=a.pz[J];c<d;c++)for(var e=a.pz[c].qV.N,f=0,g=e[J];f<g;f++){var k=e[f];if(k.id==b)return k}return null}function wHa(a,b){var c=xHa(a,a.Dfa),d={};Y(b[ky],function(a){Y(a.N,function(a){d[a.id]={ce:c}},this)},a);return d} function yHa(a,b){for(var c=new pR,d=1;10>d;d++){var e=(a.Uh[1]-a.Og[1])/10*d+a.Og[1],f=(a.Uh[0]-a.Og[0])/10*d+a.Og[0],e=b.iD([f,a.Og[1]],[f,a.Uh[1]],[a.Og[0],e],[a.Uh[0],e]);c.aqa[Mc](c,e)}d=c[$x](lJ);c=c[$x](Jh);return{Uh:[c.max,d.max],Og:[c.min,d.min]}}T=qHa[K]; T.i5=function(a,b,c,d){for(var e=zHa(this,Oda(Aj(d.IB),Aj(d.Cm)));e[1]>a.Uh[1];)e[1]-=360;for(;e[1]<a.Og[1];)e[1]+=360;return{id:d.id,center:this.lX(a,b,c,e),IB:Gi(d.IB,W(this.sca,this,a,b,c)),Cm:Gi(d.Cm,W(this.sca,this,a,b,c)),oO:d.id!=Ppa}};function zHa(a,b){var c=0,d=0,e=0;Bj(b,function(a){Y(a.lI,function(a){c+=a[0];d+=oj(a[1],360);e++},this)},a);return[c/e,d/e]}T.sca=function(a,b,c,d){return{lI:this.tda(a,b,c,d.lI),kI:Gi(d.kI,W(this.tda,this,a,b,c))}}; T.tda=function(a,b,c,d){return{j:Gi(d,W(this.lX,this,a,b,c))}};T.lX=function(a,b,c,d){var e=a.Og;a=a.Uh;var f=b[r],g=b[A],k=b[G];b=b.top;c=c.iD(d)[0];return[k+f*(c.x-e[1])/(a[1]-e[1]),b+g*(1-(c.y-e[0])/(a[0]-e[0]))]};function AHa(a,b){var c=[];a.Oo=[];for(var d=Gi(a.pz,function(a){return a.qV}),e=0;e<b[J];++e){var f=b[e],g={location:f,PV:{}};if(null!=f){f=BHa(a,e,f,d);Zi(c,f);for(var k=0;k<f[J];k++){var l=f[k];g.PV[l.bn]=l}}a.Oo[C](g)}CHa(c);return c} function CHa(a){for(var b=0;b<a[J];b++){for(var c=a[b],d=new sk(c.x,c.y),e=0,f=0;f<a[J];f++)if(b!=f){var g=a[f],k=uk(d,new sk(g.x,g.y));k<c[ly]+g[ly]&&(e+=c[ly]+g[ly]-k)}c.Ty=e>c[ly]}} function BHa(a,b,c,d){var e=a.kfa(b),f=a.s3(b);if(null==f)return[];var f=new Rm({stroke:a.ifa,qa:a.jfa,fill:f,ae:a.hfa}),g=ma(c.lat),k=[];c=ma(c.lng);c=[c,c+360,c-360];for(var l=0;l<d[J];++l){var n=d[l],q=a.YD[l],s=n.FT;if(!(g<s.Og[0]||g>s.Uh[0])){for(var u=0;u<c[J];++u){var w=c[u];if(!(w<s.Og[1]||w>s.Uh[1])){var w=a.lX(n.bt,n.Zy,q,[g,w]),z=String(b+Le+n.id+Le+u),B=UF;null!=a.Za.RG&&0<=a.Za.RG?B=a.t.Aa(b,a.Za.RG):null!=a.Za.qG&&0<=a.Za.qG?B=a.t.Aa(b,a.Za.qG):null!=a.Za.pG&&0<=a.Za.pG?B=a.t.Aa(b,a.Za.pG): null!=a.Za.FA&&null!=a.Za.HA&&0<=a.Za.FA&&0<=a.Za.HA&&(B=DHa(a.t[I](b,a.Za.FA),a.t[I](b,a.Za.HA)));k[C]({bn:z,label:B,ri:b,x:w[0],y:w[1],size:e,brush:f,Ty:!1})}}if(0<k[J])break}}return k} function EHa(a,b,c){var d=a.Oo,e=d[c],f=e.PV[b];if(!f.Ty)return null;var g=b[pc](Le)[1],k=a.pz[g],l=a.YD[g],n=sn(a.b,Vwa),q=a.ofa,e=q.j9(e[tc],k.qV,n),f=new sk(f.x,f.y),n=q.tn,q=q.y7,s=f.x;s+q[r]>n[Zc]&&(s=f.x-q[r]);var u=f.y-q[A];u<n.top&&(u=f.y);q=new vl(s,u,q[r],q[A]);l=yHa(e,l);c={id:g+Le+c+uma,bt:l,FT:e,Zy:q,N:Gi(k.N,W(a.i5,a,e,q,new GR))};g=[];for(k=0;k<d[J];k++)l=d[k][tc],null!=l&&Zi(g,BHa(a,k,l,[c]));return{bn:b,A5:f,view:c,Fy:g}} function FHa(a,b){if(!a.Lfa||null==a.iq||!a.iq.mk)return null;var c=a.J4[uc],d=a.Gq[r],e=a.Gq[A],f={top:0,left:0,width:a.KL==Jg?d*a.I4:e*a.I4,height:1.5*c,orientation:a.KL,X:a.J4,J6:RC,K6:a.RT};f.top=a.LL==PI||a.LL==OAa?3*c:a.KL==Eh?e-c-f[r]:e-c-f[A];Ya(f,a.LL==PI||a.LL==ZC?0.5*c:a.KL==Eh?d-c-f[A]:d-c-f[r]);Ya(f,f[G]+a.Gq[G]);f.top+=a.Gq.top;return jR(a.iq,f,b,a.Wc)}function GHa(a,b){for(var c=null,d=0;d<a.t.M();++d)var e=a.t[I](d,b),c=Nm(c,e);return c} function tHa(a){var b=a.Za.xt;return null!=b?function(a){a=this.t[I](a,b);return null!=a?NQ(this.iq,a):this.YK}:function(){return this.YK}}function uHa(a){var b=a.Za.YA;return null!=b?function(a){a=this.t[I](a,b);return oHa(this.rD,a)}:function(){return this.cga}}function rHa(a){var b=a.Za.xt;if(null==b)return null;b=GHa(a,b);return TFa(a.b,b)}function sHa(a){var b=a.Za.YA,b=null!=b?GHa(a,b):null;return pHa(a.b,b)} function HHa(a,b){var c={nz:[],sz:[]};null!=b.af&&(c.nz=[b.af]);null!=b.mG&&(c.sz=[b.mG]);c.Aq=[];a.As&&(a.kz===kg||a.kz===mh)&&Y(HN(b[px]),function(a){var b=IHa(this,a,!1),d=this.Wc,e=this.Kq.normal[uc],f=new rl(0,this.V-1,this.Oa-1,0),s=this.Oo[a];a=(a=this.sT[a])&&vHa(this,a);var u=null,w=null;a?(c.nz[C](a.id),u=w=new sk(a[nx][0],a[nx][1]),c.Aq[C](EN(b,d,!1,w,f,u,void 0,this.FU))):s&&Dj(s.PV,function(a,g){c.sz[C](g);c.Aq[C](EN(b,d,!1,new sk(a.x-e,a.y-e),f,new sk(a.x,a.y),void 0,this.FU))},this)}, a);if(null!=b.sj){if(a.As&&(a.kz===kg||a.kz===zg)){var d=IHa(a,b.sj.ri,b.sj.zF),e=a.Kq.normal[uc],f=new sk(b.sj[gx].x,b.sj[gx].y);c.Aq[C](EN(d,a.Wc,!1,new sk(f.x-e,f.y-e),new rl(0,a.V-1,a.Oa-1,0),f,void 0,a.FU))}null!=a.Za.xt&&(d={value:a.t[I](b.sj.ri,a.Za.xt)},c.gi=FHa(a,[d]))}null!=b.Ft&&(c.UD=EHa(a,b.Ft.bn,b.Ft.ri));return c}function JHa(a,b,c){b=0<=a?c:b;a=h.abs(a);c=h[t](a);var d=60*(a-c);a=h[t](d);d=h[D](60*(d-a));return c+FBa+a+Ee+d+oe+b} function DHa(a,b){return JHa(a,Cf,xf)+ne+JHa(b,Qf,mf)} function IHa(a,b,c){var d=a.Za,e=a.t,f={entries:[]},g;if(null!=d.RG)g=e.Aa(b,d.RG);else switch(d.xX){case Yr:c=e[I](b,d.FA);g=e[I](b,d.HA);g=DHa(c,g);break;case xs:g=e.Aa(b,d.pG);c&&(g=KQ(a.pfa,g));break;case Br:g=e.Aa(b,d.qG);break;default:g=O}a.qfa&&(c=CN(g,a.Kq[Ed]),f[Ez][C](c));if(null!=d.rY)if(c=e.Aa(b,d.rY),e.Li(d.rY,Mg))f[Ez][C](CN(c,a.Kq.normal,void 0,void 0,void 0,void 0,void 0,!0));else for(b=c[pc](me),d=0;d<b[J];d++)c=CN(b[d],a.Kq.normal),f[Ez][C](c);else null!=d.xt&&(g=e.cb(d.xt),c=e.Aa(b, d.xt),c=CN(c,a.Kq[Ed],g,a.Kq.normal),f[Ez][C](c)),null!=d.YA&&d.YA!=d.xt&&(g=e.cb(d.YA),c=e.Aa(b,d.YA),c=CN(c,a.Kq[Ed],g,a.Kq.normal),f[Ez][C](c));return f}T.Fi=function(a){return W(a,this)};function xHa(a,b){var c=b===R?[255,255,255]:rm(b),c=pm(wm(c,0.1));return{fill:new Rm({stroke:c,fill:b}),Cm:new Rm({stroke:R,pattern:new Qm(pH,b,b==a.Yy?te:a.Yy)}),border:new Rm({stroke:c})}};function HR(a,b,c,d,e,f,g,k,l){this.Pk=a;this.b=b;this.V=c;this.Oa=d;this.Za=f;this.n=g;this.dm=null;this.vU=!1;this.uha=k;this.mn=l;this.fT=!1;this.kT=null;this.l4=!1;this.Xa=new VN(this.Fi(this.wq));this.kA=new sO(3);this.WM=[!1,!1,!1];this.Oy=new qHa(this.b,this.V,this.Oa,this.Pk.vf,e,this.Za);this.a5=new DR(a,b,g,this.Xa);this.c6=pn(b,Rta,f.a3==ys);this.XV()}X(HR,Us);T=HR[K]; T.g1=function(a,b){var c;c=this.Oy;var d=c.b;c.pz=[];c.YD=[];for(var e=[],f=0,g=a[ky][J];f<g;f++){var k=a[ky][f],l=c.mT.Vc();l.boundingBox={lo:k.bt.Og,hi:k.bt.Uh};l=new c.mT[rc](l);c.YD[C](l);var l=c,n=k,q=f,s=new vl(n.oga*l.Us[r]+l.Us[G],n.pga*l.Us[A]+l.Us.top,n[Fy]*l.Us[r],n[Fy]*l.Us[A]),u=l.YD[q],w=yHa(n.bt,u),l={id:String(q),bt:w,FT:n.bt,Zy:s,N:Gi(n.N,W(l.i5,l,w,s,u))};e[C](l);c.pz[C]({N:k.N,qV:l})}c={width:c.V,height:c.Oa,bfa:c.Us,Gy:Gn(d,eza,ofa,oh),tta:c.kz,nD:Jn(d,HC),T2:En(d,Yua),title:{text:zn(d, HI),X:Ln(d,JI,{Va:c.lT,fontSize:c.v3}),F:[],align:nI,vb:O},views:e,hz:wHa(c,a),nz:[],sz:[],Fy:[],gi:null,UD:null,Kj:c.lT};this.iE(0,c);this.fT=!0;this.mn(Xwa,b);null!=this.kT?this.kT():this.wq()}; function KHa(a,b,c,d,e,f){a.vU=!1;var g=a.Fi(function(){this.l4=d;if(null!=e){this.dm=null;var a=this.Oy;a.t=e;a.iq=rHa(a);a.rD=sHa(a)}null!=f&&(this.n=f,this.a5.n=f);a=this.Oy;a.sT=[];for(var g={},n=0;n<a.t.M();++n){var q=b[n];a.sT[C](q);if(null!=q){var s=a.s3(n);null!=s&&(g[q]={ri:n,ce:xHa(a,s)})}}a={hz:g,Fy:AHa(a,c),gi:FHa(a,[])};this.iE(1,a);this.wq()});a.fT?g():a.kT=g}Zv(T,function(a){this.n[px][Yx](a);WN(this.Xa,1)});Tw(T,function(){return this.n[px][wz]()}); T.wq=function(){if(this.fT){if(null==this.dm||!this.dm[cz](this.n)){var a=HHa(this.Oy,this.n);this.iE(2,a)}a=this.kA[My]();if(this.WM[0])RGa(this.Pk,a);else if(this.WM[1]){var b=this.Pk;dHa(b,a);aHa(b,a);xR(b,a,!0)}else xR(this.Pk,a);this.WM=[!1,!1,!1];this.dm=this.n.o();!this.vU&&this.l4&&(this.uha(),this.vU=!0)}}; T.$ma=function(a){if(!IR(this,a)&&this.c6){var b=a[Z].Ot;null!==b&&(a[Z].jn?(this.n.af=b,b=LHa(this,b),this.n.sj=null!=b?{ri:b,zF:a[Z].zF,origin:{x:a[Z].ub.x,y:a[Z].ub.y}}:null):(this.n.af=null,this.n.sj=null),WN(this.Xa,50))}};T.cna=function(a){IR(this,a)||(a[Z].jn?(this.n.mG=a[Z].bn,this.n.sj={ri:a[Z].ri,zF:!1,origin:{x:a[Z].ub.x,y:a[Z].ub.y}}):(this.n.mG=null,this.n.sj=null),WN(this.Xa,50))};T.ana=function(a){IR(this,a)||MHa(this,a)};T.dna=function(a){MHa(this,a)}; function MHa(a,b){null!=a.n.sj&&(a.n.sj.origin={x:b[Z].ub.x,y:b[Z].ub.y},WN(a.Xa,3))}T.Zma=function(a){if(!IR(this,a)&&this.c6){var b=a[Z].Ot;null===b||this.mn(pya,{region:b});b=LHa(this,b);this.Dv(a,b)}};T.bna=function(a){IR(this,a)||this.Dv(a,a[Z].ri)};T.Dv=function(a,b){var c=this.kA[My]().Gy==oh;if(null!=b)MN(this.n[px],b,c),this.mn(As,{});else this.n[px][Wb]();this.Xa&&WN(this.Xa,50)};function IR(a,b){var c=a.kA[My]();return a.a5[Pp](b,c?c.UD:null)} T.XV=function(){this.Pk.l(vE,this.Fi(this.Zma));this.Pk.l(wE,this.Fi(this.$ma));this.Pk.l(xE,this.Fi(this.ana));this.Pk.l(VF,this.Fi(this.bna));this.Pk.l(mG,this.Fi(this.cna));this.Pk.l(bxa,this.Fi(this.dna))};function LHa(a,b){if(null===b)return null;var c=a.kA[My]();return c.hz[b]?c.hz[b].ri:null}T.iE=function(a,b){tO(this.kA,a,b);this.WM[a]=!0};T.w=function(){Ws(this.Xa);this.Xa=null;Ws(this.Pk);this.Pk=null;Ws(this.Oy);this.Oy=null;HR.e.w[L](this)};T.Fi=function(a){return W(a,this)};var NHa={COM:{COUNTRIES:["002","005","009","011","013","014","015","017","018","019","021","029","030","034","035","039","053","054","057","061","142","143","145","150","151","154","155","AD","AE","AF","AG","AI","AL","AM","AO","AR","AS",lB,"AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ",ef,"BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG", "EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN",pf,"HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC",OB,"LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL", "NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC",bC,"TF","TG","TH","TJ","TK",Nf,"TM","TN","TO",Of,"TT","TV","TW","TZ","UA","UG","UM",eC,"UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW",kJ],METROS:[eC,"US-500","US-501","US-502","US-503","US-504","US-505","US-506","US-507","US-508", "US-509","US-510","US-511","US-512","US-513","US-514","US-515","US-516","US-517","US-518","US-519","US-520","US-521","US-522","US-523","US-524","US-525","US-526","US-527","US-528","US-529","US-530","US-531","US-532","US-533","US-534","US-535","US-536","US-537","US-538","US-539","US-540","US-541","US-542","US-543","US-544","US-545","US-546","US-547","US-548","US-549","US-550","US-551","US-552","US-553","US-554","US-555","US-556","US-557","US-558","US-559","US-560","US-561","US-563","US-564","US-565", "US-566","US-567","US-569","US-570","US-571","US-573","US-574","US-575","US-576","US-577","US-581","US-582","US-583","US-584","US-588","US-592","US-596","US-597","US-598","US-600","US-602","US-603","US-604","US-605","US-606","US-609","US-610","US-611","US-612","US-613","US-616","US-617","US-618","US-619","US-622","US-623","US-624","US-625","US-626","US-627","US-628","US-630","US-631","US-632","US-633","US-634","US-635","US-636","US-637","US-638","US-639","US-640","US-641","US-642","US-643","US-644", "US-647","US-648","US-649","US-650","US-651","US-652","US-656","US-657","US-658","US-659","US-661","US-662","US-669","US-670","US-671","US-673","US-675","US-676","US-678","US-679","US-682","US-686","US-687","US-691","US-692","US-693","US-698","US-702","US-705","US-709","US-710","US-711","US-716","US-717","US-718","US-722","US-724","US-725","US-734","US-736","US-737","US-740","US-743","US-744","US-745","US-746","US-747","US-749","US-751","US-752","US-753","US-754","US-755","US-756","US-757","US-758", "US-759","US-760","US-762","US-764","US-765","US-766","US-767","US-770","US-771","US-773","US-789","US-790","US-798","US-800","US-801","US-802","US-803","US-804","US-807","US-810","US-811","US-813","US-819","US-820","US-821","US-825","US-828","US-839","US-855","US-862","US-866","US-868","US-881","US-AK","US-AL","US-AR","US-AZ","US-CA","US-CO","US-CT","US-DC","US-DE","US-FL","US-GA","US-HI","US-IA","US-ID","US-IL","US-IN","US-KS","US-KY","US-LA","US-MA","US-MD","US-ME","US-MI","US-MN","US-MO","US-MS", "US-MT","US-NC","US-ND","US-NE","US-NH","US-NJ","US-NM","US-NV","US-NY","US-OH","US-OK","US-OR","US-PA","US-RI","US-SC","US-SD","US-TN","US-TX","US-UT","US-VA","US-VT","US-WA","US-WI","US-WV","US-WY"],PROVINCES:["AD","AE","AF","AG","AL","AM","AO","AR",lB,"AU","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BN","BO","BQ",ef,"BS","BT","BW","BY","BZ","CA","CD","CF","CG","CH","CI","CL","CM","CN","CO","CR","CU","CV","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ", "FM","FR","GA","GB","GD","GE","GH","GL","GM","GN","GQ","GR","GT","GW","GY","HN",pf,"HT","HU","ID","IE","IL","IN","IQ","IR","IS","IT","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KZ","LA","LB","LC",OB,"LK","LR","LS","LT","LU","LV","LY","MA","MD","ME","MG","MH","MK","ML","MM","MN","MR","MU","MV","MW","MX","MY","MZ","NA","NE","NG","NI","NL","NO","NP","NR","NZ","OM","PA","PE","PG","PH","PK","PL","PT","PW","PY","QA","RO","RS","RU","RW","SA","SB","SC","SD","SE","SH","SI","SK","SL","SM", "SN","SO","SR","SS","ST","SV","SY","SZ",bC,"TG","TH","TJ",Nf,"TM","TN","TO",Of,"TT","TV","TZ","UA","UG",eC,"US-AK","US-AL","US-AR","US-AZ","US-CA","US-CO","US-CT","US-DC","US-DE","US-FL","US-GA","US-HI","US-IA","US-ID","US-IL","US-IN","US-KS","US-KY","US-LA","US-MA","US-MD","US-ME","US-MI","US-MN","US-MO","US-MS","US-MT","US-NC","US-ND","US-NE","US-NH","US-NJ","US-NM","US-NV","US-NY","US-OH","US-OK","US-OR","US-PA","US-RI","US-SC","US-SD","US-TN","US-TX","US-UT","US-VA","US-VT","US-WA","US-WI","US-WV", "US-WY","UY","UZ","VC","VE","VN","VU","YE","ZA","ZM","ZW"],REGIONS:["002","009","019","142","150",kJ],SUBREGIONS:["002","005","009","011","013","014","015","017","018","019","021","029","030","034","035","039","053","054","057","061","142","143","145","150","151","154","155",kJ]},IN:{COUNTRIES:["002","009","019","030","034","035","142","143","145","151","AF","BD","BT","CN","IN","MM","NP","PK","RU","TJ","UZ",kJ],PROVINCES:"AF BD BT CN IN MM NP PK RU TJ UZ".split(" "),REGIONS:["002","009","019","142", kJ],SUBREGIONS:["002","009","019","030","034","035","142","143","145","151",kJ]}};var JR={},KR={},LR=null,OHa=MQ(Rr,Ue),MR=OHa;function PHa(a,b,c){MR=a?a+Tq:OHa;KR={};NR=null;a?aR(eR(MR+Kva,Wua),function(a){OR=a;b()},function(){c()}):(OR=NHa,b())} function QHa(a,b){if(null==b)throw m("Callback is null or undefined");var c=RHa(a);if(Qh(KR[c])){var d=W(b,null,KR[c]);Ov(d,0)}else if(Qh(JR[c]))JR[c][C](b);else JR[c]=[b],d=MR+KQ(Ywa,c),aR(eR(d,Uua+c[vb](Le,ve)),function(a){var b={views:Gi(a[ky],SHa)};KR[c]=b;Y(JR[c],function(a){a(b)});delete JR[c]},function(){Y(JR[c],function(a){a(null)});delete JR[c]})}function RHa(a){var b=O;a[$y]!=sB&&(b=a[$y]+iC);return b+a.Ju+iC+THa(a.Rm)} function THa(a){null!=LR||(LR={continents:epa,subcontinents:jpa,countries:tB,provinces:Xoa,metros:Qoa});return LR[a]}var OR=NHa;function UHa(a){var b=a[$y],c=a.Ju;a=THa(a.Rm);if(b=OR[b])if(b=b[a])return 0<=aj(b,c);return!1}var NR=null;function VHa(a){null!=NR?a(NR):aR(eR(MR+Jva,Vua),function(b){NR=b=Gi(b,WHa);a(b)},function(){a(null)})} function SHa(a){for(var b=Gi(a.features,XHa),c={},d=[],e=0;e<b[J];e++){var f=b[e],g=f.id;ki(g,Opa)?c[g]=f:d[C](f)}for(e=0;e<d[J];e++)f=d[e],b=c[Opa+f.id],f.Cm=b?b.IB:[];if(c=c.__DISPUTED__All)c.Cm=c.IB,d[C](c);return{N:d,bt:YHa(a.boundingBox),oga:a.xoffset,pga:a.yoffset,scale:a[Fy]}}function XHa(a){return{id:a.id,IB:Gi(a.polygons,ZHa),Cm:[]}}function ZHa(a){return Zh(a)?{lI:PR(a),kI:[]}:{lI:PR(a.shell),kI:Gi(a.holes,PR)}}function PR(a){return Gi(a,function(a){return[oR(a[0]),ma(a[1])]})} function YHa(a){return{Uh:[oR(a.hi[0]),ma(a.hi[1])],Og:[oR(a.lo[0]),ma(a.lo[1])]}}function WHa(a){return{Ju:a.region,Rm:a.resolution,domain:a[$y],Qna:Gi(a.boundingBoxes,YHa)}};function $Ha(a,b,c,d){var e=zn(c,zH);if(e!=eg)d(QR(e,c));else if(b.xX!=Yr)d(QR(kJ,c));else{for(var f=Hn(c,DH,DGa),g=An(c,Lr),k=[],e=0;e<a.M();++e)k[C]({lat:a[I](e,b.FA),lng:a[I](e,b.HA)});VHa(function(a){if(a){t:{for(var b=0;b<a[J];++b){var e=a[b];if(null==f||e.Rm==f)if(null==g||e[$y]==g){for(var s=!0,u=0;u<k[J];++u){for(var w=k[u],z=!1,B=e.Qna,F=0;F<B[J];++F)if(aIa(w,B[F])){z=!0;break}if(!z){s=!1;break}}if(s){a={Ju:e.Ju,Rm:e.Rm,domain:e[$y]};break t}}}a=null}null!=a?d(a):d(QR(kJ,c))}else d(null)})}} function QR(a,b){var c=Gn(b,DH,DGa,PD),d=zn(b,Lr),c={Ju:a,Rm:c,domain:d};return UHa(c)||c[$y]!=sB&&(c.domain=sB,UHa(c))?c:null}function aIa(a,b){return a.lat>b.Og[0]&&a.lat<b.Uh[0]&&Mi([-360,0,360],function(c){return a.lng+c>b.Og[1]&&a.lng+c<b.Uh[1]})};function RR(a){pu[L](this,a);this.ul=this.Da=null;this.Gx=new sR(this.tu);this.d_=O;this.Ma=this.vj=null}X(RR,pu);T=RR[K];T.Ym=function(a,b,c,d){Xn(NA);Ss.oc(this.lb);this.vj=a;Ws(this.Gx);this.Gx=new sR(this.tu);a=c||{};a=lo(io(a));var e=new jn([a,IGa]),f=new CR(d);this.Ma=this.Ht(this.lb,e);d=Gn(e,sta,Xja,eg);var g=(new Ou).xd(b,d,this.tu);if(null!=g){var k=Tm({options:a,format:g,size:this.Ma});d=this.vj(function(a){if(null==a)throw m(gpa);bIa(this,b,g,e,k,f,a)},this);$Ha(b,g,e,d)}}; T.Jj=function(){var a=Ek(this.lb)[Qb](Q),b=xK(a,this.Ma),c=new sK(a),d=new nK(a,b),b=this.ul,c=new vR(c,d,b.Pk.Za),b=b.kA[My]();RGa(c,b);dHa(c,b);aHa(c,b);xR(c,b,!0);xR(c,b);return a[Xb][0].toDataURL(Gva)};T.Ht=function(a,b){var c=On(a,b,-1),d=Pn(a,b,-1);-1==c&&-1==d?(c=556,d=347):-1==c?c=h[D](556*d/347):-1==d&&(d=h[D](347*c/556));return new xk(c,d)}; function bIa(a,b,c,d,e,f,g){var k=pn(d,Fza);if(a.d_==e)cIa(a,!1,d,b,c,g,k,f,e);else{if(null!=a.Da)a.Da[Pz](a.Ma,a.vj);else{var l=pn(d,IE);a.Da=new vK(a.lb,a.Ma,a.vj,l)}a.Da.Io(W(function(){var a=this.Da.eb(),l=this.Da.Av(),a=new vR(l,a,c);null!=this.ul&&Ws(this.ul);l=this.Ma;Ws(this.ul);this.ul=new HR(a,d,l[r],l[A],b,c,f,W(this.kma,this),W(this.U$,this));cIa(this,!0,d,b,c,g,k,f,e)},a),a.vj)}} function cIa(a,b,c,d,e,f,g,k,l){c=Gn(c,Dua,GGa,zH);var n=c===$C||c===kg,q=a.vj(function(a,b,c){KHa(this.ul,a,b,c,d,k)},a),s=W(function(){JGa(this.Gx,d,e,f,g,q)},a);a.Gx.oJ=c;b&&(a.Gx.wC=null,QHa(f,a.vj(function(a){null!=a?(this.ul.g1(a,f),n&&(this.Gx.g1(a),s()),this.d_=l):this.tu.td(gpa)},a)));n||(a.Gx.wC=null,s())}Zv(T,function(a){null!=this.ul?this.ul[Yx](a):this.tu.td(xpa)});Tw(T,function(){if(null!=this.ul)return this.ul[wz]();this.tu.td(xpa);return[]});T.kma=function(){this.U$(ws,{})}; T.U$=function(a,b){hu(this,a,b)};T.Wg=function(){this.d_=O;Ws(this.ul);this.ul=null;Ws(this.Da);this.Da=null};V("google.visualization.GeoChart",RR,void 0);Ep(RR[K],RR[K][Nq]);RR[K].getImageURI=RR[K].Jj;Zv(RR[K],RR[K][Yx]);Tw(RR[K],RR[K][wz]);RR[K].clearChart=RR[K].Yf;V("google.visualization.GeoChart.mapExists",function(a){null!=a||(a={});a=new jn([a,IGa]);var b=zn(a,zH);return null!=QR(b,a)},void 0);V("google.visualization.GeoChart.setMapsSource",function(a,b,c){PHa(a,function(){b&&b()},function(){c&&c()})},void 0);function SR(a){pu[L](this,a);this.$C=new BK(800,600,xI,fa[Pb](Ula))}X(SR,nO);T=SR[K];T.Ym=function(a,b,c){Ss.oc(this.lb);c=new jn([c||{},this.uj()||{}]);var d=On(this.lb,c),e=Pn(this.lb,c);Ov(W(this.xn,this,b,c,new xk(d,e),a),0)};T.xn=function(a,b,c,d){BK.Ac=BK.X3(this.$C);a=this.ps(a,b,BK.Ac,c).Zh();c=XDa(this.$C);this.Bd=new mO(this,c,null,this,d);b=new gO(nn(b,oI));this.Bd[Nq](a,b)};T.Wg=function(){SR.e.Wg[L](this)};T.Hx=function(a,b,c,d){a=new JQ(this,a,0,c,d);(b=this.Bda())&&a.MI(b);return a}; T.Bda=function(){};function TR(a,b,c){this.rg=a;this.Bma=b;this.Pi={};this.Epa=!1;this.eD=null;this.Cma=c;a===aH&&(this.eD=new BK.Gg.rU({fill:R,stroke:aA}))}T=TR[K];vw(T,function(){this.Epa&&(this.Pi=da.getPrototypeOf(this.Pi))});T.tm=function(){if(null==this.eD){var a=dIa[this.rg];if(!a)throw m("No draw routine for "+this.rg+Me);this.eD=a[L](null,this.Pi)}return this.eD};function UR(a,b){a.Pi.x=b;return a}function VR(a,b){a.Pi.y=b;return a}T.sl=function(a){pa(this.Pi,a);return this}; T.Ex=function(a){Sa(this.Pi,a);return this};T.$q=function(a){Bw(this.Pi,a);return this};Yv(T,function(a){Jw(this.Pi,a);return this});function WR(a,b,c,d){var e=d||{};nn(b,c,null,function(b){var c=Bn(b[fc]||e[fc])||R;a.pe(c);c=wn(b.fillOpacity);null!=c&&a.dh(c);c=Bn(b[Yb]||e[Yb]);null!=c&&a.dd(c);b=un(b.strokeWidth);null!=b&&a.yk(b);return null})}T.dd=function(a){za(this.Pi,a);return this};T.yk=function(a){this.Pi.qa=a;return this};T.pe=function(a){Ca(this.Pi,a);return this}; T.dh=function(a){this.Pi.ae=a;return this};Gw(T,function(a,b){this.eD[Yy](a,b);return this});T.Z=function(a,b){this.eD.line(a,b);return this};var dIa={circle:function(a){return new BK.Gg[Cz](a[bz],a.x,a.y,{fill:a[fc]})},line:function(a){return new BK.Gg.ot(a.x,a.y,a.hb,a.kb,a)},rect:function(a){return new BK.Gg.Xj(a.x,a.y,a[r],a[A],a)},text:function(a){return new BK.Gg.Nv(a.x,a.y,a[cd],a)}};function XR(a){this.ng=[];this.da=a;this.c1=0}XR[K].Ub=function(){return this.da};XR[K].NU=function(){return this.ng};XR[K].Z=function(a,b,c,d,e,f){a=VR(UR(new TR(JF,a||YR(this),b||GC),c),d);a.Pi.hb=e;a.Pi.kb=f;this.ng[C](a);return a};function ZR(a,b,c,d,e,f,g){b=VR(UR(new TR(vH,b||YR(a),c||GC),d),e).sl(f).Ex(g);a.ng[C](b);return b}function eIa(a,b,c,d,e,f,g){b=VR(UR((new TR(Es,b||YR(a),c||GC)).$q(d),e),f).sl(g);a.ng[C](b);return b} function YR(a){var b=new aO(oB);cO(b,ZB,Qpa+a.c1);a.c1+=1;return b};function fIa(){this.cs=new Uj;this.ga=this.da=this.JQ=null}T=fIa[K];T.Pm=function(){};T.IH=function(a){this.ga=a;this.Je(a.Ub())};T.Je=function(a){this.da=a};T.Ub=function(){return this.da};Ep(T,function(a){var b=new Uj;Y(this.ga.ng,function(c){var d=c.Bma.Hn();this.cs.$e(d)?c.tm=this.cs.get(d).tm:a.hu[c.Cma].add(c.tm());b.set(d,c)},this);Bj(this.cs.fs(!0),function(a){b.$e(a)},this);this.cs=b;OFa(a)});function $R(a){SR[L](this,a)}X($R,SR);$R[K].yu=function(a){var b=new fIa;b.IH(a);return b};function aS(a,b){return bS(a,b,0)}function bS(a,b,c){for(var d=new Date(a),e=!1,f=b[J],g=[h[t],h[xb]][c],k=0;k<f;++k){var l=a[$H+cS[k]],n=a[NE+cS[k]][Mc](a),q=b[k],s=gIa[k];if(0==q)e=e||0!=n&&0!=c,l[Mc](d,[s]);else{e?l[Mc](d,[s+q*(1+h[t]((n-s)/q))]):l[Mc](d,[s+q*g((n-s)/q)]);break}}return d}function hIa(a,b){var c=h[D],d=Yi(a),e;for(e=0;e<d[J]&&0==b[e];++e)d[e]=0;if(0==e)return d[0]=c(a[0]/b[0])*b[0],d;var f=0;a[e-1]>=iIa[e-1]?f=0.7:0<a[e-1]&&(f=0.1);d[e]=c((a[e]+f)/b[e])*b[e];return d} function jIa(a){a=aS(a,[0,0,0,0,1]);return a=kIa(a,[0,0,0,0,(7+a[lc]()-1)%7],-1)}function dS(a,b,c){var d=Gi(b,function(a){return[h.log(eS(a))]});if(!c)return a=ZO(h.log(a),d),b[a];c=EEa(h.log(a),d,c);a=c[0];return a<=d[J]-1?b[a]:hIa(lIa(h.exp(c[1])),Ai(b))} function kIa(a,b,c){var d=new Date(a[bc]()),e;t:{for(e=0;e<b[J];++e)if(0!=b[e]){e=!1;break t}e=!0}if(e)return d;for(e=0;e<b[J];++e)if(0!=b[e]){var f=cS[e],g=d[$H+f],f=d[NE+f][Mc](d,[]);g[Mc](d,[f+c*b[e]])}if(0<c&&d<=a)throw"Error adding duration to date";if(0>c&&d>=a)throw"Error subtracting duration from date";return d}function fS(a,b,c,d){this.gda=a[bc]();this.Oz=b;this.tqa=d;this.V1=a[NE+cS[c]][Mc](a,[]);this.uqa=a[$H+cS[c]];this.bx=new Date(this.gda)} Ga(fS[K],function(){var a=this.bx;this.bx=new Date(this.gda);this.V1+=this.tqa;this.uqa[Mc](this.bx,[this.V1]);return a});fS[K].zO=function(){return this.bx<this.Oz?this.bx:null};function gS(a){a=Pi(a,function(a){return 0!=a});return h.max(0,a)}function eS(a){if(null==a)return-1;for(var b=0,c=a[J],d=0;d<c;++d)b+=a[d]*hS[d];return b}function lIa(a){for(var b=[],c=hS[J]-1;0<=c;c--)b[c]=h[t](a/hS[c]),a-=b[c]*hS[c];return b} function iS(a){var b=0;4===a[J]&&(b=a[3]);return 1E3*(60*(60*a[0]+a[1])+a[2])+b}function jS(a){var b=[],c=a%1E3;a=h[t](a/1E3);b=a%60;a=h[t](a/60);var d=a%60;a=h[t](a/60);b=[a,d,b];0!==c&&b[C](c);return b}function mIa(a,b){return Gi(a,function(a){return a*b})}var cS="Milliseconds Seconds Minutes Hours Date Month FullYear".split(" "),gIa=[0,0,0,0,1,0,0],iIa=[500,30,30,12,15,6,0],hS=[1,1E3,6E4,36E5,864E5,2629743830,31556926E3];function nIa(a){switch(a){case og:case pg:return{xl:oIa,Bx:pIa};case wh:return{xl:qIa,Bx:rIa};case Yg:case rh:return{xl:sIa,Bx:tIa};default:return{xl:sIa,Bx:tIa}}}function sIa(a){return ia(a)}function tIa(a){return a}function oIa(a){return a[bc]()}function pIa(a){return new Date(a)}function qIa(a){return iS(a)}function rIa(a){return jS(a)};function uIa(a){return h.pow(a,3)}function vIa(a){return 1-h.pow(1-a,3)}function wIa(a){return 3*a*a-2*a*a*a};var xIa={LINEAR:MF,dva:mF,Mva:XG,iva:nF};function yIa(a){switch(a){case MF:return kj;case mF:return uIa;case XG:return vIa;case nF:return wIa;default:return kj}}function zIa(a,b,c){b=vn(a,wC,b);if(!b)return null;var d=vn(a,Aqa,30);a=Gn(a,zqa,xIa,c);a=yIa(a);return{duration:b,u3:a,nT:d}};function kS(){}X(kS,bM);Uh(kS);T=kS[K];T.h=function(a){var b={"class":mC+this.ol(a)[ie](ne)},b=a.ea().h(Q,b,a[nz]());this.Rh(b,a.gk());GL(this,a,b);return b};T.yj=function(){return eD};T.Ah=function(a){return a[Nc]==kf};T.Ia=function(a,b){fL(b,lC);return kS.e.Ia[L](this,a,b)};fb(T,function(){return O});T.$=function(){return Ypa};ML(Ypa,function(){return new dM(null,kS.Xb())});function lS(){}X(lS,kS);Uh(lS);lS[K].$=function(){return Zpa};ML(Zpa,function(){return new dM(null,lS.Xb())});function mS(a,b,c){this.VX=a;this.uO=b;this.b_=c}X(mS,iP);T=mS[K];Ma(T,function(a,b,c){mS.e[Fc][L](this,a,b,c);a=nn(a,this.Ha(uua));b=[];b[C](a.millisecond);b[C](a.second);b[C](a.minute);b[C](a.hour);b[C](a.day);b[C](a.month);b[C](a.year);this.b_=AIa([b,gj(this[Kb],b[J]),this.b_])});function AIa(a){a=Hda[Mc](null,a);return Gi(a,function(a){return Oi(a,function(a){return a})})}T.R=function(a,b){return a.R(b)};T.jI=function(a){return oIa(a)};T.xE=function(a){return pIa(a)};T.wZ=function(a){return a}; T.jZ=function(){var a=new Date(0);a[rd](0);return a};T.cH=function(a,b,c){var d=this.Ap;-1===d&&(d=6);var e=(b-a)/d,d=dS(e,this.VX,this.uO);c?(a=aS(new Date(a),d),b=bS(new Date(b),d,1)):(a=bS(new Date(a),d,1),b=aS(new Date(b),d));e=lIa(e);e=hIa(e,d);this.rba=e=0<eS(e)?e:d;this.Loa=a;this.Eba=b;c&&(this.jc=a[bc](),this.ic=b[bc]())};T.N0=function(a,b,c){a=[];for(b=this.Loa;b<this.Eba;)a[C](b[bc]()),b=kIa(b,this.rba,1);if(c||b<=this.Eba)a[C](b[bc]()),this.ic=h.max(this.ic,b[bc]());this.Ro(a)}; T.pH=function(){var a=gS(this.rba),a=this.b_[a];this.le=typeof a===$g?new Go(a):new Go({pattern:a})}; var BIa=[[0,0,0,0,1],[0,0,0,0,2],[0,0,0,0,7],[0,0,0,0,0,1],[0,0,0,0,0,3],[0,0,0,0,0,6],[0,0,0,0,0,12],[0,0,0,0,0,0,1],[0,0,0,0,0,0,5],[0,0,0,0,0,0,10],[0,0,0,0,0,0,25],[0,0,0,0,0,0,50],[0,0,0,0,0,0,100]],CIa=[Ho.MEDIUM_DATE,Ho.MEDIUM_DATE,Ho.MEDIUM_DATE,Ho.MEDIUM_DATE,Ho.MEDIUM_DATE,Do.YEAR_MONTH_ABBR,Jh],DIa=[[1],[2],[5],[10],[20],[50],[100],[200],[500],[0,1],[0,2],[0,5],[0,10],[0,15],[0,30],[0,0,1],[0,0,2],[0,0,5],[0,0,10],[0,0,15],[0,0,30],[0,0,0,1],[0,0,0,2],[0,0,0,3],[0,0,0,4],[0,0,0,6],[0,0, 0,12],[0,0,0,0,1],[0,0,0,0,2],[0,0,0,0,7],[0,0,0,0,0,1],[0,0,0,0,0,3],[0,0,0,0,0,6],[0,0,0,0,0,12],[0,0,0,0,0,0,1],[0,0,0,0,0,0,5],[0,0,0,0,0,0,10],[0,0,0,0,0,0,25],[0,0,0,0,0,0,50],[0,0,0,0,0,0,100]],EIa=[Ho.MEDIUM_TIME,Ho.MEDIUM_TIME,Ho.SHORT_TIME,{pattern:Ho.SHORT_TIME,clearMinutes:!0},Ho.MEDIUM_DATE,Do.YEAR_MONTH_ABBR,Jh];function FIa(a,b,c,d,e,f,g,k){var l=b-a;if(0>=l)return null;for(var n=h[t](h.log(l)/h.log(10)),l=$O(5,function(a){return{Ud:h.pow(10,n-a),cS:5}}),q=[],s=!1,u=0;u<l[J];++u){var w=l[u],z=GIa(a/(w.Ud*w.cS),b/(w.Ud*w.cS),c,d,e,f,g),q=q[Ab](Gi(z,function(a){return[w,a]}));if(s)break;s=!Si(z)}return Hi(q,function(a,b){for(var c=b[0],d=b[1],e=null,f=d.gpa;f<=d.fpa&&e!=f;e=f,f+=d.hpa){var e=h[D](c.cS*f),l=h[D](c.cS*(f+g*d.ipa)),n=k(e,l,c.Ud);n>a.Kl&&(a={Kl:n,fca:{Ei:h[D](e)*c.Ud,Iq:h[D](l)*c.Ud}})}return a}, {Kl:-ea,fca:null}).fca}function GIa(a,b,c,d,e,f,g){for(var k=[],l=b-a,n=d+f,q=h[xb](l/(1-(c+e))/g),l=h[t](l/(1-n)/g);q<ea&&q<=l;++q){var n=q*g,s=h[xb](h.max(a-d*n,b-(1-e)*n)),u=h[t](h.min(a-c*n,b-(1-f)*n)),w=1;0<b&&0>a?1<g&&(s=h[xb](s/q)*q,u=h[t](u/q)*q,w=q):0<=a?s=h.max(0,s):u=h.min(-n,u);0<=u-s&&k[C]({ipa:q,hpa:w,gpa:s,fpa:u})}return k}function nS(a){if(0==a)return 0;0>a&&(a=-a);if(0.5>a)return 0;for(;0==h[D](a%10);)a=h[D](a/10);return 1==a||5==a?0.5:h[t](h.log(a)/h.log(10))+1};function oS(){this.a8=0}X(oS,iP);T=oS[K];T.P8=function(){return 4};Ma(T,function(a,b,c){oS.e[Fc][L](this,a,b,c);this.le=null;this.QG=sn(a,this.Ha(LE),1);this.XO=a.R(this.Ha(vAa),[10,2,5,1])}); T.N0=function(a,b,c){var d,e,f,g,k;c?(d=W(HIa,null,this.XO,this.Ap,a,b),e=-1E-4,f=1/h.max(this.Ap,3),g=e,k=f):(e=-1/h.max(this.Ap,3),f=0,g=e,k=f,this.XO[0]*=-1,d=W(HIa,null,this.XO,this.Ap,this.jc,this.ic));c=this.Ap;(d=FIa(a,b,e,f,g,k,c,d))||(0<=a||0>=b||1==c?d={Ei:a,Iq:b}:(d=h.max(1,h.min(c-1,h[D](b/(b-a)*c))),c-=d,a=h.max(b/d,-a/c),d={Ei:-c*a,Iq:d*a}));a=d;b=(a.Iq-a.Ei)/this.Ap;c=[];for(d=0;d<=this.Ap;++d)c[C](a.Ei+b*d);this.jc=h.min(c[0],this.jc);this.ic=h.max(c[c[J]-1],this.ic);this.Ro(c)}; T.Ro=function(a){oS.e.Ro[L](this,a);var b=0;Y(this[wy],function(a){a=this.Po(a);b=h.max(b,JEa(a/this.QG))},this);this.a8=b};T.pH=function(){var a={pattern:this[Kb],fractionDigits:this[Kb]?null:this.a8,scaleFactor:this.QG,prefix:An(this.b,this.Ha(KE)),suffix:An(this.b,this.Ha(ME))};this.le=new Io(a)};function HIa(a,b,c,d,e,f,g){c=a[0]*(d-c)/(g*(f-e));d=(f-e)/b;for(g=1;g<b;++g)c-=a[1]*h.pow(nS(e+g*d),1.2);c-=a[2]*h.pow(nS(e),1.2);c-=a[2]*h.pow(nS(f),1.2);return c-=a[3]*h.pow(nS(d),1.2)} T.R=function(a,b){return tn(a,b)};T.jI=function(a){return ia(a)};T.xE=function(a){return a};T.wZ=function(a){return a};T.jZ=function(){return 0};function IIa(){this.cK={}}var pS=null;function qS(){return pS?pS:pS=new IIa}IIa[K].Ug=function(a){return(a=this.cK[a])?a[Mc](null,[]):null};function rS(){this.daa=1}X(rS,iP);T=rS[K];T.R=function(a,b){var c;t:{c=a.R(b,null);if(bi(c)){var d=c[pc](Xe);1==d[J]&&(d=c[pc](Je));if(3==d[J]){var e=yi(d[0]),f=yi(d[1]),d=yi(d[2]);if(0<=d&&0<=f&&0<=e){c=[e,f,d];break t}}}c=!Yh(c)||3!=c[J]&&4!=c[J]?null:c}return c};T.K8=function(a,b){var c=iS(a),d=iS(b);return c<d?-1:c>d?1:0};T.jI=function(a){return iS(a)};T.xE=function(a){return jS(a)};T.wZ=function(a){return a};T.jZ=function(){return jS(0)}; T.cH=function(a,b,c){var d=this.Ap;-1===d&&(d=6);var d=(b-a)/d,e=dS(d,JIa,0);this.daa=gS(e);e=eS(e);this.tickSize=d=h.max(1,h[D](d/e))*e;c?(a=h[t](a/d)*d,b=h[xb](b/d)*d):(a=h[xb](a/d)*d,b=h[t](b/d)*d);this.Ca=a;this.mb=b;c&&(this.jc=a,this.ic=b)};T.N0=function(){for(var a=[],b=this.Ca;b<this.mb;)a[C](b),b+=this.tickSize;a[C](b);this.Ro(a)};T.pH=function(){var a=new Go({pattern:this[Kb]?this[Kb]:1>=this.daa?Goa:NB});this.le={Ee:function(b){return a.Ee(new Date(1970,0,1,b[0],b[1],b[2],0))}}}; var JIa=[[0,1,0,0],[0,2,0,0],[0,5,0,0],[0,10,0,0],[0,20,0,0],[0,30,0,0],[0,0,1,0],[0,0,5,0],[0,0,10,0],[0,0,15,0],[0,0,30,0],[0,0,0,1],[0,0,0,2],[0,0,0,3],[0,0,0,4],[0,0,0,6],[0,0,0,12]];qS().cK.timeofday=function(){return new rS};qS().cK.date=function(){return new mS(BIa,3,CIa)};qS().cK.datetime=function(){return new mS(DIa,3,EIa)};qS().cK.number=function(){return new oS};function sS(){}T=sS[K];T.iO=function(a){var b=a.nb;a=a.jb;var c=tS(this,b,a);return this.k[b].j[c].de.gv||(this.Ba[c]?this.Ba[a].Ts[0]:null)};function KIa(a,b){var c=b.nb,d=tS(a,c,b.jb);return a.k[c].j[d].de.$l||a.k[c][uz]}T.QX=function(a){return a.jb};T.$V=function(a){return{bb:a.jb,Af:this.k[a.nb].Bs}};T.hM=function(a){var b=this.hq[a.Af].kc;return null!=b?{nb:b,jb:this.eq[a.bb]}:null};T.qF=function(a,b){return this.k[a].j[b].de};function uS(a,b){this.G=b;this.Pq=a;this.bv=this.dq=this.xW=this.Ob=this.uv=this.ed=this.gq=null}T=uS[K];T.yo=function(a,b){this.ed={};this.uv={};this.G[Wb]();this.Pq[Wb]();LIa(this,a,b);var c=this.Ob,c=this.G.wk(c[r],c[A]);MIa(this,b,c)};function LIa(a,b,c){var d=new sO(2);tO(d,0,b);tO(d,1,c);a.Ob=d[My]()} function MIa(a,b,c){a[Bx](c.a(),Er);var d=a.Ob,e=a.G,f=d.nD;!Wm(f)&&!Vm(f)||e.rb(0,0,d[r],d[A],f,c);d.Iy==XG&&(f=a.Is(d[uz],c),a[Bx](f,HI));a.dq=e.za(!0);f=d.Ea;a.mD(f);f&&f[jc]!=mF&&(e[p](c,a.dq),a[Bx](a.dq.a(),DF));a.bv=e.za(!0);f=d.gi;NIa(a,f);f&&f[jc]!=mF&&(e[p](c,a.bv),a.ed.colorbar=a.bv.a());a.xW=e.za(!1);a.I6(d,c)||a.XT(d,c);e[p](c,a.xW);a.gq=b} T.XT=function(a,b){var c={color:RC,Va:a.Kj,fontSize:a.Nl,bold:!1,Ic:!1,De:!1};this.$i(TB,c,a.A[r]);var d=a.A.top+h[D](a.A[A]/2);this.G.mi(TB,a.A[G],d,a.A[G]+a.A[r],d,pD,pD,c,b)};T.mD=function(a){if(a){var b=a.ln;if(b){var c;a.iG?c=a.area:(c=Gi(b,function(a){return OIa(a)},this),c=Om(c));c&&(c=xl(c),this.G.rb(c[G],c.top,c[r],c[A],Ym,this.dq));for(c=0;c<b[J];c++)PIa(this,b[c]);QIa(this,a.iG)}}};function OIa(a){var b=[];if(a.ma){var c=OQ(a.ma);c&&b[C](c)}a.Wb&&b[C](wl(a.Wb[Ey]));return Om(b)} function vS(a,b,c,d,e,f,g){var k=f[H],l=ia(f.sides);null!=l&&xj(l)||(l=5);var n=ia(f.rotation);null!=n&&xj(n)||(n=0);n=n/180*h.PI-h.PI/2;k===WAa?(k=nH,l=3):k===jI?(k=nH,l=4,n+=h.PI/4):k===dta&&(k=nH,l=4);var q=k===mI;500<l&&(k===nH||k===mI)&&(k=ED);var s=null;if(k===nH||k===mI){f=ia(f.dent);null!=f&&xj(f)||(5<=l?(f=h.cos(h.PI/l),f-=h.pow(h.sin(h.PI/l),2)/h.sin(h.PI/2-h.PI/l)):f=0.3);f*=d;k===mI&&(l*=2);k=new YJ;for(s=0;s<l;s++){var u=d;q&&s%2&&(u=f);var w=2*h.PI/l*s+n,z=h.cos(w)*u+b,u=h.sin(w)*u+ c;0<s?k.Z(z,u):k[Yy](z,u)}k[vy]();s=a.G.tc(k,e)}else s=a.G.Uv(b,c,d,e);s&&g&&a.G[p](g,s);return s} function PIa(a,b){if(b.O){var c=a.G.za(!1),d=AN([FF,b[nc]]);a[Bx](c.a(),d,FF);if(d=OIa(b))d=xl(d),a.G.rb(d[G],d.top,d[r],d[A],Ym,c);b.ma&&a.Is(b.ma,c);if(b.Wb)if(d=a.Ob.k[b[nc]],a.Ob.R2&&d&&!d.eh&&d.oD){var e=b.Wb[Ey][G],f=b.Wb[Ey][r],g=b.Wb[Ey][A],k=e+f/2,l=b.Wb[Ey].top+g/2;d.Yu&&a.G.rb(e,l,f,g/2,d.Yu,c);var n=0.5*g,q=d.$d;q&&(q.Hb>n&&(q=q.o(),q.yk(n)),a.G.eK(e,l,e+f,l,q,c));d.fh&&((e=d.oD)||(e={type:ED}),vS(a,k,l,g/2,d.fh,e,c))}else a.G.rb(b.Wb[Ey][G],b.Wb[Ey].top,b.Wb[Ey][r],b.Wb[Ey][A],b.Wb.brush, c);d=null;b.re&&b.re.O&&(k=b.re[Ey].x,l=b.re[Ey].y,e=b.re.brush,d=a.G,g=d.za(),d.rb(k,l,12,12,e,g),d[p](c,g),e=new YJ,e[Yy](k+2,l+2),e.Z(k+12-2,l+12-2),e[Yy](k+12-2,l+2),e.Z(k+2,l+12-2),k=new Rm,k.dd(ue),k.yk(2),d.na(e,k,g),d=g.a(),g=AN([wya,b[nc]]),a[Bx](d,g));a.G[p](a.dq,c)}}function QIa(a,b){b&&(RIa(a,b.YW,-1),b.XW&&a.Is(b.XW,a.dq),RIa(a,b.WW,1))}function RIa(a,b,c){if(b){var d=aK(b[gz]),d=a.G.na(d,b.brush,a.dq);b.Kt&&(b=AN([GF,c]),a[Bx](d,b))}} function NIa(a,b){if(b){var c=b[Dx],d=a.G,e=a.bv;OGa(c.pW,d,e);PGa(c.qW,d,e);QGa(c.rW,d,e);c=a.G.rb(b.oG[G],b.oG.top,b.oG[r],b.oG[A],Ym,a.bv);a[Bx](c,rsa)}}T.$i=function(a,b,c){var d=b[uc];a=this.G.Gk(a,b);a>c&&(d=h.max(1,h[t](b[uc]*c/a)));return d};function wS(a,b){var c=a.ed[b];c&&(a.G.Ff(c),delete a.ed[b])}T.kE=function(a,b){var c=a[jy]?yP(a,this.Pq.ac()):zP(a,this.G,this.xW).a();this[Bx](c,b)};T.Is=function(a,b,c){(a=SIa(this,a,c))&&this.G[p](b,a);return a}; function SIa(a,b,c){var d=b.F;if(!d||0==d[J])return null;a=a.G;var e=b.X,f=b.cq,g=null!=b.Cb?b.Cb:0,k=b[Gz]?b[Gz]:{x:0,y:0},l=b.vb,n=!!l||c||!1;c=a.za();if(0===g&&f){var q=OQ(b);if(q){var s=h[xb](q[G]-3)+0.5,u=h[t](q.top-1)+0.5;a.rb(s,u,h[t](q[Zc]+3)+0.5-s,h[t](q[Hc]+1)+0.5-u,f,c)}}for(f=0;f<d[J];f++)q=d[f],0===g?a.Pd(q[cd],q.x+k.x,q.y+k.y,q[J],b.Cc,b.Bc,e,c):$Ba(a,q[cd],q.x+k.x,q.y+k.y,q[J],g,b.Cc,b.Bc,e,c);if(n){n=null;if(0===g)(q=OQ(b))&&(n=a.rb(q[G],q.top,q[Zc]-q[G],q[Hc]-q.top,Ym,c));else{var w= qj(g);b=Qj(b);b.Cb=0;k=(new kK(k.x,k.y))[sy](-w);Zw(b,new uP(k.x,k.y));for(f=0;f<d[J];f++)k=(new kK(d[f].x,d[f].y))[sy](-w),b.F[f].x=k.x,b.F[f].y=k.y;if(q=OQ(b))d=[new kK(q[G],q.top),new kK(q[Zc],q.top),new kK(q[Zc],q[Hc]),new kK(q[G],q[Hc])],Y(d,function(a){a[sy](w)}),d=aK(d,!1),n=a.na(d,Ym,c)}l&&n&&cCa(a,n,l,TDa(e))}return c.a()}T.qe=function(a,b,c){var d=this.ed[b];null!=d?this.G[Ty](a,c,d):this.G[p](a,c);this[Bx](c,b)}; T.registerElement=function(a,b,c){a&&(this.G.zn(a,b),this.ed[b]=a,c&&(this.uv[c]||(this.uv[c]=[]),Ri(this.uv[c],b)||this.uv[c][C](b)))};function xS(a,b){var c=a.ed[b];c&&(a.G.Ff(c),delete a.ed[b])}T.Nk=function(a){var b=[];if(this.ed[a]){var c=this.G.Nk(this.ed[a]);c&&b[C](c)}a=this.uv[a]||[];for(var d=0;d<a[J];++d)(c=this.G.Nk(this.ed[a[d]]))&&b[C](c);return Om(b)};function yS(a,b){return a.S&&a.S.brush||a.brush||b.fh}function zS(a,b){return null===a.kw?null:a.kw||b.$d}function AS(a){return a[H]==JF||a[H]==BC||a[H]==QH}function BS(a,b){return null!=a[oz]?a[oz]:b.dK}function tS(a,b,c){b=a.k[b];return b.Eg&&Qh(b.J3)?(a=a.k[b.J3].j[c],a=null!=a?a.Cf.Jk:a,null!=a?aj(b.j,a,function(a,b){return a-b.Cf.Jk}):c):c}function TIa(a,b){return a.S&&null!=a.S[bz]?a.S[bz]:null!=a[bz]?a[bz]:b.Pc}function CS(a,b){return TIa(a,b)+Um(yS(a,b))/2} function UIa(a){return a.Dd&&a.Wa==Bg&&a[lz]==Jg} function DS(a,b){for(var c=new yK,d=!0,e=!0,f=null,g=null,k=0;k<a.j[J];k++){var l=a.j[k];if(l&&l.S&&null!=l.S.x&&null!=l.S.y){d&&(f=k,d=!1);var n=l.S,q=zS(l,a);e||null===q?(c[Yy](n.x,n.y),e=!1):a.QV?c.Zj(q,a.j[g].jr.x,a.j[g].jr.y,l.ir.x,l.ir.y,n.x,n.y):c.Z(q,n.x,n.y);g=k}else e=!b||d}!d&a.Hga&&(d=b?g:a.j[J]-1,f=b?f:0,null!=d&&null!=f&&a.j[d]&&a.j[f]&&(q=zS(a.j[f],a),a.QV?c.Zj(q,a.j[d].jr.x,a.j[d].jr.y,a.j[f].ir.x,a.j[f].ir.y,a.j[f].S.x,a.j[f].S.y):c[vy](q)));return c} function ES(a){for(var b=new yK,c=!0,d=0;d<a.j[J];d++){var e=a.j[d].S;null!=e.x&&null!=e.y?(c||b.Z(zS(a.j[d],a),e.JK,e.KK),(c||e.JK!=e.GK||e.KK!=e.IK)&&b[Yy](e.GK,e.IK),c=!1):c=!0}return b}function VIa(a,b,c){return(c=(a=a.Be)&&a[c||0])&&c[jc].Se(b)}function WIa(a,b,c){return(c=(a=a.be)&&a[c||0])&&c[jc].Se(b)}function XIa(a,b,c){return(c=(a=a.Be)&&a[c||0])&&c[jc].Bk(b)}function YIa(a,b,c){return(c=(a=a.be)&&a[c||0])&&c[jc].Bk(b)} function ZIa(a,b,c,d){for(var e=a.k,f=null,g=ea,k,l=new sk(b,c),n=0,q=e[J];n<q;n++){var s=e[n];if(!s.Eg)if(a.Wa===cH){t:{var u=b,w=c;k=d;var z=s.My.x-u,B=s.My.y-w,F=0<-z*(s.My.y-s.Ue.y)+B*(s.My.x-s.Ue.x);if(0<-(s.Es.x-s.jh.x)*B+(s.Es.y-s.jh.y)*z&&F&&(z=h[ud](h.pow(s.Es.x-s.jh.x,2)+h.pow(s.Es.y-s.jh.y,2)),h[ud](h.pow(s.Es.x-u,2)+h.pow(s.Es.y-w,2))<z+k)){s=!0;break t}s=!1}if(s)return{bb:n}}else{u=0;for(w=s.j[J];u<w;u++)if((k=s.j[u])&&null!=k.S)switch(k=k.S,s[H]){case JF:case dD:case QH:k=uk(l,k);k< d&&k<g&&(f={uD:u,bb:n},g=k);break;case jD:case KC:z=null;s[H]===KC?z=new vl(k[G],k.top,k[r],k[A]):s[H]===jD&&(z=k.line,B=h.min(k[zz].top,z.top),z=new vl(k[zz][G],B,k[zz][r],h.max(k[zz].top+k[zz][A],z.top+z[A])-B));k=d;z=z.distance(l);(k=z>k?null:z)&&k<g&&(f={uD:u,bb:n},g=k);break;default:throw"unknown chart type for getPointDatum.";}if(0===g)break}}return f};function FS(a,b){uS[L](this,a,b);this.gf=null;this.v0=[]}X(FS,uS);function GS(a,b,c){a.v0[C]({definition:b,id:c})}function HS(a){var b=a.G.tba();a.G.uba();Y(a.v0,W(function(a){this.kE(a[Dx],a.id)},a));a.G.JU(b);a.v0=[]}T=FS[K]; T.I6=function(a,b){function c(b){b=a.k[b];return!a.Uc||b[H]!==QH||b.dK}$Ia(this,a);var d=this.G.za(!1);this.G[p](b,d);this[Bx](d.a(),yD);Dj(this.gf,function(a){a.Fe||(a.Fe=this.G.za(!(Qh(a.i4)&&!a.i4)))},this);this.G.rb(a.A[G],a.A.top,a.A[r],a.A[A],a.W2,d);a.Iy==mF&&this.Is(a[uz],this.gf[uz].Fe);a.JD&&this.Is(a.JD,this.gf.axistitle.Fe);Y(a.Ba,function(a,b){a.Jc&&IS(this,a.Jc,null,b)},this);Dj(a.Be,function(b){aJa(this,a,b)},this);Dj(a.be,function(b){bJa(this,a,b)},this);Dj(a.Be,function(a){cJa(this, a)},this);Dj(a.be,function(a){cJa(this,a)},this);var e=new vl(a.A[G],a.A.top,a.A[r],a.A[A]);this.G.JU(e);for(var f=[],g=0;g<a.k[J];g++)c(g)&&f[C]({pD:a.k[g].pD,index:g});dj(f,function(a,b){return bj(a.pD,b.pD)});for(g=0;g<f[J];g++){var k=f[g][nc];JS(this,a.k[k],k)}a.Uc&&a.k[0][H]===QH&&dJa(this,a,b);for(g=0;g<a.Ba[J];g++)a.Ba[g].vb&&(f=AN([Hs,g]),GS(this,a.Ba[g].vb,f));HS(this);var l=this.G.za(!1),e=this.G.cE(l,e);this.G[p](d,e);Y(CDa,function(a){var c=this.gf[a].Fe;if(c){var e;switch(this.gf[a][jc]){case GD:e= l;break;case pF:e=d;break;case YG:e=b}this.G[p](e,c)}},this);return!0}; function $Ia(a,b){a.gf={};var c=a.gf;uw(c,{position:YG});c.annotation={position:GD};c.annotationtext={position:pF};c.area={position:GD};c.bar={position:GD};c.baseline={position:GD};c.bubble={position:GD};c.categorysensitivityarea={position:GD};c.candlestick={position:GD};c.histogram={position:GD};c.gridline={position:GD};c.interval={position:GD};c.line={position:GD};c.minorgridline={position:GD};c.overlaybox={position:GD};c.pathinterval={position:GD};c.point={position:pF,i4:!1};c.pointsensitivityarea= {position:pF};c.steppedareabar={position:GD};c.tooltip={position:YG};Ap(c,{position:b.Iy==mF?pF:YG});c.axistick={position:pF};c.axistitle={position:b.qD==mF?pF:YG};var d=b.Ea&&b.Ea[jc]==mF,e=d?a.dq:null,d=d?pF:YG;c.legend={Fe:e,position:d};c.legendscrollbutton={Fe:e,position:d};c.legendentry={Fe:e,position:d};e=b.gi&&b.gi[jc]==mF;c.colorbar={Fe:e?a.bv:null,position:e?pF:YG}} function JS(a,b,c){if(b[H]==dD)eJa(a,b,c);else if(b[H]==KC)fJa(a,b,c);else if(b[H]==qI)fJa(a,b,c);else if(b[H]==jD)for(var d=0;d<b.j[J];d++)gJa(a,c,b.j[d],d);else if(b[H]==BC){var e=a.Ob.Dd,f=a.Ob.Lj;if(0!=b.j[J]){for(var f=f&&!e,g=[],k={start:null,end:null,brush:null},d=0;d<=b.j[J];d++){var l=b.j[d];l&&!l.Ae?null===k[y]?La(k,d):(l=l.QS||b.Yu,null===k.brush||cfa(k.brush,l)?(k.end=d,k.brush=l):(g[C](k),k={start:d-1,end:d,brush:l})):f&&d!==b.j[J]||(null===k[y]||null===k.end||g[C](k),d<b.j[J]&&(k={start:null, end:null,brush:null}))}l=a.G.za();for(d=0;d<g[J];d++){var k=g[d],n=k.brush,q=new YJ,s=q,u=b,w=e,z=k[y],k=k.end,B=!0,F=null;s[Yy](u.j[z].S.tT,u.j[z].S.uT);for(var M=z;M<=k;M++){var N=u.j[M],P=N.S;N.Ae||(s.Z(P.JK,P.KK),P.GK==P.JK&&P.IK==P.KK||s.Z(P.GK,P.IK),null!=P.x&&null!=P.y&&(B=!1,F=M))}if(!B)if(w)for(M=k;M>=z;M--)P=u.j[M].S,s.Z(P.vT,P.wT),P.tT==P.vT&&P.uT==P.wT||s.Z(P.tT,P.uT);else P=u.j[F].S,s.Z(P.vT,P.wT),s[vy]();a.G.na(q,n,l)}d=AN([BC,c]);a.qe(a.gf.area.Fe,d,l.a());if(e){d=ES(b);e=AN([JF,c]); f=d.tc(a.G);g=hJa(a,b);if(f){l=b.an;n=b.li;if(l||n){g=g||a.G.za();if(l)for(d=0;d<l.Hf[J];d++)a.G.na(l.Hf[d][gz],l.Hf[d].brush,g);n&&a.G.na(n[gz],n.brush,g)}g&&a.G[p](g,f)}d=g?g.a():f;null!=d&&a.qe(a.gf.line.Fe,e,d);KS(a,b,c)}else iJa(a,b,c,f)}}else iJa(a,b,c,a.Ob.Lj);if(b.ef&&b.ef.ii)for(b=b.ef.ii,d=0;e=b[d];++d)0!=e.line[J]&&(f=new YJ,$J(f,e.line,e.JS),e[Hc]&&$J(f,e[Hc],e.Rea),g=a.G.za(),a.G.na(f,e.brush,g),e=g.a(),f=AN([Pxa,c,d]),a.qe(a.gf.pathinterval.Fe,f,e))} function jJa(a,b,c,d,e){b[H]==KC||b[H]==qI?a.ue(b,c,d,e):b[H]==jD?gJa(a,c,d,e):b[H]==dD?a.hG(b,c,d,e):LS(a,b,c,d,e,a.gf.point.Fe)}function eJa(a,b,c){var d=a.gf.bubble.Fe,e=$O(b.j[J],function(a){return a});b.Qea&&cj(e,function(a,c){var d=b.j[a],e=b.j[c];return(e?e.S[bz]:0)-(d?d.S[bz]:0)});for(var f=0;f<e[J];f++){var g=e[f],k=b.j[g];k&&(a.hG(b,c,k,g),k=a.G.Pd(k[cd],k.S.x,k.S.y,k.Mea,pD,pD,k.X,d),g=AN([cD,c,g]),a.G.zn(k,g))}}function fJa(a,b,c){for(var d=0;d<b.j[J];d++)a.ue(b,c,b.j[d],d)} T.ue=function(a,b,c,d){if(c&&c.S){var e=c.brush||yS(c,a),f=a[H]==KC?JC:rI,g=AN([f,b,d]),k=c.S.vD||c.S,e=this.G.Ak(k[G],k.top,k[r],k[A],e),k=null,l=c.S.outline,n=c.an,q=c.li;if(l||n||q){k=this.G.za();this.G[p](k,e);if(l){var s=c.$d||a.$d,l=aK(l,!0);this.G.na(l,s,k)}if(n)for(s=0;s<n.Hf[J];s++)l=n.Hf[s][zz],this.G.rb(l[G],l.top,l[r],l[A],n.Hf[s].brush,k);q&&this.G.rb(q[zz][G],q[zz].top,q[zz][r],q[zz][A],q.brush,k)}e=k?k.a():e;this.qe(this.gf[f].Fe,g,e);c.vb&&(f=AN([Hs,b,d]),GS(this,c.vb,f));c.Jc&&IS(this, c.Jc,b,d);c.S.sq&&kJa(this,a,b,d,c.S.sq)}};function hJa(a,b){var c=null,d=null;Y(b.j,function(a,f){var g=b.j[f-1],k=b.j[f+1],g=!g||!g.S||g.Ae,k=!k||!k.S||k.Ae;a&&a.S&&!a.Ae&&g&&k&&(c||(c=this.G.za()),d||(d=Zm(b.$d.Qd,b.$d.Ai)),this.G.Zd(a.S.x,a.S.y,b[Ny],d,c))},a);return c} function iJa(a,b,c,d){var e=AN([JF,c]);if(0>=b[Ny])xS(a,e),KS(a,b,c);else{var f=DS(b,d);if(!Si(f.Yc)){d=(f=f.tc(a.G))&&d?null:hJa(a,b);if(f){var g=b.an,k=b.li;if(g||k){d||(d=a.G.za());if(g)for(var l=0;l<g.Hf[J];l++)a.G.na(g.Hf[l][gz],g.Hf[l].brush,d);k&&a.G.na(k[gz],k.brush,d)}d&&a.G[p](d,f)}f=d?d.a():f;null!=f&&a.qe(a.gf.line.Fe,e,f);KS(a,b,c)}}} function dJa(a,b,c){for(var d=0,e=b.k[J];d<e;d+=2){var f=b.k[d],g=b.k[d+1],k=f.j[J];if(0!=k)for(var l=new Rm({stroke:f.fh.gb(),Cg:f.fh.Oe,qa:1}),n=0;n<k;n++){var q=f.j[n],s=g.j[n];q&&q.S&&!q.Ae&&a.G.eK(q.S.x,q.S.y,s.S.x,s.S.y,l,c)}}}function KS(a,b,c){for(var d=0;d<b.j[J];d++)LS(a,b,c,b.j[d],d,a.gf.point.Fe)}T.hG=function(a,b,c,d){LS(this,a,b,c,d,this.gf.bubble.Fe)}; function lJa(a,b,c,d){var e=null,f=b.li,g=b.an,k=b.I5;if(f||g||k)e=a.G.za();k&&a.G.na(k[gz],k.brush,e);k=b[kx]||{type:ED};f&&vS(a,f.x,f.y,f[bz]+0.5,f.brush,k,e);if(g)for(f=0;f<g.Hf[J];f++)vS(a,g.x,g.y,g.Hf[f][bz],g.Hf[f].brush,k,e);b=vS(a,b.S.x,b.S.y,c,d,k);e&&a.G[p](e,b);return e?e.a():b} function LS(a,b,c,d,e,f){var g;if(g=d&&d.S&&!d.Ae)t:{var k=d.S;g=CS(d,b);var l=a.Ob.A;if(k.x-g>=l[Zc]||k.x+g<=l[G]||k.y-g>=l[Hc]||k.y+g<=l.top)g=!1;else{if((k.x>=l[Zc]||k.x<=l[G])&&(k.y>=l[Hc]||k.y<=l.top)){g*=g;var n=k.x-l[Zc],q=k.x-l[G],s=k.y-l[Hc],k=k.y-l.top,l=n*n,q=q*q,s=s*s,k=k*k;if(l+s>=g&&l+k>=g&&q+k>=g&&q+s>=g){g=!1;break t}}g=!0}}g&&(g=AN([b[H]==dD?cD:iH,c,e]),BS(d,b)?a.qe(f,g,lJa(a,d,TIa(d,b),yS(d,b))):xS(a,g),d.vb&&(f=AN([Hs,c,e]),GS(a,d.vb,f)),d.Jc&&IS(a,d.Jc,c,e),d.S.sq&&kJa(a,b,c,e, d.S.sq))}function gJa(a,b,c,d){if(c&&c.S){var e=a.G.Ak(c.S.line[G],c.S.line.top,c.S.line[r],c.S.line[A],c.$d),f=a.G.Ak(c.S[zz][G],c.S[zz].top,c.S[zz][r],c.S[zz][A],c.Jy),g=a.G.za();a.G[p](g,e);a.G[p](g,f);if(e=c.an)for(f=0;f<e.Hf[J];f++){var k=e.Hf[f][zz];a.G.rb(k[G],k.top,k[r],k[A],e.Hf[f].brush,g)}(e=c.li)&&a.G.rb(e[zz][G],e[zz].top,e[zz][r],e[zz][A],e.brush,g);e=AN([iD,b,d]);a.qe(a.gf.candlestick.Fe,e,g.a());c.vb&&(b=AN([Hs,b,d]),GS(a,c.vb,b))}} function IS(a,b,c,d){if(b){var e=b.E3,f=a.Ob.A;if(e&&!(e.x<f[G]||e.x>f[Zc])&&(f=b[vz])&&!Si(f)){var g=[xC,d];null!=c&&Ui(g,c,1);var g=AN(g),k=e.x,l=e.y,n=e[J],q=e[E],e=e[lz]==Jg?[n,1]:[1,n],e=a.G.Ak(h.min(k,k+e[0]),h.min(l,l+e[1]),h.abs(e[0]),h.abs(e[1]),new Rm({fill:q}));a.qe(a.gf.annotation.Fe,g,e);e=a.G.za();g=[zC,d];null!=c&&Ui(g,c,1);k=null;b.bundle&&!b.bundle.KS&&(f=[b.bundle[Rc]],k=-1);for(b=0;b<f[J];b++)if(q=f[b],l=SIa(a,q,!0))q.ka&&(n=AN([Hs,c,d,b]),GS(a,q.ka,n)),a.G[p](e,l),q=Yi(g),q[C](k|| b),q=AN(q),a[Bx](l,q);c=AN(g);a.qe(a.gf.annotationtext.Fe,c,e.a())}}}function kJa(a,b,c,d,e){if(null!=b.ef){var f=a.G.za();b=b.ef.ND;for(var g=0;g<e[J];g++){var k=e[g][zz],l=b[e[g].LD];if(l&&l[x]!=BC&&l[x]!=JF){var n=l.brush;if(0==k[r]&&0==k[A])l=l.KD/2,0<l&&(k=a.G.Uv(k[G],k.top,l,n),a.G[p](f,k));else if(0==k[r]||0==k[A])l=new YJ,l[Yy](k[G],k.top),l.Z(k[G]+k[r],k.top+k[A]),a.G.na(l,n,f);else a.G[p](f,a.G.Ak(k[G],k.top,k[r],k[A],n))}}f.q&&(c=AN([rF,c,d]),f=f.a(),a.qe(a.gf[xx].Fe,c,f))}} function aJa(a,b,c){var d=W(function(a,d){var g=h[t](a.aa),k=null!=a[J]?a[J]:b.A[A],l=c.VM.aa,l=h.min(l,l+c.VM[jx]*k);return this.G.rb(g,l,1,k,a.brush,d)},a);mJa(a,c,d)}function bJa(a,b,c){var d=W(function(a,d){var g=h[t](a.aa),k=null!=a[J]?a[J]:b.A[r],l=c.VM.aa,l=h.min(l,l+c.VM[jx]*k);return this.G.rb(l,g,k,1,a.brush,d)},a);mJa(a,c,d)} function mJa(a,b,c){if(b.wb){var d=a.gf.gridline.Fe,e=AN([b[yd],TE]);Y(b.wb,function(a,f){var g=AN([b[yd],TE,f]);nJa(this,a,c,d,g,e)},a)}var f=a.gf.baseline.Fe,g=AN([b[yd],LC]);nJa(a,b.Ed,c,f,g)}function nJa(a,b,c,d,e,f){var g;if(g=b)if(g=b.O)g=b.brush,g=!(!Wm(g)&&!Vm(g));g&&(b=c(b,d),a[Bx](b,e,f))} function cJa(a,b){var c=a.gf,d=a.Is(b[uz],c.axistitle.Fe),e=AN([b[yd],HI]);a[Bx](d,e);if(b[cd]){var f=c.axistick.Fe,g=AN([b[yd],zF]);Y(b[cd],function(a,c){if(a.O){var d=this.Is(a.ma,f),e=AN([b[yd],zF,c]);this[Bx](d,e,g)}},a)}}T.d3=function(a,b){this.oK(a);this.j0(a,b)}; T.oK=function(a){var b=this.gq;if(b){for(var c in b.k){var d=a.k[c];if(fP(b.k[c],Ij({j:null}))){var e=b.k[c].j,f;for(f in e){var g=e[f];if(g.vb){var k=AN([Hs,ia(c),ia(f)]);wS(this,k)}if(g=g.Jc)for(var l in g[vz])g[vz][l].ka&&(k=AN([Hs,ia(c),ia(f),ia(l)]),wS(this,k));jJa(this,d,ia(c),d.j[f],ia(f))}}else{for(f in b.k[c].j)b.k[c].j[f].vb&&(k=AN([Hs,ia(c),ia(f)]),wS(this,k));JS(this,d,ia(c))}}for(var n in b.Ba)if(c=b.Ba[n],c.vb&&(k=AN([Hs,ia(n)]),wS(this,k)),g=c.Jc){for(l in g[vz])g[vz][l].ka&&(k=AN([Hs, null,ia(n),ia(l)]),wS(this,k));IS(this,a.Ba[n].Jc,null,ia(n))}HS(this)}};T.j0=function(a,b){for(var c in b.k){var d=a.k[c];if(fP(b.k[c],Ij({j:null})))for(var e in b.k[c].j){var f=new sO(2);tO(f,0,d.j[e]);tO(f,1,b.k[c].j[e]);f=f[My]();jJa(this,d,ia(c),f,ia(e))}else f=new sO(2),tO(f,0,d),tO(f,1,b.k[c]),d=f[My](),JS(this,d,ia(c))}for(var g in b.Ba)b.Ba[g].vb&&(c=AN([Hs,ia(g)]),GS(this,b.Ba[g].vb,c)),b.Ba[g].Jc&&(c=new sO(2),tO(c,0,a.Ba[g].Jc),tO(c,1,b.Ba[g].Jc),c=c[My](),IS(this,c,null,ia(g)));HS(this)};function oJa(a){this.x=a.x||0;this.y=a.y||0;this.Ze=new uP(this.x,this.y);jb(this,a[J]);Bw(this,a[cd])};function pJa(a){Bw(this,a[cd]);this.X=a.X;this.F=a.F;this.Cc=a.Cc;this.Bc=a.Bc;this.vb=void 0!==a.vb?a.vb:O;this.de=a.de;this.Cb=null!=a.Cb?a.Cb:0;Zw(this,void 0!==a[Gz]?a[Gz]:null);this.TA=!!a.TA}pJa[K].j9=function(){var a=this,b=Gi(this.F,function(b){var d=a[Gz]?a[Gz]:{x:0,y:0},e=bK(b.x+d.x,b[J],a.Cc);b=bK(b.y+d.y,a.X[uc],a.Bc);return e[y]==e.end||b[y]==b.end?null:new rl(b[y],e.end,b.end,e[y])}),b=Fi(b,Xh);return Om(b)};function qJa(a){a=Fi(a[pc](Mh),function(a){return null!=a&&pi(a)!==O});for(var b={},c=0;c<a[J];c++){var d=a[c][pc](Lh),e=Gi(d[0][pc](Je),pi),f=bm(pi(d[1]));0===e[J]?Sj(b,f):Y(e,function(a){b[a]=b[a]||{};Sj(b[a],f)})}return b};var MS={},rJa=!1; function sJa(a){if(!rJa){var b={colors:[{color:Lla,dark:Ela,light:Sla},{color:Hla,dark:Fla,light:Ola},{color:Kla,dark:Dla,light:Tla},{color:Cla,dark:xla,light:Jla},{color:Rla,dark:Ila,light:Nla},{color:Ala,dark:wla,light:Gla}],backgroundColor:{gradient:{color1:yla,color2:vla,x1:PA,y1:PA,x2:QA,y2:QA}},titleTextStyle:{color:Hh},hAxis:{textStyle:{color:Hh},titleTextStyle:{color:Hh}},vAxis:{textStyle:{color:Hh},titleTextStyle:{color:Hh}},legend:{textStyle:{color:Hh}},chartArea:{backgroundColor:{stroke:wA,fill:R}}, areaOpacity:0.8};MS.classic=b;b={titlePosition:mF,axisTitlesPosition:mF,legend:{position:mF},chartArea:{width:QA,height:QA},vAxis:{textPosition:mF},hAxis:{textPosition:mF}};MS.maximized=b;b={enableInteractivity:!1,legend:{position:R},seriesType:BC,lineWidth:1.6,chartArea:{width:QA,height:QA},vAxis:{textPosition:R,gridlines:{color:R},baselineColor:R},hAxis:{textPosition:R,gridlines:{color:R},baselineColor:R}};MS.sparkline=b;rJa=!0}return MS[a]} function NS(a){var b={};Xa(b,a[E]||a);var c=Dm(b[E]);c==R?(b.tb=a.darker||c,b.Mi=a.lighter||c):(c=rm(c),b.tb=a.darker||pm(wm(c,0.25)),b.Mi=a.lighter||pm(xm(c,0.25)));return b};function OS(a,b,c,d){this.Uf=a;this.b=b;this.Pl=d;this.Wc=c;this.ta=Ln(this.b,tra,{Va:d.Kj,fontSize:d.Nl,Tb:d.$u});this.Qd=Cn(this.b,sra,tA);this.Vl=xn(this.b,rra,0.8);this.VS=0;this.yD=1;this.zD=2;this.pq=3;this.qq=4;this.Do=this.j3=this.i3=this.l3=this.k3=O;this.pT=this.b.R(ND,tP);this.YK=NS(this.pT[0])[E];this.rD=this.iq=this.qT=this.oT=this.Vy=this.Qy=null;this.Yi()} OS[K].Yi=function(){function a(a,b,d){if(c.H()<=a)return O;var e=c.D(a);if(b&&!Ri(d,e))throw m(IB+a+" must be of type "+d[ie](Tq));if(!b&&Ri(d,e))throw m(IB+a+" cannot be of type "+d[ie](Tq));return e}var b=this.Pl,c=this.Uf,d=c.H();if(3>d)throw m("Data table should have at least 3 columns");a(this.VS,!0,[rh]);var e=a(this.yD,!1,[rh]),f=a(this.zD,!1,[rh]);this.k3=c.cb(this.yD);this.l3=c.cb(this.zD);di(this.pq)&&this.pq<d?(this.Do=a(this.pq,!0,[Yg,rh]),this.Do==rh&&(this.Qy={},this.Vy=[]),this.i3= c.cb(this.pq)):this.pq=null;var g=!1;di(this.qq)&&this.qq<d?(a(this.qq,!0,[Yg]),this.j3=c.cb(this.qq),g=pn(this.b,Zza,!0)):this.qq=null;b.Ba=[];b.eq={};for(d=0;d<c.M();d++){var k=c.cn(d);b.eq[k]=d}b.k=[{type:dD,dK:!0,Qea:g,j:[],pta:this.Qy,qta:this.Vy}];b.Ns=e;b.eE=[f];b.xf={};b.xf.bubbles=1;b.dn=[]};function tJa(a,b,c){for(var d=a.Uf,e=0;e<d.M();e++){var f=d[I](e,a.yD),g=d[I](e,a.zD),f=lP(b.ca,f),g=lP(c.ca,g);null!=f&&PS(b,f);null!=g&&PS(c,g)}} function uJa(a,b,c,d){for(var e=0;e<a.Uf.M();e++){var f;t:{f=a;var g=b,k=c,l=e,n=f.Uf,q=n[I](l,f.VS),s=n.Aa(l,f.VS),u=n[I](l,f.yD),w=n[I](l,f.zD),z=null;if(null!=f.pq&&(z=n[I](l,f.pq),null==z)){f=null;break t}var B=null;if(null!=f.qq&&(B=n[I](l,f.qq),null==B)){f=null;break t}n=f.Wc(s,f.ta)[r];if(f.Do==Yg)f.oT=Nm(f.oT,z);else if(f.Do==rh){var F=z,M=f.Qy[F];if(!M){var M=ZH+F+Me,N=Cn(f.b,M+KD,f.pT[f.Vy[J]%f.pT[J]]),N=NS(N),P=pn(f.b,M+hJ,!0),M=zn(f.b,M+AF,F),M={color:N[E],Oj:P,zk:M};f.Qy[F]=M;f.Vy[C](F)}}f.qT= Nm(f.qT,B);u=jP(g.ca,u);w=jP(k.ca,w);null===u||null===w?f=null:(QS(g,u)&&QS(k,w)&&(g.fc(u),k.fc(w)),g=f.ZT(l,s),f={id:q,text:s,Mea:n,X:f.ta,de:g,Cf:{x:u,y:w,color:z,size:B}})}a.Pl.k[0].j[C](f)}if(a.Do==Yg)a.iq=TFa(a.b,a.oT),d.c4(a.iq);else if(a.Do==rh)for(e=0;e<a.Vy[J];e++)b=a.Vy[e],c=a.Qy[b],c.Oj&&a.Pl.dn[C]({index:e,id:b,text:c.zk,brush:new Rm({fill:c[E]}),O:!0});a.rD=pHa(a.b,a.qT)} OS[K].ZT=function(a,b){var c=this.Uf,d=c.Aa(a,this.yD),e=c.Aa(a,this.zD),d=[{title:this.k3,value:d},{title:this.l3,value:e}];null!=this.pq&&(e=c.Aa(a,this.pq),d[C]({title:this.i3,value:e}));null!=this.qq&&(c=c.Aa(a,this.qq),d[C]({title:this.j3,value:c}));return{title:b,F:d}};function vJa(){this.um=0;this.wW=this.vp=-1;this.pr=0;this.nG=-1} vJa[K].create=function(a,b,c,d,e){if(0!=a[J]&&(a=Fi(a,function(a){return null!=a}),cj(a),0!=a[J]))if(a[0]==a[a[J]-1])this.um=1,this.vp=a[0],this.wW=a[0],this.nG=0;else{var f=h[xb](0.5*a[J])-1,g=h.min(a[J]-1,h[xb]((100-b)/100*a[J])-1),k=h.max(0,h[xb](b/100*a[J])-1);b=wJa(a);var l=a[f]-h.min(a[f]-a[0],1.5*(a[f]-a[k]));l!=a[0]&&(this.pr=1,b&&(l=h[t](l)));var n=a[f]+h.min(a[a[J]-1]-a[f],1.5*(a[g]-a[f])),f=Fi(a,function(a){return a<n&&a>l});this.um=di(c)&&0<c?c:xJa(l,n,f[J],b,d,e);this.vp=this.um*(1== this.pr?h[D](l/this.um):h[t](l/this.um));1==this.pr&&this.vp<a[0]&&(this.pr=0);a=h[t]((n-this.vp)/this.um);this.wW=this.um*a+this.vp;this.nG=a+this.pr}};function wJa(a){for(var b=0;b<a[J];b++)if(!wj(a[b]))return!1;return!0}function yJa(a){var b=[];1==a.pr&&b[C](Bna+(a.vp.toPrecision(10)-0));for(var c=a.nG-a.pr,d=0;d<c+1;d++)b[C]((d*a.um+a.vp).toPrecision(10)-0+Ie);return b}function zJa(a){for(var b=[],c=0;c<=a.nG+1;c++)b[C]((c-a.pr)*a.um+a.vp);return b} function xJa(a,b,c,d,e,f){if(a==b)return 1;if(0==c)return b-a;a=b-a;c=h[ud](c);b=null!=e&&0<e;var g=null!=f&&0<f;e=b&&g?f>e?nj(c,e,f):c:b?h.max(c,e):g?h.min(c,f):c;e=a/e;f=0.8*e;a=1.2*e;c=h[D];if(!(e>a||e<f||f>=a)){b=1;g=e;do{var g=e,k=b,l=c;0==g||!xj(g)||0>=k||(k=(0==g?1:h.pow(10,h[xb](-h.log(h.abs(g))/h[kz])-1))*h.pow(10,h.max(0,k)),k*=0<g?1:-1,g=h.max(5*l(k*g/5),1)/k);b++}while(!(g>=f&&g<=a)&&5>b);e=5>b?g:e}return d?0.5<e?h[D](e):1:e};function AJa(a,b,c){this.Pl=a;this.ya=c?Gn(b,lsa,hFa,c):R;this.ta=Ln(b,msa,{Va:a.Kj,fontSize:a.Nl,Tb:this.ya==mF?a.$u:R});this.RT=An(b,ksa);this.vg=this.Yb=null}T=AJa[K];pw(T,function(){return this.ya});Kw(T,function(){return 1.5*this.ta[uc]});T.getArea=function(){return this.Yb};T.Go=function(a){this.Yb=a};T.c4=function(a){this.vg=a}; T.zW=function(){if(!this.Yb||!this.vg)return null;var a={top:this.Yb.top,left:this.Yb[G],width:this.Yb[Zc]-this.Yb[G],height:this.Yb[Hc]-this.Yb.top,orientation:Jg,X:this.ta,J6:RC,K6:this.RT},b=jR(this.vg,a,[],this.Pl.Ac);return null!=b?{position:this.ya,scale:this.vg,oG:a,definition:b}:null};function RS(a,b,c){this.m1=a;this.Oa=b;this.rw=a-b/2;this.Bga=c;np(this,0)}RS[K].getCenter=function(){return this.rw+this.Oa/2};Kw(RS[K],function(){return this.Oa});function BJa(a,b){this.bI=a;this.yy=b;for(var c=0,d=b[J];c<d;c++)np(b[c],c)}function CJa(a){for(var b=0,c=0,d=a.yy[J];c<d;c++)b+=a.yy[c][ez]();if(b>a.bI)throw m("Not enough space for labels. Need: "+b+" got: "+a.bI);a.yy[Zd](function(a,b){var c=a.m1,d=b.m1;return c==d?a[nc]>b[nc]?1:0:c>d?1:-1});c=0;for(d=a.yy[J];c<d;c++){var b=a.yy[c],e=DJa(a,b.rw,b[ez]());b.rw=e}c=[];b=0;for(d=a.yy[J];b<d;b++)c[C]([a.yy[b]]);for(;EJa(a,c););} function EJa(a,b){for(var c=0;c<b[J]-1;c++){var d=b[c],e=b[c+1],f=d[d[J]-1];if(f.rw+f.Oa>e[0].rw){for(var f=a,g=e,e=0;e<g[J];e++)d[C](g[e]);for(var k=0,e=g=0;e<d[J];e++)k+=d[e].m1,g+=d[e][ez]();k=k/d[J]-g/2;k=DJa(f,k,g);for(e=0;e<d[J];e++)f=d[e],f.rw=k,k+=f[ez]();b[he](c+1,1);return!0}}return!1}function DJa(a,b,c){return nj(b,0,a.bI-c)};function SS(a,b,c,d){this.Pl=a;this.ya=c?Gn(b,ewa,gFa,c):R;this.tL=Gn(b,Wva,iFa,this.ya==WC?pD:nI);c=Jg;if(this.ya==Qg||this.ya==zs||this.ya==BF||this.ya==YC)c=Eh;this.ib=c;this.ta=Ln(b,jwa,{Va:a.Kj,fontSize:a.Nl,Tb:this.ya==mF?a.$u:R});this.Mq=!1;this.S5=Ln(b,dwa,this.ta);this.Wc=a.Ac;this.iF=this.ta[uc];d=d?nj(d,1,2):1;this.ek=this.iF*d;this.ht=h[D](this.ta[uc]/(1.618*1.618));this.qE=this.Yb=null;this.TV=pn(b,iwa,!0);this.iha=Gn(b,hwa,pP,this.ib);this.gha=Jn(b,fwa);this.hha=Jn(b,gwa);this.Me=null; this.IM=this.ht;this.xw=this.yw=this.RV=0;this.m4=this.ya==NI?vn(b,$va,1):1;this.tE=0}pw(SS[K],function(){return this.ya});SS[K].getArea=function(){return this.Yb};SS[K].Go=function(a){this.Yb=a};function FJa(a){a.qE=Fi(a.Pl.dn,function(a){return a.O})} SS[K].zW=function(){if(!this.Yb)return null;if(this.ya!=R)if(this.ib==Eh)GJa(this);else{for(var a=[1,9,99,0],b=0;b<a[J];++b){var c;t:{c=a[b];var d=this.Yb[Zc]-this.Yb[G],e=!1;1!=c&&(d-=2*(this.ek+this.ht),e=!0,0!=c&&(d-=TS(this,c)+this.ht));var f=US(this,this.qE,d);if(0==f[J])this.Mq=!1;else{this.Me=[];for(var g=this.qE;0<g[J];){if(0<c&&this.Me[J]==c){c=!1;break t}for(var k=[HJa(this,f,g,e)],l=1;l<this.tE&&g[J]!=f[J];l++)g=$i(g,f[J]),f=US(this,g,d),k[C](HJa(this,f,g,e));k=IJa(this,k);this.Me[C](k); g=$i(g,f[J]);f=US(this,g,d)}this.Mq=1<this.Me[J]}c=!0}if(c)break}this.Mq&&(this.RV=h[D]((this.Yb.top+this.Yb[Hc]-this.ek)/2),this.xw=this.Yb[Zc]-this.ek,this.yw=this.xw-this.IM-this.ek,this.TV&&(a=TS(this,this.Me[J]),this.yw-=a+this.IM))}a=this.Me&&0<this.Me[J]?this.Me[0]:null;if(this.Mq){b=1<this.Me[J];c=this.RV;d=null;this.TV&&(d=bna+this.Me[J],e=this.yw+this.ek,f=this.xw-e,d={text:d,X:this.S5,cq:null,F:[{x:e+f/2,y:c,text:d,length:f}],Cc:pD,Bc:nI,vb:O,anchor:null,Cb:0});var g=this.iha==Eh,k=this.ek, l=h[D](k/2),n=this.yw,q=this.xw,f=e=null;g?(e=[{x:n+k,y:c+k},{x:n+l,y:c},{x:n,y:c+k}],f=[{x:q,y:c},{x:q+k,y:c},{x:q+l,y:c+k}]):(e=[{x:n+k,y:c+k},{x:n+k,y:c},{x:n,y:c+l}],f=[{x:q,y:c},{x:q+k,y:c+l},{x:q,y:c+k}]);c={Kt:this.gha,yN:this.hha};b={YW:{path:e,Kt:!1,ce:c,brush:c.yN},WW:{path:f,Kt:b,ce:c,brush:b?c.Kt:c.yN},XW:d}}else b=null;return{position:this.ya,area:this.Yb,Me:this.Me,ln:a,iG:b}}; function GJa(a){var b=h.max(a.Yb[Zc]-a.Yb[G]-(a.ek+a.ht),0),c=a.Yb[Hc]-a.Yb.top,d=h.max(c-2*a.iF,0),e=a.qE,f=a.Pl;UIa(f)&&e[rx]();var g=Gi(e,function(a){a=UN(this.Wc,a[cd],this.ta,b,ea);0==a.F[J]&&(a.F=[O]);return a},a);if(a.ya!=BF||f.eT!=JF&&f.eT!=BC)if(c=VS(a,g,c),a.Mq=JJa(e,c),a.Mq)if(c=VS(a,g,d),Qh(c[0])&&0!=c[0][J]){for(a.Me=[];0<e[J];){f=KJa(a,c,e);a.Me[C](f);for(f=0;Qh(c[f])&&0!=c[f][J];)++f;g=$i(g,f);c=VS(a,g,d);e=$i(e,f)}a.Mq&&(a.RV=h[D](a.Yb[Hc]-a.iF),a.yw=a.Yb[G],a.xw=a.yw+a.ek+a.IM,a.TV&& (d=TS(a,a.Me[J]),a.xw+=d+a.IM))}else a.Mq=!1;else f=KJa(a,c,e),a.Me=[f];else f=LJa(a,g,c,e),a.Me=[f]}function VS(a,b,c){var d=a.ta[uc],e=h[D](d/1.618),f=h[D](d/3.236);a=MJa(a,b,d+e,d+f);return bP(a,c)}function NJa(a,b){var c=Gj(a.Pl.Be),d=a.Pl.k[b],e=Gi(d.j,function(a){return!a||a.Ae?null:new sk(a.S.x,a.S.y)}),d=gP(e,c.Gh,d.Lj);return null===d?OJa(e,c.Gh):d} function OJa(a,b){a=Fi(a,Xh);var c=-(aj(a,b,function(a,b){return bj(a,b.x)})+1),c=$i(a,0,c);return(c=Qi(c,function(a){return null!==a.y}))?c.y:null} function LJa(a,b,c,d){for(var e=a.Yb[Zc]-a.Yb[G],f=h[D](a.Yb[G]),g=[],k=[],l=a.Pl.By==gE,n=0;n<d[J];n++){var q=d[n],s=UN(a.Wc,q[cd],a.ta,e,b[n].F[J]),u={};u.id=q.id;u.brush=q.brush.o();var w=Pj(a.ta);Xa(w,u.brush.gb());u.ma={text:q[cd],X:w,cq:null,F:[],Cc:nI,Bc:nI,vb:s.ge?q[cd]:O,anchor:null,Cb:0};w.Tb&&u.brush.dd(w.Tb,1);u.O=!0;for(var z=0;z<s.F[J];z++)u.ma.F[C]({length:e,text:s.F[z]});l&&(z=a.Wc(u.ma.F[0][cd],w)[r],u.re={},tw(u.re,{x:f+z+5}),u.re.brush=u.brush,u.re.O=!1);np(u,q[nc]);z=NJa(a,u[nc])|| 0;w=a.Wc(u.ma.F[0],w)[A];q=new RS(z,u.ma.F[J]*w,u);g[C](q);k[C](u)}CJa(new BJa(c,g));for(z=0;z<g[J];z++)for(q=g[z],a=q.rw,u=q.Bga,b=u.ma.F,n=0;n<b[J];n++)b[n].y=h[D](n*w+a),b[n].x=f,l&&(u.re[Ey].y=b[n].y);return k} function KJa(a,b,c){for(var d=a.ek+a.ht,e=a.Yb[Zc]-a.Yb[G]-d,f=a.ta[uc],g=h[D](f/1.618),k=h[D](f/3.236),l=f+g,n=f+k,f=[],k=0,q=h[D](a.Yb[G]),s=0;s<c[J];s++){var u=c[s],w=b[s][J];if(0!=w){var z=UN(a.Wc,u[cd],a.ta,e,w),w={};w.id=u.id;w.ma={text:u[cd],X:a.ta,cq:null,F:[],anchor:new uP(q,0),Cc:nI,Bc:nI,vb:z.ge?u[cd]:O,Cb:0};w.Wb={};tw(w.Wb,new vl(q,k,a.ek,a.iF));w.Wb.brush=u.brush.o();a.ta.Tb&&w.Wb.brush.dd(a.ta.Tb,1);w.O=!0;for(var B=0;B<z.F[J];B++)0<B&&(k+=n),w.ma.F[C]({x:d,y:k,length:e,text:z.F[B]}); np(w,u[nc]);k+=l;f[C](w)}}b=h[D](a.Yb.top);a.Mq||(g=k-g,c=a.Yb[Hc]-a.Yb.top,a.tL==oE?b+=c-g:a.tL==pD&&(b+=h[t]((c-g)/2)));for(s=0;s<f[J];s++)w=f[s],w.Wb[Ey].top+=b,w.ma[Gz].y+=b;return f}function MJa(a,b,c,d){for(var e=Hi(b,function(a,b){return h.max(a,b.F[J])},0),f=[],g=0;g<e;g++){var k=0==g?c:d;Y(b,function(a,b){g<a.F[J]&&f[C]({key:b,min:0==g&&0==b?this.ta[uc]:k,Tc:[]})},a)}return f}function JJa(a,b){var c=a[J]-1;return 1<a[J]&&1>b[c][J]} function IJa(a,b){var c=a.Yb[Hc]-a.Yb.top,d=a.ta[uc],e=c-a.tE*d,f=1<a.tE?e/(a.tE-1):0,g=(c-((d+f)*b[J]-f))/2,k=[];Y(b,function(a){var b=h[D](g);Y(a,function(a){a.ma[Gz].y+=b;a.Wb[Ey].top+=b});g+=d+f;Zi(k,a)});return k}function US(a,b,c){var d=a.ek+a.ht,e=h.min(a.Pl[r]*(2-1.618)/2,c);if(e<d)return[];a=PJa(a,e,b);return aP(a,c)} function HJa(a,b,c,d){for(var e=a.Yb[Zc]-a.Yb[G],f=a.ek+a.ht,g=h[D](1.618*a.ta[uc]),k=[],l=0,n=h[D](a.Yb.top),q=0;q<b[J];q++){var s=c[q],u=UN(a.Wc,s[cd],a.ta,b[q]-f-(0<q?g:0),1),w=0<u.F[J]?u.F[0]:O,z=a.Wc(w,a.ta)[r],B=[{x:l+f,y:0,length:z,text:w}],F={};F.id=s.id;F.ma={text:s[cd],X:a.ta,cq:null,F:w?B:[],anchor:new uP(0,n),Cc:nI,Bc:nI,vb:u.ge?s[cd]:O,Cb:0};F.O=!0;F.Wb={};F.Wb.brush=s.brush.o();a.ta.Tb&&F.Wb.brush.dd(a.ta.Tb,1);tw(F.Wb,new vl(l,n,a.ek,a.iF));np(F,s[nc]);k[C](F);l+=z+f+g}b=a.Yb[G];d|| (d=l-g,a.tL==oE?b+=e-d:a.tL==pD&&(b+=h[t]((e-d)/2)));for(q=0;q<k[J];q++)F=k[q],Ya(F.Wb[Ey],F.Wb[Ey][G]+b),F.ma[Gz].x+=b;return k}function PJa(a,b,c){var d=a.ek+a.ht,e=h[D](1.618*a.ta[uc]);return Gi(c,function(a,c){var k=this.Wc(a[cd],this.ta)[r]+d,l=h.min(b,k),k=k-l;0<c&&(l+=e);return{min:l,Tc:[k]}},a)}function TS(a,b){for(var c=Oe;10<=b;)c+=Oe,b/=10;return a.Wc(c+Tq+c,a.S5)[r]};function WS(a,b,c,d,e){this.mz=a;this.Nb=null;rp(this,b);this.Ac=c;this.fj=this.kf=null;a=this.L=this.f5();a.Ac=c;pa(a,d);Sa(a,e);a.Wa=Gn(b,Ah,aFa,R);a.Kj=zn(b,GE);a.Nl=vn(b,HE,h[D](h.pow(2*(a[r]+a[A]),1/3)));a.eT=Gn(b,kza,bFa,JF);a.Ls=pn(b,AAa);a.Gy=Gn(b,eza,ofa,oh);a.R2=pn(b,awa);a.nD=Jn(b,HC);a.W2=Jn(b,Era);c=a.W2;d=a.nD;c=Xm(c)?c.gb():Xm(d)?Wm(c)?Mm(c.gb(),d.gb(),c.Oe):d.gb():null;a.fK=c;a.lea=Cn(b,gra,O);a.T2=Cn(b,Yua,O);a.$u=a.fK||O;c=zn(b,HI);a.Iy=Gn(b,yAa,qP,XG);d=Ln(b,JI,{Va:a.Kj,fontSize:a.Nl, Tb:a.Iy==mF?a.$u:R});Ap(a,{text:c,X:d,cq:null,F:[],Cc:nI,Bc:oE,vb:O,anchor:null,Cb:0});a.qD=Gn(b,dra,qP,XG);a.Fc=pn(b,sF);a.Lj=pn(b,qF);a.By=Gn(b,Mva,nFa,ZD);this.e5();this[Fc]();if(a.By==gE&&(!a.xf||a.xf.line!=a.k[J]))throw m("DIVE interactivity model is only supported when all series are of type line.");}WS[K].f5=function(){return new sS};WS[K].Ay=function(){return this.L}; Ma(WS[K],function(){var a=this.L;QJa(this);var b=this.u6(),c=this.t6(),d=null,e=a.Wa;!a.Uc||e!==cH&&e!==QH?a.R2&&e!==cH&&e!==cD&&(d=2):d=2;this.kf=new SS(a,this[eq],b,d);this.fj=new AJa(a,this[eq],c);this.s6();FJa(this.kf);var b=this.L,e=b[uz].X[uc],c=this.kf.ta[uc],f=this.kf[zy](),g=this.fj.ta[uc],k=this.fj[zy](),d=b.Iy==XG?b[uz][cd]:O,l=UN(this.Ac,d,b[uz].X,b.A[r],ea),n=h.max(2,h[D](e/3.236)),q=h.max(2,h[D](c/1.618)),g=h.max(2,h[D](g/1.618)),s=h.max(2,h[D](1.618*b.Nl)),u=[];u[C]({key:XC,min:2,Tc:[s- 2]});u[C]({key:OI,min:0,Tc:[ea]});0<l.F[J]&&u[C]({key:HI,min:e+2,Tc:[]});if(f==NI){for(var f=this.kf,s=b.A[r],w=f.qE,z=US(f,w,s),B=1;(0==f.m4||f.m4>B)&&z[J]<w[J];)++B,w=$i(w,z[J]),z=US(f,w,s);s=B;for(f=0;f<s;++f)u[C]({key:DF,min:c+2,Tc:[q-2]})}k==NI&&u[C]({key:MD,min:this.fj[ez]()+2,Tc:[g-2]});for(f=1;f<l.F[J];f++)u[C]({key:HI,min:e+2,Tc:[n-2]});k=bP(u,b.A.top);e=k[OI][0]||0;l=k[uz]||[];n=UN(this.Ac,d,b[uz].X,b.A[r],l[J]);for(f=0;f<n.F[J];f++)e+=l[f],b[uz].F[C]({text:n.F[f],x:b.A[G],y:e,length:b.A[r]}); b[uz].vb=n.ge?d:O;d=k.legend||[];0<d[J]&&(this.kf.tE=d[J],c=e+d[0]-c,e+=Mda[Mc](null,d),this.kf.Go(new rl(c,b.A[Zc],e,b.A[G])));c=k.colorBar||[];0<c[J]&&(e+=c[0],b=new rl(e-this.fj[ez](),b.A[Zc],e,b.A[G]),this.fj.Go(b));a.Ea=this.kf.zW();a.gi=this.fj.zW()});WS[K].e5=function(){var a=this.mz,b=new ku(a);if(2>b.H())throw m("Not enough columns given to draw the requested chart.");if(pn(this[eq],EH)){for(var c=[],a=a.M()-1;0<=a;a--)c[C](a);b.qn(c)}this.Nb=b}; function RJa(a,b,c,d){null!=b||(b=d());b=h[D](b);null!=a||(a=(c-b)/2);a=h[D](a);b=h.min(a+b,c);return{start:a,end:b}} function QJa(a){var b=a.L,c=Mn(a[eq],wD,b[r]),d=Mn(a[eq],tD,b[A]),e=Mn(a[eq],vD,b[A]),f=Mn(a[eq],uD,b[r]),g=W(function(){var a=b[r]/1.618,c=b[r]-b[A]*(1.618-1);return h[D](a>c?a:(a+2*c)/3)},a),f=RJa(f,c,b[r],g),c=h.min(f[y],f.end),f=f.end,g=f-c;a=W(function(){var a=b[A]/1.618,c=b[A]-b[r]*(1.618-1);return h[D](a>c?a:(a+2*c)/3)},a);e=RJa(e,d,b[A],a);d=h.min(e[y],e.end);e=e.end;b.A={left:c,right:f,width:g,top:d,bottom:e,height:e-d}};function XS(a,b,c,d){return new SJa(a,b,c,d)}function SJa(a,b,c,d){this.vN=b;this.le=new Io({pattern:a});this.Opa=c;this.Npa=d}ua(SJa[K],function(a){a/=this.vN;return this.le.Ee(a)+(ne+(2>h.abs(a)?this.Opa:this.Npa))});function YS(){this.wca=new Date;this.Dk(tf)}YS[K].Dk=function(a){switch(a){case Sf:a=Do.YEAR_FULL;break;case Bf:a=jba;break;case vf:a=Do.YEAR_MONTH_ABBR;break;case jf:a=qo[vd].SHORT_DATE;break;default:a=qo[vd].SHORT_DATETIME}this.le=new Go({pattern:a,timeZone:0})};ua(YS[K],function(a){this.wca[Jc](a);return this.le.Ee(this.wca)});function ZS(){this.S1=null;this.hD=[];this.AV=this.ny=this.LJ=null}function $S(a,b){a.S1=b;return a}function aT(a,b){a.LJ=b;return a}ZS[K].mE=function(a){this.ny=a;return this}; function TJa(a,b){var c;c=cP(di(b)?b:3);c=[XS(c,h.pow(10,15),dpa,dpa),XS(c,h.pow(10,12),Apa,Apa),XS(c,h.pow(10,9),boa,boa),XS(c,h.pow(10,6),Roa,Roa)];a.hD=c;return a}function bT(a){var b;b=cP(di(5)?5:3);b=[XS(b,h.pow(10,15),Af,Af),XS(b,h.pow(10,12),Lf,Lf),XS(b,h.pow(10,9),$na,$na),XS(b,h.pow(10,6),sf,sf)];a.hD=b;return a}ZS[K].jq=function(){var a;a=this.AV?new Io(this.AV):new Io({pattern:cP(di(this.S1)?this.S1:16)});return new UJa(a,this.hD,this.LJ,this.ny)}; function UJa(a,b,c,d){this.Upa=a;this.hD=b||[];this.LJ=c||null;this.ny=d||null}ua(UJa[K],function(a){var b=0>a;a=h.abs(a);if(this.LJ){var c=this.LJ;if(0!=a){var d=h[t](h.log(h.abs(a))/BDa)+1;d>c?(c=h.pow(10,d-c),a=h[D](a/c)*c):(c=h.pow(10,c-d),a=h[D](a*c)/c)}}c=null;for(d=0;d<this.hD[J];d++){var e=this.hD[d];if(a>=e.vN){c=e[Kb](a);break}}null==c&&(c=this.Upa.Ee(a));this.ny&&(a=this.ny.symbol,d=this.ny.usePadding?ne:O,c=this.ny[jc]==zs?c+d+a:a+d+c);return b?Le+c:c});function cT(a,b,c,d,e,f){this.hd=a;this.ya=b;this.vw=c;this.zt=d;this.Gb=f}function VJa(a,b,c){return new cT(a,b,!0,!0,0,c)}function dT(a,b,c){return new cT(a,b,!1,!1,0,c)}pw(cT[K],function(){return h[D](this.ya)});fb(cT[K],function(){return this.hd});cT[K].sd=function(){return this.Gb};cT[K].Zl=function(a){this.Gb=a};function eT(a,b){this.JJ=a;this.IJ=b||0;var c;c=this.JJ+this.IJ;if(1<=c)c=1;else{var d=c[hc]();c=0;var e=d[ld](jE);-1!=e?c=la(d[ec](e+1),10):e=d[J];d=d[ld](Me);-1!=d&&(c-=e-1-d);c=h.pow(10,-c)}this.hca=c;this.ya=0}T=eT[K];Ga(T,function(){this.ya++;return this[I]()});T.wg=function(){this.ya--;return this[I]()};fb(T,function(){return h[D]((this.ya*this.JJ+this.IJ)*this.hca)/this.hca});ta(T,function(a){this.ya=h[t]((a-this.IJ)/this.JJ);return this[I]()}); sa(T,function(a){this.ya=h[xb]((a-this.IJ)/this.JJ);return this[I]()});Va(T,function(a){this.ya=h[D]((a-this.IJ)/this.JJ);return this[I]()});function WJa(a,b,c,d){this.fa=a;this.dg=b;this.ib=c;this.le=d}function XJa(a,b){var c=b[J];if(0<c)for(;--c;)if(YJa(a,b[c-1],b[c]))return!1;return!0}function YJa(a,b,c){var d=ZJa(a,b),e=ZJa(a,c);return h.abs(a.fa.fb(b)-a.fa.fb(c))<(d+e)/2}function ZJa(a,b){var c=a.le[Kb](b);return a.dg.mu(c,a.ib)}function $Ja(a,b,c){b=a.fa.bf(b);a=a.fa.bf(c);return h.abs(a-b)}function fT(a,b){for(var c=[],d=0;d<b[J];d++){var e=b[d];c[C](VJa(e,a.fa.fb(e),a.le[Kb](e)))}return c} function gT(a,b,c,d){if(b==c)return[b];if(!xj(b))return[c];var e=[];for(b=a[xb](b);b<=c;)e[C](b),b=a[oc]();1==e[J]&&(b=(new eT(d/10))[t](c),b!=e[0]&&e[C](b));return e};function hT(a,b,c,d,e){this.lJ=a;this.nR=b;this.nS=c;this.E1=d;this.jD=e;a=iT(this,a);b=iT(this,b)-a;this.py=(d-c)/b;this.QJ=this.py*a-c}hT[K].fb=function(a){return iT(this,a)*this.py-this.QJ};hT[K].bf=function(a){t:switch(a=(a+this.QJ)/this.py,this.jD){case 0:a=h.pow(h.E,a);break t;case 1:break t;default:a=h.pow(a*this.jD+1,1/this.jD)}return a};function iT(a,b){switch(a.jD){case 0:return h.log(b);case 1:return b;default:return(h.pow(b,a.jD)-1)/a.jD}};function jT(a,b,c,d,e,f){this.ks=a;this.dJ=b;this.Jz=c;this.Iz=d;this.Pu=e;this.$aa=f;this.ks==this.dJ?e=this.ks/2:ga(this.$aa)?e=TO(1,VO(this.dJ-this.ks))/1E3:(e=this.$aa/2,0<this.ks&&(e=h.min(this.ks,e)));this.Hl=e;a>=this.Hl?(this.Sf=new hT(a,b,c,d,this.Pu),this.ei=h[D](this.Sf.fb(this.Hl))):b<=-this.Hl?(this.Sf=new hT(-b,-a,d,c,this.Pu),this.ei=h[D](this.Sf.fb(this.Hl)),f=2*this.ei-d,e=2*this.ei-c,this.Sf=new hT(-b,-a,f,e,this.Pu)):a>=-this.Hl?(this.ei=h[D](c),this.Sf=new hT(this.Hl,b,this.ei, d,this.Pu)):b<=this.Hl?(this.ei=h[D](d),e=2*this.ei-c,this.Sf=new hT(this.Hl,-a,this.ei,e,this.Pu)):(this.Sf=new hT(this.Hl,b,0,1,this.Pu),e=this.Sf.fb(-a),this.ei=h[D](c+e/(e+1)*(d-c)),b>=-a?this.Sf=new hT(this.Hl,b,this.ei,d,this.Pu):(e=2*this.ei-c,this.Sf=new hT(this.Hl,-a,this.ei,e,this.Pu)));this.eg=d<c}T=jT[K];T.Sb=function(){return this.ks};T.Zb=function(){return this.dJ};T.Zn=function(){return this.Jz};T.Dm=function(){return this.Iz}; T.bf=function(a){if(this.ks==this.dJ)return this.ks;var b=this.eg?-1:1;return a*b>this.ei*b?this.Sf.bf(a):a*b<this.ei*b?-this.Sf.bf(2*this.ei-a):0};T.fb=function(a){return this.ks==this.dJ?h.abs(this.Jz-this.Iz)/2:a>this.Hl?this.Sf.fb(a):a<-this.Hl?2*this.ei-this.Sf.fb(-a):this.ei};function kT(a){this.Fpa=a[Ab]();this.GJ=a[J];this.ya=0}T=kT[K];Ga(T,function(){this.ya++;return this[I]()});T.wg=function(){this.ya--;return this[I]()};fb(T,function(){var a=h[t](this.ya/this.GJ);return TO(this.Fpa[this.ya-a*this.GJ],a)});ta(T,function(a){this.ya=this.GJ*WO(a);if(this[I]()!=a)for(;this.wg()>a;);return this[I]()});sa(T,function(a){this.ya=this.GJ*VO(a);if(this[I]()!=a)for(;this[oc]()<a;);return this[I]()}); Va(T,function(a){this.ya=this.GJ*WO(a);if(this[I]()!=a){for(;this.wg()>a;);if(a-this[I]()<this[oc]()-a)return this.wg()}return this[I]()});function lT(a,b,c,d,e){this.Sf=a;this.G0=e;this.Kp=new WJa(a,c,d,b);this.Sr=new kT([1,2,5])}lT[K].cG=function(){var a=this.O_(),b;this.Sr[t](a);do b=new eT(a),b=gT(b,this.Sf.Sb(),this.Sf.Zb(),a),a=this.Sr[oc]();while(!XJa(this.Kp,b));return fT(this.Kp,b)};lT[K].O_=function(){var a=this.Sf.Zn(),b=this.Sf.Dm(),c=$Ja(this.Kp,b-this.G0,b),d=$Ja(this.Kp,a,a+this.G0),c=h.max(d,c),d=this.Sf.fb(0);d>=a&&d<=b&&(a=this.Sf.bf(this.Sf.fb(0)+this.G0),c=h.max(c,a));return this.Sr[xb](c)};function mT(a,b,c,d){this.lJ=a;this.nR=b;this.T1=c;this.fda=d;this.py=(this.fda-this.T1)/(this.nR-this.lJ);this.QJ=this.py*this.lJ-this.T1}T=mT[K];T.bf=function(a){return(a+this.QJ)/this.py};T.fb=function(a){return a*this.py-this.QJ};T.Zn=function(){return this.T1};T.Dm=function(){return this.fda};T.Sb=function(){return this.lJ};T.Zb=function(){return this.nR};function nT(a,b){this.jR=a;this.kJ=h[t](a/10);this.ss=a-this.kJ;this.ec=0;this.mR=VO(h.abs(b));this.gy=this.ss*this.mR;this.ya=0}function aKa(a){var b=h[t](a.ya/a.ss);a=10*(a.ya+a.kJ-b*a.ss)/a.jR;0==a&&(a=1);return TO(a,b)}T=nT[K];fb(T,function(){this.ya=h.abs(this.ec)+this.gy;return 0<this.ec?aKa(this):0>this.ec?-aKa(this):0});Ga(T,function(){this.ec++;return this[I]()});T.wg=function(){this.ec--;return this[I]()}; ta(T,function(a){var b=this.kJ,c=VO(h.abs(a));if(h.abs(a)<=h.pow(10,this.mR))return this.ec=0>a?-1:0,this[I]();0<a?this.ec=this.ss*c-this.gy:0>a&&(this.ec=this.gy-this.ss*c,b=-b);this[I]()!=a&&(c=this.jR*a/TO(1,WO(h.abs(a))),this.ec+=h[t](c)-b);return this[I]()}); sa(T,function(a){var b=this.kJ,c=VO(h.abs(a));if(h.abs(a)<=h.pow(10,this.mR))return this.ec=0<a?1:0,this[I]();0<a?this.ec=this.ss*c-this.gy:0>a&&(this.ec=this.gy-this.ss*c,b=-b);this[I]()!=a&&(c=this.jR*a/TO(1,WO(h.abs(a))),this.ec+=h[xb](c)-b);return this[I]()}); Va(T,function(a){var b=VO(h.abs(a));if(h.abs(a)<=h.pow(10,this.mR))return this.ec=0;if(0<a){this.ec=this.ss*b-this.gy;if(this[oc]()>a)return a-this[I]()>=this.wg()-a?this[oc]():this[I]();this.wg()}else if(0>a){this.ec=this.gy-this.ss*b;if(this.wg()<a)return a-this[I]()<this[oc]()-a?this.wg():this[I]();this[oc]()}this[I]()!=a&&(b=this.jR*a/TO(1,WO(h.abs(a))),this.ec+=h[D](b)-this.kJ);return this[I]()});function oT(a,b,c,d,e,f){this.fa=a;this.le=b;this.dg=c;this.ib=d;this.xj=f;this.dma=e;this.Kp=new WJa(a,c,d,b);this.Sr=new kT([1,2,5])} oT[K].cG=function(){var a=this.xj/10,b=this.O_(),c=new nT(b,a),c=gT(c,this.fa.Sb(),this.fa.Zb(),b);if(2>c[J])return fT(this.Kp,c);var b=c[0],d=c[1];if(0==b){if(3>c[J])return fT(this.Kp,c);b=d;d=c[2]}c=TO(1,WO(h.abs(b)));c==b&&(c*=10);this.Sr[xb](c/h.abs(d-b));do if(b=this.Sr.wg(),c=new nT(b,a),c=gT(c,this.fa.Sb(),this.fa.Zb(),b),b=this.Kp,d=[],!(1>=c[J]||0!=c[0])){d[C](c[0]);for(var e=1,f=c[J];e<f;e++)YJa(b,c[0],c[e])||d[C](c[e]);c=d}while(!XJa(this.Kp,c));return fT(this.Kp,c)}; oT[K].O_=function(){var a=this.fa.fb(10*this.xj),b;this.Sr[t](1);do b=this.Sr[oc](),b=this.fa.fb(10*this.xj*(b-1)/b);while(h.abs(a-b)>=this.dma);return this.Sr.wg()};function bKa(a,b){this.wy=null!=a?a:1;12<this.wy&&(this.Cqa=new eT(h[t](this.wy/12)));this.Aqa=b||0;this.Ml=new Date;this[t](0)}T=bKa[K];fb(T,function(){return this.Ml[bc]()});Ga(T,function(){var a=this.Ml[zc](),a=a+this.wy;this.Ml[Ud](a);return this[I]()});T.wg=function(){this.Ml[Ud](this.Ml[zc]()-this.wy);return this[I]()}; ta(T,function(a){this.Ml[Jc](a);1<this.wy&&(this.Ml[Ud](this.Ml[zc]()-(this.Ml[zc]()+12-this.Aqa)%this.wy%12),12<this.wy&&(a=this.Cqa[t](this.Ml[Jb]()),this.Ml.setUTCFullYear(a)));this.Ml.setUTCDate(1);this.Ml.setUTCHours(0,0,0,0);return this[I]()});sa(T,function(a){return this[t](a)<a?this[oc]():this[I]()});Va(T,function(a){return this[t](a)!=a&&a-this[I]()<this[oc]()-a?this.wg():this[I]()});function cKa(){this.ya=0}T=cKa[K];Ga(T,function(){this.ya++;return this[I]()});T.wg=function(){this.ya--;return this[I]()};fb(T,function(){return TO(1,this.ya)});ta(T,function(a){this.ya=VO(a);return this[I]()});sa(T,function(a){this.ya=WO(a);return this[I]()});Va(T,function(a){var b=TO(1,WO(a)),c=b/10;this.ya=h[D](0.4342944819032518*h.log(a-c<b-a?c:b));return this[I]()});function dKa(a){a?(this.Dj=[1E3,5E3,1E4,15E3,3E4,6E4,3E5,6E5,9E5,18E5,36E5,108E5,216E5,432E5,864E5,6048E5,2629746E3,7889238E3,31556952E3],this.Ne=new kT([1,2,5])):(this.Dj=[1E3,6E4,36E5,864E5,6048E5,2629746E3,7889238E3,31556952E3],this.Ne=new cKa);this.gR=this.Ne[D](this.Dj[0]);this.r0=this.Ne.wg();this.xna=this.r0+(this.gR-this.r0)/2;this.AC=this.Dj[this.Dj[J]-1];this.Ne[D](1);this.Zaa=this.AC*this.Ne[oc]();this.zna=this.AC+(this.Zaa-this.AC)/2;pT(this,2)} function pT(a,b){a.t0=1==b||4==b;2==b?a.ya=0:3==b?a.ya=a.Dj[J]-1:1==b?a.Vi=1:4==b&&(a.Vi=a.AC)}T=dKa[K];fb(T,function(){return this.t0?this.Vi*this.Ne[I]():this.Dj[this.ya]});ta(T,function(a){if(a<this.gR)return pT(this,1),this.Ne[t](a);if(a>=this.Zaa)return pT(this,4),this.Vi*this.Ne[t](a/this.Vi);for(pT(this,2);a>=this.Dj[this.ya];)this.ya++;return this.Dj[--this.ya]}); sa(T,function(a){if(a<=this.r0)return pT(this,1),this.Ne[xb](a);if(a>this.AC)return pT(this,4),this.Vi*this.Ne[xb](a/this.Vi);for(pT(this,3);a<=this.Dj[this.ya];)this.ya--;return this.Dj[++this.ya]});Va(T,function(a){if(a<this.xna)return pT(this,1),this.Ne[D](a);if(a>=this.zna)return pT(this,4),this.Vi*this.Ne[D](a/this.Vi);for(pT(this,3);0<this.ya&&a<this.Dj[this.ya];)this.ya--;this.Dj[this.ya+1]-a<=a-this.Dj[this.ya]&&this.ya++;return this.Dj[this.ya]}); Ga(T,function(){this.t0?(this.Ne[oc](),1==this.Vi&&this.Ne[I]()==this.gR&&pT(this,2)):(this.ya++,this.ya==this.Dj[J]&&(pT(this,4),this.Ne[D](1),this.Ne[oc]()));return this[I]()});T.wg=function(){this.t0?(this.Ne.wg(),this.Vi==this.AC&&1==this.Ne[I]()&&pT(this,3)):(this.ya--,-1==this.ya&&(pT(this,1),this.Ne[D](this.gR),this.Ne.wg()));return this[I]()};function qT(a){a=(new dKa(!0))[D](a);return 2629746E3>a?6048E5==a?new eT(a,3456E5):new eT(a):new bKa(h[D](a/2629746E3))} function eKa(a){if(!na(a))return txa;var b=new Date;b[Jc](a);a=O+rT(b[Jb]()[hc](),4);var c=b[zc](),d=b[Jd](),e=1!=d,f=b[ee](),g=b[de](),k=b.getUTCSeconds(),b=b.getUTCMilliseconds(),l=0!=f||0!=g||0!=k||0!=b;if(0!=c||e||l)a=a+Le+rT((c+1)[hc](),2);if(e||l)a+=Le,a+=rT(d[hc](),2);l&&(a+=Lf,a+=rT(f[hc](),2),a+=Xe,a+=rT(g[hc](),2),a+=Xe,a+=rT(k[hc](),2),a+=Me,a+=rT(b[hc](),3));return a} function sT(a,b){var c=O,d=new Date;d[Jc](a);var e=d[zc](),f=d[Jd](),g=d[ee](),k=d[de](),l=d.getUTCSeconds(),n=d.getUTCMilliseconds(),c=c+rT(d[Jb]()[hc](),4);if(b==Sf)return c;c=c+Le+rT((e+1)[hc](),2);if(b==vf)return c;c+=Le;c+=rT(f[hc](),2);if(b==jf)return c;c+=Lf;c+=rT(g[hc](),2);c+=Xe;c+=rT(k[hc](),2);c+=Xe;c+=rT(l[hc](),2);c+=Me;return c+=rT(n[hc](),3)}function rT(a,b){for(var c=a[J];c<b;c++)a=Oe+a;return a} function tT(a){if(a==txa||null==a||a==O)return ja;var b=0,c=0,d=1,e=0,f=0,g=0,k=0,b=la(a[ec](0,4),10);4<a[J]&&(c=la(a[ec](5,2),10)-1,7<a[J]&&(d=la(a[ec](8,2),10),10<a[J]&&(e=la(a[ec](11,2),10),f=la(a[ec](14,2),10),g=la(a[ec](17,2),10),k=la(a[ec](20,3),10))));return Date.UTC(b,c,d,e,f,g,k)}function uT(a,b){if(a[y]==a.end||0==b)return a;var c=(a.end-a[y])*b,d;d=a[y];d=0>d?-fKa(-d,c):gKa(d,c);var e=a.end,c=0>e?-gKa(-e,c):fKa(e,c);return new zm(d,c)} function gKa(a,b){if(0==a)return 0;for(var c=a,d=0,e=ja;0<c;){var f=VO(c),g=TO(1,f),k=hKa(c);if(5<k&&(e=5*g+d,e=vT(e,f),e<=a&&e>a-b))break;e=k*g+d;e=vT(e,f);if(e<=a&&e>a-b)break;f=k*g;d+=f;c-=f}return e}function fKa(a,b){if(0==a)return 0;for(var c=a,d=0,e=ja;0<c;){var f=VO(c),g=TO(1,f),k=hKa(c);if(5>k&&(e=5*g+d,e=vT(e,f),e<=a+b&&e>=a))break;e=k*g+d;e=vT(e,f);if(e<=a+b&&e>=a)break;e=(k+1)*g+d;e=vT(e,f);if(e<=a+b&&e>=a)break;f=k*g;d+=f;c-=f}return e} function vT(a,b){var c=TO(1,h.abs(b));return h[D](a*c)/c}function hKa(a){var b=VO(a),b=TO(1,b);a/=b;b=h.abs(h[D](a)-a);0!=b&&1E-10>b&&(a=h[D](a));return h[t](a)};function iKa(a,b,c,d,e,f,g,k,l){this.Wja=a;this.Q8=b;this.R8=c;this.dg=d;this.Nf=e;this.fa=f;this.jP=g;this.ib=k;this.HY=l;this.Vja=no(a);this.oP=no(b);this.Nf.Dk(this.Q8)}function jKa(a,b,c){var d=a.fa.fb(b);c=a.fa.fb(c);d=(d+c)/2;return dT(a.fa.bf(d),d,a.Nf[Kb](b))};function wT(a,b,c,d,e,f,g){this.fa=a;this.Pj=b;this.dg=c;this.Nf=d;this.jP=e;this.ib=f;this.HY=g;this.W8=[xT(this,jf,1),xT(this,jf,7),xT(this,vf,1),xT(this,vf,2),xT(this,vf,3),xT(this,Bf,1),xT(this,vf,6),xT(this,Sf,1),xT(this,Sf,2),xT(this,Sf,5),xT(this,Sf,10),xT(this,Sf,20),xT(this,Sf,50),xT(this,Sf,100),xT(this,Sf,1E3),xT(this,Sf,1E4),xT(this,Sf,1E7)]}function xT(a,b,c){return new iKa(a.Pj,b,c,a.dg,a.Nf,a.fa,a.jP,a.ib,a.HY)} wT[K].cG=function(){for(var a=no(this.Pj),b=0;b<this.W8[J];b++){var c=this.W8[b];if(a<=c.oP){t:{var d=c,e=d.fa.Sb(),f=d.fa.Zb();d.Nf.Dk(d.Wja);if(e==f)c=[dT(e,h.abs(d.fa.Zn()-d.fa.Dm())/2,d.Nf[Kb](e))];else{var g,c=d.Nf[Kb](f);g=new cT(f,d.fa.Dm(),!0,!0,0,c);d.Nf.Dk(d.Q8);for(var k=1==d.R8&&d.oP>d.Vja,l=qT(d.oP*d.R8),n=qT(d.oP),c=[],q=ja,s=l[xb](e),e=n[xb](e);e<=f;e=n[oc]()){var u=d.fa.fb(e);if(e==s){var s=l[oc](),w=d,z=q,B=e,F=w.dg.mu(w.Nf[Kb](z),w.ib),M=w.dg.mu(w.Nf[Kb](B),w.ib);if(h.abs(w.fa.fb(z)- w.fa.fb(B))-(F+M)/2<w.jP){c=null;break t}k?(ga(q)||c[C](jKa(d,q,e)),c[C](new cT(e,u,!0,!0,0,null))):(q=VJa(e,u,d.Nf[Kb](e)),c[C](q));q=e}else c[C](new cT(e,u,!1,!0,0,null))}k&&f<e&&(l=d,k=c,e=n,n=l.Nf[Kb](f),s=l.dg.mu(n,l.ib),q=e[I](),e=e.wg(),e=l.fa.fb(e),q=l.fa.fb(q),l=l.fa.fb(f),q=(e+q)/2,l-q>s/2&&k[C](dT(f,q,n)));if(d.HY){f=d;n=g;l=c;k=void 0;i:{for(k=l[J]-1;0<=k;k--)if(null!=l[k].sd()){k=l[k];break i}k=null}null!=k&&(l=f.dg.mu(k.sd(),f.ib),s=f.dg.mu(n.sd(),f.ib),h.abs(k[zy]()-n[zy]())-(l+s)/ 2<f.jP&&k.Zl(null));c[C](g)}g=c;for(n=f=0;n<g[J];n++)null!=g[n].sd()&&f++;if(2>f)c=d,d=c.Nf[Kb](c.fa.Sb()),g=c.Nf[Kb](c.fa.Zb()),d=d+Le+g,g=[],f=h.abs(c.fa.Zn()-c.fa.Dm()),c.dg.qc(d)>f+40||g[C](dT(ja,c.fa.Zn()+c.fa.Dm()/2,d)),c=g;else{i:{d=c;if(!(2>d[J]))for(g=d[0],f=1;f<d[J];f++){n=d[f];if(5>h.abs(n[zy]()-g[zy]())&&g[I]()!=n[I]()){d=!0;break i}g=n}d=!1}if(d){d=[];for(g=0;g<c[J];g++)f=c[g],f.zt&&!f.vw||d[C](f);c=d}}}}if(null!=c)return c}}return[]};function yT(a,b,c,d,e,f,g,k,l,n,q){e&&(e=c,c=d,d=e);if(a==b)return g=(d-c)/2+c,q=q[Kb](a),[dT(a,g,q)];a=1==f?new mT(a,b,c,d):new jT(a,b,c,d,f,g);if(a.Sb()==a.Zb())b=1;else{c=h.min(a.Zn(),a.Dm());d=h.max(a.Zn(),a.Dm());f=h.abs(a.bf(c));e=h.abs(a.bf(d));b=h.max(f,e);var s=0,u=a.fb(0);if(c>u||u>d)s=h.min(f,e);c=a.fb(s);b=a.fb(b);b=kKa(c,a)/kKa(b,a)}return(0.65<b?new lT(a,q,n,k,l):new oT(a,q,n,k,l,g)).cG()}function kKa(a,b){var c=b.bf(a),d=b.bf(a+10);return h.abs(d-c)};function zT(a,b){this.Ara=a;this.zra=b}zT[K].qc=function(a){return a[J]*this.Ara};Kw(zT[K],function(){return this.zra});zT[K].mu=function(a,b){return b==Jg?this.qc(a):this[ez](a)};function AT(a,b){this.JR=a;this.ta=b}AT[K].qc=function(a){return this.JR(a,this.ta)[r]};Kw(AT[K],function(a){return this.JR(a,this.ta)[A]});AT[K].mu=function(a,b){return b==Jg?this.qc(a):this[ez](a)};function lKa(a,b,c,d,e){this.VX=a;this.uO=b;this.N8=c;this.Mja=vn(d,e(eva));this.Oja=vn(d,e(gva));this.Nja=vn(d,e(fva));this.Lja=vn(d,e(dva));this.Kja=vn(d,e(bva));this.p6=vn(d,e(cva));this.Pja=vn(d,e(kva));this.L8=pn(d,e(Zua))}function mKa(a,b){return new lKa(nKa,oKa,pKa,a,b)} lKa[K].dga=function(a,b,c,d,e,f){var g,k;g=h[D](0.15*(b-a));a-=g;b+=g;k=dS(c,qKa,this.uO);c=dS((b-a)/this.Pja/2,this.VX,this.uO);var l=rKa(c);c=gS(l);g=a;a=this.N8[c];k=eS(k)<eS(l);a=sKa({Hh:g,Zi:b,oY:a[nc],t8:a[xz],u8:a.jx,pY:a.nu,Dta:Ai(a.nu),r8:this.Mja,Js:e.Js,gd:e.gd,s8:this.Kja,mY:[],q8:0},d,f);if(!(this.L8&&1==a[Cy]&&0<c&&k)){f=BT(this,e.gd,1==a[Cy]&&k?1:0,a.wb,a.UO);if(this.L8&&1<a[Cy]){if(a.vja/a[Cy]<this.Lja)d=[];else{e=e.Js;g=[];c=new fS(a.wb[0].ra,new Date(b),c,1);for(b=0;c.bx<c.Oz;)0!= b%a[Cy]&&(k=c[oc](),l=d(k[bc]()),g[C]({ra:k,aa:l,O:!0,brush:e,length:5})),b++;d=g}a=Xi(a.wb,d)}else a=a.wb;return{wb:a,aj:f}}c=this.N8[c-1];f=sKa({Hh:g,Zi:b,oY:c[nc],t8:c[xz],u8:c.kx,pY:c.lx,r8:this.Oja,Js:e.kK,gd:e.OD,s8:this.p6,mY:a.wb,q8:this.Nja},d,f);if(null==f)return d=BT(this,e.gd,2,a.wb,a.UO),{wb:a.wb,aj:d};d=BT(this,e.gd,1,a.wb,a.UO);e=BT(this,e.OD,1,f.wb,f.UO,d);a=Xi(f.wb,a.wb);f=Xi(d,e);return{wb:a,aj:f}}; function sKa(a,b,c){for(var d=Gi(a.u8,function(a){return new Go({pattern:a})}),e=0;e<a.pY[J];++e){var f=a.pY[e],g=0,k=mIa(a.t8,f),k=aS(new Date(a.Hh),k);4==a.oY&&(k=jIa(k));for(var l=new fS(k,new Date(a.Zi),a.oY,f),k=[],n=!0,q=b(a.Hh),s=-1;l.bx<l.Oz;){var u=l[oc](),w=b(u[bc]());-1==s&&w>=q&&(s=k[J]);var z=l.zO();if(null!=z){z=b(z[bc]());if(z<w+1)continue;if(z-w<a.r8){n=!1;break}}for(z=!1;g<a.mY[J];){var B=a.mY[g];if(h.abs(B.aa-w)<a.q8){z=!0;break}if(B.aa>w){g=h.max(0,g-1);break}g++}z||k[C]({ra:u, aa:w,O:!0,brush:a.Js,length:null})}if(n){1<s&&(k=$i(k,s-1));g=n=null;for(q=0;q<d[J];++q){s=d[q];u=!0;w=[];for(l=0;l<k[J];++l){var z=k[l],B=s.Ee(z.ra),F=c(B,a.gd)[r];if(l+1<k[J]&&k[l+1].aa-z.aa<a.s8+F){u=!1;break}w[C]({text:B,Oha:F})}if(u){n=q;g=w;break}}if(null!=n){a=ea;for(l=0;l<k[J]-1;++l)a=h.min(a,k[l+1].aa-k[l].aa);return{wb:k,UO:g,multiple:f,vja:a}}}}return null} function BT(a,b,c,d,e,f){var g=[];if(null!=f)for(var k=0;k<f[J];++k){var l=f[k].ma,n=l.F[0];g[C](tKa(n.x,n[J],l.Cc,a.p6))}a=1==c?nI:pD;f=0;k=[];l=2==c?d[J]-1:d[J];for(n=0;n<l;++n){var q=d[n];if(q.O&&e[n]){for(var s=h[D](2==c?(d[n+1].aa+q.aa)/2:q.aa),u=e[n].Oha,w=tKa(s,u,a),z=!0;f<g[J];){var B=g[f],F=w,M=B;if(h.max(F[y],M[y])<=h.min(F.end,M.end)){z=!1;break}if(B[y]>w.end){f=h.max(0,f-1);break}f++}z&&k[C]({ra:q.ra,O:!0,aa:s,ma:{text:e[n][cd],X:b,F:[{x:s,y:0,text:e[n][cd],length:u}],Cc:a,Bc:oE,xta:e[n][cd], anchor:null,Cb:0}})}}return k}function rKa(a){return Gi(a,function(a){return 0<a?1:0})}function tKa(a,b,c,d){d=Qh(d)?d:0;c==nI?(c=a,a=c+b):(c=h[D](a-b/2),a=h[D](a+b/2));return new zm(c-d,a+d)} var qKa=[[1],[50],[500],[0,1],[0,15],[0,30],[0,0,1],[0,0,15],[0,0,30],[0,0,0,1],[0,0,0,6],[0,0,0,12],[0,0,0,0,1],[0,0,0,0,7],[0,0,0,0,0,1],[0,0,0,0,0,3],[0,0,0,0,0,6],[0,0,0,0,0,0,1]],nKa=[[1],[2],[5],[10],[20],[50],[100],[200],[500],[0,1],[0,2],[0,5],[0,10],[0,15],[0,30],[0,0,1],[0,0,2],[0,0,5],[0,0,10],[0,0,15],[0,0,30],[0,0,0,1],[0,0,0,2],[0,0,0,3],[0,0,0,4],[0,0,0,6],[0,0,0,12],[0,0,0,0,1],[0,0,0,0,2],[0,0,0,0,7],[0,0,0,0,0,1],[0,0,0,0,0,3],[0,0,0,0,0,0,1],[0,0,0,0,0,0,10],[0,0,0,0,0,0,50],[0, 0,0,0,0,0,100]],oKa=3,pKa=[{index:0,duration:[1],jx:[Fg],nu:[1,5,10,50,100,500],kx:[Fg],lx:[1,5,10,50,100]},{index:1,duration:[0,1],jx:[Fg],nu:[1,5,10,15,30],kx:[sna],lx:[1,5,10,15]},{index:2,duration:[0,0,1],jx:[Eg],nu:[1,2,5,15,20,30],kx:[cB],lx:[1,2,5,15]},{index:3,duration:[0,0,0,1],jx:["h a"],nu:[1,2,6,12],kx:["h a"],lx:[1,2,6]},{index:4,duration:[0,0,0,0,1],jx:[uf,ng],nu:[1,2,7],kx:[ng],lx:[1,7]},{index:5,duration:[0,0,0,0,0,1],jx:["MMM y","MMM yy",RB],nu:[1,3,6],kx:[RB],lx:[1,3]},{index:6, duration:[0,0,0,0,0,0,1],jx:[Jh],nu:[1,2,5,10,20,50,100,200,500,1E3],kx:[Jh],lx:[1,2,5,10,20,50,100,200,500,1E3]}];function CT(a,b,c,d,e,f,g){this.CE=c;this.b=b;np(this,d);ab(this,Gn(b,this.Ha(Ah),eFa,e));this.Zi=this.Hh=null;this.XD=[];this.Bq=null;this.Iea=0<a.xf.bars;c=zn(b,this.Ha(HI));d={Va:a.Kj,fontSize:a.Nl,Tb:a.qD==mF?a.$u:R};d=Ln(b,this.Ha(JI),d);Ap(this,{text:c,X:d,cq:null,F:[],Cc:pD,Bc:nI,vb:O,anchor:null,Cb:0});this.aj=null;this.Sl=Gn(b,this.Ha(sAa),qP,XG);c={color:this[H]!=Dh||a.Wa==QH?zn(b,Wwa):zn(b,nxa),Va:a.Kj,fontSize:a.Nl,Tb:this.Sl==mF?a.$u:R};this.gd=Ln(b,this.Ha(EI),c);d=vn(b,this.Ha(iva)); d=Mm(this.gd[E],a.fK||te,d);this.OD=Ln(b,this.Ha(EI),c);Xa(this.OD,d);this.Pea=Gn(b,this.Ha(Gxa),jFa,ZAa);this.Z2=Gn(b,this.Ha(Iva),kFa,Twa);c=Cn(b,this.Ha(gra),a.lea);this.ZD=new Rm({fill:c});c=Cn(b,this.Ha($ua),a.T2);this.Js=new Rm({fill:c});this.Vo=vn(b,this.Ha(oxa),0);d=vn(b,this.Ha(hva));a=Mm(c,a.fK||te,d);a=Cn(b,this.Ha(AG),a);this.kK=new Rm({fill:a});this.Eo=2;this.Y2=h.max(this.Eo,h[D](this[uz].X[uc]/3.236));nw(this,[]);if(this.zi=g||b.R(this.Ha(GI)))this.zi=Gi(this.zi,function(a){var b={}; b.v=Qh(a.v)?a.v:a;bi(a.f)&&(b.f=a.f);return b});this.WD=0;this.Ol=sn(b,this.Ha(qg),1);Qv(this,this.Ol);this.Gh=this.hh=null;this.iz=this.pv=0;this.zb={min:-ea,max:ea};this.vq=null;this.$ea=f;f=XO(this.b,this.Ha(PF),this.Ha(PH));this.cfa=f===BG;this.Sy=f===OF||this.cfa;this[H]==Dh?(this.gT=this.Ed=this.ca=null,this.Pj=Gn(b,this.Ha(wAa),Dfa,tf),this.qK=ea):this.zi=null}T=CT[K];T.Ha=function(a){return KEa(this.CE,a)};function PS(a,b){di(b)&&0!==b&&!ga(b)&&(a.qK=h.min(h.abs(b),a.qK))} T.$A=function(a){this.ca.$A(this.qK/10,a||[])};function DT(a,b,c){var d=qS().Ug(b);a.Tw=tn(c,a.Ha(ava));var e=a.Dr(),e=!a.Sy&&In(c,rE)&&(!In(c,Vta)||An(c,a.Ha(Wta+e)));!a.zi&&(e||0>a.Tw||null===a.Tw&&a.Sy)&&(a.gT=!0,a.Tw=-1);d[Fc](c,a.CE,a.Tw);a.ca=d;a.dataType=b;a.Hh=d.R(c,a.Ha(Wg));a.Zi=d.R(c,a.Ha(Ug));a.Bq=c.R(a.Ha(LC),vFa.vAxis.gridlines.baseline)} function ET(a,b){a.vq=Hn(b,a.Ha(gJ),fFa);if(null===a.vq||a.vq==qE){if(a[H]==Dh){var c=a.ca,d=c.R(b,a.Ha(wBa));di(d)||(d=jP(c,c.R(b,a.Ha(fJ))));var e=c.R(b,a.Ha(vBa));di(e)||(e=jP(c,c.R(b,a.Ha(eJ))));null!=d&&(a.zb.min=d);null!=e&&(a.zb.max=e)}else a.zb.min=sn(b,a.Ha(fJ),a.zb.min),a.zb.max=sn(b,a.Ha(eJ),a.zb.max);a.zb.min>a.zb.max&&(c=a.zb.min,a.zb.min=a.zb.max,a.zb.max=c);a.vq=a.zb.min!=-ea||a.zb.max!=ea?qE:a.$ea;a[H]==Dh&&a.vq==qE&&(a.zb.min!=-ea&&(a.ca.jc=a.zb.min),a.zb.max!=ea&&(a.ca.ic=a.zb.max))}} function uKa(a){return a.vq==qE&&(a.zb.min==-ea||a.zb.max==ea)}function vKa(a){if(a[H]==Dh&&!a.ca)throw m("Axis type/data type mismatch for "+a.CE);} function wKa(a,b,c,d,e,f){a.hh=d+(1==a[jx]?0.5:-0.5);a.WD=c-1;a.Gh=d+c*a[jx];c=a.l8(b);d=!1;xKa(a)&&(pn(a.b,a.Ha(jva))||a.gT)&&(d=!0);b=d?yKa(a,b,e,f):zKa(a,b,e,f);return{title:a[uz],name:a.m8(),type:a[H],xo:a.Sy,dataType:a[yy],Ol:a.Ol,hh:a.hh,Gh:a.Gh,ke:{Se:W(a.i8,a),Bk:W(a.Po,a)},position:{Se:W(a.OG,a),Bk:W(a.A6,a)},VM:c,Ed:b.Ed,wb:b.wb,text:a.aj}} function zKa(a,b,c,d){a[H]==Dh?(AKa(a),a.zi?BKa(a):a.gT?xKa(a)?CKa(a,b):DKa(a,b):EKa(a)):FKa(a,b,a.WD+1);var e=GKa(a),f=null;if(a[H]==Dh){var f=Gi(a[wy],function(a){return{Q9:a,ra:a.ra,aa:a.aa,O:!0,length:null,brush:this.Js}},a),g;if(g=a.Sy?HKa(a,f):IKa(a,f))g=Gi(g,function(a){return{ra:this.A6(a),aa:a,O:!0,length:null,brush:this.kK}},a),Zi(f,g);Ei(f,function(a){if(a.aa*this[jx]<this.hh*this[jx]||FT(this,a.aa))a.O=!1,Wi(this[wy],a.Q9);delete a.Q9},a)}a.iV(b,c,d,null);a.hV(b);return{wb:f,Ed:e}} function yKa(a,b,c,d){GT(a);if(a.ca.jc>=a.ca.ic)return{wb:null,Ed:null};var e=GKa(a);cj(a.XD);for(var f=ea,g=1;g<a.XD[J];++g){var k=a.XD[g]-a.XD[g-1];k&&(f=h.min(f,k))}var g=mKa(a.b,W(a.Ha,a)),k={gd:a.gd,Js:a.Js,OD:a.OD,kK:a.kK},l=a[jx];Qv(a,1);var n=g.dga(a.ca.jc,a.ca.ic,f,W(a.se,a),k,b.Ac);Qv(a,l);-1===l&&(Ei(n.wb,function(a){a.aa=HT(this,a.aa)},a),Ei(n.aj,function(a){a.aa=HT(this,a.aa);a.ma.F[0].x=HT(this,a.ma.F[0].x)},a));var q=a.oL(b)[lz]===Eh;Ei(n.aj,function(a){a.ra=this.ca.Po(a.ra[bc]()); if(q){var b=a.ma.F[0].x;a.ma.F[0].x=a.ma.F[0].y;a.ma.F[0].y=b}},a);Ei(n.wb,function(a){a.ra=this.ca.Po(a.ra[bc]());if(a.aa*this[jx]<this.hh*this[jx]||FT(this,a.aa))a.O=!1,Wi(n.wb,a)},a);var s=nw(a,[]);Ei(n.aj,function(a){a.aa*this[jx]<this.hh*this[jx]||FT(this,a.aa)?Wi(n.aj,a):s[C]({ra:a.ra,aa:a.aa,text:a.ma[cd],O:a.O})},a);a.iV(b,c,d,n.aj);a.hV(b);return{wb:n.wb,Ed:e}} function FKa(a,b,c){var d;a.vq==qE?(a.zb.min==-ea?a.zb.min=h.min(0,a.zb.max-1):a.zb.max==ea&&(a.zb.max=h.max(b.Ba[J],a.zb.min+1)),d=a.zb.max-a.zb.min):(a.zb.min=0,a.zb.max=b.Ba[J],d=b.Ba[J]);a.Iea&&(d=h.min(d,h[t]((c+1)/2)));a[H]==mD&&(d=h.max(1,d-1));a.iz=JKa(a);a.pv=a.WD/d;nw(a,$O(b.Ba[J],function(a){var c=a-this.iz;return{ra:b.Ba[a][Z],aa:this.se(a),text:b.Ba[a].Ts[0],O:0<=c&&c<=d}},a))} function BKa(a){var b=a.ca;cj(a.zi,function(a,c){return b.K8(a.v,c.v)});0<a.zi[J]&&(a.fc(jP(b,a.zi[0].v)),a.fc(jP(b,a.zi[a.zi[J]-1].v)));GT(a);b.cH(b.jc,b.ic,!1);-1===a.Ol&&(a.zi=Yi(a.zi),a.zi[rx]());var c=Gi(a.zi,function(a){return jP(this.ca,a.v)},a);b.Ro(c);var d=kP(a.ca);nw(a,Gi(a.zi,function(a){var c=a.v,g=jP(b,c),g=this.se(g);a=a.f;bi(a)||(a=d.Ee(c));return{ra:c,aa:g,text:a,O:!0}},a))} function EKa(a){PEa(a.ca,a.Hh,a.Zi,a.vq==oH||uKa(a));a.Sy&&KKa(a);var b=a.ca[wy];uKa(a)&&(b=Fi(b,function(a){return a>=this.zb.min&&a<=this.zb.max},a));di(a.Tw)&&2>a.Tw&&(b=$i(b,0,a.Tw));a.ca.Ro(b);a.ca.pH();var c=kP(a.ca);GT(a);nw(a,Gi(a.ca[wy],function(a){var b=this.ca.Po(a),f=c.Ee(b);return{ra:b,aa:this.se(a),text:f,O:!0}},a))} function KKa(a){var b=ea,c=null,d,e=a.ca[wy],e=Gi(e,function(a){d=0<a-c?1:-1;a=d*h[t](d*a);c&&0!==a*c&&0<a-c&&(b=h.min(b,h.abs(a-c)));return c=a});b!==ea&&(c=null,Ei(e,function(a,g){null!==c&&(c===a&&Bi[he][L](e,g,1),h.abs(a-c)>b&&(d=0<a-c?1:-1,Ui(e,c+d*b,g+1)));c=a}));a.ca.Ro(e)} function CKa(a,b){GT(a);var c=a.ca,d=a.oL(b);c.cH(c.jc,c.ic,!1);var e=kP(c);e.Dk(a.Pj);var f=d.Jz,g=d.Iz-1,k=new AT(b.Ac,a.gd);if(d.eg)var l=f,f=g,g=l;d=(new wT(new mT(c.jc,c.ic,f,g),a.Pj,k,e,10,d[lz],!1)).cG();nw(a,[]);for(e=0;e<d[J];e++)f=d[e],f.sd()&&a[wy][C]({ra:c.Po(f[I]()),aa:f[zy](),text:f.sd(),O:!0})} function IKa(a,b){if(!b||1>=b[J]||0==a.Vo)return null;var c=(b[1].aa-b[0].aa)/(a.Vo+1),d=[],e,f,g=b[0].aa;for(e=f=h[t]((g-a.hh)/c);0<e;e--){var k=h[t](g-c*e);1<h.abs(k-a.hh)&&d[C](k)}for(e=0;e<b[J]-1;e++)for(g=b[e].aa,f=0;f<a.Vo;f++)g+=c,d[C](h[t](g));g=Ai(b).aa;f=h[t]((a.Gh-g)/c);for(e=1;e<=f;e++)k=h[t](g+c*e),1<h.abs(k-a.Gh)&&d[C](k);return d} function HKa(a,b){if(!b||1>=b[J]||0==a.Vo)return null;for(var c=b[0],d=c.ra,e=d,f=[c],g=1;g<b[J]-1;g++)c=b[g],e=d,d=c.ra,0!==d&&(UO(d)||e&&UO(e/d))&&f[C](c);f[C](b[b[J]-1]);b=f;if(1>=b[J])return null;var k=b[1].aa-b[0].aa,c=[],d=[],l;a.Vo=h.min(sFa[J],a.Vo);e=sFa[a.Vo-1];a.Vo=e[J];for(g=0;g<a.Vo;g++)f=h.log(e[g])/h.log(10),d[C](f);for(g=0;g<b[J]-1;g++)if(e=b[g].aa,f=1,k=b[g+1].ra/b[g].ra,!(0>k)&&UO(k))for(1>k&&(f=-1,e=b[g+1].aa),k=b[g+1].aa-b[g].aa,l=0;l<a.Vo;l++)c[C](e+f*k*d[l]);return c} function GKa(a){var b=null;a[H]==Dh&&a.Ed&&(b={ra:a.Ed.ra,aa:a.Ed.aa,O:!0,length:null,brush:a.ZD});return b}function AKa(a){null!=a.Bq&&a.Bq!==eg&&a.fc(jP(a.ca,a.Bq));null!=a.Hh&&a.fc(jP(a.ca,a.Hh));null!=a.Zi&&a.fc(jP(a.ca,a.Zi))} function GT(a){var b=xj(a.zb.min)?a.zb.min:a.ca.jc,c=xj(a.zb.max)?a.zb.max:a.ca.ic;b===c&&(b-=1,c+=1);a.pv=a.WD/(c-b);b!==ea&&(a.iz=b);if(Qh(a.Bq)&&a.Bq!==eg)b=jP(a.ca,a.Bq);else{var d=jP(a.ca,a.ca.jZ()),b=nj(d,b,c);xj(b)||(b=0)}a.Ed=null;xj(b)&&(c=a.se(b),ga(c)||(a.Ed={ra:a.ca.Po(b),aa:c}))} function DKa(a,b){if(a.vq==oH&&na(a.ca.jc)&&na(a.ca.ic)){var c=uT(new zm(a.ca.jc,a.ca.ic),0.1);a.fc(c[y]);a.fc(c.end)}GT(a);var c=a.oL(b),d=a.ca.eA.inverse(a.ca.jc),e=a.ca.eA.inverse(a.ca.ic);PS(a,d);PS(a,e);var f=a.Sy?0:1,g=new AT(b.Ac,a.gd),k,l=a.b;k=new ZS;var n=An(l,a.Ha(JE));In(l,a.Ha(uua));var q=tn(l,a.Ha(LE)),s=An(l,a.Ha(KE)),u=An(a.b,a.Ha(ME));n||q||s||u?k.AV={pattern:n,scaleFactor:q,prefix:s,suffix:u}:(n=tn(l,a.Ha(vua)),di(n)&&$S(k,n),n=tn(l,a.Ha(wua)),di(n)&&aT(k,n),(n=l.R(a.Ha(xua)))&& k.mE({symbol:n.symbol,position:n[jc],usePadding:n.usePadding}),pn(l,a.Ha(yua))&&bT(k));k=k.jq();l=[];xj(d)&&(l=yT(d,e,c.Jz,c.Iz-1,c.eg,f,a.qK,c[lz],40,g,k));nw(a,[]);for(c=0;c<l[J];c++)d=l[c],e=d[I](),f=a.ca.eA[Sz](e),a[wy][C]({ra:e,aa:a.se(f),text:d.sd(),O:!0})}T.fc=function(a){this[H]==Dh&&null!=a&&QS(this,a)&&(this.ca.fc(a),this.XD[C](a))};function LKa(a){if(a[H]==Dh){var b=a.ca,c=0.01*(b.ic-b.jc);0<b.jc&&a.zb.min==-ea&&(b.jc=h.max(b.jc-c,0));0>b.ic&&a.zb.max==ea&&(b.ic=h.min(b.ic+c,0))}} T.se=function(a){return null!=a?this.hh+(a-this.iz)*this[jx]*this.pv:null};function HT(a,b){if(null==b)return null;Qv(a,1);var c=null!=b?(b-a.hh)*a[jx]/a.pv+a.iz:null;Qv(a,-1);return a.se(c)}T.i8=function(a){return this[H]==Dh?jP(this.ca,a):a};T.Po=function(a){return null!=a?this[H]==Dh?this.ca.Po(a):a:null};T.A6=function(a){a=null!=a?(a-this.hh)*this[jx]/this.pv+this.iz:null;return null!=a?this.Po(a):null};T.OG=function(a){return this.se(this.i8(a))}; function JKa(a){switch(a[H]){case lD:return a.zb.min-0.5}return a.zb.min}function QS(a,b){return a[H]==Dh?b>=a.zb.min&&b<=a.zb.max:b>=h[t](a.zb.min)&&b<h[xb](a.zb.max)}function FT(a,b){return b*a[jx]>a.Gh*a[jx]}function xKa(a){return null!=a.ca&&(a.ca instanceof mS||a.ca instanceof rS)};function MKa(a,b,c,d,e,f,g,k,l,n){this.g$=a;this.Mf=b;this.boa=c;this.ina=d;this.Iba=e;this.RR=f;this.vla=g;this.ula=k;this.tla=l;this.e$=n}function NKa(a,b,c,d){switch(d){case $qa:return(b-1-a)%c;default:return a}}function IT(a,b,c){b=h[xb]((a.Mf[J]-0)/(b*c));return 2>a.Mf[J]||2>b} function OKa(a,b,c,d,e){b=NKa(b,a.Mf[J],d,a.vla);for(var f=1>=a.Mf[J]?a.g$:h.abs(a.Mf[1].aa-a.Mf[0].aa)*d-a.ula,g=[];b<a.Mf[J];b+=d){var k=a.Mf[b],l=k.O&&!a.tla?h.min(f,2*k.aa,2*(a.g$-k.aa)):f,n=a.e$(k[cd],l,e),q=n.ge;l<f&&(q=a.e$(k[cd],f,e).ge);g[C]({ra:k.ra,O:k.O,aa:k.aa,U4:c,text:k[cd],width:n.Kg,layout:n,ge:q})}return g}function PKa(a,b,c,d){var e=b*c;d=1<b?1:d;for(var f=[],g=0;g<b;g++){var k=OKa(a,a.boa+g*c,g*d,e,d);Zi(f,k)}cj(f,function(a,b){return a.aa-b.aa});return f} function JT(a,b,c){a=PKa(a,b,c,a.ina);return Hi(a,function(a,b){return{yt:h.max(a.yt,b[tx].F[J]),ge:a.ge||b.ge}},{yt:0,ge:!1})}function KT(a){for(var b=1,c=a.RR||1,d=JT(a,b,c),e=b;d.ge&&b<a.Iba;){b++;if(IT(a,b,c))break;e=b;d=JT(a,e,c)}b=c;if(!a.RR)for(;d.ge;){c++;if(IT(a,e,c))break;b=c;d=JT(a,e,b)}return{pV:e,ow:b,yt:d.yt*e}}function LT(a,b,c,d,e){a=PKa(a,b,c,d);e=Hi(a,function(a,b){var c=b.ge?1:0;delete b.ge;return a+c},0)<=a[J]*e;return{jM:a,Ica:e}} function QKa(a,b,c,d,e){var f=h.min(a.Iba,d);b=h.min(b,f);c=a.RR||c;for(var g=LT(a,b,c,d,e),k=b;!g.Ica&&b<f;){b++;if(IT(a,b,c))break;k=b;g=LT(a,k,c,d,e)}f=c;if(!a.RR)for(;!g.Ica;){c++;if(IT(a,k,c))break;f=c;g=LT(a,k,f,d,e)}return{pV:k,ow:f,jM:g.jM}};function MT(a,b,c,d,e,f,g){CT[L](this,a,b,Xi([lva+d,VE],c),d,e,f,g);a=this.Ha(Tza);this.QU=b.R(a,null,on);a=vn(b,this.Ha(Uza),30);if(0>a||90<a)a=30;this.Dha=a;this.bN=qj(a);this.p4=vn(b,this.Ha(jua));this.q4=vn(b,this.Ha(gxa),ea);this.xU=vn(b,this.Ha(exa),2);this.zL=vn(b,this.Ha(Kza),0);this.tU=Gn(b,this.Ha(Lza),qFa,ara);this.r4=vn(b,this.Ha(mxa),this.gd[uc]);this.o4=pn(b,this.Ha(vqa),!1)}X(MT,CT);T=MT[K];T.m8=function(){return mva+this[nc]}; T.hX=function(a,b,c){return wKa(this,a,a.A[r],1==this[jx]?a.A[G]:a.A[Zc],b,c)}; T.iV=function(a,b,c,d){if(0==this[nc]){var e=a.Ac,f=this.gd[uc],g=this[uz].X[uc],k=b.ta[uc],l=a.qD==XG?this[uz][cd]:O,n=this,q=new MKa(a[r],this[wy],this.p4,this.q4,this.xU,this.zL,this.tU,this.r4,this.o4,function(a,b,c){return UN(e,a,n.gd,b,c)}),s=this.zL||1,u,w;if(this.Sl==XG&&!d)if(null!=this.QU)this.QU?w=NT(this,e):u=KT(q);else if(this[wy][J]*f/(this.xU*s)<=a[r]){if(u=KT(q),u.ow>s||0==u.yt)w=NT(this,e),u=null}else w=NT(this,e);var z=UN(e,l,this[uz].X,a.A[r],ea),B=this.Eo,F=h.max(B,h[D](f/1.618)), M=h.max(B,h[D](f/3.236)),N=function(){return{key:GI,min:w.minHeight+B,max:w.maxHeight+B,Tc:[F-B]}},P=[];P[C]({key:XC,min:B,Tc:[ea]});0<z.F[J]&&P[C]({key:HI,min:g+B,Tc:[ea]});b[zy]()==WC&&P[C]({key:DF,min:k+B,Tc:[ea]});c[zy]()==WC&&P[C]({key:MD,min:c[ez]()+B,Tc:[ea]});var ba=P[J];d||u&&0<u.yt?P[C]({key:GI,min:f+B,Tc:[F-B]}):w&&P[C](N());var U=P[J];if(u)for(var qa=1;qa<u.yt;qa++)P[C]({key:GI,min:f+B,Tc:[M-B]});f=P[J];for(qa=1;qa<z.F[J];qa++)P[C]({key:HI,min:g+B,Tc:[this.Y2-B]});var g=bP(P,a[A]-a.A[Hc]), ya=g[wy]||[],Ha;u&&(Ha=QKa(q,u.pV,u.ow,ya[J],0),null==this.QU&&Ha.ow>s&&(Ha=u=null,w=NT(this,e),P[ba]=N(),P=IEa(P,0,U,f,void 0),g=bP(P,a[A]-a.A[Hc])));var Aa=a.A[Hc],ya=g[wy]||[];if(0<ya[J]){for(qa=1;qa<ya[J];qa++)ya[qa]+=ya[qa-1];if(d){q=Aa+ya[0];for(qa=0;qa<d[J];qa++)s=d[qa].ma,Zw(s,s[Gz]||new uP(0,0)),s[Gz].y=q;this.aj=d}else u?this.aj=Gi(Ha.jM,function(a){var b=Gi(a[tx].F,function(b,c){return{x:0,y:ya[a.U4+c],length:a[r],text:b}},this);return{ra:a.ra,O:a.O,ma:{text:a[cd],X:this.gd,F:b,Cc:pD,Bc:oE, vb:a[tx].ge?a[cd]:O,anchor:new uP(a.aa,Aa),Cb:0}}},this):w&&(qa=ya[0],d=h.min(qa-B,w.maxHeight),this.aj=RKa(this,e,Aa+qa-d,d,w.ow));Aa+=Ai(ya)}d=g[uz]||[];if(0<d[J])for(q=UN(e,l,this[uz].X,a.A[r],d[J]),this[uz].vb=q.ge?l:O,qa=0;qa<d[J];qa++)Aa+=d[qa],this[uz].Bc=oE,this[uz].F[C]({x:a.A[G]+a.A[r]/2,y:Aa,length:a.A[r],text:q.F[qa]});l=g.legend||[];0<l[J]&&(Aa+=l[0],b.Go(new rl(Aa-k,a.A[Zc],Aa,a.A[G])));b=g.colorBar||[];0<b[J]&&(Aa+=b[0],a=new rl(Aa-c[ez](),a.A[Zc],Aa,a.A[G]),c.Go(a))}}; function NT(a,b){function c(a){a=b(a[cd],d)[r]*f+e*g;return h[xb](a)}var d=a.gd,e=d[uc],f=h.sin(a.bN),g=h.cos(a.bN),k=a.zL;k||(k=2>a[wy][J]?1:h[xb]((e+a.Eo)/f/h.abs(a[wy][1].aa-a[wy][0].aa)));for(var l=0,n=0;n<a[wy][J];n+=k)l=h.max(c(a[wy][n]),l);n=c({text:Ne});return{minHeight:h.min(l,n),maxHeight:l,ow:k}} function RKa(a,b,c,d,e){var f=a.gd[uc],g=h.sin(a.bN),k=NKa(0,a[wy][J],e,a.tU);d=(d-f*h.cos(a.bN))/g;d=h[t](d);for(var l=[];k<a[wy][J];k+=e){var n=a[wy][k],q=UN(b,n[cd],a.gd,d,1),s={text:n[cd],X:a.gd,F:[],Cb:-a.Dha,Cc:oE,Bc:nI,vb:q.ge?n[cd]:O,anchor:new uP(n.aa-0.5*g*f,c)};0<q.F[J]&&s.F[C]({x:0,y:0,length:d,text:q.F[0]});l[C]({ra:n.ra,O:n.O,ma:s})}return l} T.hV=function(a){if(0==this[nc]){var b=a.Ac,c=this.gd[uc],d=new MKa(a[r],this[wy],this.p4,this.q4,this.xU,this.zL,this.tU,this.r4,this.o4,W(function(a,c,d){return UN(b,a,this.gd,c,d)},this)),e;this.Sl==mF&&(e=KT(d));var f=this.Eo,g=h.max(this.Eo,h[D](c/3.236)),k=h.max(this.Eo,h[D](c/1.618)),k=this[H]==Dh?g:k,l=h.max(f,h[D](c/3.236)),n,q;this[H]==Dh?this.Z2==aF?(n=nI,q=g):(n=oE,q=-g):(n=pD,q=0);g=[];g[C]({key:OI,min:f,Tc:[ea]});if(e)for(var s=0;s<e.yt;s++)g[C]({key:GI,min:c+f,Tc:[(0==s?k:l)-f]});var u= bP(g,h[t](a.A[A]/2))[wy]||[];if(0<u[J]){for(s=1;s<u[J];s++)u[s]+=u[s-1];c=QKa(d,e.pV,e.ow,u[J],0.5);this.aj=Gi(c.jM,function(b){var c=b[tx].F;c[rx]();c=Gi(c,function(a,c){return{x:0,y:-u[b.U4+c],length:b[r],text:a}},this);return{ra:b.ra,O:b.O,ma:{text:b[cd],X:this.gd,F:c,Cc:n,Bc:nI,vb:b[tx].ge?b[cd]:O,anchor:new uP(q+b.aa,a.A[Hc]),Cb:0}}},this)}}};T.oL=function(a){var b={};b.eg=-1==this[jx];b.Jz=a.A[G];b.Iz=a.A[Zc];Mw(b,this.Dr());return b};T.Dr=function(){return Jg}; T.l8=function(a){return 0==this[nc]?{aa:a.A[Hc],direction:-1}:{aa:a.A.top,direction:1}};function SKa(a){return new kK(h[D](a.x),h[D](a.y))}function TKa(a){return Hi(arguments,lK,new kK(0,0))}function UKa(a){return Hi(arguments,function(a,c){return new xk(a[r]+c[r],a[A]+c[A])},new xk(0,0))}function OT(a,b,c){return new kK(h.cos(a)*b,h.sin(a)*c)}function VKa(a){return new kK(a[0],a[1])}function WKa(a,b){return Gi([[a.x-b[r]/2,a.y-b[A]/2],[a.x+b[r]/2,a.y-b[A]/2],[a.x+b[r]/2,a.y+b[A]/2],[a.x-b[r]/2,a.y+b[A]/2]],VKa)} function XKa(a,b,c,d){return new vl(h.min(a,c),h.min(b,d),h.abs(c-a),h.abs(d-b))};function PT(a,b,c,d,e,f,g){CT[L](this,a,b,Xi([mBa+d,Ls],c),d,e,f,g);this[H]==Dh&&Qv(this,-this[jx])}X(PT,CT);T=PT[K];T.m8=function(){return nBa+this[nc]};T.hX=function(a,b,c){return wKa(this,a,a.A[A],1==this[jx]?a.A.top:a.A[Hc],b,c)}; T.iV=function(a){var b=a.Ac,c=this.gd[uc],d=this[uz].X[uc],e=a.qD==XG?this[uz][cd]:O,f=this.Eo,g=Hi(this[wy],function(a,c){return h.max(a,b(c[cd],this.gd)[r])},0,this),k=b(Ne,this.gd)[r],k=h.min(k,g),l=UN(b,e,this[uz].X,a.A[A],ea),n=[];this.Sl==XG?n[C]({key:GH,min:f,Tc:[c-f]}):n[C]({key:GH,min:0,Tc:[ea]});0<l.F[J]&&n[C]({key:HI,min:d+f,Tc:[ea]});this.Sl==XG&&n[C]({key:GI,min:k+f,max:g+f,Tc:[ea]});for(c=1;c<l.F[J];c++)n[C]({key:HI,min:d+f,Tc:[this.Y2-f]});var d=bP(n,0==this[nc]?a.A[G]:a[r]-a.A[Zc]), q=0==this[nc]?0:a[r],l=d[uz]||[];if(0<l[J])for(n=UN(b,e,this[uz].X,a.A[A],l[J]),1===this[nc]&&n.F[rx](),this[uz].vb=n.ge?e:O,c=0;c<l[J];c++)q+=l[c]*(0==this[nc]?1:-1),this[uz].Cb=-90,this[uz].Bc=0==this[nc]?oE:nI,this[uz].F[C]({x:q,y:a.A.top+a.A[A]/2,length:a.A[A],text:n.F[c]});if(this.Sl==XG){var e=d[wy][0]||0,q=q+e*(0==this[nc]?1:-1),s=h.min(g,e-f);this.aj=s<k?[]:Gi(this[wy],function(b,c){var d=0==this[nc]?oE:nI,e=pD;this.Pea==nra&&(0==c&&(e=1==this[jx]?nI:oE),c==this[wy][J]-1&&(e=1==this[jx]?oE: nI));return YKa(this,a,b,q,s,d,e,0)},this)}}; T.hV=function(a){var b=a.Ac,c=this.gd[uc],d=this.Eo,e=h.max(this.Eo,h[D](c/3.236)),c=h.max(this.Eo,h[D](c/1.618)),c=this[H]==Dh?e:c,f,g;this[H]==Dh?this.Z2==aF?(f=oE,g=e):(f=nI,g=-e):(f=pD,g=0);var e=Hi(this[wy],function(a,c){return h.max(a,b(c[cd],this.gd)[r])},0,this),k=b(Ne,this.gd)[r],k=h.min(k,e),l=[];l[C]({key:GH,min:d,Tc:[ea]});this.Sl==mF&&l[C]({key:GI,min:k+d,max:e+c,Tc:[]});var c=bP(l,a.A[r]/2),n=0==this[nc]?a.A[G]:a.A[Zc];if(this.Sl==mF){var c=c[wy][0]||0,q=h.min(e,c-d),n=n+(c-q)*(0==this[nc]? 1:-1);this.aj=Gi(this[wy],function(b){return YKa(this,a,b,n,q,0==this[nc]?nI:oE,f,g)},this)}};function YKa(a,b,c,d,e,f,g,k){b=UN(b.Ac,c[cd],a.gd,e,1);var l=Gi(b.F,function(a){return{x:0,y:0,length:e,text:a}},a);return{ra:c.ra,O:c.O,ma:{text:c[cd],X:a.gd,cq:null,F:l,Cc:f,Bc:g,vb:b.ge?c[cd]:O,anchor:new uP(d,c.aa-k),Cb:0}}}T.oL=function(a){var b={};b.eg=-1==this[jx];b.Jz=a.A.top;b.Iz=a.A[Hc];Mw(b,this.Dr());return b};T.Dr=function(){return Eh}; T.l8=function(a){return 0==this[nc]?{aa:a.A[G],direction:1}:{aa:a.A[Zc],direction:-1}};function QT(a,b,c,d,e){this.Eq=this.tM=this.rT=this.Te=this.Xc=this.Re=this.kg=this.sb=null;this.Zv=1;this.KM=null;WS[L](this,a,b,c,d,e)}X(QT,WS);T=QT[K]; Ma(T,function(){var a=this[eq];this.As=Hn(a,MI,Nn)!=R;this.L.Fh=Gn(a,CE,oFa,WD);if(this.L.Fh==lD&&this.L.Wa!=Bg)throw m("Focus target "+this.L.Fh+" is not supported for the chosen chart type.");this.L.Uc=pn(this[eq],Pva);this.L.Wa==cD?this.Eq=new OS(this.Nb,this[eq],this.Ac,this.L):(this.sb=a.R(ND,tP),ZKa(this));a=0<this.L.xf.bars||0<this.L.xf.area||0<this.L.xf.steppedArea;this.L.Dd=pn(this[eq],tF)&&a;this.L.S2=pn(this[eq],Hza,!1);a=this.L;switch(a.Wa){case Bg:case cF:Mw(a,Gn(this[eq],WG,pP,O));if(!a[lz])throw m("Unspecified orientation."); this.Te={};this.kg={};this.Re={};var b,c,d,e;switch(a[lz]){case Jg:d=MT;e=this.kg;b=PT;c=this.Re;break;case Eh:d=PT,e=this.Re,b=MT,c=this.kg}for(var f=this.rT.La(),g=0;g<f[J];++g){var k=f[g],l=new b(a,this[eq],[oAa+k,fia],k,Dh,oH);if(l[H]!=Dh)throw m("Target-axis must be of type value");this.Te[k]=l;c[k]=l}var n;a.Wa===cF&&(n=a.k[0].fd.histogramBuckets);b=d;c=this[eq];if(this.Nb.D(0)==rh)i:{switch($Ka(this)){case BC:d=1<this.L.Ba[J]?mD:lD;break i;case JF:case KC:case qI:case jD:d=lD;break i}d=null}else d= Dh;this.Xc=new b(a,c,[qha],0,d,rG,n);e[0]=this.Xc;break;case QH:case cD:this.kg={0:new MT(a,this[eq],[],0,Dh,oH)},this.Re={0:new PT(a,this[eq],[],0,Dh,oH)}}aLa(this);QT.e[Fc][L](this)}); function ZKa(a){var b=a.L,c=a.Nb,d=b.Wa==QH?function(){return QH}:b.Wa===cF?function(){return KC}:W(function(a){return Gn(this[eq],ZH+a+Vma,bFa,b.eT)},a),d=b.Uc?bLa(c,d,b.Wa):cLa(c,d);b.Ba=[];b.eq={};for(var e=d.Tj,f=0;f<c.M();f++){var g=c.cn(f),k=c[I](f,0),l=Gi(e,function(a){return c.Aa(f,a.oa[$y][0])||O}),k={data:k,Ts:l,Bs:g};if(l=e[0].oa.tooltip)k.de=RT(a,l[0],f);b.Ba[C](k);b.eq[g]=f}b.k=[];for(f=0;f<d.TU[J];f++)e=dLa(a,f,d.TU[f]),b.k[C](e),Kj(c.Sq(f))||(b.k[f].fd=c.Sq(f));b.hq=d.K4;b.Tj=d.Tj; b.Ns=d.Ns;b.eE={};b.xf={};a.rT=new ck;a.tM=[];for(f=0;f<b.k[J];++f){d=b.k[f];a.rT.add(d.ee);e=b.eE[d.ee];if(null==e)b.eE[d.ee]=d[yy];else if(e!=d[yy])throw m("All series on a given axis must be of the same data type");b.xf[d[H]]=(b.xf[d[H]]||0)+1;e=a.tM[d.ee]||{};a.tM[d.ee]=e;e[d[H]]=(e[d[H]]||0)+1}} function eLa(a){var b={},c=a.L;c.dn=[];var d=W(function(a){var d=c.k[a];if(c.Uc&&d[H]===QH){var g=[this[eq].R(cE,0.5),this[eq].R(bE,1)],k=d[E][E];c.dn[C]({id:d.id,text:d.zk,brush:new Rm({gh:{lg:k,Tf:k,Wy:g[0],Xy:g[1],x1:QA,y1:PA,hb:PA,kb:PA,sv:!0,uK:!0}}),index:a,O:d.Oj})}else g=new Rm({fill:d[E][E]}),d.HD&&g.dh(d.HD),c.dn[C]({id:d.id,text:d.zk,brush:g,index:a,O:d.Oj});b[a]=!0},a);Y(c.k,function(a,c){b[c]||(d(c),null!=a.tD&&d(a.tD))},a);c.Uc&&c.k[0][H]===KC&&c.dn[C]({id:-1,text:$oa,brush:new Rm({fill:rFa[E]}), index:-1,O:!0})} function fLa(a,b){function c(a){return a=864E5*a+e}function d(a){a-=e;return a/864E5}for(var e=(new Date(1900,0,1,0,0,0))[bc](),f=new wo(ula),g=new lEa(function(a){return f[Kb](a)}),k=a.L,l=k.Wa==QH?QH:JF,n=0,q=k.k[J],s=0;s<q;s++){var u=k.k[s],w=VAa+s+Me;if(null!=In(a[eq],VAa+s)){n++;var z=Gn(a[eq],w+Ah,ZEa,MF),B=a[eq].R(w+KD,Gna),F=B===Gna;F&&(B=u.fh.gb());var F=xn(a[eq],[w+bh,bh],F?0.5:1),M=vn(a[eq],[w+jH,jH],0),N=0<M;0>=M&&(M=6);M/=2;0<M&&(M+=1);var P={};null!=u.oa[Z]&&ra(P,u.oa[Z]);var ba=vn(a[eq], [w+LF,LF],2);Gn(a[eq],w+RD,rP,R);pn(a[eq],w+hJ,!1);var B=NS(B),z=$Ea[z],U=a.kg[0],qa=a.Re[0];if(k[lz]===Eh)var ya=U,U=qa,qa=ya;if(U[H]===Dh){var Ha=U.ca,Aa=qa.ca,Wc=u.oa[Z][0],cb=kj,kc=kj;0<b.M()&&$h(b[I](0,0))&&(cb=d,kc=c);U={min:cb(Ha.jc),max:cb(Ha.ic)};z=z(b.M(),function(a){a=b[I](a,0);a=lP(Ha,a);return cb(a)},function(a){return lP(Aa,b[I](a,Wc))},{range:U,jz:sn(a[eq],w+ata,3)});if(null!==z){U=zn(a[eq],w+HI,g.B(z.$s.Qk())||zpa+n);qa=Gi(z[Z],function(a){var b=kc(a[0]),b=null!=b?Ha.xE(b):null;a= a[1];a=null!=a?Aa.xE(a):null;return[b,a]});u.tD=k.k[J];ya=$m(B[E],ba);Sm(ya,F);var kd=Zm(B[E]);kd.dh(F);var Mb=zn(a[eq],w+AF,U);pn(a[eq],w+Gza,!1)&&(Mb+=me+g.B((new MO([new oP([new mP(fh),new PO(2)]),new PO(z.So)])).Qk()));k.k[C]({id:u.id+Spa,title:U,Eg:!0,data:qa,dataType:u[yy],O:!0,Bs:0,oa:P,J3:s,He:u.He,ef:null,color:B,HD:F,fh:kd,$d:ya,Yu:null,FD:null,type:l,pD:sn(a[eq],w+BBa,0),lineWidth:ba,Pc:M,V2:12,av:Gn(a[eq],w+RD,rP,R),gK:vn(a[eq],[w+iI,iI],1),dK:N,j:[],JS:[],ee:u.ee,Oj:pn(a[eq],w+hJ,!1), zk:Mb})}}}}} function cLa(a,b){for(var c=[],d=[],e=null,f=null,g=0,k=[],l=0;l<a.H();++l){var n=a.D(l),q=a.Li(l,ih)||(0==l?Lr:Jr);if(0==l&&q!==Lr)throw m(xoa);if(q==Lr){if(0<g)throw m(Fpa+l+Ge);e={oa:{},dataType:n};f={kc:null,He:d[J]};d[C](e)}0==g&&q===Jr&&(f=c[J],g=b(f),e={type:g,dataType:n,oa:{}},f={kc:f,He:null},c[C](e),g=g===jD?4:1);if(q===Jr&&(g--,n!==e[yy]))throw m(Yna);if(q===Hs&&e.oa[q])throw m(Voa);e.oa[q]=e.oa[q]||[];k[C]({kc:f.kc,He:f.He,Iv:q,Uy:e.oa[q][J]});e.oa[q][C](l)}if(0<g)throw m(Ooa+g+Ge);e= 0;n=d[0][yy];for(l=0;l<c[J];++l){if(d[J]<=e)throw m("Series #"+l+ila);q=d[e+1];f=c[l].oa[Z];if(q&&q.oa[$y][0]<=f[0]&&(++e,n!==d[e][yy]))throw m(Zna);c[l].He=e}return{TU:c,Tj:d,Ns:n,K4:k}}function gLa(a,b){if(a!==b)throw m("Column types must be consistent: equal for domain columns and for columns in the same serie.");} function bLa(a,b,c){var d=[],e=[],f=null,g=[];if(c===QH){for(var k=a.H()-2,l=function(a){if(a!==Jr&&a!==RG)throw m("All columns must be either data or old-data columns");},n={data:null,"old-data":null},f=a.D(0),q=0;2>q;++q){var s=a.D(q);c=a.Li(q,ih);l(c);gLa(f,s);s={oa:{},dataType:s};s.oa.domain=[q];e[C](s);n[c]=q;g[C]({He:q,Iv:Lr,Uy:0,kc:null})}for(q=0;q<k;++q){var u=2+q,s=a.D(q);c=a.Li(q,ih);l(c);q%2&&gLa(d[q-1][yy],s);var w=n[c],s={type:b(q),dataType:s,He:w,oa:{}};s.oa[c]=[u];d[C](s);g[C]({He:w, Iv:c,Uy:0,kc:q})}}else if(c===Bg){k=f=null;for(q=l=0;q<a.H();++q){s=a.D(q);c=a.Li(q,ih)||(0===q?Lr:Jr);if(0===q&&c!==Lr)throw m(xoa);if(c===Lr){if(0<l)throw m(Fpa+q+Ge);f={oa:{},dataType:s};k={kc:null,He:e[J]};e[C](f)}0!==l||c!==Jr&&c!==RG||(k=d[J],l=b(k),f={type:l,dataType:s,oa:{}},k={kc:k,He:null},d[C](f),l=l===jD?4:c===RG?2:1);if(c===Jr||c===RG)if(l--,s!==f[yy])throw m(Yna);if(c===Hs&&f.oa[c])throw m(Voa);f.oa[c]=f.oa[c]||[];g[C]({kc:k.kc,He:k.He,Iv:c,Uy:f.oa[c][J]});f.oa[c][C](q)}if(0<l)throw m(Ooa+ l+Ge);a=0;f=e[0][yy];for(q=0;q<d[J];++q){if(e[J]<=a)throw m("Series #"+q+ila);b=e[a+1];c=d[q].oa[RG]||d[q].oa[Z];if(b&&b.oa[$y][0]<=c[0]&&(++a,f!==e[a][yy]))throw m(Zna);d[q].He=a}}return{TU:d,Tj:e,Ns:f,K4:g}}T.RE=function(a){a=a.oa[RG];return null!=a&&0<a[J]}; function dLa(a,b,c){var d=c[H],e=c.oa,f=c.He,g=a[eq],k=ZH+b+Me,l=e[Z]||e[RG],n=a.Nb.jF(l[0]),q=a.Nb.cb(l[0])||O,s=d==QH?0:2,u=vn(g,[k+jH,jH],d==QH?7:0),w=d==JF||d==BC||d==QH?0<u:!0;0==u&&(u=d==QH?7:6);u/=2;0<u&&(u+=1);b=g.R(k+KD,a.sb[(a.L.Uc&&d==QH?h[t](b/2):b)%a.sb[J]]);b=NS(b);var z=null;if(d==BC||d==qI)z=xn(g,[k+CC,CC]),z=Zm(b[E],z);var B=null;if(d==jD)var B=new Rm({stroke:b[E],qa:2,fill:b[E]}),F=new Rm({stroke:b[E],qa:2,fill:te}),M=pn(g,xra),N=M?B:F,B={I3:Jn(g,[k+yra,yra],M?F:B),H3:Jn(g,[k+wra, wra],N)};s=vn(g,[k+LF,LF],s);F=$m(b[E],s);if(M=g.R([k+Jwa,Jwa],null,rn))F.Hk=M;M=vn(g,[k+Usa,Usa],1);N=null;if(d===QH||d===JF||d===BC)N=In(g,[k+$xa,$xa],{type:ED}),bi(N)&&(N={type:N});var P=null;if(a.L.Uc&&d===QH){var ba=a.RE(c),M=ba?a[eq].R(cE,0.5):a[eq].R(bE,1);ba&&(P=!1)}ba=d==qI?z:Zm(b[E],M);if(a.L.Uc)if(d===KC)var U=g.R(ita,rFa),U=NS(U),U={background:{fh:Zm(U[E],M)}};else d===QH&&a.RE(c)&&(w=!1);var qa=hLa(a,e,g,k,b);return{id:a.Nb.jf(l[0]),title:q,dataType:c[yy],O:!0,Bs:n,oa:e,He:f,ef:qa,color:b, HD:M,fh:ba,$d:F,oD:N,eh:U,Yu:z,FD:B,type:d,pD:sn(g,k+BBa,0),lineWidth:s,Pc:u,V2:12,av:Gn(g,[k+RD,RD],rP,R),gK:vn(g,[k+iI,iI],1),dK:w,j:[],JS:[],ee:vn(g,[k+AI,AI],0),Oj:null!=P?P:pn(g,k+hJ,!0),zk:zn(g,k+AF,q)}} function hLa(a,b,c,d,e){function f(a,b){return g(a,b)[Ab]([d+b,b])}function g(a,b){return[d+Nva+a+Me+b,d+Ova+b,Nva+a+Me+b,Ova+b]}var k=b[xx];if(!k)return null;b={Eb:[],Kw:[],tN:[],j:[],areas:[],F:[],ND:{}};for(var l={},n=0;n<k[J];n++){var q=k[n],s=a.Nb.jf(q)||a.Nb.cb(q)||ZD,u=Hn(c,g(s,sh),cFa);switch(u){case KC:b.Eb[C](q);break;case dAa:b.Kw[C](q);break;case qra:b.tN[C](q);break;case lH:b.j[C](q);break;case BC:b[Qz][C](q);break;case JF:b.F[C](q);break;case R:break;default:throw m("Invalid interval style: "+ u);}s in l?l[s][C](q):l[s]=[q]}1<b.Eb[J]&&0==b.Kw[J]&&(b.Kw=[b.Eb[0],b.Eb[b.Eb[J]-1]]);if(0!=b.Kw[J]%2)throw m("Stick-intervals must be defined by an even number of columns");if(0!=b[Qz][J]%2)throw m("Area-intervals must be defined by an even number of columns");for(s in l){u=vn(c,g(s,LF));n=xn(c,g(s,iua));q=Dn(c,g(s,KD),Hj(dFa),O);q=ST(q,e);n=new Rm({stroke:q,fill:q,ae:n,qa:u});q=vn(c,g(s,fra));a=vn(c,g(s,Cza));var k=vn(c,g(s,pra)),w=vn(c,g(s,jH)),u=Hn(c,g(s,sh),cFa),z=pn(c,f(s,qF)),B=Gn(c,f(s,RD), rP,R),F=vn(c,f(s,iI),1),u={style:u,brush:n,Sha:q,Uha:a,Tha:k,KD:w,Lj:z,av:B,gK:F};a=l[s];for(n=0;n<a[J];++n)q=a[n],b.ND[q]=u}return b}function $Ka(a){var b=[JF,BC,qI,KC,jD],c={};Y(b,function(a,b){c[a]=b});a=Hi(a.L.k,function(a,b){return h.max(a,c[b[H]])},0);return b[a]} function aLa(a){var b=a.L;switch(b.Wa){case QH:case cD:if(b.Ns==rh)throw m("X values column cannot be of type string");var c=b.eE[0];if(c==rh)throw m("Data column(s) cannot be of type string");var d=a.kg[0],e=a.Re[0];if(d[H]!=Dh)throw m("The x-axis must be of type value");DT(d,b.Ns,a[eq]);if(e[H]!=Dh)throw m("The y-axis must be of type value");DT(e,c,a[eq]);break;case Bg:case cF:c=a.Xc;if(c[H]==Dh){if(b.Ns==rh)throw m("Domain column cannot be of type string, it should be the X values on a continuous domain axis"); DT(c,b.Ns,a[eq])}Dj(a.Te,function(a,c){var d=b.eE[c];if(d==rh)throw m("Data column(s) for axis #"+c+" cannot be of type string");DT(a,d,this[eq]);d=this.tM[c];null===a.Bq&&(0<d.bars||0<d.area||0<d.steppedArea)&&(a.Bq=0)},a)}Dj(a.kg,function(a){vKa(a)});Dj(a.Re,function(a){vKa(a)})} function iLa(a){if(null===TT(a))return[];for(var b=(a.L.Tj[0].oa[$y]||[])[0],c=[],d=null,e=a.Nb,f=0;f<e.M();f++){var g=e[I](f,b),k=UT(a,f);if(null!==d&&null!=k){if(0>k)throw m("Invalid gap value ("+k+") in data row #"+f+". Gap value must be non-negative.");c[C]({wc:d,xe:g,wia:k})}d=g}return c}T.u6=function(){return this.Eq&&this.Eq.Do==Yg?null:null!=this.Re[0]&&null!=this.Re[1]?NI:null!=this.Re[1]?Qg:zs};T.t6=function(){return this.Eq&&this.Eq.Do==Yg?NI:null}; function VT(a){var b=a.oa[Z];return b?b[0]:a.oa[RG][0]}function jLa(a){for(var b=a.L,c=a.Nb,d=a.Xc,e=0;e<b.Ba[J];e++){for(var f=0;f<b.k[J];f++){var g=b.k[f],k=a.Te[g.ee],g=c[I](e,VT(g)),g=lP(k.ca,g);null!=g&&PS(k,g)}d[H]==Dh&&(f=c[I](e,0),f=lP(d.ca,f),PS(d,f))}}function kLa(a){var b=a.L,c=a.Nb,d=a.kg[0];a=a.Re[0];for(var e=0;e<c.M();e++)for(var f=0;f<b.k[J];f++){var g=b.k[f],k=VT(g),g=c[I](e,b.Tj[g.He].oa[$y][0]),k=c[I](e,k),g=lP(d.ca,g),k=lP(a.ca,k);null!=g&&PS(d,g);null!=k&&PS(a,k)}} T.s6=function(){var a=this.L;lLa(this);(a.Dd||a.Uc||a.Wa===cF)&&Dj(this.Te,function(a){a.fc(0)});if(a.Wa===Bg||a.Wa===cF)jLa(this),this.Xc[H]==Dh&&this.Xc.$A(iLa(this)),ET(this.Xc,this[eq]),Dj(this.Te,function(a){a.$A();ET(a,this[eq])},this);else{var b=this.kg[0],c=this.Re[0];a.Wa==cD?tJa(this.Eq,b,c):a.Wa==QH&&kLa(this);b.$A();ET(b,this[eq]);c.$A();ET(c,this[eq])}a.xf.bars&&mLa(this,KC);if(a.xf.steppedArea){if(this.Xc[H]==Dh)throw m("Stepped area series with value domain axis is not supported."); mLa(this,qI)}a.xf.candlesticks&&nLa(this);a.xf.line&&(oLa(this),pLa(this));a.xf.area&&qLa(this);a.xf.scatter&&(rLa(this),pLa(this));a.xf.bubbles&&uJa(this.Eq,this.kg[0],this.Re[0],this.fj);(a.xf.bars||a.xf.candlesticks)&&a.Wa!==cF&&this.Xc&&this.Xc[H]==Dh&&sLa(this);a.Be=Ej(this.kg,function(a){return a.hX(this.L,this.kf,this.fj)},this);a.be=Ej(this.Re,function(a){return a.hX(this.L,this.kf,this.fj)},this);tLa(this);uLa(this);vLa(this);(a.Wa===Bg&&a[lz]===Jg||a.xf.bars)&&wLa(this);var b=this.kf[zy](), c=this.kf.ta[uc],d=null;b!=zs&&b!=BF||null!=this.Re[1]||(d=new rl(a.A.top,a[r]-c,a.A[Hc],a.A[Zc]+c));b!=Qg||null!=this.Re[0]||(d=new rl(a.A.top,a.A[G]-c,a.A[Hc],c));d&&d[Zc]>=d[G]&&this.kf.Go(d);xLa(this);yLa(this);this.Eq||(fLa(this,this.Nb),eLa(this),zLa(this))}; function lLa(a){var b=a.L,c=a.Ac,d=Gj(a.kg)[uz].X,e=h.max(b[uz].X[uc],d[uc]),f=a.kf.ta[uc],g=a.kf[zy](),k=a.fj.ta[uc],l=a.fj[zy](),n=b.Iy==mF?b[uz][cd]:O,q=O,s=O;if(b.qD==mF){var u=function(a){var b=Ij(a);cj(b);b=Gi(b,function(b){return a[b][uz][cd]});return Fi(b,function(a){return a!=O})[ie](Ke)};switch(b.Wa){case QH:case cD:q=u(a.kg);s=u(a.Re);break;case Bg:q=u({0:a.Xc}),s=u(a.Te)}}var q=q&&s?q+cla+s:q?q:s?s:O,s=h.max(2,h[D](e/1.618)),w=h.max(2,h[D](f/1.618)),z=h.max(2,h[D](k/1.618)),B=b.A[r]-2* s,k=UN(c,n,b[uz].X,B,1),u=0<k.F[J]?k.F[0]:O,F=c(u,b[uz].X)[r],M=h[D](h.max(2,1.618*e)),B=h.max(B-F-M,0),c=UN(c,q,d,B,1),M=0<c.F[J]?c.F[0]:O,N=[];N[C]({key:XC,min:2,Tc:[ea]});(u||M)&&N[C]({key:HI,min:e+2,Tc:[s-2]});g==mF&&N[C]({key:DF,min:f+2,Tc:[w-2]});l==mF&&N[C]({key:MD,min:a.fj[ez]()+2,Tc:[z-2]});g=bP(N,h[t](b.A[A]/2));e=b.A.top;l=g[uz]||[];0<l[J]&&(e+=l[0],u&&(b[uz].F[C]({text:u,x:b.A[G]+s,y:e,length:F}),b[uz].vb=k.ge?n:O),M&&(b.JD={text:q,X:d,cq:null,F:[],Cc:oE,Bc:oE,vb:c.ge?q:O,anchor:null, Cb:0},b.JD.F[C]({text:M,x:b.A[Zc]-s,y:e,length:B})));d=g.legend||[];0<d[J]&&(e+=d[0],a.kf.Go(new rl(e-f,b.A[Zc],e,b.A[G])));f=g.colorBar||[];0<f[J]&&(e+=f[0],b=new rl(e-a.fj[ez](),b.A[Zc],e,b.A[G]),a.fj.Go(b))}function mLa(a,b){var c=a.L;c.Uc?ALa(a,b):BLa(a,b,c.Dd)}function sLa(a){var b=a.Xc,c=Fi(a.L.Ba,function(a,b){return 0!=UT(this,b)},a),d=ea,e;Y(c,function(a){a=jP(b.ca,a[Z]);Qh(e)&&(d=h.min(d,h.abs(a-e)));e=a},a);xj(d)&&(a=d/2,b.fc(b.ca.jc-a),b.fc(b.ca.ic+a))} function BLa(a,b,c){var d=a.L,e=a.Nb,f=a.Xc,g=a.L.Wa===cF,k=(d.A[A]-1)/CLa(c,d,e);a.L.ov=g&&DLa(k,pn(a[eq],dF));for(var l=0;l<d.Ba[J];l++)for(var k=0==UT(a,l),n=Ej(a.Te,function(){return[0,0]}),q=-1,s=0;s<d.k[J];s++){var u=d.k[s];if(u[H]==b){q++;!1==c&&(n[u.ee]=[0,0]);var w=u.j;if(k)w[C](null);else{var z=u.ee,B=a.Te[z],F=e[I](l,u.oa[Z][0]),F=jP(B.ca,F),M=WT(a,l);f.fc(M);var N=0<F?0:1,P=n[z];QS(f,M)&&(c?B.fc(F+P[N]):B.fc(F));c||(a.Zv=h.max(a.Zv,q+1));var z=function(a,b,c,d){b={Cf:{Dq:l,Fv:b,Rj:c,Ck:a+ (d||g?P[N]:0),Jk:M,zE:XT(this,u,l,P[N],!0)}};null==a&&(b.Ae=!0);u[H]==qI&&(c=w[J],b.Cf.g4=0!=c&&w[c-1]?w[c-1].Cf.Ck:null);YT(this,b,u,s,l);w[C](b);P[N]+=a},B=c?0:q,ba=c||g?P[N]:null;if(g&&!a.L.ov)for(var U=0;U<F;U++)ba=c||g?P[N]:null,z[L](a,1,B,ba,c);else z[L](a,F,B,ba,c)}}}c||Dj(a.Te,function(a){LKa(a)})} function ALa(a,b){for(var c=a.L,d=a.Nb,e=a.Xc,f=Fi(c.k,function(a){return a[H]==b}),g=0;g<c.Ba[J];++g){var k=0==UT(a,g),l=WT(a,g);e.fc(l);for(var n=QS(e,l),q=[RG,Jr],s=0;s<f[J];++s){var u=f[s];if(k){u.j[C](null);return}for(var w=a.Te[u.ee],z=w.ca,B=0;B<q[J];++B){var F=q[B],M=d[I](g,u.oa[F][0]),M=jP(z,M);if(null===M){u.j[C](null);return}n&&w.fc(M);a.Zv=h.max(a.Zv,s+1);F={brush:F==RG?u.eh[Dz].fh:null,Cf:{Dq:g,Fv:s,Rj:null,Ck:M,Jk:l,aga:F==Jr,zE:XT(a,u,g,0,!0)}};YT(a,F,u,s,g);u.j[C](F)}}}Dj(a.Te,function(a){LKa(a)})} function nLa(a){var b=a.L,c=a.Nb,d=a.Xc,e=Fi(b.k,function(a){return a[H]==jD});Y(b.Ba,function(a,b){var k=0==UT(this,b);Y(e,function(a,e){if(k)a.j[C](null);else{var f=a.oa[Z],s=this.Te[a.ee];this.Zv=h.max(this.Zv,e+1);var u=c[I](b,f[0]),w=c[I](b,f[1]),z=c[I](b,f[2]),f=c[I](b,f[3]),u=jP(s.ca,u),w=jP(s.ca,w),z=jP(s.ca,z),f=jP(s.ca,f);if(null===u||null===f||null===w||null===z)a.j[C](null);else{var B=WT(this,b);d.fc(B);var F=z<w;QS(d,B)&&(s.fc(u),s.fc(f));s={Jy:F?a.FD.H3:a.FD.I3,$d:Zm(a[E][E]),Cf:{Dq:b, Fv:e,dha:u,lineTo:f,eha:F?z:w,fha:F?w:z,cha:F,Jk:B}};YT(this,s,a,e,b);a.j[C](s)}}},this)},a)}function ELa(a,b){var c=a.L,d=a.Nb,e=a.Xc,f=c.k[b];if(f[H]==JF)for(var c=f.Eg?f[Z]:c.Ba,g=0;g<c[J];g++){var k=a.Te[f.ee],l=f.oa[Z][0],l=f.Eg?f[Z][g][1]:d[I](g,l),l=jP(k.ca,l),n;if(null!=l){var q=WT(a,g,f);e.fc(q);(n=QS(e,q)&&!f.Eg)&&k.fc(l);k=f.Eg?null:XT(a,f,g,0,n)}else n=!1,k=null;k={Cf:{Dq:g,Fv:0,Jk:q,Vv:l,zE:k},shape:f.oD,x4:n};null==l&&(k.Ae=!0);YT(a,k,f,b,g);f.j[C](k)}} function oLa(a){for(var b=a.L,c=0;c<b.k[J];c++)ELa(a,c);FLa(a);ZT(a)}function FLa(a){for(var b=a.Xc,c=a.L.k,d=0;d<c[J];d++){var e=c[d];if((e[H]==JF||e[H]==BC)&&0!=e[Ny]){var f=a.Te[e.ee],g=Gi(e.j,function(a){return!a||a.Ae?null:new sk(a.Cf.Jk,a.Cf.Vv)}),k=a.L.Lj,e=gP(g,JKa(b),k),l;t:{switch(b[H]){case mD:l=b.zb.max-1;break t;case lD:l=b.zb.max-0.5;break t}l=b.zb.max}k=gP(g,l,k);f.fc(e);f.fc(k)}}} function qLa(a){for(var b=a.L,c=a.Nb,d=a.Xc,e=b.Lj,f=0;f<b.Ba[J];f++)for(var g=Ej(a.Te,function(){return 0}),k=Pj(g),l=Pj(g),n=0;n<b.k[J];n++){var q=b.k[n];if(q[H]==BC){var s=q.ee,u=a.Te[s],w=null,z=null,B=q.oa[Z][0],F=c[I](f,B),F=jP(u.ca,F),M=WT(a,f),N;if(null==F||ga(F))b.Dd&&(w=k[s],z=g[s]),s={B4:M,C4:w,z4:M,A4:z,G4:M,H4:z,D4:M,E4:w},N=!1;else{var P,ba;N=0<f?c[I](f-1,B):null;var U=f<c.M()-1?c[I](f+1,B):null;b.Dd?(B=F+l[s],w=k[s],z=g[s],P=k[s]+F,ba=g[s]+F,f==c.M()-1||null!==U&&!ga(U)?k[s]+=F:P=k[s], 0==f||null!==N&&!ga(N)?g[s]+=F:ba=g[s]):(P=ba=B=F,f==c.M()-1||null!==U&&!ga(U)?P=B:e||(P=null),0==f||null!==N&&!ga(N)?ba=B:e||(ba=null));d.fc(M);(N=QS(d,M))&&u.fc(B);u=XT(a,q,f,l[s],N);b.Dd&&(l[s]=B);s={Jk:M,Vv:B,Dq:f,Fv:0,G4:M,H4:ba,D4:M,E4:P,B4:M,C4:w,z4:M,A4:z,zE:u}}s={Cf:s,shape:q.oD,x4:N};YT(a,s,q,n,f);if(null==F||ga(F))s.Ae=!0;q.j[C](s)}}FLa(a);ZT(a)}function zLa(a){Y(a.L.k,function(a,c){a.Eg&&(a[H]===QH?GLa(this,c):a[H]===JF&&ELa(this,c),HLa(this,c))},a)} function GLa(a,b){var c=a.L,d=a.Nb,e=a.kg[0],f=a.Re[0],g=c.k[b],k=g.He;if(g[H]===QH)for(var l=g.Eg?g[Z][J]:d.M(),n=0;n<l;n++){var q=c.Tj[k].oa[$y][0],s=VT(g),q=g.Eg?g[Z][n][0]:d[I](n,q),u=g.Eg?g[Z][n][1]:d[I](n,s),s=jP(e.ca,q),q=jP(f.ca,u);if(null===s||null===q)g.j[C](null);else(u=QS(e,s)&&QS(f,q))&&!g.Eg&&(e.fc(s),f.fc(q)),s={Cf:{x:s,y:q},shape:g.oD,bga:u},YT(a,s,g,b,n),g.j[C](s)}}function rLa(a){for(var b=a.L,c=0;c<b.k[J];c++)GLa(a,c);ZT(a)} function ZT(a){function b(a){return!(!a||a.Ae)}for(var c=W(function(a){var b=null!=a.Cf?a.Cf.Dq:null;return{Qv:null!=a.Qv?a.Qv:1,lw:null!=a.lw?a.lw:1,scope:null!=a[yz]?a[yz]:!0,Qia:null!=b?UT(this,b):null}},a),d=null===TT(a),e=0;e<a.L.k[J];e++){var f=a.L.k[e],g=f.Yu,k=f.oa.emphasis||[],l=f.oa[yz]||[];if(0!=(f.oa.certainty||[])[J]||0!=k[J]||0!=l[J]||!d)for(var k=Qi(f.j,b),n=c(k||{}),l=0;l<f.j[J];l++){var q=f.j[l];if(q&&!q.Ae){var s=c(q),u=f.$d;s[yz]||n[yz]||(f.N7=f.N7||u.lF(),u=f.N7,q.kw=u,g&&(f.M7= f.M7||g.lF(),q.QS=f.M7));if(1>s.Qv||1>n.Qv)u=$T(u,!1),q.kw=u;1!=s.lw&&1!=n.lw&&(n=h.min(n.lw,s.lw),u=ILa(u,n),q.kw=u);0==s.Qia&&k&&!k.Ae&&(q.kw=null);n=s}k=q}}}function JLa(a){var b={fill:{},stroke:{}};null!=a&&(null!=a[E]&&Xa(b[fc],Xa(b[Yb],a[E])),null!=a[Kd]&&mb(b[fc],mb(b[Yb],a[Kd])),null!=a[lx]&&Xa(b[fc],a[lx]),null!=a.fillOpacity&&mb(b[fc],a.fillOpacity),null!=a[Ax]&&Xa(b[Yb],a[Ax]),null!=a.strokeOpacity&&mb(b[Yb],a.strokeOpacity),null!=a.strokeWidth&&pa(b[Yb],a.strokeWidth));return b} function KLa(a,b,c){var d=void 0;b=null!=b.oa[x]?b.oa[x][0]:void 0;if(null!=b&&a.Nb.D(b)===rh&&(a=a.Nb[I](c,b),null!=a)){var e,d=pi(a);if(qm(d))e={fill:{color:d},stroke:{color:d}};else if(d[Bb](0)===Lh){try{var f=eo(d)}catch(g){}null!=f&&(e=f)}null==e&&(ri(d,Lh)?(e=Ej(qJa(d),JLa),O in e&&(Sj(e,e[O]),Lj(e,O)),He in e&&(Sj(e,e[He]),Lj(e,He))):e=JLa(bm(d)));d=e}if(null!=d)return new jn([d])} function YT(a,b,c,d,e){a.As&&(b.de=LLa(a,c,d,e));var f=KLa(a,c,e);d=MLa(a,c,e);var g=NLa(a,c,e);a=OLa(a,c,e);e=c.fh;if(null!=f){e=e.o();var k=function(a,b){var c=b||O;a.pe(Cn(f,[c+fua,c+zE],a.gb()));a.dh(xn(f,c+gua,a.Oe));a.dd(Cn(f,[c+gAa,c+uI],a.Qd));Sm(a,xn(f,c+hAa,a.Ai));a.yk(sn(f,c+iAa,a.Hb))};k(e);switch(c[H]){case JF:case QH:case BC:k(e,Zxa);Xh(f.R(JF,null))&&null!=c.$d&&(b.kw=c.$d.o(),k(b.kw,KF));Xh(f.R(BC,null))&&null!=c.Yu&&(b.QS=c.Yu.o(),k(b.QS,Xqa));break;case qI:Xh(f.R(JF,null))&&k(e, KF);case KC:k(e,era);break;case jD:b.Jy=b.Jy.o(),k(b.Jy),k(b.$d),k(b.Jy,era),k(b.$d,KF)}b.brush=e}k=CS(b,c);a||(b.scope=a,c.Z7=c.Z7||e.lF(),e=c.Z7,b.brush=e);1!=g&&(b.lw=g,c[H]==JF||c[H]==BC||c[H]==QH)&&(k=h[D](k*h[ud](g)*10)/10,Jw(b,k));if(1>d)switch(b.Qv=d,c[H]){case JF:case BC:case QH:b.brush=$T(e,!0);Jw(b,h.max(k-Um(b.brush)/2,0));break;case KC:case qI:b.brush=$T(e,!1)}}function LLa(a,b,c,d){c=a.ZT(b,c,d);var e=b.oa.tooltip;e&&!b.Eg&&(a=RT(a,e[0],d))&&Sj(c,a);c.am=!!c.am;return c} function RT(a,b,c){var d=a.Nb;a=a.L.Ls&&(d.Ao(c,b,Mg)||d.Li(b,Mg));b=d.Aa(c,b);return{am:!!a,ti:b?!0:!1,content:b}} T.ZT=function(a,b,c){if(this.L.Wa===QH||a.Eg){var d=this.Nb,e=this.L,f,g,k,l;if(a.Eg)f=a[Z][c][0],g=a[Z][c][1],null!=f&&(f=Po(f,d.D(a.He))),null!=g&&(g=Po(g,a[yy])),k=e.Fh===lD?g:f+Ke+g,l=f;else if(this.L.Uc){var n=this.kg[0][uz][cd]||hC,q=this.Re[0][uz][cd]||Kpa;k=b%2?b-1:b;b=e.k[k];k=e.k[k+1];f=e.Tj[k.He].oa[$y][0];g=VT(k);f=d.Aa(c,f);g=d.Aa(c,g);k=n+bB+f+Ke+q+bB+g;f=e.Tj[b.He].oa[$y][0];g=VT(b);f=d.Aa(c,f);g=d.Aa(c,g);k+=me+n+bB+f+Ke+q+bB+g}else f=e.Tj[a.He].oa[$y][0],g=VT(a),f=d.Aa(c,f),g=d.Aa(c, g),k=f+Ke+g;a={ti:!1,content:k,$l:a[uz],gv:l}}else a=PLa(this,a,c);return a}; function PLa(a,b,c){var d=a.Nb,e=a.L.Ba[c],e=b.Eg?b[Z][c][0][hc]():e.Ts[b.He];if(b[H]==jD){var f=b.oa[Z];a=d.Aa(c,f[0])+Uz+d.Aa(c,f[3])+Ke+d.Aa(c,f[1])+Uz+d.Aa(c,f[2])}else if(a.L.Uc){var g=b.oa[RG],f=b.oa[Z],k=a.Nb[I](c,g[0]);a=a.Nb[I](c,f[0]);g=d.Aa(c,g[0]);f=d.Aa(c,f[0]);if(null===k&&li(g)&&null===a&&li(f))return{ti:!1,content:null};a=f+me+g}else{f=b.oa[Z];k=b.Eg?b[Z][c][1]:a.Nb[I](c,f[0]);a=b.Eg?b[Z][c][1][hc]():a.Nb.Aa(c,f[0]);if(null===k&&li(a))return{ti:!1,content:null};k=b.oa[xx]||[];k[J]&& (k=Gi(k,function(a){return d.Aa(c,a)}),a+=rga+k[ie](Ke)+$f)}return{ti:!1,content:a,gv:e,$l:b[uz],am:!1}} function pLa(a){function b(a){return{Jk:a.x,Vv:a.y}}function c(a){return new kK(a.Jk,a.Vv)}function d(a){return{x:a.x,y:a.y}}function e(a){return new kK(a.x,a.y)}var f=a.L,g=a.Xc,k=W(function(a,b,c){b.bga&&(this.kg[0].fc(c.x),this.Re[0].fc(c.y))},a);a=W(function(a,b,c){g.fc(c.Jk);b.x4&&this.Te[a.ee].fc(c.Vv)},a);var l,n,q;switch(f.Wa){case QH:l=e;n=d;q=k;break;case Bg:l=c,n=b,q=a}for(k=0;k<f.k[J];k++)if(a=f.k[k],a[H]==QH||a[H]==JF)if(Ri([Bg,Sxa,ID],a.av)){var s=a[H]==QH&&a.av==ID,u=a.av==Bg;a.QV= !0;a.Hga=s;s=YO(Gi(a.j,function(a){return!a||a.Ae?null:l(a.Cf)}),a.gK,u,s,f.Lj);for(u=0;u<a.j[J];++u){var w=a.j[u];if(s[u]){var z=n(s[u][0]),B=n(s[u][1]);w.v5=z;w.w5=B;q(a,w,z);q(a,w,B)}}}else a.QV=!1} function uLa(a){if(a.L.Fh==lD){var b=a.Xc,c=fj(a.L.Ba[J]);dj(c,W(function(a,b){return bj(aU(this,a),aU(this,b))},a));var d=b.hh,e=b.Gh;if(d>e)var f=d,d=e,e=f;for(var g,k,f=0;f<c[J];f++){var l=c[f];k=aU(a,l);if(null!=k){if(FT(b,k))return;if(!(k*b[jx]<b.hh*b[jx])){g=f;break}}}if(Qh(g))for(var n=d,q,d=null,f=g;f<c[J];f++){null!=d&&f<d&&(f=d,d=null);l=c[f];g=n;if(f==c[J]-1){bU(a,l,g,e);break}q=aU(a,c[f+1]);if(null==q){for(n=f+2;n<c[J];n++)if(q=aU(a,c[n]),null!=q){d=n;break}if(null==q){bU(a,l,g,e);break}}if(FT(b, q)){bU(a,l,g,e);break}n=vj(k,q);bU(a,l,g,n);k=q}}}function aU(a,b){var c=a.L.Ba,d=a.Xc;return d[H]==Dh?null!=c[b][Z]?d.OG(c[b][Z]):null:d.se(b)}function bU(a,b,c,d){function e(){var a=c;c=d;d=a}var f=a.L.A.top,g=a.L.A[Hc],k=a.L.A[G],l=a.L.A[Zc],n=a.Xc[jx];b=a.L.Ba[b];a.L[lz]==Jg?1==n?(d<c&&e(),b.kP=new rl(f,d,g,c)):(d>c&&e(),b.kP=new rl(f,c,g,d)):1==n?(d<c&&e(),b.kP=new rl(c,l,d,k)):(d>c&&e(),b.kP=new rl(d,l,c,k))} function xLa(a){var b=a.L;Dj(b.be,function(a,d){cU(this,this.Re[d],b.be[d],this.kna)},a);Dj(b.Be,function(a,d){cU(this,this.kg[d],b.Be[d],this.jna)},a)}function yLa(a){var b=a.L;Dj(b.Be,function(a,d){cU(this,this.kg[d],b.Be[d],this.Mna)},a)}function cU(a,b,c,d){c[cd]&&Bw(c,Fi(c[cd],W(d,a,b)))}T.jna=function(a,b){var c=this.L,d=b.ma;return d.Cb?!0:(d=OQ(d))?a.Sl!=mF||(new rl(c.A.top,c.A[Zc],c.A[Hc],c.A[G]))[Lc](d)?!0:!1:!0}; T.Mna=function(a,b){var c=this.L;if(a.Sl!=mF)return!0;var d=b.ma;if(d.Cb)return!0;var e=OQ(d);if(!e)return!0;var d=d.X[uc]/2,f=new rl(e.top,e[Zc]+d,e[Hc],e[G]-d),g;for(g in c.be){var k=ia(g);if(this.Re[k].Sl==mF&&!(1>(c.be[k][cd]?c.be[k][cd][J]:0))){var l=OQ(c.be[k][cd][0].ma),n=OQ(Ai(c.be[k][cd]).ma);if(l||n){if(l&&ul(f,l)||n&&ul(f,n))return!1;l?n?(k=h.min(l[G],n[G]),l=h.max(l[Zc],n[Zc])):(k=l[G],l=l[Zc]):(k=n[G],l=n[Zc]);if(h.abs(e[G]-k)<d||h.abs(e[Zc]-l)<d)return!1}}}return!0}; T.kna=function(a,b){var c=this.L,d=new rl(c.A.top,c.A[Zc],c.A[Hc],c.A[G]),e=b.ma,f=e.X[uc]/2,e=OQ(e);if(!e)return!0;if(a.Sl==mF&&!d[Lc](e))return!1;d=new rl(e.top,e[Zc]+f,e[Hc],e[G]-f);return(f=OQ(c[uz]))&&ul(d,f)||(c=c.JD?OQ(c.JD):null)&&ul(d,c)?!1:(c=this.kf.getArea())&&ul(d,c)?!1:!0}; function wLa(a){var b=a.L,c=a.Xc,d=a[eq],e={Va:b.Kj,fontSize:b.Nl,Tb:b.$u},f=Ln(d,[Tqa,yC],e),g=Jn(d,[Qqa,Jqa]),k=Cn(d,[Rqa,Vqa],O),l=Gn(d,[Sqa,Wqa],sP,HF);Y(a.L.Ba,function(a,d){var e=[],n=[];Y(b.Tj,function(a){a=this.iK(d,a.oa,l);Zi(e,a.FL);Zi(n,a.line)},this);if(e[J]||n[J]){var q=WT(this,d),q=c.se(q),s=b.A.top+b.A[A];e[J]&&(s={x:q,y:s},a.Jc=QLa(this,s,R,O,!1,this.L[lz],e,f,g,5,k));n[J]&&(s={x:q,y:null},a.Jc=RLa(this,s,n,f,k))}},a);var n=Hj(dFa),q=pn(d,[Mqa,Uqa],!0),s=pn(d,[Kqa,Iqa],!1),u=lfa(d, [Pqa,yC],n,e),w=Jn(d,[Lqa,Jqa]),z=Dn(d,[Nqa,Vqa],n,O),B=Gn(d,[Oqa,Wqa],sP,HF);Y(a.L.k,function(a,b){if(a[H]==BC||a[H]==KC||a[H]==JF||a[H]==QH){var c=ZH+b+Lma,e=pn(d,c+ova,q),f=pn(d,c+wqa,s),g=lfa(d,c+EI,n,u);Xa(g,ST(g[E],a[E]));var k=Jn(d,[c+ora],w),l=Dn(d,c+cAa,n,z),l=ST(l,a[E]);Gn(d,c+sh,sP,B);for(c=0;c<a.j[J];++c)if(null!=a.j[c]&&null!=a.j[c].S){var Ha=a.j[c],Aa=this.iK(c,a.oa,B),Wc=Ha.S,cb=a[E][E][ke](),Ha=Ha.brush?Ha.brush.gb():cb;if(Ha!==cb&&e){var cb=Pj(g),kc=[0.1,0.2,0.3],kd=rm(Ha),Mb=rm(this.L.nD.gb()), Oc=Gi(kc,gi(wm,kd)),kc=Gi(kc,gi(xm,kd)),kd=pm(ym(Mb,Xi([kd],Oc,kc)));Xa(cb,kd)}else cb=g;Aa.FL[J]&&(a.j[c].Jc=QLa(this,Wc,a[H],Ha,this.L.Dd,this.L[lz],Aa.FL,cb,k,12,l,e,f));Aa.line[J]&&(a.j[c].Jc=RLa(this,Wc,Aa.line,g,l))}}},a)}T.iK=function(a,b,c){var d=this.Nb,e=b.annotation,f={line:[],FL:[]};if(null==e)return f;b=b.annotationText||[];for(var g=0;g<e[J];++g){var k=e[g],l=k+1,n=0<=Ci(b,l);d[I](a,k)&&(l={text:d.Aa(a,k),W5:n?l:null,rowIndex:a},Gn(this[eq],Eqa+k+Tma,sP,c)==JF?f.line[C](l):f.FL[C](l))}return f}; function QLa(a,b,c,d,e,f,g,k,l,n,q,s,u){var w=[[64,64,64],[128,128,128],[255,255,255]],z=null==s?!0:s;s=c===KC;var B,F;if(s)var M=new vl(b[G],b.top,b[r],b[A]),N=F=b.top,P=B=h[t](b[G]+b[r]/2);else var P=B=b.x,N=F=b.y;var ba=N-n,U=ba,qa=-n,ya=g[J],Ha=n+k[uc]*ya;N-Ha<a.L.A.top&&N+Ha<a.L.A[Hc]&&(ba=N+Ha,U=N+n+k[uc],qa=n);N=null;1<ya&&(n=P,N=U,U=null,U=g[0][cd]+fla,Ha=a.Ac(U,k),c===KC&&Ha[r]>b[r]?(c=b[G],n=nI):(c=n,n=pD),U={KS:!1,label:{text:U,X:k,F:[{x:0,y:0,length:Ha[r],text:U}],Cc:n,Bc:oE,anchor:new uP(c, N),Cb:0}},a.As&&(U[Rc].vb=hoa),N=U);c=[];for(n=0;n<ya;n++){var U=g[n],Aa=a.Ac(U[cd],k),Ha={},Wc=new uP(B,ba),cb=null;Ha.X=jo(k,ko);if(s){if(M&&!u){var cb=rm(d),kc=pm(ym(cb,w)),cb=f===Jg?NI:zs,kd=jo(k,ko);z&&(kd.Tb=R,Xa(kd,kc));t:{var Mb=U[cd],Oc=kd,Vd=cb,cb=M,Tf=a.Ac,kd=a.As,Uf=di(2)?2:0,Ce=di(2)?2:0,kc=Tf(Mb,Oc),gq,Gf=cb.Ub();gq=kc[r]<=Gf[r]&&kc[A]<=Gf[A];var Gf={},Di=[];Bw(Gf,Mb);Gf.X=Oc;if(Vd===NI)Vd=h[t](cb[Vy]().x),Ce=cb.top+Ce,Gf.Cc=pD,Gf.Bc=nI;else if(Vd===zs)Vd=cb[G]+(cb[r]-Uf),Ce=h[t](cb[Vy]().y), Gf.Cc=oE,Gf.Bc=pD;else throw m("Invalid text block position.");if(!gq||kc[r]>cb[r]-Uf)if(kc[A]<cb[A]){if(Oc=UN(Tf,Mb,Oc,cb[r]-Uf,cb[A]/(kc[A]+2)),Di=Oc.F,Oc.ge){var hj=Mb;Gf.TA=!0}}else if(cb[A]>Oc[uc]/3)hj=Mb,Di=[Ne],Ce=h[t](cb[Vy]().y),Gf.Bc=pD,Gf.TA=!0;else{cb=null;break t}Gf.F=[];if(Di[J])for(Oc=Mb=0,Tf=Di[J];Oc<Tf;Oc++)Gf.F[C](new oJa({x:0,y:Mb,length:cb[r],text:Di[Oc]})),Mb+=kc[A];else Gf.F[C](new oJa({x:0,y:0,length:kc[r],text:Mb}));Gf.Cb=0;Zw(Gf,new uP(Vd,Ce));kd&&hj&&(Gf.de={am:!1,ti:!1, content:hj});cb=new pJa(Gf)}}if(u||!e&&(!cb||1<cb.F[J]||cb.TA))switch(f){case Jg:Ha.Bc=oE;b[r]>Aa[r]?(Wc.x=B,Ha.Cc=pD):(Wc.x=M[G],Ha.Cc=nI);break;case Eh:Wc.x=M[G]+M[r]+2,Ha.Cc=nI,Ha.Bc=pD,Wc.y=M[Vy]().y}}else Wc.x=P,Ha.Cc=pD,Ha.Bc=oE;if(cb&&(e||!e&&!cb.TA)){c[C](cb);var Hf=!0}else{switch(f){case Jg:Ha.Cc=pD;Ha.Bc=oE;break;case Eh:Ha.Cc=nI,Ha.Bc=pD}Bw(Ha,U[cd]);Ha.X=k;Ha.cq=l;Zw(Ha,Wc);Ha.TA=!1;Ha.F=[{x:0,y:0,length:Aa[r],text:U[cd]}];Ha.Cb=0;Aa=U.W5;a.As&&null!=Aa&&(Ha.de=RT(a,Aa,U.rowIndex));c[C](Ha); ba-=k[uc]}}n=Hf?0:qa;a=Eh;s&&f===Eh&&(n=0,a=Jg,B=b[G]+b[r],F=h[t](b.top+b[A]/2));return{E3:{x:B,y:F,length:n,orientation:a,color:q},labels:c,bundle:N?N:null}} function RLa(a,b,c,d,e){var f=b.x,g=b.y,k=d[uc];b=[];for(var l=0;l<c[J];l++){var n=c[l],q=UN(a.L.Ac,n[cd],d,a.L.A[A]-k);b[C](q)}if(null!=g){for(l=n=0;l<b[J];l++)q=b[l],n=h.max(n,q.Kg);l=n+k;g=h[D](g-l/2);g<a.L.A.top&&(g=a.L.A.top);k=g+l;k>a.L.A[Hc]&&(k=a.L.A[Hc],g=k-l)}else g=a.L.A.top,k=a.L.A[Hc];for(var s=h[D]((g+k)/2),u=f+2,w=[],l=0;l<c[J];l++){var n=c[l],q=b[l],q={text:n,X:d,F:[{x:u,y:s,length:q.Kg,text:q.F[0]}],Cc:pD,Bc:nI,anchor:null,Cb:270},z=n.W5;a.As&&null!=z&&(q.de=RT(a,z,n.rowIndex));w[C](q); u+=d[uc]}return{E3:{x:f,y:g,length:k-g,orientation:Eh,color:e},labels:w,bundle:null}}function HLa(a,b){var c=a.L.k[b],d=SLa(a,c);c.j&&Y(c.j,function(a){null!=a&&(a.S=d(a.Cf),null!=a.v5&&(a.ir=d(a.v5)),null!=a.w5&&(a.jr=d(a.w5)))});c.ef&&(0<c.ef.F[J]||0<c.ef[Qz][J])&&TLa(c)}function vLa(a){Y(a.L.k,function(a,c){HLa(this,c)},a)} function TLa(a){function b(b){var c=e[b];delete e[b];if(c&&1<c.line[J]){c[Hc]&&c[Hc][rx]();if(f[b].av!=R){var d=f[b].av==Bg;b=f[b].gK;c.JS=YO(c.line,b,d,!1,!1);c[Hc]&&(c.Rea=YO(c[Hc],b,d,!1,!1))}a.ef.ii[C](c)}}function c(a,b){if(!e[a]){var c=f[a].brush.o(),d=f[a][x],g={};g.LD=a;g.line=[];d==BC?(c.yk(0),Na(g,[])):c.dh(0);g.brush=c;e[a]=g}e[a].line[C](new kK(b[G],b.top));e[a][Hc]&&e[a][Hc][C](new kK(b[G]+b[r],b.top+b[A]))}function d(a){a=f[a][x];return a==BC||a==JF}var e={},f=a.ef.ND;a.ef.ii=[];for(var g= 0;g<a.j[J];g++){var k={},l=a.j[g];if(l&&l.S&&l.S.sq)for(var l=l.S.sq,n=0;n<l[J];++n){var q=l[n].LD;d(q)&&(k[q]=!0,c(q,l[n][zz]))}for(q in e)k[q]||f[q].Lj||b(q)}for(q in e)b(q)}function SLa(a,b){switch(b[H]){case QH:return W(a.Zqa,a,b);case dD:return W(a.Wqa,a,b);case JF:return W(a.Yqa,a,b);case KC:return W(a.Vqa,a,b);case qI:return W(a.$qa,a,b);case jD:return W(a.Xqa,a,b);case BC:return W(a.Uqa,a,b)}return null}T.Zqa=function(a,b){return{x:this.kg[0].se(b.x),y:this.Re[0].se(b.y)}}; T.Wqa=function(a,b){var c=this.Eq,d=this.kg[0].se(b.x),e=this.Re[0].se(b.y),f;f=c.Do==Yg?NQ(c.iq,b[E]):c.Do==rh?c.Qy[b[E]][E]:c.YK;f=new Rm({fill:f,ae:c.Vl,stroke:c.Qd});c=oHa(c.rD,b[ly]);return{x:d,y:e,brush:f,radius:c,lN:c}};T.Yqa=function(a,b){var c=dU(this,a.ee,b.Jk,b.Vv);c.sq=eU(this,a,b);return c};T.Vqa=function(a,b){var c=fU(this,a,b,b.Rj,b.Ck);return c?{top:c.top,left:c[G],width:c[r],height:c[A],sq:eU(this,a,b)}:null}; T.Xqa=function(a,b){var c=fU(this,a,b,b.eha,b.fha),d=fU(this,a,b,b.dha,b[Ry]);if(!c||!d)return null;pa(d,2);Ya(d,d[G]+(c[r]-(c[r]%2?3:2))/2);var e=b.cha?a.FD.H3:a.FD.I3;Vm(e)&&(e=e.Hb/2,Sa(c,c[A]-2*e),pa(c,c[r]-2*e),Ya(c,c[G]+e),c.top+=e);Sa(c,h.max(c[A],2));pa(c,h.max(c[r],1));return{rect:c,line:d}}; T.$qa=function(a,b){var c=this.Te[a.ee];null==b.Rj&&(b.Rj=jP(c.ca,c.Ed.ra));var d=this.Xc,e=d[wy][b.Dq].aa,f=d.pv,g=h[t](e-d[jx]*f/2),f=h[t](e+d[jx]*f/2),k=c.se(b.Ck),d=gU(this,g,c.se(b.Rj)),e=gU(this,g,k),f=gU(this,f,k),k=[];pn(this[eq],tsa,!0)&&null!=b.g4&&(c=gU(this,g,c.se(b.g4)),k[C](c));k[C](e);k[C](f);return{vD:XKa(d.x,d.y,f.x,f.y),outline:k,sq:eU(this,a,b)}}; function fU(a,b,c,d,e){var f=a.Xc,g=a.Te[b.ee];b=a.KM;null!=d||(d=jP(g.ca,g.Ed.ra));if(c.Fv>=b.z6||c.Dq>=f[wy][J]&&f[H]!=Dh)return null;f=h.min(g.se(d),g.se(e));d=h.max(g.se(d),g.se(e));g=(e=a.L.Wa===cF)?DLa(g.pv,pn(a[eq],dF))?0:1:h.min(1,0.2*(d-f));0===g||h[t](f+g)<h[t](d)&&h[t](f+g)>h[t](f)?(f=h[t](f+g),d=h[t](d)):f+=g;var k=sn(a[eq],hta,0.3),g=ULa(a,c);c=(c.aga?k:1)*b.kN/2;b=(e?h[xb]:h[t])(g-c);c=h[t](g+c);f=gU(a,b,f);a=gU(a,c,d);return XKa(f.x,f.y,a.x,a.y)} T.Uqa=function(a,b){function c(a){return null!=a?a:e}var d=this.Te[a.ee],e=jP(d.ca,d.Ed.ra),d=dU(this,a.ee,b.Jk,b.Vv),f=dU(this,a.ee,b.z4,c(b.A4)),g=dU(this,a.ee,b.B4,c(b.C4)),k=dU(this,a.ee,b.D4,c(b.E4)),l=dU(this,a.ee,b.G4,c(b.H4)),n=eU(this,a,b);return{x:d.x,y:d.y,tT:f.x,uT:f.y,vT:g.x,wT:g.y,GK:k.x,IK:k.y,JK:l.x,KK:l.y,sq:n}}; function eU(a,b,c){if(!c.zE)return[];var d=a.Xc;b=a.Te[b.ee];var e=a.KM;if(c.Fv>=e.z6||c.Dq>=d[wy][J]&&d[H]!=Dh)return[];for(var f=ULa(a,c),g=[],k=0,l;l=c.zE[k];k++){var n=b.se(l.hia),q=b.se(l.iia),s=(d[H]==Dh?d[wy]&&1<d[wy][J]?d[wy][1].aa-d[wy][0].aa:0:e.kN)*l.jia,u=h.abs(n-q),q=gU(a,f-s/2,h.min(q,n)),n=q.x,q=q.y,s=gU(a,s,u);g[C]({rect:new vl(n,q,s.x,s.y),LD:l.LD})}return g}function ULa(a,b){var c=a.Xc,d=a.KM;return(c[H]==Dh?c.se(b.Jk):c[wy][b.Dq].aa)-d.$ia+(d.kN+1)*b.Fv+d.kN/2} function ST(a,b){switch(a){case YH:return b.tb;case jza:return b.Mi;case XH:return b[E];default:return a}}function gU(a,b,c){switch(a.L[lz]){case Jg:return{x:b,y:c};case Eh:return{x:c,y:b}}throw m("Invalid orientation.");}function dU(a,b,c,d){return gU(a,a.Xc.se(c),a.Te[b].se(d))}function $T(a,b){var c=a.o();if(Wm(c)&&c.gb()!=ue){var d=new Qm(pH,c.gb());c.fe=d;!Vm(c)&&b&&(c.dd(c.gb()),c.yk(1))}else Vm(c)&&(c.Hk=UD);return c}function ILa(a,b){var c=a.o();c.yk(c.Hb*b);return c} function MLa(a,b,c){a=a.Nb;b=b.oa.certainty||[];return b[J]&&(c=a[I](c,b[0]),null!=c)?a.D(b[0])==jg?c?1:0:c:1}function OLa(a,b,c){a=a.Nb;b=b.oa[yz]||[];return b[J]&&(c=a[I](c,b[0]),null!=c)?!!c:!0}function NLa(a,b,c){a=a.Nb;b=b.oa.emphasis||[];return b[J]&&(c=a[I](c,b[0]),null!=c)?a.D(b[0])==jg?c?2:1:c:1}function UT(a,b){var c=TT(a);return null===c?null:a.Nb[I](b,c)}function TT(a){if(null===a.Xc||a.Xc[H]!=Dh)return null;a=a.L.Tj[0].oa.gap||[];return Si(a)?null:a[0]} function XT(a,b,c,d,e){function f(a,b,f){var g=jP(k.ca,l[I](c,a));b=jP(k.ca,l[I](c,b));null!=g&&null!=b&&(g+=d,b+=d,e&&(k.fc(g),k.fc(b)),n[C]({iia:g,hia:b,jia:f,LD:a}))}var g=b.ef;if(!g)return null;var k=a.Te[b.ee],l=a.Nb,n=[];for(a=0;a<g.Kw[J];a+=2)f(g.Kw[a],g.Kw[a+1],0);for(var q=0,s=g.tN[J]-1;q<=s;q++,s--)a=g.tN[q],b=g.tN[s],f(a,b,g.ND[a].Tha);for(b=0;b<g.j[J];b++)a=g.j[b],f(a,a,0);for(b=0;b<g.Eb[J];b++)a=g.Eb[b],q=g.ND[a],f(a,a,0==b||b==g.Eb[J]-1?q.Sha:q.Uha);q=0;for(s=g[Qz][J]-1;q<=s;q++,s--)a= g[Qz][q],b=g[Qz][s],f(a,b,0);for(b=0;b<g.F[J];b++)a=g.F[b],f(a,a,0);return n[J]?n:null}function tLa(a){var b=a.L;if(b.xf.bars||b.xf.candlesticks||!Wh(Oi(b.k,function(a){return null!=a.ef}))){var c=Fi(b.Ba,function(a,b){return 0!=UT(this,b)},a),c=VLa(a.Xc,c),c=h.max(c,1),d=nfa(a[eq],c),d=h.max(d,1),e=h.min(a.Zv,h[t]((d+1)/2)),f=(d-e+1)/e;c>d&&(f=h[t](f));a.KM={z6:e,kN:f,$ia:b.Wa===cF?0:((f+1)*e-1)/2}}} function VLa(a,b){if(Si(b))return 0;if(a[H]==Dh){for(var c=a.WD,d=null,e=0;e<b[J];e++){var f=a.OG(b[e][Z]);null!=d&&(c=h.min(c,h.abs(f-d)));d=f}return c}return h.abs(a.OG(1)-a.OG(0))}function WT(a,b,c){var d=a.Nb;a=a.Xc;a[H]==Dh&&(b=c&&c.Eg?c[Z][b][0]:d[I](b,0),b=jP(a.ca,b));return b};function hU(a){this.Ql=a;this.k_=[];this.mQ=!1;this.Ch={ne:null,Qt:0,Tl:0,uI:0,vI:0}}hU[K].Le=function(a,b,c){this.k_[c]=!0;0===c&&(this.Ch.ne=b,this.Ch.Qt=a.x,this.Ch.Tl=a.y,this.Ch.uI=a.x,this.Ch.vI=a.y)};dp(hU[K],function(a,b){this.Ql[$]({type:a,data:b})});function iU(a,b,c,d){this.Ql=a;this.G=b;this.Pq=c;this.pi=d;this.zx=null;this.yZ=new hU(a);this.mO=null}X(iU,Us);T=iU[K];T.w=function(){this.G[Wb]();this.Pq[Wb]();Ws(this.mO);iU.e.w[L](this)};function WLa(a){var b=a.G.Cs;XLa(a,W(function(a,d){this.G.Fb(b,a,d)},a));Ws(a.mO);a.mO=new MM(a.G.ac());kt(a.mO,GG,W(a.gna,a))}function YLa(a){var b=a.Pq.ac();XLa(a,W(function(a,d){this.Pq.Fb(b,a,d)},a))}function ZLa(a){var b=fa;$La(a,W(function(a,d){this.Pq.Fb(b,a,d)},a))} function $La(a,b){b(EG,W(a.Bra,a));b(FG,W(a.Cra,a))}function XLa(a,b){b(gs,W(a.oda,a));b(fs,W(a.Rqa,a));b(EG,W(a.oda,a));b(FG,W(a.Qqa,a));b(es,W(a.Pqa,a));b(Fr,W(a.Nqa,a));b(OD,W(a.Sqa,a));b(YD,W(a.Oqa,a))}T.Bra=function(a){var b=Ml(this.G.ac());a=Ml(a);a.x-=b.x;a.y-=b.y;b=this.yZ;b.k_[0]&&(b.Ch.uI=a.x,b.Ch.vI=a.y,b.mQ||b[$](Jra,{ne:b.Ch.ne,ub:{x:b.Ch.Qt,y:b.Ch.Tl}}),b.mQ=!0,b[$](Hra,{ne:b.Ch.ne,ub:{x:b.Ch.uI,y:b.Ch.vI}}))}; T.Cra=function(a){var b=Ml(this.G.ac()),c=Ml(a);c.x-=b.x;c.y-=b.y;b=this.yZ;a=a[rq];b.k_[a]=!1;0===a&&b.mQ&&(b.mQ=!1,b.Ch.uI=c.x,b.Ch.vI=c.y,b[$](Ira,{ne:b.Ch.ne,ub:{x:b.Ch.uI,y:b.Ch.vI}}))};T.oda=function(a){var b=gK(a),c=this.us(a);a[H]==EG&&this[$](Nra,{ub:b,ne:c});c!=this.zx&&(null!=this.zx&&aMa(this,this.zx),this[$](Kra,{ub:b}),jU(this,Ioa,c),this.zx=c)};T.Rqa=function(a){a=this.us(a);a==this.zx&&(aMa(this,a),this.zx=null)};function aMa(a,b){a[$](Lra,null);jU(a,Joa,b)} T.Qqa=function(a){var b=gK(a);a=this.us(a);this[$](Ora,{ub:b,ne:a});jU(this,Toa,a)};T.Pqa=function(a){var b=gK(a),c=this.us(a);this[$](Mra,{ub:b,ne:c,preventDefault:W(a[Hp],a)});jU(this,Soa,c);this.yZ.Le(b,c,a[rq])};T.Nqa=function(a){var b=gK(a);a=this.us(a);this[$](Fra,{ub:b,ne:a});jU(this,goa,a)};T.Sqa=function(a){var b=gK(a),c=this.us(a);this[$](Tra,{ub:b,ne:c});jU(this,hpa,c);Ys(a)};T.Oqa=function(a){var b=gK(a);a=this.us(a);this[$](Gra,{ub:b,ne:a});jU(this,ooa,a)}; T.gna=function(a){var b=gK(a),c=this.us(a);this[$](Ura,{ub:b,ne:c,wheelDelta:a.detail,preventDefault:W(a[Hp],a)});jU(this,lpa,c)}; function jU(a,b,c){var d=c[pc](qe);switch(d[0]){case Hs:var e=c=null,f=null;a.pi==cH?c=ia(d[1]):4==d[J]?(c=d[1]?ia(d[1]):null,e=ia(d[2]),f=ia(d[3])):3==d[J]?(c=ia(d[1]),e=ia(d[2])):e=ia(d[1]);d={kc:c,Ji:e,fx:f};a[$](Hs+b,d);break;case qC:d={$v:d[1]};a[$](nqa+b,d);break;case FF:d=ia(d[1]);if(0>d)break;d={mP:d};a[$](kwa+b,d);break;case GF:d={jma:ia(d[1])};a[$](Fwa+b,d);break;case wya:d=ia(d[1]);d={mP:d};a[$](qya+b,d);break;default:a.Wba(b,c)}}dp(T,function(a,b){this.Ql[$]({type:a,data:b})});function kU(a,b,c,d){iU[L](this,a,b,c,d.Wa);this.Q=d;this.mZ=bMa(this)}X(kU,iU);kU[K].e3=function(a){this.Q=a;this.mZ=bMa(this)};function bMa(a){var b=a.Q;if(b.Wa!=Bg&&b.Wa!=QH)return{};a={};for(var b=b.k,c=0;c<b[J];c++){var d=b[c];if(AS(d))for(var e=d.j,f=0;f<e[J];f++){var g=e[f];if(g&&g.S&&!g.Ae){var k=AN([iH,c,f]);a[k]={center:g.S,radius:g.S&&null!=g.S.lN?g.S.lN:null!=g.lN?g.lN:d.V2,kc:c,Ji:f}}}}return a} kU[K].us=function(a){var b=this.G.Er(a[Mq]),c=gK(a),c=cMa(this,c);if(a[H]==fs){a=this.zx;if(null==a)return b;c=c==a?null:a}if(null!=c){a=dMa(b);var d=dMa(c),b=a>d?b:c}this.Q.Fh==lD?(c=b[pc](qe)[0],c=c!=JC&&c!=cD&&c!=iD&&c!=iH&&c!=mH&&c!=rI):c=!0;return c?b:Er}; function cMa(a,b){if(!(new vl(a.Q.A[G]+1,a.Q.A.top+1,a.Q.A[r]-2,a.Q.A[A]-2))[Lc](b))return null;switch(a.Q.Fh){case WD:var c=b.x,d=b.y,e=null,f=ea,g;for(g in a.mZ){var k=a.mZ[g],l=k[nx].x,n=k[nx].y,q=k[bz];l-c<=q&&l-c>=-q&&n-d<=q&&n-d>=-q&&(l=(l-c)*(l-c)+(n-d)*(n-d),l<=q*q&&l<=f&&(e=AN([mH,k.kc,k.Ji]),f=l))}return e;case lD:t:{c=a.Q.Ba;for(d=0;d<c[J];d++)if((e=c[d].kP)&&e[Lc](b)){c=AN([nD,d]);break t}c=null}return c}return null}function dMa(a){a=a[pc](qe);return Ci(CDa,a[0])} kU[K].Wba=function(a,b){var c=b[pc](qe);switch(c[0]){case JC:case cD:case iD:case iH:case mH:case rI:var d=ia(c[1]),c={kc:d,Ji:ia(c[2])};this[$](WD+a,c);break;case nD:c=ia(c[1]);c={kc:null,Ji:c};this[$](lD+a,c);break;case zC:d=ia(Ai(c));this[$](xC+a,3==c[J]?{kc:null,Ji:ia(c[1]),fx:d}:{kc:ia(c[1]),Ji:ia(c[2]),fx:d});break;case JF:case BC:d=ia(c[1]),c={kc:d,Ji:null},this[$](fza+a,c)}};function lU(a,b){this.Gu={};this.Qu={};this.UC=[];this[az](a,b)}function eMa(a){Y(a.UC,function(a){fMa(this,this.Qu[a])},a)}lU[K].updateOptions=function(a,b){this.ta=Ln(a,mqa,b);this.Uoa=Ln(a,lqa,b);eMa(this)};lU[K].getEntries=function(){for(var a=[],b=0,c=this.UC[J];b<c;b++){var d=this.UC[b],e=this.Qu[d];if(!e[oz]||e[oz]()){var f=null,f=e.is&&!e.is()?CN(e[cd]||O,this.Uoa,null,null,null,null,null,!1,null):Qj(this.Gu[d]);a[C](f)}}return a}; function fMa(a,b){if(!b.id)throw m("Missing mandatory ID for action.");var c=null;a.Qu[b.id]?c=a.Qu[b.id]:(c=a.Qu[b.id]={id:b.id,text:void 0,visible:void 0,is:void 0,action:void 0},a.UC[C](b.id));Sj(c,b);a.Gu[b.id]=CN(c[cd]||O,a.ta,null,null,null,null,null,!1,c.id)}lU[K].Tg=function(a){(a=this.Qu[a])&&(a=Qj(a));return a};function gMa(a,b){a.qH=a.qH||{};var c=a.qH;c.entries=c[Ez]||{};c=c[Ez];c[b]=c[b]||{};c=c[b];c.ih=c.ih||{};return c.ih} lU[K].gu=function(a,b,c){if(!a[jy]){var d=b.Qa.$v;null!=d&&(a=Pi(a.qH[Ez],function(a){return a.ih[Z].id==d}),-1!==a&&(c=gMa(c,a),ra(c,c[Z]||{}),Ww(c[Z],c[Z][Dz]||{}),c[Z][Dz].brush=Zm(Bla)))}};function hMa(a){this.Ob=a}function mU(a,b){var c={index:{},order:[],Ts:{}};Y(b,function(a){var b=this.getKey(a);if(null!=b){if(!c.Ts[vc](b)){var f=this.getTitle(a);f&&(c.Ts[b]=f)}c[nc][vc](b)||(c[nc][b]=[],c[ix][C](b));c[nc][b][C](a)}},a);return c};function nU(a){this.Ob=a}X(nU,hMa);nU[K].getKey=function(a){return this.Ob.QX(a)};nU[K].getTitle=function(a){return this.Ob.iO(a)};Ow(nU[K],function(a,b,c){var d=KIa(this.Ob,c);return iMa(a,d,b[yb]||O,!0,a.Lka,this.Ob.k[c.nb])});function oU(a){this.Ob=a}X(oU,hMa);oU[K].getKey=function(a){return a.nb};oU[K].getTitle=function(a){return KIa(this.Ob,a)};Ow(oU[K],function(a,b,c){c=this.Ob.iO(c)||O;return[c?CN(b[yb]||O,a.aH,c,a.ta):null]});function pU(a,b,c,d){b=Ln(a,GAa,{Va:b.Va,fontSize:b[uc]});this.ar=pn(a,BAa,c==lD);this.Lka=pn(a,BAa,!0);this.tia=pn(a,DAa,!0);this.ta=b;this.aH=Zea(b);this.te=d||null;this.Z6=zn(a,gta,koa);this.a7=zn(a,kta,apa)}pU[K].jt=function(){};function qU(a,b,c,d){pU[L](this,a,b,c,d)}X(qU,pU); qU[K].Y5=function(a,b,c){var d=a.Ob,e=d.k[b];c=d.qF(b,c);var f=!1,g=null,k=null,l=null!=d.Uc&&d.Uc;if(d.Uc)if(f=!0,k=[this.Z6,this.a7],d=e[H],d===KC)g=[{color:e.fh.gb(),alpha:e.fh.Oe},{color:e.eh[Dz].fh.gb(),alpha:e.eh[Dz].fh.Oe}];else if(d===QH)d=b%2?b-1:b,b=a.Ob.k[d],d=a.Ob.k[d+1],g=[{color:d.fh.gb(),alpha:d.fh.Oe},{color:b.fh.gb(),alpha:b.fh.Oe}];else throw m("Diff chart not supported for the chosen chart type.");b={entries:[]};if(c.F)for(c[uz]&&rU(this,b,c[uz]),e=0;e<c.F[J];e++)k=c.F[e],f=b,k= (l=k[uz])?CN(k[id],this.aH,l,this.ta):null,null!=k&&f[Ez][C](k);else c.gv&&!c.ti?(rU(this,b,c.gv),sU(this,b,c.$l,c[yb],!0,this.ar,e,f,g,k,l)):c.$l&&!c.ti?sU(this,b,c.$l,c[yb],!0,this.ar,e,!0,g,k,l):null!=c[yb]&&sU(this,b,null,c[yb],!1,this.ar,e);this.jt(b,a.Sj);return b}; function jMa(a,b,c,d){var e=b.Ob,f=new nU(e),g=new oU(e),k=null;d==lD?k=f:d==WH&&(k=g);var l;if(k)l=mU(k,c);else{d=mU(f,c);var n=mU(g,c),k=g;l=n;1==d[ix][J]&&1<n[ix][J]&&(k=f,l=d)}var q={entries:[]};Y(l[ix],function(a){rU(this,q,l.Ts[a][hc]());Y(l[nc][a],function(a){var b=e.qF(a.nb,a.jb);b.ti?sU(this,q,null,b[yb],!1,this.ar,e.k[a.nb]):q[Ez][C][Mc](q[Ez],k[nz](this,b,a))},this)},a);a.jt(q,b.Sj,0<c[J]);return q} qU[K].Z5=function(a,b){var c=a.Ob,d=c.k[b],e=d.de,f=null,g=null,k=null!=c.Uc&&c.Uc;c.Uc&&(f=c.k[J],f=(b+f/c.pie.Ih[J])%f,g=c.k[f],c={color:d.brush.gb(),alpha:d.brush.Oe},g={color:g.brush.gb(),alpha:g.brush.Oe},f=b>f?[c,g]:[g,c],g=[this.Z6,this.a7]);c={entries:[]};e.$l?sU(this,c,e.$l,e[yb],!0,this.ar,d,!0,f,g,k):sU(this,c,null,e[yb],!1,this.ar,d);this.jt(c,a.Sj);return c}; function kMa(a,b,c){var d=b.Ob,e={entries:[]};Y(c,W(function(a){a=d.k[a];var b=a.de;b.$l?sU(this,e,b.$l,b[yb],!0,this.ar,a,!0):sU(this,e,null,b[yb],!1,this.ar,a)},a));a.jt(e,b.Sj);return e} qU[K].X5=function(a,b){var c=a.Ob,d=c.Ba[b].de,e=!1,f={entries:[]};if(d&&d[yb])sU(this,f,null,d[yb],!1,!1);else{var g=0,k=1,l=c.k[J];UIa(c)&&(g=c.k[J]-1,l=k=-1);for(var n=null;g!=l;g+=k){var q=c.k[g],d=tS(c,g,b);if(n!=q.He){var n=q.He,s=c.Ba[b].Ts[n];mi(s)||rU(this,f,s)}q.j[d]&&q.j[d].de&&q.j[d].de[yb]&&(d=q.j[d].de,sU(this,f,d.$l,d[yb],!0,this.ar,q,void 0,void 0,void 0,void 0,d.ti&&d.am),e=!0)}}null!=a.Sj&&0<a.Sj[J]&&(e=!0);this.jt(f,a.Sj);return e||this.tia?f:null}; function rU(a,b,c){a=CN(c,a.aH);b[Ez][C](a)}function iMa(a,b,c,d,e,f,g,k,l,n,q){g=null!=g?g:!1;d=d?a.aH:a.ta;c=c[pc](me);var s=e?f[E][E]:null;b=g&&null!=b?CN(b,a.ta,null,null,s,f&&f.HD):CN(c[0],d,b,a.ta,s,f&&f.HD,null,q);a=[b];for(g=g?0:1;g<c[J];g++)s=null!=k?k[g][E]:e?R:null,b=CN(c[g],d,null,null,s,null!=k?k[g][Bz]:null,null!=l?l[g]:null,q),b.UI=n,a[C](b);return a}function sU(a,b,c,d,e,f,g,k,l,n,q,s){b[Ez][C][Mc](b[Ez],iMa(a,c,d,e,f,g,k,l,n,q,s))} qU[K].jt=function(a,b,c){b&&0!==b[J]&&((void 0==c||c)&&a[Ez][C](IDa()),Zi(a[Ez],b))};function tU(a,b,c){pU[L](this,a,b,c);this.I8=this.aH;this.gP=Pj(this.ta);Xa(this.gP,jA);Ja(this.gP,this.gP[uc]-2)}X(tU,pU);tU[K].Y5=function(a,b,c){b=a.Ob.k[b];a=b.j[c].de;c=[];b.Oj||(b=CN(b[uz],this.I8),c[C](b));b=CN(a[yb],this.I8);c[C](b);a=CN(a.gv,this.gP);c[C](a);return{entries:c}};tU[K].Z5=function(){return{entries:[]}};tU[K].X5=function(){return{entries:[]}};function lMa(a,b,c){this.Gt=b;this.tn=new rl(0,c[r],c[A],0);b=null!=b.te&&0<b.te.getEntries()[J]?kg:zg;this.aT=Gn(a,MI,Nn,b)}function uU(a){if(a.Wa==cH){var b=a.pie[nx];return new sk(b.x,b.y)}b=Gj(a.Be);b=null!=b.Ed?b.Ed.aa:h.min(b.hh,b.Gh);a=Gj(a.be);a=null!=a.Ed?a.Ed.aa:h.max(a.hh,a.Gh);return new sk(b,a)}function mMa(a,b){a.tn=b}function vU(a,b,c){var d=b.S;b=CS(b,c);a=uU(a);b=1+h[xb](b/h[ud](2));return new sk(d.x+(d.x>=a.x?b:-b),d.y+(d.y<=a.y?-b:b))} function nMa(a,b){var c=lK(a.pie[nx],OT(((b.mq?45:(b.Fd+b.$c)/2)/180-0.5)*h.PI,a.pie.Qc,a.pie.Rc)),c=new sk(c.x+b[by].x,c.y+b[by].y);c.x=nj(c.x,0,a[r]);c.y=nj(c.y,0,a[A]);return c}function oMa(a){var b=a[Gz]?a[Gz]:new sk(0,0),c=a.F[0],d=a.X[uc];return 270==a.Cb?new sk(b.x+c.x+d,b.y+c.y-c[J]/2):new sk(b.x+c.x+c[J]/2,b.y+c.y-d)} function pMa(a,b,c){var d=a.k[b],e=d[H];c=tS(a,b,c);switch(a.Wa){case Bg:case cF:switch(e){case KC:case qI:return d=d.j[c],d=d.S.vD||d.S,b=uU(a),d=new sk(d[G]+(d[G]<b.x?0:d[r]),d.top+(d.top<b.y?0:d[A])),qMa(a,d),d;case JF:case BC:return vU(a,d.j[c],d);case jD:return d=d.j[c].S[zz],b=uU(a),d=new sk(d[G]+d[r]>b.x?d[G]+d[r]:d[G],d.top<b.y?d.top:d.top+d[A]),qMa(a,d),d}case QH:return vU(a,d.j[c],d);case cD:c=d.j[c];b=c.S;d=vU(a,c,d);if(d.x<a.A[G]||d.x>a.A[Zc])d.x+=2*(b.x-d.x);if(d.y<a.A.top||d.y>a.A[Hc])d.y+= 2*(b.y-d.y);return d}return new sk(0,0)}function qMa(a,b){var c=a.A;b.x=nj(b.x,c[G],c[Zc]);b.y=nj(b.y,c.top,c[Hc])}function rMa(a,b){var c=lK(a.pie[nx],OT(((b.mq?45:(b.Fd+b.$c)/2)/180-0.5)*h.PI,a.pie.Qc-0.1,a.pie.Rc-0.1));return new sk(c.x+b[by].x,c.y+b[by].y)}function sMa(a){var b=a[Gz]?a[Gz]:new sk(0,0),c=a.F[0],d=a.X[uc];return 270==a.Cb?new sk(b.x+c.x+d/2,b.y+c.y):new sk(b.x+c.x,b.y+c.y-d/2)} function tMa(a,b,c){c=tS(a,b,c);var d=a.k[b];b=d[H];c=d.j[c].S;if(b==KC||b==qI||b==jD){var e=c.vD||c[zz]||c;c=e[G];b=e[r];var d=c+b,f=e.top,e=e[A],g=f+e,k=uU(a);a=a[lz]==Jg?g>k.y?new sk(c+b/2,g-0.1):new sk(c+b/2,f+0.1):c<k.x?new sk(c+0.1,f+e/2):new sk(d-0.1,f+e/2)}else a=new sk(c.x,c.y);return a} function wU(a,b,c,d,e,f){if(null===c||null===d||null===e)if(null===c||null===d)if(null!==c&&null===d){d=b.Ob;f=d.k[c];e=nMa(d,f);f=rMa(d,f);var g=d.k[c].de;g.am&&g.ti?a=xU(a,g[yb],f):(b=a.Gt.Z5(b,c),a=EN(b,d.Ac,!0,e,a.tn,f,void 0,d.Ls))}else if(null!==c||null===d||null===e)if(null===c&&null!==d){c=b.Ob;e=f.o();var g=f=null,k=Gj(c.Be),l=Gj(c.be),n=k.Ol,q=l.Ol,s=d;c[lz]&&c[lz]!==Jg?(q=-q,l[H]===Dh&&(s=c.Ba[d][Z]),g=l[jc].Se(s)):(k[H]===Dh&&(s=c.Ba[d][Z]),f=k[jc].Se(s));k=a.Gt.ta[uc];e.x=null===f?e.x: f;e.y=null===g?e.y:g;f=e.x-n*k;g=e.y+q*k;f=new sk(f,g);(g=c.Ba[d].de)&&g.am&&g.ti?a=xU(a,g[yb],e):(b=a.Gt.X5(b,d),a=null===b?null:EN(b,c.Ac,!1,f,a.tn,e,void 0,c.Ls))}else a=null;else c=b.Ob,g=c.Ba[d].Jc[vz][e],(n=g.de)?(f=oMa(g),g=sMa(g),n.am&&n.ti?a=xU(a,n[yb],g):(n=a.Gt,d={entries:[CN(b.Ob.Ba[d].Jc[vz][e].de[yb],n.ta)]},0<b.Sj[J]&&n.jt(d,b.Sj),a=EN(d,c.Ac,!1,f,a.tn,g,void 0,c.Ls))):a=null;else e=b.Ob,f=pMa(e,c,d),g=tMa(e,c,d),n=e.k[c].j[d].de,n.am&&n.ti?a=xU(a,n[yb],g):(b=a.Gt.Y5(b,c,d),a=EN(b, e.Ac,!0,f,a.tn,g,void 0,e.Ls));else f=b.Ob,n=f.k[c].j[d].Jc[vz][e],(q=n.de)?(g=oMa(n),n=sMa(n),q.am&&q.ti?a=xU(a,q[yb],n):(q=a.Gt,d={entries:[CN(b.Ob.k[c].j[d].Jc[vz][e].de[yb],q.ta)]},q.jt(d,b.Sj),a=EN(d,f.Ac,!1,g,a.tn,n,void 0,f.Ls))):a=null;return a}function uMa(a,b,c,d){var e=b.Ob,f=b.Ob.k[d];d=nMa(e,f);var f=rMa(e,f),g=Gi(c,function(a){return e.k[a].de});Mi(g,function(a){return a.am&&a.ti});b=kMa(a.Gt,b,c);return EN(b,e.Ac,!0,d,a.tn,f,void 0,e.Ls)} function vMa(a,b,c,d,e){var f=b.Ob,g=pMa(f,d.nb,d.jb);d=tMa(f,d.nb,d.jb);var k=Gi(c,function(a){var b=tS(f,a.nb,a.jb);return f.k[a.nb].j[b].de});Mi(k,function(a){return a.am&&a.ti});b=jMa(a.Gt,b,c,e);return EN(b,f.Ac,!0,g,a.tn,d,void 0,f.Ls)}function xU(a,b,c){return{html:{content:b,fd:{className:OE}},Eca:!0,Fca:c,anchor:c,Dca:a.tn,Gca:20,margin:5}};function yU(a,b,c,d,e,f){this.te=f;d==gE||this.te?null!=this.te&&this.te[az](a,c):this.te=new lU(a,c);c=d==gE?new tU(a,c,e):new qU(a,c,e,this.te);this.Fo=new lMa(a,c,b)}function zU(a,b,c){var d={};if(null!=c.Ea.vB){d.Ea=d.Ea||{};var e=b.Ea,f=c.Ea.vB;d.Ea.ln=e.Me[f];var g=f+1+Tq+e.Me[J],k=e.iG.YW,l=0<f,e=e.iG.WW,f=f<b.Ea.Me[J]-1;d.Ea.iG={YW:{brush:l?k.ce.Kt:k.ce.yN,Kt:l},WW:{brush:f?e.ce.Kt:e.ce.yN,Kt:f},XW:{text:g,F:{0:{text:g}}}}}a.gu(b,c,d);return d}yU[K].Hi=function(a){this.te&&fMa(this.te,a)}; yU[K].Tg=function(a){if(this.te)return this.te.Tg(a)};yU[K].Gi=function(a){if(this.te){var b=this.te;a in b.Gu&&delete b.Gu[a];a in b.Qu&&delete b.Qu[a];a=Ci(b.UC,a);0<=a&&b.UC[he](a,1)}};function AU(a){Uv(this,new FN);this.Qa={nb:null,datum:null,jb:null};Cw(this,{Qa:null,lK:null});this.Ea={Qa:{ih:null},vB:null};this.wh={Qa:{$v:null}};hw(this,{position:null,t4:null});this.Jh=this.hn=null;a&&(this[ux][Yx](a[ux]),a.Qa&&(this.Qa=BU(this.Qa,a.Qa)),a[Uy]&&Cw(this,BU(this[Uy],a[Uy])),a.Ea&&(this.Ea=BU(this.Ea,a.Ea)),a.wh&&(this.wh=BU(this.wh,a.wh)),a.hn&&(this.hn=BU(this.hn,a.hn)),a.Jh&&BU(this.Jh,a.Jh))} AU[K].o=function(){var a=new AU;Uv(a,this[ux].o());a.Qa=hn(this.Qa);Cw(a,hn(this[Uy]));a.Ea=hn(this.Ea);a.wh=hn(this.wh);hw(a,hn(this[iy]));a.hn=hn(this.hn);a.Jh=hn(this.Jh);return a};Za(AU[K],function(a,b){var c=Qh(b)?b:!1;return this[ux][cz](a[ux])&&gn(this.Qa,a.Qa)&&gn(this[Uy],a[Uy])&&gn(this.Ea,a.Ea)&&gn(this.wh,a.wh)&&(c||gn(this[iy],a[iy]))&&gn(this.hn,a.hn)&&gn(this.Jh,a.Jh)});function BU(a,b){var c=new sO(2);tO(c,0,a);tO(c,1,b);return c[My]()};function CU(){}X(CU,sS);T=CU[K];T.iO=function(a){var b=a.nb,c=a.jb;return this.ov?CU.e.iO[L](this,a):this.k[b].fd.histogramBucketItems[c][Rc].gv};T.QX=function(a){return this.ov?CU.e.QX[L](this,a):this.k[a.nb].fd.histogramBucketItems[a.jb].bb};T.$V=function(a){if(this.ov)return CU.e.$V[L](this,a);a=this.k[a.nb].fd.histogramBucketItems[a.jb];return{bb:a.bb,Af:a.Af}}; T.hM=function(a){var b=this.hq[a.Af].kc;return null!=b?this.ov?CU.e.hM[L](this,a):{nb:b,jb:this.k[b].fd.histogramElementIndexes[a.bb]}:null};T.qF=function(a,b){var c=this.k[a],d=c.j[b];return this.ov?{F:[{title:Koa,value:d.Cf.Ck-d.Cf.Rj}]}:c.fd.histogramBucketItems[b][Rc]};function DU(a,b,c,d,e){QT[L](this,a,b,c,d,e)}X(DU,QT);DU[K].f5=function(){return new CU}; DU[K].e5=function(){for(var a=this.mz,b=a.D(0)===rh,c=b?1:0,d=[],e=a.M(),f=a.H(),g=0;g<e;g++)for(var k=c;k<f;k++){var l=a[I](g,k);di(l)&&!na(l)||null===l&&!this.L.Lj||d[C](l||0)}var g=sn(this[eq],pva),n=sn(this[eq],qva),k=sn(this[eq],sva),l=sn(this[eq],rva),q=pn(this[eq],tva),s=new vJa;s[Up](d,n,g,k,l);g=g||s.um;n=[];l=yJa(s);d=new Ko;d.mg(Yg,zF);for(g=c;g<f;g++)for(k=a.cb(g)+Zka,d.mg(Yg,k),n[g-c]=[],k=0;k<l[J];k++)n[g-c][C]([]);a=zJa(s);for(g=0;g<l[J];g++)d.lq(),d.wa(g,0,a[g]);for(g=0;g<e;g++)for(a= b?this.mz[I](g,0):O,k=c;k<f;k++)if(l=this.mz[I](g,k),!(di(l)&&!na(l)||null===l&&!this.L.Lj)){var u=0==s.um||l<s.vp?0:l>=s.wW?s.nG:h[t]((l-s.vp)/s.um)+s.pr,w=k+1-c;d.wa(u,w,(d[I](u,w)||0)+1);w=this.mz.cb(k)||gC;n[k-c][u][C]({bb:g,Af:k,label:{title:a,gv:a,$l:w,content:l[hc](),F:[{title:w,value:l||0}]}})}for(var z=[],k=c;k<f;k++)z[k]=[];for(k=c;k<f;k++)b=ij(n[k-c]),q&&b[Zd](function(a,b){var c=a[Rc].F[0][id],d=b[Rc].F[0][id];return c<d?-1:c>d?1:0}),d.Sv(k-c,uva,b),Y(b,function(a,b){z[a.Af][a.bb]=b}); for(k=c;k<f;k++)d.Sv(k-c,wva,z[k]);c=zJa(s);d.Sv(0,vva,c);this.Nb=new ku(d)};function DLa(a,b){return 4>a||b}function CLa(a,b,c){for(var d=[],e=0;e<b.Ba[J];e++){d[e]=[];for(var f=0;f<b.k[J];f++){var g=b.k[f];if(g[H]==KC){var k=a?0:f;d[e][k]=(d[e][k]||0)+c[I](e,g.oa[Z][0])}}}for(e=a=0;e<d[J];e++)for(f=0;f<d[e][J];f++)a=h.max(d[e][f],a);return a};function EU(a,b,c,d,e,f,g){yU[L](this,a,b,c,d,e,g);var k=pn(a,nE,!0);this.iT=k;this.yM=Hn(a,Qsa,pfa);this.mha=Gn(a,[Psa,Msa],qfa,kg);this.ria=Gn(a,[Ksa,Msa],qfa,kg);this.kha=En(a,[Nsa,Hsa]);this.pia=En(a,[Isa,Hsa]);this.lha=xn(a,[Osa,Lsa],1);this.qia=xn(a,[Jsa,Lsa],1);this.q6=Gn(a,uqa,pFa,R);this.bm=$O(f,function(b){return pn(a,ZH+b+Nma,k)});this.Gna=Mi(this.bm,kj);this.vK=!0}X(EU,yU);EU[K].gu=function(a,b,c){this.vK=!0;switch(a.By){case ZD:this.q2(a,b,c);break;case gE:wMa(this,a,b,c)}}; EU[K].c3=function(a,b){return a[cz](b,this.vK)};function FU(a,b,c){a.k=a.k||{};a=a.k;a[b]=a[b]||{};b=a[b];b.j=b.j||{};b=b.j;b[c]=b[c]||{};return b[c]}function GU(a,b,c){if(null!=b)return a=FU(a,b,c),a.Jc=a.Jc||{},a.Jc;a=xMa(a,c);a.Jc=a.Jc||{};return a.Jc}function HU(a,b){a.k=a.k||{};var c=a.k;c[b]=c[b]||{};return c[b]}function xMa(a,b){a.Ba=a.Ba||{};var c=a.Ba;c[b]=c[b]||{};return c[b]}function IU(a,b){a.Ea=a.Ea||{};var c=a.Ea;c.ln=c.ln||{};c=c.ln;c[b]=c[b]||{};return c[b]} EU[K].q2=function(a,b,c){var d={Ob:a,Sj:this.te.getEntries(),qv:c,Yl:b.wh},e=b.wh.Qa.$v;null!=e&&uw(b.wh.Qa,this.te.Tg(e)[Hy]);for(var e=this.Fo.aT,f=e==mh||e==kg,e=e==zg||e==kg,g=this.q6!=R,k=this.te&&0<d.Sj[J],l=IN(b[ux]),n=1<l[J]&&(g||k),q=0;q<l[J];++q){var s=l[q],u=s.column,w=s.row,z=a.hq[u],s=z.kc;if(w=a.hM({Af:u,bb:w}))switch(z.Iv){case Jr:if(!this.bm[s])break;JU(this,a,w.nb,w.jb,c);f&&!n&&KU(this,d,w.nb,w.jb);break;case xC:if(null!=s?!this.bm[s]:!this.iT)break;s=z.Uy;yMa(w.nb,w.jb,s,c);f&& LU(this,d,w.nb,w.jb,s)}}f&&n&&!a.ov&&(q=Fi(Gi(l,function(b){return a.hM({Af:b.column,bb:b.row})}),Xh),0<q[J]&&zMa(this,d,g?q:[],q[q[J]-1]));l=GN(b[ux],mg);for(q=0;q<l[J];++q)u=l[q],z=a.hq[u],null!=z&&(s=z.kc,null!=s&&this.bm[s]&&AMa(this,a,s,c));l=a.Wa===cD;n=HN(b[ux]);k=1<n[J]&&(g||k);for(q=0;q<n[J];++q)w=n[q],w=a.eq[w],l?(s=0,this.bm[s]&&(JU(this,a,s,w,c),f&&!k&&KU(this,d,s,w))):(BMa(this,a,w,c),f&&!k&&CMa(this,d,b[iy].t4,w));if(k)if(l)KU(this,d,0,a.eq[n[n[J]-1]]);else if(f){var B=a.k,q=ij(Gi(n, function(b){for(var c=[],d=0;d<B[J];d++){var e=a.eq[b];null!=e&&c[C]({nb:d,jb:e})}return c}));0<q[J]&&zMa(this,d,g?q:[],q[q[J]-1])}f=b.Qa.nb;g=b.Qa[ay];null!=g?this.bm[f]&&(MU(this,a,f,g,c),e&&KU(this,d,f,g),DMa(a,f,g,c)):null!=f&&this.bm[f]&&NU(this,a,f,c);f=b.Ea.Qa.ih;null!=f&&this.bm[f]&&NU(this,a,f,c);f=b.Qa.jb;null!=f&&a.Ba[f]&&(EMa(this,a,f,c),e&&(CMa(this,d,b[iy][jc],f),this.vK=!1));if(f=b[Uy].lK)f=GU(c,f.kc,f.$S),f.bundle=f.bundle||{},f.bundle.KS=!0;(f=b[Uy].Qa)&&e&&(g=a.hq[f.Af],e=g.kc,f= a.eq[f.bb],g=g.Uy,(null!=e?this.bm[e]:this.iT)&&LU(this,d,e,f,g));if(b=b.Jh)c.Jh=b};var FMa=[0.25,0.1,0.05],GMa=[0.3,0.1,0.05],HMa=[0.3,0.15,0.05]; function MU(a,b,c,d,e){var f=b.k[c],g=f.j[d];if(g&&!g.Ae&&g.S&&(!AS(f)||0!=f[Ny]||BS(g,f))){var k=f[H]==KC?HMa:FMa;e=FU(e,c,d);e.an={};c=e.an;c.Hf=[];for(d=0;d<k[J];d++){var l=new Rm({fill:R,stroke:RC,Cg:k[d],qa:1});c.Hf[C]({brush:l})}switch(f[H]){case KC:case qI:case jD:a=g.S.vD||g.S[zz]||g.S;b=new vl(a[G],a.top,a[r],a[A]);for(d=0;d<k[J];d++)a=c.Hf[d].brush.Hb,c.Hf[d].rect=new vl(b[G]-a/2,b.top-a/2,b[r]+a,b[A]+a),Ya(b,b[G]-a),b.top-=a,pa(b,b[r]+2*a),Sa(b,b[A]+2*a);break;case JF:case BC:case QH:case dD:Pw(e, !0);c.x=g.S.x;c.y=g.S.y;if(a.yM===kg||a.yM===zg)d=yS(g,f),d=$m(a.pia||d.gb(),1,!1,a.qia),IMa(b,g,e,d,a.ria);e.li?(a=e.li,b=a[bz]+a.brush.Hb/2):b=CS(g,f);for(d=0;d<k[J];d++)a=c.Hf[d].brush.Hb,Jw(c.Hf[d],b+a/2),b+=a}}} function NU(a,b,c,d){var e=b.k[c],f;if(AS(e)&&0<e[Ny]){f=HU(d,c);f.an={};f=f.an;f.Hf=[];var g;g=e[H]==BC?b.Dd?ES(e):DS(e,!1):DS(e,b.Lj);g=lCa(g);for(var k=e.$d.Hb/2,l=0;l<GMa[J];l++){var n=new Rm({fill:R,stroke:RC,Cg:GMa[l],qa:1}),q=mCa(g,k+n.Hb/2);f.Hf[C]({brush:n,path:q});k+=n.Hb}}f=(f=(f=d.k)&&f[c])&&f.j;for(g=0;g<e.j[J];++g)k=e.j[g],!k||k.Ae||(BS(k,e)||f&&f[g]&&f[g][oz])&&MU(a,b,c,g,d);b.Uc&&e[H]===QH&&!a.RE(e.oa)&&NU(a,b,c-1,d)}EU[K].RE=function(a){a=a[RG];return null!=a&&0<a[J]}; function EMa(a,b,c,d){for(var e=b.k,f=0;f<e[J];++f){var g=tS(b,f,c);a.bm[f]&&null!=g&&MU(a,b,f,g,d)}} function JU(a,b,c,d,e){var f=b.k[c],g=f.j[d];if(g&&!g.Ae&&g.S&&(!AS(f)||0!=f[Ny]||BS(g,f))){var k=yS(g,f);c=FU(e,c,d);c.li={};d=c.li;var l=b.fK;e=1;null==l&&(l=Hh,e=0);switch(f[H]){case KC:case qI:case jD:e=1;d.brush=Ym.o();d.brush.dd(l);f[H]==jD&&(a=rm(mm(k.gb()).vd),b=rm(mm(l).vd),f=rm(mm(g.Jy.gb()).vd),d.brush.dd(pm(ym(f,[a,b]))));Sm(d.brush,e);d.brush.yk(1);g=g.S.vD||g.S[zz]||g.S;k=k.Hb;a=d.brush.Hb;d.rect=new vl(g[G]+k/2+1.5+a/2,g.top+k/2+1.5+a/2,g[r]-(k+3+a),g[A]-(k+3+a));(0>=d[zz][r]||0>=d[zz][A])&& delete c.li;break;case JF:case BC:case QH:case dD:Pw(c,!0);d.x=g.S.x;d.y=g.S.y;if(a.yM===kg||a.yM===mh){var n=$m(a.kha||k.gb(),1,!1,a.lha);IMa(b,g,c,n,a.mha)}d.brush=new Rm({fill:l,ae:e,stroke:k.gb(),qa:1});Jw(d,CS(g,f)+1.5+d.brush.Hb/2)}}} function IMa(a,b,c,d,e){c=c.I5||(c.I5={});c.x=b.S.x;c.y=b.S.y;c.brush=d;b=new sk(a.A[G],c.y);d=new sk(a.A[Zc],c.y);var f=new sk(c.x,a.A.top);a=new sk(c.x,a.A[Hc]);c.path=c[gz]||new YJ;if(e===kg||e===Eh)for(f=aK([f,a]),a=0;a<f.Yc[J]-1;a++)c[gz].qj(f.Yc[a]);if(e===kg||e===Jg)for(e=aK([b,d]),a=0;a<e.Yc[J]-1;a++)c[gz].qj(e.Yc[a]);c[gz][vy]()} function AMa(a,b,c,d){var e=b.k[c];if((e[H]==JF||e[H]==BC||e[H]==QH)&&0<e[Ny]){var f=HU(d,c);f.li={};var f=f.li,g;g=e[H]==BC?b.Dd?ES(e):DS(e,!1):DS(e,b.Lj);g=lCa(g);f.brush=new Rm({stroke:e.$d.Qd,qa:h.min(1,e.$d.Hb/2)});f.path=mCa(g,-(e.$d.Hb/2+2+f.brush.Hb/2))}for(f=0;f<e.j[J];++f)g=e.j[f],!g||g.Ae||BS(g,e)&&JU(a,b,c,f,d);b.Uc&&e[H]===QH&&!a.RE(e.oa)&&AMa(a,b,c-1,d)}function BMa(a,b,c,d){for(var e=b.k,f=0;f<e[J];++f){var g=tS(b,f,c);a.bm[f]&&null!=g&&JU(a,b,f,g,d)}} function JMa(a,b,c,d){c=FU(b.qv,c.nb,c.jb);var e=null!=b.Yl;c.vb=d;e&&a.te.gu(d,b.Yl,c.vb)}function KU(a,b,c,d){var e=wU(a.Fo,b,c,d,null);JMa(a,b,{nb:c,jb:d},e)}function zMa(a,b,c,d){c=vMa(a.Fo,b,c,d,a.q6);JMa(a,b,d,c)}function CMa(a,b,c,d){if(c&&a.Gna){var e=xMa(b.qv,d),f=null!=b.Yl;c=wU(a.Fo,b,null,d,null,c);null!==c&&(e.vb=c,f&&a.te.gu(c,b.Yl,e.vb))}} function LU(a,b,c,d,e){var f=GU(b.qv,c,d);f.labels=f[vz]||{};f=f[vz];f[e]=f[e]||{};var f=f[e],g=null!=b.Yl;c=wU(a.Fo,b,c,d,e);f.ka=c;g&&c&&a.te.gu(c,b.Yl,f.ka)}function DMa(a,b,c,d){if(a.gi){var e=a.gi;a=jR(e[Fy],e.oG,[{value:a.k[b].j[c].Cf[E]}],a.Ac);d.gi={definition:a}}}function yMa(a,b,c,d){a=GU(d,a,b);a.labels=a[vz]||{};a=a[vz];a[c]=a[c]||{};c=a[c];c.X=c.X||{};ib(c.X,!0)} function wMa(a,b,c,d){var e={Ob:b,Sj:[],qv:d,Yl:null},f=c.Qa.nb,g=c.Qa[ay];b.Ea&&mMa(a.Fo,new rl(0,b.Ea.area[G],b[A],0));var k=a.Fo.aT;if(null!=f&&null==g){for(var l=c[iy][jc].x,n=b.k[f].j,g=Fi(n,function(a){return null!=a}),q=0;q<g[J]&&g[q].S.x<l;)q++;0==q?g=0:q==g[J]?g=g[J]-1:(l=l<vj(g[q-1].S.x,g[q].S.x)?q-1:q,g=Ci(n,g[l]));a.vK=!1}n=null;if(null!=g)for(n=FU(d,f,g),Pw(n,!0),k==zg&&KU(a,e,f,g),b.Ea&&(n=IU(d,f),n.re={O:b.S2}),n=0;n<b.k[J];n++)n!=f&&(b.Ea&&(g=IU(d,n),g.ma={X:{color:nA}}),g=HU(d,n), l=b.k[n],g.$d=l.$d.o(),Sm(g.$d,0.3));if(f=c[Uy].lK)f=GU(d,f.kc,f.$S),f.bundle=f.bundle||{},f.bundle.KS=!0;if(g=c[Uy].Qa)n=b.hq[g.Af],f=n.kc,g=b.eq[g.bb],n=n.Uy,(null!=f?a.bm[f]:a.iT)&&LU(a,e,f,g,n);if(b.Ea&&b.Ea[jc]==BF&&null!=c.Ea.Qa.ih){c=c.Ea.Qa.ih;n=IU(d,c);n.re={O:b.S2};for(var f=b.k[c].j,s,n=f[J]-1;0<=n;n--)if((g=f[n])&&!g.Ae&&g.S&&(new rl(b.A.top,b.A[Zc],b.A[Hc],b.A[G]))[Lc](new sk(g.S.x,g.S.y))){s=n;break}null!=s&&(n=FU(d,c,s),Pw(n,!0),k==zg&&KU(a,e,c,s));for(n=0;n<b.k[J];n++)n!=c&&(g=IU(d, n),g.ma={X:{color:nA}},g=HU(d,n),l=b.k[n],g.$d=l.$d.o(),Sm(g.$d,0.3))}};function KMa(a,b){this.oA=a;this.wM=b;this.kj=Pj(a);this.kj.Be&&(this.kj.Be=Ej(this.kj.Be,Pj),this.Xga=Ej(a.Be,function(c,d){return LMa(a.Be[d],b.Be[d],this.kj.Be[d],!0,!1)},this));this.kj.be&&(this.kj.be=Ej(this.kj.be,Pj),this.Yga=Ej(a.be,function(c,d){return LMa(a.be[d],b.be[d],this.kj.be[d],!1,!0)},this));this.vn=this.bk=null;MMa(this);this.dM=this.jV=null;NMa(this)} function LMa(a,b,c,d,e){if(!a||!b)return null;var f=Pj(a),g=Pj(a);if(a[H]==Dh&&b[H]==Dh&&a[yy]===b[yy]){a.Ed&&b.Ed&&(g.Ed=b.Ed,c.Ed=Pj(c.Ed));g.ke=Pj(g.ke);Ea(g,Pj(g[jc]));c.ke=Pj(c.ke);Ea(c,Pj(c[jc]));g[jc].Se=b[jc].Se;if(a.wb&&b.wb){g.wb=Yi(g.wb);c.wb=Yi(c.wb);for(var k=g.wb,l=c.wb,n=0;n<k[J];n++){k[n]=Pj(k[n]);l[n]=Pj(l[n]);var q=k[n],s=a.ke.Se(q.ra),s=b.ke.Bk(s);q.aa=b[jc].Se(s)}}if(a[cd]&&b[cd])for(Bw(g,Yi(g[cd])),Bw(c,Yi(c[cd])),k=g[cd],c=c[cd],OU(k),OU(c),n=0;n<k[J];n++)OMa(a,b,a[cd][n],k[n], d,e)}else if(a[cd]&&b[cd]){var u=eP(a[cd],b[cd],function(a,b){return a.ra==b.ra});Bw(f,Fi(a[cd],function(a,b){return null!=u.lV[b]}));Bw(g,Fi(b[cd],function(a,b){return null!=u.mV[b]}));Bw(c,Yi(f[cd]));OU(f[cd]);OU(g[cd]);OU(c[cd])}return[f,g]}function OMa(a,b,c,d,e,f){var g=d.ma,k=a.ke.Se(d.ra),k=b.ke.Bk(k);a=a[jc].Se(d.ra);b=b[jc].Se(k);e&&(e=c.ma[Gz].x-a,g[Gz].x=b+e);f&&(e=c.ma[Gz].y-a,g[Gz].y=b+e)} function OU(a){Y(a,function(b,c){a[c]=Pj(a[c]);b=a[c];b.ma=Pj(b.ma);var d=b.ma;if(d[Gz]){var e=d[Gz];Zw(d,new uP(e.x,e.y))}})}function MMa(a){var b=a.oA,c=a.wM;if(b.k&&c.k){var d=eP(b.k,c.k,function(a,b){return a.id==b.id});a.bk=Fi(b.k,function(a,b){return null!=d.lV[b]});a.vn=Fi(c.k,function(a,b){return null!=d.mV[b]});b.Wa==Bg||b.Wa==QH?(b=b[lz]==Jg?b.Be[0]:b.be[0],c=c[lz]==Jg?c.Be[0]:c.be[0],b[H]==Dh&&c[H]==Dh&&b[yy]===c[yy]?PMa(a,b.ke.Se,b.ke.Bk):QMa(a)):b.Wa==cD&&RMa(a)}} function QMa(a){var b=a.oA.Ba,c=a.wM.Ba;if(b&&c){var d={},e={},f={},g={};Y(b,function(a,b){null!=a[Z]&&(f[a[Z]]=b)});Y(c,function(a,b){null!=a[Z]&&(g[a[Z]]=b)});Y(b,function(a,b){null!=a[Z]&&(d[b]=g[a[Z]])});Y(c,function(a,b){if(null!=a[Z]){var c=f[a[Z]];d[c]!==b&&(c=null);e[b]=c}});Y(b,function(a,b){null!=a[Z]&&e[g[a[Z]]]!==b&&(d[b]=null)});for(var k=0,l=0,n=[],q=[];k<b[J]||l<c[J];)k<b[J]&&null==d[k]?(q[C]({Nw:{Vh:k,iy:!0},Ow:{Vh:l,iy:!1}}),n[C]({data:b[k][Z]}),k++):(l<c[J]&&null==e[l]?(q[C]({Nw:{Vh:k, iy:!1},Ow:{Vh:l,iy:!0}}),n[C]({data:c[l][Z]})):(q[C]({Nw:{Vh:k,iy:!0},Ow:{Vh:l,iy:!0}}),n[C]({data:b[k][Z]}),k++),l++);a.kj.Ba=n;var s=function(a,b){return 0==b?a[0]:b>=a[J]?Ai(a):PU(a[b-1],a[b],0.5)};a.oA.Uc?SMa(a,q,function(a,b,c,d){return b.iy?a[b.Vh*c+d]:s(a,b.Vh*c+d)}):QU(a,q,function(a,b){return b.iy?a[b.Vh]:s(a,b.Vh)})}} function PMa(a,b,c){var d=a.oA.Ba,e=a.wM.Ba;if(d&&e)if(0==d[J]||0==e[J])a.kj.Ba=[],QU(a,[],function(){return null});else{var f=function(a){return b(a[Z])},g=[],k=[];if(d[J]===e[J])for(var l=0;l<d[J];l++)k[C]({Nw:l,Ow:l}),g[C]({data:c(vj(f(d[l]),f(e[l])))});else l=MEa(d,e,f),Y(l,function(a){var b=a.HC;a=a.IC;var l;null!=d[b]&&null!=e[a]&&(l=c(vj(f(d[b]),f(e[a]))));null!=l&&(k[C]({Nw:b,Ow:a}),g[C]({data:l}))});a.kj.Ba=g;a.oA.Uc?SMa(a,k,function(a,b,c,d){return a[b*c+d]}):QU(a,k,function(a,b){return a[b]})}} function RMa(a){function b(a){a=Pj(a);a.S=Pj(a.S);a.S.brush=a.S.brush.o();a.S.brush.dh(0);Sm(a.S.brush,0);a.X=Pj(a.X);mb(a.X,0);return a}var c=a.bk[0].j,d=a.vn[0].j,e=[],f=[],g=[],k={};Y(d,function(a,b){null!=a&&(Qh(k[a.id])||(k[a.id]=[]),k[a.id][C](b))});Dj(c,function(a,b){if(null!=a){var c=a.id&&k[a.id],c=c&&c[rb]();Qh(c)?g[C]({Nw:b,Ow:c}):e[C](a)}});Dj(k,function(a){Y(a,function(a){f[C](d[a])})});QU(a,g,function(a,b){return a[b]});var c=Gi(e,b),l=Gi(f,b);a.bk[0].Kz=Xi(e,l);a.vn[0].Kz=Xi(c,f)} function QU(a,b,c){for(var d=0;d<a.bk[J];d++){for(var e=a.bk[d].j,f=a.vn[d].j,g=[],k=[],l=0;l<b[J];l++){var n=b[l],q=c(e,n.Nw),n=c(f,n.Ow);q&&!q.Ae&&n&&!n.Ae&&(g[C](q),k[C](n))}a.bk[d]=RU(a.bk[d],g);a.vn[d]=RU(a.vn[d],k)}} function SMa(a,b,c){for(var d=0;d<a.bk[J];d++){var e=a.bk[d].j,f=a.vn[d].j,g=[],k=[];if(0<b[J])for(var l=h[xb](e[J]/b[J]),n=h[xb](f[J]/b[J]),q=0;q<b[J];q++){for(var s=b[q],u=0;u<l;u++){var w=c(e,s.Nw,l,u);w&&!w.Ae&&g[C](w)}for(u=0;u<n;u++)(w=c(f,s.Ow,n,u))&&!w.Ae&&k[C](w)}a.bk[d]=RU(a.bk[d],g);a.vn[d]=RU(a.vn[d],k)}}function RU(a,b){var c=Pj(a);c.j=b;return c} function NMa(a){var b=a.oA,c=a.wM;if(b.Ea&&b.Ea.Me&&c.Ea&&c.Ea.Me){var b=b.Ea.Me[0],c=c.Ea.Me[0],d=eP(b,c,function(a,b){return a.id==b.id});a.jV=Fi(b,function(a,b){return null!=d.lV[b]});a.dM=Fi(c,function(a,b){return null!=d.mV[b]});a.kj.Ea=Pj(a.kj.Ea);c=a.kj.Ea;c.ln=Yi(a.dM);c.Me=[c.ln];a=c.ln;for(c=0;c<a[J];++c){a[c]=Pj(a[c]);b=a[c];if(b.ma&&(b.ma=Pj(b.ma),b.ma.F)){b.ma.F=Yi(b.ma.F);for(var e=0;e<b.ma.F[J];e++)b.ma.F[e]=Pj(b.ma.F[e])}b.Wb&&(b.Wb=Pj(b.Wb),b.Wb[Ey]&&tw(b.Wb,b.Wb[Ey].o()));b.re&& (b.re=Pj(b.re),b.re[Ey]&&tw(b.re,Pj(b.re[Ey])))}}}function SU(a,b,c){if(a!==b)if(a&&a[rc]==Rm&&b&&b[rc]==Rm)a=new Rm({fill:Mm(a.gb(),b.gb(),1-c),ae:SU(a.Oe,b.Oe,c),stroke:Mm(a.Qd,b.Qd,1-c),qa:SU(a.Hb,b.Hb,c),Cg:SU(a.Ai,b.Ai,c),cO:a.Hk,gh:a.Qg,pattern:a.fe});else if(Yh(a)&&Yh(b))if(a){if(b){for(var d=[],e=h.min(a[J],b[J]),f=0;f<e;f++)d[C](SU(a[f],b[f],c));a=d}}else a=b;else a=ai(a)||ai(b)?TMa(a,b,c):bi(a)||bi(b)?a:di(a)&&di(b)?a*(1-c)+b*c:null;return a} function TMa(a,b,c){if(!a)return b;if(!b)return a;var d={};Dj(a,function(e,f){Qh(b[f])&&(d[f]=SU(a[f],b[f],c))});return d}function UMa(a,b,c,d,e){b=!e||(c?b>=c.top&&b<=c[Hc]:!1);return(!d||(c?a>=c[G]&&a<=c[Zc]:!1))&&b} function VMa(a,b,c,d,e){a[jc]&&a[jc].Se&&b[jc]&&b[jc].Se&&(c[jc].Se=function(c){var d=a[jc].Se(c);c=b[jc].Se(c);return SU(d,c,e)});a.Ed&&b.Ed&&(c.Ed.aa=SU(a.Ed.aa,b.Ed.aa,e));a.wb&&b.wb&&Y(c.wb,function(c,g){c.aa=SU(a.wb[g].aa,b.wb[g].aa,e);c.O=d(c.aa,c.aa)});a[cd]&&b[cd]&&Y(c[cd],function(c,g){if(c){var k=a[cd][g].ma,l=b[cd][g].ma,n=c.ma;n&&n[Gz]&&(n[Gz].x=SU(k[Gz].x,l[Gz].x,e),n[Gz].y=SU(k[Gz].y,l[Gz].y,e));c.ma&&(k=0<c.ma.F[J],c.O=d((k?c.ma.F[0].x:0)+c.ma[Gz].x,(k?c.ma.F[0].y:0)+c.ma[Gz].y))}})} function PU(a,b,c){if(!a||!b)return null;var d=Pj(a);if(Qh(a.S)||Qh(b.S))d.S=SU(a.S||{},b.S||{},c),d.Cf=SU(a.Cf||{},b.Cf||{},c);Qh(a.ir)&&Qh(b.ir)&&(d.ir=SU(a.ir,b.ir,c));Qh(a.jr)&&Qh(b.jr)&&(d.jr=SU(a.jr,b.jr,c));Qh(a.X)&&Qh(b.X)&&a.X!==b.X&&(d.X=Pj(a.X),Xa(d.X,Mm(a.X[E],b.X[E],1-c)),mb(d.X,SU(Qh(a.X[Kd])?a.X[Kd]:1,Qh(b.X[Kd])?b.X[Kd]:1,c)));null!=a.Jc&&null!=b.Jc&&a.Jc[vz][0][cd]===b.Jc[vz][0][cd]?d.Jc=SU(a.Jc,b.Jc,c):delete d.Jc;return d} KMa[K].interpolate=function(a){var b=this.kj;if(b.Be){var c=function(a,c){return UMa(a,c,b.A,!0,!1)};Dj(b.Be,function(b,d){var e=this.Xga[d];e&&VMa(e[0],e[1],b,c,a)},this)}if(b.be){var d=function(a,c){return UMa(a,c,b.A,!1,!0)};Dj(b.be,function(b,c){var e=this.Yga[c];e&&VMa(e[0],e[1],b,d,a)},this)}if(this.bk&&this.vn){b.k=[];for(var e=0;e<this.bk[J];++e){var f=this.bk[e],g=this.vn[e],k=Pj(g);if(f&&g&&f[H]==g[H]){if(f.j&&g.j){k.j=[];for(var l=0;l<f.j[J];l++)k.j[l]=PU(f.j[l],g.j[l],a);if(f.Kz&&g.Kz)for(l= 0;l<f.Kz[J];l++)k.j[C](PU(f.Kz[l],g.Kz[l],a))}f.ef&&f.ef.ii&&g.ef&&g.ef.ii&&(k.ef=Pj(k.ef),k.ef.ii=SU(f.ef.ii,g.ef.ii,a))}b.k[e]=k}}if(this.jV&&this.dM&&b.Ea&&b.Ea.ln)for(e=0;e<b.Ea.ln[J];e++){f=b.Ea.ln[e];g=this.jV[e];k=this.dM[e];if(f.ma&&f.ma.F&&g.ma&&g.ma.F&&!Si(g.ma.F)&&k.ma&&k.ma.F)for(var n=f.ma.F,q=g.ma.F,s=k.ma.F,u=q[J],l=0;l<n[J];l++){var w=l<u?q[l]:q[u-1];n[l].x=SU(w.x,s[l].x,a);n[l].y=SU(w.y,s[l].y,a)}f.Wb&&f.Wb[Ey]&&g.Wb&&g.Wb[Ey]&&k.Wb&&k.Wb[Ey]&&(l=SU(g.Wb[Ey],k.Wb[Ey],a),tw(f.Wb,new vl(l[G], l.top,l[r],l[A])));f.re&&f.re[Ey]&&g.re&&g.re[Ey]&&k.re&&k.re[Ey]&&tw(f.re,SU(g.re[Ey],k.re[Ey],a))}return b};function TU(a){this.hy=a} TU[K].nv=function(a,b,c,d){var e=[],f=b.Qa,g=a.Qa;if(f.nb!=g.nb||f[ay]!=g[ay])null!=g.nb&&e[C](UU(TG,g.nb,g[ay],c,d)),null!=f.nb&&e[C](UU(UG,f.nb,f[ay],c,d));f.jb!=g.jb&&(null!=g.jb&&(g=g.jb,e[C]({type:TG,data:{row:g,column:null}})),null!=f.jb&&(g=f.jb,e[C]({type:UG,data:{row:g,column:null}})));f=b[Uy].Qa;g=a[Uy].Qa;!g||f&&f.bb==g.bb&&f.Af==g.Af||e[C]({type:TG,data:{row:g.bb,column:g.Af}});!f||g&&f.bb==g.bb&&f.Af==g.Af||e[C]({type:UG,data:{row:f.bb,column:f.Af}});f=b.Ea.Qa;g=a.Ea.Qa;f.ih!=g.ih&&(null!= g.ih&&e[C](UU(TG,g.ih,null,c,d)),null!=f.ih&&e[C](UU(UG,f.ih,null,c,d)));b[ux][cz](a[ux])||e[C]({type:As});Y(e,W(function(a){this[$](a[H],a[Z])},this))};dp(TU[K],function(a,b){hu(this.hy,a,b||null)});function UU(a,b,c,d,e){b=e[b];d==cH?(c=b.Bs,d=null):d=b.Bs;return{type:a,data:{row:c,column:d}}};function VU(a,b){return nj(a.x,b[G],b[G]+b[r])===a.x&&nj(a.y,b.top,b.top+b[A])===a.y?!0:!1};function WMa(a,b){this.Mt=a;this.Lt=b};function XMa(a,b,c,d,e,f,g,k){this.Op=ia(a);this.Pp=ia(c);this.Mp=ia(b);this.Np=ia(d);this.CQ=ia(a);this.DQ=ia(c);this.pQ=ia(b)-ia(a);this.oQ=ia(d)-ia(c);Oa(this,1);this.Tna=e;this.k0=f;this.pba=g;this.EQ=k};function WU(a,b,c){this.kr=c;this.Ja=a;this.oj=b;this.Mf=this.ug=null}T=WU[K];sp(T,function(){return this.Ja});T.Gv=function(a){this.ug=a};T.ey=function(){};T.ay=function(){};T.by=function(){};T.XC=function(){};T.CC=function(){};T.DC=function(){};T.zC=function(){};T.yC=function(){};T.Le=function(){}; T.updateOptions=function(){var a={hAxis:{viewWindowMode:qE,viewWindow:{}},vAxis:{viewWindowMode:qE,viewWindow:{}}};this.Ja.hn=a;this.kr.Mt&&(ga(this.ug.Op)||(a.hAxis.viewWindow.numericMin=this.ug.Op),ga(this.ug.Mp)||(a.hAxis.viewWindow.numericMax=this.ug.Mp));this.kr.Lt&&(ga(this.ug.Pp)||(a.vAxis.viewWindow.numericMin=this.ug.Pp),ga(this.ug.Np)||(a.vAxis.viewWindow.numericMax=this.ug.Np))};function XU(a,b,c){WU[L](this,a,b,c);this.Ka=null}X(XU,WU);T=XU[K];T.ey=function(a){var b=this.oj().getChartAreaBoundingBox();VU(a,b)&&(this.Ka={x:a.x,y:a.y,md:0,Xd:0})};T.ay=function(a){if(this.Ka){var b=a.x;a=a.y;this.Ka={md:b-this.Ka.x,Xd:a-this.Ka.y,x:b,y:a};this.PC()}};T.by=function(){this.Ka=null};T.Le=function(a,b){var c=this.oj().getChartAreaBoundingBox();VU(a,c)&&b()}; T.PC=function(){var a=this.ug;if(a){var b=this.kr,c=this.oj();if(b.Mt){var d=this.Ka.x-this.Ka.md,e=c.getHAxisValue(this.Ka.x)-c.getHAxisValue(d),f=a.Op-e,g=a.Mp-e,d=h.max(f,a.CQ),k=h.min(g,a.CQ+a.pQ);if(a.EQ&&(d===f||0>e)&&(k===g||0<e)||!a.EQ)a.Op=f,a.Mp=g}b.Lt&&(d=this.Ka.y-this.Ka.Xd,c=c.getVAxisValue(this.Ka.y)-c.getVAxisValue(d),b=a.Pp-c,e=a.Np-c,d=h.max(b,a.DQ),k=h.min(e,a.DQ+a.oQ),a.EQ&&(d===b||0>c)&&(k===e||0<c)||!a.EQ)&&(a.Pp=b,a.Np=e);this[az]()}};function YU(a,b,c){WU[L](this,a,b,c);this.Ka=null}X(YU,WU);T=YU[K];T.ey=function(a){var b=this.oj().getChartAreaBoundingBox();VU(a,b)&&(this.Ka={Qt:a.x,Tl:a.y,z0:0,A0:0})}; T.ay=function(a){if(this.Ka){var b=this.oj().getChartAreaBoundingBox(),c=this.kr;this.u0(a,b);this.Ka.z0=a.x;this.Ka.A0=a.y;if(c.Mt){a=h.min(this.Ka.Qt,this.Ka.z0);var d=h.abs(this.Ka.Qt-this.Ka.z0)}else a=b[G],d=b[r];c.Lt?(c=h.min(this.Ka.Tl,this.Ka.A0),b=h.abs(this.Ka.Tl-this.Ka.A0)):(c=b.top,b=b[A]);this[hq]().Jh={left:a,top:c,width:d,height:b,color:SC,opacity:0.2}}};T.by=function(){this.Ka&&(this.PC(),this.Ka=null)}; T.PC=function(){var a=this.kr,b=this.ug,c=this.oj(),d=this[hq]().Jh,e=c.getHAxisValue(d[G]),f=c.getHAxisValue(d[G]+d[r]),g=c.getVAxisValue(d.top),c=c.getVAxisValue(d.top+d[A]);if(e!==f&&g!==c){d=b.pQ*b.k0;if(a.Mt){var k=h.min(e,f),e=h.max(e,f);e-k<d&&(e=(k+e)/2,k=e-d/2,e+=d/2);b.Op=k;b.Mp=e}f=b.oQ*b.k0;a.Lt&&(a=h.min(g,c),g=h.max(g,c),g-a<f&&(e=(a+g)/2,a=e-f/2,g=e+f/2),b.Pp=a,b.Np=g);this[az]()}};T.u0=function(a,b){a.x=nj(a.x,b[G],b[G]+b[r]);a.y=nj(a.y,b.top,b.top+b[A])};function ZU(a,b,c){WU[L](this,a,b,c);this.Ka=null}X(ZU,WU);T=ZU[K];T.XC=function(a){var b=this.oj().getChartAreaBoundingBox();VU(a,b)&&(this.Ka={x:a.x,y:a.y,scale:a.gesture[Fy],kba:1})};T.CC=function(a){if(this.Ka){var b=this.oj().getChartAreaBoundingBox();this.u0(a,b);this.Ka.kba=this.Ka[Fy];Oa(this.Ka,a.gesture[Fy]);this.PC()}};T.DC=function(){this.Ka&&(this.PC(),this.Ka=null)}; T.PC=function(){var a=this.ug,b=this.oj();if(a){var c=1-(this.Ka.kba-this.Ka[Fy]),d=b.getHAxisValue(this.Ka.x),e=a.Mp-d;a.Op=d-(d-a.Op)/c;a.Mp=d+e/c;b=b.getVAxisValue(this.Ka.y);d=a.Np-b;a.Pp=b-(b-a.Pp)/c;a.Np=b+d/c;this[az]()}};T.u0=function(a,b){a.x=nj(a.x,b[G],b[G]+b[r]);a.y=nj(a.y,b.top,b.top+b[A])};function $U(a,b,c){WU[L](this,a,b,c)}X($U,WU);$U[K].yC=function(){var a=this.ug;Oa(a,1);a.Op=a.CQ;a.Mp=a.CQ+a.pQ;a.Pp=a.DQ;a.Np=a.DQ+a.oQ;this[az]()};function aV(a,b,c){WU[L](this,a,b,c)}X(aV,WU);aV[K].zC=function(a,b){var c=this.kr,d=this.oj().getChartAreaBoundingBox();if(VU(a,d)){b();d=this.ug;if(0>a.wheelDelta){if(d[Fy]>=d.Tna)return;Oa(d,d[Fy]*d.pba)}else{if(d[Fy]<=d.k0)return;Oa(d,d[Fy]/d.pba)}if(c.Mt){var e=(d.Mp+d.Op)/2,f=d.pQ*d[Fy]/2;d.Op=e-f;d.Mp=e+f}c.Lt&&(c=(d.Np+d.Pp)/2,e=d.oQ*d[Fy]/2,d.Pp=c-e,d.Np=c+e);this[az]()}};var YMa=[{isEnabled:function(a){a=a.R(sE);return null==a||Yh(a)&&Ri(a,wta)?!0:!1},constructor:XU},{isEnabled:function(a){a=a.R(sE);return Yh(a)&&Ri(a,xta)?!0:!1},constructor:YU},{isEnabled:function(a){a=a.R(sE);return null==a||Yh(a)&&Ri(a,Yya)?!0:!1},constructor:$U},{isEnabled:function(a){a=a.R(sE);return Yh(a)&&Ri(a,Xxa),!1},constructor:ZU},{isEnabled:function(a){a=a.R(sE);return null==a||Yh(a)&&Ri(a,cza)?!0:!1},constructor:aV}];function ZMa(a,b,c,d){if(c.R(Ah)===cH)throw m("Cannot use explorer with a pie chart");this.b=c;this.Ja=a;this.kr=null;this.oj=b;this.Q=d;this.Mf=this.ug=null;this.Tn=[];$Ma(this,d)}T=ZMa[K]; T.Gv=function(){var a=this.oj(),b=a.getChartAreaBoundingBox(),c=a.getHAxisValue(b[G]),d=a.getHAxisValue(b[G]+b[r]),e=a.getVAxisValue(b.top+b[A]),a=a.getVAxisValue(b.top),b=sn(this.b,Zta,4),f=sn(this.b,Yta,0.25),g=sn(this.b,$ta,1.5),k=pn(this.b,Xta,!1);this.ug=new XMa(c,d,e,a,b,f,g,k);Y(this.Tn,function(a){a.Gv(this.ug)},this)}; function $Ma(a,b){var c=b.Be[0],d=b.be[0],c=!b.Be[1]&&c[H]===Dh&&!c.xo,d=!b.be[1]&&d[H]===Dh&&!d.xo,e=a.b.R(rE)[Oz];e===Jg?d=!1:e===Eh&&(c=!1);a.kr=new WMa(c,d);Y(YMa,function(a){a[Ay](this.b)&&this.Tn[C](new a[rc](this.Ja,this.oj,this.kr))},a)}T.ey=function(a){Y(this.Tn,function(b){b.ey(a)},this)};T.ay=function(a){Y(this.Tn,function(b){b.ay(a)},this)};T.by=function(a){Y(this.Tn,function(b){b.by(a)},this)};T.yC=function(a){Y(this.Tn,function(b){b.yC(a)},this)}; T.zC=function(a,b){Y(this.Tn,function(c){c.zC(a,b)},this)};T.Le=function(a,b){Y(this.Tn,function(c){c.Le(a,b)},this)};T.XC=function(a,b){Y(this.Tn,function(c){c.XC(a,b)},this)};T.CC=function(a,b){Y(this.Tn,function(c){c.CC(a,b)},this)};T.DC=function(a,b){Y(this.Tn,function(c){c.DC(a,b)},this)};var aNa=[{isEnabled:function(a){return a.R(rE)?!0:!1},constructor:ZMa}];function bNa(a,b,c,d){this.b=a;this.n=b;this.oj=c;this.Q=d;this.Un=[];this.Xa=null;cNa(this)}function cNa(a){a.b&&Y(aNa,function(a){a[Ay]&&a[Ay](this.b)&&this.Un[C](new a[rc](this.n,this.oj,this.b,this.Q))},a)}T=bNa[K];T.by=function(a){Y(this.Un,function(b){b.by(a)});WN(this.Xa,15)};T.ay=function(a){Y(this.Un,function(b){b.ay(a)});WN(this.Xa,5)};T.ey=function(a){Y(this.Un,function(b){b.ey(a)});WN(this.Xa,5)};T.zC=function(a,b){Y(this.Un,function(c){c.zC(a,b)});WN(this.Xa,5)}; T.yC=function(a){Y(this.Un,function(b){b.yC(a)});WN(this.Xa,5)};T.Le=function(a,b){Y(this.Un,function(c){c.Le(a,b)})};T.XC=function(a,b){Y(this.Un,function(c){c.XC(a,b)})};T.CC=function(a,b){Y(this.Un,function(c){c.CC(a,b)});WN(this.Xa,5)};T.DC=function(a,b){Y(this.Un,function(c){c.DC(a,b)});WN(this.Xa,15)};T.Gv=function(){Y(this.Un,function(a){a.Gv()})};function bV(a,b,c,d,e,f){this.Q=a;this.Ja=b;this.Ql=c;this.yf=d;this.Xa=new VN(e);Vs(this,this.Xa);this.co=f;this.co.Xa=this.Xa;this.XV()}X(bV,Us);T=bV[K];T.w=function(){qt(this.Ql);bV.e.w[L](this)};T.qoa=function(a){Ea(this.Ja[iy],a[Z].ub);WN(this.Xa,5)};T.roa=function(){};T.toa=function(a){Ea(this.Ja[iy],a[Z].ub);this.yf[$](SG,{targetID:a[Z].ne,x:a[Z].ub.x,y:a[Z].ub.y})};T.uoa=function(a){this.yf[$](xxa,{targetID:a[Z].ne,x:a[Z].ub.x,y:a[Z].ub.y})}; T.soa=function(a){var b={targetID:a[Z].ne,x:a[Z].ub.x,y:a[Z].ub.y};this.yf[$](wxa,b);this.co.Le(b,a[Z][Hp])};T.loa=function(a){this.yf[$](Fr,{targetID:a[Z].ne,x:a[Z].ub.x,y:a[Z].ub.y})};T.yoa=function(a){a={targetID:a[Z].ne,x:a[Z].ub.x,y:a[Z].ub.y};this.yf[$](HH,a);this.co.yC(a)};T.moa=function(a){this.yf[$](YD,{targetID:a[Z].ne,x:a[Z].ub.x,y:a[Z].ub.y})};T.zoa=function(a){var b={targetID:a[Z].ne,x:a[Z].ub.x,y:a[Z].ub.y,wheelDelta:a[Z].wheelDelta};this.yf[$](SH,b);this.co.zC(b,a[Z][Hp])}; T.ooa=function(a){a={targetID:a[Z].ne,x:a[Z].ub.x,y:a[Z].ub.y};this.yf[$](zta,a);this.co.ey(a)};T.poa=function(a){a={targetID:a[Z].ne,x:a[Z].ub.x,y:a[Z].ub.y};this.yf[$](iE,a);this.co.ay(a)};T.noa=function(a){a={targetID:a[Z].ne,x:a[Z].ub.x,y:a[Z].ub.y};this.yf[$](yta,a);this.co.by(a)};T.woa=function(a){this.co.XC({targetID:a[Z].ne,x:a[Z].ub.x,y:a[Z].ub.y,gesture:a[Z].Fba},a[Z][Hp])};T.xoa=function(a){this.co.CC({targetID:a[Z].ne,x:a[Z].ub.x,y:a[Z].ub.y,gesture:a[Z].Fba},a[Z][Hp])}; T.voa=function(a){this.co.DC({targetID:a[Z].ne,x:a[Z].ub.x,y:a[Z].ub.y,gesture:a[Z].Fba},a[Z][Hp])};T.joa=function(a){this.Ja.Qa.jb=a[Z].Ji;WN(this.Xa,50)};T.koa=function(){Ea(this.Ja[iy],null);this.Ja.Qa.jb=null;WN(this.Xa,50)};T.ioa=function(a){var b=this.Q;this.Ja[iy].t4=this.Ja[iy][jc].o();MN(this.Ja[ux],b.Ba[a[Z].Ji].Bs,b.Gy==oh);WN(this.Xa,0)};T.Aba=function(a){this.Q.Wa!=cD&&(this.Ja.Ea.Qa.ih=a[Z].mP,WN(this.Xa,50))};T.Bba=function(){this.Q.Wa!=cD&&(this.Ja.Ea.Qa.ih=null,WN(this.Xa,250))}; T.Doa=function(a){this.Q.Wa!=cD&&(dNa(this,a[Z].mP),WN(this.Xa,0))};T.Eoa=function(a){null==this.Ja.Ea.vB&&(this.Ja.Ea.vB=0);this.Ja.Ea.vB+=a[Z].jma;WN(this.Xa,0)};T.d9=function(a){if(this.Q.Wa!=cD){var b=this.Q.By;if(this.Q.Fh==WH||b==gE)this.Ja.Qa.nb=a[Z].kc,WN(this.Xa,50)}};T.K$=function(){if(this.Q.Wa!=cD){var a=this.Q.By;if(this.Q.Fh==WH||a==gE)this.Ja.Qa.nb=null,WN(this.Xa,250)}};T.Q6=function(a){this.Q.Wa!=cD&&this.Q.Fh==WH&&(dNa(this,a[Z].kc),WN(this.Xa,0))};T.Goa=function(a){this.Aba(a)}; T.Hoa=function(){this.Bba()};T.Foa=function(a){this.yf[$](vya,{index:a[Z].mP})};T.Boa=function(a){this.Q.Fh==WH?this.d9(a):(this.Ja.Qa.nb=a[Z].kc,this.Ja.Qa.datum=a[Z].Ji,WN(this.Xa,50))};T.Coa=function(){this.Q.Fh==WH?this.K$():(cV(this),WN(this.Xa,250))};T.Aoa=function(a){var b=this.Q;if(b.Fh==WH)this.Q6(a);else{var c=b.Gy==oh;a={jb:a[Z].Ji,nb:a[Z].kc};b.Wa==cD?MN(this.Ja[ux],a.jb,c):b.k[a.nb].Eg||(b=b.$V(a),this.Q.Fh==WH?NN(this.Ja[ux],b.Af,c):ON(this.Ja[ux],b.bb,b.Af,c));WN(this.Xa,0)}}; T.x8=function(a){var b=a[Z].fx;-1!=b&&(this.Ja[Uy].Qa={bb:a[Z].Ji,Af:eNa(this,a[Z].kc,b)},cV(this),WN(this.Xa,50))};T.V8=function(a){-1!=a[Z].fx&&(this.Ja[Uy].Qa=null,WN(this.Xa,250))};T.hoa=function(a){var b=this.Q.Gy==oh,c=a[Z].Ji,d=a[Z].kc;a=a[Z].fx;-1==a?this.Ja[Uy].lK={kc:d,$S:c}:ON(this.Ja[ux],c,eNa(this,d,a),b);WN(this.Xa,0)}; T.Ioa=function(a){if(null===a[Z].fx){switch(this.Q.Fh){case WD:this.Ja.Qa.datum=a[Z].Ji;this.Ja.Qa.nb=a[Z].kc;break;case WH:this.Ja.Qa.nb=a[Z].kc;break;case lD:this.Ja.Qa.jb=a[Z].Ji}WN(this.Xa,50)}else this.x8(a)};T.Joa=function(a){if(null===a[Z].fx){switch(this.Q.Fh){case WD:cV(this);break;case WH:this.Ja.Qa.nb=null;break;case lD:Ea(this.Ja[iy],null),this.Ja.Qa.jb=null}WN(this.Xa,750)}else this.V8(a)};T.foa=function(a){this.Ja.wh.Qa.$v=a[Z].$v;WN(this.Xa,50)}; T.goa=function(){this.Ja.wh.Qa.$v=null;WN(this.Xa,250)};T.eoa=function(){this.Ja.wh.Qa[Hy]&&this.Ja.wh.Qa[Hy]();WN(this.Xa,250)};T.Gv=function(){this.co.Gv()};function cV(a){a.Ja.Qa.nb=null;a.Ja.Qa.datum=null}function eNa(a,b,c){a=a.Q;var d=null;if(null!=b)d=a.k[b].oa.annotation;else for(b=0;b<a.Tj[J];++b)d=a.Tj[b].oa.annotation;return d[c]} T.XV=function(){var a=W(function(a,c){kt(this.Ql,a,W(c,this))},this);a(Kra,this.qoa);a(Lra,this.roa);a(Nra,this.toa);a(Ora,this.uoa);a(Mra,this.soa);a(Fra,this.loa);a(Tra,this.yoa);a(Gra,this.moa);a(Ura,this.zoa);a(Jra,this.ooa);a(Hra,this.poa);a(Ira,this.noa);a(Sra,this.woa);a(Qra,this.xoa);a(Rra,this.voa);a(Ara,this.joa);a(Bra,this.koa);a(zra,this.ioa);a(Cwa,this.Aba);a(Dwa,this.Bba);a(Bwa,this.Doa);a(Gwa,this.Eoa);a(hza,this.d9);a(iza,this.K$);a(gza,this.Q6);a(sya,this.Goa);a(tya,this.Hoa);a(rya, this.Foa);a(Xsa,this.Boa);a(Ysa,this.Coa);a(Wsa,this.Aoa);a(Gqa,this.x8);a(Hqa,this.V8);a(Fqa,this.hoa);a(IAa,this.Ioa);a(JAa,this.Joa);a(pqa,this.foa);a(qqa,this.goa);a(oqa,this.eoa)};function dNa(a,b){var c=a.Q,d=c.Gy==oh,e=c.k[b].Bs;c.Wa==cH?MN(a.Ja[ux],e,d):NN(a.Ja[ux],e,d)};function dV(a,b){uS[L](this,a,b);this.OL=this.wf=null}X(dV,uS);dV[K].I6=function(a,b){var c=this.G;if(1>a.k[J])return!1;this.wf=b;for(var d=a.pie.Ih,e=a.k[J]/d[J],f=0;f<d[J];++f){for(var g=d[f].Qc,k=d[f].Rc,l=d[f].hL,n=f*e,q=n+e;n<q&&180>a.k[n].$c;)eV(this,a.k[n],g,k),n+=1;l&&eV(this,l,g,k);for(l=q-1;l>=n;--l)eV(this,a.k[l],g,k)}a.wo&&(this.OL=c.za(),fNa(this,a.wo),c[p](this.wf,this.OL));return!0}; function eV(a,b,c,d){if(b.O){var e=a.G.za(),f=a.Ob,g=f.pie[nx],k=b[by];if(b.Pb){var l=f.pie.Cy,n=b.Pb,q=new YJ;q[Yy](k.x+n.Ue.x,k.y+n.Ue.y);q.Z(k.x+n.Ue.x,k.y+n.Ue.y+l);q.Wf(k.x+g.x,k.y+g.y+l,c,d,n.Fd,n.$c,!0);q.Z(k.x+n.jh.x,k.y+n.jh.y);q.Wf(k.x+g.x,k.y+g.y,c,d,n.$c,n.Fd,!1);a.G.na(q,n.brush,e)}if(b.Fs||b.jv)l=f.pie.Cy,f=new YJ,f[Yy](k.x+g.x,k.y+g.y),f.Z(k.x+g.x,k.y+g.y+l),b.jv&&(f.Z(k.x+b.jh.x,k.y+b.jh.y+l),f.Z(k.x+b.jh.x,k.y+b.jh.y)),b.Fs&&(f.Z(k.x+b.Ue.x,k.y+b.Ue.y+l),f.Z(k.x+b.Ue.x,k.y+b.Ue.y)), a.G.na(f,b.jK,e);f=b.cv?b.cv.brush:b.brush;b.mq?0==b.ED&&0==b.Ry?a.G.Nj(g.x,g.y,c,d,f,e):(n=new YJ,n[Yy](g.x,g.y-d),n.Wf(g.x,g.y,c,d,0,180,!0),n.Wf(g.x,g.y,c,d,180,360,!0),n[Yy](g.x,g.y-b.Ry),n.Wf(g.x,g.y,b.ED,b.Ry,360,180,!1),n.Wf(g.x,g.y,b.ED,b.Ry,180,0,!1),n[vy](),a.G.na(n,f,e)):(n=new YJ,n[Yy](k.x+b.My.x,k.y+b.My.y),n.Z(k.x+b.Ue.x,k.y+b.Ue.y),n.Wf(k.x+g.x,k.y+g.y,c,d,b.Fd,b.$c,!0),n.Z(k.x+b.Es.x,k.y+b.Es.y),n.Wf(k.x+g.x,k.y+g.y,b.ED,b.Ry,b.$c,b.Fd,!1),a.G.na(n,f,e));b.li&&gNa(a,b.li,e);if(c=b.an){c.Pb&& (d=new YJ,d[Yy](c.Pb.Ue.x,c.Pb.Ue.y),d.Z(c.Pb.Ue.x,c.Pb.Ue.y+l),d.Wf(c.Pb.qh.x,c.Pb.qh.y+l,c.Pb.Qc,c.Pb.Rc,c.Pb.Fd,c.Pb.$c,!0),d.Z(c.Pb.jh.x,c.Pb.jh.y),d.Wf(c.Pb.qh.x,c.Pb.qh.y,c.Pb.Qc,c.Pb.Rc,c.Pb.$c,c.Pb.Fd,!1),a.G.na(d,c.Pb.brush,e));if(c.Fs||c.jv)d=new YJ,d[Yy](c.dz.x,c.dz.y),d.Z(c.nK.x,c.nK.y),d.Z(c.nK.x,c.nK.y+l),d.Z(c.dz.x,c.dz.y+l),d.Z(c.dz.x,c.dz.y),a.G.na(d,c.jK,e);gNa(a,c,e)}b.cT&&a.G.Pd(b[cd],b.dT.x+k.x,b.dT.y+k.y,b.pK[r],nI,nI,b.X,e);k=AN([gI,b[nc]]);e=e.a();a.qe(a.wf,k,e);b.vb&&(e=AN([Hs, b[nc]]),a.kE(b.vb,e))}}function gNa(a,b,c){if(b.mq)a.G.Nj(b.qh.x,b.qh.y,b.Qc,b.Rc,b.brush,c);else{var d=new YJ;d[Yy](b.Ue.x,b.Ue.y);d.Wf(b.qh.x,b.qh.y,b.Qc,b.Rc,b.Fd,b.$c,!0);a.G.na(d,b.brush,c)}} function fNa(a,b){for(var c=W(a.Is,a),d=W(a[Bx],a),e=a.G,f=a.OL,g=0;g<b[J];++g){var k=b[g],l=e.za(),n=e.za(),q=new YJ;q[Yy](k.Ei.x+0.5,k.Ei.y+0.5);q.Z(k.b4+0.5,k.Ei.y+0.5);q.Z(k.b4+0.5,k.Iq.y+0.5);q.Z(k.Iq.x+0.5,k.Iq.y+0.5);e.na(q,k.$d,n);e.Zd(k.Ei.x+0.5,k.Ei.y+0.5,k.a4,k.lfa,n);c(k.$y,l);c(k.az,l);e[p](f,l);e[p](f,n);k=AN([FF,k[nc]]);d(l.a(),k)}} dV[K].d3=function(a,b){if(!gn(b.wo,this.gq.wo)){this.G.cd(this.OL);var c=new sO(2);tO(c,0,a.wo||{});tO(c,1,b.wo||{});c=c[My]();fNa(this,c)}this.oK(a);this.j0(a,b)};dV[K].oK=function(a){var b=this.gq;if(b)for(var c in b.k){if(b.k[c].vb){var d=AN([Hs,ia(c)]);wS(this,d)}d=a.pie.Ih[c<a.k[J]/a.pie.Ih[J]?0:1];eV(this,a.k[c],d.Qc,d.Rc)}};dV[K].j0=function(a,b){for(var c in b.k){var d=new sO(2);tO(d,0,a.k[c]);tO(d,1,b.k[c]);var e=a.pie.Ih[c<a.k[J]/a.pie.Ih[J]?0:1],f=e.Qc,e=e.Rc;eV(this,d[My](),f,e)}};function hNa(a,b,c,d,e){var f=a[Zc]-a[G],g=Pj(d),k=Pj(d);Xa(k,qna);d=d[uc]/3.236;var l=g[uc]+d,n=k[uc]+d,q=iNa(a,f,b,g,k,d,e),s=[],u;2==c?(c=a[Zc],a=a[G],u=oE):(c=a[G],a=a[Zc],u=nI);for(var w=0;w<e[J];++w){var z=e[w],B=q[w];if(null!=B){var F=UN(b,z.$y,g,f,B.lH),M=UN(b,z.az,k,f,B.mH),N=SKa(new kK(c,B.y));s[C]({a4:2,Ei:SKa(z.N4(nj(B.y,z.HL[y],z.HL.end))),b4:a,Iq:N,lfa:new Rm({fill:$A,ae:0.7}),$d:new Rm({stroke:$A,qa:1,Cg:0.7}),Cta:d,$y:{text:z.$y,X:g,anchor:new uP(N.x,N.y),F:Gi(F.F,function(a,b){return{x:0, y:(b-F.F[J])*l,length:F.Kg,text:a}}),Cc:u,Bc:nI,vb:F.ge?z.$y:O,Cb:0},zta:g,az:{text:z.az,X:k,anchor:new uP(N.x,N.y),F:Gi(M.F,function(a,b){return{x:0,y:(b+1)*n,length:M.Kg,text:a}}),Cc:u,Bc:oE,vb:M.ge?z.az:O,Cb:0},Bta:k,Ata:u,index:z[nc]})}}return s} function iNa(a,b,c,d,e,f,g){var k=d[uc]+f,l=e[uc]+f,n=Gi(g,function(a,g){var k=UN(c,a.$y,d,b,ea),l=UN(c,a.az,e,b,ea);return{bJ:g,Y_:a.V6,Zx:a.V6,lH:k.F[J],mH:l.F[J],WQ:f,XQ:f}});cj(n,function(a,b){return a.Zx-b.Zx});n=Yi(n);cj(n,function(a,b){return g[a.bJ].U6-g[b.bJ].U6});var q=[];0<n[J]&&q[C](n.pop());for(var s=null,u=0,w;w=fV(a,k,l,g,q,!1),!(0===n[J]||w.cJ&&15<u);)w.cJ?(u++,s&&Wi(q,s)):u=0,s=n.pop(),q[C](s),cj(q,function(a,b){return a.Zx-b.Zx});w.cJ&&s&&(Wi(q,s),w=fV(a,k,l,g,q,!1));a=fV(a,k,l, g,q,!0);a.cJ||(w=a);return w[tx]}function fV(a,b,c,d,e,f){0<e[J]&&(e[0].WQ=0,Ai(e).XQ=0);for(var g=0;g<e[J];g++){var k=e[g],l=e[g-1],n=e[g+1],n=n?d[n.bJ].HL.end-5:a[Hc];k.Bca=new zm(h.min(k.Y_,l?d[l.bJ].HL[y]+5:a.top),h.max(k.Y_,n))}a=jNa(a,b,c,e,f);d=!1;f={};for(g=0;g<e[J];g++){var k=e[g],l=a[g],n=(l[Gz]-l.top-k.WQ)/b,q=(l[Hc]-l[Gz]-k.XQ)/c,n=h[t](n+0.1),q=h[t](q+0.1),s=n<k.lH||q<k.mH;d=d||s;f[k.bJ]={y:l[Gz],lH:n,mH:q,cJ:s}}return{layout:f,cJ:d}} function jNa(a,b,c,d,e){var f=Ej(d,function(a){return{anchor:a.Zx,top:a.Zx-(a.lH*b+a.WQ),bottom:a.Zx+(a.mH*c+a.XQ)}}),g=[];g[C](function(b,c){var d=b[c].top;return 0==c?{top:h.max(a.top-d,0)}:{top:h.max(b[yi(c)-1][Hc]-d,0)/2}});g[C](function(b,c){var e=b[c][Hc];return c==d[J]-1?{bottom:h.min(a[Hc]-e,0)}:{bottom:h.min(b[yi(c)+1].top-e,0)/2}});g[C](function(a,c,f){var g=a[c][Gz]-a[c].top;a=h.max(-g,0);c=d[c];c=h.max(c.lH*b+c.WQ-h.max(g,0),0);f=(a+c*(e?1:f))/2;return{anchor:f,top:-f}});g[C](function(a, b,f){var g=a[b][Hc]-a[b][Gz];a=h.max(-g,0);b=d[b];b=h.max(b.mH*c+b.XQ-h.max(g,0),0);f=(a+b*(e?1:f))/2;return{anchor:-f,bottom:f}});g[C](function(a,b){var c=a[b][Gz],e=d[b];return{anchor:nj(c,e.Bca[y],e.Bca.end)-c}});e&&g[C](function(a,b,c){return{anchor:(d[b].Y_-a[b][Gz])*c}});var k=NEa(f,g,function(a,b){return{anchor:a[Gz]+(b[Gz]||0),top:a.top+(b.top||0),bottom:a[Hc]+(b[Hc]||0)}},function(a,b){return h.max(h.abs(a[Gz]-b[Gz]),h.abs(a.top-b.top),h.abs(a[Hc]-b[Hc]))});return Gi(d,function(a,b){var c= k[String(b)];return{anchor:c[Gz],top:c.top,bottom:c[Hc]}})}function kNa(a,b){var c=Pi(a,function(a){return a[nc]==b});if(0>c)return{};var d={};d[c]={a4:4,$d:new Rm({stroke:$A,qa:2,Cg:0.7})};return d};function gV(a,b,c,d,e){this.sb=b.R(ND,tP);this.B5=sn(b,Wxa,0);this.Fga=0>sn(b,qg,1);WS[L](this,a,b,c,d,e)}X(gV,WS);Ma(gV[K],function(){this.L.Fh=WH;this.L.Uc=pn(this[eq],Pva);this.L.Fc&=!this.L.Uc;this.L.Uc&&(this.L.eh=this.L.eh||{},this.L.eh.pie=this.L.eh.pie||{},this.L.eh.pie.h3=this[eq].R(jta,!0),this.L.eh.pie.hT=this[eq].R(fta,0.6));for(var a=0;a<this.Nb.M();a++)if(0>this.Nb[I](a,1))throw m("Negative values are invalid for a pie chart.");gV.e[Fc][L](this)});gV[K].u6=function(){return zs}; gV[K].t6=function(){return null}; gV[K].s6=function(){var a=this.L;if(this.Nb.D(0)!=rh)throw m("Pie chart should have a first column of type string");var b;b=this.L;var c=b.A,d=this.kf[zy](),e=null,f=null,g=h[D](1.618*b.Nl),e=h[D](c[r]*(1-1/1.618)-g);d==Qg?(f=new rl(c.top,c[G]+e,c[Hc],c[G]),e=new rl(c.top,c[Zc],c[Hc],f[Zc]+g)):d==zs?(f=new rl(c.top,c[Zc],c[Hc],c[Zc]-e),e=new rl(c.top,f[G]-g,c[Hc],c[G])):d==YC?(e=new rl(c.top,c[Zc],c.top+1/1.618*(c[Hc]-c.top-g),c[G]),f=new rl(e[Hc]+g,c[Zc],c[Hc],c[G])):e=new rl(c.top,c[Zc],c[Hc],c[G]); var c=0,d=h.min(e[Zc]-e[G],e[Hc]-e.top),k=g=h[t](d/2),d=h[D]((e[Zc]+e[G])/2),e=h[D]((e[Hc]+e.top)/2);b.Fc&&(k*=0.8,c=g/5,e-=c/2);if(b.Uc){var l={Qc:g*b.eh.pie.hT,Rc:k*b.eh.pie.hT},g={Qc:g,Rc:k};b={pie:{center:new kK(d,e),Qc:g.Qc,Rc:g.Rc,Cy:c,Ih:b.eh.pie.h3?[l,g]:[g,l]},Ea:f}}else b={pie:{center:new kK(d,e),Qc:g,Rc:k,Cy:c,Ih:[{Qc:g,Rc:k}]},Ea:f};lNa(this,b);f=this.kf[zy]();b.Ea?this.kf.Go(b.Ea):f==WC?this.kf.Go(mNa(this)):f==BF&&nNa(this,a.A,b,this.kf.ta)}; function oNa(a,b,c){var d=a.L,e={},f=Cn(a[eq],eH,O);a=b[E];var g=b.tb;b=b.Mi;var k;d.Fc?(d=a,k=g,f=b):k=d=f;e.normal=new Rm({stroke:d,qa:1,fill:a,ae:null!=c?c:1});e.tb=new Rm({stroke:k,qa:1,fill:g,ae:null!=c?c:1});e.Mi=new Rm({stroke:f,qa:1,fill:b,ae:null!=c?c:1});return e}function mNa(a){var b=a.L,c=b[A]-b.A[Hc];a=a.kf.ta[uc];var d=[];d[C]({min:2,Tc:[ea]});var e=d[J];d[C]({min:a+2,Tc:[ea]});c=aP(d,c);return c[J]>e?(c=b.A[Hc]+c[e],new rl(c-a,b.A[Zc],c,b.A[G])):null} function lNa(a,b){var c=a.L,d=a.Nb,e=b.pie[nx],f=b.pie.Cy,g=d.M(),k=NS(Cn(a[eq],Txa,O)),l=oNa(a,k,1),n=Ln(a[eq],Vxa,{Va:c.Kj,fontSize:c.Nl}),q=Gn(a[eq],fH,lFa,c.Uc?R:bH),s=Gn(a[eq],FAa,mFa,kg),u=xn(a[eq],Vza,1/720),w=pn(a[eq],tta),z=zn(a[eq],Uxa,Woa),B=xn(a[eq],dH,0);a[eq][Yva]=2;c.k=[];c.dn=[];var F,M,N;c.Uc?(F=a[eq].R(eta,0.01),F=c.eh.pie.hT*(1+F),F=c.eh.pie.h3?[0,F]:[F,0],M=[!1,!0],N=[a[eq].R(cE,0.5),a[eq].R(bE,1)]):(F=[0],M=[!0],N=[1]);c.pie={center:e,Cy:f,Qc:b.pie.Qc,Rc:b.pie.Rc,Ih:[]};for(var f= W(function(a,b){var d=c.k[a];if(1==b)hV(d,s,d);else{var e=c.k[a-g];hV(d,s,d,e);hV(e,s,d,e)}},a),P=W(function(a){var b=c.pie.Ih[a-1].hL,d=c.pie.Ih[0].hL;1==a&&b?hV(b,s,b):1<a&&(b&&d?(hV(b,s,b,d),hV(d,s,b,d)):b?(d={oz:Oe,Pe:Oe},hV(b,s,b,d)):d&&(b={oz:Oe,Pe:Oe},hV(d,s,b,d)))},a),ba=W(function(a,b,d,e,f){c.Uc?c.dn[C]({id:a,text:b,brush:new Rm({gh:{lg:d,Tf:d,Wy:N[0],Xy:N[1],x1:QA,y1:PA,hb:PA,kb:PA,sv:!0,uK:!0}}),index:e,O:f}):c.dn[C]({id:a,text:b,brush:new Rm({fill:d}),index:e,O:f})},a),U=c.pie.Ih,qa= b.pie.Ih,ya=qa[J],Ha=0,Aa=0;Aa<ya;++Aa){for(var Wc=qa[Aa],cb=null,kc=Wc.Qc,Wc=Wc.Rc,kd=F[Aa],Mb=M[Aa],Oc=0,Vd=0,Tf=0,Uf=0;Uf<g;Uf++)Tf+=d[I](Uf,Aa+1)||0;for(Uf=0;Uf<g;++Uf){var Ce=d[I](Uf,Aa+1)||0,gq=d.Aa(Uf,Aa+1),Gf=d[I](Uf,0),Di=d.Aa(Uf,0),hj=Vd/Tf,Hf=hj+Ce/Tf,sg=Hf-hj>=u;sg?Vd+=Ce:Oc+=Ce;var $r=Wza+Ha,Ro=a[eq].R($r+Mma,a.sb[Uf%a.sb[J]]),Ro=NS(Ro),hx=oNa(a,Ro,N[Aa]),XA=sn(a[eq],$r+Sma,0),jq=xn(a[eq],$r+Pma,B)+kd,tg=Ln(a[eq],$r+Uma,n),Ce=pNa(a,Ha,Uf,hj,Hf,Ce,gq,Di,sg,e,kc,Wc,jq,XA,q,tg,Ro,hx);c.k[C](Ce); sg=pn(a[eq],$r+Wma,Mb&&(sg||w));ba(Gf,Di,Ro[E],Ha,sg);Aa==ya-1&&f(Ha,ya);Ha+=1}0<Oc&&(hj=1-Oc/Tf,Hf=1,Ce=Oc,gq=String(Oc),Di=z,cb=pNa(a,-1,-1,hj,Hf,Ce,gq,Di,!0,e,kc,Wc,B+kd,0,q,n,k,l),Mb&&!w&&ba(O,Di,k[E],-1,!0));U[C]({Qc:kc,Rc:Wc,hL:cb});Aa==ya-1&&P(ya)}}function iV(a,b){switch(b){case bH:return a.oz;case Dh:return a.Pe;case kg:return a.Pe+Yka+a.oz+Ge}return O} function pNa(a,b,c,d,e,f,g,k,l,n,q,s,u,w,z,B,F,M){var N=a.L;if(N.Fc||1<=u)u=0;var P={},ba=e-d;Fw(P,f);P.Pe=g;Xa(P,F);P.ce=M;P.brush=P.ce.normal;Ap(P,k);np(P,b);P.Bs=0<=c?a.Nb.cn(c):null;P.O=l;b=q*u;u*=s;P.ED=b;P.Ry=u;P.Fd=360*d+a.B5;P.$c=360*e+a.B5;a.Fga&&(c=360-P.Fd,P.Fd=360-P.$c,P.$c=c);c=h.PI*(P.Fd-90)/180;f=h.PI*(P.$c-90)/180;P.oz=h[D](1E3*ba)/10+we;k=O;switch(z){case bH:k=P.oz;break;case zF:k=P[uz];break;case Dh:k=g;break;case oBa:k=g+Yka+P.oz+Ge}Bw(P,k);if(!l)return P;P.X=B;a=a.Ac(P[cd],B)[r]; B=B[uc];P.pK=new xk(a,B);P.mq=1==ba;if(P[cd])if(P.mq)P.dT=mK(n,new kK(a/2,B/2)),P.cT=!0;else{ba=q-B;B=s-B;a=P.pK;a=new xk(a[r]/ba,a[A]/B);g=new xk(2/ba,2/B);l=OT((c+f)/2+h.PI,1,1);i:{z=WKa(new kK(0,0),a);k=1;F=h.min;for(M=0;M<z[J];++M){var U;var qa=z[M];U=l.x*qa.x+l.y*qa.y;qa=U*U+1-(qa.x*qa.x+qa.y*qa.y);0>qa?U=null:(qa=h[ud](qa),U=[U-qa,U+qa]);if(null===U||0>U[1]){z=null;break i}k=F(k,U[1])}z=k}if(0.4>z)a=null;else{l=l.o();l[Fy](-z);a=UKa(a,g,g);i:{a=WKa(l,a);g=oj(f-c,2*h.PI);z=0;k=g;for(F=0;F<a[J];++F){M= oj(h[sd](a[F].y,a[F].x)-c,2*h.PI);if(M>=g||0==M){a=!1;break i}k=h.min(M,k);z=h.max(M,z)}a=z-k<h.PI}a=a?l:null}ba=a&&new kK(a.x*ba,a.y*B);null!==ba&&(P.cT=!0,P.dT=TKa(n,ba,new kK(-P.pK[r]/2,-P.pK[A]/2)))}else P.cT=!1;P.offset=OT((c+f)/2,q,s)[Fy](w);w=OT(f,q,s);P.Ue=lK(n,OT(c,q,s));P.jh=lK(n,w);s=OT(f,b,u);P.My=lK(n,OT(c,b,u));P.Es=lK(n,s);N.Fc&&270>=P.Fd&&90<=P.$c&&(s={},90>P.Fd?(s.Fd=90,s.Ue=new kK(n.x+q,n.y)):(s.Fd=P.Fd,s.Ue=P.Ue),270<P.$c?(s.$c=270,s.jh=new kK(n.x-q,n.y)):(s.$c=P.$c,s.jh=P.jh), s.brush=P.ce.tb,P.Pb=s);P.Fs=N.Fc&&0.5<d;P.jv=N.Fc&&0.5>e;if(P.Fs||P.jv)P.jK=P.ce.tb;return P}function hV(a,b,c,d){c=iV(c,b);d&&(c+=me+iV(d,b));a.de={$l:a[uz],content:c}} function nNa(a,b,c,d){var e=a.L,f=e.pie.Qc,g=e.pie.Rc,k=c.pie[nx],l=Gn(a[eq],Zva,mFa,bH),n=h.PI*(3*(f+g)-h[ud]((3*f+g)*(f+3*g))),q=[];c=[];for(var s=0;s<e.dn[J];++s){var u=e.dn[s];if(u.O){var w;if(0<=u[nc])w=e.k[u[nc]];else{var z=e.pie.Ih;w=z[z[J]-1].hL}var B=h.max((f+w.ED)/2,0.75*f),F=h.max((g+w.Ry)/2,0.75*g),M=(w.$c+w.Fd)/2,z=oj(M,360),N=vj(f-B,g-F)/n*360,P,ba;2*N<w.$c-w.Fd?(P=w.Fd+N,ba=w.$c-N,180>z?ba=h.min(ba,180):P=h.max(P,180)):ba=P=M;var U=function(a){return lK(k,OT(a,B,F))},N=function(a){return U(h.asin(nj((a- k.y)/F,-1,1)))},qa=function(a){return U(h.PI-h.asin(nj((a-k.y)/F,-1,1)))},u={V6:U(qj(M-90)).y,HL:new zm(U(qj(P-90)).y,U(qj(ba-90)).y),$y:u[cd],az:iV(w,l),U6:w[id],index:w[nc]};180>z?(u.N4=N,q[C](u)):(u.N4=qa,c[C](u))}}f=b[r]/2-f-d[uc];e=hNa(new rl(b.top,b[Zc],b[Hc],b[Zc]-f),a.Ac,2,d,q);b=hNa(new rl(b.top,b[G]+f,b[Hc],b[G]),a.Ac,1,d,c);d=[];Zi(d,e,b);a.L.wo=d};function jV(a,b,c){iU[L](this,a,b,c,cH)}X(jV,iU);jV[K].us=function(a){return this.G.Er(a[Mq])};jV[K].Wba=function(a,b){var c=b[pc](qe);switch(c[0]){case gI:c=ia(c[1]);if(0>c)break;this[$](fza+a,{kc:c,Ji:null})}};function kV(a,b,c,d,e,f,g){yU[L](this,a,b,c,d,e,g);var k=pn(a,nE,!0);this.C6=$O(f,function(b){return pn(a,Wza+b+Nma,k)})}X(kV,yU);kV[K].gu=function(a,b,c){this.q2(a,b,c)};kV[K].c3=function(a,b){return a[cz](b,!0)};function lV(a,b){a.k=a.k||{};var c=a.k;c[b]=c[b]||{};return c[b]} kV[K].q2=function(a,b,c){var d={Ob:a,Sj:this.te.getEntries(),qv:c,Yl:b.wh},e=b.wh.Qa.$v;null!=e&&uw(b.wh.Qa,this.te.Tg(e)[Hy]);for(var f=this.Fo.aT,e=f==mh||f==kg,g=f==zg||f==kg,k=this.te&&0<d.Sj[J],f=HN(b[ux]),k=1<f[J]&&k,l=0;l<f[J];++l){var n=f[l],q=a.pie.Ih[J],n=n+a.k[J]/q*(q-1);this.C6[n]&&(qNa(a,n,c),e&&!k&&rNa(this,d,n))}e&&k&&sNa(this,d,f,f[f[J]-1]);var s=W(function(b){if(a.Uc){var c=a.k[J];return[b,(b+c/a.pie.Ih[J])%c]}return[b]},this),e=W(function(b,e){if(null!=b){for(var f=s(b),k=!1,l=0;l< f[J];++l){var n=f[l];if(null!=n&&this.C6[n]){k=k||!0;if(a.Uc){var q=n,P=c,ba=a.k[q];if(null!=ba[by]){var U=ba.brush.o();U.dd(Mm(ba.brush.gb(),re,0.7));U.dh(ba.brush.Oe+0.1);lV(P,q).cv={brush:U}}}else tNa(a,n,c);a.wo&&(c.wo=kNa(a.wo,n))}}e&&g&&k&&rNa(this,d,b)}},this);if(f=b.Jh)c.Jh=f;e(b.Qa.nb,!0);e(b.Ea.Qa.ih,!1)}; function tNa(a,b,c){var d=a.pie;a=a.k[b];if(null!=a[by]){c=lV(c,b);c.an={};b=c.an;b.brush=new Rm({stroke:a.brush.gb(),qa:6.5,Cg:0.3});b.qh=new sk(d[nx].x+a[by].x,d[nx].y+a[by].y);b.Fd=a.Fd;b.$c=a.$c;b.mq=a.mq;var e;(e=c.li)?(c=e.Qc+e.brush.Hb/2,e=e.Rc+e.brush.Hb/2):(e=a.brush.Hb/2,c=d.Qc+e,e=d.Rc+e);d=b.brush.Hb/2;b.Qc=c+d;b.Rc=e+d;c=qj(b.Fd-90);e=qj(b.$c-90);b.Ue=wk(b.qh,OT(c,b.Qc,b.Rc));b.jh=wk(b.qh,OT(e,b.Qc,b.Rc));var f=a.Pb;f&&(b.Pb=b.Pb||{},b.Pb.brush=Zm(f.brush.gb(),0.3),b.Pb.qh=b.qh.o(),b.Pb.Fd= f.Fd,b.Pb.$c=f.$c,b.Pb.Qc=b.Qc+d,b.Pb.Rc=b.Rc+d,c=qj(b.Pb.Fd-90),e=qj(b.Pb.$c-90),b.Pb.Ue=wk(b.Pb.qh,OT(c,b.Pb.Qc,b.Pb.Rc)),b.Pb.jh=wk(b.Pb.qh,OT(e,b.Pb.Qc,b.Pb.Rc)));b.Fs=a.Fs;b.jv=a.jv;if(b.Fs||b.jv)b.jK=Zm(a.jK.gb(),0.3),b.kia=b.Fs?c:e,a=function(a,b){return wk(a.qh,OT(a.kia,a.Qc+b*a.brush.Hb/2,a.Rc+b*a.brush.Hb/2))},b.dz=a(b,-1),b.nK=a(b,1)}} function qNa(a,b,c){var d=a.pie;0<d.Cy||(a=a.k[b],null!=a[by]&&(b=lV(c,b),b.li={},b=b.li,b.brush=$m(a.brush.gb(),2),b.qh=new sk(d[nx].x+a[by].x,d[nx].y+a[by].y),b.Fd=a.Fd,b.$c=a.$c,b.mq=a.mq,a=a.brush.Hb/2+2.5+b.brush.Hb/2,b.Qc=d.Qc+a,b.Rc=d.Rc+a,d=qj(b.$c-90),b.Ue=wk(b.qh,OT(qj(b.Fd-90),b.Qc,b.Rc)),b.jh=wk(b.qh,OT(d,b.Qc,b.Rc))))}function rNa(a,b,c){var d=lV(b.qv,c);c=wU(a.Fo,b,c,null,null);d.vb=c;b.Yl&&a.te.gu(c,b.Yl,d.vb)} function sNa(a,b,c,d){var e=lV(b.qv,d);c=uMa(a.Fo,b,c,d);e.vb=c;b.Yl&&a.te.gu(c,b.Yl,e.vb)};function mV(a){pu[L](this,a);this.pi=null;this.ib=Jg;this.Ef=this.Gc=this.b=this.Q=this.M3=null;this.wK=[];this.og=this.Da=this.tv=this.Ja=null;this.Ql=new rt;this.C=null;this.yf=new TU(this);this.$m=null}X(mV,pu);T=mV[K];T.w=function(){this.Wg();Ws(this.Ql);mV.e.w[L](this)};T.sh=null;function uNa(a,b,c,d,e,f){return a.pi===cH?new gV(b,c,d,e,f):a.pi===cF?new DU(b,c,d,e,f):new QT(b,c,d,e,f)}T.Gd=function(a,b,c,d){this.pi=a;null!=b&&(this.Gpa=b);null!=c&&(this.ib=c);null!=d&&(this.M3=d)}; T.Ym=function(a,b,c,d){Xn(NA);c=c||{};c=lo(io(c));vNa(this,c);wNa(this,c);Mw(c,c[lz]||this.ib);c.theme=c.theme||this.M3;this.pi!=R&&xNa(c);if(this.pi!=cH&&on(c.reverseCategories)){var e=c[lz]===Eh?Ls:VE;c[e]=c[e]||{};Qv(c[e],-1);delete c.reverseCategories}yNa(c);Ss.oc(this.lb);if(!b)throw m(LB);Mi(fj(b.H()),function(a){return b.Ss(a)==RG})&&(c.isDiff=!0);this.xv=b.D(0)!=Yg?1:0;this.Nh=b.M();zNa(this);if(c.isStacked&&c.vAxis&&c.vAxis.baseline)throw m("Cannot set a non-zero base-line for a stacked chart"); var f=c.theme||[];Yh(f)||(f=[f]);for(var e=[c],g=0;g<f[J];++g){var k;if(bi(f[g]))k=sJa(f[g]);else if(ai(f[g]))k=f[g];else throw m("Theme should be a theme name or an options object.");e[C](k)}c=c[H][ke]();uFa[c]&&e[C](uFa[c]);e[C](vFa);this.b=new jn(e);this.pi=Gn(this.b,Ah,aFa,R);this.V=On(this.lb,this.b);this.Oa=Pn(this.lb,this.b);c=new xk(this.V,this.Oa);e=pn(this.b,IE);if(!this.Da||this.Da.Mj)try{this.Da=new vK(this.lb,c,a,e)}catch(l){throw m(Lpa);}else this.Da[Pz](c,a);this.Ja=new AU(d);this.t= b;this.Da.Io(W(this.xn,this),a)}; T.xn=function(){var a=this.Da.eb(),b=this.Da.Av(),c;this.og?(c=this.og.z3,this.kq()):c=this.Q;var d=this.b,e=uNa(this,this.t,d,W(a.vf,a),this.V,this.Oa).Ay(),f=new bNa(d,this.Ja,W(this.Bo,this),e);Ws(this.C);this.C=new bV(e,this.Ja,this.Ql,this.yf,W(this.Lh,this,!0),f);var f=new xk(this.V,this.Oa),g={Va:e.Kj,fontSize:e.Nl},k=e.By,l=e.Fh,n=e.k[J],q=this.Ef?this.Ef.te:void 0;this.Ef=e.Wa==cH?new kV(d,f,g,k,l,n,q):new EU(d,f,g,k,l,n,q);Y(this.wK,W(function(a){bi(a)?this.Gi(a):this.Hi(a)},this));this.wK= [];this.Gc=e.Wa==cH?new dV(b,a):new FS(b,a);(a=zIa(d,0,MF))&&c&&c.Wa==e.Wa&&c[r]==e[r]&&c[A]==e[A]&&c.A.top==e.A.top&&c.A[Hc]==e.A[Hc]&&c.A[G]==e.A[G]&&c.A[Zc]==e.A[Zc]?(this.Q=null,b=hi(),this.kq(),this.og={mta:c,y3:e,Oea:new KMa(c,e),z3:c,startTime:b,Ks:b+a[xz],A3:0,timer:new tt(10),Nea:a.u3,nT:a.nT,x3:!1},this.B3(),kt(this.og.timer,Fs,W(this.B3,this)),this.og.timer[y](),this.Q=e):(this.Q=e,ANa(this),BNa(this));this.yf[$](ws);this.C.Gv()}; function nV(a,b){var c=new Ko,d=b.M(),e=b.H(),f=a.D(0)!=Yg;f&&c.mg(a.D(0),a.cb(0));for(var g=f?1:0,k=g;k<e;++k)c.mg({type:a.D(k),label:a.cb(k),role:RG}),c.mg({type:b.D(k),label:b.cb(k),role:Jr});c.Cz(d);for(var l=0;l<d;++l){k=null;f&&(k=b[I](l,0),c.al(l,0,k));for(var n=g,k=g;k<e;++k){var q=a[I](l,k);c.al(l,n,q);n+=1;q=b[I](l,k);c.al(l,n,q);n+=1}}return c} function vNa(a,b){switch(b[H]){case JF:a.Gd(Bg,JF,Jg);ab(b,null);break;case BC:a.Gd(Bg,BC,Jg);ab(b,null);break;case ssa:a.Gd(Bg,KC,Jg);ab(b,null);break;case KC:a.Gd(Bg,KC,Eh);ab(b,null);break;case QH:a.Gd(QH);ab(b,null);break;case cH:a.Gd(cH),ab(b,null)}var c=a.pi;c==R&&(c=null);var d=b[H]||R;d==R&&(d=null);if(!c&&!d)throw m("Unspecified chart type.");if(c&&d&&c!=d)throw m("Incompatible chart types.");ab(b,c||d)} function wNa(a,b){if(b[H]==Bg){var c=a.Gpa;c==R&&(c=null);var d=b.seriesType||R;d==R&&(d=null);if(c&&d&&c!=d)throw m("Incompatible default series types.");b.seriesType=c||d}} function xNa(a){a.hAxis=a.hAxis||{};a.vAxis=a.vAxis||{};var b=a.hAxis,c=a.vAxis,d=null;switch(a[H]){case QH:d=c;break;case Bg:a.targetAxis=a.targetAxis||{},d=a.targetAxis}d&&(oV(a,yG,d,Wg),oV(a,oG,d,Ug),oV(a,PF,d,PF));b&&(oV(a,Rwa,b,PF),oV(a,zAa,b,HI));c&&oV(a,KI,c,HI);a.smoothLine&&!Qh(a.curveType)&&(a.curveType=Bg);oV(a,Kwa,a,LF);oV(a,Vya,a,EH);a.chartArea=a.chartArea||{};oV(a,bra,a.chartArea,HC)} function yNa(a){pV(a,xAa,II,JI);pV(a,Hwa,Ewa,EF);qV(a.hAxis);for(var b in a.hAxes)qV(a.hAxes[b]);qV(a.vAxis);for(b in a.vAxes)qV(a.vAxes[b]);b=a.tooltip;null==b&&(b={},a.tooltip=b);pV(a,LAa,HAa,MAa);oV(a,MAa,b,EI);oV(a,KAa,b,Es);oV(a,NAa,b,XAa);b.trigger==yva&&(b.trigger=zg);b=a.legend;if(null==b)b={},a.legend=b;else if(typeof b==rh){var c=b;b={};a.legend=b;Ea(b,c)}oV(a,EF,b,EI);b=a.animation;null==b?(b={},a.animation=b):typeof b==Yg&&(c=1E3*b,b={},a.animation=b,b.duration=c);oV(a,Bqa,b,Kta)} function qV(a){if(null!=a){pV(a,qAa,rAa,EI);pV(a,xAa,II,JI);a.gridlines=a.gridlines||{};var b=a.gridlines,c=a.numberOfSections;!Qh(b.count)&&Qh(c)&&typeof c==Yg&&(b.count=c+1);a=a.gridlineColor;!Qh(b[E])&&Qh(a)&&Xa(b,a)}}function pV(a,b,c,d){a[d]=a[d]||{};d=a[d];oV(a,b,d,KD);oV(a,c,d,HE)}function oV(a,b,c,d){Qh(a[b])&&!Qh(c[d])&&(c[d]=a[b])}T.Wg=function(){this.kq();zNa(this);Ws(this.Da);qt(this)};function zNa(a){if(a.C&&!a.C.Mj){var b=a.C.Xa;b.es=ea;b.Sc[Hq]()}Ws(a.C);Ws(a.$m);qt(a.Ql)} T.Hi=function(a){null!=this.Ef?this.Ef.Hi(a):this.wK[C](a)};function CNa(a,b){var c=new FN;c[Yx](b);for(var c=IN(c),d=!1,e=0;e<c[J];e++){var f=c[e],g=f.column,f=f.row,g=a.Q.hq&&a.Q.hq[g];if(!g)return!1;var k=g.kc,l,n;null!=k?l=a.Q.k[k].j[f]:n=a.Q.Ba[f];if(!l&&!n)return!1;if(g.Iv==xC){if(d)return!1;d=!0;if(!(l||n).Jc)return!1}}return!0} Zv(T,function(a){if(CNa(this,a)){var b=null;if(this.Q.Wa!=cH){var c=new FN;c[Yx](a);for(var c=IN(c),d=0;d<c[J];d++){var e=c[d],f=this.Q.hq[e.column];if(f.Iv==xC){b={kc:f.kc,$S:e.row};break}}}this.Lh(!0);this.Ja[ux][Yx](a);b&&(this.Ja[Uy].lK=b);this.Lh(!1)}}); T.Lh=function(a){var b=this.tv;if(!this.Ef.c3(this.Ja,this.tv)){var c=this.Ja.hn,d;if(c){gfa(this.b.Vj[0],c);c=this.Da.eb();c=uNa(this,this.t,this.b,W(c.vf,c),this.V,this.Oa).Ay();this.C.Q=c;this.$m.e3&&this.$m.e3(c);d=zU(this.Ef,c,this.Ja);this.Q=c;this.Gc.oK(this.Q);var c=this.Gc,e=this.Q;c.ed={};c.uv={};LIa(c,e,d);c.G.deleteContents(!0);MIa(c,d,c.G.Cs);c.G.flush();this.Ja.hn=null}else{d=zU(this.Ef,this.Q,this.Ja);var c=this.Gc,e=this.Q,f=Ij({k:null,Ba:null,Ea:null,wo:null,gi:null,Jh:null});fP(d, f)&&fP(c.gq,f)?(gn(d.Ea,c.gq.Ea)||(c.G.cd(c.dq),f=new sO(2),tO(f,0,e.Ea||{}),tO(f,1,d.Ea||{}),f=f[My](),c.mD(f)),gn(d.gi,c.gq.gi)||(c.G.cd(c.bv),f=new sO(2),tO(f,0,e.gi||{}),tO(f,1,d.gi||{}),f=f[My](),NIa(c,f)),c.d3(e,d),gn(d.Jh,c.gq.Jh)||(xS(c,Lxa),e=d.Jh,f=new Rm,f.pe(e[E]),f.dh(e[Kd]),e=c.G.rb(e[G],e.top,e[r],e[A],f,c.G.Cs),c[Bx](e,Lxa)),c.gq=d):c.yo(e,d)}this.tv=this.Ja.o()}a&&this.yf.nv(b,this.tv,this.Q.Wa,this.Q.k)};Tw(T,function(){return this.tv?this.tv[ux][wz]():[]}); T.Tg=function(a){return this.Ef?this.Ef.Tg(a):void 0};T.Gi=function(a){null!=this.Ef?this.Ef.Gi(a):this.wK[C](a)};T.tsa=function(){var a=this.Da.eb();return a.Jna?a.lb[hd]:O};function ANa(a){var b=zU(a.Ef,a.Q,a.Ja);a.Gc.yo(a.Q,b);a.tv=a.Ja.o()}function BNa(a){var b=a.Da.eb(),c=a.Da.Av();Ws(a.$m);a.$m=a.Q.Wa==cH?new jV(a.Ql,b,c):new kU(a.Ql,b,c,a.Q);WLa(a.$m);YLa(a.$m);ZLa(a.$m)} T.B3=function(){var a=this.og;this.Q=null;if(a.x3)this.kq(),this.Q=a.y3,ANa(this),BNa(this),this.yf[$](Cqa);else{var b=hi(),c=(b-a[Iy])/(a.Ks-a[Iy]);if(1>c){if(b-a.A3<1E3/this.og.nT)return}else c=1,a.x3=!0;c=a.Oea.interpolate(a.Nea(c));a.z3=c;a.A3=b;this.Gc.yo(c,{});this.yf[$](Dqa)}this.Q=a.y3};T.kq=function(){this.og&&(Ws(this.og.timer),this.og=null)};T.Moa=function(){var a=this.Q.A;return{left:a[G],top:a.top,width:a[r],height:a[A]}}; T.Nk=function(a){return null==this.Gc?null:(a=this.Gc.Nk(a))?{left:a[G],top:a.top,width:a[Zc]-a[G],height:a[Hc]-a.top}:null};T.Bo=function(){var a=this.Q;return{getChartAreaBoundingBox:W(this.Moa,this),getBoundingBox:W(this.Nk,this),getXLocation:W(VIa,null,a),getYLocation:W(WIa,null,a),getHAxisValue:W(XIa,null,a),getVAxisValue:W(YIa,null,a),getPointDatum:W(ZIa,null,a)}};T.Ay=function(){return this.Q}; T.Jj=function(){if(!this.b)throw m("Chart not drawn.");var a=new xk(this.V,this.Oa),b=Ek(this.lb)[Qb](Q),a=xK(b,a),a=new nK(b,a),c=new sK(b),a=this.pi==cH?new dV(c,a):new FS(c,a),c=zU(this.Ef,this.Q,this.Ja);a.yo(this.Q,c);return b[Xb][0].toDataURL(Gva)};function rV(a){mV[L](this,a);this.Gd(Bg,BC,Jg)}X(rV,mV);function sV(a){mV[L](this,a);this.Gd(Bg,qI,Jg)}X(sV,mV);function tV(a){mV[L](this,a);this.Gd(Bg,R,Jg,$za)}X(tV,mV);function vV(a){mV[L](this,a);this.Gd(Bg,JF,Jg)}X(vV,mV);function wV(a){mV[L](this,a);this.Gd(QH)}X(wV,mV);wV[K].uo=function(a,b){return nV(a,b)};V("google.visualization.ScatterChart.prototype.computeDiff",wV[K].uo,void 0);function xV(a){mV[L](this,a);this.Gd(cD)}X(xV,mV);function yV(a){mV[L](this,a);this.Gd(Bg,KC,Eh)}X(yV,mV); yV[K].uo=function(a,b){return nV(a,b)};V("google.visualization.BarChart.prototype.computeDiff",yV[K].uo,void 0);function zV(a){mV[L](this,a);this.Gd(Bg,jD,Jg)}X(zV,mV);function AV(a){mV[L](this,a);this.Gd(Bg,KC,Jg)}X(AV,mV);AV[K].uo=function(a,b){return nV(a,b)};V("google.visualization.ColumnChart.prototype.computeDiff",AV[K].uo,void 0);function BV(a){mV[L](this,a);this.Gd(Bg,R,Jg)}X(BV,mV);function CV(a){mV[L](this,a);this.Gd(cH)}X(CV,mV);CV[K].uo=function(a,b){return nV(a,b)}; V("google.visualization.PieChart.prototype.computeDiff",CV[K].uo,void 0);function DV(a){mV[L](this,a);this.Gd(cF,KC,Jg)}X(DV,mV);function EV(a){rt[L](this);this.ed={};this.J=null;this.Uj={et:!1};this.vE=this.wE=this.C=this.g=this.sg=this.Q=this.ij=this.t=null;this.m=a;this.lE=50;this.L3=0;this.mL=1;this.xT=this.yT=this.rK=!1;this.VK=this.WK=this.NS=this.OS=null;this.Xf=!1;this.ud=null;this.n={range:null,yL:null,Hg:null};this.jj={dk:{min:0,max:0},value:{min:0,max:0}};this.$T=null;this.RS=!1;this.ft=null}X(EV,rt); var FV={naa:yG,maa:oG,Vx:kg},GV={p3:"rangeSelectorMinHandle",o3:"rangeSelectorMaxHandle",r3:"rangeSelectorMinScreen",q3:"rangeSelectorMaxScreen"},DNa={Xra:nr,Gra:ar,Kra:gr,$ra:tr},ENa={fill:tA,ae:0.5},FNa={chartArea:{top:Oe,height:QA},enableInteractivity:!1,legend:{position:R},hAxis:{textPosition:mF},vAxis:{textPosition:R,gridlines:{color:R}}},GNa={chartArea:{left:Oe,width:QA},enableInteractivity:!1,legend:{position:R},vAxis:{textPosition:mF},hAxis:{textPosition:R,gridlines:{color:R}}},HV={brush:new Rm({stroke:aA, fill:te}),uG:new xk(10,16),sja:3};T=EV[K]; Ep(T,function(a,b,c){this.Yf();this.t=a;this.ij=nIa(a.D(0));this.ed={};null==this.wE&&(this.wE=new VN(W(this.fja,this)));null==this.vE&&(this.vE=new VN(W(this.hW,this,!0)));b=new jn([b||{}]);this.rq(b);this.ud=this.V7(b);c=c||{};eu(this.J,ws,W(this.eja,this,c));this.rK&&(this.WK=this.t[I](0,0),this.VK=this.t[I](h.max(0,this.t.M()-1),0),b={min:this.WK,max:this.VK},c[By]&&HNa(this,b,c[By]),this.ud.domainAxis=this.ud.domainAxis||{},this.ud.domainAxis.viewWindow=b);this.J[Nq](a,this.ud)}); T.rq=function(a){this.lE=vn(a,nya,50);this.L3=vn(a,lxa,0);this.SS=pn(a,kua,!1);this.rK=pn(a,CBa,!1);this.yT=pn(a,Yza,!1);this.xT=pn(a,Dra,!1);this.OS=Jn(a,Mza,new Rm(ENa));this.NS=Ym.o();this.Yf();var b=null;switch(Gn(a,xD,DNa,gr)){case ar:b=new rV(this.m);break;case gr:b=new BV(this.m);break;case tr:b=new wV(this.m);break;case nr:b=new vV(this.m);break;default:b=new BV(this.m)}this.J=b;this.Xf=Gn(a,WG,pP,Jg)==Eh};T.V7=function(a){a=hn(nn(a,Pra));a.theme=this.Xf?GNa:FNa;return a}; function INa(a,b){var c=$O(a.M(),function(b){return a[I](b,0)}),c=Fi(c,Xh);return Gi(c,b)}T.eja=function(a){ju(this.J);this.Uj={et:!0};JNa(this,a);Ws(this.g);this.g=this.J.Da.eb(1);Ws(this.C);this.C=new sv;this.We()};T.U7=function(a){ju(this.J);JNa(this,a);IV(this,kg)}; function JNa(a,b){a.Q=a.J.Ay();a.sg=a.Xf?a.Q.be[0]:a.Q.Be[0];var c=a.jj,d;d={min:h.min(a.sg.hh,a.sg.Gh),max:h.max(a.sg.hh,a.sg.Gh)};c.dk=d;c=a.jj;d=a.sg[jc].Bk(a.sg.hh);var e=a.sg[jc].Bk(a.sg.Gh);d={min:h.min(d,e),max:h.max(d,e)};Fw(c,d);c=a.L3;if(0>=c)a.mL=1;else{d=0;d=a.jj.dk.min;var e=a.sg[jc].Bk(d),f=null;$h(e)?(f=new Date,f[Jc](e[bc]()+c)):f=e+c;d=h[xb](h.abs(a.sg[jc].Se(f)-d));c=h.max(d,1);a.mL=c<a.jj.dk.max-a.jj.dk.min?c:1}if(a.yT||a.xT)c=a.sg,d=INa(a.t,c[jc].Se),c=a.Xf?1==c.Ol?d[rx]():d:1== c.Ol?d:d[rx](),a.$T=c;b&&(c=b[By],rw(a.n,KNa(a,ai(c)?c[y]:null,ai(c)?c.end:null)))} T.We=function(){var a=this.g,b=this.Q,c=a.wk(b[r],b[A]),d=a.za(!1);a[p](c,d);c=b.A;a.rb(0,0,b[r],b[A],this.NS,d);var b=a.rb(c[G],c.top,c[r],c[A],this.NS,d),e=LNa(this),e=a.rb(e[G],e.top,e[r],e[A],this.OS,d);this.ed[GV.r3]=e;e=MNa(this);e=a.rb(e[G],e.top,e[r],e[A],this.OS,d);this.ed[GV.q3]=e;e=NNa(this,this.n[By].nh,c,a,d);this.ed[GV.p3]=e;a=NNa(this,this.n[By].mh,c,a,d);this.ed[GV.o3]=a;var f=Gk(this.m);this.C.l(f[Pd],EG,W(this.Kea,this,this.Uj));this.C.l(f[Pd],FG,W(this.t3,this,this.Uj));d=d.a(); this.C.l(d,EG,W(this.Lea,this,this.Uj));this.C.l(d,fs,W(this.jE,this,this.Uj,{type:RH,jn:!1}));(this.RS=ml(d,function(a){return a==f[Pd]}))||this.C.l(d,FG,W(this.t3,this,this.Uj));this.SS||(ONa(this,e,yG,yG),ONa(this,a,oG,oG));this.C.l(b,es,W(this.xK,this,this.Uj,{Hg:kg}));this.C.l(b,gs,W(this.jE,this,this.Uj,{type:RH,jn:!0}));this.C.l(b,fs,W(this.jE,this,this.Uj,{type:RH,jn:!1}));hu(this,ws,null)}; function ONa(a,b,c,d){a.C.l(b,es,W(a.xK,a,a.Uj,{Hg:d}));a.C.l(b,gs,W(a.jE,a,a.Uj,{type:c,jn:!0}));a.C.l(b,fs,W(a.jE,a,a.Uj,{type:c,jn:!1}))} function NNa(a,b,c,d,e){var f=HV.uG,g=HV.sja,k=HV.brush,l=d.za(!1);d[p](e,l);e=0.5*f[r];var n=a.Xf?c[G]:h[t](b-e)+0.5;b=a.Xf?h[t](b-e)+0.5:c.top;d.em(l.a(),n,b);a.Xf?(b=h[D](e),b=aK(a.Xf?[{x:0,y:b},{x:0+c[r],y:b}]:[{x:0,y:b},{x:0,y:b+c[A]}]),d.na(b,k,l),a.SS||PNa(a,0.5*(c[r]-f[A]),0,f[A],f[r],g,d,k,l)):(b=h[D](e),b=aK(a.Xf?[{x:b,y:0},{x:b+c[r],y:0}]:[{x:b,y:0},{x:b,y:0+c[A]}]),d.na(b,k,l),a.SS||PNa(a,0,0.5*(c[A]-f[A]),f[r],f[A],g,d,k,l));return l.a()} function PNa(a,b,c,d,e,f,g,k,l){d=b+d;e=c+e;var n=aK([{x:b+f,y:c},{x:d-f,y:c},{x:d,y:c+f},{x:d,y:e-f},{x:d-f,y:e},{x:b+f,y:e},{x:b,y:e-f},{x:b,y:c+f}],!1);g.na(n,k,l);f+=1;a.Xf?(a=aK([{x:b+f,y:c+f},{x:d-f,y:c+f}]),b=aK([{x:b+f,y:e-f},{x:d-f,y:e-f}])):(a=aK([{x:b+f,y:c+f},{x:b+f,y:e-f}]),b=aK([{x:d-f,y:c+f},{x:d-f,y:e-f}]));g.na(a,k,l);g.na(b,k,l)}function LNa(a){var b=a.Q.A,c=a.n[By].nh;return a.Xf?new vl(b[G],b.top,b[r],c-b.top):new vl(b[G],b.top,c-b[G],b[A])} function MNa(a){var b=a.Q.A,c=a.n[By].mh;return a.Xf?new vl(b[G],c,b[r],b[Hc]-c):new vl(c,b.top,b[Zc]-c,b[A])}function KNa(a,b,c){var d=a.jj.dk.min,e=a.jj.dk.max,f=1==a.sg.Ol&&!a.Xf;null!=b&&(b=a.sg[jc].Se(b),f?d=h.max(b,d):e=h.min(b,e));null!=c&&(a=a.sg[jc].Se(c),f?e=h.min(a,e):d=h.max(a,d));return{nh:d,mh:e}}T.pO=function(){var a=this.n[By],b=this.sg[jc].Bk(a.nh),a=this.sg[jc].Bk(a.mh),c=1==this.sg.Ol&&!this.Xf;return{start:c?b:a,end:c?a:b}}; T.dta=function(a,b){if(!this.Uj.et)return!1;var c=this.n[By];if(null==c.nh||null==c.mh)return!1;c=KNa(this,a,b);c=JV(this,c.nh,c.mh,kg);this.n.Hg=null;return c};function JV(a,b,c,d){var e=a.n[By];if(e.nh==b&&e.mh==c)return!1;rw(a.n,{nh:b,mh:c});IV(a,d);return!0} function IV(a,b){var c=a.Xf?HV.uG[A]:HV.uG[r],d=a.Xf?HV.uG[r]:HV.uG[A];if(b!=oG){var e=LNa(a),f=a.ed[GV.r3],g=a.ed[GV.p3];if(a.Xf){var k=h[t](e.top+e[A]-0.5*d)+0.5;a.g.em(g,0,k);a.g.kQ(f,e.top);a.g.Ex(f,e[A])}else k=h[t](e[G]+e[r]-0.5*c)+0.5,a.g.em(g,k,0),a.g.jQ(f,e[G]),a.g.sl(f,e[r])}b!=yG&&(e=MNa(a),f=a.ed[GV.q3],g=a.ed[GV.o3],a.Xf?(k=h[t](e.top-0.5*d)+0.5,a.g.em(g,0,k),a.g.kQ(f,e.top),a.g.Ex(f,e[A])):(k=h[t](e[G]-0.5*c)+0.5,a.g.em(g,k,0),a.g.jQ(f,e[G]),a.g.sl(f,e[r])))} T.fja=function(){IV(this,this.n.Hg)};function QNa(a){var b=a.jj.dk.max-a.jj.dk.min,c=a.sg.Ol,d=(a.n[By].nh-a.jj.dk.min)/b;if(0.1>d)return{direction:-1*c,c8:d/0.1};a=(a.jj.dk.max-a.n[By].mh)/b;return 0.1>a?{direction:1*c,c8:a/0.1}:null}function KV(a){if(a.rK){var b=!1;a.n.Hg==kg&&QNa(a)&&(b=!0);b&&!a.ft?(a.ft=new tt(a.lE),a.C.l(a.ft,Fs,W(a.cka,a)),a.ft[y]()):!b&&a.ft&&(Ws(a.ft),a.ft=null)}} T.cka=function(){if(this.ft){var a=QNa(this),b=this.lE/pj(1E3,6E4,a.c8),c=this.ij.xl(this.WK),d=this.ij.xl(this.VK),e=(d-c)*b,b=this.ud.domainAxis.viewWindow,f=b.max,g=this.ij.xl(b.min),f=this.ij.xl(f);0>a[jx]?(c=h.max(g-e,c),a=f-(g-c)):(a=h.min(f+e,d),c=g+(a-f));g=this.ij.Bx(c);a=this.ij.Bx(a);b.min=g;b.max=a;eu(this.J,ws,W(this.U7,this,null));this.J[Nq](this.t,this.ud);this.hW(!0)}};T.Lea=function(a,b){a.et&&null!=this.n.Hg&&(this.RS||RNa(this,b),hw(b[Mq][x],HG))}; T.Kea=function(a,b){a.et&&null!=this.n.Hg&&RNa(this,b)};function RNa(a,b){var c=a.n;c[By]&&null!=c[By].nh&&null!=c[By].mh||rw(c,{nh:a.jj.dk.min,mh:a.jj.dk.max});var d=Ml(b),e,d=(a.Xf?d.y:d.x)-c.yL,f=a.n[By],g=a.jj.dk,k;switch(a.n.Hg){case kg:e=g.min-f.nh;k=g.max-f.mh;break;case yG:e=g.min-f.nh;k=f.mh-a.mL-f.nh;break;case oG:e=f.nh+a.mL-f.mh,k=g.max-f.mh}e=nj(d,e,k);c.yL+=e;c.Hg!=oG&&(c[By].nh+=e);c.Hg!=yG&&(c[By].mh+=e);KV(a);WN(a.wE,a.lE);WN(a.vE,a.lE)} T.xK=function(a,b,c){if(a.et&&bt(c)){a=Ml(c);var d=this.n;d.yL=this.Xf?a.y:a.x;d.Hg=b.Hg;KV(this);c[Hp]()}}; T.t3=function(a){if(a.et&&(a=this.n,null!==a.Hg)){if(this.yT){var b=this.$T,c=a[By].mh,d=Pm(b,a[By].nh),c=Pm(b,c);JV(this,d,c,a.Hg)}else if(this.xT){var e=new zm(a[By].nh,a[By].mh),d=e.end-e[y],c=this.jj.dk,f=b=this.$T,g=W(Bm,null,e),b=Oi(f,g),g=Qi(f,g);if(null===b||null===g)b=Pm(f,e[y]),f=Pm(f,e.end),g=b=f=h.abs(e[y]-b)<=h.abs(e.end-f)?b:f;e=e.end-e[y];b=vj(b,g)-e/2;e=new zm(b,b+e);La(e,h.max(e[y],c.min));e.end=e[y]+d;e.end=h.min(e.end,c.max);La(e,e.end-d);JV(this,e[y],e.end,a.Hg)}else this.rK&& a.Hg!=kg&&(d=this.ud.domainAxis.viewWindow,c=this.pO(),HNa(this,d,c),eu(this.J,ws,W(this.U7,this,{range:c})),this.J[Nq](this.t,this.ud));this.hW(!1);a.Hg=null;KV(this)}}; function HNa(a,b,c){var d=b.max,e=a.ij.xl(b.min),d=a.ij.xl(d),f=d-e;0===f&&(e-=1,d+=1,f=2);var g=c[y];c=c.end;if(null!=g&&null!=c){var k=a.ij.xl(g),l=a.ij.xl(c);c=l-k;var g=0.1*f,n=0.6*f;c>=g&&c<=n||(k=(k+l)/2,f/=(c<g?0.9*n:1.1*g)/c,f=new zm(k-f/2,k+f/2),c<g||(e=a.ij.xl(a.WK),d=a.ij.xl(a.VK)),SNa(f,new zm(e,d)),e=a.ij.Bx(f[y]),a=a.ij.Bx(f.end),b.min=e,b.max=a)}}function SNa(a,b){a[y]<b[y]&&(a.end+=b[y]-a[y],La(a,b[y]));a.end>b.end&&(La(a,a[y]-(a.end-b.end)),a.end=b.end);a[y]<b[y]&&La(a,b[y])} T.jE=function(a,b,c){a.et&&!this.n.Hg&&hw(c[Mq][x],b.jn?b[H]==RH?HG:this.Xf?$ya:JD:ZD)};T.hW=function(a){var b=this.n.Hg,c=this.pO();if(null!=b&&null!=c){var d=this.sg.Ol;hu(this,uH,{start:c[y],end:c.end,startChanged:b==(1==d?FV.naa:FV.maa)||b==FV.Vx,endChanged:b==(1==d?FV.maa:FV.naa)||b==FV.Vx,inProgress:a})}};T.Yf=function(){this.J&&(ju(this.J),Ws(this.wE),this.wE=null,Ws(this.vE),this.vE=null,this.Uj.et=!1,Ws(this.g),this.g=null,Ws(this.C),this.C=null,this.J.Yf(),this.J=null,qt(this))};var TNa={day:864E5,hour:36E5,minute:6E4,second:1E3,millisecond:1};function LV(a){var b=MV(a),c;t:{c=a[pc](ne);if(2===c[J]){c=ia(c[0]);if(di(c)&&!ga(c))break t;throw m('Invalid number for increment: "'+a+'".');}c=1}b=TNa[b];if(!b)throw m('Invalid number for increment "'+a+'".');return c*b}function MV(a){var b=a[J]-1;a=a[Bb](b)===kh?a[ae](0,b):a;a=a[pc](ne);return 2===a[J]?a[1]:a[0]}function UNa(a,b,c){a=ia(a);b=(a-c)%LV(b);return a=new Date(a-b)} function VNa(a,b,c){a=ia(a);c=a-c;b=LV(b);c%=b;return a=0===c?new Date(a):new Date(a+b-c)};function NV(a){rt[L](this);this.q=a;a=kk||mk&&!qk(kna)&&a[Nc]==Mf;this.C=new sv(this);this.C.l(this.q,a?[wF,Oxa,Tsa,Gta,oF]:oF,this)}X(NV,rt);NV[K].Sc=null;kp(NV[K],function(a){if(a[H]==oF)kk&&qk(10)&&0==a[Np]&&0==a[Mp]||(OV(this),jk&&this.q!=Gk(this.q)[pb]||this[$](WNa(a)));else if(a[H]!=wF||SBa(a)){var b=a[H]==wF?this.q[id]:null;kk&&229==a[Np]&&(b=null);var c=WNa(a);OV(this);this.Sc=ut(function(){this.Sc=null;this.q[id]!=b&&this[$](c)},0,this)}}); function OV(a){null!=a.Sc&&(vt(a.Sc),a.Sc=null)}function WNa(a){a=new $s(a.Ka);ab(a,oF);return a}NV[K].w=function(){NV.e.w[L](this);this.C.W();OV(this);delete this.q};function PV(a,b,c){dM[L](this,a,b||rM.Xb(),c)}X(PV,dM);ML(Xpa,function(){return new PV(null)});function QV(a,b){VK[L](this,b);this.Gb=a||O}X(QV,VK);QV[K].Hp=null;QV[K].qka=10;var RV="placeholder"in fa[Qb](oF);T=QV[K];T.lG=!1;T.h=function(){this.q=this.ea().h(oF,{type:Es})};T.mf=function(a){QV.e.mf[L](this,a);this.Gb||(this.Gb=a[Sd](zF)||O);nl(Gk(a))==a&&(this.lG=!0,a=this.a(),hL(a,this.$G));RV?this.a().placeholder=this.Gb:(a=this.a(),bL(a,zF,this.Gb))}; T.Bb=function(){QV.e.Bb[L](this);var a=new sv(this);a.l(this.a(),zg,this.m5);a.l(this.a(),TC,this.gM);if(RV)this.C=a;else{lk&&a.l(this.a(),[Xr,wF,xF],this.Dga);var b=Gk(this.a());a.l(Qk(b),Pwa,this.Ega);this.C=a;XNa(this)}this.Et();this.a().ni=this};T.ve=function(){QV.e.ve[L](this);this.C&&(this.C.W(),this.C=null);this.a().ni=null};function XNa(a){!a.yia&&a.C&&a.a().form&&(a.C.l(a.a().form,nAa,a.zia),a.yia=!0)}T.w=function(){QV.e.w[L](this);this.C&&(this.C.W(),this.C=null)};T.$G="label-input-label"; T.m5=function(){this.lG=!0;var a=this.a();hL(a,this.$G);if(!RV&&!SV(this)&&!this.pka){var b=this,a=function(){b.a()&&Fw(b.a(),O)};kk?ut(a,10):a()}};T.gM=function(){RV||(this.C.uc(this.a(),Fr,this.m5),this.Hp=null);this.lG=!1;this.Et()};T.Dga=function(a){27==a[Np]&&(a[H]==wF?this.Hp=this.a()[id]:a[H]==Xr?Fw(this.a(),this.Hp):a[H]==xF&&(this.Hp=null),a[Hp]())};T.zia=function(){SV(this)||(Fw(this.a(),O),ut(this.Uka,10,this))};T.Uka=function(){SV(this)||Fw(this.a(),this.Gb)};T.Ega=function(){this.Et()}; function SV(a){return!!a.a()&&a.a()[id]!=O&&a.a()[id]!=a.Gb}wa(T,function(){Fw(this.a(),O);null!=this.Hp&&(this.Hp=O)});vw(T,function(){SV(this)&&(this[Wb](),this.Et())});T.wa=function(a){null!=this.Hp&&(this.Hp=a);Fw(this.a(),a);this.Et()};fb(T,function(){return null!=this.Hp?this.Hp:SV(this)?this.a()[id]:O});T.Zl=function(a){RV?(this.Gb=a,this.a()&&(this.a().placeholder=this.Gb)):(this.a()&&!SV(this)&&Fw(this.a(),O),this.Gb=a,this.i9(),(a=this.a())&&bL(a,zF,this.Gb))};T.sd=function(){return this.Gb}; T.Et=function(){var a=this.a();RV?this.a().placeholder!=this.Gb&&(this.a().placeholder=this.Gb):(XNa(this),bL(a,zF,this.Gb));SV(this)?(a=this.a(),hL(a,this.$G)):(this.pka||this.lG||(a=this.a(),fL(a,this.$G)),RV||ut(this.i9,this.qka,this))};T.Ga=function(a){Uw(this.a(),!a);var b=this.a();jL(b,this.$G+DA,!a)};qw(T,function(){return!this.a()[Nd]});T.i9=function(){!this.a()||SV(this)||this.lG||Fw(this.a(),this.Gb)};function TV(a,b){this.ye=new Ct(a);this.wma=b?b:vra;this.Ve=5E3}var YNa=0;hp(TV[K],function(a,b,c,d){a=a||null;d=d||iC+(YNa++)[hc](36)+hi()[hc](36);Ph._callbacks_||(Ph._callbacks_={});var e=this.ye.o();if(a)for(var f in a)a[vc]&&!a[vc](f)||fja(e,f,a[f]);b&&(Ph._callbacks_[d]=ZNa(d,b),fja(e,this.wma,Rpa+d));b=pGa(e[hc](),{timeout:this.Ve,Y$:!0});lGa(b,$Na(d,a,c));return{bc:d,baa:b}});up(TV[K],function(a){a&&(a.baa&&a.baa[pq](),a.bc&&UV(a.bc,!1))}); function $Na(a,b,c){return function(){UV(a,!1);c&&c(b)}}function ZNa(a,b){return function(c){UV(a,!0);b[Mc](void 0,arguments)}}function UV(a,b){Ph._callbacks_[a]&&(b?delete Ph._callbacks_[a]:Ph._callbacks_[a]=Th)};;window.google&&window.google.loader&&window.google.loader.eval&&window.google.loader.eval.visualization&&(window.google.loader.eval.visualization=function(){eval(arguments[0])}); function IZ(a,b){return a.time=b}var BYa="#444",JZ="#990000",CYa="annotationText",KZ="certainty",DYa="inline-block",LZ="size";V("google.visualization.CoreChart",mV,void 0);Ep(mV[K],mV[K][Nq]);mV[K].getImageURI=mV[K].Jj;Tw(mV[K],mV[K][wz]);Zv(mV[K],mV[K][Yx]);mV[K].dump=mV[K].tsa;mV[K].clearChart=mV[K].Yf;mV[K].getChartLayoutInterface=mV[K].Bo;mV[K].getContainer=mV[K].ac;mV[K].setAction=mV[K].Hi;mV[K].getAction=mV[K].Tg;mV[K].removeAction=mV[K].Gi;V(Oua,rV,void 0);Ep(rV[K],rV[K][Nq]); rV[K].getImageURI=rV[K].Jj;Tw(rV[K],rV[K][wz]);Zv(rV[K],rV[K][Yx]);rV[K].setAction=rV[K].Hi;rV[K].getAction=rV[K].Tg;rV[K].removeAction=rV[K].Gi;V(Pua,yV,void 0);yV[K].computeDiff=yV[K].uo;Ep(yV[K],yV[K][Nq]);yV[K].getImageURI=yV[K].Jj;Tw(yV[K],yV[K][wz]);Zv(yV[K],yV[K][Yx]);yV[K].setAction=yV[K].Hi;yV[K].getAction=yV[K].Tg;yV[K].removeAction=yV[K].Gi;V("google.visualization.BubbleChart",xV,void 0);Ep(xV[K],xV[K][Nq]);yV[K].getImageURI=yV[K].Jj;Tw(xV[K],xV[K][wz]);Zv(xV[K],xV[K][Yx]); xV[K].setAction=xV[K].Hi;xV[K].getAction=xV[K].Tg;xV[K].removeAction=xV[K].Gi;V("google.visualization.CandlestickChart",zV,void 0);Ep(zV[K],zV[K][Nq]);yV[K].getImageURI=yV[K].Jj;Tw(zV[K],zV[K][wz]);Zv(zV[K],zV[K][Yx]);zV[K].setAction=zV[K].Hi;zV[K].getAction=zV[K].Tg;zV[K].removeAction=zV[K].Gi;V("google.visualization.Histogram",DV,void 0);Ep(DV[K],DV[K][Nq]);yV[K].getImageURI=yV[K].Jj;Tw(DV[K],DV[K][wz]);Zv(DV[K],DV[K][Yx]);DV[K].setAction=DV[K].Hi;DV[K].getAction=DV[K].Tg;DV[K].removeAction=DV[K].Gi; V(Qua,AV,void 0);AV[K].computeDiff=AV[K].uo;Ep(AV[K],AV[K][Nq]);yV[K].getImageURI=yV[K].Jj;Tw(AV[K],AV[K][wz]);Zv(AV[K],AV[K][Yx]);AV[K].setAction=AV[K].Hi;AV[K].getAction=AV[K].Tg;AV[K].removeAction=AV[K].Gi;V("google.visualization.ComboChart",BV,void 0);Ep(BV[K],BV[K][Nq]);yV[K].getImageURI=yV[K].Jj;Tw(BV[K],BV[K][wz]);Zv(BV[K],BV[K][Yx]);BV[K].setAction=BV[K].Hi;BV[K].getAction=BV[K].Tg;BV[K].removeAction=BV[K].Gi;V(Rua,vV,void 0);Ep(vV[K],vV[K][Nq]);yV[K].getImageURI=yV[K].Jj;Tw(vV[K],vV[K][wz]); Zv(vV[K],vV[K][Yx]);vV[K].setAction=vV[K].Hi;vV[K].getAction=vV[K].Tg;vV[K].removeAction=vV[K].Gi;V(Sua,CV,void 0);CV[K].computeDiff=CV[K].uo;Ep(CV[K],CV[K][Nq]);yV[K].getImageURI=yV[K].Jj;Tw(CV[K],CV[K][wz]);Zv(CV[K],CV[K][Yx]);CV[K].setAction=CV[K].Hi;CV[K].getAction=CV[K].Tg;CV[K].removeAction=CV[K].Gi;V(Tua,wV,void 0);wV[K].computeDiff=wV[K].uo;Ep(wV[K],wV[K][Nq]);yV[K].getImageURI=yV[K].Jj;Tw(wV[K],wV[K][wz]);Zv(wV[K],wV[K][Yx]);wV[K].setAction=wV[K].Hi;wV[K].getAction=wV[K].Tg; wV[K].removeAction=wV[K].Gi;V("google.visualization.SparklineChart",tV,void 0);Ep(tV[K],tV[K][Nq]);yV[K].getImageURI=yV[K].Jj;Tw(tV[K],tV[K][wz]);Zv(tV[K],tV[K][Yx]);tV[K].setAction=tV[K].Hi;tV[K].getAction=tV[K].Tg;tV[K].removeAction=tV[K].Gi;V("google.visualization.SteppedAreaChart",sV,void 0);Ep(sV[K],sV[K][Nq]);yV[K].getImageURI=yV[K].Jj;Tw(sV[K],sV[K][wz]);Zv(sV[K],sV[K][Yx]);sV[K].setAction=sV[K].Hi;sV[K].getAction=sV[K].Tg;sV[K].removeAction=sV[K].Gi; V("google.visualization.RangeSelector",EV,void 0);Ep(EV[K],EV[K][Nq]);EV[K].getRange=EV[K].pO;EV[K].setRange=EV[K].dta;;window.google&&window.google.loader&&window.google.loader.eval&&window.google.loader.eval.visualization&&(window.google.loader.eval.visualization=function(){eval(arguments[0])}); google.loader.loaded({"module":"visualization","version":"1.0","components":["ui","corechart","default","format"]}); google.loader.eval.visualization = function() {eval(arguments[0]);};if (google.loader.eval.scripts && google.loader.eval.scripts['visualization']) {(function() {var scripts = google.loader.eval.scripts['visualization'];for (var i = 0; i < scripts.length; i++) {google.loader.eval.visualization(scripts[i]);}})();google.loader.eval.scripts['visualization'] = null;}})();
kasungayan/carbon-business-process
components/bpmn/bpmn-explorer-web/src/web/js/corechartEn.js
JavaScript
apache-2.0
667,371
/* * Copyright (c) 2012 cocos2d-x.org * http://www.cocos2d-x.org * * Copyright 2012 Yannick Loriot. All rights reserved. * http://yannickloriot.com * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT falseT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND falseNINFRINGEMENT. IN false EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ #include "CCControlStepper.h" NS_CC_EXT_BEGIN #define CCControlStepperLabelColorEnabled ccc3(55, 55, 55) #define CCControlStepperLabelColorDisabled ccc3(147, 147, 147) #define CCControlStepperLabelFont "CourierNewPSMT" #define kAutorepeatDeltaTime 0.15f #define kAutorepeatIncreaseTimeIncrement 12 CCControlStepper::CCControlStepper() : m_pMinusSprite(NULL) , m_pPlusSprite(NULL) , m_pMinusLabel(NULL) , m_pPlusLabel(NULL) , m_dValue(0.0) , m_bContinuous(false) , m_bAutorepeat(false) , m_bWraps(false) , m_dMinimumValue(0.0) , m_dMaximumValue(0.0) , m_dStepValue(0.0) , m_bTouchInsideFlag(false) , m_eTouchedPart(kCCControlStepperPartNone) , m_nAutorepeatCount(0) { } CCControlStepper::~CCControlStepper() { unscheduleAllSelectors(); CC_SAFE_RELEASE(m_pMinusSprite); CC_SAFE_RELEASE(m_pPlusSprite); CC_SAFE_RELEASE(m_pMinusLabel); CC_SAFE_RELEASE(m_pPlusLabel); } bool CCControlStepper::initWithMinusSpriteAndPlusSprite(CCSprite *minusSprite, CCSprite *plusSprite) { if (CCControl::init()) { CCAssert(minusSprite, "Minus sprite must be not nil"); CCAssert(plusSprite, "Plus sprite must be not nil"); setTouchEnabled(true); // Set the default values m_bAutorepeat = true; m_bContinuous = true; m_dMinimumValue = 0; m_dMaximumValue = 100; m_dValue = 0; m_dStepValue = 1; m_bWraps = false; this->ignoreAnchorPointForPosition( false ); // Add the minus components this->setMinusSprite(minusSprite); m_pMinusSprite->setPosition( ccp(minusSprite->getContentSize().width / 2, minusSprite->getContentSize().height / 2) ); this->addChild(m_pMinusSprite); this->setMinusLabel( CCLabelTTF::create("-", CCControlStepperLabelFont, 40)); m_pMinusLabel->setColor(CCControlStepperLabelColorDisabled); m_pMinusLabel->setPosition(CCPointMake(m_pMinusSprite->getContentSize().width / 2, m_pMinusSprite->getContentSize().height / 2) ); m_pMinusSprite->addChild(m_pMinusLabel); // Add the plus components this->setPlusSprite( plusSprite ); m_pPlusSprite->setPosition( ccp(minusSprite->getContentSize().width + plusSprite->getContentSize().width / 2, minusSprite->getContentSize().height / 2) ); this->addChild(m_pPlusSprite); this->setPlusLabel( CCLabelTTF::create("+", CCControlStepperLabelFont, 40 )); m_pPlusLabel->setColor( CCControlStepperLabelColorEnabled ); m_pPlusLabel->setPosition( CCPointMake(m_pPlusSprite->getContentSize().width / 2, m_pPlusSprite->getContentSize().height / 2) ); m_pPlusSprite->addChild(m_pPlusLabel); // Defines the content size CCRect maxRect = CCControlUtils::CCRectUnion(m_pMinusSprite->boundingBox(), m_pPlusSprite->boundingBox()); this->setContentSize( CCSizeMake(m_pMinusSprite->getContentSize().width + m_pPlusSprite->getContentSize().height, maxRect.size.height) ); return true; } return false; } CCControlStepper* CCControlStepper::create(CCSprite *minusSprite, CCSprite *plusSprite) { CCControlStepper* pRet = new CCControlStepper(); if (pRet != NULL && pRet->initWithMinusSpriteAndPlusSprite(minusSprite, plusSprite)) { pRet->autorelease(); } else { CC_SAFE_DELETE(pRet); } return pRet; } //#pragma mark Properties void CCControlStepper::setWraps(bool wraps) { m_bWraps = wraps; if (m_bWraps) { m_pMinusLabel->setColor( CCControlStepperLabelColorEnabled ); m_pPlusLabel->setColor(CCControlStepperLabelColorEnabled ); } this->setValue( m_dValue ); } void CCControlStepper::setMinimumValue(double minimumValue) { if (minimumValue >= m_dMaximumValue) { CCAssert(0, "Must be numerically less than maximumValue."); } m_dMinimumValue = minimumValue; this->setValue( m_dValue ); } void CCControlStepper::setMaximumValue(double maximumValue) { if (maximumValue <= m_dMinimumValue) { CCAssert(0, "Must be numerically greater than minimumValue."); } m_dMaximumValue = maximumValue; this->setValue(m_dValue); } void CCControlStepper::setValue(double value) { this->setValueWithSendingEvent(value, true); } double CCControlStepper::getValue() { return m_dValue; } void CCControlStepper::setStepValue(double stepValue) { if (stepValue <= 0) { CCAssert(0,"Must be numerically greater than 0."); } m_dStepValue = stepValue; } bool CCControlStepper::isContinuous() { return m_bContinuous; } //#pragma mark - //#pragma mark CCControlStepper Public Methods void CCControlStepper::setValueWithSendingEvent(double value, bool send) { if (value < m_dMinimumValue) { value = m_bWraps ? m_dMaximumValue : m_dMinimumValue; } else if (value > m_dMaximumValue) { value = m_bWraps ? m_dMinimumValue : m_dMaximumValue; } m_dValue = value; if (!m_bWraps) { m_pMinusLabel->setColor((value == m_dMinimumValue) ? CCControlStepperLabelColorDisabled : CCControlStepperLabelColorEnabled); m_pPlusLabel->setColor((value == m_dMaximumValue) ? CCControlStepperLabelColorDisabled : CCControlStepperLabelColorEnabled); } if (send) { this->sendActionsForControlEvents(CCControlEventValueChanged); } } void CCControlStepper::startAutorepeat() { m_nAutorepeatCount = -1; this->schedule(schedule_selector(CCControlStepper::update), kAutorepeatDeltaTime, kCCRepeatForever, kAutorepeatDeltaTime * 3); } /** Stop the autorepeat. */ void CCControlStepper::stopAutorepeat() { this->unschedule(schedule_selector(CCControlStepper::update)); } void CCControlStepper::update(float dt) { m_nAutorepeatCount++; if ((m_nAutorepeatCount < kAutorepeatIncreaseTimeIncrement) && (m_nAutorepeatCount % 3) != 0) return; if (m_eTouchedPart == kCCControlStepperPartMinus) { this->setValueWithSendingEvent(m_dValue - m_dStepValue, m_bContinuous); } else if (m_eTouchedPart == kCCControlStepperPartPlus) { this->setValueWithSendingEvent(m_dValue + m_dStepValue, m_bContinuous); } } //#pragma mark CCControlStepper Private Methods void CCControlStepper::updateLayoutUsingTouchLocation(CCPoint location) { if (location.x < m_pMinusSprite->getContentSize().width && m_dValue > m_dMinimumValue) { m_eTouchedPart = kCCControlStepperPartMinus; m_pMinusSprite->setColor(ccGRAY); m_pPlusSprite->setColor(ccWHITE); } else if (location.x >= m_pMinusSprite->getContentSize().width && m_dValue < m_dMaximumValue) { m_eTouchedPart = kCCControlStepperPartPlus; m_pMinusSprite->setColor(ccWHITE); m_pPlusSprite->setColor(ccGRAY); } else { m_eTouchedPart = kCCControlStepperPartNone; m_pMinusSprite->setColor(ccWHITE); m_pPlusSprite->setColor(ccWHITE); } } bool CCControlStepper::ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent) { if (!isTouchInside(pTouch) || !isEnabled() || !isVisible()) { return false; } CCPoint location = this->getTouchLocation(pTouch); this->updateLayoutUsingTouchLocation(location); m_bTouchInsideFlag = true; if (m_bAutorepeat) { this->startAutorepeat(); } return true; } void CCControlStepper::ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent) { if (this->isTouchInside(pTouch)) { CCPoint location = this->getTouchLocation(pTouch); this->updateLayoutUsingTouchLocation(location); if (!m_bTouchInsideFlag) { m_bTouchInsideFlag = true; if (m_bAutorepeat) { this->startAutorepeat(); } } } else { m_bTouchInsideFlag = false; m_eTouchedPart = kCCControlStepperPartNone; m_pMinusSprite->setColor(ccWHITE); m_pPlusSprite->setColor(ccWHITE); if (m_bAutorepeat) { this->stopAutorepeat(); } } } void CCControlStepper::ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent) { m_pMinusSprite->setColor(ccWHITE); m_pPlusSprite->setColor(ccWHITE); if (m_bAutorepeat) { this->stopAutorepeat(); } if (this->isTouchInside(pTouch)) { CCPoint location = this->getTouchLocation(pTouch); this->setValue(m_dValue + ((location.x < m_pMinusSprite->getContentSize().width) ? (0.0-m_dStepValue) : m_dStepValue)); } } NS_CC_EXT_END
Macadamian/BB10
MoshPitHero/extensions/GUI/CCControlExtension/CCControlStepper.cpp
C++
apache-2.0
10,296
/** * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.hadoop.hive.metastore.api; import java.util.Map; import java.util.HashMap; import org.apache.thrift.TEnum; public enum LockState implements org.apache.thrift.TEnum { ACQUIRED(1), WAITING(2), ABORT(3), NOT_ACQUIRED(4); private final int value; private LockState(int value) { this.value = value; } /** * Get the integer value of this enum value, as defined in the Thrift IDL. */ public int getValue() { return value; } /** * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ public static LockState findByValue(int value) { switch (value) { case 1: return ACQUIRED; case 2: return WAITING; case 3: return ABORT; case 4: return NOT_ACQUIRED; default: return null; } } }
WANdisco/amplab-hive
metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/LockState.java
Java
apache-2.0
1,027
/* * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.ec2.model; /** * Volume Type */ public enum VolumeType { Standard("standard"), Io1("io1"), Gp2("gp2"); private String value; private VolumeType(String value) { this.value = value; } @Override public String toString() { return this.value; } /** * Use this in place of valueOf. * * @param value * real value * @return VolumeType corresponding to the value */ public static VolumeType fromValue(String value) { if (value == null || "".equals(value)) { throw new IllegalArgumentException("Value cannot be null or empty!"); } else if ("standard".equals(value)) { return VolumeType.Standard; } else if ("io1".equals(value)) { return VolumeType.Io1; } else if ("gp2".equals(value)) { return VolumeType.Gp2; } else { throw new IllegalArgumentException("Cannot create enum from " + value + " value!"); } } }
dankibler/aws-sdk-java
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/VolumeType.java
Java
apache-2.0
1,656
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "crypto" "crypto/rand" "fmt" "io" "math" "sync" _ "crypto/sha1" _ "crypto/sha256" _ "crypto/sha512" ) // These are string constants in the SSH protocol. const ( compressionNone = "none" serviceUserAuth = "ssh-userauth" serviceSSH = "ssh-connection" ) // supportedCiphers specifies the supported ciphers in preference order. var supportedCiphers = []string{ "aes128-ctr", "aes192-ctr", "aes256-ctr", "aes128-gcm@openssh.com", "arcfour256", "arcfour128", } // supportedKexAlgos specifies the supported key-exchange algorithms in // preference order. var supportedKexAlgos = []string{ kexAlgoCurve25519SHA256, // P384 and P521 are not constant-time yet, but since we don't // reuse ephemeral keys, using them for ECDH should be OK. kexAlgoECDH256, kexAlgoECDH384, kexAlgoECDH521, kexAlgoDH14SHA1, kexAlgoDH1SHA1, } // supportedHostKeyAlgos specifies the supported host-key algorithms (i.e. methods // of authenticating servers) in preference order. var supportedHostKeyAlgos = []string{ CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoED25519v01, KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521, KeyAlgoRSA, KeyAlgoDSA, KeyAlgoED25519, } // supportedMACs specifies a default set of MAC algorithms in preference order. // This is based on RFC 4253, section 6.4, but with hmac-md5 variants removed // because they have reached the end of their useful life. var supportedMACs = []string{ "hmac-sha2-256-etm@openssh.com", "hmac-sha2-256", "hmac-sha1", "hmac-sha1-96", } var supportedCompressions = []string{compressionNone} // hashFuncs keeps the mapping of supported algorithms to their respective // hashes needed for signature verification. var hashFuncs = map[string]crypto.Hash{ KeyAlgoRSA: crypto.SHA1, KeyAlgoDSA: crypto.SHA1, KeyAlgoECDSA256: crypto.SHA256, KeyAlgoECDSA384: crypto.SHA384, KeyAlgoECDSA521: crypto.SHA512, CertAlgoRSAv01: crypto.SHA1, CertAlgoDSAv01: crypto.SHA1, CertAlgoECDSA256v01: crypto.SHA256, CertAlgoECDSA384v01: crypto.SHA384, CertAlgoECDSA521v01: crypto.SHA512, } // unexpectedMessageError results when the SSH message that we received didn't // match what we wanted. func unexpectedMessageError(expected, got uint8) error { return fmt.Errorf("ssh: unexpected message type %d (expected %d)", got, expected) } // parseError results from a malformed SSH message. func parseError(tag uint8) error { return fmt.Errorf("ssh: parse error in message type %d", tag) } func findCommon(what string, client []string, server []string) (common string, err error) { for _, c := range client { for _, s := range server { if c == s { return c, nil } } } return "", fmt.Errorf("ssh: no common algorithm for %s; client offered: %v, server offered: %v", what, client, server) } type directionAlgorithms struct { Cipher string MAC string Compression string } // rekeyBytes returns a rekeying intervals in bytes. func (a *directionAlgorithms) rekeyBytes() int64 { // According to RFC4344 block ciphers should rekey after // 2^(BLOCKSIZE/4) blocks. For all AES flavors BLOCKSIZE is // 128. switch a.Cipher { case "aes128-ctr", "aes192-ctr", "aes256-ctr", gcmCipherID, aes128cbcID: return 16 * (1 << 32) } // For others, stick with RFC4253 recommendation to rekey after 1 Gb of data. return 1 << 30 } type algorithms struct { kex string hostKey string w directionAlgorithms r directionAlgorithms } func findAgreedAlgorithms(clientKexInit, serverKexInit *kexInitMsg) (algs *algorithms, err error) { result := &algorithms{} result.kex, err = findCommon("key exchange", clientKexInit.KexAlgos, serverKexInit.KexAlgos) if err != nil { return } result.hostKey, err = findCommon("host key", clientKexInit.ServerHostKeyAlgos, serverKexInit.ServerHostKeyAlgos) if err != nil { return } result.w.Cipher, err = findCommon("client to server cipher", clientKexInit.CiphersClientServer, serverKexInit.CiphersClientServer) if err != nil { return } result.r.Cipher, err = findCommon("server to client cipher", clientKexInit.CiphersServerClient, serverKexInit.CiphersServerClient) if err != nil { return } result.w.MAC, err = findCommon("client to server MAC", clientKexInit.MACsClientServer, serverKexInit.MACsClientServer) if err != nil { return } result.r.MAC, err = findCommon("server to client MAC", clientKexInit.MACsServerClient, serverKexInit.MACsServerClient) if err != nil { return } result.w.Compression, err = findCommon("client to server compression", clientKexInit.CompressionClientServer, serverKexInit.CompressionClientServer) if err != nil { return } result.r.Compression, err = findCommon("server to client compression", clientKexInit.CompressionServerClient, serverKexInit.CompressionServerClient) if err != nil { return } return result, nil } // If rekeythreshold is too small, we can't make any progress sending // stuff. const minRekeyThreshold uint64 = 256 // Config contains configuration data common to both ServerConfig and // ClientConfig. type Config struct { // Rand provides the source of entropy for cryptographic // primitives. If Rand is nil, the cryptographic random reader // in package crypto/rand will be used. Rand io.Reader // The maximum number of bytes sent or received after which a // new key is negotiated. It must be at least 256. If // unspecified, a size suitable for the chosen cipher is used. RekeyThreshold uint64 // The allowed key exchanges algorithms. If unspecified then a // default set of algorithms is used. KeyExchanges []string // The allowed cipher algorithms. If unspecified then a sensible // default is used. Ciphers []string // The allowed MAC algorithms. If unspecified then a sensible default // is used. MACs []string } // SetDefaults sets sensible values for unset fields in config. This is // exported for testing: Configs passed to SSH functions are copied and have // default values set automatically. func (c *Config) SetDefaults() { if c.Rand == nil { c.Rand = rand.Reader } if c.Ciphers == nil { c.Ciphers = supportedCiphers } var ciphers []string for _, c := range c.Ciphers { if cipherModes[c] != nil { // reject the cipher if we have no cipherModes definition ciphers = append(ciphers, c) } } c.Ciphers = ciphers if c.KeyExchanges == nil { c.KeyExchanges = supportedKexAlgos } if c.MACs == nil { c.MACs = supportedMACs } if c.RekeyThreshold == 0 { // cipher specific default } else if c.RekeyThreshold < minRekeyThreshold { c.RekeyThreshold = minRekeyThreshold } else if c.RekeyThreshold >= math.MaxInt64 { // Avoid weirdness if somebody uses -1 as a threshold. c.RekeyThreshold = math.MaxInt64 } } // buildDataSignedForAuth returns the data that is signed in order to prove // possession of a private key. See RFC 4252, section 7. func buildDataSignedForAuth(sessionId []byte, req userAuthRequestMsg, algo, pubKey []byte) []byte { data := struct { Session []byte Type byte User string Service string Method string Sign bool Algo []byte PubKey []byte }{ sessionId, msgUserAuthRequest, req.User, req.Service, req.Method, true, algo, pubKey, } return Marshal(data) } func appendU16(buf []byte, n uint16) []byte { return append(buf, byte(n>>8), byte(n)) } func appendU32(buf []byte, n uint32) []byte { return append(buf, byte(n>>24), byte(n>>16), byte(n>>8), byte(n)) } func appendU64(buf []byte, n uint64) []byte { return append(buf, byte(n>>56), byte(n>>48), byte(n>>40), byte(n>>32), byte(n>>24), byte(n>>16), byte(n>>8), byte(n)) } func appendInt(buf []byte, n int) []byte { return appendU32(buf, uint32(n)) } func appendString(buf []byte, s string) []byte { buf = appendU32(buf, uint32(len(s))) buf = append(buf, s...) return buf } func appendBool(buf []byte, b bool) []byte { if b { return append(buf, 1) } return append(buf, 0) } // newCond is a helper to hide the fact that there is no usable zero // value for sync.Cond. func newCond() *sync.Cond { return sync.NewCond(new(sync.Mutex)) } // window represents the buffer available to clients // wishing to write to a channel. type window struct { *sync.Cond win uint32 // RFC 4254 5.2 says the window size can grow to 2^32-1 writeWaiters int closed bool } // add adds win to the amount of window available // for consumers. func (w *window) add(win uint32) bool { // a zero sized window adjust is a noop. if win == 0 { return true } w.L.Lock() if w.win+win < win { w.L.Unlock() return false } w.win += win // It is unusual that multiple goroutines would be attempting to reserve // window space, but not guaranteed. Use broadcast to notify all waiters // that additional window is available. w.Broadcast() w.L.Unlock() return true } // close sets the window to closed, so all reservations fail // immediately. func (w *window) close() { w.L.Lock() w.closed = true w.Broadcast() w.L.Unlock() } // reserve reserves win from the available window capacity. // If no capacity remains, reserve will block. reserve may // return less than requested. func (w *window) reserve(win uint32) (uint32, error) { var err error w.L.Lock() w.writeWaiters++ w.Broadcast() for w.win == 0 && !w.closed { w.Wait() } w.writeWaiters-- if w.win < win { win = w.win } w.win -= win if w.closed { err = io.EOF } w.L.Unlock() return win, err } // waitWriterBlocked waits until some goroutine is blocked for further // writes. It is used in tests only. func (w *window) waitWriterBlocked() { w.Cond.L.Lock() for w.writeWaiters == 0 { w.Cond.Wait() } w.Cond.L.Unlock() }
deads2k/sync-vendor
vendor/golang.org/x/crypto/ssh/common.go
GO
apache-2.0
9,932
package client import ( "bytes" "encoding/json" "fmt" "io" "io/ioutil" "net/http" "net/url" "strings" "github.com/docker/engine-api/client/transport/cancellable" "golang.org/x/net/context" ) // serverResponse is a wrapper for http API responses. type serverResponse struct { body io.ReadCloser header http.Header statusCode int } // head sends an http request to the docker API using the method HEAD. func (cli *Client) head(ctx context.Context, path string, query url.Values, headers map[string][]string) (*serverResponse, error) { return cli.sendRequest(ctx, "HEAD", path, query, nil, headers) } // getWithContext sends an http request to the docker API using the method GET with a specific go context. func (cli *Client) get(ctx context.Context, path string, query url.Values, headers map[string][]string) (*serverResponse, error) { return cli.sendRequest(ctx, "GET", path, query, nil, headers) } // postWithContext sends an http request to the docker API using the method POST with a specific go context. func (cli *Client) post(ctx context.Context, path string, query url.Values, obj interface{}, headers map[string][]string) (*serverResponse, error) { return cli.sendRequest(ctx, "POST", path, query, obj, headers) } func (cli *Client) postRaw(ctx context.Context, path string, query url.Values, body io.Reader, headers map[string][]string) (*serverResponse, error) { return cli.sendClientRequest(ctx, "POST", path, query, body, headers) } // put sends an http request to the docker API using the method PUT. func (cli *Client) put(ctx context.Context, path string, query url.Values, obj interface{}, headers map[string][]string) (*serverResponse, error) { return cli.sendRequest(ctx, "PUT", path, query, obj, headers) } // put sends an http request to the docker API using the method PUT. func (cli *Client) putRaw(ctx context.Context, path string, query url.Values, body io.Reader, headers map[string][]string) (*serverResponse, error) { return cli.sendClientRequest(ctx, "PUT", path, query, body, headers) } // delete sends an http request to the docker API using the method DELETE. func (cli *Client) delete(ctx context.Context, path string, query url.Values, headers map[string][]string) (*serverResponse, error) { return cli.sendRequest(ctx, "DELETE", path, query, nil, headers) } func (cli *Client) sendRequest(ctx context.Context, method, path string, query url.Values, obj interface{}, headers map[string][]string) (*serverResponse, error) { var body io.Reader if obj != nil { var err error body, err = encodeData(obj) if err != nil { return nil, err } if headers == nil { headers = make(map[string][]string) } headers["Content-Type"] = []string{"application/json"} } return cli.sendClientRequest(ctx, method, path, query, body, headers) } func (cli *Client) sendClientRequest(ctx context.Context, method, path string, query url.Values, body io.Reader, headers map[string][]string) (*serverResponse, error) { serverResp := &serverResponse{ body: nil, statusCode: -1, } expectedPayload := (method == "POST" || method == "PUT") if expectedPayload && body == nil { body = bytes.NewReader([]byte{}) } req, err := cli.newRequest(method, path, query, body, headers) if cli.proto == "unix" || cli.proto == "npipe" { // For local communications, it doesn't matter what the host is. We just // need a valid and meaningful host name. (See #189) req.Host = "docker" } req.URL.Host = cli.addr req.URL.Scheme = cli.transport.Scheme() if expectedPayload && req.Header.Get("Content-Type") == "" { req.Header.Set("Content-Type", "text/plain") } resp, err := cancellable.Do(ctx, cli.transport, req) if resp != nil { serverResp.statusCode = resp.StatusCode } if err != nil { if isTimeout(err) || strings.Contains(err.Error(), "connection refused") || strings.Contains(err.Error(), "dial unix") { return serverResp, ErrConnectionFailed } if !cli.transport.Secure() && strings.Contains(err.Error(), "malformed HTTP response") { return serverResp, fmt.Errorf("%v.\n* Are you trying to connect to a TLS-enabled daemon without TLS?", err) } if cli.transport.Secure() && strings.Contains(err.Error(), "remote error: bad certificate") { return serverResp, fmt.Errorf("The server probably has client authentication (--tlsverify) enabled. Please check your TLS client certification settings: %v", err) } return serverResp, fmt.Errorf("An error occurred trying to connect: %v", err) } if serverResp.statusCode < 200 || serverResp.statusCode >= 400 { body, err := ioutil.ReadAll(resp.Body) if err != nil { return serverResp, err } if len(body) == 0 { return serverResp, fmt.Errorf("Error: request returned %s for API route and version %s, check if the server supports the requested API version", http.StatusText(serverResp.statusCode), req.URL) } return serverResp, fmt.Errorf("Error response from daemon: %s", bytes.TrimSpace(body)) } serverResp.body = resp.Body serverResp.header = resp.Header return serverResp, nil } func (cli *Client) newRequest(method, path string, query url.Values, body io.Reader, headers map[string][]string) (*http.Request, error) { apiPath := cli.getAPIPath(path, query) req, err := http.NewRequest(method, apiPath, body) if err != nil { return nil, err } // Add CLI Config's HTTP Headers BEFORE we set the Docker headers // then the user can't change OUR headers for k, v := range cli.customHTTPHeaders { req.Header.Set(k, v) } if headers != nil { for k, v := range headers { req.Header[k] = v } } return req, nil } func encodeData(data interface{}) (*bytes.Buffer, error) { params := bytes.NewBuffer(nil) if data != nil { if err := json.NewEncoder(params).Encode(data); err != nil { return nil, err } } return params, nil } func ensureReaderClosed(response *serverResponse) { if response != nil && response.body != nil { response.body.Close() } } func isTimeout(err error) bool { type timeout interface { Timeout() bool } e := err switch urlErr := err.(type) { case *url.Error: e = urlErr.Err } t, ok := e.(timeout) return ok && t.Timeout() }
jianhuiz/kubernetes
vendor/github.com/docker/engine-api/client/request.go
GO
apache-2.0
6,177
/* adler32.c -- compute the Adler-32 checksum of a data stream * Copyright (C) 1995-2011 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id$ */ #include "zutil.h" #define local static local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); #define BASE 65521 /* largest prime smaller than 65536 */ #define NMAX 5552 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ #define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); #define DO16(buf) DO8(buf,0); DO8(buf,8); /* use NO_DIVIDE if your processor does not do division in hardware -- try it both ways to see which is faster */ #ifdef NO_DIVIDE /* note that this assumes BASE is 65521, where 65536 % 65521 == 15 (thank you to John Reiser for pointing this out) */ # define CHOP(a) \ do { \ unsigned long tmp = a >> 16; \ a &= 0xffffUL; \ a += (tmp << 4) - tmp; \ } while (0) # define MOD28(a) \ do { \ CHOP(a); \ if (a >= BASE) a -= BASE; \ } while (0) # define MOD(a) \ do { \ CHOP(a); \ MOD28(a); \ } while (0) # define MOD63(a) \ do { /* this assumes a is not negative */ \ z_off64_t tmp = a >> 32; \ a &= 0xffffffffL; \ a += (tmp << 8) - (tmp << 5) + tmp; \ tmp = a >> 16; \ a &= 0xffffL; \ a += (tmp << 4) - tmp; \ tmp = a >> 16; \ a &= 0xffffL; \ a += (tmp << 4) - tmp; \ if (a >= BASE) a -= BASE; \ } while (0) #else # define MOD(a) a %= BASE # define MOD28(a) a %= BASE # define MOD63(a) a %= BASE #endif /* ========================================================================= */ uLong ZEXPORT adler32(adler, buf, len) uLong adler; const Bytef *buf; uInt len; { unsigned long sum2; unsigned n; /* split Adler-32 into component sums */ sum2 = (adler >> 16) & 0xffff; adler &= 0xffff; /* in case user likes doing a byte at a time, keep it fast */ if (len == 1) { adler += buf[0]; if (adler >= BASE) adler -= BASE; sum2 += adler; if (sum2 >= BASE) sum2 -= BASE; return adler | (sum2 << 16); } /* initial Adler-32 value (deferred check for len == 1 speed) */ if (buf == Z_NULL) return 1L; /* in case short lengths are provided, keep it somewhat fast */ if (len < 16) { while (len--) { adler += *buf++; sum2 += adler; } if (adler >= BASE) adler -= BASE; MOD28(sum2); /* only added so many BASE's */ return adler | (sum2 << 16); } /* do length NMAX blocks -- requires just one modulo operation */ while (len >= NMAX) { len -= NMAX; n = NMAX / 16; /* NMAX is divisible by 16 */ do { DO16(buf); /* 16 sums unrolled */ buf += 16; } while (--n); MOD(adler); MOD(sum2); } /* do remaining bytes (less than NMAX, still just one modulo) */ if (len) { /* avoid modulos if none remaining */ while (len >= 16) { len -= 16; DO16(buf); buf += 16; } while (len--) { adler += *buf++; sum2 += adler; } MOD(adler); MOD(sum2); } /* return recombined sums */ return adler | (sum2 << 16); } /* ========================================================================= */ local uLong adler32_combine_(adler1, adler2, len2) uLong adler1; uLong adler2; z_off64_t len2; { unsigned long sum1; unsigned long sum2; unsigned rem; /* for negative len, return invalid adler32 as a clue for debugging */ if (len2 < 0) return 0xffffffffUL; /* the derivation of this formula is left as an exercise for the reader */ MOD63(len2); /* assumes len2 >= 0 */ rem = (unsigned)len2; sum1 = adler1 & 0xffff; sum2 = rem * sum1; MOD(sum2); sum1 += (adler2 & 0xffff) + BASE - 1; sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; if (sum1 >= BASE) sum1 -= BASE; if (sum1 >= BASE) sum1 -= BASE; if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1); if (sum2 >= BASE) sum2 -= BASE; return sum1 | (sum2 << 16); } /* ========================================================================= */ uLong ZEXPORT adler32_combine(adler1, adler2, len2) uLong adler1; uLong adler2; z_off_t len2; { return adler32_combine_(adler1, adler2, len2); } uLong ZEXPORT adler32_combine64(adler1, adler2, len2) uLong adler1; uLong adler2; z_off64_t len2; { return adler32_combine_(adler1, adler2, len2); }
marcreyesph/scancode-toolkit
samples/zlib/adler32.c
C
apache-2.0
4,968
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.kafka.common.errors; /** * There is no currently available leader for the given partition (either because a leadership election is in progress * or because all replicas are down). */ public class LeaderNotAvailableException extends InvalidMetadataException { private static final long serialVersionUID = 1L; public LeaderNotAvailableException(String message) { super(message); } public LeaderNotAvailableException(String message, Throwable cause) { super(message, cause); } }
Ishiihara/kafka
clients/src/main/java/org/apache/kafka/common/errors/LeaderNotAvailableException.java
Java
apache-2.0
1,338
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.camel.component.smpp; import org.apache.camel.Exchange; import org.apache.camel.ExchangePattern; import org.apache.camel.impl.DefaultCamelContext; import org.apache.camel.impl.DefaultExchange; import org.jsmpp.bean.MessageState; import org.jsmpp.bean.NumberingPlanIndicator; import org.jsmpp.bean.TypeOfNumber; import org.jsmpp.session.QuerySmResult; import org.jsmpp.session.SMPPSession; import org.junit.Before; import org.junit.Test; import static org.easymock.EasyMock.createMock; import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.replay; import static org.easymock.EasyMock.verify; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; public class SmppQuerySmCommandTest { private SMPPSession session; private SmppConfiguration config; private SmppQuerySmCommand command; @Before public void setUp() { session = createMock(SMPPSession.class); config = new SmppConfiguration(); command = new SmppQuerySmCommand(session, config); } @Test public void executeWithConfigurationData() throws Exception { Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut); exchange.getIn().setHeader(SmppConstants.COMMAND, "QuerySm"); exchange.getIn().setHeader(SmppConstants.ID, "1"); expect(session.queryShortMessage("1", TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, "1616")) .andReturn(new QuerySmResult("-300101010000004+", MessageState.DELIVERED, (byte) 0)); replay(session); command.execute(exchange); verify(session); assertEquals("1", exchange.getOut().getHeader(SmppConstants.ID)); assertEquals("DELIVERED", exchange.getOut().getHeader(SmppConstants.MESSAGE_STATE)); assertEquals((byte) 0, exchange.getOut().getHeader(SmppConstants.ERROR)); assertNotNull(exchange.getOut().getHeader(SmppConstants.FINAL_DATE)); } @Test public void execute() throws Exception { Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut); exchange.getIn().setHeader(SmppConstants.COMMAND, "QuerySm"); exchange.getIn().setHeader(SmppConstants.ID, "1"); exchange.getIn().setHeader(SmppConstants.SOURCE_ADDR_TON, TypeOfNumber.NATIONAL.value()); exchange.getIn().setHeader(SmppConstants.SOURCE_ADDR_NPI, NumberingPlanIndicator.NATIONAL.value()); exchange.getIn().setHeader(SmppConstants.SOURCE_ADDR, "1818"); expect(session.queryShortMessage("1", TypeOfNumber.NATIONAL, NumberingPlanIndicator.NATIONAL, "1818")) .andReturn(new QuerySmResult("-300101010000004+", MessageState.DELIVERED, (byte) 0)); replay(session); command.execute(exchange); verify(session); assertEquals("1", exchange.getOut().getHeader(SmppConstants.ID)); assertEquals("DELIVERED", exchange.getOut().getHeader(SmppConstants.MESSAGE_STATE)); assertEquals((byte) 0, exchange.getOut().getHeader(SmppConstants.ERROR)); assertNotNull(exchange.getOut().getHeader(SmppConstants.FINAL_DATE)); } }
allancth/camel
components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppQuerySmCommandTest.java
Java
apache-2.0
4,100
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } import React from 'react'; import PropTypes from 'prop-types'; import warning from 'warning'; import matchPath from './matchPath'; /** * The public API for rendering the first <Route> that matches. */ var Switch = function (_React$Component) { _inherits(Switch, _React$Component); function Switch() { _classCallCheck(this, Switch); return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); } Switch.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { warning(!(nextProps.location && !this.props.location), '<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'); warning(!(!nextProps.location && this.props.location), '<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'); }; Switch.prototype.render = function render() { var route = this.context.router.route; var children = this.props.children; var location = this.props.location || route.location; var match = void 0, child = void 0; React.Children.forEach(children, function (element) { if (!React.isValidElement(element)) return; var _element$props = element.props, pathProp = _element$props.path, exact = _element$props.exact, strict = _element$props.strict, from = _element$props.from; var path = pathProp || from; if (match == null) { child = element; match = path ? matchPath(location.pathname, { path: path, exact: exact, strict: strict }) : route.match; } }); return match ? React.cloneElement(child, { location: location, computedMatch: match }) : null; }; return Switch; }(React.Component); Switch.contextTypes = { router: PropTypes.shape({ route: PropTypes.object.isRequired }).isRequired }; Switch.propTypes = { children: PropTypes.node, location: PropTypes.object }; export default Switch;
bhathiya/test
features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/node_modules/react-router/es/Switch.js
JavaScript
apache-2.0
3,021
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.elasticsearch.rest.action.admin.indices; import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.cluster.metadata.MappingMetaData; import org.elasticsearch.common.Strings; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.indices.TypeMissingException; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; import org.elasticsearch.rest.action.RestBuilderListener; import java.io.IOException; import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestStatus.OK; public class RestGetMappingAction extends BaseRestHandler { public RestGetMappingAction(Settings settings, RestController controller) { super(settings); controller.registerHandler(GET, "/{index}/{type}/_mapping", this); controller.registerHandler(GET, "/{index}/_mappings/{type}", this); controller.registerHandler(GET, "/{index}/_mapping/{type}", this); controller.registerHandler(GET, "/_mapping/{type}", this); } @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { final String[] indices = Strings.splitStringByCommaToArray(request.param("index")); final String[] types = request.paramAsStringArrayOrEmptyIfAll("type"); GetMappingsRequest getMappingsRequest = new GetMappingsRequest(); getMappingsRequest.indices(indices).types(types); getMappingsRequest.indicesOptions(IndicesOptions.fromRequest(request, getMappingsRequest.indicesOptions())); getMappingsRequest.local(request.paramAsBoolean("local", getMappingsRequest.local())); return channel -> client.admin().indices().getMappings(getMappingsRequest, new RestBuilderListener<GetMappingsResponse>(channel) { @Override public RestResponse buildResponse(GetMappingsResponse response, XContentBuilder builder) throws Exception { ImmutableOpenMap<String, ImmutableOpenMap<String, MappingMetaData>> mappingsByIndex = response.getMappings(); if (mappingsByIndex.isEmpty()) { if (indices.length != 0 && types.length != 0) { return new BytesRestResponse(OK, builder.startObject().endObject()); } else if (indices.length != 0) { builder.close(); return new BytesRestResponse(channel, new IndexNotFoundException(indices[0])); } else if (types.length != 0) { builder.close(); return new BytesRestResponse(channel, new TypeMissingException("_all", types[0])); } else { return new BytesRestResponse(OK, builder.startObject().endObject()); } } builder.startObject(); for (ObjectObjectCursor<String, ImmutableOpenMap<String, MappingMetaData>> indexEntry : mappingsByIndex) { if (indexEntry.value.isEmpty()) { continue; } builder.startObject(indexEntry.key); builder.startObject(Fields.MAPPINGS); for (ObjectObjectCursor<String, MappingMetaData> typeEntry : indexEntry.value) { builder.field(typeEntry.key); builder.map(typeEntry.value.sourceAsMap()); } builder.endObject(); builder.endObject(); } builder.endObject(); return new BytesRestResponse(OK, builder); } }); } static class Fields { static final String MAPPINGS = "mappings"; } }
Shepard1212/elasticsearch
core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java
Java
apache-2.0
5,211
/** * Copyright (c) 2008, http://www.snakeyaml.org * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.yaml.snakeyaml.issues.issue114; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import junit.framework.TestCase; import org.yaml.snakeyaml.Yaml; public class PreserveTypeTest extends TestCase { public static class MyBean { private int dummy; public int getDummy() { return dummy; } public void setDummy(int dummy) { this.dummy = dummy; } } public static class ReferencingBean { private List<MyBean> myBeans = new LinkedList<PreserveTypeTest.MyBean>(); public List<MyBean> getMyBeans() { return myBeans; } public void setMyBeans(List<MyBean> myBeans) { this.myBeans = myBeans; } } private Map<String, Object> createData(boolean collectionFirst) { MyBean myBean = new MyBean(); ReferencingBean referencingBean = new ReferencingBean(); referencingBean.getMyBeans().add(myBean); LinkedHashMap<String, Object> map = new LinkedHashMap<String, Object>(); if (collectionFirst) { map.put("referencingBean", referencingBean); map.put("myBean", myBean); } else { map.put("myBean", myBean); map.put("referencingBean", referencingBean); } return map; } private void check(String doc) { Yaml yaml = new Yaml(); @SuppressWarnings("unchecked") Map<String, Object> loaded = (Map<String, Object>) yaml.load(doc); Object myBean2 = loaded.get("myBean"); assertTrue(myBean2.getClass().toString(), myBean2 instanceof MyBean); } public void testPreserveType1() { Yaml yaml = new Yaml(); String s = yaml.dump(createData(true)); check(s); } public void testPreserveType2() { Yaml yaml = new Yaml(); String s = yaml.dump(createData(false)); check(s); } }
mapiman/snakeyaml
src/test/java/org/yaml/snakeyaml/issues/issue114/PreserveTypeTest.java
Java
apache-2.0
2,606
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.kafka.streams.tests; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.clients.consumer.ConsumerRecords; import org.apache.kafka.clients.consumer.KafkaConsumer; import org.apache.kafka.clients.producer.Callback; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.ProducerConfig; import org.apache.kafka.clients.producer.ProducerRecord; import org.apache.kafka.clients.producer.RecordMetadata; import org.apache.kafka.common.PartitionInfo; import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.errors.TimeoutException; import org.apache.kafka.common.serialization.ByteArraySerializer; import org.apache.kafka.common.serialization.Deserializer; import org.apache.kafka.common.serialization.StringDeserializer; import org.apache.kafka.common.utils.Exit; import org.apache.kafka.common.utils.Utils; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.Instant; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Random; import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; import static java.util.Collections.emptyMap; import static org.apache.kafka.common.utils.Utils.mkEntry; public class SmokeTestDriver extends SmokeTestUtil { private static final String[] TOPICS = { "data", "echo", "max", "min", "min-suppressed", "min-raw", "dif", "sum", "sws-raw", "sws-suppressed", "cnt", "avg", "tagg" }; private static final int MAX_RECORD_EMPTY_RETRIES = 30; private static class ValueList { public final String key; private final int[] values; private int index; ValueList(final int min, final int max) { key = min + "-" + max; values = new int[max - min + 1]; for (int i = 0; i < values.length; i++) { values[i] = min + i; } // We want to randomize the order of data to test not completely predictable processing order // However, values are also use as a timestamp of the record. (TODO: separate data and timestamp) // We keep some correlation of time and order. Thus, the shuffling is done with a sliding window shuffle(values, 10); index = 0; } int next() { return (index < values.length) ? values[index++] : -1; } } public static String[] topics() { return Arrays.copyOf(TOPICS, TOPICS.length); } static void generatePerpetually(final String kafka, final int numKeys, final int maxRecordsPerKey) { final Properties producerProps = generatorProperties(kafka); int numRecordsProduced = 0; final ValueList[] data = new ValueList[numKeys]; for (int i = 0; i < numKeys; i++) { data[i] = new ValueList(i, i + maxRecordsPerKey - 1); } final Random rand = new Random(); try (final KafkaProducer<byte[], byte[]> producer = new KafkaProducer<>(producerProps)) { while (true) { final int index = rand.nextInt(numKeys); final String key = data[index].key; final int value = data[index].next(); final ProducerRecord<byte[], byte[]> record = new ProducerRecord<>( "data", stringSerde.serializer().serialize("", key), intSerde.serializer().serialize("", value) ); producer.send(record); numRecordsProduced++; if (numRecordsProduced % 100 == 0) { System.out.println(Instant.now() + " " + numRecordsProduced + " records produced"); } Utils.sleep(2); } } } public static Map<String, Set<Integer>> generate(final String kafka, final int numKeys, final int maxRecordsPerKey, final Duration timeToSpend) { final Properties producerProps = generatorProperties(kafka); int numRecordsProduced = 0; final Map<String, Set<Integer>> allData = new HashMap<>(); final ValueList[] data = new ValueList[numKeys]; for (int i = 0; i < numKeys; i++) { data[i] = new ValueList(i, i + maxRecordsPerKey - 1); allData.put(data[i].key, new HashSet<>()); } final Random rand = new Random(); int remaining = data.length; final long recordPauseTime = timeToSpend.toMillis() / numKeys / maxRecordsPerKey; List<ProducerRecord<byte[], byte[]>> needRetry = new ArrayList<>(); try (final KafkaProducer<byte[], byte[]> producer = new KafkaProducer<>(producerProps)) { while (remaining > 0) { final int index = rand.nextInt(remaining); final String key = data[index].key; final int value = data[index].next(); if (value < 0) { remaining--; data[index] = data[remaining]; } else { final ProducerRecord<byte[], byte[]> record = new ProducerRecord<>( "data", stringSerde.serializer().serialize("", key), intSerde.serializer().serialize("", value) ); producer.send(record, new TestCallback(record, needRetry)); numRecordsProduced++; allData.get(key).add(value); if (numRecordsProduced % 100 == 0) { System.out.println(Instant.now() + " " + numRecordsProduced + " records produced"); } Utils.sleep(Math.max(recordPauseTime, 2)); } } producer.flush(); int remainingRetries = 5; while (!needRetry.isEmpty()) { final List<ProducerRecord<byte[], byte[]>> needRetry2 = new ArrayList<>(); for (final ProducerRecord<byte[], byte[]> record : needRetry) { System.out.println("retry producing " + stringSerde.deserializer().deserialize("", record.key())); producer.send(record, new TestCallback(record, needRetry2)); } producer.flush(); needRetry = needRetry2; if (--remainingRetries == 0 && !needRetry.isEmpty()) { System.err.println("Failed to produce all records after multiple retries"); Exit.exit(1); } } // now that we've sent everything, we'll send some final records with a timestamp high enough to flush out // all suppressed records. final List<PartitionInfo> partitions = producer.partitionsFor("data"); for (final PartitionInfo partition : partitions) { producer.send(new ProducerRecord<>( partition.topic(), partition.partition(), System.currentTimeMillis() + Duration.ofDays(2).toMillis(), stringSerde.serializer().serialize("", "flush"), intSerde.serializer().serialize("", 0) )); } } return Collections.unmodifiableMap(allData); } private static Properties generatorProperties(final String kafka) { final Properties producerProps = new Properties(); producerProps.put(ProducerConfig.CLIENT_ID_CONFIG, "SmokeTest"); producerProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, kafka); producerProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class); producerProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class); producerProps.put(ProducerConfig.ACKS_CONFIG, "all"); return producerProps; } private static class TestCallback implements Callback { private final ProducerRecord<byte[], byte[]> originalRecord; private final List<ProducerRecord<byte[], byte[]>> needRetry; TestCallback(final ProducerRecord<byte[], byte[]> originalRecord, final List<ProducerRecord<byte[], byte[]>> needRetry) { this.originalRecord = originalRecord; this.needRetry = needRetry; } @Override public void onCompletion(final RecordMetadata metadata, final Exception exception) { if (exception != null) { if (exception instanceof TimeoutException) { needRetry.add(originalRecord); } else { exception.printStackTrace(); Exit.exit(1); } } } } private static void shuffle(final int[] data, @SuppressWarnings("SameParameterValue") final int windowSize) { final Random rand = new Random(); for (int i = 0; i < data.length; i++) { // we shuffle data within windowSize final int j = rand.nextInt(Math.min(data.length - i, windowSize)) + i; // swap final int tmp = data[i]; data[i] = data[j]; data[j] = tmp; } } public static class NumberDeserializer implements Deserializer<Number> { @Override public Number deserialize(final String topic, final byte[] data) { final Number value; switch (topic) { case "data": case "echo": case "min": case "min-raw": case "min-suppressed": case "sws-raw": case "sws-suppressed": case "max": case "dif": value = intSerde.deserializer().deserialize(topic, data); break; case "sum": case "cnt": case "tagg": value = longSerde.deserializer().deserialize(topic, data); break; case "avg": value = doubleSerde.deserializer().deserialize(topic, data); break; default: throw new RuntimeException("unknown topic: " + topic); } return value; } } public static VerificationResult verify(final String kafka, final Map<String, Set<Integer>> inputs, final int maxRecordsPerKey) { final Properties props = new Properties(); props.put(ConsumerConfig.CLIENT_ID_CONFIG, "verifier"); props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, kafka); props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, NumberDeserializer.class); props.put(ConsumerConfig.ISOLATION_LEVEL_CONFIG, "read_committed"); final KafkaConsumer<String, Number> consumer = new KafkaConsumer<>(props); final List<TopicPartition> partitions = getAllPartitions(consumer, TOPICS); consumer.assign(partitions); consumer.seekToBeginning(partitions); final int recordsGenerated = inputs.size() * maxRecordsPerKey; int recordsProcessed = 0; final Map<String, AtomicInteger> processed = Stream.of(TOPICS) .collect(Collectors.toMap(t -> t, t -> new AtomicInteger(0))); final Map<String, Map<String, LinkedList<ConsumerRecord<String, Number>>>> events = new HashMap<>(); VerificationResult verificationResult = new VerificationResult(false, "no results yet"); int retry = 0; final long start = System.currentTimeMillis(); while (System.currentTimeMillis() - start < TimeUnit.MINUTES.toMillis(6)) { final ConsumerRecords<String, Number> records = consumer.poll(Duration.ofSeconds(5)); if (records.isEmpty() && recordsProcessed >= recordsGenerated) { verificationResult = verifyAll(inputs, events, false); if (verificationResult.passed()) { break; } else if (retry++ > MAX_RECORD_EMPTY_RETRIES) { System.out.println(Instant.now() + " Didn't get any more results, verification hasn't passed, and out of retries."); break; } else { System.out.println(Instant.now() + " Didn't get any more results, but verification hasn't passed (yet). Retrying..." + retry); } } else { System.out.println(Instant.now() + " Get some more results from " + records.partitions() + ", resetting retry."); retry = 0; for (final ConsumerRecord<String, Number> record : records) { final String key = record.key(); final String topic = record.topic(); processed.get(topic).incrementAndGet(); if (topic.equals("echo")) { recordsProcessed++; if (recordsProcessed % 100 == 0) { System.out.println("Echo records processed = " + recordsProcessed); } } events.computeIfAbsent(topic, t -> new HashMap<>()) .computeIfAbsent(key, k -> new LinkedList<>()) .add(record); } System.out.println(processed); } } consumer.close(); final long finished = System.currentTimeMillis() - start; System.out.println("Verification time=" + finished); System.out.println("-------------------"); System.out.println("Result Verification"); System.out.println("-------------------"); System.out.println("recordGenerated=" + recordsGenerated); System.out.println("recordProcessed=" + recordsProcessed); if (recordsProcessed > recordsGenerated) { System.out.println("PROCESSED-MORE-THAN-GENERATED"); } else if (recordsProcessed < recordsGenerated) { System.out.println("PROCESSED-LESS-THAN-GENERATED"); } boolean success; final Map<String, Set<Number>> received = events.get("echo") .entrySet() .stream() .map(entry -> mkEntry( entry.getKey(), entry.getValue().stream().map(ConsumerRecord::value).collect(Collectors.toSet())) ) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); success = inputs.equals(received); if (success) { System.out.println("ALL-RECORDS-DELIVERED"); } else { int missedCount = 0; for (final Map.Entry<String, Set<Integer>> entry : inputs.entrySet()) { missedCount += received.get(entry.getKey()).size(); } System.out.println("missedRecords=" + missedCount); } // give it one more try if it's not already passing. if (!verificationResult.passed()) { verificationResult = verifyAll(inputs, events, true); } success &= verificationResult.passed(); System.out.println(verificationResult.result()); System.out.println(success ? "SUCCESS" : "FAILURE"); return verificationResult; } public static class VerificationResult { private final boolean passed; private final String result; VerificationResult(final boolean passed, final String result) { this.passed = passed; this.result = result; } public boolean passed() { return passed; } public String result() { return result; } } private static VerificationResult verifyAll(final Map<String, Set<Integer>> inputs, final Map<String, Map<String, LinkedList<ConsumerRecord<String, Number>>>> events, final boolean printResults) { final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); boolean pass; try (final PrintStream resultStream = new PrintStream(byteArrayOutputStream)) { pass = verifyTAgg(resultStream, inputs, events.get("tagg"), printResults); pass &= verifySuppressed(resultStream, "min-suppressed", events, printResults); pass &= verify(resultStream, "min-suppressed", inputs, events, windowedKey -> { final String unwindowedKey = windowedKey.substring(1, windowedKey.length() - 1).replaceAll("@.*", ""); return getMin(unwindowedKey); }, printResults); pass &= verifySuppressed(resultStream, "sws-suppressed", events, printResults); pass &= verify(resultStream, "min", inputs, events, SmokeTestDriver::getMin, printResults); pass &= verify(resultStream, "max", inputs, events, SmokeTestDriver::getMax, printResults); pass &= verify(resultStream, "dif", inputs, events, key -> getMax(key).intValue() - getMin(key).intValue(), printResults); pass &= verify(resultStream, "sum", inputs, events, SmokeTestDriver::getSum, printResults); pass &= verify(resultStream, "cnt", inputs, events, key1 -> getMax(key1).intValue() - getMin(key1).intValue() + 1L, printResults); pass &= verify(resultStream, "avg", inputs, events, SmokeTestDriver::getAvg, printResults); } return new VerificationResult(pass, new String(byteArrayOutputStream.toByteArray(), StandardCharsets.UTF_8)); } private static boolean verify(final PrintStream resultStream, final String topic, final Map<String, Set<Integer>> inputData, final Map<String, Map<String, LinkedList<ConsumerRecord<String, Number>>>> events, final Function<String, Number> keyToExpectation, final boolean printResults) { final Map<String, LinkedList<ConsumerRecord<String, Number>>> observedInputEvents = events.get("data"); final Map<String, LinkedList<ConsumerRecord<String, Number>>> outputEvents = events.getOrDefault(topic, emptyMap()); if (outputEvents.isEmpty()) { resultStream.println(topic + " is empty"); return false; } else { resultStream.printf("verifying %s with %d keys%n", topic, outputEvents.size()); if (outputEvents.size() != inputData.size()) { resultStream.printf("fail: resultCount=%d expectedCount=%s%n\tresult=%s%n\texpected=%s%n", outputEvents.size(), inputData.size(), outputEvents.keySet(), inputData.keySet()); return false; } for (final Map.Entry<String, LinkedList<ConsumerRecord<String, Number>>> entry : outputEvents.entrySet()) { final String key = entry.getKey(); final Number expected = keyToExpectation.apply(key); final Number actual = entry.getValue().getLast().value(); if (!expected.equals(actual)) { resultStream.printf("%s fail: key=%s actual=%s expected=%s%n", topic, key, actual, expected); if (printResults) { resultStream.printf("\t inputEvents=%n%s%n\t" + "echoEvents=%n%s%n\tmaxEvents=%n%s%n\tminEvents=%n%s%n\tdifEvents=%n%s%n\tcntEvents=%n%s%n\ttaggEvents=%n%s%n", indent("\t\t", observedInputEvents.get(key)), indent("\t\t", events.getOrDefault("echo", emptyMap()).getOrDefault(key, new LinkedList<>())), indent("\t\t", events.getOrDefault("max", emptyMap()).getOrDefault(key, new LinkedList<>())), indent("\t\t", events.getOrDefault("min", emptyMap()).getOrDefault(key, new LinkedList<>())), indent("\t\t", events.getOrDefault("dif", emptyMap()).getOrDefault(key, new LinkedList<>())), indent("\t\t", events.getOrDefault("cnt", emptyMap()).getOrDefault(key, new LinkedList<>())), indent("\t\t", events.getOrDefault("tagg", emptyMap()).getOrDefault(key, new LinkedList<>()))); if (!Utils.mkSet("echo", "max", "min", "dif", "cnt", "tagg").contains(topic)) resultStream.printf("%sEvents=%n%s%n", topic, indent("\t\t", entry.getValue())); } return false; } } return true; } } private static boolean verifySuppressed(final PrintStream resultStream, @SuppressWarnings("SameParameterValue") final String topic, final Map<String, Map<String, LinkedList<ConsumerRecord<String, Number>>>> events, final boolean printResults) { resultStream.println("verifying suppressed " + topic); final Map<String, LinkedList<ConsumerRecord<String, Number>>> topicEvents = events.getOrDefault(topic, emptyMap()); for (final Map.Entry<String, LinkedList<ConsumerRecord<String, Number>>> entry : topicEvents.entrySet()) { if (entry.getValue().size() != 1) { final String unsuppressedTopic = topic.replace("-suppressed", "-raw"); final String key = entry.getKey(); final String unwindowedKey = key.substring(1, key.length() - 1).replaceAll("@.*", ""); resultStream.printf("fail: key=%s%n\tnon-unique result:%n%s%n", key, indent("\t\t", entry.getValue())); if (printResults) resultStream.printf("\tresultEvents:%n%s%n\tinputEvents:%n%s%n", indent("\t\t", events.get(unsuppressedTopic).get(key)), indent("\t\t", events.get("data").get(unwindowedKey))); return false; } } return true; } private static String indent(@SuppressWarnings("SameParameterValue") final String prefix, final Iterable<ConsumerRecord<String, Number>> list) { final StringBuilder stringBuilder = new StringBuilder(); for (final ConsumerRecord<String, Number> record : list) { stringBuilder.append(prefix).append(record).append('\n'); } return stringBuilder.toString(); } private static Long getSum(final String key) { final int min = getMin(key).intValue(); final int max = getMax(key).intValue(); return ((long) min + max) * (max - min + 1L) / 2L; } private static Double getAvg(final String key) { final int min = getMin(key).intValue(); final int max = getMax(key).intValue(); return ((long) min + max) / 2.0; } private static boolean verifyTAgg(final PrintStream resultStream, final Map<String, Set<Integer>> allData, final Map<String, LinkedList<ConsumerRecord<String, Number>>> taggEvents, final boolean printResults) { if (taggEvents == null) { resultStream.println("tagg is missing"); return false; } else if (taggEvents.isEmpty()) { resultStream.println("tagg is empty"); return false; } else { resultStream.println("verifying tagg"); // generate expected answer final Map<String, Long> expected = new HashMap<>(); for (final String key : allData.keySet()) { final int min = getMin(key).intValue(); final int max = getMax(key).intValue(); final String cnt = Long.toString(max - min + 1L); expected.put(cnt, expected.getOrDefault(cnt, 0L) + 1); } // check the result for (final Map.Entry<String, LinkedList<ConsumerRecord<String, Number>>> entry : taggEvents.entrySet()) { final String key = entry.getKey(); Long expectedCount = expected.remove(key); if (expectedCount == null) { expectedCount = 0L; } if (entry.getValue().getLast().value().longValue() != expectedCount) { resultStream.println("fail: key=" + key + " tagg=" + entry.getValue() + " expected=" + expectedCount); if (printResults) resultStream.println("\t taggEvents: " + entry.getValue()); return false; } } } return true; } private static Number getMin(final String key) { return Integer.parseInt(key.split("-")[0]); } private static Number getMax(final String key) { return Integer.parseInt(key.split("-")[1]); } private static List<TopicPartition> getAllPartitions(final KafkaConsumer<?, ?> consumer, final String... topics) { final List<TopicPartition> partitions = new ArrayList<>(); for (final String topic : topics) { for (final PartitionInfo info : consumer.partitionsFor(topic)) { partitions.add(new TopicPartition(info.topic(), info.partition())); } } return partitions; } }
noslowerdna/kafka
streams/src/test/java/org/apache/kafka/streams/tests/SmokeTestDriver.java
Java
apache-2.0
27,631
# # Author:: Adam Edwards (<adamed@opscode.com>) # Copyright:: Copyright (c) 2013 Opscode, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # require 'chef/provider/windows_script' class Chef class Provider class Batch < Chef::Provider::WindowsScript provides :batch, os: "windows" def initialize (new_resource, run_context) super(new_resource, run_context, '.bat') end def command basepath = is_forced_32bit ? wow64_directory : run_context.node.kernel.os_info.system_directory interpreter_path = Chef::Util::PathHelper.join(basepath, interpreter) "\"#{interpreter_path}\" #{flags} \"#{script_file.path}\"" end def flags @new_resource.flags.nil? ? '/c' : new_resource.flags + ' /c' end end end end
baberthal/chef
lib/chef/provider/batch.rb
Ruby
apache-2.0
1,343
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <link rel="shortcut icon" href="../../assets/ico/favicon.png"> <title>Justified Nav Template for Bootstrap</title> <!-- Bootstrap core CSS --> <link href="../../dist/css/bootstrap.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="justified-nav.css" rel="stylesheet"> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="../../assets/js/html5shiv.js"></script> <script src="../../assets/js/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="masthead"> <h3 class="text-muted">Project name</h3> <ul class="nav nav-justified"> <li class="active"><a href="#">Home</a></li> <li><a href="#">Projects</a></li> <li><a href="#">Services</a></li> <li><a href="#">Downloads</a></li> <li><a href="#">About</a></li> <li><a href="#">Contact</a></li> </ul> </div> <!-- Jumbotron --> <div class="jumbotron"> <h1>Marketing stuff!</h1> <p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet.</p> <p><a class="btn btn-lg btn-success" href="#">Get started today</a></p> </div> <!-- Example row of columns --> <div class="row"> <div class="col-lg-4"> <h2>Heading</h2> <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p> <p><a class="btn btn-primary" href="#">View details &raquo;</a></p> </div> <div class="col-lg-4"> <h2>Heading</h2> <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p> <p><a class="btn btn-primary" href="#">View details &raquo;</a></p> </div> <div class="col-lg-4"> <h2>Heading</h2> <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa.</p> <p><a class="btn btn-primary" href="#">View details &raquo;</a></p> </div> </div> <!-- Site footer --> <div class="footer"> <p>&copy; Company 2013</p> </div> </div> <!-- /container --> <!-- Bootstrap core JavaScript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> </body> </html>
wardbell/UnicornStore
StartingSource/UnicornStore/src/UnicornStore/bower_components/bootstrap/examples/justified-nav/index.html
HTML
apache-2.0
3,223
/************************************************************ * * EaseMob CONFIDENTIAL * __________________ * Copyright (C) 2013-2014 EaseMob Technologies. All rights reserved. * * NOTICE: All information contained herein is, and remains * the property of EaseMob Technologies. * Dissemination of this information or reproduction of this material * is strictly forbidden unless prior written permission is obtained * from EaseMob Technologies. */ #import "EMChatImageBubbleView.h" #import "UIImageView+WebCache.h" NSString *const kRouterEventImageBubbleTapEventName = @"kRouterEventImageBubbleTapEventName"; @interface EMChatImageBubbleView () @end @implementation EMChatImageBubbleView - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { _imageView = [[UIImageView alloc] init]; [self addSubview:_imageView]; } return self; } - (CGSize)sizeThatFits:(CGSize)size { CGSize retSize = self.model.size; if (retSize.width == 0 || retSize.height == 0) { retSize.width = MAX_SIZE; retSize.height = MAX_SIZE; } if (retSize.width > retSize.height) { CGFloat height = MAX_SIZE / retSize.width * retSize.height; retSize.height = height; retSize.width = MAX_SIZE; }else { CGFloat width = MAX_SIZE / retSize.height * retSize.width; retSize.width = width; retSize.height = MAX_SIZE; } return CGSizeMake(retSize.width + BUBBLE_VIEW_PADDING * 2 + BUBBLE_ARROW_WIDTH, 2 * BUBBLE_VIEW_PADDING + retSize.height); } -(void)layoutSubviews { [super layoutSubviews]; CGRect frame = self.bounds; frame.size.width -= BUBBLE_ARROW_WIDTH; frame = CGRectInset(frame, BUBBLE_VIEW_PADDING, BUBBLE_VIEW_PADDING); if (self.model.isSender) { frame.origin.x = BUBBLE_VIEW_PADDING; }else{ frame.origin.x = BUBBLE_VIEW_PADDING + BUBBLE_ARROW_WIDTH; } frame.origin.y = BUBBLE_VIEW_PADDING; [self.imageView setFrame:frame]; } #pragma mark - setter - (void)setModel:(MessageModel *)model { [super setModel:model]; UIImage *image = _model.thumbnailImage; if (!image) { image = _model.image; if (!image) { image = [UIImage imageNamed:@"imageDownloadFail.png"]; } } self.imageView.image = image; } #pragma mark - public -(void)bubbleViewPressed:(id)sender { [self routerEventWithName:kRouterEventImageBubbleTapEventName userInfo:@{KMESSAGEKEY:self.model}]; } +(CGFloat)heightForBubbleWithObject:(MessageModel *)object { CGSize retSize = object.size; if (retSize.width == 0 || retSize.height == 0) { retSize.width = MAX_SIZE; retSize.height = MAX_SIZE; }else if (retSize.width > retSize.height) { CGFloat height = MAX_SIZE / retSize.width * retSize.height; retSize.height = height; retSize.width = MAX_SIZE; }else { CGFloat width = MAX_SIZE / retSize.height * retSize.width; retSize.width = width; retSize.height = MAX_SIZE; } return 2 * BUBBLE_VIEW_PADDING + retSize.height; } @end
jackyzonewen/FindMe
FindMe/Chat/ChatView/MessageView/ChatCell/ChatCellBubble/EMChatImageBubbleView.m
Matlab
apache-2.0
3,182
/* * Copyright 2012-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package sample; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.support.SpringBootServletInitializer; @SpringBootApplication public class SampleTomEEDeployApplication extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(SampleTomEEDeployApplication.class); } }
hqrt/jenkins2-course-spring-boot
spring-boot-deployment-tests/spring-boot-deployment-test-tomee/src/main/java/sample/SampleTomEEDeployApplication.java
Java
apache-2.0
1,123
<!-- @license Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <link rel="import" href="../polymer/polymer.html"> <link rel="import" href="../paper-slider/paper-slider.html"> <link rel="import" href="../paper-spinner/paper-spinner-lite.html"> <link rel="import" href="../tf-dashboard-common/tensorboard-color.html"> <link rel="import" href="../tf-imports/lodash.html"> <link rel="import" href="../tf-imports/d3.html"> <!-- tf-image-loader loads an individual image from the TensorBoard backend. Right now it always loads the most recent image. We should add support in the future for loading older images. --> <dom-module id="tf-image-loader"> <template> <div id="image-annotation"> <template is="dom-if" if="[[_hasAtLeastOneStep]]"> step <span class="step-value"> [[_stepValue]] </span> <template is="dom-if" if="[[_currentWallTime]]"> ([[_currentWallTime]]) </template> <paper-spinner-lite active hidden$=[[!_isImageLoading]]></paper-spinner-lite> </template> <template is="dom-if" if="[[_hasMultipleSteps]]"> <paper-slider id="steps" immediate-value="{{_stepIndex}}" max="[[_maxStepIndex]]" max-markers="[[_maxStepIndex]]" snaps step="1" value="{{_stepIndex}}"></paper-slider> </template> </div> <div id="main-image-container"></div> <style> :host { display: block; width: 100%; height: auto; position: relative; --step-slider-knob-color: #424242; } #image-annotation { border-left: 4px solid; padding-left: 5px; font-size: 12px; margin: -10px 0 10px 0; } #image-annotation .step-value { font-weight: bold; } #image-annotation paper-spinner-lite { width: 14px; height: 14px; vertical-align: text-bottom; --paper-spinner-color: var(--tb-orange-strong) } #steps { height: 15px; margin: 0 0 0 -15px; /* 31 comes from adding a padding of 15px from both sides of the paper-slider, subtracting * 1px so that the slider width aligns with the image (the last slider marker takes up 1px), * and adding 2px to account for a border of 1px on both sides of the image. 30 - 1 + 2. */ width: calc(100% + 31px); --paper-slider-active-color: var(--step-slider-knob-color); --paper-slider-knob-color: var(--step-slider-knob-color); --paper-slider-pin-color: var(--step-slider-knob-color); --paper-slider-knob-start-color: var(--step-slider-knob-color); --paper-slider-knob-start-border-color: var(--step-slider-knob-color); --paper-slider-pin-start-color: var(--step-slider-knob-color); } #main-image-container img { border: 1px solid #f5f5f5; image-rendering: -moz-crisp-edges; image-rendering: pixelated; display: block; width: 100%; height: auto; } </style> </template> <script> Polymer({ is: "tf-image-loader", properties: { colorScale: Object, run: String, // This is an array of Tensorboard Image&Datum objects (See backend.ts for details). The // properties of objects in this array are // { // width: number, // height: number, // wall_time: Date, // step: number, // url: string, // } _steps: { type: Array, value: [], notify: true, }, _stepIndex: { type: Number, notify: true, }, _hasAtLeastOneStep: { type: Boolean, computed: "_computeHasAtLeastOneStep(_steps)", }, _hasMultipleSteps: { type: Boolean, computed: "_computeHasMultipleSteps(_steps)", }, _stepValue: { type: Number, computed: "_computeStepValue(_stepIndex)", }, _currentWallTime: { type: Number, computed: "_computeCurrentWallTime(_stepIndex)", }, _maxStepIndex: { type: Number, computed: "_computeMaxStepIndex(_steps)", }, // We use a strictly increasing index to make sure that we don't settle on a stale image. _currentImageLoadIndex: { type: Number, value: 1, }, _isImageLoading: { type: Boolean, value: false, }, }, observers: [ "_updateImageUrl(_steps, _stepIndex)", ], redraw: function() { // Other dashboards logic requires a redraw method to be defined. redraw is called at // various places such as when the image is expanded. this.setSeriesData(this.run, this._steps); }, setVisibleSeries: function(runs) { // Do nothing. }, setSeriesData: function(run, steps) { this.set("run", run); this.set("_steps", steps); this.set("_stepIndex", steps.length - 1); // Update the border color based on the run. var color = this.colorScale.scale(run); this.$$("#image-annotation").style.borderColor = color; }, _updateImageUrl: function(steps, stepIndex) { // We manually change the image URL (instead of binding to the image's src attribute) // because we would like to manage what happens when the image starts to / finishes loading. if (!steps.length) { return; } let img = new Image(); img.id = "img"; // '#img' used to select the image in tf-image-dashboard. const loadIndex = ++this._currentImageLoadIndex; img.onload = img.onerror = (function() { if (loadIndex != this._currentImageLoadIndex) { // This load is no longer relevant. return; } // The new image has finished loading. Remove the old image. Add the new one. let mainImageContainer = this.$$("#main-image-container"); mainImageContainer.innerHTML = ""; Polymer.dom(mainImageContainer).appendChild(img); // The image has finished loading (or has erred and failed to load). this.set("_isImageLoading", false); }).bind(this); // Load the new image. this.set("_isImageLoading", true); img.src = steps[stepIndex].url; }, _computeHasAtLeastOneStep: function(steps) { return !!steps && steps.length > 0; }, _computeHasMultipleSteps: function(steps) { return !!steps && steps.length > 1; }, _computeStepValue: function(stepIndex) { return this._steps[stepIndex].step; }, _computeCurrentWallTime: function(stepIndex) { return this._steps[stepIndex].wall_time.toString(); }, _computeMaxStepIndex: function(steps) { return steps.length - 1; }, }); </script> </dom-module>
wangyum/tensorflow
tensorflow/tensorboard/components/tf_image_dashboard/tf-image-loader.html
HTML
apache-2.0
7,594
/* * Copyright (c) 2012, Freescale Semiconductor, Inc. * All rights reserved. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // File: sjc_iomux_config.c /* ------------------------------------------------------------------------------ * <auto-generated> * This code was generated by a tool. * Runtime Version:3.4.0.0 * * Changes to this file may cause incorrect behavior and will be lost if * the code is regenerated. * </auto-generated> * ------------------------------------------------------------------------------ */ #include "iomux_config.h" #include "registers/regsiomuxc.h" // Function to configure IOMUXC for sjc module. void sjc_iomux_config(void) { // Config sjc.JTAG_MOD to pad JTAG_MOD(Y14) // HW_IOMUXC_SW_PAD_CTL_PAD_JTAG_MOD_WR(0x0000B060); // Pad Control Register: // IOMUXC_SW_PAD_CTL_PAD_JTAG_MOD(0x020E045C) // LVE [22] - Low Voltage Enable Field Reset: DISABLED // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // DISABLED (0) - High Voltage // ENABLED (1) - Low Voltage // HYS [16] - Hysteresis Enable Field Reset: DISABLED // DISABLED (0) - CMOS input // ENABLED (1) - Schmitt trigger input // PUS [15:14] - Pull Up / Down Config. Field Reset: 100K_OHM_PU // 100K_OHM_PD (0) - 100K Ohm Pull Down // 47K_OHM_PU (1) - 47K Ohm Pull Up // 100K_OHM_PU (2) - 100K Ohm Pull Up // 22K_OHM_PU (3) - 22K Ohm Pull Up // PUE [13] - Pull / Keep Select Field Reset: PULL // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // KEEP (0) - Keeper Enabled // PULL (1) - Pull Enabled // PKE [12] - Pull / Keep Enable Field Reset: ENABLED // DISABLED (0) - Pull/Keeper Disabled // ENABLED (1) - Pull/Keeper Enabled // ODE [11] - Open Drain Enable Field Reset: DISABLED // Enables open drain of the pin. // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // DISABLED (0) - Output is CMOS. // ENABLED (1) - Output is Open Drain. // SPEED [7:6] - Speed Field Reset: 50MHZ // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // RESERVED0 (0) - Reserved // 50MHZ (1) - Low (50 MHz) // 100MHZ (2) - Medium (100 MHz) // 200MHZ (3) - Maximum (200 MHz) // DSE [5:3] - Drive Strength Field Reset: 60_OHM // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // HIZ (0) - HI-Z // 240_OHM (1) - 240 Ohm // 120_OHM (2) - 120 Ohm // 80_OHM (3) - 80 Ohm // 60_OHM (4) - 60 Ohm // 48_OHM (5) - 48 Ohm // 40_OHM (6) - 40 Ohm // 34_OHM (7) - 34 Ohm // SRE [0] - Slew Rate Field Reset: SLOW // Slew rate control. // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // SLOW (0) - Slow Slew Rate // FAST (1) - Fast Slew Rate HW_IOMUXC_SW_PAD_CTL_PAD_JTAG_MOD_WR( BF_IOMUXC_SW_PAD_CTL_PAD_JTAG_MOD_HYS_V(DISABLED) | BF_IOMUXC_SW_PAD_CTL_PAD_JTAG_MOD_PUS_V(100K_OHM_PU) | BF_IOMUXC_SW_PAD_CTL_PAD_JTAG_MOD_PKE_V(ENABLED)); // Config sjc.JTAG_TCK to pad JTAG_TCK(AA14) // HW_IOMUXC_SW_PAD_CTL_PAD_JTAG_TCK_WR(0x00007060); // Pad Control Register: // IOMUXC_SW_PAD_CTL_PAD_JTAG_TCK(0x020E0460) // LVE [22] - Low Voltage Enable Field Reset: DISABLED // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // DISABLED (0) - High Voltage // ENABLED (1) - Low Voltage // HYS [16] - Hysteresis Enable Field Reset: DISABLED // DISABLED (0) - CMOS input // ENABLED (1) - Schmitt trigger input // PUS [15:14] - Pull Up / Down Config. Field Reset: 47K_OHM_PU // 100K_OHM_PD (0) - 100K Ohm Pull Down // 47K_OHM_PU (1) - 47K Ohm Pull Up // 100K_OHM_PU (2) - 100K Ohm Pull Up // 22K_OHM_PU (3) - 22K Ohm Pull Up // PUE [13] - Pull / Keep Select Field Reset: PULL // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // KEEP (0) - Keeper Enabled // PULL (1) - Pull Enabled // PKE [12] - Pull / Keep Enable Field Reset: ENABLED // DISABLED (0) - Pull/Keeper Disabled // ENABLED (1) - Pull/Keeper Enabled // ODE [11] - Open Drain Enable Field Reset: DISABLED // Enables open drain of the pin. // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // DISABLED (0) - Output is CMOS. // ENABLED (1) - Output is Open Drain. // SPEED [7:6] - Speed Field Reset: 50MHZ // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // RESERVED0 (0) - Reserved // 50MHZ (1) - Low (50 MHz) // 100MHZ (2) - Medium (100 MHz) // 200MHZ (3) - Maximum (200 MHz) // DSE [5:3] - Drive Strength Field Reset: 60_OHM // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // HIZ (0) - HI-Z // 240_OHM (1) - 240 Ohm // 120_OHM (2) - 120 Ohm // 80_OHM (3) - 80 Ohm // 60_OHM (4) - 60 Ohm // 48_OHM (5) - 48 Ohm // 40_OHM (6) - 40 Ohm // 34_OHM (7) - 34 Ohm // SRE [0] - Slew Rate Field Reset: SLOW // Slew rate control. // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // SLOW (0) - Slow Slew Rate // FAST (1) - Fast Slew Rate HW_IOMUXC_SW_PAD_CTL_PAD_JTAG_TCK_WR( BF_IOMUXC_SW_PAD_CTL_PAD_JTAG_TCK_HYS_V(DISABLED) | BF_IOMUXC_SW_PAD_CTL_PAD_JTAG_TCK_PUS_V(47K_OHM_PU) | BF_IOMUXC_SW_PAD_CTL_PAD_JTAG_TCK_PKE_V(ENABLED)); // Config sjc.JTAG_TDI to pad JTAG_TDI(W14) // HW_IOMUXC_SW_PAD_CTL_PAD_JTAG_TDI_WR(0x00007060); // Pad Control Register: // IOMUXC_SW_PAD_CTL_PAD_JTAG_TDI(0x020E0464) // LVE [22] - Low Voltage Enable Field Reset: DISABLED // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // DISABLED (0) - High Voltage // ENABLED (1) - Low Voltage // HYS [16] - Hysteresis Enable Field Reset: DISABLED // DISABLED (0) - CMOS input // ENABLED (1) - Schmitt trigger input // PUS [15:14] - Pull Up / Down Config. Field Reset: 47K_OHM_PU // 100K_OHM_PD (0) - 100K Ohm Pull Down // 47K_OHM_PU (1) - 47K Ohm Pull Up // 100K_OHM_PU (2) - 100K Ohm Pull Up // 22K_OHM_PU (3) - 22K Ohm Pull Up // PUE [13] - Pull / Keep Select Field Reset: PULL // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // KEEP (0) - Keeper Enabled // PULL (1) - Pull Enabled // PKE [12] - Pull / Keep Enable Field Reset: ENABLED // DISABLED (0) - Pull/Keeper Disabled // ENABLED (1) - Pull/Keeper Enabled // ODE [11] - Open Drain Enable Field Reset: DISABLED // Enables open drain of the pin. // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // DISABLED (0) - Output is CMOS. // ENABLED (1) - Output is Open Drain. // SPEED [7:6] - Speed Field Reset: 50MHZ // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // RESERVED0 (0) - Reserved // 50MHZ (1) - Low (50 MHz) // 100MHZ (2) - Medium (100 MHz) // 200MHZ (3) - Maximum (200 MHz) // DSE [5:3] - Drive Strength Field Reset: 60_OHM // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // HIZ (0) - HI-Z // 240_OHM (1) - 240 Ohm // 120_OHM (2) - 120 Ohm // 80_OHM (3) - 80 Ohm // 60_OHM (4) - 60 Ohm // 48_OHM (5) - 48 Ohm // 40_OHM (6) - 40 Ohm // 34_OHM (7) - 34 Ohm // SRE [0] - Slew Rate Field Reset: SLOW // Slew rate control. // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // SLOW (0) - Slow Slew Rate // FAST (1) - Fast Slew Rate HW_IOMUXC_SW_PAD_CTL_PAD_JTAG_TDI_WR( BF_IOMUXC_SW_PAD_CTL_PAD_JTAG_TDI_HYS_V(DISABLED) | BF_IOMUXC_SW_PAD_CTL_PAD_JTAG_TDI_PUS_V(47K_OHM_PU) | BF_IOMUXC_SW_PAD_CTL_PAD_JTAG_TDI_PKE_V(ENABLED)); // Config sjc.JTAG_TDO to pad JTAG_TDO(W15) // HW_IOMUXC_SW_PAD_CTL_PAD_JTAG_TDO_WR(0x000090B1); // Pad Control Register: // IOMUXC_SW_PAD_CTL_PAD_JTAG_TDO(0x020E0468) // LVE [22] - Low Voltage Enable Field Reset: DISABLED // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // DISABLED (0) - High Voltage // ENABLED (1) - Low Voltage // HYS [16] - Hysteresis Enable Field Reset: DISABLED // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // DISABLED (0) - CMOS input // ENABLED (1) - Schmitt trigger input // PUS [15:14] - Pull Up / Down Config. Field Reset: 100K_OHM_PU // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // 100K_OHM_PD (0) - 100K Ohm Pull Down // 47K_OHM_PU (1) - 47K Ohm Pull Up // 100K_OHM_PU (2) - 100K Ohm Pull Up // 22K_OHM_PU (3) - 22K Ohm Pull Up // PUE [13] - Pull / Keep Select Field Reset: KEEP // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // KEEP (0) - Keeper Enabled // PULL (1) - Pull Enabled // PKE [12] - Pull / Keep Enable Field Reset: ENABLED // DISABLED (0) - Pull/Keeper Disabled // ENABLED (1) - Pull/Keeper Enabled // ODE [11] - Open Drain Enable Field Reset: DISABLED // Enables open drain of the pin. // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // DISABLED (0) - Output is CMOS. // ENABLED (1) - Output is Open Drain. // SPEED [7:6] - Speed Field Reset: 100MHZ // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // RESERVED0 (0) - Reserved // 50MHZ (1) - Low (50 MHz) // 100MHZ (2) - Medium (100 MHz) // 200MHZ (3) - Maximum (200 MHz) // DSE [5:3] - Drive Strength Field Reset: 40_OHM // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // HIZ (0) - HI-Z // 240_OHM (1) - 240 Ohm // 120_OHM (2) - 120 Ohm // 80_OHM (3) - 80 Ohm // 60_OHM (4) - 60 Ohm // 48_OHM (5) - 48 Ohm // 40_OHM (6) - 40 Ohm // 34_OHM (7) - 34 Ohm // SRE [0] - Slew Rate Field Reset: FAST // Slew rate control. // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // SLOW (0) - Slow Slew Rate // FAST (1) - Fast Slew Rate HW_IOMUXC_SW_PAD_CTL_PAD_JTAG_TDO_WR( BF_IOMUXC_SW_PAD_CTL_PAD_JTAG_TDO_PKE_V(ENABLED)); // Config sjc.JTAG_TMS to pad JTAG_TMS(Y15) // HW_IOMUXC_SW_PAD_CTL_PAD_JTAG_TMS_WR(0x00007060); // Pad Control Register: // IOMUXC_SW_PAD_CTL_PAD_JTAG_TMS(0x020E046C) // LVE [22] - Low Voltage Enable Field Reset: DISABLED // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // DISABLED (0) - High Voltage // ENABLED (1) - Low Voltage // HYS [16] - Hysteresis Enable Field Reset: DISABLED // DISABLED (0) - CMOS input // ENABLED (1) - Schmitt trigger input // PUS [15:14] - Pull Up / Down Config. Field Reset: 47K_OHM_PU // 100K_OHM_PD (0) - 100K Ohm Pull Down // 47K_OHM_PU (1) - 47K Ohm Pull Up // 100K_OHM_PU (2) - 100K Ohm Pull Up // 22K_OHM_PU (3) - 22K Ohm Pull Up // PUE [13] - Pull / Keep Select Field Reset: PULL // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // KEEP (0) - Keeper Enabled // PULL (1) - Pull Enabled // PKE [12] - Pull / Keep Enable Field Reset: ENABLED // DISABLED (0) - Pull/Keeper Disabled // ENABLED (1) - Pull/Keeper Enabled // ODE [11] - Open Drain Enable Field Reset: DISABLED // Enables open drain of the pin. // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // DISABLED (0) - Output is CMOS. // ENABLED (1) - Output is Open Drain. // SPEED [7:6] - Speed Field Reset: 50MHZ // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // RESERVED0 (0) - Reserved // 50MHZ (1) - Low (50 MHz) // 100MHZ (2) - Medium (100 MHz) // 200MHZ (3) - Maximum (200 MHz) // DSE [5:3] - Drive Strength Field Reset: 60_OHM // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // HIZ (0) - HI-Z // 240_OHM (1) - 240 Ohm // 120_OHM (2) - 120 Ohm // 80_OHM (3) - 80 Ohm // 60_OHM (4) - 60 Ohm // 48_OHM (5) - 48 Ohm // 40_OHM (6) - 40 Ohm // 34_OHM (7) - 34 Ohm // SRE [0] - Slew Rate Field Reset: SLOW // Slew rate control. // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // SLOW (0) - Slow Slew Rate // FAST (1) - Fast Slew Rate HW_IOMUXC_SW_PAD_CTL_PAD_JTAG_TMS_WR( BF_IOMUXC_SW_PAD_CTL_PAD_JTAG_TMS_HYS_V(DISABLED) | BF_IOMUXC_SW_PAD_CTL_PAD_JTAG_TMS_PUS_V(47K_OHM_PU) | BF_IOMUXC_SW_PAD_CTL_PAD_JTAG_TMS_PKE_V(ENABLED)); // Config sjc.JTAG_TRSTB to pad JTAG_TRSTB(AA15) // HW_IOMUXC_SW_PAD_CTL_PAD_JTAG_TRSTB_WR(0x00007060); // Pad Control Register: // IOMUXC_SW_PAD_CTL_PAD_JTAG_TRSTB(0x020E0470) // LVE [22] - Low Voltage Enable Field Reset: DISABLED // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // DISABLED (0) - High Voltage // ENABLED (1) - Low Voltage // HYS [16] - Hysteresis Enable Field Reset: DISABLED // DISABLED (0) - CMOS input // ENABLED (1) - Schmitt trigger input // PUS [15:14] - Pull Up / Down Config. Field Reset: 47K_OHM_PU // 100K_OHM_PD (0) - 100K Ohm Pull Down // 47K_OHM_PU (1) - 47K Ohm Pull Up // 100K_OHM_PU (2) - 100K Ohm Pull Up // 22K_OHM_PU (3) - 22K Ohm Pull Up // PUE [13] - Pull / Keep Select Field Reset: PULL // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // KEEP (0) - Keeper Enabled // PULL (1) - Pull Enabled // PKE [12] - Pull / Keep Enable Field Reset: ENABLED // DISABLED (0) - Pull/Keeper Disabled // ENABLED (1) - Pull/Keeper Enabled // ODE [11] - Open Drain Enable Field Reset: DISABLED // Enables open drain of the pin. // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // DISABLED (0) - Output is CMOS. // ENABLED (1) - Output is Open Drain. // SPEED [7:6] - Speed Field Reset: 50MHZ // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // RESERVED0 (0) - Reserved // 50MHZ (1) - Low (50 MHz) // 100MHZ (2) - Medium (100 MHz) // 200MHZ (3) - Maximum (200 MHz) // DSE [5:3] - Drive Strength Field Reset: 60_OHM // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // HIZ (0) - HI-Z // 240_OHM (1) - 240 Ohm // 120_OHM (2) - 120 Ohm // 80_OHM (3) - 80 Ohm // 60_OHM (4) - 60 Ohm // 48_OHM (5) - 48 Ohm // 40_OHM (6) - 40 Ohm // 34_OHM (7) - 34 Ohm // SRE [0] - Slew Rate Field Reset: SLOW // Slew rate control. // NOTE: Read Only Field // The value of this field is fixed and cannot be changed. // SLOW (0) - Slow Slew Rate // FAST (1) - Fast Slew Rate HW_IOMUXC_SW_PAD_CTL_PAD_JTAG_TRSTB_WR( BF_IOMUXC_SW_PAD_CTL_PAD_JTAG_TRSTB_HYS_V(DISABLED) | BF_IOMUXC_SW_PAD_CTL_PAD_JTAG_TRSTB_PUS_V(47K_OHM_PU) | BF_IOMUXC_SW_PAD_CTL_PAD_JTAG_TRSTB_PKE_V(ENABLED)); }
AubrCool/rt-thread
bsp/imx6sx/iMX6_Platform_SDK/board/mx6sl/evk/iomux/sjc_iomux_config.c
C
apache-2.0
18,459
/* * Copyright 2000-2009 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.intellij.codeInsight.lookup.impl; import com.intellij.codeInsight.completion.JavaCompletionUtil; import com.intellij.codeInsight.lookup.DefaultLookupItemRenderer; import com.intellij.codeInsight.lookup.LookupElement; import com.intellij.codeInsight.lookup.LookupElementPresentation; import com.intellij.codeInsight.lookup.LookupItem; import com.intellij.psi.PsiDocCommentOwner; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiMethod; import com.intellij.psi.PsiType; import com.intellij.psi.impl.beanProperties.BeanPropertyElement; import com.intellij.psi.util.PsiUtilCore; import org.jetbrains.annotations.Nullable; import java.util.List; /** * @author yole */ public class JavaElementLookupRenderer implements ElementLookupRenderer { @Override public boolean handlesItem(final Object element) { return element instanceof BeanPropertyElement; } @Override public void renderElement(final LookupItem item, final Object element, final LookupElementPresentation presentation) { presentation.setIcon(DefaultLookupItemRenderer.getRawIcon(item, presentation.isReal())); presentation.setItemText(PsiUtilCore.getName((PsiElement)element)); presentation.setStrikeout(isToStrikeout(item)); presentation.setTailText((String)item.getAttribute(LookupItem.TAIL_TEXT_ATTR), item.getAttribute(LookupItem.TAIL_TEXT_SMALL_ATTR) != null); PsiType type = ((BeanPropertyElement)element).getPropertyType(); presentation.setTypeText(type == null ? null : type.getPresentableText()); } public static boolean isToStrikeout(LookupElement item) { final List<PsiMethod> allMethods = JavaCompletionUtil.getAllMethods(item); if (allMethods != null){ for (PsiMethod method : allMethods) { if (!method.isValid()) { //? return false; } if (!isDeprecated(method)) { return false; } } return true; } return isDeprecated(item.getPsiElement()); } private static boolean isDeprecated(@Nullable PsiElement element) { return element instanceof PsiDocCommentOwner && ((PsiDocCommentOwner)element).isDeprecated(); } }
clumsy/intellij-community
java/java-impl/src/com/intellij/codeInsight/lookup/impl/JavaElementLookupRenderer.java
Java
apache-2.0
2,753
/** ****************************************************************************** * @file stm32l4xx_hal_spi.c * @author MCD Application Team * @version V1.5.1 * @date 31-May-2016 * @brief SPI HAL module driver. * This file provides firmware functions to manage the following * functionalities of the Serial Peripheral Interface (SPI) peripheral: * + Initialization and de-initialization functions * + IO operation functions * + Peripheral Control functions * + Peripheral State functions * @verbatim ============================================================================== ##### How to use this driver ##### ============================================================================== [..] The SPI HAL driver can be used as follows: (#) Declare a SPI_HandleTypeDef handle structure, for example: SPI_HandleTypeDef hspi; (#)Initialize the SPI low level resources by implementing the HAL_SPI_MspInit() API: (##) Enable the SPIx interface clock (##) SPI pins configuration (+++) Enable the clock for the SPI GPIOs (+++) Configure these SPI pins as alternate function push-pull (##) NVIC configuration if you need to use interrupt process (+++) Configure the SPIx interrupt priority (+++) Enable the NVIC SPI IRQ handle (##) DMA Configuration if you need to use DMA process (+++) Declare a DMA_HandleTypeDef handle structure for the transmit or receive channel (+++) Enable the DMAx clock (+++) Configure the DMA handle parameters (+++) Configure the DMA Tx or Rx channel (+++) Associate the initialized hdma_tx handle to the hspi DMA Tx or Rx handle (+++) Configure the priority and enable the NVIC for the transfer complete interrupt on the DMA Tx or Rx channel (#) Program the Mode, BidirectionalMode , Data size, Baudrate Prescaler, NSS management, Clock polarity and phase, FirstBit and CRC configuration in the hspi Init structure. (#) Initialize the SPI registers by calling the HAL_SPI_Init() API: (++) This API configures also the low level Hardware GPIO, CLOCK, CORTEX...etc) by calling the customized HAL_SPI_MspInit() API. [..] Circular mode restriction: (#) The DMA circular mode cannot be used when the SPI is configured in these modes: (##) Master 2Lines RxOnly (##) Master 1Line Rx (#) The CRC feature is not managed when the DMA circular mode is enabled (#) When the SPI DMA Pause/Stop features are used, we must use the following APIs the HAL_SPI_DMAPause()/ HAL_SPI_DMAStop() only under the SPI callbacks @endverbatim ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "stm32l4xx_hal.h" /** @addtogroup STM32L4xx_HAL_Driver * @{ */ /** @defgroup SPI SPI * @brief SPI HAL module driver * @{ */ #ifdef HAL_SPI_MODULE_ENABLED /* Private typedef -----------------------------------------------------------*/ /* Private defines -----------------------------------------------------------*/ /** @defgroup SPI_Private_Constants SPI Private Constants * @{ */ #define SPI_DEFAULT_TIMEOUT 50 /** * @} */ /* Private macros ------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /** @defgroup SPI_Private_Functions SPI Private Functions * @{ */ static void SPI_DMATransmitCplt(DMA_HandleTypeDef *hdma); static void SPI_DMAReceiveCplt(DMA_HandleTypeDef *hdma); static void SPI_DMATransmitReceiveCplt(DMA_HandleTypeDef *hdma); static void SPI_DMAHalfTransmitCplt(DMA_HandleTypeDef *hdma); static void SPI_DMAHalfReceiveCplt(DMA_HandleTypeDef *hdma); static void SPI_DMAHalfTransmitReceiveCplt(DMA_HandleTypeDef *hdma); static void SPI_DMAError(DMA_HandleTypeDef *hdma); static HAL_StatusTypeDef SPI_WaitFlagStateUntilTimeout(SPI_HandleTypeDef *hspi, uint32_t Flag, uint32_t State, uint32_t Timeout); static HAL_StatusTypeDef SPI_WaitFifoStateUntilTimeout(SPI_HandleTypeDef *hspi, uint32_t Fifo, uint32_t State, uint32_t Timeout); static void SPI_TxISR_8BIT(struct __SPI_HandleTypeDef *hspi); static void SPI_TxISR_16BIT(struct __SPI_HandleTypeDef *hspi); static void SPI_RxISR_8BIT(struct __SPI_HandleTypeDef *hspi); static void SPI_RxISR_8BITCRC(struct __SPI_HandleTypeDef *hspi); static void SPI_RxISR_16BIT(struct __SPI_HandleTypeDef *hspi); static void SPI_RxISR_16BITCRC(struct __SPI_HandleTypeDef *hspi); static void SPI_2linesRxISR_8BIT(struct __SPI_HandleTypeDef *hspi); static void SPI_2linesRxISR_8BITCRC(struct __SPI_HandleTypeDef *hspi); static void SPI_2linesTxISR_8BIT(struct __SPI_HandleTypeDef *hspi); static void SPI_2linesTxISR_16BIT(struct __SPI_HandleTypeDef *hspi); static void SPI_2linesRxISR_16BIT(struct __SPI_HandleTypeDef *hspi); static void SPI_2linesRxISR_16BITCRC(struct __SPI_HandleTypeDef *hspi); static void SPI_CloseRxTx_ISR(SPI_HandleTypeDef *hspi); static void SPI_CloseRx_ISR(SPI_HandleTypeDef *hspi); static void SPI_CloseTx_ISR(SPI_HandleTypeDef *hspi); static HAL_StatusTypeDef SPI_EndRxTransaction(SPI_HandleTypeDef *hspi, uint32_t Timeout); static HAL_StatusTypeDef SPI_EndRxTxTransaction(SPI_HandleTypeDef *hspi, uint32_t Timeout); /** * @} */ /* Exported functions ---------------------------------------------------------*/ /** @defgroup SPI_Exported_Functions SPI Exported Functions * @{ */ /** @defgroup SPI_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @verbatim =============================================================================== ##### Initialization and de-initialization functions ##### =============================================================================== [..] This subsection provides a set of functions allowing to initialize and de-initialize the SPIx peripheral: (+) User must implement HAL_SPI_MspInit() function in which he configures all related peripherals resources (CLOCK, GPIO, DMA, IT and NVIC ). (+) Call the function HAL_SPI_Init() to configure the selected device with the selected configuration: (++) Mode (++) Direction (++) Data Size (++) Clock Polarity and Phase (++) NSS Management (++) BaudRate Prescaler (++) FirstBit (++) TIMode (++) CRC Calculation (++) CRC Polynomial if CRC enabled (++) CRC Length, used only with Data8 and Data16 (++) FIFO reception threshold (+) Call the function HAL_SPI_DeInit() to restore the default configuration of the selected SPIx peripheral. @endverbatim * @{ */ /** * @brief Initialize the SPI according to the specified parameters * in the SPI_InitTypeDef and initialize the associated handle. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_Init(SPI_HandleTypeDef *hspi) { uint32_t frxth; /* Check the SPI handle allocation */ if(hspi == NULL) { return HAL_ERROR; } /* Check the parameters */ assert_param(IS_SPI_ALL_INSTANCE(hspi->Instance)); assert_param(IS_SPI_MODE(hspi->Init.Mode)); assert_param(IS_SPI_DIRECTION(hspi->Init.Direction)); assert_param(IS_SPI_DATASIZE(hspi->Init.DataSize)); assert_param(IS_SPI_CPOL(hspi->Init.CLKPolarity)); assert_param(IS_SPI_CPHA(hspi->Init.CLKPhase)); assert_param(IS_SPI_NSS(hspi->Init.NSS)); assert_param(IS_SPI_NSSP(hspi->Init.NSSPMode)); assert_param(IS_SPI_BAUDRATE_PRESCALER(hspi->Init.BaudRatePrescaler)); assert_param(IS_SPI_FIRST_BIT(hspi->Init.FirstBit)); assert_param(IS_SPI_TIMODE(hspi->Init.TIMode)); assert_param(IS_SPI_CRC_CALCULATION(hspi->Init.CRCCalculation)); assert_param(IS_SPI_CRC_POLYNOMIAL(hspi->Init.CRCPolynomial)); assert_param(IS_SPI_CRC_LENGTH(hspi->Init.CRCLength)); if(hspi->State == HAL_SPI_STATE_RESET) { /* Allocate lock resource and initialize it */ hspi->Lock = HAL_UNLOCKED; /* Init the low level hardware : GPIO, CLOCK, NVIC... */ HAL_SPI_MspInit(hspi); } hspi->State = HAL_SPI_STATE_BUSY; /* Disable the selected SPI peripheral */ __HAL_SPI_DISABLE(hspi); /* Align by default the rs fifo threshold on the data size */ if(hspi->Init.DataSize > SPI_DATASIZE_8BIT) { frxth = SPI_RXFIFO_THRESHOLD_HF; } else { frxth = SPI_RXFIFO_THRESHOLD_QF; } /* CRC calculation is valid only for 16Bit and 8 Bit */ if(( hspi->Init.DataSize != SPI_DATASIZE_16BIT ) && ( hspi->Init.DataSize != SPI_DATASIZE_8BIT )) { /* CRC must be disabled */ hspi->Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; } /* Align the CRC Length on the data size */ if( hspi->Init.CRCLength == SPI_CRC_LENGTH_DATASIZE) { /* CRC Length aligned on the data size : value set by default */ if(hspi->Init.DataSize > SPI_DATASIZE_8BIT) { hspi->Init.CRCLength = SPI_CRC_LENGTH_16BIT; } else { hspi->Init.CRCLength = SPI_CRC_LENGTH_8BIT; } } /*---------------------------- SPIx CR1 & CR2 Configuration ------------------------*/ /* Configure : SPI Mode, Communication Mode, Clock polarity and phase, NSS management, Communication speed, First bit, CRC calculation state, CRC Length */ hspi->Instance->CR1 = (hspi->Init.Mode | hspi->Init.Direction | hspi->Init.CLKPolarity | hspi->Init.CLKPhase | (hspi->Init.NSS & SPI_CR1_SSM) | hspi->Init.BaudRatePrescaler | hspi->Init.FirstBit | hspi->Init.CRCCalculation); if( hspi->Init.CRCLength == SPI_CRC_LENGTH_16BIT) { hspi->Instance->CR1|= SPI_CR1_CRCL; } /* Configure : NSS management */ /* Configure : Rx Fifo Threshold */ hspi->Instance->CR2 = (((hspi->Init.NSS >> 16) & SPI_CR2_SSOE) | hspi->Init.TIMode | hspi->Init.NSSPMode | hspi->Init.DataSize ) | frxth; /*---------------------------- SPIx CRCPOLY Configuration --------------------*/ /* Configure : CRC Polynomial */ hspi->Instance->CRCPR = hspi->Init.CRCPolynomial; hspi->ErrorCode = HAL_SPI_ERROR_NONE; hspi->State= HAL_SPI_STATE_READY; return HAL_OK; } /** * @brief DeInitialize the SPI peripheral. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_DeInit(SPI_HandleTypeDef *hspi) { /* Check the SPI handle allocation */ if(hspi == NULL) { return HAL_ERROR; } /* Check the parameters */ assert_param(IS_SPI_ALL_INSTANCE(hspi->Instance)); hspi->State = HAL_SPI_STATE_BUSY; /* Disable the SPI Peripheral Clock */ __HAL_SPI_DISABLE(hspi); /* DeInit the low level hardware: GPIO, CLOCK, NVIC... */ HAL_SPI_MspDeInit(hspi); hspi->ErrorCode = HAL_SPI_ERROR_NONE; hspi->State = HAL_SPI_STATE_RESET; __HAL_UNLOCK(hspi); return HAL_OK; } /** * @brief Initialize the SPI MSP. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ __weak void HAL_SPI_MspInit(SPI_HandleTypeDef *hspi) { /* Prevent unused argument(s) compilation warning */ UNUSED(hspi); /* NOTE : This function should not be modified, when the callback is needed, the HAL_SPI_MspInit should be implemented in the user file */ } /** * @brief DeInitialize the SPI MSP. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ __weak void HAL_SPI_MspDeInit(SPI_HandleTypeDef *hspi) { /* Prevent unused argument(s) compilation warning */ UNUSED(hspi); /* NOTE : This function should not be modified, when the callback is needed, the HAL_SPI_MspDeInit should be implemented in the user file */ } /** * @} */ /** @defgroup SPI_Exported_Functions_Group2 IO operation functions * @brief Data transfers functions * @verbatim ============================================================================== ##### IO operation functions ##### =============================================================================== [..] This subsection provides a set of functions allowing to manage the SPI data transfers. [..] The SPI supports master and slave mode : (#) There are two modes of transfer: (++) Blocking mode: The communication is performed in polling mode. The HAL status of all data processing is returned by the same function after finishing transfer. (++) No-Blocking mode: The communication is performed using Interrupts or DMA, These APIs return the HAL status. The end of the data processing will be indicated through the dedicated SPI IRQ when using Interrupt mode or the DMA IRQ when using DMA mode. The HAL_SPI_TxCpltCallback(), HAL_SPI_RxCpltCallback() and HAL_SPI_TxRxCpltCallback() user callbacks will be executed respectively at the end of the transmit or Receive process The HAL_SPI_ErrorCallback()user callback will be executed when a communication error is detected (#) APIs provided for these 2 transfer modes (Blocking mode or Non blocking mode using either Interrupt or DMA) exist for 1Line (simplex) and 2Lines (full duplex) modes. @endverbatim * @{ */ /** * @brief Transmit an amount of data in blocking mode. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @param pData: pointer to data buffer * @param Size: amount of data to be sent * @param Timeout: Timeout duration * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout) { uint32_t tickstart = HAL_GetTick(); HAL_StatusTypeDef errorcode = HAL_OK; assert_param(IS_SPI_DIRECTION_2LINES_OR_1LINE(hspi->Init.Direction)); /* Process Locked */ __HAL_LOCK(hspi); if(hspi->State != HAL_SPI_STATE_READY) { errorcode = HAL_BUSY; goto error; } if((pData == NULL ) || (Size == 0)) { errorcode = HAL_ERROR; goto error; } /* Set the transaction information */ hspi->State = HAL_SPI_STATE_BUSY_TX; hspi->ErrorCode = HAL_SPI_ERROR_NONE; hspi->pTxBuffPtr = pData; hspi->TxXferSize = Size; hspi->TxXferCount = Size; hspi->pRxBuffPtr = (uint8_t *)NULL; hspi->RxXferSize = 0; hspi->RxXferCount = 0; /* Configure communication direction : 1Line */ if(hspi->Init.Direction == SPI_DIRECTION_1LINE) { SPI_1LINE_TX(hspi); } /* Reset CRC Calculation */ if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { SPI_RESET_CRC(hspi); } /* Check if the SPI is already enabled */ if((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) { /* Enable SPI peripheral */ __HAL_SPI_ENABLE(hspi); } /* Transmit data in 16 Bit mode */ if(hspi->Init.DataSize > SPI_DATASIZE_8BIT) { /* Transmit data in 16 Bit mode */ while (hspi->TxXferCount > 0) { /* Wait until TXE flag is set to send data */ if((hspi->Instance->SR & SPI_FLAG_TXE) == SPI_FLAG_TXE) { hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr); hspi->pTxBuffPtr += sizeof(uint16_t); hspi->TxXferCount--; } else { /* Timeout management */ if((Timeout == 0) || ((Timeout != HAL_MAX_DELAY) && ((HAL_GetTick()-tickstart) >= Timeout))) { errorcode = HAL_TIMEOUT; goto error; } } } } /* Transmit data in 8 Bit mode */ else { while (hspi->TxXferCount > 0) { /* Wait until TXE flag is set to send data */ if((hspi->Instance->SR & SPI_FLAG_TXE) == SPI_FLAG_TXE) { if(hspi->TxXferCount > 1) { /* write on the data register in packing mode */ hspi->Instance->DR = *((uint16_t*)hspi->pTxBuffPtr); hspi->pTxBuffPtr += sizeof(uint16_t); hspi->TxXferCount -= 2; } else { *((__IO uint8_t*)&hspi->Instance->DR) = (*hspi->pTxBuffPtr++); hspi->TxXferCount--; } } else { /* Timeout management */ if((Timeout == 0) || ((Timeout != HAL_MAX_DELAY) && ((HAL_GetTick()-tickstart) >= Timeout))) { errorcode = HAL_TIMEOUT; goto error; } } } } /* Enable CRC Transmission */ if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { hspi->Instance->CR1|= SPI_CR1_CRCNEXT; } /* Check the end of the transaction */ if(SPI_EndRxTxTransaction(hspi,Timeout) != HAL_OK) { hspi->ErrorCode = HAL_SPI_ERROR_FLAG; } /* Clear overrun flag in 2 Lines communication mode because received is not read */ if(hspi->Init.Direction == SPI_DIRECTION_2LINES) { __HAL_SPI_CLEAR_OVRFLAG(hspi); } if(hspi->ErrorCode != HAL_SPI_ERROR_NONE) { errorcode = HAL_ERROR; } error: hspi->State = HAL_SPI_STATE_READY; /* Process Unlocked */ __HAL_UNLOCK(hspi); return errorcode; } /** * @brief Receive an amount of data in blocking mode. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @param pData: pointer to data buffer * @param Size: amount of data to be received * @param Timeout: Timeout duration * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_Receive(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout) { __IO uint16_t tmpreg; uint32_t tickstart = HAL_GetTick(); HAL_StatusTypeDef errorcode = HAL_OK; if((hspi->Init.Mode == SPI_MODE_MASTER) && (hspi->Init.Direction == SPI_DIRECTION_2LINES)) { /* the receive process is not supported in 2Lines direction master mode */ /* in this case we call the TransmitReceive process */ /* Process Locked */ return HAL_SPI_TransmitReceive(hspi,pData,pData,Size,Timeout); } /* Process Locked */ __HAL_LOCK(hspi); if(hspi->State != HAL_SPI_STATE_READY) { errorcode = HAL_BUSY; goto error; } if((pData == NULL ) || (Size == 0)) { errorcode = HAL_ERROR; goto error; } hspi->State = HAL_SPI_STATE_BUSY_RX; hspi->ErrorCode = HAL_SPI_ERROR_NONE; hspi->pRxBuffPtr = pData; hspi->RxXferSize = Size; hspi->RxXferCount = Size; hspi->pTxBuffPtr = (uint8_t *)NULL; hspi->TxXferSize = 0; hspi->TxXferCount = 0; /* Reset CRC Calculation */ if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { SPI_RESET_CRC(hspi); /* this is done to handle the CRCNEXT before the latest data */ hspi->RxXferCount--; } /* Set the Rx Fido threshold */ if(hspi->Init.DataSize > SPI_DATASIZE_8BIT) { /* set fiforxthresold according the reception data length: 16bit */ CLEAR_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD); } else { /* set fiforxthresold according the reception data length: 8bit */ SET_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD); } /* Configure communication direction 1Line and enabled SPI if needed */ if(hspi->Init.Direction == SPI_DIRECTION_1LINE) { SPI_1LINE_RX(hspi); } /* Check if the SPI is already enabled */ if((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) { /* Enable SPI peripheral */ __HAL_SPI_ENABLE(hspi); } if(hspi->Init.DataSize <= SPI_DATASIZE_8BIT) { /* Transfer loop */ while(hspi->RxXferCount > 0) { /* Check the RXNE flag */ if((hspi->Instance->SR & SPI_FLAG_RXNE) == SPI_FLAG_RXNE) { /* read the received data */ (*hspi->pRxBuffPtr++)= *(__IO uint8_t *)&hspi->Instance->DR; hspi->RxXferCount--; } else { /* Timeout management */ if((Timeout == 0) || ((Timeout != HAL_MAX_DELAY) && ((HAL_GetTick()-tickstart) >= Timeout))) { errorcode = HAL_TIMEOUT; goto error; } } } } else { /* Transfer loop */ while(hspi->RxXferCount > 0) { /* Check the RXNE flag */ if((hspi->Instance->SR & SPI_FLAG_RXNE) == SPI_FLAG_RXNE) { *((uint16_t*)hspi->pRxBuffPtr) = hspi->Instance->DR; hspi->pRxBuffPtr += sizeof(uint16_t); hspi->RxXferCount--; } else { /* Timeout management */ if((Timeout == 0) || ((Timeout != HAL_MAX_DELAY) && ((HAL_GetTick()-tickstart) >= Timeout))) { errorcode = HAL_TIMEOUT; goto error; } } } } /* Handle the CRC Transmission */ if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { /* freeze the CRC before the latest data */ hspi->Instance->CR1|= SPI_CR1_CRCNEXT; /* Read the latest data */ if(SPI_WaitFlagStateUntilTimeout(hspi, SPI_FLAG_RXNE, SPI_FLAG_RXNE, Timeout) != HAL_OK) { /* the latest data has not been received */ errorcode = HAL_TIMEOUT; goto error; } /* Receive last data in 16 Bit mode */ if(hspi->Init.DataSize > SPI_DATASIZE_8BIT) { *((uint16_t*)hspi->pRxBuffPtr) = hspi->Instance->DR; } /* Receive last data in 8 Bit mode */ else { *hspi->pRxBuffPtr = *(__IO uint8_t *)&hspi->Instance->DR; } /* Wait until TXE flag */ if(SPI_WaitFlagStateUntilTimeout(hspi, SPI_FLAG_RXNE, SPI_FLAG_RXNE, Timeout) != HAL_OK) { /* Flag Error*/ hspi->ErrorCode = HAL_SPI_ERROR_CRC; errorcode = HAL_TIMEOUT; goto error; } if(hspi->Init.DataSize == SPI_DATASIZE_16BIT) { tmpreg = hspi->Instance->DR; UNUSED(tmpreg); /* To avoid GCC warning */ } else { tmpreg = *(__IO uint8_t *)&hspi->Instance->DR; UNUSED(tmpreg); /* To avoid GCC warning */ if((hspi->Init.DataSize == SPI_DATASIZE_8BIT) && (hspi->Init.CRCLength == SPI_CRC_LENGTH_16BIT)) { if(SPI_WaitFlagStateUntilTimeout(hspi, SPI_FLAG_RXNE, SPI_FLAG_RXNE, Timeout) != HAL_OK) { /* Error on the CRC reception */ hspi->ErrorCode = HAL_SPI_ERROR_CRC; errorcode = HAL_TIMEOUT; goto error; } tmpreg = *(__IO uint8_t *)&hspi->Instance->DR; UNUSED(tmpreg); /* To avoid GCC warning */ } } } /* Check the end of the transaction */ if(SPI_EndRxTransaction(hspi,Timeout) != HAL_OK) { hspi->ErrorCode = HAL_SPI_ERROR_FLAG; } /* Check if CRC error occurred */ if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR) != RESET) { hspi->ErrorCode|= HAL_SPI_ERROR_CRC; __HAL_SPI_CLEAR_CRCERRFLAG(hspi); } if(hspi->ErrorCode != HAL_SPI_ERROR_NONE) { errorcode = HAL_ERROR; } error : hspi->State = HAL_SPI_STATE_READY; __HAL_UNLOCK(hspi); return errorcode; } /** * @brief Transmit and Receive an amount of data in blocking mode. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @param pTxData: pointer to transmission data buffer * @param pRxData: pointer to reception data buffer * @param Size: amount of data to be sent and received * @param Timeout: Timeout duration * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout) { __IO uint16_t tmpreg; uint32_t tickstart = HAL_GetTick(); HAL_StatusTypeDef errorcode = HAL_OK; assert_param(IS_SPI_DIRECTION_2LINES(hspi->Init.Direction)); /* Process Locked */ __HAL_LOCK(hspi); if(hspi->State != HAL_SPI_STATE_READY) { errorcode = HAL_BUSY; goto error; } if((pTxData == NULL) || (pRxData == NULL) || (Size == 0)) { errorcode = HAL_ERROR; goto error; } hspi->State = HAL_SPI_STATE_BUSY_TX_RX; hspi->ErrorCode = HAL_SPI_ERROR_NONE; hspi->pRxBuffPtr = pRxData; hspi->RxXferCount = Size; hspi->RxXferSize = Size; hspi->pTxBuffPtr = pTxData; hspi->TxXferCount = Size; hspi->TxXferSize = Size; /* Reset CRC Calculation */ if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { SPI_RESET_CRC(hspi); } /* Set the Rx Fido threshold */ if((hspi->Init.DataSize > SPI_DATASIZE_8BIT) || (hspi->RxXferCount > 1)) { /* set fiforxthreshold according the reception data length: 16bit */ CLEAR_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD); } else { /* set fiforxthreshold according the reception data length: 8bit */ SET_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD); } /* Check if the SPI is already enabled */ if((hspi->Instance->CR1 &SPI_CR1_SPE) != SPI_CR1_SPE) { /* Enable SPI peripheral */ __HAL_SPI_ENABLE(hspi); } /* Transmit and Receive data in 16 Bit mode */ if(hspi->Init.DataSize > SPI_DATASIZE_8BIT) { while ((hspi->TxXferCount > 0 ) || (hspi->RxXferCount > 0)) { /* Check TXE flag */ if((hspi->TxXferCount > 0) && ((hspi->Instance->SR & SPI_FLAG_TXE) == SPI_FLAG_TXE)) { hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr); hspi->pTxBuffPtr += sizeof(uint16_t); hspi->TxXferCount--; /* Enable CRC Transmission */ if((hspi->TxXferCount == 0) && (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)) { hspi->Instance->CR1|= SPI_CR1_CRCNEXT; } } /* Check RXNE flag */ if((hspi->RxXferCount > 0) && ((hspi->Instance->SR & SPI_FLAG_RXNE) == SPI_FLAG_RXNE)) { *((uint16_t *)hspi->pRxBuffPtr) = hspi->Instance->DR; hspi->pRxBuffPtr += sizeof(uint16_t); hspi->RxXferCount--; } if((Timeout != HAL_MAX_DELAY) && ((HAL_GetTick()-tickstart) >= Timeout)) { errorcode = HAL_TIMEOUT; goto error; } } } /* Transmit and Receive data in 8 Bit mode */ else { while((hspi->TxXferCount > 0) || (hspi->RxXferCount > 0)) { /* check TXE flag */ if((hspi->TxXferCount > 0) && ((hspi->Instance->SR & SPI_FLAG_TXE) == SPI_FLAG_TXE)) { if(hspi->TxXferCount > 1) { hspi->Instance->DR = *((uint16_t*)hspi->pTxBuffPtr); hspi->pTxBuffPtr += sizeof(uint16_t); hspi->TxXferCount -= 2; } else { *(__IO uint8_t *)&hspi->Instance->DR = (*hspi->pTxBuffPtr++); hspi->TxXferCount--; } /* Enable CRC Transmission */ if((hspi->TxXferCount == 0) && (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)) { hspi->Instance->CR1 |= SPI_CR1_CRCNEXT; } } /* Wait until RXNE flag is reset */ if((hspi->RxXferCount > 0) && ((hspi->Instance->SR & SPI_FLAG_RXNE) == SPI_FLAG_RXNE)) { if(hspi->RxXferCount > 1) { *((uint16_t*)hspi->pRxBuffPtr) = hspi->Instance->DR; hspi->pRxBuffPtr += sizeof(uint16_t); hspi->RxXferCount -= 2; if(hspi->RxXferCount <= 1) { /* set fiforxthresold before to switch on 8 bit data size */ SET_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD); } } else { (*hspi->pRxBuffPtr++) = *(__IO uint8_t *)&hspi->Instance->DR; hspi->RxXferCount--; } } if((Timeout != HAL_MAX_DELAY) && ((HAL_GetTick()-tickstart) >= Timeout)) { errorcode = HAL_TIMEOUT; goto error; } } } /* Read CRC from DR to close CRC calculation process */ if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { /* Wait until TXE flag */ if(SPI_WaitFlagStateUntilTimeout(hspi, SPI_FLAG_RXNE, SPI_FLAG_RXNE, Timeout) != HAL_OK) { /* Error on the CRC reception */ hspi->ErrorCode|= HAL_SPI_ERROR_CRC; errorcode = HAL_TIMEOUT; goto error; } if(hspi->Init.DataSize == SPI_DATASIZE_16BIT) { tmpreg = hspi->Instance->DR; UNUSED(tmpreg); /* To avoid GCC warning */ } else { tmpreg = *(__IO uint8_t *)&hspi->Instance->DR; UNUSED(tmpreg); /* To avoid GCC warning */ if(hspi->Init.CRCLength == SPI_CRC_LENGTH_16BIT) { if(SPI_WaitFlagStateUntilTimeout(hspi, SPI_FLAG_RXNE, SPI_FLAG_RXNE, Timeout) != HAL_OK) { /* Error on the CRC reception */ hspi->ErrorCode|= HAL_SPI_ERROR_CRC; errorcode = HAL_TIMEOUT; goto error; } tmpreg = *(__IO uint8_t *)&hspi->Instance->DR; UNUSED(tmpreg); /* To avoid GCC warning */ } } } /* Check if CRC error occurred */ if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR) != RESET) { hspi->ErrorCode|= HAL_SPI_ERROR_CRC; /* Clear CRC Flag */ __HAL_SPI_CLEAR_CRCERRFLAG(hspi); errorcode = HAL_ERROR; } /* Check the end of the transaction */ if(SPI_EndRxTxTransaction(hspi,Timeout) != HAL_OK) { hspi->ErrorCode = HAL_SPI_ERROR_FLAG; } if(hspi->ErrorCode != HAL_SPI_ERROR_NONE) { errorcode = HAL_ERROR; } error : hspi->State = HAL_SPI_STATE_READY; __HAL_UNLOCK(hspi); return errorcode; } /** * @brief Transmit an amount of data in non-blocking mode with Interrupt. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @param pData: pointer to data buffer * @param Size: amount of data to be sent * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_Transmit_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size) { HAL_StatusTypeDef errorcode = HAL_OK; assert_param(IS_SPI_DIRECTION_2LINES_OR_1LINE(hspi->Init.Direction)); /* Process Locked */ __HAL_LOCK(hspi); if((pData == NULL) || (Size == 0)) { errorcode = HAL_ERROR; goto error; } if(hspi->State != HAL_SPI_STATE_READY) { errorcode = HAL_BUSY; goto error; } /* prepare the transfer */ hspi->State = HAL_SPI_STATE_BUSY_TX; hspi->ErrorCode = HAL_SPI_ERROR_NONE; hspi->pTxBuffPtr = pData; hspi->TxXferSize = Size; hspi->TxXferCount = Size; hspi->pRxBuffPtr = (uint8_t *)NULL; hspi->RxXferSize = 0; hspi->RxXferCount = 0; hspi->RxISR = NULL; /* Set the function for IT treatment */ if(hspi->Init.DataSize > SPI_DATASIZE_8BIT ) { hspi->TxISR = SPI_TxISR_16BIT; } else { hspi->TxISR = SPI_TxISR_8BIT; } /* Configure communication direction : 1Line */ if(hspi->Init.Direction == SPI_DIRECTION_1LINE) { SPI_1LINE_TX(hspi); } /* Reset CRC Calculation */ if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { SPI_RESET_CRC(hspi); } /* Enable TXE and ERR interrupt */ __HAL_SPI_ENABLE_IT(hspi,(SPI_IT_TXE)); /* Check if the SPI is already enabled */ if((hspi->Instance->CR1 &SPI_CR1_SPE) != SPI_CR1_SPE) { /* Enable SPI peripheral */ __HAL_SPI_ENABLE(hspi); } error : __HAL_UNLOCK(hspi); return errorcode; } /** * @brief Receive an amount of data in non-blocking mode with Interrupt. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @param pData: pointer to data buffer * @param Size: amount of data to be sent * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_Receive_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size) { HAL_StatusTypeDef errorcode = HAL_OK; /* Process Locked */ __HAL_LOCK(hspi); if(hspi->State != HAL_SPI_STATE_READY) { errorcode = HAL_BUSY; goto error; } if((pData == NULL) || (Size == 0)) { errorcode = HAL_ERROR; goto error; } /* Configure communication */ hspi->State = HAL_SPI_STATE_BUSY_RX; hspi->ErrorCode = HAL_SPI_ERROR_NONE; hspi->pRxBuffPtr = pData; hspi->RxXferSize = Size; hspi->RxXferCount = Size; hspi->pTxBuffPtr = (uint8_t *)NULL; hspi->TxXferSize = 0; hspi->TxXferCount = 0; if((hspi->Init.Mode == SPI_MODE_MASTER) && (hspi->Init.Direction == SPI_DIRECTION_2LINES)) { /* Process Unlocked */ __HAL_UNLOCK(hspi); /* the receive process is not supported in 2Lines direction master mode */ /* in this we call the TransmitReceive process */ return HAL_SPI_TransmitReceive_IT(hspi,pData,pData,Size); } if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { hspi->CRCSize = 1; if((hspi->Init.DataSize <= SPI_DATASIZE_8BIT) && (hspi->Init.CRCLength == SPI_CRC_LENGTH_16BIT)) { hspi->CRCSize = 2; } } else { hspi->CRCSize = 0; } hspi->TxISR = NULL; /* check the data size to adapt Rx threshold and the set the function for IT treatment */ if(hspi->Init.DataSize > SPI_DATASIZE_8BIT ) { /* set fiforxthresold according the reception data length: 16 bit */ CLEAR_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD); hspi->RxISR = SPI_RxISR_16BIT; } else { /* set fiforxthresold according the reception data length: 8 bit */ SET_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD); hspi->RxISR = SPI_RxISR_8BIT; } /* Configure communication direction : 1Line */ if(hspi->Init.Direction == SPI_DIRECTION_1LINE) { SPI_1LINE_RX(hspi); } /* Reset CRC Calculation */ if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { SPI_RESET_CRC(hspi); } /* Enable TXE and ERR interrupt */ __HAL_SPI_ENABLE_IT(hspi, (SPI_IT_RXNE | SPI_IT_ERR)); /* Check if the SPI is already enabled */ if((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) { /* Enable SPI peripheral */ __HAL_SPI_ENABLE(hspi); } error : /* Process Unlocked */ __HAL_UNLOCK(hspi); return errorcode; } /** * @brief Transmit and Receive an amount of data in non-blocking mode with Interrupt. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @param pTxData: pointer to transmission data buffer * @param pRxData: pointer to reception data buffer * @param Size: amount of data to be sent and received * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_TransmitReceive_IT(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size) { HAL_StatusTypeDef errorcode = HAL_OK; assert_param(IS_SPI_DIRECTION_2LINES(hspi->Init.Direction)); /* Process locked */ __HAL_LOCK(hspi); if(!((hspi->State == HAL_SPI_STATE_READY) || \ ((hspi->Init.Mode == SPI_MODE_MASTER) && (hspi->Init.Direction == SPI_DIRECTION_2LINES) && (hspi->State == HAL_SPI_STATE_BUSY_RX)))) { errorcode = HAL_BUSY; goto error; } if((pTxData == NULL ) || (pRxData == NULL ) || (Size == 0)) { errorcode = HAL_ERROR; goto error; } hspi->CRCSize = 0; if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { hspi->CRCSize = 1; if((hspi->Init.DataSize <= SPI_DATASIZE_8BIT) && (hspi->Init.CRCLength == SPI_CRC_LENGTH_16BIT)) { hspi->CRCSize = 2; } } if(hspi->State != HAL_SPI_STATE_BUSY_RX) { hspi->State = HAL_SPI_STATE_BUSY_TX_RX; } hspi->ErrorCode = HAL_SPI_ERROR_NONE; hspi->pTxBuffPtr = pTxData; hspi->TxXferSize = Size; hspi->TxXferCount = Size; hspi->pRxBuffPtr = pRxData; hspi->RxXferSize = Size; hspi->RxXferCount = Size; /* Set the function for IT treatment */ if(hspi->Init.DataSize > SPI_DATASIZE_8BIT ) { hspi->RxISR = SPI_2linesRxISR_16BIT; hspi->TxISR = SPI_2linesTxISR_16BIT; } else { hspi->RxISR = SPI_2linesRxISR_8BIT; hspi->TxISR = SPI_2linesTxISR_8BIT; } /* Reset CRC Calculation */ if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { SPI_RESET_CRC(hspi); } /* check if packing mode is enabled and if there is more than 2 data to receive */ if((hspi->Init.DataSize > SPI_DATASIZE_8BIT) || (hspi->RxXferCount >= 2)) { /* set fiforxthresold according the reception data length: 16 bit */ CLEAR_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD); } else { /* set fiforxthresold according the reception data length: 8 bit */ SET_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD); } /* Enable TXE, RXNE and ERR interrupt */ __HAL_SPI_ENABLE_IT(hspi, (SPI_IT_TXE | SPI_IT_RXNE | SPI_IT_ERR)); /* Check if the SPI is already enabled */ if((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) { /* Enable SPI peripheral */ __HAL_SPI_ENABLE(hspi); } error : /* Process Unlocked */ __HAL_UNLOCK(hspi); return errorcode; } /** * @brief Transmit an amount of data in non-blocking mode with DMA. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @param pData: pointer to data buffer * @param Size: amount of data to be sent * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_Transmit_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size) { HAL_StatusTypeDef errorcode = HAL_OK; assert_param(IS_SPI_DIRECTION_2LINES_OR_1LINE(hspi->Init.Direction)); /* Process Locked */ __HAL_LOCK(hspi); if(hspi->State != HAL_SPI_STATE_READY) { errorcode = HAL_BUSY; goto error; } if((pData == NULL) || (Size == 0)) { errorcode = HAL_ERROR; goto error; } hspi->State = HAL_SPI_STATE_BUSY_TX; hspi->ErrorCode = HAL_SPI_ERROR_NONE; hspi->pTxBuffPtr = pData; hspi->TxXferSize = Size; hspi->TxXferCount = Size; hspi->pRxBuffPtr = (uint8_t *)NULL; hspi->RxXferSize = 0; hspi->RxXferCount = 0; /* Configure communication direction : 1Line */ if(hspi->Init.Direction == SPI_DIRECTION_1LINE) { SPI_1LINE_TX(hspi); } /* Reset CRC Calculation */ if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { SPI_RESET_CRC(hspi); } /* Set the SPI TxDMA Half transfer complete callback */ hspi->hdmatx->XferHalfCpltCallback = SPI_DMAHalfTransmitCplt; /* Set the SPI TxDMA transfer complete callback */ hspi->hdmatx->XferCpltCallback = SPI_DMATransmitCplt; /* Set the DMA error callback */ hspi->hdmatx->XferErrorCallback = SPI_DMAError; CLEAR_BIT(hspi->Instance->CR2, SPI_CR2_LDMATX); /* packing mode is enabled only if the DMA setting is HALWORD */ if((hspi->Init.DataSize <= SPI_DATASIZE_8BIT) && (hspi->hdmatx->Init.MemDataAlignment == DMA_MDATAALIGN_HALFWORD)) { /* Check the even/odd of the data size + crc if enabled */ if((hspi->TxXferCount & 0x1) == 0) { CLEAR_BIT(hspi->Instance->CR2, SPI_CR2_LDMATX); hspi->TxXferCount = (hspi->TxXferCount >> 1); } else { SET_BIT(hspi->Instance->CR2, SPI_CR2_LDMATX); hspi->TxXferCount = (hspi->TxXferCount >> 1) + 1; } } /* Enable the Tx DMA channel */ HAL_DMA_Start_IT(hspi->hdmatx, (uint32_t)hspi->pTxBuffPtr, (uint32_t)&hspi->Instance->DR, hspi->TxXferCount); /* Check if the SPI is already enabled */ if((hspi->Instance->CR1 &SPI_CR1_SPE) != SPI_CR1_SPE) { /* Enable SPI peripheral */ __HAL_SPI_ENABLE(hspi); } /* Enable Tx DMA Request */ SET_BIT(hspi->Instance->CR2, SPI_CR2_TXDMAEN); error : /* Process Unlocked */ __HAL_UNLOCK(hspi); return errorcode; } /** * @brief Receive an amount of data in non-blocking mode with DMA. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @param pData: pointer to data buffer * @note When the CRC feature is enabled the pData Length must be Size + 1. * @param Size: amount of data to be sent * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_Receive_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size) { HAL_StatusTypeDef errorcode = HAL_OK; /* Process Locked */ __HAL_LOCK(hspi); if(hspi->State != HAL_SPI_STATE_READY) { errorcode = HAL_BUSY; goto error; } if((pData == NULL) || (Size == 0)) { errorcode = HAL_ERROR; goto error; } hspi->State = HAL_SPI_STATE_BUSY_RX; hspi->ErrorCode = HAL_SPI_ERROR_NONE; hspi->pRxBuffPtr = pData; hspi->RxXferSize = Size; hspi->RxXferCount = Size; hspi->pTxBuffPtr = (uint8_t *)NULL; hspi->TxXferSize = 0; hspi->TxXferCount = 0; if((hspi->Init.Mode == SPI_MODE_MASTER) && (hspi->Init.Direction == SPI_DIRECTION_2LINES)) { /* Process Unlocked */ __HAL_UNLOCK(hspi); /* the receive process is not supported in 2Lines direction master mode */ /* in this case we call the TransmitReceive process */ return HAL_SPI_TransmitReceive_DMA(hspi,pData,pData,Size); } /* Configure communication direction : 1Line */ if(hspi->Init.Direction == SPI_DIRECTION_1LINE) { SPI_1LINE_RX(hspi); } /* Reset CRC Calculation */ if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { SPI_RESET_CRC(hspi); } /* packing mode management is enabled by the DMA settings */ if((hspi->Init.DataSize <= SPI_DATASIZE_8BIT) && (hspi->hdmarx->Init.MemDataAlignment == DMA_MDATAALIGN_HALFWORD)) { /* Restriction the DMA data received is not allowed in this mode */ errorcode = HAL_ERROR; goto error; } CLEAR_BIT(hspi->Instance->CR2, SPI_CR2_LDMARX); if( hspi->Init.DataSize > SPI_DATASIZE_8BIT) { /* set fiforxthresold according the reception data length: 16bit */ CLEAR_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD); } else { /* set fiforxthresold according the reception data length: 8bit */ SET_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD); } /* Set the SPI RxDMA Half transfer complete callback */ hspi->hdmarx->XferHalfCpltCallback = SPI_DMAHalfReceiveCplt; /* Set the SPI Rx DMA transfer complete callback */ hspi->hdmarx->XferCpltCallback = SPI_DMAReceiveCplt; /* Set the DMA error callback */ hspi->hdmarx->XferErrorCallback = SPI_DMAError; /* Enable Rx DMA Request */ SET_BIT(hspi->Instance->CR2, SPI_CR2_RXDMAEN); /* Enable the Rx DMA channel */ HAL_DMA_Start_IT(hspi->hdmarx, (uint32_t)&hspi->Instance->DR, (uint32_t)hspi->pRxBuffPtr, hspi->RxXferCount); /* Check if the SPI is already enabled */ if((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) { /* Enable SPI peripheral */ __HAL_SPI_ENABLE(hspi); } error: /* Process Unlocked */ __HAL_UNLOCK(hspi); return errorcode; } /** * @brief Transmit and Receive an amount of data in non-blocking mode with DMA. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @param pTxData: pointer to transmission data buffer * @param pRxData: pointer to reception data buffer * @note When the CRC feature is enabled the pRxData Length must be Size + 1 * @param Size: amount of data to be sent * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_TransmitReceive_DMA(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size) { HAL_StatusTypeDef errorcode = HAL_OK; assert_param(IS_SPI_DIRECTION_2LINES(hspi->Init.Direction)); /* Process locked */ __HAL_LOCK(hspi); if(!((hspi->State == HAL_SPI_STATE_READY) || ((hspi->Init.Mode == SPI_MODE_MASTER) && (hspi->Init.Direction == SPI_DIRECTION_2LINES) && (hspi->State == HAL_SPI_STATE_BUSY_RX)))) { errorcode = HAL_BUSY; goto error; } if((pTxData == NULL ) || (pRxData == NULL ) || (Size == 0)) { errorcode = HAL_ERROR; goto error; } /* check if the transmit Receive function is not called by a receive master */ if(hspi->State != HAL_SPI_STATE_BUSY_RX) { hspi->State = HAL_SPI_STATE_BUSY_TX_RX; } hspi->ErrorCode = HAL_SPI_ERROR_NONE; hspi->pTxBuffPtr = (uint8_t *)pTxData; hspi->TxXferSize = Size; hspi->TxXferCount = Size; hspi->pRxBuffPtr = (uint8_t *)pRxData; hspi->RxXferSize = Size; hspi->RxXferCount = Size; /* Reset CRC Calculation + increase the rxsize */ if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { SPI_RESET_CRC(hspi); } /* Reset the threshold bit */ CLEAR_BIT(hspi->Instance->CR2, SPI_CR2_LDMATX | SPI_CR2_LDMARX); /* the packing mode management is enabled by the DMA settings according the spi data size */ if(hspi->Init.DataSize > SPI_DATASIZE_8BIT) { /* set fiforxthreshold according the reception data length: 16bit */ CLEAR_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD); } else { /* set fiforxthresold according the reception data length: 8bit */ SET_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD); if(hspi->hdmatx->Init.MemDataAlignment == DMA_MDATAALIGN_HALFWORD) { if((hspi->TxXferSize & 0x1) == 0x0) { CLEAR_BIT(hspi->Instance->CR2, SPI_CR2_LDMATX); hspi->TxXferCount = hspi->TxXferCount >> 1; } else { SET_BIT(hspi->Instance->CR2, SPI_CR2_LDMATX); hspi->TxXferCount = (hspi->TxXferCount >> 1) + 1; } } if(hspi->hdmarx->Init.MemDataAlignment == DMA_MDATAALIGN_HALFWORD) { /* set fiforxthresold according the reception data length: 16bit */ CLEAR_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD); if((hspi->RxXferCount & 0x1) == 0x0 ) { CLEAR_BIT(hspi->Instance->CR2, SPI_CR2_LDMARX); hspi->RxXferCount = hspi->RxXferCount >> 1; } else { SET_BIT(hspi->Instance->CR2, SPI_CR2_LDMARX); hspi->RxXferCount = (hspi->RxXferCount >> 1) + 1; } } } /* Set the SPI Rx DMA transfer complete callback if the transfer request is a reception request (RXNE) */ if(hspi->State == HAL_SPI_STATE_BUSY_RX) { /* Set the SPI Rx DMA Half transfer complete callback */ hspi->hdmarx->XferHalfCpltCallback = SPI_DMAHalfReceiveCplt; hspi->hdmarx->XferCpltCallback = SPI_DMAReceiveCplt; } else { /* Set the SPI Rx DMA Half transfer complete callback */ hspi->hdmarx->XferHalfCpltCallback = SPI_DMAHalfTransmitReceiveCplt; hspi->hdmarx->XferCpltCallback = SPI_DMATransmitReceiveCplt; } /* Set the DMA error callback */ hspi->hdmarx->XferErrorCallback = SPI_DMAError; /* Enable Rx DMA Request */ SET_BIT(hspi->Instance->CR2, SPI_CR2_RXDMAEN); /* Enable the Rx DMA channel */ HAL_DMA_Start_IT(hspi->hdmarx, (uint32_t)&hspi->Instance->DR, (uint32_t) hspi->pRxBuffPtr, hspi->RxXferCount); /* Set the SPI DMA Tx Abort Complete callback to Null : Tx DMA will be aborted at end of Rx transfer (when Rx DMA Transfer Complete callback will be executed) */ hspi->hdmatx->XferAbortCallback = NULL; hspi->hdmatx->XferHalfCpltCallback = NULL; hspi->hdmatx->XferCpltCallback = NULL; hspi->hdmatx->XferErrorCallback = NULL; /* Enable the Tx DMA channel */ HAL_DMA_Start_IT(hspi->hdmatx, (uint32_t)hspi->pTxBuffPtr, (uint32_t)&hspi->Instance->DR, hspi->TxXferCount); /* Check if the SPI is already enabled */ if((hspi->Instance->CR1 &SPI_CR1_SPE) != SPI_CR1_SPE) { /* Enable SPI peripheral */ __HAL_SPI_ENABLE(hspi); } /* Enable Tx DMA Request */ SET_BIT(hspi->Instance->CR2, SPI_CR2_TXDMAEN); error : /* Process Unlocked */ __HAL_UNLOCK(hspi); return errorcode; } /** * @brief Pause the DMA Transfer. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for the specified SPI module. * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_DMAPause(SPI_HandleTypeDef *hspi) { /* Process Locked */ __HAL_LOCK(hspi); /* Disable the SPI DMA Tx & Rx requests */ CLEAR_BIT(hspi->Instance->CR2, SPI_CR2_TXDMAEN | SPI_CR2_RXDMAEN); /* Process Unlocked */ __HAL_UNLOCK(hspi); return HAL_OK; } /** * @brief Resume the DMA Transfer. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for the specified SPI module. * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_DMAResume(SPI_HandleTypeDef *hspi) { /* Process Locked */ __HAL_LOCK(hspi); /* Enable the SPI DMA Tx & Rx requests */ SET_BIT(hspi->Instance->CR2, SPI_CR2_TXDMAEN | SPI_CR2_RXDMAEN); /* Process Unlocked */ __HAL_UNLOCK(hspi); return HAL_OK; } /** * @brief Stop the DMA Transfer. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for the specified SPI module. * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_DMAStop(SPI_HandleTypeDef *hspi) { /* The Lock is not implemented on this API to allow the user application to call the HAL SPI API under callbacks HAL_SPI_TxCpltCallback() or HAL_SPI_RxCpltCallback() or HAL_SPI_TxRxCpltCallback(): when calling HAL_DMA_Abort() API the DMA TX/RX Transfer complete interrupt is generated and the correspond call back is executed HAL_SPI_TxCpltCallback() or HAL_SPI_RxCpltCallback() or HAL_SPI_TxRxCpltCallback() */ /* Abort the SPI DMA tx channel */ if(hspi->hdmatx != NULL) { HAL_DMA_Abort(hspi->hdmatx); } /* Abort the SPI DMA rx channel */ if(hspi->hdmarx != NULL) { HAL_DMA_Abort(hspi->hdmarx); } /* Disable the SPI DMA Tx & Rx requests */ CLEAR_BIT(hspi->Instance->CR2, SPI_CR2_TXDMAEN | SPI_CR2_RXDMAEN); hspi->State = HAL_SPI_STATE_READY; return HAL_OK; } /** * @brief Handle SPI interrupt request. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for the specified SPI module. * @retval None */ void HAL_SPI_IRQHandler(SPI_HandleTypeDef *hspi) { uint32_t itsource = hspi->Instance->CR2; uint32_t itflag = hspi->Instance->SR; /* SPI in mode Receiver ----------------------------------------------------*/ if(((itflag & SPI_FLAG_OVR) == RESET) && ((itflag & SPI_FLAG_RXNE) != RESET) && ((itsource & SPI_IT_RXNE) != RESET)) { hspi->RxISR(hspi); return; } /* SPI in mode Transmitter ---------------------------------------------------*/ if(((itflag & SPI_FLAG_TXE) != RESET) && ((itsource & SPI_IT_TXE) != RESET)) { hspi->TxISR(hspi); return; } /* SPI in Error Treatment ---------------------------------------------------*/ if((itflag & (SPI_FLAG_MODF | SPI_FLAG_OVR | SPI_FLAG_FRE)) != RESET) { /* SPI Overrun error interrupt occurred -------------------------------------*/ if((itflag & SPI_FLAG_OVR) != RESET) { if(hspi->State != HAL_SPI_STATE_BUSY_TX) { hspi->ErrorCode |= HAL_SPI_ERROR_OVR; __HAL_SPI_CLEAR_OVRFLAG(hspi); } else { return; } } /* SPI Mode Fault error interrupt occurred -------------------------------------*/ if((itflag & SPI_FLAG_MODF) != RESET) { hspi->ErrorCode |= HAL_SPI_ERROR_MODF; __HAL_SPI_CLEAR_MODFFLAG(hspi); } /* SPI Frame error interrupt occurred ----------------------------------------*/ if((itflag & SPI_FLAG_FRE) != RESET) { hspi->ErrorCode |= HAL_SPI_ERROR_FRE; __HAL_SPI_CLEAR_FREFLAG(hspi); } __HAL_SPI_DISABLE_IT(hspi, SPI_IT_RXNE | SPI_IT_TXE | SPI_IT_ERR); hspi->State = HAL_SPI_STATE_READY; HAL_SPI_ErrorCallback(hspi); return; } } /** * @brief Tx Transfer completed callback. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ __weak void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi) { /* Prevent unused argument(s) compilation warning */ UNUSED(hspi); /* NOTE : This function should not be modified, when the callback is needed, the HAL_SPI_TxCpltCallback should be implemented in the user file */ } /** * @brief Rx Transfer completed callback. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ __weak void HAL_SPI_RxCpltCallback(SPI_HandleTypeDef *hspi) { /* Prevent unused argument(s) compilation warning */ UNUSED(hspi); /* NOTE : This function should not be modified, when the callback is needed, the HAL_SPI_RxCpltCallback should be implemented in the user file */ } /** * @brief Tx and Rx Transfer completed callback. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ __weak void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef *hspi) { /* Prevent unused argument(s) compilation warning */ UNUSED(hspi); /* NOTE : This function should not be modified, when the callback is needed, the HAL_SPI_TxRxCpltCallback should be implemented in the user file */ } /** * @brief Tx Half Transfer completed callback. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ __weak void HAL_SPI_TxHalfCpltCallback(SPI_HandleTypeDef *hspi) { /* Prevent unused argument(s) compilation warning */ UNUSED(hspi); /* NOTE : This function should not be modified, when the callback is needed, the HAL_SPI_TxHalfCpltCallback should be implemented in the user file */ } /** * @brief Rx Half Transfer completed callback. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ __weak void HAL_SPI_RxHalfCpltCallback(SPI_HandleTypeDef *hspi) { /* Prevent unused argument(s) compilation warning */ UNUSED(hspi); /* NOTE : This function should not be modified, when the callback is needed, the HAL_SPI_RxHalfCpltCallback() should be implemented in the user file */ } /** * @brief Tx and Rx Half Transfer callback. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ __weak void HAL_SPI_TxRxHalfCpltCallback(SPI_HandleTypeDef *hspi) { /* Prevent unused argument(s) compilation warning */ UNUSED(hspi); /* NOTE : This function should not be modified, when the callback is needed, the HAL_SPI_TxRxHalfCpltCallback() should be implemented in the user file */ } /** * @brief SPI error callback. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ __weak void HAL_SPI_ErrorCallback(SPI_HandleTypeDef *hspi) { /* Prevent unused argument(s) compilation warning */ UNUSED(hspi); /* NOTE : This function should not be modified, when the callback is needed, the HAL_SPI_ErrorCallback should be implemented in the user file */ /* NOTE : The ErrorCode parameter in the hspi handle is updated by the SPI processes and user can use HAL_SPI_GetError() API to check the latest error occurred */ } /** * @} */ /** @defgroup SPI_Exported_Functions_Group3 Peripheral State and Errors functions * @brief SPI control functions * @verbatim =============================================================================== ##### Peripheral State and Errors functions ##### =============================================================================== [..] This subsection provides a set of functions allowing to control the SPI. (+) HAL_SPI_GetState() API can be helpful to check in run-time the state of the SPI peripheral (+) HAL_SPI_GetError() check in run-time Errors occurring during communication @endverbatim * @{ */ /** * @brief Return the SPI handle state. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval SPI state */ HAL_SPI_StateTypeDef HAL_SPI_GetState(SPI_HandleTypeDef *hspi) { /* Return SPI handle state */ return hspi->State; } /** * @brief Return the SPI error code. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval SPI error code in bitmap format */ uint32_t HAL_SPI_GetError(SPI_HandleTypeDef *hspi) { return hspi->ErrorCode; } /** * @} */ /** * @} */ /** @addtogroup SPI_Private_Functions * @brief Private functions * @{ */ /** * @brief DMA SPI transmit process complete callback. * @param hdma: pointer to a DMA_HandleTypeDef structure that contains * the configuration information for the specified DMA module. * @retval None */ static void SPI_DMATransmitCplt(DMA_HandleTypeDef *hdma) { SPI_HandleTypeDef* hspi = ( SPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; if((hdma->Instance->CCR & DMA_CCR_CIRC) != DMA_CCR_CIRC) { /* Disable Tx DMA Request */ CLEAR_BIT(hspi->Instance->CR2, SPI_CR2_TXDMAEN); /* Check the end of the transaction */ if(SPI_EndRxTxTransaction(hspi,SPI_DEFAULT_TIMEOUT) != HAL_OK) { hspi->ErrorCode = HAL_SPI_ERROR_FLAG; } /* Clear overrun flag in 2 Lines communication mode because received data is not read */ if(hspi->Init.Direction == SPI_DIRECTION_2LINES) { __HAL_SPI_CLEAR_OVRFLAG(hspi); } hspi->TxXferCount = 0; hspi->State = HAL_SPI_STATE_READY; if(hspi->ErrorCode != HAL_SPI_ERROR_NONE) { HAL_SPI_ErrorCallback(hspi); return; } } HAL_SPI_TxCpltCallback(hspi); } /** * @brief DMA SPI receive process complete callback. * @param hdma: pointer to a DMA_HandleTypeDef structure that contains * the configuration information for the specified DMA module. * @retval None */ static void SPI_DMAReceiveCplt(DMA_HandleTypeDef *hdma) { SPI_HandleTypeDef* hspi = ( SPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; if((hdma->Instance->CCR & DMA_CCR_CIRC) != DMA_CCR_CIRC) { __IO uint16_t tmpreg; /* CRC handling */ if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { /* Wait until TXE flag */ if(SPI_WaitFlagStateUntilTimeout(hspi, SPI_FLAG_RXNE, SPI_FLAG_RXNE, SPI_DEFAULT_TIMEOUT) != HAL_OK) { /* Error on the CRC reception */ hspi->ErrorCode|= HAL_SPI_ERROR_CRC; } if(hspi->Init.DataSize > SPI_DATASIZE_8BIT) { tmpreg = hspi->Instance->DR; UNUSED(tmpreg); /* To avoid GCC warning */ } else { tmpreg = *(__IO uint8_t *)&hspi->Instance->DR; UNUSED(tmpreg); /* To avoid GCC warning */ if(hspi->Init.CRCLength == SPI_CRC_LENGTH_16BIT) { if(SPI_WaitFlagStateUntilTimeout(hspi, SPI_FLAG_RXNE, SPI_FLAG_RXNE, SPI_DEFAULT_TIMEOUT) != HAL_OK) { /* Error on the CRC reception */ hspi->ErrorCode|= HAL_SPI_ERROR_CRC; } tmpreg = *(__IO uint8_t *)&hspi->Instance->DR; UNUSED(tmpreg); /* To avoid GCC warning */ } } } /* Disable Rx/Tx DMA Request (done by default to handle the case master rx direction 2 lines) */ CLEAR_BIT(hspi->Instance->CR2, SPI_CR2_TXDMAEN | SPI_CR2_RXDMAEN); /* Check the end of the transaction */ if(SPI_EndRxTransaction(hspi,SPI_DEFAULT_TIMEOUT)!=HAL_OK) { hspi->ErrorCode|= HAL_SPI_ERROR_FLAG; } hspi->RxXferCount = 0; hspi->State = HAL_SPI_STATE_READY; /* Check if CRC error occurred */ if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR) != RESET) { hspi->ErrorCode|= HAL_SPI_ERROR_CRC; __HAL_SPI_CLEAR_CRCERRFLAG(hspi); } if(hspi->ErrorCode != HAL_SPI_ERROR_NONE) { HAL_SPI_ErrorCallback(hspi); return; } } HAL_SPI_RxCpltCallback(hspi); } /** * @brief DMA SPI transmit receive process complete callback. * @param hdma : pointer to a DMA_HandleTypeDef structure that contains * the configuration information for the specified DMA module. * @retval None */ static void SPI_DMATransmitReceiveCplt(DMA_HandleTypeDef *hdma) { SPI_HandleTypeDef* hspi = ( SPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; if((hdma->Instance->CCR & DMA_CCR_CIRC) != DMA_CCR_CIRC) { __IO int16_t tmpreg; /* CRC handling */ if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { if((hspi->Init.DataSize == SPI_DATASIZE_8BIT) && (hspi->Init.CRCLength == SPI_CRC_LENGTH_8BIT)) { if(SPI_WaitFifoStateUntilTimeout(hspi, SPI_FLAG_FRLVL, SPI_FRLVL_QUARTER_FULL, SPI_DEFAULT_TIMEOUT) != HAL_OK) { /* Error on the CRC reception */ hspi->ErrorCode|= HAL_SPI_ERROR_CRC; } tmpreg = *(__IO uint8_t *)&hspi->Instance->DR; UNUSED(tmpreg); /* To avoid GCC warning */ } else { if(SPI_WaitFifoStateUntilTimeout(hspi, SPI_FLAG_FRLVL, SPI_FRLVL_HALF_FULL, SPI_DEFAULT_TIMEOUT) != HAL_OK) { /* Error on the CRC reception */ hspi->ErrorCode|= HAL_SPI_ERROR_CRC; } tmpreg = hspi->Instance->DR; UNUSED(tmpreg); /* To avoid GCC warning */ } } /* Check the end of the transaction */ if(SPI_EndRxTxTransaction(hspi,SPI_DEFAULT_TIMEOUT) != HAL_OK) { hspi->ErrorCode = HAL_SPI_ERROR_FLAG; } /* Disable Rx/Tx DMA Request */ CLEAR_BIT(hspi->Instance->CR2, SPI_CR2_TXDMAEN | SPI_CR2_RXDMAEN); hspi->TxXferCount = 0; hspi->RxXferCount = 0; hspi->State = HAL_SPI_STATE_READY; /* Check if CRC error occurred */ if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR) != RESET) { hspi->ErrorCode|= HAL_SPI_ERROR_CRC; __HAL_SPI_CLEAR_CRCERRFLAG(hspi); } if(hspi->ErrorCode != HAL_SPI_ERROR_NONE) { HAL_SPI_ErrorCallback(hspi); return; } } HAL_SPI_TxRxCpltCallback(hspi); } /** * @brief DMA SPI half transmit process complete callback. * @param hdma : pointer to a DMA_HandleTypeDef structure that contains * the configuration information for the specified DMA module. * @retval None */ static void SPI_DMAHalfTransmitCplt(DMA_HandleTypeDef *hdma) { SPI_HandleTypeDef* hspi = ( SPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; HAL_SPI_TxHalfCpltCallback(hspi); } /** * @brief DMA SPI half receive process complete callback. * @param hdma: pointer to a DMA_HandleTypeDef structure that contains * the configuration information for the specified DMA module. * @retval None */ static void SPI_DMAHalfReceiveCplt(DMA_HandleTypeDef *hdma) { SPI_HandleTypeDef* hspi = ( SPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; HAL_SPI_RxHalfCpltCallback(hspi); } /** * @brief DMA SPI half transmit receive process complete callback. * @param hdma : pointer to a DMA_HandleTypeDef structure that contains * the configuration information for the specified DMA module. * @retval None */ static void SPI_DMAHalfTransmitReceiveCplt(DMA_HandleTypeDef *hdma) { SPI_HandleTypeDef* hspi = ( SPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; HAL_SPI_TxRxHalfCpltCallback(hspi); } /** * @brief DMA SPI communication error callback. * @param hdma : pointer to a DMA_HandleTypeDef structure that contains * the configuration information for the specified DMA module. * @retval None */ static void SPI_DMAError(DMA_HandleTypeDef *hdma) { SPI_HandleTypeDef* hspi = ( SPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; /* Stop the disable DMA transfer on SPI side */ CLEAR_BIT(hspi->Instance->CR2, SPI_CR2_TXDMAEN | SPI_CR2_RXDMAEN); hspi->ErrorCode|= HAL_SPI_ERROR_DMA; hspi->State = HAL_SPI_STATE_READY; HAL_SPI_ErrorCallback(hspi); } /** * @brief Rx 8-bit handler for Transmit and Receive in Interrupt mode. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ static void SPI_2linesRxISR_8BIT(struct __SPI_HandleTypeDef *hspi) { /* Receive data in packing mode */ if(hspi->RxXferCount > 1) { *((uint16_t*)hspi->pRxBuffPtr) = hspi->Instance->DR; hspi->pRxBuffPtr += sizeof(uint16_t); hspi->RxXferCount -= 2; if(hspi->RxXferCount == 1) { /* set fiforxthresold according the reception data length: 8bit */ SET_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD); } } /* Receive data in 8 Bit mode */ else { *hspi->pRxBuffPtr++ = *((__IO uint8_t *)&hspi->Instance->DR); hspi->RxXferCount--; } /* check end of the reception */ if(hspi->RxXferCount == 0) { if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { SET_BIT(hspi->Instance->CR2, SPI_RXFIFO_THRESHOLD); hspi->RxISR = SPI_2linesRxISR_8BITCRC; return; } /* Disable RXNE interrupt */ __HAL_SPI_DISABLE_IT(hspi, SPI_IT_RXNE); if(hspi->TxXferCount == 0) { SPI_CloseRxTx_ISR(hspi); } } } /** * @brief Rx 8-bit handler for Transmit and Receive in Interrupt mode. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ static void SPI_2linesRxISR_8BITCRC(struct __SPI_HandleTypeDef *hspi) { __IO uint8_t tmpreg = *((__IO uint8_t *)&hspi->Instance->DR); UNUSED(tmpreg); /* To avoid GCC warning */ hspi->CRCSize--; /* check end of the reception */ if(hspi->CRCSize == 0) { /* Disable RXNE interrupt */ __HAL_SPI_DISABLE_IT(hspi, SPI_IT_RXNE); if(hspi->TxXferCount == 0) { SPI_CloseRxTx_ISR(hspi); } } } /** * @brief Tx 8-bit handler for Transmit and Receive in Interrupt mode. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ static void SPI_2linesTxISR_8BIT(struct __SPI_HandleTypeDef *hspi) { /* Transmit data in packing Bit mode */ if(hspi->TxXferCount >= 2) { hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr); hspi->pTxBuffPtr += sizeof(uint16_t); hspi->TxXferCount -= 2; } /* Transmit data in 8 Bit mode */ else { *(__IO uint8_t *)&hspi->Instance->DR = (*hspi->pTxBuffPtr++); hspi->TxXferCount--; } /* check the end of the transmission */ if(hspi->TxXferCount == 0) { if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { hspi->Instance->CR1 |= SPI_CR1_CRCNEXT; } /* Disable TXE interrupt */ __HAL_SPI_DISABLE_IT(hspi, SPI_IT_TXE); if(hspi->RxXferCount == 0) { SPI_CloseRxTx_ISR(hspi); } } } /** * @brief Rx 16-bit handler for Transmit and Receive in Interrupt mode. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ static void SPI_2linesRxISR_16BIT(struct __SPI_HandleTypeDef *hspi) { /* Receive data in 16 Bit mode */ *((uint16_t*)hspi->pRxBuffPtr) = hspi->Instance->DR; hspi->pRxBuffPtr += sizeof(uint16_t); hspi->RxXferCount--; if(hspi->RxXferCount == 0) { if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { hspi->RxISR = SPI_2linesRxISR_16BITCRC; return; } /* Disable RXNE interrupt */ __HAL_SPI_DISABLE_IT(hspi, SPI_IT_RXNE); if(hspi->TxXferCount == 0) { SPI_CloseRxTx_ISR(hspi); } } } /** * @brief Manage the CRC 16-bit receive for Transmit and Receive in Interrupt mode. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ static void SPI_2linesRxISR_16BITCRC(struct __SPI_HandleTypeDef *hspi) { /* Receive data in 16 Bit mode */ __IO uint16_t tmpreg = hspi->Instance->DR; UNUSED(tmpreg); /* To avoid GCC warning */ /* Disable RXNE interrupt */ __HAL_SPI_DISABLE_IT(hspi, SPI_IT_RXNE); SPI_CloseRxTx_ISR(hspi); } /** * @brief Tx 16-bit handler for Transmit and Receive in Interrupt mode. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ static void SPI_2linesTxISR_16BIT(struct __SPI_HandleTypeDef *hspi) { /* Transmit data in 16 Bit mode */ hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr); hspi->pTxBuffPtr += sizeof(uint16_t); hspi->TxXferCount--; /* Enable CRC Transmission */ if(hspi->TxXferCount == 0) { if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { hspi->Instance->CR1 |= SPI_CR1_CRCNEXT; } /* Disable TXE interrupt */ __HAL_SPI_DISABLE_IT(hspi, SPI_IT_TXE); if(hspi->RxXferCount == 0) { SPI_CloseRxTx_ISR(hspi); } } } /** * @brief Manage the CRC 8-bit receive in Interrupt context. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ static void SPI_RxISR_8BITCRC(struct __SPI_HandleTypeDef *hspi) { __IO uint8_t tmpreg = *((uint8_t*)&hspi->Instance->DR); UNUSED(tmpreg); /* To avoid GCC warning */ hspi->CRCSize--; if(hspi->CRCSize == 0) { SPI_CloseRx_ISR(hspi); } } /** * @brief Manage the receive 8-bit in Interrupt context. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ static void SPI_RxISR_8BIT(struct __SPI_HandleTypeDef *hspi) { *hspi->pRxBuffPtr++ = (*(__IO uint8_t *)&hspi->Instance->DR); hspi->RxXferCount--; /* Enable CRC Transmission */ if((hspi->RxXferCount == 1) && (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)) { hspi->Instance->CR1 |= SPI_CR1_CRCNEXT; } if(hspi->RxXferCount == 0) { if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { hspi->RxISR = SPI_RxISR_8BITCRC; return; } SPI_CloseRx_ISR(hspi); } } /** * @brief Manage the CRC 16-bit receive in Interrupt context. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ static void SPI_RxISR_16BITCRC(struct __SPI_HandleTypeDef *hspi) { __IO uint16_t tmpreg; tmpreg = hspi->Instance->DR; UNUSED(tmpreg); /* To avoid GCC warning */ /* Disable RXNE and ERR interrupt */ __HAL_SPI_DISABLE_IT(hspi, (SPI_IT_RXNE | SPI_IT_ERR)); SPI_CloseRx_ISR(hspi); } /** * @brief Manage the 16-bit receive in Interrupt context. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ static void SPI_RxISR_16BIT(struct __SPI_HandleTypeDef *hspi) { *((uint16_t *)hspi->pRxBuffPtr) = hspi->Instance->DR; hspi->pRxBuffPtr += sizeof(uint16_t); hspi->RxXferCount--; /* Enable CRC Transmission */ if((hspi->RxXferCount == 1) && (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)) { hspi->Instance->CR1 |= SPI_CR1_CRCNEXT; } if(hspi->RxXferCount == 0) { if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { hspi->RxISR = SPI_RxISR_16BITCRC; return; } SPI_CloseRx_ISR(hspi); } } /** * @brief Handle the data 8-bit transmit in Interrupt mode. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ static void SPI_TxISR_8BIT(struct __SPI_HandleTypeDef *hspi) { *(__IO uint8_t *)&hspi->Instance->DR = (*hspi->pTxBuffPtr++); hspi->TxXferCount--; if(hspi->TxXferCount == 0) { if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { /* Enable CRC Transmission */ hspi->Instance->CR1 |= SPI_CR1_CRCNEXT; } SPI_CloseTx_ISR(hspi); } } /** * @brief Handle the data 16-bit transmit in Interrupt mode. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ static void SPI_TxISR_16BIT(struct __SPI_HandleTypeDef *hspi) { /* Transmit data in 16 Bit mode */ hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr); hspi->pTxBuffPtr += sizeof(uint16_t); hspi->TxXferCount--; if(hspi->TxXferCount == 0) { if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { /* Enable CRC Transmission */ hspi->Instance->CR1 |= SPI_CR1_CRCNEXT; } SPI_CloseTx_ISR(hspi); } } /** * @brief Handle SPI Communication Timeout. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @param Flag : SPI flag to check * @param State : flag state to check * @param Timeout : Timeout duration * @retval HAL status */ static HAL_StatusTypeDef SPI_WaitFlagStateUntilTimeout(SPI_HandleTypeDef *hspi, uint32_t Flag, uint32_t State, uint32_t Timeout) { uint32_t tickstart = HAL_GetTick(); while((hspi->Instance->SR & Flag) != State) { if(Timeout != HAL_MAX_DELAY) { if((Timeout == 0) || ((HAL_GetTick()-tickstart) >= Timeout)) { /* Disable the SPI and reset the CRC: the CRC value should be cleared on both master and slave sides in order to resynchronize the master and slave for their respective CRC calculation */ /* Disable TXE, RXNE and ERR interrupts for the interrupt process */ __HAL_SPI_DISABLE_IT(hspi, (SPI_IT_TXE | SPI_IT_RXNE | SPI_IT_ERR)); if((hspi->Init.Mode == SPI_MODE_MASTER)&&((hspi->Init.Direction == SPI_DIRECTION_1LINE)||(hspi->Init.Direction == SPI_DIRECTION_2LINES_RXONLY))) { /* Disable SPI peripheral */ __HAL_SPI_DISABLE(hspi); } /* Reset CRC Calculation */ if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { SPI_RESET_CRC(hspi); } hspi->State= HAL_SPI_STATE_READY; /* Process Unlocked */ __HAL_UNLOCK(hspi); return HAL_TIMEOUT; } } } return HAL_OK; } /** * @brief Handle SPI FIFO Communication Timeout. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @param Fifo : Fifo to check * @param State : Fifo state to check * @param Timeout : Timeout duration * @retval HAL status */ static HAL_StatusTypeDef SPI_WaitFifoStateUntilTimeout(SPI_HandleTypeDef *hspi, uint32_t Fifo, uint32_t State, uint32_t Timeout) { __IO uint8_t tmpreg; uint32_t tickstart = HAL_GetTick(); while((hspi->Instance->SR & Fifo) != State) { if((Fifo == SPI_SR_FRLVL) && (State == SPI_FRLVL_EMPTY)) { tmpreg = *((__IO uint8_t*)&hspi->Instance->DR); UNUSED(tmpreg); /* To avoid GCC warning */ } if(Timeout != HAL_MAX_DELAY) { if((Timeout == 0) || ((HAL_GetTick()-tickstart) >= Timeout)) { /* Disable the SPI and reset the CRC: the CRC value should be cleared on both master and slave sides in order to resynchronize the master and slave for their respective CRC calculation */ /* Disable TXE, RXNE and ERR interrupts for the interrupt process */ __HAL_SPI_DISABLE_IT(hspi, (SPI_IT_TXE | SPI_IT_RXNE | SPI_IT_ERR)); if((hspi->Init.Mode == SPI_MODE_MASTER)&&((hspi->Init.Direction == SPI_DIRECTION_1LINE)||(hspi->Init.Direction == SPI_DIRECTION_2LINES_RXONLY))) { /* Disable SPI peripheral */ __HAL_SPI_DISABLE(hspi); } /* Reset CRC Calculation */ if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { SPI_RESET_CRC(hspi); } hspi->State = HAL_SPI_STATE_READY; /* Process Unlocked */ __HAL_UNLOCK(hspi); return HAL_TIMEOUT; } } } return HAL_OK; } /** * @brief Handle the check of the RX transaction complete. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @param Timeout : Timeout duration * @retval None */ static HAL_StatusTypeDef SPI_EndRxTransaction(SPI_HandleTypeDef *hspi, uint32_t Timeout) { if((hspi->Init.Mode == SPI_MODE_MASTER)&&((hspi->Init.Direction == SPI_DIRECTION_1LINE)||(hspi->Init.Direction == SPI_DIRECTION_2LINES_RXONLY))) { /* Disable SPI peripheral */ __HAL_SPI_DISABLE(hspi); } /* Control the BSY flag */ if(SPI_WaitFlagStateUntilTimeout(hspi, SPI_FLAG_BSY, RESET, Timeout) != HAL_OK) { hspi->ErrorCode |= HAL_SPI_ERROR_FLAG; return HAL_TIMEOUT; } if((hspi->Init.Mode == SPI_MODE_MASTER)&&((hspi->Init.Direction == SPI_DIRECTION_1LINE)||(hspi->Init.Direction == SPI_DIRECTION_2LINES_RXONLY))) { /* Empty the FRLVL fifo */ if(SPI_WaitFifoStateUntilTimeout(hspi, SPI_FLAG_FRLVL, SPI_FRLVL_EMPTY, Timeout) != HAL_OK) { hspi->ErrorCode |= HAL_SPI_ERROR_FLAG; return HAL_TIMEOUT; } } return HAL_OK; } /** * @brief Handle the check of the RXTX or TX transaction complete. * @param hspi: SPI handle * @param Timeout : Timeout duration */ static HAL_StatusTypeDef SPI_EndRxTxTransaction(SPI_HandleTypeDef *hspi, uint32_t Timeout) { /* Control if the TX fifo is empty */ if(SPI_WaitFifoStateUntilTimeout(hspi, SPI_FLAG_FTLVL, SPI_FTLVL_EMPTY, Timeout) != HAL_OK) { hspi->ErrorCode |= HAL_SPI_ERROR_FLAG; return HAL_TIMEOUT; } /* Control the BSY flag */ if(SPI_WaitFlagStateUntilTimeout(hspi, SPI_FLAG_BSY, RESET, Timeout) != HAL_OK) { hspi->ErrorCode |= HAL_SPI_ERROR_FLAG; return HAL_TIMEOUT; } return HAL_OK; } /** * @brief Handle the end of the RXTX transaction. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ static void SPI_CloseRxTx_ISR(SPI_HandleTypeDef *hspi) { /* Disable ERR interrupt */ __HAL_SPI_DISABLE_IT(hspi, SPI_IT_ERR); /* Check the end of the transaction */ if(SPI_EndRxTxTransaction(hspi,SPI_DEFAULT_TIMEOUT)!=HAL_OK) { hspi->ErrorCode|= HAL_SPI_ERROR_FLAG; } /* Check if CRC error occurred */ if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR) != RESET) { hspi->State = HAL_SPI_STATE_READY; hspi->ErrorCode|= HAL_SPI_ERROR_CRC; __HAL_SPI_CLEAR_CRCERRFLAG(hspi); HAL_SPI_ErrorCallback(hspi); } else { if(hspi->ErrorCode == HAL_SPI_ERROR_NONE) { if(hspi->State == HAL_SPI_STATE_BUSY_RX) { hspi->State = HAL_SPI_STATE_READY; HAL_SPI_RxCpltCallback(hspi); } else { hspi->State = HAL_SPI_STATE_READY; HAL_SPI_TxRxCpltCallback(hspi); } } else { hspi->State = HAL_SPI_STATE_READY; HAL_SPI_ErrorCallback(hspi); } } } /** * @brief Handle the end of the RX transaction. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ static void SPI_CloseRx_ISR(SPI_HandleTypeDef *hspi) { /* Disable RXNE and ERR interrupt */ __HAL_SPI_DISABLE_IT(hspi, (SPI_IT_RXNE | SPI_IT_ERR)); /* Check the end of the transaction */ if(SPI_EndRxTransaction(hspi,SPI_DEFAULT_TIMEOUT)!=HAL_OK) { hspi->ErrorCode|= HAL_SPI_ERROR_FLAG; } hspi->State = HAL_SPI_STATE_READY; /* Check if CRC error occurred */ if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR) != RESET) { hspi->ErrorCode|= HAL_SPI_ERROR_CRC; __HAL_SPI_CLEAR_CRCERRFLAG(hspi); HAL_SPI_ErrorCallback(hspi); } else { if(hspi->ErrorCode == HAL_SPI_ERROR_NONE) { HAL_SPI_RxCpltCallback(hspi); } else { HAL_SPI_ErrorCallback(hspi); } } } /** * @brief Handle the end of the TX transaction. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval None */ static void SPI_CloseTx_ISR(SPI_HandleTypeDef *hspi) { /* Disable TXE and ERR interrupt */ __HAL_SPI_DISABLE_IT(hspi, (SPI_IT_TXE | SPI_IT_ERR)); /* Check the end of the transaction */ if(SPI_EndRxTxTransaction(hspi,SPI_DEFAULT_TIMEOUT)!=HAL_OK) { hspi->ErrorCode|= HAL_SPI_ERROR_FLAG; } /* Clear overrun flag in 2 Lines communication mode because received is not read */ if(hspi->Init.Direction == SPI_DIRECTION_2LINES) { __HAL_SPI_CLEAR_OVRFLAG(hspi); } hspi->State = HAL_SPI_STATE_READY; if(hspi->ErrorCode != HAL_SPI_ERROR_NONE) { HAL_SPI_ErrorCallback(hspi); } else { HAL_SPI_TxCpltCallback(hspi); } } /** * @} */ #endif /* HAL_SPI_MODULE_ENABLED */ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
RonEld/mbed
targets/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_hal_spi.c
C
apache-2.0
83,407
/* Copyright 2012 Selenium committers Copyright 2012 Software Freedom Conservancy Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.openqa.selenium.server.htmlrunner; import static org.junit.Assert.assertEquals; import org.junit.Test; public class HTMLSuiteResultUnitTest { @Test public void testBasic() { String input = "\r\n" + "\r\n" + "<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\">\r\n" + " <tbody>\r\n" + " <tr class=\"title status_passed\"><td><b>Test Suite</b></td></tr>\r\n" + " <tr class=\"status_passed\"><td><a href=\"./TestQuickOpen.html\">TestQuickOpen</a></td></tr>\r\n" + " <tr class=\"status_passed\"><td><a href=\"./TestQuickOpen.html\">TestQuickOpen</a></td></tr>\r\n" + " <tr class=\"status_passed\"><td><a href=\"./TestQuickOpen.html\">TestQuickOpen</a></td></tr>\r\n" + " <tr class=\"status_passed\"><td><a href=\"./TestQuickOpen.html\">TestQuickOpen</a></td></tr>\r\n" + " </tbody>\r\n" + " </table>\r\n" + "\r\n" + ""; HTMLSuiteResult hsr = new HTMLSuiteResult(input); // System.out.println(hsr.getUpdatedSuite()); String expected = "\r\n" + "\r\n" + "<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\">\r\n" + " <tbody>\r\n" + " <tr class=\"title status_passed\"><td><b>Test Suite</b></td></tr>\r\n" + " <tr class=\"status_passed\"><td><a href=\"#testresult0\">TestQuickOpen</a></td></tr>\r\n" + " <tr class=\"status_passed\"><td><a href=\"#testresult1\">TestQuickOpen</a></td></tr>\r\n" + " <tr class=\"status_passed\"><td><a href=\"#testresult2\">TestQuickOpen</a></td></tr>\r\n" + " <tr class=\"status_passed\"><td><a href=\"#testresult3\">TestQuickOpen</a></td></tr>\r\n" + " </tbody>\r\n" + " </table>\r\n" + "\r\n" + ""; assertEquals(expected, hsr.getUpdatedSuite()); } }
pilwon/selenium-webdriver
java/server/test/org/openqa/selenium/server/htmlrunner/HTMLSuiteResultUnitTest.java
Java
apache-2.0
2,633
// Copyright ©2014 The gonum Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package path import ( "math" "reflect" "testing" "github.com/gonum/graph" "github.com/gonum/graph/path/internal" "github.com/gonum/graph/path/internal/testgraphs" "github.com/gonum/graph/simple" "github.com/gonum/graph/topo" ) var aStarTests = []struct { name string g graph.Graph s, t int heuristic Heuristic wantPath []int }{ { name: "simple path", g: func() graph.Graph { return internal.NewGridFrom( "*..*", "**.*", "**.*", "**.*", ) }(), s: 1, t: 14, wantPath: []int{1, 2, 6, 10, 14}, }, { name: "small open graph", g: internal.NewGrid(3, 3, true), s: 0, t: 8, }, { name: "large open graph", g: internal.NewGrid(1000, 1000, true), s: 0, t: 999*1000 + 999, }, { name: "no path", g: func() graph.Graph { tg := internal.NewGrid(5, 5, true) // Create a complete "wall" across the middle row. tg.Set(2, 0, false) tg.Set(2, 1, false) tg.Set(2, 2, false) tg.Set(2, 3, false) tg.Set(2, 4, false) return tg }(), s: 2, t: 22, }, { name: "partially obstructed", g: func() graph.Graph { tg := internal.NewGrid(10, 10, true) // Create a partial "wall" accross the middle // row with a gap at the left-hand end. tg.Set(4, 1, false) tg.Set(4, 2, false) tg.Set(4, 3, false) tg.Set(4, 4, false) tg.Set(4, 5, false) tg.Set(4, 6, false) tg.Set(4, 7, false) tg.Set(4, 8, false) tg.Set(4, 9, false) return tg }(), s: 5, t: 9*10 + 9, }, { name: "partially obstructed with heuristic", g: func() graph.Graph { tg := internal.NewGrid(10, 10, true) // Create a partial "wall" accross the middle // row with a gap at the left-hand end. tg.Set(4, 1, false) tg.Set(4, 2, false) tg.Set(4, 3, false) tg.Set(4, 4, false) tg.Set(4, 5, false) tg.Set(4, 6, false) tg.Set(4, 7, false) tg.Set(4, 8, false) tg.Set(4, 9, false) return tg }(), s: 5, t: 9*10 + 9, // Manhattan Heuristic heuristic: func(u, v graph.Node) float64 { uid := u.ID() cu := (uid % 10) ru := (uid - cu) / 10 vid := v.ID() cv := (vid % 10) rv := (vid - cv) / 10 return math.Abs(float64(ru-rv)) + math.Abs(float64(cu-cv)) }, }, } func TestAStar(t *testing.T) { for _, test := range aStarTests { pt, _ := AStar(simple.Node(test.s), simple.Node(test.t), test.g, test.heuristic) p, cost := pt.To(simple.Node(test.t)) if !topo.IsPathIn(test.g, p) { t.Error("got path that is not path in input graph for %q", test.name) } bfp, ok := BellmanFordFrom(simple.Node(test.s), test.g) if !ok { t.Fatalf("unexpected negative cycle in %q", test.name) } if want := bfp.WeightTo(simple.Node(test.t)); cost != want { t.Errorf("unexpected cost for %q: got:%v want:%v", test.name, cost, want) } var got = make([]int, 0, len(p)) for _, n := range p { got = append(got, n.ID()) } if test.wantPath != nil && !reflect.DeepEqual(got, test.wantPath) { t.Errorf("unexpected result for %q:\ngot: %v\nwant:%v", test.name, got, test.wantPath) } } } func TestExhaustiveAStar(t *testing.T) { g := simple.NewUndirectedGraph(0, math.Inf(1)) nodes := []locatedNode{ {id: 1, x: 0, y: 6}, {id: 2, x: 1, y: 0}, {id: 3, x: 8, y: 7}, {id: 4, x: 16, y: 0}, {id: 5, x: 17, y: 6}, {id: 6, x: 9, y: 8}, } for _, n := range nodes { g.AddNode(n) } edges := []weightedEdge{ {from: g.Node(1), to: g.Node(2), cost: 7}, {from: g.Node(1), to: g.Node(3), cost: 9}, {from: g.Node(1), to: g.Node(6), cost: 14}, {from: g.Node(2), to: g.Node(3), cost: 10}, {from: g.Node(2), to: g.Node(4), cost: 15}, {from: g.Node(3), to: g.Node(4), cost: 11}, {from: g.Node(3), to: g.Node(6), cost: 2}, {from: g.Node(4), to: g.Node(5), cost: 7}, {from: g.Node(5), to: g.Node(6), cost: 9}, } for _, e := range edges { g.SetEdge(e) } heuristic := func(u, v graph.Node) float64 { lu := u.(locatedNode) lv := v.(locatedNode) return math.Hypot(lu.x-lv.x, lu.y-lv.y) } if ok, edge, goal := isMonotonic(g, heuristic); !ok { t.Fatalf("non-monotonic heuristic at edge:%v for goal:%v", edge, goal) } ps := DijkstraAllPaths(g) for _, start := range g.Nodes() { for _, goal := range g.Nodes() { pt, _ := AStar(start, goal, g, heuristic) gotPath, gotWeight := pt.To(goal) wantPath, wantWeight, _ := ps.Between(start, goal) if gotWeight != wantWeight { t.Errorf("unexpected path weight from %v to %v result: got:%s want:%s", start, goal, gotWeight, wantWeight) } if !reflect.DeepEqual(gotPath, wantPath) { t.Errorf("unexpected path from %v to %v result:\ngot: %v\nwant:%v", start, goal, gotPath, wantPath) } } } } type locatedNode struct { id int x, y float64 } func (n locatedNode) ID() int { return n.id } type weightedEdge struct { from, to graph.Node cost float64 } func (e weightedEdge) From() graph.Node { return e.from } func (e weightedEdge) To() graph.Node { return e.to } func (e weightedEdge) Weight() float64 { return e.cost } func isMonotonic(g UndirectedWeightLister, h Heuristic) (ok bool, at graph.Edge, goal graph.Node) { for _, goal := range g.Nodes() { for _, edge := range g.Edges() { from := edge.From() to := edge.To() w, ok := g.Weight(from, to) if !ok { panic("A*: unexpected invalid weight") } if h(from, goal) > w+h(to, goal) { return false, edge, goal } } } return true, nil, nil } func TestAStarNullHeuristic(t *testing.T) { for _, test := range testgraphs.ShortestPathTests { g := test.Graph() for _, e := range test.Edges { g.SetEdge(e) } var ( pt Shortest panicked bool ) func() { defer func() { panicked = recover() != nil }() pt, _ = AStar(test.Query.From(), test.Query.To(), g.(graph.Graph), nil) }() if panicked || test.HasNegativeWeight { if !test.HasNegativeWeight { t.Errorf("%q: unexpected panic", test.Name) } if !panicked { t.Errorf("%q: expected panic for negative edge weight", test.Name) } continue } if pt.From().ID() != test.Query.From().ID() { t.Fatalf("%q: unexpected from node ID: got:%d want:%d", pt.From().ID(), test.Query.From().ID()) } p, weight := pt.To(test.Query.To()) if weight != test.Weight { t.Errorf("%q: unexpected weight from Between: got:%f want:%f", test.Name, weight, test.Weight) } if weight := pt.WeightTo(test.Query.To()); weight != test.Weight { t.Errorf("%q: unexpected weight from Weight: got:%f want:%f", test.Name, weight, test.Weight) } var got []int for _, n := range p { got = append(got, n.ID()) } ok := len(got) == 0 && len(test.WantPaths) == 0 for _, sp := range test.WantPaths { if reflect.DeepEqual(got, sp) { ok = true break } } if !ok { t.Errorf("%q: unexpected shortest path:\ngot: %v\nwant from:%v", test.Name, p, test.WantPaths) } np, weight := pt.To(test.NoPathFor.To()) if pt.From().ID() == test.NoPathFor.From().ID() && (np != nil || !math.IsInf(weight, 1)) { t.Errorf("%q: unexpected path:\ngot: path=%v weight=%f\nwant:path=<nil> weight=+Inf", test.Name, np, weight) } } }
ramr/origin
vendor/github.com/gonum/graph/path/a_star_test.go
GO
apache-2.0
7,304
#!/bin/sh # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ----------------------------------------------------------------------------- # Set CLASSPATH and Java options # ----------------------------------------------------------------------------- # Make sure prerequisite environment variables are set if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then if $darwin; then # Bugzilla 54390 if [ -x '/usr/libexec/java_home' ] ; then export JAVA_HOME=`/usr/libexec/java_home` # Bugzilla 37284 (reviewed). elif [ -d "/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home" ]; then export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home" fi else JAVA_PATH=`which java 2>/dev/null` if [ "x$JAVA_PATH" != "x" ]; then JAVA_PATH=`dirname $JAVA_PATH 2>/dev/null` JRE_HOME=`dirname $JAVA_PATH 2>/dev/null` fi if [ "x$JRE_HOME" = "x" ]; then # XXX: Should we try other locations? if [ -x /usr/bin/java ]; then JRE_HOME=/usr fi fi fi if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined" echo "At least one of these environment variable is needed to run this program" exit 1 fi fi if [ -z "$JAVA_HOME" -a "$1" = "debug" ]; then echo "JAVA_HOME should point to a JDK in order to run in debug mode." exit 1 fi if [ -z "$JRE_HOME" ]; then JRE_HOME="$JAVA_HOME" fi # If we're running under jdb, we need a full jdk. if [ "$1" = "debug" ] ; then if [ "$os400" = "true" ]; then if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/javac ]; then echo "The JAVA_HOME environment variable is not defined correctly" echo "This environment variable is needed to run this program" echo "NB: JAVA_HOME should point to a JDK not a JRE" exit 1 fi else if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/jdb -o ! -x "$JAVA_HOME"/bin/javac ]; then echo "The JAVA_HOME environment variable is not defined correctly" echo "This environment variable is needed to run this program" echo "NB: JAVA_HOME should point to a JDK not a JRE" exit 1 fi fi fi if [ -z "$BASEDIR" ]; then echo "The BASEDIR environment variable is not defined" echo "This environment variable is needed to run this program" exit 1 fi if [ ! -x "$BASEDIR"/bin/setclasspath.sh ]; then if $os400; then # -x will Only work on the os400 if the files are: # 1. owned by the user # 2. owned by the PRIMARY group of the user # this will not work if the user belongs in secondary groups eval else echo "The BASEDIR environment variable is not defined correctly" echo "This environment variable is needed to run this program" exit 1 fi fi # Don't override the endorsed dir if the user has set it previously if [ -z "$JAVA_ENDORSED_DIRS" ]; then # Set the default -Djava.endorsed.dirs argument JAVA_ENDORSED_DIRS="$BASEDIR"/endorsed fi # OSX hack to CLASSPATH JIKESPATH= if [ `uname -s` = "Darwin" ]; then OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes" if [ -d "$OSXHACK" ]; then for i in "$OSXHACK"/*.jar; do JIKESPATH="$JIKESPATH":"$i" done fi fi # Set standard commands for invoking Java. _RUNJAVA="$JRE_HOME"/bin/java if [ "$os400" != "true" ]; then _RUNJDB="$JAVA_HOME"/bin/jdb fi
lots-of-things/hadoop-compiled
share/hadoop/httpfs/tomcat/bin/setclasspath.sh
Shell
apache-2.0
4,171
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package java.security; import java.nio.ByteBuffer; import java.util.HashMap; /** * {@code SecureClassLoader} represents a {@code ClassLoader} which associates * the classes it loads with a code source and provide mechanisms to allow the * relevant permissions to be retrieved. */ public class SecureClassLoader extends ClassLoader { // A cache of ProtectionDomains for a given CodeSource private HashMap<CodeSource, ProtectionDomain> pds = new HashMap<CodeSource, ProtectionDomain>(); /** * Constructs a new instance of {@code SecureClassLoader}. The default * parent {@code ClassLoader} is used. */ protected SecureClassLoader() { } /** * Constructs a new instance of {@code SecureClassLoader} with the specified * parent {@code ClassLoader}. * * @param parent * the parent {@code ClassLoader}. */ protected SecureClassLoader(ClassLoader parent) { super(parent); } /** * Returns the {@code PermissionCollection} for the specified {@code * CodeSource}. * * @param codesource * the code source. * @return the {@code PermissionCollection} for the specified {@code * CodeSource}. */ protected PermissionCollection getPermissions(CodeSource codesource) { // Do nothing by default, ProtectionDomain will take care about // permissions in dynamic return new Permissions(); } /** * Constructs a new class from an array of bytes containing a class * definition in class file format with an optional {@code CodeSource}. * * @param name * the name of the new class. * @param b * a memory image of a class file. * @param off * the start offset in b of the class data. * @param len * the length of the class data. * @param cs * the {@code CodeSource}, or {@code null}. * @return a new class. * @throws IndexOutOfBoundsException * if {@code off} or {@code len} are not valid in respect to * {@code b}. * @throws ClassFormatError * if the specified data is not valid class data. * @throws SecurityException * if the package to which this class is to be added, already * contains classes which were signed by different certificates, * or if the class name begins with "java." */ protected final Class<?> defineClass(String name, byte[] b, int off, int len, CodeSource cs) { return null; // Class loading not supported on iOS. } /** * Constructs a new class from an array of bytes containing a class * definition in class file format with an optional {@code CodeSource}. * * @param name * the name of the new class. * @param b * a memory image of a class file. * @param cs * the {@code CodeSource}, or {@code null}. * @return a new class. * @throws ClassFormatError * if the specified data is not valid class data. * @throws SecurityException * if the package to which this class is to be added, already * contains classes which were signed by different certificates, * or if the class name begins with "java." */ protected final Class<?> defineClass(String name, ByteBuffer b, CodeSource cs) { return null; // Class loading not supported on iOS. } // Constructs and caches ProtectionDomain for the given CodeSource // object.<br> // It calls {@link getPermissions()} to get a set of permissions. // // @param cs CodeSource object // @return ProtectionDomain for the passed CodeSource object private ProtectionDomain getPD(CodeSource cs) { if (cs == null) { return null; } // need to cache PDs, otherwise every class from a given CodeSource // will have it's own ProtectionDomain, which does not look right. ProtectionDomain pd; synchronized (pds) { if ((pd = pds.get(cs)) != null) { return pd; } PermissionCollection perms = getPermissions(cs); pd = new ProtectionDomain(cs, perms, this, null); pds.put(cs, pd); } return pd; } }
shabbirh/j2objc
jre_emul/android/libcore/luni/src/main/java/java/security/SecureClassLoader.java
Java
apache-2.0
5,281
/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package policy import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" ) // PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. type PodDisruptionBudgetSpec struct { // An eviction is allowed if at least "minAvailable" pods selected by // "selector" will still be available after the eviction, i.e. even in the // absence of the evicted pod. So for example you can prevent all voluntary // evictions by specifying "100%". // +optional MinAvailable *intstr.IntOrString // Label query over pods whose evictions are managed by the disruption // budget. // +optional Selector *metav1.LabelSelector // An eviction is allowed if at most "maxUnavailable" pods selected by // "selector" are unavailable after the eviction, i.e. even in absence of // the evicted pod. For example, one can prevent all voluntary evictions // by specifying 0. This is a mutually exclusive setting with "minAvailable". // +optional MaxUnavailable *intstr.IntOrString } // PodDisruptionBudgetStatus represents information about the status of a // PodDisruptionBudget. Status may trail the actual state of a system. type PodDisruptionBudgetStatus struct { // Most recent generation observed when updating this PDB status. PodDisruptionsAllowed and other // status informatio is valid only if observedGeneration equals to PDB's object generation. // +optional ObservedGeneration int64 // DisruptedPods contains information about pods whose eviction was // processed by the API server eviction subresource handler but has not // yet been observed by the PodDisruptionBudget controller. // A pod will be in this map from the time when the API server processed the // eviction request to the time when the pod is seen by PDB controller // as having been marked for deletion (or after a timeout). The key in the map is the name of the pod // and the value is the time when the API server processed the eviction request. If // the deletion didn't occur and a pod is still there it will be removed from // the list automatically by PodDisruptionBudget controller after some time. // If everything goes smooth this map should be empty for the most of the time. // Large number of entries in the map may indicate problems with pod deletions. DisruptedPods map[string]metav1.Time // Number of pod disruptions that are currently allowed. PodDisruptionsAllowed int32 // current number of healthy pods CurrentHealthy int32 // minimum desired number of healthy pods DesiredHealthy int32 // total number of pods counted by this disruption budget ExpectedPods int32 } // +genclient // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods type PodDisruptionBudget struct { metav1.TypeMeta // +optional metav1.ObjectMeta // Specification of the desired behavior of the PodDisruptionBudget. // +optional Spec PodDisruptionBudgetSpec // Most recently observed status of the PodDisruptionBudget. // +optional Status PodDisruptionBudgetStatus } // PodDisruptionBudgetList is a collection of PodDisruptionBudgets. type PodDisruptionBudgetList struct { metav1.TypeMeta // +optional metav1.ListMeta Items []PodDisruptionBudget } // +genclient // +genclient:noVerbs // Eviction evicts a pod from its node subject to certain policies and safety constraints. // This is a subresource of Pod. A request to cause such an eviction is // created by POSTing to .../pods/<pod name>/eviction. type Eviction struct { metav1.TypeMeta // ObjectMeta describes the pod that is being evicted. // +optional metav1.ObjectMeta // DeleteOptions may be provided // +optional DeleteOptions *metav1.DeleteOptions }
rrati/origin
vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/pkg/apis/policy/types.go
GO
apache-2.0
4,293
/* * Copyright 2007 Sascha Weinreuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.intellij.plugins.relaxNG.compact.psi.impl; import com.intellij.lang.ASTNode; import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor; import org.intellij.plugins.relaxNG.compact.psi.RncExternalRef; import org.jetbrains.annotations.NotNull; public class RncExternalRefImpl extends RncFileReferenceImpl implements RncExternalRef { public RncExternalRefImpl(ASTNode node) { super(node); } @Override public void accept(@NotNull RncElementVisitor visitor) { visitor.visitExternalRef(this); } }
goodwinnk/intellij-community
xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncExternalRefImpl.java
Java
apache-2.0
1,133
#!/usr/bin/env python # # git-p4.py -- A tool for bidirectional operation between a Perforce depot and git. # # Author: Simon Hausmann <simon@lst.de> # Copyright: 2007 Simon Hausmann <simon@lst.de> # 2007 Trolltech ASA # License: MIT <http://www.opensource.org/licenses/mit-license.php> # from __future__ import print_function from __future__ import absolute_import from __future__ import division import sys import six from six.moves import input from six.moves import range from six.moves import zip if sys.hexversion < 0x02040000: # The limiter is the subprocess module sys.stderr.write("git-p4: requires Python 2.4 or later.\n") sys.exit(1) import os import optparse import marshal import subprocess import tempfile import time import platform import re import shutil import stat try: from subprocess import CalledProcessError except ImportError: # from python:subprocess.py # Exception classes used by this module. class CalledProcessError(Exception): """This exception is raised when a process run by check_call() returns a non-zero exit status. The exit status will be stored in the returncode attribute.""" def __init__(self, returncode, cmd): self.returncode = returncode self.cmd = cmd def __str__(self): return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode) verbose = False # Only labels/tags matching this will be imported/exported defaultLabelRegexp = r'[a-zA-Z0-9_\-.]+$' def p4_build_cmd(cmd): """Build a suitable p4 command line. This consolidates building and returning a p4 command line into one location. It means that hooking into the environment, or other configuration can be done more easily. """ real_cmd = ["p4"] if isinstance(cmd, six.string_types): real_cmd = ' '.join(real_cmd) + ' ' + cmd else: real_cmd += cmd return real_cmd def chdir(path, is_client_path=False): """Do chdir to the given path, and set the PWD environment variable for use by P4. It does not look at getcwd() output. Since we're not using the shell, it is necessary to set the PWD environment variable explicitly. Normally, expand the path to force it to be absolute. This addresses the use of relative path names inside P4 settings, e.g. P4CONFIG=.p4config. P4 does not simply open the filename as given; it looks for .p4config using PWD. If is_client_path, the path was handed to us directly by p4, and may be a symbolic link. Do not call os.getcwd() in this case, because it will cause p4 to think that PWD is not inside the client path. """ os.chdir(path) if not is_client_path: path = os.getcwd() os.environ['PWD'] = path def die(msg): if verbose: raise Exception(msg) else: sys.stderr.write(msg + "\n") sys.exit(1) def write_pipe(c, stdin): if verbose: sys.stderr.write('Writing pipe: %s\n' % str(c)) expand = isinstance(c, six.string_types) p = subprocess.Popen(c, stdin=subprocess.PIPE, shell=expand) pipe = p.stdin val = pipe.write(stdin) pipe.close() if p.wait(): die('Command failed: %s' % str(c)) return val def p4_write_pipe(c, stdin): real_cmd = p4_build_cmd(c) return write_pipe(real_cmd, stdin) def read_pipe(c, ignore_error=False): if verbose: sys.stderr.write('Reading pipe: %s\n' % str(c)) expand = isinstance(c, six.string_types) p = subprocess.Popen(c, stdout=subprocess.PIPE, shell=expand) pipe = p.stdout val = pipe.read() if p.wait() and not ignore_error: die('Command failed: %s' % str(c)) return val def p4_read_pipe(c, ignore_error=False): real_cmd = p4_build_cmd(c) return read_pipe(real_cmd, ignore_error) def read_pipe_lines(c): if verbose: sys.stderr.write('Reading pipe: %s\n' % str(c)) expand = isinstance(c, six.string_types) p = subprocess.Popen(c, stdout=subprocess.PIPE, shell=expand) pipe = p.stdout val = pipe.readlines() if pipe.close() or p.wait(): die('Command failed: %s' % str(c)) return val def p4_read_pipe_lines(c): """Specifically invoke p4 on the command supplied. """ real_cmd = p4_build_cmd(c) return read_pipe_lines(real_cmd) def p4_has_command(cmd): """Ask p4 for help on this command. If it returns an error, the command does not exist in this version of p4.""" real_cmd = p4_build_cmd(["help", cmd]) p = subprocess.Popen(real_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) p.communicate() return p.returncode == 0 def p4_has_move_command(): """See if the move command exists, that it supports -k, and that it has not been administratively disabled. The arguments must be correct, but the filenames do not have to exist. Use ones with wildcards so even if they exist, it will fail.""" if not p4_has_command("move"): return False cmd = p4_build_cmd(["move", "-k", "@from", "@to"]) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (out, err) = p.communicate() # return code will be 1 in either case if err.find("Invalid option") >= 0: return False if err.find("disabled") >= 0: return False # assume it failed because @... was invalid changelist return True def system(cmd): expand = isinstance(cmd, six.string_types) if verbose: sys.stderr.write("executing %s\n" % str(cmd)) retcode = subprocess.call(cmd, shell=expand) if retcode: raise CalledProcessError(retcode, cmd) def p4_system(cmd): """Specifically invoke p4 as the system command. """ real_cmd = p4_build_cmd(cmd) expand = isinstance(real_cmd, six.string_types) retcode = subprocess.call(real_cmd, shell=expand) if retcode: raise CalledProcessError(retcode, real_cmd) _p4_version_string = None def p4_version_string(): """Read the version string, showing just the last line, which hopefully is the interesting version bit. $ p4 -V Perforce - The Fast Software Configuration Management System. Copyright 1995-2011 Perforce Software. All rights reserved. Rev. P4/NTX86/2011.1/393975 (2011/12/16). """ global _p4_version_string if not _p4_version_string: a = p4_read_pipe_lines(["-V"]) _p4_version_string = a[-1].rstrip() return _p4_version_string def p4_integrate(src, dest): p4_system(["integrate", "-Dt", wildcard_encode(src), wildcard_encode(dest)]) def p4_sync(f, *options): p4_system(["sync"] + list(options) + [wildcard_encode(f)]) def p4_add(f): # forcibly add file names with wildcards if wildcard_present(f): p4_system(["add", "-f", f]) else: p4_system(["add", f]) def p4_delete(f): p4_system(["delete", wildcard_encode(f)]) def p4_edit(f): p4_system(["edit", wildcard_encode(f)]) def p4_revert(f): p4_system(["revert", wildcard_encode(f)]) def p4_reopen(type, f): p4_system(["reopen", "-t", type, wildcard_encode(f)]) def p4_move(src, dest): p4_system(["move", "-k", wildcard_encode(src), wildcard_encode(dest)]) def p4_describe(change): """Make sure it returns a valid result by checking for the presence of field "time". Return a dict of the results.""" ds = p4CmdList(["describe", "-s", str(change)]) if len(ds) != 1: die("p4 describe -s %d did not return 1 result: %s" % (change, str(ds))) d = ds[0] if "p4ExitCode" in d: die("p4 describe -s %d exited with %d: %s" % (change, d["p4ExitCode"], str(d))) if "code" in d: if d["code"] == "error": die("p4 describe -s %d returned error code: %s" % (change, str(d))) if "time" not in d: die("p4 describe -s %d returned no \"time\": %s" % (change, str(d))) return d # # Canonicalize the p4 type and return a tuple of the # base type, plus any modifiers. See "p4 help filetypes" # for a list and explanation. # def split_p4_type(p4type): p4_filetypes_historical = { "ctempobj": "binary+Sw", "ctext": "text+C", "cxtext": "text+Cx", "ktext": "text+k", "kxtext": "text+kx", "ltext": "text+F", "tempobj": "binary+FSw", "ubinary": "binary+F", "uresource": "resource+F", "uxbinary": "binary+Fx", "xbinary": "binary+x", "xltext": "text+Fx", "xtempobj": "binary+Swx", "xtext": "text+x", "xunicode": "unicode+x", "xutf16": "utf16+x", } if p4type in p4_filetypes_historical: p4type = p4_filetypes_historical[p4type] mods = "" s = p4type.split("+") base = s[0] mods = "" if len(s) > 1: mods = s[1] return (base, mods) # # return the raw p4 type of a file (text, text+ko, etc) # def p4_type(file): results = p4CmdList(["fstat", "-T", "headType", file]) return results[0]['headType'] # # Given a type base and modifier, return a regexp matching # the keywords that can be expanded in the file # def p4_keywords_regexp_for_type(base, type_mods): if base in ("text", "unicode", "binary"): kwords = None if "ko" in type_mods: kwords = 'Id|Header' elif "k" in type_mods: kwords = 'Id|Header|Author|Date|DateTime|Change|File|Revision' else: return None pattern = r""" \$ # Starts with a dollar, followed by... (%s) # one of the keywords, followed by... (:[^$\n]+)? # possibly an old expansion, followed by... \$ # another dollar """ % kwords return pattern else: return None # # Given a file, return a regexp matching the possible # RCS keywords that will be expanded, or None for files # with kw expansion turned off. # def p4_keywords_regexp_for_file(file): if not os.path.exists(file): return None else: (type_base, type_mods) = split_p4_type(p4_type(file)) return p4_keywords_regexp_for_type(type_base, type_mods) def setP4ExecBit(file, mode): # Reopens an already open file and changes the execute bit to match # the execute bit setting in the passed in mode. p4Type = "+x" if not isModeExec(mode): p4Type = getP4OpenedType(file) p4Type = re.sub('^([cku]?)x(.*)', '\\1\\2', p4Type) p4Type = re.sub('(.*?\+.*?)x(.*?)', '\\1\\2', p4Type) if p4Type[-1] == "+": p4Type = p4Type[0:-1] p4_reopen(p4Type, file) def getP4OpenedType(file): # Returns the perforce file type for the given file. result = p4_read_pipe(["opened", wildcard_encode(file)]) match = re.match(".*\((.+)\)\r?$", result) if match: return match.group(1) else: die("Could not determine file type for %s (result: '%s')" % (file, result)) # Return the set of all p4 labels def getP4Labels(depotPaths): labels = set() if isinstance(depotPaths, six.string_types): depotPaths = [depotPaths] for l in p4CmdList(["labels"] + ["%s..." % p for p in depotPaths]): label = l['label'] labels.add(label) return labels # Return the set of all git tags def getGitTags(): gitTags = set() for line in read_pipe_lines(["git", "tag"]): tag = line.strip() gitTags.add(tag) return gitTags def diffTreePattern(): # This is a simple generator for the diff tree regex pattern. This could be # a class variable if this and parseDiffTreeEntry were a part of a class. pattern = re.compile(':(\d+) (\d+) (\w+) (\w+) ([A-Z])(\d+)?\t(.*?)((\t(.*))|$)') while True: yield pattern def parseDiffTreeEntry(entry): """Parses a single diff tree entry into its component elements. See git-diff-tree(1) manpage for details about the format of the diff output. This method returns a dictionary with the following elements: src_mode - The mode of the source file dst_mode - The mode of the destination file src_sha1 - The sha1 for the source file dst_sha1 - The sha1 fr the destination file status - The one letter status of the diff (i.e. 'A', 'M', 'D', etc) status_score - The score for the status (applicable for 'C' and 'R' statuses). This is None if there is no score. src - The path for the source file. dst - The path for the destination file. This is only present for copy or renames. If it is not present, this is None. If the pattern is not matched, None is returned.""" match = diffTreePattern().next().match(entry) if match: return { 'src_mode': match.group(1), 'dst_mode': match.group(2), 'src_sha1': match.group(3), 'dst_sha1': match.group(4), 'status': match.group(5), 'status_score': match.group(6), 'src': match.group(7), 'dst': match.group(10) } return None def isModeExec(mode): # Returns True if the given git mode represents an executable file, # otherwise False. return mode[-3:] == "755" def isModeExecChanged(src_mode, dst_mode): return isModeExec(src_mode) != isModeExec(dst_mode) def p4CmdList(cmd, stdin=None, stdin_mode='w+b', cb=None): if isinstance(cmd, six.string_types): cmd = "-G " + cmd expand = True else: cmd = ["-G"] + cmd expand = False cmd = p4_build_cmd(cmd) if verbose: sys.stderr.write("Opening pipe: %s\n" % str(cmd)) # Use a temporary file to avoid deadlocks without # subprocess.communicate(), which would put another copy # of stdout into memory. stdin_file = None if stdin is not None: stdin_file = tempfile.TemporaryFile(prefix='p4-stdin', mode=stdin_mode) if isinstance(stdin, six.string_types): stdin_file.write(stdin) else: for i in stdin: stdin_file.write(i + '\n') stdin_file.flush() stdin_file.seek(0) p4 = subprocess.Popen(cmd, shell=expand, stdin=stdin_file, stdout=subprocess.PIPE) result = [] try: while True: entry = marshal.load(p4.stdout) if cb is not None: cb(entry) else: result.append(entry) except EOFError: pass exitCode = p4.wait() if exitCode != 0: entry = {} entry["p4ExitCode"] = exitCode result.append(entry) return result def p4Cmd(cmd): list = p4CmdList(cmd) result = {} for entry in list: result.update(entry) return result; def p4Where(depotPath): if not depotPath.endswith("/"): depotPath += "/" depotPath = depotPath + "..." outputList = p4CmdList(["where", depotPath]) output = None for entry in outputList: if "depotFile" in entry: if entry["depotFile"] == depotPath: output = entry break elif "data" in entry: data = entry.get("data") space = data.find(" ") if data[:space] == depotPath: output = entry break if output == None: return "" if output["code"] == "error": return "" clientPath = "" if "path" in output: clientPath = output.get("path") elif "data" in output: data = output.get("data") lastSpace = data.rfind(" ") clientPath = data[lastSpace + 1:] if clientPath.endswith("..."): clientPath = clientPath[:-3] return clientPath def currentGitBranch(): return read_pipe("git name-rev HEAD").split(" ")[1].strip() def isValidGitDir(path): if (os.path.exists(path + "/HEAD") and os.path.exists(path + "/refs") and os.path.exists(path + "/objects")): return True; return False def parseRevision(ref): return read_pipe("git rev-parse %s" % ref).strip() def branchExists(ref): rev = read_pipe(["git", "rev-parse", "-q", "--verify", ref], ignore_error=True) return len(rev) > 0 def extractLogMessageFromGitCommit(commit): logMessage = "" ## fixme: title is first line of commit, not 1st paragraph. foundTitle = False for log in read_pipe_lines("git cat-file commit %s" % commit): if not foundTitle: if len(log) == 1: foundTitle = True continue logMessage += log return logMessage def extractSettingsGitLog(log): values = {} for line in log.split("\n"): line = line.strip() m = re.search (r"^ *\[git-p4: (.*)\]$", line) if not m: continue assignments = m.group(1).split (':') for a in assignments: vals = a.split ('=') key = vals[0].strip() val = ('='.join (vals[1:])).strip() if val.endswith ('\"') and val.startswith('"'): val = val[1:-1] values[key] = val paths = values.get("depot-paths") if not paths: paths = values.get("depot-path") if paths: values['depot-paths'] = paths.split(',') return values def gitBranchExists(branch): proc = subprocess.Popen(["git", "rev-parse", branch], stderr=subprocess.PIPE, stdout=subprocess.PIPE); return proc.wait() == 0; _gitConfig = {} def gitConfig(key): if key not in _gitConfig: cmd = [ "git", "config", key ] s = read_pipe(cmd, ignore_error=True) _gitConfig[key] = s.strip() return _gitConfig[key] def gitConfigBool(key): """Return a bool, using git config --bool. It is True only if the variable is set to true, and False if set to false or not present in the config.""" if key not in _gitConfig: cmd = [ "git", "config", "--bool", key ] s = read_pipe(cmd, ignore_error=True) v = s.strip() _gitConfig[key] = v == "true" return _gitConfig[key] def gitConfigList(key): if key not in _gitConfig: s = read_pipe(["git", "config", "--get-all", key], ignore_error=True) _gitConfig[key] = s.strip().split(os.linesep) return _gitConfig[key] def p4BranchesInGit(branchesAreInRemotes=True): """Find all the branches whose names start with "p4/", looking in remotes or heads as specified by the argument. Return a dictionary of { branch: revision } for each one found. The branch names are the short names, without any "p4/" prefix.""" branches = {} cmdline = "git rev-parse --symbolic " if branchesAreInRemotes: cmdline += "--remotes" else: cmdline += "--branches" for line in read_pipe_lines(cmdline): line = line.strip() # only import to p4/ if not line.startswith('p4/'): continue # special symbolic ref to p4/master if line == "p4/HEAD": continue # strip off p4/ prefix branch = line[len("p4/"):] branches[branch] = parseRevision(line) return branches def branch_exists(branch): """Make sure that the given ref name really exists.""" cmd = [ "git", "rev-parse", "--symbolic", "--verify", branch ] p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, _ = p.communicate() if p.returncode: return False # expect exactly one line of output: the branch name return out.rstrip() == branch def findUpstreamBranchPoint(head = "HEAD"): branches = p4BranchesInGit() # map from depot-path to branch name branchByDepotPath = {} for branch in branches.keys(): tip = branches[branch] log = extractLogMessageFromGitCommit(tip) settings = extractSettingsGitLog(log) if "depot-paths" in settings: paths = ",".join(settings["depot-paths"]) branchByDepotPath[paths] = "remotes/p4/" + branch settings = None parent = 0 while parent < 65535: commit = head + "~%s" % parent log = extractLogMessageFromGitCommit(commit) settings = extractSettingsGitLog(log) if "depot-paths" in settings: paths = ",".join(settings["depot-paths"]) if paths in branchByDepotPath: return [branchByDepotPath[paths], settings] parent = parent + 1 return ["", settings] def createOrUpdateBranchesFromOrigin(localRefPrefix = "refs/remotes/p4/", silent=True): if not silent: print ("Creating/updating branch(es) in %s based on origin branch(es)" % localRefPrefix) originPrefix = "origin/p4/" for line in read_pipe_lines("git rev-parse --symbolic --remotes"): line = line.strip() if (not line.startswith(originPrefix)) or line.endswith("HEAD"): continue headName = line[len(originPrefix):] remoteHead = localRefPrefix + headName originHead = line original = extractSettingsGitLog(extractLogMessageFromGitCommit(originHead)) if ('depot-paths' not in original or 'change' not in original): continue update = False if not gitBranchExists(remoteHead): if verbose: print("creating %s" % remoteHead) update = True else: settings = extractSettingsGitLog(extractLogMessageFromGitCommit(remoteHead)) if ('change' in settings) > 0: if settings['depot-paths'] == original['depot-paths']: originP4Change = int(original['change']) p4Change = int(settings['change']) if originP4Change > p4Change: print ("%s (%s) is newer than %s (%s). " "Updating p4 branch from origin." % (originHead, originP4Change, remoteHead, p4Change)) update = True else: print ("Ignoring: %s was imported from %s while " "%s was imported from %s" % (originHead, ','.join(original['depot-paths']), remoteHead, ','.join(settings['depot-paths']))) if update: system("git update-ref %s %s" % (remoteHead, originHead)) def originP4BranchesExist(): return gitBranchExists("origin") or gitBranchExists("origin/p4") or gitBranchExists("origin/p4/master") def p4ChangesForPaths(depotPaths, changeRange): assert depotPaths cmd = ['changes'] for p in depotPaths: cmd += ["%s...%s" % (p, changeRange)] output = p4_read_pipe_lines(cmd) changes = {} for line in output: changeNum = int(line.split(" ")[1]) changes[changeNum] = True changelist = sorted(changes.keys()) return changelist def p4PathStartsWith(path, prefix): # This method tries to remedy a potential mixed-case issue: # # If UserA adds //depot/DirA/file1 # and UserB adds //depot/dira/file2 # # we may or may not have a problem. If you have core.ignorecase=true, # we treat DirA and dira as the same directory if gitConfigBool("core.ignorecase"): return path.lower().startswith(prefix.lower()) return path.startswith(prefix) def getClientSpec(): """Look at the p4 client spec, create a View() object that contains all the mappings, and return it.""" specList = p4CmdList("client -o") if len(specList) != 1: die('Output from "client -o" is %d lines, expecting 1' % len(specList)) # dictionary of all client parameters entry = specList[0] # the //client/ name client_name = entry["Client"] # just the keys that start with "View" view_keys = [ k for k in entry.keys() if k.startswith("View") ] # hold this new View view = View(client_name) # append the lines, in order, to the view for view_num in range(len(view_keys)): k = "View%d" % view_num if k not in view_keys: die("Expected view key %s missing" % k) view.append(entry[k]) return view def getClientRoot(): """Grab the client directory.""" output = p4CmdList("client -o") if len(output) != 1: die('Output from "client -o" is %d lines, expecting 1' % len(output)) entry = output[0] if "Root" not in entry: die('Client has no "Root"') return entry["Root"] # # P4 wildcards are not allowed in filenames. P4 complains # if you simply add them, but you can force it with "-f", in # which case it translates them into %xx encoding internally. # def wildcard_decode(path): # Search for and fix just these four characters. Do % last so # that fixing it does not inadvertently create new %-escapes. # Cannot have * in a filename in windows; untested as to # what p4 would do in such a case. if not platform.system() == "Windows": path = path.replace("%2A", "*") path = path.replace("%23", "#") \ .replace("%40", "@") \ .replace("%25", "%") return path def wildcard_encode(path): # do % first to avoid double-encoding the %s introduced here path = path.replace("%", "%25") \ .replace("*", "%2A") \ .replace("#", "%23") \ .replace("@", "%40") return path def wildcard_present(path): m = re.search("[*#@%]", path) return m is not None class Command(object): def __init__(self): self.usage = "usage: %prog [options]" self.needsGit = True self.verbose = False class P4UserMap(object): def __init__(self): self.userMapFromPerforceServer = False self.myP4UserId = None def p4UserId(self): if self.myP4UserId: return self.myP4UserId results = p4CmdList("user -o") for r in results: if 'User' in r: self.myP4UserId = r['User'] return r['User'] die("Could not find your p4 user id") def p4UserIsMe(self, p4User): # return True if the given p4 user is actually me me = self.p4UserId() if not p4User or p4User != me: return False else: return True def getUserCacheFilename(self): home = os.environ.get("HOME", os.environ.get("USERPROFILE")) return home + "/.gitp4-usercache.txt" def getUserMapFromPerforceServer(self): if self.userMapFromPerforceServer: return self.users = {} self.emails = {} for output in p4CmdList("users"): if "User" not in output: continue self.users[output["User"]] = output["FullName"] + " <" + output["Email"] + ">" self.emails[output["Email"]] = output["User"] s = '' for (key, val) in self.users.items(): s += "%s\t%s\n" % (key.expandtabs(1), val.expandtabs(1)) open(self.getUserCacheFilename(), "wb").write(s) self.userMapFromPerforceServer = True def loadUserMapFromCache(self): self.users = {} self.userMapFromPerforceServer = False try: cache = open(self.getUserCacheFilename(), "rb") lines = cache.readlines() cache.close() for line in lines: entry = line.strip().split("\t") self.users[entry[0]] = entry[1] except IOError: self.getUserMapFromPerforceServer() class P4Debug(Command): def __init__(self): Command.__init__(self) self.options = [] self.description = "A tool to debug the output of p4 -G." self.needsGit = False def run(self, args): j = 0 for output in p4CmdList(args): print('Element: %d' % j) j += 1 print(output) return True class P4RollBack(Command): def __init__(self): Command.__init__(self) self.options = [ optparse.make_option("--local", dest="rollbackLocalBranches", action="store_true") ] self.description = "A tool to debug the multi-branch import. Don't use :)" self.rollbackLocalBranches = False def run(self, args): if len(args) != 1: return False maxChange = int(args[0]) if "p4ExitCode" in p4Cmd("changes -m 1"): die("Problems executing p4"); if self.rollbackLocalBranches: refPrefix = "refs/heads/" lines = read_pipe_lines("git rev-parse --symbolic --branches") else: refPrefix = "refs/remotes/" lines = read_pipe_lines("git rev-parse --symbolic --remotes") for line in lines: if self.rollbackLocalBranches or (line.startswith("p4/") and line != "p4/HEAD\n"): line = line.strip() ref = refPrefix + line log = extractLogMessageFromGitCommit(ref) settings = extractSettingsGitLog(log) depotPaths = settings['depot-paths'] change = settings['change'] changed = False if len(p4Cmd("changes -m 1 " + ' '.join (['%s...@%s' % (p, maxChange) for p in depotPaths]))) == 0: print("Branch %s did not exist at change %s, deleting." % (ref, maxChange)) system("git update-ref -d %s `git rev-parse %s`" % (ref, ref)) continue while change and int(change) > maxChange: changed = True if self.verbose: print("%s is at %s ; rewinding towards %s" % (ref, change, maxChange)) system("git update-ref %s \"%s^\"" % (ref, ref)) log = extractLogMessageFromGitCommit(ref) settings = extractSettingsGitLog(log) depotPaths = settings['depot-paths'] change = settings['change'] if changed: print("%s rewound to %s" % (ref, change)) return True class P4Submit(Command, P4UserMap): conflict_behavior_choices = ("ask", "skip", "quit") def __init__(self): Command.__init__(self) P4UserMap.__init__(self) self.options = [ optparse.make_option("--origin", dest="origin"), optparse.make_option("-M", dest="detectRenames", action="store_true"), # preserve the user, requires relevant p4 permissions optparse.make_option("--preserve-user", dest="preserveUser", action="store_true"), optparse.make_option("--export-labels", dest="exportLabels", action="store_true"), optparse.make_option("--dry-run", "-n", dest="dry_run", action="store_true"), optparse.make_option("--prepare-p4-only", dest="prepare_p4_only", action="store_true"), optparse.make_option("--conflict", dest="conflict_behavior", choices=self.conflict_behavior_choices), optparse.make_option("--branch", dest="branch"), ] self.description = "Submit changes from git to the perforce depot." self.usage += " [name of git branch to submit into perforce depot]" self.origin = "" self.detectRenames = False self.preserveUser = gitConfigBool("git-p4.preserveUser") self.dry_run = False self.prepare_p4_only = False self.conflict_behavior = None self.isWindows = (platform.system() == "Windows") self.exportLabels = False self.p4HasMoveCommand = p4_has_move_command() self.branch = None def check(self): if len(p4CmdList("opened ...")) > 0: die("You have files opened with perforce! Close them before starting the sync.") def separate_jobs_from_description(self, message): """Extract and return a possible Jobs field in the commit message. It goes into a separate section in the p4 change specification. A jobs line starts with "Jobs:" and looks like a new field in a form. Values are white-space separated on the same line or on following lines that start with a tab. This does not parse and extract the full git commit message like a p4 form. It just sees the Jobs: line as a marker to pass everything from then on directly into the p4 form, but outside the description section. Return a tuple (stripped log message, jobs string).""" m = re.search(r'^Jobs:', message, re.MULTILINE) if m is None: return (message, None) jobtext = message[m.start():] stripped_message = message[:m.start()].rstrip() return (stripped_message, jobtext) def prepareLogMessage(self, template, message, jobs): """Edits the template returned from "p4 change -o" to insert the message in the Description field, and the jobs text in the Jobs field.""" result = "" inDescriptionSection = False for line in template.split("\n"): if line.startswith("#"): result += line + "\n" continue if inDescriptionSection: if line.startswith("Files:") or line.startswith("Jobs:"): inDescriptionSection = False # insert Jobs section if jobs: result += jobs + "\n" else: continue else: if line.startswith("Description:"): inDescriptionSection = True line += "\n" for messageLine in message.split("\n"): line += "\t" + messageLine + "\n" result += line + "\n" return result def patchRCSKeywords(self, file, pattern): # Attempt to zap the RCS keywords in a p4 controlled file matching the given pattern (handle, outFileName) = tempfile.mkstemp(dir='.') try: outFile = os.fdopen(handle, "w+") inFile = open(file, "r") regexp = re.compile(pattern, re.VERBOSE) for line in inFile.readlines(): line = regexp.sub(r'$\1$', line) outFile.write(line) inFile.close() outFile.close() # Forcibly overwrite the original file os.unlink(file) shutil.move(outFileName, file) except: # cleanup our temporary file os.unlink(outFileName) print("Failed to strip RCS keywords in %s" % file) raise print("Patched up RCS keywords in %s" % file) def p4UserForCommit(self, id): # Return the tuple (perforce user,git email) for a given git commit id self.getUserMapFromPerforceServer() gitEmail = read_pipe(["git", "log", "--max-count=1", "--format=%ae", id]) gitEmail = gitEmail.strip() if gitEmail not in self.emails: return (None, gitEmail) else: return (self.emails[gitEmail], gitEmail) def checkValidP4Users(self, commits): # check if any git authors cannot be mapped to p4 users for id in commits: (user, email) = self.p4UserForCommit(id) if not user: msg = "Cannot find p4 user for email %s in commit %s." % (email, id) if gitConfigBool("git-p4.allowMissingP4Users"): print("%s" % msg) else: die("Error: %s\nSet git-p4.allowMissingP4Users to true to allow this." % msg) def lastP4Changelist(self): # Get back the last changelist number submitted in this client spec. This # then gets used to patch up the username in the change. If the same # client spec is being used by multiple processes then this might go # wrong. results = p4CmdList("client -o") # find the current client client = None for r in results: if 'Client' in r: client = r['Client'] break if not client: die("could not get client spec") results = p4CmdList(["changes", "-c", client, "-m", "1"]) for r in results: if 'change' in r: return r['change'] die("Could not get changelist number for last submit - cannot patch up user details") def modifyChangelistUser(self, changelist, newUser): # fixup the user field of a changelist after it has been submitted. changes = p4CmdList("change -o %s" % changelist) if len(changes) != 1: die("Bad output from p4 change modifying %s to user %s" % (changelist, newUser)) c = changes[0] if c['User'] == newUser: return # nothing to do c['User'] = newUser input = marshal.dumps(c) result = p4CmdList("change -f -i", stdin=input) for r in result: if 'code' in r: if r['code'] == 'error': die("Could not modify user field of changelist %s to %s:%s" % (changelist, newUser, r['data'])) if 'data' in r: print("Updated user field for changelist %s to %s" % (changelist, newUser)) return die("Could not modify user field of changelist %s to %s" % (changelist, newUser)) def canChangeChangelists(self): # check to see if we have p4 admin or super-user permissions, either of # which are required to modify changelists. results = p4CmdList(["protects", self.depotPath]) for r in results: if 'perm' in r: if r['perm'] == 'admin': return 1 if r['perm'] == 'super': return 1 return 0 def prepareSubmitTemplate(self): """Run "p4 change -o" to grab a change specification template. This does not use "p4 -G", as it is nice to keep the submission template in original order, since a human might edit it. Remove lines in the Files section that show changes to files outside the depot path we're committing into.""" template = "" inFilesSection = False for line in p4_read_pipe_lines(['change', '-o']): if line.endswith("\r\n"): line = line[:-2] + "\n" if inFilesSection: if line.startswith("\t"): # path starts and ends with a tab path = line[1:] lastTab = path.rfind("\t") if lastTab != -1: path = path[:lastTab] if not p4PathStartsWith(path, self.depotPath): continue else: inFilesSection = False else: if line.startswith("Files:"): inFilesSection = True template += line return template def edit_template(self, template_file): """Invoke the editor to let the user change the submission message. Return true if okay to continue with the submit.""" # if configured to skip the editing part, just submit if gitConfigBool("git-p4.skipSubmitEdit"): return True # look at the modification time, to check later if the user saved # the file mtime = os.stat(template_file).st_mtime # invoke the editor if "P4EDITOR" in os.environ and (os.environ.get("P4EDITOR") != ""): editor = os.environ.get("P4EDITOR") else: editor = read_pipe("git var GIT_EDITOR").strip() system(editor + " " + template_file) # If the file was not saved, prompt to see if this patch should # be skipped. But skip this verification step if configured so. if gitConfigBool("git-p4.skipSubmitEditCheck"): return True # modification time updated means user saved the file if os.stat(template_file).st_mtime > mtime: return True while True: response = input("Submit template unchanged. Submit anyway? [y]es, [n]o (skip this patch) ") if response == 'y': return True if response == 'n': return False def applyCommit(self, id): """Apply one commit, return True if it succeeded.""" print("Applying", read_pipe(["git", "show", "-s", "--format=format:%h %s", id])) (p4User, gitEmail) = self.p4UserForCommit(id) diff = read_pipe_lines("git diff-tree -r %s \"%s^\" \"%s\"" % (self.diffOpts, id, id)) filesToAdd = set() filesToDelete = set() editedFiles = set() pureRenameCopy = set() filesToChangeExecBit = {} for line in diff: diff = parseDiffTreeEntry(line) modifier = diff['status'] path = diff['src'] if modifier == "M": p4_edit(path) if isModeExecChanged(diff['src_mode'], diff['dst_mode']): filesToChangeExecBit[path] = diff['dst_mode'] editedFiles.add(path) elif modifier == "A": filesToAdd.add(path) filesToChangeExecBit[path] = diff['dst_mode'] if path in filesToDelete: filesToDelete.remove(path) elif modifier == "D": filesToDelete.add(path) if path in filesToAdd: filesToAdd.remove(path) elif modifier == "C": src, dest = diff['src'], diff['dst'] p4_integrate(src, dest) pureRenameCopy.add(dest) if diff['src_sha1'] != diff['dst_sha1']: p4_edit(dest) pureRenameCopy.discard(dest) if isModeExecChanged(diff['src_mode'], diff['dst_mode']): p4_edit(dest) pureRenameCopy.discard(dest) filesToChangeExecBit[dest] = diff['dst_mode'] if self.isWindows: # turn off read-only attribute os.chmod(dest, stat.S_IWRITE) os.unlink(dest) editedFiles.add(dest) elif modifier == "R": src, dest = diff['src'], diff['dst'] if self.p4HasMoveCommand: p4_edit(src) # src must be open before move p4_move(src, dest) # opens for (move/delete, move/add) else: p4_integrate(src, dest) if diff['src_sha1'] != diff['dst_sha1']: p4_edit(dest) else: pureRenameCopy.add(dest) if isModeExecChanged(diff['src_mode'], diff['dst_mode']): if not self.p4HasMoveCommand: p4_edit(dest) # with move: already open, writable filesToChangeExecBit[dest] = diff['dst_mode'] if not self.p4HasMoveCommand: if self.isWindows: os.chmod(dest, stat.S_IWRITE) os.unlink(dest) filesToDelete.add(src) editedFiles.add(dest) else: die("unknown modifier %s for %s" % (modifier, path)) diffcmd = "git format-patch -k --stdout \"%s^\"..\"%s\"" % (id, id) patchcmd = diffcmd + " | git apply " tryPatchCmd = patchcmd + "--check -" applyPatchCmd = patchcmd + "--check --apply -" patch_succeeded = True if os.system(tryPatchCmd) != 0: fixed_rcs_keywords = False patch_succeeded = False print("Unfortunately applying the change failed!") # Patch failed, maybe it's just RCS keyword woes. Look through # the patch to see if that's possible. if gitConfigBool("git-p4.attemptRCSCleanup"): file = None pattern = None kwfiles = {} for file in editedFiles | filesToDelete: # did this file's delta contain RCS keywords? pattern = p4_keywords_regexp_for_file(file) if pattern: # this file is a possibility...look for RCS keywords. regexp = re.compile(pattern, re.VERBOSE) for line in read_pipe_lines(["git", "diff", "%s^..%s" % (id, id), file]): if regexp.search(line): if verbose: print("got keyword match on %s in %s in %s" % (pattern, line, file)) kwfiles[file] = pattern break for file in kwfiles: if verbose: print("zapping %s with %s" % (line, pattern)) # File is being deleted, so not open in p4. Must # disable the read-only bit on windows. if self.isWindows and file not in editedFiles: os.chmod(file, stat.S_IWRITE) self.patchRCSKeywords(file, kwfiles[file]) fixed_rcs_keywords = True if fixed_rcs_keywords: print("Retrying the patch with RCS keywords cleaned up") if os.system(tryPatchCmd) == 0: patch_succeeded = True if not patch_succeeded: for f in editedFiles: p4_revert(f) return False # # Apply the patch for real, and do add/delete/+x handling. # system(applyPatchCmd) for f in filesToAdd: p4_add(f) for f in filesToDelete: p4_revert(f) p4_delete(f) # Set/clear executable bits for f in filesToChangeExecBit.keys(): mode = filesToChangeExecBit[f] setP4ExecBit(f, mode) # # Build p4 change description, starting with the contents # of the git commit message. # logMessage = extractLogMessageFromGitCommit(id) logMessage = logMessage.strip() (logMessage, jobs) = self.separate_jobs_from_description(logMessage) template = self.prepareSubmitTemplate() submitTemplate = self.prepareLogMessage(template, logMessage, jobs) if self.preserveUser: submitTemplate += "\n######## Actual user %s, modified after commit\n" % p4User if self.checkAuthorship and not self.p4UserIsMe(p4User): submitTemplate += "######## git author %s does not match your p4 account.\n" % gitEmail submitTemplate += "######## Use option --preserve-user to modify authorship.\n" submitTemplate += "######## Variable git-p4.skipUserNameCheck hides this message.\n" separatorLine = "######## everything below this line is just the diff #######\n" # diff if "P4DIFF" in os.environ: del(os.environ["P4DIFF"]) diff = "" for editedFile in editedFiles: diff += p4_read_pipe(['diff', '-du', wildcard_encode(editedFile)]) # new file diff newdiff = "" for newFile in filesToAdd: newdiff += "==== new file ====\n" newdiff += "--- /dev/null\n" newdiff += "+++ %s\n" % newFile f = open(newFile, "r") for line in f.readlines(): newdiff += "+" + line f.close() # change description file: submitTemplate, separatorLine, diff, newdiff (handle, fileName) = tempfile.mkstemp() tmpFile = os.fdopen(handle, "w+") if self.isWindows: submitTemplate = submitTemplate.replace("\n", "\r\n") separatorLine = separatorLine.replace("\n", "\r\n") newdiff = newdiff.replace("\n", "\r\n") tmpFile.write(submitTemplate + separatorLine + diff + newdiff) tmpFile.close() if self.prepare_p4_only: # # Leave the p4 tree prepared, and the submit template around # and let the user decide what to do next # print() print("P4 workspace prepared for submission.") print("To submit or revert, go to client workspace") print(" " + self.clientPath) print() print("To submit, use \"p4 submit\" to write a new description,") print("or \"p4 submit -i %s\" to use the one prepared by" \ " \"git p4\"." % fileName) print("You can delete the file \"%s\" when finished." % fileName) if self.preserveUser and p4User and not self.p4UserIsMe(p4User): print("To preserve change ownership by user %s, you must\n" \ "do \"p4 change -f <change>\" after submitting and\n" \ "edit the User field.") if pureRenameCopy: print("After submitting, renamed files must be re-synced.") print("Invoke \"p4 sync -f\" on each of these files:") for f in pureRenameCopy: print(" " + f) print() print("To revert the changes, use \"p4 revert ...\", and delete") print("the submit template file \"%s\"" % fileName) if filesToAdd: print("Since the commit adds new files, they must be deleted:") for f in filesToAdd: print(" " + f) print() return True # # Let the user edit the change description, then submit it. # if self.edit_template(fileName): # read the edited message and submit ret = True tmpFile = open(fileName, "rb") message = tmpFile.read() tmpFile.close() submitTemplate = message[:message.index(separatorLine)] if self.isWindows: submitTemplate = submitTemplate.replace("\r\n", "\n") p4_write_pipe(['submit', '-i'], submitTemplate) if self.preserveUser: if p4User: # Get last changelist number. Cannot easily get it from # the submit command output as the output is # unmarshalled. changelist = self.lastP4Changelist() self.modifyChangelistUser(changelist, p4User) # The rename/copy happened by applying a patch that created a # new file. This leaves it writable, which confuses p4. for f in pureRenameCopy: p4_sync(f, "-f") else: # skip this patch ret = False print("Submission cancelled, undoing p4 changes.") for f in editedFiles: p4_revert(f) for f in filesToAdd: p4_revert(f) os.remove(f) for f in filesToDelete: p4_revert(f) os.remove(fileName) return ret # Export git tags as p4 labels. Create a p4 label and then tag # with that. def exportGitTags(self, gitTags): validLabelRegexp = gitConfig("git-p4.labelExportRegexp") if len(validLabelRegexp) == 0: validLabelRegexp = defaultLabelRegexp m = re.compile(validLabelRegexp) for name in gitTags: if not m.match(name): if verbose: print("tag %s does not match regexp %s" % (name, validLabelRegexp)) continue # Get the p4 commit this corresponds to logMessage = extractLogMessageFromGitCommit(name) values = extractSettingsGitLog(logMessage) if 'change' not in values: # a tag pointing to something not sent to p4; ignore if verbose: print("git tag %s does not give a p4 commit" % name) continue else: changelist = values['change'] # Get the tag details. inHeader = True isAnnotated = False body = [] for l in read_pipe_lines(["git", "cat-file", "-p", name]): l = l.strip() if inHeader: if re.match(r'tag\s+', l): isAnnotated = True elif re.match(r'\s*$', l): inHeader = False continue else: body.append(l) if not isAnnotated: body = ["lightweight tag imported by git p4\n"] # Create the label - use the same view as the client spec we are using clientSpec = getClientSpec() labelTemplate = "Label: %s\n" % name labelTemplate += "Description:\n" for b in body: labelTemplate += "\t" + b + "\n" labelTemplate += "View:\n" for depot_side in clientSpec.mappings: labelTemplate += "\t%s\n" % depot_side if self.dry_run: print("Would create p4 label %s for tag" % name) elif self.prepare_p4_only: print("Not creating p4 label %s for tag due to option" \ " --prepare-p4-only" % name) else: p4_write_pipe(["label", "-i"], labelTemplate) # Use the label p4_system(["tag", "-l", name] + ["%s@%s" % (depot_side, changelist) for depot_side in clientSpec.mappings]) if verbose: print("created p4 label for tag %s" % name) def run(self, args): if len(args) == 0: self.master = currentGitBranch() if len(self.master) == 0 or not gitBranchExists("refs/heads/%s" % self.master): die("Detecting current git branch failed!") elif len(args) == 1: self.master = args[0] if not branchExists(self.master): die("Branch %s does not exist" % self.master) else: return False allowSubmit = gitConfig("git-p4.allowSubmit") if len(allowSubmit) > 0 and not self.master in allowSubmit.split(","): die("%s is not in git-p4.allowSubmit" % self.master) [upstream, settings] = findUpstreamBranchPoint() self.depotPath = settings['depot-paths'][0] if len(self.origin) == 0: self.origin = upstream if self.preserveUser: if not self.canChangeChangelists(): die("Cannot preserve user names without p4 super-user or admin permissions") # if not set from the command line, try the config file if self.conflict_behavior is None: val = gitConfig("git-p4.conflict") if val: if val not in self.conflict_behavior_choices: die("Invalid value '%s' for config git-p4.conflict" % val) else: val = "ask" self.conflict_behavior = val if self.verbose: print("Origin branch is " + self.origin) if len(self.depotPath) == 0: print("Internal error: cannot locate perforce depot path from existing branches") sys.exit(128) self.useClientSpec = False if gitConfigBool("git-p4.useclientspec"): self.useClientSpec = True if self.useClientSpec: self.clientSpecDirs = getClientSpec() if self.useClientSpec: # all files are relative to the client spec self.clientPath = getClientRoot() else: self.clientPath = p4Where(self.depotPath) if self.clientPath == "": die("Error: Cannot locate perforce checkout of %s in client view" % self.depotPath) print("Perforce checkout for depot path %s located at %s" % (self.depotPath, self.clientPath)) self.oldWorkingDirectory = os.getcwd() # ensure the clientPath exists new_client_dir = False if not os.path.exists(self.clientPath): new_client_dir = True os.makedirs(self.clientPath) chdir(self.clientPath, is_client_path=True) if self.dry_run: print("Would synchronize p4 checkout in %s" % self.clientPath) else: print("Synchronizing p4 checkout...") if new_client_dir: # old one was destroyed, and maybe nobody told p4 p4_sync("...", "-f") else: p4_sync("...") self.check() commits = [] for line in read_pipe_lines(["git", "rev-list", "--no-merges", "%s..%s" % (self.origin, self.master)]): commits.append(line.strip()) commits.reverse() if self.preserveUser or gitConfigBool("git-p4.skipUserNameCheck"): self.checkAuthorship = False else: self.checkAuthorship = True if self.preserveUser: self.checkValidP4Users(commits) # # Build up a set of options to be passed to diff when # submitting each commit to p4. # if self.detectRenames: # command-line -M arg self.diffOpts = "-M" else: # If not explicitly set check the config variable detectRenames = gitConfig("git-p4.detectRenames") if detectRenames.lower() == "false" or detectRenames == "": self.diffOpts = "" elif detectRenames.lower() == "true": self.diffOpts = "-M" else: self.diffOpts = "-M%s" % detectRenames # no command-line arg for -C or --find-copies-harder, just # config variables detectCopies = gitConfig("git-p4.detectCopies") if detectCopies.lower() == "false" or detectCopies == "": pass elif detectCopies.lower() == "true": self.diffOpts += " -C" else: self.diffOpts += " -C%s" % detectCopies if gitConfigBool("git-p4.detectCopiesHarder"): self.diffOpts += " --find-copies-harder" # # Apply the commits, one at a time. On failure, ask if should # continue to try the rest of the patches, or quit. # if self.dry_run: print("Would apply") applied = [] last = len(commits) - 1 for i, commit in enumerate(commits): if self.dry_run: print(" ", read_pipe(["git", "show", "-s", "--format=format:%h %s", commit])) ok = True else: ok = self.applyCommit(commit) if ok: applied.append(commit) else: if self.prepare_p4_only and i < last: print("Processing only the first commit due to option" \ " --prepare-p4-only") break if i < last: quit = False while True: # prompt for what to do, or use the option/variable if self.conflict_behavior == "ask": print("What do you want to do?") response = input("[s]kip this commit but apply" " the rest, or [q]uit? ") if not response: continue elif self.conflict_behavior == "skip": response = "s" elif self.conflict_behavior == "quit": response = "q" else: die("Unknown conflict_behavior '%s'" % self.conflict_behavior) if response[0] == "s": print("Skipping this commit, but applying the rest") break if response[0] == "q": print("Quitting") quit = True break if quit: break chdir(self.oldWorkingDirectory) if self.dry_run: pass elif self.prepare_p4_only: pass elif len(commits) == len(applied): print("All commits applied!") sync = P4Sync() if self.branch: sync.branch = self.branch sync.run([]) rebase = P4Rebase() rebase.rebase() else: if len(applied) == 0: print("No commits applied.") else: print("Applied only the commits marked with '*':") for c in commits: if c in applied: star = "*" else: star = " " print(star, read_pipe(["git", "show", "-s", "--format=format:%h %s", c])) print("You will have to do 'git p4 sync' and rebase.") if gitConfigBool("git-p4.exportLabels"): self.exportLabels = True if self.exportLabels: p4Labels = getP4Labels(self.depotPath) gitTags = getGitTags() missingGitTags = gitTags - p4Labels self.exportGitTags(missingGitTags) # exit with error unless everything applied perfectly if len(commits) != len(applied): sys.exit(1) return True class View(object): """Represent a p4 view ("p4 help views"), and map files in a repo according to the view.""" def __init__(self, client_name): self.mappings = [] self.client_prefix = "//%s/" % client_name # cache results of "p4 where" to lookup client file locations self.client_spec_path_cache = {} def append(self, view_line): """Parse a view line, splitting it into depot and client sides. Append to self.mappings, preserving order. This is only needed for tag creation.""" # Split the view line into exactly two words. P4 enforces # structure on these lines that simplifies this quite a bit. # # Either or both words may be double-quoted. # Single quotes do not matter. # Double-quote marks cannot occur inside the words. # A + or - prefix is also inside the quotes. # There are no quotes unless they contain a space. # The line is already white-space stripped. # The two words are separated by a single space. # if view_line[0] == '"': # First word is double quoted. Find its end. close_quote_index = view_line.find('"', 1) if close_quote_index <= 0: die("No first-word closing quote found: %s" % view_line) depot_side = view_line[1:close_quote_index] # skip closing quote and space rhs_index = close_quote_index + 1 + 1 else: space_index = view_line.find(" ") if space_index <= 0: die("No word-splitting space found: %s" % view_line) depot_side = view_line[0:space_index] rhs_index = space_index + 1 # prefix + means overlay on previous mapping if depot_side.startswith("+"): depot_side = depot_side[1:] # prefix - means exclude this path, leave out of mappings exclude = False if depot_side.startswith("-"): exclude = True depot_side = depot_side[1:] if not exclude: self.mappings.append(depot_side) def convert_client_path(self, clientFile): # chop off //client/ part to make it relative if not clientFile.startswith(self.client_prefix): die("No prefix '%s' on clientFile '%s'" % (self.client_prefix, clientFile)) return clientFile[len(self.client_prefix):] def update_client_spec_path_cache(self, files): """ Caching file paths by "p4 where" batch query """ # List depot file paths exclude that already cached fileArgs = [f['path'] for f in files if f['path'] not in self.client_spec_path_cache] if len(fileArgs) == 0: return # All files in cache where_result = p4CmdList(["-x", "-", "where"], stdin=fileArgs) for res in where_result: if "code" in res and res["code"] == "error": # assume error is "... file(s) not in client view" continue if "clientFile" not in res: die("No clientFile from 'p4 where %s'" % depot_path) if "unmap" in res: # it will list all of them, but only one not unmap-ped continue self.client_spec_path_cache[res['depotFile']] = self.convert_client_path(res["clientFile"]) # not found files or unmap files set to "" for depotFile in fileArgs: if depotFile not in self.client_spec_path_cache: self.client_spec_path_cache[depotFile] = "" def map_in_client(self, depot_path): """Return the relative location in the client where this depot file should live. Returns "" if the file should not be mapped in the client.""" if depot_path in self.client_spec_path_cache: return self.client_spec_path_cache[depot_path] die( "Error: %s is not found in client spec path" % depot_path ) return "" class P4Sync(Command, P4UserMap): delete_actions = ( "delete", "move/delete", "purge" ) def __init__(self): Command.__init__(self) P4UserMap.__init__(self) self.options = [ optparse.make_option("--branch", dest="branch"), optparse.make_option("--detect-branches", dest="detectBranches", action="store_true"), optparse.make_option("--changesfile", dest="changesFile"), optparse.make_option("--silent", dest="silent", action="store_true"), optparse.make_option("--detect-labels", dest="detectLabels", action="store_true"), optparse.make_option("--import-labels", dest="importLabels", action="store_true"), optparse.make_option("--import-local", dest="importIntoRemotes", action="store_false", help="Import into refs/heads/ , not refs/remotes"), optparse.make_option("--max-changes", dest="maxChanges"), optparse.make_option("--keep-path", dest="keepRepoPath", action='store_true', help="Keep entire BRANCH/DIR/SUBDIR prefix during import"), optparse.make_option("--use-client-spec", dest="useClientSpec", action='store_true', help="Only sync files that are included in the Perforce Client Spec") ] self.description = """Imports from Perforce into a git repository.\n example: //depot/my/project/ -- to import the current head //depot/my/project/@all -- to import everything //depot/my/project/@1,6 -- to import only from revision 1 to 6 (a ... is not needed in the path p4 specification, it's added implicitly)""" self.usage += " //depot/path[@revRange]" self.silent = False self.createdBranches = set() self.committedChanges = set() self.branch = "" self.detectBranches = False self.detectLabels = False self.importLabels = False self.changesFile = "" self.syncWithOrigin = True self.importIntoRemotes = True self.maxChanges = "" self.keepRepoPath = False self.depotPaths = None self.p4BranchesInGit = [] self.cloneExclude = [] self.useClientSpec = False self.useClientSpec_from_options = False self.clientSpecDirs = None self.tempBranches = [] self.tempBranchLocation = "git-p4-tmp" if gitConfig("git-p4.syncFromOrigin") == "false": self.syncWithOrigin = False # Force a checkpoint in fast-import and wait for it to finish def checkpoint(self): self.gitStream.write("checkpoint\n\n") self.gitStream.write("progress checkpoint\n\n") out = self.gitOutput.readline() if self.verbose: print("checkpoint finished: " + out) def extractFilesFromCommit(self, commit): self.cloneExclude = [re.sub(r"\.\.\.$", "", path) for path in self.cloneExclude] files = [] fnum = 0 while "depotFile%s" % fnum in commit: path = commit["depotFile%s" % fnum] if [p for p in self.cloneExclude if p4PathStartsWith(path, p)]: found = False else: found = [p for p in self.depotPaths if p4PathStartsWith(path, p)] if not found: fnum = fnum + 1 continue file = {} file["path"] = path file["rev"] = commit["rev%s" % fnum] file["action"] = commit["action%s" % fnum] file["type"] = commit["type%s" % fnum] files.append(file) fnum = fnum + 1 return files def stripRepoPath(self, path, prefixes): """When streaming files, this is called to map a p4 depot path to where it should go in git. The prefixes are either self.depotPaths, or self.branchPrefixes in the case of branch detection.""" if self.useClientSpec: # branch detection moves files up a level (the branch name) # from what client spec interpretation gives path = self.clientSpecDirs.map_in_client(path) if self.detectBranches: for b in self.knownBranches: if path.startswith(b + "/"): path = path[len(b)+1:] elif self.keepRepoPath: # Preserve everything in relative path name except leading # //depot/; just look at first prefix as they all should # be in the same depot. depot = re.sub("^(//[^/]+/).*", r'\1', prefixes[0]) if p4PathStartsWith(path, depot): path = path[len(depot):] else: for p in prefixes: if p4PathStartsWith(path, p): path = path[len(p):] break path = wildcard_decode(path) return path def splitFilesIntoBranches(self, commit): """Look at each depotFile in the commit to figure out to what branch it belongs.""" if self.clientSpecDirs: files = self.extractFilesFromCommit(commit) self.clientSpecDirs.update_client_spec_path_cache(files) branches = {} fnum = 0 while "depotFile%s" % fnum in commit: path = commit["depotFile%s" % fnum] found = [p for p in self.depotPaths if p4PathStartsWith(path, p)] if not found: fnum = fnum + 1 continue file = {} file["path"] = path file["rev"] = commit["rev%s" % fnum] file["action"] = commit["action%s" % fnum] file["type"] = commit["type%s" % fnum] fnum = fnum + 1 # start with the full relative path where this file would # go in a p4 client if self.useClientSpec: relPath = self.clientSpecDirs.map_in_client(path) else: relPath = self.stripRepoPath(path, self.depotPaths) for branch in self.knownBranches.keys(): # add a trailing slash so that a commit into qt/4.2foo # doesn't end up in qt/4.2, e.g. if relPath.startswith(branch + "/"): if branch not in branches: branches[branch] = [] branches[branch].append(file) break return branches # output one file from the P4 stream # - helper for streamP4Files def streamOneP4File(self, file, contents): relPath = self.stripRepoPath(file['depotFile'], self.branchPrefixes) if verbose: sys.stderr.write("%s\n" % relPath) (type_base, type_mods) = split_p4_type(file["type"]) git_mode = "100644" if "x" in type_mods: git_mode = "100755" if type_base == "symlink": git_mode = "120000" # p4 print on a symlink sometimes contains "target\n"; # if it does, remove the newline data = ''.join(contents) if data[-1] == '\n': contents = [data[:-1]] else: contents = [data] if type_base == "utf16": # p4 delivers different text in the python output to -G # than it does when using "print -o", or normal p4 client # operations. utf16 is converted to ascii or utf8, perhaps. # But ascii text saved as -t utf16 is completely mangled. # Invoke print -o to get the real contents. # # On windows, the newlines will always be mangled by print, so put # them back too. This is not needed to the cygwin windows version, # just the native "NT" type. # text = p4_read_pipe(['print', '-q', '-o', '-', file['depotFile']]) if p4_version_string().find("/NT") >= 0: text = text.replace("\r\n", "\n") contents = [ text ] if type_base == "apple": # Apple filetype files will be streamed as a concatenation of # its appledouble header and the contents. This is useless # on both macs and non-macs. If using "print -q -o xx", it # will create "xx" with the data, and "%xx" with the header. # This is also not very useful. # # Ideally, someday, this script can learn how to generate # appledouble files directly and import those to git, but # non-mac machines can never find a use for apple filetype. print("\nIgnoring apple filetype file %s" % file['depotFile']) return # Note that we do not try to de-mangle keywords on utf16 files, # even though in theory somebody may want that. pattern = p4_keywords_regexp_for_type(type_base, type_mods) if pattern: regexp = re.compile(pattern, re.VERBOSE) text = ''.join(contents) text = regexp.sub(r'$\1$', text) contents = [ text ] self.gitStream.write("M %s inline %s\n" % (git_mode, relPath)) # total length... length = 0 for d in contents: length = length + len(d) self.gitStream.write("data %d\n" % length) for d in contents: self.gitStream.write(d) self.gitStream.write("\n") def streamOneP4Deletion(self, file): relPath = self.stripRepoPath(file['path'], self.branchPrefixes) if verbose: sys.stderr.write("delete %s\n" % relPath) self.gitStream.write("D %s\n" % relPath) # handle another chunk of streaming data def streamP4FilesCb(self, marshalled): # catch p4 errors and complain err = None if "code" in marshalled: if marshalled["code"] == "error": if "data" in marshalled: err = marshalled["data"].rstrip() if err: f = None if self.stream_have_file_info: if "depotFile" in self.stream_file: f = self.stream_file["depotFile"] # force a failure in fast-import, else an empty # commit will be made self.gitStream.write("\n") self.gitStream.write("die-now\n") self.gitStream.close() # ignore errors, but make sure it exits first self.importProcess.wait() if f: die("Error from p4 print for %s: %s" % (f, err)) else: die("Error from p4 print: %s" % err) if 'depotFile' in marshalled and self.stream_have_file_info: # start of a new file - output the old one first self.streamOneP4File(self.stream_file, self.stream_contents) self.stream_file = {} self.stream_contents = [] self.stream_have_file_info = False # pick up the new file information... for the # 'data' field we need to append to our array for k in marshalled.keys(): if k == 'data': self.stream_contents.append(marshalled['data']) else: self.stream_file[k] = marshalled[k] self.stream_have_file_info = True # Stream directly from "p4 files" into "git fast-import" def streamP4Files(self, files): filesForCommit = [] filesToRead = [] filesToDelete = [] for f in files: # if using a client spec, only add the files that have # a path in the client if self.clientSpecDirs: if self.clientSpecDirs.map_in_client(f['path']) == "": continue filesForCommit.append(f) if f['action'] in self.delete_actions: filesToDelete.append(f) else: filesToRead.append(f) # deleted files... for f in filesToDelete: self.streamOneP4Deletion(f) if len(filesToRead) > 0: self.stream_file = {} self.stream_contents = [] self.stream_have_file_info = False # curry self argument def streamP4FilesCbSelf(entry): self.streamP4FilesCb(entry) fileArgs = ['%s#%s' % (f['path'], f['rev']) for f in filesToRead] p4CmdList(["-x", "-", "print"], stdin=fileArgs, cb=streamP4FilesCbSelf) # do the last chunk if 'depotFile' in self.stream_file: self.streamOneP4File(self.stream_file, self.stream_contents) def make_email(self, userid): if userid in self.users: return self.users[userid] else: return "%s <a@b>" % userid # Stream a p4 tag def streamTag(self, gitStream, labelName, labelDetails, commit, epoch): if verbose: print("writing tag %s for commit %s" % (labelName, commit)) gitStream.write("tag %s\n" % labelName) gitStream.write("from %s\n" % commit) if 'Owner' in labelDetails: owner = labelDetails["Owner"] else: owner = None # Try to use the owner of the p4 label, or failing that, # the current p4 user id. if owner: email = self.make_email(owner) else: email = self.make_email(self.p4UserId()) tagger = "%s %s %s" % (email, epoch, self.tz) gitStream.write("tagger %s\n" % tagger) print("labelDetails=", labelDetails) if 'Description' in labelDetails: description = labelDetails['Description'] else: description = 'Label from git p4' gitStream.write("data %d\n" % len(description)) gitStream.write(description) gitStream.write("\n") def commit(self, details, files, branch, parent = ""): epoch = details["time"] author = details["user"] if self.verbose: print("commit into %s" % branch) # start with reading files; if that fails, we should not # create a commit. new_files = [] for f in files: if [p for p in self.branchPrefixes if p4PathStartsWith(f['path'], p)]: new_files.append (f) else: sys.stderr.write("Ignoring file outside of prefix: %s\n" % f['path']) if self.clientSpecDirs: self.clientSpecDirs.update_client_spec_path_cache(files) self.gitStream.write("commit %s\n" % branch) # gitStream.write("mark :%s\n" % details["change"]) self.committedChanges.add(int(details["change"])) committer = "" if author not in self.users: self.getUserMapFromPerforceServer() committer = "%s %s %s" % (self.make_email(author), epoch, self.tz) self.gitStream.write("committer %s\n" % committer) self.gitStream.write("data <<EOT\n") self.gitStream.write(details["desc"]) self.gitStream.write("\n[git-p4: depot-paths = \"%s\": change = %s" % (','.join(self.branchPrefixes), details["change"])) if len(details['options']) > 0: self.gitStream.write(": options = %s" % details['options']) self.gitStream.write("]\nEOT\n\n") if len(parent) > 0: if self.verbose: print("parent %s" % parent) self.gitStream.write("from %s\n" % parent) self.streamP4Files(new_files) self.gitStream.write("\n") change = int(details["change"]) if change in self.labels: label = self.labels[change] labelDetails = label[0] labelRevisions = label[1] if self.verbose: print("Change %s is labelled %s" % (change, labelDetails)) files = p4CmdList(["files"] + ["%s...@%s" % (p, change) for p in self.branchPrefixes]) if len(files) == len(labelRevisions): cleanedFiles = {} for info in files: if info["action"] in self.delete_actions: continue cleanedFiles[info["depotFile"]] = info["rev"] if cleanedFiles == labelRevisions: self.streamTag(self.gitStream, 'tag_%s' % labelDetails['label'], labelDetails, branch, epoch) else: if not self.silent: print ("Tag %s does not match with change %s: files do not match." % (labelDetails["label"], change)) else: if not self.silent: print ("Tag %s does not match with change %s: file count is different." % (labelDetails["label"], change)) # Build a dictionary of changelists and labels, for "detect-labels" option. def getLabels(self): self.labels = {} l = p4CmdList(["labels"] + ["%s..." % p for p in self.depotPaths]) if len(l) > 0 and not self.silent: print("Finding files belonging to labels in %s" % repr(self.depotPaths)) for output in l: label = output["label"] revisions = {} newestChange = 0 if self.verbose: print("Querying files for label %s" % label) for file in p4CmdList(["files"] + ["%s...@%s" % (p, label) for p in self.depotPaths]): revisions[file["depotFile"]] = file["rev"] change = int(file["change"]) if change > newestChange: newestChange = change self.labels[newestChange] = [output, revisions] if self.verbose: print("Label changes: %s" % (list(self.labels.keys()),)) # Import p4 labels as git tags. A direct mapping does not # exist, so assume that if all the files are at the same revision # then we can use that, or it's something more complicated we should # just ignore. def importP4Labels(self, stream, p4Labels): if verbose: print("import p4 labels: " + ' '.join(p4Labels)) ignoredP4Labels = gitConfigList("git-p4.ignoredP4Labels") validLabelRegexp = gitConfig("git-p4.labelImportRegexp") if len(validLabelRegexp) == 0: validLabelRegexp = defaultLabelRegexp m = re.compile(validLabelRegexp) for name in p4Labels: commitFound = False if not m.match(name): if verbose: print("label %s does not match regexp %s" % (name, validLabelRegexp)) continue if name in ignoredP4Labels: continue labelDetails = p4CmdList(['label', "-o", name])[0] # get the most recent changelist for each file in this label change = p4Cmd(["changes", "-m", "1"] + ["%s...@%s" % (p, name) for p in self.depotPaths]) if 'change' in change: # find the corresponding git commit; take the oldest commit changelist = int(change['change']) gitCommit = read_pipe(["git", "rev-list", "--max-count=1", "--reverse", ":/\[git-p4:.*change = %d\]" % changelist]) if len(gitCommit) == 0: print("could not find git commit for changelist %d" % changelist) else: gitCommit = gitCommit.strip() commitFound = True # Convert from p4 time format try: tmwhen = time.strptime(labelDetails['Update'], "%Y/%m/%d %H:%M:%S") except ValueError: print("Could not convert label time %s" % labelDetails['Update']) tmwhen = 1 when = int(time.mktime(tmwhen)) self.streamTag(stream, name, labelDetails, gitCommit, when) if verbose: print("p4 label %s mapped to git commit %s" % (name, gitCommit)) else: if verbose: print("Label %s has no changelists - possibly deleted?" % name) if not commitFound: # We can't import this label; don't try again as it will get very # expensive repeatedly fetching all the files for labels that will # never be imported. If the label is moved in the future, the # ignore will need to be removed manually. system(["git", "config", "--add", "git-p4.ignoredP4Labels", name]) def guessProjectName(self): for p in self.depotPaths: if p.endswith("/"): p = p[:-1] p = p[p.strip().rfind("/") + 1:] if not p.endswith("/"): p += "/" return p def getBranchMapping(self): lostAndFoundBranches = set() user = gitConfig("git-p4.branchUser") if len(user) > 0: command = "branches -u %s" % user else: command = "branches" for info in p4CmdList(command): details = p4Cmd(["branch", "-o", info["branch"]]) viewIdx = 0 while "View%s" % viewIdx in details: paths = details["View%s" % viewIdx].split(" ") viewIdx = viewIdx + 1 # require standard //depot/foo/... //depot/bar/... mapping if len(paths) != 2 or not paths[0].endswith("/...") or not paths[1].endswith("/..."): continue source = paths[0] destination = paths[1] ## HACK if p4PathStartsWith(source, self.depotPaths[0]) and p4PathStartsWith(destination, self.depotPaths[0]): source = source[len(self.depotPaths[0]):-4] destination = destination[len(self.depotPaths[0]):-4] if destination in self.knownBranches: if not self.silent: print("p4 branch %s defines a mapping from %s to %s" % (info["branch"], source, destination)) print("but there exists another mapping from %s to %s already!" % (self.knownBranches[destination], destination)) continue self.knownBranches[destination] = source lostAndFoundBranches.discard(destination) if source not in self.knownBranches: lostAndFoundBranches.add(source) # Perforce does not strictly require branches to be defined, so we also # check git config for a branch list. # # Example of branch definition in git config file: # [git-p4] # branchList=main:branchA # branchList=main:branchB # branchList=branchA:branchC configBranches = gitConfigList("git-p4.branchList") for branch in configBranches: if branch: (source, destination) = branch.split(":") self.knownBranches[destination] = source lostAndFoundBranches.discard(destination) if source not in self.knownBranches: lostAndFoundBranches.add(source) for branch in lostAndFoundBranches: self.knownBranches[branch] = branch def getBranchMappingFromGitBranches(self): branches = p4BranchesInGit(self.importIntoRemotes) for branch in branches.keys(): if branch == "master": branch = "main" else: branch = branch[len(self.projectName):] self.knownBranches[branch] = branch def updateOptionDict(self, d): option_keys = {} if self.keepRepoPath: option_keys['keepRepoPath'] = 1 d["options"] = ' '.join(sorted(option_keys.keys())) def readOptions(self, d): self.keepRepoPath = ('options' in d and ('keepRepoPath' in d['options'])) def gitRefForBranch(self, branch): if branch == "main": return self.refPrefix + "master" if len(branch) <= 0: return branch return self.refPrefix + self.projectName + branch def gitCommitByP4Change(self, ref, change): if self.verbose: print("looking in ref " + ref + " for change %s using bisect..." % change) earliestCommit = "" latestCommit = parseRevision(ref) while True: if self.verbose: print("trying: earliest %s latest %s" % (earliestCommit, latestCommit)) next = read_pipe("git rev-list --bisect %s %s" % (latestCommit, earliestCommit)).strip() if len(next) == 0: if self.verbose: print("argh") return "" log = extractLogMessageFromGitCommit(next) settings = extractSettingsGitLog(log) currentChange = int(settings['change']) if self.verbose: print("current change %s" % currentChange) if currentChange == change: if self.verbose: print("found %s" % next) return next if currentChange < change: earliestCommit = "^%s" % next else: latestCommit = "%s" % next return "" def importNewBranch(self, branch, maxChange): # make fast-import flush all changes to disk and update the refs using the checkpoint # command so that we can try to find the branch parent in the git history self.gitStream.write("checkpoint\n\n"); self.gitStream.flush(); branchPrefix = self.depotPaths[0] + branch + "/" range = "@1,%s" % maxChange #print "prefix" + branchPrefix changes = p4ChangesForPaths([branchPrefix], range) if len(changes) <= 0: return False firstChange = changes[0] #print "first change in branch: %s" % firstChange sourceBranch = self.knownBranches[branch] sourceDepotPath = self.depotPaths[0] + sourceBranch sourceRef = self.gitRefForBranch(sourceBranch) #print "source " + sourceBranch branchParentChange = int(p4Cmd(["changes", "-m", "1", "%s...@1,%s" % (sourceDepotPath, firstChange)])["change"]) #print "branch parent: %s" % branchParentChange gitParent = self.gitCommitByP4Change(sourceRef, branchParentChange) if len(gitParent) > 0: self.initialParents[self.gitRefForBranch(branch)] = gitParent #print "parent git commit: %s" % gitParent self.importChanges(changes) return True def searchParent(self, parent, branch, target): parentFound = False for blob in read_pipe_lines(["git", "rev-list", "--reverse", "--no-merges", parent]): blob = blob.strip() if len(read_pipe(["git", "diff-tree", blob, target])) == 0: parentFound = True if self.verbose: print("Found parent of %s in commit %s" % (branch, blob)) break if parentFound: return blob else: return None def importChanges(self, changes): cnt = 1 for change in changes: description = p4_describe(change) self.updateOptionDict(description) if not self.silent: sys.stdout.write("\rImporting revision %s (%s%%)" % (change, cnt * 100 / len(changes))) sys.stdout.flush() cnt = cnt + 1 try: if self.detectBranches: branches = self.splitFilesIntoBranches(description) for branch in branches.keys(): ## HACK --hwn branchPrefix = self.depotPaths[0] + branch + "/" self.branchPrefixes = [ branchPrefix ] parent = "" filesForCommit = branches[branch] if self.verbose: print("branch is %s" % branch) self.updatedBranches.add(branch) if branch not in self.createdBranches: self.createdBranches.add(branch) parent = self.knownBranches[branch] if parent == branch: parent = "" else: fullBranch = self.projectName + branch if fullBranch not in self.p4BranchesInGit: if not self.silent: print("\n Importing new branch %s" % fullBranch); if self.importNewBranch(branch, change - 1): parent = "" self.p4BranchesInGit.append(fullBranch) if not self.silent: print("\n Resuming with change %s" % change); if self.verbose: print("parent determined through known branches: %s" % parent) branch = self.gitRefForBranch(branch) parent = self.gitRefForBranch(parent) if self.verbose: print("looking for initial parent for %s; current parent is %s" % (branch, parent)) if len(parent) == 0 and branch in self.initialParents: parent = self.initialParents[branch] del self.initialParents[branch] blob = None if len(parent) > 0: tempBranch = "%s/%d" % (self.tempBranchLocation, change) if self.verbose: print("Creating temporary branch: " + tempBranch) self.commit(description, filesForCommit, tempBranch) self.tempBranches.append(tempBranch) self.checkpoint() blob = self.searchParent(parent, branch, tempBranch) if blob: self.commit(description, filesForCommit, branch, blob) else: if self.verbose: print("Parent of %s not found. Committing into head of %s" % (branch, parent)) self.commit(description, filesForCommit, branch, parent) else: files = self.extractFilesFromCommit(description) self.commit(description, files, self.branch, self.initialParent) # only needed once, to connect to the previous commit self.initialParent = "" except IOError: print(self.gitError.read()) sys.exit(1) def importHeadRevision(self, revision): print("Doing initial import of %s from revision %s into %s" % (' '.join(self.depotPaths), revision, self.branch)) details = {} details["user"] = "git perforce import user" details["desc"] = ("Initial import of %s from the state at revision %s\n" % (' '.join(self.depotPaths), revision)) details["change"] = revision newestRevision = 0 fileCnt = 0 fileArgs = ["%s...%s" % (p, revision) for p in self.depotPaths] for info in p4CmdList(["files"] + fileArgs): if 'code' in info and info['code'] == 'error': sys.stderr.write("p4 returned an error: %s\n" % info['data']) if info['data'].find("must refer to client") >= 0: sys.stderr.write("This particular p4 error is misleading.\n") sys.stderr.write("Perhaps the depot path was misspelled.\n"); sys.stderr.write("Depot path: %s\n" % " ".join(self.depotPaths)) sys.exit(1) if 'p4ExitCode' in info: sys.stderr.write("p4 exitcode: %s\n" % info['p4ExitCode']) sys.exit(1) change = int(info["change"]) if change > newestRevision: newestRevision = change if info["action"] in self.delete_actions: # don't increase the file cnt, otherwise details["depotFile123"] will have gaps! #fileCnt = fileCnt + 1 continue for prop in ["depotFile", "rev", "action", "type" ]: details["%s%s" % (prop, fileCnt)] = info[prop] fileCnt = fileCnt + 1 details["change"] = newestRevision # Use time from top-most change so that all git p4 clones of # the same p4 repo have the same commit SHA1s. res = p4_describe(newestRevision) details["time"] = res["time"] self.updateOptionDict(details) try: self.commit(details, self.extractFilesFromCommit(details), self.branch) except IOError: print("IO error with git fast-import. Is your git version recent enough?") print(self.gitError.read()) def run(self, args): self.depotPaths = [] self.changeRange = "" self.previousDepotPaths = [] self.hasOrigin = False # map from branch depot path to parent branch self.knownBranches = {} self.initialParents = {} if self.importIntoRemotes: self.refPrefix = "refs/remotes/p4/" else: self.refPrefix = "refs/heads/p4/" if self.syncWithOrigin: self.hasOrigin = originP4BranchesExist() if self.hasOrigin: if not self.silent: print('Syncing with origin first, using "git fetch origin"') system("git fetch origin") branch_arg_given = bool(self.branch) if len(self.branch) == 0: self.branch = self.refPrefix + "master" if gitBranchExists("refs/heads/p4") and self.importIntoRemotes: system("git update-ref %s refs/heads/p4" % self.branch) system("git branch -D p4") # accept either the command-line option, or the configuration variable if self.useClientSpec: # will use this after clone to set the variable self.useClientSpec_from_options = True else: if gitConfigBool("git-p4.useclientspec"): self.useClientSpec = True if self.useClientSpec: self.clientSpecDirs = getClientSpec() # TODO: should always look at previous commits, # merge with previous imports, if possible. if args == []: if self.hasOrigin: createOrUpdateBranchesFromOrigin(self.refPrefix, self.silent) # branches holds mapping from branch name to sha1 branches = p4BranchesInGit(self.importIntoRemotes) # restrict to just this one, disabling detect-branches if branch_arg_given: short = self.branch.split("/")[-1] if short in branches: self.p4BranchesInGit = [ short ] else: self.p4BranchesInGit = list(branches.keys()) if len(self.p4BranchesInGit) > 1: if not self.silent: print("Importing from/into multiple branches") self.detectBranches = True for branch in branches.keys(): self.initialParents[self.refPrefix + branch] = \ branches[branch] if self.verbose: print("branches: %s" % self.p4BranchesInGit) p4Change = 0 for branch in self.p4BranchesInGit: logMsg = extractLogMessageFromGitCommit(self.refPrefix + branch) settings = extractSettingsGitLog(logMsg) self.readOptions(settings) if ('depot-paths' in settings and 'change' in settings): change = int(settings['change']) + 1 p4Change = max(p4Change, change) depotPaths = sorted(settings['depot-paths']) if self.previousDepotPaths == []: self.previousDepotPaths = depotPaths else: paths = [] for (prev, cur) in zip(self.previousDepotPaths, depotPaths): prev_list = prev.split("/") cur_list = cur.split("/") for i in range(0, min(len(cur_list), len(prev_list))): if cur_list[i] != prev_list[i]: i = i - 1 break paths.append ("/".join(cur_list[:i + 1])) self.previousDepotPaths = paths if p4Change > 0: self.depotPaths = sorted(self.previousDepotPaths) self.changeRange = "@%s,#head" % p4Change if not self.silent and not self.detectBranches: print("Performing incremental import into %s git branch" % self.branch) # accept multiple ref name abbreviations: # refs/foo/bar/branch -> use it exactly # p4/branch -> prepend refs/remotes/ or refs/heads/ # branch -> prepend refs/remotes/p4/ or refs/heads/p4/ if not self.branch.startswith("refs/"): if self.importIntoRemotes: prepend = "refs/remotes/" else: prepend = "refs/heads/" if not self.branch.startswith("p4/"): prepend += "p4/" self.branch = prepend + self.branch if len(args) == 0 and self.depotPaths: if not self.silent: print("Depot paths: %s" % ' '.join(self.depotPaths)) else: if self.depotPaths and self.depotPaths != args: print ("previous import used depot path %s and now %s was specified. " "This doesn't work!" % (' '.join (self.depotPaths), ' '.join (args))) sys.exit(1) self.depotPaths = sorted(args) revision = "" self.users = {} # Make sure no revision specifiers are used when --changesfile # is specified. bad_changesfile = False if len(self.changesFile) > 0: for p in self.depotPaths: if p.find("@") >= 0 or p.find("#") >= 0: bad_changesfile = True break if bad_changesfile: die("Option --changesfile is incompatible with revision specifiers") newPaths = [] for p in self.depotPaths: if p.find("@") != -1: atIdx = p.index("@") self.changeRange = p[atIdx:] if self.changeRange == "@all": self.changeRange = "" elif ',' not in self.changeRange: revision = self.changeRange self.changeRange = "" p = p[:atIdx] elif p.find("#") != -1: hashIdx = p.index("#") revision = p[hashIdx:] p = p[:hashIdx] elif self.previousDepotPaths == []: # pay attention to changesfile, if given, else import # the entire p4 tree at the head revision if len(self.changesFile) == 0: revision = "#head" p = re.sub ("\.\.\.$", "", p) if not p.endswith("/"): p += "/" newPaths.append(p) self.depotPaths = newPaths # --detect-branches may change this for each branch self.branchPrefixes = self.depotPaths self.loadUserMapFromCache() self.labels = {} if self.detectLabels: self.getLabels(); if self.detectBranches: ## FIXME - what's a P4 projectName ? self.projectName = self.guessProjectName() if self.hasOrigin: self.getBranchMappingFromGitBranches() else: self.getBranchMapping() if self.verbose: print("p4-git branches: %s" % self.p4BranchesInGit) print("initial parents: %s" % self.initialParents) for b in self.p4BranchesInGit: if b != "master": ## FIXME b = b[len(self.projectName):] self.createdBranches.add(b) self.tz = "%+03d%02d" % (- time.timezone / 3600, ((- time.timezone % 3600) // 60)) self.importProcess = subprocess.Popen(["git", "fast-import"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE); self.gitOutput = self.importProcess.stdout self.gitStream = self.importProcess.stdin self.gitError = self.importProcess.stderr if revision: self.importHeadRevision(revision) else: changes = [] if len(self.changesFile) > 0: output = open(self.changesFile).readlines() changeSet = set() for line in output: changeSet.add(int(line)) for change in changeSet: changes.append(change) changes.sort() else: # catch "git p4 sync" with no new branches, in a repo that # does not have any existing p4 branches if len(args) == 0: if not self.p4BranchesInGit: die("No remote p4 branches. Perhaps you never did \"git p4 clone\" in here.") # The default branch is master, unless --branch is used to # specify something else. Make sure it exists, or complain # nicely about how to use --branch. if not self.detectBranches: if not branch_exists(self.branch): if branch_arg_given: die("Error: branch %s does not exist." % self.branch) else: die("Error: no branch %s; perhaps specify one with --branch." % self.branch) if self.verbose: print("Getting p4 changes for %s...%s" % (', '.join(self.depotPaths), self.changeRange)) changes = p4ChangesForPaths(self.depotPaths, self.changeRange) if len(self.maxChanges) > 0: changes = changes[:min(int(self.maxChanges), len(changes))] if len(changes) == 0: if not self.silent: print("No changes to import!") else: if not self.silent and not self.detectBranches: print("Import destination: %s" % self.branch) self.updatedBranches = set() if not self.detectBranches: if args: # start a new branch self.initialParent = "" else: # build on a previous revision self.initialParent = parseRevision(self.branch) self.importChanges(changes) if not self.silent: print("") if len(self.updatedBranches) > 0: sys.stdout.write("Updated branches: ") for b in self.updatedBranches: sys.stdout.write("%s " % b) sys.stdout.write("\n") if gitConfigBool("git-p4.importLabels"): self.importLabels = True if self.importLabels: p4Labels = getP4Labels(self.depotPaths) gitTags = getGitTags() missingP4Labels = p4Labels - gitTags self.importP4Labels(self.gitStream, missingP4Labels) self.gitStream.close() if self.importProcess.wait() != 0: die("fast-import failed: %s" % self.gitError.read()) self.gitOutput.close() self.gitError.close() # Cleanup temporary branches created during import if self.tempBranches != []: for branch in self.tempBranches: read_pipe("git update-ref -d %s" % branch) os.rmdir(os.path.join(os.environ.get("GIT_DIR", ".git"), self.tempBranchLocation)) # Create a symbolic ref p4/HEAD pointing to p4/<branch> to allow # a convenient shortcut refname "p4". if self.importIntoRemotes: head_ref = self.refPrefix + "HEAD" if not gitBranchExists(head_ref) and gitBranchExists(self.branch): system(["git", "symbolic-ref", head_ref, self.branch]) return True class P4Rebase(Command): def __init__(self): Command.__init__(self) self.options = [ optparse.make_option("--import-labels", dest="importLabels", action="store_true"), ] self.importLabels = False self.description = ("Fetches the latest revision from perforce and " + "rebases the current work (branch) against it") def run(self, args): sync = P4Sync() sync.importLabels = self.importLabels sync.run([]) return self.rebase() def rebase(self): if os.system("git update-index --refresh") != 0: die("Some files in your working directory are modified and different than what is in your index. You can use git update-index <filename> to bring the index up-to-date or stash away all your changes with git stash."); if len(read_pipe("git diff-index HEAD --")) > 0: die("You have uncommitted changes. Please commit them before rebasing or stash them away with git stash."); [upstream, settings] = findUpstreamBranchPoint() if len(upstream) == 0: die("Cannot find upstream branchpoint for rebase") # the branchpoint may be p4/foo~3, so strip off the parent upstream = re.sub("~[0-9]+$", "", upstream) print("Rebasing the current branch onto %s" % upstream) oldHead = read_pipe("git rev-parse HEAD").strip() system("git rebase %s" % upstream) system("git diff-tree --stat --summary -M %s HEAD" % oldHead) return True class P4Clone(P4Sync): def __init__(self): P4Sync.__init__(self) self.description = "Creates a new git repository and imports from Perforce into it" self.usage = "usage: %prog [options] //depot/path[@revRange]" self.options += [ optparse.make_option("--destination", dest="cloneDestination", action='store', default=None, help="where to leave result of the clone"), optparse.make_option("-/", dest="cloneExclude", action="append", type="string", help="exclude depot path"), optparse.make_option("--bare", dest="cloneBare", action="store_true", default=False), ] self.cloneDestination = None self.needsGit = False self.cloneBare = False # This is required for the "append" cloneExclude action def ensure_value(self, attr, value): if not hasattr(self, attr) or getattr(self, attr) is None: setattr(self, attr, value) return getattr(self, attr) def defaultDestination(self, args): ## TODO: use common prefix of args? depotPath = args[0] depotDir = re.sub("(@[^@]*)$", "", depotPath) depotDir = re.sub("(#[^#]*)$", "", depotDir) depotDir = re.sub(r"\.\.\.$", "", depotDir) depotDir = re.sub(r"/$", "", depotDir) return os.path.split(depotDir)[1] def run(self, args): if len(args) < 1: return False if self.keepRepoPath and not self.cloneDestination: sys.stderr.write("Must specify destination for --keep-path\n") sys.exit(1) depotPaths = args if not self.cloneDestination and len(depotPaths) > 1: self.cloneDestination = depotPaths[-1] depotPaths = depotPaths[:-1] self.cloneExclude = ["/"+p for p in self.cloneExclude] for p in depotPaths: if not p.startswith("//"): sys.stderr.write('Depot paths must start with "//": %s\n' % p) return False if not self.cloneDestination: self.cloneDestination = self.defaultDestination(args) print("Importing from %s into %s" % (', '.join(depotPaths), self.cloneDestination)) if not os.path.exists(self.cloneDestination): os.makedirs(self.cloneDestination) chdir(self.cloneDestination) init_cmd = [ "git", "init" ] if self.cloneBare: init_cmd.append("--bare") retcode = subprocess.call(init_cmd) if retcode: raise CalledProcessError(retcode, init_cmd) if not P4Sync.run(self, depotPaths): return False # create a master branch and check out a work tree if gitBranchExists(self.branch): system([ "git", "branch", "master", self.branch ]) if not self.cloneBare: system([ "git", "checkout", "-f" ]) else: print('Not checking out any branch, use ' \ '"git checkout -q -b master <branch>"') # auto-set this variable if invoked with --use-client-spec if self.useClientSpec_from_options: system("git config --bool git-p4.useclientspec true") return True class P4Branches(Command): def __init__(self): Command.__init__(self) self.options = [ ] self.description = ("Shows the git branches that hold imports and their " + "corresponding perforce depot paths") self.verbose = False def run(self, args): if originP4BranchesExist(): createOrUpdateBranchesFromOrigin() cmdline = "git rev-parse --symbolic " cmdline += " --remotes" for line in read_pipe_lines(cmdline): line = line.strip() if not line.startswith('p4/') or line == "p4/HEAD": continue branch = line log = extractLogMessageFromGitCommit("refs/remotes/%s" % branch) settings = extractSettingsGitLog(log) print("%s <= %s (%s)" % (branch, ",".join(settings["depot-paths"]), settings["change"])) return True class HelpFormatter(optparse.IndentedHelpFormatter): def __init__(self): optparse.IndentedHelpFormatter.__init__(self) def format_description(self, description): if description: return description + "\n" else: return "" def printUsage(commands): print("usage: %s <command> [options]" % sys.argv[0]) print("") print("valid commands: %s" % ", ".join(commands)) print("") print("Try %s <command> --help for command specific help." % sys.argv[0]) print("") commands = { "debug" : P4Debug, "submit" : P4Submit, "commit" : P4Submit, "sync" : P4Sync, "rebase" : P4Rebase, "clone" : P4Clone, "rollback" : P4RollBack, "branches" : P4Branches } def main(): if len(sys.argv[1:]) == 0: printUsage(list(commands.keys())) sys.exit(2) cmdName = sys.argv[1] try: klass = commands[cmdName] cmd = klass() except KeyError: print("unknown command %s" % cmdName) print("") printUsage(list(commands.keys())) sys.exit(2) options = cmd.options cmd.gitdir = os.environ.get("GIT_DIR", None) args = sys.argv[2:] options.append(optparse.make_option("--verbose", "-v", dest="verbose", action="store_true")) if cmd.needsGit: options.append(optparse.make_option("--git-dir", dest="gitdir")) parser = optparse.OptionParser(cmd.usage.replace("%prog", "%prog " + cmdName), options, description = cmd.description, formatter = HelpFormatter()) (cmd, args) = parser.parse_args(sys.argv[2:], cmd); global verbose verbose = cmd.verbose if cmd.needsGit: if cmd.gitdir == None: cmd.gitdir = os.path.abspath(".git") if not isValidGitDir(cmd.gitdir): cmd.gitdir = read_pipe("git rev-parse --git-dir").strip() if os.path.exists(cmd.gitdir): cdup = read_pipe("git rev-parse --show-cdup").strip() if len(cdup) > 0: chdir(cdup); if not isValidGitDir(cmd.gitdir): if isValidGitDir(cmd.gitdir + "/.git"): cmd.gitdir += "/.git" else: die("fatal: cannot locate git repository at %s" % cmd.gitdir) os.environ["GIT_DIR"] = cmd.gitdir if not cmd.run(args): parser.print_help() sys.exit(2) if __name__ == '__main__': main()
Juanvulcano/zulip
api/integrations/perforce/git_p4.py
Python
apache-2.0
121,430
# # Author:: Adam Jacob (<adam@chef.io>) # Copyright:: Copyright 2009-2016, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # require "chef/knife" class Chef class Knife class NodeEdit < Knife deps do require "chef/node" require "chef/json_compat" require "chef/knife/core/node_editor" end banner "knife node edit NODE (options)" option :all_attributes, :short => "-a", :long => "--all", :boolean => true, :description => "Display all attributes when editing" def run if node_name.nil? show_usage ui.fatal("You must specify a node name") exit 1 end updated_node = node_editor.edit_node if updated_values = node_editor.updated? ui.info "Saving updated #{updated_values.join(', ')} on node #{node.name}" updated_node.save else ui.info "Node not updated, skipping node save" end end def node_name @node_name ||= @name_args[0] end def node_editor @node_editor ||= Knife::NodeEditor.new(node, ui, config) end def node @node ||= Chef::Node.load(node_name) end end end end
aaron-lane/chef
lib/chef/knife/node_edit.rb
Ruby
apache-2.0
1,807
#!/bin/sh set -e # # This script is meant for quick & easy install via: # 'curl -sSL https://get.docker.com/ | sh' # or: # 'wget -qO- https://get.docker.com/ | sh' # # For test builds (ie. release candidates): # 'curl -fsSL https://test.docker.com/ | sh' # or: # 'wget -qO- https://test.docker.com/ | sh' # # For experimental builds: # 'curl -fsSL https://experimental.docker.com/ | sh' # or: # 'wget -qO- https://experimental.docker.com/ | sh' # # Docker Maintainers: # To update this script on https://get.docker.com, # use hack/release.sh during a normal release, # or the following one-liner for script hotfixes: # aws s3 cp --acl public-read hack/install.sh s3://get.docker.com/index # url="https://get.docker.com/" apt_url="https://apt.dockerproject.org" yum_url="https://yum.dockerproject.org" gpg_fingerprint="58118E89F3A912897C070ADBF76221572C52609D" key_servers=" ha.pool.sks-keyservers.net pgp.mit.edu keyserver.ubuntu.com " command_exists() { command -v "$@" > /dev/null 2>&1 } echo_docker_as_nonroot() { if command_exists docker && [ -e /var/run/docker.sock ]; then ( set -x $sh_c 'docker version' ) || true fi your_user=your-user [ "$user" != 'root' ] && your_user="$user" # intentionally mixed spaces and tabs here -- tabs are stripped by "<<-EOF", spaces are kept in the output cat <<-EOF If you would like to use Docker as a non-root user, you should now consider adding your user to the "docker" group with something like: sudo usermod -aG docker $your_user Remember that you will have to log out and back in for this to take effect! EOF } # Check if this is a forked Linux distro check_forked() { # Check for lsb_release command existence, it usually exists in forked distros if command_exists lsb_release; then # Check if the `-u` option is supported set +e lsb_release -a -u > /dev/null 2>&1 lsb_release_exit_code=$? set -e # Check if the command has exited successfully, it means we're in a forked distro if [ "$lsb_release_exit_code" = "0" ]; then # Print info about current distro cat <<-EOF You're using '$lsb_dist' version '$dist_version'. EOF # Get the upstream release info lsb_dist=$(lsb_release -a -u 2>&1 | tr '[:upper:]' '[:lower:]' | grep -E 'id' | cut -d ':' -f 2 | tr -d '[[:space:]]') dist_version=$(lsb_release -a -u 2>&1 | tr '[:upper:]' '[:lower:]' | grep -E 'codename' | cut -d ':' -f 2 | tr -d '[[:space:]]') # Print info about upstream distro cat <<-EOF Upstream release is '$lsb_dist' version '$dist_version'. EOF else if [ -r /etc/debian_version ] && [ "$lsb_dist" != "ubuntu" ]; then # We're Debian and don't even know it! lsb_dist=debian dist_version="$(cat /etc/debian_version | sed 's/\/.*//' | sed 's/\..*//')" case "$dist_version" in 8|'Kali Linux 2') dist_version="jessie" ;; 7) dist_version="wheezy" ;; esac fi fi fi } rpm_import_repository_key() { local key=$1; shift local tmpdir=$(mktemp -d) chmod 600 "$tmpdir" for key_server in $key_servers ; do gpg --homedir "$tmpdir" --keyserver "$key_server" --recv-keys "$key" && break done gpg --homedir "$tmpdir" -k "$key" >/dev/null gpg --homedir "$tmpdir" --export --armor "$key" > "$tmpdir"/repo.key rpm --import "$tmpdir"/repo.key rm -rf "$tmpdir" } semverParse() { major="${1%%.*}" minor="${1#$major.}" minor="${minor%%.*}" patch="${1#$major.$minor.}" patch="${patch%%[-.]*}" } do_install() { case "$(uname -m)" in *64) ;; *) cat >&2 <<-'EOF' Error: you are not using a 64bit platform. Docker currently only supports 64bit platforms. EOF exit 1 ;; esac if command_exists docker; then version="$(docker -v | awk -F '[ ,]+' '{ print $3 }')" MAJOR_W=1 MINOR_W=10 semverParse $version shouldWarn=0 if [ $major -lt $MAJOR_W ]; then shouldWarn=1 fi if [ $major -le $MAJOR_W ] && [ $minor -lt $MINOR_W ]; then shouldWarn=1 fi cat >&2 <<-'EOF' Warning: the "docker" command appears to already exist on this system. If you already have Docker installed, this script can cause trouble, which is why we're displaying this warning and provide the opportunity to cancel the installation. If you installed the current Docker package using this script and are using it EOF if [ $shouldWarn -eq 1 ]; then cat >&2 <<-'EOF' again to update Docker, we urge you to migrate your image store before upgrading to v1.10+. You can find instructions for this here: https://github.com/docker/docker/wiki/Engine-v1.10.0-content-addressability-migration EOF else cat >&2 <<-'EOF' again to update Docker, you can safely ignore this message. EOF fi cat >&2 <<-'EOF' You may press Ctrl+C now to abort this script. EOF ( set -x; sleep 20 ) fi user="$(id -un 2>/dev/null || true)" sh_c='sh -c' if [ "$user" != 'root' ]; then if command_exists sudo; then sh_c='sudo -E sh -c' elif command_exists su; then sh_c='su -c' else cat >&2 <<-'EOF' Error: this installer needs the ability to run commands as root. We are unable to find either "sudo" or "su" available to make this happen. EOF exit 1 fi fi curl='' if command_exists curl; then curl='curl -sSL' elif command_exists wget; then curl='wget -qO-' elif command_exists busybox && busybox --list-modules | grep -q wget; then curl='busybox wget -qO-' fi # check to see which repo they are trying to install from if [ -z "$repo" ]; then repo='main' if [ "https://test.docker.com/" = "$url" ]; then repo='testing' elif [ "https://experimental.docker.com/" = "$url" ]; then repo='experimental' fi fi # perform some very rudimentary platform detection lsb_dist='' dist_version='' if command_exists lsb_release; then lsb_dist="$(lsb_release -si)" fi if [ -z "$lsb_dist" ] && [ -r /etc/lsb-release ]; then lsb_dist="$(. /etc/lsb-release && echo "$DISTRIB_ID")" fi if [ -z "$lsb_dist" ] && [ -r /etc/debian_version ]; then lsb_dist='debian' fi if [ -z "$lsb_dist" ] && [ -r /etc/fedora-release ]; then lsb_dist='fedora' fi if [ -z "$lsb_dist" ] && [ -r /etc/oracle-release ]; then lsb_dist='oracleserver' fi if [ -z "$lsb_dist" ] && [ -r /etc/centos-release ]; then lsb_dist='centos' fi if [ -z "$lsb_dist" ] && [ -r /etc/redhat-release ]; then lsb_dist='redhat' fi if [ -z "$lsb_dist" ] && [ -r /etc/os-release ]; then lsb_dist="$(. /etc/os-release && echo "$ID")" fi lsb_dist="$(echo "$lsb_dist" | tr '[:upper:]' '[:lower:]')" # Special case redhatenterpriseserver if [ "${lsb_dist}" = "redhatenterpriseserver" ]; then # Set it to redhat, it will be changed to centos below anyways lsb_dist='redhat' fi case "$lsb_dist" in ubuntu) if command_exists lsb_release; then dist_version="$(lsb_release --codename | cut -f2)" fi if [ -z "$dist_version" ] && [ -r /etc/lsb-release ]; then dist_version="$(. /etc/lsb-release && echo "$DISTRIB_CODENAME")" fi ;; debian) dist_version="$(cat /etc/debian_version | sed 's/\/.*//' | sed 's/\..*//')" case "$dist_version" in 8) dist_version="jessie" ;; 7) dist_version="wheezy" ;; esac ;; oracleserver) # need to switch lsb_dist to match yum repo URL lsb_dist="oraclelinux" dist_version="$(rpm -q --whatprovides redhat-release --queryformat "%{VERSION}\n" | sed 's/\/.*//' | sed 's/\..*//' | sed 's/Server*//')" ;; fedora|centos|redhat) dist_version="$(rpm -q --whatprovides ${lsb_dist}-release --queryformat "%{VERSION}\n" | sed 's/\/.*//' | sed 's/\..*//' | sed 's/Server*//' | sort | tail -1)" ;; *) if command_exists lsb_release; then dist_version="$(lsb_release --codename | cut -f2)" fi if [ -z "$dist_version" ] && [ -r /etc/os-release ]; then dist_version="$(. /etc/os-release && echo "$VERSION_ID")" fi ;; esac # Check if this is a forked Linux distro check_forked # Run setup for each distro accordingly case "$lsb_dist" in amzn) ( set -x $sh_c 'sleep 3; yum -y -q install docker' ) echo_docker_as_nonroot exit 0 ;; 'opensuse project'|opensuse) echo 'Going to perform the following operations:' if [ "$repo" != 'main' ]; then echo ' * add repository obs://Virtualization:containers' fi echo ' * install Docker' $sh_c 'echo "Press CTRL-C to abort"; sleep 3' if [ "$repo" != 'main' ]; then # install experimental packages from OBS://Virtualization:containers ( set -x zypper -n ar -f obs://Virtualization:containers Virtualization:containers rpm_import_repository_key 55A0B34D49501BB7CA474F5AA193FBB572174FC2 ) fi ( set -x zypper -n install docker ) echo_docker_as_nonroot exit 0 ;; 'suse linux'|sle[sd]) echo 'Going to perform the following operations:' if [ "$repo" != 'main' ]; then echo ' * add repository obs://Virtualization:containers' echo ' * install experimental Docker using packages NOT supported by SUSE' else echo ' * add the "Containers" module' echo ' * install Docker using packages supported by SUSE' fi $sh_c 'echo "Press CTRL-C to abort"; sleep 3' if [ "$repo" != 'main' ]; then # install experimental packages from OBS://Virtualization:containers echo >&2 'Warning: installing experimental packages from OBS, these packages are NOT supported by SUSE' ( set -x zypper -n ar -f obs://Virtualization:containers/SLE_12 Virtualization:containers rpm_import_repository_key 55A0B34D49501BB7CA474F5AA193FBB572174FC2 ) else # Add the containers module # Note well-1: the SLE machine must already be registered against SUSE Customer Center # Note well-2: the `-r ""` is required to workaround a known issue of SUSEConnect ( set -x SUSEConnect -p sle-module-containers/12/x86_64 -r "" ) fi ( set -x zypper -n install docker ) echo_docker_as_nonroot exit 0 ;; ubuntu|debian) export DEBIAN_FRONTEND=noninteractive did_apt_get_update= apt_get_update() { if [ -z "$did_apt_get_update" ]; then ( set -x; $sh_c 'sleep 3; apt-get update' ) did_apt_get_update=1 fi } # aufs is preferred over devicemapper; try to ensure the driver is available. if ! grep -q aufs /proc/filesystems && ! $sh_c 'modprobe aufs'; then if uname -r | grep -q -- '-generic' && dpkg -l 'linux-image-*-generic' | grep -qE '^ii|^hi' 2>/dev/null; then kern_extras="linux-image-extra-$(uname -r) linux-image-extra-virtual" apt_get_update ( set -x; $sh_c 'sleep 3; apt-get install -y -q '"$kern_extras" ) || true if ! grep -q aufs /proc/filesystems && ! $sh_c 'modprobe aufs'; then echo >&2 'Warning: tried to install '"$kern_extras"' (for AUFS)' echo >&2 ' but we still have no AUFS. Docker may not work. Proceeding anyways!' ( set -x; sleep 10 ) fi else echo >&2 'Warning: current kernel is not supported by the linux-image-extra-virtual' echo >&2 ' package. We have no AUFS support. Consider installing the packages' echo >&2 ' linux-image-virtual kernel and linux-image-extra-virtual for AUFS support.' ( set -x; sleep 10 ) fi fi # install apparmor utils if they're missing and apparmor is enabled in the kernel # otherwise Docker will fail to start if [ "$(cat /sys/module/apparmor/parameters/enabled 2>/dev/null)" = 'Y' ]; then if command -v apparmor_parser >/dev/null 2>&1; then echo 'apparmor is enabled in the kernel and apparmor utils were already installed' else echo 'apparmor is enabled in the kernel, but apparmor_parser missing' apt_get_update ( set -x; $sh_c 'sleep 3; apt-get install -y -q apparmor' ) fi fi if [ ! -e /usr/lib/apt/methods/https ]; then apt_get_update ( set -x; $sh_c 'sleep 3; apt-get install -y -q apt-transport-https ca-certificates' ) fi if [ -z "$curl" ]; then apt_get_update ( set -x; $sh_c 'sleep 3; apt-get install -y -q curl ca-certificates' ) curl='curl -sSL' fi ( set -x for key_server in $key_servers ; do $sh_c "apt-key adv --keyserver hkp://${key_server}:80 --recv-keys ${gpg_fingerprint}" && break done $sh_c "apt-key adv -k ${gpg_fingerprint} >/dev/null" $sh_c "mkdir -p /etc/apt/sources.list.d" $sh_c "echo deb \[arch=$(dpkg --print-architecture)\] ${apt_url}/repo ${lsb_dist}-${dist_version} ${repo} > /etc/apt/sources.list.d/docker.list" $sh_c 'sleep 3; apt-get update; apt-get install -y -q docker-engine' ) echo_docker_as_nonroot exit 0 ;; fedora|centos|redhat|oraclelinux) if [ "${lsb_dist}" = "redhat" ]; then # we use the centos repository for both redhat and centos releases lsb_dist='centos' fi $sh_c "cat >/etc/yum.repos.d/docker-${repo}.repo" <<-EOF [docker-${repo}-repo] name=Docker ${repo} Repository baseurl=${yum_url}/repo/${repo}/${lsb_dist}/${dist_version} enabled=1 gpgcheck=1 gpgkey=${yum_url}/gpg EOF if [ "$lsb_dist" = "fedora" ] && [ "$dist_version" -ge "22" ]; then ( set -x $sh_c 'sleep 3; dnf -y -q install docker-engine' ) else ( set -x $sh_c 'sleep 3; yum -y -q install docker-engine' ) fi echo_docker_as_nonroot exit 0 ;; gentoo) if [ "$url" = "https://test.docker.com/" ]; then # intentionally mixed spaces and tabs here -- tabs are stripped by "<<-'EOF'", spaces are kept in the output cat >&2 <<-'EOF' You appear to be trying to install the latest nightly build in Gentoo.' The portage tree should contain the latest stable release of Docker, but' if you want something more recent, you can always use the live ebuild' provided in the "docker" overlay available via layman. For more' instructions, please see the following URL:' https://github.com/tianon/docker-overlay#using-this-overlay' After adding the "docker" overlay, you should be able to:' emerge -av =app-emulation/docker-9999' EOF exit 1 fi ( set -x $sh_c 'sleep 3; emerge app-emulation/docker' ) exit 0 ;; esac # intentionally mixed spaces and tabs here -- tabs are stripped by "<<-'EOF'", spaces are kept in the output cat >&2 <<-'EOF' Either your platform is not easily detectable, is not supported by this installer script (yet - PRs welcome! [hack/install.sh]), or does not yet have a package for Docker. Please visit the following URL for more detailed installation instructions: https://docs.docker.com/engine/installation/ EOF exit 1 } # wrapped up in a function so that we have some protection against only getting # half the file during "curl | sh" do_install
aweiteka/cri-o
vendor/github.com/containers/storage/hack/install.sh
Shell
apache-2.0
14,802
/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // This file was automatically generated by informer-gen package v1 import ( rbac_v1 "k8s.io/api/rbac/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/rbac/v1" cache "k8s.io/client-go/tools/cache" time "time" ) // ClusterRoleInformer provides access to a shared informer and lister for // ClusterRoles. type ClusterRoleInformer interface { Informer() cache.SharedIndexInformer Lister() v1.ClusterRoleLister } type clusterRoleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewClusterRoleInformer constructs a new informer for ClusterRole type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredClusterRoleInformer(client, resyncPeriod, indexers, nil) } // NewFilteredClusterRoleInformer constructs a new informer for ClusterRole type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1().ClusterRoles().List(options) }, WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1().ClusterRoles().Watch(options) }, }, &rbac_v1.ClusterRole{}, resyncPeriod, indexers, ) } func (f *clusterRoleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredClusterRoleInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *clusterRoleInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&rbac_v1.ClusterRole{}, f.defaultInformer) } func (f *clusterRoleInformer) Lister() v1.ClusterRoleLister { return v1.NewClusterRoleLister(f.Informer().GetIndexer()) }
radanalyticsio/oshinko-cli
vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go
GO
apache-2.0
3,396
/************************************************************* * * MathJax/jax/output/HTML-CSS/fonts/TeX/Greek/Italic/Main.js * * Copyright (c) 2009-2013 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ MathJax.OutputJax['HTML-CSS'].FONTDATA.FONTS['MathJax_Greek-italic'] = { directory: 'Greek/Italic', family: 'MathJax_Greek', style: 'italic', testString: "\u0393 \u03A5 \u039B", skew: { 0x393: 0.0833, 0x394: 0.167, 0x398: 0.0833, 0x39B: 0.167, 0x39E: 0.0833, 0x3A0: 0.0556, 0x3A3: 0.0833, 0x3A5: 0.0556, 0x3A6: 0.0833, 0x3A8: 0.0556, 0x3A9: 0.0833, 0x3B1: 0.0278, 0x3B2: 0.0833, 0x3B4: 0.0556, 0x3B5: 0.0833, 0x3B6: 0.0833, 0x3B7: 0.0556, 0x3B8: 0.0833, 0x3B9: 0.0556, 0x3BC: 0.0278, 0x3BD: 0.0278, 0x3BE: 0.111, 0x3BF: 0.0556, 0x3C1: 0.0833, 0x3C2: 0.0833, 0x3C4: 0.0278, 0x3C5: 0.0278, 0x3C6: 0.0833, 0x3C7: 0.0556, 0x3C8: 0.111, 0x3D1: 0.0833, 0x3D5: 0.0833, 0x3F1: 0.0833, 0x3F5: 0.0556 }, 0x20: [0,0,250,0,0], // SPACE 0xA0: [0,0,250,0,0], // NO-BREAK SPACE 0x393: [680,-1,615,31,721], // GREEK CAPITAL LETTER GAMMA 0x394: [716,0,833,48,788], // GREEK CAPITAL LETTER DELTA 0x398: [704,22,763,50,740], // GREEK CAPITAL LETTER THETA 0x39B: [716,0,694,35,670], // GREEK CAPITAL LETTER LAMDA 0x39E: [678,0,742,53,777], // GREEK CAPITAL LETTER XI 0x3A0: [681,0,831,31,887], // GREEK CAPITAL LETTER PI 0x3A3: [683,0,780,58,806], // GREEK CAPITAL LETTER SIGMA 0x3A5: [705,0,583,28,700], // GREEK CAPITAL LETTER UPSILON 0x3A6: [683,0,667,24,642], // GREEK CAPITAL LETTER PHI 0x3A8: [683,0,612,21,692], // GREEK CAPITAL LETTER PSI 0x3A9: [704,0,772,80,786], // GREEK CAPITAL LETTER OMEGA 0x3B1: [442,11,640,34,603], // GREEK SMALL LETTER ALPHA 0x3B2: [705,194,566,23,573], // GREEK SMALL LETTER BETA 0x3B3: [441,216,518,11,543], // GREEK SMALL LETTER GAMMA 0x3B4: [717,10,444,36,451], // GREEK SMALL LETTER DELTA 0x3B5: [452,22,466,27,428], // GREEK SMALL LETTER EPSILON 0x3B6: [704,204,438,44,471], // GREEK SMALL LETTER ZETA 0x3B7: [442,216,497,21,503], // GREEK SMALL LETTER ETA 0x3B8: [705,10,469,35,462], // GREEK SMALL LETTER THETA 0x3B9: [442,10,354,48,332], // GREEK SMALL LETTER IOTA 0x3BA: [442,11,576,49,554], // GREEK SMALL LETTER KAPPA 0x3BB: [694,12,583,47,556], // GREEK SMALL LETTER LAMDA 0x3BC: [442,216,603,23,580], // GREEK SMALL LETTER MU 0x3BD: [442,2,494,45,530], // GREEK SMALL LETTER NU 0x3BE: [704,205,438,21,443], // GREEK SMALL LETTER XI 0x3BF: [441,11,485,34,476], // GREEK SMALL LETTER OMICRON 0x3C0: [431,11,570,19,573], // GREEK SMALL LETTER PI 0x3C1: [442,216,517,23,510], // GREEK SMALL LETTER RHO 0x3C2: [442,107,363,31,405], // GREEK SMALL LETTER FINAL SIGMA 0x3C3: [431,11,571,31,572], // GREEK SMALL LETTER SIGMA 0x3C4: [431,13,437,18,517], // GREEK SMALL LETTER TAU 0x3C5: [443,10,540,21,523], // GREEK SMALL LETTER UPSILON 0x3C6: [442,218,654,50,618], // GREEK SMALL LETTER PHI 0x3C7: [442,204,626,25,600], // GREEK SMALL LETTER CHI 0x3C8: [694,205,651,21,634], // GREEK SMALL LETTER PSI 0x3C9: [443,11,622,15,604], // GREEK SMALL LETTER OMEGA 0x3D1: [705,11,591,21,563], // GREEK THETA SYMBOL 0x3D5: [694,205,596,43,579], // GREEK PHI SYMBOL 0x3D6: [431,10,828,19,823], // GREEK PI SYMBOL 0x3F1: [442,194,517,67,510], // GREEK RHO SYMBOL 0x3F5: [431,11,406,40,382] // GREEK LUNATE EPSILON SYMBOL }; MathJax.Callback.Queue( ["initFont",MathJax.OutputJax["HTML-CSS"],"MathJax_Greek-italic"], ["loadComplete",MathJax.Ajax,MathJax.OutputJax["HTML-CSS"].fontDir+"/Greek/Italic/Main.js"] );
segmentio/MathJax
unpacked/jax/output/HTML-CSS/fonts/TeX/Greek/Italic/Main.js
JavaScript
apache-2.0
4,530
/* * Copyright 2015 The SageTV Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package sage.locator; public class MediaInfo { public MediaInfo() {} public int mediaType; public long size; public String relativePath; public java.io.File localPath; public int downloadID; public sage.MediaFile getMediaFile() { if (localPath != null && localPath.length() > 0) { return sage.Wizard.getInstance().getFileForFilePath(localPath); } return null; } public String toString() { return "MediaInfo[type=" + mediaType + " size=" + size + " id=" + downloadID + " path=" + relativePath + "]"; } }
webernissle/sagetv
java/sage/locator/MediaInfo.java
Java
apache-2.0
1,176
// Code generated by protoc-gen-gogo. // source: kv.proto // DO NOT EDIT! /* Package storagepb is a generated protocol buffer package. It is generated from these files: kv.proto It has these top-level messages: KeyValue Event */ package storagepb import ( "fmt" proto "github.com/gogo/protobuf/proto" ) import math "math" import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf type Event_EventType int32 const ( PUT Event_EventType = 0 DELETE Event_EventType = 1 EXPIRE Event_EventType = 2 ) var Event_EventType_name = map[int32]string{ 0: "PUT", 1: "DELETE", 2: "EXPIRE", } var Event_EventType_value = map[string]int32{ "PUT": 0, "DELETE": 1, "EXPIRE": 2, } func (x Event_EventType) String() string { return proto.EnumName(Event_EventType_name, int32(x)) } type KeyValue struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` CreateRevision int64 `protobuf:"varint,2,opt,name=create_revision,proto3" json:"create_revision,omitempty"` // mod_revision is the last modified revision of the key. ModRevision int64 `protobuf:"varint,3,opt,name=mod_revision,proto3" json:"mod_revision,omitempty"` // version is the version of the key. A deletion resets // the version to zero and any modification of the key // increases its version. Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"` Value []byte `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` } func (m *KeyValue) Reset() { *m = KeyValue{} } func (m *KeyValue) String() string { return proto.CompactTextString(m) } func (*KeyValue) ProtoMessage() {} type Event struct { Type Event_EventType `protobuf:"varint,1,opt,name=type,proto3,enum=storagepb.Event_EventType" json:"type,omitempty"` // a put event contains the current key-value // a delete/expire event contains the previous // key-value Kv *KeyValue `protobuf:"bytes,2,opt,name=kv" json:"kv,omitempty"` } func (m *Event) Reset() { *m = Event{} } func (m *Event) String() string { return proto.CompactTextString(m) } func (*Event) ProtoMessage() {} func init() { proto.RegisterType((*KeyValue)(nil), "storagepb.KeyValue") proto.RegisterType((*Event)(nil), "storagepb.Event") proto.RegisterEnum("storagepb.Event_EventType", Event_EventType_name, Event_EventType_value) } func (m *KeyValue) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) if err != nil { return nil, err } return data[:n], nil } func (m *KeyValue) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l if m.Key != nil { if len(m.Key) > 0 { data[i] = 0xa i++ i = encodeVarintKv(data, i, uint64(len(m.Key))) i += copy(data[i:], m.Key) } } if m.CreateRevision != 0 { data[i] = 0x10 i++ i = encodeVarintKv(data, i, uint64(m.CreateRevision)) } if m.ModRevision != 0 { data[i] = 0x18 i++ i = encodeVarintKv(data, i, uint64(m.ModRevision)) } if m.Version != 0 { data[i] = 0x20 i++ i = encodeVarintKv(data, i, uint64(m.Version)) } if m.Value != nil { if len(m.Value) > 0 { data[i] = 0x2a i++ i = encodeVarintKv(data, i, uint64(len(m.Value))) i += copy(data[i:], m.Value) } } return i, nil } func (m *Event) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) if err != nil { return nil, err } return data[:n], nil } func (m *Event) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l if m.Type != 0 { data[i] = 0x8 i++ i = encodeVarintKv(data, i, uint64(m.Type)) } if m.Kv != nil { data[i] = 0x12 i++ i = encodeVarintKv(data, i, uint64(m.Kv.Size())) n1, err := m.Kv.MarshalTo(data[i:]) if err != nil { return 0, err } i += n1 } return i, nil } func encodeFixed64Kv(data []byte, offset int, v uint64) int { data[offset] = uint8(v) data[offset+1] = uint8(v >> 8) data[offset+2] = uint8(v >> 16) data[offset+3] = uint8(v >> 24) data[offset+4] = uint8(v >> 32) data[offset+5] = uint8(v >> 40) data[offset+6] = uint8(v >> 48) data[offset+7] = uint8(v >> 56) return offset + 8 } func encodeFixed32Kv(data []byte, offset int, v uint32) int { data[offset] = uint8(v) data[offset+1] = uint8(v >> 8) data[offset+2] = uint8(v >> 16) data[offset+3] = uint8(v >> 24) return offset + 4 } func encodeVarintKv(data []byte, offset int, v uint64) int { for v >= 1<<7 { data[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } data[offset] = uint8(v) return offset + 1 } func (m *KeyValue) Size() (n int) { var l int _ = l if m.Key != nil { l = len(m.Key) if l > 0 { n += 1 + l + sovKv(uint64(l)) } } if m.CreateRevision != 0 { n += 1 + sovKv(uint64(m.CreateRevision)) } if m.ModRevision != 0 { n += 1 + sovKv(uint64(m.ModRevision)) } if m.Version != 0 { n += 1 + sovKv(uint64(m.Version)) } if m.Value != nil { l = len(m.Value) if l > 0 { n += 1 + l + sovKv(uint64(l)) } } return n } func (m *Event) Size() (n int) { var l int _ = l if m.Type != 0 { n += 1 + sovKv(uint64(m.Type)) } if m.Kv != nil { l = m.Kv.Size() n += 1 + l + sovKv(uint64(l)) } return n } func sovKv(x uint64) (n int) { for { n++ x >>= 7 if x == 0 { break } } return n } func sozKv(x uint64) (n int) { return sovKv(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *KeyValue) Unmarshal(data []byte) error { l := len(data) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := data[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: KeyValue: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: KeyValue: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := data[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthKv } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Key = append(m.Key[:0], data[iNdEx:postIndex]...) if m.Key == nil { m.Key = []byte{} } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CreateRevision", wireType) } m.CreateRevision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := data[iNdEx] iNdEx++ m.CreateRevision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ModRevision", wireType) } m.ModRevision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := data[iNdEx] iNdEx++ m.ModRevision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } m.Version = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := data[iNdEx] iNdEx++ m.Version |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := data[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthKv } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Value = append(m.Value[:0], data[iNdEx:postIndex]...) if m.Value == nil { m.Value = []byte{} } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipKv(data[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthKv } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Event) Unmarshal(data []byte) error { l := len(data) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := data[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Event: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } m.Type = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := data[iNdEx] iNdEx++ m.Type |= (Event_EventType(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Kv", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := data[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthKv } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Kv == nil { m.Kv = &KeyValue{} } if err := m.Kv.Unmarshal(data[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipKv(data[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthKv } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipKv(data []byte) (n int, err error) { l := len(data) iNdEx := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowKv } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := data[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowKv } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if data[iNdEx-1] < 0x80 { break } } return iNdEx, nil case 1: iNdEx += 8 return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowKv } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := data[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } iNdEx += length if length < 0 { return 0, ErrInvalidLengthKv } return iNdEx, nil case 3: for { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowKv } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := data[iNdEx] iNdEx++ innerWire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } innerWireType := int(innerWire & 0x7) if innerWireType == 4 { break } next, err := skipKv(data[start:]) if err != nil { return 0, err } iNdEx = start + next } return iNdEx, nil case 4: return iNdEx, nil case 5: iNdEx += 4 return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } } panic("unreachable") } var ( ErrInvalidLengthKv = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowKv = fmt.Errorf("proto: integer overflow") )
hurf/kubernetes
Godeps/_workspace/src/github.com/coreos/etcd/storage/storagepb/kv.pb.go
GO
apache-2.0
13,202
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <title>RemoteLocationContext</title> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="RemoteLocationContext"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/openqa/selenium/remote/html5/RemoteLocalStorage.html" title="class in org.openqa.selenium.remote.html5"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../org/openqa/selenium/remote/html5/RemoteSessionStorage.html" title="class in org.openqa.selenium.remote.html5"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/openqa/selenium/remote/html5/RemoteLocationContext.html" target="_top">Frames</a></li> <li><a href="RemoteLocationContext.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.openqa.selenium.remote.html5</div> <h2 title="Class RemoteLocationContext" class="title">Class RemoteLocationContext</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>org.openqa.selenium.remote.html5.RemoteLocationContext</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd><a href="../../../../../org/openqa/selenium/html5/LocationContext.html" title="interface in org.openqa.selenium.html5">LocationContext</a></dd> </dl> <hr> <br> <pre>public class <span class="strong">RemoteLocationContext</span> extends java.lang.Object implements <a href="../../../../../org/openqa/selenium/html5/LocationContext.html" title="interface in org.openqa.selenium.html5">LocationContext</a></pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../../org/openqa/selenium/remote/html5/RemoteLocationContext.html#RemoteLocationContext(org.openqa.selenium.remote.ExecuteMethod)">RemoteLocationContext</a></strong>(<a href="../../../../../org/openqa/selenium/remote/ExecuteMethod.html" title="interface in org.openqa.selenium.remote">ExecuteMethod</a>&nbsp;executeMethod)</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/openqa/selenium/html5/Location.html" title="class in org.openqa.selenium.html5">Location</a></code></td> <td class="colLast"><code><strong><a href="../../../../../org/openqa/selenium/remote/html5/RemoteLocationContext.html#location()">location</a></strong>()</code> <div class="block">Gets the physical location of the browser.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../../org/openqa/selenium/remote/html5/RemoteLocationContext.html#setLocation(org.openqa.selenium.html5.Location)">setLocation</a></strong>(<a href="../../../../../org/openqa/selenium/html5/Location.html" title="class in org.openqa.selenium.html5">Location</a>&nbsp;location)</code> <div class="block">Sets the physical location.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="RemoteLocationContext(org.openqa.selenium.remote.ExecuteMethod)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>RemoteLocationContext</h4> <pre>public&nbsp;RemoteLocationContext(<a href="../../../../../org/openqa/selenium/remote/ExecuteMethod.html" title="interface in org.openqa.selenium.remote">ExecuteMethod</a>&nbsp;executeMethod)</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="location()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>location</h4> <pre>public&nbsp;<a href="../../../../../org/openqa/selenium/html5/Location.html" title="class in org.openqa.selenium.html5">Location</a>&nbsp;location()</pre> <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../../../../org/openqa/selenium/html5/LocationContext.html#location()">LocationContext</a></code></strong></div> <div class="block">Gets the physical location of the browser.</div> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../../org/openqa/selenium/html5/LocationContext.html#location()">location</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/openqa/selenium/html5/LocationContext.html" title="interface in org.openqa.selenium.html5">LocationContext</a></code></dd> <dt><span class="strong">Returns:</span></dt><dd>A <a href="../../../../../org/openqa/selenium/html5/Location.html" title="class in org.openqa.selenium.html5"><code>Location</code></a> containing the location information. Returns null if the location is not available</dd></dl> </li> </ul> <a name="setLocation(org.openqa.selenium.html5.Location)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>setLocation</h4> <pre>public&nbsp;void&nbsp;setLocation(<a href="../../../../../org/openqa/selenium/html5/Location.html" title="class in org.openqa.selenium.html5">Location</a>&nbsp;location)</pre> <div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../../../../org/openqa/selenium/html5/LocationContext.html#setLocation(org.openqa.selenium.html5.Location)">LocationContext</a></code></strong></div> <div class="block">Sets the physical location.</div> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../../org/openqa/selenium/html5/LocationContext.html#setLocation(org.openqa.selenium.html5.Location)">setLocation</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/openqa/selenium/html5/LocationContext.html" title="interface in org.openqa.selenium.html5">LocationContext</a></code></dd> <dt><span class="strong">Parameters:</span></dt><dd><code>location</code> - A <a href="../../../../../org/openqa/selenium/html5/Location.html" title="class in org.openqa.selenium.html5"><code>Location</code></a> containing the new location information</dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/openqa/selenium/remote/html5/RemoteLocalStorage.html" title="class in org.openqa.selenium.remote.html5"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../org/openqa/selenium/remote/html5/RemoteSessionStorage.html" title="class in org.openqa.selenium.remote.html5"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/openqa/selenium/remote/html5/RemoteLocationContext.html" target="_top">Frames</a></li> <li><a href="RemoteLocationContext.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
pilwon/selenium-webdriver
docs/api/java/org/openqa/selenium/remote/html5/RemoteLocationContext.html
HTML
apache-2.0
11,970
dojo.provide("dijit.form.NumberTextBox"); dojo.require("dijit.form.ValidationTextBox"); dojo.require("dojo.number"); /*===== dojo.declare( "dijit.form.NumberTextBox.__Constraints", [dijit.form.RangeBoundTextBox.__Constraints, dojo.number.__FormatOptions, dojo.number.__ParseOptions], { // summary: // Specifies both the rules on valid/invalid values (minimum, maximum, // number of required decimal places), and also formatting options for // displaying the value when the field is not focused. // example: // Minimum/maximum: // To specify a field between 0 and 120: // | {min:0,max:120} // To specify a field that must be an integer: // | {fractional:false} // To specify a field where 0 to 3 decimal places are allowed on input, // but after the field is blurred the value is displayed with 3 decimal places: // | {places:'0,3'} }); =====*/ dojo.declare("dijit.form.NumberTextBoxMixin", null, { // summary: // A mixin for all number textboxes // tags: // protected // Override ValidationTextBox.regExpGen().... we use a reg-ex generating function rather // than a straight regexp to deal with locale (plus formatting options too?) regExpGen: dojo.number.regexp, /*===== // constraints: dijit.form.NumberTextBox.__Constraints // Despite the name, this parameter specifies both constraints on the input // (including minimum/maximum allowed values) as well as // formatting options like places (the number of digits to display after // the decimal point). See `dijit.form.NumberTextBox.__Constraints` for details. constraints: {}, ======*/ // value: Number // The value of this NumberTextBox as a Javascript Number (i.e., not a String). // If the displayed value is blank, the value is NaN, and if the user types in // an gibberish value (like "hello world"), the value is undefined // (i.e. attr('value') returns undefined). // // Symmetrically, attr('value', NaN) will clear the displayed value, // whereas attr('value', undefined) will have no effect. value: NaN, // editOptions: [protected] Object // Properties to mix into constraints when the value is being edited. // This is here because we edit the number in the format "12345", which is // different than the display value (ex: "12,345") editOptions: { pattern: '#.######' }, /*===== _formatter: function(value, options){ // summary: // _formatter() is called by format(). It's the base routine for formatting a number, // as a string, for example converting 12345 into "12,345". // value: Number // The number to be converted into a string. // options: dojo.number.__FormatOptions? // Formatting options // tags: // protected extension return "12345"; // String }, =====*/ _formatter: dojo.number.format, _setConstraintsAttr: function(/* Object */ constraints){ var places = typeof constraints.places == "number"? constraints.places : 0; if(places){ places++; } // decimal rounding errors take away another digit of precision if(typeof constraints.max != "number"){ constraints.max = 9 * Math.pow(10, 15-places); } if(typeof constraints.min != "number"){ constraints.min = -9 * Math.pow(10, 15-places); } this.inherited(arguments, [ constraints ]); if(this.focusNode && this.focusNode.value && !isNaN(this.value)){ this.set('value', this.value); } }, _onFocus: function(){ if(this.disabled){ return; } var val = this.get('value'); if(typeof val == "number" && !isNaN(val)){ var formattedValue = this.format(val, this.constraints); if(formattedValue !== undefined){ this.textbox.value = formattedValue; } } this.inherited(arguments); }, format: function(/*Number*/ value, /*dojo.number.__FormatOptions*/ constraints){ // summary: // Formats the value as a Number, according to constraints. // tags: // protected var formattedValue = String(value); if(typeof value != "number"){ return formattedValue; } if(isNaN(value)){ return ""; } // check for exponential notation that dojo.number.format chokes on if(!("rangeCheck" in this && this.rangeCheck(value, constraints)) && constraints.exponent !== false && /\de[-+]?\d/i.test(formattedValue)){ return formattedValue; } if(this.editOptions && this._focused){ constraints = dojo.mixin({}, constraints, this.editOptions); } return this._formatter(value, constraints); }, /*===== parse: function(value, constraints){ // summary: // Parses the string value as a Number, according to constraints. // value: String // String representing a number // constraints: dojo.number.__ParseOptions // Formatting options // tags: // protected return 123.45; // Number }, =====*/ parse: dojo.number.parse, _getDisplayedValueAttr: function(){ var v = this.inherited(arguments); return isNaN(v) ? this.textbox.value : v; }, filter: function(/*Number*/ value){ // summary: // This is called with both the display value (string), and the actual value (a number). // When called with the actual value it does corrections so that '' etc. are represented as NaN. // Otherwise it dispatches to the superclass's filter() method. // // See `dijit.form.TextBox.filter` for more details. return (value === null || value === '' || value === undefined) ? NaN : this.inherited(arguments); // attr('value', null||''||undefined) should fire onChange(NaN) }, serialize: function(/*Number*/ value, /*Object?*/options){ // summary: // Convert value (a Number) into a canonical string (ie, how the number literal is written in javascript/java/C/etc.) // tags: // protected return (typeof value != "number" || isNaN(value)) ? '' : this.inherited(arguments); }, _setValueAttr: function(/*Number*/ value, /*Boolean?*/ priorityChange, /*String?*/formattedValue){ // summary: // Hook so attr('value', ...) works. if(value !== undefined && formattedValue === undefined){ formattedValue = String(value); if(typeof value == "number"){ if(isNaN(value)){ formattedValue = '' } // check for exponential notation that dojo.number.format chokes on else if(("rangeCheck" in this && this.rangeCheck(value, this.constraints)) || this.constraints.exponent === false || !/\de[-+]?\d/i.test(formattedValue)){ formattedValue = undefined; // lets format comnpute a real string value } }else if(!value){ // 0 processed in if branch above, ''|null|undefined flow thru here formattedValue = ''; value = NaN; }else{ // non-numeric values value = undefined; } } this.inherited(arguments, [value, priorityChange, formattedValue]); }, _getValueAttr: function(){ // summary: // Hook so attr('value') works. // Returns Number, NaN for '', or undefined for unparsable text var v = this.inherited(arguments); // returns Number for all values accepted by parse() or NaN for all other displayed values // If the displayed value of the textbox is gibberish (ex: "hello world"), this.inherited() above // returns NaN; this if() branch converts the return value to undefined. // Returning undefined prevents user text from being overwritten when doing _setValueAttr(_getValueAttr()). // A blank displayed value is still returned as NaN. if(isNaN(v) && this.textbox.value !== ''){ if(this.constraints.exponent !== false && /\de[-+]?\d/i.test(this.textbox.value) && (new RegExp("^"+dojo.number._realNumberRegexp(dojo.mixin({}, this.constraints))+"$").test(this.textbox.value))){ // check for exponential notation that parse() rejected (erroneously?) var n = Number(this.textbox.value); return isNaN(n) ? undefined : n; // return exponential Number or undefined for random text (may not be possible to do with the above RegExp check) }else{ return undefined; // gibberish } }else{ return v; // Number or NaN for '' } }, isValid: function(/*Boolean*/ isFocused){ // Overrides dijit.form.RangeBoundTextBox.isValid to check that the editing-mode value is valid since // it may not be formatted according to the regExp vaidation rules if(!this._focused || this._isEmpty(this.textbox.value)){ return this.inherited(arguments); }else{ var v = this.get('value'); if(!isNaN(v) && this.rangeCheck(v, this.constraints)){ if(this.constraints.exponent !== false && /\de[-+]?\d/i.test(this.textbox.value)){ // exponential, parse doesn't like it return true; // valid exponential number in range }else{ return this.inherited(arguments); } }else{ return false; } } } } ); dojo.declare("dijit.form.NumberTextBox", [dijit.form.RangeBoundTextBox,dijit.form.NumberTextBoxMixin], { // summary: // A TextBox for entering numbers, with formatting and range checking // description: // NumberTextBox is a textbox for entering and displaying numbers, supporting // the following main features: // // 1. Enforce minimum/maximum allowed values (as well as enforcing that the user types // a number rather than a random string) // 2. NLS support (altering roles of comma and dot as "thousands-separator" and "decimal-point" // depending on locale). // 3. Separate modes for editing the value and displaying it, specifically that // the thousands separator character (typically comma) disappears when editing // but reappears after the field is blurred. // 4. Formatting and constraints regarding the number of places (digits after the decimal point) // allowed on input, and number of places displayed when blurred (see `constraints` parameter). } );
dotunolafunmiloye/owf-framework
web-app/js-lib/dojo-release-1.5.0-src/dijit/form/NumberTextBox.js
JavaScript
apache-2.0
9,746
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.camel.component.docker.headers; import java.util.Map; import com.github.dockerjava.api.command.StartContainerCmd; import com.github.dockerjava.api.model.Bind; import com.github.dockerjava.api.model.Capability; import com.github.dockerjava.api.model.Device; import com.github.dockerjava.api.model.ExposedPort; import com.github.dockerjava.api.model.Link; import com.github.dockerjava.api.model.LxcConf; import com.github.dockerjava.api.model.PortBinding; import com.github.dockerjava.api.model.Ports; import com.github.dockerjava.api.model.RestartPolicy; import com.github.dockerjava.api.model.Volume; import org.apache.camel.component.docker.DockerConstants; import org.apache.camel.component.docker.DockerOperation; import org.junit.Test; import org.mockito.Matchers; import org.mockito.Mock; import org.mockito.Mockito; /** * Validates Start Container Request headers are applied properly */ public class StartContainerCmdHeaderTest extends BaseDockerHeaderTest<StartContainerCmd> { @Mock ExposedPort exposedPort; @Mock private StartContainerCmd mockObject; @Test public void startContainerHeaderTest() { String containerId = "be29975e0098"; Map<String, Object> headers = getDefaultParameters(); headers.put(DockerConstants.DOCKER_CONTAINER_ID, containerId); template.sendBodyAndHeaders("direct:in", "", headers); Mockito.verify(dockerClient, Mockito.times(1)).startContainerCmd(containerId); } @Override protected void setupMocks() { Mockito.when(dockerClient.startContainerCmd(Matchers.anyString())).thenReturn(mockObject); } @Override protected DockerOperation getOperation() { return DockerOperation.START_CONTAINER; } }
coderczp/camel
components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/StartContainerCmdHeaderTest.java
Java
apache-2.0
2,575
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.drill.common.exceptions; import java.util.Set; import javax.validation.ConstraintViolation; import org.apache.drill.common.logical.data.LogicalOperator; import org.apache.drill.common.logical.data.LogicalOperatorBase; public class LogicalPlanParsingException extends DrillRuntimeException{ static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(LogicalPlanParsingException.class); private Set<ConstraintViolation<LogicalOperatorBase>> violations; private LogicalOperator operator; public LogicalPlanParsingException() { super(); } public LogicalPlanParsingException(LogicalOperator operator, Set<ConstraintViolation<LogicalOperatorBase>> violations){ super(getErrorMessage(operator, violations)); this.operator = operator; this.violations = violations; } public LogicalPlanParsingException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } public LogicalPlanParsingException(String message, Throwable cause) { super(message, cause); } public LogicalPlanParsingException(String message) { super(message); } public LogicalPlanParsingException(Throwable cause) { super(cause); } private static String getErrorMessage(LogicalOperator operator, Set<ConstraintViolation<LogicalOperatorBase>> violations){ StringBuffer sb = new StringBuffer(); sb.append("Failure while attempting to set up operator of type "); sb.append(operator.getClass().getCanonicalName()); sb.append(". Constraints violated:\n"); for(ConstraintViolation<LogicalOperatorBase> v : violations){ sb.append("\t"); sb.append(v.getMessage()); sb.append(", Invalid value: "); sb.append(v.getInvalidValue()); sb.append("\n"); } return sb.toString(); } }
yssharma/drill
common/src/main/java/org/apache/drill/common/exceptions/LogicalPlanParsingException.java
Java
apache-2.0
2,698
/* * Copyright 2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package samples.classwithinnermembers; /** * Class that is used to test that local and member class works with PowerMock. */ public class ClassWithInnerMembers { private interface InnerInterface { String doStuff(); } private static class MyInnerClass implements InnerInterface { public String doStuff() { return "member class"; } } private static class StaticInnerClassWithConstructorArgument implements InnerInterface { private final String value; public StaticInnerClassWithConstructorArgument(String value) { this.value = value; } public String doStuff() { return value; } } private class MyInnerClassWithConstructorArgument implements InnerInterface { private final String value; public MyInnerClassWithConstructorArgument(String value) { this.value = value; } public String doStuff() { return value; } } public String getValue() { return new MyInnerClass().doStuff(); } public String getValueForInnerClassWithConstructorArgument() { return new MyInnerClassWithConstructorArgument("value").doStuff(); } public String getValueForStaticInnerClassWithConstructorArgument() { return new StaticInnerClassWithConstructorArgument("value").doStuff(); } public String getLocalClassValue() { class MyLocalClass implements InnerInterface { public String doStuff() { return "local class"; } } return new MyLocalClass().doStuff(); } public String getLocalClassValueWithArgument() { class MyLocalClass implements InnerInterface { private final String value; public MyLocalClass(String value) { this.value = value; } public String doStuff() { return value; } } return new MyLocalClass("my value").doStuff(); } public String getValueForAnonymousInnerClass() { InnerInterface inner = new InnerInterface() { public String doStuff() { return "value"; } }; return inner.doStuff(); } }
maidh91/powermock
tests/utils/src/main/java/samples/classwithinnermembers/ClassWithInnerMembers.java
Java
apache-2.0
2,649
/* mbed Microcontroller Library '******************************************************************************* * Copyright (c) 2016, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************* */ #include "PeripheralPins.h" // ===== // Note: Commented lines are alternative possibilities which are not used per default. // If you change them, you will have also to modify the corresponding xxx_api.c file // for pwmout, analogin, analogout, ... // ===== //*** ADC *** const PinMap PinMap_ADC[] = { {PA_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0 // {PA_0, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC2_IN0 // {PA_0, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC3_IN0 // {PA_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 (pin used by ethernet) // {PA_1, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC2_IN1 (pin used by ethernet) // {PA_1, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC3_IN1 (pin used by ethernet) // {PA_2, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 (pin used by ethernet) // {PA_2, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC2_IN2 (pin used by ethernet) // {PA_2, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC3_IN2 (pin used by ethernet) {PA_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 - ARDUINO A0 // {PA_3, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_IN3 - ARDUINO A0 // {PA_3, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC3_IN3 - ARDUINO A0 {PA_4, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 // {PA_4, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_IN4 {PA_5, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 - ARDUINO D13 // {PA_5, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_IN5 - ARDUINO D13 {PA_6, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 - ARDUINO D12 // {PA_6, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC2_IN6 - ARDUINO D12 // {PA_7, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 (pin used by ethernet when JP6 ON) - ARDUINO D11 (default configuration) {PA_7, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_IN7 (pin used by ethernet when JP6 ON) - ARDUINO D11 (default configuration) // {PB_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 (pin used by LED1) // {PB_0, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC2_IN8 (pin used by LED1) {PB_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 // {PB_1, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC2_IN9 {PC_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 - ARDUINO A1 // {PC_0, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_IN10 - ARDUINO A1 // {PC_0, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC3_IN10 - ARDUINO A1 // {PC_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11 (pin used by ethernet) // {PC_1, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_IN11 (pin used by ethernet) // {PC_1, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC3_IN11 (pin used by ethernet) {PC_2, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12 // {PC_2, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC2_IN12 // {PC_2, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC3_IN12 {PC_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13 - ARDUINO A2 // {PC_3, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC2_IN13 - ARDUINO A2 // {PC_3, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC3_IN13 - ARDUINO A2 {PC_4, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_IN14 (pin used by ethernet when JP6 ON) // {PC_4, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC2_IN14 (pin used by ethernet when JP6 ON) {PC_5, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15 (pin used by ethernet when JP6 ON) // {PC_5, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC2_IN15 (pin used by ethernet when JP6 ON) {PF_3, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC3_IN9 - ARDUINO A3 {PF_4, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC3_IN14 {PF_5, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC3_IN15 - ARDUINO A4 {PF_6, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC3_IN4 {PF_7, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC3_IN5 {PF_8, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC3_IN6 {PF_9, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC3_IN7 {PF_10, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC3_IN8 - ARDUINO A5 {NC, NC, 0} }; const PinMap PinMap_ADC_Internal[] = { {ADC_TEMP, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 16, 0)}, // See in analogin_api.c the correct ADC channel used {ADC_VREF, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 17, 0)}, // See in analogin_api.c the correct ADC channel used {ADC_VBAT, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)}, // See in analogin_api.c the correct ADC channel used {NC, NC, 0} }; //*** DAC *** const PinMap PinMap_DAC[] = { {PA_4, DAC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1 {PA_5, DAC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 - ARDUINO D13 {NC, NC, 0} }; //*** I2C *** const PinMap PinMap_I2C_SDA[] = { // {PB_7, I2C_1 , STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, // (pin used by LED2) {PB_9, I2C_1 , STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, // ARDUINO D14 {PB_11, I2C_2 , STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, {PC_9, I2C_3 , STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, {PF_0, I2C_2 , STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, {NC, NC, 0} }; const PinMap PinMap_I2C_SCL[] = { {PA_8, I2C_3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, {PB_6, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, {PB_8, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, // ARDUINO D15 {PB_10, I2C_2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, {PF_1, I2C_2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, {NC, NC, 0} }; //*** PWM *** const PinMap PinMap_PWM[] = { {PA_0, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 // {PA_0, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 (TIM5 used by us_ticker) // {PA_1, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 (pin used by ethernet) // {PA_1, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 (TIM5 used by us_ticker) (pin used by ethernet) // {PA_2, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 (pin used by ethernet) // {PA_2, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 (TIM5 used by us_ticker) // {PA_2, PWM_9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 (pin used by ethernet) // {PA_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 - ARDUINO A0 {PA_3, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 (TIM5 used by us_ticker) - ARDUINO A0 // {PA_3, PWM_9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 - ARDUINO A0 // {PA_5, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - ARDUINO D13 {PA_5, PWM_8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N - ARDUINO D13 // {PA_6, PWM_13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1 - ARDUINO D12 {PA_6, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 - ARDUINO D12 {PA_7, PWM_14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1 (pin used by ethernet when JP6 ON) - ARDUINO D11 (default configuration) // {PA_7, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N (pin used by ethernet when JP6 ON) - ARDUINO D11 (default configuration) // {PA_7, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 (pin used by ethernet when JP6 ON) - ARDUINO D11 (default configuration) // {PA_7, PWM_8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N (pin used by ethernet when JP6 ON) - ARDUINO D11 (default configuration) {PA_8, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 // {PA_9, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 (pin used by usb) // {PA_10, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 (pin used by usb) // {PA_11, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 (pin used by usb) {PA_15, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 // {PB_0, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N (pin used by LED1) // {PB_0, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 (pin used by LED1) // {PB_0, PWM_8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N (pin used by LED1) // {PB_1, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N // {PB_1, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 {PB_1, PWM_8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N {PB_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 {PB_4, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 {PB_5, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 - ARDUINO D11 (need HW and SW updates) // HW solder bridge update : SB121 off, SB122 on // SW : config from json files {PB_6, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 // {PB_7, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 (pin used by LED2) // {PB_8, PWM_10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 - ARDUINO D15 {PB_8, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 - ARDUINO D15 {PB_9, PWM_11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 - ARDUINO D14 // {PB_9, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 - ARDUINO D14 {PB_10, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 {PB_11, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 {PB_13, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N (pin used by ethernet when JP7 ON) // {PB_14, PWM_12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 1, 0)}, // TIM12_CH1 (pin used by LED3) // {PB_14, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N (pin used by LED3) // {PB_14, PWM_8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N (pin used by LED3) {PB_15, PWM_12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 2, 0)}, // TIM12_CH2 // {PB_15, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N // {PB_15, PWM_8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N {PC_6, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 // {PC_6, PWM_8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 0)}, // TIM8_CH1 {PC_7, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 // {PC_7, PWM_8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2 {PC_8, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 // {PC_8, PWM_8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 0)}, // TIM8_CH3 {PC_9, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 // {PC_9, PWM_8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4 {PD_12, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 {PD_13, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 {PD_14, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 - ARDUINO D10 {PD_15, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 - ARDUINO D9 {PE_5, PWM_9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 {PE_6, PWM_9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 {PE_8, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N {PE_9, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 - ARDUINO D6 {PE_10, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N {PE_11, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 - ARDUINO D5 {PE_12, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N {PE_13, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 - ARDUINO D3 {PE_14, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 {PF_6, PWM_10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 {PF_7, PWM_11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 {PF_8, PWM_13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1 {PF_9, PWM_14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1 {NC, NC, 0} }; //*** SERIAL *** const PinMap PinMap_UART_TX[] = { {PA_0, UART_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, // {PA_2, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // (pin used by ethernet) // {PA_9, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // (pin used by usb) {PB_6, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, {PB_10, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, {PC_6, UART_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, // {PC_10, UART_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, {PC_10, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, {PC_12, UART_5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, {PD_5, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, {PD_8, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, {PE_1, UART_8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)}, {PE_8, UART_7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART7)}, {PF_7, UART_7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART7)}, {PG_14, UART_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, // ARDUINO D1 {NC, NC, 0} }; const PinMap PinMap_UART_RX[] = { // {PA_1, UART_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, // (pin used by ethernet) {PA_3, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // ARDUINO A0 // {PA_10, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // (pin used by usb) // {PB_7, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // (pin used by LED2) {PB_11, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, {PC_7, UART_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, {PC_11, UART_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, // {PC_11, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, {PD_2, UART_5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, {PD_6, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, {PD_9, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, {PE_0, UART_8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)}, {PE_7, UART_7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART7)}, {PF_6, UART_7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART7)}, {PG_9, UART_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, // ARDUINO D0 {NC, NC, 0} }; const PinMap PinMap_UART_RTS[] = { // {PA_1, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // (pin used by ethernet) // {PA_12, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // (pin used by usb) // {PB_14, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // (pin used by LED3) {PD_4, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, {PD_12, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, {PG_8, UART_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, {PG_12, UART_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, {NC, NC, 0} }; const PinMap PinMap_UART_CTS[] = { {PA_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // {PA_11, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // (pin used by usb) {PB_13, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // (pin used by ethernet when JP7 ON) {PD_3, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, {PD_11, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // {PG_13, UART_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, // (pin used by ethernet) {PG_15, UART_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, {NC, NC, 0} }; //*** SPI *** const PinMap PinMap_SPI_MOSI[] = { {PA_7, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // pin used by ethernet when JP6 ON - ARDUINO D11 (default configuration) {PB_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // ARDUINO D11 (need HW and SW updates) // HW solder bridge update : SB121 off, SB122 on // SW : config from json files // {PB_5, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, {PB_15, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, {PC_3, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, // ARDUINO A2 {PC_12, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, {PD_6, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, {PE_6, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, {PE_14, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, {PF_9, SPI_5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI5)}, {PF_11, SPI_5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI5)}, {PG_14, SPI_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI6)}, // ARDUINO D1 {NC, NC, 0} }; const PinMap PinMap_SPI_MISO[] = { {PA_6, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // ARDUINO D12 {PB_4, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // {PB_4, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, // {PB_14, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, // (pin used by LED3) {PC_2, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, {PC_11, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, {PE_5, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, {PE_13, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, // ARDUINO D3 {PF_8, SPI_5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI5)}, {PG_12, SPI_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI6)}, {NC, NC, 0} }; const PinMap PinMap_SPI_SCLK[] = { {PA_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // ARDUINO D13 // {PB_3, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, {PB_3, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, {PB_10, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, {PB_13, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, // (pin used by ethernet when JP7 ON) {PC_10, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, {PD_3, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, {PE_2, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, {PE_12, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, {PF_7, SPI_5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI5)}, // {PG_13, SPI_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI6)}, // (pin used by ethernet) {NC, NC, 0} }; const PinMap PinMap_SPI_SSEL[] = { {PA_4, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // {PA_4, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, // {PA_15, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, {PA_15, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, {PB_9, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, // ARDUINO D14 {PB_12, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, {PE_4, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, {PE_11, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, // ARDUINO D5 {PF_6, SPI_5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI5)}, {PG_8, SPI_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI6)}, {NC, NC, 0} }; const PinMap PinMap_CAN_RD[] = { {PB_8, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, {PB_12, CAN_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, {PD_0, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, {PB_5 , CAN_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, // ARDUINO D11 (need HW and SW updates) // HW solder bridge update : SB121 off, SB122 on // SW : config from json files {PA_11, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, {NC, NC, 0} }; const PinMap PinMap_CAN_TD[] = { {PB_9, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, {PB_13, CAN_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, {PD_1, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, {PB_6 , CAN_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, {PA_12, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, {NC, NC, 0} };
svogl/mbed-os
targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_NUCLEO_F439ZI/PeripheralPins.c
C
apache-2.0
27,057
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build go1.5 package rename // This file contains logic related to specifying a renaming: parsing of // the flags as a form of query, and finding the object(s) it denotes. // See Usage for flag details. import ( "bytes" "fmt" "go/ast" "go/build" "go/parser" "go/token" "go/types" "log" "os" "path/filepath" "strconv" "strings" "golang.org/x/tools/go/buildutil" "golang.org/x/tools/go/loader" ) // A spec specifies an entity to rename. // // It is populated from an -offset flag or -from query; // see Usage for the allowed -from query forms. // type spec struct { // pkg is the package containing the position // specified by the -from or -offset flag. // If filename == "", our search for the 'from' entity // is restricted to this package. pkg string // The original name of the entity being renamed. // If the query had a ::from component, this is that; // otherwise it's the last segment, e.g. // (encoding/json.Decoder).from // encoding/json.from fromName string // -- The remaining fields are private to this file. All are optional. -- // The query's ::x suffix, if any. searchFor string // e.g. "Decoder" in "(encoding/json.Decoder).fieldOrMethod" // or "encoding/json.Decoder pkgMember string // e.g. fieldOrMethod in "(encoding/json.Decoder).fieldOrMethod" typeMember string // Restricts the query to this file. // Implied by -from="file.go::x" and -offset flags. filename string // Byte offset of the 'from' identifier within the file named 'filename'. // -offset mode only. offset int } // parseFromFlag interprets the "-from" flag value as a renaming specification. // See Usage in rename.go for valid formats. func parseFromFlag(ctxt *build.Context, fromFlag string) (*spec, error) { var spec spec var main string // sans "::x" suffix switch parts := strings.Split(fromFlag, "::"); len(parts) { case 1: main = parts[0] case 2: main = parts[0] spec.searchFor = parts[1] if parts[1] == "" { // error } default: return nil, fmt.Errorf("-from %q: invalid identifier specification (see -help for formats)", fromFlag) } if strings.HasSuffix(main, ".go") { // main is "filename.go" if spec.searchFor == "" { return nil, fmt.Errorf("-from: filename %q must have a ::name suffix", main) } spec.filename = main if !buildutil.FileExists(ctxt, spec.filename) { return nil, fmt.Errorf("no such file: %s", spec.filename) } bp, err := buildutil.ContainingPackage(ctxt, wd, spec.filename) if err != nil { return nil, err } spec.pkg = bp.ImportPath } else { // main is one of: // "importpath" // "importpath".member // (*"importpath".type).fieldormethod (parens and star optional) if err := parseObjectSpec(&spec, main); err != nil { return nil, err } } if spec.searchFor != "" { spec.fromName = spec.searchFor } cwd, err := os.Getwd() if err != nil { return nil, err } // Sanitize the package. bp, err := ctxt.Import(spec.pkg, cwd, build.FindOnly) if err != nil { return nil, fmt.Errorf("can't find package %q", spec.pkg) } spec.pkg = bp.ImportPath if !isValidIdentifier(spec.fromName) { return nil, fmt.Errorf("-from: invalid identifier %q", spec.fromName) } if Verbose { log.Printf("-from spec: %+v", spec) } return &spec, nil } // parseObjectSpec parses main as one of the non-filename forms of // object specification. func parseObjectSpec(spec *spec, main string) error { // Parse main as a Go expression, albeit a strange one. e, _ := parser.ParseExpr(main) if pkg := parseImportPath(e); pkg != "" { // e.g. bytes or "encoding/json": a package spec.pkg = pkg if spec.searchFor == "" { return fmt.Errorf("-from %q: package import path %q must have a ::name suffix", main, main) } return nil } if e, ok := e.(*ast.SelectorExpr); ok { x := unparen(e.X) // Strip off star constructor, if any. if star, ok := x.(*ast.StarExpr); ok { x = star.X } if pkg := parseImportPath(x); pkg != "" { // package member e.g. "encoding/json".HTMLEscape spec.pkg = pkg // e.g. "encoding/json" spec.pkgMember = e.Sel.Name // e.g. "HTMLEscape" spec.fromName = e.Sel.Name return nil } if x, ok := x.(*ast.SelectorExpr); ok { // field/method of type e.g. ("encoding/json".Decoder).Decode y := unparen(x.X) if pkg := parseImportPath(y); pkg != "" { spec.pkg = pkg // e.g. "encoding/json" spec.pkgMember = x.Sel.Name // e.g. "Decoder" spec.typeMember = e.Sel.Name // e.g. "Decode" spec.fromName = e.Sel.Name return nil } } } return fmt.Errorf("-from %q: invalid expression", main) } // parseImportPath returns the import path of the package denoted by e. // Any import path may be represented as a string literal; // single-segment import paths (e.g. "bytes") may also be represented as // ast.Ident. parseImportPath returns "" for all other expressions. func parseImportPath(e ast.Expr) string { switch e := e.(type) { case *ast.Ident: return e.Name // e.g. bytes case *ast.BasicLit: if e.Kind == token.STRING { pkgname, _ := strconv.Unquote(e.Value) return pkgname // e.g. "encoding/json" } } return "" } // parseOffsetFlag interprets the "-offset" flag value as a renaming specification. func parseOffsetFlag(ctxt *build.Context, offsetFlag string) (*spec, error) { var spec spec // Validate -offset, e.g. file.go:#123 parts := strings.Split(offsetFlag, ":#") if len(parts) != 2 { return nil, fmt.Errorf("-offset %q: invalid offset specification", offsetFlag) } spec.filename = parts[0] if !buildutil.FileExists(ctxt, spec.filename) { return nil, fmt.Errorf("no such file: %s", spec.filename) } bp, err := buildutil.ContainingPackage(ctxt, wd, spec.filename) if err != nil { return nil, err } spec.pkg = bp.ImportPath for _, r := range parts[1] { if !isDigit(r) { return nil, fmt.Errorf("-offset %q: non-numeric offset", offsetFlag) } } spec.offset, err = strconv.Atoi(parts[1]) if err != nil { return nil, fmt.Errorf("-offset %q: non-numeric offset", offsetFlag) } // Parse the file and check there's an identifier at that offset. fset := token.NewFileSet() f, err := buildutil.ParseFile(fset, ctxt, nil, wd, spec.filename, parser.ParseComments) if err != nil { return nil, fmt.Errorf("-offset %q: cannot parse file: %s", offsetFlag, err) } id := identAtOffset(fset, f, spec.offset) if id == nil { return nil, fmt.Errorf("-offset %q: no identifier at this position", offsetFlag) } spec.fromName = id.Name return &spec, nil } var wd = func() string { wd, err := os.Getwd() if err != nil { panic("cannot get working directory: " + err.Error()) } return wd }() // For source trees built with 'go build', the -from or -offset // spec identifies exactly one initial 'from' object to rename , // but certain proprietary build systems allow a single file to // appear in multiple packages (e.g. the test package contains a // copy of its library), so there may be multiple objects for // the same source entity. func findFromObjects(iprog *loader.Program, spec *spec) ([]types.Object, error) { if spec.filename != "" { return findFromObjectsInFile(iprog, spec) } // Search for objects defined in specified package. // TODO(adonovan): the iprog.ImportMap has an entry {"main": ...} // for main packages, even though that's not an import path. // Seems like a bug. // // pkg := iprog.ImportMap[spec.pkg] // if pkg == nil { // return fmt.Errorf("cannot find package %s", spec.pkg) // can't happen? // } // info := iprog.AllPackages[pkg] // Workaround: lookup by value. var info *loader.PackageInfo var pkg *types.Package for pkg, info = range iprog.AllPackages { if pkg.Path() == spec.pkg { break } } if info == nil { return nil, fmt.Errorf("package %q was not loaded", spec.pkg) } objects, err := findObjects(info, spec) if err != nil { return nil, err } if len(objects) > 1 { // ambiguous "*" scope query return nil, ambiguityError(iprog.Fset, objects) } return objects, nil } func findFromObjectsInFile(iprog *loader.Program, spec *spec) ([]types.Object, error) { var fromObjects []types.Object for _, info := range iprog.AllPackages { // restrict to specified filename // NB: under certain proprietary build systems, a given // filename may appear in multiple packages. for _, f := range info.Files { thisFile := iprog.Fset.File(f.Pos()) if !sameFile(thisFile.Name(), spec.filename) { continue } // This package contains the query file. if spec.offset != 0 { // Search for a specific ident by file/offset. id := identAtOffset(iprog.Fset, f, spec.offset) if id == nil { // can't happen? return nil, fmt.Errorf("identifier not found") } obj := info.Uses[id] if obj == nil { obj = info.Defs[id] if obj == nil { // Ident without Object. // Package clause? pos := thisFile.Pos(spec.offset) _, path, _ := iprog.PathEnclosingInterval(pos, pos) if len(path) == 2 { // [Ident File] // TODO(adonovan): support this case. return nil, fmt.Errorf("cannot rename %q: renaming package clauses is not yet supported", path[1].(*ast.File).Name.Name) } // Implicit y in "switch y := x.(type) {"? if obj := typeSwitchVar(&info.Info, path); obj != nil { return []types.Object{obj}, nil } // Probably a type error. return nil, fmt.Errorf("cannot find object for %q", id.Name) } } if obj.Pkg() == nil { return nil, fmt.Errorf("cannot rename predeclared identifiers (%s)", obj) } fromObjects = append(fromObjects, obj) } else { // do a package-wide query objects, err := findObjects(info, spec) if err != nil { return nil, err } // filter results: only objects defined in thisFile var filtered []types.Object for _, obj := range objects { if iprog.Fset.File(obj.Pos()) == thisFile { filtered = append(filtered, obj) } } if len(filtered) == 0 { return nil, fmt.Errorf("no object %q declared in file %s", spec.fromName, spec.filename) } else if len(filtered) > 1 { return nil, ambiguityError(iprog.Fset, filtered) } fromObjects = append(fromObjects, filtered[0]) } break } } if len(fromObjects) == 0 { // can't happen? return nil, fmt.Errorf("file %s was not part of the loaded program", spec.filename) } return fromObjects, nil } func typeSwitchVar(info *types.Info, path []ast.Node) types.Object { if len(path) > 3 { // [Ident AssignStmt TypeSwitchStmt...] if sw, ok := path[2].(*ast.TypeSwitchStmt); ok { // choose the first case. if len(sw.Body.List) > 0 { obj := info.Implicits[sw.Body.List[0].(*ast.CaseClause)] if obj != nil { return obj } } } } return nil } // On success, findObjects returns the list of objects named // spec.fromName matching the spec. On success, the result has exactly // one element unless spec.searchFor!="", in which case it has at least one // element. // func findObjects(info *loader.PackageInfo, spec *spec) ([]types.Object, error) { if spec.pkgMember == "" { if spec.searchFor == "" { panic(spec) } objects := searchDefs(&info.Info, spec.searchFor) if objects == nil { return nil, fmt.Errorf("no object %q declared in package %q", spec.searchFor, info.Pkg.Path()) } return objects, nil } pkgMember := info.Pkg.Scope().Lookup(spec.pkgMember) if pkgMember == nil { return nil, fmt.Errorf("package %q has no member %q", info.Pkg.Path(), spec.pkgMember) } var searchFunc *types.Func if spec.typeMember == "" { // package member if spec.searchFor == "" { return []types.Object{pkgMember}, nil } // Search within pkgMember, which must be a function. searchFunc, _ = pkgMember.(*types.Func) if searchFunc == nil { return nil, fmt.Errorf("cannot search for %q within %s %q", spec.searchFor, objectKind(pkgMember), pkgMember) } } else { // field/method of type // e.g. (encoding/json.Decoder).Decode // or ::x within it. tName, _ := pkgMember.(*types.TypeName) if tName == nil { return nil, fmt.Errorf("%s.%s is a %s, not a type", info.Pkg.Path(), pkgMember.Name(), objectKind(pkgMember)) } // search within named type. obj, _, _ := types.LookupFieldOrMethod(tName.Type(), true, info.Pkg, spec.typeMember) if obj == nil { return nil, fmt.Errorf("cannot find field or method %q of %s %s.%s", spec.typeMember, typeKind(tName.Type()), info.Pkg.Path(), tName.Name()) } if spec.searchFor == "" { // If it is an embedded field, return the type of the field. if v, ok := obj.(*types.Var); ok && v.Anonymous() { switch t := v.Type().(type) { case *types.Pointer: return []types.Object{t.Elem().(*types.Named).Obj()}, nil case *types.Named: return []types.Object{t.Obj()}, nil } } return []types.Object{obj}, nil } searchFunc, _ = obj.(*types.Func) if searchFunc == nil { return nil, fmt.Errorf("cannot search for local name %q within %s (%s.%s).%s; need a function", spec.searchFor, objectKind(obj), info.Pkg.Path(), tName.Name(), obj.Name()) } if isInterface(tName.Type()) { return nil, fmt.Errorf("cannot search for local name %q within abstract method (%s.%s).%s", spec.searchFor, info.Pkg.Path(), tName.Name(), searchFunc.Name()) } } // -- search within function or method -- decl := funcDecl(info, searchFunc) if decl == nil { return nil, fmt.Errorf("cannot find syntax for %s", searchFunc) // can't happen? } var objects []types.Object for _, obj := range searchDefs(&info.Info, spec.searchFor) { // We use positions, not scopes, to determine whether // the obj is within searchFunc. This is clumsy, but the // alternative, using the types.Scope tree, doesn't // account for non-lexical objects like fields and // interface methods. if decl.Pos() <= obj.Pos() && obj.Pos() < decl.End() && obj != searchFunc { objects = append(objects, obj) } } if objects == nil { return nil, fmt.Errorf("no local definition of %q within %s", spec.searchFor, searchFunc) } return objects, nil } func funcDecl(info *loader.PackageInfo, fn *types.Func) *ast.FuncDecl { for _, f := range info.Files { for _, d := range f.Decls { if d, ok := d.(*ast.FuncDecl); ok && info.Defs[d.Name] == fn { return d } } } return nil } func searchDefs(info *types.Info, name string) []types.Object { var objects []types.Object for id, obj := range info.Defs { if obj == nil { // e.g. blank ident. // TODO(adonovan): but also implicit y in // switch y := x.(type) // Needs some thought. continue } if id.Name == name { objects = append(objects, obj) } } return objects } func identAtOffset(fset *token.FileSet, f *ast.File, offset int) *ast.Ident { var found *ast.Ident ast.Inspect(f, func(n ast.Node) bool { if id, ok := n.(*ast.Ident); ok { idpos := fset.Position(id.Pos()).Offset if idpos <= offset && offset < idpos+len(id.Name) { found = id } } return found == nil // keep traversing only until found }) return found } // ambiguityError returns an error describing an ambiguous "*" scope query. func ambiguityError(fset *token.FileSet, objects []types.Object) error { var buf bytes.Buffer for i, obj := range objects { if i > 0 { buf.WriteString(", ") } posn := fset.Position(obj.Pos()) fmt.Fprintf(&buf, "%s at %s:%d", objectKind(obj), filepath.Base(posn.Filename), posn.Column) } return fmt.Errorf("ambiguous specifier %s matches %s", objects[0].Name(), buf.String()) }
kwagdy/koding-1
go/src/vendor/golang.org/x/tools/refactor/rename/spec.go
GO
apache-2.0
15,870
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags. pflag is compatible with the GNU extensions to the POSIX recommendations for command-line options. See http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html Usage: pflag is a drop-in replacement of Go's native flag package. If you import pflag under the name "flag" then all code should continue to function with no changes. import flag "github.com/spf13/pflag" There is one exception to this: if you directly instantiate the Flag struct there is one more field "Shorthand" that you will need to set. Most code never instantiates this struct directly, and instead uses functions such as String(), BoolVar(), and Var(), and is therefore unaffected. Define flags using flag.String(), Bool(), Int(), etc. This declares an integer flag, -flagname, stored in the pointer ip, with type *int. var ip = flag.Int("flagname", 1234, "help message for flagname") If you like, you can bind the flag to a variable using the Var() functions. var flagvar int func init() { flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname") } Or you can create custom flags that satisfy the Value interface (with pointer receivers) and couple them to flag parsing by flag.Var(&flagVal, "name", "help message for flagname") For such flags, the default value is just the initial value of the variable. After all flags are defined, call flag.Parse() to parse the command line into the defined flags. Flags may then be used directly. If you're using the flags themselves, they are all pointers; if you bind to variables, they're values. fmt.Println("ip has value ", *ip) fmt.Println("flagvar has value ", flagvar) After parsing, the arguments after the flag are available as the slice flag.Args() or individually as flag.Arg(i). The arguments are indexed from 0 through flag.NArg()-1. The pflag package also defines some new functions that are not in flag, that give one-letter shorthands for flags. You can use these by appending 'P' to the name of any function that defines a flag. var ip = flag.IntP("flagname", "f", 1234, "help message") var flagvar bool func init() { flag.BoolVarP("boolname", "b", true, "help message") } flag.VarP(&flagVar, "varname", "v", 1234, "help message") Shorthand letters can be used with single dashes on the command line. Boolean shorthand flags can be combined with other shorthand flags. Command line flag syntax: --flag // boolean flags only --flag=x Unlike the flag package, a single dash before an option means something different than a double dash. Single dashes signify a series of shorthand letters for flags. All but the last shorthand letter must be boolean flags. // boolean flags -f -abc // non-boolean flags -n 1234 -Ifile // mixed -abcs "hello" -abcn1234 Flag parsing stops after the terminator "--". Unlike the flag package, flags can be interspersed with arguments anywhere on the command line before this terminator. Integer flags accept 1234, 0664, 0x1234 and may be negative. Boolean flags (in their long form) accept 1, 0, t, f, true, false, TRUE, FALSE, True, False. Duration flags accept any input valid for time.ParseDuration. The default set of command-line flags is controlled by top-level functions. The FlagSet type allows one to define independent sets of flags, such as to implement subcommands in a command-line interface. The methods of FlagSet are analogous to the top-level functions for the command-line flag set. */ package pflag import ( "bytes" "errors" "fmt" "io" "os" "sort" "strings" ) // ErrHelp is the error returned if the flag -help is invoked but no such flag is defined. var ErrHelp = errors.New("pflag: help requested") // ErrorHandling defines how to handle flag parsing errors. type ErrorHandling int const ( // ContinueOnError will return an err from Parse() if an error is found ContinueOnError ErrorHandling = iota // ExitOnError will call os.Exit(2) if an error is found when parsing ExitOnError // PanicOnError will panic() if an error is found when parsing flags PanicOnError ) // NormalizedName is a flag name that has been normalized according to rules // for the FlagSet (e.g. making '-' and '_' equivalent). type NormalizedName string // A FlagSet represents a set of defined flags. type FlagSet struct { // Usage is the function called when an error occurs while parsing flags. // The field is a function (not a method) that may be changed to point to // a custom error handler. Usage func() // SortFlags is used to indicate, if user wants to have sorted flags in // help/usage messages. SortFlags bool name string parsed bool actual map[NormalizedName]*Flag orderedActual []*Flag sortedActual []*Flag formal map[NormalizedName]*Flag orderedFormal []*Flag sortedFormal []*Flag shorthands map[byte]*Flag args []string // arguments after flags argsLenAtDash int // len(args) when a '--' was located when parsing, or -1 if no -- errorHandling ErrorHandling output io.Writer // nil means stderr; use out() accessor interspersed bool // allow interspersed option/non-option args normalizeNameFunc func(f *FlagSet, name string) NormalizedName } // A Flag represents the state of a flag. type Flag struct { Name string // name as it appears on command line Shorthand string // one-letter abbreviated flag Usage string // help message Value Value // value as set DefValue string // default value (as text); for usage message Changed bool // If the user set the value (or if left to default) NoOptDefVal string // default value (as text); if the flag is on the command line without any options Deprecated string // If this flag is deprecated, this string is the new or now thing to use Hidden bool // used by cobra.Command to allow flags to be hidden from help/usage text ShorthandDeprecated string // If the shorthand of this flag is deprecated, this string is the new or now thing to use Annotations map[string][]string // used by cobra.Command bash autocomple code } // Value is the interface to the dynamic value stored in a flag. // (The default value is represented as a string.) type Value interface { String() string Set(string) error Type() string } // sortFlags returns the flags as a slice in lexicographical sorted order. func sortFlags(flags map[NormalizedName]*Flag) []*Flag { list := make(sort.StringSlice, len(flags)) i := 0 for k := range flags { list[i] = string(k) i++ } list.Sort() result := make([]*Flag, len(list)) for i, name := range list { result[i] = flags[NormalizedName(name)] } return result } // SetNormalizeFunc allows you to add a function which can translate flag names. // Flags added to the FlagSet will be translated and then when anything tries to // look up the flag that will also be translated. So it would be possible to create // a flag named "getURL" and have it translated to "geturl". A user could then pass // "--getUrl" which may also be translated to "geturl" and everything will work. func (f *FlagSet) SetNormalizeFunc(n func(f *FlagSet, name string) NormalizedName) { f.normalizeNameFunc = n f.sortedFormal = f.sortedFormal[:0] for k, v := range f.orderedFormal { delete(f.formal, NormalizedName(v.Name)) nname := f.normalizeFlagName(v.Name) v.Name = string(nname) f.formal[nname] = v f.orderedFormal[k] = v } } // GetNormalizeFunc returns the previously set NormalizeFunc of a function which // does no translation, if not set previously. func (f *FlagSet) GetNormalizeFunc() func(f *FlagSet, name string) NormalizedName { if f.normalizeNameFunc != nil { return f.normalizeNameFunc } return func(f *FlagSet, name string) NormalizedName { return NormalizedName(name) } } func (f *FlagSet) normalizeFlagName(name string) NormalizedName { n := f.GetNormalizeFunc() return n(f, name) } func (f *FlagSet) out() io.Writer { if f.output == nil { return os.Stderr } return f.output } // SetOutput sets the destination for usage and error messages. // If output is nil, os.Stderr is used. func (f *FlagSet) SetOutput(output io.Writer) { f.output = output } // VisitAll visits the flags in lexicographical order or // in primordial order if f.SortFlags is false, calling fn for each. // It visits all flags, even those not set. func (f *FlagSet) VisitAll(fn func(*Flag)) { if len(f.formal) == 0 { return } var flags []*Flag if f.SortFlags { if len(f.formal) != len(f.sortedFormal) { f.sortedFormal = sortFlags(f.formal) } flags = f.sortedFormal } else { flags = f.orderedFormal } for _, flag := range flags { fn(flag) } } // HasFlags returns a bool to indicate if the FlagSet has any flags definied. func (f *FlagSet) HasFlags() bool { return len(f.formal) > 0 } // HasAvailableFlags returns a bool to indicate if the FlagSet has any flags // definied that are not hidden or deprecated. func (f *FlagSet) HasAvailableFlags() bool { for _, flag := range f.formal { if !flag.Hidden && len(flag.Deprecated) == 0 { return true } } return false } // VisitAll visits the command-line flags in lexicographical order or // in primordial order if f.SortFlags is false, calling fn for each. // It visits all flags, even those not set. func VisitAll(fn func(*Flag)) { CommandLine.VisitAll(fn) } // Visit visits the flags in lexicographical order or // in primordial order if f.SortFlags is false, calling fn for each. // It visits only those flags that have been set. func (f *FlagSet) Visit(fn func(*Flag)) { if len(f.actual) == 0 { return } var flags []*Flag if f.SortFlags { if len(f.actual) != len(f.sortedActual) { f.sortedActual = sortFlags(f.actual) } flags = f.sortedActual } else { flags = f.orderedActual } for _, flag := range flags { fn(flag) } } // Visit visits the command-line flags in lexicographical order or // in primordial order if f.SortFlags is false, calling fn for each. // It visits only those flags that have been set. func Visit(fn func(*Flag)) { CommandLine.Visit(fn) } // Lookup returns the Flag structure of the named flag, returning nil if none exists. func (f *FlagSet) Lookup(name string) *Flag { return f.lookup(f.normalizeFlagName(name)) } // ShorthandLookup returns the Flag structure of the short handed flag, // returning nil if none exists. // It panics, if len(name) > 1. func (f *FlagSet) ShorthandLookup(name string) *Flag { if name == "" { return nil } if len(name) > 1 { msg := fmt.Sprintf("can not look up shorthand which is more than one ASCII character: %q", name) fmt.Fprintf(f.out(), msg) panic(msg) } c := name[0] return f.shorthands[c] } // lookup returns the Flag structure of the named flag, returning nil if none exists. func (f *FlagSet) lookup(name NormalizedName) *Flag { return f.formal[name] } // func to return a given type for a given flag name func (f *FlagSet) getFlagType(name string, ftype string, convFunc func(sval string) (interface{}, error)) (interface{}, error) { flag := f.Lookup(name) if flag == nil { err := fmt.Errorf("flag accessed but not defined: %s", name) return nil, err } if flag.Value.Type() != ftype { err := fmt.Errorf("trying to get %s value of flag of type %s", ftype, flag.Value.Type()) return nil, err } sval := flag.Value.String() result, err := convFunc(sval) if err != nil { return nil, err } return result, nil } // ArgsLenAtDash will return the length of f.Args at the moment when a -- was // found during arg parsing. This allows your program to know which args were // before the -- and which came after. func (f *FlagSet) ArgsLenAtDash() int { return f.argsLenAtDash } // MarkDeprecated indicated that a flag is deprecated in your program. It will // continue to function but will not show up in help or usage messages. Using // this flag will also print the given usageMessage. func (f *FlagSet) MarkDeprecated(name string, usageMessage string) error { flag := f.Lookup(name) if flag == nil { return fmt.Errorf("flag %q does not exist", name) } if usageMessage == "" { return fmt.Errorf("deprecated message for flag %q must be set", name) } flag.Deprecated = usageMessage return nil } // MarkShorthandDeprecated will mark the shorthand of a flag deprecated in your // program. It will continue to function but will not show up in help or usage // messages. Using this flag will also print the given usageMessage. func (f *FlagSet) MarkShorthandDeprecated(name string, usageMessage string) error { flag := f.Lookup(name) if flag == nil { return fmt.Errorf("flag %q does not exist", name) } if usageMessage == "" { return fmt.Errorf("deprecated message for flag %q must be set", name) } flag.ShorthandDeprecated = usageMessage return nil } // MarkHidden sets a flag to 'hidden' in your program. It will continue to // function but will not show up in help or usage messages. func (f *FlagSet) MarkHidden(name string) error { flag := f.Lookup(name) if flag == nil { return fmt.Errorf("flag %q does not exist", name) } flag.Hidden = true return nil } // Lookup returns the Flag structure of the named command-line flag, // returning nil if none exists. func Lookup(name string) *Flag { return CommandLine.Lookup(name) } // ShorthandLookup returns the Flag structure of the short handed flag, // returning nil if none exists. func ShorthandLookup(name string) *Flag { return CommandLine.ShorthandLookup(name) } // Set sets the value of the named flag. func (f *FlagSet) Set(name, value string) error { normalName := f.normalizeFlagName(name) flag, ok := f.formal[normalName] if !ok { return fmt.Errorf("no such flag -%v", name) } err := flag.Value.Set(value) if err != nil { var flagName string if flag.Shorthand != "" && flag.ShorthandDeprecated == "" { flagName = fmt.Sprintf("-%s, --%s", flag.Shorthand, flag.Name) } else { flagName = fmt.Sprintf("--%s", flag.Name) } return fmt.Errorf("invalid argument %q for %q flag: %v", value, flagName, err) } if f.actual == nil { f.actual = make(map[NormalizedName]*Flag) } f.actual[normalName] = flag f.orderedActual = append(f.orderedActual, flag) flag.Changed = true if flag.Deprecated != "" { fmt.Fprintf(f.out(), "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated) } return nil } // SetAnnotation allows one to set arbitrary annotations on a flag in the FlagSet. // This is sometimes used by spf13/cobra programs which want to generate additional // bash completion information. func (f *FlagSet) SetAnnotation(name, key string, values []string) error { normalName := f.normalizeFlagName(name) flag, ok := f.formal[normalName] if !ok { return fmt.Errorf("no such flag -%v", name) } if flag.Annotations == nil { flag.Annotations = map[string][]string{} } flag.Annotations[key] = values return nil } // Changed returns true if the flag was explicitly set during Parse() and false // otherwise func (f *FlagSet) Changed(name string) bool { flag := f.Lookup(name) // If a flag doesn't exist, it wasn't changed.... if flag == nil { return false } return flag.Changed } // Set sets the value of the named command-line flag. func Set(name, value string) error { return CommandLine.Set(name, value) } // PrintDefaults prints, to standard error unless configured // otherwise, the default values of all defined flags in the set. func (f *FlagSet) PrintDefaults() { usages := f.FlagUsages() fmt.Fprint(f.out(), usages) } // defaultIsZeroValue returns true if the default value for this flag represents // a zero value. func (f *Flag) defaultIsZeroValue() bool { switch f.Value.(type) { case boolFlag: return f.DefValue == "false" case *durationValue: // Beginning in Go 1.7, duration zero values are "0s" return f.DefValue == "0" || f.DefValue == "0s" case *intValue, *int8Value, *int32Value, *int64Value, *uintValue, *uint8Value, *uint16Value, *uint32Value, *uint64Value, *countValue, *float32Value, *float64Value: return f.DefValue == "0" case *stringValue: return f.DefValue == "" case *ipValue, *ipMaskValue, *ipNetValue: return f.DefValue == "<nil>" case *intSliceValue, *stringSliceValue, *stringArrayValue: return f.DefValue == "[]" default: switch f.Value.String() { case "false": return true case "<nil>": return true case "": return true case "0": return true } return false } } // UnquoteUsage extracts a back-quoted name from the usage // string for a flag and returns it and the un-quoted usage. // Given "a `name` to show" it returns ("name", "a name to show"). // If there are no back quotes, the name is an educated guess of the // type of the flag's value, or the empty string if the flag is boolean. func UnquoteUsage(flag *Flag) (name string, usage string) { // Look for a back-quoted name, but avoid the strings package. usage = flag.Usage for i := 0; i < len(usage); i++ { if usage[i] == '`' { for j := i + 1; j < len(usage); j++ { if usage[j] == '`' { name = usage[i+1 : j] usage = usage[:i] + name + usage[j+1:] return name, usage } } break // Only one back quote; use type name. } } name = flag.Value.Type() switch name { case "bool": name = "" case "float64": name = "float" case "int64": name = "int" case "uint64": name = "uint" } return } // Splits the string `s` on whitespace into an initial substring up to // `i` runes in length and the remainder. Will go `slop` over `i` if // that encompasses the entire string (which allows the caller to // avoid short orphan words on the final line). func wrapN(i, slop int, s string) (string, string) { if i+slop > len(s) { return s, "" } w := strings.LastIndexAny(s[:i], " \t") if w <= 0 { return s, "" } return s[:w], s[w+1:] } // Wraps the string `s` to a maximum width `w` with leading indent // `i`. The first line is not indented (this is assumed to be done by // caller). Pass `w` == 0 to do no wrapping func wrap(i, w int, s string) string { if w == 0 { return s } // space between indent i and end of line width w into which // we should wrap the text. wrap := w - i var r, l string // Not enough space for sensible wrapping. Wrap as a block on // the next line instead. if wrap < 24 { i = 16 wrap = w - i r += "\n" + strings.Repeat(" ", i) } // If still not enough space then don't even try to wrap. if wrap < 24 { return s } // Try to avoid short orphan words on the final line, by // allowing wrapN to go a bit over if that would fit in the // remainder of the line. slop := 5 wrap = wrap - slop // Handle first line, which is indented by the caller (or the // special case above) l, s = wrapN(wrap, slop, s) r = r + l // Now wrap the rest for s != "" { var t string t, s = wrapN(wrap, slop, s) r = r + "\n" + strings.Repeat(" ", i) + t } return r } // FlagUsagesWrapped returns a string containing the usage information // for all flags in the FlagSet. Wrapped to `cols` columns (0 for no // wrapping) func (f *FlagSet) FlagUsagesWrapped(cols int) string { buf := new(bytes.Buffer) lines := make([]string, 0, len(f.formal)) maxlen := 0 f.VisitAll(func(flag *Flag) { if flag.Deprecated != "" || flag.Hidden { return } line := "" if flag.Shorthand != "" && flag.ShorthandDeprecated == "" { line = fmt.Sprintf(" -%s, --%s", flag.Shorthand, flag.Name) } else { line = fmt.Sprintf(" --%s", flag.Name) } varname, usage := UnquoteUsage(flag) if varname != "" { line += " " + varname } if flag.NoOptDefVal != "" { switch flag.Value.Type() { case "string": line += fmt.Sprintf("[=\"%s\"]", flag.NoOptDefVal) case "bool": if flag.NoOptDefVal != "true" { line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) } default: line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) } } // This special character will be replaced with spacing once the // correct alignment is calculated line += "\x00" if len(line) > maxlen { maxlen = len(line) } line += usage if !flag.defaultIsZeroValue() { if flag.Value.Type() == "string" { line += fmt.Sprintf(" (default %q)", flag.DefValue) } else { line += fmt.Sprintf(" (default %s)", flag.DefValue) } } lines = append(lines, line) }) for _, line := range lines { sidx := strings.Index(line, "\x00") spacing := strings.Repeat(" ", maxlen-sidx) // maxlen + 2 comes from + 1 for the \x00 and + 1 for the (deliberate) off-by-one in maxlen-sidx fmt.Fprintln(buf, line[:sidx], spacing, wrap(maxlen+2, cols, line[sidx+1:])) } return buf.String() } // FlagUsages returns a string containing the usage information for all flags in // the FlagSet func (f *FlagSet) FlagUsages() string { return f.FlagUsagesWrapped(0) } // PrintDefaults prints to standard error the default values of all defined command-line flags. func PrintDefaults() { CommandLine.PrintDefaults() } // defaultUsage is the default function to print a usage message. func defaultUsage(f *FlagSet) { fmt.Fprintf(f.out(), "Usage of %s:\n", f.name) f.PrintDefaults() } // NOTE: Usage is not just defaultUsage(CommandLine) // because it serves (via godoc flag Usage) as the example // for how to write your own usage function. // Usage prints to standard error a usage message documenting all defined command-line flags. // The function is a variable that may be changed to point to a custom function. // By default it prints a simple header and calls PrintDefaults; for details about the // format of the output and how to control it, see the documentation for PrintDefaults. var Usage = func() { fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0]) PrintDefaults() } // NFlag returns the number of flags that have been set. func (f *FlagSet) NFlag() int { return len(f.actual) } // NFlag returns the number of command-line flags that have been set. func NFlag() int { return len(CommandLine.actual) } // Arg returns the i'th argument. Arg(0) is the first remaining argument // after flags have been processed. func (f *FlagSet) Arg(i int) string { if i < 0 || i >= len(f.args) { return "" } return f.args[i] } // Arg returns the i'th command-line argument. Arg(0) is the first remaining argument // after flags have been processed. func Arg(i int) string { return CommandLine.Arg(i) } // NArg is the number of arguments remaining after flags have been processed. func (f *FlagSet) NArg() int { return len(f.args) } // NArg is the number of arguments remaining after flags have been processed. func NArg() int { return len(CommandLine.args) } // Args returns the non-flag arguments. func (f *FlagSet) Args() []string { return f.args } // Args returns the non-flag command-line arguments. func Args() []string { return CommandLine.args } // Var defines a flag with the specified name and usage string. The type and // value of the flag are represented by the first argument, of type Value, which // typically holds a user-defined implementation of Value. For instance, the // caller could create a flag that turns a comma-separated string into a slice // of strings by giving the slice the methods of Value; in particular, Set would // decompose the comma-separated string into the slice. func (f *FlagSet) Var(value Value, name string, usage string) { f.VarP(value, name, "", usage) } // VarPF is like VarP, but returns the flag created func (f *FlagSet) VarPF(value Value, name, shorthand, usage string) *Flag { // Remember the default value as a string; it won't change. flag := &Flag{ Name: name, Shorthand: shorthand, Usage: usage, Value: value, DefValue: value.String(), } f.AddFlag(flag) return flag } // VarP is like Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) VarP(value Value, name, shorthand, usage string) { f.VarPF(value, name, shorthand, usage) } // AddFlag will add the flag to the FlagSet func (f *FlagSet) AddFlag(flag *Flag) { normalizedFlagName := f.normalizeFlagName(flag.Name) _, alreadyThere := f.formal[normalizedFlagName] if alreadyThere { msg := fmt.Sprintf("%s flag redefined: %s", f.name, flag.Name) fmt.Fprintln(f.out(), msg) panic(msg) // Happens only if flags are declared with identical names } if f.formal == nil { f.formal = make(map[NormalizedName]*Flag) } flag.Name = string(normalizedFlagName) f.formal[normalizedFlagName] = flag f.orderedFormal = append(f.orderedFormal, flag) if flag.Shorthand == "" { return } if len(flag.Shorthand) > 1 { msg := fmt.Sprintf("%q shorthand is more than one ASCII character", flag.Shorthand) fmt.Fprintf(f.out(), msg) panic(msg) } if f.shorthands == nil { f.shorthands = make(map[byte]*Flag) } c := flag.Shorthand[0] used, alreadyThere := f.shorthands[c] if alreadyThere { msg := fmt.Sprintf("unable to redefine %q shorthand in %q flagset: it's already used for %q flag", c, f.name, used.Name) fmt.Fprintf(f.out(), msg) panic(msg) } f.shorthands[c] = flag } // AddFlagSet adds one FlagSet to another. If a flag is already present in f // the flag from newSet will be ignored. func (f *FlagSet) AddFlagSet(newSet *FlagSet) { if newSet == nil { return } newSet.VisitAll(func(flag *Flag) { if f.Lookup(flag.Name) == nil { f.AddFlag(flag) } }) } // Var defines a flag with the specified name and usage string. The type and // value of the flag are represented by the first argument, of type Value, which // typically holds a user-defined implementation of Value. For instance, the // caller could create a flag that turns a comma-separated string into a slice // of strings by giving the slice the methods of Value; in particular, Set would // decompose the comma-separated string into the slice. func Var(value Value, name string, usage string) { CommandLine.VarP(value, name, "", usage) } // VarP is like Var, but accepts a shorthand letter that can be used after a single dash. func VarP(value Value, name, shorthand, usage string) { CommandLine.VarP(value, name, shorthand, usage) } // failf prints to standard error a formatted error and usage message and // returns the error. func (f *FlagSet) failf(format string, a ...interface{}) error { err := fmt.Errorf(format, a...) fmt.Fprintln(f.out(), err) f.usage() return err } // usage calls the Usage method for the flag set, or the usage function if // the flag set is CommandLine. func (f *FlagSet) usage() { if f == CommandLine { Usage() } else if f.Usage == nil { defaultUsage(f) } else { f.Usage() } } func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []string, err error) { a = args name := s[2:] if len(name) == 0 || name[0] == '-' || name[0] == '=' { err = f.failf("bad flag syntax: %s", s) return } split := strings.SplitN(name, "=", 2) name = split[0] flag, exists := f.formal[f.normalizeFlagName(name)] if !exists { if name == "help" { // special case for nice help message. f.usage() return a, ErrHelp } err = f.failf("unknown flag: --%s", name) return } var value string if len(split) == 2 { // '--flag=arg' value = split[1] } else if flag.NoOptDefVal != "" { // '--flag' (arg was optional) value = flag.NoOptDefVal } else if len(a) > 0 { // '--flag arg' value = a[0] a = a[1:] } else { // '--flag' (arg was required) err = f.failf("flag needs an argument: %s", s) return } err = fn(flag, value) return } func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parseFunc) (outShorts string, outArgs []string, err error) { if strings.HasPrefix(shorthands, "test.") { return } outArgs = args outShorts = shorthands[1:] c := shorthands[0] flag, exists := f.shorthands[c] if !exists { if c == 'h' { // special case for nice help message. f.usage() err = ErrHelp return } err = f.failf("unknown shorthand flag: %q in -%s", c, shorthands) return } var value string if len(shorthands) > 2 && shorthands[1] == '=' { // '-f=arg' value = shorthands[2:] outShorts = "" } else if flag.NoOptDefVal != "" { // '-f' (arg was optional) value = flag.NoOptDefVal } else if len(shorthands) > 1 { // '-farg' value = shorthands[1:] outShorts = "" } else if len(args) > 0 { // '-f arg' value = args[0] outArgs = args[1:] } else { // '-f' (arg was required) err = f.failf("flag needs an argument: %q in -%s", c, shorthands) return } if flag.ShorthandDeprecated != "" { fmt.Fprintf(f.out(), "Flag shorthand -%s has been deprecated, %s\n", flag.Shorthand, flag.ShorthandDeprecated) } err = fn(flag, value) return } func (f *FlagSet) parseShortArg(s string, args []string, fn parseFunc) (a []string, err error) { a = args shorthands := s[1:] // "shorthands" can be a series of shorthand letters of flags (e.g. "-vvv"). for len(shorthands) > 0 { shorthands, a, err = f.parseSingleShortArg(shorthands, args, fn) if err != nil { return } } return } func (f *FlagSet) parseArgs(args []string, fn parseFunc) (err error) { for len(args) > 0 { s := args[0] args = args[1:] if len(s) == 0 || s[0] != '-' || len(s) == 1 { if !f.interspersed { f.args = append(f.args, s) f.args = append(f.args, args...) return nil } f.args = append(f.args, s) continue } if s[1] == '-' { if len(s) == 2 { // "--" terminates the flags f.argsLenAtDash = len(f.args) f.args = append(f.args, args...) break } args, err = f.parseLongArg(s, args, fn) } else { args, err = f.parseShortArg(s, args, fn) } if err != nil { return } } return } // Parse parses flag definitions from the argument list, which should not // include the command name. Must be called after all flags in the FlagSet // are defined and before flags are accessed by the program. // The return value will be ErrHelp if -help was set but not defined. func (f *FlagSet) Parse(arguments []string) error { f.parsed = true if len(arguments) < 0 { return nil } f.args = make([]string, 0, len(arguments)) set := func(flag *Flag, value string) error { return f.Set(flag.Name, value) } err := f.parseArgs(arguments, set) if err != nil { switch f.errorHandling { case ContinueOnError: return err case ExitOnError: os.Exit(2) case PanicOnError: panic(err) } } return nil } type parseFunc func(flag *Flag, value string) error // ParseAll parses flag definitions from the argument list, which should not // include the command name. The arguments for fn are flag and value. Must be // called after all flags in the FlagSet are defined and before flags are // accessed by the program. The return value will be ErrHelp if -help was set // but not defined. func (f *FlagSet) ParseAll(arguments []string, fn func(flag *Flag, value string) error) error { f.parsed = true f.args = make([]string, 0, len(arguments)) err := f.parseArgs(arguments, fn) if err != nil { switch f.errorHandling { case ContinueOnError: return err case ExitOnError: os.Exit(2) case PanicOnError: panic(err) } } return nil } // Parsed reports whether f.Parse has been called. func (f *FlagSet) Parsed() bool { return f.parsed } // Parse parses the command-line flags from os.Args[1:]. Must be called // after all flags are defined and before flags are accessed by the program. func Parse() { // Ignore errors; CommandLine is set for ExitOnError. CommandLine.Parse(os.Args[1:]) } // ParseAll parses the command-line flags from os.Args[1:] and called fn for each. // The arguments for fn are flag and value. Must be called after all flags are // defined and before flags are accessed by the program. func ParseAll(fn func(flag *Flag, value string) error) { // Ignore errors; CommandLine is set for ExitOnError. CommandLine.ParseAll(os.Args[1:], fn) } // SetInterspersed sets whether to support interspersed option/non-option arguments. func SetInterspersed(interspersed bool) { CommandLine.SetInterspersed(interspersed) } // Parsed returns true if the command-line flags have been parsed. func Parsed() bool { return CommandLine.Parsed() } // CommandLine is the default set of command-line flags, parsed from os.Args. var CommandLine = NewFlagSet(os.Args[0], ExitOnError) // NewFlagSet returns a new, empty flag set with the specified name, // error handling property and SortFlags set to true. func NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet { f := &FlagSet{ name: name, errorHandling: errorHandling, argsLenAtDash: -1, interspersed: true, SortFlags: true, } return f } // SetInterspersed sets whether to support interspersed option/non-option arguments. func (f *FlagSet) SetInterspersed(interspersed bool) { f.interspersed = interspersed } // Init sets the name and error handling property for a flag set. // By default, the zero FlagSet uses an empty name and the // ContinueOnError error handling policy. func (f *FlagSet) Init(name string, errorHandling ErrorHandling) { f.name = name f.errorHandling = errorHandling f.argsLenAtDash = -1 }
GlenDC/zerodisk
vendor/github.com/spf13/pflag/flag.go
GO
apache-2.0
33,559
/**************************************************************************** Copyright (c) 2010-2011 cocos2d-x.org http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ package org.cocos2dx.lib; import android.app.AlertDialog; import android.content.DialogInterface; import android.os.Handler; import android.os.Message; import java.lang.ref.WeakReference; public class Cocos2dxHandler extends Handler { // =========================================================== // Constants // =========================================================== public final static int HANDLER_SHOW_DIALOG = 1; // =========================================================== // Fields // =========================================================== private WeakReference<Cocos2dxActivity> mActivity; // =========================================================== // Constructors // =========================================================== public Cocos2dxHandler(Cocos2dxActivity activity) { this.mActivity = new WeakReference<Cocos2dxActivity>(activity); } // =========================================================== // Getter & Setter // =========================================================== // =========================================================== // Methods for/from SuperClass/Interfaces // =========================================================== // =========================================================== // Methods // =========================================================== public void handleMessage(Message msg) { switch (msg.what) { case Cocos2dxHandler.HANDLER_SHOW_DIALOG: showDialog(msg); break; } } private void showDialog(Message msg) { Cocos2dxActivity theActivity = this.mActivity.get(); DialogMessage dialogMessage = (DialogMessage)msg.obj; new AlertDialog.Builder(theActivity) .setTitle(dialogMessage.title) .setMessage(dialogMessage.message) .setPositiveButton("Ok", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }).create().show(); } // =========================================================== // Inner and Anonymous Classes // =========================================================== public static class DialogMessage { public String title; public String message; public DialogMessage(String title, String message) { this.title = title; this.message = message; } } }
PJ-FDU/fudancraft
cocos2d/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHandler.java
Java
apache-2.0
3,978
/*! ****************************************************************************** * * Pentaho Data Integration * * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************/ package org.pentaho.di.trans.steps.stepsmetrics; import java.util.concurrent.ConcurrentHashMap; import org.pentaho.di.core.row.RowMetaInterface; import org.pentaho.di.trans.step.BaseStepData; import org.pentaho.di.trans.step.StepDataInterface; import org.pentaho.di.trans.step.StepInterface; /** * @author Samatar * @since 16-06-2008 * */ public class StepsMetricsData extends BaseStepData implements StepDataInterface { boolean continueLoop; public ConcurrentHashMap<Integer, StepInterface> stepInterfaces; /** The metadata we send out */ public RowMetaInterface outputRowMeta; public String realstepnamefield; public String realstepidfield; public String realsteplinesinputfield; public String realsteplinesoutputfield; public String realsteplinesreadfield; public String realsteplinesupdatedfield; public String realsteplineswrittentfield; public String realsteplineserrorsfield; public String realstepsecondsfield; public StepsMetricsData() { super(); continueLoop = true; realstepnamefield = null; realstepidfield = null; realsteplinesinputfield = null; realsteplinesoutputfield = null; realsteplinesreadfield = null; realsteplinesupdatedfield = null; realsteplineswrittentfield = null; realsteplineserrorsfield = null; realstepsecondsfield = null; } }
stepanovdg/pentaho-kettle
engine/src/main/java/org/pentaho/di/trans/steps/stepsmetrics/StepsMetricsData.java
Java
apache-2.0
2,257
package netlink import ( "net" "syscall" "unsafe" "github.com/coreos/rkt/Godeps/_workspace/src/github.com/vishvananda/netlink/nl" ) const ( NDA_UNSPEC = iota NDA_DST NDA_LLADDR NDA_CACHEINFO NDA_PROBES NDA_VLAN NDA_PORT NDA_VNI NDA_IFINDEX NDA_MAX = NDA_IFINDEX ) // Neighbor Cache Entry States. const ( NUD_NONE = 0x00 NUD_INCOMPLETE = 0x01 NUD_REACHABLE = 0x02 NUD_STALE = 0x04 NUD_DELAY = 0x08 NUD_PROBE = 0x10 NUD_FAILED = 0x20 NUD_NOARP = 0x40 NUD_PERMANENT = 0x80 ) // Neighbor Flags const ( NTF_USE = 0x01 NTF_SELF = 0x02 NTF_MASTER = 0x04 NTF_PROXY = 0x08 NTF_ROUTER = 0x80 ) type Ndmsg struct { Family uint8 Index uint32 State uint16 Flags uint8 Type uint8 } func deserializeNdmsg(b []byte) *Ndmsg { var dummy Ndmsg return (*Ndmsg)(unsafe.Pointer(&b[0:unsafe.Sizeof(dummy)][0])) } func (msg *Ndmsg) Serialize() []byte { return (*(*[unsafe.Sizeof(*msg)]byte)(unsafe.Pointer(msg)))[:] } func (msg *Ndmsg) Len() int { return int(unsafe.Sizeof(*msg)) } // NeighAdd will add an IP to MAC mapping to the ARP table // Equivalent to: `ip neigh add ....` func NeighAdd(neigh *Neigh) error { return neighAdd(neigh, syscall.NLM_F_CREATE|syscall.NLM_F_EXCL) } // NeighAdd will add or replace an IP to MAC mapping to the ARP table // Equivalent to: `ip neigh replace....` func NeighSet(neigh *Neigh) error { return neighAdd(neigh, syscall.NLM_F_CREATE) } // NeighAppend will append an entry to FDB // Equivalent to: `bridge fdb append...` func NeighAppend(neigh *Neigh) error { return neighAdd(neigh, syscall.NLM_F_CREATE|syscall.NLM_F_APPEND) } func neighAdd(neigh *Neigh, mode int) error { req := nl.NewNetlinkRequest(syscall.RTM_NEWNEIGH, mode|syscall.NLM_F_ACK) return neighHandle(neigh, req) } // NeighDel will delete an IP address from a link device. // Equivalent to: `ip addr del $addr dev $link` func NeighDel(neigh *Neigh) error { req := nl.NewNetlinkRequest(syscall.RTM_DELNEIGH, syscall.NLM_F_ACK) return neighHandle(neigh, req) } func neighHandle(neigh *Neigh, req *nl.NetlinkRequest) error { var family int if neigh.Family > 0 { family = neigh.Family } else { family = nl.GetIPFamily(neigh.IP) } msg := Ndmsg{ Family: uint8(family), Index: uint32(neigh.LinkIndex), State: uint16(neigh.State), Type: uint8(neigh.Type), Flags: uint8(neigh.Flags), } req.AddData(&msg) ipData := neigh.IP.To4() if ipData == nil { ipData = neigh.IP.To16() } dstData := nl.NewRtAttr(NDA_DST, ipData) req.AddData(dstData) hwData := nl.NewRtAttr(NDA_LLADDR, []byte(neigh.HardwareAddr)) req.AddData(hwData) _, err := req.Execute(syscall.NETLINK_ROUTE, 0) return err } // NeighList gets a list of IP-MAC mappings in the system (ARP table). // Equivalent to: `ip neighbor show`. // The list can be filtered by link and ip family. func NeighList(linkIndex, family int) ([]Neigh, error) { req := nl.NewNetlinkRequest(syscall.RTM_GETNEIGH, syscall.NLM_F_DUMP) msg := Ndmsg{ Family: uint8(family), } req.AddData(&msg) msgs, err := req.Execute(syscall.NETLINK_ROUTE, syscall.RTM_NEWNEIGH) if err != nil { return nil, err } res := make([]Neigh, 0) for _, m := range msgs { ndm := deserializeNdmsg(m) if linkIndex != 0 && int(ndm.Index) != linkIndex { // Ignore messages from other interfaces continue } neigh, err := NeighDeserialize(m) if err != nil { continue } res = append(res, *neigh) } return res, nil } func NeighDeserialize(m []byte) (*Neigh, error) { msg := deserializeNdmsg(m) neigh := Neigh{ LinkIndex: int(msg.Index), Family: int(msg.Family), State: int(msg.State), Type: int(msg.Type), Flags: int(msg.Flags), } attrs, err := nl.ParseRouteAttr(m[msg.Len():]) if err != nil { return nil, err } for _, attr := range attrs { switch attr.Attr.Type { case NDA_DST: neigh.IP = net.IP(attr.Value) case NDA_LLADDR: neigh.HardwareAddr = net.HardwareAddr(attr.Value) } } return &neigh, nil }
ChengTiesheng/rkt
Godeps/_workspace/src/github.com/vishvananda/netlink/neigh_linux.go
GO
apache-2.0
4,014
# Copyright (c) 2010-2013 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import unittest from test.unit.proxy import test_server from test.unit.proxy.test_server import teardown from swift.obj import mem_server def setup(): test_server.do_setup(mem_server) class TestController(test_server.TestController): pass class TestProxyServer(test_server.TestProxyServer): pass class TestObjectController(test_server.TestObjectController): def test_PUT_no_etag_fallocate(self): # mem server doesn't call fallocate(), believe it or not pass # these tests all go looking in the filesystem def test_policy_IO(self): pass def test_PUT_ec(self): pass def test_PUT_ec_multiple_segments(self): pass def test_PUT_ec_fragment_archive_etag_mismatch(self): pass class TestContainerController(test_server.TestContainerController): pass class TestAccountController(test_server.TestAccountController): pass class TestAccountControllerFakeGetResponse( test_server.TestAccountControllerFakeGetResponse): pass if __name__ == '__main__': setup() try: unittest.main() finally: teardown()
dencaval/swift
test/unit/proxy/test_mem_server.py
Python
apache-2.0
1,731
/*! ****************************************************************************** * * Pentaho Data Integration * * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************/ package org.pentaho.di.ui.trans.steps.reservoirsampling; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.ShellAdapter; import org.eclipse.swt.events.ShellEvent; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.pentaho.di.core.Const; import org.pentaho.di.core.util.Utils; import org.pentaho.di.i18n.BaseMessages; import org.pentaho.di.trans.TransMeta; import org.pentaho.di.trans.step.BaseStepMeta; import org.pentaho.di.trans.step.StepDialogInterface; import org.pentaho.di.trans.steps.reservoirsampling.ReservoirSamplingMeta; import org.pentaho.di.ui.core.widget.TextVar; import org.pentaho.di.ui.trans.step.BaseStepDialog; /** * The UI class for the ReservoirSampling step * * @author Mark Hall (mhall{[at]}pentaho.org * @version 1.0 */ public class ReservoirSamplingDialog extends BaseStepDialog implements StepDialogInterface { private static Class<?> PKG = ReservoirSamplingMeta.class; // for i18n purposes, needed by Translator2!! // various UI bits and pieces private Label m_wlStepname; private Text m_wStepname; private FormData m_fdlStepname; private FormData m_fdStepname; private Label m_wlSampleSize; private TextVar m_wSampleSize; private FormData m_fdlSampleSize; private FormData m_fdSampleSize; private Label m_wlSeed; private TextVar m_wSeed; private FormData m_fdlSeed; private FormData m_fdSeed; /** * meta data for the step. A copy is made so that changes, in terms of choices made by the user, can be detected. */ private ReservoirSamplingMeta m_currentMeta; private ReservoirSamplingMeta m_originalMeta; public ReservoirSamplingDialog( Shell parent, Object in, TransMeta tr, String sname ) { super( parent, (BaseStepMeta) in, tr, sname ); // The order here is important... // m_currentMeta is looked at for changes m_currentMeta = (ReservoirSamplingMeta) in; m_originalMeta = (ReservoirSamplingMeta) m_currentMeta.clone(); } /** * Open the dialog * * @return the step name */ public String open() { Shell parent = getParent(); Display display = parent.getDisplay(); shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MIN | SWT.MAX ); props.setLook( shell ); setShellImage( shell, m_currentMeta ); // used to listen to a text field (m_wStepname) ModifyListener lsMod = new ModifyListener() { public void modifyText( ModifyEvent e ) { m_currentMeta.setChanged(); } }; changed = m_currentMeta.hasChanged(); FormLayout formLayout = new FormLayout(); formLayout.marginWidth = Const.FORM_MARGIN; formLayout.marginHeight = Const.FORM_MARGIN; shell.setLayout( formLayout ); shell.setText( BaseMessages.getString( PKG, "ReservoirSamplingDialog.Shell.Title" ) ); int middle = props.getMiddlePct(); int margin = Const.MARGIN; // Stepname line m_wlStepname = new Label( shell, SWT.RIGHT ); m_wlStepname.setText( BaseMessages.getString( PKG, "ReservoirSamplingDialog.StepName.Label" ) ); props.setLook( m_wlStepname ); m_fdlStepname = new FormData(); m_fdlStepname.left = new FormAttachment( 0, 0 ); m_fdlStepname.right = new FormAttachment( middle, -margin ); m_fdlStepname.top = new FormAttachment( 0, margin ); m_wlStepname.setLayoutData( m_fdlStepname ); m_wStepname = new Text( shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); m_wStepname.setText( stepname ); props.setLook( m_wStepname ); m_wStepname.addModifyListener( lsMod ); // format the text field m_fdStepname = new FormData(); m_fdStepname.left = new FormAttachment( middle, 0 ); m_fdStepname.top = new FormAttachment( 0, margin ); m_fdStepname.right = new FormAttachment( 100, 0 ); m_wStepname.setLayoutData( m_fdStepname ); // Sample size text field m_wlSampleSize = new Label( shell, SWT.RIGHT ); m_wlSampleSize.setText( BaseMessages.getString( PKG, "ReservoirSamplingDialog.SampleSize.Label" ) ); props.setLook( m_wlSampleSize ); m_fdlSampleSize = new FormData(); m_fdlSampleSize.left = new FormAttachment( 0, 0 ); m_fdlSampleSize.right = new FormAttachment( middle, -margin ); m_fdlSampleSize.top = new FormAttachment( m_wStepname, margin ); m_wlSampleSize.setLayoutData( m_fdlSampleSize ); m_wSampleSize = new TextVar( transMeta, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( m_wSampleSize ); m_wSampleSize.addModifyListener( lsMod ); m_wSampleSize.setText( "" + m_originalMeta.getSampleSize() ); m_fdSampleSize = new FormData(); m_fdSampleSize.left = new FormAttachment( m_wlSampleSize, margin ); m_fdSampleSize.right = new FormAttachment( 100, -margin ); m_fdSampleSize.top = new FormAttachment( m_wStepname, margin ); m_wSampleSize.setLayoutData( m_fdSampleSize ); // Seed text field m_wlSeed = new Label( shell, SWT.RIGHT ); m_wlSeed.setText( BaseMessages.getString( PKG, "ReservoirSamplingDialog.Seed.Label" ) ); props.setLook( m_wlSeed ); m_fdlSeed = new FormData(); m_fdlSeed.left = new FormAttachment( 0, 0 ); m_fdlSeed.right = new FormAttachment( middle, -margin ); m_fdlSeed.top = new FormAttachment( m_wSampleSize, margin ); m_wlSeed.setLayoutData( m_fdlSeed ); m_wSeed = new TextVar( transMeta, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( m_wSeed ); m_wSeed.addModifyListener( lsMod ); m_wSeed.setText( "" + m_originalMeta.getSeed() ); m_fdSeed = new FormData(); m_fdSeed.left = new FormAttachment( m_wlSeed, margin ); m_fdSeed.right = new FormAttachment( 100, -margin ); m_fdSeed.top = new FormAttachment( m_wSampleSize, margin ); m_wSeed.setLayoutData( m_fdSeed ); // Some buttons wOK = new Button( shell, SWT.PUSH ); wOK.setText( BaseMessages.getString( PKG, "System.Button.OK" ) ); wCancel = new Button( shell, SWT.PUSH ); wCancel.setText( BaseMessages.getString( PKG, "System.Button.Cancel" ) ); setButtonPositions( new Button[] { wOK, wCancel }, margin, m_wSeed ); // Add listeners lsCancel = new Listener() { public void handleEvent( Event e ) { cancel(); } }; lsOK = new Listener() { public void handleEvent( Event e ) { ok(); } }; wCancel.addListener( SWT.Selection, lsCancel ); wOK.addListener( SWT.Selection, lsOK ); lsDef = new SelectionAdapter() { public void widgetDefaultSelected( SelectionEvent e ) { ok(); } }; m_wStepname.addSelectionListener( lsDef ); // Detect X or ALT-F4 or something that kills this window... shell.addShellListener( new ShellAdapter() { public void shellClosed( ShellEvent e ) { cancel(); } } ); // Whenever something changes, set the tooltip to the expanded version: m_wSampleSize.addModifyListener( new ModifyListener() { public void modifyText( ModifyEvent e ) { m_wSampleSize.setToolTipText( transMeta.environmentSubstitute( m_wSampleSize.getText() ) ); } } ); // Whenever something changes, set the tooltip to the expanded version: m_wSeed.addModifyListener( new ModifyListener() { public void modifyText( ModifyEvent e ) { m_wSeed.setToolTipText( transMeta.environmentSubstitute( m_wSeed.getText() ) ); } } ); // Set the shell size, based upon previous time... setSize(); m_currentMeta.setChanged( changed ); shell.open(); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep(); } } return stepname; } private void cancel() { stepname = null; m_currentMeta.setChanged( changed ); dispose(); } private void ok() { if ( Utils.isEmpty( m_wStepname.getText() ) ) { return; } stepname = m_wStepname.getText(); // return value m_currentMeta.setSampleSize( m_wSampleSize.getText() ); m_currentMeta.setSeed( m_wSeed.getText() ); System.out.println( "OK:" + m_wSampleSize + ":" + m_wSeed ); if ( !m_originalMeta.equals( m_currentMeta ) ) { m_currentMeta.setChanged(); changed = m_currentMeta.hasChanged(); } dispose(); } }
mkambol/pentaho-kettle
ui/src/main/java/org/pentaho/di/ui/trans/steps/reservoirsampling/ReservoirSamplingDialog.java
Java
apache-2.0
9,666
/* * Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except * in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.wso2.carbon.deployment.synchronizer.ui.client; import org.apache.axis2.AxisFault; import org.apache.axis2.client.Options; import org.apache.axis2.client.ServiceClient; import org.apache.axis2.context.ConfigurationContext; import org.wso2.carbon.deployment.synchronizer.stub.types.DeploymentSynchronizerAdminStub; import org.wso2.carbon.deployment.synchronizer.stub.types.util.DeploymentSynchronizerConfiguration; import org.wso2.carbon.deployment.synchronizer.stub.types.util.RepositoryConfigParameter; import java.util.Locale; public class DeploymentSyncAdminClient { private DeploymentSynchronizerAdminStub stub; public DeploymentSyncAdminClient(ConfigurationContext configCtx, String backendServerURL, String cookie, Locale locale) throws AxisFault { String serviceURL = backendServerURL + "DeploymentSynchronizerAdmin"; stub = new DeploymentSynchronizerAdminStub(configCtx, serviceURL); ServiceClient client = stub._getServiceClient(); Options options = client.getOptions(); options.setManageSession(true); options.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie); } public DeploymentSynchronizerConfiguration getConfiguration() throws Exception { return stub.getSynchronizerConfigurationForCarbonRepository(); } public void disableSynchronizer() throws Exception { stub.disableSynchronizerForCarbonRepository(); } public void enableSynchronizer(DeploymentSynchronizerConfiguration config) throws Exception { stub.enableSynchronizerForCarbonRepository(config); } public void updateSynchronizer(DeploymentSynchronizerConfiguration config) throws Exception { stub.updateSynchronizerForCarbonRepository(config); } public long getLastCommitTime() throws Exception { return stub.getLastCommitTime(); } public long getLastCheckoutTime() throws Exception { return stub.getLastCheckoutTime(); } public void commit() throws Exception { stub.commit(); } public void checkout() throws Exception { stub.checkout(); } public RepositoryConfigParameter[] getParamsByRepositoryType(String repositoryType) throws Exception{ return stub.getParamsByRepositoryType(repositoryType); } public String[] getRepositoryTypes() throws Exception{ return stub.getRepositoryTypes(); } }
ravihansa3000/carbon-commons
components/deployment-synchronizer/org.wso2.carbon.deployment.synchronizer.ui/src/main/java/org/wso2/carbon/deployment/synchronizer/ui/client/DeploymentSyncAdminClient.java
Java
apache-2.0
3,148
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.facebook.presto.raptor.metadata; import com.facebook.presto.raptor.RaptorColumnHandle; import com.facebook.presto.spi.Domain; import com.facebook.presto.spi.PrestoException; import com.facebook.presto.spi.Range; import com.facebook.presto.spi.SortedRangeSet; import com.facebook.presto.spi.TupleDomain; import com.facebook.presto.spi.type.BigintType; import com.facebook.presto.spi.type.BooleanType; import com.facebook.presto.spi.type.DateType; import com.facebook.presto.spi.type.DoubleType; import com.facebook.presto.spi.type.TimestampType; import com.facebook.presto.spi.type.Type; import com.facebook.presto.spi.type.VarcharType; import com.google.common.collect.ImmutableList; import io.airlift.slice.Slice; import java.sql.JDBCType; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.List; import java.util.Map.Entry; import java.util.StringJoiner; import static com.facebook.presto.raptor.metadata.DatabaseShardManager.maxColumn; import static com.facebook.presto.raptor.metadata.DatabaseShardManager.minColumn; import static com.facebook.presto.raptor.storage.ShardStats.truncateIndexValue; import static com.facebook.presto.spi.StandardErrorCode.INTERNAL_ERROR; import static com.google.common.base.MoreObjects.toStringHelper; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.collect.Iterables.getOnlyElement; import static java.lang.String.format; class ShardPredicate { private final String predicate; private final List<JDBCType> types; private final List<Object> values; private ShardPredicate(String predicate, List<JDBCType> types, List<Object> values) { this.predicate = checkNotNull(predicate, "predicate is null"); this.types = ImmutableList.copyOf(checkNotNull(types, "types is null")); this.values = ImmutableList.copyOf(checkNotNull(values, "values is null")); checkArgument(types.size() == values.size(), "types and values sizes do not match"); } public String getPredicate() { return predicate; } public void bind(PreparedStatement statement) throws SQLException { for (int i = 0; i < types.size(); i++) { JDBCType type = types.get(i); Object value = values.get(i); bindValue(statement, type, value, i + 1); } } @Override public String toString() { return toStringHelper(this) .addValue(predicate) .toString(); } public static ShardPredicate create(TupleDomain<RaptorColumnHandle> tupleDomain) { StringJoiner predicate = new StringJoiner(" AND ").setEmptyValue("true"); ImmutableList.Builder<JDBCType> types = ImmutableList.builder(); ImmutableList.Builder<Object> values = ImmutableList.builder(); for (Entry<RaptorColumnHandle, Domain> entry : tupleDomain.getDomains().entrySet()) { Domain domain = entry.getValue(); if (domain.isNullAllowed() || domain.isAll()) { continue; } RaptorColumnHandle handle = entry.getKey(); Type type = handle.getColumnType(); JDBCType jdbcType = jdbcType(type); if (jdbcType == null) { continue; } // TODO: support multiple ranges SortedRangeSet ranges = domain.getRanges(); if (ranges.getRangeCount() != 1) { continue; } Range range = getOnlyElement(ranges.getRanges()); Object minValue = null; Object maxValue = null; if (range.isSingleValue()) { minValue = range.getSingleValue(); maxValue = range.getSingleValue(); } else { if (!range.getLow().isLowerUnbounded()) { minValue = range.getLow().getValue(); } if (!range.getHigh().isUpperUnbounded()) { maxValue = range.getHigh().getValue(); } } String min = minColumn(handle.getColumnId()); String max = maxColumn(handle.getColumnId()); if (minValue != null) { predicate.add(format("(%s >= ? OR %s IS NULL)", max, max)); types.add(jdbcType); values.add(minValue); } if (maxValue != null) { predicate.add(format("(%s <= ? OR %s IS NULL)", min, min)); types.add(jdbcType); values.add(maxValue); } } return new ShardPredicate(predicate.toString(), types.build(), values.build()); } public static void bindValue(PreparedStatement statement, JDBCType type, Object value, int index) throws SQLException { if (value == null) { statement.setNull(index, type.getVendorTypeNumber()); return; } switch (type) { case BOOLEAN: statement.setBoolean(index, (boolean) value); return; case INTEGER: statement.setInt(index, ((Number) value).intValue()); return; case BIGINT: statement.setLong(index, ((Number) value).longValue()); return; case DOUBLE: statement.setDouble(index, ((Number) value).doubleValue()); return; case VARBINARY: statement.setBytes(index, truncateIndexValue((Slice) value).getBytes()); return; } throw new PrestoException(INTERNAL_ERROR, "Unhandled type: " + type); } public static JDBCType jdbcType(Type type) { if (type.equals(BooleanType.BOOLEAN)) { return JDBCType.BOOLEAN; } if (type.equals(BigintType.BIGINT) || type.equals(TimestampType.TIMESTAMP)) { return JDBCType.BIGINT; } if (type.equals(DoubleType.DOUBLE)) { return JDBCType.DOUBLE; } if (type.equals(DateType.DATE)) { return JDBCType.INTEGER; } if (type.equals(VarcharType.VARCHAR)) { return JDBCType.VARBINARY; } return null; } }
kuzemchik/presto
presto-raptor/src/main/java/com/facebook/presto/raptor/metadata/ShardPredicate.java
Java
apache-2.0
6,963
/*! ****************************************************************************** * * Pentaho Data Integration * * Copyright (C) 2002-2013 by Pentaho : http://www.pentaho.com * ******************************************************************************* * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************/ package org.pentaho.di.trans.steps.xmlinputsax; import org.pentaho.di.core.Const; import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.core.exception.KettleValueException; import org.pentaho.di.core.row.RowMeta; import org.pentaho.di.core.row.ValueMetaInterface; import org.pentaho.di.trans.Trans; import org.pentaho.di.trans.TransMeta; import org.pentaho.di.trans.step.BaseStep; import org.pentaho.di.trans.step.StepDataInterface; import org.pentaho.di.trans.step.StepInterface; import org.pentaho.di.trans.step.StepMeta; import org.pentaho.di.trans.step.StepMetaInterface; /** * Read all sorts of text files, convert them to rows and writes these to one or more output streams. * * @author Matt * @since 4-apr-2003 */ public class XMLInputSax extends BaseStep implements StepInterface { private XMLInputSaxMeta meta; private XMLInputSaxData data; public XMLInputSax( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta, Trans trans ) { super( stepMeta, stepDataInterface, copyNr, transMeta, trans ); } public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { if ( first ) { first = false; data.outputRowMeta = new RowMeta(); meta.getFields( data.outputRowMeta, getStepname(), null, null, this, repository, metaStore ); // For String to <type> conversions, we allocate a conversion meta data row as well... // data.convertRowMeta = data.outputRowMeta.cloneToType( ValueMetaInterface.TYPE_STRING ); } Object[] outputRowData = getRowFromXML(); if ( outputRowData == null ) { setOutputDone(); // signal end to receiver(s) return false; // This is the end of this step. } if ( log.isRowLevel() ) { logRowlevel( "Read row: " + data.outputRowMeta.getString( outputRowData ) ); } putRow( data.outputRowMeta, outputRowData ); // limit has been reached: stop now. // if ( meta.getRowLimit() > 0 && data.rownr >= meta.getRowLimit() ) { setOutputDone(); return false; } return true; } private Object[] getRowFromXML() throws KettleValueException { // finished reading the file, read the next file! // if ( data.document == null ) { data.filename = null; } else if ( !data.document.hasNext() ) { data.filename = null; } // First, see if we need to open a new file if ( data.filename == null ) { if ( !openNextFile() ) { return null; } } Object[] outputRowData = data.document.getNext(); int outputIndex = meta.getInputFields().length; // Node itemNode = XMLHandler.getSubNodeByNr(data.section, // data.itemElement, data.itemPosition); // data.itemPosition++; // See if we need to add the filename to the row... // if ( meta.includeFilename() && !Const.isEmpty( meta.getFilenameField() ) ) { outputRowData[outputIndex++] = data.filename; } // See if we need to add the row number to the row... if ( meta.includeRowNumber() && !Const.isEmpty( meta.getRowNumberField() ) ) { outputRowData[outputIndex] = new Long( data.rownr ); } data.rownr++; return outputRowData; } private boolean openNextFile() { try { if ( data.filenr >= data.files.length ) { // finished processing! if ( log.isDetailed() ) { logDetailed( "Finished processing files." ); } return false; } // Is this the last file? data.last_file = ( data.filenr == data.files.length - 1 ); data.filename = environmentSubstitute( data.files[data.filenr] ); if ( log.isBasic() ) { logBasic( "Opening file: " + data.filename ); } // Move file pointer ahead! data.filenr++; // Open the XML document data.document = new XMLInputSaxDataRetriever( log, data.filename, meta, data ); data.document.runExample(); } catch ( Exception e ) { logError( "Couldn't open file #" + data.filenr + " : " + data.filename, e ); stopAll(); setErrors( 1 ); return false; } return true; } public boolean init( StepMetaInterface smi, StepDataInterface sdi ) { meta = (XMLInputSaxMeta) smi; data = (XMLInputSaxData) sdi; if ( super.init( smi, sdi ) ) { data.files = meta.getFilePaths( getTransMeta() ); if ( data.files == null || data.files.length == 0 ) { logError( "No file(s) specified! Stop processing." ); return false; } if ( meta.getInputPosition().length == 0 ) { logError( "No location specified! Stop processing." ); return false; } if ( meta.getInputFields().length == 0 ) { logError( "No fields specified! Stop processing." ); return false; } data.rownr = 1L; return true; } return false; } public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { meta = (XMLInputSaxMeta) smi; data = (XMLInputSaxData) sdi; super.dispose( smi, sdi ); } }
YuryBY/pentaho-kettle
engine/src/org/pentaho/di/trans/steps/xmlinputsax/XMLInputSax.java
Java
apache-2.0
6,001
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.elasticsearch.cluster.routing.allocation.allocator; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.IntroSorter; import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.RoutingNode; import org.elasticsearch.cluster.routing.RoutingNodes; import org.elasticsearch.cluster.routing.ShardRoutingState; import org.elasticsearch.cluster.routing.allocation.FailedRerouteAllocation; import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; import org.elasticsearch.cluster.routing.allocation.StartedRerouteAllocation; import org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders; import org.elasticsearch.cluster.routing.allocation.decider.Decision; import org.elasticsearch.cluster.routing.allocation.decider.Decision.Type; import org.elasticsearch.common.component.AbstractComponent; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.gateway.PriorityComparator; import org.elasticsearch.node.settings.NodeSettingsService; import java.util.*; import java.util.function.Predicate; import static org.elasticsearch.cluster.routing.ShardRoutingState.RELOCATING; /** * The {@link BalancedShardsAllocator} re-balances the nodes allocations * within an cluster based on a {@link WeightFunction}. The clusters balance is defined by four parameters which can be set * in the cluster update API that allows changes in real-time: * <p/> * <ul><li><code>cluster.routing.allocation.balance.shard</code> - The <b>shard balance</b> defines the weight factor * for shards allocated on a {@link RoutingNode}</li> * <li><code>cluster.routing.allocation.balance.index</code> - The <b>index balance</b> defines a factor to the number * of {@link org.elasticsearch.cluster.routing.ShardRouting}s per index allocated on a specific node</li> * <li><code>cluster.routing.allocation.balance.threshold</code> - A <b>threshold</b> to set the minimal optimization * value of operations that should be performed</li> * </ul> * <p/> * These parameters are combined in a {@link WeightFunction} that allows calculation of node weights which * are used to re-balance shards based on global as well as per-index factors. */ public class BalancedShardsAllocator extends AbstractComponent implements ShardsAllocator { public static final String SETTING_THRESHOLD = "cluster.routing.allocation.balance.threshold"; public static final String SETTING_INDEX_BALANCE_FACTOR = "cluster.routing.allocation.balance.index"; public static final String SETTING_SHARD_BALANCE_FACTOR = "cluster.routing.allocation.balance.shard"; private static final float DEFAULT_INDEX_BALANCE_FACTOR = 0.55f; private static final float DEFAULT_SHARD_BALANCE_FACTOR = 0.45f; class ApplySettings implements NodeSettingsService.Listener { @Override public void onRefreshSettings(Settings settings) { final float indexBalance = settings.getAsFloat(SETTING_INDEX_BALANCE_FACTOR, weightFunction.indexBalance); final float shardBalance = settings.getAsFloat(SETTING_SHARD_BALANCE_FACTOR, weightFunction.shardBalance); float threshold = settings.getAsFloat(SETTING_THRESHOLD, BalancedShardsAllocator.this.threshold); if (threshold <= 0.0f) { throw new IllegalArgumentException("threshold must be greater than 0.0f but was: " + threshold); } BalancedShardsAllocator.this.threshold = threshold; BalancedShardsAllocator.this.weightFunction = new WeightFunction(indexBalance, shardBalance); } } private volatile WeightFunction weightFunction = new WeightFunction(DEFAULT_INDEX_BALANCE_FACTOR, DEFAULT_SHARD_BALANCE_FACTOR); private volatile float threshold = 1.0f; public BalancedShardsAllocator(Settings settings) { this(settings, new NodeSettingsService(settings)); } @Inject public BalancedShardsAllocator(Settings settings, NodeSettingsService nodeSettingsService) { super(settings); ApplySettings applySettings = new ApplySettings(); applySettings.onRefreshSettings(settings); nodeSettingsService.addListener(applySettings); } @Override public void applyStartedShards(StartedRerouteAllocation allocation) { /* ONLY FOR GATEWAYS */ } @Override public void applyFailedShards(FailedRerouteAllocation allocation) { /* ONLY FOR GATEWAYS */ } @Override public boolean allocateUnassigned(RoutingAllocation allocation) { return rebalance(allocation); } @Override public boolean rebalance(RoutingAllocation allocation) { final Balancer balancer = new Balancer(logger, allocation, weightFunction, threshold); return balancer.balance(); } @Override public boolean move(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { final Balancer balancer = new Balancer(logger, allocation, weightFunction, threshold); return balancer.move(shardRouting, node); } /** * Returns the currently configured delta threshold */ public float getThreshold() { return threshold; } /** * Returns the index related weight factor. */ public float getIndexBalance() { return weightFunction.indexBalance; } /** * Returns the shard related weight factor. */ public float getShardBalance() { return weightFunction.shardBalance; } /** * This class is the primary weight function used to create balanced over nodes and shards in the cluster. * Currently this function has 3 properties: * <ul> * <li><code>index balance</code> - balance property over shards per index</li> * <li><code>shard balance</code> - balance property over shards per cluster</li> * </ul> * <p> * Each of these properties are expressed as factor such that the properties factor defines the relative importance of the property for the * weight function. For example if the weight function should calculate the weights only based on a global (shard) balance the index balance * can be set to <tt>0.0</tt> and will in turn have no effect on the distribution. * </p> * The weight per index is calculated based on the following formula: * <ul> * <li> * <code>weight<sub>index</sub>(node, index) = indexBalance * (node.numShards(index) - avgShardsPerNode(index))</code> * </li> * <li> * <code>weight<sub>node</sub>(node, index) = shardBalance * (node.numShards() - avgShardsPerNode)</code> * </li> * </ul> * <code>weight(node, index) = weight<sub>index</sub>(node, index) + weight<sub>node</sub>(node, index)</code> */ public static class WeightFunction { private final float indexBalance; private final float shardBalance; private final float[] theta; public WeightFunction(float indexBalance, float shardBalance) { float sum = indexBalance + shardBalance; if (sum <= 0.0f) { throw new IllegalArgumentException("Balance factors must sum to a value > 0 but was: " + sum); } theta = new float[]{shardBalance / sum, indexBalance / sum}; this.indexBalance = indexBalance; this.shardBalance = shardBalance; } public float weight(Operation operation, Balancer balancer, ModelNode node, String index) { final float weightShard = (node.numShards() - balancer.avgShardsPerNode()); final float weightIndex = (node.numShards(index) - balancer.avgShardsPerNode(index)); assert theta != null; return theta[0] * weightShard + theta[1] * weightIndex; } } /** * An enum that donates the actual operation the {@link WeightFunction} is * applied to. */ public static enum Operation { /** * Provided during balance operations. */ BALANCE, /** * Provided during initial allocation operation for unassigned shards. */ ALLOCATE, /** * Provided during move operation. */ MOVE } /** * A {@link Balancer} */ public static class Balancer { private final ESLogger logger; private final Map<String, ModelNode> nodes = new HashMap<>(); private final HashSet<String> indices = new HashSet<>(); private final RoutingAllocation allocation; private final RoutingNodes routingNodes; private final WeightFunction weight; private final float threshold; private final MetaData metaData; private final Predicate<ShardRouting> assignedFilter = shard -> shard.assignedToNode(); public Balancer(ESLogger logger, RoutingAllocation allocation, WeightFunction weight, float threshold) { this.logger = logger; this.allocation = allocation; this.weight = weight; this.threshold = threshold; this.routingNodes = allocation.routingNodes(); for (RoutingNode node : routingNodes) { nodes.put(node.nodeId(), new ModelNode(node.nodeId())); } metaData = routingNodes.metaData(); } /** * Returns an array view on the nodes in the balancer. Nodes should not be removed from this list. */ private ModelNode[] nodesArray() { return nodes.values().toArray(new ModelNode[nodes.size()]); } /** * Returns the average of shards per node for the given index */ public float avgShardsPerNode(String index) { return ((float) metaData.index(index).totalNumberOfShards()) / nodes.size(); } /** * Returns the global average of shards per node */ public float avgShardsPerNode() { return ((float) metaData.totalNumberOfShards()) / nodes.size(); } /** * Returns the global average of primaries per node */ public float avgPrimariesPerNode() { return ((float) metaData.numberOfShards()) / nodes.size(); } /** * Returns a new {@link NodeSorter} that sorts the nodes based on their * current weight with respect to the index passed to the sorter. The * returned sorter is not sorted. Use {@link NodeSorter#reset(org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator.Operation, String)} * to sort based on an index. */ private NodeSorter newNodeSorter() { return new NodeSorter(nodesArray(), weight, this); } private boolean initialize(RoutingNodes routing, RoutingNodes.UnassignedShards unassigned) { if (logger.isTraceEnabled()) { logger.trace("Start distributing Shards"); } indices.addAll(allocation.routingTable().indicesRouting().keySet()); buildModelFromAssigned(routing.shards(assignedFilter)); return allocateUnassigned(unassigned); } private static float absDelta(float lower, float higher) { assert higher >= lower : higher + " lt " + lower +" but was expected to be gte"; return Math.abs(higher - lower); } private static boolean lessThan(float delta, float threshold) { /* deltas close to the threshold are "rounded" to the threshold manually to prevent floating point problems if the delta is very close to the threshold ie. 1.000000002 which can trigger unnecessary balance actions*/ return delta <= (threshold + 0.001f); } /** * Balances the nodes on the cluster model according to the weight * function. The configured threshold is the minimum delta between the * weight of the maximum node and the minimum node according to the * {@link WeightFunction}. This weight is calculated per index to * distribute shards evenly per index. The balancer tries to relocate * shards only if the delta exceeds the threshold. If the default case * the threshold is set to <tt>1.0</tt> to enforce gaining relocation * only, or in other words relocations that move the weight delta closer * to <tt>0.0</tt> * * @return <code>true</code> if the current configuration has been * changed, otherwise <code>false</code> */ public boolean balance() { if (this.nodes.isEmpty()) { /* with no nodes this is pointless */ return false; } if (logger.isTraceEnabled()) { logger.trace("Start balancing cluster"); } final RoutingNodes.UnassignedShards unassigned = routingNodes.unassigned().transactionBegin(); boolean changed = initialize(routingNodes, unassigned); if (!changed && allocation.deciders().canRebalance(allocation).type() == Type.YES) { NodeSorter sorter = newNodeSorter(); if (nodes.size() > 1) { /* skip if we only have one node */ for (String index : buildWeightOrderedIndidces(Operation.BALANCE, sorter)) { sorter.reset(Operation.BALANCE, index); final float[] weights = sorter.weights; final ModelNode[] modelNodes = sorter.modelNodes; int lowIdx = 0; int highIdx = weights.length - 1; while (true) { final ModelNode minNode = modelNodes[lowIdx]; final ModelNode maxNode = modelNodes[highIdx]; advance_range: if (maxNode.numShards(index) > 0) { final float delta = absDelta(weights[lowIdx], weights[highIdx]); if (lessThan(delta, threshold)) { if (lowIdx > 0 && highIdx-1 > 0 // is there a chance for a higher delta? && (absDelta(weights[0], weights[highIdx-1]) > threshold) // check if we need to break at all ) { /* This is a special case if allocations from the "heaviest" to the "lighter" nodes is not possible * due to some allocation decider restrictions like zone awareness. if one zone has for instance * less nodes than another zone. so one zone is horribly overloaded from a balanced perspective but we * can't move to the "lighter" shards since otherwise the zone would go over capacity. * * This break jumps straight to the condition below were we start moving from the high index towards * the low index to shrink the window we are considering for balance from the other direction. * (check shrinking the window from MAX to MIN) * See #3580 */ break advance_range; } if (logger.isTraceEnabled()) { logger.trace("Stop balancing index [{}] min_node [{}] weight: [{}] max_node [{}] weight: [{}] delta: [{}]", index, maxNode.getNodeId(), weights[highIdx], minNode.getNodeId(), weights[lowIdx], delta); } break; } if (logger.isTraceEnabled()) { logger.trace("Balancing from node [{}] weight: [{}] to node [{}] weight: [{}] delta: [{}]", maxNode.getNodeId(), weights[highIdx], minNode.getNodeId(), weights[lowIdx], delta); } /* pass the delta to the replication function to prevent relocations that only swap the weights of the two nodes. * a relocation must bring us closer to the balance if we only achieve the same delta the relocation is useless */ if (tryRelocateShard(Operation.BALANCE, minNode, maxNode, index, delta)) { /* * TODO we could be a bit smarter here, we don't need to fully sort necessarily * we could just find the place to insert linearly but the win might be minor * compared to the added complexity */ weights[lowIdx] = sorter.weight(Operation.BALANCE, modelNodes[lowIdx]); weights[highIdx] = sorter.weight(Operation.BALANCE, modelNodes[highIdx]); sorter.sort(0, weights.length); lowIdx = 0; highIdx = weights.length - 1; changed = true; continue; } } if (lowIdx < highIdx - 1) { /* Shrinking the window from MIN to MAX * we can't move from any shard from the min node lets move on to the next node * and see if the threshold still holds. We either don't have any shard of this * index on this node of allocation deciders prevent any relocation.*/ lowIdx++; } else if (lowIdx > 0) { /* Shrinking the window from MAX to MIN * now we go max to min since obviously we can't move anything to the max node * lets pick the next highest */ lowIdx = 0; highIdx--; } else { /* we are done here, we either can't relocate anymore or we are balanced */ break; } } } } } routingNodes.unassigned().transactionEnd(unassigned); return changed; } /** * This builds a initial index ordering where the indices are returned * in most unbalanced first. We need this in order to prevent over * allocations on added nodes from one index when the weight parameters * for global balance overrule the index balance at an intermediate * state. For example this can happen if we have 3 nodes and 3 indices * with 3 shards and 1 shard. At the first stage all three nodes hold * 2 shard for each index. now we add another node and the first index * is balanced moving 3 two of the nodes over to the new node since it * has no shards yet and global balance for the node is way below * average. To re-balance we need to move shards back eventually likely * to the nodes we relocated them from. */ private String[] buildWeightOrderedIndidces(Operation operation, NodeSorter sorter) { final String[] indices = this.indices.toArray(new String[this.indices.size()]); final float[] deltas = new float[indices.length]; for (int i = 0; i < deltas.length; i++) { sorter.reset(operation, indices[i]); deltas[i] = sorter.delta(); } new IntroSorter() { float pivotWeight; @Override protected void swap(int i, int j) { final String tmpIdx = indices[i]; indices[i] = indices[j]; indices[j] = tmpIdx; final float tmpDelta = deltas[i]; deltas[i] = deltas[j]; deltas[j] = tmpDelta; } @Override protected int compare(int i, int j) { return Float.compare(deltas[j], deltas[i]); } @Override protected void setPivot(int i) { pivotWeight = deltas[i]; } @Override protected int comparePivot(int j) { return Float.compare(deltas[j], pivotWeight); } }.sort(0, deltas.length); return indices; } /** * This function executes a move operation moving the given shard from * the given node to the minimal eligible node with respect to the * weight function. Iff the shard is moved the shard will be set to * {@link ShardRoutingState#RELOCATING} and a shadow instance of this * shard is created with an incremented version in the state * {@link ShardRoutingState#INITIALIZING}. * * @return <code>true</code> iff the shard has successfully been moved. */ public boolean move(ShardRouting shard, RoutingNode node ) { if (nodes.isEmpty() || !shard.started()) { /* with no nodes or a not started shard this is pointless */ return false; } if (logger.isTraceEnabled()) { logger.trace("Try moving shard [{}] from [{}]", shard, node); } final RoutingNodes.UnassignedShards unassigned = routingNodes.unassigned().transactionBegin(); boolean changed = initialize(routingNodes, unassigned); if (!changed) { final ModelNode sourceNode = nodes.get(node.nodeId()); assert sourceNode != null; final NodeSorter sorter = newNodeSorter(); sorter.reset(Operation.MOVE, shard.getIndex()); final ModelNode[] nodes = sorter.modelNodes; assert sourceNode.containsShard(shard); /* * the sorter holds the minimum weight node first for the shards index. * We now walk through the nodes until we find a node to allocate the shard. * This is not guaranteed to be balanced after this operation we still try best effort to * allocate on the minimal eligible node. */ for (ModelNode currentNode : nodes) { if (currentNode.getNodeId().equals(node.nodeId())) { continue; } RoutingNode target = routingNodes.node(currentNode.getNodeId()); Decision decision = allocation.deciders().canAllocate(shard, target, allocation); if (decision.type() == Type.YES) { // TODO maybe we can respect throttling here too? sourceNode.removeShard(shard); ShardRouting targetRelocatingShard = routingNodes.relocate(shard, target.nodeId(), allocation.clusterInfo().getShardSize(shard, ShardRouting.UNAVAILABLE_EXPECTED_SHARD_SIZE)); currentNode.addShard(targetRelocatingShard, decision); if (logger.isTraceEnabled()) { logger.trace("Moved shard [{}] to node [{}]", shard, currentNode.getNodeId()); } changed = true; break; } } } routingNodes.unassigned().transactionEnd(unassigned); return changed; } /** * Builds the internal model from all shards in the given * {@link Iterable}. All shards in the {@link Iterable} must be assigned * to a node. This method will skip shards in the state * {@link ShardRoutingState#RELOCATING} since each relocating shard has * a shadow shard in the state {@link ShardRoutingState#INITIALIZING} * on the target node which we respect during the allocation / balancing * process. In short, this method recreates the status-quo in the cluster. */ private void buildModelFromAssigned(Iterable<ShardRouting> shards) { for (ShardRouting shard : shards) { assert shard.assignedToNode(); /* we skip relocating shards here since we expect an initializing shard with the same id coming in */ if (shard.state() == RELOCATING) { continue; } ModelNode node = nodes.get(shard.currentNodeId()); assert node != null; node.addShard(shard, Decision.single(Type.YES, "Already allocated on node", node.getNodeId())); if (logger.isTraceEnabled()) { logger.trace("Assigned shard [{}] to node [{}]", shard, node.getNodeId()); } } } /** * Allocates all given shards on the minimal eligable node for the shards index * with respect to the weight function. All given shards must be unassigned. */ private boolean allocateUnassigned(RoutingNodes.UnassignedShards unassigned) { assert !nodes.isEmpty(); if (logger.isTraceEnabled()) { logger.trace("Start allocating unassigned shards"); } if (unassigned.isEmpty()) { return false; } boolean changed = false; /* * TODO: We could be smarter here and group the shards by index and then * use the sorter to save some iterations. */ final AllocationDeciders deciders = allocation.deciders(); final PriorityComparator secondaryComparator = PriorityComparator.getAllocationComparator(allocation); final Comparator<ShardRouting> comparator = new Comparator<ShardRouting>() { @Override public int compare(ShardRouting o1, ShardRouting o2) { if (o1.primary() ^ o2.primary()) { return o1.primary() ? -1 : o2.primary() ? 1 : 0; } final int indexCmp; if ((indexCmp = o1.index().compareTo(o2.index())) == 0) { return o1.getId() - o2.getId(); } // this comparator is more expensive than all the others up there // that's why it's added last even though it could be easier to read // if we'd apply it earlier. this comparator will only differentiate across // indices all shards of the same index is treated equally. final int secondary = secondaryComparator.compare(o1, o2); return secondary == 0 ? indexCmp : secondary; } }; /* * we use 2 arrays and move replicas to the second array once we allocated an identical * replica in the current iteration to make sure all indices get allocated in the same manner. * The arrays are sorted by primaries first and then by index and shard ID so a 2 indices with 2 replica and 1 shard would look like: * [(0,P,IDX1), (0,P,IDX2), (0,R,IDX1), (0,R,IDX1), (0,R,IDX2), (0,R,IDX2)] * if we allocate for instance (0, R, IDX1) we move the second replica to the secondary array and proceed with * the next replica. If we could not find a node to allocate (0,R,IDX1) we move all it's replicas to ingoreUnassigned. */ ShardRouting[] primary = unassigned.drain(); ShardRouting[] secondary = new ShardRouting[primary.length]; int secondaryLength = 0; int primaryLength = primary.length; ArrayUtil.timSort(primary, comparator); final Set<ModelNode> throttledNodes = Collections.newSetFromMap(new IdentityHashMap<ModelNode, Boolean>()); do { for (int i = 0; i < primaryLength; i++) { ShardRouting shard = primary[i]; if (!shard.primary()) { boolean drop = deciders.canAllocate(shard, allocation).type() == Type.NO; if (drop) { unassigned.ignoreShard(shard); while(i < primaryLength-1 && comparator.compare(primary[i], primary[i+1]) == 0) { unassigned.ignoreShard(primary[++i]); } continue; } else { while(i < primaryLength-1 && comparator.compare(primary[i], primary[i+1]) == 0) { secondary[secondaryLength++] = primary[++i]; } } } assert !shard.assignedToNode() : shard; /* find an node with minimal weight we can allocate on*/ float minWeight = Float.POSITIVE_INFINITY; ModelNode minNode = null; Decision decision = null; if (throttledNodes.size() < nodes.size()) { /* Don't iterate over an identity hashset here the * iteration order is different for each run and makes testing hard */ for (ModelNode node : nodes.values()) { if (throttledNodes.contains(node)) { continue; } /* * The shard we add is removed below to simulate the * addition for weight calculation we use Decision.ALWAYS to * not violate the not null condition. */ if (!node.containsShard(shard)) { node.addShard(shard, Decision.ALWAYS); float currentWeight = weight.weight(Operation.ALLOCATE, this, node, shard.index()); /* * Remove the shard from the node again this is only a * simulation */ Decision removed = node.removeShard(shard); assert removed != null; /* * Unless the operation is not providing any gains we * don't check deciders */ if (currentWeight <= minWeight) { Decision currentDecision = deciders.canAllocate(shard, routingNodes.node(node.getNodeId()), allocation); NOUPDATE: if (currentDecision.type() == Type.YES || currentDecision.type() == Type.THROTTLE) { if (currentWeight == minWeight) { /* we have an equal weight tie breaking: * 1. if one decision is YES prefer it * 2. prefer the node that holds the primary for this index with the next id in the ring ie. * for the 3 shards 2 replica case we try to build up: * 1 2 0 * 2 0 1 * 0 1 2 * such that if we need to tie-break we try to prefer the node holding a shard with the minimal id greater * than the id of the shard we need to assign. This works find when new indices are created since * primaries are added first and we only add one shard set a time in this algorithm. */ if (currentDecision.type() == decision.type()) { final int repId = shard.id(); final int nodeHigh = node.highestPrimary(shard.index()); final int minNodeHigh = minNode.highestPrimary(shard.index()); if ((((nodeHigh > repId && minNodeHigh > repId) || (nodeHigh < repId && minNodeHigh < repId)) && (nodeHigh < minNodeHigh)) || (nodeHigh > minNodeHigh && nodeHigh > repId && minNodeHigh < repId)) { minNode = node; minWeight = currentWeight; decision = currentDecision; } else { break NOUPDATE; } } else if (currentDecision.type() != Type.YES) { break NOUPDATE; } } minNode = node; minWeight = currentWeight; decision = currentDecision; } } } } } assert decision != null && minNode != null || decision == null && minNode == null; if (minNode != null) { minNode.addShard(shard, decision); if (decision.type() == Type.YES) { if (logger.isTraceEnabled()) { logger.trace("Assigned shard [{}] to [{}]", shard, minNode.getNodeId()); } routingNodes.initialize(shard, routingNodes.node(minNode.getNodeId()).nodeId(), allocation.clusterInfo().getShardSize(shard, ShardRouting.UNAVAILABLE_EXPECTED_SHARD_SIZE)); changed = true; continue; // don't add to ignoreUnassigned } else { final RoutingNode node = routingNodes.node(minNode.getNodeId()); if (deciders.canAllocate(node, allocation).type() != Type.YES) { if (logger.isTraceEnabled()) { logger.trace("Can not allocate on node [{}] remove from round decision [{}]", node, decision.type()); } throttledNodes.add(minNode); } } if (logger.isTraceEnabled()) { logger.trace("No eligable node found to assign shard [{}] decision [{}]", shard, decision.type()); } } else if (logger.isTraceEnabled()) { logger.trace("No Node found to assign shard [{}]", shard); } unassigned.ignoreShard(shard); if (!shard.primary()) { // we could not allocate it and we are a replica - check if we can ignore the other replicas while(secondaryLength > 0 && comparator.compare(shard, secondary[secondaryLength-1]) == 0) { unassigned.ignoreShard(secondary[--secondaryLength]); } } } primaryLength = secondaryLength; ShardRouting[] tmp = primary; primary = secondary; secondary = tmp; secondaryLength = 0; } while (primaryLength > 0); // clear everything we have either added it or moved to ingoreUnassigned return changed; } /** * Tries to find a relocation from the max node to the minimal node for an arbitrary shard of the given index on the * balance model. Iff this method returns a <code>true</code> the relocation has already been executed on the * simulation model as well as on the cluster. */ private boolean tryRelocateShard(Operation operation, ModelNode minNode, ModelNode maxNode, String idx, float minCost) { final ModelIndex index = maxNode.getIndex(idx); Decision decision = null; if (index != null) { if (logger.isTraceEnabled()) { logger.trace("Try relocating shard for index index [{}] from node [{}] to node [{}]", idx, maxNode.getNodeId(), minNode.getNodeId()); } final RoutingNode node = routingNodes.node(minNode.getNodeId()); ShardRouting candidate = null; final AllocationDeciders deciders = allocation.deciders(); /* make a copy since we modify this list in the loop */ final ArrayList<ShardRouting> shards = new ArrayList<>(index.getAllShards()); for (ShardRouting shard : shards) { if (shard.started()) { // skip initializing, unassigned and relocating shards we can't relocate them anyway Decision allocationDecision = deciders.canAllocate(shard, node, allocation); Decision rebalanceDecision = deciders.canRebalance(shard, allocation); if (((allocationDecision.type() == Type.YES) || (allocationDecision.type() == Type.THROTTLE)) && ((rebalanceDecision.type() == Type.YES) || (rebalanceDecision.type() == Type.THROTTLE))) { Decision srcDecision; if ((srcDecision = maxNode.removeShard(shard)) != null) { minNode.addShard(shard, srcDecision); final float delta = weight.weight(operation, this, minNode, idx) - weight.weight(operation, this, maxNode, idx); if (delta < minCost || (candidate != null && delta == minCost && candidate.id() > shard.id())) { /* this last line is a tie-breaker to make the shard allocation alg deterministic * otherwise we rely on the iteration order of the index.getAllShards() which is a set.*/ minCost = delta; candidate = shard; decision = new Decision.Multi().add(allocationDecision).add(rebalanceDecision); } minNode.removeShard(shard); maxNode.addShard(shard, srcDecision); } } } } if (candidate != null) { /* allocate on the model even if not throttled */ maxNode.removeShard(candidate); minNode.addShard(candidate, decision); if (decision.type() == Type.YES) { /* only allocate on the cluster if we are not throttled */ if (logger.isTraceEnabled()) { logger.trace("Relocate shard [{}] from node [{}] to node [{}]", candidate, maxNode.getNodeId(), minNode.getNodeId()); } /* now allocate on the cluster - if we are started we need to relocate the shard */ if (candidate.started()) { RoutingNode lowRoutingNode = routingNodes.node(minNode.getNodeId()); routingNodes.relocate(candidate, lowRoutingNode.nodeId(), allocation.clusterInfo().getShardSize(candidate, ShardRouting.UNAVAILABLE_EXPECTED_SHARD_SIZE)); } else { routingNodes.initialize(candidate, routingNodes.node(minNode.getNodeId()).nodeId(), allocation.clusterInfo().getShardSize(candidate, ShardRouting.UNAVAILABLE_EXPECTED_SHARD_SIZE)); } return true; } } } if (logger.isTraceEnabled()) { logger.trace("Couldn't find shard to relocate from node [{}] to node [{}] allocation decision [{}]", maxNode.getNodeId(), minNode.getNodeId(), decision == null ? "NO" : decision.type().name()); } return false; } } static class ModelNode implements Iterable<ModelIndex> { private final String id; private final Map<String, ModelIndex> indices = new HashMap<>(); /* cached stats - invalidated on add/remove and lazily calculated */ private int numShards = -1; public ModelNode(String id) { this.id = id; } public ModelIndex getIndex(String indexId) { return indices.get(indexId); } public String getNodeId() { return id; } public int numShards() { if (numShards == -1) { int sum = 0; for (ModelIndex index : indices.values()) { sum += index.numShards(); } numShards = sum; } return numShards; } public int numShards(String idx) { ModelIndex index = indices.get(idx); return index == null ? 0 : index.numShards(); } public Collection<ShardRouting> shards() { Collection<ShardRouting> result = new ArrayList<>(); for (ModelIndex index : indices.values()) { result.addAll(index.getAllShards()); } return result; } public int highestPrimary(String index) { ModelIndex idx = indices.get(index); if (idx != null) { return idx.highestPrimary(); } return -1; } public void addShard(ShardRouting shard, Decision decision) { numShards = -1; ModelIndex index = indices.get(shard.index()); if (index == null) { index = new ModelIndex(shard.index()); indices.put(index.getIndexId(), index); } index.addShard(shard, decision); } public Decision removeShard(ShardRouting shard) { numShards = -1; ModelIndex index = indices.get(shard.index()); Decision removed = null; if (index != null) { removed = index.removeShard(shard); if (removed != null && index.numShards() == 0) { indices.remove(shard.index()); } } return removed; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Node(").append(id).append(")"); return sb.toString(); } @Override public Iterator<ModelIndex> iterator() { return indices.values().iterator(); } public boolean containsShard(ShardRouting shard) { ModelIndex index = getIndex(shard.getIndex()); return index == null ? false : index.containsShard(shard); } } static final class ModelIndex { private final String id; private final Map<ShardRouting, Decision> shards = new HashMap<>(); private int numPrimaries = -1; private int highestPrimary = -1; public ModelIndex(String id) { this.id = id; } public int highestPrimary() { if (highestPrimary == -1) { int maxId = -1; for (ShardRouting shard : shards.keySet()) { if (shard.primary()) { maxId = Math.max(maxId, shard.id()); } } return highestPrimary = maxId; } return highestPrimary; } public String getIndexId() { return id; } public Decision getDecicion(ShardRouting shard) { return shards.get(shard); } public int numShards() { return shards.size(); } public Collection<ShardRouting> getAllShards() { return shards.keySet(); } public int numPrimaries() { if (numPrimaries == -1) { int num = 0; for (ShardRouting shard : shards.keySet()) { if (shard.primary()) { num++; } } return numPrimaries = num; } return numPrimaries; } public Decision removeShard(ShardRouting shard) { highestPrimary = numPrimaries = -1; return shards.remove(shard); } public void addShard(ShardRouting shard, Decision decision) { highestPrimary = numPrimaries = -1; assert decision != null; assert !shards.containsKey(shard) : "Shard already allocated on current node: " + shards.get(shard) + " " + shard; shards.put(shard, decision); } public boolean containsShard(ShardRouting shard) { return shards.containsKey(shard); } } static final class NodeSorter extends IntroSorter { final ModelNode[] modelNodes; /* the nodes weights with respect to the current weight function / index */ final float[] weights; private final WeightFunction function; private String index; private final Balancer balancer; private float pivotWeight; public NodeSorter(ModelNode[] modelNodes, WeightFunction function, Balancer balancer) { this.function = function; this.balancer = balancer; this.modelNodes = modelNodes; weights = new float[modelNodes.length]; } /** * Resets the sorter, recalculates the weights per node and sorts the * nodes by weight, with minimal weight first. */ public void reset(Operation operation, String index) { this.index = index; for (int i = 0; i < weights.length; i++) { weights[i] = weight(operation, modelNodes[i]); } sort(0, modelNodes.length); } public float weight(Operation operation, ModelNode node) { return function.weight(operation, balancer, node, index); } @Override protected void swap(int i, int j) { final ModelNode tmpNode = modelNodes[i]; modelNodes[i] = modelNodes[j]; modelNodes[j] = tmpNode; final float tmpWeight = weights[i]; weights[i] = weights[j]; weights[j] = tmpWeight; } @Override protected int compare(int i, int j) { return Float.compare(weights[i], weights[j]); } @Override protected void setPivot(int i) { pivotWeight = weights[i]; } @Override protected int comparePivot(int j) { return Float.compare(pivotWeight, weights[j]); } public float delta() { return weights[weights.length - 1] - weights[0]; } } }
18098924759/elasticsearch
core/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/BalancedShardsAllocator.java
Java
apache-2.0
50,175
/*************************GO-LICENSE-START********************************* * Copyright 2014 ThoughtWorks, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *************************GO-LICENSE-END***********************************/ package com.thoughtworks.go.domain; import javax.servlet.http.HttpServletResponse; import com.thoughtworks.go.util.Clock; import com.thoughtworks.go.util.HttpService; import com.thoughtworks.go.work.DefaultGoPublisher; import org.apache.log4j.Logger; public class DownloadAction { private final HttpService httpService; private final DefaultGoPublisher goPublisher; private final Clock clock; private static final int DOWNLOAD_SLEEP_MILLIS = 5000; private static final Logger LOG = Logger.getLogger(DownloadAction.class); public DownloadAction(HttpService httpService, DefaultGoPublisher goPublisher, Clock clock) { this.httpService = httpService; this.goPublisher = goPublisher; this.clock = clock; } public void perform(String url, FetchHandler handler) throws Exception { int retryCount = 0; while (true) { retryCount++; String message = ""; try { int rc = download(httpService, url, handler); if (handler.handleResult(rc, goPublisher)) { return; } message = String.format("Unsuccessful response '%s' from the server", rc); } catch (Exception e) { message = String.format("Caught an exception '%s'", e.getMessage()); } if (retryCount > 3) { message = String.format("Giving up fetching resource '%s'. Tried 4 times and failed.", url); LOG.error(message); throw new RuntimeException(message); } long backout = Math.round(backout(retryCount)); publishDownloadError(url, message, backout); clock.sleepForSeconds(backout); } } private void publishDownloadError(String url, String cause, long backout) throws InterruptedException { String message = String.format("Could not fetch artifact %s. Pausing %s seconds to retry. Error was : %s", url, backout, cause); goPublisher.consumeLineWithPrefix(message); LOG.warn(message); } private int download(HttpService httpService, String url, FetchHandler handler) throws Exception { int returnCode = httpService.download(url, handler); while (returnCode == HttpServletResponse.SC_ACCEPTED) { clock.sleepForMillis(DOWNLOAD_SLEEP_MILLIS); returnCode = httpService.download(url, handler); } return returnCode; } private double backout(int retryCount) { return (retryCount * 10.0) + (10 * Math.random()); } }
feluraschi/gocd
common/src/com/thoughtworks/go/domain/DownloadAction.java
Java
apache-2.0
3,366
//===-- BPFMCCodeEmitter.cpp - Convert BPF code to machine code -----------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file implements the BPFMCCodeEmitter class. // //===----------------------------------------------------------------------===// #include "MCTargetDesc/BPFMCTargetDesc.h" #include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCCodeEmitter.h" #include "llvm/MC/MCFixup.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCSubtargetInfo.h" #include "llvm/Support/Endian.h" #include "llvm/Support/EndianStream.h" #include <cassert> #include <cstdint> using namespace llvm; #define DEBUG_TYPE "mccodeemitter" namespace { class BPFMCCodeEmitter : public MCCodeEmitter { const MCInstrInfo &MCII; const MCRegisterInfo &MRI; bool IsLittleEndian; public: BPFMCCodeEmitter(const MCInstrInfo &mcii, const MCRegisterInfo &mri, bool IsLittleEndian) : MCII(mcii), MRI(mri), IsLittleEndian(IsLittleEndian) {} BPFMCCodeEmitter(const BPFMCCodeEmitter &) = delete; void operator=(const BPFMCCodeEmitter &) = delete; ~BPFMCCodeEmitter() override = default; // getBinaryCodeForInstr - TableGen'erated function for getting the // binary encoding for an instruction. uint64_t getBinaryCodeForInstr(const MCInst &MI, SmallVectorImpl<MCFixup> &Fixups, const MCSubtargetInfo &STI) const; // getMachineOpValue - Return binary encoding of operand. If the machin // operand requires relocation, record the relocation and return zero. unsigned getMachineOpValue(const MCInst &MI, const MCOperand &MO, SmallVectorImpl<MCFixup> &Fixups, const MCSubtargetInfo &STI) const; uint64_t getMemoryOpValue(const MCInst &MI, unsigned Op, SmallVectorImpl<MCFixup> &Fixups, const MCSubtargetInfo &STI) const; void encodeInstruction(const MCInst &MI, raw_ostream &OS, SmallVectorImpl<MCFixup> &Fixups, const MCSubtargetInfo &STI) const override; private: FeatureBitset computeAvailableFeatures(const FeatureBitset &FB) const; void verifyInstructionPredicates(const MCInst &MI, const FeatureBitset &AvailableFeatures) const; }; } // end anonymous namespace MCCodeEmitter *llvm::createBPFMCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, MCContext &Ctx) { return new BPFMCCodeEmitter(MCII, MRI, true); } MCCodeEmitter *llvm::createBPFbeMCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, MCContext &Ctx) { return new BPFMCCodeEmitter(MCII, MRI, false); } unsigned BPFMCCodeEmitter::getMachineOpValue(const MCInst &MI, const MCOperand &MO, SmallVectorImpl<MCFixup> &Fixups, const MCSubtargetInfo &STI) const { if (MO.isReg()) return MRI.getEncodingValue(MO.getReg()); if (MO.isImm()) return static_cast<unsigned>(MO.getImm()); assert(MO.isExpr()); const MCExpr *Expr = MO.getExpr(); assert(Expr->getKind() == MCExpr::SymbolRef); if (MI.getOpcode() == BPF::JAL) // func call name Fixups.push_back(MCFixup::create(0, Expr, FK_PCRel_4)); else if (MI.getOpcode() == BPF::LD_imm64) Fixups.push_back(MCFixup::create(0, Expr, FK_SecRel_8)); else // bb label Fixups.push_back(MCFixup::create(0, Expr, FK_PCRel_2)); return 0; } static uint8_t SwapBits(uint8_t Val) { return (Val & 0x0F) << 4 | (Val & 0xF0) >> 4; } void BPFMCCodeEmitter::encodeInstruction(const MCInst &MI, raw_ostream &OS, SmallVectorImpl<MCFixup> &Fixups, const MCSubtargetInfo &STI) const { verifyInstructionPredicates(MI, computeAvailableFeatures(STI.getFeatureBits())); unsigned Opcode = MI.getOpcode(); support::endian::Writer OSE(OS, IsLittleEndian ? support::little : support::big); if (Opcode == BPF::LD_imm64 || Opcode == BPF::LD_pseudo) { uint64_t Value = getBinaryCodeForInstr(MI, Fixups, STI); OS << char(Value >> 56); if (IsLittleEndian) OS << char((Value >> 48) & 0xff); else OS << char(SwapBits((Value >> 48) & 0xff)); OSE.write<uint16_t>(0); OSE.write<uint32_t>(Value & 0xffffFFFF); const MCOperand &MO = MI.getOperand(1); uint64_t Imm = MO.isImm() ? MO.getImm() : 0; OSE.write<uint8_t>(0); OSE.write<uint8_t>(0); OSE.write<uint16_t>(0); OSE.write<uint32_t>(Imm >> 32); } else { // Get instruction encoding and emit it uint64_t Value = getBinaryCodeForInstr(MI, Fixups, STI); OS << char(Value >> 56); if (IsLittleEndian) OS << char((Value >> 48) & 0xff); else OS << char(SwapBits((Value >> 48) & 0xff)); OSE.write<uint16_t>((Value >> 32) & 0xffff); OSE.write<uint32_t>(Value & 0xffffFFFF); } } // Encode BPF Memory Operand uint64_t BPFMCCodeEmitter::getMemoryOpValue(const MCInst &MI, unsigned Op, SmallVectorImpl<MCFixup> &Fixups, const MCSubtargetInfo &STI) const { uint64_t Encoding; const MCOperand Op1 = MI.getOperand(1); assert(Op1.isReg() && "First operand is not register."); Encoding = MRI.getEncodingValue(Op1.getReg()); Encoding <<= 16; MCOperand Op2 = MI.getOperand(2); assert(Op2.isImm() && "Second operand is not immediate."); Encoding |= Op2.getImm() & 0xffff; return Encoding; } #define ENABLE_INSTR_PREDICATE_VERIFIER #include "BPFGenMCCodeEmitter.inc"
bkaradzic/SwiftShader
third_party/llvm-10.0/llvm/lib/Target/BPF/MCTargetDesc/BPFMCCodeEmitter.cpp
C++
apache-2.0
6,248
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Socket control messages package unix import "unsafe" // UnixCredentials encodes credentials into a socket control message // for sending to another process. This can be used for // authentication. func UnixCredentials(ucred *Ucred) []byte { b := make([]byte, CmsgSpace(SizeofUcred)) h := (*Cmsghdr)(unsafe.Pointer(&b[0])) h.Level = SOL_SOCKET h.Type = SCM_CREDENTIALS h.SetLen(CmsgLen(SizeofUcred)) *((*Ucred)(cmsgData(h))) = *ucred return b } // ParseUnixCredentials decodes a socket control message that contains // credentials in a Ucred structure. To receive such a message, the // SO_PASSCRED option must be enabled on the socket. func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { if m.Header.Level != SOL_SOCKET { return nil, EINVAL } if m.Header.Type != SCM_CREDENTIALS { return nil, EINVAL } ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) return &ucred, nil }
sunyuan3/runc
vendor/golang.org/x/sys/unix/sockcmsg_linux.go
GO
apache-2.0
1,072
/* * Licensed to Apereo under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Apereo licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a * copy of the License at the following location: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.jasig.cas.monitor; /** * Provides status information about the number of SSO sessions established in CAS. * * @author Marvin S. Addison * @since 3.5.0 */ public class SessionStatus extends Status { /** Total number of SSO sessions maintained by CAS. */ private final int sessionCount; /** Total number of service tickets in CAS ticket registry. */ private final int serviceTicketCount; /** * Creates a new status object with the given code. * * @param code Status code. * @param desc Human-readable status description. * * @see #getCode() */ public SessionStatus(final StatusCode code, final String desc) { this(code, desc, 0, 0); } /** * Creates a new status object with the given code. * * @param code Status code. * @param desc Human-readable status description. * @param sessions Number of established SSO sessions in ticket registry. * @param serviceTickets Number of service tickets in ticket registry. * * @see #getCode() */ public SessionStatus(final StatusCode code, final String desc, final int sessions, final int serviceTickets) { super(code, desc); this.sessionCount = sessions; this.serviceTicketCount = serviceTickets; } /** * Gets total number of SSO sessions maintained by CAS. * * @return Total number of SSO sessions. */ public int getSessionCount() { return this.sessionCount; } /** * Gets the total number of service tickets in the CAS ticket registry. * * @return Total number of service tickets. */ public int getServiceTicketCount() { return this.serviceTicketCount; } }
lijihuai/cas
cas-server-core/src/main/java/org/jasig/cas/monitor/SessionStatus.java
Java
apache-2.0
2,553
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.sling.ide.eclipse.core.internal; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate; import org.eclipse.wst.server.core.IServer; import org.eclipse.wst.server.core.ServerUtil; public class SlingLaunchpadLaunchConfigurationDelegate extends AbstractJavaLaunchConfigurationDelegate { @Override public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { IServer server = ServerUtil.getServer(configuration); if (server == null) { throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "No server found for configuration " + configuration)); } SlingLaunchpadBehaviour launchpad = (SlingLaunchpadBehaviour) server.loadAdapter(SlingLaunchpadBehaviour.class, monitor); launchpad.setupLaunch(launch, mode, monitor); launchpad.start(monitor); } }
anchela/sling
tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingLaunchpadLaunchConfigurationDelegate.java
Java
apache-2.0
2,067
'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } module.exports = function () { return new IgnoreBase(); }; // A simple implementation of make-array function make_array(subject) { return Array.isArray(subject) ? subject : [subject]; } var REGEX_BLANK_LINE = /^\s+$/; var REGEX_LEADING_EXCAPED_EXCLAMATION = /^\\\!/; var REGEX_LEADING_EXCAPED_HASH = /^\\#/; var SLASH = '/'; var KEY_IGNORE = typeof Symbol !== 'undefined' ? Symbol.for('node-ignore') /* istanbul ignore next */ : 'node-ignore'; var IgnoreBase = function () { function IgnoreBase() { _classCallCheck(this, IgnoreBase); this._rules = []; this[KEY_IGNORE] = true; this._initCache(); } _createClass(IgnoreBase, [{ key: '_initCache', value: function _initCache() { this._cache = {}; } // @param {Array.<string>|string|Ignore} pattern }, { key: 'add', value: function add(pattern) { this._added = false; if (typeof pattern === 'string') { pattern = pattern.split(/\r?\n/g); } make_array(pattern).forEach(this._addPattern, this); // Some rules have just added to the ignore, // making the behavior changed. if (this._added) { this._initCache(); } return this; } // legacy }, { key: 'addPattern', value: function addPattern(pattern) { return this.add(pattern); } }, { key: '_addPattern', value: function _addPattern(pattern) { // #32 if (pattern && pattern[KEY_IGNORE]) { this._rules = this._rules.concat(pattern._rules); this._added = true; return; } if (this._checkPattern(pattern)) { var rule = this._createRule(pattern); this._added = true; this._rules.push(rule); } } }, { key: '_checkPattern', value: function _checkPattern(pattern) { // > A blank line matches no files, so it can serve as a separator for readability. return pattern && typeof pattern === 'string' && !REGEX_BLANK_LINE.test(pattern) // > A line starting with # serves as a comment. && pattern.indexOf('#') !== 0; } }, { key: 'filter', value: function filter(paths) { var _this = this; return make_array(paths).filter(function (path) { return _this._filter(path); }); } }, { key: 'createFilter', value: function createFilter() { var _this2 = this; return function (path) { return _this2._filter(path); }; } }, { key: 'ignores', value: function ignores(path) { return !this._filter(path); } }, { key: '_createRule', value: function _createRule(pattern) { var origin = pattern; var negative = false; // > An optional prefix "!" which negates the pattern; if (pattern.indexOf('!') === 0) { negative = true; pattern = pattern.substr(1); } pattern = pattern // > Put a backslash ("\") in front of the first "!" for patterns that begin with a literal "!", for example, `"\!important!.txt"`. .replace(REGEX_LEADING_EXCAPED_EXCLAMATION, '!') // > Put a backslash ("\") in front of the first hash for patterns that begin with a hash. .replace(REGEX_LEADING_EXCAPED_HASH, '#'); var regex = make_regex(pattern, negative); return { origin: origin, pattern: pattern, negative: negative, regex: regex }; } // @returns `Boolean` true if the `path` is NOT ignored }, { key: '_filter', value: function _filter(path, slices) { if (!path) { return false; } if (path in this._cache) { return this._cache[path]; } if (!slices) { // path/to/a.js // ['path', 'to', 'a.js'] slices = path.split(SLASH); } slices.pop(); return this._cache[path] = slices.length // > It is not possible to re-include a file if a parent directory of that file is excluded. // If the path contains a parent directory, check the parent first ? this._filter(slices.join(SLASH) + SLASH, slices) && this._test(path) // Or only test the path : this._test(path); } // @returns {Boolean} true if a file is NOT ignored }, { key: '_test', value: function _test(path) { // Explicitly define variable type by setting matched to `0` var matched = 0; this._rules.forEach(function (rule) { // if matched = true, then we only test negative rules // if matched = false, then we test non-negative rules if (!(matched ^ rule.negative)) { matched = rule.negative ^ rule.regex.test(path); } }); return !matched; } }]); return IgnoreBase; }(); // > If the pattern ends with a slash, // > it is removed for the purpose of the following description, // > but it would only find a match with a directory. // > In other words, foo/ will match a directory foo and paths underneath it, // > but will not match a regular file or a symbolic link foo // > (this is consistent with the way how pathspec works in general in Git). // '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`' // -> ignore-rules will not deal with it, because it costs extra `fs.stat` call // you could use option `mark: true` with `glob` // '`foo/`' should not continue with the '`..`' var DEFAULT_REPLACER_PREFIX = [ // > Trailing spaces are ignored unless they are quoted with backslash ("\") [ // (a\ ) -> (a ) // (a ) -> (a) // (a \ ) -> (a ) /\\?\s+$/, function (match) { return match.indexOf('\\') === 0 ? ' ' : ''; }], // replace (\ ) with ' ' [/\\\s/g, function () { return ' '; }], // Escape metacharacters // which is written down by users but means special for regular expressions. // > There are 12 characters with special meanings: // > - the backslash \, // > - the caret ^, // > - the dollar sign $, // > - the period or dot ., // > - the vertical bar or pipe symbol |, // > - the question mark ?, // > - the asterisk or star *, // > - the plus sign +, // > - the opening parenthesis (, // > - the closing parenthesis ), // > - and the opening square bracket [, // > - the opening curly brace {, // > These special characters are often called "metacharacters". [/[\\\^$.|?*+()\[{]/g, function (match) { return '\\' + match; }], // leading slash [ // > A leading slash matches the beginning of the pathname. // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". // A leading slash matches the beginning of the pathname /^\//, function () { return '^'; }], // replace special metacharacter slash after the leading slash [/\//g, function () { return '\\/'; }], [ // > A leading "**" followed by a slash means match in all directories. // > For example, "**/foo" matches file or directory "foo" anywhere, // > the same as pattern "foo". // > "**/foo/bar" matches file or directory "bar" anywhere that is directly under directory "foo". // Notice that the '*'s have been replaced as '\\*' /^\^*\\\*\\\*\\\//, // '**/foo' <-> 'foo' function () { return '^(?:.*\\/)?'; }]]; var DEFAULT_REPLACER_SUFFIX = [ // starting [ // there will be no leading '/' (which has been replaced by section "leading slash") // If starts with '**', adding a '^' to the regular expression also works /^(?=[^\^])/, function () { return !/\/(?!$)/.test(this) // > If the pattern does not contain a slash /, Git treats it as a shell glob pattern // Actually, if there is only a trailing slash, git also treats it as a shell glob pattern ? '(?:^|\\/)' // > Otherwise, Git treats the pattern as a shell glob suitable for consumption by fnmatch(3) : '^'; }], // two globstars [ // Use lookahead assertions so that we could match more than one `'/**'` /\\\/\\\*\\\*(?=\\\/|$)/g, // Zero, one or several directories // should not use '*', or it will be replaced by the next replacer // Check if it is not the last `'/**'` function (match, index, str) { return index + 6 < str.length // case: /**/ // > A slash followed by two consecutive asterisks then a slash matches zero or more directories. // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. // '/**/' ? '(?:\\/[^\\/]+)*' // case: /** // > A trailing `"/**"` matches everything inside. // #21: everything inside but it should not include the current folder : '\\/.+'; }], // intermediate wildcards [ // Never replace escaped '*' // ignore rule '\*' will match the path '*' // 'abc.*/' -> go // 'abc.*' -> skip this rule /(^|[^\\]+)\\\*(?=.+)/g, // '*.js' matches '.js' // '*.js' doesn't match 'abc' function (match, p1) { return p1 + '[^\\/]*'; }], // trailing wildcard [/(\^|\\\/)?\\\*$/, function (match, p1) { return (p1 // '\^': // '/*' does not match '' // '/*' does not match everything // '\\\/': // 'abc/*' does not match 'abc/' ? p1 + '[^/]+' // 'a*' matches 'a' // 'a*' matches 'aa' : '[^/]*') + '(?=$|\\/$)'; }], [ // unescape /\\\\\\/g, function () { return '\\'; }]]; var POSITIVE_REPLACERS = [].concat(DEFAULT_REPLACER_PREFIX, [ // 'f' // matches // - /f(end) // - /f/ // - (start)f(end) // - (start)f/ // doesn't match // - oof // - foo // pseudo: // -> (^|/)f(/|$) // ending [ // 'js' will not match 'js.' // 'ab' will not match 'abc' /(?:[^*\/])$/, // 'js*' will not match 'a.js' // 'js/' will not match 'a.js' // 'js' will match 'a.js' and 'a.js/' function (match) { return match + '(?=$|\\/)'; }]], DEFAULT_REPLACER_SUFFIX); var NEGATIVE_REPLACERS = [].concat(DEFAULT_REPLACER_PREFIX, [ // #24, #38 // The MISSING rule of [gitignore docs](https://git-scm.com/docs/gitignore) // A negative pattern without a trailing wildcard should not // re-include the things inside that directory. // eg: // ['node_modules/*', '!node_modules'] // should ignore `node_modules/a.js` [/(?:[^*])$/, function (match) { return match + '(?=$|\\/$)'; }]], DEFAULT_REPLACER_SUFFIX); // A simple cache, because an ignore rule only has only one certain meaning var cache = {}; // @param {pattern} function make_regex(pattern, negative) { var r = cache[pattern]; if (r) { return r; } var replacers = negative ? NEGATIVE_REPLACERS : POSITIVE_REPLACERS; var source = replacers.reduce(function (prev, current) { return prev.replace(current[0], current[1].bind(pattern)); }, pattern); return cache[pattern] = new RegExp(source, 'i'); } // Windows // -------------------------------------------------------------- /* istanbul ignore if */ if ( // Detect `process` so that it can run in browsers. typeof process !== 'undefined' && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === 'win32')) { var filter = IgnoreBase.prototype._filter; var make_posix = function make_posix(str) { return (/^\\\\\?\\/.test(str) || /[^\x00-\x80]+/.test(str) ? str : str.replace(/\\/g, '/') ); }; IgnoreBase.prototype._filter = function (path, slices) { path = make_posix(path); return filter.call(this, path, slices); }; }
GoogleCloudPlatform/prometheus-engine
third_party/prometheus_ui/base/web/ui/react-app/node_modules/globby/node_modules/ignore/ignore.js
JavaScript
apache-2.0
11,780
var json = typeof JSON !== 'undefined' ? JSON : require('jsonify'); module.exports = function (obj, opts) { if (!opts) opts = {}; if (typeof opts === 'function') opts = { cmp: opts }; var space = opts.space || ''; if (typeof space === 'number') space = Array(space+1).join(' '); var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; var replacer = opts.replacer || function(key, value) { return value; }; var cmp = opts.cmp && (function (f) { return function (node) { return function (a, b) { var aobj = { key: a, value: node[a] }; var bobj = { key: b, value: node[b] }; return f(aobj, bobj); }; }; })(opts.cmp); var seen = []; return (function stringify (parent, key, node, level) { var indent = space ? ('\n' + new Array(level + 1).join(space)) : ''; var colonSeparator = space ? ': ' : ':'; if (node && node.toJSON && typeof node.toJSON === 'function') { node = node.toJSON(); } node = replacer.call(parent, key, node); if (node === undefined) { return; } if (typeof node !== 'object' || node === null) { return json.stringify(node); } if (isArray(node)) { var out = []; for (var i = 0; i < node.length; i++) { var item = stringify(node, i, node[i], level+1) || json.stringify(null); out.push(indent + space + item); } return '[' + out.join(',') + indent + ']'; } else { if (seen.indexOf(node) !== -1) { if (cycles) return json.stringify('__cycle__'); throw new TypeError('Converting circular structure to JSON'); } else seen.push(node); var keys = objectKeys(node).sort(cmp && cmp(node)); var out = []; for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = stringify(node, key, node[key], level+1); if(!value) continue; var keyValue = json.stringify(key) + colonSeparator + value; ; out.push(indent + space + keyValue); } seen.splice(seen.indexOf(node), 1); return '{' + out.join(',') + indent + '}'; } })({ '': obj }, '', obj, 0); }; var isArray = Array.isArray || function (x) { return {}.toString.call(x) === '[object Array]'; }; var objectKeys = Object.keys || function (obj) { var has = Object.prototype.hasOwnProperty || function () { return true }; var keys = []; for (var key in obj) { if (has.call(obj, key)) keys.push(key); } return keys; };
puyanLiu/LPYFramework
前端练习/autoFramework/webpack-demo/node_modules/json-stable-stringify/index.js
JavaScript
apache-2.0
2,861
/** * Copyright 2015 The AMP HTML Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS-IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import {loadScript} from '../3p/3p'; /** * @param {!Window} global * @param {!Object} data */ export function smartadserver(global, data) { // For more flexibility, we construct the call to SmartAdServer's URL in the // external loader, based on the data received from the AMP tag. loadScript(global, 'https://ec-ns.sascdn.com/diff/js/amp.v0.js', () => { global.sas.callAmpAd(data); }); }
taboola/amphtml
ads/smartadserver.js
JavaScript
apache-2.0
1,034
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with this * work for additional information regarding copyright ownership. The ASF * licenses this file to You under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package org.apache.sling.cassandra.test.data.populator.perf; import org.apache.sling.commons.testing.integration.HttpTestBase; import org.apache.sling.servlets.post.SlingPostConstants; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Test the PlanetsResourceProvider that the test-services bundles provides */ public class CassandraResourceProviderUpdateTest extends HttpTestBase { private static List<String> exerciseList = new ArrayList<String>(); private static List<String> testList = new ArrayList<String>(); private static List<Long> firstRun = new ArrayList<Long>(); private static List<Long> secondRun = new ArrayList<Long>(); private static File file = new File("/home/dishara/mystuff/sling/svn/slinglatest/launchpad/integration-tests/CassandraUpdateLatencyReport.txt"); private static FileWriter fileWriter; static { loadTestLists(); if (!file.exists()) { try { file.createNewFile(); } catch (IOException ignore) { } } try { fileWriter = new FileWriter(file, true); } catch (IOException ignore) { } } private static void loadTestLists() { int exerciseCount = 0; int testCount = 0; for (int i = 0; i < 1000; i++) { if (i % 2 == 0) { if (exerciseCount < 100) { exerciseList.add(String.valueOf(i)); System.out.println("Exercise: " + i); exerciseCount++; } } else { if (testCount < 100) { testList.add(String.valueOf(i)); System.out.println("Test: " + i); testCount++; } } } } private void createAllExerciseData(String parentNode) throws IOException { Map<String, String> props = new HashMap<String, String>(); props.put(SlingPostConstants.RP_CONTENT_TYPE, "json"); Map<String, String> props1 = new HashMap<String, String>(); props1.put("metadata", "resolutionPathInfo=json"); props1.put("resourceType", "nt:cassandra9"); props1.put("resourceSuperType", "nt:supercass9"); props.put(SlingPostConstants.RP_CHECKIN, "true"); for (String s : exerciseList) { testClient.createNode(HTTP_BASE_URL + "/content/cassandra/" + parentNode + "/" + s, props, props1, true); } } private void writeToFile(String s) throws IOException { fileWriter.write(s + "\n"); } private void createAllTestData(String parentNode, List<Long> result, Map<String, Long> nodeMap) throws IOException { Map<String, String> props = new HashMap<String, String>(); props.put(SlingPostConstants.RP_CONTENT_TYPE, "json"); Map<String, String> props1 = new HashMap<String, String>(); props1.put("metadata", "resolutionPathInfo=json"); props1.put("resourceType", "nt:cassandra9"); props1.put("resourceSuperType", "nt:supercass9"); props.put(SlingPostConstants.RP_CHECKIN, "true"); writeToFile("#######################################################################################################################"); writeToFile("############################ HTTP CUD Latency Report on Test Data under " + parentNode + " ################################"); writeToFile("#######################################################################################################################"); long subTotal = 0; for (String s : testList) { long startTime = System.currentTimeMillis(); String url = HTTP_BASE_URL + "/content/cassandra/" + parentNode + "/" + s; testClient.createNode(url, props, props1, true); long latency = System.currentTimeMillis() - startTime; result.add(latency); subTotal = subTotal + latency; writeToFile("[TEST] Latency: " + latency + " (ms) HTTP URI " + url); System.out.println(url); } nodeMap.put(parentNode, subTotal); } public void testMovieResource() throws Exception { String[] nodes = new String[]{"LA", "MA", "SA"}; Map<String, Long> firstNodeMap = new HashMap<String, Long>(); writeToFile("============================================ FIRST RUN ============================================================"); for (String s : nodes) { createAllTestData(s, firstRun, firstNodeMap); } long firstRunTotal = 0; long secondRunTotal = 0; for (long l1 : firstRun) { firstRunTotal = firstRunTotal + l1; } for (long l2 : secondRun) { secondRunTotal = secondRunTotal + l2; } writeToFile("==========================================================================================================================="); writeToFile("========================================== FIRST RUN TEST SUMMERY=========================================================="); writeToFile("[RESULT] Average Latency Under Node A(1K) = " + firstNodeMap.get("LA") / testList.size() + " (ms)"); writeToFile("[RESULT] Average Latency Under Node B(10K) = " + firstNodeMap.get("MA") / testList.size() + " (ms)"); writeToFile("[RESULT] Average Latency Under Node C(100K) = " + firstNodeMap.get("SA") / testList.size() + " (ms)"); // writeToFile("[RESULT] Average Latency Under Node D(1M) = " + firstNodeMap.get("D") / testList.size() + " (ms)"); // writeToFile("[RESULT] Average Latency Under Node E(10M) = " + firstNodeMap.get("E") / testList.size() + " (ms)"); // writeToFile("[RESULT] Average Latency Under Node F(100M) = " + firstNodeMap.get("F") / testList.size() + " (ms)"); writeToFile("[FIRST RUN] #TOTAL CALLS = " + firstRun.size() + " Total Average Latency = " + firstRunTotal / firstRun.size() + " (ms)"); writeToFile("==========================================================================================================================="); // writeToFile("========================================== SECOND RUN TEST SUMMERY=========================================================="); // writeToFile("[RESULT] Average Latency Under Node A(1K) = " + secondNodeMap.get("LA") / testList.size() + " (ms)"); // writeToFile("[RESULT] Average Latency Under Node B(10K) = " + secondNodeMap.get("MA") / testList.size() + " (ms)"); // writeToFile("[RESULT] Average Latency Under Node C(100K) = " + secondNodeMap.get("SA") / testList.size() + " (ms)"); // writeToFile("[RESULT] Average Latency Under Node D(1M) = " + secondNodeMap.get("D") / testList.size() + " (ms)"); // writeToFile("[RESULT] Average Latency Under Node E(10M) = " + secondNodeMap.get("E") / testList.size() + " (ms)"); // writeToFile("[RESULT] Average Latency Under Node F(100M) = " + secondNodeMap.get("F") / testList.size() + " (ms)"); // writeToFile("[FIRST RUN] #TOTAL CALLS = " + secondRun.size() + " Total Average Latency = " + secondRunTotal / secondRun.size() + " (ms)"); writeToFile("==========================================================================================================================="); fileWriter.close(); } }
wimsymons/sling
contrib/extensions/cassandra/src/test/java/org/apache/sling/cassandra/test/data/populator/perf/CassandraResourceProviderUpdateTest.java
Java
apache-2.0
8,350
// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ---------------------------------------------------------------------------------- using System; using System.Linq; using System.Management.Automation; using Microsoft.WindowsAzure.Commands.ServiceManagement.Helpers; using Microsoft.WindowsAzure.Commands.ServiceManagement.Model; using Microsoft.WindowsAzure.Commands.ServiceManagement.PlatformImageRepository.Properties; using Microsoft.WindowsAzure.Commands.Utilities.Common; using Microsoft.WindowsAzure.Management; using Microsoft.WindowsAzure.Management.Compute; using Microsoft.WindowsAzure.Commands.ServiceManagement.PlatformImageRepository.Model; using Microsoft.WindowsAzure.Management.Compute.Models; namespace Microsoft.WindowsAzure.Commands.ServiceManagement.PlatformImageRepository.ImagePublishing { [Cmdlet(VerbsCommon.Set, "AzurePlatformVMImage", DefaultParameterSetName = ReplicateParameterSetName), OutputType(typeof(ManagementOperationContext))] public class SetAzurePlatformVMImage : ServiceManagementBaseCmdlet { private const string ReplicateParameterSetName = "Replicate"; private const string ShareParameterSetName = "Share"; private bool isVMImage; private bool isOSImage; [Parameter(Position = 0, Mandatory = true, ParameterSetName = ReplicateParameterSetName, ValueFromPipelineByPropertyName = true, HelpMessage = "Name of the image in the image library.")] [Parameter(Position = 0, Mandatory = true, ParameterSetName = ShareParameterSetName, ValueFromPipelineByPropertyName = true, HelpMessage = "Name of the image in the image library.")] [ValidateNotNullOrEmpty] public string ImageName { get; set; } [Parameter(Position = 1, Mandatory = true, ParameterSetName = ReplicateParameterSetName, ValueFromPipelineByPropertyName = true, HelpMessage = "Specifies the locations that image will be replicated.")] [ValidateNotNullOrEmpty] public string[] ReplicaLocations { get; set; } [Parameter(Position = 1, Mandatory = true, ParameterSetName = ShareParameterSetName, ValueFromPipelineByPropertyName = true, HelpMessage = "Specifies the sharing permission of replicated image.")] [ValidateSet("Public", "Private", "MSDN", "EA")] public string Permission { get; set; } [Parameter(Mandatory = true, ParameterSetName = ReplicateParameterSetName), ValidateNotNullOrEmpty] public ComputeImageConfig ComputeImageConfig { get; set; } [Parameter(ParameterSetName = ReplicateParameterSetName), ValidateNotNullOrEmpty] public MarketplaceImageConfig MarketplaceImageConfig { get; set; } public void SetAzurePlatformVMImageProcess() { var imageType = new VirtualMachineImageHelper(this.ComputeClient).GetImageType(this.ImageName); isOSImage = imageType.HasFlag(VirtualMachineImageType.OSImage); isVMImage = imageType.HasFlag(VirtualMachineImageType.VMImage); if (isOSImage && isVMImage) { WriteErrorWithTimestamp( string.Format(ServiceManagement.Properties.Resources.DuplicateNamesFoundInBothVMAndOSImages, this.ImageName)); } if (this.ParameterSpecified("ReplicaLocations")) { ProcessReplicateImageParameterSet(); } else if (this.ParameterSpecified("Permission")) { ProcessShareImageParameterSet(); } } private bool ParameterSpecified(string parameterName) { return this.MyInvocation.BoundParameters.ContainsKey(parameterName); } private void ProcessShareImageParameterSet() { if (isVMImage) { ExecuteClientActionNewSM( null, CommandRuntime.ToString(), () => { this.ComputeClient.VirtualMachineVMImages.GetDetails(this.ImageName); return this.ComputeClient.VirtualMachineVMImages.Share(this.ImageName, this.Permission); }); } else { ExecuteClientActionNewSM( null, CommandRuntime.ToString(), () => { this.ComputeClient.VirtualMachineOSImages.GetDetails(this.ImageName); return this.ComputeClient.VirtualMachineOSImages.Share(this.ImageName, this.Permission); }); } } private void ProcessReplicateImageParameterSet() { if (isVMImage) { ExecuteClientActionNewSM( null, CommandRuntime.ToString(), () => { this.ComputeClient.VirtualMachineVMImages.GetDetails(this.ImageName); ValidateTargetLocations(); return this.ComputeClient.VirtualMachineVMImages.Replicate( this.ImageName, new Management.Compute.Models.VirtualMachineVMImageReplicateParameters { TargetLocations = this.ReplicaLocations == null ? null : this.ReplicaLocations.ToList(), ComputeImageAttributes = new ComputeImageAttributes { Offer = this.ComputeImageConfig.Offer, Sku = this.ComputeImageConfig.Sku, Version = this.ComputeImageConfig.Version }, MarketplaceImageAttributes = this.MarketplaceImageConfig == null ? null : new MarketplaceImageAttributes { Plan = new Plan { Name = this.MarketplaceImageConfig.PlanName, Product = this.MarketplaceImageConfig.Product, Publisher = this.MarketplaceImageConfig.Publisher }, PublisherId = this.MarketplaceImageConfig.PublisherId } }); }); } else { ExecuteClientActionNewSM( null, CommandRuntime.ToString(), () => { this.ComputeClient.VirtualMachineOSImages.Get(this.ImageName); ValidateTargetLocations(); return this.ComputeClient.VirtualMachineOSImages.Replicate(this.ImageName, new Management.Compute.Models.VirtualMachineOSImageReplicateParameters { TargetLocations = this.ReplicaLocations == null ? null : this.ReplicaLocations.ToList(), ComputeImageAttributes = new ComputeImageAttributes { Offer = this.ComputeImageConfig.Offer, Sku = this.ComputeImageConfig.Sku, Version = this.ComputeImageConfig.Version }, MarketplaceImageAttributes = this.MarketplaceImageConfig == null ? null : new MarketplaceImageAttributes { Plan = new Plan { Name = this.MarketplaceImageConfig.PlanName, Product = this.MarketplaceImageConfig.Product, Publisher = this.MarketplaceImageConfig.Publisher }, PublisherId = this.MarketplaceImageConfig.PublisherId } }); }); } } private void ValidateTargetLocations() { var locations = this.ManagementClient.Locations.List(); if (this.ReplicaLocations != null) { var invalidValues = ReplicaLocations.Except(locations.Select(l => l.Name), StringComparer.OrdinalIgnoreCase).ToList(); if (invalidValues.Any()) { var validValuesMessage = string.Format(Resources.SetAzurePlatformVMImage_Valid_Values, String.Join(", ", locations.Select(l => "'" + l.Name + "'"))); var invalidValuesMessage = string.Format(Resources.SetAzurePlatformVMImage_Invalid_Values, String.Join(", ", invalidValues.Select(l => "'" + l + "'"))); throw new ArgumentOutOfRangeException("Location", String.Format(Resources.SetAzurePlatformVMImage_Expected_Found, validValuesMessage, invalidValuesMessage)); } } } protected override void OnProcessRecord() { ServiceManagementProfile.Initialize(); this.SetAzurePlatformVMImageProcess(); } } }
atpham256/azure-powershell
src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/ImagePublishing/SetAzurePlatformVMImage.cs
C#
apache-2.0
10,118
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.sling.resourceresolver.impl.helper; import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.apache.sling.adapter.annotations.Adaptable; import org.apache.sling.adapter.annotations.Adapter; import org.apache.sling.api.resource.Resource; import org.apache.sling.api.resource.ResourceResolver; import org.apache.sling.api.resource.SyntheticResource; import org.apache.sling.api.resource.ValueMap; import org.apache.sling.api.wrappers.ValueMapDecorator; @Adaptable(adaptableClass = Resource.class, adapters = @Adapter(value = { Map.class, ValueMap.class })) public final class RedirectResource extends SyntheticResource { static final String RT_SLING_REDIRECT = "sling:redirect"; static final String PROP_SLING_TARGET = "sling:target"; static final String PROP_SLING_STATUS = "sling:status"; private final Map<String, Object> values; public RedirectResource(final ResourceResolver resolver, final String path, final String target, final int status) { super(resolver, path, RT_SLING_REDIRECT); final Map<String, Object> props = new HashMap<String, Object>(); props.put(PROP_SLING_TARGET, target); props.put(PROP_SLING_STATUS, status); this.values = Collections.unmodifiableMap(props); } /** * @see org.apache.sling.api.adapter.Adaptable#adaptTo(java.lang.Class) */ @SuppressWarnings("unchecked") public <AdapterType> AdapterType adaptTo(final Class<AdapterType> type) { if (type == ValueMap.class) { return (AdapterType) new ValueMapDecorator(values); } else if (type == Map.class) { return (AdapterType) values; } return super.adaptTo(type); } @Override public String toString() { return super.toString() + ", values=" + values; } }
klcodanr/sling
bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/RedirectResource.java
Java
apache-2.0
2,678
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package mf.org.apache.xerces.impl.dv.xs; import mf.org.apache.xerces.impl.dv.DatatypeException; import mf.org.apache.xerces.impl.dv.InvalidDatatypeFacetException; import mf.org.apache.xerces.impl.dv.InvalidDatatypeValueException; import mf.org.apache.xerces.impl.dv.ValidatedInfo; import mf.org.apache.xerces.impl.dv.ValidationContext; import mf.org.apache.xerces.impl.dv.XSFacets; import mf.org.apache.xerces.impl.dv.XSSimpleType; import mf.org.apache.xerces.xs.StringList; import mf.org.apache.xerces.xs.XSNamespaceItem; import mf.org.apache.xerces.xs.XSObject; import mf.org.apache.xerces.xs.XSObjectList; import mf.org.apache.xerces.xs.XSSimpleTypeDefinition; import mf.org.apache.xerces.xs.XSTypeDefinition; /** * Base class for XSSimpleType wrapper implementations. * * @xerces.internal * * @version $Id: XSSimpleTypeDelegate.java 1024038 2010-10-18 22:06:35Z sandygao $ */ public class XSSimpleTypeDelegate implements XSSimpleType { protected final XSSimpleType type; public XSSimpleTypeDelegate(XSSimpleType type) { if (type == null) { throw new NullPointerException(); } this.type = type; } public XSSimpleType getWrappedXSSimpleType() { return type; } public XSObjectList getAnnotations() { return type.getAnnotations(); } public boolean getBounded() { return type.getBounded(); } public short getBuiltInKind() { return type.getBuiltInKind(); } public short getDefinedFacets() { return type.getDefinedFacets(); } public XSObjectList getFacets() { return type.getFacets(); } public XSObject getFacet(int facetType) { return type.getFacet(facetType); } public boolean getFinite() { return type.getFinite(); } public short getFixedFacets() { return type.getFixedFacets(); } public XSSimpleTypeDefinition getItemType() { return type.getItemType(); } public StringList getLexicalEnumeration() { return type.getLexicalEnumeration(); } public String getLexicalFacetValue(short facetName) { return type.getLexicalFacetValue(facetName); } public StringList getLexicalPattern() { return type.getLexicalPattern(); } public XSObjectList getMemberTypes() { return type.getMemberTypes(); } public XSObjectList getMultiValueFacets() { return type.getMultiValueFacets(); } public boolean getNumeric() { return type.getNumeric(); } public short getOrdered() { return type.getOrdered(); } public XSSimpleTypeDefinition getPrimitiveType() { return type.getPrimitiveType(); } public short getVariety() { return type.getVariety(); } public boolean isDefinedFacet(short facetName) { return type.isDefinedFacet(facetName); } public boolean isFixedFacet(short facetName) { return type.isFixedFacet(facetName); } public boolean derivedFrom(String namespace, String name, short derivationMethod) { return type.derivedFrom(namespace, name, derivationMethod); } public boolean derivedFromType(XSTypeDefinition ancestorType, short derivationMethod) { return type.derivedFromType(ancestorType, derivationMethod); } public boolean getAnonymous() { return type.getAnonymous(); } public XSTypeDefinition getBaseType() { return type.getBaseType(); } public short getFinal() { return type.getFinal(); } public short getTypeCategory() { return type.getTypeCategory(); } public boolean isFinal(short restriction) { return type.isFinal(restriction); } public String getName() { return type.getName(); } public String getNamespace() { return type.getNamespace(); } public XSNamespaceItem getNamespaceItem() { return type.getNamespaceItem(); } public short getType() { return type.getType(); } public void applyFacets(XSFacets facets, short presentFacet, short fixedFacet, ValidationContext context) throws InvalidDatatypeFacetException { type.applyFacets(facets, presentFacet, fixedFacet, context); } public short getPrimitiveKind() { return type.getPrimitiveKind(); } public short getWhitespace() throws DatatypeException { return type.getWhitespace(); } public boolean isEqual(Object value1, Object value2) { return type.isEqual(value1, value2); } public boolean isIDType() { return type.isIDType(); } public void validate(ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException { type.validate(context, validatedInfo); } public Object validate(String content, ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException { return type.validate(content, context, validatedInfo); } public Object validate(Object content, ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException { return type.validate(content, context, validatedInfo); } public String toString() { return type.toString(); } }
PedroBorges9/xerces-for-android
src/mf/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java
Java
apache-2.0
6,406
/*************************GO-LICENSE-START********************************* * Copyright 2014 ThoughtWorks, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *************************GO-LICENSE-END***********************************/ package com.thoughtworks.go.domain.valuestreammap; import java.util.Arrays; import java.util.Collections; import java.util.Date; import java.util.List; import org.junit.Test; import static com.thoughtworks.go.domain.valuestreammap.VSMTestHelper.scmRevision; import static org.hamcrest.CoreMatchers.hasItems; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; public class NodeTest { @Test public void shouldReplaceParentNodeAtTheSameIndex() { /* g -> p1 -> p3 | ^ +-> p2 --+ */ Node git = new PipelineDependencyNode("git-fingerprint", "git"); git.setLevel(0); Node p1 = new PipelineDependencyNode("p1", "p1"); p1.setLevel(1); Node p2 = new PipelineDependencyNode("p2", "p2"); p2.setLevel(1); Node dummy = new PipelineDependencyNode("dummy", "dummy"); dummy.setLevel(1); Node p3 = new PipelineDependencyNode("p3", "p3"); p2.setLevel(2); git.addChildIfAbsent(p1); git.addChildIfAbsent(p2); p1.addParentIfAbsent(git); p2.addParentIfAbsent(git); p1.addChildIfAbsent(p3); p2.addChildIfAbsent(p3); p3.addParentIfAbsent(p1); p3.addParentIfAbsent(p2); assertThat(p3.getParents().size(), is(2)); assertThat(p3.getParents(), hasItems(p1, p2)); p3.replaceParentWith(p1, dummy); assertThat(p3.getParents().size(), is(2)); assertThat(p3.getParents(), hasItems(dummy, p2)); } @Test public void shouldReplaceChildNodeAtTheSameIndex() { /* g -> p1 | +-> p2 */ Node git = new PipelineDependencyNode("git-fingerprint", "git"); git.setLevel(0); Node p1 = new PipelineDependencyNode("p1", "p1"); p1.setLevel(1); Node p2 = new PipelineDependencyNode("p2", "p2"); p2.setLevel(1); Node dummy = new PipelineDependencyNode("dummy", "dummy"); dummy.setLevel(0); git.addChildIfAbsent(p1); git.addChildIfAbsent(p2); p1.addParentIfAbsent(git); p2.addParentIfAbsent(git); assertThat(git.getChildren().size(), is(2)); assertThat(git.getChildren(), hasItems(p1, p2)); git.replaceChildWith(p1, dummy); assertThat(git.getChildren().size(), is(2)); assertThat(git.getChildren(), hasItems(dummy, p2)); } @Test public void shouldGetTypeForNode() { Node g1 = new SCMDependencyNode("g1", "g1", "git"); Node p2 = new PipelineDependencyNode("p2", "p2"); Node dummy = new DummyNode("dummy", "dummy"); assertThat(g1.getType(), is(DependencyNodeType.MATERIAL)); assertThat(p2.getType(), is(DependencyNodeType.PIPELINE)); assertThat(dummy.getType(), is(DependencyNodeType.DUMMY)); } @Test public void shouldCompareTwoNodesBasedOnBarycenterValue() { PipelineDependencyNode p1 = new PipelineDependencyNode("p1", "p1"); p1.setLevel(1); p1.setDepth(5); PipelineDependencyNode p2 = new PipelineDependencyNode("p2", "p2"); p2.setLevel(1); p2.setDepth(1); PipelineDependencyNode p3 = new PipelineDependencyNode("p3", "p3"); p3.setLevel(1); p3.setDepth(4); List<PipelineDependencyNode> nodes = Arrays.asList(p1, p2, p3); Collections.sort(nodes); assertThat(nodes, is(Arrays.asList(p2, p3, p1))); } @Test public void shouldAddUniqueAndNotNullRevisionsToANode() throws Exception { Revision p11 = new PipelineRevision("p1", 1, "label1"); Revision p12 = new PipelineRevision("p1", 2, "label2"); PipelineDependencyNode node = new PipelineDependencyNode("p1", "p1"); node.setLevel(1); node.addRevision(p11); node.addRevision(null); node.addRevision(p12); node.addRevision(p11); List<Revision> revisions = node.revisions(); assertThat(revisions.toString(), revisions.size(), is(2)); assertThat(revisions, hasItems(p11, p12)); } @Test public void shouldGetRevisionsSortedInOrderOfModificationTimes_ForAnScmMaterialNode() { SCMDependencyNode node = new SCMDependencyNode("finger-print", "svn-material", "svn"); Revision revision_Mar4th = scmRevision("rev", new Date(2013, 3, 4)); Revision revision_Mar3rd = scmRevision("rev", new Date(2013, 3, 3)); Revision revision_Mar2nd = scmRevision("rev", new Date(2013, 3, 2)); node.addRevision(revision_Mar3rd); node.addRevision(revision_Mar4th); node.addRevision(revision_Mar2nd); assertThat(node.revisions(), is(Arrays.asList(revision_Mar4th, revision_Mar3rd, revision_Mar2nd))); } @Test public void shouldGetRevisionsSortedInOrderOfPipelineCounters() { Node node = new PipelineDependencyNode("p", "p"); Revision revision_2 = new PipelineRevision("p", 2, "2"); Revision revision_1 = new PipelineRevision("p", 1, "1"); Revision revision_3 = new PipelineRevision("p", 3, "3"); node.addRevision(revision_2); node.addRevision(revision_1); node.addRevision(revision_3); assertThat(node.revisions(), is(Arrays.asList(revision_3, revision_2, revision_1))); } }
sahilm/gocd
server/test/unit/com/thoughtworks/go/domain/valuestreammap/NodeTest.java
Java
apache-2.0
6,110
package com.google.maps.android.geojson; import com.google.android.gms.maps.model.BitmapDescriptor; import com.google.android.gms.maps.model.MarkerOptions; import java.util.Arrays; import java.util.Observable; /** * A class that allows for GeoJsonPoint objects to be styled and for these styles to be translated * into a MarkerOptions object. {@see * <a href="https://developer.android.com/reference/com/google/android/gms/maps/model/MarkerOptions.html"> * MarkerOptions docs</a> for more details about the options.} */ public class GeoJsonPointStyle extends Observable implements GeoJsonStyle { private final static String[] GEOMETRY_TYPE = {"Point", "MultiPoint", "GeometryCollection"}; private final MarkerOptions mMarkerOptions; /** * Creates a new PointStyle object */ public GeoJsonPointStyle() { mMarkerOptions = new MarkerOptions(); } /** {@inheritDoc} */ @Override public String[] getGeometryType() { return GEOMETRY_TYPE; } /** * Gets the alpha of the GeoJsonPoint. This is a value from 0 to 1, where 0 means the marker is * completely transparent and 1 means the marker is completely opaque. * * @return alpha of the GeoJsonPoint */ public float getAlpha() { return mMarkerOptions.getAlpha(); } /** * Sets the alpha of the GeoJsonPoint. This is a value from 0 to 1, where 0 means the marker is * completely transparent and 1 means the marker is completely opaque. * * @param alpha alpha value of the GeoJsonPoint */ public void setAlpha(float alpha) { mMarkerOptions.alpha(alpha); styleChanged(); } /** * Gets the Anchor U coordinate of the GeoJsonPoint. Normalized to [0, 1], of the anchor from * the left edge. This is equivalent to the same U value used in {@link * com.google.android.gms.maps.model.MarkerOptions#getAnchorU()}. * * @return Anchor U coordinate of the GeoJsonPoint */ public float getAnchorU() { return mMarkerOptions.getAnchorU(); } /** * Gets the Anchor V coordinate of the GeoJsonPoint. Normalized to [0, 1], of the anchor from * the top edge. This is equivalent to the same V value used in {@link * com.google.android.gms.maps.model.MarkerOptions#getAnchorV()}. * * @return Anchor V coordinate of the GeoJsonPoint */ public float getAnchorV() { return mMarkerOptions.getAnchorV(); } /** * Sets the Anchor U and V coordinates of the GeoJsonPoint. The anchor point is specified in * the * continuous space [0.0, 1.0] x [0.0, 1.0], where (0, 0) is the top-left corner of the image, * and (1, 1) is the bottom-right corner. The U &amp; V values are the same U &amp; V values * used in * {@link com.google.android.gms.maps.model.MarkerOptions#anchor(float, float)} ()}. * * @param anchorU Anchor U coordinate of the GeoJsonPoint * @param anchorV Anchor V coordinate of the GeoJsonPoint */ public void setAnchor(float anchorU, float anchorV) { mMarkerOptions.anchor(anchorU, anchorV); styleChanged(); } /** * Gets whether the GeoJsonPoint is draggable * * @return true if GeoJsonPoint is draggable, false if not draggable */ public boolean isDraggable() { return mMarkerOptions.isDraggable(); } /** * Sets the GeoJsonPoint to be draggable * * @param draggable true if GeoJsonPoint is draggable, false if not draggable */ public void setDraggable(boolean draggable) { mMarkerOptions.draggable(draggable); styleChanged(); } /** * Gets whether the GeoJsonPoint is flat * * @return true if GeoJsonPoint is flat, false if not flat */ public boolean isFlat() { return mMarkerOptions.isFlat(); } /** * Sets the GeoJsonPoint to be flat * * @param flat true if GeoJsonPoint is flat, false if not flat */ public void setFlat(boolean flat) { mMarkerOptions.flat(flat); styleChanged(); } /** * Gets a bitmap image for the GeoJsonPoint * * @return bitmap descriptor for the GeoJsonPoint */ public BitmapDescriptor getIcon() { return mMarkerOptions.getIcon(); } /** * Sets a bitmap image for the GeoJsonPoint * * @param bitmap bitmap descriptor for the GeoJsonPoint */ public void setIcon(BitmapDescriptor bitmap) { mMarkerOptions.icon(bitmap); styleChanged(); } /** * Gets the info window anchor U coordinate of the GeoJsonPoint. Normalized to [0, 1], of the * info window anchor from the left edge. This is equivalent to the same U value used in {@link * com.google.android.gms.maps.model.MarkerOptions#getInfoWindowAnchorU()}. * * @return info window anchor U coordinate of the GeoJsonPoint */ public float getInfoWindowAnchorU() { return mMarkerOptions.getInfoWindowAnchorU(); } /** * Gets the info window anchor V coordinate of the GeoJsonPoint. Normalized to [0, 1], of the * info window anchor from the top edge. This is equivalent to the same V value used in {@link * com.google.android.gms.maps.model.MarkerOptions#getInfoWindowAnchorV()}. * * @return info window anchor V coordinate of the GeoJsonPoint */ public float getInfoWindowAnchorV() { return mMarkerOptions.getInfoWindowAnchorV(); } /** * Sets the info window anchor U and V coordinates of the GeoJsonPoint. This is specified in * the same coordinate system as the anchor. The U &amp; V values are the same U &amp; V values * used in * {@link com.google.android.gms.maps.model.MarkerOptions#infoWindowAnchor(float, float)}. * * @param infoWindowAnchorU info window anchor U coordinate of the GeoJsonPoint * @param infoWindowAnchorV info window anchor V coordinate of the GeoJsonPoint */ public void setInfoWindowAnchor(float infoWindowAnchorU, float infoWindowAnchorV) { mMarkerOptions.infoWindowAnchor(infoWindowAnchorU, infoWindowAnchorV); styleChanged(); } /** * Gets the rotation of the GeoJsonPoint in degrees clockwise about the marker's anchor point * * @return rotation of the GeoJsonPoint */ public float getRotation() { return mMarkerOptions.getRotation(); } /** * Sets the rotation of the GeoJsonPoint in degrees clockwise about the marker's anchor point * * @param rotation rotation value of the GeoJsonPoint */ public void setRotation(float rotation) { mMarkerOptions.rotation(rotation); styleChanged(); } /** * Gets the snippet of the GeoJsonPoint * * @return snippet of the GeoJsonPoint */ public String getSnippet() { return mMarkerOptions.getSnippet(); } /** * Sets the snippet of the GeoJsonPoint * * @param snippet sets the snippet value of the GeoJsonPoint */ public void setSnippet(String snippet) { mMarkerOptions.snippet(snippet); styleChanged(); } /** * Gets the title of the GeoJsonPoint * * @return title of the GeoJsonPoint */ public String getTitle() { return mMarkerOptions.getTitle(); } /** * Sets the title of the GeoJsonPoint * * @param title title value of the GeoJsonPoint */ public void setTitle(String title) { mMarkerOptions.title(title); styleChanged(); } /** * Gets whether the GeoJsonPoint is visible * * @return true if GeoJsonPoint is visible, false if not visible */ @Override public boolean isVisible() { return mMarkerOptions.isVisible(); } /** * Sets whether the GeoJsonPoint is visible * * @param visible true if GeoJsonPoint is visible, false if not visible */ @Override public void setVisible(boolean visible) { mMarkerOptions.visible(visible); styleChanged(); } /** * Notifies the observers, GeoJsonFeature objects, that the style has changed. Indicates to the * GeoJsonFeature that it should check whether a redraw is needed for the feature. */ private void styleChanged() { setChanged(); notifyObservers(); } /** * Gets a new MarkerOptions object containing styles for the GeoJsonPoint * * @return new MarkerOptions object */ public MarkerOptions toMarkerOptions() { MarkerOptions markerOptions = new MarkerOptions(); markerOptions.alpha(mMarkerOptions.getAlpha()); markerOptions.anchor(mMarkerOptions.getAnchorU(), mMarkerOptions.getAnchorV()); markerOptions.draggable(mMarkerOptions.isDraggable()); markerOptions.flat(mMarkerOptions.isFlat()); markerOptions.icon(mMarkerOptions.getIcon()); markerOptions.infoWindowAnchor(mMarkerOptions.getInfoWindowAnchorU(), mMarkerOptions.getInfoWindowAnchorV()); markerOptions.rotation(mMarkerOptions.getRotation()); markerOptions.snippet(mMarkerOptions.getSnippet()); markerOptions.title(mMarkerOptions.getTitle()); markerOptions.visible(mMarkerOptions.isVisible()); return markerOptions; } @Override public String toString() { StringBuilder sb = new StringBuilder("PointStyle{"); sb.append("\n geometry type=").append(Arrays.toString(GEOMETRY_TYPE)); sb.append(",\n alpha=").append(getAlpha()); sb.append(",\n anchor U=").append(getAnchorU()); sb.append(",\n anchor V=").append(getAnchorV()); sb.append(",\n draggable=").append(isDraggable()); sb.append(",\n flat=").append(isFlat()); sb.append(",\n info window anchor U=").append(getInfoWindowAnchorU()); sb.append(",\n info window anchor V=").append(getInfoWindowAnchorV()); sb.append(",\n rotation=").append(getRotation()); sb.append(",\n snippet=").append(getSnippet()); sb.append(",\n title=").append(getTitle()); sb.append(",\n visible=").append(isVisible()); sb.append("\n}\n"); return sb.toString(); } }
impraveen/android-maps-utils
library/src/com/google/maps/android/geojson/GeoJsonPointStyle.java
Java
apache-2.0
10,326
<?php /** * Add Site Administration Screen * * @package WordPress * @subpackage Multisite * @since 3.1.0 */ /** Load WordPress Administration Bootstrap */ require_once( dirname( __FILE__ ) . '/admin.php' ); if ( ! is_multisite() ) wp_die( __( 'Multisite support is not enabled.' ) ); if ( ! current_user_can( 'manage_sites' ) ) wp_die( __( 'You do not have sufficient permissions to add sites to this network.' ) ); get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __('Overview'), 'content' => '<p>' . __('This screen is for Super Admins to add new sites to the network. This is not affected by the registration settings.') . '</p>' . '<p>' . __('If the admin email for the new site does not exist in the database, a new user will also be created.') . '</p>' ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __('For more information:') . '</strong></p>' . '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Sites_Screen" target="_blank">Documentation on Site Management</a>') . '</p>' . '<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>' ); if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) { check_admin_referer( 'add-blog', '_wpnonce_add-blog' ); if ( ! is_array( $_POST['blog'] ) ) wp_die( __( 'Can&#8217;t create an empty site.' ) ); $blog = $_POST['blog']; $domain = ''; if ( preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) ) $domain = strtolower( $blog['domain'] ); // If not a subdomain install, make sure the domain isn't a reserved word if ( ! is_subdomain_install() ) { /** This filter is documented in wp-includes/ms-functions.php */ $subdirectory_reserved_names = apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed' ) ); if ( in_array( $domain, $subdirectory_reserved_names ) ) wp_die( sprintf( __('The following words are reserved for use by WordPress functions and cannot be used as blog names: <code>%s</code>' ), implode( '</code>, <code>', $subdirectory_reserved_names ) ) ); } $email = sanitize_email( $blog['email'] ); $title = $blog['title']; if ( empty( $domain ) ) wp_die( __( 'Missing or invalid site address.' ) ); if ( empty( $email ) ) wp_die( __( 'Missing email address.' ) ); if ( !is_email( $email ) ) wp_die( __( 'Invalid email address.' ) ); if ( is_subdomain_install() ) { $newdomain = $domain . '.' . preg_replace( '|^www\.|', '', $current_site->domain ); $path = $current_site->path; } else { $newdomain = $current_site->domain; $path = $current_site->path . $domain . '/'; } $password = 'N/A'; $user_id = email_exists($email); if ( !$user_id ) { // Create a new user with a random password $password = wp_generate_password( 12, false ); $user_id = wpmu_create_user( $domain, $password, $email ); if ( false == $user_id ) wp_die( __( 'There was an error creating the user.' ) ); else wp_new_user_notification( $user_id, $password ); } $wpdb->hide_errors(); $id = wpmu_create_blog( $newdomain, $path, $title, $user_id , array( 'public' => 1 ), $current_site->id ); $wpdb->show_errors(); if ( !is_wp_error( $id ) ) { if ( !is_super_admin( $user_id ) && !get_user_option( 'primary_blog', $user_id ) ) update_user_option( $user_id, 'primary_blog', $id, true ); $content_mail = sprintf( __( 'New site created by %1$s Address: %2$s Name: %3$s' ), $current_user->user_login , get_site_url( $id ), wp_unslash( $title ) ); wp_mail( get_site_option('admin_email'), sprintf( __( '[%s] New Site Created' ), $current_site->site_name ), $content_mail, 'From: "Site Admin" <' . get_site_option( 'admin_email' ) . '>' ); wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) ); wp_redirect( add_query_arg( array( 'update' => 'added', 'id' => $id ), 'site-new.php' ) ); exit; } else { wp_die( $id->get_error_message() ); } } if ( isset($_GET['update']) ) { $messages = array(); if ( 'added' == $_GET['update'] ) $messages[] = sprintf( __( 'Site added. <a href="%1$s">Visit Dashboard</a> or <a href="%2$s">Edit Site</a>' ), esc_url( get_admin_url( absint( $_GET['id'] ) ) ), network_admin_url( 'site-info.php?id=' . absint( $_GET['id'] ) ) ); } $title = __('Add New Site'); $parent_file = 'sites.php'; require( ABSPATH . 'wp-admin/admin-header.php' ); ?> <div class="wrap"> <h2 id="add-new-site"><?php _e('Add New Site') ?></h2> <?php if ( ! empty( $messages ) ) { foreach ( $messages as $msg ) echo '<div id="message" class="updated"><p>' . $msg . '</p></div>'; } ?> <form method="post" action="<?php echo network_admin_url('site-new.php?action=add-site'); ?>"> <?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ) ?> <table class="form-table"> <tr class="form-field form-required"> <th scope="row"><?php _e( 'Site Address' ) ?></th> <td> <?php if ( is_subdomain_install() ) { ?> <input name="blog[domain]" type="text" class="regular-text" title="<?php esc_attr_e( 'Domain' ) ?>"/><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', $current_site->domain ); ?></span> <?php } else { echo $current_site->domain . $current_site->path ?><input name="blog[domain]" class="regular-text" type="text" title="<?php esc_attr_e( 'Domain' ) ?>"/> <?php } echo '<p>' . __( 'Only lowercase letters (a-z) and numbers are allowed.' ) . '</p>'; ?> </td> </tr> <tr class="form-field form-required"> <th scope="row"><?php _e( 'Site Title' ) ?></th> <td><input name="blog[title]" type="text" class="regular-text" title="<?php esc_attr_e( 'Title' ) ?>"/></td> </tr> <tr class="form-field form-required"> <th scope="row"><?php _e( 'Admin Email' ) ?></th> <td><input name="blog[email]" type="text" class="regular-text" title="<?php esc_attr_e( 'Email' ) ?>"/></td> </tr> <tr class="form-field"> <td colspan="2"><?php _e( 'A new user will be created if the above email address is not in the database.' ) ?><br /><?php _e( 'The username and password will be mailed to this email address.' ) ?></td> </tr> </table> <?php submit_button( __('Add Site'), 'primary', 'add-site' ); ?> </form> </div> <?php require( ABSPATH . 'wp-admin/admin-footer.php' );
leosiuk/www2
wp-admin/network/site-new.php
PHP
apache-2.0
6,290
<?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @package Zend_Validator */ namespace ZendTest\Validator\File; use Zend\Validator\File; /** * IsCompressed testbed * * @category Zend * @package Zend_Validator_File * @subpackage UnitTests * @group Zend_Validator */ class IsCompressedTest extends \PHPUnit_Framework_TestCase { protected function getMagicMime() { // As of PHP >= 5.3.11 and >= 5.4.1 the magic database format has changed. // http://doc.php.net/downloads/pdf/split/de/File-Information.pdf (page 11) if (version_compare(PHP_VERSION, '5.3.10', '<=') || (version_compare(PHP_VERSION, '5.4', '>=') && version_compare(PHP_VERSION, '5.4.1', '<')) ) { return __DIR__ . '/_files/magic.lte.5.3.10.mime'; } return __DIR__ . '/_files/magic.mime'; } /** * @return array */ public function basicBehaviorDataProvider() { $testFile = __DIR__ . '/_files/test.zip'; $fileUpload = array( 'tmp_name' => $testFile, 'name' => basename($testFile), 'size' => 200, 'error' => 0, 'type' => 'application/zip' ); return array( // Options, isValid Param, Expected value array(null, $fileUpload, true), array('zip', $fileUpload, true), array('test/notype', $fileUpload, false), array('application/zip, application/x-tar', $fileUpload, true), array(array('application/zip', 'application/x-tar'), $fileUpload, true), array(array('zip', 'tar'), $fileUpload, true), array(array('tar', 'arj'), $fileUpload, false), ); } /** * @return void */ protected function skipIfNoFileInfoExtension() { if (!extension_loaded('fileinfo') && function_exists('mime_content_type') && ini_get('mime_magic.magicfile') && (mime_content_type(__DIR__ . '/_files/test.zip') == 'text/plain') ) { $this->markTestSkipped( 'This PHP Version has no finfo, has mime_content_type, ' . ' but mime_content_type exhibits buggy behavior on this system.' ); } } /** * Ensures that the validator follows expected behavior * * @dataProvider basicBehaviorDataProvider * @return void */ public function testBasic($options, $isValidParam, $expected) { $this->skipIfNoFileInfoExtension(); $validator = new File\IsCompressed($options); $validator->enableHeaderCheck(); $this->assertEquals($expected, $validator->isValid($isValidParam)); } /** * Ensures that the validator follows expected behavior for legacy Zend\Transfer API * * @dataProvider basicBehaviorDataProvider * @return void */ public function testLegacy($options, $isValidParam, $expected) { if (is_array($isValidParam)) { $this->skipIfNoFileInfoExtension(); $validator = new File\IsCompressed($options); $validator->enableHeaderCheck(); $this->assertEquals($expected, $validator->isValid($isValidParam['tmp_name'], $isValidParam)); } } /** * Ensures that getMimeType() returns expected value * * @return void */ public function testGetMimeType() { $validator = new File\IsCompressed('image/gif'); $this->assertEquals('image/gif', $validator->getMimeType()); $validator = new File\IsCompressed(array('image/gif', 'video', 'text/test')); $this->assertEquals('image/gif,video,text/test', $validator->getMimeType()); $validator = new File\IsCompressed(array('image/gif', 'video', 'text/test')); $this->assertEquals(array('image/gif', 'video', 'text/test'), $validator->getMimeType(true)); } /** * Ensures that setMimeType() returns expected value * * @return void */ public function testSetMimeType() { $validator = new File\IsCompressed('image/gif'); $validator->setMimeType('image/jpeg'); $this->assertEquals('image/jpeg', $validator->getMimeType()); $this->assertEquals(array('image/jpeg'), $validator->getMimeType(true)); $validator->setMimeType('image/gif, text/test'); $this->assertEquals('image/gif,text/test', $validator->getMimeType()); $this->assertEquals(array('image/gif', 'text/test'), $validator->getMimeType(true)); $validator->setMimeType(array('video/mpeg', 'gif')); $this->assertEquals('video/mpeg,gif', $validator->getMimeType()); $this->assertEquals(array('video/mpeg', 'gif'), $validator->getMimeType(true)); } /** * Ensures that addMimeType() returns expected value * * @return void */ public function testAddMimeType() { $validator = new File\IsCompressed('image/gif'); $validator->addMimeType('text'); $this->assertEquals('image/gif,text', $validator->getMimeType()); $this->assertEquals(array('image/gif', 'text'), $validator->getMimeType(true)); $validator->addMimeType('jpg, to'); $this->assertEquals('image/gif,text,jpg,to', $validator->getMimeType()); $this->assertEquals(array('image/gif', 'text', 'jpg', 'to'), $validator->getMimeType(true)); $validator->addMimeType(array('zip', 'ti')); $this->assertEquals('image/gif,text,jpg,to,zip,ti', $validator->getMimeType()); $this->assertEquals(array('image/gif', 'text', 'jpg', 'to', 'zip', 'ti'), $validator->getMimeType(true)); $validator->addMimeType(''); $this->assertEquals('image/gif,text,jpg,to,zip,ti', $validator->getMimeType()); $this->assertEquals(array('image/gif', 'text', 'jpg', 'to', 'zip', 'ti'), $validator->getMimeType(true)); } /** * @ZF-8111 */ public function testErrorMessages() { $files = array( 'name' => 'picture.jpg', 'type' => 'image/jpeg', 'size' => 200, 'tmp_name' => __DIR__ . '/_files/picture.jpg', 'error' => 0 ); $validator = new File\IsCompressed('test/notype'); $validator->enableHeaderCheck(); $this->assertFalse($validator->isValid(__DIR__ . '/_files/picture.jpg', $files)); $error = $validator->getMessages(); $this->assertTrue(array_key_exists('fileIsCompressedFalseType', $error)); } public function testOptionsAtConstructor() { if (!extension_loaded('fileinfo')) { $this->markTestSkipped('This PHP Version has no finfo installed'); } $magicFile = $this->getMagicMime(); $validator = new File\IsCompressed(array( 'image/gif', 'image/jpg', 'magicFile' => $magicFile, 'enableHeaderCheck' => true)); $this->assertEquals($magicFile, $validator->getMagicFile()); $this->assertTrue($validator->getHeaderCheck()); $this->assertEquals('image/gif,image/jpg', $validator->getMimeType()); } public function testNonMimeOptionsAtConstructorStillSetsDefaults() { $validator = new File\IsCompressed(array( 'enableHeaderCheck' => true, )); $this->assertNotEmpty($validator->getMimeType()); } /** * @group ZF-11258 */ public function testZF11258() { $validator = new File\IsCompressed(); $this->assertFalse($validator->isValid(__DIR__ . '/_files/nofile.mo')); $this->assertTrue(array_key_exists('fileIsCompressedNotReadable', $validator->getMessages())); $this->assertContains("does not exist", current($validator->getMessages())); } }
abha9377/GSLocator
vendor/ZF2/tests/ZendTest/Validator/File/IsCompressedTest.php
PHP
apache-2.0
8,246
/* * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.intellij.codeInspection.sillyAssignment; import com.intellij.codeInspection.*; import com.intellij.openapi.util.Comparing; import com.intellij.psi.*; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.psi.util.PsiUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; public class SillyAssignmentInspectionBase extends BaseJavaBatchLocalInspectionTool { @Override @NotNull public String getGroupDisplayName() { return ""; } @Override @NotNull public String getDisplayName() { return InspectionsBundle.message("inspection.variable.assigned.to.itself.display.name"); } @Override @NotNull @NonNls public String getShortName() { return "SillyAssignment"; } @Override public boolean isEnabledByDefault() { return true; } @Override @NotNull public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly) { return new JavaElementVisitor() { @Override public void visitAssignmentExpression(PsiAssignmentExpression expression) { checkSillyAssignment(expression, holder); } @Override public void visitReferenceExpression(PsiReferenceExpression expression) { visitElement(expression); } @Override public void visitVariable(final PsiVariable variable) { final PsiExpression initializer = PsiUtil.deparenthesizeExpression(variable.getInitializer()); if (initializer instanceof PsiAssignmentExpression) { final PsiExpression lExpr = PsiUtil.deparenthesizeExpression(((PsiAssignmentExpression)initializer).getLExpression()); checkExpression(variable, lExpr); } else { checkExpression(variable, initializer); } } private void checkExpression(PsiVariable variable, PsiExpression expression) { if (!(expression instanceof PsiReferenceExpression)) { return; } final PsiReferenceExpression refExpr = (PsiReferenceExpression)expression; final PsiExpression qualifier = refExpr.getQualifierExpression(); if (qualifier == null || qualifier instanceof PsiThisExpression || qualifier instanceof PsiSuperExpression || variable.hasModifierProperty(PsiModifier.STATIC)) { if (refExpr.isReferenceTo(variable)) { holder.registerProblem(expression, InspectionsBundle.message("assignment.to.declared.variable.problem.descriptor", variable.getName()), ProblemHighlightType.LIKE_UNUSED_SYMBOL); } } } }; } private void checkSillyAssignment(PsiAssignmentExpression assignment, ProblemsHolder holder) { if (assignment.getOperationTokenType() != JavaTokenType.EQ) return; PsiExpression lExpression = assignment.getLExpression(); PsiExpression rExpression = assignment.getRExpression(); if (rExpression == null) return; lExpression = PsiUtil.deparenthesizeExpression(lExpression); rExpression = PsiUtil.deparenthesizeExpression(rExpression); if (!(lExpression instanceof PsiReferenceExpression)) return; PsiReferenceExpression rRef; if (!(rExpression instanceof PsiReferenceExpression)) { if (!(rExpression instanceof PsiAssignmentExpression)) return; final PsiAssignmentExpression rAssignmentExpression = (PsiAssignmentExpression)rExpression; final PsiExpression assignee = PsiUtil.deparenthesizeExpression(rAssignmentExpression.getLExpression()); if (!(assignee instanceof PsiReferenceExpression)) return; rRef = (PsiReferenceExpression)assignee; } else { rRef = (PsiReferenceExpression)rExpression; } PsiReferenceExpression lRef = (PsiReferenceExpression)lExpression; PsiManager manager = assignment.getManager(); if (!sameInstanceReferences(lRef, rRef, manager)) return; final PsiVariable variable = (PsiVariable)lRef.resolve(); if (variable == null) return; holder.registerProblem(assignment, InspectionsBundle.message("assignment.to.itself.problem.descriptor", variable.getName()), ProblemHighlightType.LIKE_UNUSED_SYMBOL, createRemoveAssignmentFix()); } protected LocalQuickFix createRemoveAssignmentFix() { return null; } /** * @return true if both expressions resolve to the same variable/class or field in the same instance of the class */ private static boolean sameInstanceReferences(@Nullable PsiJavaCodeReferenceElement lRef, @Nullable PsiJavaCodeReferenceElement rRef, PsiManager manager) { if (lRef == null && rRef == null) return true; if (lRef == null || rRef == null) return false; PsiElement lResolved = lRef.resolve(); PsiElement rResolved = rRef.resolve(); if (!manager.areElementsEquivalent(lResolved, rResolved)) return false; if (!(lResolved instanceof PsiVariable)) return false; final PsiVariable variable = (PsiVariable)lResolved; if (variable.hasModifierProperty(PsiModifier.STATIC)) return true; final PsiElement lQualifier = lRef.getQualifier(); final PsiElement rQualifier = rRef.getQualifier(); if (lQualifier instanceof PsiJavaCodeReferenceElement && rQualifier instanceof PsiJavaCodeReferenceElement) { return sameInstanceReferences((PsiJavaCodeReferenceElement)lQualifier, (PsiJavaCodeReferenceElement)rQualifier, manager); } if (Comparing.equal(lQualifier, rQualifier)) return true; boolean lThis = lQualifier == null || lQualifier instanceof PsiThisExpression || lQualifier instanceof PsiSuperExpression; boolean rThis = rQualifier == null || rQualifier instanceof PsiThisExpression || rQualifier instanceof PsiSuperExpression; if (lThis && rThis) { final PsiJavaCodeReferenceElement llQualifier = getQualifier(lQualifier); final PsiJavaCodeReferenceElement rrQualifier = getQualifier(rQualifier); return sameInstanceReferences(llQualifier, rrQualifier, manager); } return false; } private static PsiJavaCodeReferenceElement getQualifier(PsiElement qualifier) { if (qualifier instanceof PsiThisExpression) { final PsiJavaCodeReferenceElement thisQualifier = ((PsiThisExpression)qualifier).getQualifier(); if (thisQualifier != null) { final PsiClass innerMostClass = PsiTreeUtil.getParentOfType(thisQualifier, PsiClass.class); if (innerMostClass == thisQualifier.resolve()) { return null; } } return thisQualifier; } if (qualifier != null) { return ((PsiSuperExpression)qualifier).getQualifier(); } return null; } }
diorcety/intellij-community
java/java-analysis-impl/src/com/intellij/codeInspection/sillyAssignment/SillyAssignmentInspectionBase.java
Java
apache-2.0
7,279
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!DOCTYPE html> <html> <head> <title>Apache Tomcat WebSocket Examples: Echo</title> <style type="text/css"> #connect-container { float: left; width: 400px } #connect-container div { padding: 5px; } #console-container { float: left; margin-left: 15px; width: 400px; } #console { border: 1px solid #CCCCCC; border-right-color: #999999; border-bottom-color: #999999; height: 170px; overflow-y: scroll; padding: 5px; width: 100%; } #console p { padding: 0; margin: 0; } </style> <script type="text/javascript"> var ws = null; function setConnected(connected) { document.getElementById('connect').disabled = connected; document.getElementById('disconnect').disabled = !connected; document.getElementById('echo').disabled = !connected; } function connect() { var target = document.getElementById('target').value; if (target == '') { alert('Please select server side connection implementation.'); return; } if ('WebSocket' in window) { ws = new WebSocket(target); } else if ('MozWebSocket' in window) { ws = new MozWebSocket(target); } else { alert('WebSocket is not supported by this browser.'); return; } ws.onopen = function () { setConnected(true); log('Info: WebSocket connection opened.'); }; ws.onmessage = function (event) { log('Received: ' + event.data); }; ws.onclose = function () { setConnected(false); log('Info: WebSocket connection closed.'); }; } function disconnect() { if (ws != null) { ws.close(); ws = null; } setConnected(false); } function echo() { if (ws != null) { var message = document.getElementById('message').value; log('Sent: ' + message); ws.send(message); } else { alert('WebSocket connection not established, please connect.'); } } function updateTarget(target) { if (window.location.protocol == 'http:') { document.getElementById('target').value = 'ws://' + window.location.host + target; } else { document.getElementById('target').value = 'wss://' + window.location.host + target; } } function log(message) { var console = document.getElementById('console'); var p = document.createElement('p'); p.style.wordWrap = 'break-word'; p.appendChild(document.createTextNode(message)); console.appendChild(p); while (console.childNodes.length > 25) { console.removeChild(console.firstChild); } console.scrollTop = console.scrollHeight; } </script> </head> <body> <noscript><h2 style="color: #ff0000">Seems your browser doesn't support Javascript! Websockets rely on Javascript being enabled. Please enable Javascript and reload this page!</h2></noscript> <div> <div id="connect-container"> <div> <span>Connect using:</span> <!-- echo example using streams on the server side --> <input id="radio1" type="radio" name="group1" value="/examples/websocket/tc7/echoStream" onclick="updateTarget(this.value);"> <label for="radio1">streams</label> <!-- echo example using messages on the server side --> <input id="radio2" type="radio" name="group1" value="/examples/websocket/tc7/echoMessage" onclick="updateTarget(this.value);"> <label for="radio2">messages</label> </div> <div> <input id="target" type="text" size="40" style="width: 350px"/> </div> <div> <button id="connect" onclick="connect();">Connect</button> <button id="disconnect" disabled="disabled" onclick="disconnect();">Disconnect</button> </div> <div> <textarea id="message" style="width: 350px">Here is a message!</textarea> </div> <div> <button id="echo" onclick="echo();" disabled="disabled">Echo message</button> </div> </div> <div id="console-container"> <div id="console"></div> </div> </div> </body> </html>
jdy1512/javastudy_boardgame
apis/apache-tomcat-7.0.61/webapps/examples/websocket-deprecated/echo.html
HTML
apache-2.0
5,658
/*************************GO-LICENSE-START********************************* * Copyright 2014 ThoughtWorks, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *************************GO-LICENSE-END***********************************/ package com.thoughtworks.go.config; import com.thoughtworks.go.domain.materials.ValidationBean; import static org.hamcrest.Matchers.is; import static org.hamcrest.core.StringContains.containsString; import com.thoughtworks.go.server.messaging.SendEmailMessage; import org.jmock.Expectations; import static org.jmock.Expectations.same; import org.jmock.Mockery; import org.jmock.integration.junit4.JMock; import static org.junit.Assert.assertThat; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(JMock.class) public class BackgroundEmailSenderTest { GoMailSender neverReturns = new GoMailSender() { public ValidationBean send(String subject, String body, String to) { try { Thread.sleep(10000000); } catch (InterruptedException e) { } return null; } public ValidationBean send(SendEmailMessage message) { return send(message.getSubject(), message.getBody(), message.getTo()); } }; private Mockery mockery; private GoMailSender sender; @Before public void setUp() { mockery = new Mockery(); sender = mockery.mock(GoMailSender.class); } @Test public void shouldReturnNotValidIfSendingTimesout() { BackgroundMailSender background = new BackgroundMailSender(neverReturns, 1); ValidationBean validationBean = background.send("Subject", "body", "to@someone"); assertThat(validationBean.isValid(), is(false)); assertThat(validationBean.getError(), containsString("Timeout when sending email")); } @Test public void shouldReturnWhateverTheOtherSenderReturnsIfSendingDoesNotTimeout() { final ValidationBean validationBean = ValidationBean.valid(); mockery.checking(new Expectations() { { one(sender).send("Subject", "body", "to@someone"); will(returnValue(validationBean)); } }); BackgroundMailSender background = new BackgroundMailSender(sender, 1000); ValidationBean returned = background.send("Subject", "body", "to@someone"); assertThat(returned, same(validationBean)); } }
Battsooj/gocd
server/test/unit/com/thoughtworks/go/config/BackgroundEmailSenderTest.java
Java
apache-2.0
2,981
require 'pathname' require "openid" require 'openid/extensions/sreg' require 'openid/extensions/pape' require 'openid/store/filesystem' class ConsumerController < ApplicationController layout nil def index # render an openid form end def start begin identifier = params[:openid_identifier] if identifier.nil? flash[:error] = "Enter an OpenID identifier" redirect_to :action => 'index' return end oidreq = consumer.begin(identifier) rescue OpenID::OpenIDError => e flash[:error] = "Discovery failed for #{identifier}: #{e}" redirect_to :action => 'index' return end if params[:use_sreg] sregreq = OpenID::SReg::Request.new # required fields sregreq.request_fields(['email','nickname'], true) # optional fields sregreq.request_fields(['dob', 'fullname'], false) oidreq.add_extension(sregreq) oidreq.return_to_args['did_sreg'] = 'y' end if params[:use_pape] papereq = OpenID::PAPE::Request.new papereq.add_policy_uri(OpenID::PAPE::AUTH_PHISHING_RESISTANT) papereq.max_auth_age = 2*60*60 oidreq.add_extension(papereq) oidreq.return_to_args['did_pape'] = 'y' end if params[:force_post] oidreq.return_to_args['force_post']='x'*2048 end return_to = url_for :action => 'complete', :only_path => false realm = url_for :action => 'index', :only_path => false if oidreq.send_redirect?(realm, return_to, params[:immediate]) redirect_to oidreq.redirect_url(realm, return_to, params[:immediate]) else render :text => oidreq.html_markup(realm, return_to, params[:immediate], {'id' => 'openid_form'}) end end def complete # FIXME - url_for some action is not necessarily the current URL. current_url = url_for(:action => 'complete', :only_path => false) parameters = params.reject{|k,v|request.path_parameters[k]} oidresp = consumer.complete(parameters, current_url) case oidresp.status when OpenID::Consumer::FAILURE if oidresp.display_identifier flash[:error] = ("Verification of #{oidresp.display_identifier}"\ " failed: #{oidresp.message}") else flash[:error] = "Verification failed: #{oidresp.message}" end when OpenID::Consumer::SUCCESS flash[:success] = ("Verification of #{oidresp.display_identifier}"\ " succeeded.") if params[:did_sreg] sreg_resp = OpenID::SReg::Response.from_success_response(oidresp) sreg_message = "Simple Registration data was requested" if sreg_resp.empty? sreg_message << ", but none was returned." else sreg_message << ". The following data were sent:" sreg_resp.data.each {|k,v| sreg_message << "<br/><b>#{k}</b>: #{v}" } end flash[:sreg_results] = sreg_message end if params[:did_pape] pape_resp = OpenID::PAPE::Response.from_success_response(oidresp) pape_message = "A phishing resistant authentication method was requested" if pape_resp.auth_policies.member? OpenID::PAPE::AUTH_PHISHING_RESISTANT pape_message << ", and the server reported one." else pape_message << ", but the server did not report one." end if pape_resp.auth_time pape_message << "<br><b>Authentication time:</b> #{pape_resp.auth_time} seconds" end if pape_resp.nist_auth_level pape_message << "<br><b>NIST Auth Level:</b> #{pape_resp.nist_auth_level}" end flash[:pape_results] = pape_message end when OpenID::Consumer::SETUP_NEEDED flash[:alert] = "Immediate request failed - Setup Needed" when OpenID::Consumer::CANCEL flash[:alert] = "OpenID transaction cancelled." else end redirect_to :action => 'index' end private def consumer if @consumer.nil? dir = Pathname.new(RAILS_ROOT).join('db').join('cstore') store = OpenID::Store::Filesystem.new(dir) @consumer = OpenID::Consumer.new(session, store) end return @consumer end end
agoragames/ruby-openid-oauth-hybrid
examples/rails_openid/app/controllers/consumer_controller.rb
Ruby
apache-2.0
4,193
/* * Copyright (C) 2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * JDWP TCP socket network code. */ #include "jdwp/JdwpPriv.h" #include "jdwp/JdwpHandler.h" #include "Bits.h" #include <stdlib.h> #include <unistd.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <arpa/inet.h> #include <netdb.h> #define kBasePort 8000 #define kMaxPort 8040 #define kInputBufferSize 8192 #define kMagicHandshake "JDWP-Handshake" #define kMagicHandshakeLen (sizeof(kMagicHandshake)-1) // fwd static void netShutdown(JdwpNetState* state); static void netFree(JdwpNetState* state); /* * JDWP network state. * * We only talk to one debugger at a time. */ struct JdwpNetState : public JdwpNetStateBase { short listenPort; int listenSock; /* listen for connection from debugger */ int wakePipe[2]; /* break out of select */ struct in_addr remoteAddr; unsigned short remotePort; bool awaitingHandshake; /* waiting for "JDWP-Handshake" */ /* pending data from the network; would be more efficient as circular buf */ unsigned char inputBuffer[kInputBufferSize]; int inputCount; JdwpNetState() { listenPort = 0; listenSock = -1; wakePipe[0] = -1; wakePipe[1] = -1; awaitingHandshake = false; inputCount = 0; } }; static JdwpNetState* netStartup(short port); /* * Set up some stuff for transport=dt_socket. */ static bool prepareSocket(JdwpState* state, const JdwpStartupParams* pParams) { unsigned short port; if (pParams->server) { if (pParams->port != 0) { /* try only the specified port */ port = pParams->port; state->netState = netStartup(port); } else { /* scan through a range of ports, binding to the first available */ for (port = kBasePort; port <= kMaxPort; port++) { state->netState = netStartup(port); if (state->netState != NULL) break; } } if (state->netState == NULL) { ALOGE("JDWP net startup failed (req port=%d)", pParams->port); return false; } } else { port = pParams->port; // used in a debug msg later state->netState = netStartup(-1); } if (pParams->suspend) ALOGI("JDWP will wait for debugger on port %d", port); else ALOGD("JDWP will %s on port %d", pParams->server ? "listen" : "connect", port); return true; } /* * Are we still waiting for the handshake string? */ static bool awaitingHandshake(JdwpState* state) { return state->netState->awaitingHandshake; } /* * Initialize JDWP stuff. * * Allocates a new state structure. If "port" is non-negative, this also * tries to bind to a listen port. If "port" is less than zero, we assume * we're preparing for an outbound connection, and return without binding * to anything. * * This may be called several times if we're probing for a port. * * Returns 0 on success. */ static JdwpNetState* netStartup(short port) { int one = 1; JdwpNetState* netState = new JdwpNetState; if (port < 0) return netState; assert(port != 0); netState->listenSock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); if (netState->listenSock < 0) { ALOGE("Socket create failed: %s", strerror(errno)); goto fail; } /* allow immediate re-use */ if (setsockopt(netState->listenSock, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0) { ALOGE("setsockopt(SO_REUSEADDR) failed: %s", strerror(errno)); goto fail; } union { struct sockaddr_in addrInet; struct sockaddr addrPlain; } addr; addr.addrInet.sin_family = AF_INET; addr.addrInet.sin_port = htons(port); inet_aton("127.0.0.1", &addr.addrInet.sin_addr); if (bind(netState->listenSock, &addr.addrPlain, sizeof(addr)) != 0) { ALOGV("attempt to bind to port %u failed: %s", port, strerror(errno)); goto fail; } netState->listenPort = port; LOGVV("+++ bound to port %d", netState->listenPort); if (listen(netState->listenSock, 5) != 0) { ALOGE("Listen failed: %s", strerror(errno)); goto fail; } return netState; fail: netShutdown(netState); netFree(netState); return NULL; } /* * Shut down JDWP listener. Don't free state. * * Note that "netState" may be partially initialized if "startup" failed. * * This may be called from a non-JDWP thread as part of shutting the * JDWP thread down. * * (This is currently called several times during startup as we probe * for an open port.) */ static void netShutdown(JdwpNetState* netState) { if (netState == NULL) return; int listenSock = netState->listenSock; int clientSock = netState->clientSock; /* clear these out so it doesn't wake up and try to reuse them */ netState->listenSock = netState->clientSock = -1; /* "shutdown" dislodges blocking read() and accept() calls */ if (listenSock >= 0) { shutdown(listenSock, SHUT_RDWR); close(listenSock); } if (clientSock >= 0) { shutdown(clientSock, SHUT_RDWR); close(clientSock); } /* if we might be sitting in select, kick us loose */ if (netState->wakePipe[1] >= 0) { ALOGV("+++ writing to wakePipe"); TEMP_FAILURE_RETRY(write(netState->wakePipe[1], "", 1)); } } static void netShutdownExtern(JdwpState* state) { netShutdown(state->netState); } /* * Free JDWP state. * * Call this after shutting the network down with netShutdown(). */ static void netFree(JdwpNetState* netState) { if (netState == NULL) return; assert(netState->listenSock == -1); assert(netState->clientSock == -1); if (netState->wakePipe[0] >= 0) { close(netState->wakePipe[0]); netState->wakePipe[0] = -1; } if (netState->wakePipe[1] >= 0) { close(netState->wakePipe[1]); netState->wakePipe[1] = -1; } delete netState; } static void netFreeExtern(JdwpState* state) { netFree(state->netState); } /* * Returns "true" if we're connected to a debugger. */ static bool isConnected(JdwpState* state) { return (state->netState != NULL && state->netState->clientSock >= 0); } /* * Returns "true" if the fd is ready, "false" if not. */ #if 0 static bool isFdReadable(int sock) { fd_set readfds; struct timeval tv; int count; FD_ZERO(&readfds); FD_SET(sock, &readfds); tv.tv_sec = 0; tv.tv_usec = 0; count = select(sock+1, &readfds, NULL, NULL, &tv); if (count <= 0) return false; if (FD_ISSET(sock, &readfds)) /* make sure it's our fd */ return true; ALOGE("WEIRD: odd behavior in select (count=%d)", count); return false; } #endif #if 0 /* * Check to see if we have a pending connection from the debugger. * * Returns true on success (meaning a connection is available). */ static bool checkConnection(JdwpState* state) { JdwpNetState* netState = state->netState; assert(netState->listenSock >= 0); /* not expecting to be called when debugger is actively connected */ assert(netState->clientSock < 0); if (!isFdReadable(netState->listenSock)) return false; return true; } #endif /* * Disable the TCP Nagle algorithm, which delays transmission of outbound * packets until the previous transmissions have been acked. JDWP does a * lot of back-and-forth with small packets, so this may help. */ static int setNoDelay(int fd) { int cc, on = 1; cc = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)); assert(cc == 0); return cc; } /* * Accept a connection. This will block waiting for somebody to show up. * If that's not desirable, use checkConnection() to make sure something * is pending. */ static bool acceptConnection(JdwpState* state) { JdwpNetState* netState = state->netState; union { struct sockaddr_in addrInet; struct sockaddr addrPlain; } addr; socklen_t addrlen; int sock; if (netState->listenSock < 0) return false; /* you're not listening! */ assert(netState->clientSock < 0); /* must not already be talking */ addrlen = sizeof(addr); do { sock = accept(netState->listenSock, &addr.addrPlain, &addrlen); if (sock < 0 && errno != EINTR) { // When we call shutdown() on the socket, accept() returns with // EINVAL. Don't gripe about it. if (errno == EINVAL) LOGVV("accept failed: %s", strerror(errno)); else ALOGE("accept failed: %s", strerror(errno)); return false; } } while (sock < 0); netState->remoteAddr = addr.addrInet.sin_addr; netState->remotePort = ntohs(addr.addrInet.sin_port); ALOGV("+++ accepted connection from %s:%u", inet_ntoa(netState->remoteAddr), netState->remotePort); netState->clientSock = sock; netState->awaitingHandshake = true; netState->inputCount = 0; ALOGV("Setting TCP_NODELAY on accepted socket"); setNoDelay(netState->clientSock); if (pipe(netState->wakePipe) < 0) { ALOGE("pipe failed"); return false; } return true; } /* * Create a connection to a waiting debugger. */ static bool establishConnection(JdwpState* state) { union { struct sockaddr_in addrInet; struct sockaddr addrPlain; } addr; struct hostent* pEntry; int h_errno; assert(state != NULL && state->netState != NULL); assert(!state->params.server); assert(state->params.host[0] != '\0'); assert(state->params.port != 0); /* * Start by resolving the host name. */ //#undef HAVE_GETHOSTBYNAME_R //#warning "forcing non-R" #ifdef HAVE_GETHOSTBYNAME_R struct hostent he; char auxBuf[128]; int cc = gethostbyname_r(state->params.host, &he, auxBuf, sizeof(auxBuf), &pEntry, &h_errno); if (cc != 0) { ALOGW("gethostbyname_r('%s') failed: %s", state->params.host, strerror(errno)); return false; } #else h_errno = 0; pEntry = gethostbyname(state->params.host); if (pEntry == NULL) { ALOGW("gethostbyname('%s') failed: %s", state->params.host, strerror(h_errno)); return false; } #endif /* copy it out ASAP to minimize risk of multithreaded annoyances */ memcpy(&addr.addrInet.sin_addr, pEntry->h_addr, pEntry->h_length); addr.addrInet.sin_family = pEntry->h_addrtype; addr.addrInet.sin_port = htons(state->params.port); ALOGI("Connecting out to '%s' %d", inet_ntoa(addr.addrInet.sin_addr), ntohs(addr.addrInet.sin_port)); /* * Create a socket. */ JdwpNetState* netState; netState = state->netState; netState->clientSock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); if (netState->clientSock < 0) { ALOGE("Unable to create socket: %s", strerror(errno)); return false; } /* * Try to connect. */ if (connect(netState->clientSock, &addr.addrPlain, sizeof(addr)) != 0) { ALOGE("Unable to connect to %s:%d: %s", inet_ntoa(addr.addrInet.sin_addr), ntohs(addr.addrInet.sin_port), strerror(errno)); close(netState->clientSock); netState->clientSock = -1; return false; } ALOGI("Connection established to %s (%s:%d)", state->params.host, inet_ntoa(addr.addrInet.sin_addr), ntohs(addr.addrInet.sin_port)); netState->awaitingHandshake = true; netState->inputCount = 0; setNoDelay(netState->clientSock); if (pipe(netState->wakePipe) < 0) { ALOGE("pipe failed"); return false; } return true; } /* * Close the connection to the debugger. * * Reset the state so we're ready to receive a new connection. */ static void closeConnection(JdwpState* state) { JdwpNetState* netState; assert(state != NULL && state->netState != NULL); netState = state->netState; if (netState->clientSock < 0) return; ALOGV("+++ closed connection to %s:%u", inet_ntoa(netState->remoteAddr), netState->remotePort); close(netState->clientSock); netState->clientSock = -1; return; } /* * Figure out if we have a full packet in the buffer. */ static bool haveFullPacket(JdwpNetState* netState) { long length; if (netState->awaitingHandshake) return (netState->inputCount >= (int) kMagicHandshakeLen); if (netState->inputCount < 4) return false; length = get4BE(netState->inputBuffer); return (netState->inputCount >= length); } /* * Consume bytes from the buffer. * * This would be more efficient with a circular buffer. However, we're * usually only going to find one packet, which is trivial to handle. */ static void consumeBytes(JdwpNetState* netState, int count) { assert(count > 0); assert(count <= netState->inputCount); if (count == netState->inputCount) { netState->inputCount = 0; return; } memmove(netState->inputBuffer, netState->inputBuffer + count, netState->inputCount - count); netState->inputCount -= count; } /* * Dump the contents of a packet to stdout. */ #if 0 static void dumpPacket(const unsigned char* packetBuf) { const unsigned char* buf = packetBuf; u4 length, id; u1 flags, cmdSet, cmd; u2 error; bool reply; int dataLen; cmd = cmdSet = 0xcc; length = read4BE(&buf); id = read4BE(&buf); flags = read1(&buf); if ((flags & kJDWPFlagReply) != 0) { reply = true; error = read2BE(&buf); } else { reply = false; cmdSet = read1(&buf); cmd = read1(&buf); } dataLen = length - (buf - packetBuf); ALOGV("--- %s: dataLen=%u id=0x%08x flags=0x%02x cmd=%d/%d", reply ? "reply" : "req", dataLen, id, flags, cmdSet, cmd); if (dataLen > 0) dvmPrintHexDumpDbg(buf, dataLen, LOG_TAG); } #endif /* * Handle a packet. Returns "false" if we encounter a connection-fatal error. */ static bool handlePacket(JdwpState* state) { JdwpNetState* netState = state->netState; const unsigned char* buf = netState->inputBuffer; JdwpReqHeader hdr; u4 length, id; u1 flags, cmdSet, cmd; u2 error; bool reply; int dataLen; cmd = cmdSet = 0; // shut up gcc /*dumpPacket(netState->inputBuffer);*/ length = read4BE(&buf); id = read4BE(&buf); flags = read1(&buf); if ((flags & kJDWPFlagReply) != 0) { reply = true; error = read2BE(&buf); } else { reply = false; cmdSet = read1(&buf); cmd = read1(&buf); } assert((int) length <= netState->inputCount); dataLen = length - (buf - netState->inputBuffer); if (!reply) { ExpandBuf* pReply = expandBufAlloc(); hdr.length = length; hdr.id = id; hdr.cmdSet = cmdSet; hdr.cmd = cmd; dvmJdwpProcessRequest(state, &hdr, buf, dataLen, pReply); if (expandBufGetLength(pReply) > 0) { ssize_t cc = netState->writePacket(pReply); if (cc != (ssize_t) expandBufGetLength(pReply)) { ALOGE("Failed sending reply to debugger: %s", strerror(errno)); expandBufFree(pReply); return false; } } else { ALOGW("No reply created for set=%d cmd=%d", cmdSet, cmd); } expandBufFree(pReply); } else { ALOGV("reply?!"); assert(false); } ALOGV("----------"); consumeBytes(netState, length); return true; } /* * Process incoming data. If no data is available, this will block until * some arrives. * * If we get a full packet, handle it. * * To take some of the mystery out of life, we want to reject incoming * connections if we already have a debugger attached. If we don't, the * debugger will just mysteriously hang until it times out. We could just * close the listen socket, but there's a good chance we won't be able to * bind to the same port again, which would confuse utilities. * * Returns "false" on error (indicating that the connection has been severed), * "true" if things are still okay. */ static bool processIncoming(JdwpState* state) { JdwpNetState* netState = state->netState; int readCount; assert(netState->clientSock >= 0); if (!haveFullPacket(netState)) { /* read some more, looping until we have data */ errno = 0; while (1) { int selCount; fd_set readfds; int maxfd; int fd; maxfd = netState->listenSock; if (netState->clientSock > maxfd) maxfd = netState->clientSock; if (netState->wakePipe[0] > maxfd) maxfd = netState->wakePipe[0]; if (maxfd < 0) { ALOGV("+++ all fds are closed"); return false; } FD_ZERO(&readfds); /* configure fds; note these may get zapped by another thread */ fd = netState->listenSock; if (fd >= 0) FD_SET(fd, &readfds); fd = netState->clientSock; if (fd >= 0) FD_SET(fd, &readfds); fd = netState->wakePipe[0]; if (fd >= 0) { FD_SET(fd, &readfds); } else { ALOGI("NOTE: entering select w/o wakepipe"); } /* * Select blocks until it sees activity on the file descriptors. * Closing the local file descriptor does not count as activity, * so we can't rely on that to wake us up (it works for read() * and accept(), but not select()). * * We can do one of three things: (1) send a signal and catch * EINTR, (2) open an additional fd ("wakePipe") and write to * it when it's time to exit, or (3) time out periodically and * re-issue the select. We're currently using #2, as it's more * reliable than #1 and generally better than #3. Wastes two fds. */ selCount = select(maxfd+1, &readfds, NULL, NULL, NULL); if (selCount < 0) { if (errno == EINTR) continue; ALOGE("select failed: %s", strerror(errno)); goto fail; } if (netState->wakePipe[0] >= 0 && FD_ISSET(netState->wakePipe[0], &readfds)) { if (netState->listenSock >= 0) ALOGE("Exit wake set, but not exiting?"); else ALOGD("Got wake-up signal, bailing out of select"); goto fail; } if (netState->listenSock >= 0 && FD_ISSET(netState->listenSock, &readfds)) { ALOGI("Ignoring second debugger -- accepting and dropping"); union { struct sockaddr_in addrInet; struct sockaddr addrPlain; } addr; socklen_t addrlen; int tmpSock; tmpSock = accept(netState->listenSock, &addr.addrPlain, &addrlen); if (tmpSock < 0) ALOGI("Weird -- accept failed"); else close(tmpSock); } if (netState->clientSock >= 0 && FD_ISSET(netState->clientSock, &readfds)) { readCount = read(netState->clientSock, netState->inputBuffer + netState->inputCount, sizeof(netState->inputBuffer) - netState->inputCount); if (readCount < 0) { /* read failed */ if (errno != EINTR) goto fail; ALOGD("+++ EINTR hit"); return true; } else if (readCount == 0) { /* EOF hit -- far end went away */ ALOGD("+++ peer disconnected"); goto fail; } else break; } } netState->inputCount += readCount; if (!haveFullPacket(netState)) return true; /* still not there yet */ } /* * Special-case the initial handshake. For some bizarre reason we're * expected to emulate bad tty settings by echoing the request back * exactly as it was sent. Note the handshake is always initiated by * the debugger, no matter who connects to whom. * * Other than this one case, the protocol [claims to be] stateless. */ if (netState->awaitingHandshake) { int cc; if (memcmp(netState->inputBuffer, kMagicHandshake, kMagicHandshakeLen) != 0) { ALOGE("ERROR: bad handshake '%.14s'", netState->inputBuffer); goto fail; } errno = 0; cc = TEMP_FAILURE_RETRY(write(netState->clientSock, netState->inputBuffer, kMagicHandshakeLen)); if (cc != kMagicHandshakeLen) { ALOGE("Failed writing handshake bytes: %s (%d of %d)", strerror(errno), cc, (int) kMagicHandshakeLen); goto fail; } consumeBytes(netState, kMagicHandshakeLen); netState->awaitingHandshake = false; ALOGV("+++ handshake complete"); return true; } /* * Handle this packet. */ return handlePacket(state); fail: closeConnection(state); return false; } /* * Send a request. * * The entire packet must be sent with a single write() call to avoid * threading issues. * * Returns "true" if it was sent successfully. */ static bool sendRequest(JdwpState* state, ExpandBuf* pReq) { JdwpNetState* netState = state->netState; /*dumpPacket(expandBufGetBuffer(pReq));*/ if (netState->clientSock < 0) { /* can happen with some DDMS events */ ALOGV("NOT sending request -- no debugger is attached"); return false; } errno = 0; ssize_t cc = netState->writePacket(pReq); if (cc != (ssize_t) expandBufGetLength(pReq)) { ALOGE("Failed sending req to debugger: %s (%d of %d)", strerror(errno), (int) cc, (int) expandBufGetLength(pReq)); return false; } return true; } /* * Send a request that was split into multiple buffers. * * The entire packet must be sent with a single writev() call to avoid * threading issues. * * Returns "true" if it was sent successfully. */ static bool sendBufferedRequest(JdwpState* state, const struct iovec* iov, int iovcnt) { JdwpNetState* netState = state->netState; if (netState->clientSock < 0) { /* can happen with some DDMS events */ ALOGV("NOT sending request -- no debugger is attached"); return false; } size_t expected = 0; int i; for (i = 0; i < iovcnt; i++) expected += iov[i].iov_len; ssize_t actual = netState->writeBufferedPacket(iov, iovcnt); if ((size_t)actual != expected) { ALOGE("Failed sending b-req to debugger: %s (%d of %zu)", strerror(errno), (int) actual, expected); return false; } return true; } /* * Our functions. * * We can't generally share the implementations with other transports, * even if they're also socket-based, because our JdwpNetState will be * different from theirs. */ static const JdwpTransport socketTransport = { prepareSocket, acceptConnection, establishConnection, closeConnection, netShutdownExtern, netFreeExtern, isConnected, awaitingHandshake, processIncoming, sendRequest, sendBufferedRequest, }; /* * Return our set. */ const JdwpTransport* dvmJdwpSocketTransport() { return &socketTransport; }
pangliang/DexHunter
dalvik/vm/jdwp/JdwpSocket.cpp
C++
apache-2.0
24,972
/* * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.intellij.util.text; import com.intellij.openapi.util.text.DelimitedListProcessor; import junit.framework.TestCase; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * @author Dmitry Avdeev */ public class DelimitedListProcessorTest extends TestCase { public void testProcessor() { doTest("a; ; ", Arrays.asList("a", " ", " ")); } private void doTest(final String text, final List<String> expected) { final ArrayList<String> tokens = new ArrayList<>(); new DelimitedListProcessor(";") { @Override protected void processToken(final int start, final int end, final boolean delimitersOnly) { tokens.add(text.substring(start, end)); } }.processText(text); assertEquals(expected, tokens); } }
goodwinnk/intellij-community
platform/util/testSrc/com/intellij/util/text/DelimitedListProcessorTest.java
Java
apache-2.0
1,391
/* * Copyright (C) 2011 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.jakewharton.nineoldandroids.sample.droidflakes; import java.util.HashMap; import android.graphics.Bitmap; /** * This class represents a single Droidflake, with properties representing its * size, rotation, location, and speed. */ public class Flake { // These are the unique properties of any flake: its size, rotation, speed, // location, and its underlying Bitmap object float x, y; float rotation; float speed; float rotationSpeed; int width, height; Bitmap bitmap; // This map stores pre-scaled bitmaps according to the width. No reason to create // new bitmaps for sizes we've already seen. static HashMap<Integer, Bitmap> bitmapMap = new HashMap<Integer, Bitmap>(); /** * Creates a new droidflake in the given xRange and with the given bitmap. Parameters of * location, size, rotation, and speed are randomly determined. */ static Flake createFlake(float xRange, Bitmap originalBitmap) { Flake flake = new Flake(); // Size each flake with a width between 5 and 55 and a proportional height flake.width = (int)(5 + (float)Math.random() * 50); float hwRatio = originalBitmap.getHeight() / originalBitmap.getWidth(); flake.height = (int)(flake.width * hwRatio); // Position the flake horizontally between the left and right of the range flake.x = (float)Math.random() * (xRange - flake.width); // Position the flake vertically slightly off the top of the display flake.y = 0 - (flake.height + (float)Math.random() * flake.height); // Each flake travels at 50-200 pixels per second flake.speed = 50 + (float) Math.random() * 150; // Flakes start at -90 to 90 degrees rotation, and rotate between -45 and 45 // degrees per second flake.rotation = (float) Math.random() * 180 - 90; flake.rotationSpeed = (float) Math.random() * 90 - 45; // Get the cached bitmap for this size if it exists, otherwise create and cache one flake.bitmap = bitmapMap.get(flake.width); if (flake.bitmap == null) { flake.bitmap = Bitmap.createScaledBitmap(originalBitmap, (int)flake.width, (int)flake.height, true); bitmapMap.put(flake.width, flake.bitmap); } return flake; } }
huangzl233/NineOldAndroids
sample/src/com/jakewharton/nineoldandroids/sample/droidflakes/Flake.java
Java
apache-2.0
2,975
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package proxy import ( "bytes" "fmt" "io" "net" "net/url" "os" "strconv" "strings" "sync" "testing" ) type proxyFromEnvTest struct { allProxyEnv string noProxyEnv string wantTypeOf Dialer } func (t proxyFromEnvTest) String() string { var buf bytes.Buffer space := func() { if buf.Len() > 0 { buf.WriteByte(' ') } } if t.allProxyEnv != "" { fmt.Fprintf(&buf, "all_proxy=%q", t.allProxyEnv) } if t.noProxyEnv != "" { space() fmt.Fprintf(&buf, "no_proxy=%q", t.noProxyEnv) } return strings.TrimSpace(buf.String()) } func TestFromEnvironment(t *testing.T) { ResetProxyEnv() type dummyDialer struct { direct } RegisterDialerType("irc", func(_ *url.URL, _ Dialer) (Dialer, error) { return dummyDialer{}, nil }) proxyFromEnvTests := []proxyFromEnvTest{ {allProxyEnv: "127.0.0.1:8080", noProxyEnv: "localhost, 127.0.0.1", wantTypeOf: direct{}}, {allProxyEnv: "ftp://example.com:8000", noProxyEnv: "localhost, 127.0.0.1", wantTypeOf: direct{}}, {allProxyEnv: "socks5://example.com:8080", noProxyEnv: "localhost, 127.0.0.1", wantTypeOf: &PerHost{}}, {allProxyEnv: "irc://example.com:8000", wantTypeOf: dummyDialer{}}, {noProxyEnv: "localhost, 127.0.0.1", wantTypeOf: direct{}}, {wantTypeOf: direct{}}, } for _, tt := range proxyFromEnvTests { os.Setenv("ALL_PROXY", tt.allProxyEnv) os.Setenv("NO_PROXY", tt.noProxyEnv) ResetCachedEnvironment() d := FromEnvironment() if got, want := fmt.Sprintf("%T", d), fmt.Sprintf("%T", tt.wantTypeOf); got != want { t.Errorf("%v: got type = %T, want %T", tt, d, tt.wantTypeOf) } } } func TestFromURL(t *testing.T) { endSystem, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { t.Fatalf("net.Listen failed: %v", err) } defer endSystem.Close() gateway, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { t.Fatalf("net.Listen failed: %v", err) } defer gateway.Close() var wg sync.WaitGroup wg.Add(1) go socks5Gateway(t, gateway, endSystem, socks5Domain, &wg) url, err := url.Parse("socks5://user:password@" + gateway.Addr().String()) if err != nil { t.Fatalf("url.Parse failed: %v", err) } proxy, err := FromURL(url, Direct) if err != nil { t.Fatalf("FromURL failed: %v", err) } _, port, err := net.SplitHostPort(endSystem.Addr().String()) if err != nil { t.Fatalf("net.SplitHostPort failed: %v", err) } if c, err := proxy.Dial("tcp", "localhost:"+port); err != nil { t.Fatalf("FromURL.Dial failed: %v", err) } else { c.Close() } wg.Wait() } func TestSOCKS5(t *testing.T) { endSystem, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { t.Fatalf("net.Listen failed: %v", err) } defer endSystem.Close() gateway, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { t.Fatalf("net.Listen failed: %v", err) } defer gateway.Close() var wg sync.WaitGroup wg.Add(1) go socks5Gateway(t, gateway, endSystem, socks5IP4, &wg) proxy, err := SOCKS5("tcp", gateway.Addr().String(), nil, Direct) if err != nil { t.Fatalf("SOCKS5 failed: %v", err) } if c, err := proxy.Dial("tcp", endSystem.Addr().String()); err != nil { t.Fatalf("SOCKS5.Dial failed: %v", err) } else { c.Close() } wg.Wait() } func socks5Gateway(t *testing.T, gateway, endSystem net.Listener, typ byte, wg *sync.WaitGroup) { defer wg.Done() c, err := gateway.Accept() if err != nil { t.Errorf("net.Listener.Accept failed: %v", err) return } defer c.Close() b := make([]byte, 32) var n int if typ == socks5Domain { n = 4 } else { n = 3 } if _, err := io.ReadFull(c, b[:n]); err != nil { t.Errorf("io.ReadFull failed: %v", err) return } if _, err := c.Write([]byte{socks5Version, socks5AuthNone}); err != nil { t.Errorf("net.Conn.Write failed: %v", err) return } if typ == socks5Domain { n = 16 } else { n = 10 } if _, err := io.ReadFull(c, b[:n]); err != nil { t.Errorf("io.ReadFull failed: %v", err) return } if b[0] != socks5Version || b[1] != socks5Connect || b[2] != 0x00 || b[3] != typ { t.Errorf("got an unexpected packet: %#02x %#02x %#02x %#02x", b[0], b[1], b[2], b[3]) return } if typ == socks5Domain { copy(b[:5], []byte{socks5Version, 0x00, 0x00, socks5Domain, 9}) b = append(b, []byte("localhost")...) } else { copy(b[:4], []byte{socks5Version, 0x00, 0x00, socks5IP4}) } host, port, err := net.SplitHostPort(endSystem.Addr().String()) if err != nil { t.Errorf("net.SplitHostPort failed: %v", err) return } b = append(b, []byte(net.ParseIP(host).To4())...) p, err := strconv.Atoi(port) if err != nil { t.Errorf("strconv.Atoi failed: %v", err) return } b = append(b, []byte{byte(p >> 8), byte(p)}...) if _, err := c.Write(b); err != nil { t.Errorf("net.Conn.Write failed: %v", err) return } } func ResetProxyEnv() { for _, env := range []*envOnce{allProxyEnv, noProxyEnv} { for _, v := range env.names { os.Setenv(v, "") } } ResetCachedEnvironment() } func ResetCachedEnvironment() { allProxyEnv.reset() noProxyEnv.reset() }
s1061123/koko
vendor/golang.org/x/net/proxy/proxy_test.go
GO
apache-2.0
5,145
'use strict'; var tap = require('tap'); var test = tap.test; var semver = require('../semver.js'); var eq = semver.eq; var gt = semver.gt; var lt = semver.lt; var neq = semver.neq; var cmp = semver.cmp; var gte = semver.gte; var lte = semver.lte; var satisfies = semver.satisfies; var validRange = semver.validRange; var inc = semver.inc; var diff = semver.diff; var replaceStars = semver.replaceStars; var toComparators = semver.toComparators; var SemVer = semver.SemVer; var Range = semver.Range; test('\ncomparison tests', function(t) { // [version1, version2] // version1 should be greater than version2 [['0.0.0', '0.0.0-foo'], ['0.0.1', '0.0.0'], ['1.0.0', '0.9.9'], ['0.10.0', '0.9.0'], ['0.99.0', '0.10.0'], ['2.0.0', '1.2.3'], ['v0.0.0', '0.0.0-foo', true], ['v0.0.1', '0.0.0', true], ['v1.0.0', '0.9.9', true], ['v0.10.0', '0.9.0', true], ['v0.99.0', '0.10.0', true], ['v2.0.0', '1.2.3', true], ['0.0.0', 'v0.0.0-foo', true], ['0.0.1', 'v0.0.0', true], ['1.0.0', 'v0.9.9', true], ['0.10.0', 'v0.9.0', true], ['0.99.0', 'v0.10.0', true], ['2.0.0', 'v1.2.3', true], ['1.2.3', '1.2.3-asdf'], ['1.2.3', '1.2.3-4'], ['1.2.3', '1.2.3-4-foo'], ['1.2.3-5-foo', '1.2.3-5'], ['1.2.3-5', '1.2.3-4'], ['1.2.3-5-foo', '1.2.3-5-Foo'], ['3.0.0', '2.7.2+asdf'], ['1.2.3-a.10', '1.2.3-a.5'], ['1.2.3-a.b', '1.2.3-a.5'], ['1.2.3-a.b', '1.2.3-a'], ['1.2.3-a.b.c.10.d.5', '1.2.3-a.b.c.5.d.100'], ['1.2.3-r2', '1.2.3-r100'], ['1.2.3-r100', '1.2.3-R2'] ].forEach(function(v) { var v0 = v[0]; var v1 = v[1]; var loose = v[2]; t.ok(gt(v0, v1, loose), "gt('" + v0 + "', '" + v1 + "')"); t.ok(lt(v1, v0, loose), "lt('" + v1 + "', '" + v0 + "')"); t.ok(!gt(v1, v0, loose), "!gt('" + v1 + "', '" + v0 + "')"); t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); t.ok(eq(v0, v0, loose), "eq('" + v0 + "', '" + v0 + "')"); t.ok(eq(v1, v1, loose), "eq('" + v1 + "', '" + v1 + "')"); t.ok(neq(v0, v1, loose), "neq('" + v0 + "', '" + v1 + "')"); t.ok(cmp(v1, '==', v1, loose), "cmp('" + v1 + "' == '" + v1 + "')"); t.ok(cmp(v0, '>=', v1, loose), "cmp('" + v0 + "' >= '" + v1 + "')"); t.ok(cmp(v1, '<=', v0, loose), "cmp('" + v1 + "' <= '" + v0 + "')"); t.ok(cmp(v0, '!=', v1, loose), "cmp('" + v0 + "' != '" + v1 + "')"); }); t.end(); }); test('\nequality tests', function(t) { // [version1, version2] // version1 should be equivalent to version2 [['1.2.3', 'v1.2.3', true], ['1.2.3', '=1.2.3', true], ['1.2.3', 'v 1.2.3', true], ['1.2.3', '= 1.2.3', true], ['1.2.3', ' v1.2.3', true], ['1.2.3', ' =1.2.3', true], ['1.2.3', ' v 1.2.3', true], ['1.2.3', ' = 1.2.3', true], ['1.2.3-0', 'v1.2.3-0', true], ['1.2.3-0', '=1.2.3-0', true], ['1.2.3-0', 'v 1.2.3-0', true], ['1.2.3-0', '= 1.2.3-0', true], ['1.2.3-0', ' v1.2.3-0', true], ['1.2.3-0', ' =1.2.3-0', true], ['1.2.3-0', ' v 1.2.3-0', true], ['1.2.3-0', ' = 1.2.3-0', true], ['1.2.3-1', 'v1.2.3-1', true], ['1.2.3-1', '=1.2.3-1', true], ['1.2.3-1', 'v 1.2.3-1', true], ['1.2.3-1', '= 1.2.3-1', true], ['1.2.3-1', ' v1.2.3-1', true], ['1.2.3-1', ' =1.2.3-1', true], ['1.2.3-1', ' v 1.2.3-1', true], ['1.2.3-1', ' = 1.2.3-1', true], ['1.2.3-beta', 'v1.2.3-beta', true], ['1.2.3-beta', '=1.2.3-beta', true], ['1.2.3-beta', 'v 1.2.3-beta', true], ['1.2.3-beta', '= 1.2.3-beta', true], ['1.2.3-beta', ' v1.2.3-beta', true], ['1.2.3-beta', ' =1.2.3-beta', true], ['1.2.3-beta', ' v 1.2.3-beta', true], ['1.2.3-beta', ' = 1.2.3-beta', true], ['1.2.3-beta+build', ' = 1.2.3-beta+otherbuild', true], ['1.2.3+build', ' = 1.2.3+otherbuild', true], ['1.2.3-beta+build', '1.2.3-beta+otherbuild'], ['1.2.3+build', '1.2.3+otherbuild'], [' v1.2.3+build', '1.2.3+otherbuild'] ].forEach(function(v) { var v0 = v[0]; var v1 = v[1]; var loose = v[2]; t.ok(eq(v0, v1, loose), "eq('" + v0 + "', '" + v1 + "')"); t.ok(!neq(v0, v1, loose), "!neq('" + v0 + "', '" + v1 + "')"); t.ok(cmp(v0, '==', v1, loose), 'cmp(' + v0 + '==' + v1 + ')'); t.ok(!cmp(v0, '!=', v1, loose), '!cmp(' + v0 + '!=' + v1 + ')'); t.ok(!cmp(v0, '===', v1, loose), '!cmp(' + v0 + '===' + v1 + ')'); t.ok(cmp(v0, '!==', v1, loose), 'cmp(' + v0 + '!==' + v1 + ')'); t.ok(!gt(v0, v1, loose), "!gt('" + v0 + "', '" + v1 + "')"); t.ok(gte(v0, v1, loose), "gte('" + v0 + "', '" + v1 + "')"); t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); t.ok(lte(v0, v1, loose), "lte('" + v0 + "', '" + v1 + "')"); }); t.end(); }); test('\nrange tests', function(t) { // [range, version] // version should be included by range [['1.0.0 - 2.0.0', '1.2.3'], ['^1.2.3+build', '1.2.3'], ['^1.2.3+build', '1.3.0'], ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3'], ['1.2.3pre+asdf - 2.4.3-pre+asdf', '1.2.3', true], ['1.2.3-pre+asdf - 2.4.3pre+asdf', '1.2.3', true], ['1.2.3pre+asdf - 2.4.3pre+asdf', '1.2.3', true], ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3-pre.2'], ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '2.4.3-alpha'], ['1.2.3+asdf - 2.4.3+asdf', '1.2.3'], ['1.0.0', '1.0.0'], ['>=*', '0.2.4'], ['', '1.0.0'], ['*', '1.2.3'], ['*', 'v1.2.3', true], ['>=1.0.0', '1.0.0'], ['>=1.0.0', '1.0.1'], ['>=1.0.0', '1.1.0'], ['>1.0.0', '1.0.1'], ['>1.0.0', '1.1.0'], ['<=2.0.0', '2.0.0'], ['<=2.0.0', '1.9999.9999'], ['<=2.0.0', '0.2.9'], ['<2.0.0', '1.9999.9999'], ['<2.0.0', '0.2.9'], ['>= 1.0.0', '1.0.0'], ['>= 1.0.0', '1.0.1'], ['>= 1.0.0', '1.1.0'], ['> 1.0.0', '1.0.1'], ['> 1.0.0', '1.1.0'], ['<= 2.0.0', '2.0.0'], ['<= 2.0.0', '1.9999.9999'], ['<= 2.0.0', '0.2.9'], ['< 2.0.0', '1.9999.9999'], ['<\t2.0.0', '0.2.9'], ['>=0.1.97', 'v0.1.97', true], ['>=0.1.97', '0.1.97'], ['0.1.20 || 1.2.4', '1.2.4'], ['>=0.2.3 || <0.0.1', '0.0.0'], ['>=0.2.3 || <0.0.1', '0.2.3'], ['>=0.2.3 || <0.0.1', '0.2.4'], ['||', '1.3.4'], ['2.x.x', '2.1.3'], ['1.2.x', '1.2.3'], ['1.2.x || 2.x', '2.1.3'], ['1.2.x || 2.x', '1.2.3'], ['x', '1.2.3'], ['2.*.*', '2.1.3'], ['1.2.*', '1.2.3'], ['1.2.* || 2.*', '2.1.3'], ['1.2.* || 2.*', '1.2.3'], ['*', '1.2.3'], ['2', '2.1.2'], ['2.3', '2.3.1'], ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 ['~2.4', '2.4.5'], ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0, ['~1', '1.2.3'], // >=1.0.0 <2.0.0 ['~>1', '1.2.3'], ['~> 1', '1.2.3'], ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0, ['~ 1.0', '1.0.2'], ['~ 1.0.3', '1.0.12'], ['>=1', '1.0.0'], ['>= 1', '1.0.0'], ['<1.2', '1.1.1'], ['< 1.2', '1.1.1'], ['~v0.5.4-pre', '0.5.5'], ['~v0.5.4-pre', '0.5.4'], ['=0.7.x', '0.7.2'], ['<=0.7.x', '0.7.2'], ['>=0.7.x', '0.7.2'], ['<=0.7.x', '0.6.2'], ['~1.2.1 >=1.2.3', '1.2.3'], ['~1.2.1 =1.2.3', '1.2.3'], ['~1.2.1 1.2.3', '1.2.3'], ['~1.2.1 >=1.2.3 1.2.3', '1.2.3'], ['~1.2.1 1.2.3 >=1.2.3', '1.2.3'], ['~1.2.1 1.2.3', '1.2.3'], ['>=1.2.1 1.2.3', '1.2.3'], ['1.2.3 >=1.2.1', '1.2.3'], ['>=1.2.3 >=1.2.1', '1.2.3'], ['>=1.2.1 >=1.2.3', '1.2.3'], ['>=1.2', '1.2.8'], ['^1.2.3', '1.8.1'], ['^0.1.2', '0.1.2'], ['^0.1', '0.1.2'], ['^1.2', '1.4.2'], ['^1.2 ^1', '1.4.2'], ['^1.2.3-alpha', '1.2.3-pre'], ['^1.2.0-alpha', '1.2.0-pre'], ['^0.0.1-alpha', '0.0.1-beta'] ].forEach(function(v) { var range = v[0]; var ver = v[1]; var loose = v[2]; t.ok(satisfies(ver, range, loose), range + ' satisfied by ' + ver); }); t.end(); }); test('\nnegative range tests', function(t) { // [range, version] // version should not be included by range [['1.0.0 - 2.0.0', '2.2.3'], ['1.2.3+asdf - 2.4.3+asdf', '1.2.3-pre.2'], ['1.2.3+asdf - 2.4.3+asdf', '2.4.3-alpha'], ['^1.2.3+build', '2.0.0'], ['^1.2.3+build', '1.2.0'], ['^1.2.3', '1.2.3-pre'], ['^1.2', '1.2.0-pre'], ['>1.2', '1.3.0-beta'], ['<=1.2.3', '1.2.3-beta'], ['^1.2.3', '1.2.3-beta'], ['=0.7.x', '0.7.0-asdf'], ['>=0.7.x', '0.7.0-asdf'], ['1', '1.0.0beta', true], ['<1', '1.0.0beta', true], ['< 1', '1.0.0beta', true], ['1.0.0', '1.0.1'], ['>=1.0.0', '0.0.0'], ['>=1.0.0', '0.0.1'], ['>=1.0.0', '0.1.0'], ['>1.0.0', '0.0.1'], ['>1.0.0', '0.1.0'], ['<=2.0.0', '3.0.0'], ['<=2.0.0', '2.9999.9999'], ['<=2.0.0', '2.2.9'], ['<2.0.0', '2.9999.9999'], ['<2.0.0', '2.2.9'], ['>=0.1.97', 'v0.1.93', true], ['>=0.1.97', '0.1.93'], ['0.1.20 || 1.2.4', '1.2.3'], ['>=0.2.3 || <0.0.1', '0.0.3'], ['>=0.2.3 || <0.0.1', '0.2.2'], ['2.x.x', '1.1.3'], ['2.x.x', '3.1.3'], ['1.2.x', '1.3.3'], ['1.2.x || 2.x', '3.1.3'], ['1.2.x || 2.x', '1.1.3'], ['2.*.*', '1.1.3'], ['2.*.*', '3.1.3'], ['1.2.*', '1.3.3'], ['1.2.* || 2.*', '3.1.3'], ['1.2.* || 2.*', '1.1.3'], ['2', '1.1.2'], ['2.3', '2.4.1'], ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 ['~2.4', '2.3.9'], ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0 ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0 ['~1', '0.2.3'], // >=1.0.0 <2.0.0 ['~>1', '2.2.3'], ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0 ['<1', '1.0.0'], ['>=1.2', '1.1.1'], ['1', '2.0.0beta', true], ['~v0.5.4-beta', '0.5.4-alpha'], ['=0.7.x', '0.8.2'], ['>=0.7.x', '0.6.2'], ['<0.7.x', '0.7.2'], ['<1.2.3', '1.2.3-beta'], ['=1.2.3', '1.2.3-beta'], ['>1.2', '1.2.8'], ['^1.2.3', '2.0.0-alpha'], ['^1.2.3', '1.2.2'], ['^1.2', '1.1.9'], ['*', 'v1.2.3-foo', true], // invalid ranges never satisfied! ['blerg', '1.2.3'], ['git+https://user:password0123@github.com/foo', '123.0.0', true], ['^1.2.3', '2.0.0-pre'] ].forEach(function(v) { var range = v[0]; var ver = v[1]; var loose = v[2]; var found = satisfies(ver, range, loose); t.ok(!found, ver + ' not satisfied by ' + range); }); t.end(); }); test('\nincrement versions test', function(t) { // [version, inc, result, identifier] // inc(version, inc) -> result [['1.2.3', 'major', '2.0.0'], ['1.2.3', 'minor', '1.3.0'], ['1.2.3', 'patch', '1.2.4'], ['1.2.3tag', 'major', '2.0.0', true], ['1.2.3-tag', 'major', '2.0.0'], ['1.2.3', 'fake', null], ['1.2.0-0', 'patch', '1.2.0'], ['fake', 'major', null], ['1.2.3-4', 'major', '2.0.0'], ['1.2.3-4', 'minor', '1.3.0'], ['1.2.3-4', 'patch', '1.2.3'], ['1.2.3-alpha.0.beta', 'major', '2.0.0'], ['1.2.3-alpha.0.beta', 'minor', '1.3.0'], ['1.2.3-alpha.0.beta', 'patch', '1.2.3'], ['1.2.4', 'prerelease', '1.2.5-0'], ['1.2.3-0', 'prerelease', '1.2.3-1'], ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1'], ['1.2.3-alpha.1', 'prerelease', '1.2.3-alpha.2'], ['1.2.3-alpha.2', 'prerelease', '1.2.3-alpha.3'], ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta'], ['1.2.3-alpha.1.beta', 'prerelease', '1.2.3-alpha.2.beta'], ['1.2.3-alpha.2.beta', 'prerelease', '1.2.3-alpha.3.beta'], ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta'], ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta'], ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta'], ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1'], ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2'], ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3'], ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta'], ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta'], ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta'], ['1.2.0', 'prepatch', '1.2.1-0'], ['1.2.0-1', 'prepatch', '1.2.1-0'], ['1.2.0', 'preminor', '1.3.0-0'], ['1.2.3-1', 'preminor', '1.3.0-0'], ['1.2.0', 'premajor', '2.0.0-0'], ['1.2.3-1', 'premajor', '2.0.0-0'], ['1.2.0-1', 'minor', '1.2.0'], ['1.0.0-1', 'major', '1.0.0'], ['1.2.3', 'major', '2.0.0', false, 'dev'], ['1.2.3', 'minor', '1.3.0', false, 'dev'], ['1.2.3', 'patch', '1.2.4', false, 'dev'], ['1.2.3tag', 'major', '2.0.0', true, 'dev'], ['1.2.3-tag', 'major', '2.0.0', false, 'dev'], ['1.2.3', 'fake', null, false, 'dev'], ['1.2.0-0', 'patch', '1.2.0', false, 'dev'], ['fake', 'major', null, false, 'dev'], ['1.2.3-4', 'major', '2.0.0', false, 'dev'], ['1.2.3-4', 'minor', '1.3.0', false, 'dev'], ['1.2.3-4', 'patch', '1.2.3', false, 'dev'], ['1.2.3-alpha.0.beta', 'major', '2.0.0', false, 'dev'], ['1.2.3-alpha.0.beta', 'minor', '1.3.0', false, 'dev'], ['1.2.3-alpha.0.beta', 'patch', '1.2.3', false, 'dev'], ['1.2.4', 'prerelease', '1.2.5-dev.0', false, 'dev'], ['1.2.3-0', 'prerelease', '1.2.3-dev.0', false, 'dev'], ['1.2.3-alpha.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1', false, 'alpha'], ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta', false, 'alpha'], ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta', false, 'alpha'], ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta', false, 'alpha'], ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta', false, 'alpha'], ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1', false, 'alpha'], ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2', false, 'alpha'], ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3', false, 'alpha'], ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta', false, 'alpha'], ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta', false, 'alpha'], ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta', false, 'alpha'], ['1.2.0', 'prepatch', '1.2.1-dev.0', false, 'dev'], ['1.2.0-1', 'prepatch', '1.2.1-dev.0', false, 'dev'], ['1.2.0', 'preminor', '1.3.0-dev.0', false, 'dev'], ['1.2.3-1', 'preminor', '1.3.0-dev.0', false, 'dev'], ['1.2.0', 'premajor', '2.0.0-dev.0', false, 'dev'], ['1.2.3-1', 'premajor', '2.0.0-dev.0', false, 'dev'], ['1.2.0-1', 'minor', '1.2.0', false, 'dev'], ['1.0.0-1', 'major', '1.0.0', false, 'dev'], ['1.2.3-dev.bar', 'prerelease', '1.2.3-dev.0', false, 'dev'] ].forEach(function(v) { var pre = v[0]; var what = v[1]; var wanted = v[2]; var loose = v[3]; var id = v[4]; var found = inc(pre, what, loose, id); var cmd = 'inc(' + pre + ', ' + what + ', ' + id + ')'; t.equal(found, wanted, cmd + ' === ' + wanted); var parsed = semver.parse(pre, loose); if (wanted) { parsed.inc(what, id); t.equal(parsed.version, wanted, cmd + ' object version updated'); t.equal(parsed.raw, wanted, cmd + ' object raw field updated'); } else if (parsed) { t.throws(function () { parsed.inc(what, id) }) } else { t.equal(parsed, null) } }); t.end(); }); test('\ndiff versions test', function(t) { // [version1, version2, result] // diff(version1, version2) -> result [['1.2.3', '0.2.3', 'major'], ['1.4.5', '0.2.3', 'major'], ['1.2.3', '2.0.0-pre', 'premajor'], ['1.2.3', '1.3.3', 'minor'], ['1.0.1', '1.1.0-pre', 'preminor'], ['1.2.3', '1.2.4', 'patch'], ['1.2.3', '1.2.4-pre', 'prepatch'], ['0.0.1', '0.0.1-pre', 'prerelease'], ['0.0.1', '0.0.1-pre-2', 'prerelease'], ['1.1.0', '1.1.0-pre', 'prerelease'], ['1.1.0-pre-1', '1.1.0-pre-2', 'prerelease'], ['1.0.0', '1.0.0', null] ].forEach(function(v) { var version1 = v[0]; var version2 = v[1]; var wanted = v[2]; var found = diff(version1, version2); var cmd = 'diff(' + version1 + ', ' + version2 + ')'; t.equal(found, wanted, cmd + ' === ' + wanted); }); t.end(); }); test('\nvalid range test', function(t) { // [range, result] // validRange(range) -> result // translate ranges into their canonical form [['1.0.0 - 2.0.0', '>=1.0.0 <=2.0.0'], ['1.0.0', '1.0.0'], ['>=*', '*'], ['', '*'], ['*', '*'], ['*', '*'], ['>=1.0.0', '>=1.0.0'], ['>1.0.0', '>1.0.0'], ['<=2.0.0', '<=2.0.0'], ['1', '>=1.0.0 <2.0.0'], ['<=2.0.0', '<=2.0.0'], ['<=2.0.0', '<=2.0.0'], ['<2.0.0', '<2.0.0'], ['<2.0.0', '<2.0.0'], ['>= 1.0.0', '>=1.0.0'], ['>= 1.0.0', '>=1.0.0'], ['>= 1.0.0', '>=1.0.0'], ['> 1.0.0', '>1.0.0'], ['> 1.0.0', '>1.0.0'], ['<= 2.0.0', '<=2.0.0'], ['<= 2.0.0', '<=2.0.0'], ['<= 2.0.0', '<=2.0.0'], ['< 2.0.0', '<2.0.0'], ['< 2.0.0', '<2.0.0'], ['>=0.1.97', '>=0.1.97'], ['>=0.1.97', '>=0.1.97'], ['0.1.20 || 1.2.4', '0.1.20||1.2.4'], ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], ['||', '||'], ['2.x.x', '>=2.0.0 <3.0.0'], ['1.2.x', '>=1.2.0 <1.3.0'], ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], ['x', '*'], ['2.*.*', '>=2.0.0 <3.0.0'], ['1.2.*', '>=1.2.0 <1.3.0'], ['1.2.* || 2.*', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], ['*', '*'], ['2', '>=2.0.0 <3.0.0'], ['2.3', '>=2.3.0 <2.4.0'], ['~2.4', '>=2.4.0 <2.5.0'], ['~2.4', '>=2.4.0 <2.5.0'], ['~>3.2.1', '>=3.2.1 <3.3.0'], ['~1', '>=1.0.0 <2.0.0'], ['~>1', '>=1.0.0 <2.0.0'], ['~> 1', '>=1.0.0 <2.0.0'], ['~1.0', '>=1.0.0 <1.1.0'], ['~ 1.0', '>=1.0.0 <1.1.0'], ['^0', '>=0.0.0 <1.0.0'], ['^ 1', '>=1.0.0 <2.0.0'], ['^0.1', '>=0.1.0 <0.2.0'], ['^1.0', '>=1.0.0 <2.0.0'], ['^1.2', '>=1.2.0 <2.0.0'], ['^0.0.1', '>=0.0.1 <0.0.2'], ['^0.0.1-beta', '>=0.0.1-beta <0.0.2'], ['^0.1.2', '>=0.1.2 <0.2.0'], ['^1.2.3', '>=1.2.3 <2.0.0'], ['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0'], ['<1', '<1.0.0'], ['< 1', '<1.0.0'], ['>=1', '>=1.0.0'], ['>= 1', '>=1.0.0'], ['<1.2', '<1.2.0'], ['< 1.2', '<1.2.0'], ['1', '>=1.0.0 <2.0.0'], ['>01.02.03', '>1.2.3', true], ['>01.02.03', null], ['~1.2.3beta', '>=1.2.3-beta <1.3.0', true], ['~1.2.3beta', null], ['^ 1.2 ^ 1', '>=1.2.0 <2.0.0 >=1.0.0 <2.0.0'] ].forEach(function(v) { var pre = v[0]; var wanted = v[1]; var loose = v[2]; var found = validRange(pre, loose); t.equal(found, wanted, 'validRange(' + pre + ') === ' + wanted); }); t.end(); }); test('\ncomparators test', function(t) { // [range, comparators] // turn range into a set of individual comparators [['1.0.0 - 2.0.0', [['>=1.0.0', '<=2.0.0']]], ['1.0.0', [['1.0.0']]], ['>=*', [['']]], ['', [['']]], ['*', [['']]], ['*', [['']]], ['>=1.0.0', [['>=1.0.0']]], ['>=1.0.0', [['>=1.0.0']]], ['>=1.0.0', [['>=1.0.0']]], ['>1.0.0', [['>1.0.0']]], ['>1.0.0', [['>1.0.0']]], ['<=2.0.0', [['<=2.0.0']]], ['1', [['>=1.0.0', '<2.0.0']]], ['<=2.0.0', [['<=2.0.0']]], ['<=2.0.0', [['<=2.0.0']]], ['<2.0.0', [['<2.0.0']]], ['<2.0.0', [['<2.0.0']]], ['>= 1.0.0', [['>=1.0.0']]], ['>= 1.0.0', [['>=1.0.0']]], ['>= 1.0.0', [['>=1.0.0']]], ['> 1.0.0', [['>1.0.0']]], ['> 1.0.0', [['>1.0.0']]], ['<= 2.0.0', [['<=2.0.0']]], ['<= 2.0.0', [['<=2.0.0']]], ['<= 2.0.0', [['<=2.0.0']]], ['< 2.0.0', [['<2.0.0']]], ['<\t2.0.0', [['<2.0.0']]], ['>=0.1.97', [['>=0.1.97']]], ['>=0.1.97', [['>=0.1.97']]], ['0.1.20 || 1.2.4', [['0.1.20'], ['1.2.4']]], ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], ['||', [[''], ['']]], ['2.x.x', [['>=2.0.0', '<3.0.0']]], ['1.2.x', [['>=1.2.0', '<1.3.0']]], ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], ['x', [['']]], ['2.*.*', [['>=2.0.0', '<3.0.0']]], ['1.2.*', [['>=1.2.0', '<1.3.0']]], ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], ['*', [['']]], ['2', [['>=2.0.0', '<3.0.0']]], ['2.3', [['>=2.3.0', '<2.4.0']]], ['~2.4', [['>=2.4.0', '<2.5.0']]], ['~2.4', [['>=2.4.0', '<2.5.0']]], ['~>3.2.1', [['>=3.2.1', '<3.3.0']]], ['~1', [['>=1.0.0', '<2.0.0']]], ['~>1', [['>=1.0.0', '<2.0.0']]], ['~> 1', [['>=1.0.0', '<2.0.0']]], ['~1.0', [['>=1.0.0', '<1.1.0']]], ['~ 1.0', [['>=1.0.0', '<1.1.0']]], ['~ 1.0.3', [['>=1.0.3', '<1.1.0']]], ['~> 1.0.3', [['>=1.0.3', '<1.1.0']]], ['<1', [['<1.0.0']]], ['< 1', [['<1.0.0']]], ['>=1', [['>=1.0.0']]], ['>= 1', [['>=1.0.0']]], ['<1.2', [['<1.2.0']]], ['< 1.2', [['<1.2.0']]], ['1', [['>=1.0.0', '<2.0.0']]], ['1 2', [['>=1.0.0', '<2.0.0', '>=2.0.0', '<3.0.0']]], ['1.2 - 3.4.5', [['>=1.2.0', '<=3.4.5']]], ['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0']]], ['1.2.3 - 3', [['>=1.2.3', '<4.0.0']]], ['>*', [['<0.0.0']]], ['<*', [['<0.0.0']]] ].forEach(function(v) { var pre = v[0]; var wanted = v[1]; var found = toComparators(v[0]); var jw = JSON.stringify(wanted); t.equivalent(found, wanted, 'toComparators(' + pre + ') === ' + jw); }); t.end(); }); test('\ninvalid version numbers', function(t) { ['1.2.3.4', 'NOT VALID', 1.2, null, 'Infinity.NaN.Infinity' ].forEach(function(v) { t.throws(function() { new SemVer(v); }, {name:'TypeError', message:'Invalid Version: ' + v}); }); t.end(); }); test('\nstrict vs loose version numbers', function(t) { [['=1.2.3', '1.2.3'], ['01.02.03', '1.2.3'], ['1.2.3-beta.01', '1.2.3-beta.1'], [' =1.2.3', '1.2.3'], ['1.2.3foo', '1.2.3-foo'] ].forEach(function(v) { var loose = v[0]; var strict = v[1]; t.throws(function() { new SemVer(loose); }); var lv = new SemVer(loose, true); t.equal(lv.version, strict); t.ok(eq(loose, strict, true)); t.throws(function() { eq(loose, strict); }); t.throws(function() { new SemVer(strict).compare(loose); }); }); t.end(); }); test('\nstrict vs loose ranges', function(t) { [['>=01.02.03', '>=1.2.3'], ['~1.02.03beta', '>=1.2.3-beta <1.3.0'] ].forEach(function(v) { var loose = v[0]; var comps = v[1]; t.throws(function() { new Range(loose); }); t.equal(new Range(loose, true).range, comps); }); t.end(); }); test('\nmax satisfying', function(t) { [[['1.2.3', '1.2.4'], '1.2', '1.2.4'], [['1.2.4', '1.2.3'], '1.2', '1.2.4'], [['1.2.3', '1.2.4', '1.2.5', '1.2.6'], '~1.2.3', '1.2.6'], [['1.1.0', '1.2.0', '1.2.1', '1.3.0', '2.0.0b1', '2.0.0b2', '2.0.0b3', '2.0.0', '2.1.0'], '~2.0.0', '2.0.0', true] ].forEach(function(v) { var versions = v[0]; var range = v[1]; var expect = v[2]; var loose = v[3]; var actual = semver.maxSatisfying(versions, range, loose); t.equal(actual, expect); }); t.end(); });
TempSquad/TEMP2016-site-client
node_modules/gulp-util/node_modules/dateformat/node_modules/meow/node_modules/normalize-package-data/node_modules/semver/test/index.js
JavaScript
apache-2.0
23,531
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.activemq.artemis.service.extensions.xa.recovery; public class ActiveMQRegistryImpl implements ActiveMQRegistry { private static ActiveMQRegistryImpl instance; public static ActiveMQRegistry getInstance() { if (instance == null) { instance = new ActiveMQRegistryImpl(); } return instance; } @Override public void register(XARecoveryConfig resourceConfig) { } @Override public void unRegister(XARecoveryConfig resourceConfig) { } @Override public void stop() { } @Override public void init() { } }
iweiss/activemq-artemis
artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/ActiveMQRegistryImpl.java
Java
apache-2.0
1,399
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.sling.scripting.jsp.jasper.xmlparser; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; /** * Simplified implementation of a Node from a Document Object Model (DOM) * parse of an XML document. This class is used to represent a DOM tree * so that the XML parser's implementation of <code>org.w3c.dom</code> need * not be visible to the remainder of Jasper. * <p> * <strong>WARNING</strong> - Construction of a new tree, or modifications * to an existing one, are not thread-safe and such accesses must be * synchronized. * * @author Craig R. McClanahan * @version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (Die, 24 Okt 2006) $ */ public class TreeNode { // ----------------------------------------------------------- Constructors /** * Construct a new node with no parent. * * @param name The name of this node */ public TreeNode(String name) { this(name, null); } /** * Construct a new node with the specified parent. * * @param name The name of this node * @param parent The node that is the parent of this node */ public TreeNode(String name, TreeNode parent) { super(); this.name = name; this.parent = parent; if (this.parent != null) this.parent.addChild(this); } // ----------------------------------------------------- Instance Variables /** * The attributes of this node, keyed by attribute name, * Instantiated only if required. */ protected HashMap attributes = null; /** * The body text associated with this node (if any). */ protected String body = null; /** * The children of this node, instantiated only if required. */ protected ArrayList children = null; /** * The name of this node. */ protected String name = null; /** * The parent node of this node. */ protected TreeNode parent = null; // --------------------------------------------------------- Public Methods /** * Add an attribute to this node, replacing any existing attribute * with the same name. * * @param name The attribute name to add * @param value The new attribute value */ public void addAttribute(String name, String value) { if (attributes == null) attributes = new HashMap(); attributes.put(name, value); } /** * Add a new child node to this node. * * @param node The new child node */ public void addChild(TreeNode node) { if (children == null) children = new ArrayList(); children.add(node); } /** * Return the value of the specified node attribute if it exists, or * <code>null</code> otherwise. * * @param name Name of the requested attribute */ public String findAttribute(String name) { if (attributes == null) return (null); else return ((String) attributes.get(name)); } /** * Return an Iterator of the attribute names of this node. If there are * no attributes, an empty Iterator is returned. */ public Iterator findAttributes() { if (attributes == null) return (Collections.EMPTY_LIST.iterator()); else return (attributes.keySet().iterator()); } /** * Return the first child node of this node with the specified name, * if there is one; otherwise, return <code>null</code>. * * @param name Name of the desired child element */ public TreeNode findChild(String name) { if (children == null) return (null); Iterator items = children.iterator(); while (items.hasNext()) { TreeNode item = (TreeNode) items.next(); if (name.equals(item.getName())) return (item); } return (null); } /** * Return an Iterator of all children of this node. If there are no * children, an empty Iterator is returned. */ public Iterator findChildren() { if (children == null) return (Collections.EMPTY_LIST.iterator()); else return (children.iterator()); } /** * Return an Iterator over all children of this node that have the * specified name. If there are no such children, an empty Iterator * is returned. * * @param name Name used to select children */ public Iterator findChildren(String name) { if (children == null) return (Collections.EMPTY_LIST.iterator()); ArrayList results = new ArrayList(); Iterator items = children.iterator(); while (items.hasNext()) { TreeNode item = (TreeNode) items.next(); if (name.equals(item.getName())) results.add(item); } return (results.iterator()); } /** * Return the body text associated with this node (if any). */ public String getBody() { return (this.body); } /** * Return the name of this node. */ public String getName() { return (this.name); } /** * Remove any existing value for the specified attribute name. * * @param name The attribute name to remove */ public void removeAttribute(String name) { if (attributes != null) attributes.remove(name); } /** * Remove a child node from this node, if it is one. * * @param node The child node to remove */ public void removeNode(TreeNode node) { if (children != null) children.remove(node); } /** * Set the body text associated with this node (if any). * * @param body The body text (if any) */ public void setBody(String body) { this.body = body; } /** * Return a String representation of this TreeNode. */ public String toString() { StringBuffer sb = new StringBuffer(); toString(sb, 0, this); return (sb.toString()); } // ------------------------------------------------------ Protected Methods /** * Append to the specified StringBuffer a character representation of * this node, with the specified amount of indentation. * * @param sb The StringBuffer to append to * @param indent Number of characters of indentation * @param node The TreeNode to be printed */ protected void toString(StringBuffer sb, int indent, TreeNode node) { int indent2 = indent + 2; // Reconstruct an opening node for (int i = 0; i < indent; i++) sb.append(' '); sb.append('<'); sb.append(node.getName()); Iterator names = node.findAttributes(); while (names.hasNext()) { sb.append(' '); String name = (String) names.next(); sb.append(name); sb.append("=\""); String value = node.findAttribute(name); sb.append(value); sb.append("\""); } sb.append(">\n"); // Reconstruct the body text of this node (if any) String body = node.getBody(); if ((body != null) && (body.length() > 0)) { for (int i = 0; i < indent2; i++) sb.append(' '); sb.append(body); sb.append("\n"); } // Reconstruct child nodes with extra indentation Iterator children = node.findChildren(); while (children.hasNext()) { TreeNode child = (TreeNode) children.next(); toString(sb, indent2, child); } // Reconstruct a closing node marker for (int i = 0; i < indent; i++) sb.append(' '); sb.append("</"); sb.append(node.getName()); sb.append(">\n"); } }
tteofili/sling
bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/xmlparser/TreeNode.java
Java
apache-2.0
8,898
<!-- Good morning, Mr. Phelps. --> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>or-tools/src/base/: Member List - Doxy</title> <link rel="shortcut icon" href="../../../favicon.ico"> <!-- Both stylesheets are supplied by Doxygen, with maybe minor tweaks from Google. --> <link href="../../../doxygen.css" rel="stylesheet" type="text/css"> <link href="../../../tabs.css" rel="stylesheet" type="text/css"> </head> <body topmargin=0 leftmargin=20 bottommargin=0 rightmargin=20 marginwidth=20 marginheight=0> <!-- Second part of the secret behind Doxy logo always having the word "Doxy" with the color of the day. --> <style> a.doxy_logo:hover { background-color: #287003 } </style> <table width=100% cellpadding=0 cellspacing=0 border=0> <!-- Top horizontal line with the color of the day. --> <tr valign=top> <td colspan=3 bgcolor=#287003 height=3></td> </tr> <!-- Header row with the links at the right. --> <tr valign=top> <td colspan=3 align=right> <font size=-1> Generated on: <font color=#287003><b>Thu Mar 29 07:46:58 PDT 2012</b></font> for <b>custom file set</b> </font> </td> </tr> <!-- Header row with the logo and the search form. --> <tr valign=top> <!-- Logo. --> <td align=left width=150> <table width=150 height=54 cellpadding=0 cellspacing=0 border=0> <tr valign=top> <!-- First part of the secret behind Doxy logo always having the word "Doxy" with the color of the day. --> <td bgcolor=#287003> <a class="doxy_logo" href="../../../index.html"><img src="../../../doxy_logo.png" alt="Doxy" border=0></a> </td> </tr> </table> </td> </tr> <!-- Tiny vertical space below the form. --> <tr valign=top> <td colspan=3 height=3></td> </tr> </table> <!-- Header navigation row. --> <div class="memproto"> <table width=100% cellpadding=0 cellspacing=0 border=0> <tr> <td align=left style="padding-left: 20px"><font size=+1><b><tt><font color=#333333>// <a href="../../../index.html"><font color=#287003>doxy</font></a>/</font> <a href="../../../or-tools/index.html">or-tools</a>/ <a href="../../../or-tools/src/index.html">src</a>/ <a href="../../../or-tools/src/base/index.html">base</a>/ </tt></b></font> </td> </tr> </table> </div> <br /> <!-- No subdirs found. --> <!-- End of header. --> <!-- Generated by Doxygen 1.5.6 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main&nbsp;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li> <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li> </ul> </div> </div> <div class="contents"> <h1>operations_research::CallbackUtils_ Member List</h1>This is the complete list of members for <a class="el" href="structoperations__research_1_1CallbackUtils__.html">operations_research::CallbackUtils_</a>, including all inherited members.<p><table> <tr class="memlist"><td><a class="el" href="structoperations__research_1_1CallbackUtils__.html#33b66e1f9a5acdc4e1dea385e15154ca">FailIsRepeatable</a>(const char *name)</td><td><a class="el" href="structoperations__research_1_1CallbackUtils__.html">operations_research::CallbackUtils_</a></td><td><code> [static]</code></td></tr> </table></div> <!-- Start of footer. --> <table width=100% cellpadding=0 cellspacing=0 border=0> <tr valign=top> <td colspan=2 height=10></td> </tr> <tr valign=top> <td colspan=2 bgcolor=#287003 height=3></td> </tr> </table> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /> </body> </html>
KapecK/or-tools
documentation/reference_manual/or-tools/src/base/structoperations__research_1_1CallbackUtils__-members.html
HTML
apache-2.0
5,078
// Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "github.com/openshift/api/route/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" ) // RouteLister helps list Routes. type RouteLister interface { // List lists all Routes in the indexer. List(selector labels.Selector) (ret []*v1.Route, err error) // Routes returns an object that can list and get Routes. Routes(namespace string) RouteNamespaceLister RouteListerExpansion } // routeLister implements the RouteLister interface. type routeLister struct { indexer cache.Indexer } // NewRouteLister returns a new RouteLister. func NewRouteLister(indexer cache.Indexer) RouteLister { return &routeLister{indexer: indexer} } // List lists all Routes in the indexer. func (s *routeLister) List(selector labels.Selector) (ret []*v1.Route, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(*v1.Route)) }) return ret, err } // Routes returns an object that can list and get Routes. func (s *routeLister) Routes(namespace string) RouteNamespaceLister { return routeNamespaceLister{indexer: s.indexer, namespace: namespace} } // RouteNamespaceLister helps list and get Routes. type RouteNamespaceLister interface { // List lists all Routes in the indexer for a given namespace. List(selector labels.Selector) (ret []*v1.Route, err error) // Get retrieves the Route from the indexer for a given namespace and name. Get(name string) (*v1.Route, error) RouteNamespaceListerExpansion } // routeNamespaceLister implements the RouteNamespaceLister // interface. type routeNamespaceLister struct { indexer cache.Indexer namespace string } // List lists all Routes in the indexer for a given namespace. func (s routeNamespaceLister) List(selector labels.Selector) (ret []*v1.Route, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { ret = append(ret, m.(*v1.Route)) }) return ret, err } // Get retrieves the Route from the indexer for a given namespace and name. func (s routeNamespaceLister) Get(name string) (*v1.Route, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { return nil, errors.NewNotFound(v1.Resource("route"), name) } return obj.(*v1.Route), nil }
enj/origin
vendor/github.com/openshift/client-go/route/listers/route/v1/route.go
GO
apache-2.0
2,387
package org.apache.nifi.processors.kafka; import java.util.Collections; import org.I0Itec.zkclient.ZkClient; import org.I0Itec.zkclient.exception.ZkMarshallingError; /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import org.I0Itec.zkclient.serialize.ZkSerializer; import kafka.admin.AdminUtils; import kafka.api.TopicMetadata; import kafka.utils.ZKStringSerializer; import scala.collection.JavaConversions; /** * Utility class to support interaction with Kafka internals. * */ class KafkaUtils { /** * Will retrieve the amount of partitions for a given Kafka topic. */ static int retrievePartitionCountForTopic(String zookeeperConnectionString, String topicName) { ZkClient zkClient = null; try { zkClient = new ZkClient(zookeeperConnectionString); zkClient.setZkSerializer(new ZkSerializer() { @Override public byte[] serialize(Object o) throws ZkMarshallingError { return ZKStringSerializer.serialize(o); } @Override public Object deserialize(byte[] bytes) throws ZkMarshallingError { return ZKStringSerializer.deserialize(bytes); } }); scala.collection.Set<TopicMetadata> topicMetadatas = AdminUtils .fetchTopicMetadataFromZk(JavaConversions.asScalaSet(Collections.singleton(topicName)), zkClient); if (topicMetadatas != null && topicMetadatas.size() > 0) { return JavaConversions.asJavaSet(topicMetadatas).iterator().next().partitionsMetadata().size(); } else { throw new IllegalStateException("Failed to get metadata for topic " + topicName); } } catch (Exception e) { throw new IllegalStateException("Failed to retrieve partitions for topic " + topicName, e); } finally { try { zkClient.close(); } catch (Exception e2) { // ignore } } } }
bbende/nifi
nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-8-processors/src/main/java/org/apache/nifi/processors/kafka/KafkaUtils.java
Java
apache-2.0
2,826
// Copyright 2015 Huan Du. All rights reserved. // Licensed under the MIT license that can be found in the LICENSE file. package xstrings import ( "bytes" "strings" "unicode/utf8" ) // Reverse a utf8 encoded string. func Reverse(str string) string { var size int tail := len(str) buf := make([]byte, tail) s := buf for len(str) > 0 { _, size = utf8.DecodeRuneInString(str) tail -= size s = append(s[:tail], []byte(str[:size])...) str = str[size:] } return string(buf) } // Slice a string by rune. // // Start must satisfy 0 <= start <= rune length. // // End can be positive, zero or negative. // If end >= 0, start and end must satisfy start <= end <= rune length. // If end < 0, it means slice to the end of string. // // Otherwise, Slice will panic as out of range. func Slice(str string, start, end int) string { var size, startPos, endPos int origin := str if start < 0 || end > len(str) || (end >= 0 && start > end) { panic("out of range") } if end >= 0 { end -= start } for start > 0 && len(str) > 0 { _, size = utf8.DecodeRuneInString(str) start-- startPos += size str = str[size:] } if end < 0 { return origin[startPos:] } endPos = startPos for end > 0 && len(str) > 0 { _, size = utf8.DecodeRuneInString(str) end-- endPos += size str = str[size:] } if len(str) == 0 && (start > 0 || end > 0) { panic("out of range") } return origin[startPos:endPos] } // Partition splits a string by sep into three parts. // The return value is a slice of strings with head, match and tail. // // If str contains sep, for example "hello" and "l", Partition returns // "he", "l", "lo" // // If str doesn't contain sep, for example "hello" and "x", Partition returns // "hello", "", "" func Partition(str, sep string) (head, match, tail string) { index := strings.Index(str, sep) if index == -1 { head = str return } head = str[:index] match = str[index : index+len(sep)] tail = str[index+len(sep):] return } // LastPartition splits a string by last instance of sep into three parts. // The return value is a slice of strings with head, match and tail. // // If str contains sep, for example "hello" and "l", LastPartition returns // "hel", "l", "o" // // If str doesn't contain sep, for example "hello" and "x", LastPartition returns // "", "", "hello" func LastPartition(str, sep string) (head, match, tail string) { index := strings.LastIndex(str, sep) if index == -1 { tail = str return } head = str[:index] match = str[index : index+len(sep)] tail = str[index+len(sep):] return } // Insert src into dst at given rune index. // Index is counted by runes instead of bytes. // // If index is out of range of dst, panic with out of range. func Insert(dst, src string, index int) string { return Slice(dst, 0, index) + src + Slice(dst, index, -1) } // Scrubs invalid utf8 bytes with repl string. // Adjacent invalid bytes are replaced only once. func Scrub(str, repl string) string { var buf *bytes.Buffer var r rune var size, pos int var hasError bool origin := str for len(str) > 0 { r, size = utf8.DecodeRuneInString(str) if r == utf8.RuneError { if !hasError { if buf == nil { buf = &bytes.Buffer{} } buf.WriteString(origin[:pos]) hasError = true } } else if hasError { hasError = false buf.WriteString(repl) origin = origin[pos:] pos = 0 } pos += size str = str[size:] } if buf != nil { buf.WriteString(origin) return buf.String() } // No invalid byte. return origin } // Splits a string into words. Returns a slice of words. // If there is no word in a string, return nil. // // Word is defined as a locale dependent string containing alphabetic characters, // which may also contain but not start with `'` and `-` characters. func WordSplit(str string) []string { var word string var words []string var r rune var size, pos int inWord := false for len(str) > 0 { r, size = utf8.DecodeRuneInString(str) switch { case isAlphabet(r): if !inWord { inWord = true word = str pos = 0 } case inWord && (r == '\'' || r == '-'): // Still in word. default: if inWord { inWord = false words = append(words, word[:pos]) } } pos += size str = str[size:] } if inWord { words = append(words, word[:pos]) } return words }
kenota/kommentator
vendor/github.com/huandu/xstrings/manipulate.go
GO
apache-2.0
4,370
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.elasticsearch.action.search; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import static org.elasticsearch.action.ValidateActions.addValidationError; public class ClearScrollRequest extends ActionRequest { private List<String> scrollIds; public List<String> getScrollIds() { return scrollIds; } public void setScrollIds(List<String> scrollIds) { this.scrollIds = scrollIds; } public void addScrollId(String scrollId) { if (scrollIds == null) { scrollIds = new ArrayList<>(); } scrollIds.add(scrollId); } public List<String> scrollIds() { return scrollIds; } public void scrollIds(List<String> scrollIds) { this.scrollIds = scrollIds; } @Override public ActionRequestValidationException validate() { ActionRequestValidationException validationException = null; if (scrollIds == null || scrollIds.isEmpty()) { validationException = addValidationError("no scroll ids specified", validationException); } return validationException; } @Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); scrollIds = Arrays.asList(in.readStringArray()); } @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); if (scrollIds == null) { out.writeVInt(0); } else { out.writeStringArray(scrollIds.toArray(new String[scrollIds.size()])); } } }
C-Bish/elasticsearch
core/src/main/java/org/elasticsearch/action/search/ClearScrollRequest.java
Java
apache-2.0
2,649
/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 import ( "testing" "k8s.io/api/core/v1" extensions "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/tools/cache" ) func TestDaemonSetLister(t *testing.T) { store := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{"namespace": cache.MetaNamespaceIndexFunc}) lister := NewDaemonSetLister(store) testCases := []struct { inDSs []*extensions.DaemonSet list func() ([]*extensions.DaemonSet, error) outDaemonSetNames sets.String expectErr bool }{ // Basic listing { inDSs: []*extensions.DaemonSet{ {ObjectMeta: metav1.ObjectMeta{Name: "basic"}}, }, list: func() ([]*extensions.DaemonSet, error) { return lister.List(labels.Everything()) }, outDaemonSetNames: sets.NewString("basic"), }, // Listing multiple daemon sets { inDSs: []*extensions.DaemonSet{ {ObjectMeta: metav1.ObjectMeta{Name: "basic"}}, {ObjectMeta: metav1.ObjectMeta{Name: "complex"}}, {ObjectMeta: metav1.ObjectMeta{Name: "complex2"}}, }, list: func() ([]*extensions.DaemonSet, error) { return lister.List(labels.Everything()) }, outDaemonSetNames: sets.NewString("basic", "complex", "complex2"), }, // No pod labels { inDSs: []*extensions.DaemonSet{ { ObjectMeta: metav1.ObjectMeta{Name: "basic", Namespace: "ns"}, Spec: extensions.DaemonSetSpec{ Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"foo": "baz"}}, }, }, }, list: func() ([]*extensions.DaemonSet, error) { pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{Name: "pod1", Namespace: "ns"}, } return lister.GetPodDaemonSets(pod) }, outDaemonSetNames: sets.NewString(), expectErr: true, }, // No DS selectors { inDSs: []*extensions.DaemonSet{ { ObjectMeta: metav1.ObjectMeta{Name: "basic", Namespace: "ns"}, }, }, list: func() ([]*extensions.DaemonSet, error) { pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "pod1", Namespace: "ns", Labels: map[string]string{"foo": "bar"}, }, } return lister.GetPodDaemonSets(pod) }, outDaemonSetNames: sets.NewString(), expectErr: true, }, // Matching labels to selectors and namespace { inDSs: []*extensions.DaemonSet{ { ObjectMeta: metav1.ObjectMeta{Name: "foo"}, Spec: extensions.DaemonSetSpec{ Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, }, }, { ObjectMeta: metav1.ObjectMeta{Name: "bar", Namespace: "ns"}, Spec: extensions.DaemonSetSpec{ Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, }, }, }, list: func() ([]*extensions.DaemonSet, error) { pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "pod1", Labels: map[string]string{"foo": "bar"}, Namespace: "ns", }, } return lister.GetPodDaemonSets(pod) }, outDaemonSetNames: sets.NewString("bar"), }, } for _, c := range testCases { for _, r := range c.inDSs { store.Add(r) } daemonSets, err := c.list() if err != nil && c.expectErr { continue } else if c.expectErr { t.Error("Expected error, got none") continue } else if err != nil { t.Errorf("Unexpected error %#v", err) continue } daemonSetNames := make([]string, len(daemonSets)) for ix := range daemonSets { daemonSetNames[ix] = daemonSets[ix].Name } if !c.outDaemonSetNames.HasAll(daemonSetNames...) || len(daemonSetNames) != len(c.outDaemonSetNames) { t.Errorf("Unexpected got controllers %+v expected %+v", daemonSetNames, c.outDaemonSetNames) } } }
danmcp/origin
vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/listers/extensions/v1beta1/daemonset_expansion_test.go
GO
apache-2.0
4,387
/************************************************************* * * MathJax/fonts/HTML-CSS/TeX/png/Main/Bold/LatinExtendedA.js * * Defines the image size data needed for the HTML-CSS OutputJax * to display mathematics using fallback images when the fonts * are not availble to the client browser. * * --------------------------------------------------------------------- * * Copyright (c) 2009-2013 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ MathJax.OutputJax["HTML-CSS"].defineImageData({ "MathJax_Main-bold": { 0x131: [ // LATIN SMALL LETTER DOTLESS I [3,3,0],[4,4,0],[4,5,0],[5,5,0],[6,6,0],[7,8,0],[8,9,0],[9,11,0], [11,13,0],[12,15,0],[15,18,0],[17,21,0],[21,25,0],[24,30,0] ] } }); MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].imgDir+"/Main/Bold"+ MathJax.OutputJax["HTML-CSS"].imgPacked+"/LatinExtendedA.js");
yzyuehen/MathJax
fonts/HTML-CSS/TeX/png/Main/Bold/unpacked/LatinExtendedA.js
JavaScript
apache-2.0
1,440
/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package internalversion import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" policy "k8s.io/kubernetes/pkg/apis/policy" scheme "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/scheme" ) // PodDisruptionBudgetsGetter has a method to return a PodDisruptionBudgetInterface. // A group's client should implement this interface. type PodDisruptionBudgetsGetter interface { PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface } // PodDisruptionBudgetInterface has methods to work with PodDisruptionBudget resources. type PodDisruptionBudgetInterface interface { Create(*policy.PodDisruptionBudget) (*policy.PodDisruptionBudget, error) Update(*policy.PodDisruptionBudget) (*policy.PodDisruptionBudget, error) UpdateStatus(*policy.PodDisruptionBudget) (*policy.PodDisruptionBudget, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error Get(name string, options v1.GetOptions) (*policy.PodDisruptionBudget, error) List(opts v1.ListOptions) (*policy.PodDisruptionBudgetList, error) Watch(opts v1.ListOptions) (watch.Interface, error) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *policy.PodDisruptionBudget, err error) PodDisruptionBudgetExpansion } // podDisruptionBudgets implements PodDisruptionBudgetInterface type podDisruptionBudgets struct { client rest.Interface ns string } // newPodDisruptionBudgets returns a PodDisruptionBudgets func newPodDisruptionBudgets(c *PolicyClient, namespace string) *podDisruptionBudgets { return &podDisruptionBudgets{ client: c.RESTClient(), ns: namespace, } } // Get takes name of the podDisruptionBudget, and returns the corresponding podDisruptionBudget object, and an error if there is any. func (c *podDisruptionBudgets) Get(name string, options v1.GetOptions) (result *policy.PodDisruptionBudget, err error) { result = &policy.PodDisruptionBudget{} err = c.client.Get(). Namespace(c.ns). Resource("poddisruptionbudgets"). Name(name). VersionedParams(&options, scheme.ParameterCodec). Do(). Into(result) return } // List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. func (c *podDisruptionBudgets) List(opts v1.ListOptions) (result *policy.PodDisruptionBudgetList, err error) { result = &policy.PodDisruptionBudgetList{} err = c.client.Get(). Namespace(c.ns). Resource("poddisruptionbudgets"). VersionedParams(&opts, scheme.ParameterCodec). Do(). Into(result) return } // Watch returns a watch.Interface that watches the requested podDisruptionBudgets. func (c *podDisruptionBudgets) Watch(opts v1.ListOptions) (watch.Interface, error) { opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("poddisruptionbudgets"). VersionedParams(&opts, scheme.ParameterCodec). Watch() } // Create takes the representation of a podDisruptionBudget and creates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. func (c *podDisruptionBudgets) Create(podDisruptionBudget *policy.PodDisruptionBudget) (result *policy.PodDisruptionBudget, err error) { result = &policy.PodDisruptionBudget{} err = c.client.Post(). Namespace(c.ns). Resource("poddisruptionbudgets"). Body(podDisruptionBudget). Do(). Into(result) return } // Update takes the representation of a podDisruptionBudget and updates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. func (c *podDisruptionBudgets) Update(podDisruptionBudget *policy.PodDisruptionBudget) (result *policy.PodDisruptionBudget, err error) { result = &policy.PodDisruptionBudget{} err = c.client.Put(). Namespace(c.ns). Resource("poddisruptionbudgets"). Name(podDisruptionBudget.Name). Body(podDisruptionBudget). Do(). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *podDisruptionBudgets) UpdateStatus(podDisruptionBudget *policy.PodDisruptionBudget) (result *policy.PodDisruptionBudget, err error) { result = &policy.PodDisruptionBudget{} err = c.client.Put(). Namespace(c.ns). Resource("poddisruptionbudgets"). Name(podDisruptionBudget.Name). SubResource("status"). Body(podDisruptionBudget). Do(). Into(result) return } // Delete takes name of the podDisruptionBudget and deletes it. Returns an error if one occurs. func (c *podDisruptionBudgets) Delete(name string, options *v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("poddisruptionbudgets"). Name(name). Body(options). Do(). Error() } // DeleteCollection deletes a collection of objects. func (c *podDisruptionBudgets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("poddisruptionbudgets"). VersionedParams(&listOptions, scheme.ParameterCodec). Body(options). Do(). Error() } // Patch applies the patch and returns the patched podDisruptionBudget. func (c *podDisruptionBudgets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *policy.PodDisruptionBudget, err error) { result = &policy.PodDisruptionBudget{} err = c.client.Patch(pt). Namespace(c.ns). Resource("poddisruptionbudgets"). SubResource(subresources...). Name(name). Body(data). Do(). Into(result) return }
aleksandra-malinowska/autoscaler
vertical-pod-autoscaler/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/policy/internalversion/poddisruptionbudget.go
GO
apache-2.0
6,254
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.codehaus.groovy.classgen; import groovy.lang.GroovyObject; /** * Tests using the GroovyObject API from Java on a groovy object * * @author <a href="mailto:james@coredevelopers.net">James Strachan</a> */ public class GetPropertyTest extends TestSupport { public void testProperty() throws Exception { GroovyObject object = compile("src/test/org/codehaus/groovy/classgen/MyBean.groovy"); System.out.println("Got object: " + object); Object value = object.getProperty("name"); assertEquals("name property", "James", value); object.setProperty("name", "Bob"); assertEquals("name property", "Bob", object.getProperty("name")); } }
upadhyayap/incubator-groovy
src/test/org/codehaus/groovy/classgen/GetPropertyTest.java
Java
apache-2.0
1,525
// +build amd64,!appengine package roaring // *** the following functions are defined in popcnt_amd64.s //go:noescape func hasAsm() bool // useAsm is a flag used to select the GO or ASM implementation of the popcnt function var useAsm = hasAsm() //go:noescape func popcntSliceAsm(s []uint64) uint64 //go:noescape func popcntMaskSliceAsm(s, m []uint64) uint64 //go:noescape func popcntAndSliceAsm(s, m []uint64) uint64 //go:noescape func popcntOrSliceAsm(s, m []uint64) uint64 //go:noescape func popcntXorSliceAsm(s, m []uint64) uint64 func popcntSlice(s []uint64) uint64 { if useAsm { return popcntSliceAsm(s) } return popcntSliceGo(s) } func popcntMaskSlice(s, m []uint64) uint64 { if useAsm { return popcntMaskSliceAsm(s, m) } return popcntMaskSliceGo(s, m) } func popcntAndSlice(s, m []uint64) uint64 { if useAsm { return popcntAndSliceAsm(s, m) } return popcntAndSliceGo(s, m) } func popcntOrSlice(s, m []uint64) uint64 { if useAsm { return popcntOrSliceAsm(s, m) } return popcntOrSliceGo(s, m) } func popcntXorSlice(s, m []uint64) uint64 { if useAsm { return popcntXorSliceAsm(s, m) } return popcntXorSliceGo(s, m) }
hyperhq/hyper
vendor/github.com/RoaringBitmap/roaring/popcnt_asm.go
GO
apache-2.0
1,167
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.nifi.hl7.query.evaluator.message; import java.util.Map; import org.apache.nifi.hl7.model.HL7Message; import org.apache.nifi.hl7.query.evaluator.Evaluator; public class MessageEvaluator implements Evaluator<HL7Message> { public HL7Message evaluate(final Map<String, Object> objectMap) { return (HL7Message) objectMap.get(Evaluator.MESSAGE_KEY); } public Class<? extends HL7Message> getType() { return HL7Message.class; } }
PuspenduBanerjee/nifi
nifi-commons/nifi-hl7-query-language/src/main/java/org/apache/nifi/hl7/query/evaluator/message/MessageEvaluator.java
Java
apache-2.0
1,281
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.nifi.provenance.serialization; import java.util.Optional; public class StorageSummary { private final long eventId; private final String storageLocation; private final String partitionName; private final Integer blockIndex; private final long serializedLength; private final long bytesWritten; public StorageSummary(final long eventId, final String storageLocation, final Integer blockIndex, final long serializedLength, final long bytesWritten) { this(eventId, storageLocation, null, blockIndex, serializedLength, bytesWritten); } public StorageSummary(final long eventId, final String storageLocation, final String partitionName, final Integer blockIndex, final long serializedLength, final long bytesWritten) { this.eventId = eventId; this.storageLocation = storageLocation; this.partitionName = partitionName; this.blockIndex = blockIndex; this.serializedLength = serializedLength; this.bytesWritten = bytesWritten; } public long getEventId() { return eventId; } public String getStorageLocation() { return storageLocation; } public Optional<String> getPartitionName() { return Optional.ofNullable(partitionName); } public Integer getBlockIndex() { return blockIndex; } public long getSerializedLength() { return serializedLength; } public long getBytesWritten() { return bytesWritten; } @Override public String toString() { return "StorageSummary[eventId=" + getEventId() + ", partition=" + getPartitionName().orElse(null) + ", location=" + getStorageLocation() + "]"; } }
jtstorck/nifi
nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/serialization/StorageSummary.java
Java
apache-2.0
2,531
// Go support for leveled logs, analogous to https://code.google.com/p/google-glog/ // // Copyright 2013 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup. // It provides functions Info, Warning, Error, Fatal, plus formatting variants such as // Infof. It also provides V-style logging controlled by the -v and -vmodule=file=2 flags. // // Basic examples: // // glog.Info("Prepare to repel boarders") // // glog.Fatalf("Initialization failed: %s", err) // // See the documentation for the V function for an explanation of these examples: // // if glog.V(2) { // glog.Info("Starting transaction...") // } // // glog.V(2).Infoln("Processed", nItems, "elements") // // Log output is buffered and written periodically using Flush. Programs // should call Flush before exiting to guarantee all log output is written. // // By default, all log statements write to files in a temporary directory. // This package provides several flags that modify this behavior. // As a result, flag.Parse must be called before any logging is done. // // -logtostderr=false // Logs are written to standard error instead of to files. // -alsologtostderr=false // Logs are written to standard error as well as to files. // -stderrthreshold=ERROR // Log events at or above this severity are logged to standard // error as well as to files. // -log_dir="" // Log files will be written to this directory instead of the // default temporary directory. // // Other flags provide aids to debugging. // // -log_backtrace_at="" // When set to a file and line number holding a logging statement, // such as // -log_backtrace_at=gopherflakes.go:234 // a stack trace will be written to the Info log whenever execution // hits that statement. (Unlike with -vmodule, the ".go" must be // present.) // -v=0 // Enable V-leveled logging at the specified level. // -vmodule="" // The syntax of the argument is a comma-separated list of pattern=N, // where pattern is a literal file name (minus the ".go" suffix) or // "glob" pattern and N is a V level. For instance, // -vmodule=gopher*=3 // sets the V level to 3 in all Go files whose names begin "gopher". // package glog import ( "bufio" "bytes" "errors" "flag" "fmt" "io" stdLog "log" "os" "path/filepath" "runtime" "strconv" "strings" "sync" "sync/atomic" "time" ) // severity identifies the sort of log: info, warning etc. It also implements // the flag.Value interface. The -stderrthreshold flag is of type severity and // should be modified only through the flag.Value interface. The values match // the corresponding constants in C++. type severity int32 // sync/atomic int32 // These constants identify the log levels in order of increasing severity. // A message written to a high-severity log file is also written to each // lower-severity log file. const ( infoLog severity = iota warningLog errorLog fatalLog numSeverity = 4 ) const severityChar = "IWEF" var severityName = []string{ infoLog: "INFO", warningLog: "WARNING", errorLog: "ERROR", fatalLog: "FATAL", } // get returns the value of the severity. func (s *severity) get() severity { return severity(atomic.LoadInt32((*int32)(s))) } // set sets the value of the severity. func (s *severity) set(val severity) { atomic.StoreInt32((*int32)(s), int32(val)) } // String is part of the flag.Value interface. func (s *severity) String() string { return strconv.FormatInt(int64(*s), 10) } // Get is part of the flag.Value interface. func (s *severity) Get() interface{} { return *s } // Set is part of the flag.Value interface. func (s *severity) Set(value string) error { var threshold severity // Is it a known name? if v, ok := severityByName(value); ok { threshold = v } else { v, err := strconv.Atoi(value) if err != nil { return err } threshold = severity(v) } logging.stderrThreshold.set(threshold) return nil } func severityByName(s string) (severity, bool) { s = strings.ToUpper(s) for i, name := range severityName { if name == s { return severity(i), true } } return 0, false } // OutputStats tracks the number of output lines and bytes written. type OutputStats struct { lines int64 bytes int64 } // Lines returns the number of lines written. func (s *OutputStats) Lines() int64 { return atomic.LoadInt64(&s.lines) } // Bytes returns the number of bytes written. func (s *OutputStats) Bytes() int64 { return atomic.LoadInt64(&s.bytes) } // Stats tracks the number of lines of output and number of bytes // per severity level. Values must be read with atomic.LoadInt64. var Stats struct { Info, Warning, Error OutputStats } var severityStats = [numSeverity]*OutputStats{ infoLog: &Stats.Info, warningLog: &Stats.Warning, errorLog: &Stats.Error, } // Level is exported because it appears in the arguments to V and is // the type of the v flag, which can be set programmatically. // It's a distinct type because we want to discriminate it from logType. // Variables of type level are only changed under logging.mu. // The -v flag is read only with atomic ops, so the state of the logging // module is consistent. // Level is treated as a sync/atomic int32. // Level specifies a level of verbosity for V logs. *Level implements // flag.Value; the -v flag is of type Level and should be modified // only through the flag.Value interface. type Level int32 // get returns the value of the Level. func (l *Level) get() Level { return Level(atomic.LoadInt32((*int32)(l))) } // set sets the value of the Level. func (l *Level) set(val Level) { atomic.StoreInt32((*int32)(l), int32(val)) } // String is part of the flag.Value interface. func (l *Level) String() string { return strconv.FormatInt(int64(*l), 10) } // Get is part of the flag.Value interface. func (l *Level) Get() interface{} { return *l } // Set is part of the flag.Value interface. func (l *Level) Set(value string) error { v, err := strconv.Atoi(value) if err != nil { return err } logging.mu.Lock() defer logging.mu.Unlock() logging.setVState(Level(v), logging.vmodule.filter, false) return nil } // moduleSpec represents the setting of the -vmodule flag. type moduleSpec struct { filter []modulePat } // modulePat contains a filter for the -vmodule flag. // It holds a verbosity level and a file pattern to match. type modulePat struct { pattern string literal bool // The pattern is a literal string level Level } // match reports whether the file matches the pattern. It uses a string // comparison if the pattern contains no metacharacters. func (m *modulePat) match(file string) bool { if m.literal { return file == m.pattern } match, _ := filepath.Match(m.pattern, file) return match } func (m *moduleSpec) String() string { // Lock because the type is not atomic. TODO: clean this up. logging.mu.Lock() defer logging.mu.Unlock() var b bytes.Buffer for i, f := range m.filter { if i > 0 { b.WriteRune(',') } fmt.Fprintf(&b, "%s=%d", f.pattern, f.level) } return b.String() } // Get is part of the (Go 1.2) flag.Getter interface. It always returns nil for this flag type since the // struct is not exported. func (m *moduleSpec) Get() interface{} { return nil } var errVmoduleSyntax = errors.New("syntax error: expect comma-separated list of filename=N") // Syntax: -vmodule=recordio=2,file=1,gfs*=3 func (m *moduleSpec) Set(value string) error { var filter []modulePat for _, pat := range strings.Split(value, ",") { if len(pat) == 0 { // Empty strings such as from a trailing comma can be ignored. continue } patLev := strings.Split(pat, "=") if len(patLev) != 2 || len(patLev[0]) == 0 || len(patLev[1]) == 0 { return errVmoduleSyntax } pattern := patLev[0] v, err := strconv.Atoi(patLev[1]) if err != nil { return errors.New("syntax error: expect comma-separated list of filename=N") } if v < 0 { return errors.New("negative value for vmodule level") } if v == 0 { continue // Ignore. It's harmless but no point in paying the overhead. } // TODO: check syntax of filter? filter = append(filter, modulePat{pattern, isLiteral(pattern), Level(v)}) } logging.mu.Lock() defer logging.mu.Unlock() logging.setVState(logging.verbosity, filter, true) return nil } // isLiteral reports whether the pattern is a literal string, that is, has no metacharacters // that require filepath.Match to be called to match the pattern. func isLiteral(pattern string) bool { return !strings.ContainsAny(pattern, `\*?[]`) } // traceLocation represents the setting of the -log_backtrace_at flag. type traceLocation struct { file string line int } // isSet reports whether the trace location has been specified. // logging.mu is held. func (t *traceLocation) isSet() bool { return t.line > 0 } // match reports whether the specified file and line matches the trace location. // The argument file name is the full path, not the basename specified in the flag. // logging.mu is held. func (t *traceLocation) match(file string, line int) bool { if t.line != line { return false } if i := strings.LastIndex(file, "/"); i >= 0 { file = file[i+1:] } return t.file == file } func (t *traceLocation) String() string { // Lock because the type is not atomic. TODO: clean this up. logging.mu.Lock() defer logging.mu.Unlock() return fmt.Sprintf("%s:%d", t.file, t.line) } // Get is part of the (Go 1.2) flag.Getter interface. It always returns nil for this flag type since the // struct is not exported func (t *traceLocation) Get() interface{} { return nil } var errTraceSyntax = errors.New("syntax error: expect file.go:234") // Syntax: -log_backtrace_at=gopherflakes.go:234 // Note that unlike vmodule the file extension is included here. func (t *traceLocation) Set(value string) error { if value == "" { // Unset. t.line = 0 t.file = "" } fields := strings.Split(value, ":") if len(fields) != 2 { return errTraceSyntax } file, line := fields[0], fields[1] if !strings.Contains(file, ".") { return errTraceSyntax } v, err := strconv.Atoi(line) if err != nil { return errTraceSyntax } if v <= 0 { return errors.New("negative or zero value for level") } logging.mu.Lock() defer logging.mu.Unlock() t.line = v t.file = file return nil } // flushSyncWriter is the interface satisfied by logging destinations. type flushSyncWriter interface { Flush() error Sync() error io.Writer } func init() { flag.BoolVar(&logging.toStderr, "logtostderr", false, "log to standard error instead of files") flag.BoolVar(&logging.alsoToStderr, "alsologtostderr", false, "log to standard error as well as files") flag.Var(&logging.verbosity, "v", "log level for V logs") flag.Var(&logging.stderrThreshold, "stderrthreshold", "logs at or above this threshold go to stderr") flag.Var(&logging.vmodule, "vmodule", "comma-separated list of pattern=N settings for file-filtered logging") flag.Var(&logging.traceLocation, "log_backtrace_at", "when logging hits line file:N, emit a stack trace") // Default stderrThreshold is ERROR. logging.stderrThreshold = errorLog logging.setVState(0, nil, false) go logging.flushDaemon() } // Flush flushes all pending log I/O. func Flush() { logging.lockAndFlushAll() } // loggingT collects all the global state of the logging setup. type loggingT struct { // Boolean flags. Not handled atomically because the flag.Value interface // does not let us avoid the =true, and that shorthand is necessary for // compatibility. TODO: does this matter enough to fix? Seems unlikely. toStderr bool // The -logtostderr flag. alsoToStderr bool // The -alsologtostderr flag. // Level flag. Handled atomically. stderrThreshold severity // The -stderrthreshold flag. // freeList is a list of byte buffers, maintained under freeListMu. freeList *buffer // freeListMu maintains the free list. It is separate from the main mutex // so buffers can be grabbed and printed to without holding the main lock, // for better parallelization. freeListMu sync.Mutex // mu protects the remaining elements of this structure and is // used to synchronize logging. mu sync.Mutex // file holds writer for each of the log types. file [numSeverity]flushSyncWriter // pcs is used in V to avoid an allocation when computing the caller's PC. pcs [1]uintptr // vmap is a cache of the V Level for each V() call site, identified by PC. // It is wiped whenever the vmodule flag changes state. vmap map[uintptr]Level // filterLength stores the length of the vmodule filter chain. If greater // than zero, it means vmodule is enabled. It may be read safely // using sync.LoadInt32, but is only modified under mu. filterLength int32 // traceLocation is the state of the -log_backtrace_at flag. traceLocation traceLocation // These flags are modified only under lock, although verbosity may be fetched // safely using atomic.LoadInt32. vmodule moduleSpec // The state of the -vmodule flag. verbosity Level // V logging level, the value of the -v flag/ } // buffer holds a byte Buffer for reuse. The zero value is ready for use. type buffer struct { bytes.Buffer tmp [64]byte // temporary byte array for creating headers. next *buffer } var logging loggingT // setVState sets a consistent state for V logging. // l.mu is held. func (l *loggingT) setVState(verbosity Level, filter []modulePat, setFilter bool) { // Turn verbosity off so V will not fire while we are in transition. logging.verbosity.set(0) // Ditto for filter length. atomic.StoreInt32(&logging.filterLength, 0) // Set the new filters and wipe the pc->Level map if the filter has changed. if setFilter { logging.vmodule.filter = filter logging.vmap = make(map[uintptr]Level) } // Things are consistent now, so enable filtering and verbosity. // They are enabled in order opposite to that in V. atomic.StoreInt32(&logging.filterLength, int32(len(filter))) logging.verbosity.set(verbosity) } // getBuffer returns a new, ready-to-use buffer. func (l *loggingT) getBuffer() *buffer { l.freeListMu.Lock() b := l.freeList if b != nil { l.freeList = b.next } l.freeListMu.Unlock() if b == nil { b = new(buffer) } else { b.next = nil b.Reset() } return b } // putBuffer returns a buffer to the free list. func (l *loggingT) putBuffer(b *buffer) { if b.Len() >= 256 { // Let big buffers die a natural death. return } l.freeListMu.Lock() b.next = l.freeList l.freeList = b l.freeListMu.Unlock() } var timeNow = time.Now // Stubbed out for testing. /* header formats a log header as defined by the C++ implementation. It returns a buffer containing the formatted header and the user's file and line number. The depth specifies how many stack frames above lives the source line to be identified in the log message. Log lines have this form: Lmmdd hh:mm:ss.uuuuuu threadid file:line] msg... where the fields are defined as follows: L A single character, representing the log level (eg 'I' for INFO) mm The month (zero padded; ie May is '05') dd The day (zero padded) hh:mm:ss.uuuuuu Time in hours, minutes and fractional seconds threadid The space-padded thread ID as returned by GetTID() file The file name line The line number msg The user-supplied message */ func (l *loggingT) header(s severity, depth int) (*buffer, string, int) { _, file, line, ok := runtime.Caller(3 + depth) if !ok { file = "???" line = 1 } else { slash := strings.LastIndex(file, "/") if slash >= 0 { file = file[slash+1:] } } return l.formatHeader(s, file, line), file, line } // formatHeader formats a log header using the provided file name and line number. func (l *loggingT) formatHeader(s severity, file string, line int) *buffer { now := timeNow() if line < 0 { line = 0 // not a real line number, but acceptable to someDigits } if s > fatalLog { s = infoLog // for safety. } buf := l.getBuffer() // Avoid Fprintf, for speed. The format is so simple that we can do it quickly by hand. // It's worth about 3X. Fprintf is hard. _, month, day := now.Date() hour, minute, second := now.Clock() // Lmmdd hh:mm:ss.uuuuuu threadid file:line] buf.tmp[0] = severityChar[s] buf.twoDigits(1, int(month)) buf.twoDigits(3, day) buf.tmp[5] = ' ' buf.twoDigits(6, hour) buf.tmp[8] = ':' buf.twoDigits(9, minute) buf.tmp[11] = ':' buf.twoDigits(12, second) buf.tmp[14] = '.' buf.nDigits(6, 15, now.Nanosecond()/1000, '0') buf.tmp[21] = ' ' buf.nDigits(7, 22, pid, ' ') // TODO: should be TID buf.tmp[29] = ' ' buf.Write(buf.tmp[:30]) buf.WriteString(file) buf.tmp[0] = ':' n := buf.someDigits(1, line) buf.tmp[n+1] = ']' buf.tmp[n+2] = ' ' buf.Write(buf.tmp[:n+3]) return buf } // Some custom tiny helper functions to print the log header efficiently. const digits = "0123456789" // twoDigits formats a zero-prefixed two-digit integer at buf.tmp[i]. func (buf *buffer) twoDigits(i, d int) { buf.tmp[i+1] = digits[d%10] d /= 10 buf.tmp[i] = digits[d%10] } // nDigits formats an n-digit integer at buf.tmp[i], // padding with pad on the left. // It assumes d >= 0. func (buf *buffer) nDigits(n, i, d int, pad byte) { j := n - 1 for ; j >= 0 && d > 0; j-- { buf.tmp[i+j] = digits[d%10] d /= 10 } for ; j >= 0; j-- { buf.tmp[i+j] = pad } } // someDigits formats a zero-prefixed variable-width integer at buf.tmp[i]. func (buf *buffer) someDigits(i, d int) int { // Print into the top, then copy down. We know there's space for at least // a 10-digit number. j := len(buf.tmp) for { j-- buf.tmp[j] = digits[d%10] d /= 10 if d == 0 { break } } return copy(buf.tmp[i:], buf.tmp[j:]) } func (l *loggingT) println(s severity, args ...interface{}) { buf, file, line := l.header(s, 0) fmt.Fprintln(buf, args...) l.output(s, buf, file, line, false) } func (l *loggingT) print(s severity, args ...interface{}) { l.printDepth(s, 1, args...) } func (l *loggingT) printDepth(s severity, depth int, args ...interface{}) { buf, file, line := l.header(s, depth) fmt.Fprint(buf, args...) if buf.Bytes()[buf.Len()-1] != '\n' { buf.WriteByte('\n') } l.output(s, buf, file, line, false) } func (l *loggingT) printf(s severity, format string, args ...interface{}) { buf, file, line := l.header(s, 0) fmt.Fprintf(buf, format, args...) if buf.Bytes()[buf.Len()-1] != '\n' { buf.WriteByte('\n') } l.output(s, buf, file, line, false) } // printWithFileLine behaves like print but uses the provided file and line number. If // alsoLogToStderr is true, the log message always appears on standard error; it // will also appear in the log file unless --logtostderr is set. func (l *loggingT) printWithFileLine(s severity, file string, line int, alsoToStderr bool, args ...interface{}) { buf := l.formatHeader(s, file, line) fmt.Fprint(buf, args...) if buf.Bytes()[buf.Len()-1] != '\n' { buf.WriteByte('\n') } l.output(s, buf, file, line, alsoToStderr) } // output writes the data to the log files and releases the buffer. func (l *loggingT) output(s severity, buf *buffer, file string, line int, alsoToStderr bool) { l.mu.Lock() if l.traceLocation.isSet() { if l.traceLocation.match(file, line) { buf.Write(stacks(false)) } } data := buf.Bytes() if l.toStderr { os.Stderr.Write(data) } else { if alsoToStderr || l.alsoToStderr || s >= l.stderrThreshold.get() { os.Stderr.Write(data) } if l.file[s] == nil { if err := l.createFiles(s); err != nil { os.Stderr.Write(data) // Make sure the message appears somewhere. l.exit(err) } } switch s { case fatalLog: l.file[fatalLog].Write(data) fallthrough case errorLog: l.file[errorLog].Write(data) fallthrough case warningLog: l.file[warningLog].Write(data) fallthrough case infoLog: l.file[infoLog].Write(data) } } if s == fatalLog { // If we got here via Exit rather than Fatal, print no stacks. if atomic.LoadUint32(&fatalNoStacks) > 0 { l.mu.Unlock() timeoutFlush(10 * time.Second) os.Exit(1) } // Dump all goroutine stacks before exiting. // First, make sure we see the trace for the current goroutine on standard error. // If -logtostderr has been specified, the loop below will do that anyway // as the first stack in the full dump. if !l.toStderr { os.Stderr.Write(stacks(false)) } // Write the stack trace for all goroutines to the files. trace := stacks(true) logExitFunc = func(error) {} // If we get a write error, we'll still exit below. for log := fatalLog; log >= infoLog; log-- { if f := l.file[log]; f != nil { // Can be nil if -logtostderr is set. f.Write(trace) } } l.mu.Unlock() timeoutFlush(10 * time.Second) os.Exit(255) // C++ uses -1, which is silly because it's anded with 255 anyway. } l.putBuffer(buf) l.mu.Unlock() if stats := severityStats[s]; stats != nil { atomic.AddInt64(&stats.lines, 1) atomic.AddInt64(&stats.bytes, int64(len(data))) } } // timeoutFlush calls Flush and returns when it completes or after timeout // elapses, whichever happens first. This is needed because the hooks invoked // by Flush may deadlock when glog.Fatal is called from a hook that holds // a lock. func timeoutFlush(timeout time.Duration) { done := make(chan bool, 1) go func() { Flush() // calls logging.lockAndFlushAll() done <- true }() select { case <-done: case <-time.After(timeout): fmt.Fprintln(os.Stderr, "glog: Flush took longer than", timeout) } } // stacks is a wrapper for runtime.Stack that attempts to recover the data for all goroutines. func stacks(all bool) []byte { // We don't know how big the traces are, so grow a few times if they don't fit. Start large, though. n := 10000 if all { n = 100000 } var trace []byte for i := 0; i < 5; i++ { trace = make([]byte, n) nbytes := runtime.Stack(trace, all) if nbytes < len(trace) { return trace[:nbytes] } n *= 2 } return trace } // logExitFunc provides a simple mechanism to override the default behavior // of exiting on error. Used in testing and to guarantee we reach a required exit // for fatal logs. Instead, exit could be a function rather than a method but that // would make its use clumsier. var logExitFunc func(error) // exit is called if there is trouble creating or writing log files. // It flushes the logs and exits the program; there's no point in hanging around. // l.mu is held. func (l *loggingT) exit(err error) { fmt.Fprintf(os.Stderr, "log: exiting because of error: %s\n", err) // If logExitFunc is set, we do that instead of exiting. if logExitFunc != nil { logExitFunc(err) return } l.flushAll() os.Exit(2) } // syncBuffer joins a bufio.Writer to its underlying file, providing access to the // file's Sync method and providing a wrapper for the Write method that provides log // file rotation. There are conflicting methods, so the file cannot be embedded. // l.mu is held for all its methods. type syncBuffer struct { logger *loggingT *bufio.Writer file *os.File sev severity nbytes uint64 // The number of bytes written to this file } func (sb *syncBuffer) Sync() error { return sb.file.Sync() } func (sb *syncBuffer) Write(p []byte) (n int, err error) { if sb.nbytes+uint64(len(p)) >= MaxSize { if err := sb.rotateFile(time.Now()); err != nil { sb.logger.exit(err) } } n, err = sb.Writer.Write(p) sb.nbytes += uint64(n) if err != nil { sb.logger.exit(err) } return } // rotateFile closes the syncBuffer's file and starts a new one. func (sb *syncBuffer) rotateFile(now time.Time) error { if sb.file != nil { sb.Flush() sb.file.Close() } var err error sb.file, _, err = create(severityName[sb.sev], now) sb.nbytes = 0 if err != nil { return err } sb.Writer = bufio.NewWriterSize(sb.file, bufferSize) // Write header. var buf bytes.Buffer fmt.Fprintf(&buf, "Log file created at: %s\n", now.Format("2006/01/02 15:04:05")) fmt.Fprintf(&buf, "Running on machine: %s\n", host) fmt.Fprintf(&buf, "Binary: Built with %s %s for %s/%s\n", runtime.Compiler, runtime.Version(), runtime.GOOS, runtime.GOARCH) fmt.Fprintf(&buf, "Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg\n") n, err := sb.file.Write(buf.Bytes()) sb.nbytes += uint64(n) return err } // bufferSize sizes the buffer associated with each log file. It's large // so that log records can accumulate without the logging thread blocking // on disk I/O. The flushDaemon will block instead. const bufferSize = 256 * 1024 // createFiles creates all the log files for severity from sev down to infoLog. // l.mu is held. func (l *loggingT) createFiles(sev severity) error { now := time.Now() // Files are created in decreasing severity order, so as soon as we find one // has already been created, we can stop. for s := sev; s >= infoLog && l.file[s] == nil; s-- { sb := &syncBuffer{ logger: l, sev: s, } if err := sb.rotateFile(now); err != nil { return err } l.file[s] = sb } return nil } const flushInterval = 30 * time.Second // flushDaemon periodically flushes the log file buffers. func (l *loggingT) flushDaemon() { for _ = range time.NewTicker(flushInterval).C { l.lockAndFlushAll() } } // lockAndFlushAll is like flushAll but locks l.mu first. func (l *loggingT) lockAndFlushAll() { l.mu.Lock() l.flushAll() l.mu.Unlock() } // flushAll flushes all the logs and attempts to "sync" their data to disk. // l.mu is held. func (l *loggingT) flushAll() { // Flush from fatal down, in case there's trouble flushing. for s := fatalLog; s >= infoLog; s-- { file := l.file[s] if file != nil { file.Flush() // ignore error file.Sync() // ignore error } } } // CopyStandardLogTo arranges for messages written to the Go "log" package's // default logs to also appear in the Google logs for the named and lower // severities. Subsequent changes to the standard log's default output location // or format may break this behavior. // // Valid names are "INFO", "WARNING", "ERROR", and "FATAL". If the name is not // recognized, CopyStandardLogTo panics. func CopyStandardLogTo(name string) { sev, ok := severityByName(name) if !ok { panic(fmt.Sprintf("log.CopyStandardLogTo(%q): unrecognized severity name", name)) } // Set a log format that captures the user's file and line: // d.go:23: message stdLog.SetFlags(stdLog.Lshortfile) stdLog.SetOutput(logBridge(sev)) } // logBridge provides the Write method that enables CopyStandardLogTo to connect // Go's standard logs to the logs provided by this package. type logBridge severity // Write parses the standard logging line and passes its components to the // logger for severity(lb). func (lb logBridge) Write(b []byte) (n int, err error) { var ( file = "???" line = 1 text string ) // Split "d.go:23: message" into "d.go", "23", and "message". if parts := bytes.SplitN(b, []byte{':'}, 3); len(parts) != 3 || len(parts[0]) < 1 || len(parts[2]) < 1 { text = fmt.Sprintf("bad log format: %s", b) } else { file = string(parts[0]) text = string(parts[2][1:]) // skip leading space line, err = strconv.Atoi(string(parts[1])) if err != nil { text = fmt.Sprintf("bad line number: %s", b) line = 1 } } // printWithFileLine with alsoToStderr=true, so standard log messages // always appear on standard error. logging.printWithFileLine(severity(lb), file, line, true, text) return len(b), nil } // setV computes and remembers the V level for a given PC // when vmodule is enabled. // File pattern matching takes the basename of the file, stripped // of its .go suffix, and uses filepath.Match, which is a little more // general than the *? matching used in C++. // l.mu is held. func (l *loggingT) setV(pc uintptr) Level { fn := runtime.FuncForPC(pc) file, _ := fn.FileLine(pc) // The file is something like /a/b/c/d.go. We want just the d. if strings.HasSuffix(file, ".go") { file = file[:len(file)-3] } if slash := strings.LastIndex(file, "/"); slash >= 0 { file = file[slash+1:] } for _, filter := range l.vmodule.filter { if filter.match(file) { l.vmap[pc] = filter.level return filter.level } } l.vmap[pc] = 0 return 0 } // Verbose is a boolean type that implements Infof (like Printf) etc. // See the documentation of V for more information. type Verbose bool // V reports whether verbosity at the call site is at least the requested level. // The returned value is a boolean of type Verbose, which implements Info, Infoln // and Infof. These methods will write to the Info log if called. // Thus, one may write either // if glog.V(2) { glog.Info("log this") } // or // glog.V(2).Info("log this") // The second form is shorter but the first is cheaper if logging is off because it does // not evaluate its arguments. // // Whether an individual call to V generates a log record depends on the setting of // the -v and --vmodule flags; both are off by default. If the level in the call to // V is at least the value of -v, or of -vmodule for the source file containing the // call, the V call will log. func V(level Level) Verbose { // This function tries hard to be cheap unless there's work to do. // The fast path is two atomic loads and compares. // Here is a cheap but safe test to see if V logging is enabled globally. if logging.verbosity.get() >= level { return Verbose(true) } // It's off globally but it vmodule may still be set. // Here is another cheap but safe test to see if vmodule is enabled. if atomic.LoadInt32(&logging.filterLength) > 0 { // Now we need a proper lock to use the logging structure. The pcs field // is shared so we must lock before accessing it. This is fairly expensive, // but if V logging is enabled we're slow anyway. logging.mu.Lock() defer logging.mu.Unlock() if runtime.Callers(2, logging.pcs[:]) == 0 { return Verbose(false) } v, ok := logging.vmap[logging.pcs[0]] if !ok { v = logging.setV(logging.pcs[0]) } return Verbose(v >= level) } return Verbose(false) } // Info is equivalent to the global Info function, guarded by the value of v. // See the documentation of V for usage. func (v Verbose) Info(args ...interface{}) { if v { logging.print(infoLog, args...) } } // Infoln is equivalent to the global Infoln function, guarded by the value of v. // See the documentation of V for usage. func (v Verbose) Infoln(args ...interface{}) { if v { logging.println(infoLog, args...) } } // Infof is equivalent to the global Infof function, guarded by the value of v. // See the documentation of V for usage. func (v Verbose) Infof(format string, args ...interface{}) { if v { logging.printf(infoLog, format, args...) } } // Info logs to the INFO log. // Arguments are handled in the manner of fmt.Print; a newline is appended if missing. func Info(args ...interface{}) { logging.print(infoLog, args...) } // InfoDepth acts as Info but uses depth to determine which call frame to log. // InfoDepth(0, "msg") is the same as Info("msg"). func InfoDepth(depth int, args ...interface{}) { logging.printDepth(infoLog, depth, args...) } // Infoln logs to the INFO log. // Arguments are handled in the manner of fmt.Println; a newline is appended if missing. func Infoln(args ...interface{}) { logging.println(infoLog, args...) } // Infof logs to the INFO log. // Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. func Infof(format string, args ...interface{}) { logging.printf(infoLog, format, args...) } // Warning logs to the WARNING and INFO logs. // Arguments are handled in the manner of fmt.Print; a newline is appended if missing. func Warning(args ...interface{}) { logging.print(warningLog, args...) } // WarningDepth acts as Warning but uses depth to determine which call frame to log. // WarningDepth(0, "msg") is the same as Warning("msg"). func WarningDepth(depth int, args ...interface{}) { logging.printDepth(warningLog, depth, args...) } // Warningln logs to the WARNING and INFO logs. // Arguments are handled in the manner of fmt.Println; a newline is appended if missing. func Warningln(args ...interface{}) { logging.println(warningLog, args...) } // Warningf logs to the WARNING and INFO logs. // Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. func Warningf(format string, args ...interface{}) { logging.printf(warningLog, format, args...) } // Error logs to the ERROR, WARNING, and INFO logs. // Arguments are handled in the manner of fmt.Print; a newline is appended if missing. func Error(args ...interface{}) { logging.print(errorLog, args...) } // ErrorDepth acts as Error but uses depth to determine which call frame to log. // ErrorDepth(0, "msg") is the same as Error("msg"). func ErrorDepth(depth int, args ...interface{}) { logging.printDepth(errorLog, depth, args...) } // Errorln logs to the ERROR, WARNING, and INFO logs. // Arguments are handled in the manner of fmt.Println; a newline is appended if missing. func Errorln(args ...interface{}) { logging.println(errorLog, args...) } // Errorf logs to the ERROR, WARNING, and INFO logs. // Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. func Errorf(format string, args ...interface{}) { logging.printf(errorLog, format, args...) } // Fatal logs to the FATAL, ERROR, WARNING, and INFO logs, // including a stack trace of all running goroutines, then calls os.Exit(255). // Arguments are handled in the manner of fmt.Print; a newline is appended if missing. func Fatal(args ...interface{}) { logging.print(fatalLog, args...) } // FatalDepth acts as Fatal but uses depth to determine which call frame to log. // FatalDepth(0, "msg") is the same as Fatal("msg"). func FatalDepth(depth int, args ...interface{}) { logging.printDepth(fatalLog, depth, args...) } // Fatalln logs to the FATAL, ERROR, WARNING, and INFO logs, // including a stack trace of all running goroutines, then calls os.Exit(255). // Arguments are handled in the manner of fmt.Println; a newline is appended if missing. func Fatalln(args ...interface{}) { logging.println(fatalLog, args...) } // Fatalf logs to the FATAL, ERROR, WARNING, and INFO logs, // including a stack trace of all running goroutines, then calls os.Exit(255). // Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. func Fatalf(format string, args ...interface{}) { logging.printf(fatalLog, format, args...) } // fatalNoStacks is non-zero if we are to exit without dumping goroutine stacks. // It allows Exit and relatives to use the Fatal logs. var fatalNoStacks uint32 // Exit logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1). // Arguments are handled in the manner of fmt.Print; a newline is appended if missing. func Exit(args ...interface{}) { atomic.StoreUint32(&fatalNoStacks, 1) logging.print(fatalLog, args...) } // ExitDepth acts as Exit but uses depth to determine which call frame to log. // ExitDepth(0, "msg") is the same as Exit("msg"). func ExitDepth(depth int, args ...interface{}) { atomic.StoreUint32(&fatalNoStacks, 1) logging.printDepth(fatalLog, depth, args...) } // Exitln logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1). func Exitln(args ...interface{}) { atomic.StoreUint32(&fatalNoStacks, 1) logging.println(fatalLog, args...) } // Exitf logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1). // Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. func Exitf(format string, args ...interface{}) { atomic.StoreUint32(&fatalNoStacks, 1) logging.printf(fatalLog, format, args...) }
swordboy/skynet
vendor/k8s.io/client-go/1.5/vendor/github.com/golang/glog/glog.go
GO
apache-2.0
36,277
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.elasticsearch.index.mapper; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.StringField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.ConstantScoreQuery; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; import org.junit.Before; import java.io.IOException; public class TypeFieldTypeTests extends FieldTypeTestCase { @Override protected MappedFieldType createDefaultFieldType() { return new TypeFieldMapper.TypeFieldType(); } @Before public void setupProperties() { addModifier(new Modifier("fielddata", true) { @Override public void modify(MappedFieldType ft) { TypeFieldMapper.TypeFieldType tft = (TypeFieldMapper.TypeFieldType) ft; tft.setFielddata(tft.fielddata() == false); } }); } public void testTermsQuery() throws Exception { Directory dir = newDirectory(); IndexWriter w = new IndexWriter(dir, newIndexWriterConfig()); IndexReader reader = openReaderWithNewType("my_type", w); TypeFieldMapper.TypeFieldType ft = new TypeFieldMapper.TypeFieldType(); ft.setName(TypeFieldMapper.NAME); Query query = ft.termQuery("my_type", null); assertEquals(new MatchAllDocsQuery(), query.rewrite(reader)); // Make sure that Lucene actually simplifies the query when there is a single type Query userQuery = new PhraseQuery("body", "quick", "fox"); Query filteredQuery = new BooleanQuery.Builder().add(userQuery, Occur.MUST).add(query, Occur.FILTER).build(); Query rewritten = new IndexSearcher(reader).rewrite(filteredQuery); assertEquals(userQuery, rewritten); // ... and does not rewrite it if there is more than one type reader.close(); reader = openReaderWithNewType("my_type2", w); Query expected = new ConstantScoreQuery( new BooleanQuery.Builder() .add(new TermQuery(new Term(TypeFieldMapper.NAME, "my_type")), Occur.SHOULD) .build() ); assertEquals(expected, query.rewrite(reader)); BytesRef[] types = new BytesRef[] {new BytesRef("my_type"), new BytesRef("my_type2"), new BytesRef("my_type3")}; // the query should match all documents query = new TypeFieldMapper.TypesQuery(types); assertEquals(new MatchAllDocsQuery(), query.rewrite(reader)); reader.close(); reader = openReaderWithNewType("unknown_type", w); // the query cannot rewrite to a match all docs sinc unknown_type is not queried. query = new TypeFieldMapper.TypesQuery(types); expected = new ConstantScoreQuery( new BooleanQuery.Builder() .add(new TermQuery(new Term(TypeFieldMapper.CONTENT_TYPE, types[0])), Occur.SHOULD) .add(new TermQuery(new Term(TypeFieldMapper.CONTENT_TYPE, types[1])), Occur.SHOULD) .build() ); rewritten = query.rewrite(reader); assertEquals(expected, rewritten); // make sure that redundant types does not rewrite to MatchAllDocsQuery query = new TypeFieldMapper.TypesQuery(new BytesRef("my_type"), new BytesRef("my_type"), new BytesRef("my_type")); expected = new ConstantScoreQuery( new BooleanQuery.Builder() .add(new TermQuery(new Term(TypeFieldMapper.CONTENT_TYPE, "my_type")), Occur.SHOULD) .build() ); rewritten = query.rewrite(reader); assertEquals(expected, rewritten); IOUtils.close(reader, w, dir); } static DirectoryReader openReaderWithNewType(String type, IndexWriter writer) throws IOException { Document doc = new Document(); StringField typeField = new StringField(TypeFieldMapper.NAME, type, Store.NO); doc.add(typeField); writer.addDocument(doc); return DirectoryReader.open(writer); } }
geidies/elasticsearch
core/src/test/java/org/elasticsearch/index/mapper/TypeFieldTypeTests.java
Java
apache-2.0
5,425
/*! ****************************************************************************** * * Pentaho Data Integration * * Copyright (C) 2002-2013 by Pentaho : http://www.pentaho.com * ******************************************************************************* * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************/ package org.pentaho.di.www; import static junit.framework.Assert.assertFalse; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.junit.Before; import org.junit.Test; import org.pentaho.di.core.gui.Point; import org.pentaho.di.core.logging.KettleLogStore; import org.pentaho.di.core.logging.LogChannelInterface; import org.pentaho.di.trans.Trans; import org.pentaho.di.trans.TransMeta; public class GetTransStatusServletTest { private TransformationMap mockTransformationMap; private GetTransStatusServlet getTransStatusServlet; @Before public void setup() { mockTransformationMap = mock( TransformationMap.class ); getTransStatusServlet = new GetTransStatusServlet( mockTransformationMap ); } @Test public void testGetTransStatusServletEscapesHtmlWhenTransNotFound() throws ServletException, IOException { HttpServletRequest mockHttpServletRequest = mock( HttpServletRequest.class ); HttpServletResponse mockHttpServletResponse = mock( HttpServletResponse.class ); StringWriter out = new StringWriter(); PrintWriter printWriter = new PrintWriter( out ); when( mockHttpServletRequest.getContextPath() ).thenReturn( GetTransStatusServlet.CONTEXT_PATH ); when( mockHttpServletRequest.getParameter( anyString() ) ).thenReturn( ServletTestUtils.BAD_STRING ); when( mockHttpServletResponse.getWriter() ).thenReturn( printWriter ); getTransStatusServlet.doGet( mockHttpServletRequest, mockHttpServletResponse ); assertFalse( ServletTestUtils.hasBadText( ServletTestUtils.getInsideOfTag( "H1", out.toString() ) ) ); } @Test public void testGetTransStatusServletEscapesHtmlWhenTransFound() throws ServletException, IOException { KettleLogStore.init(); HttpServletRequest mockHttpServletRequest = mock( HttpServletRequest.class ); HttpServletResponse mockHttpServletResponse = mock( HttpServletResponse.class ); Trans mockTrans = mock( Trans.class ); TransMeta mockTransMeta = mock( TransMeta.class ); LogChannelInterface mockChannelInterface = mock( LogChannelInterface.class ); StringWriter out = new StringWriter(); PrintWriter printWriter = new PrintWriter( out ); when( mockHttpServletRequest.getContextPath() ).thenReturn( GetTransStatusServlet.CONTEXT_PATH ); when( mockHttpServletRequest.getParameter( anyString() ) ).thenReturn( ServletTestUtils.BAD_STRING ); when( mockHttpServletResponse.getWriter() ).thenReturn( printWriter ); when( mockTransformationMap.getTransformation( any( CarteObjectEntry.class ) ) ).thenReturn( mockTrans ); when( mockTrans.getLogChannel() ).thenReturn( mockChannelInterface ); when( mockTrans.getTransMeta() ).thenReturn( mockTransMeta ); when( mockTransMeta.getMaximum() ).thenReturn( new Point( 10, 10 ) ); getTransStatusServlet.doGet( mockHttpServletRequest, mockHttpServletResponse ); assertFalse( out.toString().contains( ServletTestUtils.BAD_STRING ) ); } }
EcoleKeine/pentaho-kettle
test/org/pentaho/di/www/GetTransStatusServletTest.java
Java
apache-2.0
4,190
package fakedriver import ( "github.com/docker/machine/drivers" "github.com/docker/machine/state" ) type FakeDriver struct { *drivers.BaseDriver MockState state.State MockName string } func (d *FakeDriver) DriverName() string { return "fakedriver" } func (d *FakeDriver) SetConfigFromFlags(flags drivers.DriverOptions) error { return nil } func (d *FakeDriver) GetURL() (string, error) { return "", nil } func (d *FakeDriver) GetMachineName() string { return d.MockName } func (d *FakeDriver) GetIP() (string, error) { return "1.2.3.4", nil } func (d *FakeDriver) GetSSHHostname() (string, error) { return "", nil } func (d *FakeDriver) GetSSHKeyPath() string { return "" } func (d *FakeDriver) GetSSHPort() (int, error) { return 0, nil } func (d *FakeDriver) GetSSHUsername() string { return "" } func (d *FakeDriver) GetState() (state.State, error) { return d.MockState, nil } func (d *FakeDriver) PreCreateCheck() error { return nil } func (d *FakeDriver) Create() error { return nil } func (d *FakeDriver) Remove() error { return nil } func (d *FakeDriver) Start() error { d.MockState = state.Running return nil } func (d *FakeDriver) Stop() error { d.MockState = state.Stopped return nil } func (d *FakeDriver) Restart() error { return nil } func (d *FakeDriver) Kill() error { return nil } func (d *FakeDriver) Upgrade() error { return nil }
asalhamed/machine
drivers/fakedriver/fakedriver.go
GO
apache-2.0
1,394
/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v2alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/pkg/api/v1" ) // GroupName is the group name use in this package const GroupName = "autoscaling" // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v2alpha1"} var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addDefaultingFuncs) AddToScheme = SchemeBuilder.AddToScheme ) // Adds the list of known types to api.Scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &HorizontalPodAutoscaler{}, &HorizontalPodAutoscalerList{}, &v1.ListOptions{}, &v1.DeleteOptions{}, &metav1.GetOptions{}, &metav1.ExportOptions{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil }
rchicoli/kubernetes-contrib
rescheduler/vendor/k8s.io/client-go/pkg/apis/autoscaling/v2alpha1/register.go
GO
apache-2.0
1,494
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Uživatelská příručka CKFinder</title> <link href="../../files/other/help.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="../../files/other/help.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="robots" content="noindex, nofollow" /> </head> <body> <h1> Právní omezení</h1> <p> CKFinder, včetně této dokumentace, patří &copy; 2007-2012 <a href="http://cksource.com" target="_blank">CKSource</a> - Frederico Knabben. Všechna práva vyhrazena. Ujistěte se, prosím, že jste přečetli a pochopili <a href="license.html">Licenci CKFinder</a>.</p> <p> Ikony použité v panelu nástrojů a kontextových menu byly navrhnuty Markem Jamesem. Pro další informace si prosím prohlédněte následující adresu:<br /> <a href="http://www.famfamfam.com/lab/icons/silk/">http://www.famfamfam.com/lab/icons/silk/</a></p> <h2> Obchodní značky</h2> <p> CKFinder, logo CKFinder, CKSource, CKEditor a FCKeditor jsou obchodní značky <a href="http://cksource.com" target="_blank">CKSource</a> - Frederico Knabben.</p> </body> </html>
spacetime2013/nphitech
src/main/webapp/static/ckfinder/help/cs/files/011.html
HTML
apache-2.0
1,323
// Package quantile computes approximate quantiles over an unbounded data // stream within low memory and CPU bounds. // // A small amount of accuracy is traded to achieve the above properties. // // Multiple streams can be merged before calling Query to generate a single set // of results. This is meaningful when the streams represent the same type of // data. See Merge and Samples. // // For more detailed information about the algorithm used, see: // // Effective Computation of Biased Quantiles over Data Streams // // http://www.cs.rutgers.edu/~muthu/bquant.pdf package quantile import ( "math" "sort" ) // Sample holds an observed value and meta information for compression. JSON // tags have been added for convenience. type Sample struct { Value float64 `json:",string"` Width float64 `json:",string"` Delta float64 `json:",string"` } // Samples represents a slice of samples. It implements sort.Interface. type Samples []Sample func (a Samples) Len() int { return len(a) } func (a Samples) Less(i, j int) bool { return a[i].Value < a[j].Value } func (a Samples) Swap(i, j int) { a[i], a[j] = a[j], a[i] } type invariant func(s *stream, r float64) float64 // NewLowBiased returns an initialized Stream for low-biased quantiles // (e.g. 0.01, 0.1, 0.5) where the needed quantiles are not known a priori, but // error guarantees can still be given even for the lower ranks of the data // distribution. // // The provided epsilon is a relative error, i.e. the true quantile of a value // returned by a query is guaranteed to be within (1±Epsilon)*Quantile. // // See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error // properties. func NewLowBiased(epsilon float64) *Stream { ƒ := func(s *stream, r float64) float64 { return 2 * epsilon * r } return newStream(ƒ) } // NewHighBiased returns an initialized Stream for high-biased quantiles // (e.g. 0.01, 0.1, 0.5) where the needed quantiles are not known a priori, but // error guarantees can still be given even for the higher ranks of the data // distribution. // // The provided epsilon is a relative error, i.e. the true quantile of a value // returned by a query is guaranteed to be within 1-(1±Epsilon)*(1-Quantile). // // See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error // properties. func NewHighBiased(epsilon float64) *Stream { ƒ := func(s *stream, r float64) float64 { return 2 * epsilon * (s.n - r) } return newStream(ƒ) } // NewTargeted returns an initialized Stream concerned with a particular set of // quantile values that are supplied a priori. Knowing these a priori reduces // space and computation time. The targets map maps the desired quantiles to // their absolute errors, i.e. the true quantile of a value returned by a query // is guaranteed to be within (Quantile±Epsilon). // // See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error properties. func NewTargeted(targets map[float64]float64) *Stream { ƒ := func(s *stream, r float64) float64 { var m = math.MaxFloat64 var f float64 for quantile, epsilon := range targets { if quantile*s.n <= r { f = (2 * epsilon * r) / quantile } else { f = (2 * epsilon * (s.n - r)) / (1 - quantile) } if f < m { m = f } } return m } return newStream(ƒ) } // Stream computes quantiles for a stream of float64s. It is not thread-safe by // design. Take care when using across multiple goroutines. type Stream struct { *stream b Samples sorted bool } func newStream(ƒ invariant) *Stream { x := &stream{ƒ: ƒ} return &Stream{x, make(Samples, 0, 500), true} } // Insert inserts v into the stream. func (s *Stream) Insert(v float64) { s.insert(Sample{Value: v, Width: 1}) } func (s *Stream) insert(sample Sample) { s.b = append(s.b, sample) s.sorted = false if len(s.b) == cap(s.b) { s.flush() } } // Query returns the computed qth percentiles value. If s was created with // NewTargeted, and q is not in the set of quantiles provided a priori, Query // will return an unspecified result. func (s *Stream) Query(q float64) float64 { if !s.flushed() { // Fast path when there hasn't been enough data for a flush; // this also yields better accuracy for small sets of data. l := len(s.b) if l == 0 { return 0 } i := int(math.Ceil(float64(l) * q)) if i > 0 { i -= 1 } s.maybeSort() return s.b[i].Value } s.flush() return s.stream.query(q) } // Merge merges samples into the underlying streams samples. This is handy when // merging multiple streams from separate threads, database shards, etc. // // ATTENTION: This method is broken and does not yield correct results. The // underlying algorithm is not capable of merging streams correctly. func (s *Stream) Merge(samples Samples) { sort.Sort(samples) s.stream.merge(samples) } // Reset reinitializes and clears the list reusing the samples buffer memory. func (s *Stream) Reset() { s.stream.reset() s.b = s.b[:0] } // Samples returns stream samples held by s. func (s *Stream) Samples() Samples { if !s.flushed() { return s.b } s.flush() return s.stream.samples() } // Count returns the total number of samples observed in the stream // since initialization. func (s *Stream) Count() int { return len(s.b) + s.stream.count() } func (s *Stream) flush() { s.maybeSort() s.stream.merge(s.b) s.b = s.b[:0] } func (s *Stream) maybeSort() { if !s.sorted { s.sorted = true sort.Sort(s.b) } } func (s *Stream) flushed() bool { return len(s.stream.l) > 0 } type stream struct { n float64 l []Sample ƒ invariant } func (s *stream) reset() { s.l = s.l[:0] s.n = 0 } func (s *stream) insert(v float64) { s.merge(Samples{{v, 1, 0}}) } func (s *stream) merge(samples Samples) { // TODO(beorn7): This tries to merge not only individual samples, but // whole summaries. The paper doesn't mention merging summaries at // all. Unittests show that the merging is inaccurate. Find out how to // do merges properly. var r float64 i := 0 for _, sample := range samples { for ; i < len(s.l); i++ { c := s.l[i] if c.Value > sample.Value { // Insert at position i. s.l = append(s.l, Sample{}) copy(s.l[i+1:], s.l[i:]) s.l[i] = Sample{ sample.Value, sample.Width, math.Max(sample.Delta, math.Floor(s.ƒ(s, r))-1), // TODO(beorn7): How to calculate delta correctly? } i++ goto inserted } r += c.Width } s.l = append(s.l, Sample{sample.Value, sample.Width, 0}) i++ inserted: s.n += sample.Width r += sample.Width } s.compress() } func (s *stream) count() int { return int(s.n) } func (s *stream) query(q float64) float64 { t := math.Ceil(q * s.n) t += math.Ceil(s.ƒ(s, t) / 2) p := s.l[0] var r float64 for _, c := range s.l[1:] { r += p.Width if r+c.Width+c.Delta > t { return p.Value } p = c } return p.Value } func (s *stream) compress() { if len(s.l) < 2 { return } x := s.l[len(s.l)-1] xi := len(s.l) - 1 r := s.n - 1 - x.Width for i := len(s.l) - 2; i >= 0; i-- { c := s.l[i] if c.Width+x.Width+x.Delta <= s.ƒ(s, r) { x.Width += c.Width s.l[xi] = x // Remove element at i. copy(s.l[i:], s.l[i+1:]) s.l = s.l[:len(s.l)-1] xi -= 1 } else { x = c xi = i } r -= c.Width } } func (s *stream) samples() Samples { samples := make(Samples, len(s.l)) copy(samples, s.l) return samples }
dcos/dcos-metrics
vendor/github.com/beorn7/perks/quantile/stream.go
GO
apache-2.0
7,422
package raft import ( "bytes" "encoding/json" "fmt" "strconv" "sync" "testing" "time" ) //-------------------------------------- // Request Vote //-------------------------------------- // Ensure that we can request a vote from a server that has not voted. func TestServerRequestVote(t *testing.T) { server := newTestServer("1", &testTransporter{}) server.Start() if _, err := server.Do(&DefaultJoinCommand{Name: server.Name()}); err != nil { t.Fatalf("Server %s unable to join: %v", server.Name(), err) } defer server.Stop() resp := server.RequestVote(newRequestVoteRequest(1, "foo", 1, 0)) if resp.Term != 1 || !resp.VoteGranted { t.Fatalf("Invalid request vote response: %v/%v", resp.Term, resp.VoteGranted) } } // // Ensure that a vote request is denied if it comes from an old term. func TestServerRequestVoteDeniedForStaleTerm(t *testing.T) { s := newTestServer("1", &testTransporter{}) s.Start() if _, err := s.Do(&DefaultJoinCommand{Name: s.Name()}); err != nil { t.Fatalf("Server %s unable to join: %v", s.Name(), err) } s.(*server).mutex.Lock() s.(*server).currentTerm = 2 s.(*server).mutex.Unlock() defer s.Stop() resp := s.RequestVote(newRequestVoteRequest(1, "foo", 1, 0)) if resp.Term != 2 || resp.VoteGranted { t.Fatalf("Invalid request vote response: %v/%v", resp.Term, resp.VoteGranted) } if s.Term() != 2 && s.State() != Follower { t.Fatalf("Server did not update term and demote: %v / %v", s.Term(), s.State()) } } // Ensure that a vote request is denied if we've already voted for a different candidate. func TestServerRequestVoteDeniedIfAlreadyVoted(t *testing.T) { s := newTestServer("1", &testTransporter{}) s.Start() if _, err := s.Do(&DefaultJoinCommand{Name: s.Name()}); err != nil { t.Fatalf("Server %s unable to join: %v", s.Name(), err) } s.(*server).mutex.Lock() s.(*server).currentTerm = 2 s.(*server).mutex.Unlock() defer s.Stop() resp := s.RequestVote(newRequestVoteRequest(2, "foo", 1, 0)) if resp.Term != 2 || !resp.VoteGranted { t.Fatalf("First vote should not have been denied") } resp = s.RequestVote(newRequestVoteRequest(2, "bar", 1, 0)) if resp.Term != 2 || resp.VoteGranted { t.Fatalf("Second vote should have been denied") } } // Ensure that a vote request is approved if vote occurs in a new term. func TestServerRequestVoteApprovedIfAlreadyVotedInOlderTerm(t *testing.T) { s := newTestServer("1", &testTransporter{}) s.Start() if _, err := s.Do(&DefaultJoinCommand{Name: s.Name()}); err != nil { t.Fatalf("Server %s unable to join: %v", s.Name(), err) } time.Sleep(time.Millisecond * 100) s.(*server).mutex.Lock() s.(*server).currentTerm = 2 s.(*server).mutex.Unlock() defer s.Stop() resp := s.RequestVote(newRequestVoteRequest(2, "foo", 2, 1)) if resp.Term != 2 || !resp.VoteGranted || s.VotedFor() != "foo" { t.Fatalf("First vote should not have been denied") } resp = s.RequestVote(newRequestVoteRequest(3, "bar", 2, 1)) if resp.Term != 3 || !resp.VoteGranted || s.VotedFor() != "bar" { t.Fatalf("Second vote should have been approved") } } // Ensure that a vote request is denied if the log is out of date. func TestServerRequestVoteDenyIfCandidateLogIsBehind(t *testing.T) { tmpLog := newLog() e0, _ := newLogEntry(tmpLog, nil, 1, 1, &testCommand1{Val: "foo", I: 20}) e1, _ := newLogEntry(tmpLog, nil, 2, 1, &testCommand2{X: 100}) e2, _ := newLogEntry(tmpLog, nil, 3, 2, &testCommand1{Val: "bar", I: 0}) s := newTestServerWithLog("1", &testTransporter{}, []*LogEntry{e0, e1, e2}) // start as a follower with term 2 and index 3 s.Start() defer s.Stop() // request vote from term 3 with last log entry 2, 2 resp := s.RequestVote(newRequestVoteRequest(3, "foo", 2, 2)) if resp.Term != 3 || resp.VoteGranted { t.Fatalf("Stale index vote should have been denied [%v/%v]", resp.Term, resp.VoteGranted) } // request vote from term 2 with last log entry 2, 3 resp = s.RequestVote(newRequestVoteRequest(2, "foo", 3, 2)) if resp.Term != 3 || resp.VoteGranted { t.Fatalf("Stale term vote should have been denied [%v/%v]", resp.Term, resp.VoteGranted) } // request vote from term 3 with last log entry 2, 3 resp = s.RequestVote(newRequestVoteRequest(3, "foo", 3, 2)) if resp.Term != 3 || !resp.VoteGranted { t.Fatalf("Matching log vote should have been granted") } // request vote from term 3 with last log entry 2, 4 resp = s.RequestVote(newRequestVoteRequest(3, "foo", 4, 2)) if resp.Term != 3 || !resp.VoteGranted { t.Fatalf("Ahead-of-log vote should have been granted") } } func TestProcessVoteResponse(t *testing.T) { // server Term: 0, status: Leader // response Term : 1, granted // Expectation: not success // Server Term 1 status:Leader server := &server{} server.eventDispatcher = newEventDispatcher(server) server.currentTerm = 0 server.state = Leader response := &RequestVoteResponse{ VoteGranted: true, Term: 1, } if success := server.processVoteResponse(response); success { t.Fatal("Process should fail if the resp's term is larger than server's") } if server.state != Follower { t.Fatal("Server should stepdown") } // server Term: 1, status: Follower // response Term: 2, granted // Expectation: not success response.Term = 2 if success := server.processVoteResponse(response); success { t.Fatal("Process should fail if the resp's term is larger than server's") } if server.state != Follower { t.Fatal("Server should still be Follower") } server.currentTerm = 2 // server Term: 2, status: Follower // response Term: 2 // Expectation: success if success := server.processVoteResponse(response); !success { t.Fatal("Process should success if the server's term is larger than resp's") } } // //-------------------------------------- // // Promotion // //-------------------------------------- // // Ensure that we can self-promote a server to candidate, obtain votes and become a fearless leader. func TestServerPromoteSelf(t *testing.T) { e0, _ := newLogEntry(newLog(), nil, 1, 1, &testCommand1{Val: "foo", I: 20}) s := newTestServerWithLog("1", &testTransporter{}, []*LogEntry{e0}) // start as a follower s.Start() defer s.Stop() time.Sleep(2 * testElectionTimeout) if s.State() != Leader { t.Fatalf("Server self-promotion failed: %v", s.State()) } } //Ensure that we can promote a server within a cluster to a leader. func TestServerPromote(t *testing.T) { lookup := map[string]Server{} transporter := &testTransporter{} transporter.sendVoteRequestFunc = func(s Server, peer *Peer, req *RequestVoteRequest) *RequestVoteResponse { return lookup[peer.Name].RequestVote(req) } transporter.sendAppendEntriesRequestFunc = func(s Server, peer *Peer, req *AppendEntriesRequest) *AppendEntriesResponse { return lookup[peer.Name].AppendEntries(req) } servers := newTestCluster([]string{"1", "2", "3"}, transporter, lookup) servers[0].Start() servers[1].Start() servers[2].Start() time.Sleep(2 * testElectionTimeout) if servers[0].State() != Leader && servers[1].State() != Leader && servers[2].State() != Leader { t.Fatalf("No leader elected: (%s, %s, %s)", servers[0].State(), servers[1].State(), servers[2].State()) } for _, s := range servers { s.Stop() } } //-------------------------------------- // Append Entries //-------------------------------------- // Ensure we can append entries to a server. func TestServerAppendEntries(t *testing.T) { s := newTestServer("1", &testTransporter{}) s.SetHeartbeatInterval(time.Second * 10) s.Start() defer s.Stop() // Append single entry. e, _ := newLogEntry(nil, nil, 1, 1, &testCommand1{Val: "foo", I: 10}) entries := []*LogEntry{e} resp := s.AppendEntries(newAppendEntriesRequest(1, 0, 0, 0, "ldr", entries)) if resp.Term() != 1 || !resp.Success() { t.Fatalf("AppendEntries failed: %v/%v", resp.Term, resp.Success) } if index, term := s.(*server).log.commitInfo(); index != 0 || term != 0 { t.Fatalf("Invalid commit info [IDX=%v, TERM=%v]", index, term) } // Append multiple entries + commit the last one. e1, _ := newLogEntry(nil, nil, 2, 1, &testCommand1{Val: "bar", I: 20}) e2, _ := newLogEntry(nil, nil, 3, 1, &testCommand1{Val: "baz", I: 30}) entries = []*LogEntry{e1, e2} resp = s.AppendEntries(newAppendEntriesRequest(1, 1, 1, 1, "ldr", entries)) if resp.Term() != 1 || !resp.Success() { t.Fatalf("AppendEntries failed: %v/%v", resp.Term, resp.Success) } if index, term := s.(*server).log.commitInfo(); index != 1 || term != 1 { t.Fatalf("Invalid commit info [IDX=%v, TERM=%v]", index, term) } // Send zero entries and commit everything. resp = s.AppendEntries(newAppendEntriesRequest(2, 3, 1, 3, "ldr", []*LogEntry{})) if resp.Term() != 2 || !resp.Success() { t.Fatalf("AppendEntries failed: %v/%v", resp.Term, resp.Success) } if index, term := s.(*server).log.commitInfo(); index != 3 || term != 1 { t.Fatalf("Invalid commit info [IDX=%v, TERM=%v]", index, term) } } //Ensure that entries with stale terms are rejected. func TestServerAppendEntriesWithStaleTermsAreRejected(t *testing.T) { s := newTestServer("1", &testTransporter{}) s.Start() defer s.Stop() s.(*server).mutex.Lock() s.(*server).currentTerm = 2 s.(*server).mutex.Unlock() // Append single entry. e, _ := newLogEntry(nil, nil, 1, 1, &testCommand1{Val: "foo", I: 10}) entries := []*LogEntry{e} resp := s.AppendEntries(newAppendEntriesRequest(1, 0, 0, 0, "ldr", entries)) if resp.Term() != 2 || resp.Success() { t.Fatalf("AppendEntries should have failed: %v/%v", resp.Term, resp.Success) } if index, term := s.(*server).log.commitInfo(); index != 0 || term != 0 { t.Fatalf("Invalid commit info [IDX=%v, TERM=%v]", index, term) } } // Ensure that we reject entries if the commit log is different. func TestServerAppendEntriesRejectedIfAlreadyCommitted(t *testing.T) { s := newTestServer("1", &testTransporter{}) s.Start() defer s.Stop() // Append single entry + commit. e1, _ := newLogEntry(nil, nil, 1, 1, &testCommand1{Val: "foo", I: 10}) e2, _ := newLogEntry(nil, nil, 2, 1, &testCommand1{Val: "foo", I: 15}) entries := []*LogEntry{e1, e2} resp := s.AppendEntries(newAppendEntriesRequest(1, 0, 0, 2, "ldr", entries)) if resp.Term() != 1 || !resp.Success() { t.Fatalf("AppendEntries failed: %v/%v", resp.Term, resp.Success) } // Append entry again (post-commit). e, _ := newLogEntry(nil, nil, 2, 1, &testCommand1{Val: "bar", I: 20}) entries = []*LogEntry{e} resp = s.AppendEntries(newAppendEntriesRequest(1, 2, 1, 1, "ldr", entries)) if resp.Term() != 1 || resp.Success() { t.Fatalf("AppendEntries should have failed: %v/%v", resp.Term, resp.Success) } } // Ensure that we uncommitted entries are rolled back if new entries overwrite them. func TestServerAppendEntriesOverwritesUncommittedEntries(t *testing.T) { s := newTestServer("1", &testTransporter{}) s.Start() defer s.Stop() entry1, _ := newLogEntry(s.(*server).log, nil, 1, 1, &testCommand1{Val: "foo", I: 10}) entry2, _ := newLogEntry(s.(*server).log, nil, 2, 1, &testCommand1{Val: "foo", I: 15}) entry3, _ := newLogEntry(s.(*server).log, nil, 2, 2, &testCommand1{Val: "bar", I: 20}) // Append single entry + commit. entries := []*LogEntry{entry1, entry2} resp := s.AppendEntries(newAppendEntriesRequest(1, 0, 0, 1, "ldr", entries)) if resp.Term() != 1 || !resp.Success() || s.(*server).log.commitIndex != 1 { t.Fatalf("AppendEntries failed: %v/%v", resp.Term, resp.Success) } for i, entry := range s.(*server).log.entries { if entry.Term() != entries[i].Term() || entry.Index() != entries[i].Index() || !bytes.Equal(entry.Command(), entries[i].Command()) { t.Fatalf("AppendEntries failed: %v/%v", resp.Term, resp.Success) } } // Append entry that overwrites the second (uncommitted) entry. entries = []*LogEntry{entry3} resp = s.AppendEntries(newAppendEntriesRequest(2, 1, 1, 2, "ldr", entries)) if resp.Term() != 2 || !resp.Success() || s.(*server).log.commitIndex != 2 { t.Fatalf("AppendEntries should have succeeded: %v/%v", resp.Term, resp.Success) } entries = []*LogEntry{entry1, entry3} for i, entry := range s.(*server).log.entries { if entry.Term() != entries[i].Term() || entry.Index() != entries[i].Index() || !bytes.Equal(entry.Command(), entries[i].Command()) { t.Fatalf("AppendEntries failed: %v/%v", resp.Term, resp.Success) } } } //-------------------------------------- // Command Execution //-------------------------------------- // Ensure that a follower cannot execute a command. func TestServerDenyCommandExecutionWhenFollower(t *testing.T) { s := newTestServer("1", &testTransporter{}) s.Start() defer s.Stop() var err error if _, err = s.Do(&testCommand1{Val: "foo", I: 10}); err != NotLeaderError { t.Fatalf("Expected error: %v, got: %v", NotLeaderError, err) } } //-------------------------------------- // Recovery //-------------------------------------- // Ensure that a follower cannot execute a command. func TestServerRecoverFromPreviousLogAndConf(t *testing.T) { // Initialize the servers. var mutex sync.RWMutex servers := map[string]Server{} transporter := &testTransporter{} transporter.sendVoteRequestFunc = func(s Server, peer *Peer, req *RequestVoteRequest) *RequestVoteResponse { mutex.RLock() target := servers[peer.Name] mutex.RUnlock() b, _ := json.Marshal(req) clonedReq := &RequestVoteRequest{} json.Unmarshal(b, clonedReq) return target.RequestVote(clonedReq) } transporter.sendAppendEntriesRequestFunc = func(s Server, peer *Peer, req *AppendEntriesRequest) *AppendEntriesResponse { mutex.RLock() target := servers[peer.Name] mutex.RUnlock() b, _ := json.Marshal(req) clonedReq := &AppendEntriesRequest{} json.Unmarshal(b, clonedReq) return target.AppendEntries(clonedReq) } disTransporter := &testTransporter{} disTransporter.sendVoteRequestFunc = func(s Server, peer *Peer, req *RequestVoteRequest) *RequestVoteResponse { return nil } disTransporter.sendAppendEntriesRequestFunc = func(s Server, peer *Peer, req *AppendEntriesRequest) *AppendEntriesResponse { return nil } var names []string var paths = make(map[string]string) n := 5 // add n servers for i := 1; i <= n; i++ { names = append(names, strconv.Itoa(i)) } var leader Server for _, name := range names { s := newTestServer(name, transporter) mutex.Lock() servers[name] = s mutex.Unlock() paths[name] = s.Path() if name == "1" { leader = s s.SetHeartbeatInterval(testHeartbeatInterval) s.Start() time.Sleep(testHeartbeatInterval) } else { s.SetElectionTimeout(testElectionTimeout) s.SetHeartbeatInterval(testHeartbeatInterval) s.Start() time.Sleep(testHeartbeatInterval) } if _, err := leader.Do(&DefaultJoinCommand{Name: name}); err != nil { t.Fatalf("Unable to join server[%s]: %v", name, err) } } // commit some commands for i := 0; i < 10; i++ { if _, err := leader.Do(&testCommand2{X: 1}); err != nil { t.Fatalf("cannot commit command: %s", err.Error()) } } time.Sleep(2 * testHeartbeatInterval) for _, name := range names { s := servers[name] if s.CommitIndex() != 16 { t.Fatalf("%s commitIndex is invalid [%d/%d]", name, s.CommitIndex(), 16) } s.Stop() } for _, name := range names { // with old path and disable transportation s := newTestServerWithPath(name, disTransporter, paths[name]) servers[name] = s s.Start() // should only commit to the last join command if s.CommitIndex() != 6 { t.Fatalf("%s recover phase 1 commitIndex is invalid [%d/%d]", name, s.CommitIndex(), 6) } // peer conf should be recovered if len(s.Peers()) != 4 { t.Fatalf("%s recover phase 1 peer failed! [%d/%d]", name, len(s.Peers()), 4) } } // let nodes talk to each other for _, name := range names { servers[name].SetTransporter(transporter) } time.Sleep(2 * testElectionTimeout) // should commit to the previous index + 1(nop command when new leader elected) for _, name := range names { s := servers[name] if s.CommitIndex() != 17 { t.Fatalf("%s commitIndex is invalid [%d/%d]", name, s.CommitIndex(), 17) } s.Stop() } } //-------------------------------------- // Membership //-------------------------------------- // Ensure that we can start a single server and append to its log. func TestServerSingleNode(t *testing.T) { s := newTestServer("1", &testTransporter{}) if s.State() != Stopped { t.Fatalf("Unexpected server state: %v", s.State()) } s.Start() time.Sleep(testHeartbeatInterval) // Join the server to itself. if _, err := s.Do(&DefaultJoinCommand{Name: "1"}); err != nil { t.Fatalf("Unable to join: %v", err) } debugln("finish command") if s.State() != Leader { t.Fatalf("Unexpected server state: %v", s.State()) } s.Stop() if s.State() != Stopped { t.Fatalf("Unexpected server state: %v", s.State()) } } // Ensure that we can start multiple servers and determine a leader. func TestServerMultiNode(t *testing.T) { // Initialize the servers. var mutex sync.RWMutex servers := map[string]Server{} transporter := &testTransporter{} transporter.sendVoteRequestFunc = func(s Server, peer *Peer, req *RequestVoteRequest) *RequestVoteResponse { mutex.RLock() target := servers[peer.Name] mutex.RUnlock() b, _ := json.Marshal(req) clonedReq := &RequestVoteRequest{} json.Unmarshal(b, clonedReq) c := make(chan *RequestVoteResponse) go func() { c <- target.RequestVote(clonedReq) }() select { case resp := <-c: return resp case <-time.After(time.Millisecond * 200): return nil } } transporter.sendAppendEntriesRequestFunc = func(s Server, peer *Peer, req *AppendEntriesRequest) *AppendEntriesResponse { mutex.RLock() target := servers[peer.Name] mutex.RUnlock() b, _ := json.Marshal(req) clonedReq := &AppendEntriesRequest{} json.Unmarshal(b, clonedReq) c := make(chan *AppendEntriesResponse) go func() { c <- target.AppendEntries(clonedReq) }() select { case resp := <-c: return resp case <-time.After(time.Millisecond * 200): return nil } } disTransporter := &testTransporter{} disTransporter.sendVoteRequestFunc = func(s Server, peer *Peer, req *RequestVoteRequest) *RequestVoteResponse { return nil } disTransporter.sendAppendEntriesRequestFunc = func(s Server, peer *Peer, req *AppendEntriesRequest) *AppendEntriesResponse { return nil } var names []string n := 5 // add n servers for i := 1; i <= n; i++ { names = append(names, strconv.Itoa(i)) } var leader Server for _, name := range names { s := newTestServer(name, transporter) defer s.Stop() mutex.Lock() servers[name] = s mutex.Unlock() if name == "1" { leader = s s.SetHeartbeatInterval(testHeartbeatInterval) s.Start() time.Sleep(testHeartbeatInterval) } else { s.SetElectionTimeout(testElectionTimeout) s.SetHeartbeatInterval(testHeartbeatInterval) s.Start() time.Sleep(testHeartbeatInterval) } if _, err := leader.Do(&DefaultJoinCommand{Name: name}); err != nil { t.Fatalf("Unable to join server[%s]: %v", name, err) } } time.Sleep(2 * testElectionTimeout) // Check that two peers exist on leader. mutex.RLock() if leader.MemberCount() != n { t.Fatalf("Expected member count to be %v, got %v", n, leader.MemberCount()) } if servers["2"].State() == Leader || servers["3"].State() == Leader { t.Fatalf("Expected leader should be 1: 2=%v, 3=%v\n", servers["2"].State(), servers["3"].State()) } mutex.RUnlock() for i := 0; i < 20; i++ { retry := 0 fmt.Println("Round ", i) num := strconv.Itoa(i%(len(servers)) + 1) num_1 := strconv.Itoa((i+3)%(len(servers)) + 1) toStop := servers[num] toStop_1 := servers[num_1] // Stop the first server and wait for a re-election. time.Sleep(2 * testElectionTimeout) debugln("Disconnect ", toStop.Name()) debugln("disconnect ", num, " ", num_1) toStop.SetTransporter(disTransporter) toStop_1.SetTransporter(disTransporter) time.Sleep(2 * testElectionTimeout) // Check that either server 2 or 3 is the leader now. //mutex.Lock() leader := 0 for key, value := range servers { debugln("Play begin") if key != num && key != num_1 { if value.State() == Leader { debugln("Found leader") for i := 0; i < 10; i++ { debugln("[Test] do ", value.Name()) if _, err := value.Do(&testCommand2{X: 1}); err != nil { break } debugln("[Test] Done") } debugln("Leader is ", value.Name(), " Index ", value.(*server).log.commitIndex) } debugln("Not Found leader") } } for { for key, value := range servers { if key != num && key != num_1 { if value.State() == Leader { leader++ } debugln(value.Name(), " ", value.(*server).Term(), " ", value.State()) } } if leader > 1 { if retry < 300 { debugln("retry") retry++ leader = 0 time.Sleep(2 * testElectionTimeout) continue } t.Fatalf("wrong leader number %v", leader) } if leader == 0 { if retry < 300 { retry++ fmt.Println("retry 0") leader = 0 time.Sleep(2 * testElectionTimeout) continue } t.Fatalf("wrong leader number %v", leader) } if leader == 1 { break } } //mutex.Unlock() toStop.SetTransporter(transporter) toStop_1.SetTransporter(transporter) } }
jcantrill/origin
Godeps/_workspace/src/github.com/coreos/etcd/third_party/github.com/goraft/raft/server_test.go
GO
apache-2.0
21,354
.tundra .dijitMenu, .tundra .dijitMenuBar { border: 1px solid #7eabcd; margin: 0; padding: 0; background-color: #f7f7f7; } .tundra .dijitMenuTable { border-collapse: separate; border-spacing: 0 0; padding: 0; } .tundra .dijitBorderContainer .dijitMenuBar { border:1px solid #ccc; } .tundra .dijitMenuItem { font-family: sans-serif; margin: 0; } .tundra .dijitMenuItem { padding: 4px 5px; } .tundra .dijitMenuPreviousButton, .tundra .dijitMenuNextButton { font-style: italic; } .tundra .dijitMenuItem td { padding: 2px; } .tundra .dijitMenuPassive .dijitMenuItemHover, .tundra .dijitComboBoxMenu .dijitMenuItemHover, .tundra .dijitMenuItemSelected { background-color: #3559ac; color:#fff; } .tundra .dijitMenuItemIcon { width: 16px; height: 16px; } .tundra .dijitMenuExpand { /* arrow to indicate this MenuItem opens a sub-menu */ width: 7px; height: 7px; background-image: url('images/spriteArrows.png'); background-position: -14px 0; } .dj_ie6 .tundra .dijitMenuExpand { background-image: url('images/spriteArrows.gif'); } /* separator can be two pixels -- set border of either one to 0 to have only one */ .tundra .dijitMenuSeparatorTop { border-bottom: 1px solid #9b9b9b; } .tundra .dijitMenuSeparatorBottom { border-top: 1px solid #e8e8e8; } /* the checked menu item */ .tundra .dijitCheckedMenuItem .dijitMenuItemIcon, .tundra .dijitRadioMenuItem .dijitMenuItemIcon { background-image: url('images/checkmark.png'); background-position: -80px; } .dj_ie6 .tundra .dijitCheckedMenuItem .dijitMenuItemIcon, .dj_ie6 .tundra .dijitRadioMenuItem .dijitMenuItemIcon { background-image: url('images/checkmark.gif'); } .tundra .dijitCheckedMenuItemChecked .dijitMenuItemIcon { background-position: -64px; } .tundra .dijitRadioMenuItem .dijitMenuItemIcon { background-position: -110px; /* 15px * 8 */ } .tundra .dijitRadioMenuItemChecked .dijitMenuItemIcon { background-position: -95px; /* 15px * 7 */ }
maptopixel/WebGL-model-demo
ThirdParty/dojo-release-1.10.4/dijit/themes/tundra/Menu.css
CSS
apache-2.0
1,945
/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package schemamutation import ( "k8s.io/kube-openapi/pkg/validation/spec" ) // Walker runs callback functions on all references of an OpenAPI spec, // replacing the values when visiting corresponding types. type Walker struct { // SchemaCallback will be called on each schema, taking the original schema, // and before any other callbacks of the Walker. // If the schema needs to be mutated, DO NOT mutate it in-place, // always create a copy, mutate, and return it. SchemaCallback func(schema *spec.Schema) *spec.Schema // RefCallback will be called on each ref. // If the ref needs to be mutated, DO NOT mutate it in-place, // always create a copy, mutate, and return it. RefCallback func(ref *spec.Ref) *spec.Ref } type SchemaCallbackFunc func(schema *spec.Schema) *spec.Schema type RefCallbackFunc func(ref *spec.Ref) *spec.Ref var SchemaCallBackNoop SchemaCallbackFunc = func(schema *spec.Schema) *spec.Schema { return schema } var RefCallbackNoop RefCallbackFunc = func(ref *spec.Ref) *spec.Ref { return ref } // ReplaceReferences rewrites the references without mutating the input. // The output might share data with the input. func ReplaceReferences(walkRef func(ref *spec.Ref) *spec.Ref, sp *spec.Swagger) *spec.Swagger { walker := &Walker{RefCallback: walkRef, SchemaCallback: SchemaCallBackNoop} return walker.WalkRoot(sp) } func (w *Walker) WalkSchema(schema *spec.Schema) *spec.Schema { if schema == nil { return nil } orig := schema clone := func() { if orig == schema { schema = &spec.Schema{} *schema = *orig } } // Always run callback on the whole schema first // so that SchemaCallback can take the original schema as input. schema = w.SchemaCallback(schema) if r := w.RefCallback(&schema.Ref); r != &schema.Ref { clone() schema.Ref = *r } definitionsCloned := false for k, v := range schema.Definitions { if s := w.WalkSchema(&v); s != &v { if !definitionsCloned { definitionsCloned = true clone() schema.Definitions = make(spec.Definitions, len(orig.Definitions)) for k2, v2 := range orig.Definitions { schema.Definitions[k2] = v2 } } schema.Definitions[k] = *s } } propertiesCloned := false for k, v := range schema.Properties { if s := w.WalkSchema(&v); s != &v { if !propertiesCloned { propertiesCloned = true clone() schema.Properties = make(map[string]spec.Schema, len(orig.Properties)) for k2, v2 := range orig.Properties { schema.Properties[k2] = v2 } } schema.Properties[k] = *s } } patternPropertiesCloned := false for k, v := range schema.PatternProperties { if s := w.WalkSchema(&v); s != &v { if !patternPropertiesCloned { patternPropertiesCloned = true clone() schema.PatternProperties = make(map[string]spec.Schema, len(orig.PatternProperties)) for k2, v2 := range orig.PatternProperties { schema.PatternProperties[k2] = v2 } } schema.PatternProperties[k] = *s } } allOfCloned := false for i := range schema.AllOf { if s := w.WalkSchema(&schema.AllOf[i]); s != &schema.AllOf[i] { if !allOfCloned { allOfCloned = true clone() schema.AllOf = make([]spec.Schema, len(orig.AllOf)) copy(schema.AllOf, orig.AllOf) } schema.AllOf[i] = *s } } anyOfCloned := false for i := range schema.AnyOf { if s := w.WalkSchema(&schema.AnyOf[i]); s != &schema.AnyOf[i] { if !anyOfCloned { anyOfCloned = true clone() schema.AnyOf = make([]spec.Schema, len(orig.AnyOf)) copy(schema.AnyOf, orig.AnyOf) } schema.AnyOf[i] = *s } } oneOfCloned := false for i := range schema.OneOf { if s := w.WalkSchema(&schema.OneOf[i]); s != &schema.OneOf[i] { if !oneOfCloned { oneOfCloned = true clone() schema.OneOf = make([]spec.Schema, len(orig.OneOf)) copy(schema.OneOf, orig.OneOf) } schema.OneOf[i] = *s } } if schema.Not != nil { if s := w.WalkSchema(schema.Not); s != schema.Not { clone() schema.Not = s } } if schema.AdditionalProperties != nil && schema.AdditionalProperties.Schema != nil { if s := w.WalkSchema(schema.AdditionalProperties.Schema); s != schema.AdditionalProperties.Schema { clone() schema.AdditionalProperties = &spec.SchemaOrBool{Schema: s, Allows: schema.AdditionalProperties.Allows} } } if schema.AdditionalItems != nil && schema.AdditionalItems.Schema != nil { if s := w.WalkSchema(schema.AdditionalItems.Schema); s != schema.AdditionalItems.Schema { clone() schema.AdditionalItems = &spec.SchemaOrBool{Schema: s, Allows: schema.AdditionalItems.Allows} } } if schema.Items != nil { if schema.Items.Schema != nil { if s := w.WalkSchema(schema.Items.Schema); s != schema.Items.Schema { clone() schema.Items = &spec.SchemaOrArray{Schema: s} } } else { itemsCloned := false for i := range schema.Items.Schemas { if s := w.WalkSchema(&schema.Items.Schemas[i]); s != &schema.Items.Schemas[i] { if !itemsCloned { clone() schema.Items = &spec.SchemaOrArray{ Schemas: make([]spec.Schema, len(orig.Items.Schemas)), } itemsCloned = true copy(schema.Items.Schemas, orig.Items.Schemas) } schema.Items.Schemas[i] = *s } } } } return schema } func (w *Walker) walkParameter(param *spec.Parameter) *spec.Parameter { if param == nil { return nil } orig := param cloned := false clone := func() { if !cloned { cloned = true param = &spec.Parameter{} *param = *orig } } if r := w.RefCallback(&param.Ref); r != &param.Ref { clone() param.Ref = *r } if s := w.WalkSchema(param.Schema); s != param.Schema { clone() param.Schema = s } if param.Items != nil { if r := w.RefCallback(&param.Items.Ref); r != &param.Items.Ref { param.Items.Ref = *r } } return param } func (w *Walker) walkParameters(params []spec.Parameter) ([]spec.Parameter, bool) { if params == nil { return nil, false } orig := params cloned := false clone := func() { if !cloned { cloned = true params = make([]spec.Parameter, len(params)) copy(params, orig) } } for i := range params { if s := w.walkParameter(&params[i]); s != &params[i] { clone() params[i] = *s } } return params, cloned } func (w *Walker) walkResponse(resp *spec.Response) *spec.Response { if resp == nil { return nil } orig := resp cloned := false clone := func() { if !cloned { cloned = true resp = &spec.Response{} *resp = *orig } } if r := w.RefCallback(&resp.Ref); r != &resp.Ref { clone() resp.Ref = *r } if s := w.WalkSchema(resp.Schema); s != resp.Schema { clone() resp.Schema = s } return resp } func (w *Walker) walkResponses(resps *spec.Responses) *spec.Responses { if resps == nil { return nil } orig := resps cloned := false clone := func() { if !cloned { cloned = true resps = &spec.Responses{} *resps = *orig } } if r := w.walkResponse(resps.ResponsesProps.Default); r != resps.ResponsesProps.Default { clone() resps.Default = r } responsesCloned := false for k, v := range resps.ResponsesProps.StatusCodeResponses { if r := w.walkResponse(&v); r != &v { if !responsesCloned { responsesCloned = true clone() resps.ResponsesProps.StatusCodeResponses = make(map[int]spec.Response, len(orig.StatusCodeResponses)) for k2, v2 := range orig.StatusCodeResponses { resps.ResponsesProps.StatusCodeResponses[k2] = v2 } } resps.ResponsesProps.StatusCodeResponses[k] = *r } } return resps } func (w *Walker) walkOperation(op *spec.Operation) *spec.Operation { if op == nil { return nil } orig := op cloned := false clone := func() { if !cloned { cloned = true op = &spec.Operation{} *op = *orig } } parametersCloned := false for i := range op.Parameters { if s := w.walkParameter(&op.Parameters[i]); s != &op.Parameters[i] { if !parametersCloned { parametersCloned = true clone() op.Parameters = make([]spec.Parameter, len(orig.Parameters)) copy(op.Parameters, orig.Parameters) } op.Parameters[i] = *s } } if r := w.walkResponses(op.Responses); r != op.Responses { clone() op.Responses = r } return op } func (w *Walker) walkPathItem(pathItem *spec.PathItem) *spec.PathItem { if pathItem == nil { return nil } orig := pathItem cloned := false clone := func() { if !cloned { cloned = true pathItem = &spec.PathItem{} *pathItem = *orig } } if p, changed := w.walkParameters(pathItem.Parameters); changed { clone() pathItem.Parameters = p } if op := w.walkOperation(pathItem.Get); op != pathItem.Get { clone() pathItem.Get = op } if op := w.walkOperation(pathItem.Head); op != pathItem.Head { clone() pathItem.Head = op } if op := w.walkOperation(pathItem.Delete); op != pathItem.Delete { clone() pathItem.Delete = op } if op := w.walkOperation(pathItem.Options); op != pathItem.Options { clone() pathItem.Options = op } if op := w.walkOperation(pathItem.Patch); op != pathItem.Patch { clone() pathItem.Patch = op } if op := w.walkOperation(pathItem.Post); op != pathItem.Post { clone() pathItem.Post = op } if op := w.walkOperation(pathItem.Put); op != pathItem.Put { clone() pathItem.Put = op } return pathItem } func (w *Walker) walkPaths(paths *spec.Paths) *spec.Paths { if paths == nil { return nil } orig := paths cloned := false clone := func() { if !cloned { cloned = true paths = &spec.Paths{} *paths = *orig } } pathsCloned := false for k, v := range paths.Paths { if p := w.walkPathItem(&v); p != &v { if !pathsCloned { pathsCloned = true clone() paths.Paths = make(map[string]spec.PathItem, len(orig.Paths)) for k2, v2 := range orig.Paths { paths.Paths[k2] = v2 } } paths.Paths[k] = *p } } return paths } func (w *Walker) WalkRoot(swagger *spec.Swagger) *spec.Swagger { if swagger == nil { return nil } orig := swagger cloned := false clone := func() { if !cloned { cloned = true swagger = &spec.Swagger{} *swagger = *orig } } parametersCloned := false for k, v := range swagger.Parameters { if p := w.walkParameter(&v); p != &v { if !parametersCloned { parametersCloned = true clone() swagger.Parameters = make(map[string]spec.Parameter, len(orig.Parameters)) for k2, v2 := range orig.Parameters { swagger.Parameters[k2] = v2 } } swagger.Parameters[k] = *p } } responsesCloned := false for k, v := range swagger.Responses { if r := w.walkResponse(&v); r != &v { if !responsesCloned { responsesCloned = true clone() swagger.Responses = make(map[string]spec.Response, len(orig.Responses)) for k2, v2 := range orig.Responses { swagger.Responses[k2] = v2 } } swagger.Responses[k] = *r } } definitionsCloned := false for k, v := range swagger.Definitions { if s := w.WalkSchema(&v); s != &v { if !definitionsCloned { definitionsCloned = true clone() swagger.Definitions = make(spec.Definitions, len(orig.Definitions)) for k2, v2 := range orig.Definitions { swagger.Definitions[k2] = v2 } } swagger.Definitions[k] = *s } } if swagger.Paths != nil { if p := w.walkPaths(swagger.Paths); p != swagger.Paths { clone() swagger.Paths = p } } return swagger }
mahak/kubernetes
vendor/k8s.io/kube-openapi/pkg/schemamutation/walker.go
GO
apache-2.0
11,949