hoeditor-web 3.0.13 → 3.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (("undefined"!==typeof self?self:this)["webpackChunkhoeditor"]=("undefined"!==typeof self?self:this)["webpackChunkhoeditor"]||[]).push([[935],{82772:function(h,g,d){"use strict";var f=d(82109),x=d(1702),b=d(41318).indexOf,P=d(9341),E=x([].indexOf),S=!!E&&1/E([1],1,-0)<0,w=P("indexOf");f({target:"Array",proto:!0,forced:S||!w},{indexOf:function indexOf(h){var g=arguments.length>1?arguments[1]:void 0;return S?E(this,h,g)||0:b(this,h,g)}})},85827:function(h,g,d){"use strict";var f=d(82109),x=d(53671).left,b=d(9341),P=d(7392),E=d(35268),S=b("reduce"),w=!E&&P>79&&P<83;f({target:"Array",proto:!0,forced:!S||w},{reduce:function reduce(h){var g=arguments.length;return x(this,h,g,g>1?arguments[1]:void 0)}})},65069:function(h,g,d){"use strict";var f=d(82109),x=d(1702),b=d(43157),P=x([].reverse),E=[1,2];f({target:"Array",proto:!0,forced:String(E)===String(E.reverse())},{reverse:function reverse(){return b(this)&&(this.length=this.length),P(this)}})},26131:function(h){h.exports=function(h){this.ok=!1,this.alpha=1,"#"==h.charAt(0)&&(h=h.substr(1,6)),h=h.replace(/ /g,""),h=h.toLowerCase();var g={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",rebeccapurple:"663399",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"};h=g[h]||h;for(var d=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(h){return[parseInt(h[1]),parseInt(h[2]),parseInt(h[3]),parseFloat(h[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(h){return[parseInt(h[1]),parseInt(h[2]),parseInt(h[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(h){return[parseInt(h[1],16),parseInt(h[2],16),parseInt(h[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(h){return[parseInt(h[1]+h[1],16),parseInt(h[2]+h[2],16),parseInt(h[3]+h[3],16)]}}],f=0;f<d.length;f++){var x=d[f].re,b=d[f].process,P=x.exec(h);if(P){var E=b(P);this.r=E[0],this.g=E[1],this.b=E[2],E.length>3&&(this.alpha=E[3]),this.ok=!0}}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.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var h=this.r.toString(16),g=this.g.toString(16),d=this.b.toString(16);return 1==h.length&&(h="0"+h),1==g.length&&(g="0"+g),1==d.length&&(d="0"+d),"#"+h+g+d},this.getHelpXML=function(){for(var h=new Array,f=0;f<d.length;f++)for(var x=d[f].example,b=0;b<x.length;b++)h[h.length]=x[b];for(var P in g)h[h.length]=P;var E=document.createElement("ul");E.setAttribute("id","rgbcolor-examples");for(f=0;f<h.length;f++)try{var S=document.createElement("li"),w=new RGBColor(h[f]),C=document.createElement("div");C.style.cssText="margin: 3px; border: 1px solid black; background:"+w.toHex()+"; color:"+w.toHex(),C.appendChild(document.createTextNode("test"));var A=document.createTextNode(" "+h[f]+" -> "+w.toRGB()+" -> "+w.toHex());S.appendChild(C),S.appendChild(A),E.appendChild(S)}catch(M){}return E}}},71935:function(h,g,d){"use strict";d.r(g),d.d(g,{AElement:function(){return AElement},AnimateColorElement:function(){return AnimateColorElement},AnimateElement:function(){return AnimateElement},AnimateTransformElement:function(){return AnimateTransformElement},BoundingBox:function(){return BoundingBox},CB1:function(){return CB1},CB2:function(){return CB2},CB3:function(){return CB3},CB4:function(){return CB4},Canvg:function(){return Canvg},CircleElement:function(){return CircleElement},ClipPathElement:function(){return ClipPathElement},DefsElement:function(){return DefsElement},DescElement:function(){return DescElement},Document:function(){return Document},Element:function(){return Element},EllipseElement:function(){return EllipseElement},FeColorMatrixElement:function(){return FeColorMatrixElement},FeCompositeElement:function(){return FeCompositeElement},FeDropShadowElement:function(){return FeDropShadowElement},FeGaussianBlurElement:function(){return FeGaussianBlurElement},FeMorphologyElement:function(){return FeMorphologyElement},FilterElement:function(){return FilterElement},Font:function(){return Font},FontElement:function(){return FontElement},FontFaceElement:function(){return FontFaceElement},GElement:function(){return GElement},GlyphElement:function(){return GlyphElement},GradientElement:function(){return GradientElement},ImageElement:function(){return ImageElement},LineElement:function(){return LineElement},LinearGradientElement:function(){return LinearGradientElement},MarkerElement:function(){return MarkerElement},MaskElement:function(){return MaskElement},Matrix:function(){return Matrix},MissingGlyphElement:function(){return MissingGlyphElement},Mouse:function(){return Mouse},PSEUDO_ZERO:function(){return Q},Parser:function(){return Parser},PathElement:function(){return PathElement},PathParser:function(){return PathParser},PatternElement:function(){return PatternElement},Point:function(){return Point},PolygonElement:function(){return PolygonElement},PolylineElement:function(){return PolylineElement},Property:function(){return Property},QB1:function(){return QB1},QB2:function(){return QB2},QB3:function(){return QB3},RadialGradientElement:function(){return RadialGradientElement},RectElement:function(){return RectElement},RenderedElement:function(){return RenderedElement},Rotate:function(){return Rotate},SVGElement:function(){return SVGElement},SVGFontLoader:function(){return SVGFontLoader},Scale:function(){return Scale},Screen:function(){return Screen},Skew:function(){return Skew},SkewX:function(){return SkewX},SkewY:function(){return SkewY},StopElement:function(){return StopElement},StyleElement:function(){return StyleElement},SymbolElement:function(){return SymbolElement},TRefElement:function(){return TRefElement},TSpanElement:function(){return TSpanElement},TextElement:function(){return TextElement},TextPathElement:function(){return TextPathElement},TitleElement:function(){return TitleElement},Transform:function(){return Transform},Translate:function(){return Translate},UnknownElement:function(){return UnknownElement},UseElement:function(){return UseElement},ViewPort:function(){return ViewPort},compressSpaces:function(){return compressSpaces},default:function(){return Canvg},getSelectorSpecificity:function(){return getSelectorSpecificity},normalizeAttributeName:function(){return normalizeAttributeName},normalizeColor:function(){return normalizeColor},parseExternalUrl:function(){return parseExternalUrl},presets:function(){return L},toNumbers:function(){return toNumbers},trimLeft:function(){return trimLeft},trimRight:function(){return trimRight},vectorMagnitude:function(){return vectorMagnitude},vectorsAngle:function(){return vectorsAngle},vectorsRatio:function(){return vectorsRatio}});d(88674);var f=d(49894),x=(d(4723),d(15306),d(23157),d(66992),d(33948),d(49888)),b=(d(85827),d(27852),d(23123),d(54087)),P=(d(73210),d(26131)),E=(d(82772),d(32023),d(65069),function(h,g){return(E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,g){h.__proto__=g}||function(h,g){for(var d in g)Object.prototype.hasOwnProperty.call(g,d)&&(h[d]=g[d])})(h,g)});function r(h,g){if("function"!=typeof g&&null!==g)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");function i(){this.constructor=h}E(h,g),h.prototype=null===g?Object.create(g):(i.prototype=g.prototype,new i)}function e(h){var g="";Array.isArray(h)||(h=[h]);for(var d=0;d<h.length;d++){var f=h[d];if(f.type===_.CLOSE_PATH)g+="z";else if(f.type===_.HORIZ_LINE_TO)g+=(f.relative?"h":"H")+f.x;else if(f.type===_.VERT_LINE_TO)g+=(f.relative?"v":"V")+f.y;else if(f.type===_.MOVE_TO)g+=(f.relative?"m":"M")+f.x+" "+f.y;else if(f.type===_.LINE_TO)g+=(f.relative?"l":"L")+f.x+" "+f.y;else if(f.type===_.CURVE_TO)g+=(f.relative?"c":"C")+f.x1+" "+f.y1+" "+f.x2+" "+f.y2+" "+f.x+" "+f.y;else if(f.type===_.SMOOTH_CURVE_TO)g+=(f.relative?"s":"S")+f.x2+" "+f.y2+" "+f.x+" "+f.y;else if(f.type===_.QUAD_TO)g+=(f.relative?"q":"Q")+f.x1+" "+f.y1+" "+f.x+" "+f.y;else if(f.type===_.SMOOTH_QUAD_TO)g+=(f.relative?"t":"T")+f.x+" "+f.y;else{if(f.type!==_.ARC)throw new Error('Unexpected command type "'+f.type+'" at index '+d+".");g+=(f.relative?"a":"A")+f.rX+" "+f.rY+" "+f.xRot+" "+ +f.lArcFlag+" "+ +f.sweepFlag+" "+f.x+" "+f.y}}return g}function i(h,g){var d=h[0],f=h[1];return[d*Math.cos(g)-f*Math.sin(g),d*Math.sin(g)+f*Math.cos(g)]}function a(){for(var h=[],g=0;g<arguments.length;g++)h[g]=arguments[g];for(var d=0;d<h.length;d++)if("number"!=typeof h[d])throw new Error("assertNumbers arguments["+d+"] is not a number. "+typeof h[d]+" == typeof "+h[d]);return!0}var S=Math.PI;function o(h,g,d){h.lArcFlag=0===h.lArcFlag?0:1,h.sweepFlag=0===h.sweepFlag?0:1;var f=h.rX,x=h.rY,b=h.x,P=h.y;f=Math.abs(h.rX),x=Math.abs(h.rY);var E=i([(g-b)/2,(d-P)/2],-h.xRot/180*S),w=E[0],C=E[1],A=Math.pow(w,2)/Math.pow(f,2)+Math.pow(C,2)/Math.pow(x,2);1<A&&(f*=Math.sqrt(A),x*=Math.sqrt(A)),h.rX=f,h.rY=x;var M=Math.pow(f,2)*Math.pow(C,2)+Math.pow(x,2)*Math.pow(w,2),N=(h.lArcFlag!==h.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(f,2)*Math.pow(x,2)-M)/M)),_=f*C/x*N,V=-x*w/f*N,k=i([_,V],h.xRot/180*S);h.cX=k[0]+(g+b)/2,h.cY=k[1]+(d+P)/2,h.phi1=Math.atan2((C-V)/x,(w-_)/f),h.phi2=Math.atan2((-C-V)/x,(-w-_)/f),0===h.sweepFlag&&h.phi2>h.phi1&&(h.phi2-=2*S),1===h.sweepFlag&&h.phi2<h.phi1&&(h.phi2+=2*S),h.phi1*=180/S,h.phi2*=180/S}function s(h,g,d){a(h,g,d);var f=h*h+g*g-d*d;if(0>f)return[];if(0===f)return[[h*d/(h*h+g*g),g*d/(h*h+g*g)]];var x=Math.sqrt(f);return[[(h*d+g*x)/(h*h+g*g),(g*d-h*x)/(h*h+g*g)],[(h*d-g*x)/(h*h+g*g),(g*d+h*x)/(h*h+g*g)]]}var w,C=Math.PI/180;function c(h,g,d){return(1-d)*h+d*g}function y(h,g,d,f){return h+Math.cos(f/180*S)*g+Math.sin(f/180*S)*d}function p(h,g,d,f){var x=1e-6,b=g-h,P=d-g,E=3*b+3*(f-d)-6*P,S=6*(P-b),w=3*b;return Math.abs(E)<x?[-w/S]:function(h,g,d){void 0===d&&(d=1e-6);var f=h*h/4-g;if(f<-d)return[];if(f<=d)return[-h/2];var x=Math.sqrt(f);return[-h/2-x,-h/2+x]}(S/E,w/E,x)}function m(h,g,d,f,x){var b=1-x;return h*(b*b*b)+g*(3*b*b*x)+d*(3*b*x*x)+f*(x*x*x)}!function(h){function r(){return u((function(h,g,d){return h.relative&&(void 0!==h.x1&&(h.x1+=g),void 0!==h.y1&&(h.y1+=d),void 0!==h.x2&&(h.x2+=g),void 0!==h.y2&&(h.y2+=d),void 0!==h.x&&(h.x+=g),void 0!==h.y&&(h.y+=d),h.relative=!1),h}))}function e(){var h=NaN,g=NaN,d=NaN,f=NaN;return u((function(x,b,P){return x.type&_.SMOOTH_CURVE_TO&&(x.type=_.CURVE_TO,h=isNaN(h)?b:h,g=isNaN(g)?P:g,x.x1=x.relative?b-h:2*b-h,x.y1=x.relative?P-g:2*P-g),x.type&_.CURVE_TO?(h=x.relative?b+x.x2:x.x2,g=x.relative?P+x.y2:x.y2):(h=NaN,g=NaN),x.type&_.SMOOTH_QUAD_TO&&(x.type=_.QUAD_TO,d=isNaN(d)?b:d,f=isNaN(f)?P:f,x.x1=x.relative?b-d:2*b-d,x.y1=x.relative?P-f:2*P-f),x.type&_.QUAD_TO?(d=x.relative?b+x.x1:x.x1,f=x.relative?P+x.y1:x.y1):(d=NaN,f=NaN),x}))}function n(){var h=NaN,g=NaN;return u((function(d,f,x){if(d.type&_.SMOOTH_QUAD_TO&&(d.type=_.QUAD_TO,h=isNaN(h)?f:h,g=isNaN(g)?x:g,d.x1=d.relative?f-h:2*f-h,d.y1=d.relative?x-g:2*x-g),d.type&_.QUAD_TO){h=d.relative?f+d.x1:d.x1,g=d.relative?x+d.y1:d.y1;var b=d.x1,P=d.y1;d.type=_.CURVE_TO,d.x1=((d.relative?0:f)+2*b)/3,d.y1=((d.relative?0:x)+2*P)/3,d.x2=(d.x+2*b)/3,d.y2=(d.y+2*P)/3}else h=NaN,g=NaN;return d}))}function u(h){var g=0,d=0,f=NaN,x=NaN;return function(b){if(isNaN(f)&&!(b.type&_.MOVE_TO))throw new Error("path must start with moveto");var P=h(b,g,d,f,x);return b.type&_.CLOSE_PATH&&(g=f,d=x),void 0!==b.x&&(g=b.relative?g+b.x:b.x),void 0!==b.y&&(d=b.relative?d+b.y:b.y),b.type&_.MOVE_TO&&(f=g,x=d),P}}function O(h,g,d,f,x,b){return a(h,g,d,f,x,b),u((function(P,E,S,w){var C=P.x1,A=P.x2,M=P.relative&&!isNaN(w),N=void 0!==P.x?P.x:M?0:E,V=void 0!==P.y?P.y:M?0:S;function l(h){return h*h}P.type&_.HORIZ_LINE_TO&&0!==g&&(P.type=_.LINE_TO,P.y=P.relative?0:S),P.type&_.VERT_LINE_TO&&0!==d&&(P.type=_.LINE_TO,P.x=P.relative?0:E),void 0!==P.x&&(P.x=P.x*h+V*d+(M?0:x)),void 0!==P.y&&(P.y=N*g+P.y*f+(M?0:b)),void 0!==P.x1&&(P.x1=P.x1*h+P.y1*d+(M?0:x)),void 0!==P.y1&&(P.y1=C*g+P.y1*f+(M?0:b)),void 0!==P.x2&&(P.x2=P.x2*h+P.y2*d+(M?0:x)),void 0!==P.y2&&(P.y2=A*g+P.y2*f+(M?0:b));var k=h*f-g*d;if(void 0!==P.xRot&&(1!==h||0!==g||0!==d||1!==f))if(0===k)delete P.rX,delete P.rY,delete P.xRot,delete P.lArcFlag,delete P.sweepFlag,P.type=_.LINE_TO;else{var R=P.xRot*Math.PI/180,B=Math.sin(R),L=Math.cos(R),D=1/l(P.rX),F=1/l(P.rY),z=l(L)*D+l(B)*F,U=2*B*L*(D-F),X=l(B)*D+l(L)*F,Y=z*f*f-U*g*f+X*g*g,G=U*(h*f+g*d)-2*(z*d*f+X*h*g),j=z*d*d-U*h*d+X*h*h,Q=(Math.atan2(G,Y-j)+Math.PI)%Math.PI/2,q=Math.sin(Q),W=Math.cos(Q);P.rX=Math.abs(k)/Math.sqrt(Y*l(W)+G*q*W+j*l(q)),P.rY=Math.abs(k)/Math.sqrt(Y*l(q)-G*q*W+j*l(W)),P.xRot=180*Q/Math.PI}return void 0!==P.sweepFlag&&0>k&&(P.sweepFlag=+!P.sweepFlag),P}))}function l(){return function(h){var g={};for(var d in h)g[d]=h[d];return g}}h.ROUND=function(h){function r(g){return Math.round(g*h)/h}return void 0===h&&(h=1e13),a(h),function(h){return void 0!==h.x1&&(h.x1=r(h.x1)),void 0!==h.y1&&(h.y1=r(h.y1)),void 0!==h.x2&&(h.x2=r(h.x2)),void 0!==h.y2&&(h.y2=r(h.y2)),void 0!==h.x&&(h.x=r(h.x)),void 0!==h.y&&(h.y=r(h.y)),void 0!==h.rX&&(h.rX=r(h.rX)),void 0!==h.rY&&(h.rY=r(h.rY)),h}},h.TO_ABS=r,h.TO_REL=function(){return u((function(h,g,d){return h.relative||(void 0!==h.x1&&(h.x1-=g),void 0!==h.y1&&(h.y1-=d),void 0!==h.x2&&(h.x2-=g),void 0!==h.y2&&(h.y2-=d),void 0!==h.x&&(h.x-=g),void 0!==h.y&&(h.y-=d),h.relative=!0),h}))},h.NORMALIZE_HVZ=function(h,g,d){return void 0===h&&(h=!0),void 0===g&&(g=!0),void 0===d&&(d=!0),u((function(f,x,b,P,E){if(isNaN(P)&&!(f.type&_.MOVE_TO))throw new Error("path must start with moveto");return g&&f.type&_.HORIZ_LINE_TO&&(f.type=_.LINE_TO,f.y=f.relative?0:b),d&&f.type&_.VERT_LINE_TO&&(f.type=_.LINE_TO,f.x=f.relative?0:x),h&&f.type&_.CLOSE_PATH&&(f.type=_.LINE_TO,f.x=f.relative?P-x:P,f.y=f.relative?E-b:E),f.type&_.ARC&&(0===f.rX||0===f.rY)&&(f.type=_.LINE_TO,delete f.rX,delete f.rY,delete f.xRot,delete f.lArcFlag,delete f.sweepFlag),f}))},h.NORMALIZE_ST=e,h.QT_TO_C=n,h.INFO=u,h.SANITIZE=function(h){void 0===h&&(h=0),a(h);var g=NaN,d=NaN,f=NaN,x=NaN;return u((function(b,P,E,S,w){var C=Math.abs,A=!1,M=0,N=0;if(b.type&_.SMOOTH_CURVE_TO&&(M=isNaN(g)?0:P-g,N=isNaN(d)?0:E-d),b.type&(_.CURVE_TO|_.SMOOTH_CURVE_TO)?(g=b.relative?P+b.x2:b.x2,d=b.relative?E+b.y2:b.y2):(g=NaN,d=NaN),b.type&_.SMOOTH_QUAD_TO?(f=isNaN(f)?P:2*P-f,x=isNaN(x)?E:2*E-x):b.type&_.QUAD_TO?(f=b.relative?P+b.x1:b.x1,x=b.relative?E+b.y1:b.y2):(f=NaN,x=NaN),b.type&_.LINE_COMMANDS||b.type&_.ARC&&(0===b.rX||0===b.rY||!b.lArcFlag)||b.type&_.CURVE_TO||b.type&_.SMOOTH_CURVE_TO||b.type&_.QUAD_TO||b.type&_.SMOOTH_QUAD_TO){var V=void 0===b.x?0:b.relative?b.x:b.x-P,k=void 0===b.y?0:b.relative?b.y:b.y-E;M=isNaN(f)?void 0===b.x1?M:b.relative?b.x:b.x1-P:f-P,N=isNaN(x)?void 0===b.y1?N:b.relative?b.y:b.y1-E:x-E;var R=void 0===b.x2?0:b.relative?b.x:b.x2-P,B=void 0===b.y2?0:b.relative?b.y:b.y2-E;C(V)<=h&&C(k)<=h&&C(M)<=h&&C(N)<=h&&C(R)<=h&&C(B)<=h&&(A=!0)}return b.type&_.CLOSE_PATH&&C(P-S)<=h&&C(E-w)<=h&&(A=!0),A?[]:b}))},h.MATRIX=O,h.ROTATE=function(h,g,d){void 0===g&&(g=0),void 0===d&&(d=0),a(h,g,d);var f=Math.sin(h),x=Math.cos(h);return O(x,f,-f,x,g-g*x+d*f,d-g*f-d*x)},h.TRANSLATE=function(h,g){return void 0===g&&(g=0),a(h,g),O(1,0,0,1,h,g)},h.SCALE=function(h,g){return void 0===g&&(g=h),a(h,g),O(h,0,0,g,0,0)},h.SKEW_X=function(h){return a(h),O(1,0,Math.atan(h),1,0,0)},h.SKEW_Y=function(h){return a(h),O(1,Math.atan(h),0,1,0,0)},h.X_AXIS_SYMMETRY=function(h){return void 0===h&&(h=0),a(h),O(-1,0,0,1,h,0)},h.Y_AXIS_SYMMETRY=function(h){return void 0===h&&(h=0),a(h),O(1,0,0,-1,0,h)},h.A_TO_C=function(){return u((function(h,g,d){return _.ARC===h.type?function(h,g,d){var f,x,b,P;h.cX||o(h,g,d);for(var E=Math.min(h.phi1,h.phi2),S=Math.max(h.phi1,h.phi2)-E,w=Math.ceil(S/90),A=new Array(w),M=g,N=d,V=0;V<w;V++){var k=c(h.phi1,h.phi2,V/w),R=c(h.phi1,h.phi2,(V+1)/w),B=R-k,L=4/3*Math.tan(B*C/4),D=[Math.cos(k*C)-L*Math.sin(k*C),Math.sin(k*C)+L*Math.cos(k*C)],F=D[0],z=D[1],U=[Math.cos(R*C),Math.sin(R*C)],X=U[0],Y=U[1],G=[X+L*Math.sin(R*C),Y-L*Math.cos(R*C)],j=G[0],Q=G[1];A[V]={relative:h.relative,type:_.CURVE_TO};var H=function(g,d){var f=i([g*h.rX,d*h.rY],h.xRot),x=f[0],b=f[1];return[h.cX+x,h.cY+b]};f=H(F,z),A[V].x1=f[0],A[V].y1=f[1],x=H(j,Q),A[V].x2=x[0],A[V].y2=x[1],b=H(X,Y),A[V].x=b[0],A[V].y=b[1],h.relative&&(A[V].x1-=M,A[V].y1-=N,A[V].x2-=M,A[V].y2-=N,A[V].x-=M,A[V].y-=N),M=(P=[A[V].x,A[V].y])[0],N=P[1]}return A}(h,h.relative?0:g,h.relative?0:d):h}))},h.ANNOTATE_ARCS=function(){return u((function(h,g,d){return h.relative&&(g=0,d=0),_.ARC===h.type&&o(h,g,d),h}))},h.CLONE=l,h.CALCULATE_BOUNDS=function(){var t=function(h){var g={};for(var d in h)g[d]=h[d];return g},h=r(),g=n(),d=e(),f=u((function(x,b,P){var E=d(g(h(t(x))));function O(h){h>f.maxX&&(f.maxX=h),h<f.minX&&(f.minX=h)}function l(h){h>f.maxY&&(f.maxY=h),h<f.minY&&(f.minY=h)}if(E.type&_.DRAWING_COMMANDS&&(O(b),l(P)),E.type&_.HORIZ_LINE_TO&&O(E.x),E.type&_.VERT_LINE_TO&&l(E.y),E.type&_.LINE_TO&&(O(E.x),l(E.y)),E.type&_.CURVE_TO){O(E.x),l(E.y);for(var S=0,w=p(b,E.x1,E.x2,E.x);S<w.length;S++)0<(Y=w[S])&&1>Y&&O(m(b,E.x1,E.x2,E.x,Y));for(var C=0,A=p(P,E.y1,E.y2,E.y);C<A.length;C++)0<(Y=A[C])&&1>Y&&l(m(P,E.y1,E.y2,E.y,Y))}if(E.type&_.ARC){O(E.x),l(E.y),o(E,b,P);for(var M=E.xRot/180*Math.PI,N=Math.cos(M)*E.rX,V=Math.sin(M)*E.rX,k=-Math.sin(M)*E.rY,R=Math.cos(M)*E.rY,B=E.phi1<E.phi2?[E.phi1,E.phi2]:-180>E.phi2?[E.phi2+360,E.phi1+360]:[E.phi2,E.phi1],L=B[0],D=B[1],I=function(h){var g=h[0],d=h[1],f=180*Math.atan2(d,g)/Math.PI;return f<L?f+360:f},F=0,z=s(k,-N,0).map(I);F<z.length;F++)(Y=z[F])>L&&Y<D&&O(y(E.cX,N,k,Y));for(var U=0,X=s(R,-V,0).map(I);U<X.length;U++){var Y;(Y=X[U])>L&&Y<D&&l(y(E.cY,V,R,Y))}}return x}));return f.minX=1/0,f.maxX=-1/0,f.minY=1/0,f.maxY=-1/0,f}}(w||(w={}));var A,M=function(){function t(){}return t.prototype.round=function(h){return this.transform(w.ROUND(h))},t.prototype.toAbs=function(){return this.transform(w.TO_ABS())},t.prototype.toRel=function(){return this.transform(w.TO_REL())},t.prototype.normalizeHVZ=function(h,g,d){return this.transform(w.NORMALIZE_HVZ(h,g,d))},t.prototype.normalizeST=function(){return this.transform(w.NORMALIZE_ST())},t.prototype.qtToC=function(){return this.transform(w.QT_TO_C())},t.prototype.aToC=function(){return this.transform(w.A_TO_C())},t.prototype.sanitize=function(h){return this.transform(w.SANITIZE(h))},t.prototype.translate=function(h,g){return this.transform(w.TRANSLATE(h,g))},t.prototype.scale=function(h,g){return this.transform(w.SCALE(h,g))},t.prototype.rotate=function(h,g,d){return this.transform(w.ROTATE(h,g,d))},t.prototype.matrix=function(h,g,d,f,x,b){return this.transform(w.MATRIX(h,g,d,f,x,b))},t.prototype.skewX=function(h){return this.transform(w.SKEW_X(h))},t.prototype.skewY=function(h){return this.transform(w.SKEW_Y(h))},t.prototype.xSymmetry=function(h){return this.transform(w.X_AXIS_SYMMETRY(h))},t.prototype.ySymmetry=function(h){return this.transform(w.Y_AXIS_SYMMETRY(h))},t.prototype.annotateArcs=function(){return this.transform(w.ANNOTATE_ARCS())},t}(),T=function(h){return" "===h||"\t"===h||"\r"===h||"\n"===h},v=function(h){return"0".charCodeAt(0)<=h.charCodeAt(0)&&h.charCodeAt(0)<="9".charCodeAt(0)},N=function(h){function e(){var g=h.call(this)||this;return g.curNumber="",g.curCommandType=-1,g.curCommandRelative=!1,g.canParseCommandOrComma=!0,g.curNumberHasExp=!1,g.curNumberHasExpDigits=!1,g.curNumberHasDecimal=!1,g.curArgs=[],g}return r(e,h),e.prototype.finish=function(h){if(void 0===h&&(h=[]),this.parse(" ",h),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return h},e.prototype.parse=function(h,g){var d=this;void 0===g&&(g=[]);for(var i=function(h){g.push(h),d.curArgs.length=0,d.canParseCommandOrComma=!0},f=0;f<h.length;f++){var x=h[f],b=!(this.curCommandType!==_.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),P=v(x)&&("0"===this.curNumber&&"0"===x||b);if(!v(x)||P)if("e"!==x&&"E"!==x)if("-"!==x&&"+"!==x||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==x||this.curNumberHasExp||this.curNumberHasDecimal||b){if(this.curNumber&&-1!==this.curCommandType){var E=Number(this.curNumber);if(isNaN(E))throw new SyntaxError("Invalid number ending at "+f);if(this.curCommandType===_.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>E)throw new SyntaxError('Expected positive number, got "'+E+'" at index "'+f+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+f+'"');this.curArgs.push(E),this.curArgs.length===V[this.curCommandType]&&(_.HORIZ_LINE_TO===this.curCommandType?i({type:_.HORIZ_LINE_TO,relative:this.curCommandRelative,x:E}):_.VERT_LINE_TO===this.curCommandType?i({type:_.VERT_LINE_TO,relative:this.curCommandRelative,y:E}):this.curCommandType===_.MOVE_TO||this.curCommandType===_.LINE_TO||this.curCommandType===_.SMOOTH_QUAD_TO?(i({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),_.MOVE_TO===this.curCommandType&&(this.curCommandType=_.LINE_TO)):this.curCommandType===_.CURVE_TO?i({type:_.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===_.SMOOTH_CURVE_TO?i({type:_.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_.QUAD_TO?i({type:_.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_.ARC&&i({type:_.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!T(x))if(","===x&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==x&&"-"!==x&&"."!==x)if(P)this.curNumber=x,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+f+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+x+'" at index '+f+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==x&&"Z"!==x)if("h"===x||"H"===x)this.curCommandType=_.HORIZ_LINE_TO,this.curCommandRelative="h"===x;else if("v"===x||"V"===x)this.curCommandType=_.VERT_LINE_TO,this.curCommandRelative="v"===x;else if("m"===x||"M"===x)this.curCommandType=_.MOVE_TO,this.curCommandRelative="m"===x;else if("l"===x||"L"===x)this.curCommandType=_.LINE_TO,this.curCommandRelative="l"===x;else if("c"===x||"C"===x)this.curCommandType=_.CURVE_TO,this.curCommandRelative="c"===x;else if("s"===x||"S"===x)this.curCommandType=_.SMOOTH_CURVE_TO,this.curCommandRelative="s"===x;else if("q"===x||"Q"===x)this.curCommandType=_.QUAD_TO,this.curCommandRelative="q"===x;else if("t"===x||"T"===x)this.curCommandType=_.SMOOTH_QUAD_TO,this.curCommandRelative="t"===x;else{if("a"!==x&&"A"!==x)throw new SyntaxError('Unexpected character "'+x+'" at index '+f+".");this.curCommandType=_.ARC,this.curCommandRelative="a"===x}else g.push({type:_.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=x,this.curNumberHasDecimal="."===x}else this.curNumber+=x,this.curNumberHasDecimal=!0;else this.curNumber+=x;else this.curNumber+=x,this.curNumberHasExp=!0;else this.curNumber+=x,this.curNumberHasExpDigits=this.curNumberHasExp}return g},e.prototype.transform=function(h){return Object.create(this,{parse:{value:function(g,d){void 0===d&&(d=[]);for(var f=0,x=Object.getPrototypeOf(this).parse.call(this,g);f<x.length;f++){var b=x[f],P=h(b);Array.isArray(P)?d.push.apply(d,P):d.push(P)}return d}}})},e}(M),_=function(h){function i(g){var d=h.call(this)||this;return d.commands="string"==typeof g?i.parse(g):g,d}return r(i,h),i.prototype.encode=function(){return i.encode(this.commands)},i.prototype.getBounds=function(){var h=w.CALCULATE_BOUNDS();return this.transform(h),h},i.prototype.transform=function(h){for(var g=[],d=0,f=this.commands;d<f.length;d++){var x=h(f[d]);Array.isArray(x)?g.push.apply(g,x):g.push(x)}return this.commands=g,this},i.encode=function(h){return e(h)},i.parse=function(h){var g=new N,d=[];return g.parse(h,d),g.finish(d),d},i.CLOSE_PATH=1,i.MOVE_TO=2,i.HORIZ_LINE_TO=4,i.VERT_LINE_TO=8,i.LINE_TO=16,i.CURVE_TO=32,i.SMOOTH_CURVE_TO=64,i.QUAD_TO=128,i.SMOOTH_QUAD_TO=256,i.ARC=512,i.LINE_COMMANDS=i.LINE_TO|i.HORIZ_LINE_TO|i.VERT_LINE_TO,i.DRAWING_COMMANDS=i.HORIZ_LINE_TO|i.VERT_LINE_TO|i.LINE_TO|i.CURVE_TO|i.SMOOTH_CURVE_TO|i.QUAD_TO|i.SMOOTH_QUAD_TO|i.ARC,i}(M),V=((A={})[_.MOVE_TO]=2,A[_.LINE_TO]=2,A[_.HORIZ_LINE_TO]=1,A[_.VERT_LINE_TO]=1,A[_.CLOSE_PATH]=0,A[_.QUAD_TO]=4,A[_.SMOOTH_QUAD_TO]=2,A[_.CURVE_TO]=6,A[_.SMOOTH_CURVE_TO]=4,A[_.ARC]=7,A);d(39714);function _typeof(h){return _typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(h){return typeof h}:function(h){return h&&"function"===typeof Symbol&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},_typeof(h)}function _classCallCheck(h,g){if(!(h instanceof g))throw new TypeError("Cannot call a class as a function")}var k=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],R=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function getImageDataFromCanvas(h,g,d,f,x){if("string"===typeof h&&(h=document.getElementById(h)),!h||"object"!==_typeof(h)||!("getContext"in h))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var b=h.getContext("2d");try{return b.getImageData(g,d,f,x)}catch(e){throw new Error("unable to access image data: "+e)}}function processCanvasRGBA(h,g,d,f,x,b){if(!(isNaN(b)||b<1)){b|=0;var P=getImageDataFromCanvas(h,g,d,f,x);P=processImageDataRGBA(P,g,d,f,x,b),h.getContext("2d").putImageData(P,g,d)}}function processImageDataRGBA(h,g,d,f,x,b){for(var P,E=h.data,S=2*b+1,w=f-1,C=x-1,A=b+1,M=A*(A+1)/2,N=new B,_=N,V=1;V<S;V++)_=_.next=new B,V===A&&(P=_);_.next=N;for(var L=null,D=null,F=0,z=0,U=k[b],X=R[b],Y=0;Y<x;Y++){_=N;for(var G=E[z],j=E[z+1],Q=E[z+2],q=E[z+3],W=0;W<A;W++)_.r=G,_.g=j,_.b=Q,_.a=q,_=_.next;for(var $=0,Z=0,K=0,J=0,tt=A*G,et=A*j,rt=A*Q,it=A*q,nt=M*G,at=M*j,st=M*Q,ot=M*q,ht=1;ht<A;ht++){var lt=z+((w<ht?w:ht)<<2),ut=E[lt],ct=E[lt+1],gt=E[lt+2],dt=E[lt+3],pt=A-ht;nt+=(_.r=ut)*pt,at+=(_.g=ct)*pt,st+=(_.b=gt)*pt,ot+=(_.a=dt)*pt,$+=ut,Z+=ct,K+=gt,J+=dt,_=_.next}L=N,D=P;for(var ft=0;ft<f;ft++){var mt=ot*U>>X;if(E[z+3]=mt,0!==mt){var yt=255/mt;E[z]=(nt*U>>X)*yt,E[z+1]=(at*U>>X)*yt,E[z+2]=(st*U>>X)*yt}else E[z]=E[z+1]=E[z+2]=0;nt-=tt,at-=et,st-=rt,ot-=it,tt-=L.r,et-=L.g,rt-=L.b,it-=L.a;var vt=ft+b+1;vt=F+(vt<w?vt:w)<<2,$+=L.r=E[vt],Z+=L.g=E[vt+1],K+=L.b=E[vt+2],J+=L.a=E[vt+3],nt+=$,at+=Z,st+=K,ot+=J,L=L.next;var xt=D,bt=xt.r,Pt=xt.g,Et=xt.b,St=xt.a;tt+=bt,et+=Pt,rt+=Et,it+=St,$-=bt,Z-=Pt,K-=Et,J-=St,D=D.next,z+=4}F+=f}for(var Tt=0;Tt<f;Tt++){z=Tt<<2;var wt=E[z],Ct=E[z+1],At=E[z+2],Ot=E[z+3],Mt=A*wt,Nt=A*Ct,_t=A*At,Vt=A*Ot,kt=M*wt,Rt=M*Ct,It=M*At,Bt=M*Ot;_=N;for(var Lt=0;Lt<A;Lt++)_.r=wt,_.g=Ct,_.b=At,_.a=Ot,_=_.next;for(var Dt=f,Ft=0,zt=0,Ut=0,Ht=0,Xt=1;Xt<=b;Xt++){z=Dt+Tt<<2;var Yt=A-Xt;kt+=(_.r=wt=E[z])*Yt,Rt+=(_.g=Ct=E[z+1])*Yt,It+=(_.b=At=E[z+2])*Yt,Bt+=(_.a=Ot=E[z+3])*Yt,Ht+=wt,Ft+=Ct,zt+=At,Ut+=Ot,_=_.next,Xt<C&&(Dt+=f)}z=Tt,L=N,D=P;for(var Gt=0;Gt<x;Gt++){var jt=z<<2;E[jt+3]=Ot=Bt*U>>X,Ot>0?(Ot=255/Ot,E[jt]=(kt*U>>X)*Ot,E[jt+1]=(Rt*U>>X)*Ot,E[jt+2]=(It*U>>X)*Ot):E[jt]=E[jt+1]=E[jt+2]=0,kt-=Mt,Rt-=Nt,It-=_t,Bt-=Vt,Mt-=L.r,Nt-=L.g,_t-=L.b,Vt-=L.a,jt=Tt+((jt=Gt+A)<C?jt:C)*f<<2,kt+=Ht+=L.r=E[jt],Rt+=Ft+=L.g=E[jt+1],It+=zt+=L.b=E[jt+2],Bt+=Ut+=L.a=E[jt+3],L=L.next,Mt+=wt=D.r,Nt+=Ct=D.g,_t+=At=D.b,Vt+=Ot=D.a,Ht-=wt,Ft-=Ct,zt-=At,Ut-=Ot,D=D.next,z+=f}}return h}var B=function BlurStack(){_classCallCheck(this,BlurStack),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};function offscreen(){var{DOMParser:h}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},g={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:h,createCanvas(h,g){return new OffscreenCanvas(h,g)},createImage(h){return(0,f.Z)((function*(){var g=yield fetch(h),d=yield g.blob(),f=yield createImageBitmap(d);return f}))()}};return"undefined"===typeof DOMParser&&"undefined"!==typeof h||Reflect.deleteProperty(g,"DOMParser"),g}function node(h){var{DOMParser:g,canvas:d,fetch:f}=h;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:g,fetch:f,createCanvas:d.createCanvas,createImage:d.loadImage}}var L=Object.freeze({__proto__:null,offscreen:offscreen,node:node});function compressSpaces(h){return h.replace(/(?!\u3000)\s+/gm," ")}function trimLeft(h){return h.replace(/^[\n \t]+/,"")}function trimRight(h){return h.replace(/[\n \t]+$/,"")}function toNumbers(h){var g=(h||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return g.map(parseFloat)}var D=/^[A-Z-]+$/;function normalizeAttributeName(h){return D.test(h)?h.toLowerCase():h}function parseExternalUrl(h){var g=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(h)||[];return g[2]||g[3]||g[4]}function normalizeColor(h){if(!h.startsWith("rgb"))return h;var g=3,d=h.replace(/\d+(\.\d+)?/g,((h,d)=>g--&&d?String(Math.round(parseFloat(h))):h));return d}var F=/(\[[^\]]+\])/g,z=/(#[^\s+>~.[:]+)/g,U=/(\.[^\s+>~.[:]+)/g,X=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,Y=/(:[\w-]+\([^)]*\))/gi,G=/(:[^\s+>~.[:]+)/g,j=/([^\s+>~.[:]+)/g;function findSelectorMatch(h,g){var d=g.exec(h);return d?[h.replace(g," "),d.length]:[h,0]}function getSelectorSpecificity(h){var g=[0,0,0],d=h.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),f=0;return[d,f]=findSelectorMatch(d,F),g[1]+=f,[d,f]=findSelectorMatch(d,z),g[0]+=f,[d,f]=findSelectorMatch(d,U),g[1]+=f,[d,f]=findSelectorMatch(d,X),g[2]+=f,[d,f]=findSelectorMatch(d,Y),g[1]+=f,[d,f]=findSelectorMatch(d,G),g[1]+=f,d=d.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[d,f]=findSelectorMatch(d,j),g[2]+=f,g.join("")}var Q=1e-8;function vectorMagnitude(h){return Math.sqrt(Math.pow(h[0],2)+Math.pow(h[1],2))}function vectorsRatio(h,g){return(h[0]*g[0]+h[1]*g[1])/(vectorMagnitude(h)*vectorMagnitude(g))}function vectorsAngle(h,g){return(h[0]*g[1]<h[1]*g[0]?-1:1)*Math.acos(vectorsRatio(h,g))}function CB1(h){return h*h*h}function CB2(h){return 3*h*h*(1-h)}function CB3(h){return 3*h*(1-h)*(1-h)}function CB4(h){return(1-h)*(1-h)*(1-h)}function QB1(h){return h*h}function QB2(h){return 2*h*(1-h)}function QB3(h){return(1-h)*(1-h)}class Property{constructor(h,g,d){this.document=h,this.name=g,this.value=d,this.isNormalizedColor=!1}static empty(h){return new Property(h,"EMPTY","")}split(){var h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:" ",{document:g,name:d}=this;return compressSpaces(this.getString()).trim().split(h).map((h=>new Property(g,d,h)))}hasValue(h){var{value:g}=this;return null!==g&&""!==g&&(h||0!==g)&&"undefined"!==typeof g}isString(h){var{value:g}=this,d="string"===typeof g;return d&&h?h.test(g):d}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var h=this.getString();switch(!0){case h.endsWith("px"):case/^[0-9]+$/.test(h):return!0;default:return!1}}setValue(h){return this.value=h,this}getValue(h){return"undefined"===typeof h||this.hasValue()?this.value:h}getNumber(h){if(!this.hasValue())return"undefined"===typeof h?0:parseFloat(h);var{value:g}=this,d=parseFloat(g);return this.isString(/%$/)&&(d/=100),d}getString(h){return"undefined"===typeof h||this.hasValue()?"undefined"===typeof this.value?"":String(this.value):String(h)}getColor(h){var g=this.getString(h);return this.isNormalizedColor||(this.isNormalizedColor=!0,g=normalizeColor(g),this.value=g),g}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(h){var g=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasValue())return 0;var[d,f]="boolean"===typeof h?[void 0,h]:[h],{viewPort:x}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(x.computeSize("x"),x.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(x.computeSize("x"),x.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*x.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*x.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return 15*this.getNumber();case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case this.isString(/%$/)&&f:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*x.computeSize(d);default:var b=this.getNumber();return g&&b<1?b*x.computeSize(d):b}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var h=this.getString(),g=/#([^)'"]+)/.exec(h);return g&&(g=g[1]),g||(g=h),this.document.definitions[g]}getFillStyleDefinition(h,g){var d=this.getDefinition();if(!d)return null;if("function"===typeof d.createGradient)return d.createGradient(this.document.ctx,h,g);if("function"===typeof d.createPattern){if(d.getHrefAttribute().hasValue()){var f=d.getAttribute("patternTransform");d=d.getHrefAttribute().getDefinition(),f.hasValue()&&d.getAttribute("patternTransform",!0).setValue(f.value)}return d.createPattern(this.document.ctx,h,g)}return null}getTextBaseline(){return this.hasValue()?Property.textBaselineMapping[this.getString()]:null}addOpacity(h){for(var g=this.getColor(),d=g.length,f=0,x=0;x<d;x++)if(","===g[x]&&f++,3===f)break;if(h.hasValue()&&this.isString()&&3!==f){var b=new P(g);b.ok&&(b.alpha=h.getNumber(),g=b.toRGBA())}return new Property(this.document,this.name,g)}}Property.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};class ViewPort{constructor(){this.viewPorts=[]}clear(){this.viewPorts=[]}setCurrent(h,g){this.viewPorts.push({width:h,height:g})}removeCurrent(){this.viewPorts.pop()}getCurrent(){var{viewPorts:h}=this;return h[h.length-1]}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(h){return"number"===typeof h?h:"x"===h?this.width:"y"===h?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}class Point{constructor(h,g){this.x=h,this.y=g}static parse(h){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,[d=g,f=g]=toNumbers(h);return new Point(d,f)}static parseScale(h){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,[d=g,f=d]=toNumbers(h);return new Point(d,f)}static parsePath(h){for(var g=toNumbers(h),d=g.length,f=[],x=0;x<d;x+=2)f.push(new Point(g[x],g[x+1]));return f}angleTo(h){return Math.atan2(h.y-this.y,h.x-this.x)}applyTransform(h){var{x:g,y:d}=this,f=g*h[0]+d*h[2]+h[4],x=g*h[1]+d*h[3]+h[5];this.x=f,this.y=x}}class Mouse{constructor(h){this.screen=h,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}isWorking(){return this.working}start(){if(!this.working){var{screen:h,onClick:g,onMouseMove:d}=this,f=h.ctx.canvas;f.onclick=g,f.onmousemove=d,this.working=!0}}stop(){if(this.working){var h=this.screen.ctx.canvas;this.working=!1,h.onclick=null,h.onmousemove=null}}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(this.working){var{screen:h,events:g,eventElements:d}=this,{style:f}=h.ctx.canvas;f&&(f.cursor=""),g.forEach(((h,g)=>{var{run:f}=h,x=d[g];while(x)f(x),x=x.parent})),this.events=[],this.eventElements=[]}}checkPath(h,g){if(this.working&&g){var{events:d,eventElements:f}=this;d.forEach(((d,x)=>{var{x:b,y:P}=d;!f[x]&&g.isPointInPath&&g.isPointInPath(b,P)&&(f[x]=h)}))}}checkBoundingBox(h,g){if(this.working&&g){var{events:d,eventElements:f}=this;d.forEach(((d,x)=>{var{x:b,y:P}=d;!f[x]&&g.isPointInBox(b,P)&&(f[x]=h)}))}}mapXY(h,g){var{window:d,ctx:f}=this.screen,x=new Point(h,g),b=f.canvas;while(b)x.x-=b.offsetLeft,x.y-=b.offsetTop,b=b.offsetParent;return d.scrollX&&(x.x+=d.scrollX),d.scrollY&&(x.y+=d.scrollY),x}onClick(h){var{x:g,y:d}=this.mapXY(h.clientX,h.clientY);this.events.push({type:"onclick",x:g,y:d,run(h){h.onClick&&h.onClick()}})}onMouseMove(h){var{x:g,y:d}=this.mapXY(h.clientX,h.clientY);this.events.push({type:"onmousemove",x:g,y:d,run(h){h.onMouseMove&&h.onMouseMove()}})}}var q="undefined"!==typeof window?window:null,W="undefined"!==typeof fetch?fetch.bind(void 0):null;class Screen{constructor(h){var{fetch:g=W,window:d=q}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.ctx=h,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new ViewPort,this.mouse=new Mouse(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=d,this.fetch=g}wait(h){this.waits.push(h)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var h=this.waits.every((h=>h()));return h&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=h,h}setDefaults(h){h.strokeStyle="rgba(0,0,0,0)",h.lineCap="butt",h.lineJoin="miter",h.miterLimit=4}setViewBox(h){var{document:g,ctx:d,aspectRatio:f,width:x,desiredWidth:b,height:P,desiredHeight:E,minX:S=0,minY:w=0,refX:C,refY:A,clip:M=!1,clipX:N=0,clipY:_=0}=h,V=compressSpaces(f).replace(/^defer\s/,""),[k,R]=V.split(" "),B=k||"xMidYMid",L=R||"meet",D=x/b,F=P/E,z=Math.min(D,F),U=Math.max(D,F),X=b,Y=E;"meet"===L&&(X*=z,Y*=z),"slice"===L&&(X*=U,Y*=U);var G=new Property(g,"refX",C),j=new Property(g,"refY",A),Q=G.hasValue()&&j.hasValue();if(Q&&d.translate(-z*G.getPixels("x"),-z*j.getPixels("y")),M){var q=z*N,W=z*_;d.beginPath(),d.moveTo(q,W),d.lineTo(x,W),d.lineTo(x,P),d.lineTo(q,P),d.closePath(),d.clip()}if(!Q){var $="meet"===L&&z===F,Z="slice"===L&&U===F,K="meet"===L&&z===D,J="slice"===L&&U===D;B.startsWith("xMid")&&($||Z)&&d.translate(x/2-X/2,0),B.endsWith("YMid")&&(K||J)&&d.translate(0,P/2-Y/2),B.startsWith("xMax")&&($||Z)&&d.translate(x-X,0),B.endsWith("YMax")&&(K||J)&&d.translate(0,P-Y)}switch(!0){case"none"===B:d.scale(D,F);break;case"meet"===L:d.scale(z,z);break;case"slice"===L:d.scale(U,U);break}d.translate(-S,-w)}start(h){var{enableRedraw:g=!1,ignoreMouse:d=!1,ignoreAnimation:f=!1,ignoreDimensions:x=!1,ignoreClear:P=!1,forceRedraw:E,scaleWidth:S,scaleHeight:w,offsetX:C,offsetY:A}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{FRAMERATE:M,mouse:N}=this,_=1e3/M;if(this.frameDuration=_,this.readyPromise=new Promise((h=>{this.resolveReady=h})),this.isReady()&&this.render(h,x,P,S,w,C,A),g){var V=Date.now(),k=V,R=0,tick=()=>{V=Date.now(),R=V-k,R>=_&&(k=V-R%_,this.shouldUpdate(f,E)&&(this.render(h,x,P,S,w,C,A),N.runEvents())),this.intervalId=b(tick)};d||N.start(),this.intervalId=b(tick)}}stop(){this.intervalId&&(b.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(h,g){if(!h){var{frameDuration:d}=this,f=this.animations.reduce(((h,g)=>g.update(d)||h),!1);if(f)return!0}return!("function"!==typeof g||!g())||(!(this.isReadyLock||!this.isReady())||!!this.mouse.hasEvents())}render(h,g,d,f,x,b,P){var{CLIENT_WIDTH:E,CLIENT_HEIGHT:S,viewPort:w,ctx:C,isFirstRender:A}=this,M=C.canvas;w.clear(),M.width&&M.height?w.setCurrent(M.width,M.height):w.setCurrent(E,S);var N=h.getStyle("width"),_=h.getStyle("height");!g&&(A||"number"!==typeof f&&"number"!==typeof x)&&(N.hasValue()&&(M.width=N.getPixels("x"),M.style&&(M.style.width="".concat(M.width,"px"))),_.hasValue()&&(M.height=_.getPixels("y"),M.style&&(M.style.height="".concat(M.height,"px"))));var V=M.clientWidth||M.width,k=M.clientHeight||M.height;if(g&&N.hasValue()&&_.hasValue()&&(V=N.getPixels("x"),k=_.getPixels("y")),w.setCurrent(V,k),"number"===typeof b&&h.getAttribute("x",!0).setValue(b),"number"===typeof P&&h.getAttribute("y",!0).setValue(P),"number"===typeof f||"number"===typeof x){var R=toNumbers(h.getAttribute("viewBox").getString()),B=0,L=0;if("number"===typeof f){var D=h.getStyle("width");D.hasValue()?B=D.getPixels("x")/f:isNaN(R[2])||(B=R[2]/f)}if("number"===typeof x){var F=h.getStyle("height");F.hasValue()?L=F.getPixels("y")/x:isNaN(R[3])||(L=R[3]/x)}B||(B=L),L||(L=B),h.getAttribute("width",!0).setValue(f),h.getAttribute("height",!0).setValue(x);var z=h.getStyle("transform",!0,!0);z.setValue("".concat(z.getString()," scale(").concat(1/B,", ").concat(1/L,")"))}d||C.clearRect(0,0,V,k),h.render(C),A&&(this.isFirstRender=!1)}}Screen.defaultWindow=q,Screen.defaultFetch=W;var{defaultFetch:$}=Screen,Z="undefined"!==typeof DOMParser?DOMParser:null;class Parser{constructor(){var{fetch:h=$,DOMParser:g=Z}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.fetch=h,this.DOMParser=g}parse(h){var g=this;return(0,f.Z)((function*(){return h.startsWith("<")?g.parseFromString(h):g.load(h)}))()}parseFromString(h){var g=new this.DOMParser;try{return this.checkDocument(g.parseFromString(h,"image/svg+xml"))}catch(d){return this.checkDocument(g.parseFromString(h,"text/xml"))}}checkDocument(h){var g=h.getElementsByTagName("parsererror")[0];if(g)throw new Error(g.textContent);return h}load(h){var g=this;return(0,f.Z)((function*(){var d=yield g.fetch(h),f=yield d.text();return g.parseFromString(f)}))()}}class Translate{constructor(h,g){this.type="translate",this.point=null,this.point=Point.parse(g)}apply(h){var{x:g,y:d}=this.point;h.translate(g||0,d||0)}unapply(h){var{x:g,y:d}=this.point;h.translate(-1*g||0,-1*d||0)}applyToPoint(h){var{x:g,y:d}=this.point;h.applyTransform([1,0,0,1,g||0,d||0])}}class Rotate{constructor(h,g,d){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var f=toNumbers(g);this.angle=new Property(h,"angle",f[0]),this.originX=d[0],this.originY=d[1],this.cx=f[1]||0,this.cy=f[2]||0}apply(h){var{cx:g,cy:d,originX:f,originY:x,angle:b}=this,P=g+f.getPixels("x"),E=d+x.getPixels("y");h.translate(P,E),h.rotate(b.getRadians()),h.translate(-P,-E)}unapply(h){var{cx:g,cy:d,originX:f,originY:x,angle:b}=this,P=g+f.getPixels("x"),E=d+x.getPixels("y");h.translate(P,E),h.rotate(-1*b.getRadians()),h.translate(-P,-E)}applyToPoint(h){var{cx:g,cy:d,angle:f}=this,x=f.getRadians();h.applyTransform([1,0,0,1,g||0,d||0]),h.applyTransform([Math.cos(x),Math.sin(x),-Math.sin(x),Math.cos(x),0,0]),h.applyTransform([1,0,0,1,-g||0,-d||0])}}class Scale{constructor(h,g,d){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var f=Point.parseScale(g);0!==f.x&&0!==f.y||(f.x=Q,f.y=Q),this.scale=f,this.originX=d[0],this.originY=d[1]}apply(h){var{scale:{x:g,y:d},originX:f,originY:x}=this,b=f.getPixels("x"),P=x.getPixels("y");h.translate(b,P),h.scale(g,d||g),h.translate(-b,-P)}unapply(h){var{scale:{x:g,y:d},originX:f,originY:x}=this,b=f.getPixels("x"),P=x.getPixels("y");h.translate(b,P),h.scale(1/g,1/d||g),h.translate(-b,-P)}applyToPoint(h){var{x:g,y:d}=this.scale;h.applyTransform([g||0,0,0,d||0,0,0])}}class Matrix{constructor(h,g,d){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=toNumbers(g),this.originX=d[0],this.originY=d[1]}apply(h){var{originX:g,originY:d,matrix:f}=this,x=g.getPixels("x"),b=d.getPixels("y");h.translate(x,b),h.transform(f[0],f[1],f[2],f[3],f[4],f[5]),h.translate(-x,-b)}unapply(h){var{originX:g,originY:d,matrix:f}=this,x=f[0],b=f[2],P=f[4],E=f[1],S=f[3],w=f[5],C=0,A=0,M=1,N=1/(x*(S*M-w*A)-b*(E*M-w*C)+P*(E*A-S*C)),_=g.getPixels("x"),V=d.getPixels("y");h.translate(_,V),h.transform(N*(S*M-w*A),N*(w*C-E*M),N*(P*A-b*M),N*(x*M-P*C),N*(b*w-P*S),N*(P*E-x*w)),h.translate(-_,-V)}applyToPoint(h){h.applyTransform(this.matrix)}}class Skew extends Matrix{constructor(h,g,d){super(h,g,d),this.type="skew",this.angle=null,this.angle=new Property(h,"angle",g)}}class SkewX extends Skew{constructor(h,g,d){super(h,g,d),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class SkewY extends Skew{constructor(h,g,d){super(h,g,d),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function parseTransforms(h){return compressSpaces(h).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function parseTransform(h){var[g,d]=h.split("(");return[g.trim(),d.trim().replace(")","")]}class Transform{constructor(h,g,d){this.document=h,this.transforms=[];var f=parseTransforms(g);f.forEach((h=>{if("none"!==h){var[g,f]=parseTransform(h),x=Transform.transformTypes[g];"undefined"!==typeof x&&this.transforms.push(new x(this.document,f,d))}}))}static fromElement(h,g){var d=g.getStyle("transform",!1,!0),[f,x=f]=g.getStyle("transform-origin",!1,!0).split(),b=[f,x];return d.hasValue()?new Transform(h,d.getString(),b):null}apply(h){for(var{transforms:g}=this,d=g.length,f=0;f<d;f++)g[f].apply(h)}unapply(h){for(var{transforms:g}=this,d=g.length,f=d-1;f>=0;f--)g[f].unapply(h)}applyToPoint(h){for(var{transforms:g}=this,d=g.length,f=0;f<d;f++)g[f].applyToPoint(h)}}Transform.transformTypes={translate:Translate,rotate:Rotate,scale:Scale,matrix:Matrix,skewX:SkewX,skewY:SkewY};class Element{constructor(h,g){var d=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.document=h,this.node=g,this.captureTextNodes=d,this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],g&&1===g.nodeType){if(Array.from(g.attributes).forEach((g=>{var d=normalizeAttributeName(g.nodeName);this.attributes[d]=new Property(h,d,g.value)})),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var f=this.getAttribute("style").getString().split(";").map((h=>h.trim()));f.forEach((g=>{if(g){var[d,f]=g.split(":").map((h=>h.trim()));this.styles[d]=new Property(h,d,f)}}))}var{definitions:x}=h,b=this.getAttribute("id");b.hasValue()&&(x[b.getString()]||(x[b.getString()]=this)),Array.from(g.childNodes).forEach((g=>{if(1===g.nodeType)this.addChild(g);else if(d&&(3===g.nodeType||4===g.nodeType)){var f=h.createTextNode(g);f.getText().length>0&&this.addChild(f)}}))}}getAttribute(h){var g=arguments.length>1&&void 0!==arguments[1]&&arguments[1],d=this.attributes[h];if(!d&&g){var f=new Property(this.document,h,"");return this.attributes[h]=f,f}return d||Property.empty(this.document)}getHrefAttribute(){for(var h in this.attributes)if("href"===h||h.endsWith(":href"))return this.attributes[h];return Property.empty(this.document)}getStyle(h){var g=arguments.length>1&&void 0!==arguments[1]&&arguments[1],d=arguments.length>2&&void 0!==arguments[2]&&arguments[2],f=this.styles[h];if(f)return f;var x=this.getAttribute(h);if(null!==x&&void 0!==x&&x.hasValue())return this.styles[h]=x,x;if(!d){var{parent:b}=this;if(b){var P=b.getStyle(h);if(null!==P&&void 0!==P&&P.hasValue())return P}}if(g){var E=new Property(this.document,h,"");return this.styles[h]=E,E}return f||Property.empty(this.document)}render(h){if("none"!==this.getStyle("display").getString()&&"hidden"!==this.getStyle("visibility").getString()){if(h.save(),this.getStyle("mask").hasValue()){var g=this.getStyle("mask").getDefinition();g&&(this.applyEffects(h),g.apply(h,this))}else if("none"!==this.getStyle("filter").getValue("none")){var d=this.getStyle("filter").getDefinition();d&&(this.applyEffects(h),d.apply(h,this))}else this.setContext(h),this.renderChildren(h),this.clearContext(h);h.restore()}}setContext(h){}applyEffects(h){var g=Transform.fromElement(this.document,this);g&&g.apply(h);var d=this.getStyle("clip-path",!1,!0);if(d.hasValue()){var f=d.getDefinition();f&&f.apply(h)}}clearContext(h){}renderChildren(h){this.children.forEach((g=>{g.render(h)}))}addChild(h){var g=h instanceof Element?h:this.document.createElement(h);g.parent=this,Element.ignoreChildTypes.includes(g.type)||this.children.push(g)}matchesSelector(h){var g,{node:d}=this;if("function"===typeof d.matches)return d.matches(h);var f=null===(g=d.getAttribute)||void 0===g?void 0:g.call(d,"class");return!(!f||""===f)&&f.split(" ").some((g=>".".concat(g)===h))}addStylesFromStyleDefinition(){var{styles:h,stylesSpecificity:g}=this.document;for(var d in h)if(!d.startsWith("@")&&this.matchesSelector(d)){var f=h[d],x=g[d];if(f)for(var b in f){var P=this.stylesSpecificity[b];"undefined"===typeof P&&(P="000"),x>=P&&(this.styles[b]=f[b],this.stylesSpecificity[b]=x)}}}removeStyles(h,g){var d=g.reduce(((g,d)=>{var f=h.getStyle(d);if(!f.hasValue())return g;var x=f.getString();return f.setValue(""),[...g,[d,x]]}),[]);return d}restoreStyles(h,g){g.forEach((g=>{var[d,f]=g;h.getStyle(d,!0).setValue(f)}))}isFirstChild(){var h;return 0===(null===(h=this.parent)||void 0===h?void 0:h.children.indexOf(this))}}Element.ignoreChildTypes=["title"];class UnknownElement extends Element{constructor(h,g,d){super(h,g,d)}}function wrapFontFamily(h){var g=h.trim();return/^('|")/.test(g)?g:'"'.concat(g,'"')}function prepareFontFamily(h){return"undefined"===typeof process?h:h.trim().split(",").map(wrapFontFamily).join(",")}function prepareFontStyle(h){if(!h)return"";var g=h.trim().toLowerCase();switch(g){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return g;default:return/^oblique\s+(-|)\d+deg$/.test(g)?g:""}}function prepareFontWeight(h){if(!h)return"";var g=h.trim().toLowerCase();switch(g){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return g;default:return/^[\d.]+$/.test(g)?g:""}}class Font{constructor(h,g,d,f,x,b){var P=b?"string"===typeof b?Font.parse(b):b:{};this.fontFamily=x||P.fontFamily,this.fontSize=f||P.fontSize,this.fontStyle=h||P.fontStyle,this.fontWeight=d||P.fontWeight,this.fontVariant=g||P.fontVariant}static parse(){var h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",g=arguments.length>1?arguments[1]:void 0,d="",f="",x="",b="",P="",E=compressSpaces(h).trim().split(" "),S={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return E.forEach((h=>{switch(!0){case!S.fontStyle&&Font.styles.includes(h):"inherit"!==h&&(d=h),S.fontStyle=!0;break;case!S.fontVariant&&Font.variants.includes(h):"inherit"!==h&&(f=h),S.fontStyle=!0,S.fontVariant=!0;break;case!S.fontWeight&&Font.weights.includes(h):"inherit"!==h&&(x=h),S.fontStyle=!0,S.fontVariant=!0,S.fontWeight=!0;break;case!S.fontSize:"inherit"!==h&&([b]=h.split("/")),S.fontStyle=!0,S.fontVariant=!0,S.fontWeight=!0,S.fontSize=!0;break;default:"inherit"!==h&&(P+=h)}})),new Font(d,f,x,b,P,g)}toString(){return[prepareFontStyle(this.fontStyle),this.fontVariant,prepareFontWeight(this.fontWeight),this.fontSize,prepareFontFamily(this.fontFamily)].join(" ").trim()}}Font.styles="normal|italic|oblique|inherit",Font.variants="normal|small-caps|inherit",Font.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class BoundingBox{constructor(){var h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.NaN,g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.NaN,d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.NaN,f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Number.NaN;this.x1=h,this.y1=g,this.x2=d,this.y2=f,this.addPoint(h,g),this.addPoint(d,f)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(h,g){"undefined"!==typeof h&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=h,this.x2=h),h<this.x1&&(this.x1=h),h>this.x2&&(this.x2=h)),"undefined"!==typeof g&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=g,this.y2=g),g<this.y1&&(this.y1=g),g>this.y2&&(this.y2=g))}addX(h){this.addPoint(h,null)}addY(h){this.addPoint(null,h)}addBoundingBox(h){if(h){var{x1:g,y1:d,x2:f,y2:x}=h;this.addPoint(g,d),this.addPoint(f,x)}}sumCubic(h,g,d,f,x){return Math.pow(1-h,3)*g+3*Math.pow(1-h,2)*h*d+3*(1-h)*Math.pow(h,2)*f+Math.pow(h,3)*x}bezierCurveAdd(h,g,d,f,x){var b=6*g-12*d+6*f,P=-3*g+9*d-9*f+3*x,E=3*d-3*g;if(0!==P){var S=Math.pow(b,2)-4*E*P;if(!(S<0)){var w=(-b+Math.sqrt(S))/(2*P);0<w&&w<1&&(h?this.addX(this.sumCubic(w,g,d,f,x)):this.addY(this.sumCubic(w,g,d,f,x)));var C=(-b-Math.sqrt(S))/(2*P);0<C&&C<1&&(h?this.addX(this.sumCubic(C,g,d,f,x)):this.addY(this.sumCubic(C,g,d,f,x)))}}else{if(0===b)return;var A=-E/b;0<A&&A<1&&(h?this.addX(this.sumCubic(A,g,d,f,x)):this.addY(this.sumCubic(A,g,d,f,x)))}}addBezierCurve(h,g,d,f,x,b,P,E){this.addPoint(h,g),this.addPoint(P,E),this.bezierCurveAdd(!0,h,d,x,P),this.bezierCurveAdd(!1,g,f,b,E)}addQuadraticCurve(h,g,d,f,x,b){var P=h+2/3*(d-h),E=g+2/3*(f-g),S=P+1/3*(x-h),w=E+1/3*(b-g);this.addBezierCurve(h,g,P,S,E,w,x,b)}isPointInBox(h,g){var{x1:d,y1:f,x2:x,y2:b}=this;return d<=h&&h<=x&&f<=g&&g<=b}}class PathParser extends _{constructor(h){super(h.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=null,this.start=null,this.current=null,this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new Point(0,0),this.control=new Point(0,0),this.current=new Point(0,0),this.points=[],this.angles=[]}isEnd(){var{i:h,commands:g}=this;return h>=g.length-1}next(){var h=this.commands[++this.i];return this.previousCommand=this.command,this.command=h,h}getPoint(){var h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"x",g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y",d=new Point(this.command[h],this.command[g]);return this.makeAbsolute(d)}getAsControlPoint(h,g){var d=this.getPoint(h,g);return this.control=d,d}getAsCurrentPoint(h,g){var d=this.getPoint(h,g);return this.current=d,d}getReflectedControlPoint(){var h=this.previousCommand.type;if(h!==_.CURVE_TO&&h!==_.SMOOTH_CURVE_TO&&h!==_.QUAD_TO&&h!==_.SMOOTH_QUAD_TO)return this.current;var{current:{x:g,y:d},control:{x:f,y:x}}=this,b=new Point(2*g-f,2*d-x);return b}makeAbsolute(h){if(this.command.relative){var{x:g,y:d}=this.current;h.x+=g,h.y+=d}return h}addMarker(h,g,d){var{points:f,angles:x}=this;d&&x.length>0&&!x[x.length-1]&&(x[x.length-1]=f[f.length-1].angleTo(d)),this.addMarkerAngle(h,g?g.angleTo(h):null)}addMarkerAngle(h,g){this.points.push(h),this.angles.push(g)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:h}=this,g=h.length,d=0;d<g;d++)if(!h[d])for(var f=d+1;f<g;f++)if(h[f]){h[d]=h[f];break}return h}}class RenderedElement extends Element{constructor(){super(...arguments),this.modifiedEmSizeStack=!1}calculateOpacity(){var h=1,g=this;while(g){var d=g.getStyle("opacity",!1,!0);d.hasValue(!0)&&(h*=d.getNumber()),g=g.parent}return h}setContext(h){var g=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!g){var d=this.getStyle("fill"),f=this.getStyle("fill-opacity"),x=this.getStyle("stroke"),b=this.getStyle("stroke-opacity");if(d.isUrlDefinition()){var P=d.getFillStyleDefinition(this,f);P&&(h.fillStyle=P)}else if(d.hasValue()){"currentColor"===d.getString()&&d.setValue(this.getStyle("color").getColor());var E=d.getColor();"inherit"!==E&&(h.fillStyle="none"===E?"rgba(0,0,0,0)":E)}if(f.hasValue()){var S=new Property(this.document,"fill",h.fillStyle).addOpacity(f).getColor();h.fillStyle=S}if(x.isUrlDefinition()){var w=x.getFillStyleDefinition(this,b);w&&(h.strokeStyle=w)}else if(x.hasValue()){"currentColor"===x.getString()&&x.setValue(this.getStyle("color").getColor());var C=x.getString();"inherit"!==C&&(h.strokeStyle="none"===C?"rgba(0,0,0,0)":C)}if(b.hasValue()){var A=new Property(this.document,"stroke",h.strokeStyle).addOpacity(b).getString();h.strokeStyle=A}var M=this.getStyle("stroke-width");if(M.hasValue()){var N=M.getPixels();h.lineWidth=N||Q}var _=this.getStyle("stroke-linecap"),V=this.getStyle("stroke-linejoin"),k=this.getStyle("stroke-miterlimit"),R=this.getStyle("stroke-dasharray"),B=this.getStyle("stroke-dashoffset");if(_.hasValue()&&(h.lineCap=_.getString()),V.hasValue()&&(h.lineJoin=V.getString()),k.hasValue()&&(h.miterLimit=k.getNumber()),R.hasValue()&&"none"!==R.getString()){var L=toNumbers(R.getString());"undefined"!==typeof h.setLineDash?h.setLineDash(L):"undefined"!==typeof h.webkitLineDash?h.webkitLineDash=L:"undefined"===typeof h.mozDash||1===L.length&&0===L[0]||(h.mozDash=L);var D=B.getPixels();"undefined"!==typeof h.lineDashOffset?h.lineDashOffset=D:"undefined"!==typeof h.webkitLineDashOffset?h.webkitLineDashOffset=D:"undefined"!==typeof h.mozDashOffset&&(h.mozDashOffset=D)}}if(this.modifiedEmSizeStack=!1,"undefined"!==typeof h.font){var F=this.getStyle("font"),z=this.getStyle("font-style"),U=this.getStyle("font-variant"),X=this.getStyle("font-weight"),Y=this.getStyle("font-size"),G=this.getStyle("font-family"),j=new Font(z.getString(),U.getString(),X.getString(),Y.hasValue()?"".concat(Y.getPixels(!0),"px"):"",G.getString(),Font.parse(F.getString(),h.font));z.setValue(j.fontStyle),U.setValue(j.fontVariant),X.setValue(j.fontWeight),Y.setValue(j.fontSize),G.setValue(j.fontFamily),h.font=j.toString(),Y.isPixels()&&(this.document.emSize=Y.getPixels(),this.modifiedEmSizeStack=!0)}g||(this.applyEffects(h),h.globalAlpha=this.calculateOpacity())}clearContext(h){super.clearContext(h),this.modifiedEmSizeStack&&this.document.popEmSize()}}class PathElement extends RenderedElement{constructor(h,g,d){super(h,g,d),this.type="path",this.pathParser=null,this.pathParser=new PathParser(this.getAttribute("d").getString())}path(h){var{pathParser:g}=this,d=new BoundingBox;g.reset(),h&&h.beginPath();while(!g.isEnd())switch(g.next().type){case PathParser.MOVE_TO:this.pathM(h,d);break;case PathParser.LINE_TO:this.pathL(h,d);break;case PathParser.HORIZ_LINE_TO:this.pathH(h,d);break;case PathParser.VERT_LINE_TO:this.pathV(h,d);break;case PathParser.CURVE_TO:this.pathC(h,d);break;case PathParser.SMOOTH_CURVE_TO:this.pathS(h,d);break;case PathParser.QUAD_TO:this.pathQ(h,d);break;case PathParser.SMOOTH_QUAD_TO:this.pathT(h,d);break;case PathParser.ARC:this.pathA(h,d);break;case PathParser.CLOSE_PATH:this.pathZ(h,d);break}return d}getBoundingBox(h){return this.path()}getMarkers(){var{pathParser:h}=this,g=h.getMarkerPoints(),d=h.getMarkerAngles(),f=g.map(((h,g)=>[h,d[g]]));return f}renderChildren(h){this.path(h),this.document.screen.mouse.checkPath(this,h);var g=this.getStyle("fill-rule");""!==h.fillStyle&&("inherit"!==g.getString("inherit")?h.fill(g.getString()):h.fill()),""!==h.strokeStyle&&("non-scaling-stroke"===this.getAttribute("vector-effect").getString()?(h.save(),h.setTransform(1,0,0,1,0,0),h.stroke(),h.restore()):h.stroke());var d=this.getMarkers();if(d){var f=d.length-1,x=this.getStyle("marker-start"),b=this.getStyle("marker-mid"),P=this.getStyle("marker-end");if(x.isUrlDefinition()){var E=x.getDefinition(),[S,w]=d[0];E.render(h,S,w)}if(b.isUrlDefinition())for(var C=b.getDefinition(),A=1;A<f;A++){var[M,N]=d[A];C.render(h,M,N)}if(P.isUrlDefinition()){var _=P.getDefinition(),[V,k]=d[f];_.render(h,V,k)}}}static pathM(h){var g=h.getAsCurrentPoint();return h.start=h.current,{point:g}}pathM(h,g){var{pathParser:d}=this,{point:f}=PathElement.pathM(d),{x:x,y:b}=f;d.addMarker(f),g.addPoint(x,b),h&&h.moveTo(x,b)}static pathL(h){var{current:g}=h,d=h.getAsCurrentPoint();return{current:g,point:d}}pathL(h,g){var{pathParser:d}=this,{current:f,point:x}=PathElement.pathL(d),{x:b,y:P}=x;d.addMarker(x,f),g.addPoint(b,P),h&&h.lineTo(b,P)}static pathH(h){var{current:g,command:d}=h,f=new Point((d.relative?g.x:0)+d.x,g.y);return h.current=f,{current:g,point:f}}pathH(h,g){var{pathParser:d}=this,{current:f,point:x}=PathElement.pathH(d),{x:b,y:P}=x;d.addMarker(x,f),g.addPoint(b,P),h&&h.lineTo(b,P)}static pathV(h){var{current:g,command:d}=h,f=new Point(g.x,(d.relative?g.y:0)+d.y);return h.current=f,{current:g,point:f}}pathV(h,g){var{pathParser:d}=this,{current:f,point:x}=PathElement.pathV(d),{x:b,y:P}=x;d.addMarker(x,f),g.addPoint(b,P),h&&h.lineTo(b,P)}static pathC(h){var{current:g}=h,d=h.getPoint("x1","y1"),f=h.getAsControlPoint("x2","y2"),x=h.getAsCurrentPoint();return{current:g,point:d,controlPoint:f,currentPoint:x}}pathC(h,g){var{pathParser:d}=this,{current:f,point:x,controlPoint:b,currentPoint:P}=PathElement.pathC(d);d.addMarker(P,b,x),g.addBezierCurve(f.x,f.y,x.x,x.y,b.x,b.y,P.x,P.y),h&&h.bezierCurveTo(x.x,x.y,b.x,b.y,P.x,P.y)}static pathS(h){var{current:g}=h,d=h.getReflectedControlPoint(),f=h.getAsControlPoint("x2","y2"),x=h.getAsCurrentPoint();return{current:g,point:d,controlPoint:f,currentPoint:x}}pathS(h,g){var{pathParser:d}=this,{current:f,point:x,controlPoint:b,currentPoint:P}=PathElement.pathS(d);d.addMarker(P,b,x),g.addBezierCurve(f.x,f.y,x.x,x.y,b.x,b.y,P.x,P.y),h&&h.bezierCurveTo(x.x,x.y,b.x,b.y,P.x,P.y)}static pathQ(h){var{current:g}=h,d=h.getAsControlPoint("x1","y1"),f=h.getAsCurrentPoint();return{current:g,controlPoint:d,currentPoint:f}}pathQ(h,g){var{pathParser:d}=this,{current:f,controlPoint:x,currentPoint:b}=PathElement.pathQ(d);d.addMarker(b,x,x),g.addQuadraticCurve(f.x,f.y,x.x,x.y,b.x,b.y),h&&h.quadraticCurveTo(x.x,x.y,b.x,b.y)}static pathT(h){var{current:g}=h,d=h.getReflectedControlPoint();h.control=d;var f=h.getAsCurrentPoint();return{current:g,controlPoint:d,currentPoint:f}}pathT(h,g){var{pathParser:d}=this,{current:f,controlPoint:x,currentPoint:b}=PathElement.pathT(d);d.addMarker(b,x,x),g.addQuadraticCurve(f.x,f.y,x.x,x.y,b.x,b.y),h&&h.quadraticCurveTo(x.x,x.y,b.x,b.y)}static pathA(h){var{current:g,command:d}=h,{rX:f,rY:x,xRot:b,lArcFlag:P,sweepFlag:E}=d,S=b*(Math.PI/180),w=h.getAsCurrentPoint(),C=new Point(Math.cos(S)*(g.x-w.x)/2+Math.sin(S)*(g.y-w.y)/2,-Math.sin(S)*(g.x-w.x)/2+Math.cos(S)*(g.y-w.y)/2),A=Math.pow(C.x,2)/Math.pow(f,2)+Math.pow(C.y,2)/Math.pow(x,2);A>1&&(f*=Math.sqrt(A),x*=Math.sqrt(A));var M=(P===E?-1:1)*Math.sqrt((Math.pow(f,2)*Math.pow(x,2)-Math.pow(f,2)*Math.pow(C.y,2)-Math.pow(x,2)*Math.pow(C.x,2))/(Math.pow(f,2)*Math.pow(C.y,2)+Math.pow(x,2)*Math.pow(C.x,2)));isNaN(M)&&(M=0);var N=new Point(M*f*C.y/x,M*-x*C.x/f),_=new Point((g.x+w.x)/2+Math.cos(S)*N.x-Math.sin(S)*N.y,(g.y+w.y)/2+Math.sin(S)*N.x+Math.cos(S)*N.y),V=vectorsAngle([1,0],[(C.x-N.x)/f,(C.y-N.y)/x]),k=[(C.x-N.x)/f,(C.y-N.y)/x],R=[(-C.x-N.x)/f,(-C.y-N.y)/x],B=vectorsAngle(k,R);return vectorsRatio(k,R)<=-1&&(B=Math.PI),vectorsRatio(k,R)>=1&&(B=0),{currentPoint:w,rX:f,rY:x,sweepFlag:E,xAxisRotation:S,centp:_,a1:V,ad:B}}pathA(h,g){var{pathParser:d}=this,{currentPoint:f,rX:x,rY:b,sweepFlag:P,xAxisRotation:E,centp:S,a1:w,ad:C}=PathElement.pathA(d),A=1-P?1:-1,M=w+A*(C/2),N=new Point(S.x+x*Math.cos(M),S.y+b*Math.sin(M));if(d.addMarkerAngle(N,M-A*Math.PI/2),d.addMarkerAngle(f,M-A*Math.PI),g.addPoint(f.x,f.y),h&&!isNaN(w)&&!isNaN(C)){var _=x>b?x:b,V=x>b?1:x/b,k=x>b?b/x:1;h.translate(S.x,S.y),h.rotate(E),h.scale(V,k),h.arc(0,0,_,w,w+C,Boolean(1-P)),h.scale(1/V,1/k),h.rotate(-E),h.translate(-S.x,-S.y)}}static pathZ(h){h.current=h.start}pathZ(h,g){PathElement.pathZ(this.pathParser),h&&g.x1!==g.x2&&g.y1!==g.y2&&h.closePath()}}class GlyphElement extends PathElement{constructor(h,g,d){super(h,g,d),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class TextElement extends RenderedElement{constructor(h,g,d){super(h,g,new.target===TextElement||d),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(h){var g=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super.setContext(h,g);var d=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();d&&(h.textBaseline=d)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(h){if("text"!==this.type)return this.getTElementBoundingBox(h);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(h);var g=null;return this.children.forEach(((d,f)=>{var x=this.getChildBoundingBox(h,this,this,f);g?g.addBoundingBox(x):g=x})),g}getFontSize(){var{document:h,parent:g}=this,d=Font.parse(h.ctx.font).fontSize,f=g.getStyle("font-size").getNumber(d);return f}getTElementBoundingBox(h){var g=this.getFontSize();return new BoundingBox(this.x,this.y-g,this.x+this.measureText(h),this.y)}getGlyph(h,g,d){var f=g[d],x=null;if(h.isArabic){var b=g.length,P=g[d-1],E=g[d+1],S="isolated";if((0===d||" "===P)&&d<b-1&&" "!==E&&(S="terminal"),d>0&&" "!==P&&d<b-1&&" "!==E&&(S="medial"),d>0&&" "!==P&&(d===b-1||" "===E)&&(S="initial"),"undefined"!==typeof h.glyphs[f]){var w=h.glyphs[f];x=w instanceof GlyphElement?w:w[S]}}else x=h.glyphs[f];return x||(x=h.missingGlyph),x}getText(){return""}getTextFromNode(h){var g=h||this.node,d=Array.from(g.parentNode.childNodes),f=d.indexOf(g),x=d.length-1,b=compressSpaces(g.textContent||"");return 0===f&&(b=trimLeft(b)),f===x&&(b=trimRight(b)),b}renderChildren(h){if("text"===this.type){this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(h),this.children.forEach(((g,d)=>{this.renderChild(h,this,this,d)}));var{mouse:g}=this.document.screen;g.isWorking()&&g.checkBoundingBox(this,this.getBoundingBox(h))}else this.renderTElementChildren(h)}renderTElementChildren(h){var{document:g,parent:d}=this,f=this.getText(),x=d.getStyle("font-family").getDefinition();if(x)for(var{unitsPerEm:b}=x.fontFace,P=Font.parse(g.ctx.font),E=d.getStyle("font-size").getNumber(P.fontSize),S=d.getStyle("font-style").getString(P.fontStyle),w=E/b,C=x.isRTL?f.split("").reverse().join(""):f,A=toNumbers(d.getAttribute("dx").getString()),M=C.length,N=0;N<M;N++){var _=this.getGlyph(x,C,N);h.translate(this.x,this.y),h.scale(w,-w);var V=h.lineWidth;h.lineWidth=h.lineWidth*b/E,"italic"===S&&h.transform(1,0,.4,1,0,0),_.render(h),"italic"===S&&h.transform(1,0,-.4,1,0,0),h.lineWidth=V,h.scale(1/w,-1/w),h.translate(-this.x,-this.y),this.x+=E*(_.horizAdvX||x.horizAdvX)/b,"undefined"===typeof A[N]||isNaN(A[N])||(this.x+=A[N])}else{var{x:k,y:R}=this;h.fillStyle&&h.fillText(f,k,R),h.strokeStyle&&h.strokeText(f,k,R)}}applyAnchoring(){if(!(this.textChunkStart>=this.leafTexts.length)){var h=this.leafTexts[this.textChunkStart],g=h.getStyle("text-anchor").getString("start"),d=!1,f=0;f="start"===g&&!d||"end"===g&&d?h.x-this.minX:"end"===g&&!d||"start"===g&&d?h.x-this.maxX:h.x-(this.minX+this.maxX)/2;for(var x=this.textChunkStart;x<this.leafTexts.length;x++)this.leafTexts[x].x+=f;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}adjustChildCoordinatesRecursive(h){this.children.forEach(((g,d)=>{this.adjustChildCoordinatesRecursiveCore(h,this,this,d)})),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(h,g,d,f){var x=d.children[f];x.children.length>0?x.children.forEach(((d,f)=>{g.adjustChildCoordinatesRecursiveCore(h,g,x,f)})):this.adjustChildCoordinates(h,g,d,f)}adjustChildCoordinates(h,g,d,f){var x=d.children[f];if("function"!==typeof x.measureText)return x;h.save(),x.setContext(h,!0);var b=x.getAttribute("x"),P=x.getAttribute("y"),E=x.getAttribute("dx"),S=x.getAttribute("dy"),w=x.getStyle("font-family").getDefinition(),C=Boolean(w)&&w.isRTL;0===f&&(b.hasValue()||b.setValue(x.getInheritedAttribute("x")),P.hasValue()||P.setValue(x.getInheritedAttribute("y")),E.hasValue()||E.setValue(x.getInheritedAttribute("dx")),S.hasValue()||S.setValue(x.getInheritedAttribute("dy")));var A=x.measureText(h);return C&&(g.x-=A),b.hasValue()?(g.applyAnchoring(),x.x=b.getPixels("x"),E.hasValue()&&(x.x+=E.getPixels("x"))):(E.hasValue()&&(g.x+=E.getPixels("x")),x.x=g.x),g.x=x.x,C||(g.x+=A),P.hasValue()?(x.y=P.getPixels("y"),S.hasValue()&&(x.y+=S.getPixels("y"))):(S.hasValue()&&(g.y+=S.getPixels("y")),x.y=g.y),g.y=x.y,g.leafTexts.push(x),g.minX=Math.min(g.minX,x.x,x.x+A),g.maxX=Math.max(g.maxX,x.x,x.x+A),x.clearContext(h),h.restore(),x}getChildBoundingBox(h,g,d,f){var x=d.children[f];if("function"!==typeof x.getBoundingBox)return null;var b=x.getBoundingBox(h);return b?(x.children.forEach(((d,f)=>{var P=g.getChildBoundingBox(h,g,x,f);b.addBoundingBox(P)})),b):null}renderChild(h,g,d,f){var x=d.children[f];x.render(h),x.children.forEach(((d,f)=>{g.renderChild(h,g,x,f)}))}measureText(h){var{measureCache:g}=this;if(~g)return g;var d=this.getText(),f=this.measureTargetText(h,d);return this.measureCache=f,f}measureTargetText(h,g){if(!g.length)return 0;var{parent:d}=this,f=d.getStyle("font-family").getDefinition();if(f){for(var x=this.getFontSize(),b=f.isRTL?g.split("").reverse().join(""):g,P=toNumbers(d.getAttribute("dx").getString()),E=b.length,S=0,w=0;w<E;w++){var C=this.getGlyph(f,b,w);S+=(C.horizAdvX||f.horizAdvX)*x/f.fontFace.unitsPerEm,"undefined"===typeof P[w]||isNaN(P[w])||(S+=P[w])}return S}if(!h.measureText)return 10*g.length;h.save(),this.setContext(h,!0);var{width:A}=h.measureText(g);return this.clearContext(h),h.restore(),A}getInheritedAttribute(h){var g=this;while(g instanceof TextElement&&g.isFirstChild()){var d=g.parent.getAttribute(h);if(d.hasValue(!0))return d.getValue("0");g=g.parent}return null}}class TSpanElement extends TextElement{constructor(h,g,d){super(h,g,new.target===TSpanElement||d),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}getText(){return this.text}}class TextNode extends TSpanElement{constructor(){super(...arguments),this.type="textNode"}}class SVGElement extends RenderedElement{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(h){var g,{document:d}=this,{screen:f,window:x}=d,b=h.canvas;if(f.setDefaults(h),b.style&&"undefined"!==typeof h.font&&x&&"undefined"!==typeof x.getComputedStyle){h.font=x.getComputedStyle(b).getPropertyValue("font");var P=new Property(d,"fontSize",Font.parse(h.font).fontSize);P.hasValue()&&(d.rootEmSize=P.getPixels("y"),d.emSize=d.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:E,height:S}=f.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var w=this.getAttribute("refX"),C=this.getAttribute("refY"),A=this.getAttribute("viewBox"),M=A.hasValue()?toNumbers(A.getString()):null,N=!this.root&&"visible"!==this.getStyle("overflow").getValue("hidden"),_=0,V=0,k=0,R=0;M&&(_=M[0],V=M[1]),this.root||(E=this.getStyle("width").getPixels("x"),S=this.getStyle("height").getPixels("y"),"marker"===this.type&&(k=_,R=V,_=0,V=0)),f.viewPort.setCurrent(E,S),!this.node||this.parent&&"foreignObject"!==(null===(g=this.node.parentNode)||void 0===g?void 0:g.nodeName)||!this.getStyle("transform",!1,!0).hasValue()||this.getStyle("transform-origin",!1,!0).hasValue()||this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(h),h.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),M&&(E=M[2],S=M[3]),d.setViewBox({ctx:h,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:f.viewPort.width,desiredWidth:E,height:f.viewPort.height,desiredHeight:S,minX:_,minY:V,refX:w.getValue(),refY:C.getValue(),clip:N,clipX:k,clipY:R}),M&&(f.viewPort.removeCurrent(),f.viewPort.setCurrent(E,S))}clearContext(h){super.clearContext(h),this.document.screen.viewPort.removeCurrent()}resize(h){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h,d=arguments.length>2&&void 0!==arguments[2]&&arguments[2],f=this.getAttribute("width",!0),x=this.getAttribute("height",!0),b=this.getAttribute("viewBox"),P=this.getAttribute("style"),E=f.getNumber(0),S=x.getNumber(0);if(d)if("string"===typeof d)this.getAttribute("preserveAspectRatio",!0).setValue(d);else{var w=this.getAttribute("preserveAspectRatio");w.hasValue()&&w.setValue(w.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(f.setValue(h),x.setValue(g),b.hasValue()||b.setValue("0 0 ".concat(E||h," ").concat(S||g)),P.hasValue()){var C=this.getStyle("width"),A=this.getStyle("height");C.hasValue()&&C.setValue("".concat(h,"px")),A.hasValue()&&A.setValue("".concat(g,"px"))}}}class RectElement extends PathElement{constructor(){super(...arguments),this.type="rect"}path(h){var g=this.getAttribute("x").getPixels("x"),d=this.getAttribute("y").getPixels("y"),f=this.getStyle("width",!1,!0).getPixels("x"),x=this.getStyle("height",!1,!0).getPixels("y"),b=this.getAttribute("rx"),P=this.getAttribute("ry"),E=b.getPixels("x"),S=P.getPixels("y");if(b.hasValue()&&!P.hasValue()&&(S=E),P.hasValue()&&!b.hasValue()&&(E=S),E=Math.min(E,f/2),S=Math.min(S,x/2),h){var w=(Math.sqrt(2)-1)/3*4;h.beginPath(),x>0&&f>0&&(h.moveTo(g+E,d),h.lineTo(g+f-E,d),h.bezierCurveTo(g+f-E+w*E,d,g+f,d+S-w*S,g+f,d+S),h.lineTo(g+f,d+x-S),h.bezierCurveTo(g+f,d+x-S+w*S,g+f-E+w*E,d+x,g+f-E,d+x),h.lineTo(g+E,d+x),h.bezierCurveTo(g+E-w*E,d+x,g,d+x-S+w*S,g,d+x-S),h.lineTo(g,d+S),h.bezierCurveTo(g,d+S-w*S,g+E-w*E,d,g+E,d),h.closePath())}return new BoundingBox(g,d,g+f,d+x)}getMarkers(){return null}}class CircleElement extends PathElement{constructor(){super(...arguments),this.type="circle"}path(h){var g=this.getAttribute("cx").getPixels("x"),d=this.getAttribute("cy").getPixels("y"),f=this.getAttribute("r").getPixels();return h&&f>0&&(h.beginPath(),h.arc(g,d,f,0,2*Math.PI,!1),h.closePath()),new BoundingBox(g-f,d-f,g+f,d+f)}getMarkers(){return null}}class EllipseElement extends PathElement{constructor(){super(...arguments),this.type="ellipse"}path(h){var g=(Math.sqrt(2)-1)/3*4,d=this.getAttribute("rx").getPixels("x"),f=this.getAttribute("ry").getPixels("y"),x=this.getAttribute("cx").getPixels("x"),b=this.getAttribute("cy").getPixels("y");return h&&d>0&&f>0&&(h.beginPath(),h.moveTo(x+d,b),h.bezierCurveTo(x+d,b+g*f,x+g*d,b+f,x,b+f),h.bezierCurveTo(x-g*d,b+f,x-d,b+g*f,x-d,b),h.bezierCurveTo(x-d,b-g*f,x-g*d,b-f,x,b-f),h.bezierCurveTo(x+g*d,b-f,x+d,b-g*f,x+d,b),h.closePath()),new BoundingBox(x-d,b-f,x+d,b+f)}getMarkers(){return null}}class LineElement extends PathElement{constructor(){super(...arguments),this.type="line"}getPoints(){return[new Point(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new Point(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(h){var[{x:g,y:d},{x:f,y:x}]=this.getPoints();return h&&(h.beginPath(),h.moveTo(g,d),h.lineTo(f,x)),new BoundingBox(g,d,f,x)}getMarkers(){var[h,g]=this.getPoints(),d=h.angleTo(g);return[[h,d],[g,d]]}}class PolylineElement extends PathElement{constructor(h,g,d){super(h,g,d),this.type="polyline",this.points=[],this.points=Point.parsePath(this.getAttribute("points").getString())}path(h){var{points:g}=this,[{x:d,y:f}]=g,x=new BoundingBox(d,f);return h&&(h.beginPath(),h.moveTo(d,f)),g.forEach((g=>{var{x:d,y:f}=g;x.addPoint(d,f),h&&h.lineTo(d,f)})),x}getMarkers(){var{points:h}=this,g=h.length-1,d=[];return h.forEach(((f,x)=>{x!==g&&d.push([f,f.angleTo(h[x+1])])})),d.length>0&&d.push([h[h.length-1],d[d.length-1][1]]),d}}class PolygonElement extends PolylineElement{constructor(){super(...arguments),this.type="polygon"}path(h){var g=super.path(h),[{x:d,y:f}]=this.points;return h&&(h.lineTo(d,f),h.closePath()),g}}class PatternElement extends Element{constructor(){super(...arguments),this.type="pattern"}createPattern(h,g,d){var f=this.getStyle("width").getPixels("x",!0),x=this.getStyle("height").getPixels("y",!0),b=new SVGElement(this.document,null);b.attributes.viewBox=new Property(this.document,"viewBox",this.getAttribute("viewBox").getValue()),b.attributes.width=new Property(this.document,"width","".concat(f,"px")),b.attributes.height=new Property(this.document,"height","".concat(x,"px")),b.attributes.transform=new Property(this.document,"transform",this.getAttribute("patternTransform").getValue()),b.children=this.children;var P=this.document.createCanvas(f,x),E=P.getContext("2d"),S=this.getAttribute("x"),w=this.getAttribute("y");S.hasValue()&&w.hasValue()&&E.translate(S.getPixels("x",!0),w.getPixels("y",!0)),d.hasValue()?this.styles["fill-opacity"]=d:Reflect.deleteProperty(this.styles,"fill-opacity");for(var C=-1;C<=1;C++)for(var A=-1;A<=1;A++)E.save(),b.attributes.x=new Property(this.document,"x",C*P.width),b.attributes.y=new Property(this.document,"y",A*P.height),b.render(E),E.restore();var M=h.createPattern(P,"repeat");return M}}class MarkerElement extends Element{constructor(){super(...arguments),this.type="marker"}render(h,g,d){if(g){var{x:f,y:x}=g,b=this.getAttribute("orient").getString("auto"),P=this.getAttribute("markerUnits").getString("strokeWidth");h.translate(f,x),"auto"===b&&h.rotate(d),"strokeWidth"===P&&h.scale(h.lineWidth,h.lineWidth),h.save();var E=new SVGElement(this.document,null);E.type=this.type,E.attributes.viewBox=new Property(this.document,"viewBox",this.getAttribute("viewBox").getValue()),E.attributes.refX=new Property(this.document,"refX",this.getAttribute("refX").getValue()),E.attributes.refY=new Property(this.document,"refY",this.getAttribute("refY").getValue()),E.attributes.width=new Property(this.document,"width",this.getAttribute("markerWidth").getValue()),E.attributes.height=new Property(this.document,"height",this.getAttribute("markerHeight").getValue()),E.attributes.overflow=new Property(this.document,"overflow",this.getAttribute("overflow").getValue()),E.attributes.fill=new Property(this.document,"fill",this.getAttribute("fill").getColor("black")),E.attributes.stroke=new Property(this.document,"stroke",this.getAttribute("stroke").getValue("none")),E.children=this.children,E.render(h),h.restore(),"strokeWidth"===P&&h.scale(1/h.lineWidth,1/h.lineWidth),"auto"===b&&h.rotate(-d),h.translate(-f,-x)}}}class DefsElement extends Element{constructor(){super(...arguments),this.type="defs"}render(){}}class GElement extends RenderedElement{constructor(){super(...arguments),this.type="g"}getBoundingBox(h){var g=new BoundingBox;return this.children.forEach((d=>{g.addBoundingBox(d.getBoundingBox(h))})),g}}class GradientElement extends Element{constructor(h,g,d){super(h,g,d),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:f,children:x}=this;x.forEach((h=>{"stop"===h.type&&f.push(h)}))}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(h,g,d){var f=this;this.getHrefAttribute().hasValue()&&(f=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(f));var{stops:x}=f,b=this.getGradient(h,g);if(!b)return this.addParentOpacity(d,x[x.length-1].color);if(x.forEach((h=>{b.addColorStop(h.offset,this.addParentOpacity(d,h.color))})),this.getAttribute("gradientTransform").hasValue()){var{document:P}=this,{MAX_VIRTUAL_PIXELS:E,viewPort:S}=P.screen,[w]=S.viewPorts,C=new RectElement(P,null);C.attributes.x=new Property(P,"x",-E/3),C.attributes.y=new Property(P,"y",-E/3),C.attributes.width=new Property(P,"width",E),C.attributes.height=new Property(P,"height",E);var A=new GElement(P,null);A.attributes.transform=new Property(P,"transform",this.getAttribute("gradientTransform").getValue()),A.children=[C];var M=new SVGElement(P,null);M.attributes.x=new Property(P,"x",0),M.attributes.y=new Property(P,"y",0),M.attributes.width=new Property(P,"width",w.width),M.attributes.height=new Property(P,"height",w.height),M.children=[A];var N=P.createCanvas(w.width,w.height),_=N.getContext("2d");return _.fillStyle=b,M.render(_),_.createPattern(N,"no-repeat")}return b}inheritStopContainer(h){this.attributesToInherit.forEach((g=>{!this.getAttribute(g).hasValue()&&h.getAttribute(g).hasValue()&&this.getAttribute(g,!0).setValue(h.getAttribute(g).getValue())}))}addParentOpacity(h,g){if(h.hasValue()){var d=new Property(this.document,"color",g);return d.addOpacity(h).getColor()}return g}}class LinearGradientElement extends GradientElement{constructor(h,g,d){super(h,g,d),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(h,g){var d="objectBoundingBox"===this.getGradientUnits(),f=d?g.getBoundingBox(h):null;if(d&&!f)return null;this.getAttribute("x1").hasValue()||this.getAttribute("y1").hasValue()||this.getAttribute("x2").hasValue()||this.getAttribute("y2").hasValue()||(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var x=d?f.x+f.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),b=d?f.y+f.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),P=d?f.x+f.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),E=d?f.y+f.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return x===P&&b===E?null:h.createLinearGradient(x,b,P,E)}}class RadialGradientElement extends GradientElement{constructor(h,g,d){super(h,g,d),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(h,g){var d="objectBoundingBox"===this.getGradientUnits(),f=g.getBoundingBox(h);if(d&&!f)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var x=d?f.x+f.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),b=d?f.y+f.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),P=x,E=b;this.getAttribute("fx").hasValue()&&(P=d?f.x+f.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(E=d?f.y+f.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var S=d?(f.width+f.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),w=this.getAttribute("fr").getPixels();return h.createRadialGradient(P,E,w,x,b,S)}}class StopElement extends Element{constructor(h,g,d){super(h,g,d),this.type="stop";var f=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),x=this.getStyle("stop-opacity"),b=this.getStyle("stop-color",!0);""===b.getString()&&b.setValue("#000"),x.hasValue()&&(b=b.addOpacity(x)),this.offset=f,this.color=b.getColor()}}class AnimateElement extends Element{constructor(h,g,d){super(h,g,d),this.type="animate",this.duration=0,this.initialValue=null,this.initialUnits="",this.removed=!1,this.frozen=!1,h.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new Property(h,"values",null);var f=this.getAttribute("values");f.hasValue()&&this.values.setValue(f.getString().split(";"))}getProperty(){var h=this.getAttribute("attributeType").getString(),g=this.getAttribute("attributeName").getString();return"CSS"===h?this.parent.getStyle(g,!0):this.parent.getAttribute(g,!0)}calcValue(){var{initialUnits:h}=this,{progress:g,from:d,to:f}=this.getProgress(),x=d.getNumber()+(f.getNumber()-d.getNumber())*g;return"%"===h&&(x*=100),"".concat(x).concat(h)}update(h){var{parent:g}=this,d=this.getProperty();if(this.initialValue||(this.initialValue=d.getString(),this.initialUnits=d.getUnits()),this.duration>this.maxDuration){var f=this.getAttribute("fill").getString("remove");if("indefinite"===this.getAttribute("repeatCount").getString()||"indefinite"===this.getAttribute("repeatDur").getString())this.duration=0;else if("freeze"!==f||this.frozen){if("remove"===f&&!this.removed)return this.removed=!0,d.setValue(g.animationFrozen?g.animationFrozenValue:this.initialValue),!0}else this.frozen=!0,g.animationFrozen=!0,g.animationFrozenValue=d.getString();return!1}this.duration+=h;var x=!1;if(this.begin<this.duration){var b=this.calcValue(),P=this.getAttribute("type");if(P.hasValue()){var E=P.getString();b="".concat(E,"(").concat(b,")")}d.setValue(b),x=!0}return x}getProgress(){var{document:h,values:g}=this,d={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(g.hasValue()){var f=d.progress*(g.getValue().length-1),x=Math.floor(f),b=Math.ceil(f);d.from=new Property(h,"from",parseFloat(g.getValue()[x])),d.to=new Property(h,"to",parseFloat(g.getValue()[b])),d.progress=(f-x)/(b-x)}else d.from=this.from,d.to=this.to;return d}}class AnimateColorElement extends AnimateElement{constructor(){super(...arguments),this.type="animateColor"}calcValue(){var{progress:h,from:g,to:d}=this.getProgress(),f=new P(g.getColor()),x=new P(d.getColor());if(f.ok&&x.ok){var b=f.r+(x.r-f.r)*h,E=f.g+(x.g-f.g)*h,S=f.b+(x.b-f.b)*h;return"rgb(".concat(Math.floor(b),", ").concat(Math.floor(E),", ").concat(Math.floor(S),")")}return this.getAttribute("from").getColor()}}class AnimateTransformElement extends AnimateElement{constructor(){super(...arguments),this.type="animateTransform"}calcValue(){var{progress:h,from:g,to:d}=this.getProgress(),f=toNumbers(g.getString()),x=toNumbers(d.getString()),b=f.map(((g,d)=>{var f=x[d];return g+(f-g)*h})).join(" ");return b}}class FontElement extends Element{constructor(h,g,d){super(h,g,d),this.type="font",this.glyphs={},this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:f}=h,{children:x}=this;for(var b of x)switch(b.type){case"font-face":this.fontFace=b;var P=b.getStyle("font-family");P.hasValue()&&(f[P.getString()]=this);break;case"missing-glyph":this.missingGlyph=b;break;case"glyph":var E=b;E.arabicForm?(this.isRTL=!0,this.isArabic=!0,"undefined"===typeof this.glyphs[E.unicode]&&(this.glyphs[E.unicode]={}),this.glyphs[E.unicode][E.arabicForm]=E):this.glyphs[E.unicode]=E;break}}render(){}}class FontFaceElement extends Element{constructor(h,g,d){super(h,g,d),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class MissingGlyphElement extends PathElement{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class TRefElement extends TextElement{constructor(){super(...arguments),this.type="tref"}getText(){var h=this.getHrefAttribute().getDefinition();if(h){var g=h.children[0];if(g)return g.getText()}return""}}class AElement extends TextElement{constructor(h,g,d){super(h,g,d),this.type="a";var{childNodes:f}=g,x=f[0],b=f.length>0&&Array.from(f).every((h=>3===h.nodeType));this.hasText=b,this.text=b?this.getTextFromNode(x):""}getText(){return this.text}renderChildren(h){if(this.hasText){super.renderChildren(h);var{document:g,x:d,y:f}=this,{mouse:x}=g.screen,b=new Property(g,"fontSize",Font.parse(g.ctx.font).fontSize);x.isWorking()&&x.checkBoundingBox(this,new BoundingBox(d,f-b.getPixels("y"),d+this.measureText(h),f))}else if(this.children.length>0){var P=new GElement(this.document,null);P.children=this.children,P.parent=this,P.render(h)}}onClick(){var{window:h}=this.document;h&&h.open(this.getHrefAttribute().getString())}onMouseMove(){var h=this.document.ctx;h.canvas.style.cursor="pointer"}}function ownKeys$2(h,g){var d=Object.keys(h);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(h);g&&(f=f.filter((function(g){return Object.getOwnPropertyDescriptor(h,g).enumerable}))),d.push.apply(d,f)}return d}function _objectSpread$2(h){for(var g=1;g<arguments.length;g++){var d=null!=arguments[g]?arguments[g]:{};g%2?ownKeys$2(Object(d),!0).forEach((function(g){(0,x.Z)(h,g,d[g])})):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(d)):ownKeys$2(Object(d)).forEach((function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(d,g))}))}return h}class TextPathElement extends TextElement{constructor(h,g,d){super(h,g,d),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);var f=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(f)}getText(){return this.text}path(h){var{dataArray:g}=this;h&&h.beginPath(),g.forEach((g=>{var{type:d,points:f}=g;switch(d){case PathParser.LINE_TO:h&&h.lineTo(f[0],f[1]);break;case PathParser.MOVE_TO:h&&h.moveTo(f[0],f[1]);break;case PathParser.CURVE_TO:h&&h.bezierCurveTo(f[0],f[1],f[2],f[3],f[4],f[5]);break;case PathParser.QUAD_TO:h&&h.quadraticCurveTo(f[0],f[1],f[2],f[3]);break;case PathParser.ARC:var[x,b,P,E,S,w,C,A]=f,M=P>E?P:E,N=P>E?1:P/E,_=P>E?E/P:1;h&&(h.translate(x,b),h.rotate(C),h.scale(N,_),h.arc(0,0,M,S,S+w,Boolean(1-A)),h.scale(1/N,1/_),h.rotate(-C),h.translate(-x,-b));break;case PathParser.CLOSE_PATH:h&&h.closePath();break}}))}renderChildren(h){this.setTextData(h),h.save();var g=this.parent.getStyle("text-decoration").getString(),d=this.getFontSize(),{glyphInfo:f}=this,x=h.fillStyle;"underline"===g&&h.beginPath(),f.forEach(((f,x)=>{var{p0:b,p1:P,rotation:E,text:S}=f;h.save(),h.translate(b.x,b.y),h.rotate(E),h.fillStyle&&h.fillText(S,0,0),h.strokeStyle&&h.strokeText(S,0,0),h.restore(),"underline"===g&&(0===x&&h.moveTo(b.x,b.y+d/8),h.lineTo(P.x,P.y+d/5))})),"underline"===g&&(h.lineWidth=d/20,h.strokeStyle=x,h.stroke(),h.closePath()),h.restore()}getLetterSpacingAt(){var h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.letterSpacingCache[h]||0}findSegmentToFitChar(h,g,d,f,x,b,P,E,S){var w=b,C=this.measureText(h,E);" "===E&&"justify"===g&&d<f&&(C+=(f-d)/x),S>-1&&(w+=this.getLetterSpacingAt(S));var A=this.textHeight/20,M=this.getEquidistantPointOnPath(w,A,0),N=this.getEquidistantPointOnPath(w+C,A,0),_={p0:M,p1:N},V=M&&N?Math.atan2(N.y-M.y,N.x-M.x):0;if(P){var k=Math.cos(Math.PI/2+V)*P,R=Math.cos(-V)*P;_.p0=_objectSpread$2(_objectSpread$2({},M),{},{x:M.x+k,y:M.y+R}),_.p1=_objectSpread$2(_objectSpread$2({},N),{},{x:N.x+k,y:N.y+R})}return w+=C,{offset:w,segment:_,rotation:V}}measureText(h,g){var{measuresCache:d}=this,f=g||this.getText();if(d.has(f))return d.get(f);var x=this.measureTargetText(h,f);return d.set(f,x),x}setTextData(h){if(!this.glyphInfo){var g=this.getText(),d=g.split(""),f=g.split(" ").length-1,x=this.parent.getAttribute("dx").split().map((h=>h.getPixels("x"))),b=this.parent.getAttribute("dy").getPixels("y"),P=this.parent.getStyle("text-anchor").getString("start"),E=this.getStyle("letter-spacing"),S=this.parent.getStyle("letter-spacing"),w=0;E.hasValue()&&"inherit"!==E.getValue()?E.hasValue()&&"initial"!==E.getValue()&&"unset"!==E.getValue()&&(w=E.getPixels()):w=S.getPixels();var C=[],A=g.length;this.letterSpacingCache=C;for(var M=0;M<A;M++)C.push("undefined"!==typeof x[M]?x[M]:w);var N=C.reduce(((h,g,d)=>0===d?0:h+g||0),0),_=this.measureText(h),V=Math.max(_+N,0);this.textWidth=_,this.textHeight=this.getFontSize(),this.glyphInfo=[];var k=this.getPathLength(),R=this.getStyle("startOffset").getNumber(0)*k,B=0;"middle"!==P&&"center"!==P||(B=-V/2),"end"!==P&&"right"!==P||(B=-V),B+=R,d.forEach(((g,x)=>{var{offset:E,segment:S,rotation:w}=this.findSegmentToFitChar(h,P,V,k,f,B,b,g,x);B=E,S.p0&&S.p1&&this.glyphInfo.push({text:d[x],p0:S.p0,p1:S.p1,rotation:w})}))}}parsePathData(h){if(this.pathLength=-1,!h)return[];var g=[],{pathParser:d}=h;d.reset();while(!d.isEnd()){var{current:f}=d,x=f?f.x:0,b=f?f.y:0,P=d.next(),E=P.type,S=[];switch(P.type){case PathParser.MOVE_TO:this.pathM(d,S);break;case PathParser.LINE_TO:E=this.pathL(d,S);break;case PathParser.HORIZ_LINE_TO:E=this.pathH(d,S);break;case PathParser.VERT_LINE_TO:E=this.pathV(d,S);break;case PathParser.CURVE_TO:this.pathC(d,S);break;case PathParser.SMOOTH_CURVE_TO:E=this.pathS(d,S);break;case PathParser.QUAD_TO:this.pathQ(d,S);break;case PathParser.SMOOTH_QUAD_TO:E=this.pathT(d,S);break;case PathParser.ARC:S=this.pathA(d);break;case PathParser.CLOSE_PATH:PathElement.pathZ(d);break}P.type!==PathParser.CLOSE_PATH?g.push({type:E,points:S,start:{x:x,y:b},pathLength:this.calcLength(x,b,E,S)}):g.push({type:PathParser.CLOSE_PATH,points:[],pathLength:0})}return g}pathM(h,g){var{x:d,y:f}=PathElement.pathM(h).point;g.push(d,f)}pathL(h,g){var{x:d,y:f}=PathElement.pathL(h).point;return g.push(d,f),PathParser.LINE_TO}pathH(h,g){var{x:d,y:f}=PathElement.pathH(h).point;return g.push(d,f),PathParser.LINE_TO}pathV(h,g){var{x:d,y:f}=PathElement.pathV(h).point;return g.push(d,f),PathParser.LINE_TO}pathC(h,g){var{point:d,controlPoint:f,currentPoint:x}=PathElement.pathC(h);g.push(d.x,d.y,f.x,f.y,x.x,x.y)}pathS(h,g){var{point:d,controlPoint:f,currentPoint:x}=PathElement.pathS(h);return g.push(d.x,d.y,f.x,f.y,x.x,x.y),PathParser.CURVE_TO}pathQ(h,g){var{controlPoint:d,currentPoint:f}=PathElement.pathQ(h);g.push(d.x,d.y,f.x,f.y)}pathT(h,g){var{controlPoint:d,currentPoint:f}=PathElement.pathT(h);return g.push(d.x,d.y,f.x,f.y),PathParser.QUAD_TO}pathA(h){var{rX:g,rY:d,sweepFlag:f,xAxisRotation:x,centp:b,a1:P,ad:E}=PathElement.pathA(h);return 0===f&&E>0&&(E-=2*Math.PI),1===f&&E<0&&(E+=2*Math.PI),[b.x,b.y,g,d,P,E,x,f]}calcLength(h,g,d,f){var x=0,b=null,P=null,E=0;switch(d){case PathParser.LINE_TO:return this.getLineLength(h,g,f[0],f[1]);case PathParser.CURVE_TO:for(x=0,b=this.getPointOnCubicBezier(0,h,g,f[0],f[1],f[2],f[3],f[4],f[5]),E=.01;E<=1;E+=.01)P=this.getPointOnCubicBezier(E,h,g,f[0],f[1],f[2],f[3],f[4],f[5]),x+=this.getLineLength(b.x,b.y,P.x,P.y),b=P;return x;case PathParser.QUAD_TO:for(x=0,b=this.getPointOnQuadraticBezier(0,h,g,f[0],f[1],f[2],f[3]),E=.01;E<=1;E+=.01)P=this.getPointOnQuadraticBezier(E,h,g,f[0],f[1],f[2],f[3]),x+=this.getLineLength(b.x,b.y,P.x,P.y),b=P;return x;case PathParser.ARC:x=0;var S=f[4],w=f[5],C=f[4]+w,A=Math.PI/180;if(Math.abs(S-C)<A&&(A=Math.abs(S-C)),b=this.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],S,0),w<0)for(E=S-A;E>C;E-=A)P=this.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],E,0),x+=this.getLineLength(b.x,b.y,P.x,P.y),b=P;else for(E=S+A;E<C;E+=A)P=this.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],E,0),x+=this.getLineLength(b.x,b.y,P.x,P.y),b=P;return P=this.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],C,0),x+=this.getLineLength(b.x,b.y,P.x,P.y),x}return 0}getPointOnLine(h,g,d,f,x){var b=arguments.length>5&&void 0!==arguments[5]?arguments[5]:g,P=arguments.length>6&&void 0!==arguments[6]?arguments[6]:d,E=(x-d)/(f-g+Q),S=Math.sqrt(h*h/(1+E*E));f<g&&(S*=-1);var w=E*S,C=null;if(f===g)C={x:b,y:P+w};else if((P-d)/(b-g+Q)===E)C={x:b+S,y:P+w};else{var A=0,M=0,N=this.getLineLength(g,d,f,x);if(N<Q)return null;var _=(b-g)*(f-g)+(P-d)*(x-d);_/=N*N,A=g+_*(f-g),M=d+_*(x-d);var V=this.getLineLength(b,P,A,M),k=Math.sqrt(h*h-V*V);S=Math.sqrt(k*k/(1+E*E)),f<g&&(S*=-1),w=E*S,C={x:A+S,y:M+w}}return C}getPointOnPath(h){var g=this.getPathLength(),d=0,f=null;if(h<-5e-5||h-5e-5>g)return null;var{dataArray:x}=this;for(var b of x){if(!b||!(b.pathLength<5e-5||d+b.pathLength+5e-5<h)){var P=h-d,E=0;switch(b.type){case PathParser.LINE_TO:f=this.getPointOnLine(P,b.start.x,b.start.y,b.points[0],b.points[1],b.start.x,b.start.y);break;case PathParser.ARC:var S=b.points[4],w=b.points[5],C=b.points[4]+w;if(E=S+P/b.pathLength*w,w<0&&E<C||w>=0&&E>C)break;f=this.getPointOnEllipticalArc(b.points[0],b.points[1],b.points[2],b.points[3],E,b.points[6]);break;case PathParser.CURVE_TO:E=P/b.pathLength,E>1&&(E=1),f=this.getPointOnCubicBezier(E,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3],b.points[4],b.points[5]);break;case PathParser.QUAD_TO:E=P/b.pathLength,E>1&&(E=1),f=this.getPointOnQuadraticBezier(E,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3]);break}if(f)return f;break}d+=b.pathLength}return null}getLineLength(h,g,d,f){return Math.sqrt((d-h)*(d-h)+(f-g)*(f-g))}getPathLength(){return-1===this.pathLength&&(this.pathLength=this.dataArray.reduce(((h,g)=>g.pathLength>0?h+g.pathLength:h),0)),this.pathLength}getPointOnCubicBezier(h,g,d,f,x,b,P,E,S){var w=E*CB1(h)+b*CB2(h)+f*CB3(h)+g*CB4(h),C=S*CB1(h)+P*CB2(h)+x*CB3(h)+d*CB4(h);return{x:w,y:C}}getPointOnQuadraticBezier(h,g,d,f,x,b,P){var E=b*QB1(h)+f*QB2(h)+g*QB3(h),S=P*QB1(h)+x*QB2(h)+d*QB3(h);return{x:E,y:S}}getPointOnEllipticalArc(h,g,d,f,x,b){var P=Math.cos(b),E=Math.sin(b),S={x:d*Math.cos(x),y:f*Math.sin(x)};return{x:h+(S.x*P-S.y*E),y:g+(S.x*E+S.y*P)}}buildEquidistantCache(h,g){var d=this.getPathLength(),f=g||.25,x=h||d/100;if(!this.equidistantCache||this.equidistantCache.step!==x||this.equidistantCache.precision!==f){this.equidistantCache={step:x,precision:f,points:[]};for(var b=0,P=0;P<=d;P+=f){var E=this.getPointOnPath(P),S=this.getPointOnPath(P+f);E&&S&&(b+=this.getLineLength(E.x,E.y,S.x,S.y),b>=x&&(this.equidistantCache.points.push({x:E.x,y:E.y,distance:P}),b-=x))}}}getEquidistantPointOnPath(h,g,d){if(this.buildEquidistantCache(g,d),h<0||h-this.getPathLength()>5e-5)return null;var f=Math.round(h/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[f]||null}}var K=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class ImageElement extends RenderedElement{constructor(h,g,d){super(h,g,d),this.type="image",this.loaded=!1;var f=this.getHrefAttribute().getString();if(f){var x=f.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(f);h.images.push(this),x?this.loadSvg(f):this.loadImage(f),this.isSvg=x}}loadImage(h){var g=this;return(0,f.Z)((function*(){try{var d=yield g.document.createImage(h);g.image=d}catch(f){console.error('Error while loading image "'.concat(h,'":'),f)}g.loaded=!0}))()}loadSvg(h){var g=this;return(0,f.Z)((function*(){var d=K.exec(h);if(d){var f=d[5];"base64"===d[4]?g.image=atob(f):g.image=decodeURIComponent(f)}else try{var x=yield g.document.fetch(h),b=yield x.text();g.image=b}catch(P){console.error('Error while loading image "'.concat(h,'":'),P)}g.loaded=!0}))()}renderChildren(h){var{document:g,image:d,loaded:f}=this,x=this.getAttribute("x").getPixels("x"),b=this.getAttribute("y").getPixels("y"),P=this.getStyle("width").getPixels("x"),E=this.getStyle("height").getPixels("y");if(f&&d&&P&&E){if(h.save(),h.translate(x,b),this.isSvg){var S=g.canvg.forkString(h,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:P,scaleHeight:E});S.document.documentElement.parent=this,S.render()}else{var w=this.image;g.setViewBox({ctx:h,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:P,desiredWidth:w.width,height:E,desiredHeight:w.height}),this.loaded&&("undefined"===typeof w.complete||w.complete)&&h.drawImage(w,0,0)}h.restore()}}getBoundingBox(){var h=this.getAttribute("x").getPixels("x"),g=this.getAttribute("y").getPixels("y"),d=this.getStyle("width").getPixels("x"),f=this.getStyle("height").getPixels("y");return new BoundingBox(h,g,h+d,g+f)}}class SymbolElement extends RenderedElement{constructor(){super(...arguments),this.type="symbol"}render(h){}}class SVGFontLoader{constructor(h){this.document=h,this.loaded=!1,h.fonts.push(this)}load(h,g){var d=this;return(0,f.Z)((function*(){try{var{document:f}=d,x=yield f.canvg.parser.load(g),b=x.getElementsByTagName("font");Array.from(b).forEach((g=>{var d=f.createElement(g);f.definitions[h]=d}))}catch(P){console.error('Error while loading font "'.concat(g,'":'),P)}d.loaded=!0}))()}}class StyleElement extends Element{constructor(h,g,d){super(h,g,d),this.type="style";var f=compressSpaces(Array.from(g.childNodes).map((h=>h.textContent)).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")),x=f.split("}");x.forEach((g=>{var d=g.trim();if(d){var f=d.split("{"),x=f[0].split(","),b=f[1].split(";");x.forEach((g=>{var d=g.trim();if(d){var f=h.styles[d]||{};if(b.forEach((g=>{var d=g.indexOf(":"),x=g.substr(0,d).trim(),b=g.substr(d+1,g.length-d).trim();x&&b&&(f[x]=new Property(h,x,b))})),h.styles[d]=f,h.stylesSpecificity[d]=getSelectorSpecificity(d),"@font-face"===d){var x=f["font-family"].getString().replace(/"|'/g,""),P=f.src.getString().split(",");P.forEach((g=>{if(g.indexOf('format("svg")')>0){var d=parseExternalUrl(g);d&&new SVGFontLoader(h).load(x,d)}}))}}}))}}))}}StyleElement.parseExternalUrl=parseExternalUrl;class UseElement extends RenderedElement{constructor(){super(...arguments),this.type="use"}setContext(h){super.setContext(h);var g=this.getAttribute("x"),d=this.getAttribute("y");g.hasValue()&&h.translate(g.getPixels("x"),0),d.hasValue()&&h.translate(0,d.getPixels("y"))}path(h){var{element:g}=this;g&&g.path(h)}renderChildren(h){var{document:g,element:d}=this;if(d){var f=d;if("symbol"===d.type&&(f=new SVGElement(g,null),f.attributes.viewBox=new Property(g,"viewBox",d.getAttribute("viewBox").getString()),f.attributes.preserveAspectRatio=new Property(g,"preserveAspectRatio",d.getAttribute("preserveAspectRatio").getString()),f.attributes.overflow=new Property(g,"overflow",d.getAttribute("overflow").getString()),f.children=d.children,d.styles.opacity=new Property(g,"opacity",this.calculateOpacity())),"svg"===f.type){var x=this.getStyle("width",!1,!0),b=this.getStyle("height",!1,!0);x.hasValue()&&(f.attributes.width=new Property(g,"width",x.getString())),b.hasValue()&&(f.attributes.height=new Property(g,"height",b.getString()))}var P=f.parent;f.parent=this,f.render(h),f.parent=P}}getBoundingBox(h){var{element:g}=this;return g?g.getBoundingBox(h):null}elementTransform(){var{document:h,element:g}=this;return Transform.fromElement(h,g)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function imGet(h,g,d,f,x,b){return h[d*f*4+4*g+b]}function imSet(h,g,d,f,x,b,P){h[d*f*4+4*g+b]=P}function index_es_m(h,g,d){var f=h[g];return f*d}function index_es_c(h,g,d,f){return g+Math.cos(h)*d+Math.sin(h)*f}class FeColorMatrixElement extends Element{constructor(h,g,d){super(h,g,d),this.type="feColorMatrix";var f=toNumbers(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":var x=f[0];f=[.213+.787*x,.715-.715*x,.072-.072*x,0,0,.213-.213*x,.715+.285*x,.072-.072*x,0,0,.213-.213*x,.715-.715*x,.072+.928*x,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var b=f[0]*Math.PI/180;f=[index_es_c(b,.213,.787,-.213),index_es_c(b,.715,-.715,-.715),index_es_c(b,.072,-.072,.928),0,0,index_es_c(b,.213,-.213,.143),index_es_c(b,.715,.285,.14),index_es_c(b,.072,-.072,-.283),0,0,index_es_c(b,.213,-.213,-.787),index_es_c(b,.715,-.715,.715),index_es_c(b,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}this.matrix=f,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(h,g,d,f,x){for(var{includeOpacity:b,matrix:P}=this,E=h.getImageData(0,0,f,x),S=0;S<x;S++)for(var w=0;w<f;w++){var C=imGet(E.data,w,S,f,x,0),A=imGet(E.data,w,S,f,x,1),M=imGet(E.data,w,S,f,x,2),N=imGet(E.data,w,S,f,x,3),_=index_es_m(P,0,C)+index_es_m(P,1,A)+index_es_m(P,2,M)+index_es_m(P,3,N)+index_es_m(P,4,1),V=index_es_m(P,5,C)+index_es_m(P,6,A)+index_es_m(P,7,M)+index_es_m(P,8,N)+index_es_m(P,9,1),k=index_es_m(P,10,C)+index_es_m(P,11,A)+index_es_m(P,12,M)+index_es_m(P,13,N)+index_es_m(P,14,1),R=index_es_m(P,15,C)+index_es_m(P,16,A)+index_es_m(P,17,M)+index_es_m(P,18,N)+index_es_m(P,19,1);b&&(_=0,V=0,k=0,R*=N/255),imSet(E.data,w,S,f,x,0,_),imSet(E.data,w,S,f,x,1,V),imSet(E.data,w,S,f,x,2,k),imSet(E.data,w,S,f,x,3,R)}h.clearRect(0,0,f,x),h.putImageData(E,0,0)}}class MaskElement extends Element{constructor(){super(...arguments),this.type="mask"}apply(h,g){var{document:d}=this,f=this.getAttribute("x").getPixels("x"),x=this.getAttribute("y").getPixels("y"),b=this.getStyle("width").getPixels("x"),P=this.getStyle("height").getPixels("y");if(!b&&!P){var E=new BoundingBox;this.children.forEach((g=>{E.addBoundingBox(g.getBoundingBox(h))})),f=Math.floor(E.x1),x=Math.floor(E.y1),b=Math.floor(E.width),P=Math.floor(E.height)}var S=this.removeStyles(g,MaskElement.ignoreStyles),w=d.createCanvas(f+b,x+P),C=w.getContext("2d");d.screen.setDefaults(C),this.renderChildren(C),new FeColorMatrixElement(d,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(C,0,0,f+b,x+P);var A=d.createCanvas(f+b,x+P),M=A.getContext("2d");d.screen.setDefaults(M),g.render(M),M.globalCompositeOperation="destination-in",M.fillStyle=C.createPattern(w,"no-repeat"),M.fillRect(0,0,f+b,x+P),h.fillStyle=M.createPattern(A,"no-repeat"),h.fillRect(0,0,f+b,x+P),this.restoreStyles(g,S)}render(h){}}MaskElement.ignoreStyles=["mask","transform","clip-path"];var noop=()=>{};class ClipPathElement extends Element{constructor(){super(...arguments),this.type="clipPath"}apply(h){var{document:g}=this,d=Reflect.getPrototypeOf(h),{beginPath:f,closePath:x}=h;d&&(d.beginPath=noop,d.closePath=noop),Reflect.apply(f,h,[]),this.children.forEach((f=>{if("undefined"!==typeof f.path){var b="undefined"!==typeof f.elementTransform?f.elementTransform():null;b||(b=Transform.fromElement(g,f)),b&&b.apply(h),f.path(h),d&&(d.closePath=x),b&&b.unapply(h)}})),Reflect.apply(x,h,[]),h.clip(),d&&(d.beginPath=f,d.closePath=x)}render(h){}}class FilterElement extends Element{constructor(){super(...arguments),this.type="filter"}apply(h,g){var{document:d,children:f}=this,x=g.getBoundingBox(h);if(x){var b=0,P=0;f.forEach((h=>{var g=h.extraFilterDistance||0;b=Math.max(b,g),P=Math.max(P,g)}));var E=Math.floor(x.width),S=Math.floor(x.height),w=E+2*b,C=S+2*P;if(!(w<1||C<1)){var A=Math.floor(x.x),M=Math.floor(x.y),N=this.removeStyles(g,FilterElement.ignoreStyles),_=d.createCanvas(w,C),V=_.getContext("2d");d.screen.setDefaults(V),V.translate(-A+b,-M+P),g.render(V),f.forEach((h=>{"function"===typeof h.apply&&h.apply(V,0,0,w,C)})),h.drawImage(_,0,0,w,C,A-b,M-P,w,C),this.restoreStyles(g,N)}}}render(h){}}FilterElement.ignoreStyles=["filter","transform","clip-path"];class FeDropShadowElement extends Element{constructor(h,g,d){super(h,g,d),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(h,g,d,f,x){}}class FeMorphologyElement extends Element{constructor(){super(...arguments),this.type="feMorphology"}apply(h,g,d,f,x){}}class FeCompositeElement extends Element{constructor(){super(...arguments),this.type="feComposite"}apply(h,g,d,f,x){}}class FeGaussianBlurElement extends Element{constructor(h,g,d){super(h,g,d),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(h,g,d,f,x){var{document:b,blurRadius:P}=this,E=b.window?b.window.document.body:null,S=h.canvas;S.id=b.getUniqueId(),E&&(S.style.display="none",E.appendChild(S)),processCanvasRGBA(S,g,d,f,x,P),E&&E.removeChild(S)}}class TitleElement extends Element{constructor(){super(...arguments),this.type="title"}}class DescElement extends Element{constructor(){super(...arguments),this.type="desc"}}var J={svg:SVGElement,rect:RectElement,circle:CircleElement,ellipse:EllipseElement,line:LineElement,polyline:PolylineElement,polygon:PolygonElement,path:PathElement,pattern:PatternElement,marker:MarkerElement,defs:DefsElement,linearGradient:LinearGradientElement,radialGradient:RadialGradientElement,stop:StopElement,animate:AnimateElement,animateColor:AnimateColorElement,animateTransform:AnimateTransformElement,font:FontElement,"font-face":FontFaceElement,"missing-glyph":MissingGlyphElement,glyph:GlyphElement,text:TextElement,tspan:TSpanElement,tref:TRefElement,a:AElement,textPath:TextPathElement,image:ImageElement,g:GElement,symbol:SymbolElement,style:StyleElement,use:UseElement,mask:MaskElement,clipPath:ClipPathElement,filter:FilterElement,feDropShadow:FeDropShadowElement,feMorphology:FeMorphologyElement,feComposite:FeCompositeElement,feColorMatrix:FeColorMatrixElement,feGaussianBlur:FeGaussianBlurElement,title:TitleElement,desc:DescElement};function ownKeys$1(h,g){var d=Object.keys(h);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(h);g&&(f=f.filter((function(g){return Object.getOwnPropertyDescriptor(h,g).enumerable}))),d.push.apply(d,f)}return d}function _objectSpread$1(h){for(var g=1;g<arguments.length;g++){var d=null!=arguments[g]?arguments[g]:{};g%2?ownKeys$1(Object(d),!0).forEach((function(g){(0,x.Z)(h,g,d[g])})):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(d)):ownKeys$1(Object(d)).forEach((function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(d,g))}))}return h}function createCanvas(h,g){var d=document.createElement("canvas");return d.width=h,d.height=g,d}function createImage(h){return _createImage.apply(this,arguments)}function _createImage(){return _createImage=(0,f.Z)((function*(h){var g=arguments.length>1&&void 0!==arguments[1]&&arguments[1],d=document.createElement("img");return g&&(d.crossOrigin="Anonymous"),new Promise(((g,f)=>{d.onload=()=>{g(d)},d.onerror=(h,g,d,x,b)=>{f(b)},d.src=h}))})),_createImage.apply(this,arguments)}class Document{constructor(h){var{rootEmSize:g=12,emSize:d=12,createCanvas:f=Document.createCanvas,createImage:x=Document.createImage,anonymousCrossOrigin:b}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.canvg=h,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=h.screen,this.rootEmSize=g,this.emSize=d,this.createCanvas=f,this.createImage=this.bindCreateImage(x,b),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(h,g){return"boolean"===typeof g?(d,f)=>h(d,"boolean"===typeof f?f:g):h}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:h}=this;return h[h.length-1]}set emSize(h){var{emSizeStack:g}=this;g.push(h)}popEmSize(){var{emSizeStack:h}=this;h.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every((h=>h.loaded))}isFontsLoaded(){return this.fonts.every((h=>h.loaded))}createDocumentElement(h){var g=this.createElement(h.documentElement);return g.root=!0,g.addStylesFromStyleDefinition(),this.documentElement=g,g}createElement(h){var g=h.nodeName.replace(/^[^:]+:/,""),d=Document.elementTypes[g];return"undefined"!==typeof d?new d(this,h):new UnknownElement(this,h)}createTextNode(h){return new TextNode(this,h)}setViewBox(h){this.screen.setViewBox(_objectSpread$1({document:this},h))}}function ownKeys(h,g){var d=Object.keys(h);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(h);g&&(f=f.filter((function(g){return Object.getOwnPropertyDescriptor(h,g).enumerable}))),d.push.apply(d,f)}return d}function _objectSpread(h){for(var g=1;g<arguments.length;g++){var d=null!=arguments[g]?arguments[g]:{};g%2?ownKeys(Object(d),!0).forEach((function(g){(0,x.Z)(h,g,d[g])})):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(d)):ownKeys(Object(d)).forEach((function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(d,g))}))}return h}Document.createCanvas=createCanvas,Document.createImage=createImage,Document.elementTypes=J;class Canvg{constructor(h,g){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.parser=new Parser(d),this.screen=new Screen(h,d),this.options=d;var f=new Document(this,d),x=f.createDocumentElement(g);this.document=f,this.documentElement=x}static from(h,g){var d=arguments;return(0,f.Z)((function*(){var f=d.length>2&&void 0!==d[2]?d[2]:{},x=new Parser(f),b=yield x.parse(g);return new Canvg(h,b,f)}))()}static fromString(h,g){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},f=new Parser(d),x=f.parseFromString(g);return new Canvg(h,x,d)}fork(h,g){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Canvg.from(h,g,_objectSpread(_objectSpread({},this.options),d))}forkString(h,g){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Canvg.fromString(h,g,_objectSpread(_objectSpread({},this.options),d))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var h=arguments,g=this;return(0,f.Z)((function*(){var d=h.length>0&&void 0!==h[0]?h[0]:{};g.start(_objectSpread({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},d)),yield g.ready(),g.stop()}))()}start(){var h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{documentElement:g,screen:d,options:f}=this;d.start(g,_objectSpread(_objectSpread({enableRedraw:!0},f),h))}stop(){this.screen.stop()}resize(h){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h,d=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.documentElement.resize(h,g,d)}}}}]);
1
+ (("undefined"!==typeof self?self:this)["webpackChunkhoeditor"]=("undefined"!==typeof self?self:this)["webpackChunkhoeditor"]||[]).push([[935],{82772:function(h,g,d){"use strict";var f=d(82109),x=d(21470),b=d(41318).indexOf,P=d(9341),E=x([].indexOf),S=!!E&&1/E([1],1,-0)<0,w=P("indexOf");f({target:"Array",proto:!0,forced:S||!w},{indexOf:function indexOf(h){var g=arguments.length>1?arguments[1]:void 0;return S?E(this,h,g)||0:b(this,h,g)}})},85827:function(h,g,d){"use strict";var f=d(82109),x=d(53671).left,b=d(9341),P=d(7392),E=d(35268),S=b("reduce"),w=!E&&P>79&&P<83;f({target:"Array",proto:!0,forced:!S||w},{reduce:function reduce(h){var g=arguments.length;return x(this,h,g,g>1?arguments[1]:void 0)}})},65069:function(h,g,d){"use strict";var f=d(82109),x=d(1702),b=d(43157),P=x([].reverse),E=[1,2];f({target:"Array",proto:!0,forced:String(E)===String(E.reverse())},{reverse:function reverse(){return b(this)&&(this.length=this.length),P(this)}})},26131:function(h){h.exports=function(h){this.ok=!1,this.alpha=1,"#"==h.charAt(0)&&(h=h.substr(1,6)),h=h.replace(/ /g,""),h=h.toLowerCase();var g={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",rebeccapurple:"663399",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"};h=g[h]||h;for(var d=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(h){return[parseInt(h[1]),parseInt(h[2]),parseInt(h[3]),parseFloat(h[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(h){return[parseInt(h[1]),parseInt(h[2]),parseInt(h[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(h){return[parseInt(h[1],16),parseInt(h[2],16),parseInt(h[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(h){return[parseInt(h[1]+h[1],16),parseInt(h[2]+h[2],16),parseInt(h[3]+h[3],16)]}}],f=0;f<d.length;f++){var x=d[f].re,b=d[f].process,P=x.exec(h);if(P){var E=b(P);this.r=E[0],this.g=E[1],this.b=E[2],E.length>3&&(this.alpha=E[3]),this.ok=!0}}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.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var h=this.r.toString(16),g=this.g.toString(16),d=this.b.toString(16);return 1==h.length&&(h="0"+h),1==g.length&&(g="0"+g),1==d.length&&(d="0"+d),"#"+h+g+d},this.getHelpXML=function(){for(var h=new Array,f=0;f<d.length;f++)for(var x=d[f].example,b=0;b<x.length;b++)h[h.length]=x[b];for(var P in g)h[h.length]=P;var E=document.createElement("ul");E.setAttribute("id","rgbcolor-examples");for(f=0;f<h.length;f++)try{var S=document.createElement("li"),w=new RGBColor(h[f]),C=document.createElement("div");C.style.cssText="margin: 3px; border: 1px solid black; background:"+w.toHex()+"; color:"+w.toHex(),C.appendChild(document.createTextNode("test"));var A=document.createTextNode(" "+h[f]+" -> "+w.toRGB()+" -> "+w.toHex());S.appendChild(C),S.appendChild(A),E.appendChild(S)}catch(M){}return E}}},71935:function(h,g,d){"use strict";d.r(g),d.d(g,{AElement:function(){return AElement},AnimateColorElement:function(){return AnimateColorElement},AnimateElement:function(){return AnimateElement},AnimateTransformElement:function(){return AnimateTransformElement},BoundingBox:function(){return BoundingBox},CB1:function(){return CB1},CB2:function(){return CB2},CB3:function(){return CB3},CB4:function(){return CB4},Canvg:function(){return Canvg},CircleElement:function(){return CircleElement},ClipPathElement:function(){return ClipPathElement},DefsElement:function(){return DefsElement},DescElement:function(){return DescElement},Document:function(){return Document},Element:function(){return Element},EllipseElement:function(){return EllipseElement},FeColorMatrixElement:function(){return FeColorMatrixElement},FeCompositeElement:function(){return FeCompositeElement},FeDropShadowElement:function(){return FeDropShadowElement},FeGaussianBlurElement:function(){return FeGaussianBlurElement},FeMorphologyElement:function(){return FeMorphologyElement},FilterElement:function(){return FilterElement},Font:function(){return Font},FontElement:function(){return FontElement},FontFaceElement:function(){return FontFaceElement},GElement:function(){return GElement},GlyphElement:function(){return GlyphElement},GradientElement:function(){return GradientElement},ImageElement:function(){return ImageElement},LineElement:function(){return LineElement},LinearGradientElement:function(){return LinearGradientElement},MarkerElement:function(){return MarkerElement},MaskElement:function(){return MaskElement},Matrix:function(){return Matrix},MissingGlyphElement:function(){return MissingGlyphElement},Mouse:function(){return Mouse},PSEUDO_ZERO:function(){return Q},Parser:function(){return Parser},PathElement:function(){return PathElement},PathParser:function(){return PathParser},PatternElement:function(){return PatternElement},Point:function(){return Point},PolygonElement:function(){return PolygonElement},PolylineElement:function(){return PolylineElement},Property:function(){return Property},QB1:function(){return QB1},QB2:function(){return QB2},QB3:function(){return QB3},RadialGradientElement:function(){return RadialGradientElement},RectElement:function(){return RectElement},RenderedElement:function(){return RenderedElement},Rotate:function(){return Rotate},SVGElement:function(){return SVGElement},SVGFontLoader:function(){return SVGFontLoader},Scale:function(){return Scale},Screen:function(){return Screen},Skew:function(){return Skew},SkewX:function(){return SkewX},SkewY:function(){return SkewY},StopElement:function(){return StopElement},StyleElement:function(){return StyleElement},SymbolElement:function(){return SymbolElement},TRefElement:function(){return TRefElement},TSpanElement:function(){return TSpanElement},TextElement:function(){return TextElement},TextPathElement:function(){return TextPathElement},TitleElement:function(){return TitleElement},Transform:function(){return Transform},Translate:function(){return Translate},UnknownElement:function(){return UnknownElement},UseElement:function(){return UseElement},ViewPort:function(){return ViewPort},compressSpaces:function(){return compressSpaces},default:function(){return Canvg},getSelectorSpecificity:function(){return getSelectorSpecificity},normalizeAttributeName:function(){return normalizeAttributeName},normalizeColor:function(){return normalizeColor},parseExternalUrl:function(){return parseExternalUrl},presets:function(){return L},toNumbers:function(){return toNumbers},trimLeft:function(){return trimLeft},trimRight:function(){return trimRight},vectorMagnitude:function(){return vectorMagnitude},vectorsAngle:function(){return vectorsAngle},vectorsRatio:function(){return vectorsRatio}});d(88674);var f=d(49894),x=(d(4723),d(15306),d(23157),d(66992),d(33948),d(49888)),b=(d(85827),d(27852),d(23123),d(54087)),P=(d(73210),d(26131)),E=(d(82772),d(32023),d(65069),function(h,g){return(E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,g){h.__proto__=g}||function(h,g){for(var d in g)Object.prototype.hasOwnProperty.call(g,d)&&(h[d]=g[d])})(h,g)});function r(h,g){if("function"!=typeof g&&null!==g)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");function i(){this.constructor=h}E(h,g),h.prototype=null===g?Object.create(g):(i.prototype=g.prototype,new i)}function e(h){var g="";Array.isArray(h)||(h=[h]);for(var d=0;d<h.length;d++){var f=h[d];if(f.type===_.CLOSE_PATH)g+="z";else if(f.type===_.HORIZ_LINE_TO)g+=(f.relative?"h":"H")+f.x;else if(f.type===_.VERT_LINE_TO)g+=(f.relative?"v":"V")+f.y;else if(f.type===_.MOVE_TO)g+=(f.relative?"m":"M")+f.x+" "+f.y;else if(f.type===_.LINE_TO)g+=(f.relative?"l":"L")+f.x+" "+f.y;else if(f.type===_.CURVE_TO)g+=(f.relative?"c":"C")+f.x1+" "+f.y1+" "+f.x2+" "+f.y2+" "+f.x+" "+f.y;else if(f.type===_.SMOOTH_CURVE_TO)g+=(f.relative?"s":"S")+f.x2+" "+f.y2+" "+f.x+" "+f.y;else if(f.type===_.QUAD_TO)g+=(f.relative?"q":"Q")+f.x1+" "+f.y1+" "+f.x+" "+f.y;else if(f.type===_.SMOOTH_QUAD_TO)g+=(f.relative?"t":"T")+f.x+" "+f.y;else{if(f.type!==_.ARC)throw new Error('Unexpected command type "'+f.type+'" at index '+d+".");g+=(f.relative?"a":"A")+f.rX+" "+f.rY+" "+f.xRot+" "+ +f.lArcFlag+" "+ +f.sweepFlag+" "+f.x+" "+f.y}}return g}function i(h,g){var d=h[0],f=h[1];return[d*Math.cos(g)-f*Math.sin(g),d*Math.sin(g)+f*Math.cos(g)]}function a(){for(var h=[],g=0;g<arguments.length;g++)h[g]=arguments[g];for(var d=0;d<h.length;d++)if("number"!=typeof h[d])throw new Error("assertNumbers arguments["+d+"] is not a number. "+typeof h[d]+" == typeof "+h[d]);return!0}var S=Math.PI;function o(h,g,d){h.lArcFlag=0===h.lArcFlag?0:1,h.sweepFlag=0===h.sweepFlag?0:1;var f=h.rX,x=h.rY,b=h.x,P=h.y;f=Math.abs(h.rX),x=Math.abs(h.rY);var E=i([(g-b)/2,(d-P)/2],-h.xRot/180*S),w=E[0],C=E[1],A=Math.pow(w,2)/Math.pow(f,2)+Math.pow(C,2)/Math.pow(x,2);1<A&&(f*=Math.sqrt(A),x*=Math.sqrt(A)),h.rX=f,h.rY=x;var M=Math.pow(f,2)*Math.pow(C,2)+Math.pow(x,2)*Math.pow(w,2),N=(h.lArcFlag!==h.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(f,2)*Math.pow(x,2)-M)/M)),_=f*C/x*N,V=-x*w/f*N,k=i([_,V],h.xRot/180*S);h.cX=k[0]+(g+b)/2,h.cY=k[1]+(d+P)/2,h.phi1=Math.atan2((C-V)/x,(w-_)/f),h.phi2=Math.atan2((-C-V)/x,(-w-_)/f),0===h.sweepFlag&&h.phi2>h.phi1&&(h.phi2-=2*S),1===h.sweepFlag&&h.phi2<h.phi1&&(h.phi2+=2*S),h.phi1*=180/S,h.phi2*=180/S}function s(h,g,d){a(h,g,d);var f=h*h+g*g-d*d;if(0>f)return[];if(0===f)return[[h*d/(h*h+g*g),g*d/(h*h+g*g)]];var x=Math.sqrt(f);return[[(h*d+g*x)/(h*h+g*g),(g*d-h*x)/(h*h+g*g)],[(h*d-g*x)/(h*h+g*g),(g*d+h*x)/(h*h+g*g)]]}var w,C=Math.PI/180;function c(h,g,d){return(1-d)*h+d*g}function y(h,g,d,f){return h+Math.cos(f/180*S)*g+Math.sin(f/180*S)*d}function p(h,g,d,f){var x=1e-6,b=g-h,P=d-g,E=3*b+3*(f-d)-6*P,S=6*(P-b),w=3*b;return Math.abs(E)<x?[-w/S]:function(h,g,d){void 0===d&&(d=1e-6);var f=h*h/4-g;if(f<-d)return[];if(f<=d)return[-h/2];var x=Math.sqrt(f);return[-h/2-x,-h/2+x]}(S/E,w/E,x)}function m(h,g,d,f,x){var b=1-x;return h*(b*b*b)+g*(3*b*b*x)+d*(3*b*x*x)+f*(x*x*x)}!function(h){function r(){return u((function(h,g,d){return h.relative&&(void 0!==h.x1&&(h.x1+=g),void 0!==h.y1&&(h.y1+=d),void 0!==h.x2&&(h.x2+=g),void 0!==h.y2&&(h.y2+=d),void 0!==h.x&&(h.x+=g),void 0!==h.y&&(h.y+=d),h.relative=!1),h}))}function e(){var h=NaN,g=NaN,d=NaN,f=NaN;return u((function(x,b,P){return x.type&_.SMOOTH_CURVE_TO&&(x.type=_.CURVE_TO,h=isNaN(h)?b:h,g=isNaN(g)?P:g,x.x1=x.relative?b-h:2*b-h,x.y1=x.relative?P-g:2*P-g),x.type&_.CURVE_TO?(h=x.relative?b+x.x2:x.x2,g=x.relative?P+x.y2:x.y2):(h=NaN,g=NaN),x.type&_.SMOOTH_QUAD_TO&&(x.type=_.QUAD_TO,d=isNaN(d)?b:d,f=isNaN(f)?P:f,x.x1=x.relative?b-d:2*b-d,x.y1=x.relative?P-f:2*P-f),x.type&_.QUAD_TO?(d=x.relative?b+x.x1:x.x1,f=x.relative?P+x.y1:x.y1):(d=NaN,f=NaN),x}))}function n(){var h=NaN,g=NaN;return u((function(d,f,x){if(d.type&_.SMOOTH_QUAD_TO&&(d.type=_.QUAD_TO,h=isNaN(h)?f:h,g=isNaN(g)?x:g,d.x1=d.relative?f-h:2*f-h,d.y1=d.relative?x-g:2*x-g),d.type&_.QUAD_TO){h=d.relative?f+d.x1:d.x1,g=d.relative?x+d.y1:d.y1;var b=d.x1,P=d.y1;d.type=_.CURVE_TO,d.x1=((d.relative?0:f)+2*b)/3,d.y1=((d.relative?0:x)+2*P)/3,d.x2=(d.x+2*b)/3,d.y2=(d.y+2*P)/3}else h=NaN,g=NaN;return d}))}function u(h){var g=0,d=0,f=NaN,x=NaN;return function(b){if(isNaN(f)&&!(b.type&_.MOVE_TO))throw new Error("path must start with moveto");var P=h(b,g,d,f,x);return b.type&_.CLOSE_PATH&&(g=f,d=x),void 0!==b.x&&(g=b.relative?g+b.x:b.x),void 0!==b.y&&(d=b.relative?d+b.y:b.y),b.type&_.MOVE_TO&&(f=g,x=d),P}}function O(h,g,d,f,x,b){return a(h,g,d,f,x,b),u((function(P,E,S,w){var C=P.x1,A=P.x2,M=P.relative&&!isNaN(w),N=void 0!==P.x?P.x:M?0:E,V=void 0!==P.y?P.y:M?0:S;function l(h){return h*h}P.type&_.HORIZ_LINE_TO&&0!==g&&(P.type=_.LINE_TO,P.y=P.relative?0:S),P.type&_.VERT_LINE_TO&&0!==d&&(P.type=_.LINE_TO,P.x=P.relative?0:E),void 0!==P.x&&(P.x=P.x*h+V*d+(M?0:x)),void 0!==P.y&&(P.y=N*g+P.y*f+(M?0:b)),void 0!==P.x1&&(P.x1=P.x1*h+P.y1*d+(M?0:x)),void 0!==P.y1&&(P.y1=C*g+P.y1*f+(M?0:b)),void 0!==P.x2&&(P.x2=P.x2*h+P.y2*d+(M?0:x)),void 0!==P.y2&&(P.y2=A*g+P.y2*f+(M?0:b));var k=h*f-g*d;if(void 0!==P.xRot&&(1!==h||0!==g||0!==d||1!==f))if(0===k)delete P.rX,delete P.rY,delete P.xRot,delete P.lArcFlag,delete P.sweepFlag,P.type=_.LINE_TO;else{var R=P.xRot*Math.PI/180,B=Math.sin(R),L=Math.cos(R),D=1/l(P.rX),F=1/l(P.rY),z=l(L)*D+l(B)*F,U=2*B*L*(D-F),X=l(B)*D+l(L)*F,Y=z*f*f-U*g*f+X*g*g,G=U*(h*f+g*d)-2*(z*d*f+X*h*g),j=z*d*d-U*h*d+X*h*h,Q=(Math.atan2(G,Y-j)+Math.PI)%Math.PI/2,q=Math.sin(Q),W=Math.cos(Q);P.rX=Math.abs(k)/Math.sqrt(Y*l(W)+G*q*W+j*l(q)),P.rY=Math.abs(k)/Math.sqrt(Y*l(q)-G*q*W+j*l(W)),P.xRot=180*Q/Math.PI}return void 0!==P.sweepFlag&&0>k&&(P.sweepFlag=+!P.sweepFlag),P}))}function l(){return function(h){var g={};for(var d in h)g[d]=h[d];return g}}h.ROUND=function(h){function r(g){return Math.round(g*h)/h}return void 0===h&&(h=1e13),a(h),function(h){return void 0!==h.x1&&(h.x1=r(h.x1)),void 0!==h.y1&&(h.y1=r(h.y1)),void 0!==h.x2&&(h.x2=r(h.x2)),void 0!==h.y2&&(h.y2=r(h.y2)),void 0!==h.x&&(h.x=r(h.x)),void 0!==h.y&&(h.y=r(h.y)),void 0!==h.rX&&(h.rX=r(h.rX)),void 0!==h.rY&&(h.rY=r(h.rY)),h}},h.TO_ABS=r,h.TO_REL=function(){return u((function(h,g,d){return h.relative||(void 0!==h.x1&&(h.x1-=g),void 0!==h.y1&&(h.y1-=d),void 0!==h.x2&&(h.x2-=g),void 0!==h.y2&&(h.y2-=d),void 0!==h.x&&(h.x-=g),void 0!==h.y&&(h.y-=d),h.relative=!0),h}))},h.NORMALIZE_HVZ=function(h,g,d){return void 0===h&&(h=!0),void 0===g&&(g=!0),void 0===d&&(d=!0),u((function(f,x,b,P,E){if(isNaN(P)&&!(f.type&_.MOVE_TO))throw new Error("path must start with moveto");return g&&f.type&_.HORIZ_LINE_TO&&(f.type=_.LINE_TO,f.y=f.relative?0:b),d&&f.type&_.VERT_LINE_TO&&(f.type=_.LINE_TO,f.x=f.relative?0:x),h&&f.type&_.CLOSE_PATH&&(f.type=_.LINE_TO,f.x=f.relative?P-x:P,f.y=f.relative?E-b:E),f.type&_.ARC&&(0===f.rX||0===f.rY)&&(f.type=_.LINE_TO,delete f.rX,delete f.rY,delete f.xRot,delete f.lArcFlag,delete f.sweepFlag),f}))},h.NORMALIZE_ST=e,h.QT_TO_C=n,h.INFO=u,h.SANITIZE=function(h){void 0===h&&(h=0),a(h);var g=NaN,d=NaN,f=NaN,x=NaN;return u((function(b,P,E,S,w){var C=Math.abs,A=!1,M=0,N=0;if(b.type&_.SMOOTH_CURVE_TO&&(M=isNaN(g)?0:P-g,N=isNaN(d)?0:E-d),b.type&(_.CURVE_TO|_.SMOOTH_CURVE_TO)?(g=b.relative?P+b.x2:b.x2,d=b.relative?E+b.y2:b.y2):(g=NaN,d=NaN),b.type&_.SMOOTH_QUAD_TO?(f=isNaN(f)?P:2*P-f,x=isNaN(x)?E:2*E-x):b.type&_.QUAD_TO?(f=b.relative?P+b.x1:b.x1,x=b.relative?E+b.y1:b.y2):(f=NaN,x=NaN),b.type&_.LINE_COMMANDS||b.type&_.ARC&&(0===b.rX||0===b.rY||!b.lArcFlag)||b.type&_.CURVE_TO||b.type&_.SMOOTH_CURVE_TO||b.type&_.QUAD_TO||b.type&_.SMOOTH_QUAD_TO){var V=void 0===b.x?0:b.relative?b.x:b.x-P,k=void 0===b.y?0:b.relative?b.y:b.y-E;M=isNaN(f)?void 0===b.x1?M:b.relative?b.x:b.x1-P:f-P,N=isNaN(x)?void 0===b.y1?N:b.relative?b.y:b.y1-E:x-E;var R=void 0===b.x2?0:b.relative?b.x:b.x2-P,B=void 0===b.y2?0:b.relative?b.y:b.y2-E;C(V)<=h&&C(k)<=h&&C(M)<=h&&C(N)<=h&&C(R)<=h&&C(B)<=h&&(A=!0)}return b.type&_.CLOSE_PATH&&C(P-S)<=h&&C(E-w)<=h&&(A=!0),A?[]:b}))},h.MATRIX=O,h.ROTATE=function(h,g,d){void 0===g&&(g=0),void 0===d&&(d=0),a(h,g,d);var f=Math.sin(h),x=Math.cos(h);return O(x,f,-f,x,g-g*x+d*f,d-g*f-d*x)},h.TRANSLATE=function(h,g){return void 0===g&&(g=0),a(h,g),O(1,0,0,1,h,g)},h.SCALE=function(h,g){return void 0===g&&(g=h),a(h,g),O(h,0,0,g,0,0)},h.SKEW_X=function(h){return a(h),O(1,0,Math.atan(h),1,0,0)},h.SKEW_Y=function(h){return a(h),O(1,Math.atan(h),0,1,0,0)},h.X_AXIS_SYMMETRY=function(h){return void 0===h&&(h=0),a(h),O(-1,0,0,1,h,0)},h.Y_AXIS_SYMMETRY=function(h){return void 0===h&&(h=0),a(h),O(1,0,0,-1,0,h)},h.A_TO_C=function(){return u((function(h,g,d){return _.ARC===h.type?function(h,g,d){var f,x,b,P;h.cX||o(h,g,d);for(var E=Math.min(h.phi1,h.phi2),S=Math.max(h.phi1,h.phi2)-E,w=Math.ceil(S/90),A=new Array(w),M=g,N=d,V=0;V<w;V++){var k=c(h.phi1,h.phi2,V/w),R=c(h.phi1,h.phi2,(V+1)/w),B=R-k,L=4/3*Math.tan(B*C/4),D=[Math.cos(k*C)-L*Math.sin(k*C),Math.sin(k*C)+L*Math.cos(k*C)],F=D[0],z=D[1],U=[Math.cos(R*C),Math.sin(R*C)],X=U[0],Y=U[1],G=[X+L*Math.sin(R*C),Y-L*Math.cos(R*C)],j=G[0],Q=G[1];A[V]={relative:h.relative,type:_.CURVE_TO};var H=function(g,d){var f=i([g*h.rX,d*h.rY],h.xRot),x=f[0],b=f[1];return[h.cX+x,h.cY+b]};f=H(F,z),A[V].x1=f[0],A[V].y1=f[1],x=H(j,Q),A[V].x2=x[0],A[V].y2=x[1],b=H(X,Y),A[V].x=b[0],A[V].y=b[1],h.relative&&(A[V].x1-=M,A[V].y1-=N,A[V].x2-=M,A[V].y2-=N,A[V].x-=M,A[V].y-=N),M=(P=[A[V].x,A[V].y])[0],N=P[1]}return A}(h,h.relative?0:g,h.relative?0:d):h}))},h.ANNOTATE_ARCS=function(){return u((function(h,g,d){return h.relative&&(g=0,d=0),_.ARC===h.type&&o(h,g,d),h}))},h.CLONE=l,h.CALCULATE_BOUNDS=function(){var t=function(h){var g={};for(var d in h)g[d]=h[d];return g},h=r(),g=n(),d=e(),f=u((function(x,b,P){var E=d(g(h(t(x))));function O(h){h>f.maxX&&(f.maxX=h),h<f.minX&&(f.minX=h)}function l(h){h>f.maxY&&(f.maxY=h),h<f.minY&&(f.minY=h)}if(E.type&_.DRAWING_COMMANDS&&(O(b),l(P)),E.type&_.HORIZ_LINE_TO&&O(E.x),E.type&_.VERT_LINE_TO&&l(E.y),E.type&_.LINE_TO&&(O(E.x),l(E.y)),E.type&_.CURVE_TO){O(E.x),l(E.y);for(var S=0,w=p(b,E.x1,E.x2,E.x);S<w.length;S++)0<(Y=w[S])&&1>Y&&O(m(b,E.x1,E.x2,E.x,Y));for(var C=0,A=p(P,E.y1,E.y2,E.y);C<A.length;C++)0<(Y=A[C])&&1>Y&&l(m(P,E.y1,E.y2,E.y,Y))}if(E.type&_.ARC){O(E.x),l(E.y),o(E,b,P);for(var M=E.xRot/180*Math.PI,N=Math.cos(M)*E.rX,V=Math.sin(M)*E.rX,k=-Math.sin(M)*E.rY,R=Math.cos(M)*E.rY,B=E.phi1<E.phi2?[E.phi1,E.phi2]:-180>E.phi2?[E.phi2+360,E.phi1+360]:[E.phi2,E.phi1],L=B[0],D=B[1],I=function(h){var g=h[0],d=h[1],f=180*Math.atan2(d,g)/Math.PI;return f<L?f+360:f},F=0,z=s(k,-N,0).map(I);F<z.length;F++)(Y=z[F])>L&&Y<D&&O(y(E.cX,N,k,Y));for(var U=0,X=s(R,-V,0).map(I);U<X.length;U++){var Y;(Y=X[U])>L&&Y<D&&l(y(E.cY,V,R,Y))}}return x}));return f.minX=1/0,f.maxX=-1/0,f.minY=1/0,f.maxY=-1/0,f}}(w||(w={}));var A,M=function(){function t(){}return t.prototype.round=function(h){return this.transform(w.ROUND(h))},t.prototype.toAbs=function(){return this.transform(w.TO_ABS())},t.prototype.toRel=function(){return this.transform(w.TO_REL())},t.prototype.normalizeHVZ=function(h,g,d){return this.transform(w.NORMALIZE_HVZ(h,g,d))},t.prototype.normalizeST=function(){return this.transform(w.NORMALIZE_ST())},t.prototype.qtToC=function(){return this.transform(w.QT_TO_C())},t.prototype.aToC=function(){return this.transform(w.A_TO_C())},t.prototype.sanitize=function(h){return this.transform(w.SANITIZE(h))},t.prototype.translate=function(h,g){return this.transform(w.TRANSLATE(h,g))},t.prototype.scale=function(h,g){return this.transform(w.SCALE(h,g))},t.prototype.rotate=function(h,g,d){return this.transform(w.ROTATE(h,g,d))},t.prototype.matrix=function(h,g,d,f,x,b){return this.transform(w.MATRIX(h,g,d,f,x,b))},t.prototype.skewX=function(h){return this.transform(w.SKEW_X(h))},t.prototype.skewY=function(h){return this.transform(w.SKEW_Y(h))},t.prototype.xSymmetry=function(h){return this.transform(w.X_AXIS_SYMMETRY(h))},t.prototype.ySymmetry=function(h){return this.transform(w.Y_AXIS_SYMMETRY(h))},t.prototype.annotateArcs=function(){return this.transform(w.ANNOTATE_ARCS())},t}(),T=function(h){return" "===h||"\t"===h||"\r"===h||"\n"===h},v=function(h){return"0".charCodeAt(0)<=h.charCodeAt(0)&&h.charCodeAt(0)<="9".charCodeAt(0)},N=function(h){function e(){var g=h.call(this)||this;return g.curNumber="",g.curCommandType=-1,g.curCommandRelative=!1,g.canParseCommandOrComma=!0,g.curNumberHasExp=!1,g.curNumberHasExpDigits=!1,g.curNumberHasDecimal=!1,g.curArgs=[],g}return r(e,h),e.prototype.finish=function(h){if(void 0===h&&(h=[]),this.parse(" ",h),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return h},e.prototype.parse=function(h,g){var d=this;void 0===g&&(g=[]);for(var i=function(h){g.push(h),d.curArgs.length=0,d.canParseCommandOrComma=!0},f=0;f<h.length;f++){var x=h[f],b=!(this.curCommandType!==_.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),P=v(x)&&("0"===this.curNumber&&"0"===x||b);if(!v(x)||P)if("e"!==x&&"E"!==x)if("-"!==x&&"+"!==x||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==x||this.curNumberHasExp||this.curNumberHasDecimal||b){if(this.curNumber&&-1!==this.curCommandType){var E=Number(this.curNumber);if(isNaN(E))throw new SyntaxError("Invalid number ending at "+f);if(this.curCommandType===_.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>E)throw new SyntaxError('Expected positive number, got "'+E+'" at index "'+f+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+f+'"');this.curArgs.push(E),this.curArgs.length===V[this.curCommandType]&&(_.HORIZ_LINE_TO===this.curCommandType?i({type:_.HORIZ_LINE_TO,relative:this.curCommandRelative,x:E}):_.VERT_LINE_TO===this.curCommandType?i({type:_.VERT_LINE_TO,relative:this.curCommandRelative,y:E}):this.curCommandType===_.MOVE_TO||this.curCommandType===_.LINE_TO||this.curCommandType===_.SMOOTH_QUAD_TO?(i({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),_.MOVE_TO===this.curCommandType&&(this.curCommandType=_.LINE_TO)):this.curCommandType===_.CURVE_TO?i({type:_.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===_.SMOOTH_CURVE_TO?i({type:_.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_.QUAD_TO?i({type:_.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_.ARC&&i({type:_.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!T(x))if(","===x&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==x&&"-"!==x&&"."!==x)if(P)this.curNumber=x,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+f+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+x+'" at index '+f+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==x&&"Z"!==x)if("h"===x||"H"===x)this.curCommandType=_.HORIZ_LINE_TO,this.curCommandRelative="h"===x;else if("v"===x||"V"===x)this.curCommandType=_.VERT_LINE_TO,this.curCommandRelative="v"===x;else if("m"===x||"M"===x)this.curCommandType=_.MOVE_TO,this.curCommandRelative="m"===x;else if("l"===x||"L"===x)this.curCommandType=_.LINE_TO,this.curCommandRelative="l"===x;else if("c"===x||"C"===x)this.curCommandType=_.CURVE_TO,this.curCommandRelative="c"===x;else if("s"===x||"S"===x)this.curCommandType=_.SMOOTH_CURVE_TO,this.curCommandRelative="s"===x;else if("q"===x||"Q"===x)this.curCommandType=_.QUAD_TO,this.curCommandRelative="q"===x;else if("t"===x||"T"===x)this.curCommandType=_.SMOOTH_QUAD_TO,this.curCommandRelative="t"===x;else{if("a"!==x&&"A"!==x)throw new SyntaxError('Unexpected character "'+x+'" at index '+f+".");this.curCommandType=_.ARC,this.curCommandRelative="a"===x}else g.push({type:_.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=x,this.curNumberHasDecimal="."===x}else this.curNumber+=x,this.curNumberHasDecimal=!0;else this.curNumber+=x;else this.curNumber+=x,this.curNumberHasExp=!0;else this.curNumber+=x,this.curNumberHasExpDigits=this.curNumberHasExp}return g},e.prototype.transform=function(h){return Object.create(this,{parse:{value:function(g,d){void 0===d&&(d=[]);for(var f=0,x=Object.getPrototypeOf(this).parse.call(this,g);f<x.length;f++){var b=x[f],P=h(b);Array.isArray(P)?d.push.apply(d,P):d.push(P)}return d}}})},e}(M),_=function(h){function i(g){var d=h.call(this)||this;return d.commands="string"==typeof g?i.parse(g):g,d}return r(i,h),i.prototype.encode=function(){return i.encode(this.commands)},i.prototype.getBounds=function(){var h=w.CALCULATE_BOUNDS();return this.transform(h),h},i.prototype.transform=function(h){for(var g=[],d=0,f=this.commands;d<f.length;d++){var x=h(f[d]);Array.isArray(x)?g.push.apply(g,x):g.push(x)}return this.commands=g,this},i.encode=function(h){return e(h)},i.parse=function(h){var g=new N,d=[];return g.parse(h,d),g.finish(d),d},i.CLOSE_PATH=1,i.MOVE_TO=2,i.HORIZ_LINE_TO=4,i.VERT_LINE_TO=8,i.LINE_TO=16,i.CURVE_TO=32,i.SMOOTH_CURVE_TO=64,i.QUAD_TO=128,i.SMOOTH_QUAD_TO=256,i.ARC=512,i.LINE_COMMANDS=i.LINE_TO|i.HORIZ_LINE_TO|i.VERT_LINE_TO,i.DRAWING_COMMANDS=i.HORIZ_LINE_TO|i.VERT_LINE_TO|i.LINE_TO|i.CURVE_TO|i.SMOOTH_CURVE_TO|i.QUAD_TO|i.SMOOTH_QUAD_TO|i.ARC,i}(M),V=((A={})[_.MOVE_TO]=2,A[_.LINE_TO]=2,A[_.HORIZ_LINE_TO]=1,A[_.VERT_LINE_TO]=1,A[_.CLOSE_PATH]=0,A[_.QUAD_TO]=4,A[_.SMOOTH_QUAD_TO]=2,A[_.CURVE_TO]=6,A[_.SMOOTH_CURVE_TO]=4,A[_.ARC]=7,A);d(39714);function _typeof(h){return _typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(h){return typeof h}:function(h){return h&&"function"===typeof Symbol&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},_typeof(h)}function _classCallCheck(h,g){if(!(h instanceof g))throw new TypeError("Cannot call a class as a function")}var k=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],R=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function getImageDataFromCanvas(h,g,d,f,x){if("string"===typeof h&&(h=document.getElementById(h)),!h||"object"!==_typeof(h)||!("getContext"in h))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var b=h.getContext("2d");try{return b.getImageData(g,d,f,x)}catch(e){throw new Error("unable to access image data: "+e)}}function processCanvasRGBA(h,g,d,f,x,b){if(!(isNaN(b)||b<1)){b|=0;var P=getImageDataFromCanvas(h,g,d,f,x);P=processImageDataRGBA(P,g,d,f,x,b),h.getContext("2d").putImageData(P,g,d)}}function processImageDataRGBA(h,g,d,f,x,b){for(var P,E=h.data,S=2*b+1,w=f-1,C=x-1,A=b+1,M=A*(A+1)/2,N=new B,_=N,V=1;V<S;V++)_=_.next=new B,V===A&&(P=_);_.next=N;for(var L=null,D=null,F=0,z=0,U=k[b],X=R[b],Y=0;Y<x;Y++){_=N;for(var G=E[z],j=E[z+1],Q=E[z+2],q=E[z+3],W=0;W<A;W++)_.r=G,_.g=j,_.b=Q,_.a=q,_=_.next;for(var $=0,Z=0,K=0,J=0,tt=A*G,et=A*j,rt=A*Q,it=A*q,nt=M*G,at=M*j,st=M*Q,ot=M*q,ht=1;ht<A;ht++){var lt=z+((w<ht?w:ht)<<2),ut=E[lt],ct=E[lt+1],gt=E[lt+2],dt=E[lt+3],pt=A-ht;nt+=(_.r=ut)*pt,at+=(_.g=ct)*pt,st+=(_.b=gt)*pt,ot+=(_.a=dt)*pt,$+=ut,Z+=ct,K+=gt,J+=dt,_=_.next}L=N,D=P;for(var ft=0;ft<f;ft++){var mt=ot*U>>X;if(E[z+3]=mt,0!==mt){var yt=255/mt;E[z]=(nt*U>>X)*yt,E[z+1]=(at*U>>X)*yt,E[z+2]=(st*U>>X)*yt}else E[z]=E[z+1]=E[z+2]=0;nt-=tt,at-=et,st-=rt,ot-=it,tt-=L.r,et-=L.g,rt-=L.b,it-=L.a;var vt=ft+b+1;vt=F+(vt<w?vt:w)<<2,$+=L.r=E[vt],Z+=L.g=E[vt+1],K+=L.b=E[vt+2],J+=L.a=E[vt+3],nt+=$,at+=Z,st+=K,ot+=J,L=L.next;var xt=D,bt=xt.r,Pt=xt.g,Et=xt.b,St=xt.a;tt+=bt,et+=Pt,rt+=Et,it+=St,$-=bt,Z-=Pt,K-=Et,J-=St,D=D.next,z+=4}F+=f}for(var Tt=0;Tt<f;Tt++){z=Tt<<2;var wt=E[z],Ct=E[z+1],At=E[z+2],Ot=E[z+3],Mt=A*wt,Nt=A*Ct,_t=A*At,Vt=A*Ot,kt=M*wt,Rt=M*Ct,It=M*At,Bt=M*Ot;_=N;for(var Lt=0;Lt<A;Lt++)_.r=wt,_.g=Ct,_.b=At,_.a=Ot,_=_.next;for(var Dt=f,Ft=0,zt=0,Ut=0,Ht=0,Xt=1;Xt<=b;Xt++){z=Dt+Tt<<2;var Yt=A-Xt;kt+=(_.r=wt=E[z])*Yt,Rt+=(_.g=Ct=E[z+1])*Yt,It+=(_.b=At=E[z+2])*Yt,Bt+=(_.a=Ot=E[z+3])*Yt,Ht+=wt,Ft+=Ct,zt+=At,Ut+=Ot,_=_.next,Xt<C&&(Dt+=f)}z=Tt,L=N,D=P;for(var Gt=0;Gt<x;Gt++){var jt=z<<2;E[jt+3]=Ot=Bt*U>>X,Ot>0?(Ot=255/Ot,E[jt]=(kt*U>>X)*Ot,E[jt+1]=(Rt*U>>X)*Ot,E[jt+2]=(It*U>>X)*Ot):E[jt]=E[jt+1]=E[jt+2]=0,kt-=Mt,Rt-=Nt,It-=_t,Bt-=Vt,Mt-=L.r,Nt-=L.g,_t-=L.b,Vt-=L.a,jt=Tt+((jt=Gt+A)<C?jt:C)*f<<2,kt+=Ht+=L.r=E[jt],Rt+=Ft+=L.g=E[jt+1],It+=zt+=L.b=E[jt+2],Bt+=Ut+=L.a=E[jt+3],L=L.next,Mt+=wt=D.r,Nt+=Ct=D.g,_t+=At=D.b,Vt+=Ot=D.a,Ht-=wt,Ft-=Ct,zt-=At,Ut-=Ot,D=D.next,z+=f}}return h}var B=function BlurStack(){_classCallCheck(this,BlurStack),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};function offscreen(){var{DOMParser:h}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},g={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:h,createCanvas(h,g){return new OffscreenCanvas(h,g)},createImage(h){return(0,f.Z)((function*(){var g=yield fetch(h),d=yield g.blob(),f=yield createImageBitmap(d);return f}))()}};return"undefined"===typeof DOMParser&&"undefined"!==typeof h||Reflect.deleteProperty(g,"DOMParser"),g}function node(h){var{DOMParser:g,canvas:d,fetch:f}=h;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:g,fetch:f,createCanvas:d.createCanvas,createImage:d.loadImage}}var L=Object.freeze({__proto__:null,offscreen:offscreen,node:node});function compressSpaces(h){return h.replace(/(?!\u3000)\s+/gm," ")}function trimLeft(h){return h.replace(/^[\n \t]+/,"")}function trimRight(h){return h.replace(/[\n \t]+$/,"")}function toNumbers(h){var g=(h||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return g.map(parseFloat)}var D=/^[A-Z-]+$/;function normalizeAttributeName(h){return D.test(h)?h.toLowerCase():h}function parseExternalUrl(h){var g=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(h)||[];return g[2]||g[3]||g[4]}function normalizeColor(h){if(!h.startsWith("rgb"))return h;var g=3,d=h.replace(/\d+(\.\d+)?/g,((h,d)=>g--&&d?String(Math.round(parseFloat(h))):h));return d}var F=/(\[[^\]]+\])/g,z=/(#[^\s+>~.[:]+)/g,U=/(\.[^\s+>~.[:]+)/g,X=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,Y=/(:[\w-]+\([^)]*\))/gi,G=/(:[^\s+>~.[:]+)/g,j=/([^\s+>~.[:]+)/g;function findSelectorMatch(h,g){var d=g.exec(h);return d?[h.replace(g," "),d.length]:[h,0]}function getSelectorSpecificity(h){var g=[0,0,0],d=h.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),f=0;return[d,f]=findSelectorMatch(d,F),g[1]+=f,[d,f]=findSelectorMatch(d,z),g[0]+=f,[d,f]=findSelectorMatch(d,U),g[1]+=f,[d,f]=findSelectorMatch(d,X),g[2]+=f,[d,f]=findSelectorMatch(d,Y),g[1]+=f,[d,f]=findSelectorMatch(d,G),g[1]+=f,d=d.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[d,f]=findSelectorMatch(d,j),g[2]+=f,g.join("")}var Q=1e-8;function vectorMagnitude(h){return Math.sqrt(Math.pow(h[0],2)+Math.pow(h[1],2))}function vectorsRatio(h,g){return(h[0]*g[0]+h[1]*g[1])/(vectorMagnitude(h)*vectorMagnitude(g))}function vectorsAngle(h,g){return(h[0]*g[1]<h[1]*g[0]?-1:1)*Math.acos(vectorsRatio(h,g))}function CB1(h){return h*h*h}function CB2(h){return 3*h*h*(1-h)}function CB3(h){return 3*h*(1-h)*(1-h)}function CB4(h){return(1-h)*(1-h)*(1-h)}function QB1(h){return h*h}function QB2(h){return 2*h*(1-h)}function QB3(h){return(1-h)*(1-h)}class Property{constructor(h,g,d){this.document=h,this.name=g,this.value=d,this.isNormalizedColor=!1}static empty(h){return new Property(h,"EMPTY","")}split(){var h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:" ",{document:g,name:d}=this;return compressSpaces(this.getString()).trim().split(h).map((h=>new Property(g,d,h)))}hasValue(h){var{value:g}=this;return null!==g&&""!==g&&(h||0!==g)&&"undefined"!==typeof g}isString(h){var{value:g}=this,d="string"===typeof g;return d&&h?h.test(g):d}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var h=this.getString();switch(!0){case h.endsWith("px"):case/^[0-9]+$/.test(h):return!0;default:return!1}}setValue(h){return this.value=h,this}getValue(h){return"undefined"===typeof h||this.hasValue()?this.value:h}getNumber(h){if(!this.hasValue())return"undefined"===typeof h?0:parseFloat(h);var{value:g}=this,d=parseFloat(g);return this.isString(/%$/)&&(d/=100),d}getString(h){return"undefined"===typeof h||this.hasValue()?"undefined"===typeof this.value?"":String(this.value):String(h)}getColor(h){var g=this.getString(h);return this.isNormalizedColor||(this.isNormalizedColor=!0,g=normalizeColor(g),this.value=g),g}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(h){var g=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasValue())return 0;var[d,f]="boolean"===typeof h?[void 0,h]:[h],{viewPort:x}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(x.computeSize("x"),x.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(x.computeSize("x"),x.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*x.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*x.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return 15*this.getNumber();case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case this.isString(/%$/)&&f:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*x.computeSize(d);default:var b=this.getNumber();return g&&b<1?b*x.computeSize(d):b}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var h=this.getString(),g=/#([^)'"]+)/.exec(h);return g&&(g=g[1]),g||(g=h),this.document.definitions[g]}getFillStyleDefinition(h,g){var d=this.getDefinition();if(!d)return null;if("function"===typeof d.createGradient)return d.createGradient(this.document.ctx,h,g);if("function"===typeof d.createPattern){if(d.getHrefAttribute().hasValue()){var f=d.getAttribute("patternTransform");d=d.getHrefAttribute().getDefinition(),f.hasValue()&&d.getAttribute("patternTransform",!0).setValue(f.value)}return d.createPattern(this.document.ctx,h,g)}return null}getTextBaseline(){return this.hasValue()?Property.textBaselineMapping[this.getString()]:null}addOpacity(h){for(var g=this.getColor(),d=g.length,f=0,x=0;x<d;x++)if(","===g[x]&&f++,3===f)break;if(h.hasValue()&&this.isString()&&3!==f){var b=new P(g);b.ok&&(b.alpha=h.getNumber(),g=b.toRGBA())}return new Property(this.document,this.name,g)}}Property.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};class ViewPort{constructor(){this.viewPorts=[]}clear(){this.viewPorts=[]}setCurrent(h,g){this.viewPorts.push({width:h,height:g})}removeCurrent(){this.viewPorts.pop()}getCurrent(){var{viewPorts:h}=this;return h[h.length-1]}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(h){return"number"===typeof h?h:"x"===h?this.width:"y"===h?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}class Point{constructor(h,g){this.x=h,this.y=g}static parse(h){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,[d=g,f=g]=toNumbers(h);return new Point(d,f)}static parseScale(h){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,[d=g,f=d]=toNumbers(h);return new Point(d,f)}static parsePath(h){for(var g=toNumbers(h),d=g.length,f=[],x=0;x<d;x+=2)f.push(new Point(g[x],g[x+1]));return f}angleTo(h){return Math.atan2(h.y-this.y,h.x-this.x)}applyTransform(h){var{x:g,y:d}=this,f=g*h[0]+d*h[2]+h[4],x=g*h[1]+d*h[3]+h[5];this.x=f,this.y=x}}class Mouse{constructor(h){this.screen=h,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}isWorking(){return this.working}start(){if(!this.working){var{screen:h,onClick:g,onMouseMove:d}=this,f=h.ctx.canvas;f.onclick=g,f.onmousemove=d,this.working=!0}}stop(){if(this.working){var h=this.screen.ctx.canvas;this.working=!1,h.onclick=null,h.onmousemove=null}}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(this.working){var{screen:h,events:g,eventElements:d}=this,{style:f}=h.ctx.canvas;f&&(f.cursor=""),g.forEach(((h,g)=>{var{run:f}=h,x=d[g];while(x)f(x),x=x.parent})),this.events=[],this.eventElements=[]}}checkPath(h,g){if(this.working&&g){var{events:d,eventElements:f}=this;d.forEach(((d,x)=>{var{x:b,y:P}=d;!f[x]&&g.isPointInPath&&g.isPointInPath(b,P)&&(f[x]=h)}))}}checkBoundingBox(h,g){if(this.working&&g){var{events:d,eventElements:f}=this;d.forEach(((d,x)=>{var{x:b,y:P}=d;!f[x]&&g.isPointInBox(b,P)&&(f[x]=h)}))}}mapXY(h,g){var{window:d,ctx:f}=this.screen,x=new Point(h,g),b=f.canvas;while(b)x.x-=b.offsetLeft,x.y-=b.offsetTop,b=b.offsetParent;return d.scrollX&&(x.x+=d.scrollX),d.scrollY&&(x.y+=d.scrollY),x}onClick(h){var{x:g,y:d}=this.mapXY(h.clientX,h.clientY);this.events.push({type:"onclick",x:g,y:d,run(h){h.onClick&&h.onClick()}})}onMouseMove(h){var{x:g,y:d}=this.mapXY(h.clientX,h.clientY);this.events.push({type:"onmousemove",x:g,y:d,run(h){h.onMouseMove&&h.onMouseMove()}})}}var q="undefined"!==typeof window?window:null,W="undefined"!==typeof fetch?fetch.bind(void 0):null;class Screen{constructor(h){var{fetch:g=W,window:d=q}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.ctx=h,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new ViewPort,this.mouse=new Mouse(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=d,this.fetch=g}wait(h){this.waits.push(h)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var h=this.waits.every((h=>h()));return h&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=h,h}setDefaults(h){h.strokeStyle="rgba(0,0,0,0)",h.lineCap="butt",h.lineJoin="miter",h.miterLimit=4}setViewBox(h){var{document:g,ctx:d,aspectRatio:f,width:x,desiredWidth:b,height:P,desiredHeight:E,minX:S=0,minY:w=0,refX:C,refY:A,clip:M=!1,clipX:N=0,clipY:_=0}=h,V=compressSpaces(f).replace(/^defer\s/,""),[k,R]=V.split(" "),B=k||"xMidYMid",L=R||"meet",D=x/b,F=P/E,z=Math.min(D,F),U=Math.max(D,F),X=b,Y=E;"meet"===L&&(X*=z,Y*=z),"slice"===L&&(X*=U,Y*=U);var G=new Property(g,"refX",C),j=new Property(g,"refY",A),Q=G.hasValue()&&j.hasValue();if(Q&&d.translate(-z*G.getPixels("x"),-z*j.getPixels("y")),M){var q=z*N,W=z*_;d.beginPath(),d.moveTo(q,W),d.lineTo(x,W),d.lineTo(x,P),d.lineTo(q,P),d.closePath(),d.clip()}if(!Q){var $="meet"===L&&z===F,Z="slice"===L&&U===F,K="meet"===L&&z===D,J="slice"===L&&U===D;B.startsWith("xMid")&&($||Z)&&d.translate(x/2-X/2,0),B.endsWith("YMid")&&(K||J)&&d.translate(0,P/2-Y/2),B.startsWith("xMax")&&($||Z)&&d.translate(x-X,0),B.endsWith("YMax")&&(K||J)&&d.translate(0,P-Y)}switch(!0){case"none"===B:d.scale(D,F);break;case"meet"===L:d.scale(z,z);break;case"slice"===L:d.scale(U,U);break}d.translate(-S,-w)}start(h){var{enableRedraw:g=!1,ignoreMouse:d=!1,ignoreAnimation:f=!1,ignoreDimensions:x=!1,ignoreClear:P=!1,forceRedraw:E,scaleWidth:S,scaleHeight:w,offsetX:C,offsetY:A}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{FRAMERATE:M,mouse:N}=this,_=1e3/M;if(this.frameDuration=_,this.readyPromise=new Promise((h=>{this.resolveReady=h})),this.isReady()&&this.render(h,x,P,S,w,C,A),g){var V=Date.now(),k=V,R=0,tick=()=>{V=Date.now(),R=V-k,R>=_&&(k=V-R%_,this.shouldUpdate(f,E)&&(this.render(h,x,P,S,w,C,A),N.runEvents())),this.intervalId=b(tick)};d||N.start(),this.intervalId=b(tick)}}stop(){this.intervalId&&(b.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(h,g){if(!h){var{frameDuration:d}=this,f=this.animations.reduce(((h,g)=>g.update(d)||h),!1);if(f)return!0}return!("function"!==typeof g||!g())||(!(this.isReadyLock||!this.isReady())||!!this.mouse.hasEvents())}render(h,g,d,f,x,b,P){var{CLIENT_WIDTH:E,CLIENT_HEIGHT:S,viewPort:w,ctx:C,isFirstRender:A}=this,M=C.canvas;w.clear(),M.width&&M.height?w.setCurrent(M.width,M.height):w.setCurrent(E,S);var N=h.getStyle("width"),_=h.getStyle("height");!g&&(A||"number"!==typeof f&&"number"!==typeof x)&&(N.hasValue()&&(M.width=N.getPixels("x"),M.style&&(M.style.width="".concat(M.width,"px"))),_.hasValue()&&(M.height=_.getPixels("y"),M.style&&(M.style.height="".concat(M.height,"px"))));var V=M.clientWidth||M.width,k=M.clientHeight||M.height;if(g&&N.hasValue()&&_.hasValue()&&(V=N.getPixels("x"),k=_.getPixels("y")),w.setCurrent(V,k),"number"===typeof b&&h.getAttribute("x",!0).setValue(b),"number"===typeof P&&h.getAttribute("y",!0).setValue(P),"number"===typeof f||"number"===typeof x){var R=toNumbers(h.getAttribute("viewBox").getString()),B=0,L=0;if("number"===typeof f){var D=h.getStyle("width");D.hasValue()?B=D.getPixels("x")/f:isNaN(R[2])||(B=R[2]/f)}if("number"===typeof x){var F=h.getStyle("height");F.hasValue()?L=F.getPixels("y")/x:isNaN(R[3])||(L=R[3]/x)}B||(B=L),L||(L=B),h.getAttribute("width",!0).setValue(f),h.getAttribute("height",!0).setValue(x);var z=h.getStyle("transform",!0,!0);z.setValue("".concat(z.getString()," scale(").concat(1/B,", ").concat(1/L,")"))}d||C.clearRect(0,0,V,k),h.render(C),A&&(this.isFirstRender=!1)}}Screen.defaultWindow=q,Screen.defaultFetch=W;var{defaultFetch:$}=Screen,Z="undefined"!==typeof DOMParser?DOMParser:null;class Parser{constructor(){var{fetch:h=$,DOMParser:g=Z}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.fetch=h,this.DOMParser=g}parse(h){var g=this;return(0,f.Z)((function*(){return h.startsWith("<")?g.parseFromString(h):g.load(h)}))()}parseFromString(h){var g=new this.DOMParser;try{return this.checkDocument(g.parseFromString(h,"image/svg+xml"))}catch(d){return this.checkDocument(g.parseFromString(h,"text/xml"))}}checkDocument(h){var g=h.getElementsByTagName("parsererror")[0];if(g)throw new Error(g.textContent);return h}load(h){var g=this;return(0,f.Z)((function*(){var d=yield g.fetch(h),f=yield d.text();return g.parseFromString(f)}))()}}class Translate{constructor(h,g){this.type="translate",this.point=null,this.point=Point.parse(g)}apply(h){var{x:g,y:d}=this.point;h.translate(g||0,d||0)}unapply(h){var{x:g,y:d}=this.point;h.translate(-1*g||0,-1*d||0)}applyToPoint(h){var{x:g,y:d}=this.point;h.applyTransform([1,0,0,1,g||0,d||0])}}class Rotate{constructor(h,g,d){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var f=toNumbers(g);this.angle=new Property(h,"angle",f[0]),this.originX=d[0],this.originY=d[1],this.cx=f[1]||0,this.cy=f[2]||0}apply(h){var{cx:g,cy:d,originX:f,originY:x,angle:b}=this,P=g+f.getPixels("x"),E=d+x.getPixels("y");h.translate(P,E),h.rotate(b.getRadians()),h.translate(-P,-E)}unapply(h){var{cx:g,cy:d,originX:f,originY:x,angle:b}=this,P=g+f.getPixels("x"),E=d+x.getPixels("y");h.translate(P,E),h.rotate(-1*b.getRadians()),h.translate(-P,-E)}applyToPoint(h){var{cx:g,cy:d,angle:f}=this,x=f.getRadians();h.applyTransform([1,0,0,1,g||0,d||0]),h.applyTransform([Math.cos(x),Math.sin(x),-Math.sin(x),Math.cos(x),0,0]),h.applyTransform([1,0,0,1,-g||0,-d||0])}}class Scale{constructor(h,g,d){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var f=Point.parseScale(g);0!==f.x&&0!==f.y||(f.x=Q,f.y=Q),this.scale=f,this.originX=d[0],this.originY=d[1]}apply(h){var{scale:{x:g,y:d},originX:f,originY:x}=this,b=f.getPixels("x"),P=x.getPixels("y");h.translate(b,P),h.scale(g,d||g),h.translate(-b,-P)}unapply(h){var{scale:{x:g,y:d},originX:f,originY:x}=this,b=f.getPixels("x"),P=x.getPixels("y");h.translate(b,P),h.scale(1/g,1/d||g),h.translate(-b,-P)}applyToPoint(h){var{x:g,y:d}=this.scale;h.applyTransform([g||0,0,0,d||0,0,0])}}class Matrix{constructor(h,g,d){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=toNumbers(g),this.originX=d[0],this.originY=d[1]}apply(h){var{originX:g,originY:d,matrix:f}=this,x=g.getPixels("x"),b=d.getPixels("y");h.translate(x,b),h.transform(f[0],f[1],f[2],f[3],f[4],f[5]),h.translate(-x,-b)}unapply(h){var{originX:g,originY:d,matrix:f}=this,x=f[0],b=f[2],P=f[4],E=f[1],S=f[3],w=f[5],C=0,A=0,M=1,N=1/(x*(S*M-w*A)-b*(E*M-w*C)+P*(E*A-S*C)),_=g.getPixels("x"),V=d.getPixels("y");h.translate(_,V),h.transform(N*(S*M-w*A),N*(w*C-E*M),N*(P*A-b*M),N*(x*M-P*C),N*(b*w-P*S),N*(P*E-x*w)),h.translate(-_,-V)}applyToPoint(h){h.applyTransform(this.matrix)}}class Skew extends Matrix{constructor(h,g,d){super(h,g,d),this.type="skew",this.angle=null,this.angle=new Property(h,"angle",g)}}class SkewX extends Skew{constructor(h,g,d){super(h,g,d),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class SkewY extends Skew{constructor(h,g,d){super(h,g,d),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function parseTransforms(h){return compressSpaces(h).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function parseTransform(h){var[g,d]=h.split("(");return[g.trim(),d.trim().replace(")","")]}class Transform{constructor(h,g,d){this.document=h,this.transforms=[];var f=parseTransforms(g);f.forEach((h=>{if("none"!==h){var[g,f]=parseTransform(h),x=Transform.transformTypes[g];"undefined"!==typeof x&&this.transforms.push(new x(this.document,f,d))}}))}static fromElement(h,g){var d=g.getStyle("transform",!1,!0),[f,x=f]=g.getStyle("transform-origin",!1,!0).split(),b=[f,x];return d.hasValue()?new Transform(h,d.getString(),b):null}apply(h){for(var{transforms:g}=this,d=g.length,f=0;f<d;f++)g[f].apply(h)}unapply(h){for(var{transforms:g}=this,d=g.length,f=d-1;f>=0;f--)g[f].unapply(h)}applyToPoint(h){for(var{transforms:g}=this,d=g.length,f=0;f<d;f++)g[f].applyToPoint(h)}}Transform.transformTypes={translate:Translate,rotate:Rotate,scale:Scale,matrix:Matrix,skewX:SkewX,skewY:SkewY};class Element{constructor(h,g){var d=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.document=h,this.node=g,this.captureTextNodes=d,this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],g&&1===g.nodeType){if(Array.from(g.attributes).forEach((g=>{var d=normalizeAttributeName(g.nodeName);this.attributes[d]=new Property(h,d,g.value)})),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var f=this.getAttribute("style").getString().split(";").map((h=>h.trim()));f.forEach((g=>{if(g){var[d,f]=g.split(":").map((h=>h.trim()));this.styles[d]=new Property(h,d,f)}}))}var{definitions:x}=h,b=this.getAttribute("id");b.hasValue()&&(x[b.getString()]||(x[b.getString()]=this)),Array.from(g.childNodes).forEach((g=>{if(1===g.nodeType)this.addChild(g);else if(d&&(3===g.nodeType||4===g.nodeType)){var f=h.createTextNode(g);f.getText().length>0&&this.addChild(f)}}))}}getAttribute(h){var g=arguments.length>1&&void 0!==arguments[1]&&arguments[1],d=this.attributes[h];if(!d&&g){var f=new Property(this.document,h,"");return this.attributes[h]=f,f}return d||Property.empty(this.document)}getHrefAttribute(){for(var h in this.attributes)if("href"===h||h.endsWith(":href"))return this.attributes[h];return Property.empty(this.document)}getStyle(h){var g=arguments.length>1&&void 0!==arguments[1]&&arguments[1],d=arguments.length>2&&void 0!==arguments[2]&&arguments[2],f=this.styles[h];if(f)return f;var x=this.getAttribute(h);if(null!==x&&void 0!==x&&x.hasValue())return this.styles[h]=x,x;if(!d){var{parent:b}=this;if(b){var P=b.getStyle(h);if(null!==P&&void 0!==P&&P.hasValue())return P}}if(g){var E=new Property(this.document,h,"");return this.styles[h]=E,E}return f||Property.empty(this.document)}render(h){if("none"!==this.getStyle("display").getString()&&"hidden"!==this.getStyle("visibility").getString()){if(h.save(),this.getStyle("mask").hasValue()){var g=this.getStyle("mask").getDefinition();g&&(this.applyEffects(h),g.apply(h,this))}else if("none"!==this.getStyle("filter").getValue("none")){var d=this.getStyle("filter").getDefinition();d&&(this.applyEffects(h),d.apply(h,this))}else this.setContext(h),this.renderChildren(h),this.clearContext(h);h.restore()}}setContext(h){}applyEffects(h){var g=Transform.fromElement(this.document,this);g&&g.apply(h);var d=this.getStyle("clip-path",!1,!0);if(d.hasValue()){var f=d.getDefinition();f&&f.apply(h)}}clearContext(h){}renderChildren(h){this.children.forEach((g=>{g.render(h)}))}addChild(h){var g=h instanceof Element?h:this.document.createElement(h);g.parent=this,Element.ignoreChildTypes.includes(g.type)||this.children.push(g)}matchesSelector(h){var g,{node:d}=this;if("function"===typeof d.matches)return d.matches(h);var f=null===(g=d.getAttribute)||void 0===g?void 0:g.call(d,"class");return!(!f||""===f)&&f.split(" ").some((g=>".".concat(g)===h))}addStylesFromStyleDefinition(){var{styles:h,stylesSpecificity:g}=this.document;for(var d in h)if(!d.startsWith("@")&&this.matchesSelector(d)){var f=h[d],x=g[d];if(f)for(var b in f){var P=this.stylesSpecificity[b];"undefined"===typeof P&&(P="000"),x>=P&&(this.styles[b]=f[b],this.stylesSpecificity[b]=x)}}}removeStyles(h,g){var d=g.reduce(((g,d)=>{var f=h.getStyle(d);if(!f.hasValue())return g;var x=f.getString();return f.setValue(""),[...g,[d,x]]}),[]);return d}restoreStyles(h,g){g.forEach((g=>{var[d,f]=g;h.getStyle(d,!0).setValue(f)}))}isFirstChild(){var h;return 0===(null===(h=this.parent)||void 0===h?void 0:h.children.indexOf(this))}}Element.ignoreChildTypes=["title"];class UnknownElement extends Element{constructor(h,g,d){super(h,g,d)}}function wrapFontFamily(h){var g=h.trim();return/^('|")/.test(g)?g:'"'.concat(g,'"')}function prepareFontFamily(h){return"undefined"===typeof process?h:h.trim().split(",").map(wrapFontFamily).join(",")}function prepareFontStyle(h){if(!h)return"";var g=h.trim().toLowerCase();switch(g){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return g;default:return/^oblique\s+(-|)\d+deg$/.test(g)?g:""}}function prepareFontWeight(h){if(!h)return"";var g=h.trim().toLowerCase();switch(g){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return g;default:return/^[\d.]+$/.test(g)?g:""}}class Font{constructor(h,g,d,f,x,b){var P=b?"string"===typeof b?Font.parse(b):b:{};this.fontFamily=x||P.fontFamily,this.fontSize=f||P.fontSize,this.fontStyle=h||P.fontStyle,this.fontWeight=d||P.fontWeight,this.fontVariant=g||P.fontVariant}static parse(){var h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",g=arguments.length>1?arguments[1]:void 0,d="",f="",x="",b="",P="",E=compressSpaces(h).trim().split(" "),S={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return E.forEach((h=>{switch(!0){case!S.fontStyle&&Font.styles.includes(h):"inherit"!==h&&(d=h),S.fontStyle=!0;break;case!S.fontVariant&&Font.variants.includes(h):"inherit"!==h&&(f=h),S.fontStyle=!0,S.fontVariant=!0;break;case!S.fontWeight&&Font.weights.includes(h):"inherit"!==h&&(x=h),S.fontStyle=!0,S.fontVariant=!0,S.fontWeight=!0;break;case!S.fontSize:"inherit"!==h&&([b]=h.split("/")),S.fontStyle=!0,S.fontVariant=!0,S.fontWeight=!0,S.fontSize=!0;break;default:"inherit"!==h&&(P+=h)}})),new Font(d,f,x,b,P,g)}toString(){return[prepareFontStyle(this.fontStyle),this.fontVariant,prepareFontWeight(this.fontWeight),this.fontSize,prepareFontFamily(this.fontFamily)].join(" ").trim()}}Font.styles="normal|italic|oblique|inherit",Font.variants="normal|small-caps|inherit",Font.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class BoundingBox{constructor(){var h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.NaN,g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.NaN,d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.NaN,f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Number.NaN;this.x1=h,this.y1=g,this.x2=d,this.y2=f,this.addPoint(h,g),this.addPoint(d,f)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(h,g){"undefined"!==typeof h&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=h,this.x2=h),h<this.x1&&(this.x1=h),h>this.x2&&(this.x2=h)),"undefined"!==typeof g&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=g,this.y2=g),g<this.y1&&(this.y1=g),g>this.y2&&(this.y2=g))}addX(h){this.addPoint(h,null)}addY(h){this.addPoint(null,h)}addBoundingBox(h){if(h){var{x1:g,y1:d,x2:f,y2:x}=h;this.addPoint(g,d),this.addPoint(f,x)}}sumCubic(h,g,d,f,x){return Math.pow(1-h,3)*g+3*Math.pow(1-h,2)*h*d+3*(1-h)*Math.pow(h,2)*f+Math.pow(h,3)*x}bezierCurveAdd(h,g,d,f,x){var b=6*g-12*d+6*f,P=-3*g+9*d-9*f+3*x,E=3*d-3*g;if(0!==P){var S=Math.pow(b,2)-4*E*P;if(!(S<0)){var w=(-b+Math.sqrt(S))/(2*P);0<w&&w<1&&(h?this.addX(this.sumCubic(w,g,d,f,x)):this.addY(this.sumCubic(w,g,d,f,x)));var C=(-b-Math.sqrt(S))/(2*P);0<C&&C<1&&(h?this.addX(this.sumCubic(C,g,d,f,x)):this.addY(this.sumCubic(C,g,d,f,x)))}}else{if(0===b)return;var A=-E/b;0<A&&A<1&&(h?this.addX(this.sumCubic(A,g,d,f,x)):this.addY(this.sumCubic(A,g,d,f,x)))}}addBezierCurve(h,g,d,f,x,b,P,E){this.addPoint(h,g),this.addPoint(P,E),this.bezierCurveAdd(!0,h,d,x,P),this.bezierCurveAdd(!1,g,f,b,E)}addQuadraticCurve(h,g,d,f,x,b){var P=h+2/3*(d-h),E=g+2/3*(f-g),S=P+1/3*(x-h),w=E+1/3*(b-g);this.addBezierCurve(h,g,P,S,E,w,x,b)}isPointInBox(h,g){var{x1:d,y1:f,x2:x,y2:b}=this;return d<=h&&h<=x&&f<=g&&g<=b}}class PathParser extends _{constructor(h){super(h.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=null,this.start=null,this.current=null,this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new Point(0,0),this.control=new Point(0,0),this.current=new Point(0,0),this.points=[],this.angles=[]}isEnd(){var{i:h,commands:g}=this;return h>=g.length-1}next(){var h=this.commands[++this.i];return this.previousCommand=this.command,this.command=h,h}getPoint(){var h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"x",g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y",d=new Point(this.command[h],this.command[g]);return this.makeAbsolute(d)}getAsControlPoint(h,g){var d=this.getPoint(h,g);return this.control=d,d}getAsCurrentPoint(h,g){var d=this.getPoint(h,g);return this.current=d,d}getReflectedControlPoint(){var h=this.previousCommand.type;if(h!==_.CURVE_TO&&h!==_.SMOOTH_CURVE_TO&&h!==_.QUAD_TO&&h!==_.SMOOTH_QUAD_TO)return this.current;var{current:{x:g,y:d},control:{x:f,y:x}}=this,b=new Point(2*g-f,2*d-x);return b}makeAbsolute(h){if(this.command.relative){var{x:g,y:d}=this.current;h.x+=g,h.y+=d}return h}addMarker(h,g,d){var{points:f,angles:x}=this;d&&x.length>0&&!x[x.length-1]&&(x[x.length-1]=f[f.length-1].angleTo(d)),this.addMarkerAngle(h,g?g.angleTo(h):null)}addMarkerAngle(h,g){this.points.push(h),this.angles.push(g)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:h}=this,g=h.length,d=0;d<g;d++)if(!h[d])for(var f=d+1;f<g;f++)if(h[f]){h[d]=h[f];break}return h}}class RenderedElement extends Element{constructor(){super(...arguments),this.modifiedEmSizeStack=!1}calculateOpacity(){var h=1,g=this;while(g){var d=g.getStyle("opacity",!1,!0);d.hasValue(!0)&&(h*=d.getNumber()),g=g.parent}return h}setContext(h){var g=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!g){var d=this.getStyle("fill"),f=this.getStyle("fill-opacity"),x=this.getStyle("stroke"),b=this.getStyle("stroke-opacity");if(d.isUrlDefinition()){var P=d.getFillStyleDefinition(this,f);P&&(h.fillStyle=P)}else if(d.hasValue()){"currentColor"===d.getString()&&d.setValue(this.getStyle("color").getColor());var E=d.getColor();"inherit"!==E&&(h.fillStyle="none"===E?"rgba(0,0,0,0)":E)}if(f.hasValue()){var S=new Property(this.document,"fill",h.fillStyle).addOpacity(f).getColor();h.fillStyle=S}if(x.isUrlDefinition()){var w=x.getFillStyleDefinition(this,b);w&&(h.strokeStyle=w)}else if(x.hasValue()){"currentColor"===x.getString()&&x.setValue(this.getStyle("color").getColor());var C=x.getString();"inherit"!==C&&(h.strokeStyle="none"===C?"rgba(0,0,0,0)":C)}if(b.hasValue()){var A=new Property(this.document,"stroke",h.strokeStyle).addOpacity(b).getString();h.strokeStyle=A}var M=this.getStyle("stroke-width");if(M.hasValue()){var N=M.getPixels();h.lineWidth=N||Q}var _=this.getStyle("stroke-linecap"),V=this.getStyle("stroke-linejoin"),k=this.getStyle("stroke-miterlimit"),R=this.getStyle("stroke-dasharray"),B=this.getStyle("stroke-dashoffset");if(_.hasValue()&&(h.lineCap=_.getString()),V.hasValue()&&(h.lineJoin=V.getString()),k.hasValue()&&(h.miterLimit=k.getNumber()),R.hasValue()&&"none"!==R.getString()){var L=toNumbers(R.getString());"undefined"!==typeof h.setLineDash?h.setLineDash(L):"undefined"!==typeof h.webkitLineDash?h.webkitLineDash=L:"undefined"===typeof h.mozDash||1===L.length&&0===L[0]||(h.mozDash=L);var D=B.getPixels();"undefined"!==typeof h.lineDashOffset?h.lineDashOffset=D:"undefined"!==typeof h.webkitLineDashOffset?h.webkitLineDashOffset=D:"undefined"!==typeof h.mozDashOffset&&(h.mozDashOffset=D)}}if(this.modifiedEmSizeStack=!1,"undefined"!==typeof h.font){var F=this.getStyle("font"),z=this.getStyle("font-style"),U=this.getStyle("font-variant"),X=this.getStyle("font-weight"),Y=this.getStyle("font-size"),G=this.getStyle("font-family"),j=new Font(z.getString(),U.getString(),X.getString(),Y.hasValue()?"".concat(Y.getPixels(!0),"px"):"",G.getString(),Font.parse(F.getString(),h.font));z.setValue(j.fontStyle),U.setValue(j.fontVariant),X.setValue(j.fontWeight),Y.setValue(j.fontSize),G.setValue(j.fontFamily),h.font=j.toString(),Y.isPixels()&&(this.document.emSize=Y.getPixels(),this.modifiedEmSizeStack=!0)}g||(this.applyEffects(h),h.globalAlpha=this.calculateOpacity())}clearContext(h){super.clearContext(h),this.modifiedEmSizeStack&&this.document.popEmSize()}}class PathElement extends RenderedElement{constructor(h,g,d){super(h,g,d),this.type="path",this.pathParser=null,this.pathParser=new PathParser(this.getAttribute("d").getString())}path(h){var{pathParser:g}=this,d=new BoundingBox;g.reset(),h&&h.beginPath();while(!g.isEnd())switch(g.next().type){case PathParser.MOVE_TO:this.pathM(h,d);break;case PathParser.LINE_TO:this.pathL(h,d);break;case PathParser.HORIZ_LINE_TO:this.pathH(h,d);break;case PathParser.VERT_LINE_TO:this.pathV(h,d);break;case PathParser.CURVE_TO:this.pathC(h,d);break;case PathParser.SMOOTH_CURVE_TO:this.pathS(h,d);break;case PathParser.QUAD_TO:this.pathQ(h,d);break;case PathParser.SMOOTH_QUAD_TO:this.pathT(h,d);break;case PathParser.ARC:this.pathA(h,d);break;case PathParser.CLOSE_PATH:this.pathZ(h,d);break}return d}getBoundingBox(h){return this.path()}getMarkers(){var{pathParser:h}=this,g=h.getMarkerPoints(),d=h.getMarkerAngles(),f=g.map(((h,g)=>[h,d[g]]));return f}renderChildren(h){this.path(h),this.document.screen.mouse.checkPath(this,h);var g=this.getStyle("fill-rule");""!==h.fillStyle&&("inherit"!==g.getString("inherit")?h.fill(g.getString()):h.fill()),""!==h.strokeStyle&&("non-scaling-stroke"===this.getAttribute("vector-effect").getString()?(h.save(),h.setTransform(1,0,0,1,0,0),h.stroke(),h.restore()):h.stroke());var d=this.getMarkers();if(d){var f=d.length-1,x=this.getStyle("marker-start"),b=this.getStyle("marker-mid"),P=this.getStyle("marker-end");if(x.isUrlDefinition()){var E=x.getDefinition(),[S,w]=d[0];E.render(h,S,w)}if(b.isUrlDefinition())for(var C=b.getDefinition(),A=1;A<f;A++){var[M,N]=d[A];C.render(h,M,N)}if(P.isUrlDefinition()){var _=P.getDefinition(),[V,k]=d[f];_.render(h,V,k)}}}static pathM(h){var g=h.getAsCurrentPoint();return h.start=h.current,{point:g}}pathM(h,g){var{pathParser:d}=this,{point:f}=PathElement.pathM(d),{x:x,y:b}=f;d.addMarker(f),g.addPoint(x,b),h&&h.moveTo(x,b)}static pathL(h){var{current:g}=h,d=h.getAsCurrentPoint();return{current:g,point:d}}pathL(h,g){var{pathParser:d}=this,{current:f,point:x}=PathElement.pathL(d),{x:b,y:P}=x;d.addMarker(x,f),g.addPoint(b,P),h&&h.lineTo(b,P)}static pathH(h){var{current:g,command:d}=h,f=new Point((d.relative?g.x:0)+d.x,g.y);return h.current=f,{current:g,point:f}}pathH(h,g){var{pathParser:d}=this,{current:f,point:x}=PathElement.pathH(d),{x:b,y:P}=x;d.addMarker(x,f),g.addPoint(b,P),h&&h.lineTo(b,P)}static pathV(h){var{current:g,command:d}=h,f=new Point(g.x,(d.relative?g.y:0)+d.y);return h.current=f,{current:g,point:f}}pathV(h,g){var{pathParser:d}=this,{current:f,point:x}=PathElement.pathV(d),{x:b,y:P}=x;d.addMarker(x,f),g.addPoint(b,P),h&&h.lineTo(b,P)}static pathC(h){var{current:g}=h,d=h.getPoint("x1","y1"),f=h.getAsControlPoint("x2","y2"),x=h.getAsCurrentPoint();return{current:g,point:d,controlPoint:f,currentPoint:x}}pathC(h,g){var{pathParser:d}=this,{current:f,point:x,controlPoint:b,currentPoint:P}=PathElement.pathC(d);d.addMarker(P,b,x),g.addBezierCurve(f.x,f.y,x.x,x.y,b.x,b.y,P.x,P.y),h&&h.bezierCurveTo(x.x,x.y,b.x,b.y,P.x,P.y)}static pathS(h){var{current:g}=h,d=h.getReflectedControlPoint(),f=h.getAsControlPoint("x2","y2"),x=h.getAsCurrentPoint();return{current:g,point:d,controlPoint:f,currentPoint:x}}pathS(h,g){var{pathParser:d}=this,{current:f,point:x,controlPoint:b,currentPoint:P}=PathElement.pathS(d);d.addMarker(P,b,x),g.addBezierCurve(f.x,f.y,x.x,x.y,b.x,b.y,P.x,P.y),h&&h.bezierCurveTo(x.x,x.y,b.x,b.y,P.x,P.y)}static pathQ(h){var{current:g}=h,d=h.getAsControlPoint("x1","y1"),f=h.getAsCurrentPoint();return{current:g,controlPoint:d,currentPoint:f}}pathQ(h,g){var{pathParser:d}=this,{current:f,controlPoint:x,currentPoint:b}=PathElement.pathQ(d);d.addMarker(b,x,x),g.addQuadraticCurve(f.x,f.y,x.x,x.y,b.x,b.y),h&&h.quadraticCurveTo(x.x,x.y,b.x,b.y)}static pathT(h){var{current:g}=h,d=h.getReflectedControlPoint();h.control=d;var f=h.getAsCurrentPoint();return{current:g,controlPoint:d,currentPoint:f}}pathT(h,g){var{pathParser:d}=this,{current:f,controlPoint:x,currentPoint:b}=PathElement.pathT(d);d.addMarker(b,x,x),g.addQuadraticCurve(f.x,f.y,x.x,x.y,b.x,b.y),h&&h.quadraticCurveTo(x.x,x.y,b.x,b.y)}static pathA(h){var{current:g,command:d}=h,{rX:f,rY:x,xRot:b,lArcFlag:P,sweepFlag:E}=d,S=b*(Math.PI/180),w=h.getAsCurrentPoint(),C=new Point(Math.cos(S)*(g.x-w.x)/2+Math.sin(S)*(g.y-w.y)/2,-Math.sin(S)*(g.x-w.x)/2+Math.cos(S)*(g.y-w.y)/2),A=Math.pow(C.x,2)/Math.pow(f,2)+Math.pow(C.y,2)/Math.pow(x,2);A>1&&(f*=Math.sqrt(A),x*=Math.sqrt(A));var M=(P===E?-1:1)*Math.sqrt((Math.pow(f,2)*Math.pow(x,2)-Math.pow(f,2)*Math.pow(C.y,2)-Math.pow(x,2)*Math.pow(C.x,2))/(Math.pow(f,2)*Math.pow(C.y,2)+Math.pow(x,2)*Math.pow(C.x,2)));isNaN(M)&&(M=0);var N=new Point(M*f*C.y/x,M*-x*C.x/f),_=new Point((g.x+w.x)/2+Math.cos(S)*N.x-Math.sin(S)*N.y,(g.y+w.y)/2+Math.sin(S)*N.x+Math.cos(S)*N.y),V=vectorsAngle([1,0],[(C.x-N.x)/f,(C.y-N.y)/x]),k=[(C.x-N.x)/f,(C.y-N.y)/x],R=[(-C.x-N.x)/f,(-C.y-N.y)/x],B=vectorsAngle(k,R);return vectorsRatio(k,R)<=-1&&(B=Math.PI),vectorsRatio(k,R)>=1&&(B=0),{currentPoint:w,rX:f,rY:x,sweepFlag:E,xAxisRotation:S,centp:_,a1:V,ad:B}}pathA(h,g){var{pathParser:d}=this,{currentPoint:f,rX:x,rY:b,sweepFlag:P,xAxisRotation:E,centp:S,a1:w,ad:C}=PathElement.pathA(d),A=1-P?1:-1,M=w+A*(C/2),N=new Point(S.x+x*Math.cos(M),S.y+b*Math.sin(M));if(d.addMarkerAngle(N,M-A*Math.PI/2),d.addMarkerAngle(f,M-A*Math.PI),g.addPoint(f.x,f.y),h&&!isNaN(w)&&!isNaN(C)){var _=x>b?x:b,V=x>b?1:x/b,k=x>b?b/x:1;h.translate(S.x,S.y),h.rotate(E),h.scale(V,k),h.arc(0,0,_,w,w+C,Boolean(1-P)),h.scale(1/V,1/k),h.rotate(-E),h.translate(-S.x,-S.y)}}static pathZ(h){h.current=h.start}pathZ(h,g){PathElement.pathZ(this.pathParser),h&&g.x1!==g.x2&&g.y1!==g.y2&&h.closePath()}}class GlyphElement extends PathElement{constructor(h,g,d){super(h,g,d),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class TextElement extends RenderedElement{constructor(h,g,d){super(h,g,new.target===TextElement||d),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(h){var g=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super.setContext(h,g);var d=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();d&&(h.textBaseline=d)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(h){if("text"!==this.type)return this.getTElementBoundingBox(h);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(h);var g=null;return this.children.forEach(((d,f)=>{var x=this.getChildBoundingBox(h,this,this,f);g?g.addBoundingBox(x):g=x})),g}getFontSize(){var{document:h,parent:g}=this,d=Font.parse(h.ctx.font).fontSize,f=g.getStyle("font-size").getNumber(d);return f}getTElementBoundingBox(h){var g=this.getFontSize();return new BoundingBox(this.x,this.y-g,this.x+this.measureText(h),this.y)}getGlyph(h,g,d){var f=g[d],x=null;if(h.isArabic){var b=g.length,P=g[d-1],E=g[d+1],S="isolated";if((0===d||" "===P)&&d<b-1&&" "!==E&&(S="terminal"),d>0&&" "!==P&&d<b-1&&" "!==E&&(S="medial"),d>0&&" "!==P&&(d===b-1||" "===E)&&(S="initial"),"undefined"!==typeof h.glyphs[f]){var w=h.glyphs[f];x=w instanceof GlyphElement?w:w[S]}}else x=h.glyphs[f];return x||(x=h.missingGlyph),x}getText(){return""}getTextFromNode(h){var g=h||this.node,d=Array.from(g.parentNode.childNodes),f=d.indexOf(g),x=d.length-1,b=compressSpaces(g.textContent||"");return 0===f&&(b=trimLeft(b)),f===x&&(b=trimRight(b)),b}renderChildren(h){if("text"===this.type){this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(h),this.children.forEach(((g,d)=>{this.renderChild(h,this,this,d)}));var{mouse:g}=this.document.screen;g.isWorking()&&g.checkBoundingBox(this,this.getBoundingBox(h))}else this.renderTElementChildren(h)}renderTElementChildren(h){var{document:g,parent:d}=this,f=this.getText(),x=d.getStyle("font-family").getDefinition();if(x)for(var{unitsPerEm:b}=x.fontFace,P=Font.parse(g.ctx.font),E=d.getStyle("font-size").getNumber(P.fontSize),S=d.getStyle("font-style").getString(P.fontStyle),w=E/b,C=x.isRTL?f.split("").reverse().join(""):f,A=toNumbers(d.getAttribute("dx").getString()),M=C.length,N=0;N<M;N++){var _=this.getGlyph(x,C,N);h.translate(this.x,this.y),h.scale(w,-w);var V=h.lineWidth;h.lineWidth=h.lineWidth*b/E,"italic"===S&&h.transform(1,0,.4,1,0,0),_.render(h),"italic"===S&&h.transform(1,0,-.4,1,0,0),h.lineWidth=V,h.scale(1/w,-1/w),h.translate(-this.x,-this.y),this.x+=E*(_.horizAdvX||x.horizAdvX)/b,"undefined"===typeof A[N]||isNaN(A[N])||(this.x+=A[N])}else{var{x:k,y:R}=this;h.fillStyle&&h.fillText(f,k,R),h.strokeStyle&&h.strokeText(f,k,R)}}applyAnchoring(){if(!(this.textChunkStart>=this.leafTexts.length)){var h=this.leafTexts[this.textChunkStart],g=h.getStyle("text-anchor").getString("start"),d=!1,f=0;f="start"===g&&!d||"end"===g&&d?h.x-this.minX:"end"===g&&!d||"start"===g&&d?h.x-this.maxX:h.x-(this.minX+this.maxX)/2;for(var x=this.textChunkStart;x<this.leafTexts.length;x++)this.leafTexts[x].x+=f;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}adjustChildCoordinatesRecursive(h){this.children.forEach(((g,d)=>{this.adjustChildCoordinatesRecursiveCore(h,this,this,d)})),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(h,g,d,f){var x=d.children[f];x.children.length>0?x.children.forEach(((d,f)=>{g.adjustChildCoordinatesRecursiveCore(h,g,x,f)})):this.adjustChildCoordinates(h,g,d,f)}adjustChildCoordinates(h,g,d,f){var x=d.children[f];if("function"!==typeof x.measureText)return x;h.save(),x.setContext(h,!0);var b=x.getAttribute("x"),P=x.getAttribute("y"),E=x.getAttribute("dx"),S=x.getAttribute("dy"),w=x.getStyle("font-family").getDefinition(),C=Boolean(w)&&w.isRTL;0===f&&(b.hasValue()||b.setValue(x.getInheritedAttribute("x")),P.hasValue()||P.setValue(x.getInheritedAttribute("y")),E.hasValue()||E.setValue(x.getInheritedAttribute("dx")),S.hasValue()||S.setValue(x.getInheritedAttribute("dy")));var A=x.measureText(h);return C&&(g.x-=A),b.hasValue()?(g.applyAnchoring(),x.x=b.getPixels("x"),E.hasValue()&&(x.x+=E.getPixels("x"))):(E.hasValue()&&(g.x+=E.getPixels("x")),x.x=g.x),g.x=x.x,C||(g.x+=A),P.hasValue()?(x.y=P.getPixels("y"),S.hasValue()&&(x.y+=S.getPixels("y"))):(S.hasValue()&&(g.y+=S.getPixels("y")),x.y=g.y),g.y=x.y,g.leafTexts.push(x),g.minX=Math.min(g.minX,x.x,x.x+A),g.maxX=Math.max(g.maxX,x.x,x.x+A),x.clearContext(h),h.restore(),x}getChildBoundingBox(h,g,d,f){var x=d.children[f];if("function"!==typeof x.getBoundingBox)return null;var b=x.getBoundingBox(h);return b?(x.children.forEach(((d,f)=>{var P=g.getChildBoundingBox(h,g,x,f);b.addBoundingBox(P)})),b):null}renderChild(h,g,d,f){var x=d.children[f];x.render(h),x.children.forEach(((d,f)=>{g.renderChild(h,g,x,f)}))}measureText(h){var{measureCache:g}=this;if(~g)return g;var d=this.getText(),f=this.measureTargetText(h,d);return this.measureCache=f,f}measureTargetText(h,g){if(!g.length)return 0;var{parent:d}=this,f=d.getStyle("font-family").getDefinition();if(f){for(var x=this.getFontSize(),b=f.isRTL?g.split("").reverse().join(""):g,P=toNumbers(d.getAttribute("dx").getString()),E=b.length,S=0,w=0;w<E;w++){var C=this.getGlyph(f,b,w);S+=(C.horizAdvX||f.horizAdvX)*x/f.fontFace.unitsPerEm,"undefined"===typeof P[w]||isNaN(P[w])||(S+=P[w])}return S}if(!h.measureText)return 10*g.length;h.save(),this.setContext(h,!0);var{width:A}=h.measureText(g);return this.clearContext(h),h.restore(),A}getInheritedAttribute(h){var g=this;while(g instanceof TextElement&&g.isFirstChild()){var d=g.parent.getAttribute(h);if(d.hasValue(!0))return d.getValue("0");g=g.parent}return null}}class TSpanElement extends TextElement{constructor(h,g,d){super(h,g,new.target===TSpanElement||d),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}getText(){return this.text}}class TextNode extends TSpanElement{constructor(){super(...arguments),this.type="textNode"}}class SVGElement extends RenderedElement{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(h){var g,{document:d}=this,{screen:f,window:x}=d,b=h.canvas;if(f.setDefaults(h),b.style&&"undefined"!==typeof h.font&&x&&"undefined"!==typeof x.getComputedStyle){h.font=x.getComputedStyle(b).getPropertyValue("font");var P=new Property(d,"fontSize",Font.parse(h.font).fontSize);P.hasValue()&&(d.rootEmSize=P.getPixels("y"),d.emSize=d.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:E,height:S}=f.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var w=this.getAttribute("refX"),C=this.getAttribute("refY"),A=this.getAttribute("viewBox"),M=A.hasValue()?toNumbers(A.getString()):null,N=!this.root&&"visible"!==this.getStyle("overflow").getValue("hidden"),_=0,V=0,k=0,R=0;M&&(_=M[0],V=M[1]),this.root||(E=this.getStyle("width").getPixels("x"),S=this.getStyle("height").getPixels("y"),"marker"===this.type&&(k=_,R=V,_=0,V=0)),f.viewPort.setCurrent(E,S),!this.node||this.parent&&"foreignObject"!==(null===(g=this.node.parentNode)||void 0===g?void 0:g.nodeName)||!this.getStyle("transform",!1,!0).hasValue()||this.getStyle("transform-origin",!1,!0).hasValue()||this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(h),h.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),M&&(E=M[2],S=M[3]),d.setViewBox({ctx:h,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:f.viewPort.width,desiredWidth:E,height:f.viewPort.height,desiredHeight:S,minX:_,minY:V,refX:w.getValue(),refY:C.getValue(),clip:N,clipX:k,clipY:R}),M&&(f.viewPort.removeCurrent(),f.viewPort.setCurrent(E,S))}clearContext(h){super.clearContext(h),this.document.screen.viewPort.removeCurrent()}resize(h){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h,d=arguments.length>2&&void 0!==arguments[2]&&arguments[2],f=this.getAttribute("width",!0),x=this.getAttribute("height",!0),b=this.getAttribute("viewBox"),P=this.getAttribute("style"),E=f.getNumber(0),S=x.getNumber(0);if(d)if("string"===typeof d)this.getAttribute("preserveAspectRatio",!0).setValue(d);else{var w=this.getAttribute("preserveAspectRatio");w.hasValue()&&w.setValue(w.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(f.setValue(h),x.setValue(g),b.hasValue()||b.setValue("0 0 ".concat(E||h," ").concat(S||g)),P.hasValue()){var C=this.getStyle("width"),A=this.getStyle("height");C.hasValue()&&C.setValue("".concat(h,"px")),A.hasValue()&&A.setValue("".concat(g,"px"))}}}class RectElement extends PathElement{constructor(){super(...arguments),this.type="rect"}path(h){var g=this.getAttribute("x").getPixels("x"),d=this.getAttribute("y").getPixels("y"),f=this.getStyle("width",!1,!0).getPixels("x"),x=this.getStyle("height",!1,!0).getPixels("y"),b=this.getAttribute("rx"),P=this.getAttribute("ry"),E=b.getPixels("x"),S=P.getPixels("y");if(b.hasValue()&&!P.hasValue()&&(S=E),P.hasValue()&&!b.hasValue()&&(E=S),E=Math.min(E,f/2),S=Math.min(S,x/2),h){var w=(Math.sqrt(2)-1)/3*4;h.beginPath(),x>0&&f>0&&(h.moveTo(g+E,d),h.lineTo(g+f-E,d),h.bezierCurveTo(g+f-E+w*E,d,g+f,d+S-w*S,g+f,d+S),h.lineTo(g+f,d+x-S),h.bezierCurveTo(g+f,d+x-S+w*S,g+f-E+w*E,d+x,g+f-E,d+x),h.lineTo(g+E,d+x),h.bezierCurveTo(g+E-w*E,d+x,g,d+x-S+w*S,g,d+x-S),h.lineTo(g,d+S),h.bezierCurveTo(g,d+S-w*S,g+E-w*E,d,g+E,d),h.closePath())}return new BoundingBox(g,d,g+f,d+x)}getMarkers(){return null}}class CircleElement extends PathElement{constructor(){super(...arguments),this.type="circle"}path(h){var g=this.getAttribute("cx").getPixels("x"),d=this.getAttribute("cy").getPixels("y"),f=this.getAttribute("r").getPixels();return h&&f>0&&(h.beginPath(),h.arc(g,d,f,0,2*Math.PI,!1),h.closePath()),new BoundingBox(g-f,d-f,g+f,d+f)}getMarkers(){return null}}class EllipseElement extends PathElement{constructor(){super(...arguments),this.type="ellipse"}path(h){var g=(Math.sqrt(2)-1)/3*4,d=this.getAttribute("rx").getPixels("x"),f=this.getAttribute("ry").getPixels("y"),x=this.getAttribute("cx").getPixels("x"),b=this.getAttribute("cy").getPixels("y");return h&&d>0&&f>0&&(h.beginPath(),h.moveTo(x+d,b),h.bezierCurveTo(x+d,b+g*f,x+g*d,b+f,x,b+f),h.bezierCurveTo(x-g*d,b+f,x-d,b+g*f,x-d,b),h.bezierCurveTo(x-d,b-g*f,x-g*d,b-f,x,b-f),h.bezierCurveTo(x+g*d,b-f,x+d,b-g*f,x+d,b),h.closePath()),new BoundingBox(x-d,b-f,x+d,b+f)}getMarkers(){return null}}class LineElement extends PathElement{constructor(){super(...arguments),this.type="line"}getPoints(){return[new Point(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new Point(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(h){var[{x:g,y:d},{x:f,y:x}]=this.getPoints();return h&&(h.beginPath(),h.moveTo(g,d),h.lineTo(f,x)),new BoundingBox(g,d,f,x)}getMarkers(){var[h,g]=this.getPoints(),d=h.angleTo(g);return[[h,d],[g,d]]}}class PolylineElement extends PathElement{constructor(h,g,d){super(h,g,d),this.type="polyline",this.points=[],this.points=Point.parsePath(this.getAttribute("points").getString())}path(h){var{points:g}=this,[{x:d,y:f}]=g,x=new BoundingBox(d,f);return h&&(h.beginPath(),h.moveTo(d,f)),g.forEach((g=>{var{x:d,y:f}=g;x.addPoint(d,f),h&&h.lineTo(d,f)})),x}getMarkers(){var{points:h}=this,g=h.length-1,d=[];return h.forEach(((f,x)=>{x!==g&&d.push([f,f.angleTo(h[x+1])])})),d.length>0&&d.push([h[h.length-1],d[d.length-1][1]]),d}}class PolygonElement extends PolylineElement{constructor(){super(...arguments),this.type="polygon"}path(h){var g=super.path(h),[{x:d,y:f}]=this.points;return h&&(h.lineTo(d,f),h.closePath()),g}}class PatternElement extends Element{constructor(){super(...arguments),this.type="pattern"}createPattern(h,g,d){var f=this.getStyle("width").getPixels("x",!0),x=this.getStyle("height").getPixels("y",!0),b=new SVGElement(this.document,null);b.attributes.viewBox=new Property(this.document,"viewBox",this.getAttribute("viewBox").getValue()),b.attributes.width=new Property(this.document,"width","".concat(f,"px")),b.attributes.height=new Property(this.document,"height","".concat(x,"px")),b.attributes.transform=new Property(this.document,"transform",this.getAttribute("patternTransform").getValue()),b.children=this.children;var P=this.document.createCanvas(f,x),E=P.getContext("2d"),S=this.getAttribute("x"),w=this.getAttribute("y");S.hasValue()&&w.hasValue()&&E.translate(S.getPixels("x",!0),w.getPixels("y",!0)),d.hasValue()?this.styles["fill-opacity"]=d:Reflect.deleteProperty(this.styles,"fill-opacity");for(var C=-1;C<=1;C++)for(var A=-1;A<=1;A++)E.save(),b.attributes.x=new Property(this.document,"x",C*P.width),b.attributes.y=new Property(this.document,"y",A*P.height),b.render(E),E.restore();var M=h.createPattern(P,"repeat");return M}}class MarkerElement extends Element{constructor(){super(...arguments),this.type="marker"}render(h,g,d){if(g){var{x:f,y:x}=g,b=this.getAttribute("orient").getString("auto"),P=this.getAttribute("markerUnits").getString("strokeWidth");h.translate(f,x),"auto"===b&&h.rotate(d),"strokeWidth"===P&&h.scale(h.lineWidth,h.lineWidth),h.save();var E=new SVGElement(this.document,null);E.type=this.type,E.attributes.viewBox=new Property(this.document,"viewBox",this.getAttribute("viewBox").getValue()),E.attributes.refX=new Property(this.document,"refX",this.getAttribute("refX").getValue()),E.attributes.refY=new Property(this.document,"refY",this.getAttribute("refY").getValue()),E.attributes.width=new Property(this.document,"width",this.getAttribute("markerWidth").getValue()),E.attributes.height=new Property(this.document,"height",this.getAttribute("markerHeight").getValue()),E.attributes.overflow=new Property(this.document,"overflow",this.getAttribute("overflow").getValue()),E.attributes.fill=new Property(this.document,"fill",this.getAttribute("fill").getColor("black")),E.attributes.stroke=new Property(this.document,"stroke",this.getAttribute("stroke").getValue("none")),E.children=this.children,E.render(h),h.restore(),"strokeWidth"===P&&h.scale(1/h.lineWidth,1/h.lineWidth),"auto"===b&&h.rotate(-d),h.translate(-f,-x)}}}class DefsElement extends Element{constructor(){super(...arguments),this.type="defs"}render(){}}class GElement extends RenderedElement{constructor(){super(...arguments),this.type="g"}getBoundingBox(h){var g=new BoundingBox;return this.children.forEach((d=>{g.addBoundingBox(d.getBoundingBox(h))})),g}}class GradientElement extends Element{constructor(h,g,d){super(h,g,d),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:f,children:x}=this;x.forEach((h=>{"stop"===h.type&&f.push(h)}))}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(h,g,d){var f=this;this.getHrefAttribute().hasValue()&&(f=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(f));var{stops:x}=f,b=this.getGradient(h,g);if(!b)return this.addParentOpacity(d,x[x.length-1].color);if(x.forEach((h=>{b.addColorStop(h.offset,this.addParentOpacity(d,h.color))})),this.getAttribute("gradientTransform").hasValue()){var{document:P}=this,{MAX_VIRTUAL_PIXELS:E,viewPort:S}=P.screen,[w]=S.viewPorts,C=new RectElement(P,null);C.attributes.x=new Property(P,"x",-E/3),C.attributes.y=new Property(P,"y",-E/3),C.attributes.width=new Property(P,"width",E),C.attributes.height=new Property(P,"height",E);var A=new GElement(P,null);A.attributes.transform=new Property(P,"transform",this.getAttribute("gradientTransform").getValue()),A.children=[C];var M=new SVGElement(P,null);M.attributes.x=new Property(P,"x",0),M.attributes.y=new Property(P,"y",0),M.attributes.width=new Property(P,"width",w.width),M.attributes.height=new Property(P,"height",w.height),M.children=[A];var N=P.createCanvas(w.width,w.height),_=N.getContext("2d");return _.fillStyle=b,M.render(_),_.createPattern(N,"no-repeat")}return b}inheritStopContainer(h){this.attributesToInherit.forEach((g=>{!this.getAttribute(g).hasValue()&&h.getAttribute(g).hasValue()&&this.getAttribute(g,!0).setValue(h.getAttribute(g).getValue())}))}addParentOpacity(h,g){if(h.hasValue()){var d=new Property(this.document,"color",g);return d.addOpacity(h).getColor()}return g}}class LinearGradientElement extends GradientElement{constructor(h,g,d){super(h,g,d),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(h,g){var d="objectBoundingBox"===this.getGradientUnits(),f=d?g.getBoundingBox(h):null;if(d&&!f)return null;this.getAttribute("x1").hasValue()||this.getAttribute("y1").hasValue()||this.getAttribute("x2").hasValue()||this.getAttribute("y2").hasValue()||(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var x=d?f.x+f.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),b=d?f.y+f.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),P=d?f.x+f.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),E=d?f.y+f.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return x===P&&b===E?null:h.createLinearGradient(x,b,P,E)}}class RadialGradientElement extends GradientElement{constructor(h,g,d){super(h,g,d),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(h,g){var d="objectBoundingBox"===this.getGradientUnits(),f=g.getBoundingBox(h);if(d&&!f)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var x=d?f.x+f.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),b=d?f.y+f.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),P=x,E=b;this.getAttribute("fx").hasValue()&&(P=d?f.x+f.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(E=d?f.y+f.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var S=d?(f.width+f.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),w=this.getAttribute("fr").getPixels();return h.createRadialGradient(P,E,w,x,b,S)}}class StopElement extends Element{constructor(h,g,d){super(h,g,d),this.type="stop";var f=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),x=this.getStyle("stop-opacity"),b=this.getStyle("stop-color",!0);""===b.getString()&&b.setValue("#000"),x.hasValue()&&(b=b.addOpacity(x)),this.offset=f,this.color=b.getColor()}}class AnimateElement extends Element{constructor(h,g,d){super(h,g,d),this.type="animate",this.duration=0,this.initialValue=null,this.initialUnits="",this.removed=!1,this.frozen=!1,h.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new Property(h,"values",null);var f=this.getAttribute("values");f.hasValue()&&this.values.setValue(f.getString().split(";"))}getProperty(){var h=this.getAttribute("attributeType").getString(),g=this.getAttribute("attributeName").getString();return"CSS"===h?this.parent.getStyle(g,!0):this.parent.getAttribute(g,!0)}calcValue(){var{initialUnits:h}=this,{progress:g,from:d,to:f}=this.getProgress(),x=d.getNumber()+(f.getNumber()-d.getNumber())*g;return"%"===h&&(x*=100),"".concat(x).concat(h)}update(h){var{parent:g}=this,d=this.getProperty();if(this.initialValue||(this.initialValue=d.getString(),this.initialUnits=d.getUnits()),this.duration>this.maxDuration){var f=this.getAttribute("fill").getString("remove");if("indefinite"===this.getAttribute("repeatCount").getString()||"indefinite"===this.getAttribute("repeatDur").getString())this.duration=0;else if("freeze"!==f||this.frozen){if("remove"===f&&!this.removed)return this.removed=!0,d.setValue(g.animationFrozen?g.animationFrozenValue:this.initialValue),!0}else this.frozen=!0,g.animationFrozen=!0,g.animationFrozenValue=d.getString();return!1}this.duration+=h;var x=!1;if(this.begin<this.duration){var b=this.calcValue(),P=this.getAttribute("type");if(P.hasValue()){var E=P.getString();b="".concat(E,"(").concat(b,")")}d.setValue(b),x=!0}return x}getProgress(){var{document:h,values:g}=this,d={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(g.hasValue()){var f=d.progress*(g.getValue().length-1),x=Math.floor(f),b=Math.ceil(f);d.from=new Property(h,"from",parseFloat(g.getValue()[x])),d.to=new Property(h,"to",parseFloat(g.getValue()[b])),d.progress=(f-x)/(b-x)}else d.from=this.from,d.to=this.to;return d}}class AnimateColorElement extends AnimateElement{constructor(){super(...arguments),this.type="animateColor"}calcValue(){var{progress:h,from:g,to:d}=this.getProgress(),f=new P(g.getColor()),x=new P(d.getColor());if(f.ok&&x.ok){var b=f.r+(x.r-f.r)*h,E=f.g+(x.g-f.g)*h,S=f.b+(x.b-f.b)*h;return"rgb(".concat(Math.floor(b),", ").concat(Math.floor(E),", ").concat(Math.floor(S),")")}return this.getAttribute("from").getColor()}}class AnimateTransformElement extends AnimateElement{constructor(){super(...arguments),this.type="animateTransform"}calcValue(){var{progress:h,from:g,to:d}=this.getProgress(),f=toNumbers(g.getString()),x=toNumbers(d.getString()),b=f.map(((g,d)=>{var f=x[d];return g+(f-g)*h})).join(" ");return b}}class FontElement extends Element{constructor(h,g,d){super(h,g,d),this.type="font",this.glyphs={},this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:f}=h,{children:x}=this;for(var b of x)switch(b.type){case"font-face":this.fontFace=b;var P=b.getStyle("font-family");P.hasValue()&&(f[P.getString()]=this);break;case"missing-glyph":this.missingGlyph=b;break;case"glyph":var E=b;E.arabicForm?(this.isRTL=!0,this.isArabic=!0,"undefined"===typeof this.glyphs[E.unicode]&&(this.glyphs[E.unicode]={}),this.glyphs[E.unicode][E.arabicForm]=E):this.glyphs[E.unicode]=E;break}}render(){}}class FontFaceElement extends Element{constructor(h,g,d){super(h,g,d),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class MissingGlyphElement extends PathElement{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class TRefElement extends TextElement{constructor(){super(...arguments),this.type="tref"}getText(){var h=this.getHrefAttribute().getDefinition();if(h){var g=h.children[0];if(g)return g.getText()}return""}}class AElement extends TextElement{constructor(h,g,d){super(h,g,d),this.type="a";var{childNodes:f}=g,x=f[0],b=f.length>0&&Array.from(f).every((h=>3===h.nodeType));this.hasText=b,this.text=b?this.getTextFromNode(x):""}getText(){return this.text}renderChildren(h){if(this.hasText){super.renderChildren(h);var{document:g,x:d,y:f}=this,{mouse:x}=g.screen,b=new Property(g,"fontSize",Font.parse(g.ctx.font).fontSize);x.isWorking()&&x.checkBoundingBox(this,new BoundingBox(d,f-b.getPixels("y"),d+this.measureText(h),f))}else if(this.children.length>0){var P=new GElement(this.document,null);P.children=this.children,P.parent=this,P.render(h)}}onClick(){var{window:h}=this.document;h&&h.open(this.getHrefAttribute().getString())}onMouseMove(){var h=this.document.ctx;h.canvas.style.cursor="pointer"}}function ownKeys$2(h,g){var d=Object.keys(h);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(h);g&&(f=f.filter((function(g){return Object.getOwnPropertyDescriptor(h,g).enumerable}))),d.push.apply(d,f)}return d}function _objectSpread$2(h){for(var g=1;g<arguments.length;g++){var d=null!=arguments[g]?arguments[g]:{};g%2?ownKeys$2(Object(d),!0).forEach((function(g){(0,x.Z)(h,g,d[g])})):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(d)):ownKeys$2(Object(d)).forEach((function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(d,g))}))}return h}class TextPathElement extends TextElement{constructor(h,g,d){super(h,g,d),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);var f=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(f)}getText(){return this.text}path(h){var{dataArray:g}=this;h&&h.beginPath(),g.forEach((g=>{var{type:d,points:f}=g;switch(d){case PathParser.LINE_TO:h&&h.lineTo(f[0],f[1]);break;case PathParser.MOVE_TO:h&&h.moveTo(f[0],f[1]);break;case PathParser.CURVE_TO:h&&h.bezierCurveTo(f[0],f[1],f[2],f[3],f[4],f[5]);break;case PathParser.QUAD_TO:h&&h.quadraticCurveTo(f[0],f[1],f[2],f[3]);break;case PathParser.ARC:var[x,b,P,E,S,w,C,A]=f,M=P>E?P:E,N=P>E?1:P/E,_=P>E?E/P:1;h&&(h.translate(x,b),h.rotate(C),h.scale(N,_),h.arc(0,0,M,S,S+w,Boolean(1-A)),h.scale(1/N,1/_),h.rotate(-C),h.translate(-x,-b));break;case PathParser.CLOSE_PATH:h&&h.closePath();break}}))}renderChildren(h){this.setTextData(h),h.save();var g=this.parent.getStyle("text-decoration").getString(),d=this.getFontSize(),{glyphInfo:f}=this,x=h.fillStyle;"underline"===g&&h.beginPath(),f.forEach(((f,x)=>{var{p0:b,p1:P,rotation:E,text:S}=f;h.save(),h.translate(b.x,b.y),h.rotate(E),h.fillStyle&&h.fillText(S,0,0),h.strokeStyle&&h.strokeText(S,0,0),h.restore(),"underline"===g&&(0===x&&h.moveTo(b.x,b.y+d/8),h.lineTo(P.x,P.y+d/5))})),"underline"===g&&(h.lineWidth=d/20,h.strokeStyle=x,h.stroke(),h.closePath()),h.restore()}getLetterSpacingAt(){var h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.letterSpacingCache[h]||0}findSegmentToFitChar(h,g,d,f,x,b,P,E,S){var w=b,C=this.measureText(h,E);" "===E&&"justify"===g&&d<f&&(C+=(f-d)/x),S>-1&&(w+=this.getLetterSpacingAt(S));var A=this.textHeight/20,M=this.getEquidistantPointOnPath(w,A,0),N=this.getEquidistantPointOnPath(w+C,A,0),_={p0:M,p1:N},V=M&&N?Math.atan2(N.y-M.y,N.x-M.x):0;if(P){var k=Math.cos(Math.PI/2+V)*P,R=Math.cos(-V)*P;_.p0=_objectSpread$2(_objectSpread$2({},M),{},{x:M.x+k,y:M.y+R}),_.p1=_objectSpread$2(_objectSpread$2({},N),{},{x:N.x+k,y:N.y+R})}return w+=C,{offset:w,segment:_,rotation:V}}measureText(h,g){var{measuresCache:d}=this,f=g||this.getText();if(d.has(f))return d.get(f);var x=this.measureTargetText(h,f);return d.set(f,x),x}setTextData(h){if(!this.glyphInfo){var g=this.getText(),d=g.split(""),f=g.split(" ").length-1,x=this.parent.getAttribute("dx").split().map((h=>h.getPixels("x"))),b=this.parent.getAttribute("dy").getPixels("y"),P=this.parent.getStyle("text-anchor").getString("start"),E=this.getStyle("letter-spacing"),S=this.parent.getStyle("letter-spacing"),w=0;E.hasValue()&&"inherit"!==E.getValue()?E.hasValue()&&"initial"!==E.getValue()&&"unset"!==E.getValue()&&(w=E.getPixels()):w=S.getPixels();var C=[],A=g.length;this.letterSpacingCache=C;for(var M=0;M<A;M++)C.push("undefined"!==typeof x[M]?x[M]:w);var N=C.reduce(((h,g,d)=>0===d?0:h+g||0),0),_=this.measureText(h),V=Math.max(_+N,0);this.textWidth=_,this.textHeight=this.getFontSize(),this.glyphInfo=[];var k=this.getPathLength(),R=this.getStyle("startOffset").getNumber(0)*k,B=0;"middle"!==P&&"center"!==P||(B=-V/2),"end"!==P&&"right"!==P||(B=-V),B+=R,d.forEach(((g,x)=>{var{offset:E,segment:S,rotation:w}=this.findSegmentToFitChar(h,P,V,k,f,B,b,g,x);B=E,S.p0&&S.p1&&this.glyphInfo.push({text:d[x],p0:S.p0,p1:S.p1,rotation:w})}))}}parsePathData(h){if(this.pathLength=-1,!h)return[];var g=[],{pathParser:d}=h;d.reset();while(!d.isEnd()){var{current:f}=d,x=f?f.x:0,b=f?f.y:0,P=d.next(),E=P.type,S=[];switch(P.type){case PathParser.MOVE_TO:this.pathM(d,S);break;case PathParser.LINE_TO:E=this.pathL(d,S);break;case PathParser.HORIZ_LINE_TO:E=this.pathH(d,S);break;case PathParser.VERT_LINE_TO:E=this.pathV(d,S);break;case PathParser.CURVE_TO:this.pathC(d,S);break;case PathParser.SMOOTH_CURVE_TO:E=this.pathS(d,S);break;case PathParser.QUAD_TO:this.pathQ(d,S);break;case PathParser.SMOOTH_QUAD_TO:E=this.pathT(d,S);break;case PathParser.ARC:S=this.pathA(d);break;case PathParser.CLOSE_PATH:PathElement.pathZ(d);break}P.type!==PathParser.CLOSE_PATH?g.push({type:E,points:S,start:{x:x,y:b},pathLength:this.calcLength(x,b,E,S)}):g.push({type:PathParser.CLOSE_PATH,points:[],pathLength:0})}return g}pathM(h,g){var{x:d,y:f}=PathElement.pathM(h).point;g.push(d,f)}pathL(h,g){var{x:d,y:f}=PathElement.pathL(h).point;return g.push(d,f),PathParser.LINE_TO}pathH(h,g){var{x:d,y:f}=PathElement.pathH(h).point;return g.push(d,f),PathParser.LINE_TO}pathV(h,g){var{x:d,y:f}=PathElement.pathV(h).point;return g.push(d,f),PathParser.LINE_TO}pathC(h,g){var{point:d,controlPoint:f,currentPoint:x}=PathElement.pathC(h);g.push(d.x,d.y,f.x,f.y,x.x,x.y)}pathS(h,g){var{point:d,controlPoint:f,currentPoint:x}=PathElement.pathS(h);return g.push(d.x,d.y,f.x,f.y,x.x,x.y),PathParser.CURVE_TO}pathQ(h,g){var{controlPoint:d,currentPoint:f}=PathElement.pathQ(h);g.push(d.x,d.y,f.x,f.y)}pathT(h,g){var{controlPoint:d,currentPoint:f}=PathElement.pathT(h);return g.push(d.x,d.y,f.x,f.y),PathParser.QUAD_TO}pathA(h){var{rX:g,rY:d,sweepFlag:f,xAxisRotation:x,centp:b,a1:P,ad:E}=PathElement.pathA(h);return 0===f&&E>0&&(E-=2*Math.PI),1===f&&E<0&&(E+=2*Math.PI),[b.x,b.y,g,d,P,E,x,f]}calcLength(h,g,d,f){var x=0,b=null,P=null,E=0;switch(d){case PathParser.LINE_TO:return this.getLineLength(h,g,f[0],f[1]);case PathParser.CURVE_TO:for(x=0,b=this.getPointOnCubicBezier(0,h,g,f[0],f[1],f[2],f[3],f[4],f[5]),E=.01;E<=1;E+=.01)P=this.getPointOnCubicBezier(E,h,g,f[0],f[1],f[2],f[3],f[4],f[5]),x+=this.getLineLength(b.x,b.y,P.x,P.y),b=P;return x;case PathParser.QUAD_TO:for(x=0,b=this.getPointOnQuadraticBezier(0,h,g,f[0],f[1],f[2],f[3]),E=.01;E<=1;E+=.01)P=this.getPointOnQuadraticBezier(E,h,g,f[0],f[1],f[2],f[3]),x+=this.getLineLength(b.x,b.y,P.x,P.y),b=P;return x;case PathParser.ARC:x=0;var S=f[4],w=f[5],C=f[4]+w,A=Math.PI/180;if(Math.abs(S-C)<A&&(A=Math.abs(S-C)),b=this.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],S,0),w<0)for(E=S-A;E>C;E-=A)P=this.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],E,0),x+=this.getLineLength(b.x,b.y,P.x,P.y),b=P;else for(E=S+A;E<C;E+=A)P=this.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],E,0),x+=this.getLineLength(b.x,b.y,P.x,P.y),b=P;return P=this.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],C,0),x+=this.getLineLength(b.x,b.y,P.x,P.y),x}return 0}getPointOnLine(h,g,d,f,x){var b=arguments.length>5&&void 0!==arguments[5]?arguments[5]:g,P=arguments.length>6&&void 0!==arguments[6]?arguments[6]:d,E=(x-d)/(f-g+Q),S=Math.sqrt(h*h/(1+E*E));f<g&&(S*=-1);var w=E*S,C=null;if(f===g)C={x:b,y:P+w};else if((P-d)/(b-g+Q)===E)C={x:b+S,y:P+w};else{var A=0,M=0,N=this.getLineLength(g,d,f,x);if(N<Q)return null;var _=(b-g)*(f-g)+(P-d)*(x-d);_/=N*N,A=g+_*(f-g),M=d+_*(x-d);var V=this.getLineLength(b,P,A,M),k=Math.sqrt(h*h-V*V);S=Math.sqrt(k*k/(1+E*E)),f<g&&(S*=-1),w=E*S,C={x:A+S,y:M+w}}return C}getPointOnPath(h){var g=this.getPathLength(),d=0,f=null;if(h<-5e-5||h-5e-5>g)return null;var{dataArray:x}=this;for(var b of x){if(!b||!(b.pathLength<5e-5||d+b.pathLength+5e-5<h)){var P=h-d,E=0;switch(b.type){case PathParser.LINE_TO:f=this.getPointOnLine(P,b.start.x,b.start.y,b.points[0],b.points[1],b.start.x,b.start.y);break;case PathParser.ARC:var S=b.points[4],w=b.points[5],C=b.points[4]+w;if(E=S+P/b.pathLength*w,w<0&&E<C||w>=0&&E>C)break;f=this.getPointOnEllipticalArc(b.points[0],b.points[1],b.points[2],b.points[3],E,b.points[6]);break;case PathParser.CURVE_TO:E=P/b.pathLength,E>1&&(E=1),f=this.getPointOnCubicBezier(E,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3],b.points[4],b.points[5]);break;case PathParser.QUAD_TO:E=P/b.pathLength,E>1&&(E=1),f=this.getPointOnQuadraticBezier(E,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3]);break}if(f)return f;break}d+=b.pathLength}return null}getLineLength(h,g,d,f){return Math.sqrt((d-h)*(d-h)+(f-g)*(f-g))}getPathLength(){return-1===this.pathLength&&(this.pathLength=this.dataArray.reduce(((h,g)=>g.pathLength>0?h+g.pathLength:h),0)),this.pathLength}getPointOnCubicBezier(h,g,d,f,x,b,P,E,S){var w=E*CB1(h)+b*CB2(h)+f*CB3(h)+g*CB4(h),C=S*CB1(h)+P*CB2(h)+x*CB3(h)+d*CB4(h);return{x:w,y:C}}getPointOnQuadraticBezier(h,g,d,f,x,b,P){var E=b*QB1(h)+f*QB2(h)+g*QB3(h),S=P*QB1(h)+x*QB2(h)+d*QB3(h);return{x:E,y:S}}getPointOnEllipticalArc(h,g,d,f,x,b){var P=Math.cos(b),E=Math.sin(b),S={x:d*Math.cos(x),y:f*Math.sin(x)};return{x:h+(S.x*P-S.y*E),y:g+(S.x*E+S.y*P)}}buildEquidistantCache(h,g){var d=this.getPathLength(),f=g||.25,x=h||d/100;if(!this.equidistantCache||this.equidistantCache.step!==x||this.equidistantCache.precision!==f){this.equidistantCache={step:x,precision:f,points:[]};for(var b=0,P=0;P<=d;P+=f){var E=this.getPointOnPath(P),S=this.getPointOnPath(P+f);E&&S&&(b+=this.getLineLength(E.x,E.y,S.x,S.y),b>=x&&(this.equidistantCache.points.push({x:E.x,y:E.y,distance:P}),b-=x))}}}getEquidistantPointOnPath(h,g,d){if(this.buildEquidistantCache(g,d),h<0||h-this.getPathLength()>5e-5)return null;var f=Math.round(h/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[f]||null}}var K=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class ImageElement extends RenderedElement{constructor(h,g,d){super(h,g,d),this.type="image",this.loaded=!1;var f=this.getHrefAttribute().getString();if(f){var x=f.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(f);h.images.push(this),x?this.loadSvg(f):this.loadImage(f),this.isSvg=x}}loadImage(h){var g=this;return(0,f.Z)((function*(){try{var d=yield g.document.createImage(h);g.image=d}catch(f){console.error('Error while loading image "'.concat(h,'":'),f)}g.loaded=!0}))()}loadSvg(h){var g=this;return(0,f.Z)((function*(){var d=K.exec(h);if(d){var f=d[5];"base64"===d[4]?g.image=atob(f):g.image=decodeURIComponent(f)}else try{var x=yield g.document.fetch(h),b=yield x.text();g.image=b}catch(P){console.error('Error while loading image "'.concat(h,'":'),P)}g.loaded=!0}))()}renderChildren(h){var{document:g,image:d,loaded:f}=this,x=this.getAttribute("x").getPixels("x"),b=this.getAttribute("y").getPixels("y"),P=this.getStyle("width").getPixels("x"),E=this.getStyle("height").getPixels("y");if(f&&d&&P&&E){if(h.save(),h.translate(x,b),this.isSvg){var S=g.canvg.forkString(h,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:P,scaleHeight:E});S.document.documentElement.parent=this,S.render()}else{var w=this.image;g.setViewBox({ctx:h,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:P,desiredWidth:w.width,height:E,desiredHeight:w.height}),this.loaded&&("undefined"===typeof w.complete||w.complete)&&h.drawImage(w,0,0)}h.restore()}}getBoundingBox(){var h=this.getAttribute("x").getPixels("x"),g=this.getAttribute("y").getPixels("y"),d=this.getStyle("width").getPixels("x"),f=this.getStyle("height").getPixels("y");return new BoundingBox(h,g,h+d,g+f)}}class SymbolElement extends RenderedElement{constructor(){super(...arguments),this.type="symbol"}render(h){}}class SVGFontLoader{constructor(h){this.document=h,this.loaded=!1,h.fonts.push(this)}load(h,g){var d=this;return(0,f.Z)((function*(){try{var{document:f}=d,x=yield f.canvg.parser.load(g),b=x.getElementsByTagName("font");Array.from(b).forEach((g=>{var d=f.createElement(g);f.definitions[h]=d}))}catch(P){console.error('Error while loading font "'.concat(g,'":'),P)}d.loaded=!0}))()}}class StyleElement extends Element{constructor(h,g,d){super(h,g,d),this.type="style";var f=compressSpaces(Array.from(g.childNodes).map((h=>h.textContent)).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")),x=f.split("}");x.forEach((g=>{var d=g.trim();if(d){var f=d.split("{"),x=f[0].split(","),b=f[1].split(";");x.forEach((g=>{var d=g.trim();if(d){var f=h.styles[d]||{};if(b.forEach((g=>{var d=g.indexOf(":"),x=g.substr(0,d).trim(),b=g.substr(d+1,g.length-d).trim();x&&b&&(f[x]=new Property(h,x,b))})),h.styles[d]=f,h.stylesSpecificity[d]=getSelectorSpecificity(d),"@font-face"===d){var x=f["font-family"].getString().replace(/"|'/g,""),P=f.src.getString().split(",");P.forEach((g=>{if(g.indexOf('format("svg")')>0){var d=parseExternalUrl(g);d&&new SVGFontLoader(h).load(x,d)}}))}}}))}}))}}StyleElement.parseExternalUrl=parseExternalUrl;class UseElement extends RenderedElement{constructor(){super(...arguments),this.type="use"}setContext(h){super.setContext(h);var g=this.getAttribute("x"),d=this.getAttribute("y");g.hasValue()&&h.translate(g.getPixels("x"),0),d.hasValue()&&h.translate(0,d.getPixels("y"))}path(h){var{element:g}=this;g&&g.path(h)}renderChildren(h){var{document:g,element:d}=this;if(d){var f=d;if("symbol"===d.type&&(f=new SVGElement(g,null),f.attributes.viewBox=new Property(g,"viewBox",d.getAttribute("viewBox").getString()),f.attributes.preserveAspectRatio=new Property(g,"preserveAspectRatio",d.getAttribute("preserveAspectRatio").getString()),f.attributes.overflow=new Property(g,"overflow",d.getAttribute("overflow").getString()),f.children=d.children,d.styles.opacity=new Property(g,"opacity",this.calculateOpacity())),"svg"===f.type){var x=this.getStyle("width",!1,!0),b=this.getStyle("height",!1,!0);x.hasValue()&&(f.attributes.width=new Property(g,"width",x.getString())),b.hasValue()&&(f.attributes.height=new Property(g,"height",b.getString()))}var P=f.parent;f.parent=this,f.render(h),f.parent=P}}getBoundingBox(h){var{element:g}=this;return g?g.getBoundingBox(h):null}elementTransform(){var{document:h,element:g}=this;return Transform.fromElement(h,g)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function imGet(h,g,d,f,x,b){return h[d*f*4+4*g+b]}function imSet(h,g,d,f,x,b,P){h[d*f*4+4*g+b]=P}function index_es_m(h,g,d){var f=h[g];return f*d}function index_es_c(h,g,d,f){return g+Math.cos(h)*d+Math.sin(h)*f}class FeColorMatrixElement extends Element{constructor(h,g,d){super(h,g,d),this.type="feColorMatrix";var f=toNumbers(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":var x=f[0];f=[.213+.787*x,.715-.715*x,.072-.072*x,0,0,.213-.213*x,.715+.285*x,.072-.072*x,0,0,.213-.213*x,.715-.715*x,.072+.928*x,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var b=f[0]*Math.PI/180;f=[index_es_c(b,.213,.787,-.213),index_es_c(b,.715,-.715,-.715),index_es_c(b,.072,-.072,.928),0,0,index_es_c(b,.213,-.213,.143),index_es_c(b,.715,.285,.14),index_es_c(b,.072,-.072,-.283),0,0,index_es_c(b,.213,-.213,-.787),index_es_c(b,.715,-.715,.715),index_es_c(b,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}this.matrix=f,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(h,g,d,f,x){for(var{includeOpacity:b,matrix:P}=this,E=h.getImageData(0,0,f,x),S=0;S<x;S++)for(var w=0;w<f;w++){var C=imGet(E.data,w,S,f,x,0),A=imGet(E.data,w,S,f,x,1),M=imGet(E.data,w,S,f,x,2),N=imGet(E.data,w,S,f,x,3),_=index_es_m(P,0,C)+index_es_m(P,1,A)+index_es_m(P,2,M)+index_es_m(P,3,N)+index_es_m(P,4,1),V=index_es_m(P,5,C)+index_es_m(P,6,A)+index_es_m(P,7,M)+index_es_m(P,8,N)+index_es_m(P,9,1),k=index_es_m(P,10,C)+index_es_m(P,11,A)+index_es_m(P,12,M)+index_es_m(P,13,N)+index_es_m(P,14,1),R=index_es_m(P,15,C)+index_es_m(P,16,A)+index_es_m(P,17,M)+index_es_m(P,18,N)+index_es_m(P,19,1);b&&(_=0,V=0,k=0,R*=N/255),imSet(E.data,w,S,f,x,0,_),imSet(E.data,w,S,f,x,1,V),imSet(E.data,w,S,f,x,2,k),imSet(E.data,w,S,f,x,3,R)}h.clearRect(0,0,f,x),h.putImageData(E,0,0)}}class MaskElement extends Element{constructor(){super(...arguments),this.type="mask"}apply(h,g){var{document:d}=this,f=this.getAttribute("x").getPixels("x"),x=this.getAttribute("y").getPixels("y"),b=this.getStyle("width").getPixels("x"),P=this.getStyle("height").getPixels("y");if(!b&&!P){var E=new BoundingBox;this.children.forEach((g=>{E.addBoundingBox(g.getBoundingBox(h))})),f=Math.floor(E.x1),x=Math.floor(E.y1),b=Math.floor(E.width),P=Math.floor(E.height)}var S=this.removeStyles(g,MaskElement.ignoreStyles),w=d.createCanvas(f+b,x+P),C=w.getContext("2d");d.screen.setDefaults(C),this.renderChildren(C),new FeColorMatrixElement(d,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(C,0,0,f+b,x+P);var A=d.createCanvas(f+b,x+P),M=A.getContext("2d");d.screen.setDefaults(M),g.render(M),M.globalCompositeOperation="destination-in",M.fillStyle=C.createPattern(w,"no-repeat"),M.fillRect(0,0,f+b,x+P),h.fillStyle=M.createPattern(A,"no-repeat"),h.fillRect(0,0,f+b,x+P),this.restoreStyles(g,S)}render(h){}}MaskElement.ignoreStyles=["mask","transform","clip-path"];var noop=()=>{};class ClipPathElement extends Element{constructor(){super(...arguments),this.type="clipPath"}apply(h){var{document:g}=this,d=Reflect.getPrototypeOf(h),{beginPath:f,closePath:x}=h;d&&(d.beginPath=noop,d.closePath=noop),Reflect.apply(f,h,[]),this.children.forEach((f=>{if("undefined"!==typeof f.path){var b="undefined"!==typeof f.elementTransform?f.elementTransform():null;b||(b=Transform.fromElement(g,f)),b&&b.apply(h),f.path(h),d&&(d.closePath=x),b&&b.unapply(h)}})),Reflect.apply(x,h,[]),h.clip(),d&&(d.beginPath=f,d.closePath=x)}render(h){}}class FilterElement extends Element{constructor(){super(...arguments),this.type="filter"}apply(h,g){var{document:d,children:f}=this,x=g.getBoundingBox(h);if(x){var b=0,P=0;f.forEach((h=>{var g=h.extraFilterDistance||0;b=Math.max(b,g),P=Math.max(P,g)}));var E=Math.floor(x.width),S=Math.floor(x.height),w=E+2*b,C=S+2*P;if(!(w<1||C<1)){var A=Math.floor(x.x),M=Math.floor(x.y),N=this.removeStyles(g,FilterElement.ignoreStyles),_=d.createCanvas(w,C),V=_.getContext("2d");d.screen.setDefaults(V),V.translate(-A+b,-M+P),g.render(V),f.forEach((h=>{"function"===typeof h.apply&&h.apply(V,0,0,w,C)})),h.drawImage(_,0,0,w,C,A-b,M-P,w,C),this.restoreStyles(g,N)}}}render(h){}}FilterElement.ignoreStyles=["filter","transform","clip-path"];class FeDropShadowElement extends Element{constructor(h,g,d){super(h,g,d),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(h,g,d,f,x){}}class FeMorphologyElement extends Element{constructor(){super(...arguments),this.type="feMorphology"}apply(h,g,d,f,x){}}class FeCompositeElement extends Element{constructor(){super(...arguments),this.type="feComposite"}apply(h,g,d,f,x){}}class FeGaussianBlurElement extends Element{constructor(h,g,d){super(h,g,d),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(h,g,d,f,x){var{document:b,blurRadius:P}=this,E=b.window?b.window.document.body:null,S=h.canvas;S.id=b.getUniqueId(),E&&(S.style.display="none",E.appendChild(S)),processCanvasRGBA(S,g,d,f,x,P),E&&E.removeChild(S)}}class TitleElement extends Element{constructor(){super(...arguments),this.type="title"}}class DescElement extends Element{constructor(){super(...arguments),this.type="desc"}}var J={svg:SVGElement,rect:RectElement,circle:CircleElement,ellipse:EllipseElement,line:LineElement,polyline:PolylineElement,polygon:PolygonElement,path:PathElement,pattern:PatternElement,marker:MarkerElement,defs:DefsElement,linearGradient:LinearGradientElement,radialGradient:RadialGradientElement,stop:StopElement,animate:AnimateElement,animateColor:AnimateColorElement,animateTransform:AnimateTransformElement,font:FontElement,"font-face":FontFaceElement,"missing-glyph":MissingGlyphElement,glyph:GlyphElement,text:TextElement,tspan:TSpanElement,tref:TRefElement,a:AElement,textPath:TextPathElement,image:ImageElement,g:GElement,symbol:SymbolElement,style:StyleElement,use:UseElement,mask:MaskElement,clipPath:ClipPathElement,filter:FilterElement,feDropShadow:FeDropShadowElement,feMorphology:FeMorphologyElement,feComposite:FeCompositeElement,feColorMatrix:FeColorMatrixElement,feGaussianBlur:FeGaussianBlurElement,title:TitleElement,desc:DescElement};function ownKeys$1(h,g){var d=Object.keys(h);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(h);g&&(f=f.filter((function(g){return Object.getOwnPropertyDescriptor(h,g).enumerable}))),d.push.apply(d,f)}return d}function _objectSpread$1(h){for(var g=1;g<arguments.length;g++){var d=null!=arguments[g]?arguments[g]:{};g%2?ownKeys$1(Object(d),!0).forEach((function(g){(0,x.Z)(h,g,d[g])})):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(d)):ownKeys$1(Object(d)).forEach((function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(d,g))}))}return h}function createCanvas(h,g){var d=document.createElement("canvas");return d.width=h,d.height=g,d}function createImage(h){return _createImage.apply(this,arguments)}function _createImage(){return _createImage=(0,f.Z)((function*(h){var g=arguments.length>1&&void 0!==arguments[1]&&arguments[1],d=document.createElement("img");return g&&(d.crossOrigin="Anonymous"),new Promise(((g,f)=>{d.onload=()=>{g(d)},d.onerror=(h,g,d,x,b)=>{f(b)},d.src=h}))})),_createImage.apply(this,arguments)}class Document{constructor(h){var{rootEmSize:g=12,emSize:d=12,createCanvas:f=Document.createCanvas,createImage:x=Document.createImage,anonymousCrossOrigin:b}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.canvg=h,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=h.screen,this.rootEmSize=g,this.emSize=d,this.createCanvas=f,this.createImage=this.bindCreateImage(x,b),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(h,g){return"boolean"===typeof g?(d,f)=>h(d,"boolean"===typeof f?f:g):h}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:h}=this;return h[h.length-1]}set emSize(h){var{emSizeStack:g}=this;g.push(h)}popEmSize(){var{emSizeStack:h}=this;h.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every((h=>h.loaded))}isFontsLoaded(){return this.fonts.every((h=>h.loaded))}createDocumentElement(h){var g=this.createElement(h.documentElement);return g.root=!0,g.addStylesFromStyleDefinition(),this.documentElement=g,g}createElement(h){var g=h.nodeName.replace(/^[^:]+:/,""),d=Document.elementTypes[g];return"undefined"!==typeof d?new d(this,h):new UnknownElement(this,h)}createTextNode(h){return new TextNode(this,h)}setViewBox(h){this.screen.setViewBox(_objectSpread$1({document:this},h))}}function ownKeys(h,g){var d=Object.keys(h);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(h);g&&(f=f.filter((function(g){return Object.getOwnPropertyDescriptor(h,g).enumerable}))),d.push.apply(d,f)}return d}function _objectSpread(h){for(var g=1;g<arguments.length;g++){var d=null!=arguments[g]?arguments[g]:{};g%2?ownKeys(Object(d),!0).forEach((function(g){(0,x.Z)(h,g,d[g])})):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(d)):ownKeys(Object(d)).forEach((function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(d,g))}))}return h}Document.createCanvas=createCanvas,Document.createImage=createImage,Document.elementTypes=J;class Canvg{constructor(h,g){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.parser=new Parser(d),this.screen=new Screen(h,d),this.options=d;var f=new Document(this,d),x=f.createDocumentElement(g);this.document=f,this.documentElement=x}static from(h,g){var d=arguments;return(0,f.Z)((function*(){var f=d.length>2&&void 0!==d[2]?d[2]:{},x=new Parser(f),b=yield x.parse(g);return new Canvg(h,b,f)}))()}static fromString(h,g){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},f=new Parser(d),x=f.parseFromString(g);return new Canvg(h,x,d)}fork(h,g){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Canvg.from(h,g,_objectSpread(_objectSpread({},this.options),d))}forkString(h,g){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Canvg.fromString(h,g,_objectSpread(_objectSpread({},this.options),d))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var h=arguments,g=this;return(0,f.Z)((function*(){var d=h.length>0&&void 0!==h[0]?h[0]:{};g.start(_objectSpread({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},d)),yield g.ready(),g.stop()}))()}start(){var h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{documentElement:g,screen:d,options:f}=this;d.start(g,_objectSpread(_objectSpread({enableRedraw:!0},f),h))}stop(){this.screen.stop()}resize(h){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h,d=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.documentElement.resize(h,g,d)}}}}]);