/*!
 * Name          : steelseries.js
 * Authors       : Gerrit Grunwald, Mark Crossley
 * Last modified : 17.05.2013
 * Revision      : 0.14.3
 *
 * Copyright (c) 2011, Gerrit Grunwald, Mark Crossley
 * All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without modification, are permitted
 *  provided that the following conditions are met:
 *
 *  # Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
 *  # 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.
 *
 *   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.
 */
var steelseries=function(){function h(n,t){var i="#"===n.charAt(0)?n.substring(1,7):n,r=parseInt(i.substring(0,2),16),u=parseInt(i.substring(2,4),16),f=parseInt(i.substring(4,6),16);return this.color="rgba("+r+","+u+","+f+","+t+")",this}function ri(t,i,r,u,f){var c=1/255,e=t.getRed(),o=t.getGreen(),s=t.getBlue(),h=t.getAlpha(),p=i.getRed()-e,w=i.getGreen()-o,b=i.getBlue()-s,k=i.getAlpha()*c-h*c,l=p/r*u,a=w/r*u,v=b/r*u,y=k/r*u;return f=f||!1,f?[(e+l).toFixed(0),(o+a).toFixed(0),(s+v).toFixed(0),h+y]:new n((e+l).toFixed(0),(o+a).toFixed(0),(s+v).toFixed(0),h+y)}function br(n,t,i){return{start:n,stop:t,color:i}}function y(n,t){var r=Math.floor(Math.log10(n)),i=n/Math.pow(10,r),u;return u=t?1.5>i?1:3>i?2:7>i?5:10:1>=i?1:2>=i?2:5>=i?5:10,u*Math.pow(10,r)}function v(n,t,i,r,u,f){var e=t+r,o=i+u;n.beginPath(),n.moveTo(t+f,i),n.lineTo(e-f,i),n.quadraticCurveTo(e,i,e,i+f),n.lineTo(e,i+u-f),n.quadraticCurveTo(e,o,e-f,o),n.lineTo(t+f,o),n.quadraticCurveTo(t,o,t,o-f),n.lineTo(t,i+f),n.quadraticCurveTo(t,i,t+f,i),n.closePath(),n.stroke()}function t(n,t){var i=f.createElement("canvas");return i.width=n,i.height=t,i}function oi(n,t,i){var r=f.createElement("canvas");return r.width=n,r.height=t,i(r.getContext("2d")),r}function ht(n){var t,i=oi(1,1,function(t){t.fillStyle=n,t.beginPath(),t.rect(0,0,1,1),t.fill()});return t=i.getContext("2d").getImageData(0,0,2,2).data,[t[0],t[1],t[2],t[3]]}function dt(t){var u,f,e,o,s,r=ht(t),i=new n(r[0],r[1],r[2],r[3]);return u=pi(i,.32),f=pi(i,.62),e=si(i,.84),o=si(i,.94),s=si(i,1),new tt(u,f,i,e,o,s)}function kr(n,t,i){var u,r,f,o,s,e;if(n/=255,t/=255,i/=255,r=Math.max(n,t,i),u=Math.min(n,t,i),s=(r+u)/2,r===u)f=o=0;else{e=r-u,o=s>.5?e/(2-r-u):e/(r+u);switch(r){case n:f=(t-i)/e+(t<i?6:0);break;case t:f=(i-n)/e+2;break;case i:f=(n-t)/e+4}f/=6}return[f,o,s]}function wt(n,t,i){var r,u,f,h=Math.floor(n*6),c=n*6-h,e=i*(1-t),o=i*(1-c*t),s=i*(1-(1-c)*t);switch(h%6){case 0:r=i,u=s,f=e;break;case 1:r=o,u=i,f=e;break;case 2:r=e,u=i,f=s;break;case 3:r=e,u=o,f=i;break;case 4:r=s,u=e,f=i;break;case 5:r=i,u=e,f=o}return[Math.floor(r*255),Math.floor(u*255),Math.floor(f*255)]}function yt(n,t,i){var e,r,u,o,s,f;if(n=n/255,t=t/255,i=i/255,r=Math.max(n,t,i),e=Math.min(n,t,i),s=r,f=r-e,o=r===0?0:f/r,r===e)u=0;else{switch(r){case n:u=(t-i)/f+(t<i?6:0);break;case t:u=(i-n)/f+2;break;case i:u=(n-t)/f+4}u/=6}return[u,o,s]}function it(n,t){return n<0?0:n>t?t:n}function pi(t,i){var r=Math.floor(t.getRed()*(1-i)),u=Math.floor(t.getGreen()*(1-i)),f=Math.floor(t.getBlue()*(1-i));return r=it(r,255),u=it(u,255),f=it(f,255),new n(r,u,f,t.getAlpha())}function si(t,i){var r=Math.round(t.getRed()*(1+i)),u=Math.round(t.getGreen()*(1+i)),f=Math.round(t.getBlue()*(1+i));return r=it(r,255),u=it(u,255),f=it(f,255),new n(r,u,f,t.getAlpha())}function dr(n,t,i){var r,u;if(i<=t)throw"Rotary bounds are of negative or zero size";return r=i-t,u=Math.floor((n-t)/r),n-u*r}function hi(n,t){return dr(t-n,-180,180)}var i=Math.PI*.5,r=Math.PI*2,e=Math.PI,u=Math.PI/180,ti=180/Math.PI,f=document,ft="LCDMono2Ultra,Arial,Verdana,sans-serif",o="Arial,Verdana,sans-serif",di=function(n,h){var vi;h=h||{};var yt=undefined===h.gaugeType?steelseries.GaugeType.TYPE4:h.gaugeType,c=undefined===h.size?0:h.size,p=undefined===h.minValue?0:h.minValue,it=undefined===h.maxValue?p+100:h.maxValue,ae=undefined===h.niceScale?!0:h.niceScale,gt=undefined===h.threshold?(it-p)/2+p:h.threshold,ti=undefined===h.thresholdRising?!0:h.thresholdRising,hi=undefined===h.section?null:h.section,ci=undefined===h.area?null:h.area,au=undefined===h.titleString?"":h.titleString,vu=undefined===h.unitString?"":h.unitString,yu=undefined===h.frameDesign?steelseries.FrameDesign.METAL:h.frameDesign,pu=undefined===h.frameVisible?!0:h.frameVisible,li=undefined===h.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:h.backgroundColor,wu=undefined===h.backgroundVisible?!0:h.backgroundVisible,ei=undefined===h.pointerType?steelseries.PointerType.TYPE1:h.pointerType,bu=undefined===h.pointerColor?steelseries.ColorDef.RED:h.pointerColor,ve=undefined===h.knobType?steelseries.KnobType.STANDARD_KNOB:h.knobType,ai=undefined===h.knobStyle?steelseries.KnobStyle.SILVER:h.knobStyle,bi=undefined===h.lcdColor?steelseries.LcdColor.STANDARD:h.lcdColor,tu=undefined===h.lcdVisible?!0:h.lcdVisible,ku=undefined===h.lcdDecimals?2:h.lcdDecimals,ye=undefined===h.digitalFont?!1:h.digitalFont,du=undefined===h.fractionalScaleDecimals?1:h.fractionalScaleDecimals,iu=undefined===h.ledColor?steelseries.LedColor.RED_LED:h.ledColor,ru=undefined===h.ledVisible?!0:h.ledVisible,uu=undefined===h.userLedColor?steelseries.LedColor.GREEN_LED:h.userLedColor,fu=undefined===h.userLedVisible?!1:h.userLedVisible,gu=undefined===h.thresholdVisible?!0:h.thresholdVisible,eu=undefined===h.minMeasuredValueVisible?!1:h.minMeasuredValueVisible,ou=undefined===h.maxMeasuredValueVisible?!1:h.maxMeasuredValueVisible,nf=undefined===h.foregroundType?steelseries.ForegroundType.TYPE1:h.foregroundType,tf=undefined===h.foregroundVisible?!0:h.foregroundVisible,rf=undefined===h.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:h.labelNumberFormat,ir=undefined===h.playAlarm?!1:h.playAlarm,uf=undefined===h.alarmSound?!1:h.alarmSound,pe=undefined===h.customLayer?null:h.customLayer,we=undefined===h.tickLabelOrientation?yt===steelseries.GaugeType.TYPE1?steelseries.TickLabelOrientation.TANGENT:steelseries.TickLabelOrientation.NORMAL:h.tickLabelOrientation,su=undefined===h.trendVisible?!1:h.trendVisible,cr=undefined===h.trendColors?[steelseries.LedColor.RED_LED,steelseries.LedColor.GREEN_LED,steelseries.LedColor.CYAN_LED]:h.trendColors,lr=undefined===h.useOdometer?!1:h.useOdometer,oi=undefined===h.odometerParams?{}:h.odometerParams,be=undefined===h.odometerUseValue?!1:h.odometerUseValue,ff=undefined===h.fullScaleDeflectionTime?2.5:h.fullScaleDeflectionTime,v=f.getElementById(n).getContext("2d");c===0&&(c=Math.min(v.canvas.width,v.canvas.height)),v.canvas.width=c,v.canvas.height=c,ir&&uf!==!1&&(vi=f.createElement("audio"),vi.setAttribute("src",uf),vi.setAttribute("preload","auto"));var tt=p,ar=p,ef=this,yi=it,pi=p,et=!1,vr=!1,of=0,hu=0,ki,wi=!1,sf=steelseries.TrendState.OFF,yr=c*.06,pr=c*.29,wr=c*.36,di,wt,br,bt,kt,cu=wt+(tt-p)*kt,b=c,ut=c,ct=b/2,at=ut/2,ii=c*.093457,ke=.6*b,de=.4*ut,ge=yt===steelseries.GaugeType.TYPE3?.6*b:ct-ii/2,no=yt===steelseries.GaugeType.TYPE3?.72*ut:.75*ut,lu=Math.floor(b/10),to=lu+"px "+o,io=lu+"px "+ft,hf=ut*.13,rr=b*.4,cf=(b-rr)/2,lf=ut*.57,af,ro=ut*.61,vf=b*.006,yf=!1,kr=p,dr=it,ur=it-p,ri=dr-kr,gr=0,ui=0,gi=10,pf=10,uo=function(){ae?(ur=y(it-p,!1),ui=y(ur/(pf-1),!0),kr=Math.floor(p/ui)*ui,dr=Math.ceil(it/ui)*ui,gr=y(ui/(gi-1),!0),p=kr,it=dr,ri=it-p):(ur=it-p,kr=p,dr=it,ri=ur,ui=y(ur/(pf-1),!0),gr=y(ui/(gi-1),!0));switch(yt.type){case"type1":di=0,wt=e,br=i,bt=i,kt=bt/ri;break;case"type2":di=0,wt=e,br=i,bt=e,kt=bt/ri;break;case"type3":di=0,wt=i,br=0,bt=1.5*e,kt=bt/ri;break;case"type4":default:di=60*u,wt=i+di/2,br=0,bt=r-di,kt=bt/ri}cu=wt+(tt-p)*kt},fr=t(c,c),wf=fr.getContext("2d"),er=t(c,c),vt=er.getContext("2d"),bf,nr=t(ii,ii),kf=nr.getContext("2d"),si=t(ii,ii),df=si.getContext("2d"),tr=si,fi=t(ii,ii),gf=fi.getContext("2d"),ni=t(ii,ii),ne=ni.getContext("2d"),dt=ni,te=t(Math.ceil(c*.028037),Math.ceil(c*.028037)),fo=te.getContext("2d"),ie=t(Math.ceil(c*.028037),Math.ceil(c*.028037)),eo=ie.getContext("2d"),or=t(c,c),re=or.getContext("2d"),sr=t(c,c),ue=sr.getContext("2d"),fe,ee,oe,se,he,nu,ce;lr&&tu&&(nu=t(10,10),ce=nu.getContext("2d"));var oo=function(n,t){n.restore(),n.save(),n.textAlign="right",n.strokeStyle=bi.textColor,n.fillStyle=bi.textColor,(bi===steelseries.LcdColor.STANDARD||bi===steelseries.LcdColor.STANDARD_GREEN)&&(n.shadowColor="gray",n.shadowOffsetX=b*.007,n.shadowOffsetY=b*.007,n.shadowBlur=b*.007),n.font=ye?io:to,n.fillText(t.toFixed(ku),cf+rr-rr*.05,lf+hf*.5+lu*.38,rr*.9),n.restore()},so=function(n){n.save(),"type1"===yt.type&&n.drawImage(a(Math.ceil(ut*.037383),steelseries.KnobType.STANDARD_KNOB,ai),b*.523364,ut*.130841),("type1"===yt.type||"type2"===yt.type)&&n.drawImage(a(Math.ceil(ut*.037383),steelseries.KnobType.STANDARD_KNOB,ai),b*.130841,ut*.514018),("type2"===yt.type||"type3"===yt.type)&&n.drawImage(a(Math.ceil(ut*.037383),steelseries.KnobType.STANDARD_KNOB,ai),b*.831775,ut*.514018),"type3"===yt.type&&n.drawImage(a(Math.ceil(ut*.037383),steelseries.KnobType.STANDARD_KNOB,ai),b*.523364,ut*.831775),"type4"===yt.type&&(n.drawImage(a(Math.ceil(ut*.037383),steelseries.KnobType.STANDARD_KNOB,ai),b*.336448,ut*.803738),n.drawImage(a(Math.ceil(ut*.037383),steelseries.KnobType.STANDARD_KNOB,ai),b*.626168,ut*.803738)),n.restore()},ho=function(){var t=f.createElement("canvas"),n,i;return t.width=Math.ceil(c*.046728),t.height=Math.ceil(t.width*.9),n=t.getContext("2d"),n.save(),i=n.createLinearGradient(0,.1,0,t.height*.9),i.addColorStop(0,"#520000"),i.addColorStop(.3,"#fc1d00"),i.addColorStop(.59,"#fc1d00"),i.addColorStop(1,"#520000"),n.fillStyle=i,n.beginPath(),n.moveTo(t.width*.5,.1),n.lineTo(t.width*.9,t.height*.9),n.lineTo(t.width*.1,t.height*.9),n.lineTo(t.width*.5,.1),n.closePath(),n.fill(),n.strokeStyle="#FFFFFF",n.stroke(),n.restore(),t},le=function(n,t,i,r,u){if(t<p?t=p:t>it&&(t=it),i<p?i=p:i>it&&(i=it),!(t>=i)){n.save(),n.strokeStyle=r,n.fillStyle=r,n.lineWidth=b*.035;var f=bt/ri*t-bt/ri*p,e=f+(i-t)/(ri/bt);n.translate(ct,at),n.rotate(wt),n.beginPath(),u?(n.moveTo(0,0),n.arc(0,0,b*.365-n.lineWidth/2,f,e,!1)):n.arc(0,0,b*.365,f,e,!1),u?(n.moveTo(0,0),n.fill()):n.stroke(),n.translate(-ct,-at),n.restore()}},co=function(n,t){var y=Math.ceil(b*.04),f=wt,r=kt*gr,u,s=p,h=gi-1,l=b*.38,w=b*.35,k=b*.355,d=b*.36,v=b*.3,c=b*.1,g=gi/2,nt=parseFloat(it.toFixed(2)),a;for(li.labelColor.setAlpha(1),n.save(),n.textAlign="center",n.textBaseline="middle",n.font=y+"px"+o,n.strokeStyle=li.labelColor.getRgbaColor(),n.fillStyle=li.labelColor.getRgbaColor(),n.translate(ct,at),n.rotate(wt),(yt.type==="type1"||yt.type==="type2")&&(c=b*.04),a=p;parseFloat(a.toFixed(2))<=nt;a+=gr){if(u=r+i,h++,h===gi){n.lineWidth=1.5,n.beginPath(),n.moveTo(l,0),n.lineTo(w,0),n.closePath(),n.stroke(),n.save(),n.translate(v,0);switch(we.type){case"horizontal":u=-f;break;case"tangent":u=f<=i+e?e:0;break;case"normal":default:u=i}n.rotate(u);switch(t.format){case"fractional":n.fillText(s.toFixed(du),0,0,c);break;case"scientific":n.fillText(s.toPrecision(2),0,0,c);break;case"standard":default:n.fillText(s.toFixed(0),0,0,c)}n.translate(-v,0),n.restore(),s+=ui,h=0,n.rotate(r),f+=r;continue}0==gi%2&&h===g?(n.lineWidth=1,n.beginPath(),n.moveTo(l,0),n.lineTo(k,0),n.closePath(),n.stroke()):(n.lineWidth=.5,n.beginPath(),n.moveTo(l,0),n.lineTo(d,0),n.closePath(),n.stroke()),n.rotate(r),f+=r}n.translate(-ct,-at),n.restore()},ht=function(n){var t,r,f;n=n||{};var e=undefined===n.frame?!1:n.frame,u=undefined===n.background?!1:n.background,o=undefined===n.led?!1:n.led,h=undefined===n.userLed?!1:n.userLed,l=undefined===n.pointer?!1:n.pointer,a=undefined===n.foreground?!1:n.foreground,v=undefined===n.trend?!1:n.trend,y=undefined===n.odo?!1:n.odo;if(yf=!0,uo(),e&&pu&&k(wf,yu,ct,at,b,ut),u&&wu&&(g(vt,li,ct,at,b,ut),st(vt,pe,ct,at,b,ut)),o&&(kf.drawImage(s(Math.ceil(c*.093457),1,iu),0,0),df.drawImage(s(Math.ceil(c*.093457),0,iu),0,0)),h&&(gf.drawImage(s(Math.ceil(c*.093457),1,uu),0,0),ne.drawImage(s(Math.ceil(c*.093457),0,uu),0,0)),eu&&fo.drawImage(w(Math.ceil(c*.028037),steelseries.ColorDef.BLUE.dark.getRgbaColor(),!0,!0),0,0),ou&&eo.drawImage(w(Math.ceil(c*.028037),steelseries.ColorDef.RED.medium.getRgbaColor(),!0),0,0),u&&wu){if(so(vt),null!==hi&&0<hi.length){t=hi.length;do t--,le(vt,hi[t].start,hi[t].stop,hi[t].color,!1);while(0<t)}if(null!==ci&&0<ci.length){r=ci.length;do r--,le(vt,ci[r].start,ci[r].stop,ci[r].color,!0);while(0<r)}co(vt,rf),pt(vt,b,ut,au,vu,li,!0,!0)}u&&gu&&(vt.save(),vt.translate(ct,at),vt.rotate(wt+(gt-p)*kt+i),vt.translate(-ct,-at),vt.drawImage(ho(),b*.475,ut*.13),vt.translate(ct,at),vt.restore()),u&&tu&&(lr&&y?(he=new steelseries.Odometer("",{_context:ce,height:c*.075,decimals:oi.decimals,digits:oi.digits===undefined?5:oi.digits,valueForeColor:oi.valueForeColor,valueBackColor:oi.valueBackColor,decimalForeColor:oi.decimalForeColor,decimalBackColor:oi.decimalBackColor,font:oi.font,value:tt}),af=(b-nu.width)/2):lr||(bf=nt(rr,hf,bi),vt.drawImage(bf,cf,lf))),l&&ot(re,b,ei,bu,li.labelColor),a&&tf&&(f=ei.type==="type15"||ei.type==="type16"?!1:!0,d(ue,nf,b,ut,f,ve,ai,yt)),v&&su&&(fe=rt(yr,steelseries.TrendState.UP,cr),ee=rt(yr,steelseries.TrendState.STEADY,cr),oe=rt(yr,steelseries.TrendState.DOWN,cr),se=rt(yr,steelseries.TrendState.OFF,cr))},lt=function(n){n=n||{};var t=undefined===n.frame?!1:n.frame,i=undefined===n.background?!1:n.background,r=undefined===n.led?!1:n.led,u=undefined===n.userLed?!1:n.userLed,f=undefined===n.pointer?!1:n.pointer,e=undefined===n.foreground?!1:n.foreground;t&&(fr.width=c,fr.height=c,wf=fr.getContext("2d")),i&&(er.width=c,er.height=c,vt=er.getContext("2d")),r&&(nr.width=Math.ceil(c*.093457),nr.height=Math.ceil(c*.093457),kf=nr.getContext("2d"),si.width=Math.ceil(c*.093457),si.height=Math.ceil(c*.093457),df=si.getContext("2d"),tr=si),u&&(fi.width=Math.ceil(c*.093457),fi.height=Math.ceil(c*.093457),gf=fi.getContext("2d"),ni.width=Math.ceil(c*.093457),ni.height=Math.ceil(c*.093457),ne=ni.getContext("2d"),dt=ni),f&&(or.width=c,or.height=c,re=or.getContext("2d")),e&&(sr.width=c,sr.height=c,ue=sr.getContext("2d"))},lo=function(){ru&&(tr=tr===nr?si:nr,wi||(wi=!0,l(ef.repaint)))},ao=function(){fu&&(dt=dt===fi?ni:fi,wi||(wi=!0,l(ef.repaint)))},hr=function(n){n?of=setInterval(lo,1e3):(clearInterval(of),tr=si)},vo=function(n){n?hu=setInterval(ao,1e3):(clearInterval(hu),dt=ni)};return this.setValue=function(n){n=parseFloat(n);var t=n<p?p:n>it?it:n;return tt!==t&&(tt=t,tt>pi&&(pi=tt),tt<yi&&(yi=tt),tt>=gt&&!et&&ti||tt<=gt&&!et&&!ti?(et=!0,hr(et),ir&&vi.play()):(tt<gt&&et&&ti||tt>gt&&et&&!ti)&&(et=!1,hr(et),ir&&vi.pause()),this.repaint()),this},this.getValue=function(){return tt},this.setOdoValue=function(n){n=parseFloat(n);var t=n<0?0:n;return ar!==t&&(ar=t,this.repaint()),this},this.getOdoValue=function(){return ar},this.setValueAnimated=function(n){n=parseFloat(n);var i=n<p?p:n>it?it:n,r=this,t;return tt!==i&&(undefined!==ki&&ki.isPlaying&&ki.stop(),t=ff*Math.abs(i-tt)/(it-p),t=Math.max(t,ff/5),ki=new Tween({},"",Tween.regularEaseInOut,tt,i,t),ki.onMotionChanged=function(n){tt=n.target._pos,tt>=gt&&!et&&ti||tt<=gt&&!et&&!ti?(et=!0,hr(et),ir&&vi.play()):(tt<gt&&et&&ti||tt>gt&&et&&!ti)&&(et=!1,hr(et),ir&&vi.pause()),tt>pi&&(pi=tt),tt<yi&&(yi=tt),wi||(wi=!0,l(r.repaint))},ki.start()),this},this.resetMinMeasuredValue=function(){yi=tt,this.repaint()},this.resetMaxMeasuredValue=function(){return pi=tt,this.repaint(),this},this.setMinMeasuredValueVisible=function(n){return eu=!!n,this.repaint(),this},this.setMaxMeasuredValueVisible=function(n){return ou=!!n,this.repaint(),this},this.setMaxMeasuredValue=function(n){n=parseFloat(n);var t=n<p?p:n>it?it:n;return pi=t,this.repaint(),this},this.setMinMeasuredValue=function(n){n=parseFloat(n);var t=n<p?p:n>it?it:n;return yi=t,this.repaint(),this},this.setTitleString=function(n){return au=n,lt({background:!0}),ht({background:!0}),this.repaint(),this},this.setUnitString=function(n){return vu=n,lt({background:!0}),ht({background:!0}),this.repaint(),this},this.setMinValue=function(n){return p=parseFloat(n),lt({frame:!0,background:!0}),ht({frame:!0,background:!0}),this.repaint(),this},this.getMinValue=function(){return p},this.setMaxValue=function(n){return it=parseFloat(n),lt({frame:!0,background:!0}),ht({frame:!0,background:!0}),this.repaint(),this},this.getMaxValue=function(){return it},this.setThreshold=function(n){n=parseFloat(n);var t=n<p?p:n>it?it:n;return gt=t,lt({background:!0}),ht({background:!0}),this.repaint(),this},this.setArea=function(n){return ci=n,lt({background:!0,foreground:!0}),ht({background:!0,foreground:!0}),this.repaint(),this},this.setSection=function(n){return hi=n,lt({background:!0,foreground:!0}),ht({background:!0,foreground:!0}),this.repaint(),this},this.setThresholdVisible=function(n){return gu=!!n,this.repaint(),this},this.setThresholdRising=function(n){return ti=!!n,et=!et,hr(et),this.repaint(),this},this.setLcdDecimals=function(n){return ku=parseInt(n,10),this.repaint(),this},this.setFrameDesign=function(n){return lt({frame:!0}),yu=n,ht({frame:!0}),this.repaint(),this},this.setBackgroundColor=function(n){return lt({background:!0,pointer:ei.type==="type2"||ei.type==="type13"?!0:!1}),li=n,ht({background:!0,pointer:ei.type==="type2"||ei.type==="type13"?!0:!1}),this.repaint(),this},this.setForegroundType=function(n){return lt({foreground:!0}),nf=n,ht({foreground:!0}),this.repaint(),this},this.setPointerType=function(n){return lt({pointer:!0,foreground:!0}),ei=n,ht({pointer:!0,foreground:!0}),this.repaint(),this},this.setPointerColor=function(n){return lt({pointer:!0}),bu=n,ht({pointer:!0}),this.repaint(),this},this.setLedColor=function(n){return lt({led:!0}),iu=n,ht({led:!0}),this.repaint(),this},this.setUserLedColor=function(n){return lt({userLed:!0}),uu=n,ht({userLed:!0}),this.repaint(),this},this.toggleUserLed=function(){return dt=dt===fi?ni:fi,this.repaint(),this},this.setUserLedOnOff=function(n){return dt=!0===n?fi:ni,this.repaint(),this},this.blinkUserLed=function(n){return n?vr||(vo(!0),vr=!0):vr&&(clearInterval(hu),vr=!1),this},this.setLedVisible=function(n){return ru=!!n,this.repaint(),this},this.setUserLedVisible=function(n){return fu=!!n,this.repaint(),this},this.setLcdColor=function(n){return bi=n,lt({background:!0}),ht({background:!0}),this.repaint(),this},this.setTrend=function(n){return sf=n,this.repaint(),this},this.setTrendVisible=function(n){return su=!!n,this.repaint(),this},this.setFractionalScaleDecimals=function(n){return du=parseInt(n,10),lt({background:!0}),ht({background:!0}),this.repaint(),this},this.setLabelNumberFormat=function(n){return rf=n,lt({background:!0}),ht({background:!0}),this.repaint(),this},this.repaint=function(){if(yf||ht({frame:!0,background:!0,led:!0,userLed:!0,pointer:!0,trend:!0,foreground:!0,odo:!0}),v.clearRect(0,0,c,c),pu&&v.drawImage(fr,0,0),v.drawImage(er,0,0),tu&&(lr?(he.setValue(be?tt:ar),v.drawImage(nu,af,ro)):oo(v,tt)),ru&&v.drawImage(tr,ke,de),fu&&v.drawImage(dt,ge,no),su)switch(sf.state){case"up":v.drawImage(fe,pr,wr);break;case"steady":v.drawImage(ee,pr,wr);break;case"down":v.drawImage(oe,pr,wr);break;case"off":v.drawImage(se,pr,wr)}eu&&(v.save(),v.translate(ct,at),v.rotate(wt+i+(yi-p)*kt),v.translate(-ct,-at),v.drawImage(te,v.canvas.width*.4865,v.canvas.height*.105),v.restore()),ou&&(v.save(),v.translate(ct,at),v.rotate(wt+i+(pi-p)*kt),v.translate(-ct,-at),v.drawImage(ie,v.canvas.width*.4865,v.canvas.height*.105),v.restore()),cu=wt+i+(tt-p)*kt,v.save(),v.translate(ct,at),v.rotate(cu),v.translate(-ct,-at),v.shadowColor="rgba(0, 0, 0, 0.8)",v.shadowOffsetX=v.shadowOffsetY=vf,v.shadowBlur=vf*2,v.drawImage(or,0,0),v.restore(),tf&&v.drawImage(sr,0,0),wi=!1},this.repaint(),this},gi=function(n,h){var ci;h=h||{};var si=undefined===h.gaugeType?steelseries.GaugeType.TYPE4:h.gaugeType,v=undefined===h.size?0:h.size,c=undefined===h.minValue?0:h.minValue,p=undefined===h.maxValue?c+100:h.maxValue,ie=undefined===h.niceScale?!0:h.niceScale,gt=undefined===h.threshold?(p-c)/2+c:h.threshold,ni=undefined===h.thresholdRising?!0:h.thresholdRising,hi=undefined===h.section?null:h.section,ou=undefined===h.useSectionColors?!1:h.useSectionColors,su=undefined===h.titleString?"":h.titleString,hu=undefined===h.unitString?"":h.unitString,cu=undefined===h.frameDesign?steelseries.FrameDesign.METAL:h.frameDesign,lu=undefined===h.frameVisible?!0:h.frameVisible,ai=undefined===h.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:h.backgroundColor,au=undefined===h.backgroundVisible?!0:h.backgroundVisible,or=undefined===h.valueColor?steelseries.ColorDef.RED:h.valueColor,vi=undefined===h.lcdColor?steelseries.LcdColor.STANDARD:h.lcdColor,vu=undefined===h.lcdVisible?!0:h.lcdVisible,yu=undefined===h.lcdDecimals?2:h.lcdDecimals,re=undefined===h.digitalFont?!1:h.digitalFont,pu=undefined===h.fractionalScaleDecimals?1:h.fractionalScaleDecimals,ue=undefined===h.customLayer?null:h.customLayer,kr=undefined===h.ledColor?steelseries.LedColor.RED_LED:h.ledColor,dr=undefined===h.ledVisible?!0:h.ledVisible,gr=undefined===h.userLedColor?steelseries.LedColor.GREEN_LED:h.userLedColor,nu=undefined===h.userLedVisible?!1:h.userLedVisible,wu=undefined===h.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:h.labelNumberFormat,bu=undefined===h.foregroundType?steelseries.ForegroundType.TYPE1:h.foregroundType,ku=undefined===h.foregroundVisible?!0:h.foregroundVisible,di=undefined===h.playAlarm?!1:h.playAlarm,du=undefined===h.alarmSound?!1:h.alarmSound,gi=undefined===h.valueGradient?null:h.valueGradient,gu=undefined===h.useValueGradient?!1:h.useValueGradient,fe=undefined===h.tickLabelOrientation?si===steelseries.GaugeType.TYPE1?steelseries.TickLabelOrientation.TANGENT:steelseries.TickLabelOrientation.NORMAL:h.tickLabelOrientation,tu=undefined===h.trendVisible?!1:h.trendVisible,sr=undefined===h.trendColors?[steelseries.LedColor.RED_LED,steelseries.LedColor.GREEN_LED,steelseries.LedColor.CYAN_LED]:h.trendColors,nf=undefined===h.fullScaleDeflectionTime?2.5:h.fullScaleDeflectionTime,b=f.getElementById(n).getContext("2d");v===0&&(v=Math.min(b.canvas.width,b.canvas.height)),b.canvas.width=v,b.canvas.height=v,di&&du!==!1&&(ci=f.createElement("audio"),ci.setAttribute("src",du),ci.setAttribute("preload","auto"));var et=c,yt=p-c,it=!1,tf=0,hr=!1,iu=0,yi,rf=this,li=!1,vt,ht,pi,fi,tt,ii,bt,ee,wi=[],cr=!1,ru=!1,a=v,ct=v,ot=a/2,lt=ct/2,uu=Math.floor(a/10),oe=uu+"px "+o,se=uu+"px "+ft,fu=ct*.13,nr=a*.4,uf=(a-nr)/2,ff=ct/2-fu/2,he=a*.116822,ce=a*.485981,w=Math.ceil(v*.093457),ef=a*.53,of=ct*.61,le=si===steelseries.GaugeType.TYPE3?.7*a:ot-w/2,ae=si===steelseries.GaugeType.TYPE3?.61*ct:.75*ct,sf=steelseries.TrendState.OFF,lr=v*.06,ar=v*.38,vr=v*.57;switch(si.type){case"type1":vt=0,ht=e,pi=0,fi=i,tt=i,ii=tt*ti,bt=tt/yt;break;case"type2":vt=0,ht=e,pi=0,fi=i,tt=e,ii=tt*ti,bt=tt/yt;break;case"type3":vt=0,ht=i,pi=-i,fi=0,tt=1.5*e,ii=tt*ti,bt=tt/yt;break;case"type4":default:vt=60*u,ht=i+vt/2,pi=-r/6,fi=0,tt=r-vt,ii=tt*ti,bt=tt/yt}var tr=t(v,v),hf=tr.getContext("2d"),ir=t(v,v),ei=ir.getContext("2d"),cf,rr=t(Math.ceil(v*.060747),Math.ceil(v*.023364)),eu=rr.getContext("2d"),bi=t(w,w),lf=bi.getContext("2d"),oi=t(w,w),af=oi.getContext("2d"),ki=oi,ri=t(w,w),vf=ri.getContext("2d"),kt=t(w,w),yf=kt.getContext("2d"),wt=kt,ve,ur=t(v,v),pf=ur.getContext("2d"),wf,bf,kf,df,gf=!1,yr=c,pr=p,fr=p-c;yt=pr-yr;var wr=0,ui=0,br=10,ne=10,ye=function(){ie?(fr=y(p-c,!1),ui=y(fr/(ne-1),!0),yr=Math.floor(c/ui)*ui,pr=Math.ceil(p/ui)*ui,wr=y(ui/(br-1),!0),c=yr,p=pr,yt=p-c):(fr=p-c,yr=c,pr=p,yt=fr,ui=y(fr/(ne-1),!0),wr=y(ui/(br-1),!0));switch(si.type){case"type1":vt=0,ht=e,fi=i,tt=i,bt=tt/yt;break;case"type2":vt=0,ht=e,fi=i,tt=e,bt=tt/yt;break;case"type3":vt=0,ht=i,fi=0,tt=1.5*e,bt=tt/yt;break;case"type4":default:vt=60*u,ht=i+vt/2,fi=0,tt=r-vt,bt=tt/yt}ee=ht+(et-c)*bt},ut=function(n){var t;n=n||{};var r=undefined===n.frame?!1:n.frame,i=undefined===n.background?!1:n.background,u=undefined===n.led?!1:n.led,f=undefined===n.userLed?!1:n.userLed,e=undefined===n.value?!1:n.value,o=undefined===n.foreground?!1:n.foreground,h=undefined===n.trend?!1:n.trend;if(gf=!0,ye(),r&&lu&&k(hf,cu,ot,lt,a,ct),i&&au&&(g(ei,ai,ot,lt,a,ct),st(ei,ue,ot,lt,a,ct)),u&&(lf.drawImage(s(w,1,kr),0,0),af.drawImage(s(w,0,kr),0,0),ve=ei.getImageData(ef,of,w,w)),f&&(vf.drawImage(s(Math.ceil(w),1,gr),0,0),yf.drawImage(s(Math.ceil(w),0,gr),0,0)),i&&pe(ei),i&&au&&(be(ei,wu),pt(ei,a,ct,su,hu,ai,!0,!0)),i&&vu&&(cf=nt(nr,fu,vi),ei.drawImage(cf,uf,ff)),cr=!1,ou&&null!==hi&&0<hi.length){cr=!0,t=hi.length,wi=[];do t--,wi.push({start:(hi[t].start+Math.abs(c))/(p-c)*ii,stop:(hi[t].stop+Math.abs(c))/(p-c)*ii,color:dt(hi[t].color)});while(0<t)}ru=!1,gu&&gi!==null&&(cr=!1,ru=!0),e&&te(eu,or),o&&ku&&d(pf,bu,a,ct,!1),h&&tu&&(wf=rt(lr,steelseries.TrendState.UP,sr),bf=rt(lr,steelseries.TrendState.STEADY,sr),kf=rt(lr,steelseries.TrendState.DOWN,sr),df=rt(lr,steelseries.TrendState.OFF,sr))},at=function(n){n=n||{};var t=undefined===n.frame?!1:n.frame,i=undefined===n.background?!1:n.background,r=undefined===n.led?!1:n.led,u=undefined===n.userLed?!1:n.userLed,f=undefined===n.value?!1:n.value,e=undefined===n.foreground?!1:n.foreground;t&&(tr.width=v,tr.height=v,hf=tr.getContext("2d")),i&&(ir.width=v,ir.height=v,ei=ir.getContext("2d")),f&&(rr.width=Math.ceil(v*.060747),rr.height=Math.ceil(v*.023364),eu=rr.getContext("2d")),r&&(bi.width=Math.ceil(w),bi.height=Math.ceil(w),lf=bi.getContext("2d"),oi.width=Math.ceil(w),oi.height=Math.ceil(w),af=oi.getContext("2d"),ki=oi),u&&(ri.width=Math.ceil(w),ri.height=Math.ceil(w),vf=ri.getContext("2d"),kt.width=Math.ceil(w),kt.height=Math.ceil(w),yf=kt.getContext("2d"),wt=kt),e&&(ur.width=v,ur.height=v,pf=ur.getContext("2d"))},pe=function(n){var t,r,i;n.save(),n.save(),n.lineWidth=v*.085,n.beginPath(),n.translate(ot,lt),n.rotate(ht-4*u),n.translate(-ot,-lt),n.arc(ot,lt,a*.35514,0,tt+8*u,!1),n.rotate(-ht),t=n.createLinearGradient(0,.107476*ct,0,.897195*ct),t.addColorStop(0,"#000000"),t.addColorStop(.22,"#333333"),t.addColorStop(.76,"#333333"),t.addColorStop(1,"#cccccc"),n.strokeStyle=t,n.stroke(),n.restore(),n.save(),n.lineWidth=v*.075,n.beginPath(),n.translate(ot,lt),n.rotate(ht-4*u),n.translate(-ot,-lt),n.arc(ot,lt,a*.35514,0,tt+8*u,!1),n.rotate(-ht),r=n.createLinearGradient(0,.112149*ct,0,.892523*ct),r.addColorStop(0,"#111111"),r.addColorStop(1,"#333333"),n.strokeStyle=r,n.stroke(),n.restore();var e=(a*.116822+a*.060747)/2,o=(a*.485981+a*.023364)/2,f=n.createRadialGradient(e,o,0,e,o,.030373*a);for(f.addColorStop(0,"#3c3c3c"),f.addColorStop(1,"#323232"),i=0,i=0;i<=ii;i+=5)n.save(),n.translate(ot,lt),n.rotate(i*u+pi),n.translate(-ot,-lt),n.beginPath(),n.rect(a*.116822,a*.485981,a*.060747,a*.023364),n.closePath(),n.fillStyle=f,n.fill(),n.restore();n.restore()},te=function(n,t){n.save(),n.beginPath(),n.rect(0,0,n.canvas.width,n.canvas.height),n.closePath();var r=n.canvas.width/2,u=n.canvas.height/2,i=b.createRadialGradient(r,u,0,r,u,n.canvas.width/2);i.addColorStop(0,t.light.getRgbaColor()),i.addColorStop(1,t.dark.getRgbaColor()),n.fillStyle=i,n.fill(),n.restore()},we=function(n,t){n.save(),n.textAlign="right",n.strokeStyle=vi.textColor,n.fillStyle=vi.textColor,(vi===steelseries.LcdColor.STANDARD||vi===steelseries.LcdColor.STANDARD_GREEN)&&(n.shadowColor="gray",n.shadowOffsetX=a*.007,n.shadowOffsetY=a*.007,n.shadowBlur=a*.007),n.font=re?se:oe,n.fillText(t.toFixed(yu),uf+nr-nr*.05,ff+fu*.5+uu*.38,nr*.9),n.restore()},be=function(n,t){var f=ht,r=bt*wr,u,w=Math.ceil(a*.04),s=c,l=br-1,y=a*.28,h=a*.1,b=parseFloat(p.toFixed(2)),v;for(ai.labelColor.setAlpha(1),n.save(),n.textAlign="center",n.textBaseline="middle",n.font=w+"px "+o,n.strokeStyle=ai.labelColor.getRgbaColor(),n.fillStyle=ai.labelColor.getRgbaColor(),n.translate(ot,lt),n.rotate(ht),(si.type==="type1"||si.type==="type2")&&(h=a*.0375),v=c;parseFloat(v.toFixed(2))<=b;v+=wr){if(u=+r+i,l++,l===br){n.save(),n.translate(y,0);switch(fe.type){case"horizontal":u=-f;break;case"tangent":u=f<=i+e?e:0;break;case"normal":default:u=i}n.rotate(u);switch(t.format){case"fractional":n.fillText(s.toFixed(pu),0,0,h);break;case"scientific":n.fillText(s.toPrecision(2),0,0,h);break;case"standard":default:n.fillText(s.toFixed(0),0,0,h)}n.translate(-y,0),n.restore(),s+=ui,l=0,n.rotate(r),f+=r;continue}n.rotate(r),f+=r}n.translate(-ot,-lt),n.restore()},er=function(n){n?tf=setInterval(de,1e3):(clearInterval(tf),ki=oi)},ke=function(n){n?iu=setInterval(ge,1e3):(clearInterval(iu),wt=kt)},de=function(){dr&&(ki=ki===bi?oi:bi,li||(li=!0,l(rf.repaint)))},ge=function(){nu&&(wt=wt===ri?kt:ri,li||(li=!0,l(rf.repaint)))};return this.setValue=function(n){n=parseFloat(n);var t=n<c?c:n>p?p:n;return et!==t&&(et=t,et>=gt&&!it&&ni||et<=gt&&!it&&!ni?(it=!0,er(it),di&&ci.play()):(et<gt&&it&&ni||et>gt&&it&&!ni)&&(it=!1,er(it),di&&ci.pause()),this.repaint()),this},this.getValue=function(){return et},this.setValueAnimated=function(n){n=parseFloat(n);var i=n<c?c:n>p?p:n,r=this,t;return et!==i&&(undefined!==yi&&yi.isPlaying&&yi.stop(),t=nf*Math.abs(i-et)/(p-c),t=Math.max(t,nf/5),yi=new Tween({},"",Tween.regularEaseInOut,et,i,t),yi.onMotionChanged=function(n){et=n.target._pos,et>=gt&&!it&&ni||et<=gt&&!it&&!ni?(it=!0,er(it),di&&ci.play()):(et<gt&&it&&ni||et>gt&&it&&!ni)&&(it=!1,er(it),di&&ci.pause()),li||(li=!0,l(r.repaint))},yi.start()),this},this.setFrameDesign=function(n){return at({frame:!0}),cu=n,ut({frame:!0}),this.repaint(),this},this.setBackgroundColor=function(n){return at({background:!0,led:!0}),ai=n,ut({background:!0,led:!0}),this.repaint(),this},this.setForegroundType=function(n){return at({foreground:!0}),bu=n,ut({foreground:!0}),this.repaint(),this},this.setValueColor=function(n){return at({value:!0}),or=n,ut({value:!0}),this.repaint(),this},this.setLedColor=function(n){return at({led:!0}),kr=n,ut({led:!0}),this.repaint(),this},this.setUserLedColor=function(n){return at({userLed:!0}),gr=n,ut({userLed:!0}),this.repaint(),this},this.toggleUserLed=function(){return wt=wt===ri?kt:ri,this.repaint(),this},this.setUserLedOnOff=function(n){return wt=!0===n?ri:kt,this.repaint(),this},this.blinkUserLed=function(n){return n?hr||(ke(!0),hr=!0):hr&&(clearInterval(iu),hr=!1),this},this.setLedVisible=function(n){return dr=!!n,this.repaint(),this},this.setUserLedVisible=function(n){return nu=!!n,this.repaint(),this},this.setLcdColor=function(n){return vi=n,at({background:!0}),ut({background:!0}),this.repaint(),this},this.setLcdDecimals=function(n){return yu=parseInt(n,10),this.repaint(),this},this.setSection=function(n){return hi=n,ut(),this.repaint(),this},this.setSectionActive=function(n){return ou=n,ut(),this.repaint(),this},this.setGradient=function(n){return gi=n,ut(),this.repaint(),this},this.setGradientActive=function(n){return gu=n,ut(),this.repaint(),this},this.setMinValue=function(n){return c=n,at({background:!0}),ut({background:!0}),this.repaint(),this},this.getMinValue=function(){return c},this.setMaxValue=function(n){return p=n,at({background:!0}),ut({background:!0}),this.repaint(),this},this.getMaxValue=function(){return p},this.setThreshold=function(n){n=parseFloat(n);var t=n<c?c:n>p?p:n;return gt=t,at({background:!0}),ut({background:!0}),this.repaint(),this},this.setThresholdRising=function(n){return ni=!!n,it=!it,er(it),this.repaint(),this},this.setTitleString=function(n){return su=n,at({background:!0}),ut({background:!0}),this.repaint(),this},this.setUnitString=function(n){return hu=n,at({background:!0}),ut({background:!0}),this.repaint(),this},this.setTrend=function(n){return sf=n,this.repaint(),this},this.setTrendVisible=function(n){return tu=!!n,this.repaint(),this},this.setFractionalScaleDecimals=function(n){pu=parseInt(n,10),at({background:!0}),ut({background:!0}),this.repaint()},this.setLabelNumberFormat=function(n){return wu=n,at({background:!0}),ut({background:!0}),this.repaint(),this},this.repaint=function(){var s=(et-c)/(p-c)*ii,t,f=or,n,i,e,o,r;for(gf||ut({frame:!0,background:!0,led:!0,userLed:!0,value:!0,trend:!0,foreground:!0}),b.clearRect(0,0,v,v),lu&&b.drawImage(tr,0,0),b.drawImage(ir,0,0),n=0;n<=s;n+=5){if(t=or,ru)e=c+n/ii*(p-c),o=gi.getEnd()-gi.getStart(),r=e/o,r=Math.max(Math.min(r,1),0),t=dt(gi.getColorAt(r).getRgbaColor());else if(cr)for(i=0;i<wi.length;i++)if(n>=wi[i].start&&n<wi[i].stop){t=wi[i].color;break}f.medium.getHexColor()!==t.medium.getHexColor()&&(te(eu,t),f=t),b.save(),b.translate(ot,lt),b.rotate(n*u+pi),b.translate(-ot,-lt),b.drawImage(rr,he,ce),b.restore()}if(vu&&we(b,et),dr&&b.drawImage(ki,ef,of),nu&&b.drawImage(wt,le,ae),tu)switch(sf.state){case"up":b.drawImage(wf,ar,vr);break;case"steady":b.drawImage(bf,ar,vr);break;case"down":b.drawImage(kf,ar,vr);break;case"off":b.drawImage(df,ar,vr)}ku&&b.drawImage(ur,0,0),li=!1},this.repaint(),this},nr=function(n,r){var wt;r=r||{};var ut=undefined===r.orientation?steelseries.Orientation.NORTH:r.orientation,c=undefined===r.size?0:r.size,nt=undefined===r.minValue?0:r.minValue,rt=undefined===r.maxValue?nt+100:r.maxValue,su=undefined===r.niceScale?!0:r.niceScale,et=undefined===r.threshold?(rt-nt)/2+nt:r.threshold,dt=undefined===r.section?null:r.section,gt=undefined===r.area?null:r.area,rr=undefined===r.titleString?"":r.titleString,ur=undefined===r.unitString?"":r.unitString,fr=undefined===r.frameDesign?steelseries.FrameDesign.METAL:r.frameDesign,er=undefined===r.frameVisible?!0:r.frameVisible,ct=undefined===r.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:r.backgroundColor,or=undefined===r.backgroundVisible?!0:r.backgroundVisible,lt=undefined===r.pointerType?steelseries.PointerType.TYPE1:r.pointerType,sr=undefined===r.pointerColor?steelseries.ColorDef.RED:r.pointerColor,hu=undefined===r.knobType?steelseries.KnobType.STANDARD_KNOB:r.knobType,pt=undefined===r.knobStyle?steelseries.KnobStyle.SILVER:r.knobStyle,di=undefined===r.ledColor?steelseries.LedColor.RED_LED:r.ledColor,gi=undefined===r.ledVisible?!0:r.ledVisible,hr=undefined===r.thresholdVisible?!0:r.thresholdVisible,st=undefined===r.thresholdRising?!0:r.thresholdRising,nr=undefined===r.minMeasuredValueVisible?!1:r.minMeasuredValueVisible,tr=undefined===r.maxMeasuredValueVisible?!1:r.maxMeasuredValueVisible,cr=undefined===r.foregroundType?steelseries.ForegroundType.TYPE1:r.foregroundType,lr=undefined===r.foregroundVisible?!0:r.foregroundVisible,cu=undefined===r.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:r.labelNumberFormat,oi=undefined===r.playAlarm?!1:r.playAlarm,ar=undefined===r.alarmSound?!1:r.alarmSound,vr=undefined===r.fullScaleDeflectionTime?2.5:r.fullScaleDeflectionTime,h=f.getElementById(n).getContext("2d");c===0&&(c=Math.min(h.canvas.width,h.canvas.height)),h.canvas.width=c,h.canvas.height=c,oi&&ar!==!1&&(wt=f.createElement("audio"),wt.setAttribute("src",ar),wt.setAttribute("preload","auto"));var yr=steelseries.GaugeType.TYPE5,lu=this,b=nt,ni=rt,ti=nt,p=c,tt=c,it=!1,pr=0,ii,si=!1,pi=nt,wi=rt,bi=rt-nt,bt=wi-pi,ki=0,at=0,hi=10,au=10,vu=0,ht=1.25*e,yu=1.25*e,ri=i,vt=ri/bt,wr=p*.006,br=p*1.17/2,kr=!1,ir=ht+(b-nt)*vt,u=p/2,ft=tt*.733644,pu=.455*p,wu=.51*tt,bu=function(){su?(bi=y(rt-nt,!1),at=y(bi/(au-1),!0),pi=Math.floor(nt/at)*at,wi=Math.ceil(rt/at)*at,ki=y(at/(hi-1),!0),nt=pi,rt=wi,bt=rt-nt):(bi=rt-nt,pi=nt,wi=rt,bt=bi,ki=1,at=10),vu=0,ht=1.25*e,yu=1.25*e,ri=i,vt=ri/bt,ir=ht+(b-nt)*vt},ci=t(c,c),dr=ci.getContext("2d"),li=t(c,c),v=li.getContext("2d"),ui=t(c*.093457,c*.093457),gr=ui.getContext("2d"),yt=t(c*.093457,c*.093457),nu=yt.getContext("2d"),fi=yt,tu=t(Math.ceil(c*.028037),Math.ceil(c*.028037)),iu=tu.getContext("2d"),ru=t(Math.ceil(c*.028037),Math.ceil(c*.028037)),uu=ru.getContext("2d"),ai=t(c,c),fu=ai.getContext("2d"),vi=t(c,c),eu=vi.getContext("2d"),ku=function(n){"type5"===yr.type&&(n.save(),ut.type==="west"?(n.drawImage(a(Math.ceil(tt*.037383),steelseries.KnobType.STANDARD_KNOB,pt),p*.44,tt*.8),n.drawImage(a(Math.ceil(tt*.037383),steelseries.KnobType.STANDARD_KNOB,pt),p*.44,tt*.16)):ut.type==="east"?(n.drawImage(a(Math.ceil(tt*.037383),steelseries.KnobType.STANDARD_KNOB,pt),p*.52,tt*.8),n.drawImage(a(Math.ceil(tt*.037383),steelseries.KnobType.STANDARD_KNOB,pt),p*.52,tt*.16)):(n.drawImage(a(Math.ceil(tt*.037383),steelseries.KnobType.STANDARD_KNOB,pt),p*.2-tt*.037383,tt*.446666),n.drawImage(a(Math.ceil(tt*.037383),steelseries.KnobType.STANDARD_KNOB,pt),p*.8,tt*.446666)),n.restore())},du=function(){var t=f.createElement("canvas"),n,i;return t.width=Math.ceil(c*.046728),t.height=Math.ceil(t.width*.9),n=t.getContext("2d"),n.save(),i=n.createLinearGradient(0,.1,0,t.height*.9),i.addColorStop(0,"#520000"),i.addColorStop(.3,"#fc1d00"),i.addColorStop(.59,"#fc1d00"),i.addColorStop(1,"#520000"),n.fillStyle=i,n.beginPath(),n.moveTo(t.width*.5,.1),n.lineTo(t.width*.9,t.height*.9),n.lineTo(t.width*.1,t.height*.9),n.lineTo(t.width*.5,.1),n.closePath(),n.fill(),n.strokeStyle="#FFFFFF",n.stroke(),n.restore(),t},ou=function(n,t,i,r,f){n.save(),n.strokeStyle=r,n.fillStyle=r,n.lineWidth=p*.035;var e=ri/bt*t-ri/bt*nt,o=e+(i-t)/(bt/ri);n.translate(u,ft),n.rotate(ht),n.beginPath(),f?(n.moveTo(0,0),n.arc(0,0,p*.365-n.lineWidth/2,e,o,!1)):n.arc(0,0,p*.365,e,o,!1),f?(n.moveTo(0,0),n.fill()):n.stroke(),n.translate(-u,-ft),n.restore()},gu=function(n){var t,i;n.save(),n.textAlign="left",n.textBaseline="middle",n.strokeStyle=ct.labelColor.getRgbaColor(),n.fillStyle=ct.labelColor.getRgbaColor(),n.font=.046728*p+"px "+o,t=n.measureText(rr).width,n.fillText(rr,(p-t)/2,tt*.4,p*.3),i=n.measureText(ur).width,n.fillText(ur,(p-i)/2,tt*.47,p*.2),n.restore()},nf=function(n,t){var l;ct.labelColor.setAlpha(1),n.save(),steelseries.Orientation.WEST===ut&&(n.translate(u,u),n.rotate(-i),n.translate(-u,-u)),steelseries.Orientation.EAST===ut&&(n.translate(u,u),n.rotate(i),n.translate(-u,-u)),n.textAlign="center",n.textBaseline="middle",l=Math.ceil(p*.04),n.font=l+"px "+o,n.strokeStyle=ct.labelColor.getRgbaColor(),n.fillStyle=ct.labelColor.getRgbaColor(),n.translate(u,ft),n.rotate(ht);for(var e=vt*ki,a,r=nt,f=hi-1,s=p*.44,y=p*.41,w=p*.415,b=p*.42,v=p*.48,h=p*.04,k=hi/2,d=parseFloat(rt.toFixed(2)),c=nt;parseFloat(c.toFixed(2))<=d;c+=ki){if(a=+e+i,f++,f===hi){n.lineWidth=1.5,n.beginPath(),n.moveTo(s,0),n.lineTo(y,0),n.closePath(),n.stroke(),n.save(),n.translate(v,0),n.rotate(a);switch(t.format){case"fractional":n.fillText(r.toFixed(2),0,0,h);break;case"scientific":n.fillText(r.toPrecision(2),0,0,h);break;case"standard":default:n.fillText(r.toFixed(0),0,0,h)}n.translate(-v,0),n.restore(),r+=at,f=0,n.rotate(e);continue}0==hi%2&&f===k?(n.lineWidth=1,n.beginPath(),n.moveTo(s,0),n.lineTo(w,0),n.closePath(),n.stroke()):(n.lineWidth=.5,n.beginPath(),n.moveTo(s,0),n.lineTo(b,0),n.closePath(),n.stroke()),n.rotate(e)}n.translate(-u,-ft),n.restore()},kt=function(n){var t,r,e;n=n||{};var o=undefined===n.frame?!1:n.frame,f=undefined===n.background?!1:n.background,h=undefined===n.led?!1:n.led,l=undefined===n.pointer?!1:n.pointer,a=undefined===n.foreground?!1:n.foreground;if(kr=!0,bu(),o&&er&&k(dr,fr,u,c/2,p,tt),f&&or&&g(v,ct,u,c/2,p,tt),h&&(gr.drawImage(s(Math.ceil(c*.093457),1,di),0,0),nu.drawImage(s(Math.ceil(c*.093457),0,di),0,0)),nr&&(iu.drawImage(w(Math.ceil(c*.028037),steelseries.ColorDef.BLUE.dark.getRgbaColor(),!0,!0),0,0),iu.restore()),tr&&(uu.drawImage(w(Math.ceil(c*.028037),steelseries.ColorDef.RED.medium.getRgbaColor(),!0),0,0),uu.restore()),f&&or){if(ku(v),null!==dt&&0<dt.length){v.save(),steelseries.Orientation.WEST===ut?(v.translate(u,u),v.rotate(-i),v.translate(-u,-u)):steelseries.Orientation.EAST===ut&&(v.translate(u,u),v.rotate(i),v.translate(-u,-u)),t=dt.length;do t--,ou(v,dt[t].start,dt[t].stop,dt[t].color,!1);while(0<t);v.restore()}if(null!==gt&&0<gt.length){steelseries.Orientation.WEST===ut&&(v.translate(u,u),v.rotate(-i),v.translate(-u,-u)),steelseries.Orientation.EAST===ut&&(v.translate(u,u),v.rotate(i),v.translate(-u,-u)),r=gt.length;do r--,ou(v,gt[r].start,gt[r].stop,gt[r].color,!0);while(0<r);v.restore()}nf(v,cu),gu(v)}hr&&(v.save(),steelseries.Orientation.WEST===ut&&(v.translate(u,u),v.rotate(-i),v.translate(-u,-u)),steelseries.Orientation.EAST===ut&&(v.translate(u,u),v.rotate(i),v.translate(-u,-u)),v.translate(u,ft),v.rotate(ht+(et-nt)*vt+i),v.translate(-u,-ft),v.drawImage(du(),p*.475,tt*.32),v.restore()),l&&ot(fu,p*1.17,lt,sr,ct.labelColor),a&&lr&&(e=lt.type==="type15"||lt.type==="type16"?!1:!0,d(eu,cr,p,tt,e,hu,pt,yr,ut))},ei=function(n){n=n||{};var t=undefined===n.frame?!1:n.frame,i=undefined===n.background?!1:n.background,r=undefined===n.led?!1:n.led,u=undefined===n.pointer?!1:n.pointer,f=undefined===n.foreground?!1:n.foreground;t&&(ci.width=c,ci.height=c,dr=ci.getContext("2d")),i&&(li.width=c,li.height=c,v=li.getContext("2d")),r&&(ui.width=Math.ceil(c*.093457),ui.height=Math.ceil(c*.093457),gr=ui.getContext("2d"),yt.width=Math.ceil(c*.093457),yt.height=Math.ceil(c*.093457),nu=yt.getContext("2d"),fi=yt),u&&(ai.width=c,ai.height=c,fu=ai.getContext("2d")),f&&(vi.width=c,vi.height=c,eu=vi.getContext("2d"))},yi=function(n){n?pr=setInterval(tf,1e3):(clearInterval(pr),fi=yt)},tf=function(){gi&&(fi=fi===ui?yt:ui,si||(si=!0,l(lu.repaint)))};return this.setValue=function(n){n=parseFloat(n);var t=n<nt?nt:n>rt?rt:n;return b!==t&&(b=t,b>ti&&(ti=b),b<ni&&(ni=b),b>=et&&!it&&st||b<=et&&!it&&!st?(it=!0,yi(it),oi&&wt.play()):(b<et&&it&&st||b>et&&it&&!st)&&(it=!1,yi(it),oi&&wt.pause()),this.repaint()),this},this.getValue=function(){return b},this.setValueAnimated=function(n){n=parseFloat(n);var i=n<nt?nt:n>rt?rt:n,r=this,t;return b!==i&&(undefined!==ii&&ii.isPlaying&&ii.stop(),t=vr*Math.abs(i-b)/(rt-nt),t=Math.max(t,vr/5),ii=new Tween({},"",Tween.regularEaseInOut,b,i,t),ii.onMotionChanged=function(n){b=n.target._pos,b>=et&&!it&&st||b<=et&&!it&&!st?(it=!0,yi(it),oi&&wt.play()):(b<et&&it&&st||b>et&&it&&!st)&&(it=!1,yi(it),oi&&wt.pause()),b>ti&&(ti=b),b<ni&&(ni=b),si||(si=!0,l(r.repaint))},ii.start()),this},this.resetMinMeasuredValue=function(){return ni=b,this.repaint(),this},this.resetMaxMeasuredValue=function(){return ti=b,this.repaint(),this},this.setMinMeasuredValueVisible=function(n){return nr=!!n,this.repaint(),this},this.setMaxMeasuredValueVisible=function(n){return tr=!!n,this.repaint(),this},this.setThresholdVisible=function(n){return hr=!!n,this.repaint(),this},this.setThresholdRising=function(n){return st=!!n,it=!it,yi(it),this.repaint(),this},this.setFrameDesign=function(n){return ei({frame:!0}),fr=n,kt({frame:!0}),this.repaint(),this},this.setBackgroundColor=function(n){return ei({background:!0,pointer:lt.type==="type2"||lt.type==="type13"?!0:!1}),ct=n,kt({background:!0,pointer:lt.type==="type2"||lt.type==="type13"?!0:!1}),this.repaint(),this},this.setForegroundType=function(n){return ei({foreground:!0}),cr=n,kt({foreground:!0}),this.repaint(),this},this.setPointerType=function(n){return ei({pointer:!0,foreground:!0}),lt=n,kt({pointer:!0,foreground:!0}),this.repaint(),this},this.setPointerColor=function(n){return ei({pointer:!0}),sr=n,kt({pointer:!0}),this.repaint(),this},this.setLedColor=function(n){return ei({led:!0}),di=n,kt({led:!0}),this.repaint(),this},this.setLedVisible=function(n){return gi=!!n,this.repaint(),this},this.repaint=function(){kr||kt({frame:!0,background:!0,led:!0,pointer:!0,foreground:!0}),h.clearRect(0,0,c,c),h.save(),er&&h.drawImage(ci,0,0),h.drawImage(li,0,0),gi&&h.drawImage(fi,pu,wu),steelseries.Orientation.WEST===ut&&(h.translate(u,u),h.rotate(-i),h.translate(-u,-u)),steelseries.Orientation.EAST===ut&&(h.translate(u,u),h.rotate(i),h.translate(-u,-u)),nr&&(h.save(),h.translate(u,ft),h.rotate(ht+i+(ni-nt)*vt),h.translate(-u,-ft),h.drawImage(tu,h.canvas.width*.4865,h.canvas.height*.27),h.restore()),tr&&(h.save(),h.translate(u,ft),h.rotate(ht+i+(ti-nt)*vt),h.translate(-u,-ft),h.drawImage(ru,h.canvas.width*.4865,h.canvas.height*.27),h.restore()),ir=ht+i+(b-nt)*vt,h.save(),h.translate(u,ft),h.rotate(ir),h.shadowColor="rgba(0, 0, 0, 0.8)",h.shadowOffsetX=h.shadowOffsetY=wr,h.shadowBlur=wr*2,h.translate(-br,-br),h.drawImage(ai,0,0),h.restore(),lr&&(steelseries.Orientation.WEST===ut?(h.translate(u,u),h.rotate(i),h.translate(-u,-u)):steelseries.Orientation.EAST===ut&&(h.translate(u,u),h.rotate(-i),h.translate(-u,-u)),h.drawImage(vi,0,0)),h.restore(),si=!1},this.repaint(),this},tr=function(n,r){var e,u,dt;r=r||{};var p=undefined===r.gaugeType?steelseries.GaugeType.TYPE1:r.gaugeType,d=undefined===r.width?0:r.width,g=undefined===r.height?0:r.height,h=undefined===r.minValue?0:r.minValue,c=undefined===r.maxValue?h+100:r.maxValue,uu=undefined===r.niceScale?!0:r.niceScale,rt=undefined===r.threshold?(c-h)/2+h:r.threshold,di=undefined===r.titleString?"":r.titleString,gi=undefined===r.unitString?"":r.unitString,lr=undefined===r.frameDesign?steelseries.FrameDesign.METAL:r.frameDesign,ar=undefined===r.frameVisible?!0:r.frameVisible,tt=undefined===r.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:r.backgroundColor,vr=undefined===r.backgroundVisible?!0:r.backgroundVisible,gt=undefined===r.valueColor?steelseries.ColorDef.RED:r.valueColor,kt=undefined===r.lcdColor?steelseries.LcdColor.STANDARD:r.lcdColor,vi=undefined===r.lcdVisible?!0:r.lcdVisible,yr=undefined===r.lcdDecimals?2:r.lcdDecimals,fu=undefined===r.digitalFont?!1:r.digitalFont,ri=undefined===r.ledColor?steelseries.LedColor.RED_LED:r.ledColor,nr=undefined===r.ledVisible?!0:r.ledVisible,pr=undefined===r.thresholdVisible?!0:r.thresholdVisible,yt=undefined===r.thresholdRising?!0:r.thresholdRising,tr=undefined===r.minMeasuredValueVisible?!1:r.minMeasuredValueVisible,ir=undefined===r.maxMeasuredValueVisible?!1:r.maxMeasuredValueVisible,eu=undefined===r.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:r.labelNumberFormat,wr=undefined===r.foregroundVisible?!0:r.foregroundVisible,ui=undefined===r.playAlarm?!1:r.playAlarm,br=undefined===r.alarmSound?!1:r.alarmSound,kr=undefined===r.fullScaleDeflectionTime?2.5:r.fullScaleDeflectionTime,k=f.getElementById(n).getContext("2d");d===0&&(d=k.canvas.width),g===0&&(g=k.canvas.height),k.canvas.width=d,k.canvas.height=g,e=d,u=g,ui&&br!==!1&&(dt=f.createElement("audio"),dt.setAttribute("src",br),dt.setAttribute("preload","auto"));var ou=this,v=h,ot=c,st=h;p.type!=="type1"&&p.type!=="type2"&&(p=steelseries.GaugeType.TYPE1);var ni,b=!1,fi=!1,dr=0,a=d<=g,rr,ur,ht=Math.round((a?g:d)*.05),ut=Math.round((a?d:g)*.05),fr,er;a?(rr=e/2-ht/2,ur=(p.type==="type1"?.053:.038)*u,fr=Math.floor(u/22)+"px "+o,er=Math.floor(u/22)+"px "+ft):(rr=.89*e,ur=u/2-ht/2,fr=Math.floor(u/10)+"px "+o,er=Math.floor(u/10)+"px "+ft);var gr=!1,yi=h,pi=c,wi=c-h,nu=pi-yi,bi=0,wt=0,ei=10,su=10,hu=function(){uu?(wi=y(c-h,!1),wt=y(wi/(su-1),!0),yi=Math.floor(h/wt)*wt,pi=Math.ceil(c/wt)*wt,bi=y(wt/(ei-1),!0),h=yi,c=pi,nu=c-h):(wi=c-h,yi=h,pi=c,nu=wi,bi=1,wt=10)},oi=t(d,g),tu=oi.getContext("2d"),si=t(d,g),it=si.getContext("2d"),ki,ti=t(ht,ht),or=ti.getContext("2d"),bt=t(ht,ht),sr=bt.getContext("2d"),ii=bt,hi=t(ut,ut),iu=hi.getContext("2d"),ci=t(ut,ut),ru=ci.getContext("2d"),li=t(d,g),hr=li.getContext("2d"),cu=function(n,t,i){n.save(),n.textAlign="right",n.textBaseline="middle",n.strokeStyle=kt.textColor,n.fillStyle=kt.textColor,(kt===steelseries.LcdColor.STANDARD||kt===steelseries.LcdColor.STANDARD_GREEN)&&(n.shadowColor="gray",i?(n.shadowOffsetX=u*.003,n.shadowOffsetY=u*.003,n.shadowBlur=u*.004):(n.shadowOffsetX=u*.007,n.shadowOffsetY=u*.007,n.shadowBlur=u*.009));var r,f,o;n.font=fu?er:fr,i?(r=(e-e*.571428)/2+e*.571428-2,f=u*.88+1+(u*.055-2)/2,o=e*.7-2):(r=e*.695+e*.18-2,f=u*.22+1+(u*.15-2)/2,o=u*.22-2),n.fillText(t.toFixed(yr),r,f,o),n.restore()},lu=function(n){var i=f.createElement("canvas"),t,r;return i.height=i.width=ut,t=i.getContext("2d"),t.save(),r=t.createLinearGradient(0,.1,0,i.height*.9),r.addColorStop(0,"#520000"),r.addColorStop(.3,"#fc1d00"),r.addColorStop(.59,"#fc1d00"),r.addColorStop(1,"#520000"),t.fillStyle=r,n?(t.beginPath(),t.moveTo(.1,i.height*.5),t.lineTo(i.width*.9,.1),t.lineTo(i.width*.9,i.height*.9),t.closePath()):(t.beginPath(),t.moveTo(.1,.1),t.lineTo(i.width*.9,.1),t.lineTo(i.width*.5,i.height*.9),t.closePath()),t.fill(),t.strokeStyle="#FFFFFF",t.stroke(),t.restore(),i},au=function(n,t,i){var f,ut;tt.labelColor.setAlpha(1),n.save(),n.textBaseline="middle",f=e*.1,n.strokeStyle=tt.labelColor.getRgbaColor(),n.fillStyle=tt.labelColor.getRgbaColor();var o=h,l=ei-1,a,r,s,b,v,y,w=1,k,d,g,nt,it,rt;for(i?(k=.34*e,d=.36*e,g=.33*e,nt=.36*e,it=.32*e,rt=.36*e,n.textAlign="right",s=0,b=u*.12864,v=0,y=p.type==="type1"?u*.856796-u*.12864:u*.7475-u*.12864,w=y/(c-h)):(k=.65*u,d=.63*u,g=.66*u,nt=.63*u,it=.67*u,rt=.63*u,n.textAlign="center",b=0,p.type==="type1"?(s=e*.142857,v=e*.871012-s):(s=e*.19857,v=e*.82-s),y=0,w=v/(c-h)),ut=h,a=0;ut<=c;ut+=bi,a+=bi){if(r=i?b+y-a*w:s+a*w,l++,l===ei){if(n.lineWidth=1.5,cr(n,it,rt,r,i),i)switch(t.format){case"fractional":n.fillText(o.toFixed(2),e*.28,r,f);break;case"scientific":n.fillText(o.toPrecision(2),e*.28,r,f);break;case"standard":default:n.fillText(o.toFixed(0),e*.28,r,f)}else switch(t.format){case"fractional":n.fillText(o.toFixed(2),r,u*.73,f);break;case"scientific":n.fillText(o.toPrecision(2),r,u*.73,f);break;case"standard":default:n.fillText(o.toFixed(0),r,u*.73,f)}o+=wt,l=0;continue}0==ei%2&&l===ei/2?(n.lineWidth=1,cr(n,g,nt,r,i)):(n.lineWidth=.5,cr(n,k,d,r,i))}n.restore()},cr=function(n,t,i,r,u){u?(n.beginPath(),n.moveTo(t,r),n.lineTo(i,r),n.closePath(),n.stroke()):(n.beginPath(),n.moveTo(r,t),n.lineTo(r,i),n.closePath(),n.stroke())},et=function(n){n=n||{};var l=undefined===n.frame?!1:n.frame,t=undefined===n.background?!1:n.background,v=undefined===n.led?!1:n.led,o=undefined===n.foreground?!1:n.foreground,i,r,f;gr=!0,hu(),l&&ar&&lt(tu,lr,e,u,a),t&&vr&&at(it,tt,e,u,a),t&&p.type==="type2"&&wu(it),v&&(a?(or.drawImage(s(ht,1,ri),0,0),sr.drawImage(s(ht,0,ri),0,0)):(or.drawImage(s(ht,1,ri),0,0),sr.drawImage(s(ht,0,ri),0,0))),tr&&(a?iu.drawImage(w(ut,steelseries.ColorDef.BLUE.dark.getRgbaColor(),!1,a),0,0):iu.drawImage(w(ut,steelseries.ColorDef.BLUE.dark.getRgbaColor(),!1,a),0,0)),ir&&(a?ru.drawImage(w(ut,steelseries.ColorDef.RED.medium.getRgbaColor(),!1,a),0,0):ru.drawImage(w(ut,steelseries.ColorDef.RED.medium.getRgbaColor(),!1,a),0,0)),t&&vr&&(au(it,eu,a),a?pt(it,e,u,di,gi,tt,a,null,vi,p):pt(it,e,u,di,gi,tt,a,null,vi,p)),t&&pr&&(it.save(),a?(i=p.type==="type1"?.856796:.7475,r=i-.12864,f=u*i-u*r*(rt-h)/(c-h),it.translate(e*.365,f-ut/2)):(i=p.type==="type1"?.871012:.82,r=i-(p.type==="type1"?.142857:.19857),f=e*r*(rt-h)/(c-h),it.translate(e*(p.type==="type1"?.142857:.19857)-ut/2+f,u*.58)),it.drawImage(lu(a),0,0),it.restore()),t&&vi&&(a?(ki=nt(e*.571428,u*.055,kt),it.drawImage(ki,(e-e*.571428)/2,u*.88)):(ki=nt(e*.18,u*.15,kt),it.drawImage(ki,e*.695,u*.22))),o&&p.type==="type2"&&pu(hr),o&&wr&&vt(hr,e,u,a,!1)},ct=function(n){n=n||{};var t=undefined===n.frame?!1:n.frame,i=undefined===n.background?!1:n.background,r=undefined===n.led?!1:n.led,u=undefined===n.foreground?!1:n.foreground;t&&(oi.width=d,oi.height=g,tu=oi.getContext("2d")),i&&(si.width=d,si.height=g,it=si.getContext("2d")),r&&(ti.width=Math.ceil(d*.093457),ti.height=Math.ceil(g*.093457),or=ti.getContext("2d"),bt.width=Math.ceil(d*.093457),bt.height=Math.ceil(g*.093457),sr=bt.getContext("2d"),ii=bt),u&&(li.width=d,li.height=g,hr=li.getContext("2d"))},ai=function(n){n?dr=setInterval(vu,1e3):(clearInterval(dr),ii=bt)},vu=function(){nr&&(ii=ii===ti?bt:ti,fi||(fi=!0,l(ou.repaint)))},yu=function(n,t,i){var u,e,r=tt.labelColor,f,l,y,o,s,w,b,st,ht,ct,lt,at,vt,yt,pt,it,k,rt,ut,d,g,nt,ft,et,ot;a?(u=i*.12864,e=p.type==="type1"?i*.856796:i*.7475,f=e-u,l=f*(v-h)/(c-h),y=e-l,st=0,ht=u,ct=0,lt=e):(p.type==="type1"?(u=t*.871012,e=t*.142857):(u=t*.82,e=t*.19857),f=u-e,l=f*(v-h)/(c-h),y=e,st=u,ht=0,ct=e,lt=0),p.type==="type1"&&(d=tt===steelseries.BackgroundColor.CARBON||tt===steelseries.BackgroundColor.PUNCHED_SHEET||tt===steelseries.BackgroundColor.STAINLESS||tt===steelseries.BackgroundColor.BRUSHED_STAINLESS||tt===steelseries.BackgroundColor.TURNED?.3:0,g=n.createLinearGradient(st,ht,ct,lt),r.setAlpha(.05+d),g.addColorStop(0,r.getRgbaColor()),r.setAlpha(.15+d),g.addColorStop(.48,r.getRgbaColor()),r.setAlpha(.15+d),g.addColorStop(.49,r.getRgbaColor()),r.setAlpha(.05+d),g.addColorStop(1,r.getRgbaColor()),n.fillStyle=g,a?n.fillRect(t*.435714,u,t*.142857,f):n.fillRect(t*.142857,i*.435714,f,i*.142857),a?(at=0,vt=u,yt=0,pt=u+f):(at=t*.142857+f,vt=0,yt=t*.142857,pt=0),nt=n.createLinearGradient(at,vt,yt,pt),r.setAlpha(.3+d),nt.addColorStop(0,r.getRgbaColor()),r.setAlpha(.69),nt.addColorStop(.48,r.getRgbaColor()),r.setAlpha(.7),nt.addColorStop(.49,r.getRgbaColor()),r.setAlpha(.4),nt.addColorStop(1,r.getRgbaColor()),n.fillStyle=nt,a?(n.fillRect(t*.435714,u,t*.007142,f),n.fillRect(t*.571428,u,t*.007142,f)):(n.fillRect(t*.142857,i*.435714,f,i*.007142),n.fillRect(t*.142857,i*.571428,f,i*.007142))),a?p.type==="type1"?(o=t*.45,s=0,w=t*.45+t*.114285,b=0):(o=t/2-i*.0486/2,s=0,w=o+i*.053,b=0):p.type==="type1"?(o=0,s=i*.45,w=0,b=i*.45+i*.114285):(o=0,s=i/2-t*.025,w=0,b=s+t*.053),ft=n.createLinearGradient(o,s,w,b),ft.addColorStop(0,gt.medium.getRgbaColor()),ft.addColorStop(1,gt.light.getRgbaColor()),n.fillStyle=ft,et=p.type==="type1"?0:a?i*.05:t*.05,a?n.fillRect(o,y,w-o,l+et):n.fillRect(y-et,s,l+et,b-s),p.type==="type1"&&(a?(it=t*.45,k=0,rt=it+t*.05,ut=0):(it=0,k=i*.45,rt=0,ut=k+i*.05),ot=n.createLinearGradient(it,k,rt,ut),ot.addColorStop(0,"rgba(255, 255, 255, 0.7)"),ot.addColorStop(.98,"rgba(255, 255, 255, 0.0)"),n.fillStyle=ot,a?n.fillRect(it,y,rt,l):n.fillRect(y,k,l,ut-k))},pu=function(n){var t=a?u:e,r;n.save(),a?n.translate(e/2,0):(n.translate(e/2,u/2),n.rotate(i),n.translate(0,-e/2+e*.05)),n.beginPath(),n.moveTo(-.049*t,.825*t),n.bezierCurveTo(-.049*t,.7975*t,-.0264*t,.775*t,.0013*t,.775*t),n.bezierCurveTo(.0264*t,.775*t,.049*t,.7975*t,.049*t,.825*t),n.bezierCurveTo(.049*t,.85*t,.0264*t,.8725*t,.0013*t,.8725*t),n.bezierCurveTo(-.0264*t,.8725*t,-.049*t,.85*t,-.049*t,.825*t),n.closePath(),r=n.createRadialGradient(0*t,.825*t,0,0*t,.825*t,.049*t),r.addColorStop(0,gt.medium.getRgbaColor()),r.addColorStop(.3,gt.medium.getRgbaColor()),r.addColorStop(1,gt.light.getRgbaColor()),n.fillStyle=r,n.fill(),n.beginPath(),a?(n.moveTo(-.0365*t,.8075*t),n.bezierCurveTo(-.0365*t,.7925*t,-.0214*t,.7875*t,-.0214*t,.7825*t),n.bezierCurveTo(.0189*t,.785*t,.0365*t,.7925*t,.0365*t,.8075*t),n.bezierCurveTo(.0365*t,.8175*t,.0214*t,.815*t,.0013*t,.8125*t),n.bezierCurveTo(-.0189*t,.8125*t,-.0365*t,.8175*t,-.0365*t,.8075*t),r=n.createRadialGradient(0,.8*t,0,0,.8*t,.0377*t)):(n.beginPath(),n.moveTo(-.0214*t,.86*t),n.bezierCurveTo(-.0365*t,.86*t,-.0415*t,.845*t,-.0465*t,.825*t),n.bezierCurveTo(-.0465*t,.805*t,-.0365*t,.7875*t,-.0214*t,.7875*t),n.bezierCurveTo(-.0113*t,.7875*t,-.0163*t,.8025*t,-.0163*t,.8225*t),n.bezierCurveTo(-.0163*t,.8425*t,-.0113*t,.86*t,-.0214*t,.86*t),r=n.createRadialGradient(-.03*t,.8225*t,0,-.03*t,.8225*t,.0377*t)),r.addColorStop(0,"rgba(255, 255, 255, 0.55)"),r.addColorStop(1,"rgba(255, 255, 255, 0.05)"),n.fillStyle=r,n.closePath(),n.fill(),n.beginPath(),n.moveTo(-.0214*t,.115*t),n.bezierCurveTo(-.0214*t,.1075*t,-.0163*t,.1025*t,-.0113*t,.1025*t),n.bezierCurveTo(-.0113*t,.1025*t,-.0113*t,.1025*t,-.0113*t,.1025*t),n.bezierCurveTo(-.0038*t,.1025*t,.0013*t,.1075*t,.0013*t,.115*t),n.bezierCurveTo(.0013*t,.115*t,.0013*t,.76*t,.0013*t,.76*t),n.bezierCurveTo(.0013*t,.7675*t,-.0038*t,.7725*t,-.0113*t,.7725*t),n.bezierCurveTo(-.0113*t,.7725*t,-.0113*t,.7725*t,-.0113*t,.7725*t),n.bezierCurveTo(-.0163*t,.7725*t,-.0214*t,.7675*t,-.0214*t,.76*t),n.bezierCurveTo(-.0214*t,.76*t,-.0214*t,.115*t,-.0214*t,.115*t),n.closePath(),r=n.createLinearGradient(-.0189*t,0,.0013*t,0),r.addColorStop(0,"rgba(255, 255, 255, 0.1)"),r.addColorStop(.34,"rgba(255, 255, 255, 0.5)"),r.addColorStop(1,"rgba(255, 255, 255, 0.1)"),n.fillStyle=r,n.fill(),n.restore()},wu=function(n){var t=a?u:e,r;n.save(),a?n.translate(e/2,0):(n.translate(e/2,u/2),n.rotate(i),n.translate(0,-e/2+e*.05)),n.beginPath(),n.moveTo(-.0516*t,.825*t),n.bezierCurveTo(-.0516*t,.8525*t,-.0289*t,.875*t,.0013*t,.875*t),n.bezierCurveTo(.0289*t,.875*t,.0516*t,.8525*t,.0516*t,.825*t),n.bezierCurveTo(.0516*t,.8075*t,.044*t,.7925*t,.0314*t,.7825*t),n.bezierCurveTo(.0314*t,.7825*t,.0314*t,.12*t,.0314*t,.12*t),n.bezierCurveTo(.0314*t,.1025*t,.0189*t,.0875*t,.0013*t,.0875*t),n.bezierCurveTo(-.0163*t,.0875*t,-.0289*t,.1025*t,-.0289*t,.12*t),n.bezierCurveTo(-.0289*t,.12*t,-.0289*t,.7825*t,-.0289*t,.7825*t),n.bezierCurveTo(-.0415*t,.79*t,-.0516*t,.805*t,-.0516*t,.825*t),n.closePath(),r=n.createLinearGradient(-.0163*t,0,.0289*t,0),r.addColorStop(0,"rgba(226, 226, 226, 0.5)"),r.addColorStop(.5,"rgba(226, 226, 226, 0.2)"),r.addColorStop(1,"rgba(226, 226, 226, 0.5)"),n.fillStyle=r,n.fill(),n.lineWidth=1,n.strokeStyle="rgba(153, 153, 153, 0.5)",n.stroke(),n.restore()};return this.setValue=function(n){n=parseFloat(n);var t=n<h?h:n>c?c:n;return v!==t&&(v=t,v>st&&(st=v),v<ot&&(ot=v),v>=rt&&!b&&yt||v<=rt&&!b&&!yt?(b=!0,ai(b),ui&&dt.play()):(v<rt&&b&&yt||v>rt&&b&&!yt)&&(b=!1,ai(b),ui&&dt.pause()),this.repaint()),this},this.getValue=function(){return v},this.setValueAnimated=function(n){var t,r=this,i;return n=parseFloat(n),t=n<h?h:n>c?c:n,v!==t&&(undefined!==ni&&ni.isPlaying&&ni.stop(),i=kr*Math.abs(t-v)/(c-h),i=Math.max(i,kr/5),ni=new Tween({},"",Tween.regularEaseInOut,v,t,i),ni.onMotionChanged=function(n){v=n.target._pos,v>st&&(st=v),v<ot&&(ot=v),v>=rt&&!b&&yt||v<=rt&&!b&&!yt?(b=!0,ai(b),ui&&dt.play()):(v<rt&&b&&yt||v>rt&&b&&!yt)&&(b=!1,ai(b),ui&&dt.pause()),fi||(fi=!0,l(r.repaint))},ni.start()),this},this.resetMinMeasuredValue=function(){return ot=v,this.repaint(),this},this.resetMaxMeasuredValue=function(){return st=v,this.repaint(),this},this.setMinMeasuredValueVisible=function(n){return tr=!!n,this.repaint(),this},this.setMaxMeasuredValueVisible=function(n){return ir=!!n,this.repaint(),this},this.setThreshold=function(n){n=parseFloat(n);var t=n<h?h:n>c?c:n;return rt=t,ct({background:!0}),et({background:!0}),this.repaint(),this},this.setThresholdVisible=function(n){return pr=!!n,this.repaint(),this},this.setThresholdRising=function(n){return yt=!!n,b=!b,ai(b),this.repaint(),this},this.setLcdDecimals=function(n){return yr=parseInt(n,10),this.repaint(),this},this.setFrameDesign=function(n){return ct({frame:!0}),lr=n,et({frame:!0}),this.repaint(),this},this.setBackgroundColor=function(n){return ct({background:!0}),tt=n,et({background:!0}),this.repaint(),this},this.setValueColor=function(n){return ct({foreground:!0}),gt=n,et({foreground:!0}),this.repaint(),this},this.setLedColor=function(n){return ct({led:!0}),ri=n,et({led:!0}),this.repaint(),this},this.setLedVisible=function(n){return nr=!!n,this.repaint(),this},this.setLcdColor=function(n){return ct({background:!0}),kt=n,et({background:!0}),this.repaint(),this},this.setMaxMeasuredValue=function(n){n=parseFloat(n);var t=n<h?h:n>c?c:n;return st=t,this.repaint(),this},this.setMinMeasuredValue=function(n){n=parseFloat(n);var t=n<h?h:n>c?c:n;return ot=t,this.repaint(),this},this.setTitleString=function(n){return di=n,ct({background:!0}),et({background:!0}),this.repaint(),this},this.setUnitString=function(n){return gi=n,ct({background:!0}),et({background:!0}),this.repaint(),this},this.setMinValue=function(n){return ct({background:!0}),h=parseFloat(n),ot<h&&(ot=h),v<h&&(v=h),et({background:!0}),this.repaint(),this},this.getMinValue=function(){return h},this.setMaxValue=function(n){return ct({background:!0}),c=parseFloat(n),st>c&&(st=c),v>c&&(v=c),et({background:!0}),this.repaint(),this},this.getMaxValue=function(){return c},this.repaint=function(){gr||et({frame:!0,background:!0,led:!0,foreground:!0}),k.clearRect(0,0,k.canvas.width,k.canvas.height),ar&&k.drawImage(oi,0,0),k.drawImage(si,0,0),vi&&cu(k,v,a),nr&&k.drawImage(ii,rr,ur);var n,t,i,r,f;tr&&(a?(t=p.type==="type1"?.856796:.7475,i=t-.12864,n=u*t-u*i*(ot-h)/(c-h),r=e*.34-hi.width,f=n-hi.height/2):(t=p.type==="type1"?.871012:.82,i=t-(p.type==="type1"?.142857:.19857),n=e*i*(ot-h)/(c-h),r=e*(p.type==="type1"?.142857:.19857)-hi.height/2+n,f=u*.65),k.drawImage(hi,r,f)),ir&&(a?(n=u*t-u*i*(st-h)/(c-h),r=e*.34-ci.width,f=n-ci.height/2):(t=p.type==="type1"?.871012:.8,i=t-(p.type==="type1"?.14857:.19857),n=e*i*(st-h)/(c-h),r=e*(p.type==="type1"?.142857:.19857)-ci.height/2+n,f=u*.65),k.drawImage(ci,r,f)),k.save(),yu(k,e,u),k.restore(),(wr||p.type==="type2")&&k.drawImage(li,0,0),fi=!1},this.repaint(),this},ir=function(n,i){var u,e,ii,yi,tt;i=i||{};var v=undefined===i.width?0:i.width,p=undefined===i.height?0:i.height,r=undefined===i.minValue?0:i.minValue,h=undefined===i.maxValue?r+100:i.maxValue,ni=undefined===i.section?null:i.section,yu=undefined===i.useSectionColors?!1:i.useSectionColors,pu=undefined===i.niceScale?!0:i.niceScale,it=undefined===i.threshold?(h-r)/2+r:i.threshold,fr=undefined===i.titleString?"":i.titleString,er=undefined===i.unitString?"":i.unitString,gr=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,nu=undefined===i.frameVisible?!0:i.frameVisible,g=undefined===i.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:i.backgroundColor,or=undefined===i.backgroundVisible?!0:i.backgroundVisible,ei=undefined===i.valueColor?steelseries.ColorDef.RED:i.valueColor,ti=undefined===i.lcdColor?steelseries.LcdColor.STANDARD:i.lcdColor,di=undefined===i.lcdVisible?!0:i.lcdVisible,tu=undefined===i.lcdDecimals?2:i.lcdDecimals,wu=undefined===i.digitalFont?!1:i.digitalFont,oi=undefined===i.ledColor?steelseries.LedColor.RED_LED:i.ledColor,sr=undefined===i.ledVisible?!0:i.ledVisible,hr=undefined===i.thresholdVisible?!0:i.thresholdVisible,ct=undefined===i.thresholdRising?!0:i.thresholdRising,cr=undefined===i.minMeasuredValueVisible?!1:i.minMeasuredValueVisible,lr=undefined===i.maxMeasuredValueVisible?!1:i.maxMeasuredValueVisible,bu=undefined===i.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:i.labelNumberFormat,iu=undefined===i.foregroundVisible?!0:i.foregroundVisible,si=undefined===i.playAlarm?!1:i.playAlarm,ru=undefined===i.alarmSound?!1:i.alarmSound,bt=undefined===i.valueGradient?null:i.valueGradient,uu=undefined===i.useValueGradient?!1:i.useValueGradient,fu=undefined===i.fullScaleDeflectionTime?2.5:i.fullScaleDeflectionTime,b=f.getElementById(n).getContext("2d");v===0&&(v=b.canvas.width),p===0&&(p=b.canvas.height),b.canvas.width=v,b.canvas.height=p,u=v,e=p,si&&ru!==!1&&(ii=f.createElement("audio"),ii.setAttribute("src",ru),ii.setAttribute("preload","auto"));var ku=this,a=r,yt=h,wt=r,ri,k=!1,hi=!1,ci=!1,gi=!1,ot=[],eu=0,c=v<=p,ar,vr,st=Math.round((c?p:v)*.05),et=Math.round((c?v:p)*.05),yr,pr;c?(ar=u/2-st/2,vr=.053*e,yr=Math.floor(e/22)+"px "+o,pr=Math.floor(e/22)+"px "+ft):(ar=.89*u,vr=e/1.95-st/2,yr=Math.floor(e/10)+"px "+o,pr=Math.floor(e/10)+"px "+ft);var ou=!1,nr=r,tr=h,ir=h-r,su=tr-nr,rr=0,kt=0,li=10,du=10,gu=function(){pu?(ir=y(h-r,!1),kt=y(ir/(du-1),!0),nr=Math.floor(r/kt)*kt,tr=Math.ceil(h/kt)*kt,rr=y(kt/(li-1),!0),r=nr,h=tr,su=h-r):(ir=h-r,nr=r,tr=h,su=ir,rr=1,kt=10)},ai=t(v,p),hu=ai.getContext("2d"),vi=t(v,p),rt=vi.getContext("2d"),ur,ut=f.createElement("canvas");c?(ut.width=u*.121428,ut.height=e*.012135):(ut.width=u*.012135,ut.height=e*.121428),yi=ut.getContext("2d"),tt=f.createElement("canvas"),c?(tt.width=u*.121428,tt.height=e*.012135):(tt.width=u*.012135,tt.height=e*.121428);var cu=tt.getContext("2d"),ui=t(st,st),wr=ui.getContext("2d"),gt=t(st,st),br=gt.getContext("2d"),fi=gt,pi=t(et,et),lu=pi.getContext("2d"),wi=t(et,et),au=wi.getContext("2d"),bi=t(v,p),vu=bi.getContext("2d"),nf=function(n,t,i){n.save(),n.textAlign="right",n.textBaseline="middle",n.strokeStyle=ti.textColor,n.fillStyle=ti.textColor,(ti===steelseries.LcdColor.STANDARD||ti===steelseries.LcdColor.STANDARD_GREEN)&&(n.shadowColor="gray",i?(n.shadowOffsetX=u*.007,n.shadowOffsetY=u*.007,n.shadowBlur=u*.009):(n.shadowOffsetX=e*.007,n.shadowOffsetY=e*.007,n.shadowBlur=e*.009));var r,f,o;n.font=wu?pr:yr,i?(r=(u-u*.571428)/2+1+u*.571428-2,f=e*.88+1+(e*.055-2)/2,o=u*.7-2):(r=u*.695+u*.18-2,f=e*.22+1+(e*.15-2)/2,o=e*.22-2),n.fillText(t.toFixed(tu),r,f,o),n.restore()},tf=function(n){var i=f.createElement("canvas"),t,r;return i.height=i.width=et,t=i.getContext("2d"),t.save(),r=t.createLinearGradient(0,.1,0,i.height*.9),r.addColorStop(0,"#520000"),r.addColorStop(.3,"#fc1d00"),r.addColorStop(.59,"#fc1d00"),r.addColorStop(1,"#520000"),t.fillStyle=r,n?(t.beginPath(),t.moveTo(.1,i.height*.5),t.lineTo(i.width*.9,.1),t.lineTo(i.width*.9,i.height*.9),t.closePath()):(t.beginPath(),t.moveTo(.1,.1),t.lineTo(i.width*.9,.1),t.lineTo(i.width*.5,i.height*.9),t.closePath()),t.fill(),t.strokeStyle="#FFFFFF",t.stroke(),t.restore(),i},rf=function(n,t,i){var o,rt;g.labelColor.setAlpha(1),n.save(),n.textBaseline="middle",o=u*.1,n.strokeStyle=g.labelColor.getRgbaColor(),n.fillStyle=g.labelColor.getRgbaColor();var s=r,c=li-1,l,f,y,p,w,a,v=1,b,k,d,nt,tt,it;for(i?(b=.34*u,k=.36*u,d=.33*u,nt=.36*u,tt=.32*u,it=.36*u,n.textAlign="right",y=0,p=e*.12864,w=0,a=e*.856796-e*.12864,v=a/(h-r)):(b=.65*e,k=.63*e,d=.66*e,nt=.63*e,tt=.67*e,it=.63*e,n.textAlign="center",y=u*.142857,p=0,w=u*.871012-u*.142857,a=0,v=w/(h-r)),rt=r,l=0;rt<=h;rt+=rr,l+=rr){if(f=i?p+a-l*v:y+l*v,c++,c===li){if(n.lineWidth=1.5,kr(n,tt,it,f,i),i)switch(t.format){case"fractional":n.fillText(s.toFixed(2),u*.28,f,o);break;case"scientific":n.fillText(s.toPrecision(2),u*.28,f,o);break;case"standard":default:n.fillText(s.toFixed(0),u*.28,f,o)}else switch(t.format){case"fractional":n.fillText(s.toFixed(2),f,e*.73,o);break;case"scientific":n.fillText(s.toPrecision(2),f,e*.73,o);break;case"standard":default:n.fillText(s.toFixed(0),f,e*.73,o)}s+=kt,c=0;continue}0==li%2&&c===li/2?(n.lineWidth=1,kr(n,d,nt,f,i)):(n.lineWidth=.5,kr(n,b,k,f,i))}n.restore()},kr=function(n,t,i,r,u){u?(n.beginPath(),n.moveTo(t,r),n.lineTo(i,r),n.closePath(),n.stroke()):(n.beginPath(),n.moveTo(r,t),n.lineTo(r,i),n.closePath(),n.stroke())},d=function(n){var i,t,f,o,l,a;n=n||{};var y=undefined===n.frame?!1:n.frame,v=undefined===n.background?!1:n.background,p=undefined===n.led?!1:n.led,b=undefined===n.foreground?!1:n.foreground,k=undefined===n.bargraphled?!1:n.bargraphled;if(ou=!0,gu(),y&&nu&&lt(hu,gr,u,e,c),v&&or&&at(rt,g,u,e,c),p&&(c?(wr.drawImage(s(st,1,oi),0,0),br.drawImage(s(st,0,oi),0,0)):(wr.drawImage(s(st,1,oi),0,0),br.drawImage(s(st,0,oi),0,0))),cr&&(c?lu.drawImage(w(et,steelseries.ColorDef.BLUE.dark.getRgbaColor(),!1,c),0,0):lu.drawImage(w(et,steelseries.ColorDef.BLUE.dark.getRgbaColor(),!1,c),0,0)),lr&&(c?au.drawImage(w(et,steelseries.ColorDef.RED.medium.getRgbaColor(),!1,c),0,0):au.drawImage(w(et,steelseries.ColorDef.RED.medium.getRgbaColor(),!1,c),0,0)),v&&or&&(rf(rt,bu,c),hr&&(rt.save(),c?(i=e*.856796-e*.728155*(it-r)/(h-r),rt.translate(u*.365,i-et/2)):(i=(u*.856796-u*.12864)*(it-r)/(h-r),rt.translate(u*.142857-et/2+i,e*.58)),rt.drawImage(tf(c),0,0),rt.restore()),c?pt(rt,u,e,fr,er,g,c,null,di):pt(rt,u,e,fr,er,g,c,null,di)),v&&di&&(c?(ur=nt(u*.571428,e*.055,ti),rt.drawImage(ur,(u-u*.571428)/2,e*.88)):(ur=nt(u*.18,e*.15,ti),rt.drawImage(ur,u*.695,e*.22))),k&&(ef(cu),dr(yi,ei)),ci=!1,null!==ni&&0<ni.length){ci=!0,t=ni.length,c?(f=e*.12864,o=e*.856796,l=o-f,a=0):(f=u*.856796,o=u*.12864,l=f-o,a=u*.012135/2),ot=[];do t--,ot.push({start:(ni[t].start+Math.abs(r))/(h-r)*l-a,stop:(ni[t].stop+Math.abs(r))/(h-r)*l-a,color:dt(ni[t].color)});while(0<t)}gi=!1,uu&&bt!==null&&(ci=!1,gi=!0),b&&iu&&vt(vu,u,e,c,!1)},ht=function(n){n=n||{};var t=undefined===n.frame?!1:n.frame,i=undefined===n.background?!1:n.background,r=undefined===n.led?!1:n.led,u=undefined===n.bargraphled?!1:n.bargraphled,f=undefined===n.foreground?!1:n.foreground;t&&(ai.width=v,ai.height=p,hu=ai.getContext("2d")),i&&(vi.width=v,vi.height=p,rt=vi.getContext("2d")),u&&(c?(ut.width=v*.121428,ut.height=p*.012135):(ut.width=v*.012135,ut.height=p*.121428),yi=ut.getContext("2d"),c?(tt.width=v*.121428,tt.height=p*.012135):(tt.width=v*.012135,tt.height=p*.121428),cu=tt.getContext("2d")),r&&(ui.width=Math.ceil(v*.093457),ui.height=Math.ceil(p*.093457),wr=ui.getContext("2d"),gt.width=Math.ceil(v*.093457),gt.height=Math.ceil(p*.093457),br=gt.getContext("2d"),fi=gt),f&&(bi.width=v,bi.height=p,vu=bi.getContext("2d"))},ki=function(n){n?eu=setInterval(uf,1e3):(clearInterval(eu),fi=gt)},uf=function(){sr&&(fi=fi===ui?gt:ui,hi||(hi=!0,l(ku.repaint)))},ff=function(n,t,i){var s,ft,f=g.labelColor,u,yt,ti,d,et,ht,pt,wt,kt,gt,ni,ct,lt,p,y,nt,it,w,b,k,rt,ii,ri,at,vt,e,o,l,st,v;if(c?(s=i*.12864,ft=i*.856796,u=ft-s,yt=u*(a-r)/(h-r),ti=s+u-yt,d=0,et=s,ht=0,pt=s+u*1.014):(s=t*.856796,ft=t*.12864,u=s-ft,yt=u*(a-r)/(h-r),ti=ft,d=t*.13,et=i*.435714,ht=d+u*1.035,pt=et),y=g===steelseries.BackgroundColor.CARBON||g===steelseries.BackgroundColor.PUNCHED_SHEET||g===steelseries.BackgroundColor.STAINLESS||g===steelseries.BackgroundColor.BRUSHED_STAINLESS||g===steelseries.BackgroundColor.TURNED?.3:0,nt=n.createLinearGradient(d,et,ht,pt),f.setAlpha(.047058+y),nt.addColorStop(0,f.getRgbaColor()),f.setAlpha(.145098+y),nt.addColorStop(.48,f.getRgbaColor()),f.setAlpha(.149019+y),nt.addColorStop(.49,f.getRgbaColor()),f.setAlpha(.047058+y),nt.addColorStop(1,f.getRgbaColor()),n.fillStyle=nt,c?n.fillRect(t*.435714,s,t*.15,u*1.014):n.fillRect(d,et,u*1.035,i*.152857),c?(wt=0,kt=s,gt=0,ni=s+u*1.014):(wt=d,kt=0,gt=ht,ni=0),it=n.createLinearGradient(wt,kt,gt,ni),f.setAlpha(.298039+y),it.addColorStop(0,f.getRgbaColor()),f.setAlpha(.686274+y),it.addColorStop(.48,f.getRgbaColor()),f.setAlpha(.698039+y),it.addColorStop(.49,f.getRgbaColor()),f.setAlpha(.4+y),it.addColorStop(1,f.getRgbaColor()),n.fillStyle=it,c?(n.fillRect(t*.435714,s,t*.007142,u*1.014),n.fillRect(t*.571428,s,t*.007142,u*1.014)):(n.fillRect(t*.13,i*.435714,u*1.035,i*.007142),n.fillRect(t*.13,i*.571428,u*1.035,i*.007142)),c?(w=t*.45,b=i*.851941,k=t*.121428,rt=i*.012135,ii=(w+k)/2,ri=(b+rt)/2):(w=t*.142857,b=i*.45,k=t*.012135,rt=i*.121428,ii=(w+k)/2,ri=(b+rt)/2),st=ei,c){for(vt=u,o=0;o<=vt;o+=rt+1)n.translate(0,-o),n.drawImage(tt,w,b),n.translate(0,o);for(at=(a-r)/(h-r)*u,o=0;o<=at;o+=rt+1){if(l=ei,gi)ct=r+o/u*(h-r),lt=bt.getEnd()-bt.getStart(),p=ct/lt,p=Math.max(Math.min(p,1),0),l=dt(bt.getColorAt(p).getRgbaColor());else if(ci)for(v=0;v<ot.length;v++)if(o>=ot[v].start&&o<ot[v].stop){l=ot[v].color;break}st.medium.getHexColor()!==l.medium.getHexColor()&&(dr(yi,l),st=l),n.translate(0,-o),n.drawImage(ut,w,b),n.translate(0,o)}}else{for(vt=u,e=-(k/2);e<=vt;e+=k+1)n.translate(e,0),n.drawImage(tt,w,b),n.translate(-e,0);for(at=(a-r)/(h-r)*u,e=-(k/2);e<=at;e+=k+1){if(l=ei,gi)ct=r+e/u*(h-r),lt=bt.getEnd()-bt.getStart(),p=ct/lt,p=Math.max(Math.min(p,1),0),l=dt(bt.getColorAt(p).getRgbaColor());else if(ci)for(v=0;v<ot.length;v++)if(e>=ot[v].start&&e<ot[v].stop){l=ot[v].color;break}st.medium.getHexColor()!==l.medium.getHexColor()&&(dr(yi,l),st=l),n.translate(e,0),n.drawImage(ut,w,b),n.translate(-e,0)}}},ef=function(n){n.save(),n.beginPath(),n.rect(0,0,n.canvas.width,n.canvas.height),n.closePath();var i=n.canvas.width/2,r=n.canvas.height/2,t=b.createRadialGradient(i,r,0,i,r,n.canvas.width/2);t.addColorStop(0,"#3c3c3c"),t.addColorStop(1,"#323232"),n.fillStyle=t,n.fill(),n.restore()},dr=function(n,t){var r,u,f,i;n.save(),n.beginPath(),n.rect(0,0,n.canvas.width,n.canvas.height),n.closePath(),r=n.canvas.width/2,u=n.canvas.height/2,f=c?n.canvas.width/2:n.canvas.height/2,i=b.createRadialGradient(r,u,0,r,u,f),i.addColorStop(0,t.light.getRgbaColor()),i.addColorStop(1,t.dark.getRgbaColor()),n.fillStyle=i,n.fill(),n.restore()};return this.setValue=function(n){n=parseFloat(n);var t=n<r?r:n>h?h:n;return a!==t&&(a=t,a>wt&&(wt=a),a<yt&&(yt=a),a>=it&&!k&&ct||a<=it&&!k&&!ct?(k=!0,ki(k),si&&ii.play()):(a<it&&k&&ct||a>it&&k&&!ct)&&(k=!1,ki(k),si&&ii.pause()),this.repaint()),this},this.getValue=function(){return a},this.setValueAnimated=function(n){var t,u=this,i;return n=parseFloat(n),t=n<r?r:n>h?h:n,a!==t&&(undefined!==ri&&ri.isPlaying&&ri.stop(),i=fu*Math.abs(t-a)/(h-r),i=Math.max(i,fu/5),ri=new Tween({},"",Tween.regularEaseInOut,a,t,i),ri.onMotionChanged=function(n){a=n.target._pos,a>=it&&!k&&ct||a<=it&&!k&&!ct?(k=!0,ki(k),si&&ii.play()):(a<it&&k&&ct||a>it&&k&&!ct)&&(k=!1,ki(k),si&&ii.pause()),a>wt&&(wt=a),a<yt&&(yt=a),hi||(hi=!0,l(u.repaint))},ri.start()),this},this.resetMinMeasuredValue=function(){return yt=a,this.repaint(),this},this.resetMaxMeasuredValue=function(){return wt=a,this.repaint(),this},this.setMinMeasuredValueVisible=function(n){return cr=!!n,this.repaint(),this},this.setMaxMeasuredValueVisible=function(n){return lr=!!n,this.repaint(),this},this.setThresholdVisible=function(n){return hr=!!n,this.repaint(),this},this.setThresholdRising=function(n){return ct=!!n,k=!k,ki(k),this.repaint(),this},this.setLcdDecimals=function(n){return tu=parseInt(n,10),this.repaint(),this},this.setFrameDesign=function(n){return ht({frame:!0}),gr=n,d({frame:!0}),this.repaint(),this},this.setBackgroundColor=function(n){return ht({background:!0}),g=n,d({background:!0}),this.repaint(),this},this.setValueColor=function(n){return ht({bargraphled:!0}),ei=n,d({bargraphled:!0}),this.repaint(),this},this.setLedColor=function(n){return ht({led:!0}),oi=n,d({led:!0}),this.repaint(),this},this.setLedVisible=function(n){return sr=!!n,this.repaint(),this},this.setLcdColor=function(n){return ti=n,ht({background:!0}),d({background:!0}),this.repaint(),this},this.setSection=function(n){return ni=n,d(),this.repaint(),this},this.setSectionActive=function(n){return yu=n,d(),this.repaint(),this},this.setGradient=function(n){return bt=n,d(),this.repaint(),this},this.setGradientActive=function(n){return uu=n,d(),this.repaint(),this},this.setMaxMeasuredValue=function(n){n=parseFloat(n);var t=n<r?r:n>h?h:n;return wt!==t&&(wt=t,this.repaint()),this},this.setMinMeasuredValue=function(n){n=parseFloat(n);var t=n<r?r:n>h?h:n;return yt!==t&&(yt=t,this.repaint()),this},this.setTitleString=function(n){return fr=n,ht({background:!0}),d({background:!0}),this.repaint(),this},this.setUnitString=function(n){return er=n,ht({background:!0}),d({background:!0}),this.repaint(),this},this.setMinValue=function(n){return r=parseFloat(n),ht({background:!0,foreground:!0,pointer:!0}),d({background:!0,foreground:!0,pointer:!0}),this.repaint(),this},this.getMinValue=function(){return r},this.setMaxValue=function(n){return h=parseFloat(n),ht({background:!0,foreground:!0,pointer:!0}),d({background:!0,foreground:!0,pointer:!0}),this.repaint(),this},this.getMaxValue=function(){return h},this.setThreshold=function(n){n=parseFloat(n);var t=n<r?r:n>h?h:n;return it!==t&&(it=t,ht({background:!0}),d({background:!0}),this.repaint()),this},this.setThresholdVisible=function(n){return hr=!!n,this.repaint(),this},this.repaint=function(){ou||d({frame:!0,background:!0,led:!0,pointer:!0,foreground:!0,bargraphled:!0}),b.clearRect(0,0,b.canvas.width,b.canvas.height),nu&&b.drawImage(ai,0,0),or&&b.drawImage(vi,0,0),di&&nf(b,a,c),sr&&b.drawImage(fi,ar,vr);var n,t,i;cr&&(c?(n=e*.856796-e*.728155*(yt-r)/(h-r),t=u*.34-pi.width,i=n-pi.height/2):(n=(u*.856796-u*.12864)*(yt-r)/(h-r),t=u*.142857-pi.height/2+n,i=e*.65),b.drawImage(pi,t,i)),lr&&(c?(n=e*.856796-e*.728155*(wt-r)/(h-r),t=u*.34-wi.width,i=n-wi.height/2):(n=(u*.856796-u*.12864)*(wt-r)/(h-r),t=u*.142857-wi.height/2+n,i=e*.65),b.drawImage(wi,t,i)),b.save(),ff(b,u,e),b.restore(),iu&&b.drawImage(bi,0,0),hi=!1},this.repaint(),this},rr=function(n,i){i=i||{};var y=undefined===i.width?0:i.width,p=undefined===i.height?0:i.height,w=undefined===i.lcdColor?steelseries.LcdColor.STANDARD:i.lcdColor,kt=undefined===i.lcdDecimals?2:i.lcdDecimals,rt=undefined===i.unitString?"":i.unitString,ut=undefined===i.unitStringVisible?!1:i.unitStringVisible,dt=undefined===i.headerString?"":i.headerString,et=undefined===i.headerStringVisible?!1:i.headerStringVisible,ot=undefined===i.digitalFont?!1:i.digitalFont,gt=undefined===i.valuesNumeric?!0:i.valuesNumeric,b=undefined===i.value?0:i.value,ni=undefined===i.alwaysScroll?!1:i.alwaysScroll,st=undefined===i.autoScroll?!1:i.autoScroll,u=undefined===i.section?null:i.section,a=!1,h=0,d,g=!1,ti=this,r=f.getElementById(n).getContext("2d");y===0&&(y=r.canvas.width),p===0&&(p=r.canvas.height),r.canvas.width=y,r.canvas.height=p;var s=y,e=p,c=0,k=Math.floor(e/1.5),ct=k+"px "+o,lt=k+"px "+ft,at=!1,vt,pt=[],bt=[],ii=function(n,t){var f,l,i;r.save(),r.textAlign="right",r.strokeStyle=t,r.fillStyle=t,r.beginPath(),r.rect(2,0,s-4,e),r.closePath(),r.clip(),(w===steelseries.LcdColor.STANDARD||w===steelseries.LcdColor.STANDARD_GREEN)&&u===null&&(r.shadowColor="gray",r.shadowOffsetX=e*.035,r.shadowOffsetY=e*.035,r.shadowBlur=e*.055),r.font=ot?lt:ct,gt?(f=0,c=0,ut&&(r.font=Math.floor(e/2.5)+"px "+o,f=r.measureText(rt).width),r.font=ot?lt:ct,l=n.toFixed(kt),c=r.measureText(l).width,i=.38,et&&(i=.52),r.fillText(l,s-f-4-h,e*.5+k*i),ut&&(r.font=Math.floor(e/2.5)+"px "+o,r.fillText(rt,s-2-h,e*.5+k*i)),et&&(r.textAlign="center",r.font=Math.floor(e/3.5)+"px "+o,r.fillText(dt,s/2,e*.3))):(c=r.measureText(n).width,ni||st&&c>s-4?a||(h=c>s*.8?s-c-s*.2:0,a=!0,clearTimeout(d),d=setTimeout(tt,200)):st&&c<=s-4&&(h=0,a=!1),r.fillText(n,s-2-h,e*.5+k*.38)),r.restore()},ri=function(n,i,r,u){var it=t(n,i),f=it.getContext("2d");f.save();var h=0,et=n,rt=i,ut=Math.min(n,i)*.095,s=f.createLinearGradient(0,h,0,h+rt);s.addColorStop(0,"#4c4c4c"),s.addColorStop(.08,"#666666"),s.addColorStop(.92,"#666666"),s.addColorStop(1,"#e6e6e6"),f.fillStyle=s,v(f,0,h,et,rt,ut),f.fill(),f.restore(),f.save();var c=ht(r),e=yt(c[0],c[1],c[2]),l=ht(u.gradientStartColor),ot=yt(l[0],l[1],l[2]),a=ht(u.gradientFraction1Color),st=yt(a[0],a[1],a[2]),y=ht(u.gradientFraction2Color),ct=yt(y[0],y[1],y[2]),p=ht(u.gradientFraction3Color),lt=yt(p[0],p[1],p[2]),w=ht(u.gradientStopColor),at=yt(w[0],w[1],w[2]),b=wt(e[0],e[1],ot[2]-.31),k=wt(e[0],e[1],st[2]-.31),d=wt(e[0],e[1],ct[2]-.31),g=wt(e[0],e[1],lt[2]-.31),nt=wt(e[0],e[1],at[2]-.31),tt=1,vt=n-2,ft=i-2,pt=ut-1,o=f.createLinearGradient(0,tt,0,tt+ft);return o.addColorStop(0,"rgb("+b[0]+", "+b[1]+", "+b[2]+")"),o.addColorStop(.03,"rgb("+k[0]+","+k[1]+","+k[2]+")"),o.addColorStop(.49,"rgb("+d[0]+","+d[1]+","+d[2]+")"),o.addColorStop(.5,"rgb("+g[0]+","+g[1]+","+g[2]+")"),o.addColorStop(1,"rgb("+nt[0]+","+nt[1]+","+nt[2]+")"),f.fillStyle=o,v(f,1,tt,vt,ft,pt),f.fill(),f.restore(),it},ui=function(n){var t=ht(n),r=yt(t[0],t[1],t[2]),i=wt(r[0],.57,.83);return"rgb("+i[0]+", "+i[1]+", "+i[2]+")"},tt=function(){a?(h>s&&(h=-c),h+=2,d=setTimeout(tt,50)):h=0,g||(g=!0,l(ti.repaint))},it=function(){var n;if(at=!0,vt=nt(y,p,w),null!==u&&0<u.length)for(n=0;n<u.length;n++)pt[n]=ri(y,p,u[n].color,w),bt[n]=ui(u[n].color)};return this.setValue=function(n){return b!==n&&(b=n,this.repaint()),this},this.setLcdColor=function(n){return w=n,it(),this.repaint(),this},this.setSection=function(n){return u=n,it({background:!0,foreground:!0}),this.repaint(),this},this.setScrolling=function(n){if(n){if(a)return;a=n,tt()}else a=n;return this},this.repaint=function(){at||it(),r.clearRect(0,0,r.canvas.width,r.canvas.height);var t=vt,i=w.textColor,n;if(null!==u&&0<u.length)for(n=0;n<u.length;n++)if(b>=u[n].start&&b<=u[n].stop){t=pt[n],i=bt[n];break}r.drawImage(t,0,0),ii(b,i),g=!1},this.repaint(),this},ur=function(n,t){t=t||{};var h=undefined===t.width?0:t.width,c=undefined===t.height?0:t.height,e=undefined===t.lcdColor?steelseries.LcdColor.STANDARD:t.lcdColor,y=undefined===t.lcdDecimals?2:t.lcdDecimals,p=undefined===t.headerString?"":t.headerString,s=undefined===t.headerStringVisible?!1:t.headerStringVisible,it=undefined===t.detailString?"":t.detailString,rt=undefined===t.detailStringVisible?!1:t.detailStringVisible,ut=undefined===t.linkAltValue?!0:t.linkAltValue,v=undefined===t.unitString?"":t.unitString,w=undefined===t.unitStringVisible?!1:t.unitStringVisible,b=undefined===t.digitalFont?!1:t.digitalFont,et=undefined===t.valuesNumeric?!0:t.valuesNumeric,a=undefined===t.value?0:t.value,l=undefined===t.altValue?0:t.altValue,i=f.getElementById(n).getContext("2d");h===0&&(h=i.canvas.width),c===0&&(c=i.canvas.height),i.canvas.width=h,i.canvas.height=c;var u=h,r=c,ot=Math.floor(r/1.875)+"px "+o,st=Math.floor(r/1.875)+"px "+ft,k=Math.floor(r/3.5)+"px "+o,ht=Math.floor(r/3.5)+"px "+ft,d=!1,g,ct=function(n){var t,h,f;i.save(),i.textAlign="right",i.textBaseline="middle",i.strokeStyle=e.textColor,i.fillStyle=e.textColor,(e===steelseries.LcdColor.STANDARD||e===steelseries.LcdColor.STANDARD_GREEN)&&(i.shadowColor="gray",i.shadowOffsetX=r*.025,i.shadowOffsetY=r*.025,i.shadowBlur=r*.05),et?(i.font=s?Math.floor(r/3)+"px "+o:Math.floor(r/2.5)+"px "+o,t=0,w&&(s?(i.font=Math.floor(r/3)+"px "+o,t=i.measureText(v).width):(i.font=Math.floor(r/2.5)+"px "+o,t=i.measureText(v).width)),i.font=b?st:ot,h=n.toFixed(y),s?i.fillText(h,u-t-4,r*.5):i.fillText(h,u-t-4,r*.38),w&&(i.font=Math.floor(r/3)+"px "+o,i.fillText(v,u-2,r*.55)),f=l.toFixed(y),rt&&(f=it+f),i.font=b?ht:s?Math.floor(r/5)+"px "+o:k,i.textAlign="center",s?(i.fillText(f,u/2,r*.83),i.fillText(p,u/2,r*.16)):i.fillText(f,u/2,r*.8)):s?(i.font=Math.floor(r/3.5)+"px "+o,i.fillText(n,u-2,r*.48),i.font=Math.floor(r/5)+"px "+o,i.textAlign="center",i.fillText(l,u/2,r*.83),i.fillText(p,u/2,r*.17)):(i.font=Math.floor(r/2.5)+"px "+o,i.fillText(n,u-2,r*.38),i.font=k,i.textAlign="center",i.fillText(l,u/2,r*.8)),i.restore()},tt=function(){d=!0,g=nt(h,c,e)};return this.setValue=function(n){return(a!==n||l!==n)&&(ut&&(l=a),a=n,this.repaint()),this},this.setAltValue=function(n){return n!==n&&(n=n,this.repaint()),this},this.setLcdColor=function(n){return e=n,tt(),this.repaint(),this},this.repaint=function(){d||tt(),i.clearRect(0,0,i.canvas.width,i.canvas.height),i.drawImage(g,0,0),ct(a)},this.repaint(),this},fr=function(n,s){s=s||{};var y=undefined===s.size?0:s.size,at=undefined===s.decimalsVisible?!1:s.decimalsVisible,ui=undefined===s.textOrientationFixed?!1:s.textOrientationFixed,pt=undefined===s.frameDesign?steelseries.FrameDesign.METAL:s.frameDesign,wt=undefined===s.frameVisible?!0:s.frameVisible,nt=undefined===s.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:s.backgroundColor,bt=undefined===s.backgroundVisible?!0:s.backgroundVisible,tt=undefined===s.pointerColor?steelseries.ColorDef.RED:s.pointerColor,kt=undefined===s.foregroundType?steelseries.ForegroundType.TYPE1:s.foregroundType,dt=undefined===s.foregroundVisible?!0:s.foregroundVisible,fi=undefined===s.rotateFace?!1:s.rotateFace,v=f.getElementById(n).getContext("2d");y===0&&(y=Math.min(v.canvas.width,v.canvas.height)),v.canvas.width=y,v.canvas.height=y;var rt,vt=!1,c=0,it=0,p=0,gt=r/360,ht=this.value,ni=at?1:0,h=y,a=y,w=h/2,b=a/2,ti=!1,ut=t(y,y),ct=ut.getContext("2d"),ft=t(y,y),yt=ft.getContext("2d"),et=t(y,y),ii=et.getContext("2d"),ot=t(y,y),ri=ot.getContext("2d"),ei=function(n){var r,f,t;for(n.textAlign="center",n.textBaseline="middle",n.save(),n.strokeStyle=nt.labelColor.getRgbaColor(),n.fillStyle=nt.labelColor.getRgbaColor(),n.translate(w,b),t=0;360>t;t++){n.strokeStyle=nt.labelColor.getRgbaColor(),n.lineWidth=.5,n.beginPath(),n.moveTo(h*.38,0),n.lineTo(h*.37,0),n.closePath(),n.stroke(),0==t%5&&(n.strokeStyle=nt.labelColor.getRgbaColor(),n.lineWidth=1,n.beginPath(),n.moveTo(h*.38,0),n.lineTo(h*.36,0),n.closePath(),n.stroke()),0==t%45&&(n.strokeStyle=nt.labelColor.getRgbaColor(),n.lineWidth=1,n.beginPath(),n.moveTo(h*.38,0),n.lineTo(h*.34,0),n.closePath(),n.stroke()),300<h&&(r="14px "+r,f="12px "+r),300>=h&&(r="12px "+r,f="10px "+r),200>=h&&(r="10px "+r,f="8px "+r),100>=h&&(r="8px "+r,f="6px "+r),n.save();switch(t){case 0:n.translate(h*.31,0),n.rotate(t*u+i),n.font=r,n.fillText("0Â°",0,0,h),n.rotate(-(t*u)+i),n.translate(-h*.31,0),n.translate(h*.41,0),n.rotate(t*u-i),n.font=f,n.fillText("0%",0,0,h);break;case 45:n.translate(h*.31,0),n.rotate(t*u+.25*e),n.font=r,n.fillText("45Â°",0,0,h),n.rotate(-(t*u)+.25*e),n.translate(-h*.31,0),n.translate(h*.31,h*.085),n.rotate(t*u-.25*e),n.font=f,n.fillText("100%",0,0,h);break;case 90:n.translate(h*.31,0),n.rotate(t*u),n.font=r,n.fillText("90Â°",0,0,h),n.rotate(-(t*u)),n.translate(-h*.31,0),n.translate(h*.21,0),n.rotate(t*u),n.font=f,n.fillText("âˆž",0,0,h);break;case 135:n.translate(h*.31,0),n.rotate(t*u-.25*e),n.font=r,n.fillText("45Â°",0,0,h),n.rotate(-(t*u)-.25*e),n.translate(-h*.31,0),n.translate(h*.31,-h*.085),n.rotate(t*u+.25*e),n.font=f,n.fillText("100%",0,0,h);break;case 180:n.translate(h*.31,0),n.rotate(t*u-i),n.font=r,n.fillText("0Â°",0,0,h),n.rotate(-(t*u)-i),n.translate(-h*.31,0),n.translate(h*.41,0),n.rotate(t*u+i),n.font=f,n.fillText("0%",0,0,h),n.translate(-h*.41,0);break;case 225:n.translate(h*.31,0),n.rotate(t*u-.75*e),n.font=r,n.fillText("45Â°",0,0,h),n.rotate(-(t*u)-.75*e),n.translate(-h*.31,0),n.translate(h*.31,h*.085),n.rotate(t*u+.75*e),n.font=f,n.fillText("100%",0,0,h);break;case 270:n.translate(h*.31,0),n.rotate(t*u-e),n.font=r,n.fillText("90Â°",0,0,h),n.rotate(-(t*u)-e),n.translate(-h*.31,0),n.translate(h*.21,0),n.rotate(t*u-e),n.font=f,n.fillText("âˆž",0,0,h);break;case 315:n.translate(h*.31,0),n.rotate(t*u-1.25*e),n.font=r,n.fillText("45Â°",0,0,h),n.rotate(-(t*u)-1.25*e),n.translate(-h*.31,0),n.translate(h*.31,-h*.085),n.rotate(t*u+1.25*e),n.font=f,n.fillText("100%",0,0,h)}n.restore(),n.rotate(gt)}n.translate(-w,-b),n.restore()},oi=function(n){n.save(),n.strokeStyle=nt.labelColor.getRgbaColor(),n.fillStyle=nt.labelColor.getRgbaColor(),n.save(),n.beginPath(),n.moveTo(h*.200934,a*.434579),n.lineTo(h*.163551,a*.434579),n.lineTo(h*.163551,a*.560747),n.lineTo(h*.200934,a*.560747),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.stroke(),n.save(),n.beginPath(),n.moveTo(h*.163551,a*.471962),n.lineTo(h*.205607,a*.5),n.lineTo(h*.163551,a*.523364),n.lineTo(h*.163551,a*.471962),n.closePath(),n.fill(),n.save(),n.beginPath(),n.moveTo(h*.799065,a*.434579),n.lineTo(h*.836448,a*.434579),n.lineTo(h*.836448,a*.560747),n.lineTo(h*.799065,a*.560747),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.stroke(),n.save(),n.beginPath(),n.moveTo(h*.836448,a*.471962),n.lineTo(h*.794392,a*.5),n.lineTo(h*.836448,a*.523364),n.lineTo(h*.836448,a*.471962),n.closePath(),n.fill(),n.restore()},si=function(n){var u;n.save(),n.save(),n.beginPath(),n.moveTo(h*.523364,a*.350467),n.lineTo(h*.5,a*.130841),n.lineTo(h*.476635,a*.350467),n.bezierCurveTo(h*.476635,a*.350467,h*.490654,a*.345794,h*.5,a*.345794),n.bezierCurveTo(h*.509345,a*.345794,h*.523364,a*.350467,h*.523364,a*.350467),n.closePath();var t=n.createLinearGradient(0,.154205*a,0,.350466*a),i=tt.dark,r=tt.light;i.setAlpha(.70588),r.setAlpha(.70588),t.addColorStop(0,i.getRgbaColor()),t.addColorStop(.3,r.getRgbaColor()),t.addColorStop(.59,r.getRgbaColor()),t.addColorStop(1,i.getRgbaColor()),n.fillStyle=t,u=tt.light.getRgbaColor(),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.strokeStyle=u,n.fill(),n.stroke(),i.setAlpha(1),r.setAlpha(1),n.restore()},hi=function(n){var t,i,r,f,u,e;n.save(),t=tt.dark,i=tt.light,t.setAlpha(.70588),i.setAlpha(.70588),n.save(),n.beginPath(),n.moveTo(h*.285046,a*.514018),n.lineTo(h*.21028,a*.5),n.lineTo(h*.285046,a*.481308),n.bezierCurveTo(h*.285046,a*.481308,h*.280373,a*.490654,h*.280373,a*.495327),n.bezierCurveTo(h*.280373,a*.504672,h*.285046,a*.514018,h*.285046,a*.514018),n.closePath(),r=n.createLinearGradient(.224299*h,0,.289719*h,0),r.addColorStop(0,t.getRgbaColor()),r.addColorStop(.3,i.getRgbaColor()),r.addColorStop(.59,i.getRgbaColor()),r.addColorStop(1,t.getRgbaColor()),n.fillStyle=r,f=tt.light.getRgbaColor(),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.strokeStyle=f,n.fill(),n.stroke(),n.save(),n.beginPath(),n.moveTo(h*.714953,a*.514018),n.lineTo(h*.789719,a*.5),n.lineTo(h*.714953,a*.481308),n.bezierCurveTo(h*.714953,a*.481308,h*.719626,a*.490654,h*.719626,a*.495327),n.bezierCurveTo(h*.719626,a*.504672,h*.714953,a*.514018,h*.714953,a*.514018),n.closePath(),u=n.createLinearGradient(.7757*h,0,.71028*h,0),u.addColorStop(0,t.getRgbaColor()),u.addColorStop(.3,i.getRgbaColor()),u.addColorStop(.59,i.getRgbaColor()),u.addColorStop(1,t.getRgbaColor()),n.fillStyle=u,e=tt.light.getRgbaColor(),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.strokeStyle=e,n.fill(),n.stroke(),t.setAlpha(1),i.setAlpha(1),n.restore()},st=function(){ti=!0,wt&&k(ct,pt,w,b,h,a),bt&&(g(ct,nt,w,b,h,a),ei(ct)),oi(yt),si(yt),hi(ii),dt&&d(ri,kt,h,a,!1)},lt=function(){ut.width=y,ut.height=y,ct=ut.getContext("2d"),ft.width=y,ft.height=y,yt=ft.getContext("2d"),et.width=y,et.height=y,ii=et.getContext("2d"),ot.width=y,ot.height=y,ri=ot.getContext("2d")};return this.setValue=function(n){var t;return n=parseFloat(n),t=0>n?360+n:n,t=359.9<n?n-360:n,c!==t&&(c=t,it=2*(Math.abs(c)*10%10),10<it&&(it-=20),0===c&&(p=90),0<c&&90>=c&&(p=90-c),90<c&&180>=c&&(p=c-90),180<c&&270>=c&&(p=270-c),270<c&&360>=c&&(p=c-270),0>c&&c>=-90&&(p=90-Math.abs(c)),c<-90&&c>=-180&&(p=Math.abs(c)-90),c<-180&&c>=-270&&(p=270-Math.abs(c)),c<-270&&c>=-360&&(p=Math.abs(c)-270),this.repaint()),this},this.getValue=function(){return c},this.setValueAnimated=function(n){if(n=parseFloat(n),360-n+c<n-c&&(n=360-n),c!==n){undefined!==rt&&rt.isPlaying&&rt.stop(),rt=new Tween({},"",Tween.regularEaseInOut,c,n,1);var t=this;rt.onMotionChanged=function(n){c=n.target._pos,it=2*(Math.abs(c)*10%10),10<it&&(it-=20),0===c&&(p=90),0<c&&90>=c&&(p=90-c),90<c&&180>=c&&(p=c-90),180<c&&270>=c&&(p=270-c),270<c&&360>=c&&(p=c-270),0>c&&c>=-90&&(p=90-Math.abs(c)),c<-90&&c>=-180&&(p=Math.abs(c)-90),c<-180&&c>=-270&&(p=270-Math.abs(c)),c<-270&&c>=-360&&(p=Math.abs(c)-270),vt||(vt=!0,l(t.repaint))},rt.start()}return this},this.setFrameDesign=function(n){return lt(),pt=n,st(),this.repaint(),this},this.setBackgroundColor=function(n){return lt(),nt=n,st(),this.repaint(),this},this.setForegroundType=function(n){return lt(),kt=n,st(),this.repaint(),this},this.setPointerColor=function(n){return lt(),tt=n,st(),this.repaint(),this},this.repaint=function(){ti||st(),v.save(),v.clearRect(0,0,v.canvas.width,v.canvas.height),ht=i+c*gt-i,fi&&(v.translate(w,b),v.rotate(-ht),v.translate(-w,-b)),(wt||bt)&&v.drawImage(ut,0,0),v.save(),v.translate(w,b),v.rotate(ht),v.translate(-w,-b),v.drawImage(ft,0,0),v.fillStyle=nt.labelColor.getRgbaColor(),v.textAlign="center",v.textBaseline="middle",ui?(v.restore(),v.font=at?h*.1+"px "+o:h*.15+"px "+o,v.fillText(p.toFixed(ni)+"Â°",w,b,h*.35)):(v.font=at?h*.15+"px "+o:h*.2+"px "+o,v.fillText(p.toFixed(ni)+"Â°",w,b,h*.35),v.restore()),v.translate(w,b),v.rotate(ht+it*u),v.translate(-w,-b),v.drawImage(et,0,0),v.restore(),dt&&v.drawImage(ot,0,0),v.restore(),vt=!1},this.repaint(),this},er=function(n,r){r=r||{};var h=undefined===r.size?0:r.size,vt=undefined===r.frameDesign?steelseries.FrameDesign.METAL:r.frameDesign,yt=undefined===r.frameVisible?!0:r.frameVisible,nt=undefined===r.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:r.backgroundColor,et=undefined===r.backgroundVisible?!0:r.backgroundVisible,pt=undefined===r.pointerType?steelseries.PointerType.TYPE2:r.pointerType,c=undefined===r.pointerColor?steelseries.ColorDef.RED:r.pointerColor,ri=undefined===r.knobType?steelseries.KnobType.STANDARD_KNOB:r.knobType,ui=undefined===r.knobStyle?steelseries.KnobStyle.SILVER:r.knobStyle,wt=undefined===r.foregroundType?steelseries.ForegroundType.TYPE1:r.foregroundType,bt=undefined===r.foregroundVisible?!0:r.foregroundVisible,a=undefined===r.pointSymbols?["N","NE","E","SE","S","SW","W","NW"]:r.pointSymbols,fi=undefined===r.pointSymbolsVisible?!0:r.pointSymbolsVisible,ei=undefined===r.customLayer?null:r.customLayer,oi=undefined===r.degreeScale?!1:r.degreeScale,kt=undefined===r.roseVisible?!0:r.roseVisible,dt=undefined===r.rotateFace?!1:r.rotateFace,w,ct=!1,v=0,ot=u,lt=this.value,s=f.getElementById(n).getContext("2d");h===0&&(h=Math.min(s.canvas.width,s.canvas.height)),s.canvas.width=h,s.canvas.height=h;var e=h,o=h,y=e/2,p=o/2,gt=e*.006,ni=!1,rt=t(h,h),ht=rt.getContext("2d"),tt=t(h,h),at=tt.getContext("2d"),ut=t(h,h),ti=ut.getContext("2d"),ft=t(h,h),ii=ft.getContext("2d"),si=function(n){var f,r,u,t;if(n.textAlign="center",n.textBaseline="middle",n.save(),n.strokeStyle=nt.labelColor.getRgbaColor(),n.fillStyle=nt.labelColor.getRgbaColor(),n.translate(y,p),oi)for(r=.08*e+"px serif",u=e*.033+"px serif",n.rotate(ot*10),t=10;360>=t;t+=10){if(n.save(),fi)switch(t){case 360:n.translate(e*.35,0),n.rotate(i),n.font=r,n.fillText(a[2],0,0,e),n.translate(-e*.35,0);break;case 90:n.translate(e*.35,0),n.rotate(i),n.font=r,n.fillText(a[4],0,0,e),n.translate(-e*.35,0);break;case 180:n.translate(e*.35,0),n.rotate(i),n.font=r,n.fillText(a[6],0,0,e),n.translate(-e*.35,0);break;case 270:n.translate(e*.35,0),n.rotate(i),n.font=r,n.fillText(a[0],0,0,e),n.translate(-e*.35,0);break;default:f=(t+90)%360,n.translate(e*.37,0),n.rotate(i),n.font=u,n.fillText("0".substring(f>=100)+f,0,0,e),n.translate(-e*.37,0)}else f=(t+90)%360,n.translate(e*.37,0),n.rotate(i),n.font=u,n.fillText("0".substring(f>=100)+f,0,0,e),n.translate(-e*.37,0);n.restore(),n.rotate(ot*10)}else for(r=.12*e+"px serif",u=.06*e+"px serif",t=0;360>t;t+=2.5){0==t%5&&(n.lineWidth=1,n.beginPath(),n.moveTo(e*.38,0),n.lineTo(e*.36,0),n.closePath(),n.stroke()),n.save();switch(t){case 0:n.translate(e*.35,0),n.rotate(i),n.font=r,n.fillText(a[2],0,0,e),n.translate(-e*.35,0);break;case 45:n.translate(e*.29,0),n.rotate(i),n.font=u,n.fillText(a[3],0,0,e),n.translate(-e*.29,0);break;case 90:n.translate(e*.35,0),n.rotate(i),n.font=r,n.fillText(a[4],0,0,e),n.translate(-e*.35,0);break;case 135:n.translate(e*.29,0),n.rotate(i),n.font=u,n.fillText(a[5],0,0,e),n.translate(-e*.29,0);break;case 180:n.translate(e*.35,0),n.rotate(i),n.font=r,n.fillText(a[6],0,0,e),n.translate(-e*.35,0);break;case 225:n.translate(e*.29,0),n.rotate(i),n.font=u,n.fillText(a[7],0,0,e),n.translate(-e*.29,0);break;case 270:n.translate(e*.35,0),n.rotate(i),n.font=r,n.fillText(a[0],0,0,e),n.translate(-e*.35,0);break;case 315:n.translate(e*.29,0),n.rotate(i),n.font=u,n.fillText(a[1],0,0,e),n.translate(-e*.29,0)}n.restore(),kt&&(0===t||22.5===t||45===t||67.5===t||90===t||112.5===t||135===t||157.5===t||180===t||202.5===t||225===t||247.5===t||270===t||292.5===t||315===t||337.5===t||360===t)&&(n.save(),n.beginPath(),t%45?n.moveTo(e*.29,0):n.moveTo(e*.38,0),n.lineTo(e*.1,0),n.closePath(),n.restore(),n.lineWidth=1,n.strokeStyle=nt.symbolColor.getRgbaColor(),n.stroke()),n.rotate(ot*2.5)}n.translate(-y,-p),n.restore()},ci=function(n){var t,i,s,r,u,f,h;n.save();switch(pt.type){case"type2":n.beginPath(),n.moveTo(e*.53271,o*.453271),n.bezierCurveTo(e*.53271,o*.453271,e*.5,o*.149532,e*.5,o*.149532),n.bezierCurveTo(e*.5,o*.149532,e*.467289,o*.453271,e*.467289,o*.453271),n.bezierCurveTo(e*.453271,o*.462616,e*.443925,o*.481308,e*.443925,o*.5),n.bezierCurveTo(e*.443925,o*.5,e*.556074,o*.5,e*.556074,o*.5),n.bezierCurveTo(e*.556074,o*.481308,e*.546728,o*.462616,e*.53271,o*.453271),n.closePath(),t=n.createLinearGradient(.471962*e,0,.528036*e,0),t.addColorStop(0,c.light.getRgbaColor()),t.addColorStop(.46,c.light.getRgbaColor()),t.addColorStop(.47,c.medium.getRgbaColor()),t.addColorStop(1,c.medium.getRgbaColor()),n.fillStyle=t,n.strokeStyle=c.dark.getRgbaColor(),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke(),n.beginPath(),n.moveTo(e*.467289,o*.546728),n.bezierCurveTo(e*.467289,o*.546728,e*.5,o*.850467,e*.5,o*.850467),n.bezierCurveTo(e*.5,o*.850467,e*.53271,o*.546728,e*.53271,o*.546728),n.bezierCurveTo(e*.546728,o*.537383,e*.556074,o*.518691,e*.556074,o*.5),n.bezierCurveTo(e*.556074,o*.5,e*.443925,o*.5,e*.443925,o*.5),n.bezierCurveTo(e*.443925,o*.518691,e*.453271,o*.537383,e*.467289,o*.546728),n.closePath(),i=n.createLinearGradient(.471962*e,0,.528036*e,0),i.addColorStop(0,"#e3e5e8"),i.addColorStop(.48,"#e3e5e8"),i.addColorStop(.48,"#abb1b8"),i.addColorStop(1,"#abb1b8"),n.fillStyle=i,s="#abb1b8",n.strokeStyle=s,n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke();break;case"type3":n.beginPath(),n.moveTo(e*.5,o*.149532),n.bezierCurveTo(e*.5,o*.149532,e*.443925,o*.490654,e*.443925,o*.5),n.bezierCurveTo(e*.443925,o*.53271,e*.467289,o*.556074,e*.5,o*.556074),n.bezierCurveTo(e*.53271,o*.556074,e*.556074,o*.53271,e*.556074,o*.5),n.bezierCurveTo(e*.556074,o*.490654,e*.5,o*.149532,e*.5,o*.149532),n.closePath(),r=n.createLinearGradient(.471962*e,0,.528036*e,0),r.addColorStop(0,c.light.getRgbaColor()),r.addColorStop(.46,c.light.getRgbaColor()),r.addColorStop(.47,c.medium.getRgbaColor()),r.addColorStop(1,c.medium.getRgbaColor()),n.fillStyle=r,n.strokeStyle=c.dark.getRgbaColor(),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke();break;case"type1:":default:n.beginPath(),n.moveTo(e*.5,o*.495327),n.lineTo(e*.528037,o*.495327),n.lineTo(e*.5,o*.149532),n.lineTo(e*.471962,o*.495327),n.lineTo(e*.5,o*.495327),n.closePath(),u=n.createLinearGradient(.471962*e,0,.528036*e,0),u.addColorStop(0,c.light.getRgbaColor()),u.addColorStop(.46,c.light.getRgbaColor()),u.addColorStop(.47,c.medium.getRgbaColor()),u.addColorStop(1,c.medium.getRgbaColor()),n.fillStyle=u,n.strokeStyle=c.dark.getRgbaColor(),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke(),n.beginPath(),n.moveTo(e*.5,o*.504672),n.lineTo(e*.471962,o*.504672),n.lineTo(e*.5,o*.850467),n.lineTo(e*.528037,o*.504672),n.lineTo(e*.5,o*.504672),n.closePath(),f=n.createLinearGradient(.471962*e,0,.528036*e,0),f.addColorStop(0,"#e3e5e8"),f.addColorStop(.48,"#e3e5e8"),f.addColorStop(.480099,"#abb1b8"),f.addColorStop(1,"#abb1b8"),n.fillStyle=f,h="#abb1b8",n.strokeStyle=h,n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke()}n.restore()},b=function(){ni=!0,yt&&k(ht,vt,y,p,e,o),et&&(g(ht,nt,y,p,e,o),st(ht,ei,y,p,e,o),kt&&li(at,y,p,e,o,nt),si(at)),ci(ti,!1),bt&&d(ii,wt,e,o,!0,ri,ui)},it=function(){rt.width=h,rt.height=h,ht=rt.getContext("2d"),tt.width=h,tt.height=h,at=tt.getContext("2d"),ut.width=h,ut.height=h,ti=ut.getContext("2d"),ft.width=h,ft.height=h,ii=ft.getContext("2d")};return this.setValue=function(n){return n=parseFloat(n)%360,v!==n&&(v=n,this.repaint()),this},this.getValue=function(){return v},this.setValueAnimated=function(n){var i=n%360,r=this,t;return v!==i&&(undefined!==w&&w.isPlaying&&w.stop(),t=hi(v,i),w=dt?new Tween({},"",Tween.regularEaseInOut,v,v+t,2):new Tween({},"",Tween.elasticEaseOut,v,v+t,2),w.onMotionChanged=function(n){v=n.target._pos%360,ct||(ct=!0,l(r.repaint))},w.start()),this},this.setFrameDesign=function(n){return it(),vt=n,b(),this.repaint(),this},this.setBackgroundColor=function(n){return it(),nt=n,b(),this.repaint(),this},this.setForegroundType=function(n){return it(),wt=n,b(),this.repaint(),this},this.setPointerColor=function(n){return it(),c=n,b(),this.repaint(),this},this.setPointerType=function(n){return it(),pt=n,b(),this.repaint(),this},this.setPointSymbols=function(n){return it(),a=n,b(),this.repaint(),this},this.repaint=function(){ni||b(),s.save(),s.clearRect(0,0,s.canvas.width,s.canvas.height),lt=i+v*ot-i,(et||yt)&&s.drawImage(rt,0,0),dt?(s.save(),s.translate(y,p),s.rotate(-lt),s.translate(-y,-p),et&&s.drawImage(tt,0,0),s.restore()):(et&&s.drawImage(tt,0,0),s.translate(y,p),s.rotate(lt),s.translate(-y,-p)),s.shadowColor="rgba(0, 0, 0, 0.8)",s.shadowOffsetX=s.shadowOffsetY=gt,s.shadowBlur=gt*2,s.drawImage(ut,0,0),s.restore(),bt&&s.drawImage(ft,0,0),ct=!1},this.repaint(),this},or=function(n,e){e=e||{};var c=undefined===e.size?0:e.size,si=undefined===e.frameDesign?steelseries.FrameDesign.METAL:e.frameDesign,ci=undefined===e.frameVisible?!0:e.frameVisible,tt=undefined===e.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:e.backgroundColor,ai=undefined===e.backgroundVisible?!0:e.backgroundVisible,dt=undefined===e.pointerTypeLatest?steelseries.PointerType.TYPE1:e.pointerTypeLatest,vi=undefined===e.pointerTypeAverage?steelseries.PointerType.TYPE8:e.pointerTypeAverage,ii=undefined===e.pointerColor?steelseries.ColorDef.RED:e.pointerColor,ri=undefined===e.pointerColorAverage?steelseries.ColorDef.BLUE:e.pointerColorAverage,ar=undefined===e.knobType?steelseries.KnobType.STANDARD_KNOB:e.knobType,vr=undefined===e.knobStyle?steelseries.KnobStyle.SILVER:e.knobStyle,yi=undefined===e.foregroundType?steelseries.ForegroundType.TYPE1:e.foregroundType,pi=undefined===e.foregroundVisible?!0:e.foregroundVisible,a=undefined===e.pointSymbols?["N","NE","E","SE","S","SW","W","NW"]:e.pointSymbols,yr=undefined===e.pointSymbolsVisible?!0:e.pointSymbolsVisible,pr=undefined===e.customLayer?null:e.customLayer,wr=undefined===e.degreeScale?!0:e.degreeScale,ui=undefined===e.degreeScaleHalf?!1:e.degreeScaleHalf,wi=undefined===e.roseVisible?!1:e.roseVisible,lt=undefined===e.lcdColor?steelseries.LcdColor.STANDARD:e.lcdColor,bi=undefined===e.lcdVisible?!0:e.lcdVisible,br=undefined===e.digitalFont?!1:e.digitalFont,ht=undefined===e.section?null:e.section,ct=undefined===e.area?null:e.area,gt=undefined===e.lcdTitleStrings?["Latest","Average"]:e.lcdTitleStrings,ki=undefined===e.titleString?"":e.titleString,di=undefined===e.useColorLabels?!1:e.useColorLabels,ni=undefined===e.fullScaleDeflectionTime?2.5:e.fullScaleDeflectionTime,at,vt,it=0,rt=0,yt=u,gi=this.valueLatest,fi=this.valueAverage,kr=-i,nr=r,tr=360,et=!1,h=f.getElementById(n).getContext("2d");c===0&&(c=Math.min(h.canvas.width,h.canvas.height)),h.canvas.width=c,h.canvas.height=c;var s=c,y=c,p=s/2,w=y/2,ei=Math.floor(s/10),dr=ei+"px "+o,gr=ei+"px "+ft,ti=s*.3,ir=y*.12,rr=(s-ti)/2,ur=y*.32,fr=y*.565,er=!1,pt=t(c,c),ut=pt.getContext("2d"),oi,wt=t(c,c),or=wt.getContext("2d"),bt=t(c,c),sr=bt.getContext("2d"),kt=t(c,c),hr=kt.getContext("2d"),cr=function(n,t){for(h.save(),h.textAlign="center",h.strokeStyle=lt.textColor,h.fillStyle=lt.textColor;n<-180;)n+=360;!ui&&n<0&&(n+=360),ui&&n>180&&(n=-(360-n)),n>=0?(n="00"+Math.round(n),n=n.substring(n.length,n.length-3)):(n="00"+Math.abs(Math.round(n)),n="-"+n.substring(n.length,n.length-3)),(lt===steelseries.LcdColor.STANDARD||lt===steelseries.LcdColor.STANDARD_GREEN)&&(h.shadowColor="gray",h.shadowOffsetX=s*.007,h.shadowOffsetY=s*.007,h.shadowBlur=s*.007),h.font=br?gr:dr,h.fillText(n+"Â°",s/2+ti*.05,(t?ur:fr)+ir*.5+ei*.38,ti*.9),h.restore()},lr=function(n,t,i,r,u){n.save(),n.strokeStyle=r,n.fillStyle=r,n.lineWidth=s*.035;var f=nr/tr*t,e=f+(i-t)/(tr/nr);n.translate(p,w),n.rotate(kr),n.beginPath(),u?(n.moveTo(0,0),n.arc(0,0,s*.365-n.lineWidth/2,f,e,!1)):n.arc(0,0,s*.365,f,e,!1),u?(n.moveTo(0,0),n.fill()):n.stroke(),n.translate(-p,-w),n.restore()},nu=function(n){var c=s*.38,l=s*.35,b=s*.36,h=s*.1,v=s*.31,u=s*.36,r,f,t,e,y;if(n.textAlign="center",n.textBaseline="middle",n.save(),n.strokeStyle=tt.labelColor.getRgbaColor(),n.fillStyle=tt.labelColor.getRgbaColor(),n.translate(p,w),wr)for(r=Math.floor(.1*s)+"px serif bold",f=Math.floor(s*.04)+"px "+o,n.rotate(yt*5),t=5;360>=t;t+=5){if(n.save(),yr)switch(t){case 360:n.translate(u,0),n.rotate(i),n.font=r,n.fillText(a[2],0,0,h),n.translate(-u,0);break;case 90:n.translate(u,0),n.rotate(i),n.font=r,n.fillText(a[4],0,0,h),n.translate(-u,0);break;case 180:n.translate(u,0),n.rotate(i),n.font=r,n.fillText(a[6],0,0,h),n.translate(-u,0);break;case 270:n.translate(u,0),n.rotate(i),n.font=r,n.fillText(a[0],0,0,h),n.translate(-u,0);break;case 5:case 85:case 95:case 175:case 185:case 265:case 275:case 355:break;default:(t+90)%20?(n.lineWidth=(t+90)%5?1.5:1,n.beginPath(),n.moveTo(c,0),y=(t+90)%10?b:l,n.lineTo(y,0),n.closePath(),n.stroke()):(n.lineWidth=1.5,n.beginPath(),n.moveTo(c,0),n.lineTo(l,0),n.closePath(),n.stroke(),e=(t+90)%360,n.translate(v,0),n.rotate(i),n.font=f,n.fillText("0".substring(e>=100)+e,0,0,h),n.translate(-v,0))}else(t+90)%20?(n.lineWidth=(t+90)%5?1.5:1,n.beginPath(),n.moveTo(c,0),y=(t+90)%10?b:l,n.lineTo(y,0),n.closePath(),n.stroke()):(n.lineWidth=1.5,n.beginPath(),n.moveTo(c,0),n.lineTo(l,0),n.closePath(),n.stroke(),e=(t+90)%360,ui&&e>180&&(e=-(360-e)),n.translate(v,0),n.rotate(i),n.font=f,n.fillText(e,0,0,h),n.translate(-v,0));n.restore(),n.rotate(yt*5)}else for(r=.12*s+"px serif",f=.06*s+"px serif",n.lineWidth=1,n.strokeStyle=tt.symbolColor.getRgbaColor(),t=0;360>t;t+=2.5){0==t%5&&(n.beginPath(),n.moveTo(s*.38,0),n.lineTo(s*.36,0),n.closePath(),n.stroke()),n.save();switch(t){case 0:n.translate(s*.35,0),n.rotate(i),n.font=r,n.fillText(a[2],0,0),n.translate(-s*.35,0);break;case 45:n.translate(s*.29,0),n.rotate(i),n.font=f,n.fillText(a[3],0,0),n.translate(-s*.29,0);break;case 90:n.translate(s*.35,0),n.rotate(i),n.font=r,n.fillText(a[4],0,0),n.translate(-s*.35,0);break;case 135:n.translate(s*.29,0),n.rotate(i),n.font=f,n.fillText(a[5],0,0),n.translate(-s*.29,0);break;case 180:n.translate(s*.35,0),n.rotate(i),n.font=r,n.fillText(a[6],0,0),n.translate(-s*.35,0);break;case 225:n.translate(s*.29,0),n.rotate(i),n.font=f,n.fillText(a[7],0,0),n.translate(-s*.29,0);break;case 270:n.translate(s*.35,0),n.rotate(i),n.font=r,n.fillText(a[0],0,0),n.translate(-s*.35,0);break;case 315:n.translate(s*.29,0),n.rotate(i),n.font=f,n.fillText(a[1],0,0),n.translate(-s*.29,0)}n.restore(),wi&&(0===t||22.5===t||45===t||67.5===t||90===t||112.5===t||135===t||157.5===t||180===t||202.5===t||225===t||247.5===t||270===t||292.5===t||315===t||337.5===t||360===t)&&(n.save(),n.beginPath(),t%45?n.moveTo(s*.29,0):n.moveTo(s*.38,0),n.lineTo(s*.1,0),n.closePath(),n.restore(),n.stroke()),n.rotate(yt*2.5)}n.translate(-p,-w),n.restore()},tu=function(n){gt.length>0&&(n.save(),n.textAlign="center",n.textBaseline="middle",n.fillStyle=di?ii.medium.getRgbaColor():tt.labelColor.getRgbaColor(),n.font=.04*s+"px "+o,n.fillText(gt[0],s/2,y*.29,s*.3),n.fillStyle=di?ri.medium.getRgbaColor():tt.labelColor.getRgbaColor(),n.fillText(gt[1],s/2,y*.71,s*.3),ki.length>0&&(n.fillStyle=tt.labelColor.getRgbaColor(),n.font=.0467*s+"px "+o,n.fillText(ki,s/2,y*.5,s*.3)))},v=function(n){var t,i,u;n=n||{};var r=undefined===n.background?!1:n.background,f=undefined===n.pointer?!1:n.pointer,e=undefined===n.foreground?!1:n.foreground;if(er=!0,r&&ci&&k(ut,si,p,w,s,y),r&&ai){if(g(ut,tt,p,w,s,y),st(ut,pr,p,w,s,y),null!==ht&&0<ht.length){t=ht.length;do t--,lr(ut,ht[t].start,ht[t].stop,ht[t].color,!1);while(0<t)}if(null!==ct&&0<ct.length){i=ct.length;do i--,lr(ut,ct[i].start,ct[i].stop,ct[i].color,!0);while(0<i)}nu(ut)}r&&wi&&li(ut,p,w,s,y,tt),r&&bi&&(oi=nt(ti,ir,lt),ut.drawImage(oi,rr,ur),ut.drawImage(oi,rr,fr),tu(ut)),f&&(ot(sr,s,vi,ri,tt.labelColor),ot(or,s,dt,ii,tt.labelColor)),e&&pi&&(u=dt.type==="type15"||dt.type==="type16"?!1:!0,d(hr,yi,s,y,u,ar,vr))},b=function(n){n=n||{};var t=undefined===n.background?!1:n.background,i=undefined===n.pointer?!1:n.pointer,r=undefined===n.foreground?!1:n.foreground;t&&(pt.width=c,pt.height=c,ut=pt.getContext("2d")),i&&(wt.width=c,wt.height=c,or=wt.getContext("2d"),bt.width=c,bt.height=c,sr=bt.getContext("2d")),r&&(kt.width=c,kt.height=c,hr=kt.getContext("2d"))};return this.setValueLatest=function(n){return n=parseFloat(n),n=n===360?360:n%360,it!==n&&(it=n,this.repaint()),this},this.getValueLatest=function(){return it},this.setValueAverage=function(n){return n=parseFloat(n),n=n===360?360:n%360,rt!==n&&(rt=n,this.repaint()),this},this.getValueAverage=function(){return rt},this.setValueAnimatedLatest=function(n){var t,u=this,i,r;return n=parseFloat(n),t=n===360?360:n%360,it!==t&&(undefined!==at&&at.isPlaying&&at.stop(),i=hi(it,t),i!==0?(r=ni*Math.abs(i)/180,r=Math.max(r,ni/5),at=new Tween({},"",Tween.regularEaseInOut,it,it+i,r),at.onMotionChanged=function(n){it=n.target._pos===360?360:n.target._pos%360,et||(et=!0,l(u.repaint))},at.start()):(it=t,et||(et=!0,l(u.repaint)))),this},this.setValueAnimatedAverage=function(n){var r,u=this,t,i;return n=parseFloat(n),r=n===360?360:n%360,rt!==n&&(undefined!==vt&&vt.isPlaying&&vt.stop(),t=hi(rt,r),t!==0?(i=ni*Math.abs(t)/180,i=Math.max(i,ni/5),vt=new Tween({},"",Tween.regularEaseInOut,rt,rt+t,i),vt.onMotionChanged=function(n){rt=n.target._pos===360?360:n.target._pos%360,et||(et=!0,l(u.repaint))},vt.start()):(rt=r,et||(et=!0,l(u.repaint)))),this},this.setArea=function(n){return ct=n,b({background:!0}),v({background:!0}),this.repaint(),this},this.setSection=function(n){return ht=n,b({background:!0}),v({background:!0}),this.repaint(),this},this.setFrameDesign=function(n){return si=n,b({background:!0}),v({background:!0}),this.repaint(),this},this.setBackgroundColor=function(n){return tt=n,b({background:!0}),v({background:!0}),this.repaint(),this},this.setForegroundType=function(n){return b({foreground:!0}),yi=n,v({foreground:!0}),this.repaint(),this},this.setPointerColor=function(n){return b({pointer:!0}),ii=n,v({pointer:!0}),this.repaint(),this},this.setPointerColorAverage=function(n){return b({pointer:!0}),ri=n,v({pointer:!0}),this.repaint(),this},this.setPointerType=function(n){return dt=n,b({pointer:!0,foreground:!0}),v({pointer:!0,foreground:!0}),this.repaint(),this},this.setPointerTypeAverage=function(n){return vi=n,b({pointer:!0,foreground:!0}),v({pointer:!0,foreground:!0}),this.repaint(),this},this.setPointSymbols=function(n){return a=n,b({background:!0}),v({background:!0}),this.repaint(),this},this.setLcdColor=function(n){return lt=n,b({background:!0}),v({background:!0}),this.repaint(),this},this.setLcdTitleStrings=function(n){return gt=n,b({background:!0}),v({background:!0}),this.repaint(),this},this.repaint=function(){er||v({frame:!0,background:!0,led:!0,pointer:!0,foreground:!0}),h.clearRect(0,0,h.canvas.width,h.canvas.height),(ci||ai)&&h.drawImage(pt,0,0),bi&&(cr(it,!0),cr(rt,!1)),fi=rt*yt;var n=s*.006;h.save(),h.translate(p,w),h.rotate(fi),h.translate(-p,-w),h.shadowColor="rgba(0, 0, 0, 0.8)",h.shadowOffsetX=h.shadowOffsetY=n,h.shadowBlur=n*2,h.drawImage(bt,0,0),gi=it*yt-fi,h.translate(p,w),h.rotate(gi),h.translate(-p,-w),h.drawImage(wt,0,0),h.restore(),pi&&h.drawImage(kt,0,0),et=!1},this.repaint(),this},sr=function(n,s){s=s||{};var a=undefined===s.size?0:s.size,ct=undefined===s.frameDesign?steelseries.FrameDesign.METAL:s.frameDesign,dt=undefined===s.frameVisible?!0:s.frameVisible,lt=undefined===s.foregroundType?steelseries.ForegroundType.TYPE1:s.foregroundType,gt=undefined===s.foregroundVisible?!0:s.foregroundVisible,et=undefined===s.pointerColor?steelseries.ColorDef.WHITE:s.pointerColor,nt,tt,ot=!1,p=0,y=0,at=e*a/360,vt=0,w=!1,v=f.getElementById(n).getContext("2d");a===0&&(a=Math.min(v.canvas.width,v.canvas.height)),v.canvas.width=a,v.canvas.height=a;var h=a,c=a,b=h/2,g=c/2,yt=!1,ut=t(a,a),pt=ut.getContext("2d"),it=t(a,a*e),wt=it.getContext("2d"),rt=t(a*.037383,a*.056074),bt=rt.getContext("2d"),ft=t(a,a),st=ft.getContext("2d"),ni=function(n){var t,r,i,f,c;n.save(),t=a,r=a*e,n.beginPath(),n.rect(0,0,t,r),n.closePath(),f=n.createLinearGradient(0,0,0,r),f.addColorStop(0,"#7fd5f0"),f.addColorStop(.5,"#7fd5f0"),f.addColorStop(.5,"#3c4439"),f.addColorStop(1,"#3c4439"),n.fillStyle=f,n.fill(),n.lineWidth=1;var h=r/72,s=!1,u=10;for(n.textAlign="center",n.textBaseline="middle",c=t*.04,n.font=c+"px "+o,n.fillStyle="#37596e",i=r/2-h;i>0;i-=h)u<=90&&(s?(n.fillText(u,(t-t*.2)/2-8,i,t*.375),n.fillText(u,t-(t-t*.2)/2+8,i,t*.375),n.beginPath(),n.moveTo((t-t*.2)/2,i),n.lineTo(t-(t-t*.2)/2,i),n.closePath(),u+=10):(n.beginPath(),n.moveTo((t-t*.1)/2,i),n.lineTo(t-(t-t*.1)/2,i),n.closePath()),n.stroke()),s^=!0;for(s=!1,u=10,n.strokeStyle="#FFFFFF",n.lineWidth=1.5,n.beginPath(),n.moveTo(0,r/2),n.lineTo(t,r/2),n.closePath(),n.stroke(),n.fillStyle="#FFFFFF",n.lineWidth=1,i=r/2+h;i<=r;i+=h)u<=90&&(s?(n.fillText(-u,(t-t*.2)/2-8,i,t*.375),n.fillText(-u,t-(t-t*.2)/2+8,i,t*.375),n.beginPath(),n.moveTo((t-t*.2)/2,i),n.lineTo(t-(t-t*.2)/2,i),n.closePath(),u+=10):(n.beginPath(),n.moveTo((t-t*.1)/2,i),n.lineTo(t-(t-t*.1)/2,i),n.closePath()),n.stroke()),s^=!0;n.restore()},ti=function(n){var r,f,t;for(n.save(),n.fillStyle=et.light.getRgbaColor(),n.beginPath(),n.moveTo(h*.476635,c*.5),n.bezierCurveTo(h*.476635,c*.514018,h*.485981,c*.523364,h*.5,c*.523364),n.bezierCurveTo(h*.514018,c*.523364,h*.523364,c*.514018,h*.523364,c*.5),n.bezierCurveTo(h*.523364,c*.485981,h*.514018,c*.476635,h*.5,c*.476635),n.bezierCurveTo(h*.485981,c*.476635,h*.476635,c*.485981,h*.476635,c*.5),n.closePath(),n.moveTo(h*.415887,c*.504672),n.lineTo(h*.415887,c*.495327),n.bezierCurveTo(h*.415887,c*.495327,h*.467289,c*.495327,h*.467289,c*.495327),n.bezierCurveTo(h*.471962,c*.481308,h*.481308,c*.471962,h*.495327,c*.467289),n.bezierCurveTo(h*.495327,c*.467289,h*.495327,c*.415887,h*.495327,c*.415887),n.lineTo(h*.504672,c*.415887),n.bezierCurveTo(h*.504672,c*.415887,h*.504672,c*.467289,h*.504672,c*.467289),n.bezierCurveTo(h*.518691,c*.471962,h*.528037,c*.481308,h*.53271,c*.495327),n.bezierCurveTo(h*.53271,c*.495327,h*.584112,c*.495327,h*.584112,c*.495327),n.lineTo(h*.584112,c*.504672),n.bezierCurveTo(h*.584112,c*.504672,h*.53271,c*.504672,h*.53271,c*.504672),n.bezierCurveTo(h*.528037,c*.518691,h*.518691,c*.53271,h*.5,c*.53271),n.bezierCurveTo(h*.481308,c*.53271,h*.471962,c*.518691,h*.467289,c*.504672),n.bezierCurveTo(h*.467289,c*.504672,h*.415887,c*.504672,h*.415887,c*.504672),n.closePath(),n.fill(),r=5,f=5*u,n.translate(b,g),n.rotate(-i),n.translate(-b,-g),t=-90;t<=90;t+=r)t%45==0||t===0?(n.strokeStyle=et.medium.getRgbaColor(),n.lineWidth=2,n.beginPath(),n.moveTo(h*.5,c*.088785),n.lineTo(h*.5,c*.113),n.closePath(),n.stroke()):t%15==0?(n.strokeStyle="#FFFFFF",n.lineWidth=1,n.beginPath(),n.moveTo(h*.5,c*.088785),n.lineTo(h*.5,c*.103785),n.closePath(),n.stroke()):(n.strokeStyle="#FFFFFF",n.lineWidth=.5,n.beginPath(),n.moveTo(h*.5,c*.088785),n.lineTo(h*.5,c*.093785),n.closePath(),n.stroke()),n.translate(b,g),n.rotate(f,b,g),n.translate(-b,-g);n.restore()},ii=function(n){n.save();var t=h*.037383,i=c*.056074;n.beginPath(),n.moveTo(t*.5,0),n.lineTo(0,i),n.lineTo(t,i),n.closePath(),n.fillStyle=et.light.getRgbaColor(),n.fill(),n.strokeStyle=et.medium.getRgbaColor(),n.stroke(),n.restore()},ht=function(){yt=!0,dt&&k(pt,ct,b,g,h,c),ni(wt),ii(bt),ti(st),gt&&d(st,lt,h,c,!0,bi,ki,wi)},kt=function(){ut.width=a,ut.height=a,pt=ut.getContext("2d"),it.width=a,it.height=a*e,wt=it.getContext("2d"),rt.width=a*.037383,rt.height=a*.056074,bt=rt.getContext("2d"),ft.width=a,ft.height=a,st=ft.getContext("2d")};return this.setRoll=function(n){return n=parseFloat(n)%360,p!==n&&(p=n,this.repaint()),this},this.getRoll=function(){return p},this.setRollAnimated=function(n){var t=this;return n=parseFloat(n)%360,p!==n&&(undefined!==nt&&nt.isPlaying&&nt.stop(),nt=new Tween({},"",Tween.regularEaseInOut,p,n,1),nt.onMotionChanged=function(n){p=n.target._pos,ot||(ot=!0,l(t.repaint))},nt.start()),this},this.setPitch=function(n){return n=(parseFloat(n)+180-vt)%360-180,y!==n&&(y=n,y>90?(y=180-y,w||this.setRoll(p-180),w=!0):y<-90?(y=-180-y,w||this.setRoll(p+180),w=!0):w=!1,this.repaint()),this},this.getPitch=function(){return y},this.setPitchAnimated=function(n){var t=this;return n=parseFloat(n),y!==n&&(undefined!==tt&&tt.isPlaying&&tt.stop(),tt=new Tween({},"",Tween.regularEaseInOut,y,n,1),tt.onMotionChanged=function(n){y=n.target._pos,y>90?(y=180-y,w||this.setRoll(p-180),w=!0):y<-90?(y=-180-y,w||this.setRoll(p+180),w=!0):w=!1,ot||(ot=!0,l(t.repaint)),t.setPitch(n.target._pos)},tt.start()),this},this.setPitchOffset=function(n){return vt=parseFloat(n),this.repaint(),this},this.setFrameDesign=function(n){return kt(),ct=n,ht(),this.repaint(),this},this.setForegroundType=function(n){return kt(),lt=n,ht(),this.repaint(),this},this.repaint=function(){yt||ht(),v.save(),v.clearRect(0,0,v.canvas.width,v.canvas.height),v.drawImage(ut,0,0),v.save(),v.beginPath(),v.arc(b,g,h*.831775/2,0,r,!0),v.closePath(),v.clip(),v.translate(b,g),v.rotate(-(p*u)),v.translate(-b,0),v.translate(0,y*at),v.drawImage(it,0,-it.height/2),v.translate(0,-(y*at)-g),v.drawImage(rt,h*.5-rt.width/2,h*.107476),v.restore(),v.drawImage(ft,0,0),v.restore()},this.repaint(),this},hr=function(n,t){var a,e,h,u,c;t=t||{};var i=undefined===t.size?0:t.size,y=undefined===t.ledColor?steelseries.LedColor.RED_LED:t.ledColor,l=!1,p=0,r=f.getElementById(n).getContext("2d");i===0&&(i=Math.min(r.canvas.width,r.canvas.height)),r.canvas.width=i,r.canvas.height=i,a=!1,e=f.createElement("canvas"),e.width=i,e.height=i,h=e.getContext("2d"),u=f.createElement("canvas"),u.width=i,u.height=i;var v=u.getContext("2d"),o=u,w=function(){a=!0,h.clearRect(0,0,h.canvas.width,h.canvas.height),h.drawImage(s(i,1,y),0,0),v.clearRect(0,0,v.canvas.width,v.canvas.height),v.drawImage(s(i,0,y),0,0)};return this.toggleLed=function(){return o=o===e?u:e,c(),this},this.setLedColor=function(n){return y=n,a=!1,c(),this},this.setLedOnOff=function(n){return o=n?e:u,c(),this},this.blink=function(n){return n?l||(p=setInterval(this.toggleLed,1e3),l=!0):l&&(clearInterval(p),l=!1,o=u),this},c=function(){a||w(),r.save(),r.clearRect(0,0,r.canvas.width,r.canvas.height),r.drawImage(o,0,0),r.restore()},c(),this},cr=function(n,i){i=i||{};var s=undefined===i.size?0:i.size,ti=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,ii=undefined===i.frameVisible?!0:i.frameVisible,p=undefined===i.pointerType?steelseries.PointerType.TYPE1:i.pointerType,y=undefined===i.pointerColor?p===steelseries.PointerType.TYPE1?steelseries.ColorDef.GRAY:steelseries.ColorDef.BLACK:i.pointerColor,tt=undefined===i.backgroundColor?p===steelseries.PointerType.TYPE1?steelseries.BackgroundColor.ANTHRACITE:steelseries.BackgroundColor.LIGHT_GRAY:i.backgroundColor,ri=undefined===i.backgroundVisible?!0:i.backgroundVisible,ui=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,fi=undefined===i.foregroundVisible?!0:i.foregroundVisible,yi=undefined===i.customLayer?null:i.customLayer,nt=undefined===i.isAutomatic?!0:i.isAutomatic,a=undefined===i.hour?11:i.hour,v=undefined===i.minute?5:i.minute,w=undefined===i.second?0:i.second,ut=undefined===i.secondMovesContinuous?!1:i.secondMovesContinuous,ft=undefined===i.timeZoneOffsetHour?0:i.timeZoneOffsetHour,et=undefined===i.timeZoneOffsetMinute?0:i.timeZoneOffsetMinute,ot=undefined===i.secondPointerVisible?!0:i.secondPointerVisible,b=new Date,ei,kt,oi,si,it=ut?100:1e3;it=ot?it:100;var pi=this,dt=6,o=f.getElementById(n).getContext("2d");s===0&&(s=Math.min(o.canvas.width,o.canvas.height)),o.canvas.width=s,o.canvas.height=s;var e=s,h=s,c=e/2,l=h/2,hi=!1,ht=t(s,s),ci=ht.getContext("2d"),ct=t(s,s),wt=ct.getContext("2d"),lt=t(s,s),li=lt.getContext("2d"),at=t(s,s),ai=at.getContext("2d"),vt=t(s,s),vi=vt.getContext("2d"),yt=t(s,s),gt=yt.getContext("2d"),wi=function(n,t){var i,o,s,r,f;r=e*.405,n.save(),n.translate(c,l);switch(t.type){case"type1":for(o=e*.074766,f=r-o,n.strokeStyle=tt.labelColor.getRgbaColor(),n.lineWidth=e*.014018,i=0;i<360;i+=30)n.beginPath(),n.moveTo(r,0),n.lineTo(f,0),n.closePath(),n.stroke(),n.rotate(30*u);for(s=e*.126168,f=r-s,n.lineWidth=e*.03271,i=0;i<360;i+=90)n.beginPath(),n.moveTo(r,0),n.lineTo(f,0),n.closePath(),n.stroke(),n.rotate(90*u);break;case"type2":default:for(o=e*.037383,f=r-o,n.strokeStyle=tt.labelColor.getRgbaColor(),n.lineWidth=e*.009345,i=0;i<360;i+=6)n.beginPath(),n.moveTo(r,0),n.lineTo(f,0),n.closePath(),n.stroke(),n.rotate(6*u);for(s=e*.084112,f=r-s,n.lineWidth=e*.028037,i=0;i<360;i+=30)n.beginPath(),n.moveTo(r,0),n.lineTo(f,0),n.closePath(),n.stroke(),n.rotate(30*u)}n.translate(-c,-l),n.restore()},bi=function(n,t){n.save();var i;switch(t.type){case"type2":n.beginPath(),n.lineWidth=e*.046728,n.moveTo(c,e*.289719),n.lineTo(c,e*.289719+e*.224299),n.strokeStyle=y.medium.getRgbaColor(),n.closePath(),n.stroke();break;case"type1":default:n.beginPath(),n.moveTo(e*.471962,h*.560747),n.lineTo(e*.471962,h*.214953),n.lineTo(e*.5,h*.182242),n.lineTo(e*.528037,h*.214953),n.lineTo(e*.528037,h*.560747),n.lineTo(e*.471962,h*.560747),n.closePath(),i=n.createLinearGradient(e*.471962,h*.560747,e*.528037,h*.214953),i.addColorStop(1,y.veryLight.getRgbaColor()),i.addColorStop(0,y.light.getRgbaColor()),n.fillStyle=i,n.strokeStyle=y.light.getRgbaColor(),n.fill(),n.stroke()}n.restore()},ki=function(n,t){n.save();var i;switch(t.type){case"type2":n.beginPath(),n.lineWidth=e*.03271,n.moveTo(c,e*.116822),n.lineTo(c,e*.116822+e*.38785),n.strokeStyle=y.medium.getRgbaColor(),n.closePath(),n.stroke();break;case"type1":default:n.beginPath(),n.moveTo(e*.518691,h*.574766),n.lineTo(e*.523364,h*.135514),n.lineTo(e*.5,h*.107476),n.lineTo(e*.476635,h*.140186),n.lineTo(e*.476635,h*.574766),n.lineTo(e*.518691,h*.574766),n.closePath(),i=n.createLinearGradient(e*.518691,h*.574766,e*.476635,h*.140186),i.addColorStop(1,y.veryLight.getRgbaColor()),i.addColorStop(0,y.light.getRgbaColor()),n.fillStyle=i,n.strokeStyle=y.light.getRgbaColor(),n.fill(),n.stroke()}n.restore()},di=function(n,t){n.save();var i;switch(t.type){case"type2":n.lineWidth=e*.009345,n.beginPath(),n.moveTo(c,e*.09813),n.lineTo(c,e*.09813+e*.126168),n.closePath(),n.stroke(),n.lineWidth=e*.018691,n.beginPath(),n.moveTo(c,e*.308411),n.lineTo(c,e*.308411+e*.191588),n.closePath(),n.stroke(),n.lineWidth=e*.016,n.beginPath(),n.arc(c,e*.26,e*.085/2,0,r),n.closePath(),n.stroke();break;case"type1":default:n.beginPath(),n.moveTo(e*.509345,h*.116822),n.lineTo(e*.509345,h*.574766),n.lineTo(e*.490654,h*.574766),n.lineTo(e*.490654,h*.116822),n.lineTo(e*.509345,h*.116822),n.closePath(),i=n.createLinearGradient(e*.509345,h*.116822,e*.490654,h*.574766),i.addColorStop(0,steelseries.ColorDef.RED.light.getRgbaColor()),i.addColorStop(.47,steelseries.ColorDef.RED.medium.getRgbaColor()),i.addColorStop(1,steelseries.ColorDef.RED.dark.getRgbaColor()),n.fillStyle=i,n.strokeStyle=steelseries.ColorDef.RED.dark.getRgbaColor(),n.fill(),n.stroke()}n.restore()},gi=function(n){var t;n.beginPath(),n.arc(c,l,e*.045,0,r),n.closePath(),t=n.createLinearGradient(c-e*.045/2,l-e*.045/2,c+e*.045/2,l+e*.045/2),t.addColorStop(0,"#eef0f2"),t.addColorStop(1,"#65696d"),n.fillStyle=t,n.fill()},nr=function(n,t){var i;n.save();switch(t.type){case"type2":n.fillStyle="#000000",n.beginPath(),n.arc(c,l,e*.088785/2,0,r),n.closePath(),n.fill();break;case"type1":default:i=n.createLinearGradient(c-e*.027/2,l-e*.027/2,c+e*.027/2,l+e*.027/2),i.addColorStop(0,"#f3f4f7"),i.addColorStop(.11,"#f3f5f7"),i.addColorStop(.12,"#f1f3f5"),i.addColorStop(.2,"#c0c5cb"),i.addColorStop(.2,"#bec3c9"),i.addColorStop(1,"#bec3c9"),n.fillStyle=i,n.beginPath(),n.arc(c,l,e*.027,0,r),n.closePath(),n.fill()}n.restore()},bt=function(n,t,i){oi=i*dt*u,ei=t*dt*u,kt=(n+t/60)*dt*5*u},ni=function(){nt?b=new Date:(b.setHours(a),b.setMinutes(v),b.setSeconds(w)),w=b.getSeconds()+(ut?b.getMilliseconds()/1e3:0),a=ft!==0&&et!==0?b.getUTCHours()+ft:b.getHours(),a=a%12,v=ft!==0&&et!==0?b.getUTCMinutes()+et:b.getMinutes(),v>60&&(v-=60,a++),v<0&&(v+=60,a--),a=a%12,bt(a,v,w),nt&&(si=setTimeout(ni,it)),pi.repaint()},rt=function(n){n=n||{};var t=undefined===n.frame?!1:n.frame,i=undefined===n.background?!1:n.background,r=undefined===n.pointers?!1:n.pointers,u=undefined===n.foreground?!1:n.foreground;hi=!0,t&&ii&&k(ci,ti,c,l,e,h),i&&ri&&(g(wt,tt,c,l,e,h),st(wt,yi,c,l,e,h),wi(wt,p)),r&&(bi(li,p),ki(ai,p),di(vi,p)),u&&fi&&(nr(gt,p),d(gt,ui,e,h,!1))},pt=function(n){n=n||{};var t=undefined===n.frame?!1:n.frame,i=undefined===n.background?!1:n.background,r=undefined===n.pointers?!1:n.pointers,u=undefined===n.foreground?!1:n.foreground;t&&(ht.width=s,ht.height=s,ci=ht.getContext("2d")),i&&(ct.width=s,ct.height=s,wt=ct.getContext("2d")),r&&(lt.width=s,lt.height=s,li=lt.getContext("2d"),at.width=s,at.height=s,ai=at.getContext("2d"),vt.width=s,vt.height=s,vi=vt.getContext("2d")),u&&(yt.width=s,yt.height=s,gt=yt.getContext("2d"))};return this.getAutomatic=function(){return nt},this.setAutomatic=function(n){return n=!!n,nt&&!n?(clearTimeout(si),nt=n):!nt&&n&&(nt=n,ni()),this},this.getHour=function(){return a},this.setHour=function(n){return n=parseInt(n,10)%12,a!==n&&(a=n,bt(a,v,w),this.repaint()),this},this.getMinute=function(){return v},this.setMinute=function(n){return n=parseInt(n,10)%60,v!==n&&(v=n,bt(a,v,w),this.repaint()),this},this.getSecond=function(){return w},this.setSecond=function(n){return w=parseInt(n,10)%60,w!==n&&(w=n,bt(a,v,w),this.repaint()),this},this.getTimeZoneOffsetHour=function(){return ft},this.setTimeZoneOffsetHour=function(n){return ft=parseInt(n,10),this.repaint(),this},this.getTimeZoneOffsetMinute=function(){return et},this.setTimeZoneOffsetMinute=function(n){return et=parseInt(n,10),this.repaint(),this},this.getSecondPointerVisible=function(){return ot},this.setSecondPointerVisible=function(n){return ot=!!n,this.repaint(),this},this.getSecondMovesContinuous=function(){return ut},this.setSecondMovesContinuous=function(n){return ut=!!n,it=ut?100:1e3,it=ot?it:100,this},this.setFrameDesign=function(n){return pt({frame:!0}),ti=n,rt({frame:!0}),this.repaint(),this},this.setBackgroundColor=function(n){return pt({frame:!0,background:!0}),tt=n,rt({frame:!0,background:!0}),this.repaint(),this},this.setForegroundType=function(n){return pt({foreground:!0}),ui=n,rt({foreground:!0}),this.repaint(),this},this.setPointerType=function(n){return pt({background:!0,foreground:!0,pointers:!0}),p=n,p.type==="type1"?(y=steelseries.ColorDef.GRAY,tt=steelseries.BackgroundColor.ANTHRACITE):(y=steelseries.ColorDef.BLACK,tt=steelseries.BackgroundColor.LIGHT_GRAY),rt({background:!0,foreground:!0,pointers:!0}),this.repaint(),this},this.setPointerColor=function(n){return pt({pointers:!0}),y=n,rt({pointers:!0}),this.repaint(),this},this.repaint=function(){hi||rt({frame:!0,background:!0,pointers:!0,foreground:!0}),o.clearRect(0,0,o.canvas.width,o.canvas.height),ii&&o.drawImage(ht,0,0),ri&&o.drawImage(ct,0,0);var n=e*.006;o.save(),o.translate(c,l),o.rotate(kt),o.translate(-c,-l),o.shadowColor="rgba(0, 0, 0, 0.8)",o.shadowOffsetX=o.shadowOffsetY=n,o.shadowBlur=n*2,o.drawImage(lt,0,0),o.translate(c,l),o.rotate(ei-kt),o.translate(-c,-l),o.drawImage(at,0,0),o.restore(),p.type==="type1"&&gi(o),ot&&(o.save(),o.translate(c,l),o.rotate(oi),o.translate(-c,-l),o.shadowColor="rgba(0, 0, 0, 0.8)",o.shadowOffsetX=o.shadowOffsetY=n,o.shadowBlur=n*2,o.drawImage(vt,0,0),o.restore()),fi&&o.drawImage(yt,0,0)},ni(),this},lr=function(t,i){var o,s,h;i=i||{};var u=undefined===i.size?0:i.size,e=undefined===i.value?50:i.value,r=f.getElementById(t).getContext("2d");return u===0&&(u=r.canvas.width),o=u,s=Math.ceil(u*.45),r.canvas.width=o,r.canvas.height=s,h=function(t,i,r,u){var f,e;t.beginPath(),t.moveTo(i*.025,r*.055555),t.lineTo(i*.9,r*.055555),t.lineTo(i*.9,r*.944444),t.lineTo(i*.025,r*.944444),t.lineTo(i*.025,r*.055555),t.closePath(),t.beginPath(),t.moveTo(i*.925,0),t.lineTo(0,0),t.lineTo(0,r),t.lineTo(i*.925,r),t.lineTo(i*.925,r*.722222),t.bezierCurveTo(i*.925,r*.722222,i*.975,r*.722222,i*.975,r*.722222),t.bezierCurveTo(i,r*.722222,i,r*.666666,i,r*.666666),t.bezierCurveTo(i,r*.666666,i,r*.333333,i,r*.333333),t.bezierCurveTo(i,r*.333333,i,r*.277777,i*.975,r*.277777),t.bezierCurveTo(i*.975,r*.277777,i*.925,r*.277777,i*.925,r*.277777),t.lineTo(i*.925,0),t.closePath(),f=t.createLinearGradient(0,0,0,r),f.addColorStop(0,"#ffffff"),f.addColorStop(1,"#7e7e7e"),t.fillStyle=f,t.fill(),t.beginPath(),e=Math.max(i*.875*(u/100),Math.ceil(i*.01)),t.rect(i*.025,i*.025,e,r*.888888),t.closePath();var h=[new n(177,25,2,1),new n(219,167,21,1),new n(121,162,75,1)],c=new ii(0,100,[0,.4,1],h);t.fillStyle=c.getColorAt(u/100).getRgbColor(),t.fill(),t.beginPath(),e=Math.max(e-i*.05,0),t.rect(i*.05,i*.05,e,r*.777777),t.closePath();var l=[new n(198,39,5,1),new n(228,189,32,1),new n(163,216,102,1)],a=[new n(246,121,48,1),new n(246,244,157,1),new n(223,233,86,1)],o=[0,.4,1],s=new ii(0,100,o,l),v=new ii(0,100,o,a);f=t.createLinearGradient(i*.05,0,i*.875,0),f.addColorStop(0,s.getColorAt(u/100).getRgbColor()),f.addColorStop(.5,v.getColorAt(u/100).getRgbColor()),f.addColorStop(1,s.getColorAt(u/100).getRgbColor()),t.fillStyle=f,t.fill(),t.beginPath(),t.rect(i*.025,i*.025,i*.875,r*.444444),t.closePath(),f=t.createLinearGradient(i*.025,i*.025,i*.875,r*.444444),f.addColorStop(0,"rgba(255, 255, 255, 0)"),f.addColorStop(1,"rgba(255, 255, 255, 0.8)"),t.fillStyle=f,t.fill()},this.setValue=function(n){return n=n<0?0:n>100?100:n,e!==n&&(e=n,this.repaint()),this},this.getValue=function(){return e},this.repaint=function(){r.clearRect(0,0,r.canvas.width,r.canvas.height),h(r,o,s,e)},this.repaint(),this},ar=function(n,i){i=i||{};var c=undefined===i.size?0:i.size,ti=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,ii=undefined===i.frameVisible?!0:i.frameVisible,a=undefined===i.pointerColor?steelseries.ColorDef.BLACK:i.pointerColor,ct=undefined===i.backgroundColor?steelseries.BackgroundColor.LIGHT_GRAY:i.backgroundColor,ri=undefined===i.backgroundVisible?!0:i.backgroundVisible,ui=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,fi=undefined===i.foregroundVisible?!0:i.foregroundVisible,ai=undefined===i.customLayer?null:i.customLayer,yt=0,lt=0,pt,vi=6,yi=this,at=0,tt=0,ei=0,oi=0,si=0,v=!1,y=!1,h=f.getElementById(n).getContext("2d"),s,b,l,p,w,hi,nt,ci=!1,it,wt,rt,ut,ft,bt,et,kt,ot,dt,li=function(n,t,i,u,f,s,h){var et=u*t,ot=et+"px "+o,st=t*.15,nt=1,tt=f*t,it=Math.round(.025*t),rt=Math.round(.035*t),ut=Math.round(.045*t),ht=ct.labelColor.getRgbaColor(),ft=ct.labelColor.getRgbaColor(),c=t/2,l=t*.4,a,p,d,b=0,g=0,lt=0,w,v=0,y=0,k,at=-e,vt=r/i;for(n.width=n.height=t,n.save(),n.textAlign="center",n.textBaseline="middle",n.font=ot,k=at,w=0;w<=i+1;k-=vt*.1,w+=.1)n.lineWidth=.5,v=Math.sin(k),y=Math.cos(k),b%2==0&&(a=[c+(l-it)*v+s,c+(l-it)*y+h],p=[c+l*v+s,c+l*y+h],n.strokeStyle=ft,n.beginPath(),n.moveTo(a[0],a[1]),n.lineTo(p[0],p[1]),n.closePath(),n.stroke()),(b===10||b===0)&&(n.fillStyle=ht,n.lineWidth=nt,p=[c+l*v+s,c+l*y+h],d=[c+(l-tt)*v+s,c+(l-tt)*y+h],g===5?(w!==i&&Math.round(w)!==60&&n.fillText(Math.round(w),d[0],d[1],st),n.lineWidth=1.5,a=[c+(l-ut)*v+s,c+(l-ut)*y+h],g=0):(n.lineWidth=nt,a=[c+(l-rt)*v+s,c+(l-rt)*y+h]),n.strokeStyle=ft,n.beginPath(),n.moveTo(a[0],a[1]),n.lineTo(p[0],p[1]),n.closePath(),n.stroke(),b=0,lt++,g++),b++;n.restore()},pi=function(n){var t,i;n.save(),n.beginPath(),n.moveTo(s*.509345,s*.457943),n.lineTo(s*.5,s*.102803),n.lineTo(s*.490654,s*.457943),n.bezierCurveTo(s*.490654,s*.457943,s*.490654,s*.457943,s*.490654,s*.457943),n.bezierCurveTo(s*.471962,s*.462616,s*.457943,s*.481308,s*.457943,s*.5),n.bezierCurveTo(s*.457943,s*.518691,s*.471962,s*.537383,s*.490654,s*.542056),n.bezierCurveTo(s*.490654,s*.542056,s*.490654,s*.542056,s*.490654,s*.542056),n.lineTo(s*.490654,s*.621495),n.lineTo(s*.509345,s*.621495),n.lineTo(s*.509345,s*.542056),n.bezierCurveTo(s*.509345,s*.542056,s*.509345,s*.542056,s*.509345,s*.542056),n.bezierCurveTo(s*.528037,s*.537383,s*.542056,s*.518691,s*.542056,s*.5),n.bezierCurveTo(s*.542056,s*.481308,s*.528037,s*.462616,s*.509345,s*.457943),n.bezierCurveTo(s*.509345,s*.457943,s*.509345,s*.457943,s*.509345,s*.457943),n.closePath(),t=n.createLinearGradient(0,0,0,s*.621495),t.addColorStop(0,a.medium.getRgbaColor()),t.addColorStop(.388888,a.medium.getRgbaColor()),t.addColorStop(.5,a.light.getRgbaColor()),t.addColorStop(.611111,a.medium.getRgbaColor()),t.addColorStop(1,a.medium.getRgbaColor()),n.fillStyle=t,n.strokeStyle=a.dark.getRgbaColor(),n.fill(),n.stroke(),n.beginPath(),i=s*.06542/2,n.arc(l,p,i,0,r),t=n.createLinearGradient(l-i,l+i,0,l+i),t.addColorStop(0,"#e6b35c"),t.addColorStop(.01,"#e6b35c"),t.addColorStop(.99,"#c48200"),t.addColorStop(1,"#c48200"),n.fillStyle=t,n.closePath(),n.fill(),n.beginPath(),i=s*.046728/2,n.arc(l,p,i,0,r),t=n.createRadialGradient(l,l,0,l,l,i),t.addColorStop(0,"#c5c5c5"),t.addColorStop(.19,"#c5c5c5"),t.addColorStop(.22,"#000000"),t.addColorStop(.8,"#000000"),t.addColorStop(.99,"#707070"),t.addColorStop(1,"#707070"),n.fillStyle=t,n.closePath(),n.fill(),n.restore()},wi=function(n){var t,i;n.save(),n.beginPath(),n.moveTo(s*.476635,s*.313084),n.bezierCurveTo(s*.476635,s*.322429,s*.485981,s*.331775,s*.495327,s*.336448),n.bezierCurveTo(s*.495327,s*.336448,s*.495327,s*.350467,s*.495327,s*.350467),n.lineTo(s*.504672,s*.350467),n.bezierCurveTo(s*.504672,s*.350467,s*.504672,s*.336448,s*.504672,s*.336448),n.bezierCurveTo(s*.514018,s*.331775,s*.523364,s*.322429,s*.523364,s*.313084),n.bezierCurveTo(s*.523364,s*.303738,s*.514018,s*.294392,s*.504672,s*.289719),n.bezierCurveTo(s*.504672,s*.289719,s*.5,s*.200934,s*.5,s*.200934),n.bezierCurveTo(s*.5,s*.200934,s*.495327,s*.289719,s*.495327,s*.289719),n.bezierCurveTo(s*.485981,s*.294392,s*.476635,s*.303738,s*.476635,s*.313084),n.closePath(),t=n.createLinearGradient(0,0,s,0),t.addColorStop(0,a.medium.getRgbaColor()),t.addColorStop(.388888,a.medium.getRgbaColor()),t.addColorStop(.5,a.light.getRgbaColor()),t.addColorStop(.611111,a.medium.getRgbaColor()),t.addColorStop(1,a.medium.getRgbaColor()),n.fillStyle=t,n.strokeStyle=a.dark.getRgbaColor(),n.fill(),n.stroke(),n.beginPath(),i=s*.037383/2,n.arc(l,nt+w/2,i,0,r),n.fillStyle="#C48200",n.closePath(),n.fill(),n.beginPath(),i=s*.028037/2,n.arc(l,nt+w/2,i,0,r),n.fillStyle="#999999",n.closePath(),n.fill(),n.beginPath(),i=s*.018691/2,n.arc(l,nt+w/2,i,0,r),n.fillStyle="#000000",n.closePath(),n.fill(),n.restore()},gt=function(){tt=(new Date).getTime()-at,lt=tt*vi/1e3,yt=lt%10800/30,ei=tt/6e4%30,oi=tt/1e3%60,si=tt%1e3},ht=function(n){n=n||{};var t=undefined===n.frame?!1:n.frame,i=undefined===n.background?!1:n.background,r=undefined===n.pointers?!1:n.pointers,u=undefined===n.foreground?!1:n.foreground;ci=!0,t&&ii&&k(wt,ti,l,p,s,b),i&&ri&&(g(ut,ct,l,p,s,b),st(ut,ai,l,p,s,b),li(ut,s,60,.075,.1,0,0),li(ut,w,30,.095,.13,hi,nt)),r&&(pi(kt),wi(bt)),u&&fi&&d(dt,ui,s,b,!1)},vt=function(n){n=n||{};var t=undefined===n.frame?!1:n.frame,i=undefined===n.background?!1:n.background,r=undefined===n.pointers?!1:n.pointers,u=undefined===n.foreground?!1:n.foreground;t&&(it.width=c,it.height=c,wt=it.getContext("2d")),i&&(rt.width=c,rt.height=c,ut=rt.getContext("2d")),r&&(ft.width=c,ft.height=c,bt=ft.getContext("2d"),et.width=c,et.height=c,kt=et.getContext("2d")),u&&(ot.width=c,ot.height=c,dt=ot.getContext("2d"))},ni=function(){y||(gt(),yi.repaint()),v&&(pt=setTimeout(ni,200))};return this.isRunning=function(){return v},this.start=function(){return v||(v=!0,at=(new Date).getTime()-tt,ni()),this},this.stop=function(){return v&&(v=!1,clearTimeout(pt)),y&&(y=!1,gt(),this.repaint()),this},this.reset=function(){return v&&(v=!1,y=!1,clearTimeout(pt)),at=(new Date).getTime(),gt(),this.repaint(),this},this.lap=function(){return v&&!y?y=!0:y&&(y=!1),this},this.getMeasuredTime=function(){return ei+":"+oi+":"+si},this.setFrameDesign=function(n){return vt({frame:!0}),ti=n,ht({frame:!0}),this.repaint(),this},this.setBackgroundColor=function(n){return vt({background:!0}),ct=n,ht({background:!0}),this.repaint(),this},this.setForegroundType=function(n){return vt({foreground:!0}),ui=n,ht({foreground:!0}),this.repaint(),this},this.setPointerColor=function(n){return vt({pointers:!0}),a=n,ht({pointers:!0}),this.repaint(),this},this.repaint=function(){ci||ht({frame:!0,background:!0,pointers:!0,foreground:!0}),h.clearRect(0,0,s,b),ii&&h.drawImage(it,0,0),ri&&h.drawImage(rt,0,0);var n=s*.006,t=(yt+2*Math.sin(yt*u))*u,i=(lt+2*Math.sin(lt*u))*u;h.save(),h.translate(l,nt+w/2),h.rotate(t),h.translate(-l,-(nt+w/2)),h.shadowColor="rgba(0, 0, 0, 0.8)",h.shadowOffsetX=h.shadowOffsetY=n/2,h.shadowBlur=n,h.drawImage(ft,0,0),h.restore(),h.save(),h.translate(l,p),h.rotate(i),h.translate(-l,-p),h.shadowColor="rgba(0, 0, 0, 0.8)",h.shadowOffsetX=h.shadowOffsetY=n/2,h.shadowBlur=n,h.drawImage(et,0,0),h.restore(),fi&&h.drawImage(ot,0,0)},c=c===0?Math.min(h.canvas.width,h.canvas.height):c,h.canvas.width=c,h.canvas.height=c,s=c,b=c,l=s/2,p=b/2,w=.285*s,hi=l-w/2,nt=.17*s,it=t(c,c),wt=it.getContext("2d"),rt=t(c,c),ut=rt.getContext("2d"),ft=t(c,c),bt=ft.getContext("2d"),et=t(c,c),kt=et.getContext("2d"),ot=t(c,c),dt=ot.getContext("2d"),at=(new Date).getTime(),ni(),this},vr=function(n,i){function ur(){vt=r/(ri-p),yt=vt/10,bt=yt/10}function fr(){ui=y%1e3/100,pt=y%1e4/100,wt=y%1e5/100}var tt,lt;i=i||{};var c=undefined===i.size?0:i.size,dt=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,gt=undefined===i.frameVisible?!0:i.frameVisible,at=undefined===i.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:i.backgroundColor,vi=undefined===i.backgroundVisible?!0:i.backgroundVisible,yi=undefined===i.knobType?steelseries.KnobType.METAL_KNOB:i.knobType,pi=undefined===i.knobStyle?steelseries.KnobStyle.BLACK:i.knobStyle,w=undefined===i.lcdColor?steelseries.LcdColor.BLACK:i.lcdColor,ni=undefined===i.lcdVisible?!0:i.lcdVisible,wi=undefined===i.digitalFont?!1:i.digitalFont,ti=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,ii=undefined===i.foregroundVisible?!0:i.foregroundVisible,bi=undefined===i.customLayer?null:i.customLayer,p=0,ri=10,y=p,ui=0,pt=0,wt=0,vt,yt,bt,ki=1,b,kt=!1,u,s,a,v,fi,h=f.getElementById(n).getContext("2d"),di=e,ei=!1,it=t(c,c),oi=it.getContext("2d"),rt=t(c,c),ut=rt.getContext("2d"),si,et=t(c,c),hi=et.getContext("2d"),ot=t(c,c),ci=ot.getContext("2d"),ht=t(c,c),li=ht.getContext("2d"),ct=t(c,c),ai=ct.getContext("2d");h.save(),c=c===0?Math.min(h.canvas.width,h.canvas.height):c,h.canvas.width=c,h.canvas.height=c,u=c,s=c,a=u/2,v=s/2,fi=Math.floor(u*.09)+"px "+o;var gi=function(n){h.save(),h.textAlign="right",h.textBaseline="middle",h.strokeStyle=w.textColor,h.fillStyle=w.textColor,(w===steelseries.LcdColor.STANDARD||w===steelseries.LcdColor.STANDARD_GREEN)&&(h.shadowColor="gray",h.shadowOffsetX=u*.007,h.shadowOffsetY=u*.007,h.shadowBlur=u*.009),h.font=wi?Math.floor(u*.075)+"px "+ft:Math.floor(u*.075)+"px "+o,h.fillText(Math.round(n),(u+u*.4)/2-4,u*.607,u*.4),h.restore()},nr=function(n,t,i,r,f,e){var k=Math.max(u*.012,2),d=Math.max(u*.007,1.5),p=u*.13,w=u*.05,b=u*.07,o=u*.4,c=0,g=0,s=0,h=0,y,l,nt=-i-t/2;for(n.save(),n.textAlign="center",n.textBaseline="middle",n.font=fi,n.strokeStyle=at.labelColor.getRgbaColor(),n.fillStyle=at.labelColor.getRgbaColor(),y=nt,l=0;l<=10;y-=e*.1,l+=.1)s=Math.sin(y),h=Math.cos(y),c%2==0&&(n.lineWidth=d,n.beginPath(),n.moveTo(a+(o-w)*s,v+(o-w)*h),n.lineTo(a+o*s,v+o*h),n.closePath(),n.stroke()),(c===10||c===0)&&(n.lineWidth=k,t===0&&Math.round(l)!==ri&&n.fillText(Math.round(l).toString(),a+(o-p)*s,v+(o-p)*h),c=0,g++,n.beginPath(),n.moveTo(a+(o-b)*s,v+(o-b)*h),n.lineTo(a+o*s,v+o*h),n.closePath(),n.stroke()),c++;n.restore()},tr=function(n,t){var i;t?(n.fillStyle="rgba(0, 0, 0, 0.5)",n.strokeStyle="rgba(0, 0, 0, 0.5)"):(i=n.createLinearGradient(0,s*.168224,0,s*.626168),i.addColorStop(0,"#ffffff"),i.addColorStop(.31,"#ffffff"),i.addColorStop(.3101,"#ffffff"),i.addColorStop(.32,"#202020"),i.addColorStop(1,"#202020"),n.fillStyle=i),n.save(),n.beginPath(),n.moveTo(u*.518691,s*.471962),n.bezierCurveTo(u*.514018,s*.471962,u*.509345,s*.467289,u*.509345,s*.467289),n.lineTo(u*.509345,s*.200934),n.lineTo(u*.5,s*.168224),n.lineTo(u*.490654,s*.200934),n.lineTo(u*.490654,s*.467289),n.bezierCurveTo(u*.490654,s*.467289,u*.481308,s*.471962,u*.481308,s*.471962),n.bezierCurveTo(u*.471962,s*.481308,u*.467289,s*.490654,u*.467289,s*.5),n.bezierCurveTo(u*.467289,s*.514018,u*.476635,s*.528037,u*.490654,s*.53271),n.bezierCurveTo(u*.490654,s*.53271,u*.490654,s*.579439,u*.490654,s*.588785),n.bezierCurveTo(u*.485981,s*.593457,u*.481308,s*.59813,u*.481308,s*.607476),n.bezierCurveTo(u*.481308,s*.616822,u*.490654,s*.626168,u*.5,s*.626168),n.bezierCurveTo(u*.509345,s*.626168,u*.518691,s*.616822,u*.518691,s*.607476),n.bezierCurveTo(u*.518691,s*.59813,u*.514018,s*.593457,u*.504672,s*.588785),n.bezierCurveTo(u*.504672,s*.579439,u*.504672,s*.53271,u*.509345,s*.53271),n.bezierCurveTo(u*.523364,s*.528037,u*.53271,s*.514018,u*.53271,s*.5),n.bezierCurveTo(u*.53271,s*.490654,u*.528037,s*.481308,u*.518691,s*.471962),n.closePath(),n.fill(),n.restore()},ir=function(n){var t;t=n.createLinearGradient(0,s*.401869,0,s*.616822),t.addColorStop(0,"#ffffff"),t.addColorStop(.51,"#ffffff"),t.addColorStop(.52,"#ffffff"),t.addColorStop(.5201,"#202020"),t.addColorStop(.53,"#202020"),t.addColorStop(1,"#202020"),n.fillStyle=t,n.beginPath(),n.moveTo(u*.518691,s*.471962),n.bezierCurveTo(u*.514018,s*.462616,u*.528037,s*.401869,u*.528037,s*.401869),n.lineTo(u*.5,s*.331775),n.lineTo(u*.471962,s*.401869),n.bezierCurveTo(u*.471962,s*.401869,u*.485981,s*.462616,u*.481308,s*.471962),n.bezierCurveTo(u*.471962,s*.481308,u*.467289,s*.490654,u*.467289,s*.5),n.bezierCurveTo(u*.467289,s*.514018,u*.476635,s*.528037,u*.490654,s*.53271),n.bezierCurveTo(u*.490654,s*.53271,u*.462616,s*.574766,u*.462616,s*.593457),n.bezierCurveTo(u*.467289,s*.616822,u*.5,s*.612149,u*.5,s*.612149),n.bezierCurveTo(u*.5,s*.612149,u*.53271,s*.616822,u*.537383,s*.593457),n.bezierCurveTo(u*.537383,s*.574766,u*.509345,s*.53271,u*.509345,s*.53271),n.bezierCurveTo(u*.523364,s*.528037,u*.53271,s*.514018,u*.53271,s*.5),n.bezierCurveTo(u*.53271,s*.490654,u*.528037,s*.481308,u*.518691,s*.471962),n.closePath(),n.fill(),n.restore()},rr=function(n){n.fillStyle="#ffffff",n.beginPath(),n.moveTo(u*.518691,s*.471962),n.bezierCurveTo(u*.514018,s*.471962,u*.514018,s*.467289,u*.514018,s*.467289),n.lineTo(u*.514018,s*.317757),n.lineTo(u*.504672,s*.303738),n.lineTo(u*.504672,s*.182242),n.lineTo(u*.53271,s*.116822),n.lineTo(u*.462616,s*.116822),n.lineTo(u*.495327,s*.182242),n.lineTo(u*.495327,s*.299065),n.lineTo(u*.485981,s*.317757),n.lineTo(u*.485981,s*.467289),n.bezierCurveTo(u*.485981,s*.467289,u*.485981,s*.471962,u*.481308,s*.471962),n.bezierCurveTo(u*.471962,s*.481308,u*.467289,s*.490654,u*.467289,s*.5),n.bezierCurveTo(u*.467289,s*.518691,u*.481308,s*.53271,u*.5,s*.53271),n.bezierCurveTo(u*.518691,s*.53271,u*.53271,s*.518691,u*.53271,s*.5),n.bezierCurveTo(u*.53271,s*.490654,u*.528037,s*.481308,u*.518691,s*.471962),n.closePath(),n.fill()};return tt=function(n){n=n||{};var i=undefined===n.frame?!1:n.frame,t=undefined===n.background?!1:n.background,r=undefined===n.pointers?!1:n.pointers,f=undefined===n.foreground?!1:n.foreground;ei=!0,ur(),i&&gt&&k(oi,dt,a,v,u,s),t&&vi&&(g(ut,at,a,v,u,s),st(ut,bi,a,v,u,s),nr(ut,0,di,0,10,vt,ki,0,!0,!0,null)),t&&ni&&(si=nt(u*.4,s*.09,w),ut.drawImage(si,(u-u*.4)/2,s*.56)),r&&(tr(li,!1),ir(ci,!1),rr(hi,!1)),f&&ii&&d(ai,ti,u,s,!0,yi,pi)},lt=function(n){n=n||{};var t=undefined===n.frame?!1:n.frame,i=undefined===n.background?!1:n.background,r=undefined===n.pointers?!1:n.pointers,u=undefined===n.foreground?!1:n.foreground;t&&(it.width=c,it.height=c,oi=it.getContext("2d")),i&&(rt.width=c,rt.height=c,ut=rt.getContext("2d")),r&&(ht.width=c,ht.height=c,li=ht.getContext("2d"),ot.width=c,ot.height=c,ci=ot.getContext("2d"),et.width=c,et.height=c,hi=et.getContext("2d")),u&&(ct.width=c,ct.height=c,ai=ct.getContext("2d"))},this.setValue=function(n){y=parseFloat(n),this.repaint()},this.getValue=function(){return y},this.setValueAnimated=function(n){n=parseFloat(n);var t=n<p?p:n,r=this,i;return y!==t&&(undefined!==b&&b.isPlaying&&b.stop(),i=Math.max(Math.abs(y-t)/2e3,1),b=new Tween({},"",Tween.regularEaseInOut,y,t,i),b.onMotionChanged=function(n){y=n.target._pos,kt||(kt=!0,l(r.repaint))},b.start()),this},this.setFrameDesign=function(n){return lt({frame:!0}),dt=n,tt({frame:!0}),this.repaint(),this},this.setBackgroundColor=function(n){return lt({background:!0,pointer:!0}),at=n,tt({background:!0,pointer:!0}),this.repaint(),this},this.setForegroundType=function(n){return lt({foreground:!0}),ti=n,tt({foreground:!0}),this.repaint(),this},this.setLcdColor=function(n){return w=n,lt({background:!0}),tt({background:!0}),this.repaint(),this},this.repaint=function(){ei||tt({frame:!0,background:!0,led:!0,pointers:!0,foreground:!0}),h.clearRect(0,0,h.canvas.width,h.canvas.height),gt&&h.drawImage(it,0,0),h.drawImage(rt,0,0),ni&&gi(y),fr();var n=u*.006*.5;h.save(),h.translate(a,v),h.rotate((wt-p)*bt),h.translate(-a,-v),h.shadowColor="rgba(0, 0, 0, 0.8)",h.shadowOffsetX=h.shadowOffsetY=n,h.shadowBlur=n*2,h.drawImage(et,0,0),n=u*.006*.75,h.shadowOffsetX=h.shadowOffsetY=n,h.translate(a,v),h.rotate((pt-p)*yt-(wt-p)*bt),h.translate(-a,-v),h.drawImage(ot,0,0),n=u*.006,h.shadowOffsetX=h.shadowOffsetY=n,h.translate(a,v),h.rotate((ui-p)*vt-(pt-p)*yt),h.translate(-a,-v),h.drawImage(ht,0,0),h.restore(),ii&&h.drawImage(ct,0,0),kt=!1},this.repaint(),this},yr=function(n,t){function ui(n,t,i){var r=f.createElement("canvas");return r.width=n,r.height=t,i(r.getContext("2d")),r}var d,ut;t=t||{};var o=undefined===t.width?0:t.width,s=undefined===t.height?0:t.height,e=f.getElementById(n).getContext("2d"),g,i,u,nt=!1,tt=!1,it=!1,rt=!1,h=f.createElement("canvas"),ft=h.getContext("2d"),c=f.createElement("canvas"),et=c.getContext("2d"),l=f.createElement("canvas"),ot=l.getContext("2d"),a=f.createElement("canvas"),st=a.getContext("2d"),v=f.createElement("canvas"),ht=v.getContext("2d"),y=f.createElement("canvas"),ct=y.getContext("2d"),p=f.createElement("canvas"),lt=p.getContext("2d"),w=f.createElement("canvas"),at=w.getContext("2d"),b=f.createElement("canvas"),vt=b.getContext("2d"),k=f.createElement("canvas"),yt=k.getContext("2d");o===0&&(o=e.canvas.width),s===0&&(s=e.canvas.height),e.canvas.width=o,e.canvas.height=s,g=o<s*.352517?o*2.836734:s,i=g*.352517,u=g,h.width=i,h.height=u,c.width=i,c.height=u,l.width=i,l.height=u,a.width=i,a.height=u,v.width=i,v.height=u,y.width=i,y.height=u,p.width=i,p.height=u,w.width=i,w.height=u,b.width=i,b.height=u,k.width=i,k.height=u;var pt=function(n){var r,t;n.save(),n.save(),n.beginPath(),n.moveTo(.107142*i,0),n.lineTo(i-.107142*i,0),n.quadraticCurveTo(i,0,i,.107142*i),n.lineTo(i,u-.107142*i),n.quadraticCurveTo(i,u,i-.107142*i,u),n.lineTo(.107142*i,u),n.quadraticCurveTo(0,u,0,u-.107142*i),n.lineTo(0,.107142*i),n.quadraticCurveTo(0,0,.107142*i,u),n.closePath(),r=n.createLinearGradient(.040816*i,.007194*u,.952101*i,.995882*u),r.addColorStop(0,"rgb(152, 152, 154)"),r.addColorStop(.01,"rgb(152, 152, 154)"),r.addColorStop(.09,"#333333"),r.addColorStop(.24,"rgb(152, 152, 154)"),r.addColorStop(.55,"rgb(31, 31, 31)"),r.addColorStop(.78,"#363636"),r.addColorStop(.98,"#000000"),r.addColorStop(1,"#000000"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(.030612*i+.084183*i,.010791*u),n.lineTo(.030612*i+.938775*i-.084183*i,.010791*u),n.quadraticCurveTo(.030612*i+.938775*i,.010791*u,.030612*i+.938775*i,.010791*u+.084183*i),n.lineTo(.030612*i+.938775*i,.010791*u+.978417*u-.084183*i),n.quadraticCurveTo(.030612*i+.938775*i,.010791*u+.978417*u,.030612*i+.938775*i-.084183*i,.010791*u+.978417*u),n.lineTo(.030612*i+.084183*i,.010791*u+.978417*u),n.quadraticCurveTo(.030612*i,.010791*u+.978417*u,.030612*i,.010791*u+.978417*u-.084183*i),n.lineTo(.030612*i,.010791*u+.084183*i),n.quadraticCurveTo(.030612*i,.010791*u,.030612*i+.084183*i,.010791*u),n.closePath(),t=n.createLinearGradient(-.132653*i,-.053956*u,2.061408*i,.667293*u),t.addColorStop(0,"#000000"),t.addColorStop(.01,"#000000"),t.addColorStop(.16,"#373735"),t.addColorStop(.31,"#000000"),t.addColorStop(.44,"#303030"),t.addColorStop(.65,"#000000"),t.addColorStop(.87,"#363636"),t.addColorStop(.98,"#000000"),t.addColorStop(1,"#000000"),n.fillStyle=t,n.fill(),n.restore(),n.restore()},wt=function(n){var t,f,e,o;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.805755*u,.397959*i,0,r,!1),t=n.createLinearGradient(0,.665467*u,0,.946043*u),t.addColorStop(0,"#ffffff"),t.addColorStop(.05,"rgb(204, 204, 204)"),t.addColorStop(.1,"rgb(153, 153, 153)"),t.addColorStop(.17,"#666666"),t.addColorStop(.27,"#333333"),t.addColorStop(1,"#010101"),n.fillStyle=t,n.fill(),n.restore(),n.save(),n.scale(1.083333,1),n.beginPath(),n.arc(.461538*i,.816546*u,.367346*i,0,r,!1),f=n.createLinearGradient(0,.68705*u,0,.946043*u),f.addColorStop(0,"#000000"),f.addColorStop(.35,"#040404"),f.addColorStop(.66,"#000000"),f.addColorStop(1,"#010101"),n.fillStyle=f,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.809352*u,.357142*i,0,r,!1),e=n.createRadialGradient(.5*i,.809352*u,0,.5*i,.809352*u,.362244*i),e.addColorStop(0,"#000000"),e.addColorStop(.88,"#000000"),e.addColorStop(.95,"rgb(94, 94, 94)"),e.addColorStop(1,"#010101"),n.fillStyle=e,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.809352*u,.357142*i,0,r,!1),o=n.createLinearGradient(0,.68705*u,0,.917266*u),o.addColorStop(0,"#000000"),o.addColorStop(1,"rgba(1, 1, 1, 0)"),n.fillStyle=o,n.fill(),n.restore(),n.restore()},bt=function(n){var t,f;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.809352*u,.32653*i,0,r,!1),t=n.createRadialGradient(.5*i,.809352*u,0,.5*i,.809352*u,.32653*i),t.addColorStop(0,"rgb(85, 185, 123)"),t.addColorStop(1,"rgb(0, 31, 0)"),n.fillStyle=t,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(0,.812949*u),n.bezierCurveTo(0,.910071*u,.224489*i,.989208*u,.5*i,.989208*u),n.bezierCurveTo(.77551*i,.989208*u,i,.910071*u,i,.809352*u),n.bezierCurveTo(.908163*i,.751798*u,.704081*i,.68705*u,.5*i,.68705*u),n.bezierCurveTo(.285714*i,.68705*u,.081632*i,.751798*u,0,.812949*u),n.closePath(),f=n.createRadialGradient(.5*i,.809352*u,0,.5*i,.809352*u,.515306*i),f.addColorStop(0,"rgb(65, 187, 126)"),f.addColorStop(1,"rgba(4, 37, 8, 0)"),n.fillStyle=f,n.fill(),n.restore(),n.restore()},kt=function(n){var f,t;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.809352*u,.32653*i,0,r,!1),f=n.createRadialGradient(.5*i,.809352*u,0,.5*i,.809352*u,.32653*i),f.addColorStop(0,"rgba(0, 255, 0, 0.25)"),f.addColorStop(1,"rgba(0, 255, 0, 0.05)"),n.fillStyle=f,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.809352*u,.32653*i,0,r,!1),t=n.createRadialGradient(.5*i,.809352*u,0,.5*i,.809352*u,.32653*i),t.addColorStop(0,"rgba(1, 1, 1, 0)"),t.addColorStop(.55,"rgba(0, 0, 0, 0)"),t.addColorStop(.5501,"rgba(0, 0, 0, 0)"),t.addColorStop(.78,"rgba(0, 0, 0, 0.12)"),t.addColorStop(.79,"rgba(0, 0, 0, 0.12)"),t.addColorStop(1,"rgba(0, 0, 0, 0.5)"),n.fillStyle=t,n.fill(),n.restore(),n.fillStyle=n.createPattern(d,"repeat"),n.fill(),n.restore()},dt=function(n){var t,f,e,o;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.496402*u,.397959*i,0,r,!1),t=n.createLinearGradient(0,.356115*u,0,.63669*u),t.addColorStop(0,"#ffffff"),t.addColorStop(.05,"rgb(204, 204, 204)"),t.addColorStop(.1,"rgb(153, 153, 153)"),t.addColorStop(.17,"#666666"),t.addColorStop(.27,"#333333"),t.addColorStop(1,"#010101"),n.fillStyle=t,n.fill(),n.restore(),n.save(),n.scale(1.083333,1),n.beginPath(),n.arc(.461538*i,.507194*u,.367346*i,0,r,!1),f=n.createLinearGradient(0,.377697*u,0,.63669*u),f.addColorStop(0,"#000000"),f.addColorStop(.35,"#040404"),f.addColorStop(.66,"#000000"),f.addColorStop(1,"#010101"),n.fillStyle=f,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.5*u,.357142*i,0,r,!1),e=n.createRadialGradient(.5*i,.5*u,0,.5*i,.5*u,.362244*i),e.addColorStop(0,"#000000"),e.addColorStop(.88,"#000000"),e.addColorStop(.95,"#5e5e5e"),e.addColorStop(1,"#010101"),n.fillStyle=e,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.5*u,.357142*i,0,r,!1),o=n.createLinearGradient(0,.377697*u,0,.607913*u),o.addColorStop(0,"#000000"),o.addColorStop(1,"rgba(1, 1, 1, 0)"),n.fillStyle=o,n.fill(),n.restore(),n.restore()},gt=function(n){var t,f;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.5*u,.32653*i,0,r,!1),t=n.createRadialGradient(.5*i,.5*u,0,.5*i,.5*u,.32653*i),t.addColorStop(0,"#fed434"),t.addColorStop(1,"#82330c"),n.fillStyle=t,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(0,.503597*u),n.bezierCurveTo(0,.600719*u,.224489*i,.679856*u,.5*i,.679856*u),n.bezierCurveTo(.77551*i,.679856*u,i,.600719*u,i,.5*u),n.bezierCurveTo(.908163*i,.442446*u,.704081*i,.377697*u,.5*i,.377697*u),n.bezierCurveTo(.285714*i,.377697*u,.081632*i,.442446*u,0,.503597*u),n.closePath(),f=n.createRadialGradient(.5*i,.5*u,0,.5*i,.5*u,.515306*i),f.addColorStop(0,"#fed434"),f.addColorStop(1,"rgba(130, 51, 12, 0)"),n.fillStyle=f,n.fill(),n.restore(),n.restore()},ni=function(n){var f,t;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.5*u,.32653*i,0,r,!1),f=n.createRadialGradient(.5*i,.5*u,0,.5*i,.5*u,.32653*i),f.addColorStop(0,"rgba(255, 255, 0, 0.25)"),f.addColorStop(1,"rgba(255, 255, 0, 0.05)"),n.fillStyle=f,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.5*u,.32653*i,0,r,!1),t=n.createRadialGradient(.5*i,.5*u,0,.5*i,.5*u,.32653*i),t.addColorStop(0,"rgba(1, 1, 1, 0)"),t.addColorStop(.55,"rgba(0, 0, 0, 0)"),t.addColorStop(.5501,"rgba(0, 0, 0, 0)"),t.addColorStop(.78,"rgba(0, 0, 0, 0.12)"),t.addColorStop(.79,"rgba(0, 0, 0, 0.13)"),t.addColorStop(1,"rgba(0, 0, 0, 0.5)"),n.fillStyle=t,n.fill(),n.restore(),n.fillStyle=n.createPattern(d,"repeat"),n.fill(),n.restore()},ti=function(n){var t,f,e,o;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.18705*u,.397959*i,0,r,!1),t=n.createLinearGradient(.5*i,.046762*u,.5*i,.327338*u),t.addColorStop(0,"#ffffff"),t.addColorStop(.05,"#cccccc"),t.addColorStop(.1,"#999999"),t.addColorStop(.17,"#666666"),t.addColorStop(.27,"#333333"),t.addColorStop(1,"#010101"),n.fillStyle=t,n.fill(),n.restore(),n.save(),n.scale(1.083333,1),n.beginPath(),n.arc(.461538*i,.197841*u,.367346*i,0,r,!1),f=n.createLinearGradient(.5*i,.068345*u,.5*i,.327338*u),f.addColorStop(0,"#000000"),f.addColorStop(.35,"#040404"),f.addColorStop(.66,"#000000"),f.addColorStop(1,"#010101"),n.fillStyle=f,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.190647*u,.357142*i,0,r,!1),e=n.createRadialGradient(.5*i,.190647*u,0,.5*i,.190647*u,.362244*i),e.addColorStop(0,"#000000"),e.addColorStop(.88,"#000000"),e.addColorStop(.95,"#5e5e5e"),e.addColorStop(1,"#010101"),n.fillStyle=e,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.190647*u,.357142*i,0,r,!1),o=n.createLinearGradient(.5*i,.068345*u,.5*i,.298561*u),o.addColorStop(0,"#000000"),o.addColorStop(1,"rgba(1, 1, 1, 0)"),n.fillStyle=o,n.fill(),n.restore(),n.restore()},ii=function(n){var t,f;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.190647*u,.32653*i,0,r,!1),t=n.createRadialGradient(.5*i,.190647*u,0,.5*i,.190647*u,.32653*i),t.addColorStop(0,"#ff0000"),t.addColorStop(1,"#410004"),n.fillStyle=t,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(0,.194244*u),n.bezierCurveTo(0,.291366*u,.224489*i,.370503*u,.5*i,.370503*u),n.bezierCurveTo(.77551*i,.370503*u,i,.291366*u,i,.190647*u),n.bezierCurveTo(.908163*i,.133093*u,.704081*i,.068345*u,.5*i,.068345*u),n.bezierCurveTo(.285714*i,.068345*u,.081632*i,.133093*u,0,.194244*u),n.closePath(),f=n.createRadialGradient(.5*i,.190647*u,0,.5*i,.190647*u,.515306*i),f.addColorStop(0,"#ff0000"),f.addColorStop(1,"rgba(118, 5, 1, 0)"),n.fillStyle=f,n.fill(),n.restore(),n.restore()},ri=function(n){var f,t;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.190647*u,.32653*i,0,r,!1),f=n.createRadialGradient(.5*i,.190647*u,0,.5*i,.190647*u,.32653*i),f.addColorStop(0,"rgba(255, 0, 0, 0.25)"),f.addColorStop(1,"rgba(255, 0, 0, 0.05)"),n.fillStyle=f,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.190647*u,.32653*i,0,r,!1),t=n.createRadialGradient(.5*i,.190647*u,0,.5*i,.190647*u,.32653*i),t.addColorStop(0,"rgba(1, 1, 1, 0)"),t.addColorStop(.55,"rgba(0, 0, 0, 0)"),t.addColorStop(.5501,"rgba(0, 0, 0, 0)"),t.addColorStop(.78,"rgba(0, 0, 0, 0.12)"),t.addColorStop(.79,"rgba(0, 0, 0, 0.13)"),t.addColorStop(1,"rgba(0, 0, 0, 0.5)"),n.fillStyle=t,n.fill(),n.restore(),n.fillStyle=n.createPattern(d,"repeat"),n.fill(),n.restore()};return d=ui(2,2,function(n){n.save(),n.strokeStyle="rgba(0, 0, 0, 0.1)",n.beginPath(),n.lineTo(0,0,1,0),n.lineTo(0,1,0,1),n.stroke(),n.restore()}),ut=function(){rt=!0,pt(ft),wt(et),bt(ot),kt(st),dt(ht),gt(ct),ni(lt),ti(at),ii(vt),ri(yt)},this.setRedOn=function(n){nt=!!n,this.repaint()},this.isRedOn=function(){return nt},this.setYellowOn=function(n){tt=!!n,this.repaint()},this.isYellowOn=function(){return tt},this.setGreenOn=function(n){it=!!n,this.repaint()},this.isGreenOn=function(){return it},this.repaint=function(){rt||ut(),e.save(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(h,0,0),e.drawImage(c,0,0),it&&e.drawImage(l,0,0),e.drawImage(a,0,0),e.drawImage(v,0,0),tt&&e.drawImage(y,0,0),e.drawImage(p,0,0),e.drawImage(w,0,0),nt&&e.drawImage(b,0,0),e.drawImage(k,0,0),e.restore()},this.repaint(),this},pr=function(n,t){function nt(n,t,i){var r=f.createElement("canvas");return r.width=n,r.height=t,i(r.getContext("2d")),r}var w;t=t||{};var u,e=undefined===t.width?0:t.width,o=undefined===t.height?0:t.height,s=undefined===t.glowColor?"#ffff00":t.glowColor,a,r,i,p=!1,v=!1,y=1,h=f.createElement("canvas"),k=h.getContext("2d"),c=f.createElement("canvas"),d=c.getContext("2d"),l=f.createElement("canvas"),g=l.getContext("2d");u=document.getElementById(n).getContext("2d"),e===0&&(e=u.canvas.width),o===0&&(o=u.canvas.height),u.canvas.width=e,u.canvas.height=o,a=e<o?e:o,r=a,i=a,w=function(n){var t,i=nt(1,1,function(t){t.fillStyle=n,t.beginPath(),t.rect(0,0,1,1),t.fill()});return t=i.getContext("2d").getImageData(0,0,2,2).data,[t[0],t[1],t[2]]},h.width=r,h.height=i,c.width=r,c.height=i,l.width=r,l.height=i;var tt=function(n){var t;n.save(),n.clearRect(0,0,n.canvas.width,n.canvas.height),n.save(),n.beginPath(),n.moveTo(.289473*r,.438596*i),n.bezierCurveTo(.289473*r,.561403*i,.385964*r,.605263*i,.385964*r,.745614*i),n.bezierCurveTo(.385964*r,.745614*i,.587719*r,.745614*i,.587719*r,.745614*i),n.bezierCurveTo(.587719*r,.605263*i,.692982*r,.561403*i,.692982*r,.438596*i),n.bezierCurveTo(.692982*r,.324561*i,.605263*r,.22807*i,.5*r,.22807*i),n.bezierCurveTo(.385964*r,.22807*i,.289473*r,.324561*i,.289473*r,.438596*i),n.closePath(),t=n.createLinearGradient(0,.289473*i,0,.701754*i),t.addColorStop(0,"#eeeeee"),t.addColorStop(.99,"#999999"),t.addColorStop(1,"#999999"),n.fillStyle=t,n.fill(),n.lineCap="butt",n.lineJoin="round",n.lineWidth=.008771*r,n.strokeStyle="#cccccc",n.stroke(),n.restore(),n.restore()},it=function(n){var t,e=w(s),o=e[0],u=e[1],h=e[2],f=kr(o,u,h);n.save(),n.clearRect(0,0,n.canvas.width,n.canvas.height),n.save(),n.beginPath(),n.moveTo(.289473*r,.438596*i),n.bezierCurveTo(.289473*r,.561403*i,.385964*r,.605263*i,.385964*r,.745614*i),n.bezierCurveTo(.385964*r,.745614*i,.587719*r,.745614*i,.587719*r,.745614*i),n.bezierCurveTo(.587719*r,.605263*i,.692982*r,.561403*i,.692982*r,.438596*i),n.bezierCurveTo(.692982*r,.324561*i,.605263*r,.22807*i,.5*r,.22807*i),n.bezierCurveTo(.385964*r,.22807*i,.289473*r,.324561*i,.289473*r,.438596*i),n.closePath(),t=n.createLinearGradient(0,.289473*i,0,.701754*i),o===u&&u===h?(t.addColorStop(0,"hsl(0, 60%, 0%)"),t.addColorStop(1,"hsl(0, 40%, 0%)")):(t.addColorStop(0,"hsl("+f[0]*255+", "+f[1]*100+"%, 70%)"),t.addColorStop(1,"hsl("+f[0]*255+", "+f[1]*100+"%, 80%)")),n.fillStyle=t,n.shadowOffsetX=0,n.shadowOffsetY=0,n.shadowBlur=30,n.shadowColor=s,n.fill(),n.lineCap="butt",n.lineJoin="round",n.lineWidth=.008771*r,n.strokeStyle="rgba("+o+", "+u+", "+h+", 0.4)",n.stroke(),n.restore(),n.restore()},rt=function(n){var e,t,f,u;n.save(),n.clearRect(0,0,n.canvas.width,n.canvas.height),n.save(),n.beginPath(),n.moveTo(.350877*r,.333333*i),n.bezierCurveTo(.350877*r,.280701*i,.41228*r,.236842*i,.5*r,.236842*i),n.bezierCurveTo(.578947*r,.236842*i,.64035*r,.280701*i,.64035*r,.333333*i),n.bezierCurveTo(.64035*r,.385964*i,.578947*r,.429824*i,.5*r,.429824*i),n.bezierCurveTo(.41228*r,.429824*i,.350877*r,.385964*i,.350877*r,.333333*i),n.closePath(),e=n.createLinearGradient(0,.245614*i,0,.429824*i),e.addColorStop(0,"#ffffff"),e.addColorStop(.99,"rgba(255, 255, 255, 0)"),e.addColorStop(1,"rgba(255, 255, 255, 0)"),n.fillStyle=e,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(.377192*r,.745614*i),n.bezierCurveTo(.377192*r,.745614*i,.429824*r,.72807*i,.491228*r,.72807*i),n.bezierCurveTo(.561403*r,.72807*i,.605263*r,.736842*i,.605263*r,.736842*i),n.lineTo(.605263*r,.763157*i),n.lineTo(.596491*r,.780701*i),n.lineTo(.605263*r,.798245*i),n.lineTo(.596491*r,.815789*i),n.lineTo(.605263*r,.833333*i),n.lineTo(.596491*r,.850877*i),n.lineTo(.605263*r,.868421*i),n.lineTo(.596491*r,.885964*i),n.lineTo(.605263*r,.894736*i),n.bezierCurveTo(.605263*r,.894736*i,.570175*r,.95614*i,.535087*r,.991228*i),n.bezierCurveTo(.526315*r,.991228*i,.517543*r,i,.5*r,i),n.bezierCurveTo(.482456*r,i,.473684*r,i,.464912*r,.991228*i),n.bezierCurveTo(.421052*r,.947368*i,.394736*r,.903508*i,.394736*r,.903508*i),n.lineTo(.394736*r,.894736*i),n.lineTo(.385964*r,.885964*i),n.lineTo(.394736*r,.868421*i),n.lineTo(.385964*r,.850877*i),n.lineTo(.394736*r,.833333*i),n.lineTo(.385964*r,.815789*i),n.lineTo(.394736*r,.798245*i),n.lineTo(.377192*r,.789473*i),n.lineTo(.394736*r,.771929*i),n.lineTo(.377192*r,.763157*i),n.lineTo(.377192*r,.745614*i),n.closePath(),t=n.createLinearGradient(.473684*r,.72807*i,.484702*r,.938307*i),t.addColorStop(0,"#333333"),t.addColorStop(.04,"#d9dad6"),t.addColorStop(.19,"#e4e5e0"),t.addColorStop(.24,"#979996"),t.addColorStop(.31,"#fbffff"),t.addColorStop(.4,"#818584"),t.addColorStop(.48,"#f5f7f4"),t.addColorStop(.56,"#959794"),t.addColorStop(.64,"#f2f2f0"),t.addColorStop(.7,"#828783"),t.addColorStop(.78,"#fcfcfc"),t.addColorStop(1,"#666666"),n.fillStyle=t,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(.377192*r,.745614*i),n.bezierCurveTo(.377192*r,.745614*i,.429824*r,.72807*i,.491228*r,.72807*i),n.bezierCurveTo(.561403*r,.72807*i,.605263*r,.736842*i,.605263*r,.736842*i),n.lineTo(.605263*r,.763157*i),n.lineTo(.596491*r,.780701*i),n.lineTo(.605263*r,.798245*i),n.lineTo(.596491*r,.815789*i),n.lineTo(.605263*r,.833333*i),n.lineTo(.596491*r,.850877*i),n.lineTo(.605263*r,.868421*i),n.lineTo(.596491*r,.885964*i),n.lineTo(.605263*r,.894736*i),n.bezierCurveTo(.605263*r,.894736*i,.570175*r,.95614*i,.535087*r,.991228*i),n.bezierCurveTo(.526315*r,.991228*i,.517543*r,i,.5*r,i),n.bezierCurveTo(.482456*r,i,.473684*r,i,.464912*r,.991228*i),n.bezierCurveTo(.421052*r,.947368*i,.394736*r,.903508*i,.394736*r,.903508*i),n.lineTo(.394736*r,.894736*i),n.lineTo(.385964*r,.885964*i),n.lineTo(.394736*r,.868421*i),n.lineTo(.385964*r,.850877*i),n.lineTo(.394736*r,.833333*i),n.lineTo(.385964*r,.815789*i),n.lineTo(.394736*r,.798245*i),n.lineTo(.377192*r,.789473*i),n.lineTo(.394736*r,.771929*i),n.lineTo(.377192*r,.763157*i),n.lineTo(.377192*r,.745614*i),n.closePath(),f=n.createLinearGradient(.377192*r,.789473*i,.605263*r,.789473*i),f.addColorStop(0,"rgba(0, 0, 0, 0.4)"),f.addColorStop(.15,"rgba(0, 0, 0, 0.32)"),f.addColorStop(.85,"rgba(0, 0, 0, 0.33)"),f.addColorStop(1,"rgba(0, 0, 0, 0.4)"),n.fillStyle=f,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(.421052*r,.947368*i),n.bezierCurveTo(.438596*r,.95614*i,.447368*r,.973684*i,.464912*r,.991228*i),n.bezierCurveTo(.473684*r,i,.482456*r,i,.5*r,i),n.bezierCurveTo(.517543*r,i,.526315*r,.991228*i,.535087*r,.991228*i),n.bezierCurveTo(.543859*r,.982456*i,.561403*r,.95614*i,.578947*r,.947368*i),n.bezierCurveTo(.552631*r,.938596*i,.526315*r,.938596*i,.5*r,.938596*i),n.bezierCurveTo(.473684*r,.938596*i,.447368*r,.938596*i,.421052*r,.947368*i),n.closePath(),u=n.createLinearGradient(0,.938596*i,0,i),u.addColorStop(0,"#050a06"),u.addColorStop(.61,"#070602"),u.addColorStop(.71,"#999288"),u.addColorStop(.83,"#010101"),u.addColorStop(1,"#000000"),n.fillStyle=u,n.fill(),n.restore(),n.restore()},ut=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,n.canvas.width,n.canvas.height),n.restore()},b=function(){p=!0,tt(k),it(d),rt(g)};return this.setOn=function(n){return v=!!n,this.repaint(),this},this.isOn=function(){return v},this.setAlpha=function(n){return y=n,this.repaint(),this},this.getAlpha=function(){return y},this.setGlowColor=function(n){return s=n,b(),this.repaint(),this},this.getGlowColor=function(){return s},this.repaint=function(){p||b(),ut(u),u.save(),u.drawImage(h,0,0),u.globalAlpha=y,v&&u.drawImage(c,0,0),u.globalAlpha=1,u.drawImage(l,0,0),u.restore()},this.repaint(),this},wr=function(n,i){function pt(){var t,n;for(st=!0,p.rect(0,0,c,e),t=p.createLinearGradient(0,0,0,e),t.addColorStop(0,"rgba(0, 0, 0, 1)"),t.addColorStop(.1,"rgba(0, 0, 0, 0.4)"),t.addColorStop(.33,"rgba(255, 255, 255, 0.45)"),t.addColorStop(.46,"rgba(255, 255, 255, 0)"),t.addColorStop(.9,"rgba(0, 0, 0, 0.4)"),t.addColorStop(1,"rgba(0, 0, 0, 1)"),p.fillStyle=t,p.fill(),r.rect(0,0,f,s*1.1),r.fillStyle=vt,r.fill(),r.strokeStyle="#f0f0f0",r.lineWidth="1px",r.moveTo(0,0),r.lineTo(0,s*1.1),r.stroke(),r.strokeStyle="#202020",r.moveTo(f,0),r.lineTo(f,s*1.1),r.stroke(),r.textAlign="center",r.textBaseline="middle",r.font=g,r.fillStyle=yt,n=9;n<21;n++)r.fillText(n%10,f*.5,h*(n-9)+h/2);if(a>0)for(u.rect(0,0,f,s*1.1),u.fillStyle=ct,u.fill(),u.strokeStyle="#f0f0f0",u.lineWidth="1px",u.moveTo(0,0),u.lineTo(0,s*1.1),u.stroke(),u.strokeStyle="#202020",u.moveTo(f,0),u.lineTo(f,s*1.1),u.stroke(),u.textAlign="center",u.textBaseline="middle",u.font=g,u.fillStyle=lt,n=9;n<21;n++)u.fillText(n%10,f*.5,h*(n-9)+h/2);for(n=0;n<b+a;n++)tt[n]=Math.random()*ot*e-ot*e/2}function wt(){for(var u=1,e=o,i,t,r,s,n=0;n<a;n++)e*=10;for(t=Math.floor(e),r=e-t,t=String(t),s=9,n=0;n<a+b;n++)i=+t.substring(t.length-n-1,t.length-n)||0,s!==9&&(r=0),n<a?w.drawImage(ft,c-f*u,-(h*(i+r)+nt+tt[n])):w.drawImage(ut,c-f*u,-(h*(i+r)+nt+tt[n])),u++,s=i}i=i||{};var ht=document,et=undefined===i._context?null:i._context,e=undefined===i.height?0:i.height,b=undefined===i.digits?6:i.digits,a=undefined===i.decimals?1:i.decimals,ct=undefined===i.decimalBackColor?"#F0F0F0":i.decimalBackColor,lt=undefined===i.decimalForeColor?"#F01010":i.decimalForeColor,at=undefined===i.font?"sans-serif":i.font,o=undefined===i.value?0:i.value,vt=undefined===i.valueBackColor?"#050505":i.valueBackColor,yt=undefined===i.valueForeColor?"#F8F8F8":i.valueForeColor,ot=undefined===i.wobbleFactor?.07:i.wobbleFactor,st=!1,v,y,k=!1,d,f,g,c,s,h,nt,tt=[],it,w,rt,p,ut,r,ft,u;y=et?et:ht.getElementById(n).getContext("2d"),e===0&&(e=y.canvas.height),o<0&&(o=0),d=Math.floor(e*.85),g="600 "+d+"px "+at,f=Math.floor(e*.68),c=f*(b+a),s=d*11,h=s/12,nt=h*.81,y.canvas.width=c,y.canvas.height=e,it=t(c,e),w=it.getContext("2d"),rt=t(c,e),p=rt.getContext("2d"),ut=t(f,s*1.1),r=ut.getContext("2d"),ft=t(f,s*1.1),u=ft.getContext("2d"),this.setValueAnimated=function(n){var t=this;return n=parseFloat(n),n<0&&(n=0),o!==n&&(undefined!==v&&v.isPlaying&&v.stop(),v=new Tween({},"",Tween.strongEaseOut,o,n,2),v.onMotionChanged=function(n){o=n.target._pos,k||(k=!0,l(t.repaint))},v.start()),this.repaint(),this},this.setValue=function(n){return o=parseFloat(n),o<0&&(o=0),this.repaint(),this},this.getValue=function(){return o},this.repaint=function(){st||pt(),wt(),w.drawImage(rt,0,0),y.drawImage(it,0,0),k=!1},this.repaint()},li=function(n,t,i,f,e,o){var l=!0,s,h,c=o.symbolColor.getRgbaColor();for(n.save(),n.lineWidth=1,n.fillStyle=c,n.strokeStyle=c,n.translate(t,i),s=0;s<360;s+=15)l=!l,n.beginPath(),n.arc(0,0,f*.26,s*u,(s+15)*u,!1),n.arc(0,0,f*.23,(s+15)*u,s*u,!0),n.closePath(),l&&n.fill(),n.stroke();for(n.translate(-t,-i),s=0;360>=s;s+=90)n.beginPath(),n.moveTo(f*.560747,e*.584112),n.lineTo(f*.640186,e*.644859),n.lineTo(f*.584112,e*.560747),n.lineTo(f*.560747,e*.584112),n.closePath(),n.fillStyle=c,n.fill(),n.stroke(),n.beginPath(),n.moveTo(f*.523364,e*.397196),n.lineTo(f*.5,e*.196261),n.lineTo(f*.471962,e*.397196),n.lineTo(f*.523364,e*.397196),n.closePath(),h=n.createLinearGradient(.476635*f,0,.518691*f,0),h.addColorStop(0,"rgb(222, 223, 218)"),h.addColorStop(.48,"rgb(222, 223, 218)"),h.addColorStop(.49,c),h.addColorStop(1,c),n.fillStyle=h,n.fill(),n.stroke(),n.translate(t,i),n.rotate(s*u),n.translate(-t,-i);n.beginPath(),n.translate(t,i),n.arc(0,0,f*.1,0,r,!1),n.lineWidth=f*.022,n.stroke(),n.translate(-t,-i),n.restore()},ot=function(n,i,u,f,e){var c,o,s,h,l=i.toString()+u.type+f.light.getHexColor()+f.medium.getHexColor();if(!ot.cache[l]){c=t(i,i),o=c.getContext("2d");switch(u.type){case"type2":s=o.createLinearGradient(0,i*.471962,0,i*.130841),s.addColorStop(0,e.getRgbaColor()),s.addColorStop(.36,e.getRgbaColor()),s.addColorStop(.361,f.light.getRgbaColor()),s.addColorStop(1,f.light.getRgbaColor()),o.fillStyle=s,o.beginPath(),o.moveTo(i*.518691,i*.471962),o.lineTo(i*.509345,i*.462616),o.lineTo(i*.509345,i*.341121),o.lineTo(i*.504672,i*.130841),o.lineTo(i*.495327,i*.130841),o.lineTo(i*.490654,i*.341121),o.lineTo(i*.490654,i*.462616),o.lineTo(i*.481308,i*.471962),o.closePath(),o.fill();break;case"type3":o.beginPath(),o.rect(i*.495327,i*.130841,i*.009345,i*.373831),o.closePath(),o.fillStyle=f.light.getRgbaColor(),o.fill();break;case"type4":s=o.createLinearGradient(.467289*i,0,.528036*i,0),s.addColorStop(0,f.dark.getRgbaColor()),s.addColorStop(.51,f.dark.getRgbaColor()),s.addColorStop(.52,f.light.getRgbaColor()),s.addColorStop(1,f.light.getRgbaColor()),o.fillStyle=s,o.beginPath(),o.moveTo(i*.5,i*.126168),o.lineTo(i*.514018,i*.135514),o.lineTo(i*.53271,i*.5),o.lineTo(i*.523364,i*.602803),o.lineTo(i*.476635,i*.602803),o.lineTo(i*.467289,i*.5),o.lineTo(i*.485981,i*.135514),o.lineTo(i*.5,i*.126168),o.closePath(),o.fill();break;case"type5":s=o.createLinearGradient(.471962*i,0,.528036*i,0),s.addColorStop(0,f.light.getRgbaColor()),s.addColorStop(.5,f.light.getRgbaColor()),s.addColorStop(.5,f.medium.getRgbaColor()),s.addColorStop(1,f.medium.getRgbaColor()),o.fillStyle=s,o.beginPath(),o.moveTo(i*.5,i*.495327),o.lineTo(i*.528037,i*.495327),o.lineTo(i*.5,i*.149532),o.lineTo(i*.471962,i*.495327),o.lineTo(i*.5,i*.495327),o.closePath(),o.fill(),o.lineWidth=1,o.lineCap="square",o.lineJoin="miter",o.strokeStyle=f.dark.getRgbaColor(),o.stroke();break;case"type6":o.fillStyle=f.medium.getRgbaColor(),o.beginPath(),o.moveTo(i*.481308,i*.485981),o.lineTo(i*.481308,i*.392523),o.lineTo(i*.485981,i*.317757),o.lineTo(i*.495327,i*.130841),o.lineTo(i*.504672,i*.130841),o.lineTo(i*.514018,i*.317757),o.lineTo(i*.518691,i*.38785),o.lineTo(i*.518691,i*.485981),o.lineTo(i*.504672,i*.485981),o.lineTo(i*.504672,i*.38785),o.lineTo(i*.5,i*.317757),o.lineTo(i*.495327,i*.392523),o.lineTo(i*.495327,i*.485981),o.lineTo(i*.481308,i*.485981),o.closePath(),o.fill();break;case"type7":s=o.createLinearGradient(.481308*i,0,.518691*i,0),s.addColorStop(0,f.dark.getRgbaColor()),s.addColorStop(1,f.medium.getRgbaColor()),o.fillStyle=s,o.beginPath(),o.moveTo(i*.490654,i*.130841),o.lineTo(i*.481308,i*.5),o.lineTo(i*.518691,i*.5),o.lineTo(i*.504672,i*.130841),o.lineTo(i*.490654,i*.130841),o.closePath(),o.fill();break;case"type8":s=o.createLinearGradient(.471962*i,0,.528036*i,0),s.addColorStop(0,f.light.getRgbaColor()),s.addColorStop(.5,f.light.getRgbaColor()),s.addColorStop(.5,f.medium.getRgbaColor()),s.addColorStop(1,f.medium.getRgbaColor()),o.fillStyle=s,o.strokeStyle=f.dark.getRgbaColor(),o.beginPath(),o.moveTo(i*.5,i*.53271),o.lineTo(i*.53271,i*.5),o.bezierCurveTo(i*.53271,i*.5,i*.509345,i*.457943,i*.5,i*.149532),o.bezierCurveTo(i*.490654,i*.457943,i*.467289,i*.5,i*.467289,i*.5),o.lineTo(i*.5,i*.53271),o.closePath(),o.fill(),o.stroke();break;case"type9":s=o.createLinearGradient(.471962*i,0,.528036*i,0),s.addColorStop(0,"rgb(50, 50, 50)"),s.addColorStop(.5,"#666666"),s.addColorStop(1,"rgb(50, 50, 50)"),o.fillStyle=s,o.strokeStyle="#2E2E2E",o.beginPath(),o.moveTo(i*.495327,i*.233644),o.lineTo(i*.504672,i*.233644),o.lineTo(i*.514018,i*.439252),o.lineTo(i*.485981,i*.439252),o.lineTo(i*.495327,i*.233644),o.closePath(),o.moveTo(i*.490654,i*.130841),o.lineTo(i*.471962,i*.471962),o.lineTo(i*.471962,i*.528037),o.bezierCurveTo(i*.471962,i*.528037,i*.476635,i*.602803,i*.476635,i*.602803),o.bezierCurveTo(i*.476635,i*.607476,i*.481308,i*.607476,i*.5,i*.607476),o.bezierCurveTo(i*.518691,i*.607476,i*.523364,i*.607476,i*.523364,i*.602803),o.bezierCurveTo(i*.523364,i*.602803,i*.528037,i*.528037,i*.528037,i*.528037),o.lineTo(i*.528037,i*.471962),o.lineTo(i*.509345,i*.130841),o.lineTo(i*.490654,i*.130841),o.closePath(),o.fill(),o.beginPath(),o.moveTo(i*.495327,i*.219626),o.lineTo(i*.504672,i*.219626),o.lineTo(i*.504672,i*.135514),o.lineTo(i*.495327,i*.135514),o.lineTo(i*.495327,i*.219626),o.closePath(),o.fillStyle=f.medium.getRgbaColor(),o.fill();break;case"type10":o.beginPath(),o.moveTo(i*.5,i*.149532),o.bezierCurveTo(i*.5,i*.149532,i*.443925,i*.490654,i*.443925,i*.5),o.bezierCurveTo(i*.443925,i*.53271,i*.467289,i*.556074,i*.5,i*.556074),o.bezierCurveTo(i*.53271,i*.556074,i*.556074,i*.53271,i*.556074,i*.5),o.bezierCurveTo(i*.556074,i*.490654,i*.5,i*.149532,i*.5,i*.149532),o.closePath(),s=o.createLinearGradient(.471962*i,0,.528036*i,0),s.addColorStop(0,f.light.getRgbaColor()),s.addColorStop(.5,f.light.getRgbaColor()),s.addColorStop(.5,f.medium.getRgbaColor()),s.addColorStop(1,f.medium.getRgbaColor()),o.fillStyle=s,o.strokeStyle=f.medium.getRgbaColor(),o.lineWidth=1,o.lineCap="square",o.lineJoin="miter",o.fill(),o.stroke();break;case"type11":o.beginPath(),o.moveTo(.5*i,.168224*i),o.lineTo(.485981*i,.5*i),o.bezierCurveTo(.485981*i,.5*i,.481308*i,.584112*i,.5*i,.584112*i),o.bezierCurveTo(.514018*i,.584112*i,.509345*i,.5*i,.509345*i,.5*i),o.lineTo(.5*i,.168224*i),o.closePath(),s=o.createLinearGradient(0,.168224*i,0,.584112*i),s.addColorStop(0,f.medium.getRgbaColor()),s.addColorStop(1,f.dark.getRgbaColor()),o.fillStyle=s,o.strokeStyle=f.dark.getRgbaColor(),o.fill(),o.stroke();break;case"type12":o.beginPath(),o.moveTo(.5*i,.168224*i),o.lineTo(.485981*i,.5*i),o.lineTo(.5*i,.504672*i),o.lineTo(.509345*i,.5*i),o.lineTo(.5*i,.168224*i),o.closePath(),s=o.createLinearGradient(0,.168224*i,0,.504672*i),s.addColorStop(0,f.medium.getRgbaColor()),s.addColorStop(1,f.dark.getRgbaColor()),o.fillStyle=s,o.strokeStyle=f.dark.getRgbaColor(),o.fill(),o.stroke();break;case"type13":case"type14":o.beginPath(),o.moveTo(.485981*i,.168224*i),o.lineTo(.5*i,.130841*i),o.lineTo(.509345*i,.168224*i),o.lineTo(.509345*i,.509345*i),o.lineTo(.485981*i,.509345*i),o.lineTo(.485981*i,.168224*i),o.closePath(),u.type==="type13"?(s=o.createLinearGradient(0,.5*i,0,.130841*i),s.addColorStop(0,e.getRgbaColor()),s.addColorStop(.85,e.getRgbaColor()),s.addColorStop(.85,f.medium.getRgbaColor()),s.addColorStop(1,f.medium.getRgbaColor()),o.fillStyle=s):(s=o.createLinearGradient(.485981*i,0,.509345*i,0),s.addColorStop(0,f.veryDark.getRgbaColor()),s.addColorStop(.5,f.light.getRgbaColor()),s.addColorStop(1,f.veryDark.getRgbaColor()),o.fillStyle=s),o.fill();break;case"type15":case"type16":o.beginPath(),o.moveTo(i*.509345,i*.457943),o.lineTo(i*.5015,i*.13),o.lineTo(i*.4985,i*.13),o.lineTo(i*.490654,i*.457943),o.bezierCurveTo(i*.490654,i*.457943,i*.490654,i*.457943,i*.490654,i*.457943),o.bezierCurveTo(i*.471962,i*.462616,i*.457943,i*.481308,i*.457943,i*.5),o.bezierCurveTo(i*.457943,i*.518691,i*.471962,i*.537383,i*.490654,i*.542056),o.bezierCurveTo(i*.490654,i*.542056,i*.490654,i*.542056,i*.490654,i*.542056),u.type==="type15"?(o.lineTo(i*.490654,i*.57),o.bezierCurveTo(i*.46,i*.58,i*.46,i*.62,i*.490654,i*.63),o.bezierCurveTo(i*.47,i*.62,i*.48,i*.59,i*.5,i*.59),o.bezierCurveTo(i*.53,i*.59,i*.52,i*.62,i*.509345,i*.63),o.bezierCurveTo(i*.54,i*.62,i*.54,i*.58,i*.509345,i*.57),o.lineTo(i*.509345,i*.57)):(o.lineTo(i*.490654,i*.621495),o.lineTo(i*.509345,i*.621495)),o.lineTo(i*.509345,i*.542056),o.bezierCurveTo(i*.509345,i*.542056,i*.509345,i*.542056,i*.509345,i*.542056),o.bezierCurveTo(i*.528037,i*.537383,i*.542056,i*.518691,i*.542056,i*.5),o.bezierCurveTo(i*.542056,i*.481308,i*.528037,i*.462616,i*.509345,i*.457943),o.bezierCurveTo(i*.509345,i*.457943,i*.509345,i*.457943,i*.509345,i*.457943),o.closePath(),s=u.type==="type15"?o.createLinearGradient(0,0,0,i*.63):o.createLinearGradient(0,0,0,i*.621495),s.addColorStop(0,f.medium.getRgbaColor()),s.addColorStop(.388888,f.medium.getRgbaColor()),s.addColorStop(.5,f.light.getRgbaColor()),s.addColorStop(.611111,f.medium.getRgbaColor()),s.addColorStop(1,f.medium.getRgbaColor()),o.fillStyle=s,o.strokeStyle=f.dark.getRgbaColor(),o.fill(),o.stroke(),o.beginPath(),h=i*.06542/2,o.arc(i*.5,i*.5,h,0,r),s=o.createLinearGradient(i*.5-h,i*.5+h,0,i*.5+h),s.addColorStop(0,"#e6b35c"),s.addColorStop(.01,"#e6b35c"),s.addColorStop(.99,"#c48200"),s.addColorStop(1,"#c48200"),o.fillStyle=s,o.closePath(),o.fill(),o.beginPath(),h=i*.046728/2,o.arc(i*.5,i*.5,h,0,r),s=o.createRadialGradient(i*.5,i*.5,0,i*.5,i*.5,h),s.addColorStop(0,"#c5c5c5"),s.addColorStop(.19,"#c5c5c5"),s.addColorStop(.22,"#000000"),s.addColorStop(.8,"#000000"),s.addColorStop(.99,"#707070"),s.addColorStop(1,"#707070"),o.fillStyle=s,o.closePath(),o.fill();break;case"type1":default:s=o.createLinearGradient(0,i*.471962,0,i*.130841),s.addColorStop(0,f.veryDark.getRgbaColor()),s.addColorStop(.3,f.medium.getRgbaColor()),s.addColorStop(.59,f.medium.getRgbaColor()),s.addColorStop(1,f.veryDark.getRgbaColor()),o.fillStyle=s,o.beginPath(),o.moveTo(i*.518691,i*.471962),o.bezierCurveTo(i*.514018,i*.457943,i*.509345,i*.415887,i*.509345,i*.401869),o.bezierCurveTo(i*.504672,i*.383177,i*.5,i*.130841,i*.5,i*.130841),o.bezierCurveTo(i*.5,i*.130841,i*.490654,i*.383177,i*.490654,i*.397196),o.bezierCurveTo(i*.490654,i*.415887,i*.485981,i*.457943,i*.481308,i*.471962),o.bezierCurveTo(i*.471962,i*.481308,i*.467289,i*.490654,i*.467289,i*.5),o.bezierCurveTo(i*.467289,i*.518691,i*.481308,i*.53271,i*.5,i*.53271),o.bezierCurveTo(i*.518691,i*.53271,i*.53271,i*.518691,i*.53271,i*.5),o.bezierCurveTo(i*.53271,i*.490654,i*.528037,i*.481308,i*.518691,i*.471962),o.closePath(),o.fill()}ot.cache[l]=c}return n.drawImage(ot.cache[l],0,0),this},k,lt,g,st,at,d,vt,a,s,nt,w,rt,l,p,c,tt,ct,bt,gt,ci,ui,ut,b,kt,fi,ei,ni;ot.cache={},k=function(i,u,f,e,o,s){var p,h,c,l,a,v,y,w=o.toString()+s+u.design;if(!k.cache[w]){p=t(o,s),h=p.getContext("2d"),h.fillStyle="#848484",h.strokeStyle="rgba(132, 132, 132, 0.5)",h.beginPath(),h.arc(f,e,o/2,0,r,!0),h.closePath(),h.fill(),h.stroke(),h.beginPath(),h.arc(f,e,o*.990654/2,0,r,!0),h.closePath();switch(u.design){case"metal":c=h.createLinearGradient(0,o*.004672,0,s*.990654),c.addColorStop(0,"#fefefe"),c.addColorStop(.07,"rgb(210, 210, 210)"),c.addColorStop(.12,"rgb(179, 179, 179)"),c.addColorStop(1,"rgb(213, 213, 213)"),h.fillStyle=c,h.fill();break;case"brass":c=h.createLinearGradient(0,o*.004672,0,s*.990654),c.addColorStop(0,"rgb(249, 243, 155)"),c.addColorStop(.05,"rgb(246, 226, 101)"),c.addColorStop(.1,"rgb(240, 225, 132)"),c.addColorStop(.5,"rgb(90, 57, 22)"),c.addColorStop(.9,"rgb(249, 237, 139)"),c.addColorStop(.95,"rgb(243, 226, 108)"),c.addColorStop(1,"rgb(202, 182, 113)"),h.fillStyle=c,h.fill();break;case"steel":c=h.createLinearGradient(0,o*.004672,0,s*.990654),c.addColorStop(0,"rgb(231, 237, 237)"),c.addColorStop(.05,"rgb(189, 199, 198)"),c.addColorStop(.1,"rgb(192, 201, 200)"),c.addColorStop(.5,"rgb(23, 31, 33)"),c.addColorStop(.9,"rgb(196, 205, 204)"),c.addColorStop(.95,"rgb(194, 204, 203)"),c.addColorStop(1,"rgb(189, 201, 199)"),h.fillStyle=c,h.fill();break;case"gold":c=h.createLinearGradient(0,o*.004672,0,s*.990654),c.addColorStop(0,"rgb(255, 255, 207)"),c.addColorStop(.15,"rgb(255, 237, 96)"),c.addColorStop(.22,"rgb(254, 199, 57)"),c.addColorStop(.3,"rgb(255, 249, 203)"),c.addColorStop(.38,"rgb(255, 199, 64)"),c.addColorStop(.44,"rgb(252, 194, 60)"),c.addColorStop(.51,"rgb(255, 204, 59)"),c.addColorStop(.6,"rgb(213, 134, 29)"),c.addColorStop(.68,"rgb(255, 201, 56)"),c.addColorStop(.75,"rgb(212, 135, 29)"),c.addColorStop(1,"rgb(247, 238, 101)"),h.fillStyle=c,h.fill();break;case"anthracite":c=h.createLinearGradient(0,.004672*s,0,.995326*s),c.addColorStop(0,"rgb(118, 117, 135)"),c.addColorStop(.06,"rgb(74, 74, 82)"),c.addColorStop(.12,"rgb(50, 50, 54)"),c.addColorStop(1,"rgb(79, 79, 87)"),h.fillStyle=c,h.fill();break;case"tiltedGray":c=h.createLinearGradient(.233644*o,.084112*s,.81258*o,.910919*s),c.addColorStop(0,"#ffffff"),c.addColorStop(.07,"rgb(210, 210, 210)"),c.addColorStop(.16,"rgb(179, 179, 179)"),c.addColorStop(.33,"#ffffff"),c.addColorStop(.55,"#c5c5c5"),c.addColorStop(.79,"#ffffff"),c.addColorStop(1,"#666666"),h.fillStyle=c,h.fill();break;case"tiltedBlack":c=h.createLinearGradient(.228971*o,.079439*s,.802547*o,.898591*s),c.addColorStop(0,"#666666"),c.addColorStop(.21,"#000000"),c.addColorStop(.47,"#666666"),c.addColorStop(.99,"#000000"),c.addColorStop(1,"#000000"),h.fillStyle=c,h.fill();break;case"glossyMetal":c=h.createRadialGradient(.5*o,.5*s,0,.5*o,.5*o,.5*o),c.addColorStop(0,"rgb(207, 207, 207)"),c.addColorStop(.96,"rgb(205, 204, 205)"),c.addColorStop(1,"rgb(244, 244, 244)"),h.fillStyle=c,h.fill(),h.beginPath(),h.arc(.5*o,.5*s,.973962*o/2,0,r),h.closePath(),c=h.createLinearGradient(0,s-.971962*s,0,.971962*s),c.addColorStop(0,"rgb(249, 249, 249)"),c.addColorStop(.23,"rgb(200, 195, 191)"),c.addColorStop(.36,"#ffffff"),c.addColorStop(.59,"rgb(29, 29, 29)"),c.addColorStop(.76,"rgb(200, 194, 192)"),c.addColorStop(1,"rgb(209, 209, 209)"),h.fillStyle=c,h.fill(),h.beginPath(),h.arc(.5*o,.5*s,.869158*o/2,0,r),h.closePath(),h.fillStyle="#f6f6f6",h.fill(),h.beginPath(),h.arc(.5*o,.5*s,.85*o/2,0,r),h.closePath(),h.fillStyle="#333333",h.fill();break;case"blackMetal":v=[0,.125,.347222,.5,.680555,.875,1],y=[new n(254,254,254,1),new n(0,0,0,1),new n(153,153,153,1),new n(0,0,0,1),new n(153,153,153,1),new n(0,0,0,1),new n(254,254,254,1)],h.save(),h.arc(f,e,o*.990654/2,0,r,!0),h.clip(),l=o*.495327,a=o*.42056,c=new et(v,y),c.fillCircle(h,f,e,a,l),h.strokeStyle="#848484",h.strokeStyle="rgba(132, 132, 132, 0.8)",h.beginPath(),h.lineWidth=o/90,h.arc(f,e,o/2,0,r,!0),h.closePath(),h.stroke(),h.restore();break;case"shinyMetal":v=[0,.125,.25,.347222,.5,.652777,.75,.875,1],y=[new n(254,254,254,1),new n(210,210,210,1),new n(179,179,179,1),new n(238,238,238,1),new n(160,160,160,1),new n(238,238,238,1),new n(179,179,179,1),new n(210,210,210,1),new n(254,254,254,1)],h.save(),h.arc(f,e,o*.990654/2,0,r,!0),h.clip(),l=o*.495327,a=o*.42056,c=new et(v,y),c.fillCircle(h,f,e,a,l),h.strokeStyle="#848484",h.strokeStyle="rgba(132, 132, 132, 0.8)",h.beginPath(),h.lineWidth=o/90,h.arc(f,e,o/2,0,r,!0),h.closePath(),h.stroke(),h.restore();break;case"chrome":v=[0,.09,.12,.16,.25,.29,.33,.38,.48,.52,.63,.68,.8,.83,.87,.97,1],y=[new n(255,255,255,1),new n(255,255,255,1),new n(136,136,138,1),new n(164,185,190,1),new n(158,179,182,1),new n(112,112,112,1),new n(221,227,227,1),new n(155,176,179,1),new n(156,176,177,1),new n(254,255,255,1),new n(255,255,255,1),new n(156,180,180,1),new n(198,209,211,1),new n(246,248,247,1),new n(204,216,216,1),new n(164,188,190,1),new n(255,255,255,1)],h.save(),h.arc(f,e,o*.990654/2,0,r,!0),h.clip(),l=o*.495327,a=o*.42056,c=new et(v,y),c.fillCircle(h,f,e,a,l),h.strokeStyle="#848484",h.strokeStyle="rgba(132, 132, 132, 0.8)",h.beginPath(),h.lineWidth=o/90,h.arc(f,e,o/2,0,r,!0),h.closePath(),h.stroke(),h.restore()}h.fillStyle="rgb(191, 191, 191)",h.beginPath(),h.arc(f,e,o*.841121/2,0,r,!0),h.closePath(),h.fill(),h.globalCompositeOperation="destination-out",h.beginPath(),h.arc(f,e,o*.83/2,0,r,!0),h.closePath(),h.fill(),k.cache[w]=p}return i.drawImage(k.cache[w],0,0),this},k.cache={},lt=function(i,r,u,f,e){var h,p,s,c,w,y,o,l=[],a=[],b=u.toString()+f+r.design+e;if(!lt.cache[b]){h=Math.sqrt(u*u+f*f)*.04,h=Math.min(h,(e?u:f)*.1),p=t(u,f),s=p.getContext("2d"),e?(c=u*.05,w=c-1,y=u*.028571):(c=f*.05,w=c-1,y=f*.028571),v(s,0,0,u,f,c),s.fillStyle="#838383",s.fill(),v(s,1,1,u-2,f-2,w);switch(r.design){case"metal":o=s.createLinearGradient(0,u*.004672,0,f*.990654),o.addColorStop(0,"#fefefe"),o.addColorStop(.07,"rgb(210, 210, 210)"),o.addColorStop(.12,"rgb(179, 179, 179)"),o.addColorStop(1,"rgb(213, 213, 213)"),s.fillStyle=o,s.fill();break;case"brass":o=s.createLinearGradient(0,u*.004672,0,f*.990654),o.addColorStop(0,"rgb(249, 243, 155)"),o.addColorStop(.05,"rgb(246, 226, 101)"),o.addColorStop(.1,"rgb(240, 225, 132)"),o.addColorStop(.5,"rgb(90, 57, 22)"),o.addColorStop(.9,"rgb(249, 237, 139)"),o.addColorStop(.95,"rgb(243, 226, 108)"),o.addColorStop(1,"rgb(202, 182, 113)"),s.fillStyle=o,s.fill();break;case"steel":o=s.createLinearGradient(0,u*.004672,0,f*.990654),o.addColorStop(0,"rgb(231, 237, 237)"),o.addColorStop(.05,"rgb(189, 199, 198)"),o.addColorStop(.1,"rgb(192, 201, 200)"),o.addColorStop(.5,"rgb(23, 31, 33)"),o.addColorStop(.9,"rgb(196, 205, 204)"),o.addColorStop(.95,"rgb(194, 204, 203)"),o.addColorStop(1,"rgb(189, 201, 199)"),s.fillStyle=o,s.fill();break;case"gold":o=s.createLinearGradient(0,u*.004672,0,f*.990654),o.addColorStop(0,"rgb(255, 255, 207)"),o.addColorStop(.15,"rgb(255, 237, 96)"),o.addColorStop(.22,"rgb(254, 199, 57)"),o.addColorStop(.3,"rgb(255, 249, 203)"),o.addColorStop(.38,"rgb(255, 199, 64)"),o.addColorStop(.44,"rgb(252, 194, 60)"),o.addColorStop(.51,"rgb(255, 204, 59)"),o.addColorStop(.6,"rgb(213, 134, 29)"),o.addColorStop(.68,"rgb(255, 201, 56)"),o.addColorStop(.75,"rgb(212, 135, 29)"),o.addColorStop(1,"rgb(247, 238, 101)"),s.fillStyle=o,s.fill();break;case"anthracite":o=s.createLinearGradient(0,.004672*f,0,.995326*f),o.addColorStop(0,"rgb(118, 117, 135)"),o.addColorStop(.06,"rgb(74, 74, 82)"),o.addColorStop(.12,"rgb(50, 50, 54)"),o.addColorStop(1,"rgb(79, 79, 87)"),s.fillStyle=o,s.fill();break;case"tiltedGray":o=s.createLinearGradient(.233644*u,.084112*f,.81258*u,.910919*f),o.addColorStop(0,"#ffffff"),o.addColorStop(.07,"rgb(210, 210, 210)"),o.addColorStop(.16,"rgb(179, 179, 179)"),o.addColorStop(.33,"#ffffff"),o.addColorStop(.55,"#c5c5c5"),o.addColorStop(.79,"#ffffff"),o.addColorStop(1,"#666666"),s.fillStyle=o,s.fill();break;case"tiltedBlack":o=s.createLinearGradient(.228971*u,.079439*f,.802547*u,.898591*f),o.addColorStop(0,"#666666"),o.addColorStop(.21,"#000000"),o.addColorStop(.47,"#666666"),o.addColorStop(.99,"#000000"),o.addColorStop(1,"#000000"),s.fillStyle=o,s.fill();break;case"glossyMetal":v(s,1,1,u-2,f-2,c),s.clip(),o=s.createLinearGradient(0,1,0,f-2),o.addColorStop(0,"rgb(249, 249, 249)"),o.addColorStop(.2,"rgb(200, 195, 191)"),o.addColorStop(.3,"#ffffff"),o.addColorStop(.6,"rgb(29, 29, 29)"),o.addColorStop(.8,"rgb(200, 194, 192)"),o.addColorStop(1,"rgb(209, 209, 209)"),s.fillStyle=o,s.fill(),v(s,h-2,h-2,u-(h-2)*2,f-(h-2)*2,y),s.clip(),s.fillStyle="#f6f6f6",s.fill(),v(s,h-1,h-1,u-(h-1)*2,f-(h-1)*2,y),s.clip(),s.fillStyle="#333333",s.fill();break;case"blackMetal":l=[0,.125,.347222,.5,.680555,.875,1],a=[new n("#FFFFFF"),new n("#000000"),new n("#999999"),new n("#000000"),new n("#999999"),new n("#000000"),new n("#FFFFFF")],s.beginPath(),v(s,1,1,u-2,f-2,c),s.closePath(),s.clip(),o=new et(l,a),o.fillRect(s,u/2,f/2,u,f,h,h);break;case"shinyMetal":l=[0,.125,.25,.347222,.5,.652777,.75,.875,1],a=[new n("#FFFFFF"),new n("#D2D2D2"),new n("#B3B3B3"),new n("#EEEEEE"),new n("#A0A0A0"),new n("#EEEEEE"),new n("#B3B3B3"),new n("#D2D2D2"),new n("#FFFFFF")],s.beginPath(),v(s,1,1,u-2,f-2,c),s.closePath(),s.clip(),o=new et(l,a),o.fillRect(s,u/2,f/2,u,f,h,h);break;case"chrome":l=[0,.09,.12,.16,.25,.29,.33,.38,.48,.52,.63,.68,.8,.83,.87,.97,1],a=[new n("#FFFFFF"),new n("#FFFFFF"),new n("#888890"),new n("#A4B9BE"),new n("#9EB3B6"),new n("#707070"),new n("#DDE3E3"),new n("#9BB0B3"),new n("#9CB0B1"),new n("#FEFFFF"),new n("#FFFFFF"),new n("#9CB4B4"),new n("#C6D1D3"),new n("#F6F8F7"),new n("#CCD8D8"),new n("#A4BCBE"),new n("#FFFFFF")],s.beginPath(),v(s,1,1,u-2,f-2,c),s.closePath(),s.clip(),o=new et(l,a),o.fillRect(s,u/2,f/2,u,f,h,h)}v(s,h-1,h-1,u-(h-1)*2,f-(h-1)*2,y-1),s.fillStyle="rgb(192, 192, 192)",s.globalCompositeOperation="destination-out",v(s,h,h,u-h*2,f-h*2,4),s.fill(),lt.cache[b]=p}return i.drawImage(lt.cache[b],0,0),this},lt.cache={},g=function(i,f,e,o,s,h){var w,c,l,d,nt,a=s*.831775/2,tt,it,rt,p,y,v,ut,b,k=s.toString()+h+f.name;if(!g.cache[k]){if(w=t(s,h),c=w.getContext("2d"),c.beginPath(),c.arc(e,o,a,0,r,!0),c.closePath(),f.name==="CARBON"||f.name==="PUNCHED_SHEET"||f.name==="BRUSHED_METAL"||f.name==="BRUSHED_STAINLESS")f.name==="CARBON"&&(c.fillStyle=c.createPattern(ai,"repeat"),c.fill()),f.name==="PUNCHED_SHEET"&&(c.fillStyle=c.createPattern(vi,"repeat"),c.fill()),l=c.createLinearGradient(a,0,s-a,0),l.addColorStop(0,"rgba(0, 0, 0, 0.25)"),l.addColorStop(.5,"rgba(0, 0, 0, 0)"),l.addColorStop(1,"rgba(0, 0, 0, 0.25)"),c.fillStyle=l,c.beginPath(),c.arc(e,o,a,0,r,!0),c.closePath(),c.fill(),(f.name==="BRUSHED_METAL"||f.name==="BRUSHED_STAINLESS")&&(tt=f.name==="BRUSHED_METAL"?!0:!1,it=parseInt(f.gradientStop.getHexColor().substr(-6),16),rt=yi(it,5,.1,tt,.5),c.fillStyle=c.createPattern(rt.fill(0,0,s,h),"no-repeat"),c.fill());else if(f.name==="STAINLESS"||f.name==="TURNED"){if(d=[0,.03,.1,.14,.24,.33,.38,.5,.62,.67,.76,.81,.85,.97,1],nt=[new n("#FDFDFD"),new n("#FDFDFD"),new n("#B2B2B4"),new n("#ACACAE"),new n("#FDFDFD"),new n("#8E8E8E"),new n("#8E8E8E"),new n("#FDFDFD"),new n("#8E8E8E"),new n("#8E8E8E"),new n("#FDFDFD"),new n("#ACACAE"),new n("#B2B2B4"),new n("#FDFDFD"),new n("#FDFDFD")],l=new et(d,nt),l.fillCircle(c,e,o,0,a),f.name==="TURNED"){for(p=a,y=p*.55,v=u*(500/p),c.save(),c.beginPath(),c.arc(e,o,p,0,r),c.closePath(),c.clip(),c.lineWidth=.5,ut=r-v*.3,b=0;b<ut;b+=v)c.strokeStyle="rgba(240, 240, 255, 0.25)",c.beginPath(),c.arc(e+y,o,y,0,r),c.stroke(),c.translate(e,o),c.rotate(v*.3),c.translate(-e,-o),c.strokeStyle="rgba(25, 10, 10, 0.1)",c.beginPath(),c.arc(e+y,o,y,0,r),c.stroke(),c.translate(e,o),c.rotate(v-v*.3),c.translate(-e,-o);c.restore()}}else l=c.createLinearGradient(0,s*.084112,0,a*2),l.addColorStop(0,f.gradientStart.getRgbaColor()),l.addColorStop(.4,f.gradientFraction.getRgbaColor()),l.addColorStop(1,f.gradientStop.getRgbaColor()),c.fillStyle=l,c.fill();l=c.createRadialGradient(e,o,0,e,o,a),l.addColorStop(0,"rgba(0, 0, 0, 0)"),l.addColorStop(.7,"rgba(0, 0, 0, 0)"),l.addColorStop(.71,"rgba(0, 0, 0, 0)"),l.addColorStop(.86,"rgba(0, 0, 0, 0.03)"),l.addColorStop(.92,"rgba(0, 0, 0, 0.07)"),l.addColorStop(.97,"rgba(0, 0, 0, 0.15)"),l.addColorStop(1,"rgba(0, 0, 0, 0.3)"),c.fillStyle=l,c.beginPath(),c.arc(e,o,a,0,r,!0),c.closePath(),c.fill(),g.cache[k]=w}return i.drawImage(g.cache[k],0,0),this},g.cache={},st=function(n,t,i,u,f,e){var o=f*.831775,s=e*.831775,h=(f-o)/2,c=(e-s)/2;return t!==null&&t.height>0&&t.width>0&&(n.save(),n.beginPath(),n.arc(i,u,f*.831775/2,0,r,!0),n.clip(),n.drawImage(t,h,c,o,s),n.restore()),this},at=function(i,u,f,e,o){var l,nt,c,tt,b,h,k,s,ft,d,w,a,y,p,it,rt,ut,g=f.toString()+e+o+u.name;if(!at.cache[g]){if(h=Math.sqrt(f*f+e*e)*.04,h=Math.min(h,(o?f:e)*.1),k=t(f,e),s=k.getContext("2d"),ft=u,v(s,h,h,f-h*2,e-h*2,4),u.name==="CARBON"||u.name==="PUNCHED_SHEET"||u.name==="STAINLESS"||u.name==="BRUSHED_METAL"||u.name==="BRUSHED_STAINLESS"||u.name==="TURNED"){if(u.name==="CARBON"&&(s.fillStyle=s.createPattern(ai,"repeat"),s.fill()),u.name==="PUNCHED_SHEET"&&(s.fillStyle=s.createPattern(vi,"repeat"),s.fill()),(u.name==="STAINLESS"||u.name==="TURNED")&&(tt=[0,.03,.1,.14,.24,.33,.38,.5,.62,.67,.76,.81,.85,.97,1],b=[new n("#FDFDFD"),new n("#FDFDFD"),new n("#B2B2B4"),new n("#ACACAE"),new n("#FDFDFD"),new n("#8E8E8E"),new n("#8E8E8E"),new n("#FDFDFD"),new n("#8E8E8E"),new n("#8E8E8E"),new n("#FDFDFD"),new n("#ACACAE"),new n("#B2B2B4"),new n("#FDFDFD"),new n("#FDFDFD")],c=new et(tt,b),v(s,h,h,f-h*2,e-h*2,4),s.clip(),c.fillRect(s,f/2,e/2,f-h*2,e-h*2,f/2,e/2),c=s.createLinearGradient(0,h,0,e-h*2),c.addColorStop(0,"rgba(0, 0, 0, 0.25)"),c.addColorStop(.1,"rgba(0, 0, 0, 0.05)"),c.addColorStop(1,"rgba(0, 0, 0, 0)"),s.fillStyle=c,v(s,h,h,f-h*2,e-h*2,4),s.fill(),s.restore(),u.name==="TURNED")){for(d=Math.sqrt((f-h*2)*(f-h*2)+(e-h*2)*(e-h*2))/2,w=d*.55,a=f/2,y=e/2,p=r/360*(400/d),s.save(),s.beginPath(),v(s,h,h,f-h*2,e-h*2,4),s.clip(),s.lineWidth=.5,nt=r-p*.3,l=0;l<nt;l+=p)s.strokeStyle="rgba(240, 240, 255, 0.25)",s.beginPath(),s.arc(a+w,y,w,0,r),s.stroke(),s.translate(a,y),s.rotate(p*.3),s.translate(-a,-y),s.strokeStyle="rgba(25, 10, 10, 0.1)",s.beginPath(),s.arc(a+w,y,w,0,r),s.stroke(),s.translate(a,y),s.rotate(-p*.3),s.translate(-a,-y),s.translate(a,y),s.rotate(p),s.translate(-a,-y);s.restore()}c=s.createLinearGradient(h,h,f-h*2,e-h*2),c.addColorStop(0,"rgba(0, 0, 0, 0.25)"),c.addColorStop(.5,"rgba(0, 0, 0, 0)"),c.addColorStop(1,"rgba(0, 0, 0, 0.25)"),s.fillStyle=c,v(s,h,h,f-h*2,e-h*2,4),s.fill(),(u.name==="BRUSHED_METAL"||u.name==="BRUSHED_STAINLESS")&&(it=u.name==="BRUSHED_METAL"?!0:!1,rt=parseInt(u.gradientStop.getHexColor().substr(-6),16),ut=yi(rt,5,.1,it,.5),s.fillStyle=s.createPattern(ut.fill(0,0,f,e),"no-repeat"),s.fill())}else c=s.createLinearGradient(0,h,0,e-h*2),c.addColorStop(0,u.gradientStart.getRgbaColor()),c.addColorStop(.4,u.gradientFraction.getRgbaColor()),c.addColorStop(1,u.gradientStop.getRgbaColor()),s.fillStyle=c,s.fill();for(b=["rgba(0, 0, 0, 0.3)","rgba(0, 0, 0, 0.15)","rgba(0, 0, 0, 0.07)","rgba(0, 0, 0, 0.03)","rgba(0, 0, 0, 0)","rgba(0, 0, 0, 0)","rgba(0, 0, 0, 0)"],l=0;l<7;l++)v(s,h+l,h+l,f-h*2-2*l,e-h*2-2*l,4),s.strokeStyle=b[l],s.stroke();at.cache[g]=k}return i.drawImage(at.cache[g],0,0),this},at.cache={},d=function(n,i,r,u,f,e,o,s,h){var b,c,v=Math.ceil(u*.084112),y=r*.5-v/2,p=u*.5-v/2,g=r*.008,l,w,k=i.type+r+u+f+(e!==undefined?e.type:"-")+(o!==undefined?o.style:"-")+(h!==undefined?h.type:"-");if(!d.cache[k]){b=t(r,u),c=b.getContext("2d"),f&&(c.shadowColor="rgba(0, 0, 0, 0.8)",c.shadowOffsetX=c.shadowOffsetY=g,c.shadowBlur=g*2,s===steelseries.GaugeType.TYPE5?steelseries.Orientation.WEST===h?(y=r*.733644-v/2,c.drawImage(a(v,e,o),y,p)):steelseries.Orientation.EAST===h?(y=r*(1-.733644)-v/2,c.drawImage(a(v,e,o),y,p)):(p=u*.733644-v/2,c.drawImage(a(v,e,o),y,u*.6857)):c.drawImage(a(v,e,o),y,p),c.shadowOffsetX=c.shadowOffsetY=0,c.shadowBlur=0);switch(i.type){case"type2":c.beginPath(),c.moveTo(r*.135514,u*.696261),c.bezierCurveTo(r*.214953,u*.588785,r*.317757,u*.5,r*.462616,u*.425233),c.bezierCurveTo(r*.612149,u*.345794,r*.733644,u*.317757,r*.873831,u*.322429),c.bezierCurveTo(r*.766355,u*.112149,r*.528037,u*.023364,r*.313084,u*.130841),c.bezierCurveTo(r*.09813,u*.238317,r*.028037,u*.485981,r*.135514,u*.696261),c.closePath(),l=c.createLinearGradient(.313084*r,.135514*u,.495528*r,.493582*u),l.addColorStop(0,"rgba(255, 255, 255, 0.275)"),l.addColorStop(1,"rgba(255, 255, 255, 0.015)");break;case"type3":c.beginPath(),c.moveTo(r*.084112,u*.509345),c.bezierCurveTo(r*.21028,u*.556074,r*.462616,u*.560747,r*.5,u*.560747),c.bezierCurveTo(r*.537383,u*.560747,r*.794392,u*.560747,r*.915887,u*.509345),c.bezierCurveTo(r*.915887,u*.2757,r*.738317,u*.084112,r*.5,u*.084112),c.bezierCurveTo(r*.261682,u*.084112,r*.084112,u*.2757,r*.084112,u*.509345),c.closePath(),l=c.createLinearGradient(0,.093457*u,0,.556073*u),l.addColorStop(0,"rgba(255, 255, 255, 0.275)"),l.addColorStop(1,"rgba(255, 255, 255, 0.015)");break;case"type4":c.beginPath(),c.moveTo(r*.67757,u*.24299),c.bezierCurveTo(r*.771028,u*.308411,r*.822429,u*.411214,r*.813084,u*.528037),c.bezierCurveTo(r*.799065,u*.654205,r*.719626,u*.757009,r*.593457,u*.799065),c.bezierCurveTo(r*.485981,u*.831775,r*.369158,u*.808411,r*.285046,u*.728971),c.bezierCurveTo(r*.2757,u*.719626,r*.252336,u*.714953,r*.233644,u*.728971),c.bezierCurveTo(r*.214953,u*.747663,r*.219626,u*.771028,r*.228971,u*.7757),c.bezierCurveTo(r*.331775,u*.878504,r*.476635,u*.915887,r*.616822,u*.869158),c.bezierCurveTo(r*.771028,u*.822429,r*.873831,u*.691588,r*.88785,u*.53271),c.bezierCurveTo(r*.897196,u*.38785,r*.836448,u*.257009,r*.719626,u*.182242),c.bezierCurveTo(r*.705607,u*.172897,r*.682242,u*.163551,r*.663551,u*.186915),c.bezierCurveTo(r*.654205,u*.205607,r*.668224,u*.238317,r*.67757,u*.24299),c.closePath(),l=c.createRadialGradient(.5*r,.5*u,0,.5*r,.5*u,.38785*r),l.addColorStop(0,"rgba(255, 255, 255, 0)"),l.addColorStop(.82,"rgba(255, 255, 255, 0)"),l.addColorStop(.83,"rgba(255, 255, 255, 0)"),l.addColorStop(1,"rgba(255, 255, 255, 0.15)"),c.beginPath(),c.moveTo(r*.261682,u*.224299),c.bezierCurveTo(r*.285046,u*.238317,r*.252336,u*.285046,r*.24299,u*.317757),c.bezierCurveTo(r*.24299,u*.350467,r*.271028,u*.383177,r*.271028,u*.397196),c.bezierCurveTo(r*.2757,u*.415887,r*.261682,u*.457943,r*.238317,u*.509345),c.bezierCurveTo(r*.224299,u*.542056,r*.17757,u*.612149,r*.158878,u*.612149),c.bezierCurveTo(r*.144859,u*.612149,r*.088785,u*.546728,r*.130841,u*.369158),c.bezierCurveTo(r*.140186,u*.336448,r*.214953,u*.200934,r*.261682,u*.224299),c.closePath(),w=c.createLinearGradient(.130841*r,.369158*u,.273839*r,.412877*u),w.addColorStop(0,"rgba(255, 255, 255, 0.275)"),w.addColorStop(1,"rgba(255, 255, 255, 0.015)"),c.fillStyle=w,c.fill();break;case"type5":c.beginPath(),c.moveTo(r*.084112,u*.5),c.bezierCurveTo(r*.084112,u*.271028,r*.271028,u*.084112,r*.5,u*.084112),c.bezierCurveTo(r*.700934,u*.084112,r*.864485,u*.224299,r*.906542,u*.411214),c.bezierCurveTo(r*.911214,u*.439252,r*.911214,u*.518691,r*.845794,u*.537383),c.bezierCurveTo(r*.794392,u*.546728,r*.551401,u*.411214,r*.392523,u*.457943),c.bezierCurveTo(r*.168224,u*.509345,r*.135514,u*.7757,r*.093457,u*.593457),c.bezierCurveTo(r*.088785,u*.560747,r*.084112,u*.53271,r*.084112,u*.5),c.closePath(),l=c.createLinearGradient(0,.084112*u,0,.644859*u),l.addColorStop(0,"rgba(255, 255, 255, 0.275)"),l.addColorStop(1,"rgba(255, 255, 255, 0.015)");break;case"type1":default:c.beginPath(),c.moveTo(r*.084112,u*.509345),c.bezierCurveTo(r*.205607,u*.448598,r*.336448,u*.415887,r*.5,u*.415887),c.bezierCurveTo(r*.672897,u*.415887,r*.789719,u*.443925,r*.915887,u*.509345),c.bezierCurveTo(r*.915887,u*.2757,r*.738317,u*.084112,r*.5,u*.084112),c.bezierCurveTo(r*.261682,u*.084112,r*.084112,u*.2757,r*.084112,u*.509345),c.closePath(),l=c.createLinearGradient(0,.088785*u,0,.490654*u),l.addColorStop(0,"rgba(255, 255, 255, 0.275)"),l.addColorStop(1,"rgba(255, 255, 255, 0.015)")}c.fillStyle=l,c.fill(),d.cache[k]=b}return n.drawImage(d.cache[k],0,0),this},d.cache={},vt=function(n,i,r,u){var c,o,e,s,f,h,l=i.toString()+r+u;return vt.cache[l]||(c=t(i,r),o=c.getContext("2d"),s=Math.sqrt(i*i+r*r)*.04,s=Math.min(s,(u?i:r)*.1),f=s*1.3,h=f*1.33,o.beginPath(),o.moveTo(f,r-f),o.lineTo(i-f,r-f),o.bezierCurveTo(i-f,r-f,i-h,r*.7,i-h,r*.5),o.bezierCurveTo(i-h,h,i-f,f,i-s,f),o.lineTo(f,f),o.bezierCurveTo(f,f,h,r*.285714,h,r*.5),o.bezierCurveTo(h,r*.7,f,r-f,s,r-f),o.closePath(),e=o.createLinearGradient(0,r-s,0,s),e.addColorStop(0,"rgba(255, 255, 255, 0)"),e.addColorStop(.06,"rgba(255, 255, 255, 0)"),e.addColorStop(.07,"rgba(255, 255, 255, 0)"),e.addColorStop(.12,"rgba(255, 255, 255, 0)"),e.addColorStop(.17,"rgba(255, 255, 255, 0.013546)"),e.addColorStop(.1701,"rgba(255, 255, 255, 0)"),e.addColorStop(.79,"rgba(255, 255, 255, 0)"),e.addColorStop(.8,"rgba(255, 255, 255, 0)"),e.addColorStop(.84,"rgba(255, 255, 255, 0.082217)"),e.addColorStop(.93,"rgba(255, 255, 255, 0.288702)"),e.addColorStop(.94,"rgba(255, 255, 255, 0.298039)"),e.addColorStop(.96,"rgba(255, 255, 255, 0.119213)"),e.addColorStop(.97,"rgba(255, 255, 255, 0)"),e.addColorStop(1,"rgba(255, 255, 255, 0)"),o.fillStyle=e,o.fill(),vt.cache[l]=c),n.drawImage(vt.cache[l],0,0),this},vt.cache={},a=function(n,i,u){var h,f,o=n/2,s=n/2,e,c=n.toString()+i.type+u.style;if(!a.cache[c]){h=t(n*1.18889,n*1.18889),f=h.getContext("2d");switch(i.type){case"metalKnob":f.beginPath(),f.moveTo(0,n*.5),f.bezierCurveTo(0,n*.222222,n*.222222,0,n*.5,0),f.bezierCurveTo(n*.777777,0,n,n*.222222,n,n*.5),f.bezierCurveTo(n,n*.777777,n*.777777,n,n*.5,n),f.bezierCurveTo(n*.222222,n,0,n*.777777,0,n*.5),f.closePath(),e=f.createLinearGradient(0,0,0,n),e.addColorStop(0,"rgb(92, 95, 101)"),e.addColorStop(.47,"rgb(46, 49, 53)"),e.addColorStop(1,"rgb(22, 23, 26)"),f.fillStyle=e,f.fill(),f.beginPath(),f.moveTo(n*.055555,n*.5),f.bezierCurveTo(n*.055555,n*.277777,n*.277777,n*.055555,n*.5,n*.055555),f.bezierCurveTo(n*.722222,n*.055555,n*.944444,n*.277777,n*.944444,n*.5),f.bezierCurveTo(n*.944444,n*.722222,n*.722222,n*.944444,n*.5,n*.944444),f.bezierCurveTo(n*.277777,n*.944444,n*.055555,n*.722222,n*.055555,n*.5),f.closePath(),e=f.createLinearGradient(0,.055555*n,0,.944443*n);switch(u.style){case"black":e.addColorStop(0,"rgb(43, 42, 47)"),e.addColorStop(1,"rgb(26, 27, 32)");break;case"brass":e.addColorStop(0,"rgb(150, 110, 54)"),e.addColorStop(1,"rgb(124, 95, 61)");break;case"silver":default:e.addColorStop(0,"rgb(204, 204, 204)"),e.addColorStop(1,"rgb(87, 92, 98)")}f.fillStyle=e,f.fill(),f.beginPath(),f.moveTo(n*.777777,n*.833333),f.bezierCurveTo(n*.722222,n*.722222,n*.611111,n*.666666,n*.5,n*.666666),f.bezierCurveTo(n*.388888,n*.666666,n*.277777,n*.722222,n*.222222,n*.833333),f.bezierCurveTo(n*.277777,n*.888888,n*.388888,n*.944444,n*.5,n*.944444),f.bezierCurveTo(n*.611111,n*.944444,n*.722222,n*.888888,n*.777777,n*.833333),f.closePath(),e=f.createRadialGradient(.555555*n,.944444*n,0,.555555*n,.944444*n,.388888*n),e.addColorStop(0,"rgba(255, 255, 255, 0.6)"),e.addColorStop(1,"rgba(255, 255, 255, 0)"),f.fillStyle=e,f.fill(),f.beginPath(),f.moveTo(n*.944444,n*.277777),f.bezierCurveTo(n*.833333,n*.111111,n*.666666,0,n*.5,0),f.bezierCurveTo(n*.333333,0,n*.166666,n*.111111,n*.055555,n*.277777),f.bezierCurveTo(n*.166666,n*.333333,n*.333333,n*.388888,n*.5,n*.388888),f.bezierCurveTo(n*.666666,n*.388888,n*.833333,n*.333333,n*.944444,n*.277777),f.closePath(),e=f.createRadialGradient(.5*n,0,0,.5*n,0,.583333*n),e.addColorStop(0,"rgba(255, 255, 255, 0.749019)"),e.addColorStop(1,"rgba(255, 255, 255, 0)"),f.fillStyle=e,f.fill(),f.beginPath(),f.moveTo(n*.277777,n*.555555),f.bezierCurveTo(n*.277777,n*.388888,n*.388888,n*.277777,n*.5,n*.277777),f.bezierCurveTo(n*.611111,n*.277777,n*.777777,n*.388888,n*.777777,n*.555555),f.bezierCurveTo(n*.777777,n*.666666,n*.611111,n*.777777,n*.5,n*.777777),f.bezierCurveTo(n*.388888,n*.777777,n*.277777,n*.666666,n*.277777,n*.555555),f.closePath(),e=f.createLinearGradient(0,.277777*n,0,.722221*n),e.addColorStop(0,"#000000"),e.addColorStop(1,"rgb(204, 204, 204)"),f.fillStyle=e,f.fill(),f.beginPath(),f.moveTo(n*.333333,n*.555555),f.bezierCurveTo(n*.333333,n*.444444,n*.388888,n*.333333,n*.5,n*.333333),f.bezierCurveTo(n*.611111,n*.333333,n*.722222,n*.444444,n*.722222,n*.555555),f.bezierCurveTo(n*.722222,n*.611111,n*.611111,n*.722222,n*.5,n*.722222),f.bezierCurveTo(n*.388888,n*.722222,n*.333333,n*.611111,n*.333333,n*.555555),f.closePath(),e=f.createLinearGradient(0,.333333*n,0,.666666*n),e.addColorStop(0,"rgb(10, 9, 1)"),e.addColorStop(1,"rgb(42, 41, 37)"),f.fillStyle=e,f.fill();break;case"standardKnob":e=f.createLinearGradient(0,0,0,n),e.addColorStop(0,"rgb(180, 180, 180)"),e.addColorStop(.46,"rgb(63, 63, 63)"),e.addColorStop(1,"rgb(40, 40, 40)"),f.fillStyle=e,f.beginPath(),f.arc(o,s,n/2,0,r,!0),f.closePath(),f.fill(),e=f.createLinearGradient(0,n-n*.77,0,n-n*.77+n*.77);switch(u.style){case"black":e.addColorStop(0,"rgb(191, 191, 191)"),e.addColorStop(.5,"rgb(45, 44, 49)"),e.addColorStop(1,"rgb(125, 126, 128)");break;case"brass":e.addColorStop(0,"rgb(223, 208, 174)"),e.addColorStop(.5,"rgb(123, 95, 63)"),e.addColorStop(1,"rgb(207, 190, 157)");break;case"silver":default:e.addColorStop(0,"rgb(215, 215, 215)"),e.addColorStop(.5,"rgb(116, 116, 116)"),e.addColorStop(1,"rgb(215, 215, 215)")}f.fillStyle=e,f.beginPath(),f.arc(o,s,n*.77/2,0,r,!0),f.closePath(),f.fill(),e=f.createRadialGradient(o,s,0,o,s,n*.77/2),e.addColorStop(0,"rgba(0, 0, 0, 0)"),e.addColorStop(.75,"rgba(0, 0, 0, 0)"),e.addColorStop(.76,"rgba(0, 0, 0, 0.01)"),e.addColorStop(1,"rgba(0, 0, 0, 0.2)"),f.fillStyle=e,f.beginPath(),f.arc(o,s,n*.77/2,0,r,!0),f.closePath(),f.fill()}a.cache[c]=h}return a.cache[c]},a.cache={},s=function(n,i,u){var l,f,o=n/2,c=n/2,e,a=n.toString()+i+u.outerColor_ON;if(!s.cache[a]){l=t(n,n),f=l.getContext("2d");switch(i){case 0:e=f.createRadialGradient(o,c,0,o,c,n*.5/2),e.addColorStop(0,u.innerColor1_OFF),e.addColorStop(.2,u.innerColor2_OFF),e.addColorStop(1,u.outerColor_OFF),f.fillStyle=e,f.beginPath(),f.arc(o,c,n*.5/2,0,r,!0),f.closePath(),f.fill(),e=f.createRadialGradient(o,c,0,o,c,n*.5/2),e.addColorStop(0,"rgba(0, 0, 0, 0)"),e.addColorStop(.8,"rgba(0, 0, 0, 0)"),e.addColorStop(1,"rgba(0, 0, 0, 0.4)"),f.fillStyle=e,f.beginPath(),f.arc(o,c,n*.5/2,0,r,!0),f.closePath(),f.fill(),e=f.createLinearGradient(0,.35*n,0,.35*n+.15*n),e.addColorStop(0,"rgba(255, 255, 255, 0.4)"),e.addColorStop(1,"rgba(255, 255, 255, 0)"),f.fillStyle=e,f.beginPath(),f.arc(o,.35*n+.2*n/2,n*.2,0,r,!0),f.closePath(),f.fill();break;case 1:e=f.createRadialGradient(o,c,0,o,c,n*.5/2),e.addColorStop(0,u.innerColor1_ON),e.addColorStop(.2,u.innerColor2_ON),e.addColorStop(1,u.outerColor_ON),f.fillStyle=e,f.beginPath(),f.arc(o,c,n*.5/2,0,r,!0),f.closePath(),f.fill(),e=f.createRadialGradient(o,c,0,o,c,n*.5/2),e.addColorStop(0,"rgba(0, 0, 0, 0)"),e.addColorStop(.8,"rgba(0, 0, 0, 0)"),e.addColorStop(1,"rgba(0, 0, 0, 0.4)"),f.fillStyle=e,f.beginPath(),f.arc(o,c,n*.5/2,0,r,!0),f.closePath(),f.fill(),e=f.createLinearGradient(0,.35*n,0,.35*n+.15*n),e.addColorStop(0,"rgba(255, 255, 255, 0.4)"),e.addColorStop(1,"rgba(255, 255, 255, 0)"),f.fillStyle=e,f.beginPath(),f.arc(o,.35*n+.2*n/2,n*.2,0,r,!0),f.closePath(),f.fill(),e=f.createRadialGradient(o,c,0,o,c,n/2),e.addColorStop(0,h(u.coronaColor,0).color),e.addColorStop(.6,h(u.coronaColor,.4).color),e.addColorStop(.7,h(u.coronaColor,.25).color),e.addColorStop(.8,h(u.coronaColor,.15).color),e.addColorStop(.85,h(u.coronaColor,.05).color),e.addColorStop(1,h(u.coronaColor,0).color),f.fillStyle=e,f.beginPath(),f.arc(o,c,n/2,0,r,!0),f.closePath(),f.fill()}s.cache[a]=l}return s.cache[a]},s.cache={},nt=function(n,i,r){var e,f,o=0,y=n,c=i,l=Math.min(n,i)*.095,u,s=1,p=n-2,a=i-2,w=l-1,h=n.toString()+i+JSON.stringify(r);return nt.cache[h]||(e=t(n,i),f=e.getContext("2d"),u=f.createLinearGradient(0,o,0,o+c),u.addColorStop(0,"#4c4c4c"),u.addColorStop(.08,"#666666"),u.addColorStop(.92,"#666666"),u.addColorStop(1,"#e6e6e6"),f.fillStyle=u,v(f,0,o,y,c,l),f.fill(),u=f.createLinearGradient(0,s,0,s+a),u.addColorStop(0,r.gradientStartColor),u.addColorStop(.03,r.gradientFraction1Color),u.addColorStop(.49,r.gradientFraction2Color),u.addColorStop(.5,r.gradientFraction3Color),u.addColorStop(1,r.gradientStopColor),f.fillStyle=u,v(f,1,s,p,a,w),f.fill(),nt.cache[h]=e),nt.cache[h]},nt.cache={},w=function(n,t,i,r){var e,u,o=n.toString()+t+i+r;return w.cache[o]||(e=f.createElement("canvas"),u=e.getContext("2d"),e.width=n,e.height=n,u.fillStyle=t,i?(u.beginPath(),u.moveTo(n*.5,n),u.lineTo(0,0),u.lineTo(n,0),u.closePath(),u.fill()):r?(u.beginPath(),u.moveTo(n,n*.5),u.lineTo(0,0),u.lineTo(0,n),u.closePath(),u.fill()):(u.beginPath(),u.moveTo(n*.5,0),u.lineTo(n,n),u.lineTo(0,n),u.closePath(),u.fill()),w.cache[o]=e),w.cache[o]},w.cache={},rt=function(n,i,u){var e=n*2,s,f,o,c=i.state+n+JSON.stringify(u),l=function(){var t=u[0];i.state==="up"?(o=f.createRadialGradient(.5*n,.2*e,0,.5*n,.2*e,.5*n),o.addColorStop(0,t.innerColor1_ON),o.addColorStop(.2,t.innerColor2_ON),o.addColorStop(1,t.outerColor_ON)):(o=f.createLinearGradient(0,0,0,.5*e),o.addColorStop(0,"#323232"),o.addColorStop(1,"#5c5c5c")),f.fillStyle=o,f.beginPath(),f.moveTo(.5*n,0),f.lineTo(n,.2*e),f.lineTo(.752*n,.2*e),f.lineTo(.752*n,.37*e),f.lineTo(.252*n,.37*e),f.lineTo(.252*n,.2*e),f.lineTo(0,.2*e),f.closePath(),f.fill(),i.state!=="up"?(f.strokeStyle="rgba(0, 0, 0, 0.4)",f.beginPath(),f.moveTo(0,.2*e),f.lineTo(.5*n,0),f.lineTo(n,.2*e),f.moveTo(.252*n,.2*e),f.lineTo(.252*n,.37*e),f.stroke(),f.strokeStyle="rgba(255, 255, 255, 0.3)",f.beginPath(),f.moveTo(.252*n,.37*e),f.lineTo(.752*n,.37*e),f.lineTo(.752*n,.2*e),f.lineTo(n,.2*e),f.stroke()):(o=f.createRadialGradient(.5*n,.2*e,0,.5*n,.2*e,.7*n),o.addColorStop(0,h(t.coronaColor,0).color),o.addColorStop(.5,h(t.coronaColor,.3).color),o.addColorStop(.7,h(t.coronaColor,.2).color),o.addColorStop(.8,h(t.coronaColor,.1).color),o.addColorStop(.85,h(t.coronaColor,.05).color),o.addColorStop(1,h(t.coronaColor,0).color),f.fillStyle=o,f.beginPath(),f.arc(.5*n,.2*e,.7*n,0,r,!0),f.closePath(),f.fill())},a=function(){var t=u[1];f.beginPath(),i.state==="steady"?(o=t.outerColor_ON,f.fillStyle=o,f.rect(.128*n,.41*e,.744*n,.074*e),f.rect(.128*n,.516*e,.744*n,.074*e),f.closePath(),f.fill()):(o=f.createLinearGradient(0,.41*e,0,.41*e+.074*e),o.addColorStop(0,"#323232"),o.addColorStop(1,"#5c5c5c"),f.fillStyle=o,f.rect(.128*n,.41*e,.744*n,.074*e),f.closePath(),f.fill(),o=f.createLinearGradient(0,.516*e,0,.516*e+.074*e),o.addColorStop(0,"#323232"),o.addColorStop(1,"#5c5c5c"),f.fillStyle=o,f.rect(.128*n,.516*e,.744*n,.074*e),f.closePath(),f.fill()),i.state!=="steady"?(f.strokeStyle="rgba(0, 0, 0, 0.4)",f.beginPath(),f.moveTo(.128*n,.41*e+.074*e),f.lineTo(.128*n,.41*e),f.lineTo(.128*n+.744*n,.41*e),f.stroke(),f.beginPath(),f.moveTo(.128*n,.516*e+.074*e),f.lineTo(.128*n,.516*e),f.lineTo(.128*n+.744*n,.516*e),f.stroke(),f.strokeStyle="rgba(255, 255, 255, 0.3)",f.beginPath(),f.moveTo(.128*n+.744*n,.41*e),f.lineTo(.128*n+.744*n,.41*e+.074*e),f.lineTo(.128*n,.41*e+.074*e),f.stroke(),f.beginPath(),f.moveTo(.128*n+.744*n,.516*e),f.lineTo(.128*n+.744*n,.516*e+.074*e),f.lineTo(.128*n,.516*e+.074*e),f.stroke()):(o=f.createRadialGradient(.5*n,.5*e,0,.5*n,.5*e,.7*n),o.addColorStop(0,h(t.coronaColor,0).color),o.addColorStop(.5,h(t.coronaColor,.3).color),o.addColorStop(.7,h(t.coronaColor,.2).color),o.addColorStop(.8,h(t.coronaColor,.1).color),o.addColorStop(.85,h(t.coronaColor,.05).color),o.addColorStop(1,h(t.coronaColor,0).color),f.fillStyle=o,f.beginPath(),f.arc(.5*n,.5*e,.7*n,0,r,!0),f.closePath(),f.fill())},v=function(){var t=u[2];i.state==="down"?(o=f.createRadialGradient(.5*n,.8*e,0,.5*n,.8*e,.5*n),o.addColorStop(0,t.innerColor1_ON),o.addColorStop(.2,t.innerColor2_ON),o.addColorStop(1,t.outerColor_ON)):(o=f.createLinearGradient(0,.63*e,0,e),o.addColorStop(0,"#323232"),o.addColorStop(1,"#5c5c5c")),f.beginPath(),f.fillStyle=o,f.moveTo(.5*n,e),f.lineTo(n,.8*e),f.lineTo(.725*n,.8*e),f.lineTo(.725*n,.63*e),f.lineTo(.252*n,.63*e),f.lineTo(.252*n,.8*e),f.lineTo(0,.8*e),f.closePath(),f.fill(),i.state!=="down"?(f.strokeStyle="rgba(0, 0, 0, 0.4)",f.beginPath(),f.moveTo(0,.8*e),f.lineTo(.252*n,.8*e),f.moveTo(.252*n,.63*e),f.lineTo(.752*n,.63*e),f.stroke(),f.beginPath(),f.moveTo(.752*n,.8*e),f.lineTo(n,.8*e),f.stroke(),f.strokeStyle="rgba(255, 255, 255, 0.3)",f.beginPath(),f.moveTo(0,.8*e),f.lineTo(.5*n,e),f.lineTo(n,.8*e),f.stroke(),f.beginPath(),f.moveTo(.752*n,.8*e),f.lineTo(.752*n,.63*e),f.stroke()):(o=f.createRadialGradient(.5*n,.8*e,0,.5*n,.8*e,.7*n),o.addColorStop(0,h(t.coronaColor,0).color),o.addColorStop(.5,h(t.coronaColor,.3).color),o.addColorStop(.7,h(t.coronaColor,.2).color),o.addColorStop(.8,h(t.coronaColor,.1).color),o.addColorStop(.85,h(t.coronaColor,.05).color),o.addColorStop(1,h(t.coronaColor,0).color),f.fillStyle=o,f.beginPath(),f.arc(.5*n,.8*e,.7*n,0,r,!0),f.closePath(),f.fill())};if(!rt.cache[c]){s=t(n*2,n*4),f=s.getContext("2d"),f.translate(n*.5,n*.5);switch(i.state){case"up":v(),a(),l();break;case"steady":v(),l(),a();break;case"down":default:l(),a(),v()}rt.cache[c]=s}return rt.cache[c]},rt.cache={};var pt=function(n,t,i,r,u,f,e,s,h,c){c=undefined===c?c=steelseries.GaugeType.TYPE1:c,n.save(),n.textAlign=s?"center":"left",n.textBaseline="middle",n.strokeStyle=f.labelColor.getRgbaColor(),n.fillStyle=f.labelColor.getRgbaColor(),s?(n.font=.046728*t+"px "+o,n.fillText(r,t/2,i*.3,t*.3),n.fillText(u,t/2,i*.38,t*.3)):e?(n.font=.1*t+"px "+o,n.save(),n.translate(.671428*t,.1375*i),n.rotate(1.570796),n.fillText(r,0,0),n.translate(-.671428*t,-.1375*i),n.restore(),n.font=.071428*t+"px "+o,h?c.type==="type2"?(n.textAlign="right",n.fillText(u,.36*t,i*.79,t*.25)):n.fillText(u,.63*t,i*.85,t*.2):(n.textAlign="center",c.type==="type2"?n.fillText(u,t/2,i*.92,t*.2):n.fillText(u,t/2,i*.89,t*.2))):(n.font=.035*t+"px "+o,n.fillText(r,t*.15,i*.25,t*.3),n.font=.025*t+"px "+o,n.fillText(u,t*.0625,i*.7,t*.07)),n.restore()},ai=oi(12,12,function(n){var u=n.canvas.width,t=n.canvas.height,f=0,r=0,i;n.save(),n.save(),n.beginPath(),n.rect(0,0,u*.5,t*.5),n.closePath(),n.restore(),i=n.createLinearGradient(0,r*t,0,.5*t+r*t),i.addColorStop(0,"rgb(35, 35, 35)"),i.addColorStop(1,"rgb(23, 23, 23)"),n.fillStyle=i,n.fill(),n.save(),n.beginPath(),n.rect(u*.083333,0,u*.333333,t*.416666),n.closePath(),n.restore(),f=.083333,r=0,i=n.createLinearGradient(0,r*t,0,.416666*t+r*t),i.addColorStop(0,"rgb(38, 38, 38)"),i.addColorStop(1,"rgb(30, 30, 30)"),n.fillStyle=i,n.fill(),n.save(),n.beginPath(),n.rect(u*.5,t*.5,u*.5,t*.5),n.closePath(),n.restore(),f=.5,r=.5,i=n.createLinearGradient(0,r*t,0,.5*t+r*t),i.addColorStop(0,"rgb(35, 35, 35)"),i.addColorStop(1,"rgb(23, 23, 23)"),n.fillStyle=i,n.fill(),n.save(),n.beginPath(),n.rect(u*.583333,t*.5,u*.333333,t*.416666),n.closePath(),n.restore(),f=.583333,r=.5,i=n.createLinearGradient(0,r*t,0,.416666*t+r*t),i.addColorStop(0,"rgb(38, 38, 38)"),i.addColorStop(1,"rgb(30, 30, 30)"),n.fillStyle=i,n.fill(),n.save(),n.beginPath(),n.rect(u*.5,0,u*.5,t*.5),n.closePath(),n.restore(),f=.5,r=0,i=n.createLinearGradient(0,r*t,0,.5*t+r*t),i.addColorStop(0,"#303030"),i.addColorStop(1,"rgb(40, 40, 40)"),n.fillStyle=i,n.fill(),n.save(),n.beginPath(),n.rect(u*.583333,t*.083333,u*.333333,t*.416666),n.closePath(),n.restore(),f=.583333,r=.083333,i=n.createLinearGradient(0,r*t,0,.416666*t+r*t),i.addColorStop(0,"rgb(53, 53, 53)"),i.addColorStop(1,"rgb(45, 45, 45)"),n.fillStyle=i,n.fill(),n.save(),n.beginPath(),n.rect(0,t*.5,u*.5,t*.5),n.closePath(),n.restore(),f=0,r=.5,i=n.createLinearGradient(0,r*t,0,.5*t+r*t),i.addColorStop(0,"#303030"),i.addColorStop(1,"#282828"),n.fillStyle=i,n.fill(),n.save(),n.beginPath(),n.rect(u*.083333,t*.583333,u*.333333,t*.416666),n.closePath(),n.restore(),f=.083333,r=.583333,i=n.createLinearGradient(0,r*t,0,.416666*t+r*t),i.addColorStop(0,"#353535"),i.addColorStop(1,"#2d2d2d"),n.fillStyle=i,n.fill(),n.restore()}),vi=oi(15,15,function(n){var i=n.canvas.width,t=n.canvas.height,r;n.save(),n.save(),n.beginPath(),n.rect(0,0,i,t),n.closePath(),n.restore(),n.fillStyle="#1D2123",n.fill(),n.save(),n.beginPath(),n.moveTo(0,t*.266666),n.bezierCurveTo(0,t*.4,i*.066666,t*.466666,i*.2,t*.466666),n.bezierCurveTo(i*.333333,t*.466666,i*.4,t*.4,i*.4,t*.266666),n.bezierCurveTo(i*.4,t*.133333,i*.333333,t*.066666,i*.2,t*.066666),n.bezierCurveTo(i*.066666,t*.066666,0,t*.133333,0,t*.266666),n.closePath(),r=n.createLinearGradient(0,.066666*t,0,.466666*t),r.addColorStop(0,"#000000"),r.addColorStop(1,"#444444"),n.fillStyle=r,n.fill(),n.save(),n.beginPath(),n.moveTo(0,t*.2),n.bezierCurveTo(0,t*.333333,i*.066666,t*.4,i*.2,t*.4),n.bezierCurveTo(i*.333333,t*.4,i*.4,t*.333333,i*.4,t*.2),n.bezierCurveTo(i*.4,t*.066666,i*.333333,0,i*.2,0),n.bezierCurveTo(i*.066666,0,0,t*.066666,0,t*.2),n.closePath(),n.fillStyle="#050506",n.fill(),n.save(),n.beginPath(),n.moveTo(i*.466666,t*.733333),n.bezierCurveTo(i*.466666,t*.866666,i*.533333,t*.933333,i*.666666,t*.933333),n.bezierCurveTo(i*.8,t*.933333,i*.866666,t*.866666,i*.866666,t*.733333),n.bezierCurveTo(i*.866666,t*.6,i*.8,t*.533333,i*.666666,t*.533333),n.bezierCurveTo(i*.533333,t*.533333,i*.466666,t*.6,i*.466666,t*.733333),n.closePath(),r=n.createLinearGradient(0,.533333*t,0,.933333*t),r.addColorStop(0,"#000000"),r.addColorStop(1,"#444444"),n.fillStyle=r,n.fill(),n.save(),n.beginPath(),n.moveTo(i*.466666,t*.666666),n.bezierCurveTo(i*.466666,t*.8,i*.533333,t*.866666,i*.666666,t*.866666),n.bezierCurveTo(i*.8,t*.866666,i*.866666,t*.8,i*.866666,t*.666666),n.bezierCurveTo(i*.866666,t*.533333,i*.8,t*.466666,i*.666666,t*.466666),n.bezierCurveTo(i*.533333,t*.466666,i*.466666,t*.533333,i*.466666,t*.666666),n.closePath(),n.fillStyle="#050506",n.fill(),n.restore()}),yi=function(n,i,r,u,f){function o(n,t){return n+=(2*Math.random()-1)*t|0,n<0?0:n>255?255:n}function s(n){return n<0?0:n>255?255:n}function h(n,t,i,r,u,f){var o,v,e,a,s,h,c,l;for(u>=i&&(u=i-1),a=1/(u*2+1),s=0,v=0;v<r;v++){for(h=c=l=0,o=0;o<u;o++)e=(s+o)*4,h+=n.data[e],c+=n.data[e+1],l+=n.data[e+2];for(o=0;o<i;o++)o>u&&(e=(s-u-1)*4,h-=n.data[e],c-=n.data[e+1],l-=n.data[e+2]),o+u<i&&(e=(s+u)*4,h+=n.data[e],c+=n.data[e+1],l+=n.data[e+2]),e=s*4,t.data[e]=h*a|0,t.data[e+1]=c*a|0,t.data[e+2]=l*a|0,t.data[e+3]=f,s++}}return this.fill=function(c,l,a,v){var k,d,nt,ot,p,b,st,g,y,ht,ct=255,lt=n>>16&255,at=n>>8&255,vt=n&255,tt=0,it=255*r,yt,pt,wt,w,rt,ut,ft,et;if(c=Math.floor(c),l=Math.floor(l),a=Math.ceil(a),v=Math.ceil(v),p=a-c,b=v-l,st=t(p,b),g=st.getContext("2d"),y=g.createImageData(p,b),ht=g.createImageData(p,b),f!==0)for(ot=[],k=0;k<p;k++)ot[k]=255*f*Math.sin(k/p*e)|0;for(nt=0;nt<b;nt++)for(i!==0&&(yt=pt=wt=0),d=0;d<p;d++)w=nt*p*4+d*4,rt=lt,ut=at,ft=vt,f!==0&&(et=ot[d],rt+=et,ut+=et,ft+=et),u?(tt=(2*Math.random()-1)*it|0,y.data[w]=s(rt+tt),y.data[w+1]=s(ut+tt),y.data[w+2]=s(ft+tt),y.data[w+3]=ct):(y.data[w]=o(rt,it),y.data[w+1]=o(ut,it),y.data[w+2]=o(ft,it),y.data[w+3]=ct);return i>0?(h(y,ht,p,b,i,ct),g.putImageData(ht,c,l)):g.putImageData(y,c,l),st},this},n=function(n,t,i,r){function s(){u=it(n,255),f=it(t,255),e=it(i,255),o=it(r,1)}var u,f,e,o;arguments.length===1?(i=parseInt(n.substr(5,2),16),t=parseInt(n.substr(3,2),16),n=parseInt(n.substr(1,2),16),r=1):arguments.length===3&&(r=1),s(),this.getRed=function(){return u},this.setRed=function(n){u=it(n,255)},this.getGreen=function(){return f},this.setGreen=function(n){f=it(n,255)},this.getBlue=function(){return e},this.setBlue=function(n){e=it(n,255)},this.getAlpha=function(){return o},this.setAlpha=function(n){o=it(n,1)},this.getRgbaColor=function(){return"rgba("+u+", "+f+", "+e+", "+o+")"},this.getRgbColor=function(){return"rgb("+u+", "+f+", "+e+")"},this.getHexColor=function(){return"#"+u.toString(16)+f.toString(16)+e.toString(16)}},et=function(n,i){for(var f=n.length-1,u=0;u<=f;u++)n[u]=r*n[u]-e;this.fillCircle=function(r,e,o,s,h){var w,l=Math.ceil(h),c=l*2,a,tt,v,y,b,k,it,g,p,d,nt,rt;for(a=r.createImageData(c,c),tt=255,y=0;y<c;y++)for(k=l-y,it=k*k,v=0;v<c;v++)if(b=v-l,g=Math.sqrt(b*b+it),g<=l&&g>=s){for(w=Math.atan2(b,k),u=0;u<f;u++)w>=n[u]&&w<n[u+1]&&(d=ri(i[u],i[u+1],n[u+1]-n[u],w-n[u],!0));p=(c-y)*c*4+v*4,a.data[p]=d[0],a.data[p+1]=d[1],a.data[p+2]=d[2],a.data[p+3]=tt}nt=t(c,c),rt=nt.getContext("2d"),rt.putImageData(a,0,0),r.drawImage(nt,e-l,o-l)},this.fillRect=function(r,e,o,s,h,c,l){var w,k,d,y,nt,a,v,tt,it,p,b,g,rt;for(s=Math.ceil(s),h=Math.ceil(h),k=s/2,d=h/2,c=Math.ceil(c),l=Math.ceil(l),y=r.createImageData(s,h),nt=255,v=0;v<h;v++)for(it=d-v,a=0;a<s;a++){for(v>l&&v<h-l&&a>c&&a<s-c&&(a=s-c),tt=a-k,w=Math.atan2(tt,it),u=0;u<f;u++)w>=n[u]&&w<n[u+1]&&(b=ri(i[u],i[u+1],n[u+1]-n[u],w-n[u],!0));p=(h-v)*s*4+a*4,y.data[p]=b[0],y.data[p+1]=b[0],y.data[p+2]=b[0],y.data[p+3]=nt}g=t(s,h),rt=g.getContext("2d"),rt.putImageData(y,0,0),r.drawImage(g,e-k,o-d)}},ii=function(n,t,i,r){this.getColorAt=function(n){var u=0,e=0,f=1,o=1,t,s;for(n=n<0?0:n>1?1:n,t=0;t<i.length;t++){if(i[t]<n&&u<i[t]&&(u=i[t],e=t),i[t]===n)return r[t];i[t]>n&&f>=i[t]&&(f=i[t],o=t)}return s=(n-u)/(f-u),ri(r[e],r[o],1,s)},this.getStart=function(){return n},this.getEnd=function(){return t}};Math.log10=function(n){return Math.log(n)/Math.LN10},l=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(n){window.setTimeout(n,1e3/16)}}(),function(){p=function(n,t,i,r,u,f){this.gradientStart=n,this.gradientFraction=t,this.gradientStop=i,this.labelColor=r,this.symbolColor=u,this.name=f}}(),function(){c=function(n,t,i,r,u,f){this.gradientStartColor=n,this.gradientFraction1Color=t,this.gradientFraction2Color=i,this.gradientFraction3Color=r,this.gradientStopColor=u,this.textColor=f}}(),function(){tt=function(n,t,i,r,u,f){this.veryDark=n,this.dark=t,this.medium=i,this.light=r,this.lighter=u,this.veryLight=f}}(),function(){ct=function(n,t,i,r,u,f,e){this.innerColor1_ON=n,this.innerColor2_ON=t,this.outerColor_ON=i,this.coronaColor=r,this.innerColor1_OFF=u,this.innerColor2_OFF=f,this.outerColor_OFF=e}}(),function(){bt=function(n){this.type=n}}(),function(){gt=function(n){this.type=n}}(),function(){ci=function(n){this.type=n}}(),function(){ui=function(n){this.style=n}}(),function(){ut=function(n){this.design=n}}(),function(){b=function(n){this.type=n}}(),function(){kt=function(n){this.type=n}}(),function(){fi=function(n){this.format=n}}(),function(){ei=function(n){this.type=n}}(),function(){ni=function(n){this.state=n}}();var gr={DARK_GRAY:new p(new n(0,0,0,1),new n(51,51,51,1),new n(153,153,153,1),new n(255,255,255,1),new n(180,180,180,1),"DARK_GRAY"),SATIN_GRAY:new p(new n(45,57,57,1),new n(45,57,57,1),new n(45,57,57,1),new n(167,184,180,1),new n(137,154,150,1),"SATIN_GRAY"),LIGHT_GRAY:new p(new n(130,130,130,1),new n(181,181,181,1),new n(253,253,253,1),new n(0,0,0,1),new n(80,80,80,1),"LIGHT_GRAY"),WHITE:new p(new n(255,255,255,1),new n(255,255,255,1),new n(255,255,255,1),new n(0,0,0,1),new n(80,80,80,1),"WHITE"),BLACK:new p(new n(0,0,0,1),new n(0,0,0,1),new n(0,0,0,1),new n(255,255,255,1),new n(150,150,150,1),"BLACK"),BEIGE:new p(new n(178,172,150,1),new n(204,205,184,1),new n(231,231,214,1),new n(0,0,0,1),new n(80,80,80,1),"BEIGE"),BROWN:new p(new n(245,225,193,1),new n(245,225,193,1),new n(255,250,240,1),new n(109,73,47,1),new n(89,53,27,1),"BROWN"),RED:new p(new n(198,93,95,1),new n(212,132,134,1),new n(242,218,218,1),new n(0,0,0,1),new n(90,0,0,1),"RED"),GREEN:new p(new n(65,120,40,1),new n(129,171,95,1),new n(218,237,202,1),new n(0,0,0,1),new n(0,90,0,1),"GREEN"),BLUE:new p(new n(45,83,122,1),new n(115,144,170,1),new n(227,234,238,1),new n(0,0,0,1),new n(0,0,90,1),"BLUE"),ANTHRACITE:new p(new n(50,50,54,1),new n(47,47,51,1),new n(69,69,74,1),new n(250,250,250,1),new n(180,180,180,1),"ANTHRACITE"),MUD:new p(new n(80,86,82,1),new n(70,76,72,1),new n(57,62,58,1),new n(255,255,240,1),new n(225,225,210,1),"MUD"),PUNCHED_SHEET:new p(new n(50,50,54,1),new n(47,47,51,1),new n(69,69,74,1),new n(255,255,255,1),new n(180,180,180,1),"PUNCHED_SHEET"),CARBON:new p(new n(50,50,54,1),new n(47,47,51,1),new n(69,69,74,1),new n(255,255,255,1),new n(180,180,180,1),"CARBON"),STAINLESS:new p(new n(130,130,130,1),new n(181,181,181,1),new n(253,253,253,1),new n(0,0,0,1),new n(80,80,80,1),"STAINLESS"),BRUSHED_METAL:new p(new n(50,50,54,1),new n(47,47,51,1),new n(69,69,74,1),new n(0,0,0,1),new n(80,80,80,1),"BRUSHED_METAL"),BRUSHED_STAINLESS:new p(new n(50,50,54,1),new n(47,47,51,1),new n(110,110,112,1),new n(0,0,0,1),new n(80,80,80,1),"BRUSHED_STAINLESS"),TURNED:new p(new n(130,130,130,1),new n(181,181,181,1),new n(253,253,253,1),new n(0,0,0,1),new n(80,80,80,1),"TURNED")},nu={BEIGE:new c("#c8c8b1","rgb(241, 237, 207)","rgb(234, 230, 194)","rgb(225, 220, 183)","rgb(237, 232, 191)","#000000"),BLUE:new c("#ffffff","rgb(231, 246, 255)","rgb(170, 224, 255)","rgb(136, 212, 255)","rgb(192, 232, 255)","#124564"),ORANGE:new c("#ffffff","rgb(255, 245, 225)","rgb(255, 217, 147)","rgb(255, 201, 104)","rgb(255, 227, 173)","#503700"),RED:new c("#ffffff","rgb(255, 225, 225)","rgb(253, 152, 152)","rgb(252, 114, 115)","rgb(254, 178, 178)","#4f0c0e"),YELLOW:new c("#ffffff","rgb(245, 255, 186)","rgb(210, 255, 0)","rgb(158, 205, 0)","rgb(210, 255, 0)","#405300"),WHITE:new c("#ffffff","#ffffff","rgb(241, 246, 242)","rgb(229, 239, 244)","#ffffff","#000000"),GRAY:new c("#414141","rgb(117, 117, 117)","rgb(87, 87, 87)","#414141","rgb(81, 81, 81)","#ffffff"),BLACK:new c("#414141","#666666","#333333","#000000","#333333","#cccccc"),GREEN:new c("rgb(33, 67, 67)","rgb(33, 67, 67)","rgb(29, 58, 58)","rgb(28, 57, 57)","rgb(23, 46, 46)","rgba(0, 185, 165, 255)"),BLUE2:new c("rgb(0, 68, 103)","rgb(8, 109, 165)","rgb(0, 72, 117)","rgb(0, 72, 117)","rgb(0, 68, 103)","rgb(111, 182, 228)"),BLUE_BLACK:new c("rgb(22, 125, 212)","rgb(3, 162, 254)","rgb(3, 162, 254)","rgb(3, 162, 254)","rgb(11, 172, 244)","#000000"),BLUE_DARKBLUE:new c("rgb(18, 33, 88)","rgb(18, 33, 88)","rgb(19, 30, 90)","rgb(17, 31, 94)","rgb(21, 25, 90)","rgb(23, 99, 221)"),BLUE_GRAY:new c("rgb(135, 174, 255)","rgb(101, 159, 255)","rgb(44, 93, 255)","rgb(27, 65, 254)","rgb(12, 50, 255)","#b2b4ed"),STANDARD:new c("rgb(131, 133, 119)","rgb(176, 183, 167)","rgb(165, 174, 153)","rgb(166, 175, 156)","rgb(175, 184, 165)","rgb(35, 42, 52)"),STANDARD_GREEN:new c("#ffffff","rgb(219, 230, 220)","rgb(179, 194, 178)","rgb(153, 176, 151)","rgb(114, 138, 109)","#080C06"),BLUE_BLUE:new c("rgb(100, 168, 253)","rgb(100, 168, 253)","rgb(95, 160, 250)","rgb(80, 144, 252)","rgb(74, 134, 255)","#002cbb"),RED_DARKRED:new c("rgb(72, 36, 50)","rgb(185, 111, 110)","rgb(148, 66, 72)","rgb(83, 19, 20)","rgb(7, 6, 14)","#FE8B92"),DARKBLUE:new c("rgb(14, 24, 31)","rgb(46, 105, 144)","rgb(19, 64, 96)","rgb(6, 20, 29)","rgb(8, 9, 10)","#3DB3FF"),LILA:new c("rgb(175, 164, 255)","rgb(188, 168, 253)","rgb(176, 159, 255)","rgb(174, 147, 252)","rgb(168, 136, 233)","#076148"),BLACKRED:new c("rgb(8, 12, 11)","rgb(10, 11, 13)","rgb(11, 10, 15)","rgb(7, 13, 9)","rgb(9, 13, 14)","#B50026"),DARKGREEN:new c("rgb(25, 85, 0)","rgb(47, 154, 0)","rgb(30, 101, 0)","rgb(30, 101, 0)","rgb(25, 85, 0)","#233123"),AMBER:new c("rgb(182, 71, 0)","rgb(236, 155, 25)","rgb(212, 93, 5)","rgb(212, 93, 5)","rgb(182, 71, 0)","#593A0A"),LIGHTBLUE:new c("rgb(125, 146, 184)","rgb(197, 212, 231)","rgb(138, 155, 194)","rgb(138, 155, 194)","rgb(125, 146, 184)","#090051"),SECTIONS:new c("#b2b2b2","#ffffff","#c4c4c4","#c4c4c4","#b2b2b2","#000000")},tu={RED:new tt(new n(82,0,0,1),new n(158,0,19,1),new n(213,0,25,1),new n(240,82,88,1),new n(255,171,173,1),new n(255,217,218,1)),GREEN:new tt(new n(8,54,4,1),new n(0,107,14,1),new n(15,148,0,1),new n(121,186,37,1),new n(190,231,141,1),new n(234,247,218,1)),BLUE:new tt(new n(0,11,68,1),new n(0,73,135,1),new n(0,108,201,1),new n(0,141,242,1),new n(122,200,255,1),new n(204,236,255,1)),ORANGE:new tt(new n(118,83,30,1),new n(215,67,0,1),new n(240,117,0,1),new n(255,166,0,1),new n(255,255,128,1),new n(255,247,194,1)),YELLOW:new tt(new n(41,41,0,1),new n(102,102,0,1),new n(177,165,0,1),new n(255,242,0,1),new n(255,250,153,1),new n(255,252,204,1)),CYAN:new tt(new n(15,109,109,1),new n(0,109,144,1),new n(0,144,191,1),new n(0,174,239,1),new n(153,223,249,1),new n(204,239,252,1)),MAGENTA:new tt(new n(98,0,114,1),new n(128,24,72,1),new n(191,36,107,1),new n(255,48,143,1),new n(255,172,210,1),new n(255,214,23,1)),WHITE:new tt(new n(210,210,210,1),new n(220,220,220,1),new n(235,235,235,1),new n(255,255,255,1),new n(255,255,255,1),new n(255,255,255,1)),GRAY:new tt(new n(25,25,25,1),new n(51,51,51,1),new n(76,76,76,1),new n(128,128,128,1),new n(204,204,204,1),new n(243,243,243,1)),BLACK:new tt(new n(0,0,0,1),new n(5,5,5,1),new n(10,10,10,1),new n(15,15,15,1),new n(20,20,20,1),new n(25,25,25,1)),RAITH:new tt(new n(0,32,65,1),new n(0,65,125,1),new n(0,106,172,1),new n(130,180,214,1),new n(148,203,242,1),new n(191,229,255,1)),GREEN_LCD:new tt(new n(0,55,45,1),new n(15,109,93,1),new n(0,185,165,1),new n(48,255,204,1),new n(153,255,227,1),new n(204,255,241,1)),JUG_GREEN:new tt(new n(0,56,0,1),new n(32,69,36,1),new n(50,161,0,1),new n(129,206,0,1),new n(190,231,141,1),new n(234,247,218,1))},iu={RED_LED:new ct("#FF9A89","#FF9A89","#FF3300","#FF8D70","#7E1C00","#7E1C00","#641B00"),GREEN_LED:new ct("#9AFF89","#9AFF89","#59FF2A","#A5FF00","#1C7E00","#1C7E00","#1B6400"),BLUE_LED:new ct("#899AFF","#899AFF","#0033FF","#708DFF","#001C7E","#001C7E","#001B64"),ORANGE_LED:new ct("#FEA23F","#FEA23F","#FD6C00","#FD6C00","#592800","#592800","#421F00"),YELLOW_LED:new ct("#FFFF62","#FFFF62","#FFFF00","#FFFF00","#6B6D00","#6B6D00","#515300"),CYAN_LED:new ct("#00FFFF","#00FFFF","#1BC3C3","#00FFFF","#083B3B","#083B3B","#052727"),MAGENTA_LED:new ct("#D300FF","#D300FF","#8600CB","#C300FF","#38004B","#38004B","#280035")},wi={TYPE1:new bt("type1"),TYPE2:new bt("type2"),TYPE3:new bt("type3"),TYPE4:new bt("type4"),TYPE5:new bt("type5")},ru={NORTH:new gt("north"),SOUTH:new gt("south"),EAST:new gt("east"),WEST:new gt("west")},bi={STANDARD_KNOB:new ci("standardKnob"),METAL_KNOB:new ci("metalKnob")},ki={BLACK:new ui("black"),BRASS:new ui("brass"),SILVER:new ui("silver")},uu={BLACK_METAL:new ut("blackMetal"),METAL:new ut("metal"),SHINY_METAL:new ut("shinyMetal"),BRASS:new ut("brass"),STEEL:new ut("steel"),CHROME:new ut("chrome"),GOLD:new ut("gold"),ANTHRACITE:new ut("anthracite"),TILTED_GRAY:new ut("tiltedGray"),TILTED_BLACK:new ut("tiltedBlack"),GLOSSY_METAL:new ut("glossyMetal")},fu={TYPE1:new b("type1"),TYPE2:new b("type2"),TYPE3:new b("type3"),TYPE4:new b("type4"),TYPE5:new b("type5"),TYPE6:new b("type6"),TYPE7:new b("type7"),TYPE8:new b("type8"),TYPE9:new b("type9"),TYPE10:new b("type10"),TYPE11:new b("type11"),TYPE12:new b("type12"),TYPE13:new b("type13"),TYPE14:new b("type14"),TYPE15:new b("type15"),TYPE16:new b("type16")},eu={TYPE1:new kt("type1"),TYPE2:new kt("type2"),TYPE3:new kt("type3"),TYPE4:new kt("type4"),TYPE5:new kt("type5")},ou={STANDARD:new fi("standard"),FRACTIONAL:new fi("fractional"),SCIENTIFIC:new fi("scientific")},su={NORMAL:new ei("normal"),HORIZONTAL:new ei("horizontal"),TANGENT:new ei("tangent")},hu={UP:new ni("up"),STEADY:new ni("steady"),DOWN:new ni("down"),OFF:new ni("off")};return{Radial:di,RadialBargraph:gi,RadialVertical:nr,Linear:tr,LinearBargraph:ir,DisplaySingle:rr,DisplayMulti:ur,Level:fr,Compass:er,WindDirection:or,Horizon:sr,Led:hr,Clock:cr,Battery:lr,StopWatch:ar,Altimeter:vr,TrafficLight:yr,LightBulb:pr,Odometer:wr,drawFrame:k,drawBackground:g,drawForeground:d,rgbaColor:n,ConicalGradient:et,setAlpha:h,getColorFromFraction:ri,gradientWrapper:ii,BackgroundColor:gr,LcdColor:nu,ColorDef:tu,LedColor:iu,GaugeType:wi,Orientation:ru,FrameDesign:uu,PointerType:fu,ForegroundType:eu,KnobType:bi,KnobStyle:ki,LabelNumberFormat:ou,TickLabelOrientation:su,TrendState:hu,Section:br}}()