//>>built define("dojox/charting/widget/SelectableLegend",["dojo/_base/lang","dojo/_base/array","dojo/_base/declare","dojo/query","dojo/_base/html","dojo/_base/connect","dojo/_base/Color","./Legend","dijit/form/CheckBox","../action2d/Highlight","dojox/lang/functional","dojox/gfx/fx","dojo/keys","dojo/_base/event","dojo/dom-construct","dojo/dom-prop"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,df,fx,_b,_c,_d,_e){ var _f=_3(null,{constructor:function(_10){ this.legend=_10; this.index=0; this.horizontalLength=this._getHrizontalLength(); _2.forEach(_10.legends,function(_11,i){ if(i>0){ _4("input",_11).attr("tabindex",-1); } }); this.firstLabel=_4("input",_10.legends[0])[0]; _6.connect(this.firstLabel,"focus",this,function(){ this.legend.active=true; }); _6.connect(this.legend.domNode,"keydown",this,"_onKeyEvent"); },_getHrizontalLength:function(){ var _12=this.legend.horizontal; if(typeof _12=="number"){ return Math.min(_12,this.legend.legends.length); }else{ if(!_12){ return 1; }else{ return this.legend.legends.length; } } },_onKeyEvent:function(e){ if(!this.legend.active){ return; } if(e.keyCode==_b.TAB){ this.legend.active=false; return; } var max=this.legend.legends.length; switch(e.keyCode){ case _b.LEFT_ARROW: this.index--; if(this.index<0){ this.index+=max; } break; case _b.RIGHT_ARROW: this.index++; if(this.index>=max){ this.index-=max; } break; case _b.UP_ARROW: if(this.index-this.horizontalLength>=0){ this.index-=this.horizontalLength; } break; case _b.DOWN_ARROW: if(this.index+this.horizontalLength