text: function RGBColor(k){this.ok=false;if(k.charAt(0)=="#"){k=k.substr(1,6)}k=k.replace(/ /g,"");k=k.toLowerCase();var q={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};for(var o in q){if(k==o){k=q[o]}}var j=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(a){return[parseInt(a[1]),parseInt(a[2]),parseInt(a[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}}];for(var p=0;p<j.length;p++){var m=j[p].re;var n=j[p].process;var l=m.exec(k);if(l){channels=n(l);this.r=channels[0];this.g=channels[1];this.b=channels[2];this.ok=true}}this.r=(this.r<0||isNaN(this.r))?0:((this.r>255)?255:this.r);this.g=(this.g<0||isNaN(this.g))?0:((this.g>255)?255:this.g);this.b=(this.b<0||isNaN(this.b))?0:((this.b>255)?255:this.b);this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"};this.toHex=function(){var c=this.r.toString(16);var a=this.g.toString(16);var b=this.b.toString(16);if(c.length==1){c="0"+c}if(a.length==1){a="0"+a}if(b.length==1){b="0"+b}return"#"+c+a+b};this.getHelpXML=function(){var w=new Array();for(var u=0;u<j.length;u++){var a=j[u].example;for(var v=0;v<a.length;v++){w[w.length]=a[v]}}for(var d in q){w[w.length]=d}var h=document.createElement("ul");h.setAttribute("id","rgbcolor-examples");for(var u=0;u<w.length;u++){try{var g=document.createElement("li");var e=new RGBColor(w[u]);var c=document.createElement("div");c.style.cssText="margin: 3px; border: 1px solid black; background:"+e.toHex()+"; color:"+e.toHex();c.appendChild(document.createTextNode("test"));var b=document.createTextNode(" "+w[u]+" -> "+e.toRGB()+" -> "+e.toHex());g.appendChild(c);g.appendChild(b);h.appendChild(g)}catch(f){}}return h}}if(!window.console){window.console={};window.console.log=function(b){};window.console.dir=function(b){}}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c){for(var d=0;d<this.length;d++){if(this[d]==c){return d}}return -1}}(function(){this.canvg=function(t,q,p){if(t==null&&q==null&&p==null){var n=document.getElementsByTagName("svg");for(var a=0;a<n.length;a++){var c=n[a];var s=document.createElement("canvas");s.width=c.clientWidth;s.height=c.clientHeight;c.parentNode.insertBefore(s,c);c.parentNode.removeChild(c);var o=document.createElement("div");o.appendChild(c);canvg(s,o.innerHTML)}return}p=p||{};if(typeof t=="string"){t=document.getElementById(t)}var u;if(t.svg==null){u=b();t.svg=u}else{u=t.svg;u.stop()}u.opts=p;var r=t.getContext("2d");if(typeof(q.documentElement)!="undefined"){u.loadXmlDoc(r,q)}else{if(q.substr(0,1)=="<"){u.loadXml(r,q)}else{u.load(r,q)}}};function b(){var a={};a.FRAMERATE=30;a.MAX_VIRTUAL_PIXELS=30000;a.init=function(d){a.Definitions={};a.Styles={};a.Animations=[];a.Images=[];a.ctx=d;a.ViewPort=new (function(){this.viewPorts=[];this.Clear=function(){this.viewPorts=[]};this.SetCurrent=function(c,f){this.viewPorts.push({width:c,height:f})};this.RemoveCurrent=function(){this.viewPorts.pop()};this.Current=function(){return this.viewPorts[this.viewPorts.length-1]};this.width=function(){return this.Current().width};this.height=function(){return this.Current().height};this.ComputeSize=function(c){if(c!=null&&typeof(c)=="number"){return c}if(c=="x"){return this.width()}if(c=="y"){return this.height()}return Math.sqrt(Math.pow(this.width(),2)+Math.pow(this.height(),2))/Math.sqrt(2)}})};a.init();a.ImagesLoaded=function(){for(var d=0;d<a.Images.length;d++){if(!a.Images[d].loaded){return false}}return true};a.trim=function(d){return d.replace(/^\s+|\s+$/g,"")};a.compressSpaces=function(d){return d.replace(/[\s\r\t\n]+/gm," ")};a.ajax=function(e){var f;if(window.XMLHttpRequest){f=new XMLHttpRequest()}else{f=new ActiveXObject("Microsoft.XMLHTTP")}if(f){f.open("GET",e,false);f.send(null);return f.responseText}return null};a.parseXml=function(h){if(window.DOMParser){var f=new DOMParser();return f.parseFromString(h,"text/xml")}else{h=h.replace(/<!DOCTYPE svg[^>]*>/,"");var g=new ActiveXObject("Microsoft.XMLDOM");g.async="false";g.loadXML(h);return g}};a.Property=function(h,f){this.name=h;this.value=f;this.hasValue=function(){return(this.value!=null&&this.value!=="")};this.numValue=function(){if(!this.hasValue()){return 0}var c=parseFloat(this.value);if((this.value+"").match(/%$/)){c=c/100}return c};this.valueOrDefault=function(c){if(this.hasValue()){return this.value}return c};this.numValueOrDefault=function(c){if(this.hasValue()){return this.numValue()}return c};var g=this;this.Color={addOpacity:function(d){var c=g.value;if(d!=null&&d!=""){var e=new RGBColor(g.value);if(e.ok){c="rgba("+e.r+", "+e.g+", "+e.b+", "+d+")"}}return new a.Property(g.name,c)}};this.Definition={getDefinition:function(){var c=g.value.replace(/^(url\()?#([^\)]+)\)?$/,"$2");return a.Definitions[c]},isUrl:function(){return g.value.indexOf("url(")==0},getFillStyle:function(c){var d=this.getDefinition();if(d!=null&&d.createGradient){return d.createGradient(a.ctx,c)}if(d!=null&&d.createPattern){return d.createPattern(a.ctx,c)}return null}};this.Length={DPI:function(c){return 96},EM:function(c){var e=12;var d=new a.Property("fontSize",a.Font.Parse(a.ctx.font).fontSize);if(d.hasValue()){e=d.Length.toPixels(c)}return e},toPixels:function(c){if(!g.hasValue()){return 0}var d=g.value+"";if(d.match(/em$/)){return g.numValue()*this.EM(c)}if(d.match(/ex$/)){return g.numValue()*this.EM(c)/2}if(d.match(/px$/)){return g.numValue()}if(d.match(/pt$/)){return g.numValue()*1.25}if(d.match(/pc$/)){return g.numValue()*15}if(d.match(/cm$/)){return g.numValue()*this.DPI(c)/2.54}if(d.match(/mm$/)){return g.numValue()*this.DPI(c)/25.4}if(d.match(/in$/)){return g.numValue()*this.DPI(c)}if(d.match(/%$/)){return g.numValue()*a.ViewPort.ComputeSize(c)}return g.numValue()}};this.Time={toMilliseconds:function(){if(!g.hasValue()){return 0}var c=g.value+"";if(c.match(/s$/)){return g.numValue()*1000}if(c.match(/ms$/)){return g.numValue()}return g.numValue()}};this.Angle={toRadians:function(){if(!g.hasValue()){return 0}var c=g.value+"";if(c.match(/deg$/)){return g.numValue()*(Math.PI/180)}if(c.match(/grad$/)){return g.numValue()*(Math.PI/200)}if(c.match(/rad$/)){return g.numValue()}return g.numValue()*(Math.PI/180)}}};a.Font=new (function(){this.Styles=["normal","italic","oblique","inherit"];this.Variants=["normal","small-caps","inherit"];this.Weights=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900","inherit"];this.CreateFont=function(c,o,q,m,n,f){var p=f!=null?this.Parse(f):this.CreateFont("","","","","",a.ctx.font);return{fontFamily:n||p.fontFamily,fontSize:m||p.fontSize,fontStyle:c||p.fontStyle,fontWeight:q||p.fontWeight,fontVariant:o||p.fontVariant,toString:function(){return[this.fontStyle,this.fontVariant,this.fontWeight,this.fontSize,this.fontFamily].join(" ")}}};var d=this;this.Parse=function(c){var m={};var l=a.trim(a.compressSpaces(c||"")).split(" ");var n={fontSize:false,fontStyle:false,fontWeight:false,fontVariant:false};var f="";for(var o=0;o<l.length;o++){if(!n.fontStyle&&d.Styles.indexOf(l[o])!=-1){if(l[o]!="inherit"){m.fontStyle=l[o]}n.fontStyle=true}else{if(!n.fontVariant&&d.Variants.indexOf(l[o])!=-1){if(l[o]!="inherit"){m.fontVariant=l[o]}n.fontStyle=n.fontVariant=true}else{if(!n.fontWeight&&d.Weights.indexOf(l[o])!=-1){if(l[o]!="inherit"){m.fontWeight=l[o]}n.fontStyle=n.fontVariant=n.fontWeight=true}else{if(!n.fontSize){if(l[o]!="inherit"){m.fontSize=l[o].split("/")[0]}n.fontStyle=n.fontVariant=n.fontWeight=n.fontSize=true}else{if(l[o]!="inherit"){f+=l[o]}}}}}}if(f!=""){m.fontFamily=f}return m}});a.ToNumberArray=function(f){var h=a.trim(a.compressSpaces((f||"").replace(/,/g," "))).split(" ");for(var g=0;g<h.length;g++){h[g]=parseFloat(h[g])}return h};a.Point=function(f,e){this.x=f;this.y=e;this.angleTo=function(c){return Math.atan2(c.y-this.y,c.x-this.x)};this.applyTransform=function(h){var d=this.x*h[0]+this.y*h[2]+h[4];var c=this.x*h[1]+this.y*h[3]+h[5];this.x=d;this.y=c}};a.CreatePoint=function(e){var f=a.ToNumberArray(e);return new a.Point(f[0],f[1])};a.CreatePath=function(h){var k=a.ToNumberArray(h);var g=[];for(var j=0;j<k.length;j+=2){g.push(new a.Point(k[j],k[j+1]))}return g};a.BoundingBox=function(j,g,k,h){this.x1=Number.NaN;this.y1=Number.NaN;this.x2=Number.NaN;this.y2=Number.NaN;this.x=function(){return this.x1};this.y=function(){return this.y1};this.width=function(){return this.x2-this.x1};this.height=function(){return this.y2-this.y1};this.addPoint=function(d,c){if(d!=null){if(isNaN(this.x1)||isNaN(this.x2)){this.x1=d;this.x2=d}if(d<this.x1){this.x1=d}if(d>this.x2){this.x2=d}}if(c!=null){if(isNaN(this.y1)||isNaN(this.y2)){this.y1=c;this.y2=c}if(c<this.y1){this.y1=c}if(c>this.y2){this.y2=c}}};this.addX=function(c){this.addPoint(c,null)};this.addY=function(c){this.addPoint(null,c)};this.addBoundingBox=function(c){this.addPoint(c.x1,c.y1);this.addPoint(c.x2,c.y2)};this.addQuadraticCurve=function(w,c,f,r,u,v){var d=w+2/3*(f-w);var e=c+2/3*(r-c);var s=d+1/3*(u-w);var t=e+1/3*(v-c);this.addBezierCurve(w,c,d,s,e,t,u,v)};this.addBezierCurve=function(t,f,M,O,F,J,d,C){var L=[t,f],N=[M,O],P=[F,J],Q=[d,C];this.addPoint(L[0],L[1]);this.addPoint(Q[0],Q[1]);for(i=0;i<=1;i++){var e=function(l){return Math.pow(1-l,3)*L[i]+3*Math.pow(1-l,2)*l*N[i]+3*(1-l)*Math.pow(l,2)*P[i]+Math.pow(l,3)*Q[i]};var I=6*L[i]-12*N[i]+6*P[i];var G=-3*L[i]+9*N[i]-9*P[i]+3*Q[i];var c=3*N[i]-3*L[i];if(G==0){if(I==0){continue}var E=-c/I;if(0<E&&E<1){if(i==0){this.addX(e(E))}if(i==1){this.addY(e(E))}}continue}var K=Math.pow(I,2)-4*c*G;if(K<0){continue}var D=(-I+Math.sqrt(K))/(2*G);if(0<D&&D<1){if(i==0){this.addX(e(D))}if(i==1){this.addY(e(D))}}var H=(-I-Math.sqrt(K))/(2*G);if(0<H&&H<1){if(i==0){this.addX(e(H))}if(i==1){this.addY(e(H))}}}};this.isPointInBox=function(d,c){return(this.x1<=d&&d<=this.x2&&this.y1<=c&&c<=this.y2)};this.addPoint(j,g);this.addPoint(k,h)};a.Transform=function(p){var k=this;this.Type={};this.Type.translate=function(c){this.p=a.CreatePoint(c);this.apply=function(d){d.translate(this.p.x||0,this.p.y||0)};this.applyToPoint=function(d){d.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0])}};this.Type.rotate=function(c){var d=a.ToNumberArray(c);this.angle=new a.Property("angle",d[0]);this.cx=d[1]||0;this.cy=d[2]||0;this.apply=function(e){e.translate(this.cx,this.cy);e.rotate(this.angle.Angle.toRadians());e.translate(-this.cx,-this.cy)};this.applyToPoint=function(e){var f=this.angle.Angle.toRadians();e.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0]);e.applyTransform([Math.cos(f),Math.sin(f),-Math.sin(f),Math.cos(f),0,0]);e.applyTransform([1,0,0,1,-this.p.x||0,-this.p.y||0])}};this.Type.scale=function(c){this.p=a.CreatePoint(c);this.apply=function(d){d.scale(this.p.x||1,this.p.y||this.p.x||1)};this.applyToPoint=function(d){d.applyTransform([this.p.x||0,0,0,this.p.y||0,0,0])}};this.Type.matrix=function(c){this.m=a.ToNumberArray(c);this.apply=function(d){d.transform(this.m[0],this.m[1],this.m[2],this.m[3],this.m[4],this.m[5])};this.applyToPoint=function(d){d.applyTransform(this.m)}};this.Type.SkewBase=function(c){this.base=k.Type.matrix;this.base(c);this.angle=new a.Property("angle",c)};this.Type.SkewBase.prototype=new this.Type.matrix;this.Type.skewX=function(c){this.base=k.Type.SkewBase;this.base(c);this.m=[1,0,Math.tan(this.angle.Angle.toRadians()),1,0,0]};this.Type.skewX.prototype=new this.Type.SkewBase;this.Type.skewY=function(c){this.base=k.Type.SkewBase;this.base(c);this.m=[1,Math.tan(this.angle.Angle.toRadians()),0,1,0,0]};this.Type.skewY.prototype=new this.Type.SkewBase;this.transforms=[];this.apply=function(d){for(var c=0;c<this.transforms.length;c++){this.transforms[c].apply(d)}};this.applyToPoint=function(c){for(var d=0;d<this.transforms.length;d++){this.transforms[d].applyToPoint(c)}};var q=a.trim(a.compressSpaces(p)).split(/\s(?=[a-z])/);for(var n=0;n<q.length;n++){var l=q[n].split("(")[0];var m=q[n].split("(")[1].replace(")","");var o=new this.Type[l](m);this.transforms.push(o)}};a.AspectRatio=function(B,u,x,H,t,v,w,z,y,D){u=a.compressSpaces(u);u=u.replace(/^defer\s/,"");var C=u.split(" ")[0]||"xMidYMid";var F=u.split(" ")[1]||"meet";var A=x/H;var E=t/v;var I=Math.min(A,E);var G=Math.max(A,E);if(F=="meet"){H*=I;v*=I}if(F=="slice"){H*=G;v*=G}y=new a.Property("refX",y);D=new a.Property("refY",D);if(y.hasValue()&&D.hasValue()){B.translate(-I*y.Length.toPixels("x"),-I*D.Length.toPixels("y"))}else{if(C.match(/^xMid/)&&((F=="meet"&&I==E)||(F=="slice"&&G==E))){B.translate(x/2-H/2,0)}if(C.match(/YMid$/)&&((F=="meet"&&I==A)||(F=="slice"&&G==A))){B.translate(0,t/2-v/2)}if(C.match(/^xMax/)&&((F=="meet"&&I==E)||(F=="slice"&&G==E))){B.translate(x-H,0)}if(C.match(/YMax$/)&&((F=="meet"&&I==A)||(F=="slice"&&G==A))){B.translate(0,t-v)}}if(C=="none"){B.scale(A,E)}else{if(F=="meet"){B.scale(I,I)}else{if(F=="slice"){B.scale(G,G)}}}B.translate(w==null?0:-w,z==null?0:-z)};a.Element={};a.Element.ElementBase=function(j){this.attributes={};this.styles={};this.children=[];this.attribute=function(d,c){var e=this.attributes[d];if(e!=null){return e}e=new a.Property(d,"");if(c==true){this.attributes[d]=e}return e};this.style=function(g,c){var f=this.styles[g];if(f!=null){return f}var h=this.attribute(g);if(h!=null&&h.hasValue()){return h}var e=this.parent;if(e!=null){var d=e.style(g);if(d!=null&&d.hasValue()){return d}}f=new a.Property(g,"");if(c==true){this.styles[g]=f}return f};this.render=function(d){if(this.style("display").value=="none"){return}if(this.attribute("visibility").value=="hidden"){return}d.save();this.setContext(d);if(this.attribute("mask").hasValue()){var e=this.attribute("mask").Definition.getDefinition();if(e!=null){e.apply(d,this)}}else{if(this.style("filter").hasValue()){var c=this.style("filter").Definition.getDefinition();if(c!=null){c.apply(d,this)}}else{this.renderChildren(d)}}this.clearContext(d);d.restore()};this.setContext=function(c){};this.clearContext=function(c){};this.renderChildren=function(d){for(var c=0;c<this.children.length;c++){this.children[c].render(d)}};this.addChild=function(d,e){var c=d;if(e){c=a.CreateElement(d)}c.parent=this;this.children.push(c)};if(j!=null&&j.nodeType==1){for(var u=0;u<j.childNodes.length;u++){var r=j.childNodes[u];if(r.nodeType==1){this.addChild(r,true)}}for(var u=0;u<j.attributes.length;u++){var o=j.attributes[u];this.attributes[o.nodeName]=new a.Property(o.nodeName,o.nodeValue)}var s=a.Styles[j.nodeName];if(s!=null){for(var p in s){this.styles[p]=s[p]}}if(this.attribute("class").hasValue()){var w=a.compressSpaces(this.attribute("class").value).split(" ");for(var v=0;v<w.length;v++){s=a.Styles["."+w[v]];if(s!=null){for(var p in s){this.styles[p]=s[p]}}s=a.Styles[j.nodeName+"."+w[v]];if(s!=null){for(var p in s){this.styles[p]=s[p]}}}}if(this.attribute("style").hasValue()){var s=this.attribute("style").value.split(";");for(var u=0;u<s.length;u++){if(a.trim(s[u])!=""){var q=s[u].split(":");var p=a.trim(q[0]);var t=a.trim(q[1]);this.styles[p]=new a.Property(p,t)}}}if(this.attribute("id").hasValue()){if(a.Definitions[this.attribute("id").value]==null){a.Definitions[this.attribute("id").value]=this}}}};a.Element.RenderedElementBase=function(d){this.base=a.Element.ElementBase;this.base(d);this.setContext=function(c){if(this.style("fill").Definition.isUrl()){var o=this.style("fill").Definition.getFillStyle(this);if(o!=null){c.fillStyle=o}}else{if(this.style("fill").hasValue()){var m=this.style("fill");if(this.style("fill-opacity").hasValue()){m=m.Color.addOpacity(this.style("fill-opacity").value)}c.fillStyle=(m.value=="none"?"rgba(0,0,0,0)":m.value)}}if(this.style("stroke").Definition.isUrl()){var o=this.style("stroke").Definition.getFillStyle(this);if(o!=null){c.strokeStyle=o}}else{if(this.style("stroke").hasValue()){var n=this.style("stroke");if(this.style("stroke-opacity").hasValue()){n=n.Color.addOpacity(this.style("stroke-opacity").value)}c.strokeStyle=(n.value=="none"?"rgba(0,0,0,0)":n.value)}}if(this.style("stroke-width").hasValue()){c.lineWidth=this.style("stroke-width").Length.toPixels()}if(this.style("stroke-linecap").hasValue()){c.lineCap=this.style("stroke-linecap").value}if(this.style("stroke-linejoin").hasValue()){c.lineJoin=this.style("stroke-linejoin").value}if(this.style("stroke-miterlimit").hasValue()){c.miterLimit=this.style("stroke-miterlimit").value}if(typeof(c.font)!="undefined"){c.font=a.Font.CreateFont(this.style("font-style").value,this.style("font-variant").value,this.style("font-weight").value,this.style("font-size").hasValue()?this.style("font-size").Length.toPixels()+"px":"",this.style("font-family").value).toString()}if(this.attribute("transform").hasValue()){var l=new a.Transform(this.attribute("transform").value);l.apply(c)}if(this.attribute("clip-path").hasValue()){var k=this.attribute("clip-path").Definition.getDefinition();if(k!=null){k.apply(c)}}if(this.style("opacity").hasValue()){c.globalAlpha=this.style("opacity").numValue()}}};a.Element.RenderedElementBase.prototype=new a.Element.ElementBase;a.Element.PathElementBase=function(d){this.base=a.Element.RenderedElementBase;this.base(d);this.path=function(c){if(c!=null){c.beginPath()}return new a.BoundingBox()};this.renderChildren=function(j){this.path(j);a.Mouse.checkPath(this,j);if(j.fillStyle!=""){j.fill()}if(j.strokeStyle!=""){j.stroke()}var c=this.getMarkers();if(c!=null){if(this.style("marker-start").Definition.isUrl()){var k=this.style("marker-start").Definition.getDefinition();k.render(j,c[0][0],c[0][1])}if(this.style("marker-mid").Definition.isUrl()){var k=this.style("marker-mid").Definition.getDefinition();for(var h=1;h<c.length-1;h++){k.render(j,c[h][0],c[h][1])}}if(this.style("marker-end").Definition.isUrl()){var k=this.style("marker-end").Definition.getDefinition();k.render(j,c[c.length-1][0],c[c.length-1][1])}}};this.getBoundingBox=function(){return this.path()};this.getMarkers=function(){return null}};a.Element.PathElementBase.prototype=new a.Element.RenderedElementBase;a.Element.svg=function(d){this.base=a.Element.RenderedElementBase;this.base(d);this.baseClearContext=this.clearContext;this.clearContext=function(c){this.baseClearContext(c);a.ViewPort.RemoveCurrent()};this.baseSetContext=this.setContext;this.setContext=function(c){c.strokeStyle="rgba(0,0,0,0)";c.lineCap="butt";c.lineJoin="miter";c.miterLimit=4;this.baseSetContext(c);if(this.attribute("x").hasValue()&&this.attribute("y").hasValue()){c.translate(this.attribute("x").Length.toPixels("x"),this.attribute("y").Length.toPixels("y"))}var r=a.ViewPort.width();var s=a.ViewPort.height();if(typeof(this.root)=="undefined"&&this.attribute("width").hasValue()&&this.attribute("height").hasValue()){r=this.attribute("width").Length.toPixels("x");s=this.attribute("height").Length.toPixels("y");var m=0;var q=0;if(this.attribute("refX").hasValue()&&this.attribute("refY").hasValue()){m=-this.attribute("refX").Length.toPixels("x");q=-this.attribute("refY").Length.toPixels("y")}c.beginPath();c.moveTo(m,q);c.lineTo(r,q);c.lineTo(r,s);c.lineTo(m,s);c.closePath();c.clip()}a.ViewPort.SetCurrent(r,s);if(this.attribute("viewBox").hasValue()){var p=a.ToNumberArray(this.attribute("viewBox").value);var n=p[0];var o=p[1];r=p[2];s=p[3];a.AspectRatio(c,this.attribute("preserveAspectRatio").value,a.ViewPort.width(),r,a.ViewPort.height(),s,n,o,this.attribute("refX").value,this.attribute("refY").value);a.ViewPort.RemoveCurrent();a.ViewPort.SetCurrent(p[2],p[3])}}};a.Element.svg.prototype=new a.Element.RenderedElementBase;a.Element.rect=function(d){this.base=a.Element.PathElementBase;this.base(d);this.path=function(q){var c=this.attribute("x").Length.toPixels("x");var l=this.attribute("y").Length.toPixels("y");var p=this.attribute("width").Length.toPixels("x");var m=this.attribute("height").Length.toPixels("y");var n=this.attribute("rx").Length.toPixels("x");var o=this.attribute("ry").Length.toPixels("y");if(this.attribute("rx").hasValue()&&!this.attribute("ry").hasValue()){o=n}if(this.attribute("ry").hasValue()&&!this.attribute("rx").hasValue()){n=o}if(q!=null){q.beginPath();q.moveTo(c+n,l);q.lineTo(c+p-n,l);q.quadraticCurveTo(c+p,l,c+p,l+o);q.lineTo(c+p,l+m-o);q.quadraticCurveTo(c+p,l+m,c+p-n,l+m);q.lineTo(c+n,l+m);q.quadraticCurveTo(c,l+m,c,l+m-o);q.lineTo(c,l+o);q.quadraticCurveTo(c,l,c+n,l);q.closePath()}return new a.BoundingBox(c,l,c+p,l+m)}};a.Element.rect.prototype=new a.Element.PathElementBase;a.Element.circle=function(d){this.base=a.Element.PathElementBase;this.base(d);this.path=function(j){var k=this.attribute("cx").Length.toPixels("x");var c=this.attribute("cy").Length.toPixels("y");var h=this.attribute("r").Length.toPixels();if(j!=null){j.beginPath();j.arc(k,c,h,0,Math.PI*2,true);j.closePath()}return new a.BoundingBox(k-h,c-h,k+h,c+h)}};a.Element.circle.prototype=new a.Element.PathElementBase;a.Element.ellipse=function(d){this.base=a.Element.PathElementBase;this.base(d);this.path=function(c){var l=4*((Math.sqrt(2)-1)/3);var k=this.attribute("rx").Length.toPixels("x");var m=this.attribute("ry").Length.toPixels("y");var o=this.attribute("cx").Length.toPixels("x");var n=this.attribute("cy").Length.toPixels("y");if(c!=null){c.beginPath();c.moveTo(o,n-m);c.bezierCurveTo(o+(l*k),n-m,o+k,n-(l*m),o+k,n);c.bezierCurveTo(o+k,n+(l*m),o+(l*k),n+m,o,n+m);c.bezierCurveTo(o-(l*k),n+m,o-k,n+(l*m),o-k,n);c.bezierCurveTo(o-k,n-(l*m),o-(l*k),n-m,o,n-m);c.closePath()}return new a.BoundingBox(o-k,n-m,o+k,n+m)}};a.Element.ellipse.prototype=new a.Element.PathElementBase;a.Element.line=function(d){this.base=a.Element.PathElementBase;this.base(d);this.getPoints=function(){return[new a.Point(this.attribute("x1").Length.toPixels("x"),this.attribute("y1").Length.toPixels("y")),new a.Point(this.attribute("x2").Length.toPixels("x"),this.attribute("y2").Length.toPixels("y"))]};this.path=function(f){var c=this.getPoints();if(f!=null){f.beginPath();f.moveTo(c[0].x,c[0].y);f.lineTo(c[1].x,c[1].y)}return new a.BoundingBox(c[0].x,c[0].y,c[1].x,c[1].y)};this.getMarkers=function(){var c=this.getPoints();var f=c[0].angleTo(c[1]);return[[c[0],f],[c[1],f]]}};a.Element.line.prototype=new a.Element.PathElementBase;a.Element.polyline=function(d){this.base=a.Element.PathElementBase;this.base(d);this.points=a.CreatePath(this.attribute("points").value);this.path=function(h){var c=new a.BoundingBox(this.points[0].x,this.points[0].y);if(h!=null){h.beginPath();h.moveTo(this.points[0].x,this.points[0].y)}for(var g=1;g<this.points.length;g++){c.addPoint(this.points[g].x,this.points[g].y);if(h!=null){h.lineTo(this.points[g].x,this.points[g].y)}}return c};this.getMarkers=function(){var c=[];for(var f=0;f<this.points.length-1;f++){c.push([this.points[f],this.points[f].angleTo(this.points[f+1])])}c.push([this.points[this.points.length-1],c[c.length-1][1]]);return c}};a.Element.polyline.prototype=new a.Element.PathElementBase;a.Element.polygon=function(d){this.base=a.Element.polyline;this.base(d);this.basePath=this.path;this.path=function(f){var c=this.basePath(f);if(f!=null){f.lineTo(this.points[0].x,this.points[0].y);f.closePath()}return c}};a.Element.polygon.prototype=new a.Element.polyline;a.Element.path=function(f){this.base=a.Element.PathElementBase;this.base(f);var d=this.attribute("d").value;d=d.replace(/,/gm," ");d=d.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");d=d.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");d=d.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2");d=d.replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");d=d.replace(/([0-9])([+\-])/gm,"$1 $2");d=d.replace(/(\.[0-9]*)(\.)/gm,"$1 $2");d=d.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");d=a.compressSpaces(d);d=a.trim(d);this.PathParser=new (function(c){this.tokens=c.split(" ");this.reset=function(){this.i=-1;this.command="";this.previousCommand="";this.start=new a.Point(0,0);this.control=new a.Point(0,0);this.current=new a.Point(0,0);this.points=[];this.angles=[]};this.isEnd=function(){return this.i>=this.tokens.length-1};this.isCommandOrEnd=function(){if(this.isEnd()){return true}return this.tokens[this.i+1].match(/^[A-Za-z]$/)!=null};this.isRelativeCommand=function(){return this.command==this.command.toLowerCase()};this.getToken=function(){this.i=this.i+1;return this.tokens[this.i]};this.getScalar=function(){return parseFloat(this.getToken())};this.nextCommand=function(){this.previousCommand=this.command;this.command=this.getToken()};this.getPoint=function(){var e=new a.Point(this.getScalar(),this.getScalar());return this.makeAbsolute(e)};this.getAsControlPoint=function(){var e=this.getPoint();this.control=e;return e};this.getAsCurrentPoint=function(){var e=this.getPoint();this.current=e;return e};this.getReflectedControlPoint=function(){if(this.previousCommand.toLowerCase()!="c"&&this.previousCommand.toLowerCase()!="s"){return this.current}var e=new a.Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y);return e};this.makeAbsolute=function(e){if(this.isRelativeCommand()){e.x=this.current.x+e.x;e.y=this.current.y+e.y}return e};this.addMarker=function(j,e,k){if(k!=null&&this.angles.length>0&&this.angles[this.angles.length-1]==null){this.angles[this.angles.length-1]=this.points[this.points.length-1].angleTo(k)}this.addMarkerAngle(j,e==null?null:e.angleTo(j))};this.addMarkerAngle=function(e,h){this.points.push(e);this.angles.push(h)};this.getMarkerPoints=function(){return this.points};this.getMarkerAngles=function(){for(var e=0;e<this.angles.length;e++){if(this.angles[e]==null){for(var h=e+1;h<this.angles.length;h++){if(this.angles[h]!=null){this.angles[e]=this.angles[h];break}}}}return this.angles}})(d);this.path=function(m){var T=this.PathParser;T.reset();var ad=new a.BoundingBox();if(m!=null){m.beginPath()}while(!T.isEnd()){T.nextCommand();switch(T.command.toUpperCase()){case"M":var aa=T.getAsCurrentPoint();T.addMarker(aa);ad.addPoint(aa.x,aa.y);if(m!=null){m.moveTo(aa.x,aa.y)}T.start=T.current;while(!T.isCommandOrEnd()){var aa=T.getAsCurrentPoint();T.addMarker(aa,T.start);ad.addPoint(aa.x,aa.y);if(m!=null){m.lineTo(aa.x,aa.y)}}break;case"L":while(!T.isCommandOrEnd()){var c=T.current;var aa=T.getAsCurrentPoint();T.addMarker(aa,c);ad.addPoint(aa.x,aa.y);if(m!=null){m.lineTo(aa.x,aa.y)}}break;case"H":while(!T.isCommandOrEnd()){var p=new a.Point((T.isRelativeCommand()?T.current.x:0)+T.getScalar(),T.current.y);T.addMarker(p,T.current);T.current=p;ad.addPoint(T.current.x,T.current.y);if(m!=null){m.lineTo(T.current.x,T.current.y)}}break;case"V":while(!T.isCommandOrEnd()){var p=new a.Point(T.current.x,(T.isRelativeCommand()?T.current.y:0)+T.getScalar());T.addMarker(p,T.current);T.current=p;ad.addPoint(T.current.x,T.current.y);if(m!=null){m.lineTo(T.current.x,T.current.y)}}break;case"C":while(!T.isCommandOrEnd()){var v=T.current;var l=T.getPoint();var u=T.getAsControlPoint();var ab=T.getAsCurrentPoint();T.addMarker(ab,u,l);ad.addBezierCurve(v.x,v.y,l.x,l.y,u.x,u.y,ab.x,ab.y);if(m!=null){m.bezierCurveTo(l.x,l.y,u.x,u.y,ab.x,ab.y)}}break;case"S":while(!T.isCommandOrEnd()){var v=T.current;var l=T.getReflectedControlPoint();var u=T.getAsControlPoint();var ab=T.getAsCurrentPoint();T.addMarker(ab,u,l);ad.addBezierCurve(v.x,v.y,l.x,l.y,u.x,u.y,ab.x,ab.y);if(m!=null){m.bezierCurveTo(l.x,l.y,u.x,u.y,ab.x,ab.y)}}break;case"Q":while(!T.isCommandOrEnd()){var v=T.current;var u=T.getAsControlPoint();var ab=T.getAsCurrentPoint();T.addMarker(ab,u,u);ad.addQuadraticCurve(v.x,v.y,u.x,u.y,ab.x,ab.y);if(m!=null){m.quadraticCurveTo(u.x,u.y,ab.x,ab.y)}}break;case"T":while(!T.isCommandOrEnd()){var v=T.current;var u=T.getReflectedControlPoint();T.control=u;var ab=T.getAsCurrentPoint();T.addMarker(ab,u,u);ad.addQuadraticCurve(v.x,v.y,u.x,u.y,ab.x,ab.y);if(m!=null){m.quadraticCurveTo(u.x,u.y,ab.x,ab.y)}}break;case"A":while(!T.isCommandOrEnd()){var v=T.current;var e=T.getScalar();var ak=T.getScalar();var Q=T.getScalar()*(Math.PI/180);var ae=T.getScalar();var s=T.getScalar();var ab=T.getAsCurrentPoint();var R=new a.Point(Math.cos(Q)*(v.x-ab.x)/2+Math.sin(Q)*(v.y-ab.y)/2,-Math.sin(Q)*(v.x-ab.x)/2+Math.cos(Q)*(v.y-ab.y)/2);var S=Math.pow(R.x,2)/Math.pow(e,2)+Math.pow(R.y,2)/Math.pow(ak,2);if(S>1){e*=Math.sqrt(S);ak*=Math.sqrt(S)}var Z=(ae==s?-1:1)*Math.sqrt(((Math.pow(e,2)*Math.pow(ak,2))-(Math.pow(e,2)*Math.pow(R.y,2))-(Math.pow(ak,2)*Math.pow(R.x,2)))/(Math.pow(e,2)*Math.pow(R.y,2)+Math.pow(ak,2)*Math.pow(R.x,2)));if(isNaN(Z)){Z=0}var aj=new a.Point(Z*e*R.y/ak,Z*-ak*R.x/e);var ai=new a.Point((v.x+ab.x)/2+Math.cos(Q)*aj.x-Math.sin(Q)*aj.y,(v.y+ab.y)/2+Math.sin(Q)*aj.x+Math.cos(Q)*aj.y);var V=function(g){return Math.sqrt(Math.pow(g[0],2)+Math.pow(g[1],2))};var ag=function(g,h){return(g[0]*h[0]+g[1]*h[1])/(V(g)*V(h))};var X=function(g,h){return(g[0]*h[1]<g[1]*h[0]?-1:1)*Math.acos(ag(g,h))};var ac=X([1,0],[(R.x-aj.x)/e,(R.y-aj.y)/ak]);var r=[(R.x-aj.x)/e,(R.y-aj.y)/ak];var af=[(-R.x-aj.x)/e,(-R.y-aj.y)/ak];var Y=X(r,af);if(ag(r,af)<=-1){Y=Math.PI}if(ag(r,af)>=1){Y=0}if(s==0&&Y>0){Y=Y-2*Math.PI}if(s==1&&Y<0){Y=Y+2*Math.PI}var U=new a.Point(ai.x-e*Math.cos((ac+Y)/2),ai.y-ak*Math.sin((ac+Y)/2));T.addMarkerAngle(U,(ac+Y)/2+(s==0?1:-1)*Math.PI/2);T.addMarkerAngle(ab,Y+(s==0?1:-1)*Math.PI/2);ad.addPoint(ab.x,ab.y);if(m!=null){var ag=e>ak?e:ak;var W=e>ak?1:e/ak;var ah=e>ak?ak/e:1;m.translate(ai.x,ai.y);m.rotate(Q);m.scale(W,ah);m.arc(0,0,ag,ac,ac+Y,1-s);m.scale(1/W,1/ah);m.rotate(-Q);m.translate(-ai.x,-ai.y)}}break;case"Z":if(m!=null){m.closePath()}T.current=T.start}}return ad};this.getMarkers=function(){var j=this.PathParser.getMarkerPoints();var c=this.PathParser.getMarkerAngles();var e=[];for(var k=0;k<j.length;k++){e.push([j[k],c[k]])}return e}};a.Element.path.prototype=new a.Element.PathElementBase;a.Element.pattern=function(d){this.base=a.Element.ElementBase;this.base(d);this.createPattern=function(k,j){var h=new a.Element.svg();h.attributes.viewBox=new a.Property("viewBox",this.attribute("viewBox").value);h.attributes.x=new a.Property("x",this.attribute("x").value);h.attributes.y=new a.Property("y",this.attribute("y").value);h.attributes.width=new a.Property("width",this.attribute("width").value);h.attributes.height=new a.Property("height",this.attribute("height").value);h.children=this.children;var c=document.createElement("canvas");c.width=this.attribute("width").Length.toPixels("x");c.height=this.attribute("height").Length.toPixels("y");h.render(c.getContext("2d"));return k.createPattern(c,"repeat")}};a.Element.pattern.prototype=new a.Element.ElementBase;a.Element.marker=function(d){this.base=a.Element.ElementBase;this.base(d);this.baseRender=this.render;this.render=function(j,k,c){j.translate(k.x,k.y);if(this.attribute("orient").valueOrDefault("auto")=="auto"){j.rotate(c)}if(this.attribute("markerUnits").valueOrDefault("strokeWidth")=="strokeWidth"){j.scale(j.lineWidth,j.lineWidth)}j.save();var h=new a.Element.svg();h.attributes.viewBox=new a.Property("viewBox",this.attribute("viewBox").value);h.attributes.refX=new a.Property("refX",this.attribute("refX").value);h.attributes.refY=new a.Property("refY",this.attribute("refY").value);h.attributes.width=new a.Property("width",this.attribute("markerWidth").value);h.attributes.height=new a.Property("height",this.attribute("markerHeight").value);h.attributes.fill=new a.Property("fill",this.attribute("fill").valueOrDefault("black"));h.attributes.stroke=new a.Property("stroke",this.attribute("stroke").valueOrDefault("none"));h.children=this.children;h.render(j);j.restore();if(this.attribute("markerUnits").valueOrDefault("strokeWidth")=="strokeWidth"){j.scale(1/j.lineWidth,1/j.lineWidth)}if(this.attribute("orient").valueOrDefault("auto")=="auto"){j.rotate(-c)}j.translate(-k.x,-k.y)}};a.Element.marker.prototype=new a.Element.ElementBase;a.Element.defs=function(d){this.base=a.Element.ElementBase;this.base(d);this.render=function(c){}};a.Element.defs.prototype=new a.Element.ElementBase;a.Element.GradientBase=function(g){this.base=a.Element.ElementBase;this.base(g);this.gradientUnits=this.attribute("gradientUnits").valueOrDefault("objectBoundingBox");this.stops=[];for(var h=0;h<this.children.length;h++){var f=this.children[h];this.stops.push(f)}this.getGradient=function(){};this.createGradient=function(e,d){var s=this;if(this.attribute("xlink:href").hasValue()){s=this.attribute("xlink:href").Definition.getDefinition()}var y=this.getGradient(e,d);for(var c=0;c<s.stops.length;c++){y.addColorStop(s.stops[c].offset,s.stops[c].color)}if(this.attribute("gradientTransform").hasValue()){var w=a.ViewPort.viewPorts[0];var v=new a.Element.rect();v.attributes.x=new a.Property("x",-a.MAX_VIRTUAL_PIXELS/3);v.attributes.y=new a.Property("y",-a.MAX_VIRTUAL_PIXELS/3);v.attributes.width=new a.Property("width",a.MAX_VIRTUAL_PIXELS);v.attributes.height=new a.Property("height",a.MAX_VIRTUAL_PIXELS);var t=new a.Element.g();t.attributes.transform=new a.Property("transform",this.attribute("gradientTransform").value);t.children=[v];var u=new a.Element.svg();u.attributes.x=new a.Property("x",0);u.attributes.y=new a.Property("y",0);u.attributes.width=new a.Property("width",w.width);u.attributes.height=new a.Property("height",w.height);u.children=[t];var x=document.createElement("canvas");x.width=w.width;x.height=w.height;var r=x.getContext("2d");r.fillStyle=y;u.render(r);return r.createPattern(x,"no-repeat")}return y}};a.Element.GradientBase.prototype=new a.Element.ElementBase;a.Element.linearGradient=function(d){this.base=a.Element.GradientBase;this.base(d);this.getGradient=function(m,o){var c=o.getBoundingBox();var q=(this.gradientUnits=="objectBoundingBox"?c.x()+c.width()*this.attribute("x1").numValue():this.attribute("x1").Length.toPixels("x"));var n=(this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("y1").numValue():this.attribute("y1").Length.toPixels("y"));var l=(this.gradientUnits=="objectBoundingBox"?c.x()+c.width()*this.attribute("x2").numValue():this.attribute("x2").Length.toPixels("x"));var p=(this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("y2").numValue():this.attribute("y2").Length.toPixels("y"));return m.createLinearGradient(q,n,l,p)}};a.Element.linearGradient.prototype=new a.Element.GradientBase;a.Element.radialGradient=function(d){this.base=a.Element.GradientBase;this.base(d);this.getGradient=function(c,m){var o=m.getBoundingBox();var n=(this.gradientUnits=="objectBoundingBox"?o.x()+o.width()*this.attribute("cx").numValue():this.attribute("cx").Length.toPixels("x"));var s=(this.gradientUnits=="objectBoundingBox"?o.y()+o.height()*this.attribute("cy").numValue():this.attribute("cy").Length.toPixels("y"));var p=n;var r=s;if(this.attribute("fx").hasValue()){p=(this.gradientUnits=="objectBoundingBox"?o.x()+o.width()*this.attribute("fx").numValue():this.attribute("fx").Length.toPixels("x"))}if(this.attribute("fy").hasValue()){r=(this.gradientUnits=="objectBoundingBox"?o.y()+o.height()*this.attribute("fy").numValue():this.attribute("fy").Length.toPixels("y"))}var q=(this.gradientUnits=="objectBoundingBox"?(o.width()+o.height())/2*this.attribute("r").numValue():this.attribute("r").Length.toPixels());return c.createRadialGradient(p,r,0,n,s,q)}};a.Element.radialGradient.prototype=new a.Element.GradientBase;a.Element.stop=function(e){this.base=a.Element.ElementBase;this.base(e);this.offset=this.attribute("offset").numValue();var f=this.style("stop-color");if(this.style("stop-opacity").hasValue()){f=f.Color.addOpacity(this.style("stop-opacity").value)}this.color=f.value};a.Element.stop.prototype=new a.Element.ElementBase;a.Element.AnimateBase=function(d){this.base=a.Element.ElementBase;this.base(d);a.Animations.push(this);this.duration=0;this.begin=this.attribute("begin").Time.toMilliseconds();this.maxDuration=this.begin+this.attribute("dur").Time.toMilliseconds();this.getProperty=function(){var c=this.attribute("attributeType").value;var f=this.attribute("attributeName").value;if(c=="CSS"){return this.parent.style(f,true)}return this.parent.attribute(f,true)};this.initialValue=null;this.removed=false;this.calcValue=function(){return""};this.update=function(c){if(this.initialValue==null){this.initialValue=this.getProperty().value}if(this.duration>this.maxDuration){if(this.attribute("repeatCount").value=="indefinite"){this.duration=0}else{if(this.attribute("fill").valueOrDefault("remove")=="remove"&&!this.removed){this.removed=true;this.getProperty().value=this.initialValue;return true}else{return false}}}this.duration=this.duration+c;var k=false;if(this.begin<this.duration){var h=this.calcValue();if(this.attribute("type").hasValue()){var j=this.attribute("type").value;h=j+"("+h+")"}this.getProperty().value=h;k=true}return k};this.progress=function(){return((this.duration-this.begin)/(this.maxDuration-this.begin))}};a.Element.AnimateBase.prototype=new a.Element.ElementBase;a.Element.animate=function(d){this.base=a.Element.AnimateBase;this.base(d);this.calcValue=function(){var c=this.attribute("from").numValue();var f=this.attribute("to").numValue();return c+(f-c)*this.progress()}};a.Element.animate.prototype=new a.Element.AnimateBase;a.Element.animateColor=function(d){this.base=a.Element.AnimateBase;this.base(d);this.calcValue=function(){var c=new RGBColor(this.attribute("from").value);var g=new RGBColor(this.attribute("to").value);if(c.ok&&g.ok){var k=c.r+(g.r-c.r)*this.progress();var l=c.g+(g.g-c.g)*this.progress();var m=c.b+(g.b-c.b)*this.progress();return"rgb("+parseInt(k,10)+","+parseInt(l,10)+","+parseInt(m,10)+")"}return this.attribute("from").value}};a.Element.animateColor.prototype=new a.Element.AnimateBase;a.Element.animateTransform=function(d){this.base=a.Element.animate;this.base(d)};a.Element.animateTransform.prototype=new a.Element.animate;a.Element.font=function(g){this.base=a.Element.ElementBase;this.base(g);this.horizAdvX=this.attribute("horiz-adv-x").numValue();this.isRTL=false;this.isArabic=false;this.fontFace=null;this.missingGlyph=null;this.glyphs=[];for(var h=0;h<this.children.length;h++){var f=this.children[h];if(f.type=="font-face"){this.fontFace=f;if(f.style("font-family").hasValue()){a.Definitions[f.style("font-family").value]=this}}else{if(f.type=="missing-glyph"){this.missingGlyph=f}else{if(f.type=="glyph"){if(f.arabicForm!=""){this.isRTL=true;this.isArabic=true;if(typeof(this.glyphs[f.unicode])=="undefined"){this.glyphs[f.unicode]=[]}this.glyphs[f.unicode][f.arabicForm]=f}else{this.glyphs[f.unicode]=f}}}}}};a.Element.font.prototype=new a.Element.ElementBase;a.Element.fontface=function(d){this.base=a.Element.ElementBase;this.base(d);this.ascent=this.attribute("ascent").value;this.descent=this.attribute("descent").value;this.unitsPerEm=this.attribute("units-per-em").numValue()};a.Element.fontface.prototype=new a.Element.ElementBase;a.Element.missingglyph=function(d){this.base=a.Element.path;this.base(d);this.horizAdvX=0};a.Element.missingglyph.prototype=new a.Element.path;a.Element.glyph=function(d){this.base=a.Element.path;this.base(d);this.horizAdvX=this.attribute("horiz-adv-x").numValue();this.unicode=this.attribute("unicode").value;this.arabicForm=this.attribute("arabic-form").value};a.Element.glyph.prototype=new a.Element.path;a.Element.text=function(f){this.base=a.Element.RenderedElementBase;this.base(f);if(f!=null){this.children=[];for(var g=0;g<f.childNodes.length;g++){var h=f.childNodes[g];if(h.nodeType==1){this.addChild(h,true)}else{if(h.nodeType==3){this.addChild(new a.Element.tspan(h),false)}}}}this.baseSetContext=this.setContext;this.setContext=function(c){this.baseSetContext(c);if(this.style("dominant-baseline").hasValue()){c.textBaseline=this.style("dominant-baseline").value}if(this.style("alignment-baseline").hasValue()){c.textBaseline=this.style("alignment-baseline").value}};this.renderChildren=function(s){var e=this.style("text-anchor").valueOrDefault("start");var t=this.attribute("x").Length.toPixels("x");var u=this.attribute("y").Length.toPixels("y");for(var w=0;w<this.children.length;w++){var j=this.children[w];if(j.attribute("x").hasValue()){j.x=j.attribute("x").Length.toPixels("x")}else{if(j.attribute("dx").hasValue()){t+=j.attribute("dx").Length.toPixels("x")}j.x=t}var v=j.measureText(s);if(e!="start"&&(w==0||j.attribute("x").hasValue())){var r=v;for(var c=w+1;c<this.children.length;c++){var d=this.children[c];if(d.attribute("x").hasValue()){break}r+=d.measureText(s)}j.x-=(e=="end"?r:r/2)}t=j.x+v;if(j.attribute("y").hasValue()){j.y=j.attribute("y").Length.toPixels("y")}else{if(j.attribute("dy").hasValue()){u+=j.attribute("dy").Length.toPixels("y")}j.y=u}u=j.y;j.render(s)}}};a.Element.text.prototype=new a.Element.RenderedElementBase;a.Element.TextElementBase=function(d){this.base=a.Element.RenderedElementBase;this.base(d);this.getGlyph=function(c,k,o){var n=k[o];var m=null;if(c.isArabic){var l="isolated";if((o==0||k[o-1]==" ")&&o<k.length-2&&k[o+1]!=" "){l="terminal"}if(o>0&&k[o-1]!=" "&&o<k.length-2&&k[o+1]!=" "){l="medial"}if(o>0&&k[o-1]!=" "&&(o==k.length-1||k[o+1]==" ")){l="initial"}if(typeof(c.glyphs[n])!="undefined"){m=c.glyphs[n][l];if(m==null&&c.glyphs[n].type=="glyph"){m=c.glyphs[n]}}}else{m=c.glyphs[n]}if(m==null){m=c.missingGlyph}return m};this.renderChildren=function(u){var w=this.parent.style("font-family").Definition.getDefinition();if(w!=null){var t=this.parent.style("font-size").numValueOrDefault(a.Font.Parse(a.ctx.font).fontSize);var p=this.parent.style("font-style").valueOrDefault(a.Font.Parse(a.ctx.font).fontStyle);var v=this.getText();if(w.isRTL){v=v.split("").reverse().join("")}var s=a.ToNumberArray(this.parent.attribute("dx").value);for(var o=0;o<v.length;o++){var c=this.getGlyph(w,v,o);var q=t/w.fontFace.unitsPerEm;u.translate(this.x,this.y);u.scale(q,-q);var r=u.lineWidth;u.lineWidth=u.lineWidth*w.fontFace.unitsPerEm/t;if(p=="italic"){u.transform(1,0,0.4,1,0,0)}c.render(u);if(p=="italic"){u.transform(1,0,-0.4,1,0,0)}u.lineWidth=r;u.scale(1/q,-1/q);u.translate(-this.x,-this.y);this.x+=t*(c.horizAdvX||w.horizAdvX)/w.fontFace.unitsPerEm;if(typeof(s[o])!="undefined"&&!isNaN(s[o])){this.x+=s[o]}}return}if(u.strokeStyle!=""){u.strokeText(a.compressSpaces(this.getText()),this.x,this.y)}if(u.fillStyle!=""){u.fillText(a.compressSpaces(this.getText()),this.x,this.y)}};this.getText=function(){};this.measureText=function(u){var w=this.parent.style("font-family").Definition.getDefinition();if(w!=null){var t=this.parent.style("font-size").numValueOrDefault(a.Font.Parse(a.ctx.font).fontSize);var q=0;var v=this.getText();if(w.isRTL){v=v.split("").reverse().join("")}var s=a.ToNumberArray(this.parent.attribute("dx").value);for(var o=0;o<v.length;o++){var c=this.getGlyph(w,v,o);q+=(c.horizAdvX||w.horizAdvX)*t/w.fontFace.unitsPerEm;if(typeof(s[o])!="undefined"&&!isNaN(s[o])){q+=s[o]}}return q}var r=a.compressSpaces(this.getText());if(!u.measureText){return r.length*10}u.save();this.setContext(u);var p=u.measureText(r).width;u.restore();return p}};a.Element.TextElementBase.prototype=new a.Element.RenderedElementBase;a.Element.tspan=function(d){this.base=a.Element.TextElementBase;this.base(d);this.text=d.nodeType==3?d.nodeValue:d.childNodes.length>0?d.childNodes[0].nodeValue:d.text;this.getText=function(){return this.text}};a.Element.tspan.prototype=new a.Element.TextElementBase;a.Element.tref=function(d){this.base=a.Element.TextElementBase;this.base(d);this.getText=function(){var c=this.attribute("xlink:href").Definition.getDefinition();if(c!=null){return c.children[0].getText()}}};a.Element.tref.prototype=new a.Element.TextElementBase;a.Element.a=function(e){this.base=a.Element.TextElementBase;this.base(e);this.hasText=true;for(var f=0;f<e.childNodes.length;f++){if(e.childNodes[f].nodeType!=3){this.hasText=false}}this.text=this.hasText?e.childNodes[0].nodeValue:"";this.getText=function(){return this.text};this.baseRenderChildren=this.renderChildren;this.renderChildren=function(g){if(this.hasText){this.baseRenderChildren(g);var c=new a.Property("fontSize",a.Font.Parse(a.ctx.font).fontSize);a.Mouse.checkBoundingBox(this,new a.BoundingBox(this.x,this.y-c.Length.toPixels("y"),this.x+this.measureText(g),this.y))}else{var d=new a.Element.g();d.children=this.children;d.parent=this;d.render(g)}};this.onclick=function(){window.open(this.attribute("xlink:href").value)};this.onmousemove=function(){a.ctx.canvas.style.cursor="pointer"}};a.Element.a.prototype=new a.Element.TextElementBase;a.Element.image=function(e){this.base=a.Element.RenderedElementBase;this.base(e);a.Images.push(this);this.img=document.createElement("img");this.loaded=false;var f=this;this.img.onload=function(){f.loaded=true};this.img.src=this.attribute("xlink:href").value;this.renderChildren=function(k){var l=this.attribute("x").Length.toPixels("x");var c=this.attribute("y").Length.toPixels("y");var d=this.attribute("width").Length.toPixels("x");var m=this.attribute("height").Length.toPixels("y");if(d==0||m==0){return}k.save();k.translate(l,c);a.AspectRatio(k,this.attribute("preserveAspectRatio").value,d,this.img.width,m,this.img.height,0,0);k.drawImage(this.img,0,0);k.restore()}};a.Element.image.prototype=new a.Element.RenderedElementBase;a.Element.g=function(d){this.base=a.Element.RenderedElementBase;this.base(d);this.getBoundingBox=function(){var c=new a.BoundingBox();for(var f=0;f<this.children.length;f++){c.addBoundingBox(this.children[f].getBoundingBox())}return c}};a.Element.g.prototype=new a.Element.RenderedElementBase;a.Element.symbol=function(d){this.base=a.Element.RenderedElementBase;this.base(d);this.baseSetContext=this.setContext;this.setContext=function(j){this.baseSetContext(j);if(this.attribute("viewBox").hasValue()){var h=a.ToNumberArray(this.attribute("viewBox").value);var k=h[0];var c=h[1];width=h[2];height=h[3];a.AspectRatio(j,this.attribute("preserveAspectRatio").value,this.attribute("width").Length.toPixels("x"),width,this.attribute("height").Length.toPixels("y"),height,k,c);a.ViewPort.SetCurrent(h[2],h[3])}}};a.Element.symbol.prototype=new a.Element.RenderedElementBase;a.Element.style=function(H){this.base=a.Element.ElementBase;this.base(H);var J=H.childNodes[0].nodeValue+(H.childNodes.length>1?H.childNodes[1].nodeValue:"");J=J.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"");J=a.compressSpaces(J);var k=J.split("}");for(var M=0;M<k.length;M++){if(a.trim(k[M])!=""){var K=k[M].split("{");var V=K[0].split(",");var Y=K[1].split(";");for(var G=0;G<V.length;G++){var Q=a.trim(V[G]);if(Q!=""){var W={};for(var L=0;L<Y.length;L++){var X=Y[L].indexOf(":");var I=Y[L].substr(0,X);var f=Y[L].substr(X+1,Y[L].length-X);if(I!=null&&f!=null){W[a.trim(I)]=new a.Property(a.trim(I),a.trim(f))}}a.Styles[Q]=W;if(Q=="@font-face"){var O=W["font-family"].value.replace(/"/g,"");var P=W.src.value.split(",");for(var N=0;N<P.length;N++){if(P[N].indexOf('format("svg")')>0){var S=P[N].indexOf("url");var T=P[N].indexOf(")",S);var U=P[N].substr(S+5,T-S-6);var j=a.parseXml(a.ajax(U));var R=j.getElementsByTagName("font");for(var F=0;F<R.length;F++){var s=a.CreateElement(R[F]);a.Definitions[O]=s}}}}}}}}};a.Element.style.prototype=new a.Element.ElementBase;a.Element.use=function(d){this.base=a.Element.RenderedElementBase;this.base(d);this.baseSetContext=this.setContext;this.setContext=function(c){this.baseSetContext(c);if(this.attribute("x").hasValue()){c.translate(this.attribute("x").Length.toPixels("x"),0)}if(this.attribute("y").hasValue()){c.translate(0,this.attribute("y").Length.toPixels("y"))}};this.getDefinition=function(){var c=this.attribute("xlink:href").Definition.getDefinition();if(this.attribute("width").hasValue()){c.attribute("width",true).value=this.attribute("width").value}if(this.attribute("height").hasValue()){c.attribute("height",true).value=this.attribute("height").value}return c};this.path=function(f){var c=this.getDefinition();if(c!=null){c.path(f)}};this.renderChildren=function(f){var c=this.getDefinition();if(c!=null){c.render(f)}}};a.Element.use.prototype=new a.Element.RenderedElementBase;a.Element.mask=function(d){this.base=a.Element.ElementBase;this.base(d);this.apply=function(s,y){var u=this.attribute("x").Length.toPixels("x");var w=this.attribute("y").Length.toPixels("y");var p=this.attribute("width").Length.toPixels("x");var t=this.attribute("height").Length.toPixels("y");var q=y.attribute("mask").value;y.attribute("mask").value="";var v=document.createElement("canvas");v.width=u+p;v.height=w+t;var r=v.getContext("2d");this.renderChildren(r);var x=document.createElement("canvas");x.width=u+p;x.height=w+t;var c=x.getContext("2d");y.render(c);c.globalCompositeOperation="destination-in";c.fillStyle=r.createPattern(v,"no-repeat");c.fillRect(0,0,u+p,w+t);s.fillStyle=c.createPattern(x,"no-repeat");s.fillRect(0,0,u+p,w+t);y.attribute("mask").value=q};this.render=function(c){}};a.Element.mask.prototype=new a.Element.ElementBase;a.Element.clipPath=function(d){this.base=a.Element.ElementBase;this.base(d);this.apply=function(f){for(var c=0;c<this.children.length;c++){if(this.children[c].path){this.children[c].path(f);f.clip()}}};this.render=function(c){}};a.Element.clipPath.prototype=new a.Element.ElementBase;a.Element.filter=function(d){this.base=a.Element.ElementBase;this.base(d);this.apply=function(E,c){var z=c.getBoundingBox();var v=this.attribute("x").Length.toPixels("x");var x=this.attribute("y").Length.toPixels("y");if(v==0||x==0){v=z.x1;x=z.y1}var C=this.attribute("width").Length.toPixels("x");var D=this.attribute("height").Length.toPixels("y");if(C==0||D==0){C=z.width();D=z.height()}var B=c.style("filter").value;c.style("filter").value="";var t=0.2;var u=t*C;var w=t*D;var y=document.createElement("canvas");y.width=C+2*u;y.height=D+2*w;var A=y.getContext("2d");A.translate(-v+u,-x+w);c.render(A);for(var s=0;s<this.children.length;s++){this.children[s].apply(A,0,0,C+2*u,D+2*w)}E.drawImage(y,0,0,C+2*u,D+2*w,v-u,x-w,C+2*u,D+2*w);c.style("filter",true).value=B};this.render=function(c){}};a.Element.filter.prototype=new a.Element.ElementBase;a.Element.feGaussianBlur=function(l){this.base=a.Element.ElementBase;this.base(l);function q(c){c=Math.max(c,0.01);var e=Math.ceil(c*4)+1;mask=[];for(var d=0;d<e;d++){mask[d]=Math.exp(-0.5*(d/c)*(d/c))}return mask}function o(e){var c=0;for(var d=1;d<e.length;d++){c+=Math.abs(e[d])}c=2*c+Math.abs(e[0]);for(var d=0;d<e.length;d++){e[d]/=c}return e}function m(f,c,d,g,C){for(var h=0;h<C;h++){for(var x=0;x<g;x++){var A=n(f,x,h,g,C,3)/255;for(var z=0;z<4;z++){var B=d[0]*(A==0?255:n(f,x,h,g,C,z))*(A==0||z==3?1:A);for(var e=1;e<d.length;e++){var y=n(f,Math.max(x-e,0),h,g,C,3)/255;var j=n(f,Math.min(x+e,g-1),h,g,C,3)/255;B+=d[e]*((y==0?255:n(f,Math.max(x-e,0),h,g,C,z))*(y==0||z==3?1:y)+(j==0?255:n(f,Math.min(x+e,g-1),h,g,C,z))*(j==0||z==3?1:j))}p(c,h,x,C,g,z,B)}}}}function n(f,g,c,d,h,e){return f[c*d*4+g*4+e]}function p(d,e,g,j,f,c,h){d[g*j*4+e*4+c]=h}function k(f,e,h,d){var c=f.getImageData(0,0,e,h);var g=q(d);g=o(g);tmp=[];m(c.data,tmp,g,e,h);m(tmp,c.data,g,h,e);f.clearRect(0,0,e,h);f.putImageData(c,0,0)}this.apply=function(c,d,f,g,e){k(c,g,e,this.attribute("stdDeviation").numValue())}};a.Element.filter.prototype=new a.Element.feGaussianBlur;a.Element.title=function(d){};a.Element.title.prototype=new a.Element.ElementBase;a.Element.desc=function(d){};a.Element.desc.prototype=new a.Element.ElementBase;a.Element.MISSING=function(d){console.log("ERROR: Element '"+d.nodeName+"' not yet implemented.")};a.Element.MISSING.prototype=new a.Element.ElementBase;a.CreateElement=function(g){var h=g.nodeName.replace(/^[^:]+:/,"");h=h.replace(/\-/g,"");var e=null;if(typeof(a.Element[h])!="undefined"){e=new a.Element[h](g)}else{e=new a.Element.MISSING(g)}e.type=g.nodeName;return e};a.load=function(f,e){a.loadXml(f,a.ajax(e))};a.loadXml=function(f,e){a.loadXmlDoc(f,a.parseXml(e))};a.loadXmlDoc=function(l,p){a.init(l);var o=function(c){var d=l.canvas;while(d){c.x-=d.offsetLeft;c.y-=d.offsetTop;d=d.offsetParent}if(window.scrollX){c.x+=window.scrollX}if(window.scrollY){c.y+=window.scrollY}return c};if(a.opts.ignoreMouse!=true){l.canvas.onclick=function(c){var d=o(new a.Point(c!=null?c.clientX:event.clientX,c!=null?c.clientY:event.clientY));a.Mouse.onclick(d.x,d.y)};l.canvas.onmousemove=function(c){var d=o(new a.Point(c!=null?c.clientX:event.clientX,c!=null?c.clientY:event.clientY));a.Mouse.onmousemove(d.x,d.y)}}var q=a.CreateElement(p.documentElement);q.root=true;var m=true;var n=function(){a.ViewPort.Clear();if(l.canvas.parentNode){a.ViewPort.SetCurrent(l.canvas.parentNode.clientWidth,l.canvas.parentNode.clientHeight)}if(a.opts.ignoreDimensions!=true){if(q.style("width").hasValue()){l.canvas.width=q.style("width").Length.toPixels("x");l.canvas.style.width=l.canvas.width+"px"}if(q.style("height").hasValue()){l.canvas.height=q.style("height").Length.toPixels("y");l.canvas.style.height=l.canvas.height+"px"}}var g=l.canvas.clientWidth||l.canvas.width;var c=l.canvas.clientHeight||l.canvas.height;a.ViewPort.SetCurrent(g,c);if(a.opts!=null&&a.opts.offsetX!=null){q.attribute("x",true).value=a.opts.offsetX}if(a.opts!=null&&a.opts.offsetY!=null){q.attribute("y",true).value=a.opts.offsetY}if(a.opts!=null&&a.opts.scaleWidth!=null&&a.opts.scaleHeight!=null){var f=1,d=1;if(q.attribute("width").hasValue()){f=q.attribute("width").Length.toPixels("x")/a.opts.scaleWidth}if(q.attribute("height").hasValue()){d=q.attribute("height").Length.toPixels("y")/a.opts.scaleHeight}q.attribute("width",true).value=a.opts.scaleWidth;q.attribute("height",true).value=a.opts.scaleHeight;q.attribute("viewBox",true).value="0 0 "+(g*f)+" "+(c*d);q.attribute("preserveAspectRatio",true).value="none"}if(a.opts.ignoreClear!=true){l.clearRect(0,0,g,c)}q.render(l);if(m){m=false;if(a.opts!=null&&typeof(a.opts.renderCallback)=="function"){a.opts.renderCallback()}}};var e=true;if(a.ImagesLoaded()){e=false;n()}a.intervalID=setInterval(function(){var c=false;if(e&&a.ImagesLoaded()){e=false;c=true}if(a.opts.ignoreMouse!=true){c=c|a.Mouse.hasEvents()}if(a.opts.ignoreAnimation!=true){for(var d=0;d<a.Animations.length;d++){c=c|a.Animations[d].update(1000/a.FRAMERATE)}}if(a.opts!=null&&typeof(a.opts.forceRedraw)=="function"){if(a.opts.forceRedraw()==true){c=true}}if(c){n();a.Mouse.runEvents()}},1000/a.FRAMERATE)};a.stop=function(){if(a.intervalID){clearInterval(a.intervalID)}};a.Mouse=new (function(){this.events=[];this.hasEvents=function(){return this.events.length!=0};this.onclick=function(f,e){this.events.push({type:"onclick",x:f,y:e,run:function(c){if(c.onclick){c.onclick()}}})};this.onmousemove=function(f,e){this.events.push({type:"onmousemove",x:f,y:e,run:function(c){if(c.onmousemove){c.onmousemove()}}})};this.eventElements=[];this.checkPath=function(h,k){for(var j=0;j<this.events.length;j++){var e=this.events[j];if(k.isPointInPath&&k.isPointInPath(e.x,e.y)){this.eventElements[j]=h}}};this.checkBoundingBox=function(j,e){for(var k=0;k<this.events.length;k++){var h=this.events[k];if(e.isPointInBox(h.x,h.y)){this.eventElements[k]=j}}};this.runEvents=function(){a.ctx.canvas.style.cursor="";for(var g=0;g<this.events.length;g++){var e=this.events[g];var h=this.eventElements[g];while(h){e.run(h);h=h.parent}}this.events=[];this.eventElements=[]}});return a}})();if(CanvasRenderingContext2D){CanvasRenderingContext2D.prototype.drawSvg=function(j,f,g,k,h){canvg(this.canvas,j,{ignoreMouse:true,ignoreAnimation:true,ignoreDimensions:true,ignoreClear:true,offsetX:f,offsetY:g,scaleWidth:k,scaleHeight:h})}}(function(v){var u,F="div",t="absolute",y="relative",x="hidden",D="visible",z="px",G=v.css,E=v.CanVGRenderer,A=v.SVGRenderer,r=v.extend,w=v.merge,s=v.addEvent,B=v.createElement,C=v.discardElement;r(E.prototype,A.prototype);r(E.prototype,{create:function(c,b,d,a){this.setContainer(b,d,a);this.configure(c)},setContainer:function(e,l,b){var j=e.style,h=e.parentNode,a=j.left,m=j.top,g=e.offsetWidth,f=e.offsetHeight,c,k={visibility:x,position:t};this.init.apply(this,[e,l,b]);c=B("canvas",{width:g,height:f},{position:y,left:a,top:m},e);this.canvas=c;this.ttLine=B(F,null,k,h);this.ttDiv=B(F,null,k,h);this.ttTimer=u;var d=B(F,{width:g,height:f},{visibility:x,left:a,top:m},h);this.hiddenSvg=d;d.appendChild(this.box)},configure:function(e){var b=this,f=e.options.tooltip,g=f.borderWidth,c=b.ttDiv,d=f.style,h=b.ttLine,a=parseInt(d.padding,10);d=w(d,{padding:a+z,"background-color":f.backgroundColor,"border-style":"solid","border-width":g+z,"border-radius":f.borderRadius+z});if(f.shadow){d=w(d,{"box-shadow":"1px 1px 3px gray","-webkit-box-shadow":"1px 1px 3px gray"})}G(c,d);G(h,{"border-left":"1px solid darkgray"});s(e,"tooltipRefresh",function(k){var m=e.container,n=m.offsetLeft,l=m.offsetTop,j;c.innerHTML=k.text;j=e.tooltip.getPosition(c.offsetWidth,c.offsetHeight,{plotX:k.x,plotY:k.y});G(c,{visibility:D,left:j.x+z,top:j.y+z,"border-color":k.borderColor});G(h,{visibility:D,left:n+k.x+z,top:l+e.plotTop+z,height:e.plotHeight+z});if(b.ttTimer!==u){clearTimeout(b.ttTimer)}b.ttTimer=setTimeout(function(){G(c,{visibility:x});G(h,{visibility:x})},3000)})},destroy:function(){var a=this;C(a.canvas);if(a.ttTimer!==u){clearTimeout(a.ttTimer)}C(a.ttLine);C(a.ttDiv);C(a.hiddenSvg);return A.prototype.destroy.apply(a)},color:function(b,a,c){if(b&&b.linearGradient){b=b.stops[b.stops.length-1][1]}return A.prototype.color.call(this,b,a,c)},draw:function(){var a=this;window.canvg(a.canvas,a.hiddenSvg.innerHTML)}})}(Highcharts));