/*! * Name : steelseries.js * Authors : Gerrit Grunwald, Mark Crossley * Last modified : 09.05.2012 * Revision : 0.11.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 f(n,t){var i="#"===n.charAt(0)?n.substring(1,7):n,f=parseInt(i.substring(0,2),16),u=parseInt(i.substring(2,4),16),r=parseInt(i.substring(4,6),16);return this.color="rgba("+f+","+u+","+r+","+t+")",this}function ui(t,i,r,u){var f=1/255,y=t.getRed(),v=t.getGreen(),a=t.getBlue(),b=t.getAlpha(),w=i.getRed()-t.getRed(),p=i.getGreen()-t.getGreen(),s=i.getBlue()-t.getBlue(),o=i.getAlpha()*f-t.getAlpha()*f,e=w/r,l=p/r,c=s/r,h=o/r;return new n((y+e*u).toFixed(0),(v+l*u).toFixed(0),(a+c*u).toFixed(0),b+h*u)}function vr(n,t,i){return{start:n,stop:t,color:i}}function c(n,t){var u=Math.floor(Math.log10(n)),r=n/Math.pow(10,u),i;return i=t?1.5>r?1:3>r?2:7>r?5:10:1.5?u/(2-r-e):u/(r+e);switch(r){case n:f=(t-i)/u+(tt?t:n}function si(t,i){var f=Math.floor(t.getRed()*(1-i)),u=Math.floor(t.getGreen()*(1-i)),r=Math.floor(t.getBlue()*(1-i));return f=k(f,255),u=k(u,255),r=k(r,255),new n(f,u,r,t.getAlpha())}function ti(t,i){var f=Math.round(t.getRed()*(1+i)),u=Math.round(t.getGreen()*(1+i)),r=Math.round(t.getBlue()*(1+i));return f=k(f,255),u=k(u,255),r=k(r,255),new n(f,u,r,t.getAlpha())}function or(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 ni(n,t){return or(t-n,-180,180)}var r=document,tt="LCDMono2Ultra,sans-serif",ei=function(n,i){i=i||{};var ot=undefined===i.gaugeType?steelseries.GaugeType.TYPE4:i.gaugeType,f=undefined===i.size?200:i.size,h=undefined===i.minValue?0:i.minValue,b=undefined===i.maxValue?h+100:i.maxValue,bf=undefined===i.niceScale?!0:i.niceScale,ti=undefined===i.threshold?(b-h)/2:i.threshold,ii=undefined===i.section?null:i.section,ui=undefined===i.area?null:i.area,lu=undefined===i.titleString?"":i.titleString,au=undefined===i.unitString?"":i.unitString,hu=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,wu=undefined===i.frameVisible?!0:i.frameVisible,bt=undefined===i.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:i.backgroundColor,bu=undefined===i.backgroundVisible?!0:i.backgroundVisible,pt=undefined===i.pointerType?steelseries.PointerType.TYPE1:i.pointerType,ar=undefined===i.pointerColor?steelseries.ColorDef.RED:i.pointerColor,ee=undefined===i.knobType?steelseries.KnobType.STANDARD_KNOB:i.knobType,fi=undefined===i.knobStyle?steelseries.KnobStyle.SILVER:i.knobStyle,ei=undefined===i.lcdColor?steelseries.LcdColor.STANDARD:i.lcdColor,vr=undefined===i.lcdVisible?!0:i.lcdVisible,eu=undefined===i.lcdDecimals?2:i.lcdDecimals,ye=undefined===i.digitalFont?!1:i.digitalFont,pe=undefined===i.fractionalScaleDecimals?1:i.fractionalScaleDecimals,br=undefined===i.ledColor?steelseries.LedColor.RED_LED:i.ledColor,ru=undefined===i.ledVisible?!0:i.ledVisible,vf=undefined===i.thresholdVisible?!0:i.thresholdVisible,kr=undefined===i.minMeasuredValueVisible?!1:i.minMeasuredValueVisible,dr=undefined===i.maxMeasuredValueVisible?!1:i.maxMeasuredValueVisible,cf=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,af=undefined===i.foregroundVisible?!0:i.foregroundVisible,oe=undefined===i.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:i.labelNumberFormat,yr=undefined===i.playAlarm?!1:i.playAlarm,uf=undefined===i.alarmSound?!1:i.alarmSound,fe=undefined===i.customLayer?null:i.customLayer,le=undefined===i.tickLabelOrientation?ot===steelseries.GaugeType.TYPE1?steelseries.TickLabelOrientation.TANGENT:steelseries.TickLabelOrientation.NORMAL:i.tickLabelOrientation,wr=undefined===i.trendVisible?!1:i.trendVisible,hr=undefined===i.trendColors?[steelseries.LedColor.RED_LED,steelseries.LedColor.GREEN_LED,steelseries.LedColor.CYAN_LED]:i.trendColors,sr=undefined===i.useOdometer?!1:i.useOdometer,wt=undefined===i.odometerParams?{}:i.odometerParams,wf=undefined===i.odometerUseValue?!1:i.odometerUseValue,ki;yr&&uf!==!1&&(ki=r.createElement("audio"),ki.setAttribute("src",uf),ki.setAttribute("preload","auto"));var l=h,or=h,yf=this,ri=b,ni=h,ht=!1,ef=0,we,of=steelseries.TrendState.OFF,lr=f*.06,cr=f*.29,er=f*.36,ci,et,gi,at,lt,rr=et+(l-h)*lt,u=r.getElementById(n).getContext("2d");u.save(),u.clearRect(0,0,u.canvas.width,u.canvas.height),u.canvas.width=f,u.canvas.height=f;var s=f,k=f,g=s/2,it=k/2,pf=.6*s,ne=.4*k,pr=Math.floor(s/10),ce=pr+"px sans-serif",ae=pr+"px "+tt,hf=k*.13,bi=s*.4,sf=(s-bi)/2,rf=k*.57,tf,ve=k*.61,st=Math.PI/2,ue=Math.PI/180,ff=!1,ir=h,nr=b,ai=b-h,yt=nr-ir,fr=0,vt=0,oi=10,lf=10,re=function(){bf?(ai=c(b-h,!1),vt=c(ai/(lf-1),!0),ir=Math.floor(h/vt)*vt,nr=Math.ceil(b/vt)*vt,fr=c(vt/(oi-1),!0),h=ir,b=nr,yt=b-h):(ai=b-h,ir=h,nr=b,yt=ai,vt=c(ai/(lf-1),!0),fr=c(vt/(oi-1),!0));switch(ot.type){case"type1":ci=0,et=Math.PI,gi=st,at=st,lt=at/yt;break;case"type2":ci=0,et=Math.PI,gi=st,at=Math.PI,lt=at/yt;break;case"type3":ci=0,et=st,gi=0,at=1.5*Math.PI,lt=at/yt;break;case"type4":default:ci=60*ue,et=st+ci/2,gi=0,at=2*Math.PI-ci,lt=at/yt}rr=et+(l-h)*lt},wi=t(f,f),nf=wi.getContext("2d"),di=t(f,f),ut=di.getContext("2d"),fu,hi=t(f*.093457,f*.093457),uu=hi.getContext("2d"),gt=t(f*.093457,f*.093457),nu=gt.getContext("2d"),si=gt,iu=t(Math.ceil(f*.028037),Math.ceil(f*.028037)),se=iu.getContext("2d"),gr=t(Math.ceil(f*.028037),Math.ceil(f*.028037)),he=gr.getContext("2d"),vi=t(f,f),tu=vi.getContext("2d"),yi=t(f,f),ou=yi.getContext("2d"),pi=t(f,f),kt=pi.getContext("2d"),li=t(f,f),pu=li.getContext("2d"),gu,du,ku,yu,cu,tr,su;sr&&vr&&(tr=t(10,10),su=tr.getContext("2d"));var kf=function(n){u.save(),u.textAlign="right",u.strokeStyle=ei.textColor,u.fillStyle=ei.textColor,(ei===steelseries.LcdColor.STANDARD||ei===steelseries.LcdColor.STANDARD_GREEN)&&(u.shadowColor="gray",u.shadowOffsetX=s*.007,u.shadowOffsetY=s*.007,u.shadowBlur=s*.007),u.font=ye?ae:ce,u.fillText(n.toFixed(eu),sf+bi-bi*.05,rf+hf*.5+pr*.38,bi*.9),u.restore()},te=function(n){n.save(),"type1"===ot.type&&n.drawImage(e(Math.ceil(k*.037383),steelseries.KnobType.STANDARD_KNOB,fi),s*.523364,k*.130841),("type1"===ot.type||"type2"===ot.type)&&n.drawImage(e(Math.ceil(k*.037383),steelseries.KnobType.STANDARD_KNOB,fi),s*.130841,k*.514018),("type2"===ot.type||"type3"===ot.type)&&n.drawImage(e(Math.ceil(k*.037383),steelseries.KnobType.STANDARD_KNOB,fi),s*.831775,k*.514018),"type3"===ot.type&&n.drawImage(e(Math.ceil(k*.037383),steelseries.KnobType.STANDARD_KNOB,fi),s*.523364,k*.831775),"type4"===ot.type&&(n.drawImage(e(Math.ceil(k*.037383),steelseries.KnobType.STANDARD_KNOB,fi),s*.336448,k*.803738),n.drawImage(e(Math.ceil(k*.037383),steelseries.KnobType.STANDARD_KNOB,fi),s*.626168,k*.803738)),n.restore()},ie=function(){var t=r.createElement("canvas"),n,i;return t.width=Math.ceil(f*.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},vu=function(n,t,i,r,u){tb&&(t=b),ib&&(i=b);if(t>=i)return;n.save(),n.strokeStyle=r,n.fillStyle=r,n.lineWidth=s*.035;var f=at/yt*t-at/yt*h,e=f+(i-t)/(yt/at);n.translate(g,it),n.rotate(et),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(-g,-it),n.restore()},df=function(n,t){var y,v,a,c;bt.labelColor.setAlpha(1),n.save(),n.textAlign="center",n.textBaseline="middle",y=Math.ceil(s*.04),n.font=y+"px sans-serif",n.strokeStyle=bt.labelColor.getRgbaColor(),n.fillStyle=bt.labelColor.getRgbaColor(),n.translate(g,it),n.rotate(et);var o=et,i=lt*fr,r,e=h,u=oi-1,l=s*.38,w=s*.35,d=s*.355,k=s*.36,p=s*.3,f=s*.1;for((ot.type==="type1"||ot.type==="type2")&&(f=s*.035),v=oi/2,a=parseFloat(b.toFixed(2)),c=h;parseFloat(c.toFixed(2))<=a;c+=fr){r=i+st,u++;if(u===oi){n.lineWidth=1.5,n.beginPath(),n.moveTo(l,0),n.lineTo(w,0),n.closePath(),n.stroke(),n.save(),n.translate(p,0);switch(le.type){case"horizontal":r=-o;break;case"tangent":r=o<=st+Math.PI?Math.PI:0;break;case"normal":default:r=st}n.rotate(r);switch(t.format){case"fractional":n.fillText(e.toFixed(pe),0,0,f);break;case"scientific":n.fillText(e.toPrecision(2),0,0,f);break;case"standard":default:n.fillText(e.toFixed(0),0,0,f)}n.translate(-p,0),n.restore(),e+=vt,u=0,n.rotate(i),o+=i;continue}0==oi%2&&u===v?(n.lineWidth=1,n.beginPath(),n.moveTo(l,0),n.lineTo(d,0),n.closePath(),n.stroke()):(n.lineWidth=.5,n.beginPath(),n.moveTo(l,0),n.lineTo(k,0),n.closePath(),n.stroke()),n.rotate(i),o+=i}n.translate(-g,-it),n.restore()},ft=function(n){var t,i,u;n=n||{};var c=undefined===n.frame?!1:n.frame,r=undefined===n.background?!1:n.background,e=undefined===n.led?!1:n.led,tt=undefined===n.pointer?!1:n.pointer,b=undefined===n.foreground?!1:n.foreground,ft=undefined===n.trend?!1:n.trend,ht=undefined===n.odo?!1:n.odo;ff=!0,re(),c&&wu&&v(nf,hu,g,it,s,k),r&&bu&&(w(ut,bt,g,it,s,k),rt(ut,fe,g,it,s,k)),e&&(uu.drawImage(o(Math.ceil(f*.093457),1,br),0,0),nu.drawImage(o(Math.ceil(f*.093457),0,br),0,0)),kr&&se.drawImage(a(Math.ceil(f*.028037),steelseries.ColorDef.BLUE.dark.getRgbaColor(),!0,!0),0,0),dr&&he.drawImage(a(Math.ceil(f*.028037),steelseries.ColorDef.RED.medium.getRgbaColor(),!0),0,0);if(r&&bu){te(ut);if(null!==ii&&0b?b:n;l!==t&&(l=t,l>ni&&(ni=l),lb?b:n,t,i;l!==r&&(undefined!==t&&t.playing&&t.stop(),t=new Tween({},"",Tween.regularEaseInOut,l,r,1),i=this,t.onMotionChanged=function(n){l=n.target._pos,lni&&(ni=l),lb?b:n;ni=t,this.repaint()},this.setMinMeasuredValue=function(n){var t=nb?b:n;ri=t,this.repaint()},this.setTitleString=function(n){lu=n,ft({background:!0}),this.repaint()},this.setUnitString=function(n){au=n,ft({background:!0}),this.repaint()},this.setMinValue=function(n){h=n,ft({frame:!0,background:!0}),this.repaint()},this.getMinValue=function(){return h},this.setMaxValue=function(n){b=n,ft({frame:!0,background:!0}),this.repaint()},this.getMaxValue=function(){return b},this.setThreshold=function(n){var t=nb?b:n;ti=t,ft({background:!0}),this.repaint()},this.setArea=function(n){ui=n,dt({foreground:!0}),ft({background:!0,foreground:!0}),this.repaint()},this.setSection=function(n){ii=n,dt({foreground:!0}),ft({background:!0,foreground:!0}),this.repaint()},this.setThresholdVisible=function(n){vf=n,this.repaint()},this.setLcdDecimals=function(n){eu=n,this.repaint()},this.setFrameDesign=function(n){dt({frame:!0}),hu=n,ft({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){dt({background:!0,pointer:pt.type==="type2"||pt.type==="type13"?!0:!1}),bt=n,ft({background:!0,pointer:pt.type==="type2"||pt.type==="type13"?!0:!1}),this.repaint()},this.setForegroundType=function(n){dt({foreground:!0}),cf=n,ft({foreground:!0}),this.repaint()},this.setPointerType=function(n){dt({pointer:!0,foreground:!0}),pt=n,ft({pointer:!0,foreground:!0}),this.repaint()},this.setPointerColor=function(n){dt({pointer:!0}),ar=n,ft({pointer:!0}),this.repaint()},this.setLedColor=function(n){dt({led:!0}),br=n,ft({led:!0}),this.repaint()},this.setLcdColor=function(n){ei=n,ft({background:!0}),this.repaint()},this.setTrend=function(n){of=n,this.repaint()},this.setTrendVisible=function(n){wr=n,this.repaint()},this.repaint=function(){ff||ft({frame:!0,background:!0,led:!0,pointer:!0,trend:!0,foreground:!0,odo:!0}),u.clearRect(0,0,u.canvas.width,u.canvas.height),wu&&u.drawImage(wi,0,0),u.drawImage(di,0,0),vr&&(sr?(cu.setValue(wf?l:or),u.drawImage(tr,tf,ve)):kf(l)),ru&&(lh?h:n;it!==t&&(it=t,ith?h:n,t;it!==i&&(undefined!==ti&&ti.playing&&ti.stop(),ti=new Tween({},"",Tween.regularEaseInOut,it,i,1),t=this,ti.onMotionChanged=function(n){it=n.target._pos,ith?h:n;fi=t,a({background:!0}),this.repaint()},this.setTitleString=function(n){su=n,a({background:!0}),this.repaint()},this.setUnitString=function(n){lu=n,a({background:!0}),this.repaint()},this.setTrend=function(n){pu=n,this.repaint()},this.setTrendVisible=function(n){ar=n,this.repaint()},this.repaint=function(){var o,i,e,n,t;for(nu||a({frame:!0,background:!0,led:!0,value:!0,trend:!0,foreground:!0}),u.clearRect(0,0,u.canvas.width,u.canvas.height),yu&&u.drawImage(hi,0,0),u.drawImage(ai,0,0),o=(it+Math.abs(f))/(h-f)*lt,e=ur,n=0;n<=o;n+=5){i=ur;if(lr){var s=f+n/lt*(h-f),c=vi.getEnd()-vi.getStart(),r=s/c;r=Math.max(Math.min(r,1),0),i=wt(vi.getColorAt(r).getRgbaColor())}else if(wi)for(t=0;t=ii[t].start&&nd?d:n;b!==t&&(b=t,b>wt&&(wt=b),bd?d:n,t;b!==i&&(undefined!==dt&&dt.playing&&dt.stop(),dt=new Tween({},"",Tween.regularEaseInOut,b,i,1),t=this,dt.onMotionChanged=function(n){b=n.target._pos,bwt&&(wt=b),bs?s:n;v!==t&&(v=t,v>ft&&(ft=v),vs?s:n,t;v!==i&&(undefined!==yt&&yt.playing&&yt.stop(),yt=new Tween({},"",Tween.regularEaseInOut,v,i,1),t=this,yt.onMotionChanged=function(n){t.setValue(n.target._pos)},yt.start())},this.resetMinMeasuredValue=function(){at=v,this.repaint()},this.resetMaxMeasuredValue=function(){ft=v,this.repaint()},this.setMinMeasuredValueVisible=function(n){tr=n,this.repaint()},this.setMaxMeasuredValueVisible=function(n){di=n,this.repaint()},this.setThresholdVisible=function(n){ar=n,this.repaint()},this.setLcdDecimals=function(n){fr=n,this.repaint()},this.setFrameDesign=function(n){st({frame:!0}),sr=n,g({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){st({background:!0}),w=n,g({background:!0}),this.repaint()},this.setValueColor=function(n){st({foreground:!0}),wt=n,g({foreground:!0}),this.repaint()},this.setLedColor=function(n){st({led:!0}),ti=n,g({led:!0}),this.repaint()},this.setLcdColor=function(n){st({background:!0}),lt=n,g({background:!0}),this.repaint()},this.setMaxMeasuredValue=function(n){var t=ns?s:n;ft=t,this.repaint()},this.setMinMeasuredValue=function(n){var t=ns?s:n;at=t,this.repaint()},this.setTitleString=function(n){gi=n,g({background:!0}),this.repaint()},this.setUnitString=function(n){wi=n,g({background:!0}),this.repaint()},this.setMinValue=function(n){st({background:!0}),e=n,mminMeasuredValues&&(ft=s),v>s&&(v=s),g({background:!0}),this.repaint()},this.getMaxValue=function(){return s},this.setThreshold=function(n){var t=ns?s:n;bt=t,g({background:!0}),this.repaint()},this.repaint=function(){pr||g({frame:!0,background:!0,led:!0,foreground:!0}),y.clearRect(0,0,y.canvas.width,y.canvas.height),or&&y.drawImage(ii,0,0),y.drawImage(ri,0,0),hi&&cu(y,v,h),er&&(v=ft[c].start&&o=ft[c].start&&es?s:n;l!==t&&(l=t,l>lt&&(lt=l),ls?s:n,t;l!==i&&(undefined!==dt&&dt.playing&&dt.stop(),dt=new Tween({},"",Tween.regularEaseInOut,l,i,1),t=this,dt.onMotionChanged=function(n){l=n.target._pos,llt&&(lt=l),ls?s:n;lt!==t&&(lt=t,this.repaint())},this.setMinMeasuredValue=function(n){var t=ns?s:n;at!==t&&(at=t,this.repaint())},this.setTitleString=function(n){ar=n,b({background:!0}),this.repaint()},this.setUnitString=function(n){rr=n,b({background:!0}),this.repaint()},this.setMinValue=function(n){u=n,b({background:!0,foreground:!0,pointer:!0}),this.repaint()},this.getMinValue=function(){return u},this.setMaxValue=function(n){s!==n&&(s=n,b({background:!0,foreground:!0,pointer:!0}),this.repaint())},this.getMaxValue=function(){return s},this.setThreshold=function(n){var t=ns?s:n;st!==t&&(st=t,b({background:!0}),this.repaint())},this.repaint=function(){tu||b({frame:!0,background:!0,led:!0,pointer:!0,foreground:!0,bargraphled:!0}),v.clearRect(0,0,v.canvas.width,v.canvas.height),kr&&v.drawImage(fi,0,0),or&&v.drawImage(hi,0,0),gi&&nf(v,l,h),br&&(lo-4?c||(e=o-l-o*.2,c=!0,clearTimeout(g),g=setTimeout(d,200)):ct&&l<=o-4&&(e=0,c=!1),u.fillText(n,o-2-e,h*.5+v*.38)),u.restore()},dt=function(n,i,r,u){var it=t(n,i),f=it.getContext("2d");f.save();var pt=0,d=0,kt=n,et=i,rt=Math.min(n,i)*.095,h=f.createLinearGradient(0,d,0,d+et);h.addColorStop(0,"#4c4c4c"),h.addColorStop(.08,"#666666"),h.addColorStop(.92,"#666666"),h.addColorStop(1,"#e6e6e6"),f.fillStyle=h,s(f,pt,d,kt,et,rt),f.fill(),f.restore(),f.save();var nt=ft(r),e=st(nt[0],nt[1],nt[2]),g=ft(u.gradientStartColor),ht=st(g[0],g[1],g[2]),tt=ft(u.gradientFraction1Color),lt=st(tt[0],tt[1],tt[2]),a=ft(u.gradientFraction2Color),ct=st(a[0],a[1],a[2]),v=ft(u.gradientFraction3Color),wt=st(v[0],v[1],v[2]),c=ft(u.gradientStopColor),yt=st(c[0],c[1],c[2]),l=vt(e[0],e[1],ht[2]-.31),y=vt(e[0],e[1],lt[2]-.31),k=vt(e[0],e[1],ct[2]-.31),p=vt(e[0],e[1],wt[2]-.31),w=vt(e[0],e[1],yt[2]-.31),bt=1,b=1,ot=n-2,ut=i-2,at=rt-1,o=f.createLinearGradient(0,b,0,b+ut);return o.addColorStop(0,"rgb("+l[0]+", "+l[1]+", "+l[2]+")"),o.addColorStop(.03,"rgb("+y[0]+","+y[1]+","+y[2]+")"),o.addColorStop(.49,"rgb("+k[0]+","+k[1]+","+k[2]+")"),o.addColorStop(.5,"rgb("+p[0]+","+p[1]+","+p[2]+")"),o.addColorStop(1,"rgb("+w[0]+","+w[1]+","+w[2]+")"),f.fillStyle=o,s(f,bt,b,ot,ut,at),f.fill(),f.restore(),it},yt=function(n){var i=ft(n),r=st(i[0],i[1],i[2]),t=vt(r[0],.57,.83);return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},d=function(){c?(e>o&&(e=-l),e+=2,g=setTimeout(d,60)):e=0,wt.repaint()},k=function(){var n;nt=!0,rt=p(b,y,w);if(null!==f&&0=f[n].start&&a<=f[n].stop){t=et[n],i=ut[n];break}u.drawImage(t,0,0),kt(a,i)},this.repaint(),this},wr=function(n,t){t=t||{};var h=undefined===t.width?128:t.width,c=undefined===t.height?64:t.height,f=undefined===t.lcdColor?steelseries.LcdColor.STANDARD:t.lcdColor,k=undefined===t.lcdDecimals?2:t.lcdDecimals,d=undefined===t.unitString?"":t.unitString,b=undefined===t.unitStringVisible?!1:t.unitStringVisible,w=undefined===t.digitalFont?!1:t.digitalFont,ut=undefined===t.valuesNumeric?!0:t.valuesNumeric,o=undefined===t.value?0:t.value,s=0,i=r.getElementById(n).getContext("2d");i.save(),i.clearRect(0,0,i.canvas.width,i.canvas.height),i.canvas.width=h,i.canvas.height=c;var e=h,u=c,g=Math.floor(u/1.875)+"px sans-serif",it=Math.floor(u/1.875)+"px "+tt,y=Math.floor(u/3.5)+"px sans-serif",rt=Math.floor(u/3.5)+"px "+tt,v=!1,l,nt=function(n){var t,o,r;i.save(),i.textAlign="right",i.textBaseline="middle",i.strokeStyle=f.textColor,i.fillStyle=f.textColor,(f===steelseries.LcdColor.STANDARD||f===steelseries.LcdColor.STANDARD_GREEN)&&(i.shadowColor="gray",i.shadowOffsetX=u*.05,i.shadowOffsetY=u*.05,i.shadowBlur=u*.06),ut?(i.font=Math.floor(u/2.5)+"px sans-serif",t=0,b&&(i.font=Math.floor(u/2.5)+"px sans-serif",t=i.measureText(d).width),i.font=w?it:g,o=n.toFixed(k),i.fillText(o,e-t-4,u*.38),b&&(i.font=Math.floor(u/3)+"px sans-serif",i.fillText(d,e-2,u*.46)),r=s.toFixed(k),i.font=w?rt:y,i.textAlign="center",i.fillText(r,e/2,u*.8)):(i.font=Math.floor(u/2.5)+"px sans-serif",i.fillText(n,e-2,u*.38),i.font=y,i.textAlign="center",i.fillText(s,e/2,u*.8)),i.restore()},a=function(){v=!0,l=p(h,c,f)};return this.setValue=function(n){(o!==n||s!==n)&&(s=o,o=n,this.repaint())},this.setLcdColor=function(n){f=n,a(),this.repaint()},this.repaint=function(){v||a(),i.clearRect(0,0,i.canvas.width,i.canvas.height),i.drawImage(l,0,0),nt(o)},this.repaint(),this},br=function(n,u){u=u||{};var c=undefined===u.size?200:u.size,st=undefined===u.decimalsVisible?!1:u.decimalsVisible,gt=undefined===u.textOrientationFixed?!1:u.textOrientationFixed,bt=undefined===u.frameDesign?steelseries.FrameDesign.METAL:u.frameDesign,at=undefined===u.frameVisible?!0:u.frameVisible,p=undefined===u.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:u.backgroundColor,vt=undefined===u.backgroundVisible?!0:u.backgroundVisible,b=undefined===u.pointerColor?steelseries.ColorDef.RED:u.pointerColor,lt=undefined===u.foregroundType?steelseries.ForegroundType.TYPE1:u.foregroundType,yt=undefined===u.foregroundVisible?!0:u.foregroundVisible,d,e=0,k=0,h=0,kt=Math.PI/180,ot=this.value,wt=st?1:0,s=r.getElementById(n).getContext("2d");s.save(),s.clearRect(0,0,s.canvas.width,s.canvas.height),s.canvas.width=c,s.canvas.height=c;var f=c,o=c,l=f/2,a=o/2,pt=!1,g=t(c,c),ut=g.getContext("2d"),nt=t(c,c),et=nt.getContext("2d"),rt=t(c,c),ht=rt.getContext("2d"),tt=t(c,c),ct=tt.getContext("2d"),ni=function(n){n.textAlign="center",n.textBaseline="middle",n.save(),n.strokeStyle=p.labelColor.getRgbaColor(),n.fillStyle=p.labelColor.getRgbaColor(),n.translate(l,a);var r,t;for(i=0;360>i;i++){n.strokeStyle=p.labelColor.getRgbaColor(),n.lineWidth=.5,n.beginPath(),n.moveTo(f*.38,0),n.lineTo(f*.37,0),n.closePath(),n.stroke(),0==i%5&&(n.strokeStyle=p.labelColor.getRgbaColor(),n.lineWidth=1,n.beginPath(),n.moveTo(f*.38,0),n.lineTo(f*.36,0),n.closePath(),n.stroke()),0==i%45&&(n.strokeStyle=p.labelColor.getRgbaColor(),n.lineWidth=1,n.beginPath(),n.moveTo(f*.38,0),n.lineTo(f*.34,0),n.closePath(),n.stroke()),300n?360+n:n,t=359.9=e&&(h=90-e),90=e&&(h=e-90),180=e&&(h=270-e),270=e&&(h=e-270),0>e&&e>=-90&&(h=90-Math.abs(e)),e<-90&&e>=-180&&(h=Math.abs(e)-90),e<-180&&e>=-270&&(h=270-Math.abs(e)),e<-270&&e>=-360&&(h=Math.abs(e)-270),this.repaint())},this.getValue=function(){return e},this.setValueAnimated=function(n){360-n+e=e&&(h=90-e),90=e&&(h=e-90),180=e&&(h=270-e),270=e&&(h=e-270),0>e&&e>=-90&&(h=90-Math.abs(e)),e<-90&&e>=-180&&(h=Math.abs(e)-90),e<-180&&e>=-270&&(h=270-Math.abs(e)),e<-270&&e>=-360&&(h=Math.abs(e)-270),t.repaint()},d.start()}},this.setFrameDesign=function(n){ft(),bt=n,it(),this.repaint()},this.setBackgroundColor=function(n){ft(),p=n,it(),this.repaint()},this.setForegroundType=function(n){ft(),lt=n,it(),this.repaint()},this.setPointerColor=function(n){ft(),b=n,it(),this.repaint()},this.repaint=function(){pt||it(),s.save(),s.clearRect(0,0,s.canvas.width,s.canvas.height),(at||vt)&&s.drawImage(g,0,0),ot=Math.PI/2+e*kt-Math.PI/2,s.save(),s.translate(l,a),s.rotate(ot),s.translate(-l,-a),s.drawImage(nt,0,0),s.fillStyle=p.labelColor.getRgbaColor(),s.textAlign="center",s.textBaseline="middle",gt?(s.restore(),s.font=st?f*.1+"px sans-serif":f*.15+"px sans-serif",s.fillText(h.toFixed(wt)+"\u00b0",l,a,f*.35)):(s.font=st?f*.15+"px sans-serif":f*.2+"px sans-serif",s.fillText(h.toFixed(wt)+"\u00b0",l,a,f*.35),s.restore()),s.translate(l,a),s.rotate(ot+k*Math.PI/180),s.translate(-l,-a),s.drawImage(rt,0,0),s.restore(),yt&&s.drawImage(tt,0,0),s.restore()},this.repaint(),this},gr=function(n,u){u=u||{};var o=undefined===u.size?200:u.size,pt=undefined===u.frameDesign?steelseries.FrameDesign.METAL:u.frameDesign,ct=undefined===u.frameVisible?!0:u.frameVisible,tt=undefined===u.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:u.backgroundColor,dt=undefined===u.backgroundVisible?!0:u.backgroundVisible,bt=undefined===u.pointerType?steelseries.PointerType.TYPE2:u.pointerType,h=undefined===u.pointerColor?steelseries.ColorDef.RED:u.pointerColor,ei=undefined===u.knobType?steelseries.KnobType.STANDARD_KNOB:u.knobType,ui=undefined===u.knobStyle?steelseries.KnobStyle.SILVER:u.knobStyle,gt=undefined===u.foregroundType?steelseries.ForegroundType.TYPE1:u.foregroundType,at=undefined===u.foregroundVisible?!0:u.foregroundVisible,c=undefined===u.pointSymbols?["N","NE","E","SE","S","SW","W","NW"]:u.pointSymbols,fi=undefined===u.customLayer?null:u.customLayer,ii=undefined===u.degreeScale?!1:u.degreeScale,yt=undefined===u.roseVisible?!0:u.roseVisible,d,p=0,st=Math.PI/180,ht=this.value,s=r.getElementById(n).getContext("2d");s.save(),s.clearRect(0,0,s.canvas.width,s.canvas.height),s.canvas.width=o,s.canvas.height=o;var f=o,e=o,a=f/2,l=e/2,kt=!1,ft=t(o,o),g=ft.getContext("2d"),ut=t(o,o),ti=ut.getContext("2d"),it=t(o,o),lt=it.getContext("2d"),ot=t(o,o),b=ot.getContext("2d"),et=t(o,o),vt=et.getContext("2d"),ri=function(n){var t,r,u;n.textAlign="center",n.textBaseline="middle",n.save(),n.strokeStyle=tt.labelColor.getRgbaColor(),n.fillStyle=tt.labelColor.getRgbaColor(),n.translate(a,l);if(ii)for(t=.08*f+"px serif",r=f*.033+"px serif",n.rotate(st*10),i=10;360>=i;i+=10){n.save();switch(i){case 360:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[2],0,0,f),n.translate(-f*.35,0);break;case 90:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[4],0,0,f),n.translate(-f*.35,0);break;case 180:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[6],0,0,f),n.translate(-f*.35,0);break;case 270:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[0],0,0,f),n.translate(-f*.35,0);break;default:u=(i+90)%360,n.translate(f*.37,0),n.rotate(Math.PI/2),n.font=r,n.fillText("0".substring(u>=100)+u,0,0,f),n.translate(-f*.37,0)}n.restore(),n.rotate(st*10)}else for(t=.12*f+"px serif",r=.06*f+"px serif",i=0;360>i;i+=2.5){0==i%5&&(n.lineWidth=1,n.beginPath(),n.moveTo(f*.38,0),n.lineTo(f*.36,0),n.closePath(),n.stroke()),n.save();switch(i){case 0:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[2],0,0,f),n.translate(-f*.35,0);break;case 45:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=r,n.fillText(c[3],0,0,f),n.translate(-f*.29,0);break;case 90:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[4],0,0,f),n.translate(-f*.35,0);break;case 135:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=r,n.fillText(c[5],0,0,f),n.translate(-f*.29,0);break;case 180:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[6],0,0,f),n.translate(-f*.35,0);break;case 225:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=r,n.fillText(c[7],0,0,f),n.translate(-f*.29,0);break;case 270:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[0],0,0,f),n.translate(-f*.35,0);break;case 315:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=r,n.fillText(c[1],0,0,f),n.translate(-f*.29,0)}n.restore(),yt&&(0===i||22.5===i||45===i||67.5===i||90===i||112.5===i||135===i||157.5===i||180===i||202.5===i||225===i||247.5===i||270===i||292.5===i||315===i||337.5===i||360===i)&&(n.save(),n.beginPath(),i%45?n.moveTo(f*.29,0):n.moveTo(f*.38,0),n.lineTo(f*.1,0),n.closePath(),n.restore(),n.lineWidth=1,n.strokeStyle=tt.symbolColor.getRgbaColor(),n.stroke()),n.rotate(st*2.5)}n.translate(-a,-l),n.restore()},wt=function(n,t){var o,s,l,i,r,u,c;n.save(),t&&(n.fillStyle="rgba(0, 0, 0, 0.5)",n.strokeStyle="rgba(0, 0, 0, 0.5)");switch(bt.type){case"type2":n.beginPath(),n.moveTo(f*.53271,e*.453271),n.bezierCurveTo(f*.53271,e*.453271,f*.5,e*.149532,f*.5,e*.149532),n.bezierCurveTo(f*.5,e*.149532,f*.467289,e*.453271,f*.467289,e*.453271),n.bezierCurveTo(f*.453271,e*.462616,f*.443925,e*.481308,f*.443925,e*.5),n.bezierCurveTo(f*.443925,e*.5,f*.556074,e*.5,f*.556074,e*.5),n.bezierCurveTo(f*.556074,e*.481308,f*.546728,e*.462616,f*.53271,e*.453271),n.closePath(),t||(o=n.createLinearGradient(.471962*f,0,.528036*f,0),o.addColorStop(0,h.light.getRgbaColor()),o.addColorStop(.46,h.light.getRgbaColor()),o.addColorStop(.47,h.medium.getRgbaColor()),o.addColorStop(1,h.medium.getRgbaColor()),n.fillStyle=o,n.strokeStyle=h.dark.getRgbaColor()),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke(),n.beginPath(),n.moveTo(f*.467289,e*.546728),n.bezierCurveTo(f*.467289,e*.546728,f*.5,e*.850467,f*.5,e*.850467),n.bezierCurveTo(f*.5,e*.850467,f*.53271,e*.546728,f*.53271,e*.546728),n.bezierCurveTo(f*.546728,e*.537383,f*.556074,e*.518691,f*.556074,e*.5),n.bezierCurveTo(f*.556074,e*.5,f*.443925,e*.5,f*.443925,e*.5),n.bezierCurveTo(f*.443925,e*.518691,f*.453271,e*.537383,f*.467289,e*.546728),n.closePath(),t||(s=n.createLinearGradient(.471962*f,0,.528036*f,0),s.addColorStop(0,"#e3e5e8"),s.addColorStop(.48,"#e3e5e8"),s.addColorStop(.48,"#abb1b8"),s.addColorStop(1,"#abb1b8"),n.fillStyle=s,l="#abb1b8",n.strokeStyle=l),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke();break;case"type3":n.beginPath(),n.moveTo(f*.5,e*.149532),n.bezierCurveTo(f*.5,e*.149532,f*.443925,e*.490654,f*.443925,e*.5),n.bezierCurveTo(f*.443925,e*.53271,f*.467289,e*.556074,f*.5,e*.556074),n.bezierCurveTo(f*.53271,e*.556074,f*.556074,e*.53271,f*.556074,e*.5),n.bezierCurveTo(f*.556074,e*.490654,f*.5,e*.149532,f*.5,e*.149532),n.closePath(),t||(i=n.createLinearGradient(.471962*f,0,.528036*f,0),i.addColorStop(0,h.light.getRgbaColor()),i.addColorStop(.46,h.light.getRgbaColor()),i.addColorStop(.47,h.medium.getRgbaColor()),i.addColorStop(1,h.medium.getRgbaColor()),n.fillStyle=i,n.strokeStyle=h.dark.getRgbaColor()),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke();break;case"type1:":default:n.beginPath(),n.moveTo(f*.5,e*.495327),n.lineTo(f*.528037,e*.495327),n.lineTo(f*.5,e*.149532),n.lineTo(f*.471962,e*.495327),n.lineTo(f*.5,e*.495327),n.closePath(),t||(r=n.createLinearGradient(.471962*f,0,.528036*f,0),r.addColorStop(0,h.light.getRgbaColor()),r.addColorStop(.46,h.light.getRgbaColor()),r.addColorStop(.47,h.medium.getRgbaColor()),r.addColorStop(1,h.medium.getRgbaColor()),n.fillStyle=r,n.strokeStyle=h.dark.getRgbaColor()),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke(),n.beginPath(),n.moveTo(f*.5,e*.504672),n.lineTo(f*.471962,e*.504672),n.lineTo(f*.5,e*.850467),n.lineTo(f*.528037,e*.504672),n.lineTo(f*.5,e*.504672),n.closePath(),t||(u=n.createLinearGradient(.471962*f,0,.528036*f,0),u.addColorStop(0,"#e3e5e8"),u.addColorStop(.48,"#e3e5e8"),u.addColorStop(.480099,"#abb1b8"),u.addColorStop(1,"#abb1b8"),n.fillStyle=u,c="#abb1b8",n.strokeStyle=c),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke()}t&&blur(n,f,e,Math.floor(f*.006)),n.restore()},k=function(){kt=!0,ct&&v(g,pt,a,l,f,e),dt&&(w(g,tt,a,l,f,e),rt(g,fi,a,l,f,e),yt&&hi(g,a,l,f,e,tt),ri(g)),wt(ti,!1),wt(lt,!0),at&&y(vt,gt,f,e,!0,ei,ui)},nt=function(){ft.width=o,ft.height=o,g=ft.getContext("2d"),ut.width=o,ut.height=o,ti=ut.getContext("2d"),it.width=o,it.height=o,lt=it.getContext("2d"),ot.width=o,ot.height=o,b=ot.getContext("2d"),et.width=o,et.height=o,vt=et.getContext("2d")};return this.setValue=function(n){n=n%360,p!==n&&(p=n,this.repaint())},this.getValue=function(){return p},this.setValueAnimated=function(n){var i=n%360,r=this,t;p!==i&&(undefined!==d&&d.playing&&d.stop(),t=ni(p,i),d=new Tween({},"",Tween.elasticEaseOut,p,p+t,2),d.onMotionChanged=function(n){p=n.target._pos%360,r.repaint()},d.start())},this.setFrameDesign=function(n){nt(),pt=n,k(),this.repaint()},this.setBackgroundColor=function(n){nt(),tt=n,k(),this.repaint()},this.setForegroundType=function(n){nt(),gt=n,k(),this.repaint()},this.setPointerColor=function(n){nt(),h=n,k(),this.repaint()},this.setPointerType=function(n){nt(),bt=n,k(),this.repaint()},this.setPointSymbols=function(n){nt(),c=n,k(),this.repaint()},this.repaint=function(){kt||k(),s.clearRect(0,0,s.canvas.width,s.canvas.height),(ct||dt)&&s.drawImage(ft,0,0),ht=Math.PI/2+p*st-Math.PI/2;var n=f*.006;b.clearRect(0,0,f,e),b.save(),b.translate(a,l),b.rotate(ht),b.translate(-a,-l),b.drawImage(it,0,0),b.restore(),s.drawImage(ot,0,0,f,e,n,n,f+n,e+n),s.save(),s.translate(a,l),s.rotate(ht),s.translate(-a,-l),s.drawImage(ut,0,0),s.restore(),at&&s.drawImage(et,0,0),s.restore()},this.repaint(),this},iu=function(n,u){u=u||{};var o=undefined===u.size?200:u.size,pi=undefined===u.frameDesign?steelseries.FrameDesign.METAL:u.frameDesign,di=undefined===u.frameVisible?!0:u.frameVisible,k=undefined===u.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:u.backgroundColor,gi=undefined===u.backgroundVisible?!0:u.backgroundVisible,dt=undefined===u.pointerTypeLatest?steelseries.PointerType.TYPE1:u.pointerTypeLatest,ri=undefined===u.pointerTypeAverage?steelseries.PointerType.TYPE8:u.pointerTypeAverage,kt=undefined===u.pointerColor?steelseries.ColorDef.RED:u.pointerColor,ii=undefined===u.pointerColorAverage?steelseries.ColorDef.BLUE:u.pointerColorAverage,kr=undefined===u.knobType?steelseries.KnobType.STANDARD_KNOB:u.knobType,dr=undefined===u.knobStyle?steelseries.KnobStyle.SILVER:u.knobStyle,si=undefined===u.foregroundType?steelseries.ForegroundType.TYPE1:u.foregroundType,ir=undefined===u.foregroundVisible?!0:u.foregroundVisible,a=undefined===u.pointSymbols?["N","NE","E","SE","S","SW","W","NW"]:u.pointSymbols,vr=undefined===u.customLayer?null:u.customLayer,wr=undefined===u.degreeScale?!0:u.degreeScale,nr=undefined===u.roseVisible?!1:u.roseVisible,ht=undefined===u.lcdColor?steelseries.LcdColor.STANDARD:u.lcdColor,fr=undefined===u.lcdVisible?!0:u.lcdVisible,pr=undefined===u.digitalFont?!1:u.digitalFont,et=undefined===u.section?null:u.section,ft=undefined===u.area?null:u.area,ti=undefined===u.lcdTitleStrings?["Latest","Average"]:u.lcdTitleStrings,rr=undefined===u.titleString?"":u.titleString,tr=undefined===u.useColorLabels?!1:u.useColorLabels,ut,st,it=0,g=0,ct=Math.PI/180,ei=this.valueLatest,fi=this.valueAverage,ar=-Math.PI/2,bi=Math.PI*2,ur=360,e=r.getElementById(n).getContext("2d");e.save(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.canvas.width=o,e.canvas.height=o;var f=o,s=o,c=f/2,h=s/2,ui=Math.floor(f/10),br=ui+"px sans-serif",gr=ui+"px "+tt,gt=f*.3,er=s*.12,hr=(f-gt)/2,or=s*.32,cr=s*.565,sr=!1,bt=t(o,o),d=bt.getContext("2d"),oi,at=t(o,o),ci=at.getContext("2d"),vt=t(o,o),li=vt.getContext("2d"),yt=t(o,o),ai=yt.getContext("2d"),lt=t(o,o),ki=lt.getContext("2d"),ot=t(o,o),l=ot.getContext("2d"),wt=t(o,o),yi=wt.getContext("2d"),vi=function(n,t){e.save(),e.textAlign="center",e.strokeStyle=ht.textColor,e.fillStyle=ht.textColor,n<0&&(n+=360),n="00"+Math.round(n),n=n.substring(n.length,n.length-3),(ht===steelseries.LcdColor.STANDARD||ht===steelseries.LcdColor.STANDARD_GREEN)&&(e.shadowColor="gray",e.shadowOffsetX=f*.007,e.shadowOffsetY=f*.007,e.shadowBlur=f*.007),e.font=pr?gr:br,e.fillText(n+"\u00b0",f/2+gt*.05,(t?or:cr)+er*.5+ui*.38,gt*.9),e.restore()},wi=function(n,t,i,r,u){n.save(),n.strokeStyle=r,n.fillStyle=r,n.lineWidth=f*.035;var e=bi/ur*t,o=e+(i-t)/(ur/bi);n.translate(c,h),n.rotate(ar),n.beginPath(),u?(n.moveTo(0,0),n.arc(0,0,f*.365-n.lineWidth/2,e,o,!1)):n.arc(0,0,f*.365,e,o,!1),u?(n.moveTo(0,0),n.fill()):n.stroke(),n.translate(-c,-h),n.restore()},lr=function(n){var l,o;n.textAlign="center",n.textBaseline="middle";var s=f*.38,v=f*.35,w=f*.355,p=f*.36,e=f*.1,y=f*.31,r=f*.36,t,u;n.save(),n.strokeStyle=k.labelColor.getRgbaColor(),n.fillStyle=k.labelColor.getRgbaColor(),n.translate(c,h);if(wr)for(t=Math.floor(.1*f)+"px serif bold",u=Math.floor(f*.04)+"px sans-serif",n.rotate(ct*5),i=5;360>=i;i+=5){n.save();switch(i){case 360:n.translate(r,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[2],0,0,e),n.translate(-r,0);break;case 90:n.translate(r,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[4],0,0,e),n.translate(-r,0);break;case 180:n.translate(r,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[6],0,0,e),n.translate(-r,0);break;case 270:n.translate(r,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[0],0,0,e),n.translate(-r,0);break;case 5:case 85:case 95:case 175:case 185:case 265:case 275:case 355:break;default:(i+90)%20?(n.lineWidth=(i+90)%5?1.5:1,n.beginPath(),n.moveTo(s,0),l=(i+90)%10?p:v,n.lineTo(l,0),n.closePath(),n.stroke()):(n.lineWidth=1.5,n.beginPath(),n.moveTo(s,0),n.lineTo(v,0),n.closePath(),n.stroke(),o=(i+90)%360,n.translate(y,0),n.rotate(Math.PI/2),n.font=u,n.fillText("0".substring(o>=100)+o,0,0,e),n.translate(-y,0))}n.restore(),n.rotate(ct*5)}else for(t=.12*f+"px serif",u=.06*f+"px serif",n.lineWidth=1,n.strokeStyle=k.symbolColor.getRgbaColor(),i=0;360>i;i+=2.5){0==i%5&&(n.beginPath(),n.moveTo(f*.38,0),n.lineTo(f*.36,0),n.closePath(),n.stroke()),n.save();switch(i){case 0:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[2],0,0),n.translate(-f*.35,0);break;case 45:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=u,n.fillText(a[3],0,0),n.translate(-f*.29,0);break;case 90:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[4],0,0),n.translate(-f*.35,0);break;case 135:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=u,n.fillText(a[5],0,0),n.translate(-f*.29,0);break;case 180:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[6],0,0),n.translate(-f*.35,0);break;case 225:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=u,n.fillText(a[7],0,0),n.translate(-f*.29,0);break;case 270:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[0],0,0),n.translate(-f*.35,0);break;case 315:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=u,n.fillText(a[1],0,0),n.translate(-f*.29,0)}n.restore(),nr&&(0===i||22.5===i||45===i||67.5===i||90===i||112.5===i||135===i||157.5===i||180===i||202.5===i||225===i||247.5===i||270===i||292.5===i||315===i||337.5===i||360===i)&&(n.save(),n.beginPath(),i%45?n.moveTo(f*.29,0):n.moveTo(f*.38,0),n.lineTo(f*.1,0),n.closePath(),n.restore(),n.stroke()),n.rotate(ct*2.5)}n.translate(-c,-h),n.restore()},yr=function(n){ti.length>0&&(n.save(),n.textAlign="center",n.textBaseline="middle",n.fillStyle=tr?kt.medium.getRgbaColor():k.labelColor.getRgbaColor(),n.font=.04*f+"px sans-serif",n.fillText(ti[0],f/2,s*.29,f*.3),n.fillStyle=tr?ii.medium.getRgbaColor():k.labelColor.getRgbaColor(),n.fillText(ti[1],f/2,s*.71,f*.3),rr.length>0&&(n.fillStyle=k.labelColor.getRgbaColor(),n.font=.0467*f+"px sans-serif",n.fillText(rr,f/2,s*.5,f*.3)))},b=function(n){var t,i,u;n=n||{};var o=undefined===n.frame?!1:n.frame,r=undefined===n.background?!1:n.background,e=undefined===n.pointer?!1:n.pointer,l=undefined===n.foreground?!1:n.foreground;sr=!0,o&&di&&v(d,pi,c,h,f,s);if(r&&gi){w(d,k,c,h,f,s),rt(d,vr,c,h,f,s);if(null!==et&&00;i-=s)r>90||(e?(n.fillText(r,(t-t*.2)/2-8,i,t*.375),n.fillText(r,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(),r+=10):(n.beginPath(),n.moveTo((t-t*.1)/2,i),n.lineTo(t-(t-t*.1)/2,i),n.closePath()),n.stroke()),e^=!0;for(e=!1,r=10,n.strokeStyle="#FFFFFF",n.lineWidth=1.5,n.beginPath(),n.moveTo(0,u/2),n.lineTo(t,u/2),n.closePath(),n.stroke(),n.fillStyle="#FFFFFF",n.lineWidth=1,i=u/2+s;i<=u;i+=s)r>90||(e?(n.fillText(-r,(t-t*.2)/2-8,i,t*.375),n.fillText(-r,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(),r+=10):(n.beginPath(),n.moveTo((t-t*.1)/2,i),n.lineTo(t-(t-t*.1)/2,i),n.closePath()),n.stroke()),e^=!0;n.restore()},wt=function(n){var i,r,t;for(n.save(),n.fillStyle=nt.light.getRgbaColor(),n.beginPath(),n.moveTo(u*.476635,f*.5),n.bezierCurveTo(u*.476635,f*.514018,u*.485981,f*.523364,u*.5,f*.523364),n.bezierCurveTo(u*.514018,f*.523364,u*.523364,f*.514018,u*.523364,f*.5),n.bezierCurveTo(u*.523364,f*.485981,u*.514018,f*.476635,u*.5,f*.476635),n.bezierCurveTo(u*.485981,f*.476635,u*.476635,f*.485981,u*.476635,f*.5),n.closePath(),n.moveTo(u*.415887,f*.504672),n.lineTo(u*.415887,f*.495327),n.bezierCurveTo(u*.415887,f*.495327,u*.467289,f*.495327,u*.467289,f*.495327),n.bezierCurveTo(u*.471962,f*.481308,u*.481308,f*.471962,u*.495327,f*.467289),n.bezierCurveTo(u*.495327,f*.467289,u*.495327,f*.415887,u*.495327,f*.415887),n.lineTo(u*.504672,f*.415887),n.bezierCurveTo(u*.504672,f*.415887,u*.504672,f*.467289,u*.504672,f*.467289),n.bezierCurveTo(u*.518691,f*.471962,u*.528037,f*.481308,u*.53271,f*.495327),n.bezierCurveTo(u*.53271,f*.495327,u*.584112,f*.495327,u*.584112,f*.495327),n.lineTo(u*.584112,f*.504672),n.bezierCurveTo(u*.584112,f*.504672,u*.53271,f*.504672,u*.53271,f*.504672),n.bezierCurveTo(u*.528037,f*.518691,u*.518691,f*.53271,u*.5,f*.53271),n.bezierCurveTo(u*.481308,f*.53271,u*.471962,f*.518691,u*.467289,f*.504672),n.bezierCurveTo(u*.467289,f*.504672,u*.415887,f*.504672,u*.415887,f*.504672),n.closePath(),n.fill(),i=5,r=Math.PI/36,n.translate(l,c),n.rotate(-Math.PI/2),n.translate(-l,-c),t=-90;t<=90;t+=i)t%45==0||t===0?(n.strokeStyle=nt.medium.getRgbaColor(),n.lineWidth=2,n.beginPath(),n.moveTo(u*.5,f*.088785),n.lineTo(u*.5,f*.113),n.closePath(),n.stroke()):t%15==0?(n.strokeStyle="#FFFFFF",n.lineWidth=1,n.beginPath(),n.moveTo(u*.5,f*.088785),n.lineTo(u*.5,f*.103785),n.closePath(),n.stroke()):(n.strokeStyle="#FFFFFF",n.lineWidth=.5,n.beginPath(),n.moveTo(u*.5,f*.088785),n.lineTo(u*.5,f*.093785),n.closePath(),n.stroke()),n.translate(l,c),n.rotate(r,l,c),n.translate(-l,-c);n.restore()},at=function(n){n.save();var i=u*.037383,t=f*.056074;n.beginPath(),n.moveTo(i*.5,0),n.lineTo(0,t),n.lineTo(i,t),n.closePath(),n.fillStyle=nt.light.getRgbaColor(),n.fill(),n.strokeStyle=nt.medium.getRgbaColor(),n.stroke(),n.restore()},it=function(){ct=!0,vt&&v(ht,lt,l,c,u,f),pt(ft),at(ut),wt(tt),yt&&y(tt,st,u,f,!0,fi,oi,ai)},rt=function(){k.width=o,k.height=o,ht=k.getContext("2d"),p.width=o,p.height=o*Math.PI,ft=p.getContext("2d"),a.width=o*.037383,a.height=o*.056074,ut=a.getContext("2d"),d.width=o,d.height=o,tt=d.getContext("2d")};return this.setRoll=function(n){n=n%360,h!==n&&(h=n,this.repaint())},this.getRoll=function(){return h},this.setRollAnimated=function(n){n=n%360;if(h!==n){var t=this;undefined!==w&&w.playing&&w.stop(),w=new Tween({},"",Tween.regularEaseInOut,h,n,1),w.onMotionChanged=function(n){h=n.target._pos,t.repaint()},w.start()}},this.setPitch=function(n){n=(n+180-et)%360-180,s!==n&&(s=n,s>90?(s=180-s,g||this.setRoll(h-180),g=!0):s<-90?(s=-180-s,g||this.setRoll(h+180),g=!0):g=!1,this.repaint())},this.getPitch=function(){return s},this.setPitchAnimated=function(n){if(s!==n){undefined!==b&&b.playing&&b.stop();var t=this;b=new Tween({},"",Tween.regularEaseInOut,s,n,1),b.onMotionChanged=function(n){t.setPitch(n.target._pos)},b.start()}},this.setPitchOffset=function(n){et=n,this.repaint()},this.setFrameDesign=function(n){rt(),lt=n,it(),this.repaint()},this.setForegroundType=function(n){rt(),st=n,it(),this.repaint()},this.repaint=function(){ct||it(),e.save(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(k,0,0),e.save(),e.beginPath(),e.arc(l,c,u*.831775/2,0,Math.PI*2,!0),e.closePath(),e.clip(),e.translate(l,c),e.rotate(-(h*Math.PI/180)),e.translate(-l,0),e.translate(0,s*ot),e.drawImage(p,0,-p.height/2),e.translate(0,-(s*ot)-c),e.drawImage(a,u*.5-a.width/2,u*.107476),e.restore(),e.drawImage(d,0,0),e.restore()},this.repaint(),this},nu=function(n,t){var a,e,h,f,c;t=t||{};var u=undefined===t.size?32:t.size,y=undefined===t.ledColor?steelseries.LedColor.RED_LED:t.ledColor,v=!1,p=0,i=r.getElementById(n).getContext("2d");i.save(),i.clearRect(0,0,i.canvas.width,i.canvas.height),i.canvas.width=u,i.canvas.height=u,a=!1,e=r.createElement("canvas"),e.width=u,e.height=u,h=e.getContext("2d"),f=r.createElement("canvas"),f.width=u,f.height=u;var l=f.getContext("2d"),s=f,w=function(){a=!0,h.clearRect(0,0,h.canvas.width,h.canvas.height),h.drawImage(o(u,1,y),0,0),l.clearRect(0,0,l.canvas.width,l.canvas.height),l.drawImage(o(u,0,y),0,0)};return this.toggleLed=function(){s=s===e?f:e,c()},this.setLedColor=function(n){y=n,a=!1,c()},this.setLedOnOff=function(n){s=!0===n?e:f,c()},this.blink=function(n){n?v||(p=setInterval(this.toggleLed,1e3),v=!0):v&&(clearInterval(p),v=!1)},c=function(){a||w(),i.save(),i.clearRect(0,0,i.canvas.width,i.canvas.height),i.drawImage(s,0,0),i.restore()},c(),this},tu=function(n,i){i=i||{};var f=undefined===i.size?200:i.size,di=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,ki=undefined===i.frameVisible?!0:i.frameVisible,p=undefined===i.pointerType?steelseries.PointerType.TYPE1:i.pointerType,b=undefined===i.pointerColor?p===steelseries.PointerType.TYPE1?steelseries.ColorDef.GRAY:steelseries.ColorDef.BLACK:i.pointerColor,ut=undefined===i.backgroundColor?p===steelseries.PointerType.TYPE1?steelseries.BackgroundColor.ANTHRACITE:steelseries.BackgroundColor.LIGHT_GRAY:i.backgroundColor,yi=undefined===i.backgroundVisible?!0:i.backgroundVisible,bi=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,si=undefined===i.foregroundVisible?!0:i.foregroundVisible,or=undefined===i.customLayer?null:i.customLayer,nt=undefined===i.isAutomatic?!0:i.isAutomatic,l=undefined===i.hour?11:i.hour,a=undefined===i.minute?5:i.minute,d=undefined===i.second?0:i.second,kt=undefined===i.secondMovesContinuous?!1:i.secondMovesContinuous,dt=undefined===i.timeZoneOffsetHour?0:i.timeZoneOffsetHour,wt=undefined===i.timeZoneOffsetMinute?0:i.timeZoneOffsetMinute,bt=undefined===i.secondPointerVisible?!0:i.secondPointerVisible,k=new Date,ui,ri,ii,nr,it=kt?100:1e3;it=bt?it:100;var sr=this,hr=Math.PI/2,gt=Math.PI*2,tt=Math.PI/180,fi=6,o=r.getElementById(n).getContext("2d");o.save(),o.clearRect(0,0,o.canvas.width,o.canvas.height),o.canvas.width=f,o.canvas.height=f;var u=f,e=f,s=u/2,h=e/2,pi=!1,st=t(f,f),wi=st.getContext("2d"),et=t(f,f),ti=et.getContext("2d"),ot=t(f,f),gi=ot.getContext("2d"),pt=t(f,f),tr=pt.getContext("2d"),vt=t(f,f),rr=vt.getContext("2d"),lt=t(f,f),ir=lt.getContext("2d"),ht=t(f,f),hi=ht.getContext("2d"),yt=t(f,f),ai=yt.getContext("2d"),g=t(f,f),c=g.getContext("2d"),at=t(f,f),oi=at.getContext("2d"),fr=function(n,t){var i,e,o,r,f;r=u*.405,n.save(),n.translate(s,h);switch(t.type){case"type1":for(e=u*.074766,f=r-e,n.strokeStyle=ut.labelColor.getRgbaColor(),n.lineWidth=u*.014018,i=0;i<360;i+=30)n.beginPath(),n.moveTo(r,0),n.lineTo(f,0),n.closePath(),n.stroke(),n.rotate(30*tt);for(o=u*.126168,f=r-o,n.lineWidth=u*.03271,i=0;i<360;i+=90)n.beginPath(),n.moveTo(r,0),n.lineTo(f,0),n.closePath(),n.stroke(),n.rotate(90*tt);break;case"type2":default:for(e=u*.037383,f=r-e,n.strokeStyle=ut.labelColor.getRgbaColor(),n.lineWidth=u*.009345,i=0;i<360;i+=6)n.beginPath(),n.moveTo(r,0),n.lineTo(f,0),n.closePath(),n.stroke(),n.rotate(6*tt);for(o=u*.084112,f=r-o,n.lineWidth=u*.028037,i=0;i<360;i+=30)n.beginPath(),n.moveTo(r,0),n.lineTo(f,0),n.closePath(),n.stroke(),n.rotate(30*tt)}n.translate(-s,-h),n.restore()},vi=function(n,t,i){n.save();var r;i&&(n.fillStyle="rgba(0, 0, 0, 0.5)",n.strokeStyle="rgba(0, 0, 0, 0.5)");switch(t.type){case"type2":n.beginPath(),n.lineWidth=u*.046728,n.moveTo(s,u*.289719),n.lineTo(s,u*.289719+u*.224299),i||(n.strokeStyle=b.medium.getRgbaColor()),n.closePath(),n.stroke();break;case"type1":default:n.beginPath(),n.moveTo(u*.471962,e*.560747),n.lineTo(u*.471962,e*.214953),n.lineTo(u*.5,e*.182242),n.lineTo(u*.528037,e*.214953),n.lineTo(u*.528037,e*.560747),n.lineTo(u*.471962,e*.560747),n.closePath(),i||(r=n.createLinearGradient(u*.471962,e*.560747,u*.528037,e*.214953),r.addColorStop(1,b.veryLight.getRgbaColor()),r.addColorStop(0,b.light.getRgbaColor()),n.fillStyle=r,n.strokeStyle=b.light.getRgbaColor()),n.fill(),n.stroke()}i&&blur(n,u,e,Math.floor(u*.006)),n.restore()},li=function(n,t,i){n.save();var r;i&&(n.fillStyle="rgba(0, 0, 0, 0.4)",n.strokeStyle="rgba(0, 0, 0, 0.4)");switch(t.type){case"type2":n.beginPath(),n.lineWidth=u*.03271,n.moveTo(s,u*.116822),n.lineTo(s,u*.116822+u*.38785),i||(n.strokeStyle=b.medium.getRgbaColor()),n.closePath(),n.stroke();break;case"type1":default:n.beginPath(),n.moveTo(u*.518691,e*.574766),n.lineTo(u*.523364,e*.135514),n.lineTo(u*.5,e*.107476),n.lineTo(u*.476635,e*.140186),n.lineTo(u*.476635,e*.574766),n.lineTo(u*.518691,e*.574766),n.closePath(),i||(r=n.createLinearGradient(u*.518691,e*.574766,u*.476635,e*.140186),r.addColorStop(1,b.veryLight.getRgbaColor()),r.addColorStop(0,b.light.getRgbaColor()),n.fillStyle=r,n.strokeStyle=b.light.getRgbaColor()),n.fill(),n.stroke()}i&&blur(n,u,e,Math.floor(u*.006)),n.restore()},ci=function(n,t,i){n.save();var r;i?(n.fillStyle="rgba(0, 0, 0, 0.5)",n.strokeStyle="rgba(0, 0, 0, 0.5)"):(n.fillStyle=steelseries.ColorDef.RED.medium.getRgbaColor(),n.strokeStyle=steelseries.ColorDef.RED.medium.getRgbaColor());switch(t.type){case"type2":n.lineWidth=u*.009345,n.beginPath(),n.moveTo(s,u*.09813),n.lineTo(s,u*.09813+u*.126168),n.closePath(),n.stroke(),n.lineWidth=u*.018691,n.beginPath(),n.moveTo(s,u*.308411),n.lineTo(s,u*.308411+u*.191588),n.closePath(),n.stroke(),n.lineWidth=u*.016,n.beginPath(),n.arc(s,u*.26,u*.085/2,0,gt),n.closePath(),n.stroke();break;case"type1":default:n.beginPath(),n.moveTo(u*.509345,e*.116822),n.lineTo(u*.509345,e*.574766),n.lineTo(u*.490654,e*.574766),n.lineTo(u*.490654,e*.116822),n.lineTo(u*.509345,e*.116822),n.closePath(),i||(r=n.createLinearGradient(u*.509345,e*.116822,u*.490654,e*.574766),r.addColorStop(0,steelseries.ColorDef.RED.light.getRgbaColor()),r.addColorStop(.47,steelseries.ColorDef.RED.medium.getRgbaColor()),r.addColorStop(1,steelseries.ColorDef.RED.dark.getRgbaColor()),n.fillStyle=r,n.strokeStyle=steelseries.ColorDef.RED.dark.getRgbaColor()),n.fill(),n.stroke()}i&&blur(n,u,e,Math.floor(u*.006)),n.restore()},er=function(n){var i=u*.006,t;n.beginPath(),n.arc(s,h,u*.045,0,gt),n.closePath(),t=n.createLinearGradient(s-u*.045/2,h-u*.045/2,s+u*.045/2,h+u*.045/2),t.addColorStop(0,"#eef0f2"),t.addColorStop(1,"#65696d"),n.fillStyle=t,n.fill()},ur=function(n,t){var r=u*.006,i;n.save();switch(t.type){case"type2":n.fillStyle="#000000",n.beginPath(),n.arc(s,h,u*.088785/2,0,gt),n.closePath(),n.fill();break;case"type1":default:i=n.createLinearGradient(s-u*.027/2,h-u*.027/2,s+u*.027/2,h+u*.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(s,h,u*.027,0,gt),n.closePath(),n.fill()}n.restore()},ni=function(n,t,i){ii=i*fi*tt,ui=t*fi*tt,ri=(n+t/60)*fi*5*tt},ei=function(){nt?k=new Date:(k.setHours(l),k.setMinutes(a),k.setSeconds(d)),d=k.getSeconds()+(kt?k.getMilliseconds()/1e3:0),l=dt!==0&&wt!==0?k.getUTCHours()+dt:k.getHours(),l=l%12,a=dt!==0&&wt!==0?k.getUTCMinutes()+wt:k.getMinutes(),a>60&&(a-=60,l++),a<0&&(a+=60,l--),l=l%12,ni(l,a,d),nt&&(nr=setTimeout(ei,it)),sr.repaint()},ft=function(n){n=n||{};var r=undefined===n.frame?!1:n.frame,f=undefined===n.background?!1:n.background,t=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground;pi=!0,r&&ki&&v(wi,di,s,h,u,e),f&&yi&&(w(ti,ut,s,h,u,e),rt(ti,or,s,h,u,e),fr(ti,p)),t&&(vi(gi,p,!1),vi(tr,p,!0),li(rr,p,!1),li(ir,p,!0),ci(hi,p,!1),ci(ai,p,!0)),i&&si&&(ur(oi,p),y(oi,bi,u,e,!1))},ct=function(n){n=n||{};var r=undefined===n.frame?!1:n.frame,u=undefined===n.background?!1:n.background,t=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground;r&&(st.width=f,st.height=f,wi=st.getContext("2d")),u&&(et.width=f,et.height=f,ti=et.getContext("2d")),t&&(ot.width=f,ot.height=f,gi=ot.getContext("2d"),pt.width=f,pt.height=f,tr=pt.getContext("2d"),vt.width=f,vt.height=f,rr=vt.getContext("2d"),lt.width=f,lt.height=f,ir=lt.getContext("2d"),ht.width=f,ht.height=f,hi=ht.getContext("2d"),yt.width=f,yt.height=f,ai=yt.getContext("2d"),g.width=f,g.height=f,c=g.getContext("2d")),i&&(at.width=f,at.height=f,oi=at.getContext("2d"))};return this.getAutomatic=function(){return nt},this.setAutomatic=function(n){nt&&!n?(clearTimer(nr),nt=n):!nt&&n&&(nt=n,ei())},this.getHour=function(){return l},this.setHour=function(n){n=n%12,l!==n&&(l=n,ni(l,a,d),this.repaint())},this.getMinute=function(){return a},this.setMinute=function(n){n=n%60,a!==n&&(a=n,ni(l,a,d),this.repaint())},this.getSecond=function(){return d},this.setSecond=function(n){d=n%60,d!==n&&(d=n,ni(l,a,d),this.repaint())},this.getTimeZoneOffsetHour=function(){return dt},this.setTimeZoneOffsetHour=function(n){dt=n,this.repaint()},this.getTimeZoneOffsetMinute=function(){return wt},this.setTimeZoneOffsetMinute=function(n){wt=n,this.repaint()},this.getSecondPointerVisible=function(){return bt},this.setSecondPointerVisible=function(n){bt=n,this.repaint()},this.getSecondMovesContinuous=function(){return kt},this.setSecondMovesContinuous=function(n){kt=n,it=kt?100:1e3,it=bt?it:100},this.setFrameDesign=function(n){ct({frame:!0}),di=n,ft({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){ct({frame:!0,background:!0}),ut=n,ft({frame:!0,background:!0}),this.repaint()},this.setForegroundType=function(n){ct({foreground:!0}),bi=n,ft({foreground:!0}),this.repaint()},this.setPointerType=function(n){ct({foreground:!0,pointers:!0}),p=n,p.type==="type1"?(b=steelseries.ColorDef.GRAY,ut=steelseries.BackgroundColor.ANTHRACITE):(b=steelseries.ColorDef.BLACK,ut=steelseries.BackgroundColor.LIGHT_GRAY),ft({background:!0,foreground:!0,pointers:!0}),this.repaint()},this.setPointerColor=function(n){ct({pointers:!0}),b=n,ft({pointers:!0}),this.repaint()},this.repaint=function(){pi||ft({frame:!0,background:!0,pointers:!0,foreground:!0}),o.clearRect(0,0,o.canvas.width,o.canvas.height),ki&&o.drawImage(st,0,0),yi&&o.drawImage(et,0,0);var n=u*.006;c.clearRect(0,0,u,e),c.save(),c.translate(s,h),c.rotate(ri),c.translate(-s,-h),c.drawImage(pt,0,0),c.restore(),o.drawImage(g,0,0,u,e,n,n,u+n,e+n),o.save(),o.translate(s,h),o.rotate(ri),o.translate(-s,-h),o.drawImage(ot,0,0),o.restore(),c.clearRect(0,0,u,e),c.save(),c.translate(s,h),c.rotate(ui),c.translate(-s,-h),c.drawImage(lt,0,0),c.restore(),o.drawImage(g,0,0,u,e,n,n,u+n,e+n),o.save(),o.translate(s,h),o.rotate(ui),o.translate(-s,-h),o.drawImage(vt,0,0),o.restore(),p.type==="type1"&&er(o),bt&&(c.clearRect(0,0,u,e),c.save(),c.translate(s,h),c.rotate(ii),c.translate(-s,-h),c.drawImage(yt,0,0),c.restore(),o.drawImage(g,0,0,u,e,n,n,u+n,e+n),o.save(),o.translate(s,h),o.rotate(ii),o.translate(-s,-h),o.drawImage(ht,0,0),o.restore()),si&&o.drawImage(at,0,0)},ei(),this},hr=function(t,i){var s;i=i||{};var o=undefined===i.size?50:i.size,f=undefined===i.value?50:i.value,e=o,h=Math.ceil(o*.45),u=r.getElementById(t).getContext("2d");return u.save(),u.clearRect(0,0,u.canvas.width,u.canvas.height),u.canvas.width=e,u.canvas.height=e,s=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 a=[0,.4,1],l=[new n(177,25,2,1),new n(219,167,21,1),new n(121,162,75,1)],y=new kt(0,100,a,l);t.fillStyle=y.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 v=[new n(198,39,5,1),new n(228,189,32,1),new n(163,216,102,1)],h=[new n(246,121,48,1),new n(246,244,157,1),new n(223,233,86,1)],o=[0,.4,1],s=new kt(0,100,o,v),c=new kt(0,100,o,h);f=t.createLinearGradient(i*.05,0,i*.875,0),f.addColorStop(0,s.getColorAt(u/100).getRgbColor()),f.addColorStop(.5,c.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){n=n<0?0:n>100?100:n,f!==n&&(f=n,this.repaint())},this.getValue=function(){return f},this.repaint=function(){u.clearRect(0,0,u.canvas.width,u.canvas.height),s(u,e,h,f)},this.repaint(),this},cr=function(n,i){i=i||{};var f=undefined===i.size?200:i.size,li=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,oi=undefined===i.frameVisible?!0:i.frameVisible,h=undefined===i.pointerColor?steelseries.ColorDef.BLACK:i.pointerColor,lt=undefined===i.backgroundColor?steelseries.BackgroundColor.LIGHT_GRAY:i.backgroundColor,gt=undefined===i.backgroundVisible?!0:i.backgroundVisible,fi=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,vi=undefined===i.foregroundVisible?!0:i.foregroundVisible,gi=undefined===i.customLayer?null:i.customLayer,bt=0,at=0,kt,di=6,ct=Math.PI*2,pt=Math.PI/180,ki=this,yt=0,d=0,yi=0,pi=0,si=0,a=!1,k=!1,e=r.getElementById(n).getContext("2d"),u=f,c=f,o=u/2,l=c/2,p=.285*u,bi=o-p/2,b=.17*u,ci=!1,ht=t(f,f),hi=ht.getContext("2d"),nt=t(f,f),it=nt.getContext("2d"),tt=t(f,f),wi=tt.getContext("2d"),ut=t(f,f),ai=ut.getContext("2d"),st=t(f,f),ni=st.getContext("2d"),ft=t(f,f),ti=ft.getContext("2d"),g=t(f,f),s=g.getContext("2d"),et=t(f,f),ei=et.getContext("2d"),ui=function(n,t,i,r,u,f,e){var vt,ut=r*t,rt=ut+"px sans-serif",ot=t*.15,at=.5,g=1,ht=1.5,tt=u*t,d=Math.round(.025*t),nt=Math.round(.035*t),it=Math.round(.045*t),st=lt.labelColor.getRgbaColor(),k=lt.labelColor.getRgbaColor(),s=t/2,o=t*.4,h,a,w,y=0,b=0,ct=0,v,c=0,l=0,p,et=-Math.PI,ft=2*Math.PI/i;for(n.width=n.height=t,n.save(),n.textAlign="center",n.textBaseline="middle",n.font=rt,p=et,v=0;v<=i+1;p-=ft*.1,v+=.1)n.lineWidth=at,c=Math.sin(p),l=Math.cos(p),y%2==0&&(h=[s+(o-d)*c+f,s+(o-d)*l+e],a=[s+o*c+f,s+o*l+e],n.strokeStyle=k,n.beginPath(),n.moveTo(h[0],h[1]),n.lineTo(a[0],a[1]),n.closePath(),n.stroke()),(y===10||y===0)&&(n.fillStyle=st,n.lineWidth=g,a=[s+o*c+f,s+o*l+e],w=[s+(o-tt)*c+f,s+(o-tt)*l+e],b===5?(v!==i&&Math.round(v)!==60&&n.fillText(Math.round(v),w[0],w[1],ot),n.lineWidth=ht,h=[s+(o-it)*c+f,s+(o-it)*l+e],b=0):(n.lineWidth=g,h=[s+(o-nt)*c+f,s+(o-nt)*l+e]),n.strokeStyle=k,n.beginPath(),n.moveTo(h[0],h[1]),n.lineTo(a[0],a[1]),n.closePath(),n.stroke(),y=0,ct++,b++),y++;n.restore()},ii=function(n,t){var i,r;n.save(),n.beginPath(),n.moveTo(u*.509345,u*.457943),n.lineTo(u*.5,u*.102803),n.lineTo(u*.490654,u*.457943),n.bezierCurveTo(u*.490654,u*.457943,u*.490654,u*.457943,u*.490654,u*.457943),n.bezierCurveTo(u*.471962,u*.462616,u*.457943,u*.481308,u*.457943,u*.5),n.bezierCurveTo(u*.457943,u*.518691,u*.471962,u*.537383,u*.490654,u*.542056),n.bezierCurveTo(u*.490654,u*.542056,u*.490654,u*.542056,u*.490654,u*.542056),n.lineTo(u*.490654,u*.621495),n.lineTo(u*.509345,u*.621495),n.lineTo(u*.509345,u*.542056),n.bezierCurveTo(u*.509345,u*.542056,u*.509345,u*.542056,u*.509345,u*.542056),n.bezierCurveTo(u*.528037,u*.537383,u*.542056,u*.518691,u*.542056,u*.5),n.bezierCurveTo(u*.542056,u*.481308,u*.528037,u*.462616,u*.509345,u*.457943),n.bezierCurveTo(u*.509345,u*.457943,u*.509345,u*.457943,u*.509345,u*.457943),n.closePath(),t?(n.fillStyle="rgba(0, 0, 0, 0.5)",n.strokeStyle="rgba(0, 0, 0, 0.5)",n.fill()):(i=n.createLinearGradient(0,0,0,u*.621495),i.addColorStop(0,h.medium.getRgbaColor()),i.addColorStop(.388888,h.medium.getRgbaColor()),i.addColorStop(.5,h.light.getRgbaColor()),i.addColorStop(.611111,h.medium.getRgbaColor()),i.addColorStop(1,h.medium.getRgbaColor()),n.fillStyle=i,n.strokeStyle=h.dark.getRgbaColor(),n.fill(),n.stroke()),t?blur(n,u,c,Math.floor(u*.006)):(n.beginPath(),r=u*.06542/2,n.arc(o,l,r,0,ct),i=n.createLinearGradient(o-r,o+r,0,o+r),i.addColorStop(0,"#e6b35c"),i.addColorStop(.01,"#e6b35c"),i.addColorStop(.99,"#c48200"),i.addColorStop(1,"#c48200"),n.fillStyle=i,n.closePath(),n.fill(),n.beginPath(),r=u*.046728/2,n.arc(o,l,r,0,ct),i=n.createRadialGradient(o,o,0,o,o,r),i.addColorStop(0,"#c5c5c5"),i.addColorStop(.19,"#c5c5c5"),i.addColorStop(.22,"#000000"),i.addColorStop(.8,"#000000"),i.addColorStop(.99,"#707070"),i.addColorStop(1,"#707070"),n.fillStyle=i,n.closePath(),n.fill()),n.restore()},ri=function(n,t){var i,r;n.save(),n.beginPath(),n.moveTo(u*.476635,u*.313084),n.bezierCurveTo(u*.476635,u*.322429,u*.485981,u*.331775,u*.495327,u*.336448),n.bezierCurveTo(u*.495327,u*.336448,u*.495327,u*.350467,u*.495327,u*.350467),n.lineTo(u*.504672,u*.350467),n.bezierCurveTo(u*.504672,u*.350467,u*.504672,u*.336448,u*.504672,u*.336448),n.bezierCurveTo(u*.514018,u*.331775,u*.523364,u*.322429,u*.523364,u*.313084),n.bezierCurveTo(u*.523364,u*.303738,u*.514018,u*.294392,u*.504672,u*.289719),n.bezierCurveTo(u*.504672,u*.289719,u*.5,u*.200934,u*.5,u*.200934),n.bezierCurveTo(u*.5,u*.200934,u*.495327,u*.289719,u*.495327,u*.289719),n.bezierCurveTo(u*.485981,u*.294392,u*.476635,u*.303738,u*.476635,u*.313084),n.closePath(),t?(n.fillStyle="rgba(0, 0, 0, 0.5)",n.strokeStyle="rgba(0, 0, 0, 0.5)",n.fill()):(i=n.createLinearGradient(0,0,u,0),i.addColorStop(0,h.medium.getRgbaColor()),i.addColorStop(.388888,h.medium.getRgbaColor()),i.addColorStop(.5,h.light.getRgbaColor()),i.addColorStop(.611111,h.medium.getRgbaColor()),i.addColorStop(1,h.medium.getRgbaColor()),n.fillStyle=i,n.strokeStyle=h.dark.getRgbaColor(),n.fill(),n.stroke()),t?blur(n,u,c,Math.floor(u*.006)):(n.beginPath(),r=u*.037383/2,n.arc(o,b+p/2,r,0,ct),n.fillStyle="#C48200",n.closePath(),n.fill(),n.beginPath(),r=u*.028037/2,n.arc(o,b+p/2,r,0,ct),n.fillStyle="#999999",n.closePath(),n.fill(),n.beginPath(),r=u*.018691/2,n.arc(o,b+p/2,r,0,ct),n.fillStyle="#000000",n.closePath(),n.fill()),n.restore()},wt=function(){d=+new Date-yt,at=d*di/1e3,bt=at%10800/30,yi=d/6e4%30,pi=d/1e3%60,si=d%1e3},ot=function(n){n=n||{};var r=undefined===n.frame?!1:n.frame,f=undefined===n.background?!1:n.background,t=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground;ci=!0,r&&oi&&v(hi,li,o,l,u,c),f&>&&(w(it,lt,o,l,u,c),rt(it,gi,o,l,u,c),ui(it,u,60,.075,.1,0,0),ui(it,p,30,.095,.13,bi,b)),t&&(ii(ni,!1),ii(ti,!0),ri(wi,!1),ri(ai,!0)),i&&vi&&y(ei,fi,u,c,!1)},vt=function(n){n=n||{};var r=undefined===n.frame?!1:n.frame,u=undefined===n.background?!1:n.background,t=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground;r&&(ht.width=f,ht.height=f,hi=ht.getContext("2d")),u&&(nt.width=f,nt.height=f,it=nt.getContext("2d")),t&&(tt.width=f,tt.height=f,wi=tt.getContext("2d"),ut.width=f,ut.height=f,ai=ut.getContext("2d"),st.width=f,st.height=f,ni=st.getContext("2d"),ft.width=f,ft.height=f,ti=ft.getContext("2d"),g.width=f,g.height=f,s=g.getContext("2d")),i&&(et.width=f,et.height=f,ei=et.getContext("2d"))},dt=function(){k||(wt(),ki.repaint()),a&&(kt=setTimeout(dt,200))};return this.isRunning=function(){return a},this.start=function(){a||(a=!0,yt=+new Date-d,dt())},this.stop=function(){a&&(a=!1,clearTimeout(kt)),k&&(k=!1,wt(),this.repaint())},this.reset=function(){a&&(a=!1,k=!1,clearTimeout(kt)),yt=+new Date,wt(),this.repaint()},this.lap=function(){a&&!k?k=!0:k&&(k=!1)},this.getMeasuredTime=function(){return yi+":"+pi+":"+si},this.setFrameDesign=function(n){vt({frame:!0}),li=n,ot({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){vt({background:!0}),lt=n,ot({background:!0}),this.repaint()},this.setForegroundType=function(n){vt({foreground:!0}),fi=n,ot({foreground:!0}),this.repaint()},this.setPointerColor=function(n){vt({pointers:!0}),h=n,ot({pointers:!0}),this.repaint()},this.repaint=function(){ci||ot({frame:!0,background:!0,pointers:!0,foreground:!0}),e.clearRect(0,0,e.canvas.width,e.canvas.height),oi&&e.drawImage(ht,0,0),gt&&e.drawImage(nt,0,0);var n=u*.006,t=(bt+2*Math.sin(bt*pt))*pt;s.clearRect(0,0,u,c),s.save(),s.translate(o,b+p/2),s.rotate(t),s.translate(-o,-(b+p/2)),s.drawImage(ut,0,0),s.restore(),e.drawImage(g,0,0,u,c,n/2,n/2,u+n/2,c+n/2),e.save(),e.translate(o,b+p/2),e.rotate(t),e.translate(-o,-(b+p/2)),e.drawImage(tt,0,0),e.restore(),t=(at+2*Math.sin(at*pt))*pt,s.clearRect(0,0,u,c),s.save(),s.translate(o,l),s.rotate(t),s.translate(-o,-l),s.drawImage(ft,0,0),s.restore(),e.drawImage(g,0,0,u,c,n,n,u+n,c+n),e.save(),e.translate(o,l),e.rotate(t),e.translate(-o,-l),e.drawImage(st,0,0),e.restore(),vi&&e.drawImage(et,0,0)},e.save(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.canvas.width=f,e.canvas.height=f,yt=+new Date,dt(),this},sr=function(n,i){function gi(){nt=2*Math.PI/(li-a),ht=nt/10,pt=ht/10}function nr(){yt=l%1e3/100,kt=l%1e4/100,wt=l%1e5/100}var o,bt,at,ut,ui,ri,fi,k,vt,vi,ct,lt,ai,a=0,li=10,l=a,yt=0,kt=0,wt=0,nt,ht,pt,rr=1,g,u,f,c,h,hi,e=r.getElementById(n).getContext("2d"),hr=Math.PI/2,cr=Math.PI/180,ur=Math.PI,ci=!1,ot=t(o,o),bi=ot.getContext("2d"),et=t(o,o),it=et.getContext("2d"),yi,pi=t(o,o),tr=pi.getContext("2d"),ti=t(o,o),ir=ti.getContext("2d"),ni=t(o,o),or=ni.getContext("2d"),ii=t(o,o),sr=ii.getContext("2d"),ei=t(o,o),fr=ei.getContext("2d"),oi=t(o,o),er=oi.getContext("2d"),b=t(o,o),s=b.getContext("2d"),ft=t(o,o),si=ft.getContext("2d"),d,st;i=i||{},o=undefined===i.size?200:i.size,bt=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,at=undefined===i.frameVisible?!0:i.frameVisible,ut=undefined===i.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:i.backgroundColor,ui=undefined===i.backgroundVisible?!0:i.backgroundVisible,ri=undefined===i.knobType?steelseries.KnobType.METAL_KNOB:i.knobType,fi=undefined===i.knobStyle?steelseries.KnobStyle.BLACK:i.knobStyle,k=undefined===i.lcdColor?steelseries.LcdColor.BLACK:i.lcdColor,vt=undefined===i.lcdVisible?!0:i.lcdVisible,vi=undefined===i.digitalFont?!1:i.digitalFont,ct=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,lt=undefined===i.foregroundVisible?!0:i.foregroundVisible,ai=undefined===i.customLayer?null:i.customLayer,e.save(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.canvas.width=o,e.canvas.height=o,u=o,f=o,c=u/2,h=f/2,hi=Math.floor(u*.09)+"px sans-serif";var di=function(n){e.save(),e.textAlign="right",e.textBaseline="middle",e.strokeStyle=k.textColor,e.fillStyle=k.textColor,(k===steelseries.LcdColor.STANDARD||k===steelseries.LcdColor.STANDARD_GREEN)&&(e.shadowColor="gray",e.shadowOffsetX=u*.007,e.shadowOffsetY=u*.007,e.shadowBlur=u*.009),e.font=vi?Math.floor(u*.075)+"px "+tt:Math.floor(u*.075)+"px sans-serif",e.fillText(Math.round(n),(u+u*.4)/2-4,u*.607,u*.4),e.restore()},ki=function(n,t,i,r,f,e){var it=Math.max(u*.012,2),rt=Math.max(u*.007,1.5),d=u*.13,g=u*.05,nt=u*.07,v=u*.4,b=0,ft=0,p=0,y=0,k,w,tt=-i-t/2;for(n.save(),n.textAlign="center",n.textBaseline="middle",n.font=hi,n.strokeStyle=ut.labelColor.getRgbaColor(),n.fillStyle=ut.labelColor.getRgbaColor(),k=tt,w=0;w<=10;k-=e*.1,w+=.1)p=Math.sin(k),y=Math.cos(k),b%2==0&&(n.lineWidth=rt,n.beginPath(),n.moveTo(c+(v-g)*p,h+(v-g)*y),n.lineTo(c+v*p,h+v*y),n.closePath(),n.stroke()),(b===10||b===0)&&(n.lineWidth=it,t===0&&Math.round(w)!==li&&n.fillText(Math.round(w).toString(),c+(v-d)*p,h+(v-d)*y),b=0,ft++,n.beginPath(),n.moveTo(c+(v-nt)*p,h+(v-nt)*y),n.lineTo(c+v*p,h+v*y),n.closePath(),n.stroke()),b++;n.restore()},dt=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,f*.168224,0,f*.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,f*.471962),n.bezierCurveTo(u*.514018,f*.471962,u*.509345,f*.467289,u*.509345,f*.467289),n.lineTo(u*.509345,f*.200934),n.lineTo(u*.5,f*.168224),n.lineTo(u*.490654,f*.200934),n.lineTo(u*.490654,f*.467289),n.bezierCurveTo(u*.490654,f*.467289,u*.481308,f*.471962,u*.481308,f*.471962),n.bezierCurveTo(u*.471962,f*.481308,u*.467289,f*.490654,u*.467289,f*.5),n.bezierCurveTo(u*.467289,f*.514018,u*.476635,f*.528037,u*.490654,f*.53271),n.bezierCurveTo(u*.490654,f*.53271,u*.490654,f*.579439,u*.490654,f*.588785),n.bezierCurveTo(u*.485981,f*.593457,u*.481308,f*.59813,u*.481308,f*.607476),n.bezierCurveTo(u*.481308,f*.616822,u*.490654,f*.626168,u*.5,f*.626168),n.bezierCurveTo(u*.509345,f*.626168,u*.518691,f*.616822,u*.518691,f*.607476),n.bezierCurveTo(u*.518691,f*.59813,u*.514018,f*.593457,u*.504672,f*.588785),n.bezierCurveTo(u*.504672,f*.579439,u*.504672,f*.53271,u*.509345,f*.53271),n.bezierCurveTo(u*.523364,f*.528037,u*.53271,f*.514018,u*.53271,f*.5),n.bezierCurveTo(u*.53271,f*.490654,u*.528037,f*.481308,u*.518691,f*.471962),n.closePath(),n.fill(),t&&blur(n,u,f,Math.floor(u*.006)),n.restore()},gt=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,f*.401869,0,f*.616822),i.addColorStop(0,"#ffffff"),i.addColorStop(.51,"#ffffff"),i.addColorStop(.52,"#ffffff"),i.addColorStop(.5201,"#202020"),i.addColorStop(.53,"#202020"),i.addColorStop(1,"#202020"),n.fillStyle=i),n.beginPath(),n.moveTo(u*.518691,f*.471962),n.bezierCurveTo(u*.514018,f*.462616,u*.528037,f*.401869,u*.528037,f*.401869),n.lineTo(u*.5,f*.331775),n.lineTo(u*.471962,f*.401869),n.bezierCurveTo(u*.471962,f*.401869,u*.485981,f*.462616,u*.481308,f*.471962),n.bezierCurveTo(u*.471962,f*.481308,u*.467289,f*.490654,u*.467289,f*.5),n.bezierCurveTo(u*.467289,f*.514018,u*.476635,f*.528037,u*.490654,f*.53271),n.bezierCurveTo(u*.490654,f*.53271,u*.462616,f*.574766,u*.462616,f*.593457),n.bezierCurveTo(u*.467289,f*.616822,u*.5,f*.612149,u*.5,f*.612149),n.bezierCurveTo(u*.5,f*.612149,u*.53271,f*.616822,u*.537383,f*.593457),n.bezierCurveTo(u*.537383,f*.574766,u*.509345,f*.53271,u*.509345,f*.53271),n.bezierCurveTo(u*.523364,f*.528037,u*.53271,f*.514018,u*.53271,f*.5),n.bezierCurveTo(u*.53271,f*.490654,u*.528037,f*.481308,u*.518691,f*.471962),n.closePath(),n.fill(),t&&blur(n,u,f,Math.floor(u*.006)),n.restore()},wi=function(n,t){t?(n.fillStyle="rgba(0, 0, 0, 0.5)",n.strokeStyle="rgba(0, 0, 0, 0.5)"):n.fillStyle="#ffffff",n.beginPath(),n.moveTo(u*.518691,f*.471962),n.bezierCurveTo(u*.514018,f*.471962,u*.514018,f*.467289,u*.514018,f*.467289),n.lineTo(u*.514018,f*.317757),n.lineTo(u*.504672,f*.303738),n.lineTo(u*.504672,f*.182242),n.lineTo(u*.53271,f*.116822),n.lineTo(u*.462616,f*.116822),n.lineTo(u*.495327,f*.182242),n.lineTo(u*.495327,f*.299065),n.lineTo(u*.485981,f*.317757),n.lineTo(u*.485981,f*.467289),n.bezierCurveTo(u*.485981,f*.467289,u*.485981,f*.471962,u*.481308,f*.471962),n.bezierCurveTo(u*.471962,f*.481308,u*.467289,f*.490654,u*.467289,f*.5),n.bezierCurveTo(u*.467289,f*.518691,u*.481308,f*.53271,u*.5,f*.53271),n.bezierCurveTo(u*.518691,f*.53271,u*.53271,f*.518691,u*.53271,f*.5),n.bezierCurveTo(u*.53271,f*.490654,u*.528037,f*.481308,u*.518691,f*.471962),n.closePath(),n.fill(),t&&blur(n,u,f,Math.floor(u*.006))};return d=function(n){var e,t,r,i;n=n||{},e=undefined===n.frame?!1:n.frame,t=undefined===n.background?!1:n.background,r=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground,ci=!0,gi(),e&&at&&v(bi,bt,c,h,u,f),t&&ui&&(w(it,ut,c,h,u,f),rt(it,ai,c,h,u,f),ki(it,0,ur,0,10,nt,rr,0,!0,!0,null)),t&&vt&&(yi=p(u*.4,f*.09,k),it.drawImage(yi,(u-u*.4)/2,f*.56)),r&&(dt(fr,!1),dt(er,!0),gt(or,!1),gt(sr,!0),wi(tr,!1),wi(ir,!0)),i&<&&y(si,ct,u,f,!0,ri,fi)},st=function(n){var r,u,t,i;n=n||{},r=undefined===n.frame?!1:n.frame,u=undefined===n.background?!1:n.background,t=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground,r&&(ot.width=o,ot.height=o,bi=ot.getContext("2d")),u&&(et.width=o,et.height=o,it=et.getContext("2d")),t&&(pointer100ftBuffer.width=o,pointer100ftBuffer.height=o,pointer100ftContext=pointer100ftBuffer.getContext("2d"),pointer100ftShadowBuffer.width=o,pointer100ftShadowBuffer.height=o,pointer100ftShadowContext=pointer100ftShadowBuffer.getContext("2d"),pointer1000ftBuffer.width=o,pointer1000ftBuffer.height=o,pointer1000ftContext=pointer1000ftBuffer.getContext("2d"),pointer1000ftShadowBuffer.width=o,pointer1000ftShadowBuffer.height=o,pointer1000ftShadowContext=pointer1000ftShadowBuffer.getContext("2d"),pointer10000ftBuffer.width=o,pointer10000ftBuffer.height=o,pointer10000ftContext=pointer10000ftBuffer.getContext("2d"),pointer10000ftShadowBuffer.width=o,pointer10000ftShadowBuffer.height=o,pointer10000ftShadowContext=pointer10000ftShadowBuffer.getContext("2d"),b.width=o,b.height=o,s=b.getContext("2d")),i&&(ft.width=o,ft.height=o,si=ft.getContext("2d"))},this.setValue=function(n){l=n,this.repaint()},this.getValue=function(){return l},this.setValueAnimated=function(n){var t=n0)for(u.rect(0,0,f,s*1.1),u.fillStyle=ot,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=ut,u.fillStyle=et,n=9;n<21;n++)u.fillText(n%10,f*.5,h*(n-9)+h/2);for(n=0;n=e;e+=90)n.beginPath(),n.moveTo(r*.560747,u*.584112),n.lineTo(r*.640186,u*.644859),n.lineTo(r*.584112,u*.560747),n.lineTo(r*.560747,u*.584112),n.closePath(),n.fillStyle=s,n.fill(),n.stroke(),n.beginPath(),n.moveTo(r*.523364,u*.397196),n.lineTo(r*.5,u*.196261),n.lineTo(r*.471962,u*.397196),n.lineTo(r*.523364,u*.397196),n.closePath(),o=n.createLinearGradient(.476635*r,0,.518691*r,0),o.addColorStop(0,"rgb(222, 223, 218)"),o.addColorStop(.48,"rgb(222, 223, 218)"),o.addColorStop(.49,s),o.addColorStop(1,s),n.fillStyle=o,n.fill(),n.stroke(),n.translate(t,i),n.rotate(e*Math.PI/180),n.translate(-t,-i);n.beginPath(),n.translate(t,i),n.arc(0,0,r*.1,0,Math.PI*2,!1),n.lineWidth=r*.022,n.stroke(),n.translate(-t,-i),n.restore()},nt=function(n,i,r,u,f,e){var l,o,s,h,c=i.toString()+r.type+u.light.getHexColor()+u.medium.getHexColor()+e;if(!nt.cache[c]){l=t(i,i),o=l.getContext("2d"),e&&(o.fillStyle="rgba(0, 0, 0, 1)",o.strokeStyle="rgba(0, 0, 0, 1)",o.shadowBlur=3,o.globalAlpha=.5);switch(r.type){case"type2":e||(s=o.createLinearGradient(0,i*.471962,0,i*.130841),s.addColorStop(0,f.getRgbaColor()),s.addColorStop(.36,f.getRgbaColor()),s.addColorStop(.361,u.light.getRgbaColor()),s.addColorStop(1,u.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(),e||(o.fillStyle=u.light.getRgbaColor()),o.fill();break;case"type4":e||(s=o.createLinearGradient(.467289*i,0,.528036*i,0),s.addColorStop(0,u.dark.getRgbaColor()),s.addColorStop(.51,u.dark.getRgbaColor()),s.addColorStop(.52,u.light.getRgbaColor()),s.addColorStop(1,u.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":e||(s=o.createLinearGradient(.471962*i,0,.528036*i,0),s.addColorStop(0,u.light.getRgbaColor()),s.addColorStop(.5,u.light.getRgbaColor()),s.addColorStop(.5,u.medium.getRgbaColor()),s.addColorStop(1,u.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",e||(o.strokeStyle=u.dark.getRgbaColor()),o.stroke();break;case"type6":e||(o.fillStyle=u.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":e||(s=o.createLinearGradient(.481308*i,0,.518691*i,0),s.addColorStop(0,u.dark.getRgbaColor()),s.addColorStop(1,u.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":e||(s=o.createLinearGradient(.471962*i,0,.528036*i,0),s.addColorStop(0,u.light.getRgbaColor()),s.addColorStop(.5,u.light.getRgbaColor()),s.addColorStop(.5,u.medium.getRgbaColor()),s.addColorStop(1,u.medium.getRgbaColor()),o.fillStyle=s,o.strokeStyle=u.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":e||(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(),e||(o.fillStyle=u.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(),e||(s=o.createLinearGradient(.471962*i,0,.528036*i,0),s.addColorStop(0,u.light.getRgbaColor()),s.addColorStop(.5,u.light.getRgbaColor()),s.addColorStop(.5,u.medium.getRgbaColor()),s.addColorStop(1,u.medium.getRgbaColor()),o.fillStyle=s,o.strokeStyle=u.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(),e||(s=o.createLinearGradient(0,.168224*i,0,.584112*i),s.addColorStop(0,u.medium.getRgbaColor()),s.addColorStop(1,u.dark.getRgbaColor()),o.fillStyle=s,o.strokeStyle=u.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(),e||(s=o.createLinearGradient(0,.168224*i,0,.504672*i),s.addColorStop(0,u.medium.getRgbaColor()),s.addColorStop(1,u.dark.getRgbaColor()),o.fillStyle=s,o.strokeStyle=u.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(),e||(r.type==="type13"?(s=o.createLinearGradient(0,.5*i,0,.130841*i),s.addColorStop(0,f.getRgbaColor()),s.addColorStop(.85,f.getRgbaColor()),s.addColorStop(.85,u.medium.getRgbaColor()),s.addColorStop(1,u.medium.getRgbaColor()),o.fillStyle=s):(s=o.createLinearGradient(.485981*i,0,.509345*i,0),s.addColorStop(0,u.veryDark.getRgbaColor()),s.addColorStop(.5,u.light.getRgbaColor()),s.addColorStop(1,u.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),r.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(),e?o.fill():(s=r.type==="type15"?o.createLinearGradient(0,0,0,i*.63):o.createLinearGradient(0,0,0,i*.621495),s.addColorStop(0,u.medium.getRgbaColor()),s.addColorStop(.388888,u.medium.getRgbaColor()),s.addColorStop(.5,u.light.getRgbaColor()),s.addColorStop(.611111,u.medium.getRgbaColor()),s.addColorStop(1,u.medium.getRgbaColor()),o.fillStyle=s,o.strokeStyle=u.dark.getRgbaColor(),o.fill(),o.stroke()),e||(o.beginPath(),h=i*.06542/2,o.arc(i*.5,i*.5,h,0,Math.PI*2),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,Math.PI*2),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:e||(s=o.createLinearGradient(0,i*.471962,0,i*.130841),s.addColorStop(0,u.veryDark.getRgbaColor()),s.addColorStop(.3,u.medium.getRgbaColor()),s.addColorStop(.59,u.medium.getRgbaColor()),s.addColorStop(1,u.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()}nt.cache[c]=l}return n.drawImage(nt.cache[c],0,0),this},v,ht,w,rt,ot,y,et,e,o,p,a,d,h,u,b,ut,at,pt,ri,dt,g,l,lt,gt,bt,yt;nt.cache={},v=function(i,r,u,f,e,o){var w,s,h,y,c,l,a,p=e.toString()+o+r.design;if(!v.cache[p]){w=t(e,o),s=w.getContext("2d"),s.fillStyle="#848484",s.strokeStyle="rgba(132, 132, 132, 0.5)",s.beginPath(),s.arc(u,f,e/2,0,Math.PI*2,!0),s.closePath(),s.fill(),s.stroke(),s.beginPath(),s.arc(u,f,e*.990654/2,0,Math.PI*2,!0),s.closePath();switch(r.design){case"metal":h=s.createLinearGradient(0,e*.004672,0,o*.990654),h.addColorStop(0,"#fefefe"),h.addColorStop(.07,"rgb(210, 210, 210)"),h.addColorStop(.12,"rgb(179, 179, 179)"),h.addColorStop(1,"rgb(213, 213, 213)"),s.fillStyle=h,s.fill();break;case"brass":h=s.createLinearGradient(0,e*.004672,0,o*.990654),h.addColorStop(0,"rgb(249, 243, 155)"),h.addColorStop(.05,"rgb(246, 226, 101)"),h.addColorStop(.1,"rgb(240, 225, 132)"),h.addColorStop(.5,"rgb(90, 57, 22)"),h.addColorStop(.9,"rgb(249, 237, 139)"),h.addColorStop(.95,"rgb(243, 226, 108)"),h.addColorStop(1,"rgb(202, 182, 113)"),s.fillStyle=h,s.fill();break;case"steel":h=s.createLinearGradient(0,e*.004672,0,o*.990654),h.addColorStop(0,"rgb(231, 237, 237)"),h.addColorStop(.05,"rgb(189, 199, 198)"),h.addColorStop(.1,"rgb(192, 201, 200)"),h.addColorStop(.5,"rgb(23, 31, 33)"),h.addColorStop(.9,"rgb(196, 205, 204)"),h.addColorStop(.95,"rgb(194, 204, 203)"),h.addColorStop(1,"rgb(189, 201, 199)"),s.fillStyle=h,s.fill();break;case"gold":h=s.createLinearGradient(0,e*.004672,0,o*.990654),h.addColorStop(0,"rgb(255, 255, 207)"),h.addColorStop(.15,"rgb(255, 237, 96)"),h.addColorStop(.22,"rgb(254, 199, 57)"),h.addColorStop(.3,"rgb(255, 249, 203)"),h.addColorStop(.38,"rgb(255, 199, 64)"),h.addColorStop(.44,"rgb(252, 194, 60)"),h.addColorStop(.51,"rgb(255, 204, 59)"),h.addColorStop(.6,"rgb(213, 134, 29)"),h.addColorStop(.68,"rgb(255, 201, 56)"),h.addColorStop(.75,"rgb(212, 135, 29)"),h.addColorStop(1,"rgb(247, 238, 101)"),s.fillStyle=h,s.fill();break;case"anthracite":h=s.createLinearGradient(0,.004672*o,0,.995326*o),h.addColorStop(0,"rgb(118, 117, 135)"),h.addColorStop(.06,"rgb(74, 74, 82)"),h.addColorStop(.12,"rgb(50, 50, 54)"),h.addColorStop(1,"rgb(79, 79, 87)"),s.fillStyle=h,s.fill();break;case"tiltedGray":h=s.createLinearGradient(.233644*e,.084112*o,.81258*e,.910919*o),h.addColorStop(0,"#ffffff"),h.addColorStop(.07,"rgb(210, 210, 210)"),h.addColorStop(.16,"rgb(179, 179, 179)"),h.addColorStop(.33,"#ffffff"),h.addColorStop(.55,"#c5c5c5"),h.addColorStop(.79,"#ffffff"),h.addColorStop(1,"#666666"),s.fillStyle=h,s.fill();break;case"tiltedBlack":h=s.createLinearGradient(.228971*e,.079439*o,.802547*e,.898591*o),h.addColorStop(0,"#666666"),h.addColorStop(.21,"#000000"),h.addColorStop(.47,"#666666"),h.addColorStop(.99,"#000000"),h.addColorStop(1,"#000000"),s.fillStyle=h,s.fill();break;case"glossyMetal":h=s.createRadialGradient(.5*e,.5*o,0,.5*e,.5*e,.5*e),h.addColorStop(0,"rgb(207, 207, 207)"),h.addColorStop(.96,"rgb(205, 204, 205)"),h.addColorStop(1,"rgb(244, 244, 244)"),s.fillStyle=h,s.fill(),s.beginPath(),s.arc(.5*e,.5*o,.973962*e/2,0,Math.PI*2),s.closePath(),h=s.createLinearGradient(0,o-.971962*o,0,.971962*o),h.addColorStop(0,"rgb(249, 249, 249)"),h.addColorStop(.23,"rgb(200, 195, 191)"),h.addColorStop(.36,"#ffffff"),h.addColorStop(.59,"rgb(29, 29, 29)"),h.addColorStop(.76,"rgb(200, 194, 192)"),h.addColorStop(1,"rgb(209, 209, 209)"),s.fillStyle=h,s.fill(),s.beginPath(),s.arc(.5*e,.5*o,.869158*e/2,0,Math.PI*2),s.closePath(),s.fillStyle="#f6f6f6",s.fill(),s.beginPath(),s.arc(.5*e,.5*o,.85*e/2,0,Math.PI*2),s.closePath(),s.fillStyle="#333333",s.fill();break;case"blackMetal":l=[0,.125,.347222,.5,.680555,.875,1],a=[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)],s.save(),s.clip(s.arc(u,f,e*.990654/2,0,Math.PI*2,!0)),y=e*.495327,c=e*.42056,h=new it(l,a,-Math.PI/2),h.fill(s,u,f,c,y),s.strokeStyle="#848484",s.strokeStyle="rgba(132, 132, 132, 0.8)",s.beginPath(),s.lineWidth=e/90,s.arc(u,f,e/2,0,Math.PI*2,!0),s.closePath(),s.stroke(),s.restore();break;case"shinyMetal":l=[0,.125,.25,.347222,.5,.652777,.75,.875,1],a=[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)],s.save(),s.clip(s.arc(u,f,e*.990654/2,0,Math.PI*2,!0)),y=e*.495327,c=e*.42056,h=new it(l,a,-Math.PI/2),h.fill(s,u,f,c,y),s.strokeStyle="#848484",s.strokeStyle="rgba(132, 132, 132, 0.8)",s.beginPath(),s.lineWidth=e/90,s.arc(u,f,e/2,0,Math.PI*2,!0),s.closePath(),s.stroke(),s.restore();break;case"chrome":l=[0,.09,.12,.16,.25,.29,.33,.38,.48,.52,.63,.68,.8,.83,.87,.97,1],a=[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)],s.save(),s.clip(s.arc(u,f,e*.990654/2,0,Math.PI*2,!0)),y=e*.495327,c=e*.42056,h=new it(l,a,-Math.PI/2),h.fill(s,u,f,c,y),s.strokeStyle="#848484",s.strokeStyle="rgba(132, 132, 132, 0.8)",s.beginPath(),s.lineWidth=e/90,s.arc(u,f,e/2,0,Math.PI*2,!0),s.closePath(),s.stroke(),s.restore()}s.fillStyle="rgb(191, 191, 191)",s.beginPath(),s.arc(u,f,e*.841121/2,0,Math.PI*2,!0),s.closePath(),s.fill(),s.globalCompositeOperation="destination-out",s.beginPath(),s.arc(u,f,e*.831775/2,0,Math.PI*2,!0),s.closePath(),s.fill(),v.cache[p]=w}return i.drawImage(v.cache[p],0,0),this},v.cache={},ht=function(i,r,u,f,e){var c,k,h,l,d,w,o,p=[],v=[],y,a,b=u.toString()+f+r.design+e;if(!ht.cache[b]){c=Math.sqrt(u*u+f*f)*.04,c=Math.min(c,(e?u:f)*.1),k=t(u,f),h=k.getContext("2d"),e?(l=u*.05,d=l-1,w=u*.028571):(l=f*.05,d=l-1,w=f*.028571),s(h,0,0,u,f,l),h.fillStyle="#838383",h.fill(),s(h,1,1,u-2,f-2,d);switch(r.design){case"metal":o=h.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)"),h.fillStyle=o,h.fill();break;case"brass":o=h.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)"),h.fillStyle=o,h.fill();break;case"steel":o=h.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)"),h.fillStyle=o,h.fill();break;case"gold":o=h.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)"),h.fillStyle=o,h.fill();break;case"anthracite":o=h.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)"),h.fillStyle=o,h.fill();break;case"tiltedGray":o=h.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"),h.fillStyle=o,h.fill();break;case"tiltedBlack":o=h.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"),h.fillStyle=o,h.fill();break;case"glossyMetal":h.clip(s(h,1,1,u-2,f-2,l)),o=h.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)"),h.fillStyle=o,h.fill(),h.clip(s(h,c-2,c-2,u-(c-2)*2,f-(c-2)*2,w)),h.fillStyle="#f6f6f6",h.fill(),h.clip(s(h,c-1,c-1,u-(c-1)*2,f-(c-1)*2,w)),h.fillStyle="#333333",h.fill();break;case"blackMetal":p=[0,.125,.347222,.5,.680555,.875,1],v=[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)],y=0,a=Math.sqrt(f*f+u*u)/2,h.clip(s(h,1,1,u-2,f-2,l)),o=new it(p,v,-Math.PI/2),o.fill(h,u/2,f/2,y,a);break;case"shinyMetal":p=[0,.125,.25,.347222,.5,.652777,.75,.875,1],v=[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)],y=0,a=Math.sqrt(f*f+u*u)/2,h.clip(s(h,1,1,u-2,f-2,l)),o=new it(p,v,-Math.PI/2),o.fill(h,u/2,f/2,y,a);break;case"chrome":p=[0,.09,.12,.16,.25,.29,.33,.38,.48,.52,.63,.68,.8,.83,.87,.97,1],v=[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)],y=0,a=Math.sqrt(f*f+u*u)/2,h.clip(s(h,1,1,u-2,f-2,l)),o=new it(p,v,-Math.PI/2),o.fill(h,u/2,f/2,y,a)}s(h,c-1,c-1,u-(c-1)*2,f-(c-1)*2,w-1),h.fillStyle="rgb(192, 192, 192)",h.globalCompositeOperation="destination-out",s(h,c,c,u-c*2,f-c*2,4),h.fill(),ht.cache[b]=k}return i.drawImage(ht.cache[b],0,0),this},ht.cache={},w=function(i,r,u,f,e,o){var p,s,h,k,d,g=e*.831775/2,et,ft,rt,tt,ut,c,v,a,l,nt,y,b=e.toString()+o+r.name;if(!w.cache[b]){p=t(e,o),s=p.getContext("2d"),s.beginPath(),s.arc(u,f,e*.831775/2,0,Math.PI*2,!0),s.closePath();if(r.name==="CARBON"||r.name==="PUNCHED_SHEET"||r.name==="BRUSHED_METAL"||r.name==="BRUSHED_STAINLESS")r.name==="CARBON"&&(s.fillStyle=s.createPattern(vi,"repeat"),s.fill()),r.name==="PUNCHED_SHEET"&&(s.fillStyle=s.createPattern(ci,"repeat"),s.fill()),h=s.createLinearGradient(g,0,e-g,0),h.addColorStop(0,"rgba(0, 0, 0, 0.25)"),h.addColorStop(.5,"rgba(0, 0, 0, 0)"),h.addColorStop(1,"rgba(0, 0, 0, 0.25)"),s.fillStyle=h,s.beginPath(),s.arc(u,f,e*.831775/2,0,Math.PI*2,!0),s.closePath(),s.fill(),(r.name==="BRUSHED_METAL"||r.name==="BRUSHED_STAINLESS")&&(et=r.name==="BRUSHED_METAL"?!0:!1,ft=parseInt(r.gradientStop.getHexColor().substr(-6),16),rt=li(ft,5,.1,et,.5),s.fillStyle=s.createPattern(rt.fill(0,0,e,o),"no-repeat"),s.fill());else if(r.name==="STAINLESS"||r.name==="TURNED"){k=[0,.03,.1,.14,.24,.33,.38,.5,.62,.67,.76,.81,.85,.97,1],d=[new n("#FDFDFD"),new n("#FDFDFD"),new n("#B2B2B4"),new n("#ACACAE"),new n("#FDFDFD"),new n("#6E6E70"),new n("#6E6E70"),new n("#FDFDFD"),new n("#6E6E70"),new n("#6E6E70"),new n("#FDFDFD"),new n("#ACACAE"),new n("#B2B2B4"),new n("#FDFDFD"),new n("#FDFDFD")],tt=e*.831775/2,ut=0,h=new it(k,d,Math.PI/1.75),h.fill(s,u,f,ut,tt),s.closePath();if(r.name==="TURNED"){for(c=Math.PI*2,v=e*.831775/2,a=v*.55,l=c/360*(500/v),s.save(),s.clip(s.arc(u,f,v,0,c)),s.lineWidth=.5,nt=c-l*.3,y=0;y0&&t.width>0&&(n.save(),n.beginPath(),n.arc(i,r,u*.831775/2,0,Math.PI*2,!0),n.clip(),n.drawImage(t,h,s,o,e),n.restore()),this},ot=function(i,r,u,f,e){var l,tt,c,ut,b,h,g,o,k,w,p,v,a,y,ft,rt,nt,d=u.toString()+f+e+r.name;if(!ot.cache[d]){h=Math.sqrt(u*u+f*f)*.04,h=Math.min(h,(e?u:f)*.1),g=t(u,f),o=g.getContext("2d"),linBColor=r,s(o,h,h,u-h*2,f-h*2,4);if(r.name==="CARBON"||r.name==="PUNCHED_SHEET"||r.name==="STAINLESS"||r.name==="BRUSHED_METAL"||r.name==="BRUSHED_STAINLESS"||r.name==="TURNED"){r.name==="CARBON"&&(o.fillStyle=o.createPattern(vi,"repeat"),o.fill()),r.name==="PUNCHED_SHEET"&&(o.fillStyle=o.createPattern(ci,"repeat"),o.fill());if(r.name==="STAINLESS"||r.name==="TURNED"){ut=[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("#6E6E70"),new n("#6E6E70"),new n("#FDFDFD"),new n("#6E6E70"),new n("#6E6E70"),new n("#FDFDFD"),new n("#ACACAE"),new n("#B2B2B4"),new n("#FDFDFD"),new n("#FDFDFD")],c=new it(ut,b,Math.PI/1.75),o.clip(s(o,h,h,u-h*2,f-h*2,4)),k=Math.sqrt((u-h*2)*(u-h*2)+(f-h*2)*(f-h*2))/2,c.fill(o,u/2,f/2,0,k),c=o.createLinearGradient(0,h,0,f-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)"),o.fillStyle=c,s(o,h,h,u-h*2,f-h*2,4),o.fill(),o.restore();if(r.name==="TURNED"){for(w=Math.PI*2,p=k*.55,v=u/2,a=f/2,y=w/360*(400/k),o.save(),o.lineWidth=.5,tt=w-y*.3,l=0;l255?255:n}function e(n){return n<0?0:n>255?255:n}function s(n,t,i,r,u,f){var o,v,e,a,s,h,c,l;for(uu&&(e=(s-u-1)*4,h-=n.data[e],c-=n.data[e+1],l-=n.data[e+2]),o+u>16&255,ct=n>>8&255,at=n&255,g=0,nt=255*r,vt,pt,yt,y,rt,it,tt,ft;h=Math.floor(h),c=Math.floor(c),l=Math.ceil(l),a=Math.ceil(a),p=l-h,w=a-c,et=t(p,w),b=et.getContext("2d"),v=b.createImageData(p,w),ot=b.createImageData(p,w);if(f!==0)for(st=[],k=0;k0?(s(v,ot,p,w,i,ht),b.putImageData(ot,h,c)):b.putImageData(v,h,c),et},this},n=function(n,t,i,r){function s(){e=k(n,255),f=k(t,255),u=k(i,255),o=k(r,1)}var e,f,u,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 e},this.setRed=function(n){e=k(n,255)},this.getGreen=function(){return f},this.setGreen=function(n){f=k(n,255)},this.getBlue=function(){return u},this.setBlue=function(n){u=k(n,255)},this.getAlpha=function(){return o},this.setAlpha=function(n){o=k(n,1)},this.getRgbaColor=function(){return"rgba("+e+", "+f+", "+u+", "+o+")"},this.getRgbColor=function(){return"rgb("+e+", "+f+", "+u+")"},this.getHexColor=function(){return"#"+e.toString(16)+f.toString(16)+u.toString(16)}},it=function(n,t,i){i=i===undefined?-Math.PI/2:i,this.fill=function(r,u,f,e,o){var h,s,p,v=2*Math.PI,c,a,w,b,y,k=180/Math.PI,d=e+(o-e)*.5,l=v/Math.max(360,o*2.2);for(r.save(),r.lineWidth=1.5,r.translate(u,f),r.rotate(i),r.translate(-u,-f),h=0,p=n.length-1;h0?r.arc(u,f,e,s+l,s,!0):r.moveTo(u,f),r.arc(u,f,o,s,s+l),r.fill(),r.stroke();r.restore()}},kt=function(n,t,i,r){this.getColorAt=function(n){var u=0,e=0,f=1,s=1,h=0,t,o;for(n=n<0?0:n>1?1:n,t=0;tn&&f>=i[t]&&(f=i[t],s=t)}return o=(n-u)/(f-u),ui(r[e],r[s],1,o)},this.getStart=function(){return n},this.getEnd=function(){return t}};Math.log10=function(n){return Math.log(n)/Math.LN10},function(){h=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(){u=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(){b=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(){ut=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(){at=function(n){this.type=n}}(),function(){pt=function(n){this.type=n}}(),function(){ri=function(n){this.type=n}}(),function(){dt=function(n){this.style=n}}(),function(){g=function(n){this.design=n}}(),function(){l=function(n){this.type=n}}(),function(){lt=function(n){this.type=n}}(),function(){gt=function(n){this.format=n}}(),function(){bt=function(n){this.type=n}}(),function(){yt=function(n){this.state=n}}();var di={DARK_GRAY:new h(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 h(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 h(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 h(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 h(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 h(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 h(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 h(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 h(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 h(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 h(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 h(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 h(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 h(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 h(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 h(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 h(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 h(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")},ki={BEIGE:new u("#c8c8b1","rgb(241, 237, 207)","rgb(234, 230, 194)","rgb(225, 220, 183)","rgb(237, 232, 191)","#000000"),BLUE:new u("#ffffff","rgb(231, 246, 255)","rgb(170, 224, 255)","rgb(136, 212, 255)","rgb(192, 232, 255)","#124564"),ORANGE:new u("#ffffff","rgb(255, 245, 225)","rgb(255, 217, 147)","rgb(255, 201, 104)","rgb(255, 227, 173)","#503700"),RED:new u("#ffffff","rgb(255, 225, 225)","rgb(253, 152, 152)","rgb(252, 114, 115)","rgb(254, 178, 178)","#4f0c0e"),YELLOW:new u("#ffffff","rgb(245, 255, 186)","rgb(210, 255, 0)","rgb(158, 205, 0)","rgb(210, 255, 0)","#405300"),WHITE:new u("#ffffff","#ffffff","rgb(241, 246, 242)","rgb(229, 239, 244)","#ffffff","#000000"),GRAY:new u("#414141","rgb(117, 117, 117)","rgb(87, 87, 87)","#414141","rgb(81, 81, 81)","#ffffff"),BLACK:new u("#414141","#666666","#333333","#000000","#333333","#cccccc"),GREEN:new u("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 u("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 u("rgb(22, 125, 212)","rgb(3, 162, 254)","rgb(3, 162, 254)","rgb(3, 162, 254)","rgb(11, 172, 244)","#000000"),BLUE_DARKBLUE:new u("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 u("rgb(135, 174, 255)","rgb(101, 159, 255)","rgb(44, 93, 255)","rgb(27, 65, 254)","rgb(12, 50, 255)","#b2b4ed"),STANDARD:new u("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 u("#ffffff","rgb(219, 230, 220)","rgb(179, 194, 178)","rgb(153, 176, 151)","rgb(114, 138, 109)","#080C06"),BLUE_BLUE:new u("rgb(100, 168, 253)","rgb(100, 168, 253)","rgb(95, 160, 250)","rgb(80, 144, 252)","rgb(74, 134, 255)","#002cbb"),RED_DARKRED:new u("rgb(72, 36, 50)","rgb(185, 111, 110)","rgb(148, 66, 72)","rgb(83, 19, 20)","rgb(7, 6, 14)","#FE8B92"),DARKBLUE:new u("rgb(14, 24, 31)","rgb(46, 105, 144)","rgb(19, 64, 96)","rgb(6, 20, 29)","rgb(8, 9, 10)","#3DB3FF"),LILA:new u("rgb(175, 164, 255)","rgb(188, 168, 253)","rgb(176, 159, 255)","rgb(174, 147, 252)","rgb(168, 136, 233)","#076148"),BLACKRED:new u("rgb(8, 12, 11)","rgb(10, 11, 13)","rgb(11, 10, 15)","rgb(7, 13, 9)","rgb(9, 13, 14)","#B50026"),DARKGREEN:new u("rgb(25, 85, 0)","rgb(47, 154, 0)","rgb(30, 101, 0)","rgb(30, 101, 0)","rgb(25, 85, 0)","#233123"),AMBER:new u("rgb(182, 71, 0)","rgb(236, 155, 25)","rgb(212, 93, 5)","rgb(212, 93, 5)","rgb(182, 71, 0)","#593A0A"),LIGHTBLUE:new u("rgb(125, 146, 184)","rgb(197, 212, 231)","rgb(138, 155, 194)","rgb(138, 155, 194)","rgb(125, 146, 184)","#090051"),SECTIONS:new u("#b2b2b2","#ffffff","#c4c4c4","#c4c4c4","#b2b2b2","#000000")},pi={RED:new b(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 b(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 b(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 b(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 b(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 b(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 b(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 b(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 b(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 b(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 b(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 b(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 b(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))},gi={RED_LED:new ut("#FF9A89","#FF9A89","#FF3300","#FF8D70","#7E1C00","#7E1C00","#641B00"),GREEN_LED:new ut("#9AFF89","#9AFF89","#59FF2A","#A5FF00","#1C7E00","#1C7E00","#1B6400"),BLUE_LED:new ut("#899AFF","#899AFF","#0033FF","#708DFF","#001C7E","#001C7E","#001B64"),ORANGE_LED:new ut("#FEA23F","#FEA23F","#FD6C00","#FD6C00","#592800","#592800","#421F00"),YELLOW_LED:new ut("#FFFF62","#FFFF62","#FFFF00","#FFFF00","#6B6D00","#6B6D00","#515300"),CYAN_LED:new ut("#00FFFF","#00FFFF","#1BC3C3","#00FFFF","#083B3B","#083B3B","#052727"),MAGENTA_LED:new ut("#D300FF","#D300FF","#8600CB","#C300FF","#38004B","#38004B","#280035")},ai={TYPE1:new at("type1"),TYPE2:new at("type2"),TYPE3:new at("type3"),TYPE4:new at("type4"),TYPE5:new at("type5")},ur={NORTH:new pt("north"),SOUTH:new pt("south"),EAST:new pt("east"),WEST:new pt("west")},fi={STANDARD_KNOB:new ri("standardKnob"),METAL_KNOB:new ri("metalKnob")},oi={BLACK:new dt("black"),BRASS:new dt("brass"),SILVER:new dt("silver")},fr={BLACK_METAL:new g("blackMetal"),METAL:new g("metal"),SHINY_METAL:new g("shinyMetal"),BRASS:new g("brass"),STEEL:new g("steel"),CHROME:new g("chrome"),GOLD:new g("gold"),ANTHRACITE:new g("anthracite"),TILTED_GRAY:new g("tiltedGray"),TILTED_BLACK:new g("tiltedBlack"),GLOSSY_METAL:new g("glossyMetal")},er={TYPE1:new l("type1"),TYPE2:new l("type2"),TYPE3:new l("type3"),TYPE4:new l("type4"),TYPE5:new l("type5"),TYPE6:new l("type6"),TYPE7:new l("type7"),TYPE8:new l("type8"),TYPE9:new l("type9"),TYPE10:new l("type10"),TYPE11:new l("type11"),TYPE12:new l("type12"),TYPE13:new l("type13"),TYPE14:new l("type14"),TYPE15:new l("type15"),TYPE16:new l("type16")},rr={TYPE1:new lt("type1"),TYPE2:new lt("type2"),TYPE3:new lt("type3"),TYPE4:new lt("type4"),TYPE5:new lt("type5")},nr={STANDARD:new gt("standard"),FRACTIONAL:new gt("fractional"),SCIENTIFIC:new gt("scientific")},tr={NORMAL:new bt("normal"),HORIZONTAL:new bt("horizontal"),TANGENT:new bt("tangent")},ir={UP:new yt("up"),STEADY:new yt("steady"),DOWN:new yt("down"),OFF:new yt("off")};return{Radial:ei,RadialBargraph:wi,RadialVertical:bi,Linear:yi,LinearBargraph:kr,DisplaySingle:dr,DisplayMulti:wr,Level:br,Compass:gr,WindDirection:iu,Horizon:ru,Led:nu,Clock:tu,Battery:hr,StopWatch:cr,Altimeter:sr,TrafficLight:lr,LightBulb:yr,Odometer:pr,drawFrame:v,drawBackground:w,drawForeground:y,rgbaColor:n,ConicalGradient:it,setAlpha:f,getColorFromFraction:ui,gradientWrapper:kt,BackgroundColor:di,LcdColor:ki,ColorDef:pi,LedColor:gi,GaugeType:ai,Orientation:ur,FrameDesign:fr,PointerType:er,ForegroundType:rr,KnobType:fi,KnobStyle:oi,LabelNumberFormat:nr,TickLabelOrientation:tr,TrendState:ir,Section:vr}}()