1234567891011121314151617181920212223242526272829303132333435363738394041 |
- !function(){function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function e(e){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?t(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function r(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=d(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){o=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw a}}}}function n(){return n="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var i=a(t,e);if(i){var n=Object.getOwnPropertyDescriptor(i,e);return n.get?n.get.call(arguments.length<3?t:r):n.value}},n.apply(this,arguments)}function a(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=f(t)););return t}function s(t){return function(t){if(Array.isArray(t))return m(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||d(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}function u(t,e){return u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},u(t,e)}function h(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=f(t);if(e){var n=f(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return l(this,r)}}function l(t,e){if(e&&("object"===w(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return c(t)}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function v(t,e,r){return e&&y(t.prototype,e),r&&y(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var i,n,a=[],s=!0,o=!1;try{for(r=r.call(t);!(s=(i=r.next()).done)&&(a.push(i.value),!e||a.length!==e);s=!0);}catch(u){o=!0,n=u}finally{try{s||null==r.return||r.return()}finally{if(o)throw n}}return a}(t,e)||d(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){if(t){if("string"==typeof t)return m(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?m(t,e):void 0}}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function x(t,e,r,i,n,a,s){try{var o=t[a](s),u=o.value}catch(h){return void r(h)}o.done?e(u):Promise.resolve(u).then(i,n)}function b(t){return function(){var e=this,r=arguments;return new Promise((function(i,n){var a=t.apply(e,r);function s(t){x(a,i,n,s,o,"next",t)}function o(t){x(a,i,n,s,o,"throw",t)}s(void 0)}))}}function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}System.register(["./ResizeObserver.es-legacy.44b91b4c.js"],(function(t){"use strict";var a;return{setters:[function(t){a=t.b4}],execute:function(){var u={"Acoustic Grand Piano":"大钢琴","Bright Acoustic Piano":"明亮的钢琴","Electric Grand Piano":"电钢琴","Rhodes Piano":"柔和的电钢琴","Chorused Piano":"加合唱效果的电钢琴",Harpsichord:"羽管键琴",Clavichord:"科拉维科特琴",Celesta:"钢片琴",Glockenspiel:"钢片琴","Music box":"八音盒",Vibraphone:"颤音琴",Marimba:"马林巴",Xylophone:"木琴","Tubular Bells":"管钟",Dulcimer:"大扬琴","Hammond Organ":"击杆风琴","Percussive Organ":"打击式风琴","Rock Organ":"摇滚风琴","Church Organ":"教堂风琴","Reed Organ":"簧管风琴",Accordian:"手风琴",Harmonica:"口琴","Tango Accordian":"探戈手风琴","Acoustic Guitar":"钢弦吉他","Electric Guitar":"闷音电吉他","Overdriven Guitar":"加驱动效果的电吉他","Distortion Guitar":"加失真效果的电吉他","Guitar Harmonics":"吉他和音","Acoustic Bass":"大贝司","Electric Bass":"电贝司","Fretless Bass":"无品贝司","Slap Bass":"掌击","Synth Bass":"电子合成",Violin:"小提琴",Viola:"中提琴",Cello:"大提琴",Contrabass:"低音大提琴","Tremolo Strings":"弦乐群颤音音色","Pizzicato Strings":"弦乐群拨弦音色","Orchestral Harp":"竖琴",Timpani:"定音鼓","String Ensemble":"弦乐合奏音色","Synth Strings":"合成弦乐合奏音色","Choir Aahs":"人声合唱","Voice Oohs":"人声","Synth Voice":"合成人声","Orchestra Hit":"管弦乐敲击齐奏",Trumpet:"小号",Trombone:"长号",Tuba:"大号","Muted Trumpet":"加弱音器小号","French Horn":"法国号","Brass Section":"铜管组","Synth Brass":"合成铜管音色","Soprano Sax":"高音萨克斯管","Alto Sax":"中音萨克斯管","Tenor Sax":"次中音萨克斯管","Baritone Sax":"低音萨克斯管",Oboe:"双簧管","English Horn":"英国管",Bassoon:"巴松","Soprano Saxophone":"高音萨克斯管","Alto Saxophone":"中音萨克斯管","Tenor Saxophone":"次中音萨克斯管","Baritone Saxophone":"上低音萨克斯管",Piccolo:"短笛",Flute:"长笛",Recorder:"竖笛","Soprano Recorder":"高音竖笛","Pan Flute":"排箫","Bottle Blow":"瓶木管",Whistle:"口哨声",Ocarina:"陶笛",Lead:"合成主音","Lead lead":"合成主音","Pad age":"合成音色",Pad:"合成音色",FX:"合成效果 科幻",Sitar:"西塔尔",Banjo:"班卓琴",Shamisen:"三昧线",Koto:"十三弦筝",Kalimba:"卡林巴",Bagpipe:"风笛",Fiddle:"民族提琴",Shanai:"山奈","Tinkle Bell":"叮当铃",Agogos:"阿戈戈铃","Steel Drums":"钢鼓","Taiko Drum":"太鼓","Melodic Toms":"嗵嗵鼓","Synth Drums":"合成鼓","Reverse Cymbals":"反向镲","Agogo Bells":"阿戈戈铃","Taiko Drums":"太鼓",Bongos:"邦戈鼓","Bongo Bell":"邦戈铃",Congas:"康加鼓",Guiro:"刮壶","Guitar Fret Noise":"吉他换把杂音","Breath Noise":"呼吸声",Seashore:"海浪声","Bird Tweet":"鸟鸣","Telephone Ring":"电话铃",Helicopter:"直升机",Applause:"鼓掌声",Gunshot:"枪声","Acoustic Bass Drum":"大鼓","Bass Drum":"大鼓","Side Drum":"小鼓鼓边","Acoustic Snare":"小鼓","Hand Claps":"拍手","Electric Snare":"小鼓","Low Floor Tom":"低音嗵鼓","Closed Hi-Hat":"闭合踩镲","High Floor Tom":"高音落地嗵鼓","Pedal Hi-Hat":"脚踏踩镲","Low Tom":"低音嗵鼓","Open Hi-Hat":"开音踩镲","Low-Mid Tom":"中低音嗵鼓","Hi Mid Tom":"高音鼓","Crash Cymbals":"对镲","High Tom":"高音嗵鼓","Ride Cymbals":"叮叮镲","Chinese Cymbals":"中国镲","Ride Bell":"圆铃",Tambourine:"铃鼓","Splash Cymbal":"溅音镲",Cowbell:"牛铃","Crash Cymbal":"强音钹","Vibra-Slap":"颤音器","Ride Cymbal":"打点钹","Hi Bongo":"高音邦戈鼓","Low Bongo":"低音邦戈鼓","Mute Hi Conga":"弱音高音康加鼓","Open Hi Conga":"强音高音康加鼓","Low Conga":"低音康加鼓","High Timbale":"高音天巴鼓","Low Timbale":"低音天巴鼓","High Agogo":"高音阿戈戈铃","Low Agogo":"低音阿戈戈铃",Cabasa:"卡巴萨",Maracas:"沙锤","Short Whistle":"短口哨","Long Whistle":"长口哨","Short Guiro":"短刮壶","Long Guiro":"长刮壶",Claves:"响棒","Hi Wood Block":"高音木鱼","Low Wood Block":"低音木鱼","Mute Triangle":"弱音三角铁","Open Triangle":"强音三角铁","Drum Set":"架子鼓","Hulusi flute":"葫芦丝",Melodica:"口风琴","Snare Drum":"小军鼓","Horn in F":"圆号",Triangle:"三角铁",Vibrato:"颤音琴","Suspend Cymbals":"吊镲","Suspended Cymbals":"吊镲","Tom-Toms":"嗵嗵鼓",Bell:"铃铛",Bells:"铃铛","Alto Clarinet":"中音单簧管","Bass Clarinet":"低音单簧管",Clarinet:"单簧管",Cornet:"短号",Euphonium:"上低音号","crash cymbals":"对镲",Castanets:"响板",Shaker:"沙锤","Mark tree":"音树",Chimes:"管钟","Mark Tree":"音树","Tom-toms":"嗵嗵鼓","Hi-Hat":"踩镲","Sleigh Bells":"雪橇铃",Flexatone:"弹音器","Brake drum":"闸鼓",Gong:"锣","concert tom":"音乐会嗵嗵鼓","brake drum":"车轮鼓","finger cymbal":"指钹","ride cymbal":"叮叮镲","Concert Toms":"音乐会嗵嗵鼓",Vibraslap:"弹音器","Wood Blocks":"木鱼","Temple Blocks":"木鱼","Wood Block":"木鱼","Field Drum":"军鼓","Quad-Toms":"筒鼓",Quads:"筒鼓","Drums set":"架子鼓","High Bongo":"邦戈",Timbales:"天巴鼓","rain stick":"雨棒","String Bass":"弦乐低音","Floor Tom":"侧嗵鼓","Brake Drum":"闸鼓","Tam-tam":"大锣",Cymbal:"镲",Cymbals:"镲",Whip:"乐鞭",whip:"乐鞭"},y=(t("g",(function(t){for(var e=t.replace(/ /g," ").toLocaleLowerCase(),r=Object.keys(u),i=0;i<r.length;i++){if(r[i].replace(/ /g," ").toLocaleLowerCase()===e)return u[r[i]]||""}for(var n=0;n<r.length;n++){var a=r[n].replace(/ /g," ").toLocaleLowerCase();if(e.includes(a))return u[r[n]]||""}return""})),{exports:{}}),d={exports:{}};(function(){var t,e,r,i,n,a;"undefined"!=typeof performance&&null!==performance&&performance.now?d.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(d.exports=function(){return(t()-n)/1e6},e=process.hrtime,i=(t=function(){var t;return 1e9*(t=e())[0]+t[1]})(),a=1e9*process.uptime(),n=i-a):Date.now?(d.exports=function(){return Date.now()-r},r=Date.now()):(d.exports=function(){return(new Date).getTime()-r},r=(new Date).getTime())}).call(a);for(var m=d.exports,x="undefined"==typeof window?a:window,k=["moz","webkit"],S="AnimationFrame",T=x["request"+S],A=x["cancel"+S]||x["cancelRequest"+S],C=0;!T&&C<k.length;C++)T=x[k[C]+"Request"+S],A=x[k[C]+"Cancel"+S]||x[k[C]+"CancelRequest"+S];if(!T||!A){var P=0,O=0,E=[];T=function(t){if(0===E.length){var e=m(),r=Math.max(0,16.666666666666668-(e-P));P=r+e,setTimeout((function(){var t=E.slice(0);E.length=0;for(var e=0;e<t.length;e++)if(!t[e].cancelled)try{t[e].callback(P)}catch(r){setTimeout((function(){throw r}),0)}}),Math.round(r))}return E.push({handle:++O,callback:t,cancelled:!1}),O},A=function(t){for(var e=0;e<E.length;e++)E[e].handle===t&&(E[e].cancelled=!0)}}y.exports=function(t){return T.call(x,t)},y.exports.cancel=function(){A.apply(x,arguments)},y.exports.polyfill=function(t){t||(t=x),t.requestAnimationFrame=T,t.cancelAnimationFrame=A};var M=y.exports,N=function(t){this.ok=!1,this.alpha=1,"#"==t.charAt(0)&&(t=t.substr(1,6)),t=(t=t.replace(/ /g,"")).toLowerCase();var e={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"};t=e[t]||t;for(var r=[{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(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),parseFloat(t[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(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],i=0;i<r.length;i++){var n=r[i].re,a=r[i].process,s=n.exec(t);if(s){var o=a(s);this.r=o[0],this.g=o[1],this.b=o[2],o.length>3&&(this.alpha=o[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 t=this.r.toString(16),e=this.g.toString(16),r=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==r.length&&(r="0"+r),"#"+t+e+r},this.getHelpXML=function(){for(var t=new Array,i=0;i<r.length;i++)for(var n=r[i].example,a=0;a<n.length;a++)t[t.length]=n[a];for(var s in e)t[t.length]=s;var o=document.createElement("ul");o.setAttribute("id","rgbcolor-examples");for(i=0;i<t.length;i++)try{var u=document.createElement("li"),h=new RGBColor(t[i]),l=document.createElement("div");l.style.cssText="margin: 3px; border: 1px solid black; background:"+h.toHex()+"; color:"+h.toHex(),l.appendChild(document.createTextNode("test"));var c=document.createTextNode(" "+t[i]+" -> "+h.toRGB()+" -> "+h.toHex());u.appendChild(l),u.appendChild(c),o.appendChild(u)}catch(f){}return o}},V=function(t,e){return(V=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};function _(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}V(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function R(t,e){var r=t[0],i=t[1];return[r*Math.cos(e)-i*Math.sin(e),r*Math.sin(e)+i*Math.cos(e)]}function I(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=0;r<t.length;r++)if("number"!=typeof t[r])throw new Error("assertNumbers arguments["+r+"] is not a number. "+w(t[r])+" == typeof "+t[r]);return!0}var L=Math.PI;function D(t,e,r){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;var i=t.rX,n=t.rY,a=t.x,s=t.y;i=Math.abs(t.rX),n=Math.abs(t.rY);var o=R([(e-a)/2,(r-s)/2],-t.xRot/180*L),u=o[0],h=o[1],l=Math.pow(u,2)/Math.pow(i,2)+Math.pow(h,2)/Math.pow(n,2);1<l&&(i*=Math.sqrt(l),n*=Math.sqrt(l)),t.rX=i,t.rY=n;var c=Math.pow(i,2)*Math.pow(h,2)+Math.pow(n,2)*Math.pow(u,2),f=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(i,2)*Math.pow(n,2)-c)/c)),g=i*h/n*f,y=-n*u/i*f,v=R([g,y],t.xRot/180*L);t.cX=v[0]+(e+a)/2,t.cY=v[1]+(r+s)/2,t.phi1=Math.atan2((h-y)/n,(u-g)/i),t.phi2=Math.atan2((-h-y)/n,(-u-g)/i),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*L),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*L),t.phi1*=180/L,t.phi2*=180/L}function B(t,e,r){I(t,e,r);var i=t*t+e*e-r*r;if(0>i)return[];if(0===i)return[[t*r/(t*t+e*e),e*r/(t*t+e*e)]];var n=Math.sqrt(i);return[[(t*r+e*n)/(t*t+e*e),(e*r-t*n)/(t*t+e*e)],[(t*r-e*n)/(t*t+e*e),(e*r+t*n)/(t*t+e*e)]]}var H,z=Math.PI/180;function F(t,e,r){return(1-r)*t+r*e}function U(t,e,r,i){return t+Math.cos(i/180*L)*e+Math.sin(i/180*L)*r}function X(t,e,r,i){var n=1e-6,a=e-t,s=r-e,o=3*a+3*(i-r)-6*s,u=6*(s-a),h=3*a;return Math.abs(o)<n?[-h/u]:function(t,e,r){void 0===r&&(r=1e-6);var i=t*t/4-e;if(i<-r)return[];if(i<=r)return[-t/2];var n=Math.sqrt(i);return[-t/2-n,-t/2+n]}(u/o,h/o,n)}function Y(t,e,r,i,n){var a=1-n;return t*(a*a*a)+e*(3*a*a*n)+r*(3*a*n*n)+i*(n*n*n)}!function(t){function e(){return n((function(t,e,r){return t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=r),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=r),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=r),t.relative=!1),t}))}function r(){var t=NaN,e=NaN,r=NaN,i=NaN;return n((function(n,a,s){return n.type&$.SMOOTH_CURVE_TO&&(n.type=$.CURVE_TO,t=isNaN(t)?a:t,e=isNaN(e)?s:e,n.x1=n.relative?a-t:2*a-t,n.y1=n.relative?s-e:2*s-e),n.type&$.CURVE_TO?(t=n.relative?a+n.x2:n.x2,e=n.relative?s+n.y2:n.y2):(t=NaN,e=NaN),n.type&$.SMOOTH_QUAD_TO&&(n.type=$.QUAD_TO,r=isNaN(r)?a:r,i=isNaN(i)?s:i,n.x1=n.relative?a-r:2*a-r,n.y1=n.relative?s-i:2*s-i),n.type&$.QUAD_TO?(r=n.relative?a+n.x1:n.x1,i=n.relative?s+n.y1:n.y1):(r=NaN,i=NaN),n}))}function i(){var t=NaN,e=NaN;return n((function(r,i,n){if(r.type&$.SMOOTH_QUAD_TO&&(r.type=$.QUAD_TO,t=isNaN(t)?i:t,e=isNaN(e)?n:e,r.x1=r.relative?i-t:2*i-t,r.y1=r.relative?n-e:2*n-e),r.type&$.QUAD_TO){t=r.relative?i+r.x1:r.x1,e=r.relative?n+r.y1:r.y1;var a=r.x1,s=r.y1;r.type=$.CURVE_TO,r.x1=((r.relative?0:i)+2*a)/3,r.y1=((r.relative?0:n)+2*s)/3,r.x2=(r.x+2*a)/3,r.y2=(r.y+2*s)/3}else t=NaN,e=NaN;return r}))}function n(t){var e=0,r=0,i=NaN,n=NaN;return function(a){if(isNaN(i)&&!(a.type&$.MOVE_TO))throw new Error("path must start with moveto");var s=t(a,e,r,i,n);return a.type&$.CLOSE_PATH&&(e=i,r=n),void 0!==a.x&&(e=a.relative?e+a.x:a.x),void 0!==a.y&&(r=a.relative?r+a.y:a.y),a.type&$.MOVE_TO&&(i=e,n=r),s}}function a(t,e,r,i,a,s){return I(t,e,r,i,a,s),n((function(n,o,u,h){var l=n.x1,c=n.x2,f=n.relative&&!isNaN(h),g=void 0!==n.x?n.x:f?0:o,y=void 0!==n.y?n.y:f?0:u;function v(t){return t*t}n.type&$.HORIZ_LINE_TO&&0!==e&&(n.type=$.LINE_TO,n.y=n.relative?0:u),n.type&$.VERT_LINE_TO&&0!==r&&(n.type=$.LINE_TO,n.x=n.relative?0:o),void 0!==n.x&&(n.x=n.x*t+y*r+(f?0:a)),void 0!==n.y&&(n.y=g*e+n.y*i+(f?0:s)),void 0!==n.x1&&(n.x1=n.x1*t+n.y1*r+(f?0:a)),void 0!==n.y1&&(n.y1=l*e+n.y1*i+(f?0:s)),void 0!==n.x2&&(n.x2=n.x2*t+n.y2*r+(f?0:a)),void 0!==n.y2&&(n.y2=c*e+n.y2*i+(f?0:s));var p=t*i-e*r;if(void 0!==n.xRot&&(1!==t||0!==e||0!==r||1!==i))if(0===p)delete n.rX,delete n.rY,delete n.xRot,delete n.lArcFlag,delete n.sweepFlag,n.type=$.LINE_TO;else{var d=n.xRot*Math.PI/180,m=Math.sin(d),x=Math.cos(d),b=1/v(n.rX),w=1/v(n.rY),k=v(x)*b+v(m)*w,S=2*m*x*(b-w),T=v(m)*b+v(x)*w,A=k*i*i-S*e*i+T*e*e,C=S*(t*i+e*r)-2*(k*r*i+T*t*e),P=k*r*r-S*t*r+T*t*t,O=(Math.atan2(C,A-P)+Math.PI)%Math.PI/2,E=Math.sin(O),M=Math.cos(O);n.rX=Math.abs(p)/Math.sqrt(A*v(M)+C*E*M+P*v(E)),n.rY=Math.abs(p)/Math.sqrt(A*v(E)-C*E*M+P*v(M)),n.xRot=180*O/Math.PI}return void 0!==n.sweepFlag&&0>p&&(n.sweepFlag=+!n.sweepFlag),n}))}t.ROUND=function(t){function e(e){return Math.round(e*t)/t}return void 0===t&&(t=1e13),I(t),function(t){return void 0!==t.x1&&(t.x1=e(t.x1)),void 0!==t.y1&&(t.y1=e(t.y1)),void 0!==t.x2&&(t.x2=e(t.x2)),void 0!==t.y2&&(t.y2=e(t.y2)),void 0!==t.x&&(t.x=e(t.x)),void 0!==t.y&&(t.y=e(t.y)),void 0!==t.rX&&(t.rX=e(t.rX)),void 0!==t.rY&&(t.rY=e(t.rY)),t}},t.TO_ABS=e,t.TO_REL=function(){return n((function(t,e,r){return t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=r),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=r),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=r),t.relative=!0),t}))},t.NORMALIZE_HVZ=function(t,e,r){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===r&&(r=!0),n((function(i,n,a,s,o){if(isNaN(s)&&!(i.type&$.MOVE_TO))throw new Error("path must start with moveto");return e&&i.type&$.HORIZ_LINE_TO&&(i.type=$.LINE_TO,i.y=i.relative?0:a),r&&i.type&$.VERT_LINE_TO&&(i.type=$.LINE_TO,i.x=i.relative?0:n),t&&i.type&$.CLOSE_PATH&&(i.type=$.LINE_TO,i.x=i.relative?s-n:s,i.y=i.relative?o-a:o),i.type&$.ARC&&(0===i.rX||0===i.rY)&&(i.type=$.LINE_TO,delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag),i}))},t.NORMALIZE_ST=r,t.QT_TO_C=i,t.INFO=n,t.SANITIZE=function(t){void 0===t&&(t=0),I(t);var e=NaN,r=NaN,i=NaN,a=NaN;return n((function(n,s,o,u,h){var l=Math.abs,c=!1,f=0,g=0;if(n.type&$.SMOOTH_CURVE_TO&&(f=isNaN(e)?0:s-e,g=isNaN(r)?0:o-r),n.type&($.CURVE_TO|$.SMOOTH_CURVE_TO)?(e=n.relative?s+n.x2:n.x2,r=n.relative?o+n.y2:n.y2):(e=NaN,r=NaN),n.type&$.SMOOTH_QUAD_TO?(i=isNaN(i)?s:2*s-i,a=isNaN(a)?o:2*o-a):n.type&$.QUAD_TO?(i=n.relative?s+n.x1:n.x1,a=n.relative?o+n.y1:n.y2):(i=NaN,a=NaN),n.type&$.LINE_COMMANDS||n.type&$.ARC&&(0===n.rX||0===n.rY||!n.lArcFlag)||n.type&$.CURVE_TO||n.type&$.SMOOTH_CURVE_TO||n.type&$.QUAD_TO||n.type&$.SMOOTH_QUAD_TO){var y=void 0===n.x?0:n.relative?n.x:n.x-s,v=void 0===n.y?0:n.relative?n.y:n.y-o;f=isNaN(i)?void 0===n.x1?f:n.relative?n.x:n.x1-s:i-s,g=isNaN(a)?void 0===n.y1?g:n.relative?n.y:n.y1-o:a-o;var p=void 0===n.x2?0:n.relative?n.x:n.x2-s,d=void 0===n.y2?0:n.relative?n.y:n.y2-o;l(y)<=t&&l(v)<=t&&l(f)<=t&&l(g)<=t&&l(p)<=t&&l(d)<=t&&(c=!0)}return n.type&$.CLOSE_PATH&&l(s-u)<=t&&l(o-h)<=t&&(c=!0),c?[]:n}))},t.MATRIX=a,t.ROTATE=function(t,e,r){void 0===e&&(e=0),void 0===r&&(r=0),I(t,e,r);var i=Math.sin(t),n=Math.cos(t);return a(n,i,-i,n,e-e*n+r*i,r-e*i-r*n)},t.TRANSLATE=function(t,e){return void 0===e&&(e=0),I(t,e),a(1,0,0,1,t,e)},t.SCALE=function(t,e){return void 0===e&&(e=t),I(t,e),a(t,0,0,e,0,0)},t.SKEW_X=function(t){return I(t),a(1,0,Math.atan(t),1,0,0)},t.SKEW_Y=function(t){return I(t),a(1,Math.atan(t),0,1,0,0)},t.X_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),I(t),a(-1,0,0,1,t,0)},t.Y_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),I(t),a(1,0,0,-1,0,t)},t.A_TO_C=function(){return n((function(t,e,r){return $.ARC===t.type?function(t,e,r){var i,n,a,s;t.cX||D(t,e,r);for(var o=Math.min(t.phi1,t.phi2),u=Math.max(t.phi1,t.phi2)-o,h=Math.ceil(u/90),l=new Array(h),c=e,f=r,g=0;g<h;g++){var y=F(t.phi1,t.phi2,g/h),v=F(t.phi1,t.phi2,(g+1)/h),p=v-y,d=4/3*Math.tan(p*z/4),m=[Math.cos(y*z)-d*Math.sin(y*z),Math.sin(y*z)+d*Math.cos(y*z)],x=m[0],b=m[1],w=[Math.cos(v*z),Math.sin(v*z)],k=w[0],S=w[1],T=[k+d*Math.sin(v*z),S-d*Math.cos(v*z)],A=T[0],C=T[1];l[g]={relative:t.relative,type:$.CURVE_TO};var P=function(e,r){var i=R([e*t.rX,r*t.rY],t.xRot),n=i[0],a=i[1];return[t.cX+n,t.cY+a]};i=P(x,b),l[g].x1=i[0],l[g].y1=i[1],n=P(A,C),l[g].x2=n[0],l[g].y2=n[1],a=P(k,S),l[g].x=a[0],l[g].y=a[1],t.relative&&(l[g].x1-=c,l[g].y1-=f,l[g].x2-=c,l[g].y2-=f,l[g].x-=c,l[g].y-=f),c=(s=[l[g].x,l[g].y])[0],f=s[1]}return l}(t,t.relative?0:e,t.relative?0:r):t}))},t.ANNOTATE_ARCS=function(){return n((function(t,e,r){return t.relative&&(e=0,r=0),$.ARC===t.type&&D(t,e,r),t}))},t.CLONE=function(){return function(t){var e={};for(var r in t)e[r]=t[r];return e}},t.CALCULATE_BOUNDS=function(){var t=e(),a=i(),s=r(),o=n((function(e,r,i){var n=s(a(t(function(t){var e={};for(var r in t)e[r]=t[r];return e}(e))));function u(t){t>o.maxX&&(o.maxX=t),t<o.minX&&(o.minX=t)}function h(t){t>o.maxY&&(o.maxY=t),t<o.minY&&(o.minY=t)}if(n.type&$.DRAWING_COMMANDS&&(u(r),h(i)),n.type&$.HORIZ_LINE_TO&&u(n.x),n.type&$.VERT_LINE_TO&&h(n.y),n.type&$.LINE_TO&&(u(n.x),h(n.y)),n.type&$.CURVE_TO){u(n.x),h(n.y);for(var l=0,c=X(r,n.x1,n.x2,n.x);l<c.length;l++)0<(P=c[l])&&1>P&&u(Y(r,n.x1,n.x2,n.x,P));for(var f=0,g=X(i,n.y1,n.y2,n.y);f<g.length;f++)0<(P=g[f])&&1>P&&h(Y(i,n.y1,n.y2,n.y,P))}if(n.type&$.ARC){u(n.x),h(n.y),D(n,r,i);for(var y=n.xRot/180*Math.PI,v=Math.cos(y)*n.rX,p=Math.sin(y)*n.rX,d=-Math.sin(y)*n.rY,m=Math.cos(y)*n.rY,x=n.phi1<n.phi2?[n.phi1,n.phi2]:-180>n.phi2?[n.phi2+360,n.phi1+360]:[n.phi2,n.phi1],b=x[0],w=x[1],k=function(t){var e=t[0],r=t[1],i=180*Math.atan2(r,e)/Math.PI;return i<b?i+360:i},S=0,T=B(d,-v,0).map(k);S<T.length;S++)(P=T[S])>b&&P<w&&u(U(n.cX,v,d,P));for(var A=0,C=B(m,-p,0).map(k);A<C.length;A++){var P;(P=C[A])>b&&P<w&&h(U(n.cY,p,m,P))}}return e}));return o.minX=1/0,o.maxX=-1/0,o.minY=1/0,o.maxY=-1/0,o}}(H||(H={}));var W,q=function(){function t(){}return t.prototype.round=function(t){return this.transform(H.ROUND(t))},t.prototype.toAbs=function(){return this.transform(H.TO_ABS())},t.prototype.toRel=function(){return this.transform(H.TO_REL())},t.prototype.normalizeHVZ=function(t,e,r){return this.transform(H.NORMALIZE_HVZ(t,e,r))},t.prototype.normalizeST=function(){return this.transform(H.NORMALIZE_ST())},t.prototype.qtToC=function(){return this.transform(H.QT_TO_C())},t.prototype.aToC=function(){return this.transform(H.A_TO_C())},t.prototype.sanitize=function(t){return this.transform(H.SANITIZE(t))},t.prototype.translate=function(t,e){return this.transform(H.TRANSLATE(t,e))},t.prototype.scale=function(t,e){return this.transform(H.SCALE(t,e))},t.prototype.rotate=function(t,e,r){return this.transform(H.ROTATE(t,e,r))},t.prototype.matrix=function(t,e,r,i,n,a){return this.transform(H.MATRIX(t,e,r,i,n,a))},t.prototype.skewX=function(t){return this.transform(H.SKEW_X(t))},t.prototype.skewY=function(t){return this.transform(H.SKEW_Y(t))},t.prototype.xSymmetry=function(t){return this.transform(H.X_AXIS_SYMMETRY(t))},t.prototype.ySymmetry=function(t){return this.transform(H.Y_AXIS_SYMMETRY(t))},t.prototype.annotateArcs=function(){return this.transform(H.ANNOTATE_ARCS())},t}(),j=function(t){return" "===t||"\t"===t||"\r"===t||"\n"===t},Q=function(t){return"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0)},G=function(t){function e(){var e=t.call(this)||this;return e.curNumber="",e.curCommandType=-1,e.curCommandRelative=!1,e.canParseCommandOrComma=!0,e.curNumberHasExp=!1,e.curNumberHasExpDigits=!1,e.curNumberHasDecimal=!1,e.curArgs=[],e}return _(e,t),e.prototype.finish=function(t){if(void 0===t&&(t=[]),this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},e.prototype.parse=function(t,e){var r=this;void 0===e&&(e=[]);for(var i=function(t){e.push(t),r.curArgs.length=0,r.canParseCommandOrComma=!0},n=0;n<t.length;n++){var a=t[n],s=!(this.curCommandType!==$.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),o=Q(a)&&("0"===this.curNumber&&"0"===a||s);if(!Q(a)||o)if("e"!==a&&"E"!==a)if("-"!==a&&"+"!==a||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==a||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&-1!==this.curCommandType){var u=Number(this.curNumber);if(isNaN(u))throw new SyntaxError("Invalid number ending at "+n);if(this.curCommandType===$.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>u)throw new SyntaxError('Expected positive number, got "'+u+'" at index "'+n+'"')}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 "'+n+'"');this.curArgs.push(u),this.curArgs.length===Z[this.curCommandType]&&($.HORIZ_LINE_TO===this.curCommandType?i({type:$.HORIZ_LINE_TO,relative:this.curCommandRelative,x:u}):$.VERT_LINE_TO===this.curCommandType?i({type:$.VERT_LINE_TO,relative:this.curCommandRelative,y:u}):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(!j(a))if(","===a&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==a&&"-"!==a&&"."!==a)if(o)this.curNumber=a,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+n+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+a+'" at index '+n+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==a&&"Z"!==a)if("h"===a||"H"===a)this.curCommandType=$.HORIZ_LINE_TO,this.curCommandRelative="h"===a;else if("v"===a||"V"===a)this.curCommandType=$.VERT_LINE_TO,this.curCommandRelative="v"===a;else if("m"===a||"M"===a)this.curCommandType=$.MOVE_TO,this.curCommandRelative="m"===a;else if("l"===a||"L"===a)this.curCommandType=$.LINE_TO,this.curCommandRelative="l"===a;else if("c"===a||"C"===a)this.curCommandType=$.CURVE_TO,this.curCommandRelative="c"===a;else if("s"===a||"S"===a)this.curCommandType=$.SMOOTH_CURVE_TO,this.curCommandRelative="s"===a;else if("q"===a||"Q"===a)this.curCommandType=$.QUAD_TO,this.curCommandRelative="q"===a;else if("t"===a||"T"===a)this.curCommandType=$.SMOOTH_QUAD_TO,this.curCommandRelative="t"===a;else{if("a"!==a&&"A"!==a)throw new SyntaxError('Unexpected character "'+a+'" at index '+n+".");this.curCommandType=$.ARC,this.curCommandRelative="a"===a}else e.push({type:$.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=a,this.curNumberHasDecimal="."===a}else this.curNumber+=a,this.curNumberHasDecimal=!0;else this.curNumber+=a;else this.curNumber+=a,this.curNumberHasExp=!0;else this.curNumber+=a,this.curNumberHasExpDigits=this.curNumberHasExp}return e},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(e,r){void 0===r&&(r=[]);for(var i=0,n=Object.getPrototypeOf(this).parse.call(this,e);i<n.length;i++){var a=n[i],s=t(a);Array.isArray(s)?r.push.apply(r,s):r.push(s)}return r}}})},e}(q),$=function(t){function e(r){var i=t.call(this)||this;return i.commands="string"==typeof r?e.parse(r):r,i}return _(e,t),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var t=H.CALCULATE_BOUNDS();return this.transform(t),t},e.prototype.transform=function(t){for(var e=[],r=0,i=this.commands;r<i.length;r++){var n=t(i[r]);Array.isArray(n)?e.push.apply(e,n):e.push(n)}return this.commands=e,this},e.encode=function(t){return function(t){var e="";Array.isArray(t)||(t=[t]);for(var r=0;r<t.length;r++){var i=t[r];if(i.type===$.CLOSE_PATH)e+="z";else if(i.type===$.HORIZ_LINE_TO)e+=(i.relative?"h":"H")+i.x;else if(i.type===$.VERT_LINE_TO)e+=(i.relative?"v":"V")+i.y;else if(i.type===$.MOVE_TO)e+=(i.relative?"m":"M")+i.x+" "+i.y;else if(i.type===$.LINE_TO)e+=(i.relative?"l":"L")+i.x+" "+i.y;else if(i.type===$.CURVE_TO)e+=(i.relative?"c":"C")+i.x1+" "+i.y1+" "+i.x2+" "+i.y2+" "+i.x+" "+i.y;else if(i.type===$.SMOOTH_CURVE_TO)e+=(i.relative?"s":"S")+i.x2+" "+i.y2+" "+i.x+" "+i.y;else if(i.type===$.QUAD_TO)e+=(i.relative?"q":"Q")+i.x1+" "+i.y1+" "+i.x+" "+i.y;else if(i.type===$.SMOOTH_QUAD_TO)e+=(i.relative?"t":"T")+i.x+" "+i.y;else{if(i.type!==$.ARC)throw new Error('Unexpected command type "'+i.type+'" at index '+r+".");e+=(i.relative?"a":"A")+i.rX+" "+i.rY+" "+i.xRot+" "+ +i.lArcFlag+" "+ +i.sweepFlag+" "+i.x+" "+i.y}}return e}(t)},e.parse=function(t){var e=new G,r=[];return e.parse(t,r),e.finish(r),r},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e}(q),Z=((W={})[$.MOVE_TO]=2,W[$.LINE_TO]=2,W[$.HORIZ_LINE_TO]=1,W[$.VERT_LINE_TO]=1,W[$.CLOSE_PATH]=0,W[$.QUAD_TO]=4,W[$.SMOOTH_QUAD_TO]=2,W[$.CURVE_TO]=6,W[$.SMOOTH_CURVE_TO]=4,W[$.ARC]=7,W);function K(t){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K(t)}
- /**
- * StackBlur - a fast almost Gaussian Blur For Canvas
- *
- * In case you find this class useful - especially in commercial projects -
- * I am not totally unhappy for a small donation to my PayPal account
- * mario@quasimondo.de
- *
- * Or support me on flattr:
- * {@link https://flattr.com/thing/72791/StackBlur-a-fast-almost-Gaussian-Blur-Effect-for-CanvasJavascript}.
- *
- * @module StackBlur
- * @author Mario Klingemann
- * Contact: mario@quasimondo.com
- * Website: {@link http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html}
- * Twitter: @quasimondo
- *
- * @copyright (c) 2010 Mario Klingemann
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following
- * conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
- var J=[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],tt=[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 et(t,e,r,i,n,a){if(!(isNaN(a)||a<1)){a|=0;var s=function(t,e,r,i,n){if("string"==typeof t&&(t=document.getElementById(t)),!t||"object"!==K(t)||!("getContext"in t))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var a=t.getContext("2d");try{return a.getImageData(e,r,i,n)}catch(s){throw new Error("unable to access image data: "+s)}}(t,e,r,i,n);s=function(t,e,r,i,n,a){for(var s,o=t.data,u=2*a+1,h=i-1,l=n-1,c=a+1,f=c*(c+1)/2,g=new rt,y=g,v=1;v<u;v++)y=y.next=new rt,v===c&&(s=y);y.next=g;for(var p=null,d=null,m=0,x=0,b=J[a],w=tt[a],k=0;k<n;k++){y=g;for(var S=o[x],T=o[x+1],A=o[x+2],C=o[x+3],P=0;P<c;P++)y.r=S,y.g=T,y.b=A,y.a=C,y=y.next;for(var O=0,E=0,M=0,N=0,V=c*S,_=c*T,R=c*A,I=c*C,L=f*S,D=f*T,B=f*A,H=f*C,z=1;z<c;z++){var F=x+((h<z?h:z)<<2),U=o[F],X=o[F+1],Y=o[F+2],W=o[F+3],q=c-z;L+=(y.r=U)*q,D+=(y.g=X)*q,B+=(y.b=Y)*q,H+=(y.a=W)*q,O+=U,E+=X,M+=Y,N+=W,y=y.next}p=g,d=s;for(var j=0;j<i;j++){var Q=H*b>>w;if(o[x+3]=Q,0!==Q){var G=255/Q;o[x]=(L*b>>w)*G,o[x+1]=(D*b>>w)*G,o[x+2]=(B*b>>w)*G}else o[x]=o[x+1]=o[x+2]=0;L-=V,D-=_,B-=R,H-=I,V-=p.r,_-=p.g,R-=p.b,I-=p.a;var $=j+a+1;$=m+($<h?$:h)<<2,L+=O+=p.r=o[$],D+=E+=p.g=o[$+1],B+=M+=p.b=o[$+2],H+=N+=p.a=o[$+3],p=p.next;var Z=d,K=Z.r,et=Z.g,it=Z.b,nt=Z.a;V+=K,_+=et,R+=it,I+=nt,O-=K,E-=et,M-=it,N-=nt,d=d.next,x+=4}m+=i}for(var at=0;at<i;at++){var st=o[x=at<<2],ot=o[x+1],ut=o[x+2],ht=o[x+3],lt=c*st,ct=c*ot,ft=c*ut,gt=c*ht,yt=f*st,vt=f*ot,pt=f*ut,dt=f*ht;y=g;for(var mt=0;mt<c;mt++)y.r=st,y.g=ot,y.b=ut,y.a=ht,y=y.next;for(var xt=i,bt=0,wt=0,kt=0,St=0,Tt=1;Tt<=a;Tt++){x=xt+at<<2;var At=c-Tt;yt+=(y.r=st=o[x])*At,vt+=(y.g=ot=o[x+1])*At,pt+=(y.b=ut=o[x+2])*At,dt+=(y.a=ht=o[x+3])*At,St+=st,bt+=ot,wt+=ut,kt+=ht,y=y.next,Tt<l&&(xt+=i)}x=at,p=g,d=s;for(var Ct=0;Ct<n;Ct++){var Pt=x<<2;o[Pt+3]=ht=dt*b>>w,ht>0?(ht=255/ht,o[Pt]=(yt*b>>w)*ht,o[Pt+1]=(vt*b>>w)*ht,o[Pt+2]=(pt*b>>w)*ht):o[Pt]=o[Pt+1]=o[Pt+2]=0,yt-=lt,vt-=ct,pt-=ft,dt-=gt,lt-=p.r,ct-=p.g,ft-=p.b,gt-=p.a,Pt=at+((Pt=Ct+c)<l?Pt:l)*i<<2,yt+=St+=p.r=o[Pt],vt+=bt+=p.g=o[Pt+1],pt+=wt+=p.b=o[Pt+2],dt+=kt+=p.a=o[Pt+3],p=p.next,lt+=st=d.r,ct+=ot=d.g,ft+=ut=d.b,gt+=ht=d.a,St-=st,bt-=ot,wt-=ut,kt-=ht,d=d.next,x+=i}}return t}(s,0,0,i,n,a),t.getContext("2d").putImageData(s,e,r)}}var rt=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};var it=Object.freeze({__proto__:null,offscreen:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.DOMParser,r={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,createCanvas:function(t,e){return new OffscreenCanvas(t,e)},createImage:function(t){return b(regeneratorRuntime.mark((function e(){var r,i,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return r=e.sent,e.next=5,r.blob();case 5:return i=e.sent,e.next=8,createImageBitmap(i);case 8:return n=e.sent,e.abrupt("return",n);case 10:case"end":return e.stop()}}),e)})))()}};return void 0===globalThis.DOMParser&&void 0!==e||Reflect.deleteProperty(r,"DOMParser"),r},node:function(t){var e=t.DOMParser,r=t.canvas;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,fetch:t.fetch,createCanvas:r.createCanvas,createImage:r.loadImage}}});function nt(t){return t.replace(/(?!\u3000)\s+/gm," ")}function at(t){var e=t.match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm);return e?e.map(parseFloat):[]}var st=/^[A-Z-]+$/;function ot(t){return st.test(t)?t.toLowerCase():t}function ut(t){var e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(t);return e&&(e[2]||e[3]||e[4])||""}var ht=/(\[[^\]]+\])/g,lt=/(#[^\s+>~.[:]+)/g,ct=/(\.[^\s+>~.[:]+)/g,ft=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,gt=/(:[\w-]+\([^)]*\))/gi,yt=/(:[^\s+>~.[:]+)/g,vt=/([^\s+>~.[:]+)/g;function pt(t,e){var r=e.exec(t);return r?[t.replace(e," "),r.length]:[t,0]}var dt=1e-8;function mt(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))}function xt(t,e){return(t[0]*e[0]+t[1]*e[1])/(mt(t)*mt(e))}function bt(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(xt(t,e))}function wt(t){return t*t*t}function kt(t){return 3*t*t*(1-t)}function St(t){return 3*t*(1-t)*(1-t)}function Tt(t){return(1-t)*(1-t)*(1-t)}function At(t){return t*t}function Ct(t){return 2*t*(1-t)}function Pt(t){return(1-t)*(1-t)}var Ot=function(){function t(e,r,i){g(this,t),this.document=e,this.name=r,this.value=i,this.isNormalizedColor=!1}return v(t,[{key:"split",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:" ",r=this.document,i=this.name;return nt(this.getString()).trim().split(e).map((function(e){return new t(r,i,e)}))}},{key:"hasValue",value:function(t){var e=this.value;return null!==e&&""!==e&&(t||0!==e)&&void 0!==e}},{key:"isString",value:function(t){var e=this.value,r="string"==typeof e;return r&&t?t.test(e):r}},{key:"isUrlDefinition",value:function(){return this.isString(/^url\(/)}},{key:"isPixels",value:function(){if(!this.hasValue())return!1;var t=this.getString();switch(!0){case t.endsWith("px"):case/^[0-9]+$/.test(t):return!0;default:return!1}}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"getValue",value:function(t){return void 0===t||this.hasValue()?this.value:t}},{key:"getNumber",value:function(t){if(!this.hasValue())return void 0===t?0:parseFloat(t);var e=this.value,r=parseFloat(e);return this.isString(/%$/)&&(r/=100),r}},{key:"getString",value:function(t){return void 0===t||this.hasValue()?void 0===this.value?"":String(this.value):String(t)}},{key:"getColor",value:function(t){var e=this.getString(t);return this.isNormalizedColor||(this.isNormalizedColor=!0,e=function(t){if(!t.startsWith("rgb"))return t;var e=3;return t.replace(/\d+(\.\d+)?/g,(function(t,r){return e--&&r?String(Math.round(parseFloat(t))):t}))}(e),this.value=e),e}},{key:"getDpi",value:function(){return 96}},{key:"getRem",value:function(){return this.document.rootEmSize}},{key:"getEm",value:function(){return this.document.emSize}},{key:"getUnits",value:function(){return this.getString().replace(/[0-9.-]/g,"")}},{key:"getPixels",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasValue())return 0;var r="boolean"==typeof t?[void 0,t]:[t],i=p(r,2),n=i[0],a=i[1],s=this.document.screen.viewPort;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(s.computeSize("x"),s.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(s.computeSize("x"),s.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*s.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*s.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(/%$/)&&a:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*s.computeSize(n);default:var o=this.getNumber();return e&&o<1?o*s.computeSize(n):o}}},{key:"getMilliseconds",value:function(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}},{key:"getRadians",value:function(){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)}}},{key:"getDefinition",value:function(){var t=this.getString(),e=/#([^)'"]+)/.exec(t),r=(null==e?void 0:e[1])||t;return this.document.definitions[r]}},{key:"getFillStyleDefinition",value:function(t,e){var r=this.getDefinition();if(!r)return null;if("function"==typeof r.createGradient&&"getBoundingBox"in t)return r.createGradient(this.document.ctx,t,e);if("function"==typeof r.createPattern){if(r.getHrefAttribute().hasValue()){var i=r.getAttribute("patternTransform");(r=r.getHrefAttribute().getDefinition())&&i.hasValue()&&r.getAttribute("patternTransform",!0).setValue(i.value)}if(r)return r.createPattern(this.document.ctx,t,e)}return null}},{key:"getTextBaseline",value:function(){if(!this.hasValue())return null;var e=this.getString();return t.textBaselineMapping[e]||null}},{key:"addOpacity",value:function(e){for(var r=this.getColor(),i=r.length,n=0,a=0;a<i&&(","===r[a]&&n++,3!==n);a++);if(e.hasValue()&&this.isString()&&3!==n){var s=new N(r);s.ok&&(s.alpha=e.getNumber(),r=s.toRGBA())}return new t(this.document,this.name,r)}}],[{key:"empty",value:function(e){return new t(e,"EMPTY","")}}]),t}();Ot.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"};var Et=function(){function t(){g(this,t),this.viewPorts=[]}return v(t,[{key:"clear",value:function(){this.viewPorts=[]}},{key:"setCurrent",value:function(t,e){this.viewPorts.push({width:t,height:e})}},{key:"removeCurrent",value:function(){this.viewPorts.pop()}},{key:"getRoot",value:function(){var t=p(this.viewPorts,1)[0];return t||Mt()}},{key:"getCurrent",value:function(){var t=this.viewPorts,e=t[t.length-1];return e||Mt()}},{key:"width",get:function(){return this.getCurrent().width}},{key:"height",get:function(){return this.getCurrent().height}},{key:"computeSize",value:function(t){return"number"==typeof t?t:"x"===t?this.width:"y"===t?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}]),t}();function Mt(){return{width:Et.DEFAULT_VIEWPORT_WIDTH,height:Et.DEFAULT_VIEWPORT_HEIGHT}}Et.DEFAULT_VIEWPORT_WIDTH=800,Et.DEFAULT_VIEWPORT_HEIGHT=600;var Nt=function(){function t(e,r){g(this,t),this.x=e,this.y=r}return v(t,[{key:"angleTo",value:function(t){return Math.atan2(t.y-this.y,t.x-this.x)}},{key:"applyTransform",value:function(t){var e=this.x,r=this.y,i=e*t[0]+r*t[2]+t[4],n=e*t[1]+r*t[3]+t[5];this.x=i,this.y=n}}],[{key:"parse",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=at(e),n=p(i,2),a=n[0],s=void 0===a?r:a,o=n[1],u=void 0===o?r:o;return new t(s,u)}},{key:"parseScale",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=at(e),n=p(i,2),a=n[0],s=void 0===a?r:a,o=n[1],u=void 0===o?s:o;return new t(s,u)}},{key:"parsePath",value:function(e){for(var r=at(e),i=r.length,n=[],a=0;a<i;a+=2)n.push(new t(r[a],r[a+1]));return n}}]),t}(),Vt=function(){function t(e){g(this,t),this.screen=e,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}return v(t,[{key:"isWorking",value:function(){return this.working}},{key:"start",value:function(){if(!this.working){var t=this.screen,e=this.onClick,r=this.onMouseMove,i=t.ctx.canvas;i.onclick=e,i.onmousemove=r,this.working=!0}}},{key:"stop",value:function(){if(this.working){var t=this.screen.ctx.canvas;this.working=!1,t.onclick=null,t.onmousemove=null}}},{key:"hasEvents",value:function(){return this.working&&this.events.length>0}},{key:"runEvents",value:function(){if(this.working){var t,e=this.screen,r=this.events,i=this.eventElements,n=e.ctx.canvas.style;n&&(n.cursor=""),r.forEach((function(e,r){var n=e.run;for(t=i[r];t;)n(t),t=t.parent})),this.events=[],this.eventElements=[]}}},{key:"checkPath",value:function(t,e){if(this.working&&e){var r=this.events,i=this.eventElements;r.forEach((function(r,n){var a=r.x,s=r.y;!i[n]&&e.isPointInPath&&e.isPointInPath(a,s)&&(i[n]=t)}))}}},{key:"checkBoundingBox",value:function(t,e){if(this.working&&e){var r=this.events,i=this.eventElements;r.forEach((function(r,n){var a=r.x,s=r.y;!i[n]&&e.isPointInBox(a,s)&&(i[n]=t)}))}}},{key:"mapXY",value:function(t,e){for(var r=this.screen,i=r.window,n=r.ctx,a=new Nt(t,e),s=n.canvas;s;)a.x-=s.offsetLeft,a.y-=s.offsetTop,s=s.offsetParent;return(null==i?void 0:i.scrollX)&&(a.x+=i.scrollX),(null==i?void 0:i.scrollY)&&(a.y+=i.scrollY),a}},{key:"onClick",value:function(t){var e=this.mapXY(t.clientX,t.clientY),r=e.x,i=e.y;this.events.push({type:"onclick",x:r,y:i,run:function(t){t.onClick&&t.onClick()}})}},{key:"onMouseMove",value:function(t){var e=this.mapXY(t.clientX,t.clientY),r=e.x,i=e.y;this.events.push({type:"onmousemove",x:r,y:i,run:function(t){t.onMouseMove&&t.onMouseMove()}})}}]),t}(),_t="undefined"!=typeof window?window:null,Rt="undefined"!=typeof fetch?fetch.bind(void 0):void 0,It=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.fetch,n=void 0===i?Rt:i,a=r.window,s=void 0===a?_t:a;if(g(this,t),this.ctx=e,this.viewPort=new Et,this.mouse=new Vt(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=s,!n)throw new Error("Can't find 'fetch' in 'globalThis', please provide it via options");this.fetch=n}return v(t,[{key:"wait",value:function(t){this.waits.push(t)}},{key:"ready",value:function(){return this.readyPromise?this.readyPromise:Promise.resolve()}},{key:"isReady",value:function(){if(this.isReadyLock)return!0;var t=this.waits.every((function(t){return t()}));return t&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=t,t}},{key:"setDefaults",value:function(t){t.strokeStyle="rgba(0,0,0,0)",t.lineCap="butt",t.lineJoin="miter",t.miterLimit=4}},{key:"setViewBox",value:function(t){var e=t.document,r=t.ctx,i=t.aspectRatio,n=t.width,a=t.desiredWidth,s=t.height,o=t.desiredHeight,u=t.minX,h=void 0===u?0:u,l=t.minY,c=void 0===l?0:l,f=t.refX,g=t.refY,y=t.clip,v=void 0!==y&&y,d=t.clipX,m=void 0===d?0:d,x=t.clipY,b=void 0===x?0:x,w=p(nt(i).replace(/^defer\s/,"").split(" "),2),k=w[0]||"xMidYMid",S=w[1]||"meet",T=n/a,A=s/o,C=Math.min(T,A),P=Math.max(T,A),O=a,E=o;"meet"===S&&(O*=C,E*=C),"slice"===S&&(O*=P,E*=P);var M=new Ot(e,"refX",f),N=new Ot(e,"refY",g),V=M.hasValue()&&N.hasValue();if(V&&r.translate(-C*M.getPixels("x"),-C*N.getPixels("y")),v){var _=C*m,R=C*b;r.beginPath(),r.moveTo(_,R),r.lineTo(n,R),r.lineTo(n,s),r.lineTo(_,s),r.closePath(),r.clip()}if(!V){var I="meet"===S&&C===A,L="slice"===S&&P===A,D="meet"===S&&C===T,B="slice"===S&&P===T;k.startsWith("xMid")&&(I||L)&&r.translate(n/2-O/2,0),k.endsWith("YMid")&&(D||B)&&r.translate(0,s/2-E/2),k.startsWith("xMax")&&(I||L)&&r.translate(n-O,0),k.endsWith("YMax")&&(D||B)&&r.translate(0,s-E)}switch(!0){case"none"===k:r.scale(T,A);break;case"meet"===S:r.scale(C,C);break;case"slice"===S:r.scale(P,P)}r.translate(-h,-c)}},{key:"start",value:function(e){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.enableRedraw,a=void 0!==n&&n,s=i.ignoreMouse,o=void 0!==s&&s,u=i.ignoreAnimation,h=void 0!==u&&u,l=i.ignoreDimensions,c=void 0!==l&&l,f=i.ignoreClear,g=void 0!==f&&f,y=i.forceRedraw,v=i.scaleWidth,p=i.scaleHeight,d=i.offsetX,m=i.offsetY,x=this.mouse,b=1e3/t.FRAMERATE;if(this.isReadyLock=!1,this.frameDuration=b,this.readyPromise=new Promise((function(t){r.resolveReady=t})),this.isReady()&&this.render(e,c,g,v,p,d,m),a){var w=Date.now(),k=w,S=0,T=function t(){w=Date.now(),(S=w-k)>=b&&(k=w-S%b,r.shouldUpdate(h,y)&&(r.render(e,c,g,v,p,d,m),x.runEvents())),r.intervalId=M(t)};o||x.start(),this.intervalId=M(T)}}},{key:"stop",value:function(){this.intervalId&&(M.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}},{key:"shouldUpdate",value:function(t,e){if(!t){var r=this.frameDuration,i=this.animations.reduce((function(t,e){return e.update(r)||t}),!1);if(i)return!0}return!("function"!=typeof e||!e())||(!(this.isReadyLock||!this.isReady())||!!this.mouse.hasEvents())}},{key:"render",value:function(t,e,r,i,n,a,s){var o=this.viewPort,u=this.ctx,h=this.isFirstRender,l=u.canvas;o.clear(),l.width&&l.height&&o.setCurrent(l.width,l.height);var c=t.getStyle("width"),f=t.getStyle("height");!e&&(h||"number"!=typeof i&&"number"!=typeof n)&&(c.hasValue()&&(l.width=c.getPixels("x"),l.style&&(l.style.width="".concat(l.width,"px"))),f.hasValue()&&(l.height=f.getPixels("y"),l.style&&(l.style.height="".concat(l.height,"px"))));var g=l.clientWidth||l.width,y=l.clientHeight||l.height;if(e&&c.hasValue()&&f.hasValue()&&(g=c.getPixels("x"),y=f.getPixels("y")),o.setCurrent(g,y),"number"==typeof a&&t.getAttribute("x",!0).setValue(a),"number"==typeof s&&t.getAttribute("y",!0).setValue(s),"number"==typeof i||"number"==typeof n){var v=at(t.getAttribute("viewBox").getString()),p=0,d=0;if("number"==typeof i){var m=t.getStyle("width");m.hasValue()?p=m.getPixels("x")/i:v[2]&&!isNaN(v[2])&&(p=v[2]/i)}if("number"==typeof n){var x=t.getStyle("height");x.hasValue()?d=x.getPixels("y")/n:v[3]&&!isNaN(v[3])&&(d=v[3]/n)}p||(p=d),d||(d=p),t.getAttribute("width",!0).setValue(i),t.getAttribute("height",!0).setValue(n);var b=t.getStyle("transform",!0,!0);b.setValue("".concat(b.getString()," scale(").concat(1/p,", ").concat(1/d,")"))}r||u.clearRect(0,0,g,y),t.render(u),h&&(this.isFirstRender=!1)}}]),t}();It.defaultWindow=_t,It.defaultFetch=Rt,It.FRAMERATE=30,It.MAX_VIRTUAL_PIXELS=3e4;var Lt=It.defaultFetch,Dt="undefined"!=typeof DOMParser?DOMParser:void 0,Bt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.fetch,i=void 0===r?Lt:r,n=e.DOMParser,a=void 0===n?Dt:n;if(g(this,t),!i)throw new Error("Can't find 'fetch' in 'globalThis', please provide it via options");if(!a)throw new Error("Can't find 'DOMParser' in 'globalThis', please provide it via options");this.fetch=i,this.DOMParser=a}var e,r;return v(t,[{key:"parse",value:(r=b(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.startsWith("<")){t.next=2;break}return t.abrupt("return",this.parseFromString(e));case 2:return t.abrupt("return",this.load(e));case 3:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"parseFromString",value:function(t){var e=new this.DOMParser;try{return this.checkDocument(e.parseFromString(t,"image/svg+xml"))}catch(r){return this.checkDocument(e.parseFromString(t,"text/xml"))}}},{key:"checkDocument",value:function(t){var e=t.getElementsByTagName("parsererror")[0];if(e)throw new Error(e.textContent||"Unknown parse error");return t}},{key:"load",value:(e=b(regeneratorRuntime.mark((function t(e){var r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.fetch(e);case 2:return r=t.sent,t.next=5,r.text();case 5:return i=t.sent,t.abrupt("return",this.parseFromString(i));case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}(),Ht=function(){function t(e,r){g(this,t),this.type="translate",this.point=Nt.parse(r)}return v(t,[{key:"apply",value:function(t){var e=this.point,r=e.x,i=e.y;t.translate(r||0,i||0)}},{key:"unapply",value:function(t){var e=this.point,r=e.x,i=e.y;t.translate(-1*r||0,-1*i||0)}},{key:"applyToPoint",value:function(t){var e=this.point,r=e.x,i=e.y;t.applyTransform([1,0,0,1,r||0,i||0])}}]),t}(),zt=function(){function t(e,r,i){g(this,t),this.type="rotate";var n=at(r);this.angle=new Ot(e,"angle",n[0]),this.originX=i[0],this.originY=i[1],this.cx=n[1]||0,this.cy=n[2]||0}return v(t,[{key:"apply",value:function(t){var e=this.cx,r=this.cy,i=this.originX,n=this.originY,a=this.angle,s=e+i.getPixels("x"),o=r+n.getPixels("y");t.translate(s,o),t.rotate(a.getRadians()),t.translate(-s,-o)}},{key:"unapply",value:function(t){var e=this.cx,r=this.cy,i=this.originX,n=this.originY,a=this.angle,s=e+i.getPixels("x"),o=r+n.getPixels("y");t.translate(s,o),t.rotate(-1*a.getRadians()),t.translate(-s,-o)}},{key:"applyToPoint",value:function(t){var e=this.cx,r=this.cy,i=this.angle.getRadians();t.applyTransform([1,0,0,1,e||0,r||0]),t.applyTransform([Math.cos(i),Math.sin(i),-Math.sin(i),Math.cos(i),0,0]),t.applyTransform([1,0,0,1,-e||0,-r||0])}}]),t}(),Ft=function(){function t(e,r,i){g(this,t),this.type="scale";var n=Nt.parseScale(r);0!==n.x&&0!==n.y||(n.x=dt,n.y=dt),this.scale=n,this.originX=i[0],this.originY=i[1]}return v(t,[{key:"apply",value:function(t){var e=this.scale,r=e.x,i=e.y,n=this.originX,a=this.originY,s=n.getPixels("x"),o=a.getPixels("y");t.translate(s,o),t.scale(r,i||r),t.translate(-s,-o)}},{key:"unapply",value:function(t){var e=this.scale,r=e.x,i=e.y,n=this.originX,a=this.originY,s=n.getPixels("x"),o=a.getPixels("y");t.translate(s,o),t.scale(1/r,1/i||r),t.translate(-s,-o)}},{key:"applyToPoint",value:function(t){var e=this.scale,r=e.x,i=e.y;t.applyTransform([r||0,0,0,i||0,0,0])}}]),t}(),Ut=function(){function t(e,r,i){var n;g(this,t),this.type="matrix",this.matrix=[(n=at(r))[0]||0,n[1]||0,n[2]||0,n[3]||0,n[4]||0,n[5]||0],this.originX=i[0],this.originY=i[1]}return v(t,[{key:"apply",value:function(t){var e=this.originX,r=this.originY,i=this.matrix,n=e.getPixels("x"),a=r.getPixels("y");t.translate(n,a),t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),t.translate(-n,-a)}},{key:"unapply",value:function(t){var e=this.originX,r=this.originY,i=this.matrix,n=i[0],a=i[2],s=i[4],o=i[1],u=i[3],h=i[5],l=1/(n*(1*u-0*h)-a*(1*o-0*h)+s*(0*o-0*u)),c=e.getPixels("x"),f=r.getPixels("y");t.translate(c,f),t.transform(l*(1*u-0*h),l*(0*h-1*o),l*(0*s-1*a),l*(1*n-0*s),l*(a*h-s*u),l*(s*o-n*h)),t.translate(-c,-f)}},{key:"applyToPoint",value:function(t){t.applyTransform(this.matrix)}}]),t}(),Xt=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;return g(this,r),(a=e.call(this,t,i,n)).type="skew",a.angle=new Ot(t,"angle",i),a}return v(r)}(Ut),Yt=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;return g(this,r),(a=e.call(this,t,i,n)).type="skewX",a.matrix=[1,0,Math.tan(a.angle.getRadians()),1,0,0],a}return v(r)}(Xt),Wt=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;return g(this,r),(a=e.call(this,t,i,n)).type="skewY",a.matrix=[1,Math.tan(a.angle.getRadians()),0,1,0,0],a}return v(r)}(Xt);var qt=function(){function t(e,r,i){var n=this;g(this,t),this.document=e,this.transforms=[],nt(r).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/).forEach((function(e){if("none"!==e){var r=function(t){var e=p(t.split("("),2),r=e[0],i=void 0===r?"":r,n=e[1],a=void 0===n?"":n;return[i.trim(),a.trim().replace(")","")]}(e),a=p(r,2),s=a[0],o=a[1],u=t.transformTypes[s];u&&n.transforms.push(new u(n.document,o,i))}}))}return v(t,[{key:"apply",value:function(t){this.transforms.forEach((function(e){return e.apply(t)}))}},{key:"unapply",value:function(t){this.transforms.forEach((function(e){return e.unapply(t)}))}},{key:"applyToPoint",value:function(t){this.transforms.forEach((function(e){return e.applyToPoint(t)}))}}],[{key:"fromElement",value:function(e,r){var i=r.getStyle("transform",!1,!0);if(i.hasValue()){var n=p(r.getStyle("transform-origin",!1,!0).split(),2),a=n[0],s=n[1],o=void 0===s?a:s;if(a&&o){var u=[a,o];return new t(e,i.getString(),u)}}return null}}]),t}();qt.transformTypes={translate:Ht,rotate:zt,scale:Ft,matrix:Ut,skewX:Yt,skewY:Wt};var jt=function(){function t(e,r){var i=this,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(g(this,t),this.document=e,this.node=r,this.captureTextNodes=n,this.type="",this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],r&&1===r.nodeType){if(Array.from(r.attributes).forEach((function(t){var r=ot(t.nodeName);i.attributes[r]=new Ot(e,r,t.value)})),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var a=this.getAttribute("style").getString().split(";").map((function(t){return t.trim()}));a.forEach((function(t){if(t){var r=t.split(":").map((function(t){return t.trim()})),n=p(r,2),a=n[0],s=n[1];a&&(i.styles[a]=new Ot(e,a,s))}}))}var s=e.definitions,o=this.getAttribute("id");o.hasValue()&&(s[o.getString()]||(s[o.getString()]=this)),Array.from(r.childNodes).forEach((function(t){if(1===t.nodeType)i.addChild(t);else if(n&&(3===t.nodeType||4===t.nodeType)){var r=e.createTextNode(t);r.getText().length>0&&i.addChild(r)}}))}}return v(t,[{key:"getAttribute",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.attributes[t];if(!r&&e){var i=new Ot(this.document,t,"");return this.attributes[t]=i,i}return r||Ot.empty(this.document)}},{key:"getHrefAttribute",value:function(){var t;for(var e in this.attributes)if("href"===e||e.endsWith(":href")){t=this.attributes[e];break}return t||Ot.empty(this.document)}},{key:"getStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.styles[t];if(i)return i;var n=this.getAttribute(t);if(n.hasValue())return this.styles[t]=n,n;if(!r){var a=this.parent;if(a){var s=a.getStyle(t);if(s.hasValue())return s}}if(e){var o=new Ot(this.document,t,"");return this.styles[t]=o,o}return Ot.empty(this.document)}},{key:"render",value:function(t){if("none"!==this.getStyle("display").getString()&&"hidden"!==this.getStyle("visibility").getString()){if(t.save(),this.getStyle("mask").hasValue()){var e=this.getStyle("mask").getDefinition();e&&(this.applyEffects(t),e.apply(t,this))}else if("none"!==this.getStyle("filter").getValue("none")){var r=this.getStyle("filter").getDefinition();r&&(this.applyEffects(t),r.apply(t,this))}else this.setContext(t),this.renderChildren(t),this.clearContext(t);t.restore()}}},{key:"setContext",value:function(t){}},{key:"applyEffects",value:function(t){var e=qt.fromElement(this.document,this);e&&e.apply(t);var r=this.getStyle("clip-path",!1,!0);if(r.hasValue()){var i=r.getDefinition();i&&i.apply(t)}}},{key:"clearContext",value:function(t){}},{key:"renderChildren",value:function(t){this.children.forEach((function(e){e.render(t)}))}},{key:"addChild",value:function(e){var r=e instanceof t?e:this.document.createElement(e);r.parent=this,t.ignoreChildTypes.includes(r.type)||this.children.push(r)}},{key:"matchesSelector",value:function(t){var e,r=this.node;if("function"==typeof r.matches)return r.matches(t);var i=null===(e=r.getAttribute)||void 0===e?void 0:e.call(r,"class");return!(!i||""===i)&&i.split(" ").some((function(e){return".".concat(e)===t}))}},{key:"addStylesFromStyleDefinition",value:function(){var t,e=this.document,r=e.styles,i=e.stylesSpecificity;for(var n in r)if(!n.startsWith("@")&&this.matchesSelector(n)){var a=r[n],s=i[n];if(a)for(var o in a){var u=this.stylesSpecificity[o];void 0===u&&(u="000"),s&&s>=u&&((t=a[o])&&(this.styles[o]=t),this.stylesSpecificity[o]=s)}}}},{key:"removeStyles",value:function(t,e){return e.reduce((function(e,r){var i=t.getStyle(r);if(!i.hasValue())return e;var n=i.getString();return i.setValue(""),[].concat(s(e),[[r,n]])}),[])}},{key:"restoreStyles",value:function(t,e){e.forEach((function(e){var r=p(e,2),i=r[0],n=r[1];t.getStyle(i,!0).setValue(n)}))}},{key:"isFirstChild",value:function(){var t;return 0===(null===(t=this.parent)||void 0===t?void 0:t.children.indexOf(this))}}]),t}();jt.ignoreChildTypes=["title"];var Qt=function(t){o(r,t);var e=h(r);function r(t,i,n){return g(this,r),e.call(this,t,i,n)}return v(r)}(jt);function Gt(t){var e=t.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}function $t(t){if(!t)return"";var e=t.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}function Zt(t){if(!t)return"";var e=t.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}var Kt=function(){function t(e,r,i,n,a,s){g(this,t);var o=s?"string"==typeof s?t.parse(s):s:{};this.fontFamily=a||o.fontFamily,this.fontSize=n||o.fontSize,this.fontStyle=e||o.fontStyle,this.fontWeight=i||o.fontWeight,this.fontVariant=r||o.fontVariant}return v(t,[{key:"toString",value:function(){return[$t(this.fontStyle),this.fontVariant,Zt(this.fontWeight),this.fontSize,(t=this.fontFamily,"undefined"==typeof process?t:t.trim().split(",").map(Gt).join(","))].join(" ").trim();var t}}],[{key:"parse",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0,i="",n="",a="",s="",o="",u=nt(e).trim().split(" "),h={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return u.forEach((function(e){switch(!0){case!h.fontStyle&&t.styles.includes(e):"inherit"!==e&&(i=e),h.fontStyle=!0;break;case!h.fontVariant&&t.variants.includes(e):"inherit"!==e&&(n=e),h.fontStyle=!0,h.fontVariant=!0;break;case!h.fontWeight&&t.weights.includes(e):"inherit"!==e&&(a=e),h.fontStyle=!0,h.fontVariant=!0,h.fontWeight=!0;break;case!h.fontSize:"inherit"!==e&&(s=e.split("/")[0]||""),h.fontStyle=!0,h.fontVariant=!0,h.fontWeight=!0,h.fontSize=!0;break;default:"inherit"!==e&&(o+=e)}})),new t(i,n,a,s,o,r)}}]),t}();Kt.styles="normal|italic|oblique|inherit",Kt.variants="normal|small-caps|inherit",Kt.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";var Jt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.NaN,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.NaN,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.NaN,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Number.NaN;g(this,t),this.x1=e,this.y1=r,this.x2=i,this.y2=n,this.addPoint(e,r),this.addPoint(i,n)}return v(t,[{key:"x",get:function(){return this.x1}},{key:"y",get:function(){return this.y1}},{key:"width",get:function(){return this.x2-this.x1}},{key:"height",get:function(){return this.y2-this.y1}},{key:"addPoint",value:function(t,e){void 0!==t&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),void 0!==e&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))}},{key:"addX",value:function(t){this.addPoint(t,0)}},{key:"addY",value:function(t){this.addPoint(0,t)}},{key:"addBoundingBox",value:function(t){if(t){var e=t.x1,r=t.y1,i=t.x2,n=t.y2;this.addPoint(e,r),this.addPoint(i,n)}}},{key:"sumCubic",value:function(t,e,r,i,n){return Math.pow(1-t,3)*e+3*Math.pow(1-t,2)*t*r+3*(1-t)*Math.pow(t,2)*i+Math.pow(t,3)*n}},{key:"bezierCurveAdd",value:function(t,e,r,i,n){var a=6*e-12*r+6*i,s=-3*e+9*r-9*i+3*n,o=3*r-3*e;if(0!==s){var u=Math.pow(a,2)-4*o*s;if(!(u<0)){var h=(-a+Math.sqrt(u))/(2*s);0<h&&h<1&&(t?this.addX(this.sumCubic(h,e,r,i,n)):this.addY(this.sumCubic(h,e,r,i,n)));var l=(-a-Math.sqrt(u))/(2*s);0<l&&l<1&&(t?this.addX(this.sumCubic(l,e,r,i,n)):this.addY(this.sumCubic(l,e,r,i,n)))}}else{if(0===a)return;var c=-o/a;0<c&&c<1&&(t?this.addX(this.sumCubic(c,e,r,i,n)):this.addY(this.sumCubic(c,e,r,i,n)))}}},{key:"addBezierCurve",value:function(t,e,r,i,n,a,s,o){this.addPoint(t,e),this.addPoint(s,o),this.bezierCurveAdd(!0,t,r,n,s),this.bezierCurveAdd(!1,e,i,a,o)}},{key:"addQuadraticCurve",value:function(t,e,r,i,n,a){var s=t+2/3*(r-t),o=e+2/3*(i-e),u=s+1/3*(n-t),h=o+1/3*(a-e);this.addBezierCurve(t,e,s,u,o,h,n,a)}},{key:"isPointInBox",value:function(t,e){var r=this.x1,i=this.y1,n=this.x2,a=this.y2;return r<=t&&t<=n&&i<=e&&e<=a}}]),t}(),te=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).modifiedEmSizeStack=!1,t}return v(r,[{key:"calculateOpacity",value:function(){for(var t=1,e=this;e;){var r=e.getStyle("opacity",!1,!0);r.hasValue(!0)&&(t*=r.getNumber()),e=e.parent}return t}},{key:"setContext",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e){var r=this.getStyle("fill"),i=this.getStyle("fill-opacity"),n=this.getStyle("stroke"),a=this.getStyle("stroke-opacity");if(r.isUrlDefinition()){var s=r.getFillStyleDefinition(this,i);s&&(t.fillStyle=s)}else if(r.hasValue()){"currentColor"===r.getString()&&r.setValue(this.getStyle("color").getColor());var o=r.getColor();"inherit"!==o&&(t.fillStyle="none"===o?"rgba(0,0,0,0)":o)}if(i.hasValue()){var u=new Ot(this.document,"fill",t.fillStyle).addOpacity(i).getColor();t.fillStyle=u}if(n.isUrlDefinition()){var h=n.getFillStyleDefinition(this,a);h&&(t.strokeStyle=h)}else if(n.hasValue()){"currentColor"===n.getString()&&n.setValue(this.getStyle("color").getColor());var l=n.getString();"inherit"!==l&&(t.strokeStyle="none"===l?"rgba(0,0,0,0)":l)}if(a.hasValue()){var c=new Ot(this.document,"stroke",t.strokeStyle).addOpacity(a).getString();t.strokeStyle=c}var f=this.getStyle("stroke-width");if(f.hasValue()){var g=f.getPixels();t.lineWidth=g||dt}var y=this.getStyle("stroke-linecap"),v=this.getStyle("stroke-linejoin"),p=this.getStyle("stroke-miterlimit"),d=this.getStyle("stroke-dasharray"),m=this.getStyle("stroke-dashoffset");if(y.hasValue()&&(t.lineCap=y.getString()),v.hasValue()&&(t.lineJoin=v.getString()),p.hasValue()&&(t.miterLimit=p.getNumber()),d.hasValue()&&"none"!==d.getString()){var x=at(d.getString());void 0!==t.setLineDash?t.setLineDash(x):void 0!==t.webkitLineDash?t.webkitLineDash=x:void 0===t.mozDash||1===x.length&&0===x[0]||(t.mozDash=x);var b=m.getPixels();void 0!==t.lineDashOffset?t.lineDashOffset=b:void 0!==t.webkitLineDashOffset?t.webkitLineDashOffset=b:void 0!==t.mozDashOffset&&(t.mozDashOffset=b)}}if(this.modifiedEmSizeStack=!1,void 0!==t.font){var w=this.getStyle("font"),k=this.getStyle("font-style"),S=this.getStyle("font-variant"),T=this.getStyle("font-weight"),A=this.getStyle("font-size"),C=this.getStyle("font-family"),P=new Kt(k.getString(),S.getString(),T.getString(),A.hasValue()?"".concat(A.getPixels(!0),"px"):"",C.getString(),Kt.parse(w.getString(),t.font));k.setValue(P.fontStyle),S.setValue(P.fontVariant),T.setValue(P.fontWeight),A.setValue(P.fontSize),C.setValue(P.fontFamily),t.font=P.toString(),A.isPixels()&&(this.document.emSize=A.getPixels(),this.modifiedEmSizeStack=!0)}e||(this.applyEffects(t),t.globalAlpha=this.calculateOpacity())}},{key:"clearContext",value:function(t){n(f(r.prototype),"clearContext",this).call(this,t),this.modifiedEmSizeStack&&this.document.popEmSize()}}]),r}(jt),ee=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;return g(this,r),(a=e.call(this,t,i,(this instanceof r?this.constructor:void 0)===r||n)).type="text",a.x=0,a.y=0,a.leafTexts=[],a.textChunkStart=0,a.minX=Number.POSITIVE_INFINITY,a.maxX=Number.NEGATIVE_INFINITY,a.measureCache=-1,a}return v(r,[{key:"setContext",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n(f(r.prototype),"setContext",this).call(this,t,e);var i=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();i&&(t.textBaseline=i)}},{key:"initializeCoordinates",value:function(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}},{key:"getBoundingBox",value:function(t){var e=this;if("text"!==this.type)return this.getTElementBoundingBox(t);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t);var r=null;return this.children.forEach((function(i,n){var a=e.getChildBoundingBox(t,e,e,n);r?r.addBoundingBox(a):r=a})),r}},{key:"getFontSize",value:function(){var t=this.document,e=this.parent,r=Kt.parse(t.ctx.font).fontSize;return e.getStyle("font-size").getNumber(r)}},{key:"getTElementBoundingBox",value:function(t){var e=this.getFontSize();return new Jt(this.x,this.y-e,this.x+this.measureText(t),this.y)}},{key:"getGlyph",value:function(t,e,r){var i,n=e[r];if(t.isArabic){var a,s=e.length,o=e[r-1],u=e[r+1],h="isolated";(0===r||" "===o)&&r<s-1&&" "!==u&&(h="terminal"),r>0&&" "!==o&&r<s-1&&" "!==u&&(h="medial"),r>0&&" "!==o&&(r===s-1||" "===u)&&(h="initial"),i=(null===(a=t.arabicGlyphs[n])||void 0===a?void 0:a[h])||t.glyphs[n]}else i=t.glyphs[n];return i||(i=t.missingGlyph),i}},{key:"getText",value:function(){return""}},{key:"getTextFromNode",value:function(t){var e=t||this.node,r=Array.from(e.parentNode.childNodes),i=r.indexOf(e),n=r.length-1,a=nt(e.textContent||"");return 0===i&&(a=a.replace(/^[\n \t]+/,"")),i===n&&(a=function(t){return t.replace(/[\n \t]+$/,"")}(a)),a}},{key:"renderChildren",value:function(t){var e=this;if("text"===this.type){this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t),this.children.forEach((function(r,i){e.renderChild(t,e,e,i)}));var r=this.document.screen.mouse;r.isWorking()&&r.checkBoundingBox(this,this.getBoundingBox(t))}else this.renderTElementChildren(t)}},{key:"renderTElementChildren",value:function(t){var e=this.document,r=this.parent,i=this.getText(),n=r.getStyle("font-family").getDefinition();if(n)for(var a=n.fontFace.unitsPerEm,s=Kt.parse(e.ctx.font),o=r.getStyle("font-size").getNumber(s.fontSize),u=r.getStyle("font-style").getString(s.fontStyle),h=o/a,l=n.isRTL?i.split("").reverse().join(""):i,c=at(r.getAttribute("dx").getString()),f=l.length,g=0;g<f;g++){var y=this.getGlyph(n,l,g);t.translate(this.x,this.y),t.scale(h,-h);var v=t.lineWidth;t.lineWidth=t.lineWidth*a/o,"italic"===u&&t.transform(1,0,.4,1,0,0),y.render(t),"italic"===u&&t.transform(1,0,-.4,1,0,0),t.lineWidth=v,t.scale(1/h,-1/h),t.translate(-this.x,-this.y),this.x+=o*(y.horizAdvX||n.horizAdvX)/a,void 0===c[g]||isNaN(c[g])||(this.x+=c[g])}else{var p=this.x,d=this.y;t.fillStyle&&t.fillText(i,p,d),t.strokeStyle&&t.strokeText(i,p,d)}}},{key:"applyAnchoring",value:function(){if(!(this.textChunkStart>=this.leafTexts.length)){var t=this.leafTexts[this.textChunkStart],e=t.getStyle("text-anchor").getString("start"),r=0;r="start"===e?t.x-this.minX:"end"===e?t.x-this.maxX:t.x-(this.minX+this.maxX)/2;for(var i=this.textChunkStart;i<this.leafTexts.length;i++)this.leafTexts[i].x+=r;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}},{key:"adjustChildCoordinatesRecursive",value:function(t){var e=this;this.children.forEach((function(r,i){e.adjustChildCoordinatesRecursiveCore(t,e,e,i)})),this.applyAnchoring()}},{key:"adjustChildCoordinatesRecursiveCore",value:function(t,e,r,i){var n=r.children[i];n.children.length>0?n.children.forEach((function(r,i){e.adjustChildCoordinatesRecursiveCore(t,e,n,i)})):this.adjustChildCoordinates(t,e,r,i)}},{key:"adjustChildCoordinates",value:function(t,e,r,i){var n=r.children[i];if("function"!=typeof n.measureText)return n;t.save(),n.setContext(t,!0);var a=n.getAttribute("x"),s=n.getAttribute("y"),o=n.getAttribute("dx"),u=n.getAttribute("dy"),h=n.getStyle("font-family").getDefinition(),l=Boolean(null==h?void 0:h.isRTL);0===i&&(a.hasValue()||a.setValue(n.getInheritedAttribute("x")),s.hasValue()||s.setValue(n.getInheritedAttribute("y")),o.hasValue()||o.setValue(n.getInheritedAttribute("dx")),u.hasValue()||u.setValue(n.getInheritedAttribute("dy")));var c=n.measureText(t);return l&&(e.x-=c),a.hasValue()?(e.applyAnchoring(),n.x=a.getPixels("x"),o.hasValue()&&(n.x+=o.getPixels("x"))):(o.hasValue()&&(e.x+=o.getPixels("x")),n.x=e.x),e.x=n.x,l||(e.x+=c),s.hasValue()?(n.y=s.getPixels("y"),u.hasValue()&&(n.y+=u.getPixels("y"))):(u.hasValue()&&(e.y+=u.getPixels("y")),n.y=e.y),e.y=n.y,e.leafTexts.push(n),e.minX=Math.min(e.minX,n.x,n.x+c),e.maxX=Math.max(e.maxX,n.x,n.x+c),n.clearContext(t),t.restore(),n}},{key:"getChildBoundingBox",value:function(t,e,r,i){var n=r.children[i];if("function"!=typeof n.getBoundingBox)return null;var a=n.getBoundingBox(t);return a&&n.children.forEach((function(r,i){var s=e.getChildBoundingBox(t,e,n,i);a.addBoundingBox(s)})),a}},{key:"renderChild",value:function(t,e,r,i){var n=r.children[i];n.render(t),n.children.forEach((function(r,i){e.renderChild(t,e,n,i)}))}},{key:"measureText",value:function(t){var e=this.measureCache;if(~e)return e;var r=this.getText(),i=this.measureTargetText(t,r);return this.measureCache=i,i}},{key:"measureTargetText",value:function(t,e){if(!e.length)return 0;var r=this.parent,i=r.getStyle("font-family").getDefinition();if(i){for(var n=this.getFontSize(),a=i.isRTL?e.split("").reverse().join(""):e,s=at(r.getAttribute("dx").getString()),o=a.length,u=0,h=0;h<o;h++){u+=(this.getGlyph(i,a,h).horizAdvX||i.horizAdvX)*n/i.fontFace.unitsPerEm,void 0===s[h]||isNaN(s[h])||(u+=s[h])}return u}if(!t.measureText)return 10*e.length;t.save(),this.setContext(t,!0);var l=t.measureText(e).width;return this.clearContext(t),t.restore(),l}},{key:"getInheritedAttribute",value:function(t){for(var e=this;e instanceof r&&e.isFirstChild()&&e.parent;){var i=e.parent.getAttribute(t);if(i.hasValue(!0))return i.getString("0");e=e.parent}return null}}]),r}(te),re=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;return g(this,r),(a=e.call(this,t,i,(this instanceof r?this.constructor:void 0)===r||n)).type="tspan",a.text=a.children.length>0?"":a.getTextFromNode(),a}return v(r,[{key:"getText",value:function(){return this.text}}]),r}(ee),ie=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="textNode",t}return v(r)}(re),ne=function(t){o(r,t);var e=h(r);function r(t){var i;return g(this,r),(i=e.call(this,t.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,""))).control=new Nt(0,0),i.start=new Nt(0,0),i.current=new Nt(0,0),i.command=null,i.commands=i.commands,i.i=-1,i.previousCommand=null,i.points=[],i.angles=[],i}return v(r,[{key:"reset",value:function(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new Nt(0,0),this.control=new Nt(0,0),this.current=new Nt(0,0),this.points=[],this.angles=[]}},{key:"isEnd",value:function(){return this.i>=this.commands.length-1}},{key:"next",value:function(){var t=this.commands[++this.i];return this.previousCommand=this.command,this.command=t,t}},{key:"getPoint",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"x",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y",r=new Nt(this.command[t],this.command[e]);return this.makeAbsolute(r)}},{key:"getAsControlPoint",value:function(t,e){var r=this.getPoint(t,e);return this.control=r,r}},{key:"getAsCurrentPoint",value:function(t,e){var r=this.getPoint(t,e);return this.current=r,r}},{key:"getReflectedControlPoint",value:function(){var t=this.previousCommand.type;if(t!==$.CURVE_TO&&t!==$.SMOOTH_CURVE_TO&&t!==$.QUAD_TO&&t!==$.SMOOTH_QUAD_TO)return this.current;var e=this.current,r=e.x,i=e.y,n=this.control,a=n.x,s=n.y;return new Nt(2*r-a,2*i-s)}},{key:"makeAbsolute",value:function(t){if(this.command.relative){var e=this.current,r=e.x,i=e.y;t.x+=r,t.y+=i}return t}},{key:"addMarker",value:function(t,e,r){var i=this.points,n=this.angles;r&&n.length>0&&!n[n.length-1]&&(n[n.length-1]=i[i.length-1].angleTo(r)),this.addMarkerAngle(t,e?e.angleTo(t):null)}},{key:"addMarkerAngle",value:function(t,e){this.points.push(t),this.angles.push(e)}},{key:"getMarkerPoints",value:function(){return this.points}},{key:"getMarkerAngles",value:function(){for(var t=this.angles,e=t.length,r=0;r<e;r++)if(!t[r])for(var i=r+1;i<e;i++)if(t[i]){t[r]=t[i];break}return t}}]),r}($),ae=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;return g(this,r),(a=e.call(this,t,i,n)).type="path",a.pathParser=new ne(a.getAttribute("d").getString()),a}return v(r,[{key:"path",value:function(t){var e=this.pathParser,r=new Jt;for(e.reset(),t&&t.beginPath();!e.isEnd();)switch(e.next().type){case ne.MOVE_TO:this.pathM(t,r);break;case ne.LINE_TO:this.pathL(t,r);break;case ne.HORIZ_LINE_TO:this.pathH(t,r);break;case ne.VERT_LINE_TO:this.pathV(t,r);break;case ne.CURVE_TO:this.pathC(t,r);break;case ne.SMOOTH_CURVE_TO:this.pathS(t,r);break;case ne.QUAD_TO:this.pathQ(t,r);break;case ne.SMOOTH_QUAD_TO:this.pathT(t,r);break;case ne.ARC:this.pathA(t,r);break;case ne.CLOSE_PATH:this.pathZ(t,r)}return r}},{key:"getBoundingBox",value:function(t){return this.path()}},{key:"getMarkers",value:function(){var t=this.pathParser,e=t.getMarkerPoints(),r=t.getMarkerAngles(),i=e.map((function(t,e){return[t,r[e]]}));return i}},{key:"renderChildren",value:function(t){this.path(t),this.document.screen.mouse.checkPath(this,t);var e=this.getStyle("fill-rule");""!==t.fillStyle&&("inherit"!==e.getString("inherit")?t.fill(e.getString()):t.fill()),""!==t.strokeStyle&&("non-scaling-stroke"===this.getAttribute("vector-effect").getString()?(t.save(),t.setTransform(1,0,0,1,0,0),t.stroke(),t.restore()):t.stroke());var r=this.getMarkers();if(r){var i=r.length-1,n=this.getStyle("marker-start"),a=this.getStyle("marker-mid"),s=this.getStyle("marker-end");if(n.isUrlDefinition()){var o=n.getDefinition(),u=p(r[0],2),h=u[0],l=u[1];o.render(t,h,l)}if(a.isUrlDefinition())for(var c=a.getDefinition(),f=1;f<i;f++){var g=p(r[f],2),y=g[0],v=g[1];c.render(t,y,v)}if(s.isUrlDefinition()){var d=s.getDefinition(),m=p(r[i],2),x=m[0],b=m[1];d.render(t,x,b)}}}},{key:"pathM",value:function(t,e){var i=this.pathParser,n=r.pathM(i).point,a=n.x,s=n.y;i.addMarker(n),e.addPoint(a,s),t&&t.moveTo(a,s)}},{key:"pathL",value:function(t,e){var i=this.pathParser,n=r.pathL(i),a=n.current,s=n.point,o=s.x,u=s.y;i.addMarker(s,a),e.addPoint(o,u),t&&t.lineTo(o,u)}},{key:"pathH",value:function(t,e){var i=this.pathParser,n=r.pathH(i),a=n.current,s=n.point,o=s.x,u=s.y;i.addMarker(s,a),e.addPoint(o,u),t&&t.lineTo(o,u)}},{key:"pathV",value:function(t,e){var i=this.pathParser,n=r.pathV(i),a=n.current,s=n.point,o=s.x,u=s.y;i.addMarker(s,a),e.addPoint(o,u),t&&t.lineTo(o,u)}},{key:"pathC",value:function(t,e){var i=this.pathParser,n=r.pathC(i),a=n.current,s=n.point,o=n.controlPoint,u=n.currentPoint;i.addMarker(u,o,s),e.addBezierCurve(a.x,a.y,s.x,s.y,o.x,o.y,u.x,u.y),t&&t.bezierCurveTo(s.x,s.y,o.x,o.y,u.x,u.y)}},{key:"pathS",value:function(t,e){var i=this.pathParser,n=r.pathS(i),a=n.current,s=n.point,o=n.controlPoint,u=n.currentPoint;i.addMarker(u,o,s),e.addBezierCurve(a.x,a.y,s.x,s.y,o.x,o.y,u.x,u.y),t&&t.bezierCurveTo(s.x,s.y,o.x,o.y,u.x,u.y)}},{key:"pathQ",value:function(t,e){var i=this.pathParser,n=r.pathQ(i),a=n.current,s=n.controlPoint,o=n.currentPoint;i.addMarker(o,s,s),e.addQuadraticCurve(a.x,a.y,s.x,s.y,o.x,o.y),t&&t.quadraticCurveTo(s.x,s.y,o.x,o.y)}},{key:"pathT",value:function(t,e){var i=this.pathParser,n=r.pathT(i),a=n.current,s=n.controlPoint,o=n.currentPoint;i.addMarker(o,s,s),e.addQuadraticCurve(a.x,a.y,s.x,s.y,o.x,o.y),t&&t.quadraticCurveTo(s.x,s.y,o.x,o.y)}},{key:"pathA",value:function(t,e){var i=this.pathParser,n=r.pathA(i),a=n.currentPoint,s=n.rX,o=n.rY,u=n.sweepFlag,h=n.xAxisRotation,l=n.centp,c=n.a1,f=n.ad,g=1-u?1:-1,y=c+g*(f/2),v=new Nt(l.x+s*Math.cos(y),l.y+o*Math.sin(y));if(i.addMarkerAngle(v,y-g*Math.PI/2),i.addMarkerAngle(a,y-g*Math.PI),e.addPoint(a.x,a.y),t&&!isNaN(c)&&!isNaN(f)){var p=s>o?s:o,d=s>o?1:s/o,m=s>o?o/s:1;t.translate(l.x,l.y),t.rotate(h),t.scale(d,m),t.arc(0,0,p,c,c+f,Boolean(1-u)),t.scale(1/d,1/m),t.rotate(-h),t.translate(-l.x,-l.y)}}},{key:"pathZ",value:function(t,e){r.pathZ(this.pathParser),t&&e.x1!==e.x2&&e.y1!==e.y2&&t.closePath()}}],[{key:"pathM",value:function(t){var e=t.getAsCurrentPoint();return t.start=t.current,{point:e}}},{key:"pathL",value:function(t){return{current:t.current,point:t.getAsCurrentPoint()}}},{key:"pathH",value:function(t){var e=t.current,r=t.command,i=new Nt((r.relative?e.x:0)+r.x,e.y);return t.current=i,{current:e,point:i}}},{key:"pathV",value:function(t){var e=t.current,r=t.command,i=new Nt(e.x,(r.relative?e.y:0)+r.y);return t.current=i,{current:e,point:i}}},{key:"pathC",value:function(t){return{current:t.current,point:t.getPoint("x1","y1"),controlPoint:t.getAsControlPoint("x2","y2"),currentPoint:t.getAsCurrentPoint()}}},{key:"pathS",value:function(t){return{current:t.current,point:t.getReflectedControlPoint(),controlPoint:t.getAsControlPoint("x2","y2"),currentPoint:t.getAsCurrentPoint()}}},{key:"pathQ",value:function(t){return{current:t.current,controlPoint:t.getAsControlPoint("x1","y1"),currentPoint:t.getAsCurrentPoint()}}},{key:"pathT",value:function(t){var e=t.current,r=t.getReflectedControlPoint();return t.control=r,{current:e,controlPoint:r,currentPoint:t.getAsCurrentPoint()}}},{key:"pathA",value:function(t){var e=t.current,r=t.command,i=r.rX,n=r.rY,a=r.xRot,s=r.lArcFlag,o=r.sweepFlag,u=a*(Math.PI/180),h=t.getAsCurrentPoint(),l=new Nt(Math.cos(u)*(e.x-h.x)/2+Math.sin(u)*(e.y-h.y)/2,-Math.sin(u)*(e.x-h.x)/2+Math.cos(u)*(e.y-h.y)/2),c=Math.pow(l.x,2)/Math.pow(i,2)+Math.pow(l.y,2)/Math.pow(n,2);c>1&&(i*=Math.sqrt(c),n*=Math.sqrt(c));var f=(s===o?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(n,2)-Math.pow(i,2)*Math.pow(l.y,2)-Math.pow(n,2)*Math.pow(l.x,2))/(Math.pow(i,2)*Math.pow(l.y,2)+Math.pow(n,2)*Math.pow(l.x,2)));isNaN(f)&&(f=0);var g=new Nt(f*i*l.y/n,f*-n*l.x/i),y=new Nt((e.x+h.x)/2+Math.cos(u)*g.x-Math.sin(u)*g.y,(e.y+h.y)/2+Math.sin(u)*g.x+Math.cos(u)*g.y),v=bt([1,0],[(l.x-g.x)/i,(l.y-g.y)/n]),p=[(l.x-g.x)/i,(l.y-g.y)/n],d=[(-l.x-g.x)/i,(-l.y-g.y)/n],m=bt(p,d);return xt(p,d)<=-1&&(m=Math.PI),xt(p,d)>=1&&(m=0),{currentPoint:h,rX:i,rY:n,sweepFlag:o,xAxisRotation:u,centp:y,a1:v,ad:m}}},{key:"pathZ",value:function(t){t.current=t.start}}]),r}(te),se=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="svg",t.root=!1,t}return v(r,[{key:"setContext",value:function(t){var e,i=this.document,a=i.screen,s=i.window,o=t.canvas;if(a.setDefaults(t),"style"in o&&void 0!==t.font&&s&&void 0!==s.getComputedStyle){t.font=s.getComputedStyle(o).getPropertyValue("font");var u=new Ot(i,"fontSize",Kt.parse(t.font).fontSize);u.hasValue()&&(i.rootEmSize=u.getPixels("y"),i.emSize=i.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var h=a.viewPort,l=h.width,c=h.height;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 g=this.getAttribute("refX"),y=this.getAttribute("refY"),v=this.getAttribute("viewBox"),p=v.hasValue()?at(v.getString()):null,d=!this.root&&"visible"!==this.getStyle("overflow").getValue("hidden"),m=0,x=0,b=0,w=0;p&&(m=p[0],x=p[1]),this.root||(l=this.getStyle("width").getPixels("x"),c=this.getStyle("height").getPixels("y"),"marker"===this.type&&(b=m,w=x,m=0,x=0)),a.viewPort.setCurrent(l,c),!this.node||this.parent&&"foreignObject"!==(null===(e=this.node.parentNode)||void 0===e?void 0:e.nodeName)||!this.getStyle("transform",!1,!0).hasValue()||this.getStyle("transform-origin",!1,!0).hasValue()||this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),n(f(r.prototype),"setContext",this).call(this,t),t.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),p&&(l=p[2],c=p[3]),i.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:a.viewPort.width,desiredWidth:l,height:a.viewPort.height,desiredHeight:c,minX:m,minY:x,refX:g.getValue(),refY:y.getValue(),clip:d,clipX:b,clipY:w}),p&&(a.viewPort.removeCurrent(),a.viewPort.setCurrent(l,c))}},{key:"clearContext",value:function(t){n(f(r.prototype),"clearContext",this).call(this,t),this.document.screen.viewPort.removeCurrent()}},{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.getAttribute("width",!0),n=this.getAttribute("height",!0),a=this.getAttribute("viewBox"),s=this.getAttribute("style"),o=i.getNumber(0),u=n.getNumber(0);if(r)if("string"==typeof r)this.getAttribute("preserveAspectRatio",!0).setValue(r);else{var h=this.getAttribute("preserveAspectRatio");h.hasValue()&&h.setValue(h.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(i.setValue(t),n.setValue(e),a.hasValue()||a.setValue("0 0 ".concat(o||t," ").concat(u||e)),s.hasValue()){var l=this.getStyle("width"),c=this.getStyle("height");l.hasValue()&&l.setValue("".concat(t,"px")),c.hasValue()&&c.setValue("".concat(e,"px"))}}}]),r}(te),oe=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="rect",t}return v(r,[{key:"path",value:function(t){var e=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),i=this.getStyle("width",!1,!0).getPixels("x"),n=this.getStyle("height",!1,!0).getPixels("y"),a=this.getAttribute("rx"),s=this.getAttribute("ry"),o=a.getPixels("x"),u=s.getPixels("y");if(a.hasValue()&&!s.hasValue()&&(u=o),s.hasValue()&&!a.hasValue()&&(o=u),o=Math.min(o,i/2),u=Math.min(u,n/2),t){var h=(Math.sqrt(2)-1)/3*4;t.beginPath(),n>0&&i>0&&(t.moveTo(e+o,r),t.lineTo(e+i-o,r),t.bezierCurveTo(e+i-o+h*o,r,e+i,r+u-h*u,e+i,r+u),t.lineTo(e+i,r+n-u),t.bezierCurveTo(e+i,r+n-u+h*u,e+i-o+h*o,r+n,e+i-o,r+n),t.lineTo(e+o,r+n),t.bezierCurveTo(e+o-h*o,r+n,e,r+n-u+h*u,e,r+n-u),t.lineTo(e,r+u),t.bezierCurveTo(e,r+u-h*u,e+o-h*o,r,e+o,r),t.closePath())}return new Jt(e,r,e+i,r+n)}},{key:"getMarkers",value:function(){return null}}]),r}(ae),ue=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="circle",t}return v(r,[{key:"path",value:function(t){var e=this.getAttribute("cx").getPixels("x"),r=this.getAttribute("cy").getPixels("y"),i=this.getAttribute("r").getPixels();return t&&i>0&&(t.beginPath(),t.arc(e,r,i,0,2*Math.PI,!1),t.closePath()),new Jt(e-i,r-i,e+i,r+i)}},{key:"getMarkers",value:function(){return null}}]),r}(ae),he=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="ellipse",t}return v(r,[{key:"path",value:function(t){var e=(Math.sqrt(2)-1)/3*4,r=this.getAttribute("rx").getPixels("x"),i=this.getAttribute("ry").getPixels("y"),n=this.getAttribute("cx").getPixels("x"),a=this.getAttribute("cy").getPixels("y");return t&&r>0&&i>0&&(t.beginPath(),t.moveTo(n+r,a),t.bezierCurveTo(n+r,a+e*i,n+e*r,a+i,n,a+i),t.bezierCurveTo(n-e*r,a+i,n-r,a+e*i,n-r,a),t.bezierCurveTo(n-r,a-e*i,n-e*r,a-i,n,a-i),t.bezierCurveTo(n+e*r,a-i,n+r,a-e*i,n+r,a),t.closePath()),new Jt(n-r,a-i,n+r,a+i)}},{key:"getMarkers",value:function(){return null}}]),r}(ae),le=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="line",t}return v(r,[{key:"getPoints",value:function(){return[new Nt(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new Nt(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}},{key:"path",value:function(t){var e=p(this.getPoints(),2),r=e[0],i=r.x,n=r.y,a=e[1],s=a.x,o=a.y;return t&&(t.beginPath(),t.moveTo(i,n),t.lineTo(s,o)),new Jt(i,n,s,o)}},{key:"getMarkers",value:function(){var t=p(this.getPoints(),2),e=t[0],r=t[1],i=e.angleTo(r);return[[e,i],[r,i]]}}]),r}(ae),ce=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;return g(this,r),(a=e.call(this,t,i,n)).type="polyline",a.points=[],a.points=Nt.parsePath(a.getAttribute("points").getString()),a}return v(r,[{key:"path",value:function(t){var e=this.points,r=p(e,1)[0],i=r.x,n=r.y,a=new Jt(i,n);return t&&(t.beginPath(),t.moveTo(i,n)),e.forEach((function(e){var r=e.x,i=e.y;a.addPoint(r,i),t&&t.lineTo(r,i)})),a}},{key:"getMarkers",value:function(){var t=this.points,e=t.length-1,r=[];return t.forEach((function(i,n){n!==e&&r.push([i,i.angleTo(t[n+1])])})),r.length>0&&r.push([t[t.length-1],r[r.length-1][1]]),r}}]),r}(ae),fe=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="polygon",t}return v(r,[{key:"path",value:function(t){var e=n(f(r.prototype),"path",this).call(this,t),i=p(this.points,1)[0],a=i.x,s=i.y;return t&&(t.lineTo(a,s),t.closePath()),e}}]),r}(ce),ge=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="pattern",t}return v(r,[{key:"createPattern",value:function(t,e,r){var i=this.getStyle("width").getPixels("x",!0),n=this.getStyle("height").getPixels("y",!0),a=new se(this.document,null);a.attributes.viewBox=new Ot(this.document,"viewBox",this.getAttribute("viewBox").getValue()),a.attributes.width=new Ot(this.document,"width","".concat(i,"px")),a.attributes.height=new Ot(this.document,"height","".concat(n,"px")),a.attributes.transform=new Ot(this.document,"transform",this.getAttribute("patternTransform").getValue()),a.children=this.children;var s=this.document.createCanvas(i,n),o=s.getContext("2d"),u=this.getAttribute("x"),h=this.getAttribute("y");u.hasValue()&&h.hasValue()&&o.translate(u.getPixels("x",!0),h.getPixels("y",!0)),r.hasValue()?this.styles["fill-opacity"]=r:Reflect.deleteProperty(this.styles,"fill-opacity");for(var l=-1;l<=1;l++)for(var c=-1;c<=1;c++)o.save(),a.attributes.x=new Ot(this.document,"x",l*s.width),a.attributes.y=new Ot(this.document,"y",c*s.height),a.render(o),o.restore();return t.createPattern(s,"repeat")}}]),r}(jt),ye=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="marker",t}return v(r,[{key:"render",value:function(t,e,r){if(e){var i=e.x,n=e.y,a=this.getAttribute("orient").getString("auto"),s=this.getAttribute("markerUnits").getString("strokeWidth");t.translate(i,n),"auto"===a&&t.rotate(r),"strokeWidth"===s&&t.scale(t.lineWidth,t.lineWidth),t.save();var o=new se(this.document);o.type=this.type,o.attributes.viewBox=new Ot(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.refX=new Ot(this.document,"refX",this.getAttribute("refX").getValue()),o.attributes.refY=new Ot(this.document,"refY",this.getAttribute("refY").getValue()),o.attributes.width=new Ot(this.document,"width",this.getAttribute("markerWidth").getValue()),o.attributes.height=new Ot(this.document,"height",this.getAttribute("markerHeight").getValue()),o.attributes.overflow=new Ot(this.document,"overflow",this.getAttribute("overflow").getValue()),o.attributes.fill=new Ot(this.document,"fill",this.getAttribute("fill").getColor("black")),o.attributes.stroke=new Ot(this.document,"stroke",this.getAttribute("stroke").getValue("none")),o.children=this.children,o.render(t),t.restore(),"strokeWidth"===s&&t.scale(1/t.lineWidth,1/t.lineWidth),"auto"===a&&t.rotate(-r),t.translate(-i,-n)}}}]),r}(jt),ve=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="defs",t}return v(r,[{key:"render",value:function(){}}]),r}(jt),pe=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="g",t}return v(r,[{key:"getBoundingBox",value:function(t){var e=new Jt;return this.children.forEach((function(r){e.addBoundingBox(r.getBoundingBox(t))})),e}}]),r}(te),de=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;g(this,r),(a=e.call(this,t,i,n)).attributesToInherit=["gradientUnits"],a.stops=[];var s=c(a),o=s.stops;return s.children.forEach((function(t){"stop"===t.type&&o.push(t)})),a}return v(r,[{key:"getGradientUnits",value:function(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}},{key:"createGradient",value:function(t,e,r){var i=this,n=this;this.getHrefAttribute().hasValue()&&(n=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(n));var a=n.stops,s=this.getGradient(t,e);if(!s)return this.addParentOpacity(r,a[a.length-1].color);if(a.forEach((function(t){s.addColorStop(t.offset,i.addParentOpacity(r,t.color))})),this.getAttribute("gradientTransform").hasValue()){var o=this.document,u=It.MAX_VIRTUAL_PIXELS,h=o.screen.viewPort.getRoot(),l=new oe(o);l.attributes.x=new Ot(o,"x",-u/3),l.attributes.y=new Ot(o,"y",-u/3),l.attributes.width=new Ot(o,"width",u),l.attributes.height=new Ot(o,"height",u);var c=new pe(o);c.attributes.transform=new Ot(o,"transform",this.getAttribute("gradientTransform").getValue()),c.children=[l];var f=new se(o);f.attributes.x=new Ot(o,"x",0),f.attributes.y=new Ot(o,"y",0),f.attributes.width=new Ot(o,"width",h.width),f.attributes.height=new Ot(o,"height",h.height),f.children=[c];var g=o.createCanvas(h.width,h.height),y=g.getContext("2d");return y.fillStyle=s,f.render(y),y.createPattern(g,"no-repeat")}return s}},{key:"inheritStopContainer",value:function(t){var e=this;this.attributesToInherit.forEach((function(r){!e.getAttribute(r).hasValue()&&t.getAttribute(r).hasValue()&&e.getAttribute(r,!0).setValue(t.getAttribute(r).getValue())}))}},{key:"addParentOpacity",value:function(t,e){return t.hasValue()?new Ot(this.document,"color",e).addOpacity(t).getColor():e}}]),r}(jt),me=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;return g(this,r),(a=e.call(this,t,i,n)).type="linearGradient",a.attributesToInherit.push("x1","y1","x2","y2"),a}return v(r,[{key:"getGradient",value:function(t,e){var r="objectBoundingBox"===this.getGradientUnits(),i=r?e.getBoundingBox(t):null;if(r&&!i)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 n=r?i.x+i.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),a=r?i.y+i.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),s=r?i.x+i.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),o=r?i.y+i.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return n===s&&a===o?null:t.createLinearGradient(n,a,s,o)}}]),r}(de),xe=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;return g(this,r),(a=e.call(this,t,i,n)).type="radialGradient",a.attributesToInherit.push("cx","cy","r","fx","fy","fr"),a}return v(r,[{key:"getGradient",value:function(t,e){var r="objectBoundingBox"===this.getGradientUnits(),i=e.getBoundingBox(t);if(r&&!i)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 n=r?i.x+i.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),a=r?i.y+i.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),s=n,o=a;this.getAttribute("fx").hasValue()&&(s=r?i.x+i.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(o=r?i.y+i.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var u=r?(i.width+i.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),h=this.getAttribute("fr").getPixels();return t.createRadialGradient(s,o,h,n,a,u)}}]),r}(de),be=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;g(this,r),(a=e.call(this,t,i,n)).type="stop";var s=Math.max(0,Math.min(1,a.getAttribute("offset").getNumber())),o=a.getStyle("stop-opacity"),u=a.getStyle("stop-color",!0);return""===u.getString()&&u.setValue("#000"),o.hasValue()&&(u=u.addOpacity(o)),a.offset=s,a.color=u.getColor(),a}return v(r)}(jt),we=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;g(this,r),(a=e.call(this,t,i,n)).type="animate",a.duration=0,a.initialUnits="",a.removed=!1,a.frozen=!1,t.screen.animations.push(c(a)),a.begin=a.getAttribute("begin").getMilliseconds(),a.maxDuration=a.begin+a.getAttribute("dur").getMilliseconds(),a.from=a.getAttribute("from"),a.to=a.getAttribute("to"),a.values=new Ot(t,"values",null);var s=a.getAttribute("values");return s.hasValue()&&a.values.setValue(s.getString().split(";")),a}return v(r,[{key:"getProperty",value:function(){var t=this.getAttribute("attributeType").getString(),e=this.getAttribute("attributeName").getString();return"CSS"===t?this.parent.getStyle(e,!0):this.parent.getAttribute(e,!0)}},{key:"calcValue",value:function(){var t=this.initialUnits,e=this.getProgress(),r=e.progress,i=e.from,n=e.to,a=i.getNumber()+(n.getNumber()-i.getNumber())*r;return"%"===t&&(a*=100),"".concat(a).concat(t)}},{key:"update",value:function(t){var e=this.parent,r=this.getProperty();if(this.initialValue||(this.initialValue=r.getString(),this.initialUnits=r.getUnits()),this.duration>this.maxDuration){var i=this.getAttribute("fill").getString("remove");if("indefinite"===this.getAttribute("repeatCount").getString()||"indefinite"===this.getAttribute("repeatDur").getString())this.duration=0;else if("freeze"!==i||this.frozen){if("remove"===i&&!this.removed)return this.removed=!0,e&&r&&r.setValue(e.animationFrozen?e.animationFrozenValue:this.initialValue),!0}else this.frozen=!0,e&&r&&(e.animationFrozen=!0,e.animationFrozenValue=r.getString());return!1}this.duration+=t;var n=!1;if(this.begin<this.duration){var a=this.calcValue(),s=this.getAttribute("type");if(s.hasValue()){var o=s.getString();a="".concat(o,"(").concat(a,")")}r.setValue(a),n=!0}return n}},{key:"getProgress",value:function(){var t,e,r=this.document,i=this.values,n=(this.duration-this.begin)/(this.maxDuration-this.begin);if(i.hasValue()){var a,s=n*(i.getValue().length-1),o=Math.floor(s),u=Math.ceil(s);a=i.getValue()[o],t=new Ot(r,"from",a?parseFloat(a):0),a=i.getValue()[u],e=new Ot(r,"to",a?parseFloat(a):0),n=(s-o)/(u-o)}else t=this.from,e=this.to;return{progress:n,from:t,to:e}}}]),r}(jt),ke=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="animateColor",t}return v(r,[{key:"calcValue",value:function(){var t=this.getProgress(),e=t.progress,r=t.from,i=t.to,n=new N(r.getColor()),a=new N(i.getColor());if(n.ok&&a.ok){var s=n.r+(a.r-n.r)*e,o=n.g+(a.g-n.g)*e,u=n.b+(a.b-n.b)*e;return"rgb(".concat(Math.floor(s),", ").concat(Math.floor(o),", ").concat(Math.floor(u),")")}return this.getAttribute("from").getColor()}}]),r}(we),Se=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="animateTransform",t}return v(r,[{key:"calcValue",value:function(){var t=this.getProgress(),e=t.progress,r=t.from,i=t.to,n=at(r.getString()),a=at(i.getString()),s=n.map((function(t,r){return t+(a[r]-t)*e})).join(" ");return s}}]),r}(we),Te=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;return g(this,r),(a=e.call(this,t,i,n)).type="font-face",a.ascent=a.getAttribute("ascent").getNumber(),a.descent=a.getAttribute("descent").getNumber(),a.unitsPerEm=a.getAttribute("units-per-em").getNumber(),a}return v(r)}(jt),Ae=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;return g(this,r),(a=e.call(this,t,i,n)).type="glyph",a.horizAdvX=a.getAttribute("horiz-adv-x").getNumber(),a.unicode=a.getAttribute("unicode").getString(),a.arabicForm=a.getAttribute("arabic-form").getString(),a}return v(r)}(ae),Ce=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="missing-glyph",t.horizAdvX=0,t}return v(r)}(Ae),Pe=function(t){o(n,t);var e=h(n);function n(t,a,s){var o;g(this,n),(o=e.call(this,t,a,s)).type="font",o.isArabic=!1,o.glyphs={},o.arabicGlyphs={},o.isRTL=!1,o.horizAdvX=o.getAttribute("horiz-adv-x").getNumber();var u,h=t.definitions,l=i(c(o).children);try{for(l.s();!(u=l.n()).done;){var f=u.value;if(f instanceof Te){o.fontFace=f;var y=f.getStyle("font-family");y.hasValue()&&(h[y.getString()]=c(o))}else if(f instanceof Ce)o.missingGlyph=f;else if(f instanceof Ae)if(f.arabicForm){o.isRTL=!0,o.isArabic=!0;var v=o.arabicGlyphs[f.unicode];void 0===v?o.arabicGlyphs[f.unicode]=r({},f.arabicForm,f):v[f.arabicForm]=f}else o.glyphs[f.unicode]=f}}catch(p){l.e(p)}finally{l.f()}return o}return v(n,[{key:"render",value:function(){}}]),n}(jt),Oe=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="tref",t}return v(r,[{key:"getText",value:function(){var t=this.getHrefAttribute().getDefinition();if(t){var e=t.children[0];if(e)return e.getText()}return""}}]),r}(ee),Ee=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;g(this,r),(a=e.call(this,t,i,n)).type="a";var s=i.childNodes,o=s[0],u=s.length>0&&Array.from(s).every((function(t){return 3===t.nodeType}));return a.hasText=u,a.text=u?a.getTextFromNode(o):"",a}return v(r,[{key:"getText",value:function(){return this.text}},{key:"renderChildren",value:function(t){if(this.hasText){n(f(r.prototype),"renderChildren",this).call(this,t);var e=this.document,i=this.x,a=this.y,s=e.screen.mouse,o=new Ot(e,"fontSize",Kt.parse(e.ctx.font).fontSize);s.isWorking()&&s.checkBoundingBox(this,new Jt(i,a-o.getPixels("y"),i+this.measureText(t),a))}else if(this.children.length>0){var u=new pe(this.document);u.children=this.children,u.parent=this,u.render(t)}}},{key:"onClick",value:function(){var t=this.document.window;t&&t.open(this.getHrefAttribute().getString())}},{key:"onMouseMove",value:function(){this.document.ctx.canvas.style.cursor="pointer"}}]),r}(ee),Me=function(t){o(n,t);var r=h(n);function n(t,e,i){var a;g(this,n),(a=r.call(this,t,e,i)).type="textPath",a.textWidth=0,a.textHeight=0,a.pathLength=-1,a.glyphInfo=null,a.letterSpacingCache=[],a.measuresCache=new Map([["",0]]);var s=a.getHrefAttribute().getDefinition();return a.text=a.getTextFromNode(),a.dataArray=a.parsePathData(s),a}return v(n,[{key:"getText",value:function(){return this.text}},{key:"path",value:function(t){var e=this.dataArray;t&&t.beginPath(),e.forEach((function(e){var r=e.type,i=e.points;switch(r){case ne.LINE_TO:t&&t.lineTo(i[0],i[1]);break;case ne.MOVE_TO:t&&t.moveTo(i[0],i[1]);break;case ne.CURVE_TO:t&&t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]);break;case ne.QUAD_TO:t&&t.quadraticCurveTo(i[0],i[1],i[2],i[3]);break;case ne.ARC:var n=p(i,8),a=n[0],s=n[1],o=n[2],u=n[3],h=n[4],l=n[5],c=n[6],f=n[7],g=o>u?o:u,y=o>u?1:o/u,v=o>u?u/o:1;t&&(t.translate(a,s),t.rotate(c),t.scale(y,v),t.arc(0,0,g,h,h+l,Boolean(1-f)),t.scale(1/y,1/v),t.rotate(-c),t.translate(-a,-s));break;case ne.CLOSE_PATH:t&&t.closePath()}}))}},{key:"renderChildren",value:function(t){this.setTextData(t),t.save();var e=this.parent.getStyle("text-decoration").getString(),r=this.getFontSize(),i=this.glyphInfo,n=t.fillStyle;"underline"===e&&t.beginPath(),i.forEach((function(i,n){var a=i.p0,s=i.p1,o=i.rotation,u=i.text;t.save(),t.translate(a.x,a.y),t.rotate(o),t.fillStyle&&t.fillText(u,0,0),t.strokeStyle&&t.strokeText(u,0,0),t.restore(),"underline"===e&&(0===n&&t.moveTo(a.x,a.y+r/8),t.lineTo(s.x,s.y+r/5))})),"underline"===e&&(t.lineWidth=r/20,t.strokeStyle=n,t.stroke(),t.closePath()),t.restore()}},{key:"getLetterSpacingAt",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.letterSpacingCache[t]||0}},{key:"findSegmentToFitChar",value:function(t,r,i,n,a,s,o,u,h){var l=s,c=this.measureText(t,u);" "===u&&"justify"===r&&i<n&&(c+=(n-i)/a),h>-1&&(l+=this.getLetterSpacingAt(h));var f=this.textHeight/20,g=this.getEquidistantPointOnPath(l,f,0),y=this.getEquidistantPointOnPath(l+c,f,0),v={p0:g,p1:y},p=g&&y?Math.atan2(y.y-g.y,y.x-g.x):0;if(o){var d=Math.cos(Math.PI/2+p)*o,m=Math.cos(-p)*o;v.p0=e(e({},g),{},{x:g.x+d,y:g.y+m}),v.p1=e(e({},y),{},{x:y.x+d,y:y.y+m})}return{offset:l+=c,segment:v,rotation:p}}},{key:"measureText",value:function(t,e){var r=this.measuresCache,i=e||this.getText();if(r.has(i))return r.get(i);var n=this.measureTargetText(t,i);return r.set(i,n),n}},{key:"setTextData",value:function(t){var e=this;if(!this.glyphInfo){var r=this.getText(),i=r.split(""),n=r.split(" ").length-1,a=this.parent.getAttribute("dx").split().map((function(t){return t.getPixels("x")})),s=this.parent.getAttribute("dy").getPixels("y"),o=this.parent.getStyle("text-anchor").getString("start"),u=this.getStyle("letter-spacing"),h=this.parent.getStyle("letter-spacing"),l=0;u.hasValue()&&"inherit"!==u.getValue()?u.hasValue()&&"initial"!==u.getValue()&&"unset"!==u.getValue()&&(l=u.getPixels()):l=h.getPixels();var c=[],f=r.length;this.letterSpacingCache=c;for(var g=0;g<f;g++)c.push(void 0!==a[g]?a[g]:l);var y=c.reduce((function(t,e,r){return 0===r?0:t+e||0}),0),v=this.measureText(t),p=Math.max(v+y,0);this.textWidth=v,this.textHeight=this.getFontSize(),this.glyphInfo=[];var d=this.getPathLength(),m=this.getStyle("startOffset").getNumber(0)*d,x=0;"middle"!==o&&"center"!==o||(x=-p/2),"end"!==o&&"right"!==o||(x=-p),x+=m,i.forEach((function(r,a){var u=e.findSegmentToFitChar(t,o,p,d,n,x,s,r,a),h=u.offset,l=u.segment,c=u.rotation;x=h,l.p0&&l.p1&&e.glyphInfo.push({text:i[a],p0:l.p0,p1:l.p1,rotation:c})}))}}},{key:"parsePathData",value:function(t){if(this.pathLength=-1,!t)return[];var e=[],r=t.pathParser;for(r.reset();!r.isEnd();){var i=r.current,n=i?i.x:0,a=i?i.y:0,s=r.next(),o=s.type,u=[];switch(s.type){case ne.MOVE_TO:this.pathM(r,u);break;case ne.LINE_TO:o=this.pathL(r,u);break;case ne.HORIZ_LINE_TO:o=this.pathH(r,u);break;case ne.VERT_LINE_TO:o=this.pathV(r,u);break;case ne.CURVE_TO:this.pathC(r,u);break;case ne.SMOOTH_CURVE_TO:o=this.pathS(r,u);break;case ne.QUAD_TO:this.pathQ(r,u);break;case ne.SMOOTH_QUAD_TO:o=this.pathT(r,u);break;case ne.ARC:u=this.pathA(r);break;case ne.CLOSE_PATH:ae.pathZ(r)}s.type!==ne.CLOSE_PATH?e.push({type:o,points:u,start:{x:n,y:a},pathLength:this.calcLength(n,a,o,u)}):e.push({type:ne.CLOSE_PATH,points:[],pathLength:0})}return e}},{key:"pathM",value:function(t,e){var r=ae.pathM(t).point,i=r.x,n=r.y;e.push(i,n)}},{key:"pathL",value:function(t,e){var r=ae.pathL(t).point,i=r.x,n=r.y;return e.push(i,n),ne.LINE_TO}},{key:"pathH",value:function(t,e){var r=ae.pathH(t).point,i=r.x,n=r.y;return e.push(i,n),ne.LINE_TO}},{key:"pathV",value:function(t,e){var r=ae.pathV(t).point,i=r.x,n=r.y;return e.push(i,n),ne.LINE_TO}},{key:"pathC",value:function(t,e){var r=ae.pathC(t),i=r.point,n=r.controlPoint,a=r.currentPoint;e.push(i.x,i.y,n.x,n.y,a.x,a.y)}},{key:"pathS",value:function(t,e){var r=ae.pathS(t),i=r.point,n=r.controlPoint,a=r.currentPoint;return e.push(i.x,i.y,n.x,n.y,a.x,a.y),ne.CURVE_TO}},{key:"pathQ",value:function(t,e){var r=ae.pathQ(t),i=r.controlPoint,n=r.currentPoint;e.push(i.x,i.y,n.x,n.y)}},{key:"pathT",value:function(t,e){var r=ae.pathT(t),i=r.controlPoint,n=r.currentPoint;return e.push(i.x,i.y,n.x,n.y),ne.QUAD_TO}},{key:"pathA",value:function(t){var e=ae.pathA(t),r=e.rX,i=e.rY,n=e.sweepFlag,a=e.xAxisRotation,s=e.centp,o=e.a1,u=e.ad;return 0===n&&u>0&&(u-=2*Math.PI),1===n&&u<0&&(u+=2*Math.PI),[s.x,s.y,r,i,o,u,a,n]}},{key:"calcLength",value:function(t,e,r,i){var n=0,a=null,s=null,o=0;switch(r){case ne.LINE_TO:return this.getLineLength(t,e,i[0],i[1]);case ne.CURVE_TO:for(n=0,a=this.getPointOnCubicBezier(0,t,e,i[0],i[1],i[2],i[3],i[4],i[5]),o=.01;o<=1;o+=.01)s=this.getPointOnCubicBezier(o,t,e,i[0],i[1],i[2],i[3],i[4],i[5]),n+=this.getLineLength(a.x,a.y,s.x,s.y),a=s;return n;case ne.QUAD_TO:for(n=0,a=this.getPointOnQuadraticBezier(0,t,e,i[0],i[1],i[2],i[3]),o=.01;o<=1;o+=.01)s=this.getPointOnQuadraticBezier(o,t,e,i[0],i[1],i[2],i[3]),n+=this.getLineLength(a.x,a.y,s.x,s.y),a=s;return n;case ne.ARC:n=0;var u=i[4],h=i[5],l=i[4]+h,c=Math.PI/180;if(Math.abs(u-l)<c&&(c=Math.abs(u-l)),a=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),h<0)for(o=u-c;o>l;o-=c)s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],o,0),n+=this.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(o=u+c;o<l;o+=c)s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],o,0),n+=this.getLineLength(a.x,a.y,s.x,s.y),a=s;return s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),n+=this.getLineLength(a.x,a.y,s.x,s.y)}return 0}},{key:"getPointOnLine",value:function(t,e,r,i,n){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:r,o=(n-r)/(i-e+dt),u=Math.sqrt(t*t/(1+o*o));i<e&&(u*=-1);var h=o*u,l=null;if(i===e)l={x:a,y:s+h};else if((s-r)/(a-e+dt)===o)l={x:a+u,y:s+h};else{var c=0,f=0,g=this.getLineLength(e,r,i,n);if(g<dt)return null;var y=(a-e)*(i-e)+(s-r)*(n-r);c=e+(y/=g*g)*(i-e),f=r+y*(n-r);var v=this.getLineLength(a,s,c,f),p=Math.sqrt(t*t-v*v);u=Math.sqrt(p*p/(1+o*o)),i<e&&(u*=-1),l={x:c+u,y:f+(h=o*u)}}return l}},{key:"getPointOnPath",value:function(t){var e=this.getPathLength(),r=0,n=null;if(t<-5e-5||t-5e-5>e)return null;var a,s=i(this.dataArray);try{for(s.s();!(a=s.n()).done;){var o=a.value;if(!o||!(o.pathLength<5e-5||r+o.pathLength+5e-5<t)){var u=t-r,h=0;switch(o.type){case ne.LINE_TO:n=this.getPointOnLine(u,o.start.x,o.start.y,o.points[0],o.points[1],o.start.x,o.start.y);break;case ne.ARC:var l=o.points[4],c=o.points[5],f=o.points[4]+c;if(h=l+u/o.pathLength*c,c<0&&h<f||c>=0&&h>f)break;n=this.getPointOnEllipticalArc(o.points[0],o.points[1],o.points[2],o.points[3],h,o.points[6]);break;case ne.CURVE_TO:(h=u/o.pathLength)>1&&(h=1),n=this.getPointOnCubicBezier(h,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3],o.points[4],o.points[5]);break;case ne.QUAD_TO:(h=u/o.pathLength)>1&&(h=1),n=this.getPointOnQuadraticBezier(h,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3])}if(n)return n;break}r+=o.pathLength}}catch(g){s.e(g)}finally{s.f()}return null}},{key:"getLineLength",value:function(t,e,r,i){return Math.sqrt((r-t)*(r-t)+(i-e)*(i-e))}},{key:"getPathLength",value:function(){return-1===this.pathLength&&(this.pathLength=this.dataArray.reduce((function(t,e){return e.pathLength>0?t+e.pathLength:t}),0)),this.pathLength}},{key:"getPointOnCubicBezier",value:function(t,e,r,i,n,a,s,o,u){return{x:o*wt(t)+a*kt(t)+i*St(t)+e*Tt(t),y:u*wt(t)+s*kt(t)+n*St(t)+r*Tt(t)}}},{key:"getPointOnQuadraticBezier",value:function(t,e,r,i,n,a,s){return{x:a*At(t)+i*Ct(t)+e*Pt(t),y:s*At(t)+n*Ct(t)+r*Pt(t)}}},{key:"getPointOnEllipticalArc",value:function(t,e,r,i,n,a){var s=Math.cos(a),o=Math.sin(a),u=r*Math.cos(n),h=i*Math.sin(n);return{x:t+(u*s-h*o),y:e+(u*o+h*s)}}},{key:"buildEquidistantCache",value:function(t,e){var r=this.getPathLength(),i=e||.25,n=t||r/100;if(!this.equidistantCache||this.equidistantCache.step!==n||this.equidistantCache.precision!==i){this.equidistantCache={step:n,precision:i,points:[]};for(var a=0,s=0;s<=r;s+=i){var o=this.getPointOnPath(s),u=this.getPointOnPath(s+i);o&&u&&((a+=this.getLineLength(o.x,o.y,u.x,u.y))>=n&&(this.equidistantCache.points.push({x:o.x,y:o.y,distance:s}),a-=n))}}}},{key:"getEquidistantPointOnPath",value:function(t,e,r){if(this.buildEquidistantCache(e,r),t<0||t-this.getPathLength()>5e-5)return null;var i=Math.round(t/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[i]||null}}]),n}(ee),Ne=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i,Ve=function(t){o(n,t);var e,r,i=h(n);function n(t,e,r){var a;g(this,n),(a=i.call(this,t,e,r)).type="image",a.loaded=!1;var s=a.getHrefAttribute().getString();if(!s)return l(a);var o=s.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(s);return t.images.push(c(a)),o?a.loadSvg(s):a.loadImage(s),a}return v(n,[{key:"loadImage",value:(r=b(regeneratorRuntime.mark((function t(e){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.document.createImage(e);case 3:r=t.sent,this.image=r,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.error('Error while loading image "'.concat(e,'":'),t.t0);case 10:this.loaded=!0;case 11:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(t){return r.apply(this,arguments)})},{key:"loadSvg",value:(e=b(regeneratorRuntime.mark((function t(e){var r,i,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=Ne.exec(e))){t.next=6;break}(i=r[5])&&("base64"===r[4]?this.image=atob(i):this.image=decodeURIComponent(i)),t.next=19;break;case 6:return t.prev=6,t.next=9,this.document.fetch(e);case 9:return n=t.sent,t.next=12,n.text();case 12:a=t.sent,this.image=a,t.next=19;break;case 16:t.prev=16,t.t0=t.catch(6),console.error('Error while loading image "'.concat(e,'":'),t.t0);case 19:this.loaded=!0;case 20:case"end":return t.stop()}}),t,this,[[6,16]])}))),function(t){return e.apply(this,arguments)})},{key:"renderChildren",value:function(t){var e=this.document,r=this.image,i=this.loaded,n=this.getAttribute("x").getPixels("x"),a=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y");if(i&&r&&s&&o){if(t.save(),t.translate(n,a),"string"==typeof r){var u=e.canvg.forkString(t,r,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:o}),h=u.document.documentElement;h&&(h.parent=this),u.render()}else e.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:r.width,height:o,desiredHeight:r.height}),this.loaded&&("complete"in r&&!r.complete||t.drawImage(r,0,0));t.restore()}}},{key:"getBoundingBox",value:function(){var t=this.getAttribute("x").getPixels("x"),e=this.getAttribute("y").getPixels("y"),r=this.getStyle("width").getPixels("x"),i=this.getStyle("height").getPixels("y");return new Jt(t,e,t+r,e+i)}}]),n}(te),_e=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="symbol",t}return v(r,[{key:"render",value:function(t){}}]),r}(te),Re=function(){function t(e){g(this,t),this.document=e,this.loaded=!1,e.fonts.push(this)}var e;return v(t,[{key:"load",value:(e=b(regeneratorRuntime.mark((function t(e,r){var i,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,i=this.document,t.next=4,i.canvg.parser.load(r);case 4:n=t.sent,a=n.getElementsByTagName("font"),Array.from(a).forEach((function(t){var r=i.createElement(t);i.definitions[e]=r})),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),console.error('Error while loading font "'.concat(r,'":'),t.t0);case 12:this.loaded=!0;case 13:case"end":return t.stop()}}),t,this,[[0,9]])}))),function(t,r){return e.apply(this,arguments)})}]),t}(),Ie=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;g(this,r),(a=e.call(this,t,i,n)).type="style";var s=nt(Array.from(i.childNodes).map((function(t){return t.textContent})).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,""));return s.split("}").forEach((function(e){var r=e.trim();if(r){var i=r.split("{"),n=i[0].split(","),a=i[1].split(";");n.forEach((function(e){var r=e.trim();if(r){var i=t.styles[r]||{};if(a.forEach((function(e){var r=e.indexOf(":"),n=e.substr(0,r).trim(),a=e.substr(r+1,e.length-r).trim();n&&a&&(i[n]=new Ot(t,n,a))})),t.styles[r]=i,t.stylesSpecificity[r]=function(t){var e=[0,0,0],r=t.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),i=0,n=p(pt(r,ht),2);r=n[0],i=n[1],e[1]+=i;var a=p(pt(r,lt),2);r=a[0],i=a[1],e[0]+=i;var s=p(pt(r,ct),2);r=s[0],i=s[1],e[1]+=i;var o=p(pt(r,ft),2);r=o[0],i=o[1],e[2]+=i;var u=p(pt(r,gt),2);r=u[0],i=u[1],e[1]+=i;var h=p(pt(r,yt),2);r=h[0],i=h[1],e[1]+=i;var l=p(pt(r=r.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),vt),2);return r=l[0],i=l[1],e[2]+=i,e.join("")}(r),"@font-face"===r){var n=i["font-family"].getString().replace(/"|'/g,"");i.src.getString().split(",").forEach((function(e){if(e.indexOf('format("svg")')>0){var r=ut(e);r&&new Re(t).load(n,r)}}))}}}))}})),a}return v(r)}(jt);Ie.parseExternalUrl=ut;var Le=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="use",t}return v(r,[{key:"setContext",value:function(t){n(f(r.prototype),"setContext",this).call(this,t);var e=this.getAttribute("x"),i=this.getAttribute("y");e.hasValue()&&t.translate(e.getPixels("x"),0),i.hasValue()&&t.translate(0,i.getPixels("y"))}},{key:"path",value:function(t){var e=this.element;e&&e.path(t)}},{key:"renderChildren",value:function(t){var e=this.document,r=this.element;if(r){var i=r;if("symbol"===r.type&&((i=new se(e)).attributes.viewBox=new Ot(e,"viewBox",r.getAttribute("viewBox").getString()),i.attributes.preserveAspectRatio=new Ot(e,"preserveAspectRatio",r.getAttribute("preserveAspectRatio").getString()),i.attributes.overflow=new Ot(e,"overflow",r.getAttribute("overflow").getString()),i.children=r.children,r.styles.opacity=new Ot(e,"opacity",this.calculateOpacity())),"svg"===i.type){var n=this.getStyle("width",!1,!0),a=this.getStyle("height",!1,!0);n.hasValue()&&(i.attributes.width=new Ot(e,"width",n.getString())),a.hasValue()&&(i.attributes.height=new Ot(e,"height",a.getString()))}var s=i.parent;i.parent=this,i.render(t),i.parent=s}}},{key:"getBoundingBox",value:function(t){var e=this.element;return e?e.getBoundingBox(t):null}},{key:"elementTransform",value:function(){var t=this.document,e=this.element;return e?qt.fromElement(t,e):null}},{key:"element",get:function(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}]),r}(te);function De(t,e,r,i,n,a){return t[r*i*4+4*e+a]}function Be(t,e,r,i,n,a,s){t[r*i*4+4*e+a]=s}function He(t,e,r){return t[e]*r}function ze(t,e,r,i){return e+Math.cos(t)*r+Math.sin(t)*i}var Fe=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;g(this,r),(a=e.call(this,t,i,n)).type="feColorMatrix";var s=at(a.getAttribute("values").getString());switch(a.getAttribute("type").getString("matrix")){case"saturate":var o=s[0];s=[.213+.787*o,.715-.715*o,.072-.072*o,0,0,.213-.213*o,.715+.285*o,.072-.072*o,0,0,.213-.213*o,.715-.715*o,.072+.928*o,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var u=s[0]*Math.PI/180;s=[ze(u,.213,.787,-.213),ze(u,.715,-.715,-.715),ze(u,.072,-.072,.928),0,0,ze(u,.213,-.213,.143),ze(u,.715,.285,.14),ze(u,.072,-.072,-.283),0,0,ze(u,.213,-.213,-.787),ze(u,.715,-.715,.715),ze(u,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":s=[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]}return a.matrix=s,a.includeOpacity=a.getAttribute("includeOpacity").hasValue(),a}return v(r,[{key:"apply",value:function(t,e,r,i,n){for(var a=this.includeOpacity,s=this.matrix,o=t.getImageData(0,0,i,n),u=0;u<n;u++)for(var h=0;h<i;h++){var l=De(o.data,h,u,i,0,0),c=De(o.data,h,u,i,0,1),f=De(o.data,h,u,i,0,2),g=De(o.data,h,u,i,0,3),y=He(s,0,l)+He(s,1,c)+He(s,2,f)+He(s,3,g)+He(s,4,1),v=He(s,5,l)+He(s,6,c)+He(s,7,f)+He(s,8,g)+He(s,9,1),p=He(s,10,l)+He(s,11,c)+He(s,12,f)+He(s,13,g)+He(s,14,1),d=He(s,15,l)+He(s,16,c)+He(s,17,f)+He(s,18,g)+He(s,19,1);a&&(y=0,v=0,p=0,d*=g/255),Be(o.data,h,u,i,0,0,y),Be(o.data,h,u,i,0,1,v),Be(o.data,h,u,i,0,2,p),Be(o.data,h,u,i,0,3,d)}t.clearRect(0,0,i,n),t.putImageData(o,0,0)}}]),r}(jt),Ue=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="mask",t}return v(r,[{key:"apply",value:function(t,e){var i=this.document,n=this.getAttribute("x").getPixels("x"),a=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y");if(!s&&!o){var u=new Jt;this.children.forEach((function(e){u.addBoundingBox(e.getBoundingBox(t))})),n=Math.floor(u.x1),a=Math.floor(u.y1),s=Math.floor(u.width),o=Math.floor(u.height)}var h=this.removeStyles(e,r.ignoreStyles),l=i.createCanvas(n+s,a+o),c=l.getContext("2d");i.screen.setDefaults(c),this.renderChildren(c),new Fe(i,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(c,0,0,n+s,a+o);var f=i.createCanvas(n+s,a+o),g=f.getContext("2d");i.screen.setDefaults(g),e.render(g),g.globalCompositeOperation="destination-in",g.fillStyle=c.createPattern(l,"no-repeat"),g.fillRect(0,0,n+s,a+o),t.fillStyle=g.createPattern(f,"no-repeat"),t.fillRect(0,0,n+s,a+o),this.restoreStyles(e,h)}},{key:"render",value:function(t){}}]),r}(jt);Ue.ignoreStyles=["mask","transform","clip-path"];var Xe=function(){},Ye=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="clipPath",t}return v(r,[{key:"apply",value:function(t){var e=this.document,r=Reflect.getPrototypeOf(t),i=t.beginPath,n=t.closePath;r&&(r.beginPath=Xe,r.closePath=Xe),Reflect.apply(i,t,[]),this.children.forEach((function(i){if("path"in i){var a="elementTransform"in i?i.elementTransform():null;a||(a=qt.fromElement(e,i)),a&&a.apply(t),i.path(t),r&&(r.closePath=n),a&&a.unapply(t)}})),Reflect.apply(n,t,[]),t.clip(),r&&(r.beginPath=i,r.closePath=n)}},{key:"render",value:function(t){}}]),r}(jt),We=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="filter",t}return v(r,[{key:"apply",value:function(t,e){var i=this.document,n=this.children,a="getBoundingBox"in e?e.getBoundingBox(t):null;if(a){var s=0,o=0;n.forEach((function(t){var e=t.extraFilterDistance||0;s=Math.max(s,e),o=Math.max(o,e)}));var u=Math.floor(a.width),h=Math.floor(a.height),l=u+2*s,c=h+2*o;if(!(l<1||c<1)){var f=Math.floor(a.x),g=Math.floor(a.y),y=this.removeStyles(e,r.ignoreStyles),v=i.createCanvas(l,c),p=v.getContext("2d");i.screen.setDefaults(p),p.translate(-f+s,-g+o),e.render(p),n.forEach((function(t){"function"==typeof t.apply&&t.apply(p,0,0,l,c)})),t.drawImage(v,0,0,l,c,f-s,g-o,l,c),this.restoreStyles(e,y)}}}},{key:"render",value:function(t){}}]),r}(jt);We.ignoreStyles=["filter","transform","clip-path"];var qe=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;return g(this,r),(a=e.call(this,t,i,n)).type="feDropShadow",a.addStylesFromStyleDefinition(),a}return v(r,[{key:"apply",value:function(t,e,r,i,n){}}]),r}(jt),je=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="feMorphology",t}return v(r,[{key:"apply",value:function(t,e,r,i,n){}}]),r}(jt),Qe=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="feComposite",t}return v(r,[{key:"apply",value:function(t,e,r,i,n){}}]),r}(jt),Ge=function(t){o(r,t);var e=h(r);function r(t,i,n){var a;return g(this,r),(a=e.call(this,t,i,n)).type="feGaussianBlur",a.blurRadius=Math.floor(a.getAttribute("stdDeviation").getNumber()),a.extraFilterDistance=a.blurRadius,a}return v(r,[{key:"apply",value:function(t,e,r,i,n){var a=this.document,s=this.blurRadius,o=a.window?a.window.document.body:null,u=t.canvas;u.id=a.getUniqueId(),o&&(u.style.display="none",o.appendChild(u)),et(u,e,r,i,n,s),o&&o.removeChild(u)}}]),r}(jt),$e=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="title",t}return v(r)}(jt),Ze=function(t){o(r,t);var e=h(r);function r(){var t;g(this,r);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))).type="desc",t}return v(r)}(jt),Ke={svg:se,rect:oe,circle:ue,ellipse:he,line:le,polyline:ce,polygon:fe,path:ae,pattern:ge,marker:ye,defs:ve,linearGradient:me,radialGradient:xe,stop:be,animate:we,animateColor:ke,animateTransform:Se,font:Pe,"font-face":Te,"missing-glyph":Ce,glyph:Ae,text:ee,tspan:re,tref:Oe,a:Ee,textPath:Me,image:Ve,g:pe,symbol:_e,style:Ie,use:Le,mask:Ue,clipPath:Ye,filter:We,feDropShadow:qe,feMorphology:je,feComposite:Qe,feColorMatrix:Fe,feGaussianBlur:Ge,title:$e,desc:Ze};function Je(){return Je=b(regeneratorRuntime.mark((function t(e){var r,i,n=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.length>1&&void 0!==n[1]&&n[1],i=document.createElement("img"),r&&(i.crossOrigin="Anonymous"),t.abrupt("return",new Promise((function(t,r){i.onload=function(){t(i)},i.onerror=function(t,e,i,n,a){r(a)},i.src=e})));case 4:case"end":return t.stop()}}),t)}))),Je.apply(this,arguments)}var tr=function(){function t(e){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.rootEmSize,a=void 0===n?12:n,s=i.emSize,o=void 0===s?12:s,u=i.createCanvas,h=void 0===u?t.createCanvas:u,l=i.createImage,c=void 0===l?t.createImage:l,f=i.anonymousCrossOrigin;g(this,t),this.canvg=e,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=e.screen,this.rootEmSize=a,this.emSize=o,this.createCanvas=h,this.createImage=this.bindCreateImage(c,f),this.screen.wait((function(){return r.isImagesLoaded()})),this.screen.wait((function(){return r.isFontsLoaded()}))}return v(t,[{key:"bindCreateImage",value:function(t,e){return"boolean"==typeof e?function(r,i){return t(r,"boolean"==typeof i?i:e)}:t}},{key:"window",get:function(){return this.screen.window}},{key:"fetch",get:function(){return this.screen.fetch}},{key:"ctx",get:function(){return this.screen.ctx}},{key:"emSize",get:function(){var t=this.emSizeStack;return t[t.length-1]||12},set:function(t){this.emSizeStack.push(t)}},{key:"popEmSize",value:function(){this.emSizeStack.pop()}},{key:"getUniqueId",value:function(){return"canvg".concat(++this.uniqueId)}},{key:"isImagesLoaded",value:function(){return this.images.every((function(t){return t.loaded}))}},{key:"isFontsLoaded",value:function(){return this.fonts.every((function(t){return t.loaded}))}},{key:"createDocumentElement",value:function(t){var e=this.createElement(t.documentElement);return e.root=!0,e.addStylesFromStyleDefinition(),this.documentElement=e,e}},{key:"createElement",value:function(e){var r=e.nodeName.replace(/^[^:]+:/,""),i=t.elementTypes[r];return i?new i(this,e):new Qt(this,e)}},{key:"createTextNode",value:function(t){return new ie(this,t)}},{key:"setViewBox",value:function(t){this.screen.setViewBox(e({document:this},t))}}]),t}();tr.createCanvas=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,r},tr.createImage=function(t){return Je.apply(this,arguments)},tr.elementTypes=Ke;var er=function(){function t(e,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};g(this,t),this.parser=new Bt(i),this.screen=new It(e,i),this.options=i;var n=new tr(this,i),a=n.createDocumentElement(r);this.document=n,this.documentElement=a}var r,i;return v(t,[{key:"fork",value:function(r,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.from(r,i,e(e({},this.options),n))}},{key:"forkString",value:function(r,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.fromString(r,i,e(e({},this.options),n))}},{key:"ready",value:function(){return this.screen.ready()}},{key:"isReady",value:function(){return this.screen.isReady()}},{key:"render",value:(i=b(regeneratorRuntime.mark((function t(){var r,i=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>0&&void 0!==i[0]?i[0]:{},this.start(e({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},r)),t.next=4,this.ready();case 4:this.stop();case 5:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this.documentElement,i=this.screen,n=this.options;i.start(r,e(e({enableRedraw:!0},n),t))}},{key:"stop",value:function(){this.screen.stop()}},{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.documentElement.resize(t,e,r)}}],[{key:"from",value:(r=b(regeneratorRuntime.mark((function e(r,i){var n,a,s,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>2&&void 0!==o[2]?o[2]:{},a=new Bt(n),e.next=4,a.parse(i);case 4:return s=e.sent,e.abrupt("return",new t(r,s,n));case 6:case"end":return e.stop()}}),e)}))),function(t,e){return r.apply(this,arguments)})},{key:"fromString",value:function(e,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=new Bt(i),a=n.parseFromString(r);return new t(e,a,i)}}]),t}();window.OffscreenCanvas||(window.OffscreenCanvas=v((function t(e,r){var i=this;return g(this,t),this.canvas=document.createElement("canvas"),this.canvas.width=e,this.canvas.height=r,this.canvas.convertToBlob=function(){return new Promise((function(t){i.canvas.toBlob(t)}))},this.canvas})));var rr=it.offscreen(),ir=function(t){return new Promise((function(e,r){var i=new FileReader;i.onloadend=function(){return e(i.result)},i.readAsDataURL(t)}))};t("s",function(){var t=b(regeneratorRuntime.mark((function t(e,r,i){var n,a,s,o,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new OffscreenCanvas(r,i),a=n.getContext("2d"),t.next=4,er.fromString(a,e,rr);case 4:return(s=t.sent).resize(r/1.2,i/1.2,"xMidYMid meet"),t.next=8,s.start();case 8:return t.next=10,n.convertToBlob();case 10:return o=t.sent,t.next=13,ir(o);case 13:return u=t.sent,a.clearRect(0,0,n.width,n.height),n=null,s.stop(),s=null,o=null,t.abrupt("return",u);case 20:case"end":return t.stop()}}),t)})));return function(e,r,i){return t.apply(this,arguments)}}())}}}))}();
|