text: /*!
        * i2djs v3.7.0
        * (c) 2022 Narayana Swamy (narayanaswamy14@gmail.com)
        * @license BSD-3-Clause
        */
  !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).i2d={})}(this,(function(t){"use strict";var e,r,i,n=null,o=[],a={},s=[],h=[];function c(t,e,r){this.executable=e,this.duration=e.duration?e.duration:0,this.delay=e.delay?e.delay:0,this.lastTime=0-(e.delay?e.delay:0),this.loopTracker=0,this.loop=e.loop?e.loop:0,this.direction=e.direction,this.easying=r,this.end=e.end?e.end:null,"reverse"===this.direction?this.factor=1:this.factor=0}function l(){}"undefined"==typeof window&&(global.window={setTimeout:setTimeout,clearTimeout:clearTimeout},global.performance={now:function(){return Date.now()}},global.document={}),window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t,e){return window.setTimeout(t,1e3/60)},window.cancelAnimFrame=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t)},c.prototype.execute=function(t){this.executable.run(t)},c.prototype.resetCallBack=function(t){"function"==typeof t&&(this.callBack=t)},l.prototype={startAnimeFrames:function(){e||(e=window.requestAnimationFrame(p))},stopAnimeFrame:function(){e&&(window.cancelAnimFrame(e),e=null)},add:function(t,e,r){var i=new c(t,e,r);i.currTime=performance.now(),e.target&&(e.target.animList||(e.target.animList=[]),e.target.animList[e.target.animList.length]=i),o[o.length]=i,this.startAnimeFrames()},remove:function(t){var e=o.indexOf(t);-1!==e&&o.splice(e,1)},onRequestFrame:function(t){if("function"!=typeof t)throw new Error("Wrong input");h.push(t),h.length>0&&!e&&this.startAnimeFrames()},removeRequestFrameCall:function(t){if("function"!=typeof t)throw new Error("Wrong input");var e=h.indexOf(t);-1!==e&&h.splice(e,1)},clearAll:function(){o=[],h=[]}},l.prototype.addVdom=function(t){var e=s.length+1;return a[e]=t,s.push(e),this.startAnimeFrames(),e},l.prototype.removeVdom=function(t){var e=s.indexOf(t);-1!==e&&(s.splice(e,1),a[t].root.destroy(),delete a[t]),0===s.length&&0===o.length&&0===h.length&&this.stopAnimeFrame()},l.prototype.vDomChanged=function(t){if(a[t]&&void 0!==a[t].stateModified)a[t].stateModified=!0,a[t].root.stateModified=!0;else if("string"==typeof t){var e=t.split(":");if(a[e[0]]&&void 0!==a[e[0]].stateModified){a[e[0]].stateModified=!0,a[e[0]].root.stateModified=!0;var r=a[e[0]].root.fetchEl("#"+e[1]);r&&(r.stateModified=!0)}}},l.prototype.execute=function(){this.startAnimeFrames()},l.prototype.vDomUpdates=function(){for(var t=0,e=s.length;t<e;t+=1)if(s[t]&&a[s[t]]&&a[s[t]].stateModified)a[s[t]].execute(),a[s[t]].stateModified=!1;else if(s[t]&&a[s[t]]&&a[s[t]].root&&"NODE"!==a[s[t]].root.ENV){document.getElementById(a[s[t]].root.container.id)||this.removeVdom(s[t])}};var u=Math.abs,f=0,d=[];function p(){try{d=[],f=0,i=performance.now();for(var t=0;t<o.length;t+=1)(r=o[t]).lastTime+=i-r.currTime,r.currTime=i,r.lastTime<r.duration&&r.lastTime>=0?(r.execute(u(r.factor-r.easying(r.lastTime,r.duration))),d[f++]=r):r.lastTime>r.duration?y(r):d[f++]=r;o=d,h.length>0&&function(){for(var t=0;t<h.length;t+=1)h[t](i)}(),n.vDomUpdates()}catch(t){console.error(t)}finally{e=window.requestAnimationFrame(p)}}function y(t){if(t.loopTracker>=t.loop-1){if(t.execute(1-t.factor),t.end&&t.end(),t.executable.target){var e=t.executable.target.animList;if(e&&e.length>0)if(1===e.length)t.executable.target.animList=[];else if(e.length>1){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}}}else t.loopTracker+=1,t.lastTime=t.lastTime-t.duration,t.lastTime=t.lastTime%t.duration,"alternate"===t.direction?t.factor=1-t.factor:"reverse"===t.direction?t.factor=1:t.factor=0,t.execute(u(t.factor-t.easying(t.lastTime,t.duration))),d[f++]=t}var x=n=new l;function v(){}function g(t,e){var r,i=0,n=0,o=1,a=1,s=e;if(t.attr.transform&&t.attr.transform.translate&&(i=(r=t.attr.transform.translate)[0],n=r[1],s.x-=i,s.y-=n),t.attr.transform&&t.attr.transform.scale&&(o=void 0!==t.attr.transform.scale[0]?t.attr.transform.scale[0]:1,a=void 0!==t.attr.transform.scale[1]?t.attr.transform.scale[1]:o,s.x/=o,s.y/=a),t.attr.transform&&t.attr.transform.rotate){var h=t.attr.transform.rotate[0],c={x:t.attr.transform.rotate[1],y:t.attr.transform.rotate[2]},l=s.x,u=s.y,f=c.x,d=c.y,p=Math.PI/180*h,y=Math.cos(p),x=Math.sin(p);s.x=y*(l-f)+x*(u-d)+f,s.y=y*(u-d)-x*(l-f)+d}}v.prototype.execute=function(){this.root.execute(),this.stateModified=!1},v.prototype.rootNode=function(t){this.root=t,this.stateModified=!0},v.prototype.eventsCheck=function(t,e,r){for(var i,n,o=0;o<=t.length-1;o+=1){var a=t[o],s={x:e.x,y:e.y};g(a,s),a.in({x:s.x,y:s.y})&&(a.children&&a.children.length>0?(n=this.eventsCheck(a.children,{x:s.x,y:s.y},r))&&(i=n):i=a)}return i},v.prototype.transformCoOr=g;var m=Math.sqrt,w=Math.sin,b=Math.cos,A=Math.abs,B=Math.atan2,T=Math.tan,k=Math.PI,S=Math.ceil,E=Math.max;function M(t,e){var r=1;if(0===e)return r;for(var i=1;i<=e;i+=1)r*=t;return r}function C(t,e){var r=0;for(var i in t)r+=M(e[i]-t[i],2);if(isNaN(r))throw new Error("error");return m(r)}function D(t,e,r){var i=M(r,3),n=M(r,2);return{x:e.ax*i+e.bx*n+e.cx*r+t.x,y:e.ay*i+e.by*n+e.cy*r+t.y}}var _=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r,i=[],n=!0,o=!1;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(i.push(a.value),!e||i.length!==e);n=!0);}catch(t){o=!0,r=t}finally{try{!n&&s.return&&s.return()}finally{o&&console.log("Error -"+r)}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},z=2*k,P=function(t,e,r,i,n,o,a){var s=t.x,h=t.y;return{x:i*(s*=e)-n*(h*=r)+o,y:n*s+i*h+a}},L=function(t,e){var r=4/3*T(e/4),i=b(t),n=w(t),o=b(t+e),a=w(t+e);return[{x:i-n*r,y:n+i*r},{x:o+a*r,y:a-o*r},{x:o,y:a}]},I=function(t,e,r,i){var n=t*i-e*r<0?-1:1,o=(t*r+e*i)/(m(t*t+e*e)*m(t*t+e*e));return o>1&&(o=1),o<-1&&(o=-1),n*Math.acos(o)};function O(t,e,r,i){var n=t.x,o=t.y,a=e.x,s=e.y,h=k/180*r,c=b(-h),l=w(-h);return{x:c*(n-a)+l*(o-s)+a,y:c*(o-s)-l*(n-a)+s}}function F(){}F.prototype={pow:M,getAngle:function(t,e){return B(e.x-t.x,e.y-t.y)},getDistance:C,scaleAlongOrigin:function(t,e){var r={};for(var i in t)r[i]=t[i]*e;return r},scaleAlongPoint:function(t,e,r){var i=(t.y-e.y)/(t.x-e.x),n=t.x*r;return{x:n,y:(i*(n-e.x)+e.y)*r}},linearTransitionBetweenPoints:function(t,e,r){return{x:t.x+(e.x-t.x)*r,y:t.y+(e.y-t.y)*r}},bezierTransition:function(t,e,r,i){return{x:(t.x-2*e.x+r.x)*i*i+(2*e.x-2*t.x)*i+t.x,y:(t.y-2*e.y+r.y)*i*i+(2*e.y-2*t.y)*i+t.y}},bezierLength:function(t,e,r){var i={},n={};i.x=t.x+r.x-2*e.x,i.y=t.y+r.y-2*e.y,n.x=2*e.x-2*t.x,n.y=2*e.y-2*t.y;var o=4*(i.x*i.x+i.y*i.y),a=4*(i.x*n.x+i.y*n.y),s=n.x*n.x+n.y*n.y,h=2*m(o+a+s),c=m(o),l=2*o*c,u=2*m(s),f=a/c,d=(2*c+f+h)/(f+u);return d=isNaN(d)||A(d)===1/0?1:d,(l*h+c*a*(h-u)+(4*s*o-a*a)*Math.log(d))/(4*l)},cubicBezierTransition:D,cubicBezierLength:function(t,e){for(var r,i,n=.001,o=0,a=D.bind(null,t,e),s=0;s<=1;s+=n)r=a(s),i=a(s+n),o+=m(M((i.x-r.x)/n,2)+M((i.y-r.y)/n,2))*n;return o},cubicBezierCoefficients:function(t){var e=3*(t.cntrl1.x-t.p0.x),r=3*(t.cntrl2.x-t.cntrl1.x)-e,i=t.p1.x-t.p0.x-e-r,n=3*(t.cntrl1.y-t.p0.y),o=3*(t.cntrl2.y-t.cntrl1.y)-n;return{cx:e,bx:r,ax:i,cy:n,by:o,ay:t.p1.y-t.p0.y-n-o}},arcToBezier:function(t){var e=t.px,r=t.py,i=t.cx,n=t.cy,o=t.rx,a=t.ry,s=t.xAxisRotation,h=void 0===s?0:s,c=t.largeArcFlag,l=void 0===c?0:c,u=t.sweepFlag,f=void 0===u?0:u,d=[];if(0===o||0===a)return[];var p=w(h*z/360),y=b(h*z/360),x=y*(e-i)/2+p*(r-n)/2,v=-p*(e-i)/2+y*(r-n)/2;if(0===x&&0===v)return[];o=A(o),a=A(a);var g=M(x,2)/M(o,2)+M(v,2)/M(a,2);g>1&&(o*=m(g),a*=m(g));var B=function(t,e,r,i,n,o,a,s,h,c,l,u){var f=M(n,2),d=M(o,2),p=M(l,2),y=M(u,2),x=f*d-f*y-d*p;x<0&&(x=0);var v=(x=m(x/=f*y+d*p)*(a===s?-1:1))*n/o*u,g=x*-o/n*l,w=c*v-h*g+(t+r)/2,b=h*v+c*g+(e+i)/2,A=(l-v)/n,B=(u-g)/o,T=(-l-v)/n,k=(-u-g)/o,S=I(1,0,A,B),E=I(A,B,T,k);return 0===s&&E>0&&(E-=z),1===s&&E<0&&(E+=z),[w,b,S,E]}(e,r,i,n,o,a,l,f,p,y,x,v),T=_(B,4),k=T[0],C=T[1],D=T[2],O=T[3],F=E(S(A(O)/(z/4)),1);O/=F;for(var N=0;N<F;N++)d.push(L(D,O)),D+=O;return d.map((function(t){var e=P(t[0],o,a,y,p,k,C),r=e.x,i=e.y,n=P(t[1],o,a,y,p,k,C),s=n.x,h=n.y,c=P(t[2],o,a,y,p,k,C);return{x1:r,y1:i,x2:s,y2:h,x:c.x,y:c.y}}))},intermediateValue:function(t,e,r){return t+(e-t)*r},toCubicCurves:function(t){if(t.length){for(var e=t,r=[],i=0;i<e.length;i+=1)if(-1!==["M","C","S","Q"].indexOf(e[i].type))r.push(e[i]);else if(-1!==["V","H","L","Z"].indexOf(e[i].type)){var n={x:(e[i].p0.x+e[i].p1.x)/2,y:(e[i].p0.y+e[i].p1.y)/2};r.push({p0:e[i].p0,cntrl1:n,cntrl2:n,p1:e[i].p1,type:"C",length:e[i].length})}else console.log("wrong cmd type");return r}},rotatePoint:O,rotateBBox:function(t,e){var r={x:t.x,y:t.y},i={x:t.x+t.width,y:t.y},n={x:t.x,y:t.y+t.height},o={x:t.x+t.width,y:t.y+t.height},a=e.translate,s=e.rotate,h={x:s[1]||0,y:s[2]||0},c=s[0];a&&a.length>0&&(h.x+=a[0],h.y+=a[1]),r=O(r,h,c,C(r,h)),i=O(i,h,c,C(i,h)),n=O(n,h,c,C(n,h)),o=O(o,h,c,C(o,h));var l=[r.x,i.x,n.x,o.x].sort((function(t,e){return t-e})),u=[r.y,i.y,n.y,o.y].sort((function(t,e){return t-e}));return{x:l[0],y:u[0],width:l[3]-l[0],height:u[3]-u[0]}}};var N=new F,R=N;function j(t,e){return t/e}function X(t,e){var r=t/e;return 1-(1-r)*Math.sin(r*e*.002*Math.PI*2+Math.PI/2)/Math.exp(8*r)}function Y(t,e){var r=t/e,i=r/100;return 1-(1-r)*Math.abs(Math.sin(r*e*i*Math.PI*2+Math.PI/2))/Math.exp(10*r)}function G(t,e){var r=t/e;return r*r}function U(t,e){var r=t/e;return r*(2-r)}function q(t,e){var r=t/e;return r<.5?2*r*r:(4-2*r)*r-1}function H(t,e){var r=t/e;return R.pow(r,3)}function V(t,e){var r=t/e;return(r-=1)*r*r+1}function Z(t,e){var r=t/e;return r<.5?4*R.pow(r,3):(r-1)*(2*r-2)*(2*r-2)+1}function W(t,e){var r=t/e;return 1-Math.cos(r*Math.PI/2)}function Q(t,e){var r=t/e;return Math.cos(r*Math.PI/2)}function $(t,e){var r=t/e;return(1-Math.cos(Math.PI*r))/2}function J(t){var e;if("function"==typeof t)return function(e,r){return t(e/r)};switch(t){case"easeOutQuad":e=U;break;case"easeInQuad":e=G;break;case"easeInOutQuad":e=q;break;case"easeInCubic":e=H;break;case"easeOutCubic":e=V;break;case"easeInOutCubic":e=Z;break;case"easeInSin":e=W;break;case"easeOutSin":e=Q;break;case"easeInOutSin":e=$;break;case"bounce":e=Y;break;case"linear":e=j;break;case"elastic":e=X;break;default:e=j}return e}var K=0,tt=0;function et(){return K+=1}function rt(){return tt+=1}var it=J;function nt(t){return this.easying=it(t),this.transition=t,this}function ot(t){if(1!==arguments.length)throw new Error("arguments mis match");return this.durationP=t,this}function at(t){if(1!==arguments.length)throw new Error("arguments mis match");return this.loopValue=t,this}function st(t){if(1!==arguments.length)throw new Error("arguments mis match");return this.directionV=t,this}function ht(t){if(1!==arguments.length)throw new Error("arguments mis match");return this.data=t,"CANVAS"===this.data.nodeName&&(this.canvasStack=[]),this}function ct(t){return"function"!=typeof t?null:(this.callbckExe=t,this)}function lt(t){return this.end=t,this}function ut(t){return this.endExe=t,this}function ft(){this.start()}function dt(){this.queue=x,this.sequenceQueue=[],this.lengthV=0,this.currPos=0,this.ID=et(),this.loopCounter=0}function pt(){this.queue=x,this.group=[],this.currPos=0,this.ID=et(),this.loopCounter=1}dt.prototype={duration:ot,loop:at,callbck:ct,bind:ht,child:lt,ease:nt,end:ut,commit:ft,reset:function(t){return this.resetV=t,this},direction:st},dt.prototype.add=function(t){var e=this;return Array.isArray(t)||"function"==typeof t||(t=[t]),Array.isArray(t)&&t.map((function(t){return e.lengthV+=t.length?t.length:0,t})),this.sequenceQueue=this.sequenceQueue.concat(t),this},dt.prototype.easyingGlobal=function(t,e){return t/e},dt.prototype.start=function(){var t=this;if("alternate"===t.directionV)t.factor=t.factor?-1*t.factor:1,t.currPos=t.factor<0?this.sequenceQueue.length-1:0;else if("reverse"===t.directionV){for(var e=0;e<this.sequenceQueue.length;e+=1){var r=this.sequenceQueue[e];r instanceof dt||r instanceof pt||r.run(1),t.currPos=e}t.factor=-1}else t.currPos=0,t.factor=1;this.execute()},dt.prototype.execute=function(){var t=this,e=this.sequenceQueue[t.currPos];if(e="function"==typeof e?e():e)return e instanceof dt||e instanceof pt?e.end(t.triggerEnd.bind(t,e)).commit():(this.currObj=e,this.queue.add(rt(),{run:function(t){e.run(t)},target:e.target,delay:void 0!==e.delay?e.delay:0,duration:void 0!==e.duration?e.duration:t.durationP,loop:e.loop?e.loop:1,direction:t.factor<0?"reverse":"default",end:t.triggerEnd.bind(t,e)},(function(t,e){return t/e}))),this},dt.prototype.triggerEnd=function(t){var e=this;if(e.currPos+=e.factor,t.end&&e.triggerChild(t),e.sequenceQueue.length===e.currPos||e.currPos<0)return e.endExe&&e.endExe(),e.loopCounter+=1,void(e.loopCounter<e.loopValue&&e.start());this.execute()},dt.prototype.triggerChild=function(t){t.end instanceof pt||t.end instanceof dt?setTimeout((function(){t.end.commit()}),0):t.end()},pt.prototype={duration:ot,loop:at,callbck:ct,bind:ht,child:lt,ease:nt,end:ut,commit:ft,direction:st},pt.prototype.add=function(t){var e=this;return Array.isArray(t)||(t=[t]),this.group=this.group.concat(t),this.group.forEach((function(t){t.durationP=t.durationP?t.durationP:e.durationP})),this},pt.prototype.execute=function(){var t=this;t.currPos=0;for(var e=function(e,r){var i=t.group[e];i instanceof dt||i instanceof pt?i.end(t.triggerEnd.bind(t,i)).commit():t.queue.add(rt(),{run:function(t){i.run(t)},target:i.target,delay:void 0!==i.delay?i.delay:0,duration:void 0!==i.duration?i.duration:t.durationP,loop:i.loop?i.loop:1,direction:i.direction?i.direction:"default",end:t.triggerEnd.bind(t,i)},i.ease?it(i.ease):t.easying)},r=0,i=t.group.length;r<i;r++)e(r);return t},pt.prototype.start=function(){var t=this;"alternate"===t.directionV?t.factor=t.factor?-1*t.factor:1:"reverse"===t.directionV?t.factor=-1:t.factor=1,this.execute()},pt.prototype.triggerEnd=function(t){var e=this;this.currPos+=1,t.end&&this.triggerChild(t.end),this.currPos===this.group.length&&(this.endExe&&this.triggerChild(this.endExe),e.loopCounter+=1,e.loopCounter<e.loopValue&&e.start())},pt.prototype.triggerChild=function(t){t instanceof pt||t instanceof dt?t.commit():"function"==typeof t?t():console.log("wrong type")};var yt={sequenceChain:function(){return new dt},parallelChain:function(){return new pt}};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var xt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},vt=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function gt(t){return t>=48&&t<=57}function mt(t){return t>=48&&t<=57||43===t||45===t||46===t}function wt(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function bt(t){for(;t.index<t.max&&(10===(e=t.path.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&vt.indexOf(e)>=0);)t.index++;var e}function At(t){var e=t.path.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err="SvgPath: arc flag can be 0 or 1 only (at pos "+t.index+")")}function Bt(t){var e,r=t.index,i=r,n=t.max,o=!1,a=!1,s=!1,h=!1;if(i>=n)t.err="SvgPath: missed param (at pos "+i+")";else if(43!==(e=t.path.charCodeAt(i))&&45!==e||(e=++i<n?t.path.charCodeAt(i):0),gt(e)||46===e){if(46!==e){if(o=48===e,e=++i<n?t.path.charCodeAt(i):0,o&&i<n&&e&&gt(e))return void(t.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+r+")");for(;i<n&&gt(t.path.charCodeAt(i));)i++,a=!0;e=i<n?t.path.charCodeAt(i):0}if(46===e){for(h=!0,i++;gt(t.path.charCodeAt(i));)i++,s=!0;e=i<n?t.path.charCodeAt(i):0}if(101===e||69===e){if(h&&!a&&!s)return void(t.err="SvgPath: invalid float exponent (at pos "+i+")");if(43!==(e=++i<n?t.path.charCodeAt(i):0)&&45!==e||i++,!(i<n&&gt(t.path.charCodeAt(i))))return void(t.err="SvgPath: invalid float exponent (at pos "+i+")");for(;i<n&&gt(t.path.charCodeAt(i));)i++}t.index=i,t.param=parseFloat(t.path.slice(r,i))+0}else t.err="SvgPath: param should start with 0..9 or `.` (at pos "+i+")"}function Tt(t){var e,r;r=(e=t.path[t.segmentStart]).toLowerCase();var i=t.data;if("m"===r&&i.length>2&&(t.result.push([e,i[0],i[1]]),i=i.slice(2),r="l",e="m"===e?"l":"L"),"r"===r)t.result.push([e].concat(i));else for(;i.length>=xt[r]&&(t.result.push([e].concat(i.splice(0,xt[r]))),xt[r]););}function kt(t){var e,r,i,n,o,a=t.max;if(t.segmentStart=t.index,e=t.path.charCodeAt(t.index),r=97==(32|e),function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}(e))if(n=xt[t.path[t.index].toLowerCase()],t.index++,bt(t),t.data=[],n){for(i=!1;;){for(o=n;o>0;o--){if(!r||3!==o&&4!==o?Bt(t):At(t),t.err.length)return;t.data.push(t.param),bt(t),i=!1,t.index<a&&44===t.path.charCodeAt(t.index)&&(t.index++,bt(t),i=!0)}if(!i){if(t.index>=t.max)break;if(!mt(t.path.charCodeAt(t.index)))break}}Tt(t)}else Tt(t);else t.err="SvgPath: bad command "+t.path[t.index]+" (at pos "+t.index+")"}function St(){if(!(this instanceof St))return new St;this.queue=[],this.cache=null}St.prototype.matrix=function(t){return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]||(this.cache=null,this.queue.push(t)),this},St.prototype.translate=function(t,e){return 0===t&&0===e||(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},St.prototype.scale=function(t,e){return 1===t&&1===e||(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},St.prototype.rotate=function(t,e,r){var i,n,o;return 0!==t&&(this.translate(e,r),i=t*Math.PI/180,n=Math.cos(i),o=Math.sin(i),this.queue.push([n,o,-o,n,0,0]),this.cache=null,this.translate(-e,-r)),this},St.prototype.skewX=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},St.prototype.skewY=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},St.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],1===this.queue.length)return this.cache;for(var t=1;t<this.queue.length;t++)this.cache=(e=this.cache,r=this.queue[t],[e[0]*r[0]+e[2]*r[1],e[1]*r[0]+e[3]*r[1],e[0]*r[2]+e[2]*r[3],e[1]*r[2]+e[3]*r[3],e[0]*r[4]+e[2]*r[5]+e[4],e[1]*r[4]+e[3]*r[5]+e[5]]);var e,r;return this.cache},St.prototype.calc=function(t,e,r){var i;return this.queue.length?(this.cache||(this.cache=this.toArray()),[t*(i=this.cache)[0]+e*i[2]+(r?0:i[4]),t*i[1]+e*i[3]+(r?0:i[5])]):[t,e]};var Et=St,Mt=Et,Ct={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},Dt=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,_t=/[\s,]+/,zt=2*Math.PI;function Pt(t,e,r,i){var n=t*r+e*i;return n>1&&(n=1),n<-1&&(n=-1),(t*i-e*r<0?-1:1)*Math.acos(n)}function Lt(t,e){var r=4/3*Math.tan(e/4),i=Math.cos(t),n=Math.sin(t),o=Math.cos(t+e),a=Math.sin(t+e);return[i,n,i-n*r,n+i*r,o+a*r,a-o*r,o,a]}var It=1e-10,Ot=Math.PI/180;function Ft(t,e,r){if(!(this instanceof Ft))return new Ft(t,e,r);this.rx=t,this.ry=e,this.ax=r}Ft.prototype.transform=function(t){var e=Math.cos(this.ax*Ot),r=Math.sin(this.ax*Ot),i=[this.rx*(t[0]*e+t[2]*r),this.rx*(t[1]*e+t[3]*r),this.ry*(-t[0]*r+t[2]*e),this.ry*(-t[1]*r+t[3]*e)],n=i[0]*i[0]+i[2]*i[2],o=i[1]*i[1]+i[3]*i[3],a=((i[0]-i[3])*(i[0]-i[3])+(i[2]+i[1])*(i[2]+i[1]))*((i[0]+i[3])*(i[0]+i[3])+(i[2]-i[1])*(i[2]-i[1])),s=(n+o)/2;if(a<It*s)return this.rx=this.ry=Math.sqrt(s),this.ax=0,this;var h=i[0]*i[1]+i[2]*i[3],c=s+(a=Math.sqrt(a))/2,l=s-a/2;return this.ax=Math.abs(h)<It&&Math.abs(c-o)<It?90:180*Math.atan(Math.abs(h)>Math.abs(c-o)?(c-n)/h:h/(c-o))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(c),this.ry=Math.sqrt(l)):(this.ax+=90,this.rx=Math.sqrt(l),this.ry=Math.sqrt(c)),this},Ft.prototype.isDegenerate=function(){return this.rx<It*this.ry||this.ry<It*this.rx};var Nt=function(t){var e=new wt(t),r=e.max;for(bt(e);e.index<r&&!e.err.length;)kt(e);return e.err.length?e.result=[]:e.result.length&&("mM".indexOf(e.result[0][0])<0?(e.err="SvgPath: string should start with `M` or `m`",e.result=[]):e.result[0][0]="M"),{err:e.err,segments:e.result}},Rt=function(t){var e,r,i=new Mt;return t.split(Dt).forEach((function(t){if(t.length)if(void 0===Ct[t])switch(r=t.split(_t).map((function(t){return+t||0})),e){case"matrix":return void(6===r.length&&i.matrix(r));case"scale":return void(1===r.length?i.scale(r[0],r[0]):2===r.length&&i.scale(r[0],r[1]));case"rotate":return void(1===r.length?i.rotate(r[0],0,0):3===r.length&&i.rotate(r[0],r[1],r[2]));case"translate":return void(1===r.length?i.translate(r[0],0):2===r.length&&i.translate(r[0],r[1]));case"skewX":return void(1===r.length&&i.skewX(r[0]));case"skewY":return void(1===r.length&&i.skewY(r[0]))}else e=t})),i},jt=Et,Xt=function(t,e,r,i,n,o,a,s,h){var c=Math.sin(h*zt/360),l=Math.cos(h*zt/360),u=l*(t-r)/2+c*(e-i)/2,f=-c*(t-r)/2+l*(e-i)/2;if(0===u&&0===f)return[];if(0===a||0===s)return[];a=Math.abs(a),s=Math.abs(s);var d=u*u/(a*a)+f*f/(s*s);d>1&&(a*=Math.sqrt(d),s*=Math.sqrt(d));var p=function(t,e,r,i,n,o,a,s,h,c){var l=c*(t-r)/2+h*(e-i)/2,u=-h*(t-r)/2+c*(e-i)/2,f=a*a,d=s*s,p=l*l,y=u*u,x=f*d-f*y-d*p;x<0&&(x=0),x/=f*y+d*p;var v=(x=Math.sqrt(x)*(n===o?-1:1))*a/s*u,g=x*-s/a*l,m=c*v-h*g+(t+r)/2,w=h*v+c*g+(e+i)/2,b=(l-v)/a,A=(u-g)/s,B=(-l-v)/a,T=(-u-g)/s,k=Pt(1,0,b,A),S=Pt(b,A,B,T);return 0===o&&S>0&&(S-=zt),1===o&&S<0&&(S+=zt),[m,w,k,S]}(t,e,r,i,n,o,a,s,c,l),y=[],x=p[2],v=p[3],g=Math.max(Math.ceil(Math.abs(v)/(zt/4)),1);v/=g;for(var m=0;m<g;m++)y.push(Lt(x,v)),x+=v;return y.map((function(t){for(var e=0;e<t.length;e+=2){var r=t[e+0],i=t[e+1],n=l*(r*=a)-c*(i*=s),o=c*r+l*i;t[e+0]=n+p[0],t[e+1]=o+p[1]}return t}))},Yt=Ft;function Gt(t){if(!(this instanceof Gt))return new Gt(t);var e=Nt(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}Gt.from=function(t){if("string"==typeof t)return new Gt(t);if(t instanceof Gt){var e=new Gt("");return e.err=t.err,e.segments=t.segments.map((function(t){return t.slice()})),e.__stack=t.__stack.map((function(t){return jt().matrix(t.toArray())})),e}throw new Error("SvgPath.from: invalid param type "+t)},Gt.prototype.__matrix=function(t){var e,r=this;t.queue.length&&this.iterate((function(i,n,o,a){var s,h,c,l;switch(i[0]){case"v":h=0===(s=t.calc(0,i[1],!0))[0]?["v",s[1]]:["l",s[0],s[1]];break;case"V":h=(s=t.calc(o,i[1],!1))[0]===t.calc(o,a,!1)[0]?["V",s[1]]:["L",s[0],s[1]];break;case"h":h=0===(s=t.calc(i[1],0,!0))[1]?["h",s[0]]:["l",s[0],s[1]];break;case"H":h=(s=t.calc(i[1],a,!1))[1]===t.calc(o,a,!1)[1]?["H",s[0]]:["L",s[0],s[1]];break;case"a":case"A":var u=t.toArray(),f=Yt(i[1],i[2],i[3]).transform(u);if(u[0]*u[3]-u[1]*u[2]<0&&(i[5]=i[5]?"0":"1"),s=t.calc(i[6],i[7],"a"===i[0]),"A"===i[0]&&i[6]===o&&i[7]===a||"a"===i[0]&&0===i[6]&&0===i[7]){h=["a"===i[0]?"l":"L",s[0],s[1]];break}h=f.isDegenerate()?["a"===i[0]?"l":"L",s[0],s[1]]:[i[0],f.rx,f.ry,f.ax,i[4],i[5],s[0],s[1]];break;case"m":l=n>0,h=["m",(s=t.calc(i[1],i[2],l))[0],s[1]];break;default:for(h=[c=i[0]],l=c.toLowerCase()===c,e=1;e<i.length;e+=2)s=t.calc(i[e],i[e+1],l),h.push(s[0],s[1])}r.segments[n]=h}),!0)},Gt.prototype.__evaluateStack=function(){var t,e;if(this.__stack.length){if(1===this.__stack.length)return this.__matrix(this.__stack[0]),void(this.__stack=[]);for(t=jt(),e=this.__stack.length;--e>=0;)t.matrix(this.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},Gt.prototype.toString=function(){var t="",e="",r=!1;this.__evaluateStack();for(var i=0,n=this.segments.length;i<n;i++){var o=this.segments[i],a=o[0];a!==e||"m"===a||"M"===a?("m"===a&&"z"===e&&(t+=" "),t+=a,r=!1):r=!0;for(var s=1;s<o.length;s++){var h=o[s];1===s?r&&h>=0&&(t+=" "):h>=0&&(t+=" "),t+=h}e=a}return t},Gt.prototype.translate=function(t,e){return this.__stack.push(jt().translate(t,e||0)),this},Gt.prototype.scale=function(t,e){return this.__stack.push(jt().scale(t,e||0===e?e:t)),this},Gt.prototype.rotate=function(t,e,r){return this.__stack.push(jt().rotate(t,e||0,r||0)),this},Gt.prototype.skewX=function(t){return this.__stack.push(jt().skewX(t)),this},Gt.prototype.skewY=function(t){return this.__stack.push(jt().skewY(t)),this},Gt.prototype.matrix=function(t){return this.__stack.push(jt().matrix(t)),this},Gt.prototype.transform=function(t){return t.trim()?(this.__stack.push(Rt(t)),this):this},Gt.prototype.round=function(t){var e,r=0,i=0,n=0,o=0;return t=t||0,this.__evaluateStack(),this.segments.forEach((function(a){var s=a[0].toLowerCase()===a[0];switch(a[0]){case"H":case"h":return s&&(a[1]+=n),n=a[1]-a[1].toFixed(t),void(a[1]=+a[1].toFixed(t));case"V":case"v":return s&&(a[1]+=o),o=a[1]-a[1].toFixed(t),void(a[1]=+a[1].toFixed(t));case"Z":case"z":return n=r,void(o=i);case"M":case"m":return s&&(a[1]+=n,a[2]+=o),n=a[1]-a[1].toFixed(t),o=a[2]-a[2].toFixed(t),r=n,i=o,a[1]=+a[1].toFixed(t),void(a[2]=+a[2].toFixed(t));case"A":case"a":return s&&(a[6]+=n,a[7]+=o),n=a[6]-a[6].toFixed(t),o=a[7]-a[7].toFixed(t),a[1]=+a[1].toFixed(t),a[2]=+a[2].toFixed(t),a[3]=+a[3].toFixed(t+2),a[6]=+a[6].toFixed(t),void(a[7]=+a[7].toFixed(t));default:return e=a.length,s&&(a[e-2]+=n,a[e-1]+=o),n=a[e-2]-a[e-2].toFixed(t),o=a[e-1]-a[e-1].toFixed(t),void a.forEach((function(e,r){r&&(a[r]=+a[r].toFixed(t))}))}})),this},Gt.prototype.iterate=function(t,e){var r,i,n,o=this.segments,a={},s=!1,h=0,c=0,l=0,u=0;if(e||this.__evaluateStack(),o.forEach((function(e,r){var i=t(e,r,h,c);Array.isArray(i)&&(a[r]=i,s=!0);var n=e[0]===e[0].toLowerCase();switch(e[0]){case"m":case"M":return h=e[1]+(n?h:0),c=e[2]+(n?c:0),l=h,void(u=c);case"h":case"H":return void(h=e[1]+(n?h:0));case"v":case"V":return void(c=e[1]+(n?c:0));case"z":case"Z":return h=l,void(c=u);default:h=e[e.length-2]+(n?h:0),c=e[e.length-1]+(n?c:0)}})),!s)return this;for(n=[],r=0;r<o.length;r++)if(void 0!==a[r])for(i=0;i<a[r].length;i++)n.push(a[r][i]);else n.push(o[r]);return this.segments=n,this},Gt.prototype.abs=function(){return this.iterate((function(t,e,r,i){var n,o=t[0],a=o.toUpperCase();if(o!==a)switch(t[0]=a,o){case"v":return void(t[1]+=i);case"a":return t[6]+=r,void(t[7]+=i);default:for(n=1;n<t.length;n++)t[n]+=n%2?r:i}}),!0),this},Gt.prototype.rel=function(){return this.iterate((function(t,e,r,i){var n,o=t[0],a=o.toLowerCase();if(o!==a&&(0!==e||"M"!==o))switch(t[0]=a,o){case"V":return void(t[1]-=i);case"A":return t[6]-=r,void(t[7]-=i);default:for(n=1;n<t.length;n++)t[n]-=n%2?r:i}}),!0),this},Gt.prototype.unarc=function(){return this.iterate((function(t,e,r,i){var n,o,a,s=[],h=t[0];return"A"!==h&&"a"!==h?null:("a"===h?(o=r+t[6],a=i+t[7]):(o=t[6],a=t[7]),0===(n=Xt(r,i,o,a,t[4],t[5],t[1],t[2],t[3])).length?[["a"===t[0]?"l":"L",t[6],t[7]]]:(n.forEach((function(t){s.push(["C",t[2],t[3],t[4],t[5],t[6],t[7]])})),s))})),this},Gt.prototype.unshort=function(){var t,e,r,i,n,o=this.segments;return this.iterate((function(a,s,h,c){var l,u=a[0],f=u.toUpperCase();s&&("T"===f?(l="t"===u,"Q"===(r=o[s-1])[0]?(t=r[1]-h,e=r[2]-c):"q"===r[0]?(t=r[1]-r[3],e=r[2]-r[4]):(t=0,e=0),i=-t,n=-e,l||(i+=h,n+=c),o[s]=[l?"q":"Q",i,n,a[1],a[2]]):"S"===f&&(l="s"===u,"C"===(r=o[s-1])[0]?(t=r[3]-h,e=r[4]-c):"c"===r[0]?(t=r[3]-r[5],e=r[4]-r[6]):(t=0,e=0),i=-t,n=-e,l||(i+=h,n+=c),o[s]=[l?"c":"C",i,n,a[1],a[2],a[3],a[4]]))})),this};var Ut=Gt,qt={exports:{}};function Ht(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Vt(t,e,r){return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function Zt(t){return"number"==typeof t&&isFinite(t)}!function(t,e){!function(t){var e={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=/([astvzqmhlc])([^astvzqmhlc]*)/gi,i=function(t){var i=[];return t.replace(r,(function(t,r,n){var a=r.toLowerCase();for(n=o(n),"m"===a&&n.length>2&&(i.push([r].concat(n.splice(0,2))),a="l",r="m"===r?"l":"L");n.length>=0;){if(n.length===e[a])return n.unshift(r),i.push(n);if(n.length<e[a])throw new Error("malformed path data");i.push([r].concat(n.splice(0,e[a])))}})),i},n=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function o(t){var e=t.match(n);return e?e.map(Number):[]}var a=function(t,e,r,i,n,o,a,h){return new s(t,e,r,i,n,o,a,h)};function s(t,e,r,i,n,o,a,s){this.a={x:t,y:e},this.b={x:r,y:i},this.c={x:n,y:o},this.d={x:a,y:s},null!=a&&null!=s?(this.getArcLength=w,this.getPoint=f,this.getDerivative=c):(this.getArcLength=d,this.getPoint=u,this.getDerivative=h),this.init()}function h(t,e,r){return{x:2*(1-r)*(t[1]-t[0])+2*r*(t[2]-t[1]),y:2*(1-r)*(e[1]-e[0])+2*r*(e[2]-e[1])}}function c(t,e,r){return u([3*(t[1]-t[0]),3*(t[2]-t[1]),3*(t[3]-t[2])],[3*(e[1]-e[0]),3*(e[2]-e[1]),3*(e[3]-e[2])],r)}function l(t,e,r,i,n){for(var o=1,a=t/e,s=(t-r(i,n,a))/e;o>.001;){var h=r(i,n,a+s),c=r(i,n,a-s),l=Math.abs(t-h)/e,u=Math.abs(t-c)/e;l<o?(o=l,a+=s):u<o?(o=u,a-=s):s/=2}return a}function u(t,e,r){return{x:(1-r)*(1-r)*t[0]+2*(1-r)*r*t[1]+r*r*t[2],y:(1-r)*(1-r)*e[0]+2*(1-r)*r*e[1]+r*r*e[2]}}function f(t,e,r){return{x:(1-r)*(1-r)*(1-r)*t[0]+3*(1-r)*(1-r)*r*t[1]+3*(1-r)*r*r*t[2]+r*r*r*t[3],y:(1-r)*(1-r)*(1-r)*e[0]+3*(1-r)*(1-r)*r*e[1]+3*(1-r)*r*r*e[2]+r*r*r*e[3]}}function d(t,e,r){void 0===r&&(r=1);var i=t[0]-2*t[1]+t[2],n=e[0]-2*e[1]+e[2],o=2*t[1]-2*t[0],a=2*e[1]-2*e[0],s=4*(i*i+n*n),h=4*(i*o+n*a),c=o*o+a*a;if(0===s)return r*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(e[2]-e[0],2));var l=h/(2*s),u=r+l,f=c/s-l*l;return Math.sqrt(s)/2*(u*Math.sqrt(u*u+f)-l*Math.sqrt(l*l+f)+f*Math.log(Math.abs((u+Math.sqrt(u*u+f))/(l+Math.sqrt(l*l+f)))))}s.prototype={constructor:s,init:function(){this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y])},getTotalLength:function(){return this.length},getPointAtLength:function(t){var e=l(t,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]);return this.getPoint([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e)},getTangentAtLength:function(t){var e=l(t,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]),r=this.getDerivative([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e),i=Math.sqrt(r.x*r.x+r.y*r.y);return i>0?{x:r.x/i,y:r.y/i}:{x:0,y:0}},getPropertiesAtLength:function(t){var e,r=l(t,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]),i=this.getDerivative([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],r),n=Math.sqrt(i.x*i.x+i.y*i.y);e=n>0?{x:i.x/n,y:i.y/n}:{x:0,y:0};var o=this.getPoint([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],r);return{x:o.x,y:o.y,tangentX:e.x,tangentY:e.y}}};var p=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],y=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],x=[[1],[1,1],[1,2,1],[1,3,3,1]];function v(t,e){return x[t][e]}function g(t,e,r){var i,n,o,a=r.length-1;if(0===a)return 0;if(0===t){for(n=0,o=0;o<=a;o++)n+=v(a,o)*Math.pow(1-e,a-o)*Math.pow(e,o)*r[o];return n}for(i=new Array(a),o=0;o<a;o++)i[o]=a*(r[o+1]-r[o]);return g(t-1,e,i)}function m(t,e,r){var i=g(1,r,t),n=g(1,r,e),o=i*i+n*n;return Math.sqrt(o)}function w(t,e,r){var i,n,o,a;void 0===r&&(r=1);var s=20;for(i=r/2,n=0,o=0;o<s;o++)a=i*p[s][o]+i,n+=y[s][o]*m(t,e,a);return i*n}var b=2*Math.PI;function A(t,e,r,i){var n=t*r+e*i;return n>1&&(n=1),n<-1&&(n=-1),(t*i-e*r<0?-1:1)*Math.acos(n)}function B(t,e,r,i,n,o,a,s,h,c){var l=c*(t-r)/2+h*(e-i)/2,u=-h*(t-r)/2+c*(e-i)/2,f=a*a,d=s*s,p=l*l,y=u*u,x=f*d-f*y-d*p;x<0&&(x=0),x/=f*y+d*p;var v=(x=Math.sqrt(x)*(n===o?-1:1))*a/s*u,g=x*-s/a*l,m=c*v-h*g+(t+r)/2,w=h*v+c*g+(e+i)/2,B=(l-v)/a,T=(u-g)/s,k=(-l-v)/a,S=(-u-g)/s,E=A(1,0,B,T),M=A(B,T,k,S);return 0===o&&M>0&&(M-=b),1===o&&M<0&&(M+=b),[m,w,E,M]}function T(t,e){var r=4/3*Math.tan(e/4),i=Math.cos(t),n=Math.sin(t),o=Math.cos(t+e),a=Math.sin(t+e);return[i,n,i-n*r,n+i*r,o+a*r,a-o*r,o,a]}var k=function(t,e,r,i,n,o,a,s,h){var c=Math.sin(n*b/360),l=Math.cos(n*b/360),u=l*(t-s)/2+c*(e-h)/2,f=-c*(t-s)/2+l*(e-h)/2;if(0===u&&0===f)return[];if(0===r||0===i)return[];r=Math.abs(r),i=Math.abs(i);var d=u*u/(r*r)+f*f/(i*i);d>1&&(r*=Math.sqrt(d),i*=Math.sqrt(d));var p=B(t,e,s,h,o,a,r,i,c,l),y=[],x=p[2],v=p[3],g=Math.max(Math.ceil(Math.abs(v)/(b/4)),1);v/=g;for(var m=0;m<g;m++)y.push(T(x,v)),x+=v;return y.map((function(t){for(var e=0;e<t.length;e+=2){var n=t[e+0],o=t[e+1],a=l*(n*=r)-c*(o*=i),s=c*n+l*o;t[e+0]=a+p[0],t[e+1]=s+p[1]}return t}))},S=function(t,e,r,i,n,o,a,s,h){return new E(t,e,r,i,n,o,a,s,h)};function E(t,e,r,i,n,o,s,h,c){var l=0,u=[],f=[];k(t,e,r,i,n,o,s,h,c).forEach((function(t){var e=new a(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]),r=e.getTotalLength();l+=r,u.push(r),f.push(e)})),this.length=l,this.partialLengths=u,this.curves=f}E.prototype={constructor:E,init:function(){},getTotalLength:function(){return this.length},getPointAtLength:function(t){t<0?t=0:t>this.length&&(t=this.length);for(var e=this.partialLengths.length-1;this.partialLengths[e]>=t&&this.partialLengths[e]>0;)e--;e<this.partialLengths.length-1&&e++;for(var r=0,i=0;i<e;i++)r+=this.partialLengths[i];return this.curves[e].getPointAtLength(t-r)},getTangentAtLength:function(t){t<0?t=0:t>this.length&&(t=this.length);for(var e=this.partialLengths.length-1;this.partialLengths[e]>=t&&this.partialLengths[e]>0;)e--;e<this.partialLengths.length-1&&e++;for(var r=0,i=0;i<e;i++)r+=this.partialLengths[i];return this.curves[e].getTangentAtLength(t-r)},getPropertiesAtLength:function(t){var e=this.getTangentAtLength(t),r=this.getPointAtLength(t);return{x:r.x,y:r.y,tangentX:e.x,tangentY:e.y}}};var M=function(t,e,r,i){return new C(t,e,r,i)};function C(t,e,r,i){this.x0=t,this.x1=e,this.y0=r,this.y1=i}C.prototype.getTotalLength=function(){return Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2))},C.prototype.getPointAtLength=function(t){var e=t/Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2)),r=(this.x1-this.x0)*e,i=(this.y1-this.y0)*e;return{x:this.x0+r,y:this.y0+i}},C.prototype.getTangentAtLength=function(){var t=Math.sqrt((this.x1-this.x0)*(this.x1-this.x0)+(this.y1-this.y0)*(this.y1-this.y0));return{x:(this.x1-this.x0)/t,y:(this.y1-this.y0)/t}},C.prototype.getPropertiesAtLength=function(t){var e=this.getPointAtLength(t),r=this.getTangentAtLength();return{x:e.x,y:e.y,tangentX:r.x,tangentY:r.y}};var D=function(t){var e=0,r=[],n=[];function o(t){if(!t)return null;for(var s,h,c=i(t),l=[0,0],u=[0,0],f=0;f<c.length;f++)"M"===c[f][0]?(h=[(l=[c[f][1],c[f][2]])[0],l[1]],n.push(null)):"m"===c[f][0]?(h=[(l=[c[f][1]+l[0],c[f][2]+l[1]])[0],l[1]],n.push(null)):"L"===c[f][0]?(e+=Math.sqrt(Math.pow(l[0]-c[f][1],2)+Math.pow(l[1]-c[f][2],2)),n.push(new M(l[0],c[f][1],l[1],c[f][2])),l=[c[f][1],c[f][2]]):"l"===c[f][0]?(e+=Math.sqrt(Math.pow(c[f][1],2)+Math.pow(c[f][2],2)),n.push(new M(l[0],c[f][1]+l[0],l[1],c[f][2]+l[1])),l=[c[f][1]+l[0],c[f][2]+l[1]]):"H"===c[f][0]?(e+=Math.abs(l[0]-c[f][1]),n.push(new M(l[0],c[f][1],l[1],l[1])),l[0]=c[f][1]):"h"===c[f][0]?(e+=Math.abs(c[f][1]),n.push(new M(l[0],l[0]+c[f][1],l[1],l[1])),l[0]=c[f][1]+l[0]):"V"===c[f][0]?(e+=Math.abs(l[1]-c[f][1]),n.push(new M(l[0],l[0],l[1],c[f][1])),l[1]=c[f][1]):"v"===c[f][0]?(e+=Math.abs(c[f][1]),n.push(new M(l[0],l[0],l[1],l[1]+c[f][1])),l[1]=c[f][1]+l[1]):"z"===c[f][0]||"Z"===c[f][0]?(e+=Math.sqrt(Math.pow(h[0]-l[0],2)+Math.pow(h[1]-l[1],2)),n.push(new M(l[0],h[0],l[1],h[1])),l=[h[0],h[1]]):"C"===c[f][0]?(s=new a(l[0],l[1],c[f][1],c[f][2],c[f][3],c[f][4],c[f][5],c[f][6]),e+=s.getTotalLength(),l=[c[f][5],c[f][6]],n.push(s)):"c"===c[f][0]?(s=new a(l[0],l[1],l[0]+c[f][1],l[1]+c[f][2],l[0]+c[f][3],l[1]+c[f][4],l[0]+c[f][5],l[1]+c[f][6]),e+=s.getTotalLength(),l=[c[f][5]+l[0],c[f][6]+l[1]],n.push(s)):"S"===c[f][0]?(s=f>0&&["C","c","S","s"].indexOf(c[f-1][0])>-1?new a(l[0],l[1],2*l[0]-c[f-1][c[f-1].length-4],2*l[1]-c[f-1][c[f-1].length-3],c[f][1],c[f][2],c[f][3],c[f][4]):new a(l[0],l[1],l[0],l[1],c[f][1],c[f][2],c[f][3],c[f][4]),e+=s.getTotalLength(),l=[c[f][3],c[f][4]],n.push(s)):"s"===c[f][0]?(s=f>0&&["C","c","S","s"].indexOf(c[f-1][0])>-1?new a(l[0],l[1],l[0]+s.d.x-s.c.x,l[1]+s.d.y-s.c.y,l[0]+c[f][1],l[1]+c[f][2],l[0]+c[f][3],l[1]+c[f][4]):new a(l[0],l[1],l[0],l[1],l[0]+c[f][1],l[1]+c[f][2],l[0]+c[f][3],l[1]+c[f][4]),e+=s.getTotalLength(),l=[c[f][3]+l[0],c[f][4]+l[1]],n.push(s)):"Q"===c[f][0]?(s=l[0]!=c[f][1]&&l[1]!=c[f][2]?new a(l[0],l[1],c[f][1],c[f][2],c[f][3],c[f][4]):new M(c[f][1],c[f][3],c[f][2],c[f][4]),e+=s.getTotalLength(),n.push(s),l=[c[f][3],c[f][4]],u=[c[f][1],c[f][2]]):"q"===c[f][0]?(s=0!=c[f][1]||0!=c[f][2]?new a(l[0],l[1],l[0]+c[f][1],l[1]+c[f][2],l[0]+c[f][3],l[1]+c[f][4]):new M(l[0]+c[f][1],l[0]+c[f][3],l[1]+c[f][2],l[1]+c[f][4]),e+=s.getTotalLength(),u=[l[0]+c[f][1],l[1]+c[f][2]],l=[c[f][3]+l[0],c[f][4]+l[1]],n.push(s)):"T"===c[f][0]?(s=f>0&&["Q","q","T","t"].indexOf(c[f-1][0])>-1?new a(l[0],l[1],2*l[0]-u[0],2*l[1]-u[1],c[f][1],c[f][2]):new M(l[0],c[f][1],l[1],c[f][2]),n.push(s),e+=s.getTotalLength(),u=[2*l[0]-u[0],2*l[1]-u[1]],l=[c[f][1],c[f][2]]):"t"===c[f][0]?(s=f>0&&["Q","q","T","t"].indexOf(c[f-1][0])>-1?new a(l[0],l[1],2*l[0]-u[0],2*l[1]-u[1],l[0]+c[f][1],l[1]+c[f][2]):new M(l[0],l[0]+c[f][1],l[1],l[1]+c[f][2]),e+=s.getTotalLength(),u=[2*l[0]-u[0],2*l[1]-u[1]],l=[c[f][1]+l[0],c[f][2]+l[0]],n.push(s)):"A"===c[f][0]?(s=new S(l[0],l[1],c[f][1],c[f][2],c[f][3],c[f][4],c[f][5],c[f][6],c[f][7]),e+=s.getTotalLength(),l=[c[f][6],c[f][7]],n.push(s)):"a"===c[f][0]&&(s=new S(l[0],l[1],c[f][1],c[f][2],c[f][3],c[f][4],c[f][5],l[0]+c[f][6],l[1]+c[f][7]),e+=s.getTotalLength(),l=[l[0]+c[f][6],l[1]+c[f][7]],n.push(s)),r.push(e);return o}o.getTotalLength=function(){return e},o.getPointAtLength=function(t){var e=s(t);return n[e.i].getPointAtLength(e.fraction)},o.getTangentAtLength=function(t){var e=s(t);return n[e.i].getTangentAtLength(e.fraction)},o.getPropertiesAtLength=function(t){var e=s(t);return n[e.i].getPropertiesAtLength(e.fraction)};var s=function(t){t<0?t=0:t>e&&(t=e);for(var i=r.length-1;r[i]>=t&&r[i]>0;)i--;return i++,{fraction:t-r[i-1],i:i}};return o(t)};t.svgPathProperties=D,t.parse=i,t.Bezier=a,Object.defineProperty(t,"__esModule",{value:!0})}(e)}(0,qt.exports);var Wt='All shapes must be supplied as arrays of [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d).\nExample valid ways of supplying a shape would be:\n[[0, 0], [10, 0], [10, 10]]\n"M0,0 L10,0 L10,10Z"\n';function Qt(t,e){var r=function(t){return new Ut(t).abs()}(t);return function(t){var e=t.segments||[],r=[];if(!e.length||"M"!==e[0][0])return!1;for(var i=0;i<e.length;i++){var n=e[i],o=n[0],a=n[1],s=n[2];if("M"===o&&i||"Z"===o)break;if("M"===o||"L"===o)r.push([a,s]);else if("H"===o)r.push([a,r[r.length-1][1]]);else{if("V"!==o)return!1;r.push([r[r.length-1][0],a])}}return!!r.length&&{ring:r}}(r)||function(t,e){var r,i,n=function(t){return t.toString().split("M").map((function(t,e){return t=t.trim(),e&&t?"M"+t:t})).filter((function(t){return t}))}(t)[0],o=[],a=3;if(!n)throw new TypeError(Wt);i=function(t){if("undefined"!=typeof window&&window&&window.document)try{var e=window.document.createElementNS("http://www.w3.org/2000/svg","path");return e.setAttributeNS(null,"d",t),e}catch(t){}return qt.exports.svgPathProperties(t)}(n),r=i.getTotalLength(),e&&Zt(e)&&e>0&&(a=Math.max(a,Math.ceil(r/e)));for(var s=0;s<a;s++){var h=i.getPointAtLength(r*s/a);o.push([h.x,h.y])}return{ring:o,skipBisect:!0}}(r,e)}function $t(t,e){for(var r=t.length+e,i=function(t){for(var e,r,i=-1,n=t.length,o=t[n-1],a=o[0],s=o[1],h=0;++i<n;)e=a,r=s,e-=a=(o=t[i])[0],r-=s=o[1],h+=Math.sqrt(e*e+r*r);return h}(t)/e,n=0,o=0,a=i/2;t.length<r;){var s=t[n],h=t[(n+1)%t.length],c=Ht(s,h);a<=o+c?(t.splice(n+1,0,c?Vt(s,h,(a-o)/c):s.slice(0)),a+=i):(o+=c,n++)}}function Jt(t,e){var r,i;if("string"==typeof t){var n=Qt(t,e);t=n.ring,i=n.skipBisect}else if(!Array.isArray(t))throw new TypeError(Wt);if(!function(t){return t.every((function(t){return Array.isArray(t)&&t.length>=2&&Zt(t[0])&&Zt(t[1])}))}(r=t.slice(0)))throw new TypeError(Wt);return r.length>1&&function(t,e){return Ht(t,e)<1e-9}(r[0],r[r.length-1])&&r.pop(),function(t){for(var e,r=-1,i=t.length,n=t[i-1],o=0;++r<i;)e=n,n=t[r],o+=e[1]*n[0]-e[0]*n[1];return o/2}(r)>0&&r.reverse(),!i&&e&&Zt(e)&&e>0&&function(t,e){void 0===e&&(e=1/0);for(var r=0;r<t.length;r++)for(var i=t[r],n=r===t.length-1?t[0]:t[r+1];Ht(i,n)>e;)n=Vt(i,n,.5),t.splice(r+1,0,n)}(r,e),r}function Kt(t,e,r){void 0===r&&(r={});var i=r.maxSegmentLength;void 0===i&&(i=10);var n=r.string;void 0===n&&(n=!0);var o=function(t,e,r){var i;return i=t.length-e.length,$t(t,i<0?-1*i:0),$t(e,i>0?i:0),function(t,e){for(var r,i,n,o=t.length,a=1/0,s=function(n){i=0,e.forEach((function(e,r){var a=Ht(t[(n+r)%o],e);i+=a*a})),i<a&&(a=i,r=n)},h=0;h<o;h++)s(h);r&&(n=t.splice(0,r),t.splice.apply(t,[t.length,0].concat(n)))}(t,e),function(t,e,r){var i=t.map((function(t,r){return function(t,e){return function(r){return t.map((function(t,i){return t+r*(e[i]-t)}))}}(t,e[r])}));return function(t){var e=i.map((function(e){return e(t)}));return r?"M"+e.join("L")+"Z":e}}(t,e,r)}(Jt(t,i),Jt(e,i),n);return!n||"string"!=typeof t&&"string"!=typeof e?o:function(r){return r<1e-4&&"string"==typeof t?t:1-r<1e-4&&"string"==typeof e?e:o(r)}}var te={exports:{}};function ee(t,e,r){r=r||2;var i,n,o,a,s,h,c,l=e&&e.length,u=l?e[0]*r:t.length,f=re(t,0,u,r,!0),d=[];if(!f||f.next===f.prev)return d;if(l&&(f=function(t,e,r,i){var n,o,a,s=[];for(n=0,o=e.length;n<o;n++)(a=re(t,e[n]*i,n<o-1?e[n+1]*i:t.length,i,!1))===a.next&&(a.steiner=!0),s.push(de(a));for(s.sort(ce),n=0;n<s.length;n++)r=ie(r=le(s[n],r),r.next);return r}(t,e,f,r)),t.length>80*r){i=o=t[0],n=a=t[1];for(var p=r;p<u;p+=r)(s=t[p])<i&&(i=s),(h=t[p+1])<n&&(n=h),s>o&&(o=s),h>a&&(a=h);c=0!==(c=Math.max(o-i,a-n))?1/c:0}return ne(f,d,r,i,n,c),d}function re(t,e,r,i,n){var o,a;if(n===Se(t,e,r,i)>0)for(o=e;o<r;o+=i)a=Be(o,t[o],t[o+1],a);else for(o=r-i;o>=e;o-=i)a=Be(o,t[o],t[o+1],a);return a&&ve(a,a.next)&&(Te(a),a=a.next),a}function ie(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!ve(i,i.next)&&0!==xe(i.prev,i,i.next))i=i.next;else{if(Te(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function ne(t,e,r,i,n,o,a){if(t){!a&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=fe(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,r,i,n,o,a,s,h,c=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,i=r,s=0,e=0;e<c&&(s++,i=i.nextZ);e++);for(h=c;s>0||h>0&&i;)0!==s&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,s--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,c*=2}while(a>1)}(n)}(t,i,n,o);for(var s,h,c=t;t.prev!==t.next;)if(s=t.prev,h=t.next,o?ae(t,i,n,o):oe(t))e.push(s.i/r),e.push(t.i/r),e.push(h.i/r),Te(t),t=h.next,c=h.next;else if((t=h)===c){a?1===a?ne(t=se(ie(t),e,r),e,r,i,n,o,2):2===a&&he(t,e,r,i,n,o):ne(ie(t),e,r,i,n,o,1);break}}}function oe(t){var e=t.prev,r=t,i=t.next;if(xe(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(pe(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&xe(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function ae(t,e,r,i){var n=t.prev,o=t,a=t.next;if(xe(n,o,a)>=0)return!1;for(var s=n.x<o.x?n.x<a.x?n.x:a.x:o.x<a.x?o.x:a.x,h=n.y<o.y?n.y<a.y?n.y:a.y:o.y<a.y?o.y:a.y,c=n.x>o.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,l=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,u=fe(s,h,e,r,i),f=fe(c,l,e,r,i),d=t.prevZ,p=t.nextZ;d&&d.z>=u&&p&&p.z<=f;){if(d!==t.prev&&d!==t.next&&pe(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&xe(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==t.prev&&p!==t.next&&pe(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&xe(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=u;){if(d!==t.prev&&d!==t.next&&pe(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&xe(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=f;){if(p!==t.prev&&p!==t.next&&pe(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&xe(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function se(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!ve(n,o)&&ge(n,i,i.next,o)&&be(n,o)&&be(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),Te(i),Te(i.next),i=t=o),i=i.next}while(i!==t);return ie(i)}function he(t,e,r,i,n,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ye(a,s)){var h=Ae(a,s);return a=ie(a,a.next),h=ie(h,h.next),ne(a,e,r,i,n,o),void ne(h,e,r,i,n,o)}s=s.next}a=a.next}while(a!==t)}function ce(t,e){return t.x-e.x}function le(t,e){var r=function(t,e){var r,i=e,n=t.x,o=t.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&s>a){if(a=s,s===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!r)return null;if(n===a)return r;var h,c=r,l=r.x,u=r.y,f=1/0;i=r;do{n>=i.x&&i.x>=l&&n!==i.x&&pe(o<u?n:a,o,l,u,o<u?a:n,o,i.x,i.y)&&(h=Math.abs(o-i.y)/(n-i.x),be(i,t)&&(h<f||h===f&&(i.x>r.x||i.x===r.x&&ue(r,i)))&&(r=i,f=h)),i=i.next}while(i!==c);return r}(t,e);if(!r)return e;var i=Ae(r,t),n=ie(r,r.next);return ie(i,i.next),e===r?n:e}function ue(t,e){return xe(t.prev,t,e.prev)<0&&xe(e.next,t,t.next)<0}function fe(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function de(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function pe(t,e,r,i,n,o,a,s){return(n-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(i-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(n-a)*(i-s)>=0}function ye(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&ge(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(be(t,e)&&be(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&(xe(t.prev,t,e.prev)||xe(t,e.prev,e))||ve(t,e)&&xe(t.prev,t,t.next)>0&&xe(e.prev,e,e.next)>0)}function xe(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function ve(t,e){return t.x===e.x&&t.y===e.y}function ge(t,e,r,i){var n=we(xe(t,e,r)),o=we(xe(t,e,i)),a=we(xe(r,i,t)),s=we(xe(r,i,e));return n!==o&&a!==s||(!(0!==n||!me(t,r,e))||(!(0!==o||!me(t,i,e))||(!(0!==a||!me(r,t,i))||!(0!==s||!me(r,e,i)))))}function me(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function we(t){return t>0?1:t<0?-1:0}function be(t,e){return xe(t.prev,t,t.next)<0?xe(t,e,t.next)>=0&&xe(t,t.prev,e)>=0:xe(t,e,t.prev)<0||xe(t,t.next,e)<0}function Ae(t,e){var r=new ke(t.i,t.x,t.y),i=new ke(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function Be(t,e,r,i){var n=new ke(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function Te(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ke(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Se(t,e,r,i){for(var n=0,o=e,a=r-i;o<r;o+=i)n+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return n}te.exports=ee,te.exports.default=ee,ee.deviation=function(t,e,r,i){var n=e&&e.length,o=n?e[0]*r:t.length,a=Math.abs(Se(t,0,o,r));if(n)for(var s=0,h=e.length;s<h;s++){var c=e[s]*r,l=s<h-1?e[s+1]*r:t.length;a-=Math.abs(Se(t,c,l,r))}var u=0;for(s=0;s<i.length;s+=3){var f=i[s]*r,d=i[s+1]*r,p=i[s+2]*r;u+=Math.abs((t[f]-t[p])*(t[d+1]-t[f+1])-(t[f]-t[d])*(t[p+1]-t[f+1]))}return 0===a&&0===u?0:Math.abs((u-a)/a)},ee.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,n=0;n<t.length;n++){for(var o=0;o<t[n].length;o++)for(var a=0;a<e;a++)r.vertices.push(t[n][o][a]);n>0&&(i+=t[n-1].length,r.holes.push(i))}return r};var Ee,Me,Ce=te.exports;function De(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}1===(Ee=De).length&&(Me=Ee,Ee=function(t,e){return De(Me(t),e)});var _e=0,ze=N,Pe=x,Le=J;function Ie(t,e,r,i){var n=r.minX,o=r.minY,a=r.maxX,s=r.maxY;if(-1!==["V","H","L","v","h","l"].indexOf(t.type))[t.p0?t.p0:e.p1,t.p1].forEach((function(t){t.x<n&&(n=t.x),t.x>a&&(a=t.x),t.y<o&&(o=t.y),t.y>s&&(s=t.y)}));else if(-1!==["Q","C","q","c"].indexOf(t.type))for(var h,c=ze.cubicBezierCoefficients(t),l=ze.cubicBezierTransition.bind(null,t.p0,c),u=0;u<1;)h=l(u),u+=.05,h.x<n&&(n=h.x),h.x>a&&(a=h.x),h.y<o&&(o=h.y),h.y>s&&(s=h.y);else{var f=t.p0;f.x<n&&(n=f.x),f.x>a&&(a=f.x),f.y<o&&(o=f.y),f.y>s&&(s=f.y)}r.minX=n,r.minY=o,r.maxX=a,r.maxY=s,i.x=n,i.y=o,i.width=a-n,i.height=s-o}function Oe(t,e){return{x:t.x+e.x,y:t.y+e.y}}function Fe(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ne(t,e,r){return t?r:e}function Re(t){this.stack=[],this.length=0,this.stackGroup=[],this.BBox={x:0,y:0,width:0,height:0},this.minMax={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},t&&this.parse(t)}function je(t){return["S","C","V","L","H","Q"].indexOf(t)>-1}Re.prototype={z:function(){return this.cp=this.start,this.segmentLength=ze.getDistance(this.pp,this.cp),this.stack.push({p0:this.pp,p1:this.cp,type:"Z",length:this.segmentLength,pointAt:function(t){return ze.linearTransitionBetweenPoints(this.p0,this.p1,t)}}),this.length+=this.segmentLength,this.pp=this.cp,Ie(this.stack[this.stack.length-1],this.stack[this.stack.length-2],this.minMax,this.BBox),this},m:function(t,e){var r=Ne(t,this.pp?this.pp:{x:0,y:0},{x:0,y:0});return this.cntrl=null,this.cp=Oe(e,r),this.start=this.cp,this.segmentLength=0,this.length=this.segmentLength,0!==this.currPathArr&&this.pp?(this.stackGroup.push(this.stack),this.stack=[]):this.stackGroup.push(this.stack),this.stack.push({type:"M",p0:this.cp,length:this.segmentLength,pointAt:function(t){return this.p0}}),this.pp=this.cp,Ie(this.stack[this.stack.length-1],this.stack[this.stack.length-2],this.minMax,this.BBox),this},v:function(t,e){var r=Ne(t,this.pp,{x:this.pp.x,y:0});return this.cntrl=null,this.cp=Oe(e,r),this.segmentLength=ze.getDistance(this.pp,this.cp),this.stack.push({type:"V",p0:this.pp,p1:this.cp,length:this.segmentLength,pointAt:function(t){return ze.linearTransitionBetweenPoints(this.p0,this.p1,t)}}),this.length+=this.segmentLength,this.pp=this.cp,Ie(this.stack[this.stack.length-1],this.stack[this.stack.length-2],this.minMax,this.BBox),this},h:function(t,e){var r=Ne(t,this.pp,{x:0,y:this.pp.y});return this.cp=Oe(e,r),this.cntrl=null,this.segmentLength=ze.getDistance(this.pp,this.cp),this.stack.push({type:t?"H":"h",p0:this.pp,p1:this.cp,length:this.segmentLength,relative:{p1:e},pointAt:function(t){return ze.linearTransitionBetweenPoints(this.p0,this.p1,t)}}),this.length+=this.segmentLength,this.pp=this.cp,Ie(this.stack[this.stack.length-1],this.stack[this.stack.length-2],this.minMax,this.BBox),this},l:function(t,e){var r=Ne(t,this.pp,{x:0,y:0});return this.cntrl=null,this.cp=Oe(e,r),this.segmentLength=ze.getDistance(this.pp,this.cp),this.stack.push({type:t?"L":"l",p0:this.pp,p1:this.cp,relative:{p1:e},length:this.segmentLength,pointAt:function(t){return ze.linearTransitionBetweenPoints(this.p0,this.p1,t)}}),this.length+=this.segmentLength,this.pp=this.cp,Ie(this.stack[this.stack.length-1],this.stack[this.stack.length-2],this.minMax,this.BBox),this},q:function(t,e,r){var i=Ne(t,this.pp,{x:0,y:0}),n=Oe(e,i),o=Oe(r,i);return this.cp=o,this.segmentLength=ze.bezierLength(this.pp,n,this.cp),this.cp=o,this.stack.push({type:t?"Q":"q",p0:this.pp,cntrl1:n,cntrl2:n,p1:this.cp,relative:{cntrl1:e,p1:r},length:this.segmentLength,pointAt:function(t){return ze.bezierTransition(this.p0,this.cntrl1,this.p1,t)}}),this.length+=this.segmentLength,this.pp=this.cp,this.cntrl=n,Ie(this.stack[this.stack.length-1],this.stack[this.stack.length-2],this.minMax,this.BBox),this},s:function(t,e,r){var i=Ne(t,this.pp,{x:0,y:0}),n=Oe(e,i),o=this.cntrl?Oe(this.pp,Fe(this.pp,this.cntrl?this.cntrl:this.pp)):n,a=Oe(r,i);this.cp=a;var s=ze.cubicBezierCoefficients({p0:this.pp,cntrl1:o,cntrl2:n,p1:a});return this.segmentLength=ze.cubicBezierLength(this.pp,s),this.stack.push({type:t?"S":"s",p0:this.pp,cntrl1:o,cntrl2:n,p1:this.cp,co:s,length:this.segmentLength,relative:{cntrl2:e,p1:r},pointAt:function(t){return ze.cubicBezierTransition(this.p0,this.co,t)}}),Ie(this.stack[this.stack.length-1],this.stack[this.stack.length-2],this.minMax,this.BBox),this.length+=this.segmentLength,this.pp=this.cp,this.cntrl=n,this},c:function(t,e,r,i){var n=this,o=Ne(t,this.pp,{x:0,y:0}),a=Oe(e,o),s=Oe(r,o),h=Oe(i,o),c=ze.cubicBezierCoefficients({p0:this.pp,cntrl1:a,cntrl2:s,p1:h});return this.cntrl=s,this.cp=h,this.segmentLength=ze.cubicBezierLength(this.pp,c),this.stack.push({type:t?"C":"c",p0:this.pp,cntrl1:a,cntrl2:s,p1:this.cp,length:this.segmentLength,co:c,relative:{cntrl1:e,cntrl2:r,p1:i},pointAt:function(t){return ze.cubicBezierTransition(this.p0,this.co,t)}}),this.length+=this.segmentLength,this.pp=this.cp,Ie(n.stack[n.stack.length-1],n.stack[n.stack.length-2],n.minMax,n.BBox),this},a:function(t,e,r,i,n,o,a){var s=Ne(t,this.pp,{x:0,y:0}),h=this,c=Oe(a,s);this.cp=c;var l=ze.arcToBezier({px:this.pp.x,py:this.pp.y,cx:c.x,cy:c.y,rx:e,ry:r,xAxisRotation:i,largeArcFlag:n,sweepFlag:o});return l.forEach((function(t,e){var r=0===e?h.pp:{x:l[0].x,y:l[0].y},i={x:t.x1,y:t.y1},n={x:t.x2,y:t.y2},o={x:t.x,y:t.y},a=ze.cubicBezierLength(r,ze.cubicBezierCoefficients({p0:r,cntrl1:i,cntrl2:n,p1:o}));h.stack.push({type:"C",p0:r,cntrl1:i,cntrl2:n,p1:o,length:a,pointAt:function(t){return ze.bezierTransition(this.p0,this.cntrl1,this.cntrl2,this.p1,t)}}),h.length+=a,Ie(h.stack[h.stack.length-1],h.stack[h.stack.length-2],h.minMax,h.BBox)})),this.pp=this.cp,this.cntrl=null,this},fetchXY:function(){return{x:parseFloat(this.pathArr[this.currPathArr+=1]),y:parseFloat(this.pathArr[this.currPathArr+=1])}}},Re.prototype.points=function(t){if(void 0===this.f&&(this.f=.3),void 0===this.t&&(this.t=.6),0!==t.length){this.m(!0,{x:t[0].x,y:t[0].y});for(var e=0,r=0,i=0,n=0,o=0,a=t[0],s=1;s<t.length;s++){var h=t[s],c=t[s+1];n=0,o=0,c&&(e=(c.y-a.y)/(c.x-a.x),o=(n=(c.x-h.x)*-this.f)*e*this.t),this.c(!0,{x:a.x-r,y:a.y-i},{x:h.x+n,y:h.y+o},{x:h.x,y:h.y}),r=n,i=o,a=h}}},Re.prototype.curveFfactor=function(t){this.f=t},Re.prototype.curveTfactor=function(t){this.t=t},Re.prototype.parse=function(t){for(this.path=t,this.currPathArr=-1,this.stack=[],this.length=0,this.pathArr=function(t){var e=t.replace(/e-/g,"$");e=(e=(e=e.replace(/ /g,",")).replace(/-/g,",-")).split(/([a-zA-Z,])/g).filter((function(t){return""!==t&&","!==t})).map((function(t){return t.replace(/\$/g,"e-")}));for(var r=0;r<e.length;r+=1)if(e[r].split(".").length>2){for(var i=e[r].split("."),n=[i[0]+"."+i[1]],o=2;o<i.length;o+=1)n.push("."+i[o]);e.splice(r,1,n[0],n[1])}return e}(this.path),this.stackGroup=[];this.currPathArr<this.pathArr.length-1;)this.case(this.pathArr[this.currPathArr+=1]);return this.stack},Re.prototype.fetchPathString=function(){for(var t,e="",r=0;r<this.stack.length;r++)"M"===(t=this.stack[r]).type||"m"===t.type?e+=t.type+" "+t.p0.x+","+t.p0.y+" ":"Z"===t.type||"z"===t.type?e+="z":"C"===t.type?e+=t.type+" "+t.cntrl1.x+","+t.cntrl1.y+" "+t.cntrl2.x+","+t.cntrl2.y+" "+t.p1.x+","+t.p1.y+" ":"c"===t.type?e+=t.type+" "+t.relative.cntrl1.x+","+t.relative.cntrl1.y+" "+t.relative.cntrl2.x+","+t.relative.cntrl2.y+" "+t.relative.p1.x+","+t.relative.p1.y+" ":"Q"===t.type?e+=t.type+" "+t.cntrl1.x+","+t.cntrl1.y+" "+t.p1.x+","+t.p1.y+" ":"q"===t.type?e+=t.type+" "+t.relative.cntrl1.x+","+t.relative.cntrl1.y+" "+t.relative.p1.x+","+t.relative.p1.y+" ":"S"===t.type?e+=t.type+" "+t.cntrl2.x+","+t.cntrl2.y+" "+t.p1.x+","+t.p1.y+" ":"s"===t.type?e+=t.type+" "+t.relative.cntrl2.x+","+t.relative.cntrl2.y+" "+t.relative.p1.x+","+t.relative.p1.y+" ":"V"===t.type?e+=t.type+" "+t.p1.y+" ":"v"===t.type?e+=t.type+" "+t.relative.p1.y+" ":"H"===t.type?e+=t.type+" "+t.p1.x+" ":"h"===t.type?e+=t.type+" "+t.relative.p1.x+" ":"L"===t.type?e+=t.type+" "+t.p1.x+","+t.p1.y+" ":"l"===t.type&&(e+=t.type+" "+t.relative.p1.x+","+t.relative.p1.y+" ");return e},Re.prototype.getTotalLength=function(){return this.length},Re.prototype.getAngleAtLength=function(t,e){if(t>this.length)return null;var r=this.getPointAtLength(t),i=this.getPointAtLength(t+("src"===e?-1*t*.01:.01*t));return Math.atan2(i.y-r.y,i.x-r.x)},Re.prototype.getPointAtLength=function(t){var e={x:0,y:0},r=t;return this.stack.every((function(t,i){return r-=t.length,Math.floor(r)>=0||(e=t.pointAt((t.length+r)/(0===t.length?1:t.length)),!1)})),e},Re.prototype.execute=function(t,e){var r;e||t.beginPath();for(var i=0;i<this.stack.length;i++)switch((r=this.stack[i]).type){case"M":case"m":t.moveTo(r.p0.x,r.p0.y);break;case"Z":case"z":t.lineTo(r.p1.x,r.p1.y);break;case"L":case"l":case"V":case"v":case"H":case"h":t.lineTo(r.p1.x,r.p1.y);break;case"C":case"c":case"S":case"s":t.bezierCurveTo(r.cntrl1.x,r.cntrl1.y,r.cntrl2.x,r.cntrl2.y,r.p1.x,r.p1.y);break;case"Q":case"q":t.quadraticCurveTo(r.cntrl1.x,r.cntrl1.y,r.p1.x,r.p1.y)}e||t.closePath()},Re.prototype.getPoints=function(t){for(var e,r=[],i=0;i<this.stack.length;i++){var n=0;switch((e=this.stack[i]).type){case"M":case"m":r[r.length]=e.p0.x,r[r.length]=e.p0.y;break;case"Z":case"z":r[r.length]=e.p1.x,r[r.length]=e.p1.y;break;case"L":case"l":case"V":case"v":case"H":case"h":r[r.length]=e.p1.x,r[r.length]=e.p1.y;break;case"C":case"c":case"S":case"s":case"Q":case"q":for(;n<=1;){var o=e.pointAt(n);r[r.length]=o.x,r[r.length]=o.y,n+=.05}}}return r},Re.prototype.case=function(t){var e,r,i,n,o,a=t;switch(-1!==["m","M","v","V","l","L","h","H","q","Q","c","C","s","S","a","A","z","Z"].indexOf(a)?this.PC=a:(a=this.PC,this.currPathArr=this.currPathArr-1),a){case"m":this.m(!1,this.fetchXY());break;case"M":this.m(!0,this.fetchXY());break;case"v":this.v(!1,{x:0,y:parseFloat(this.pathArr[this.currPathArr+=1])});break;case"V":this.v(!0,{x:0,y:parseFloat(this.pathArr[this.currPathArr+=1])});break;case"l":this.l(!1,this.fetchXY());break;case"L":this.l(!0,this.fetchXY());break;case"h":this.h(!1,{x:parseFloat(this.pathArr[this.currPathArr+=1]),y:0});break;case"H":this.h(!0,{x:parseFloat(this.pathArr[this.currPathArr+=1]),y:0});break;case"q":this.q(!1,this.fetchXY(),this.fetchXY());break;case"Q":this.q(!0,this.fetchXY(),this.fetchXY());break;case"c":this.c(!1,this.fetchXY(),this.fetchXY(),this.fetchXY());break;case"C":this.c(!0,this.fetchXY(),this.fetchXY(),this.fetchXY());break;case"s":this.s(!1,this.fetchXY(),this.fetchXY());break;case"S":this.s(!0,this.fetchXY(),this.fetchXY());break;case"a":e=parseFloat(this.pathArr[this.currPathArr+=1]),r=parseFloat(this.pathArr[this.currPathArr+=1]),i=parseFloat(this.pathArr[this.currPathArr+=1]),n=parseFloat(this.pathArr[this.currPathArr+=1]),o=parseFloat(this.pathArr[this.currPathArr+=1]),this.a(!1,e,r,i,n,o,this.fetchXY());break;case"A":e=parseFloat(this.pathArr[this.currPathArr+=1]),r=parseFloat(this.pathArr[this.currPathArr+=1]),i=parseFloat(this.pathArr[this.currPathArr+=1]),n=parseFloat(this.pathArr[this.currPathArr+=1]),o=parseFloat(this.pathArr[this.currPathArr+=1]),this.a(!0,e,r,i,n,o,this.fetchXY());break;case"z":case"Z":this.z()}};var Xe=function(t,e,r,i,n,o){this.type=t,this.p0=e,this.c1_src=r,this.c2_src=i,this.co=n,this.length_src=o};Xe.prototype.execute=function(t){var e=this.co,r=this.p0,i=this.c1_src,n=this.c2_src,o={x:r.x+(i.x-r.x)*t,y:r.y+(i.y-r.y)*t},a=i.x+(n.x-i.x)*t,s=i.y+(n.y-i.y)*t;return this.cntrl1=o,this.cntrl2={x:o.x+(a-o.x)*t,y:o.y+(s-o.y)*t},this.p1={x:e.ax*ze.pow(t,3)+e.bx*ze.pow(t,2)+e.cx*t+r.x,y:e.ay*ze.pow(t,3)+e.by*ze.pow(t,2)+e.cy*t+r.y},this.length=this.length_src*t,this.relative={cntrl1:je(this.type)?this.cntrl1:Fe(this.cntrl1,this.p0),cntrl2:je(this.type)?this.cntrl2:Fe(this.cntrl2,this.p0),p1:je(this.type)?this.p1:Fe(this.p1,this.p0)},this},Xe.prototype.pointAt=function(t){return ze.cubicBezierTransition(this.p0,this.co,t)};var Ye=function(t,e,r,i,n,o){this.type=t,this.p0=e,this.p1_src=r,this.p2_src=i,this.length_src=n,this.length=0};Ye.prototype.execute=function(t){var e=this.p0,r=this.p1_src,i=this.p2_src;return this.length=this.length_src*t,this.cntrl1={x:e.x+(r.x-e.x)*t,y:e.y+(r.y-e.y)*t},this.cntrl2=this.cntrl1,this.p1={x:(e.x-2*r.x+i.x)*t*t+(2*r.x-2*e.x)*t+e.x,y:(e.y-2*r.y+i.y)*t*t+(2*r.y-2*e.y)*t+e.y},this.relative={cntrl1:je(this.type)?this.cntrl1:Fe(this.cntrl1,this.p0),p1:je(this.type)?this.p1:Fe(this.p1,this.p0)},this},Ye.prototype.pointAt=function(t){return ze.bezierTransition(this.p0,this.cntrl1,this.p1,t)};var Ge=function(t,e,r,i,n){this.type=t,this.p0=e,this.p1=e,this.p2_src=r,this.length_src=i,this.length=0};function Ue(t){return t instanceof Re}Ge.prototype.execute=function(t){var e=this.p0,r=this.p2_src;return this.p1={x:e.x+(r.x-e.x)*t,y:e.y+(r.y-e.y)*t},this.length=this.length_src*t,this.relative={p1:je(this.type)?this.p1:Fe(this.p1,this.p0)},this},Ge.prototype.pointAt=function(t){return ze.linearTransitionBetweenPoints(this.p0,this.p1,t)};var qe={instance:function(t){return new Re(t)},isTypePath:Ue,animatePathTo:function(t){var e=this,r=t.duration,i=t.ease,n=t.end,o=t.loop,a=t.direction,s=t.d||e.attr.d,h=0;if(e.arrayStack=[],!s)throw Error("Path Not defined");for(var c=yt.sequenceChain(),l=Ue(s)?s:new Re(s),u=l.stackGroup.reduce((function(t,e){return t=t.concat(e)}),[]),f=[],d=function(t){if("Z"===u[t].type||"z"===u[t].type)f.push({run:function(t){l.stack.length=this.id+1,l.stack[this.id]=this.render.execute(t),e.setAttr("d",l)},target:e,id:t,render:new Ge(u[t].type,u[t].p0,u[0].p0,u[t].segmentLength),length:u[t].length}),h+=0;else if(-1!==["V","v","H","h","L","l"].indexOf(u[t].type))f.push({run:function(t){l.stack.length=this.id+1,l.stack[this.id]=this.render.execute(t),e.setAttr("d",l)},target:e,id:t,render:new Ge(u[t].type,u[t].p0,u[t].p1,u[t].length),length:u[t].length}),h+=u[t].length;else if("Q"===u[t].type||"q"===u[t].type)f.push({run:function(t){l.stack.length=this.id+1,l.stack[this.id]=this.render.execute(t),e.setAttr("d",l)},target:e,id:t,render:new Ye(u[t].type,u[t].p0,u[t].cntrl1,u[t].p1,u[t].length),length:u[t].length}),h+=u[t].length;else if("C"===u[t].type||"S"===u[t].type||"c"===u[t].type||"s"===u[t].type){var r=ze.cubicBezierCoefficients(u[t]);f.push({run:function(t){l.stack.length=this.id+1,l.stack[this.id]=this.render.execute(t),e.setAttr("d",l)},target:e,id:t,co:r,render:new Xe(u[t].type,u[t].p0,u[t].cntrl1,u[t].cntrl2,r,u[t].length),length:u[t].length}),h+=u[t].length}else"M"!==u[t].type&&"m"!==u[t].type||(f.push({run:function(){l.stack.length=this.id+1,l.stack[this.id]={type:"M",p0:u[t].p0,length:0,pointAt:function(t){return this.p0}}},target:e,id:t,length:0}),h+=0)},p=0;p<u.length;p+=1)d(p);return f.forEach((function(t){t.duration=t.length/h*r})),c.add(f).ease(i).loop(o||0).direction(a||"default"),"function"==typeof n&&c.end(n.bind(e)),c.commit(),this},morphTo:function(t){var e=this,r=t.duration,i=t.ease,n=t.loop?t.loop:0,o=t.direction?t.direction:"default",a=t.attr.d?t.attr.d:e.attr.d,s=Kt(Ue(e.attr.d)?e.attr.d.fetchPathString():e.attr.d,Ue(a)?a.fetchPathString():a,{maxSegmentLength:25});Pe.add("morph_"+(_e+=1),{run:function(t){e.setAttr("d",s(t))},target:e,duration:r,loop:n,direction:o},Le(i))}},He={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",DarkGrey:"a9a9a9",DarkGreen:"006400",DarkKhaki:"bdb76b",DarkMagenta:"8b008b",DarkOliveGreen:"556b2f",DarkOrange:"ff8c00",DarkOrchid:"9932cc",DarkRed:"8b0000",DarkSalmon:"e9967a",DarkSeaGreen:"8fbc8f",DarkSlateBlue:"483d8b",DarkSlateGray:"2f4f4f",DarkSlateGrey:"2f4f4f",DarkTurquoise:"00ced1",DarkViolet:"9400d3",DeepPink:"ff1493",DeepSkyBlue:"00bfff",DimGray:"696969",DimGrey:"696969",DodgerBlue:"1e90ff",FireBrick:"b22222",FloralWhite:"fffaf0",ForestGreen:"228b22",Fuchsia:"ff00ff",Gainsboro:"dcdcdc",GhostWhite:"f8f8ff",Gold:"ffd700",GoldenRod:"daa520",Gray:"808080",Grey:"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",LightGray:"d3d3d3",LightGrey:"d3d3d3",LightGreen:"90ee90",LightPink:"ffb6c1",LightSalmon:"ffa07a",LightSeaGreen:"20b2aa",LightSkyBlue:"87cefa",LightSlateGray:"778899",LightSlateGrey:"778899",LightSteelBlue:"b0c4de",LightYellow:"ffffe0",Lime:"00ff00",LimeGreen:"32cd32",Linen:"faf0e6",Magenta:"ff00ff",Maroon:"800000",MediumAquaMarine:"66cdaa",MediumBlue:"0000cd",MediumOrchid:"ba55d3",MediumPurple:"9370db",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:"db7093",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",SlateGrey:"708090",Snow:"fffafa",SpringGreen:"00ff7f",SteelBlue:"4682b4",Tan:"d2b48c",Teal:"008080",Thistle:"d8bfd8",Tomato:"ff6347",Turquoise:"40e0d0",Violet:"ee82ee",Wheat:"f5deb3",White:"ffffff",WhiteSmoke:"f5f5f5",Yellow:"ffff00",YellowGreen:"9acd32"},Ve=Math.round,Ze="rgba(0,0,0,0)";function We(t,e,r,i){this.r=t,this.g=e,this.b=r,this.a=void 0===i?255:i,this.rgba="rgba("+t+","+e+","+r+","+i+")"}function Qe(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,r,i){return e+e+r+r+i+i}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return new We(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),255)}function $e(t){var e,r,i,n,o,a,s,h=t.replace(/[^0-9.,]+/g,"").split(",").map((function(t){return parseFloat(t)}));if(o=h[0]/360,a=h[1]/100,s=h[2]/100,n=h[3],0===a)e=r=i=s;else{var c=function(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t},l=s<.5?s*(1+a):s+a-s*a,u=2*s-l;e=255*c(u,l,o+1/3),r=255*c(u,l,o),i=255*c(u,l,o-1/3)}return new We(e,r,i,n)}function Je(t){return t instanceof We?t:t.startsWith("#")?Qe(t):t.startsWith("rgb")?function(t){for(var e=t.replace(/[^0-9.,]+/g,"").split(","),r={},i=["r","g","b","a"],n=0;n<e.length;n+=1)r[i[n]]=parseFloat(e[n]);return new We(r.r,r.g,r.b,r.a)}(t):t.startsWith("hsl")?$e(t):{r:0,g:0,b:0,a:255}}We.prototype.normalize=function(){return this.normalFlag||(this.r/=255,this.g/=255,this.b/=255,this.a/=255,this.normalFlag=!0),this};var Ke,tr={nameToHex:function(t){return He[t]?"#"+He[t]:"#000"},hexToRgb:Qe,rgbToHex:function(t){var e=t.substring(t.lastIndexOf("(")+1,t.lastIndexOf(")")).split(",");return"#"+((1<<24)+(parseInt(e[0],10)<<16)+(parseInt(e[1],10)<<8)+parseInt(e[2],10)).toString(16).slice(1)},hslToRgb:$e,transition:function(t,e){return e=e||Ze,t=Je(t=t||Ze),e=Je(e),function(r){return new We(Ve(t.r+(e.r-t.r)*r),Ve(t.g+(e.g-t.g)*r),Ve(t.b+(e.b-t.b)*r),Ve(t.a+(e.a-t.a)*r))}},colorToRGB:Je,rgba:function(t,e,r,i){return new We(t,e,r,i)},isTypeColor:function(t){return t instanceof We||t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")},RGBAInstanceCheck:function(t){return t instanceof We}};function er(t){this.vDom=t,this.disable=!1,this.dragNode=null,this.touchNode=null,this.wheelNode=null,this.pointers=[]}function rr(t,e,r){if(t.dom.parent)return t.dom.parent.events[e]&&t.dom.parent.events[e](t.dom.parent,r),rr(t.dom.parent,e,r)}er.prototype.getNode=function(t){},er.prototype.addPointer=function(t){this.pointers.push(t)},er.prototype.removePointer=function(t){for(var e=this,r=this.pointers,i=-1,n=0;n<r.length;n++)if(t.pointerId===r[n].pointerId){i=n;break}-1!==i&&(e.pointers=[],e.distance=0,this.pointerNode&&this.pointerNode.node.events.zoom&&this.pointerNode.node.events.zoom.onZoomEnd(this.pointerNode.node,t,e))},er.prototype.clickCheck=function(t){or([this.vDom],{x:t.offsetX,y:t.offsetY},t,"click")},er.prototype.dblclickCheck=function(t){or([this.vDom],{x:t.offsetX,y:t.offsetY},t,"dblclick")},er.prototype.pointerdownCheck=function(t){var e=or([this.vDom],{x:t.offsetX,y:t.offsetY},t,"pointerdown");!e||this.pointerNode&&this.pointerNode.node===e?this.pointerNode&&(this.pointerNode.clickCounter+=1):this.pointerNode={node:e,clickCounter:1,dragCounter:0},e&&(e.events.zoom||e.events.drag)?(e.events.zoom&&e.events.zoom.panFlag&&e.events.zoom.panExecute(e,t,"pointerdown",this),e.events.drag&&e.events.drag.execute(e,t,"pointerdown",this)):e&&"touch"===t.pointerType&&e.events.mouseover.call(e,t)},er.prototype.pointermoveCheck=function(t){var e=this,r=this.pointerNode?this.pointerNode.node:null;r?(this.pointerNode.dragCounter+=1,r.events.zoom&&(r.events.zoom.panFlag&&r.events.zoom.panExecute(r,t,"pointermove",e),r.events.zoom.zoomPinch(r,t,e)),r.events.drag&&r.events.drag.execute(r,t,"pointermove",e),r.events.mousemove&&r.events.mousemove.call(r,t)):r&&"touch"===t.pointerType&&r.events.mousemove.call(r,t),t.preventDefault()},er.prototype.pointerupCheck=function(t){var e=this,r=this.pointerNode?this.pointerNode.node:null;r&&(r.events.drag&&r.events.drag.execute(r,t,"pointerup",e),r.events.zoom&&r.events.zoom.panFlag&&r.events.zoom.panExecute(r,t,"pointerup",e),this.pointerNode.dragCounter<=2||"touch"===t.pointerType&&this.pointerNode.dragCounter<=5?(r.events.click&&r.events.click.call(r,t),rr(r,"click",t),2===this.pointerNode.clickCounter&&(r.events.dblclick&&r.events.dblclick.call(r,t),rr(r,"dblclick",t)),Ke&&clearTimeout(Ke),Ke=setTimeout((function(){e.pointerNode=null,Ke=null}),200)):this.pointerNode=null,"touch"===t.pointerType&&r.events.mouseup.call(r,t))},er.prototype.mousedownCheck=function(t){or([this.vDom],{x:t.offsetX,y:t.offsetY},t,"mousedown")},er.prototype.mousemoveCheck=function(t){var e=or([this.vDom],{x:t.offsetX,y:t.offsetY},t,"mousemove");this.selectedNode&&this.selectedNode!==e&&(this.selectedNode.events.mouseout&&this.selectedNode.events.mouseout.call(this.selectedNode,t),this.selectedNode.events.mouseleave&&this.selectedNode.events.mouseleave.call(this.selectedNode,t)),e&&(e.events.mouseover||e.events.mousein)&&this.selectedNode!==e&&(e.events.mouseover&&e.events.mouseover.call(e,t),e.events.mousein&&e.events.mousein.call(e,t)),this.selectedNode=e,t.preventDefault()},er.prototype.mouseupCheck=function(t){or([this.vDom],{x:t.offsetX,y:t.offsetY},t,"mouseup")},er.prototype.mouseleaveCheck=function(t){or([this.vDom],{x:t.offsetX,y:t.offsetY},t,"mouseleave")},er.prototype.contextmenuCheck=function(t){or([this.vDom],{x:t.offsetX,y:t.offsetY},t,"contextmenu")},er.prototype.touchstartCheck=function(t){or([this.vDom],{x:t.offsetX,y:t.offsetY},t,"touchstart")},er.prototype.touchendCheck=function(t){or([this.vDom],{x:t.offsetX,y:t.offsetY},t,"touchend")},er.prototype.touchmoveCheck=function(t){var e=t.touches;0!==e.length&&or([this.vDom],{x:e[0].clientX,y:e[0].clientY},t,"touchmove")},er.prototype.touchcancelCheck=function(t){or([this.vDom],{x:t.x,y:t.y},t,"touchcacel")};var ir=0,nr=0;function or(t,e,r,i){for(var n,o,a=t.length-1;a>=0;a-=1){var s=t[a],h={x:e.x,y:e.y};if(s.bbox&&(ar(s,h),s.in({x:h.x,y:h.y})&&(s.children&&s.children.length>0?(o=or(s.children,{x:h.x,y:h.y},r,i))&&(n=o):n=s,s.events[i]&&"function"==typeof s.events[i]&&s.events[i](r),n)))break}return n||"rootNode"!==s.attr.id||(n=s,s.events[i]&&"function"==typeof s.events[i]&&s.events[i](r)),n}function ar(t,e){var r,i=0,n=0,o=1,a=1,s=e;if(t.attr.transform&&t.attr.transform.translate&&(i=(r=t.attr.transform.translate)[0],n=r[1],s.x-=i,s.y-=n),t.attr.transform&&t.attr.transform.scale&&(o=void 0!==t.attr.transform.scale[0]?t.attr.transform.scale[0]:1,a=void 0!==t.attr.transform.scale[1]?t.attr.transform.scale[1]:o,s.x/=o,s.y/=a),t.attr.transform&&t.attr.transform.rotate){var h=t.attr.transform.rotate[0],c={x:t.attr.transform.rotate[1],y:t.attr.transform.rotate[2]},l=s.x,u=s.y,f=c.x,d=c.y,p=Math.PI/180*h,y=Math.cos(p),x=Math.sin(p);s.x=y*(l-f)+x*(u-d)+f,s.y=y*(u-d)-x*(l-f)+d}}er.prototype.wheelEventCheck=function(t){var e=this;if(this.wheelNode)this.wheelNode.events.zoom.zoomExecute(this.wheelNode,t,e),ir+=1,this.wheelHndl&&(clearTimeout(this.wheelHndl),this.wheelHndl=null,nr=ir),this.wheelHndl=setTimeout((function(){nr!==ir?nr=ir:(e.wheelHndl=null,e.wheelNode.events.zoom.onZoomEnd(e.wheelNode,t,e),e.wheelNode=null,ir=0)}),100);else{var r=or([this.vDom],{x:t.offsetX,y:t.offsetY},t,"wheel");(r=r||this.vDom)&&r.events.zoom&&(r.events.zoom.disableWheel||(r.events.zoom.zoomExecute(r,t,e),this.wheelNode=r))}};var sr,hr=[],cr="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(sr||(sr={}));var lr,ur=function(t){return Object.freeze(t)},fr=function(t,e){this.inlineSize=t,this.blockSize=e,ur(this)},dr=function(){function t(t,e,r,i){return this.x=t,this.y=e,this.width=r,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,ur(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),pr=function(t){return t instanceof SVGElement&&"getBBox"in t},yr=function(t){if(pr(t)){var e=t.getBBox(),r=e.width,i=e.height;return!r&&!i}var n=t,o=n.offsetWidth,a=n.offsetHeight;return!(o||a||t.getClientRects().length)},xr=function(t){var e,r;if(t instanceof Element)return!0;var i=null===(r=null===(e=t)||void 0===e?void 0:e.ownerDocument)||void 0===r?void 0:r.defaultView;return!!(i&&t instanceof i.Element)},vr="undefined"!=typeof window?window:{},gr=new WeakMap,mr=/auto|scroll/,wr=/^tb|vertical/,br=/msie|trident/i.test(vr.navigator&&vr.navigator.userAgent),Ar=function(t){return parseFloat(t||"0")},Br=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new fr((r?e:t)||0,(r?t:e)||0)},Tr=ur({devicePixelContentBoxSize:Br(),borderBoxSize:Br(),contentBoxSize:Br(),contentRect:new dr(0,0,0,0)}),kr=function(t,e){if(void 0===e&&(e=!1),gr.has(t)&&!e)return gr.get(t);if(yr(t))return gr.set(t,Tr),Tr;var r=getComputedStyle(t),i=pr(t)&&t.ownerSVGElement&&t.getBBox(),n=!br&&"border-box"===r.boxSizing,o=wr.test(r.writingMode||""),a=!i&&mr.test(r.overflowY||""),s=!i&&mr.test(r.overflowX||""),h=i?0:Ar(r.paddingTop),c=i?0:Ar(r.paddingRight),l=i?0:Ar(r.paddingBottom),u=i?0:Ar(r.paddingLeft),f=i?0:Ar(r.borderTopWidth),d=i?0:Ar(r.borderRightWidth),p=i?0:Ar(r.borderBottomWidth),y=u+c,x=h+l,v=(i?0:Ar(r.borderLeftWidth))+d,g=f+p,m=s?t.offsetHeight-g-t.clientHeight:0,w=a?t.offsetWidth-v-t.clientWidth:0,b=n?y+v:0,A=n?x+g:0,B=i?i.width:Ar(r.width)-b-w,T=i?i.height:Ar(r.height)-A-m,k=B+y+w+v,S=T+x+m+g,E=ur({devicePixelContentBoxSize:Br(Math.round(B*devicePixelRatio),Math.round(T*devicePixelRatio),o),borderBoxSize:Br(k,S,o),contentBoxSize:Br(B,T,o),contentRect:new dr(u,h,B,T)});return gr.set(t,E),E},Sr=function(t,e,r){var i=kr(t,r),n=i.borderBoxSize,o=i.contentBoxSize,a=i.devicePixelContentBoxSize;switch(e){case sr.DEVICE_PIXEL_CONTENT_BOX:return a;case sr.BORDER_BOX:return n;default:return o}},Er=function(t){var e=kr(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=ur([e.borderBoxSize]),this.contentBoxSize=ur([e.contentBoxSize]),this.devicePixelContentBoxSize=ur([e.devicePixelContentBoxSize])},Mr=function(t){if(yr(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},Cr=function(){var t=1/0,e=[];hr.forEach((function(r){if(0!==r.activeTargets.length){var i=[];r.activeTargets.forEach((function(e){var r=new Er(e.target),n=Mr(e.target);i.push(r),e.lastReportedSize=Sr(e.target,e.observedBox),n<t&&(t=n)})),e.push((function(){r.callback.call(r.observer,i,r.observer)})),r.activeTargets.splice(0,r.activeTargets.length)}}));for(var r=0,i=e;r<i.length;r++){(0,i[r])()}return t},Dr=function(t){hr.forEach((function(e){e.activeTargets.splice(0,e.activeTargets.length),e.skippedTargets.splice(0,e.skippedTargets.length),e.observationTargets.forEach((function(r){r.isActive()&&(Mr(r.target)>t?e.activeTargets.push(r):e.skippedTargets.push(r))}))}))},_r=function(){var t=0;for(Dr(t);hr.some((function(t){return t.activeTargets.length>0}));)t=Cr(),Dr(t);return hr.some((function(t){return t.skippedTargets.length>0}))&&function(){var t;"function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:cr}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=cr),window.dispatchEvent(t)}(),t>0},zr=[],Pr=function(t){if(!lr){var e=0,r=document.createTextNode("");new MutationObserver((function(){return zr.splice(0).forEach((function(t){return t()}))})).observe(r,{characterData:!0}),lr=function(){r.textContent=""+(e?e--:e++)}}zr.push(t),lr()},Lr=0,Ir={attributes:!0,characterData:!0,childList:!0,subtree:!0},Or=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Fr=function(t){return void 0===t&&(t=0),Date.now()+t},Nr=!1,Rr=new(function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!Nr){Nr=!0;var r,i=Fr(t);r=function(){var r=!1;try{r=_r()}finally{if(Nr=!1,t=i-Fr(),!Lr)return;r?e.run(1e3):t>0?e.run(t):e.start()}},Pr((function(){requestAnimationFrame(r)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,Ir)};document.body?e():vr.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Or.forEach((function(e){return vr.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Or.forEach((function(e){return vr.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}()),jr=function(t){!Lr&&t>0&&Rr.start(),!(Lr+=t)&&Rr.stop()},Xr=function(){function t(t,e){this.target=t,this.observedBox=e||sr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=Sr(this.target,this.observedBox,!0);return t=this.target,pr(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),Yr=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Gr=new WeakMap,Ur=function(t,e){for(var r=0;r<t.length;r+=1)if(t[r].target===e)return r;return-1},qr=function(){function t(){}return t.connect=function(t,e){var r=new Yr(t,e);Gr.set(t,r)},t.observe=function(t,e,r){var i=Gr.get(t),n=0===i.observationTargets.length;Ur(i.observationTargets,e)<0&&(n&&hr.push(i),i.observationTargets.push(new Xr(e,r&&r.box)),jr(1),Rr.schedule())},t.unobserve=function(t,e){var r=Gr.get(t),i=Ur(r.observationTargets,e),n=1===r.observationTargets.length;i>=0&&(n&&hr.splice(hr.indexOf(r),1),r.observationTargets.splice(i,1),jr(-1))},t.disconnect=function(t){var e=this,r=Gr.get(t);r.observationTargets.slice().forEach((function(r){return e.unobserve(t,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},t}(),Hr=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");qr.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!xr(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");qr.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!xr(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");qr.unobserve(this,t)},t.prototype.disconnect=function(){qr.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}(),Vr=0,Zr=N,Wr=J,Qr=x,$r=window.ResizeObserver||Hr;var Jr=function(t,e,r){var i=[],n=t.attr.transform;return"function"==typeof r?function(i){t[e](r.call(t,i))}:(r.forEach((function(t,r){var o;o=n[e]&&void 0!==n[e][r]?n[e][r]:"scale"===e?1:0,i.push(Zr.intermediateValue.bind(null,o,t))})),function(r){t[e](i.map((function(t){return t(r)})))})},Kr=function(t,e,r){var i,n,o;if("function"==typeof r)return function(i){t.setStyle(e,r.call(t,t.dataObj,i))};if(i=t.style[e],isNaN(r)){if(tr.isTypeColor(r)){var a=tr.transition(i,r);return function(r){t.setStyle(e,a(r))}}i=i.match(/(\d+)/g),o=r.match(/(\d+)/g),n=r.match(/\D+$/),i=parseInt(i.length>0?i[0]:0,10),o=parseInt(o.length>0?o[0]:0,10),n=n.length>0?n[0]:"px"}else i=void 0!==t.style[e]?t.style[e]:1,o=r,n=0;return function(r){t.setStyle(e,Zr.intermediateValue(i,o,r)+n)}},ti=function(t,e){var r,i=e.attr?e.attr:{},n=e.style?e.style:{},o=[];if("function"!=typeof i){var a=function(n){if("transform"!==n){var a=i[n];"function"==typeof a?o[o.length]=function(e){t.setAttr(n,a.call(t,e))}:"d"===n?t.morphTo(e):o[o.length]=function(t,e,r){var i=t.attr[e];return function(n){t.setAttr(e,Zr.intermediateValue(i,r,n))}}(t,n,i[n])}else if("function"==typeof(r=i[n]))o[o.length]=function(t,e,r){return function(i){t.setAttr(e,r.call(t,i))}}(t,n,r);else{t.attr.transform||(t.attr.transform={});for(var s=Object.keys(i.transform),h=0,c=s.length;h<c;h+=1)o[o.length]=Jr(t,s[h],i.transform[s[h]])}};for(var s in i)a(s)}else o[o.length]=i.bind(t);if("function"!=typeof n)for(var h in n)o[o.length]=Kr(t,h,n[h]);else o[o.length]=n.bind(t);return{run:function(t){for(var e=0,r=o.length;e<r;e+=1)o[e](t)},target:t,duration:e.duration,delay:e.delay?e.delay:0,end:e.end?e.end.bind(t,t.dataObj):null,loop:e.loop?e.loop:0,direction:e.direction?e.direction:"default",ease:e.ease?e.ease:"default"}};function ei(t,e,r){for(var i=t.map(r),n={new:[],update:[],old:[]},o=0;o<e.length;o+=1){var a=i.indexOf(r(e[o].dataObj,o));-1!==a?(e[o].dataObj=t[a],n.update.push(e[o]),i[a]=null):n.old.push(e[o])}return n.new=t.filter((function(t,e){var n=i.indexOf(r(t,e));return-1!==n&&(i[n]=null,!0)})),n}var ri={};ri.push={value:function(t){"[object Array]"!==Object.prototype.toString.call(t)&&(t=[t]);for(var e=0,r=t.length;e<r;e++)this.data.push(t[e]);if(this.config.action.enter){var i={};this.selector.split(",").forEach((function(e){i[e]=t})),this.config.action.enter.call(this,i)}},enumerable:!1,configurable:!1,writable:!1},ri.pop={value:function(){var t=this,e=this.data.pop();if(this.config.action.exit){var r={};this.selector.split(",").forEach((function(i){r[i]=t.fetchEls(i,[e])})),this.config.action.exit.call(this,r)}},enumerable:!1,configurable:!1,writable:!1},ri.remove={value:function(t){"[object Array]"!==Object.prototype.toString.call(t)&&(t=[t]);for(var e=this,r=0,i=t.length;r<i;r++)-1!==this.data.indexOf(t[r])&&this.data.splice(this.data.indexOf(t[r]),1);if(this.config.action.exit){var n={};this.selector.split(",").forEach((function(r){n[r]=e.fetchEls(r,t)})),this.config.action.exit.call(this,n)}},enumerable:!1,configurable:!0,writable:!1},ri.update={value:function(){var t=this;if(this.config.action.update){var e={};this.selector.split(",").forEach((function(r){e[r]=t.fetchEls(r,t.data)})),this.config.action.update.call(this,e)}},enumerable:!1,configurable:!0,writable:!1},ri.join={value:function(t){this.data=t,ni.call(this,t,this.selector,this.config)},enumerable:!1,configurable:!0,writable:!1};var ii=function(){};function ni(t,e,r){var i=this,n=e.split(","),o=r.joinOn,a={new:{},update:{},old:{}};o||(o=function(t,e){return e});for(var s=0,h=n.length;s<h;s++){var c=n[s],l=ei(t,i.fetchEls(c).stack,o);a.new[c]=l.new,a.update[c]=(new ai).wrapper(l.update),a.old[c]=(new ai).wrapper(l.old)}return r.action&&(r.action.enter&&r.action.enter.call(i,a.new),r.action.exit&&r.action.exit.call(i,a.old),r.action.update&&r.action.update.call(i,a.update)),ri.config={value:r,enumerable:!1,configurable:!0,writable:!0},ri.selector={value:e,enumerable:!1,configurable:!0,writable:!1},ri.data={value:t,enumerable:!1,configurable:!0,writable:!0},Object.create(i,ri)}function oi(t,e,r){var i,n={};for(i in t)"end"!==i&&("function"==typeof t[i]?n[i]=t[i].call(e,e.dataObj,r):n[i]=t[i]);return n}ii.prototype.getAttr=function(t){return this.attr[t]},ii.prototype.getStyle=function(t){return this.style[t]},ii.prototype.exec=function(t){return"function"!=typeof t&&console.error("Wrong Exe type"),t.call(this,this.dataObj),this},ii.prototype.fetchEls=function(t,e){var r=[],i=new ai;if(this.children.length>0)if("."===t.charAt(0)){var n=t.substring(1,t.length);this.children.forEach((function(t){if(t){var i=e&&t.dataObj&&-1!==e.indexOf(t.dataObj)&&t.attr.class===n,o=!e&&t.attr.class===n;(i||o)&&r.push(t)}}))}else if("#"===t.charAt(0)){var o=t.substring(1,t.length);this.children.every((function(t){if(t){var i=e&&t.dataObj&&-1!==e.indexOf(t.dataObj)&&t.attr.id===o,n=!e&&t.attr.id===o;return!i&&!n||(r.push(t),!1)}}))}else t="group"===t?"g":t,this.children.forEach((function(i){if(i){var n=e&&i.dataObj&&-1!==e.indexOf(i.dataObj)&&i.nodeName===t,o=!e&&i.nodeName===t;(n||o)&&r.push(i)}}));return i.wrapper(r)},ii.prototype.fetchEl=function(t,e){var r;if(this.children.length>0)if("."===t.charAt(0)){var i=t.substring(1,t.length);this.children.every((function(t){if(t){var n=e&&t.dataObj&&e===t.dataObj&&t.attr.class===i,o=!e&&t.attr.class===i;return!n&&!o||(r=t,!1)}}))}else if("#"===t.charAt(0)){var n=t.substring(1,t.length);this.children.every((function(t){if(t){var i=e&&t.dataObj&&e===t.dataObj&&t.attr.id===n,o=!e&&t.attr.id===n;return!i&&!o||(r=t,!1)}}))}else t="group"===t?"g":t,this.children.forEach((function(i){if(i){var n=e&&i.dataObj&&e===i.dataObj&&i.nodeName===t,o=!e&&i.nodeName===t;(n||o)&&(r=i)}}));return r},ii.prototype.join=ni,ii.prototype.data=function(t){return t?(this.dataObj=t,this):this.dataObj},ii.prototype.interrupt=function(){if(this.animList&&this.animList.length>0)for(var t=this.animList.length-1;t>=0;t--)Qr.remove(this.animList[t]);return this.animList=[],this},ii.prototype.animateTo=function(t){return Qr.add(Vr+=1,ti(this,t),Wr(t.ease)),this},ii.prototype.animateExe=function(t){return ti(this,t)};function ai(t,e,r,i){var n,o,a=this;e||(e=[]);var s=r&&r.attr?Object.keys(r.attr):[],h=r&&r.style?Object.keys(r.style):[],c=!r||(void 0===r.bbox||r.bbox);return this.stack=e.map((function(e,l){for(var u,f=a.createNode(t.ctx,{el:r.el,bbox:c},i),d=0,p=h.length;d<p;d+=1)if(o=h[d],"function"==typeof r.style[o]){var y=r.style[o].call(f,e,l);f.setStyle(o,y)}else f.setStyle(o,r.style[o]);for(var x=0,v=s.length;x<v;x+=1)if("transform"!==(o=s[x]))if("function"==typeof r.attr[o]){var g=r.attr[o].call(f,e,l);f.setAttr(o,g)}else f.setAttr(o,r.attr[o]);else for(var m in"function"==typeof r.attr.transform?n=r.attr[o].call(f,e,l):(u=r.attr,n=u.transform),n)f[m](n[m]);return f.dataObj=e,f})),this}ai.prototype={createEls:function(t,e){for(var r,i=[],n=t,o=0,a=this.stack.length;o<a;o+=1){var s={};if(r=this.stack[o],"function"==typeof t&&(n=t.call(r,r.dataObj,o)),"function"==typeof e)s=e.call(r,r.dataObj,o);else for(var h=Object.keys(e),c=0,l=h.length;c<l;c+=1){var u=h[c];s[u]=e[u]}i.push(r.createEls(n,s))}var f=new ai;return f.wrapper(i),f},createEl:function(t){for(var e,r=[],i=0,n=this.stack.length;i<n;i+=1){var o={};if(e=this.stack[i],"function"==typeof t)o=t.call(e,e.dataObj,i);else for(var a=Object.keys(t),s=0,h=a.length;s<h;s+=1){var c=a[s];"object"!=typeof t[c]?o[c]=t[c]:o[c]=JSON.parse(JSON.stringify(t[c]))}r.push(e.createEl(o))}var l=new ai;return l.wrapper(r),l},forEach:function(t){for(var e=0,r=this.stack.length;e<r;e+=1)t.call(this.stack[e],this.stack[e].dataObj,e);return this},setAttr:function(t,e){for(var r,i=arguments,n=0,o=this.stack.length;n<o;n+=1)if(r=this.stack[n],i.length>1)"function"==typeof e?r.setAttr(t,e.call(r,r.dataObj,n)):r.setAttr(t,e);else if("function"==typeof t)r.setAttr(t.call(r,r.dataObj,n));else for(var a=Object.keys(t),s=0,h=a.length;s<h;s+=1){var c=a[s];"function"==typeof t[c]?r.setAttr(c,t[c].call(r,r.dataObj,n)):r.setAttr(c,t[c])}return this},fetchEls:function(t,e){for(var r,i=[],n=0;n<this.stack.length;n+=1)r=this.stack[n],i.push(r.fetchEls(t,e));var o=new ai;return o.wrapper(i),o},setStyle:function(t,e){for(var r,i=arguments,n=0,o=this.stack.length;n<o;n+=1)if(r=this.stack[n],i.length>1)"function"==typeof e?r.setStyle(t,e.call(r,r.dataObj,n)):r.setStyle(t,e);else{if("function"==typeof t)r.setStyle(t.call(r,r.dataObj,n));else for(var a=Object.keys(t),s=0,h=a.length;s<h;s+=1){var c=a[s];"function"==typeof t[c]?r.setStyle(c,t[c].call(r,r.dataObj,n)):r.setStyle(c,t[c])}"function"==typeof t?r.setStyle(t.call(r,r.dataObj,n)):r.setStyle(t)}return this},translate:function(t){for(var e,r=0,i=this.stack.length;r<i;r+=1)e=this.stack[r],"function"==typeof t?e.translate(t.call(e,e.dataObj,r)):e.translate(t);return this},rotate:function(t){for(var e,r=0,i=this.stack.length;r<i;r+=1)e=this.stack[r],"function"==typeof t?e.rotate(t.call(e,e.dataObj,r)):e.rotate(t);return this},scale:function(t){for(var e,r=0,i=this.stack.length;r<i;r+=1)e=this.stack[r],"function"==typeof t?e.scale(t.call(e,e.dataObj,r)):e.scale(t);return this},exec:function(t){var e;if("function"==typeof t){for(var r=0,i=this.stack.length;r<i;r+=1)e=this.stack[r],t.call(e,e.dataObj,r);return this}},animateTo:function(t){for(var e,r,i=0;i<this.stack.length;i+=1)r={},r=oi(t,e=this.stack[i],i),t.attr&&"function"!=typeof t.attr&&(r.attr=oi(t.attr,e,i)),t.style&&"function"!=typeof t.style&&(r.style=oi(t.style,e,i)),t.end&&(r.end=t.end),t.ease&&(r.ease=t.ease),e.animateTo(r);return this},animateExe:function(t){for(var e,r,i=[],n=0;n<this.stack.length;n+=1)r={},r=oi(t,e=this.stack[n],n),t.attr&&"function"!=typeof t.attr&&(r.attr=oi(t.attr,e,n)),t.style&&"function"!=typeof t.style&&(r.style=oi(t.style,e,n)),t.end&&(r.end=t.end),t.ease&&(r.ease=t.ease),i.push(e.animateExe(r));return i},animatePathTo:function(t){for(var e,r=Object.keys(t),i=0,n=this.stack.length;i<n;i+=1){e=this.stack[i];for(var o={},a=0;a<r.length;a++){var s=t[r[a]];"function"==typeof s&&(s=s.call(e,e.dataObj,i)),o[r[a]]=s}e.animatePathTo(o)}return this},remove:function(){for(var t=0,e=this.stack.length;t<e;t+=1)this.stack[t].remove();return this},interrupt:function(){for(var t=0,e=this.stack.length;t<e;t+=1)this.stack[t].interrupt();return this},text:function(t){var e;if("function"!=typeof t)for(var r=0;r<this.stack.length;r+=1)(e=this.stack[r]).text(t);else for(var i=0;i<this.stack.length;i+=1)(e=this.stack[i]).text(t.call(e,e.dataObj,i));return this},join:function(t,e,r){for(var i,n=[],o=0;o<this.stack.length;o+=1)i=this.stack[o],n.push(i.join(t,e,r));var a=new ai;return a.wrapper(n),a},on:function(t,e){for(var r=0,i=this.stack.length;r<i;r+=1)this.stack[r].on(t,e);return this}},ai.prototype.createNode=function(){},ai.prototype.wrapper=function(t){if(t)for(var e=0,r=t.length;e<r;e++){var i=t[e];this.stack.push(i)}return this};var si=function(t){var e=function(e){var r=t[e],i=r.contentRect;r.target.resizeHandler&&r.target.resizeHandler.forEach((function(t){t(i)}))};for(var r in t)e(r)};function hi(t,e){t.ro||(t.ro=new $r(si),t.ro.observe(t.container)),t.container.resizeHandler||(t.container.resizeHandler=[]),t.container.resizeHandler.push(e)}function ci(t,e){if(t.container.resizeHandler){var r=t.container.resizeHandler.indexOf(e);-1!==r&&t.container.resizeHandler.splice(r,1),0===t.container.resizeHandler.length&&t.ro&&t.ro.disconnect()}}var li=x,ui=0;function fi(){return ui+=1}var di=function(){ai.apply(this,arguments)};function pi(t,e){void 0===e&&(e={}),this.pDom=t;var r=e.id?e.id:"mask-"+Math.ceil(1e3*Math.random());this.id=e.id||r,e.id=r,this.defs||(this.defs=t.createEl({el:"defs"})),this.mask=this.defs.createEl({el:"mask",attr:e,style:{}})}function yi(t,e){void 0===e&&(e={}),this.pDom=t;var r=e.id?e.id:"clip-"+Math.ceil(1e3*Math.random());this.id=e.id||r,e.id=r,this.defs||(this.defs=t.createEl({el:"defs"})),this.clip=this.defs.createEl({el:"clipPath",attr:e,style:{}})}function xi(t,e){void 0===e&&(e={}),this.pDom=t;var r=e.id?e.id:"pattern-"+Math.ceil(1e3*Math.random());this.id=e.id||r,e.id=r,this.defs||(this.defs=t.createEl({el:"defs"})),this.pattern=this.defs.createEl({el:"pattern",attr:e,style:{}})}function vi(t){var e="";for(var r in t)"rotate"===r?e+=r+"("+t.rotate[0]+" "+(t.rotate[1]||0)+" "+(t.rotate[2]||0)+") ":"skew"===r?(t.skew[0]&&(e+="skewX("+t[r][0]+") "),t.skew[1]&&(e+="skewY("+t[r][1]+") ")):t[r].length>1?e+=r+"("+t[r].join(" ")+") ":e+=r+"("+t[r]+") ";return e}function gi(t,e,r){this.config=t,this.type=e||"linear",this.pDom=r,this.defs=this.pDom.createEl({el:"defs"})}(di.prototype=new ai).constructor=di,di.prototype.createNode=function(t,e,r){return bi(e,r)},pi.prototype.exe=function(){return"url(#"+this.id+")"},yi.prototype.exe=function(){return"url(#"+this.id+")"},xi.prototype.exe=function(){return"url(#"+this.id+")"},gi.prototype.exe=function(){return"url(#"+this.config.id+")"},gi.prototype.linearGradient=function(){var t=this;return this.linearEl=this.defs.join([1],"linearGradient",{action:{enter:function(e){var r=this.createEls(e.linearGradient,{el:"linearGradient"}).setAttr({id:t.config.id,x1:t.config.x1+"%",y1:t.config.y1+"%",x2:t.config.x2+"%",y2:t.config.y2+"%",spreadMethod:t.config.spreadMethod||"pad",gradientUnits:t.config.gradientUnits||"objectBoundingBox"});t.config.gradientTransform&&r.setAttr("gradientTransform",vi(t.config.gradientTransform))},exit:function(t){t.linearGradient.remove()},update:function(e){e.linearGradient.setAttr({id:t.config.id,x1:t.config.x1+"%",y1:t.config.y1+"%",x2:t.config.x2+"%",y2:t.config.y2+"%",spreadMethod:t.config.spreadMethod||"pad",gradientUnits:t.config.gradientUnits||"objectBoundingBox"}),t.config.gradientTransform&&e.linearGradient.setAttr("gradientTransform",vi(t.config.gradientTransform))}}}),this.linearEl=this.linearEl.fetchEl("linearGradient"),this.linearEl.fetchEls("stop").remove(),this.linearEl.createEls(this.config.colorStops,{el:"stop",attr:{offset:function(t,e){return t.value+"%"},"stop-color":function(t,e){return t.color}}}),this},gi.prototype.radialGradient=function(){var t=this;return this.defs||(this.defs=this.pDom.createEl({el:"defs"})),this.radialEl=this.defs.join([1],"radialGradient",{action:{enter:function(e){var r=this.createEls(e.radialGradient,{el:"radialGradient"}).setAttr({id:t.config.id,cx:t.config.innerCircle.x+"%",cy:t.config.innerCircle.y+"%",r:t.config.outerCircle.r+"%",fx:t.config.outerCircle.x+"%",fy:t.config.outerCircle.y+"%",spreadMethod:t.config.spreadMethod||"pad",gradientUnits:t.config.gradientUnits||"objectBoundingBox"});t.config.gradientTransform&&r.setAttr("gradientTransform",vi(t.config.gradientTransform))},exit:function(t){t.radialGradient.remove()},update:function(e){e.radialGradient.setAttr({id:t.config.id,cx:t.config.innerCircle.x+"%",cy:t.config.innerCircle.y+"%",r:t.config.outerCircle.r+"%",fx:t.config.outerCircle.x+"%",fy:t.config.outerCircle.y+"%",spreadMethod:t.config.spreadMethod||"pad",gradientUnits:t.config.gradientUnits||"objectBoundingBox"}),t.config.gradientTransform&&e.radialGradient.setAttr("gradientTransform",vi(t.config.gradientTransform))}}}),this.radialEl=this.radialEl.fetchEl("radialGradient"),this.radialEl.fetchEls("stop").remove(),this.radialEl.createEls(this.config.colorStops,{el:"stop",attr:{offset:function(t,e){return t.value+"%"},"stop-color":function(t,e){return t.color}}}),this},gi.prototype.colorStops=function(t){return"[object Array]"===Object.prototype.toString.call(t)&&(this.config.colorStops=t,"linear"===this.type?this.linearGradient():"radial"===this.type&&this.radialGradient())};var mi={svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},wi=function(t){return document.createElementNS(mi.svg,t)};function bi(t,e){var r,i,n=null,o=t.el.indexOf(":");if(o>=0)r=t.el.slice(0,o),i=t.el.slice(o+1),n=document.createElementNS(mi[r],i);else switch(t.el){case"group":n=wi("g");break;default:n=wi(t.el)}var a=new Ai(n,t,fi(),e);return t.dataObj&&(n.dataObj=t.dataObj),a}var Ai=function(t,e,r,i){this.dom=t,this.nodeName=t.nodeName,this.attr={},this.style={},this.changedAttribute={},this.changedStyles={},this.id=r,this.nodeType="svg",this.dom.nodeId=r,this.children=[],this.vDomIndex=i,this.events={},e.style&&this.setStyle(e.style),e.attr&&this.setAttr(e.attr)};function Bi(t,e){var r=e.indexOf(":"),i=t.changedAttribute[e];r>=0?t.dom.setAttributeNS(mi[e.slice(0,r)],e.slice(r+1),i):"text"===e?t.dom.textContent=i:"d"===e?qe.isTypePath(i)?t.dom.setAttribute(e,i.fetchPathString()):t.dom.setAttribute(e,i):"onerror"===e||"onload"===e?t.dom[e]=function(e){i.call(t,e)}:t.dom.setAttribute(e,i)}function Ti(t){t.dom.setAttribute("transform",vi(t.attr.transform))}function ki(t){if("[object Array]"===Object.prototype.toString.call(t))return t.reduce((function(t,e){return t+e.x+","+e.y+" "}),"")}Ai.prototype=new ii,Ai.prototype.node=function(){return this.execute(),this.dom},Ai.prototype.transFormAttributes=function(){var t=this;for(var e in t.changedAttribute)"transform"!==e?Bi(t,e):Ti(t);this.changedAttribute={}},Ai.prototype.scale=function(t){return this.attr.transform||(this.attr.transform={}),this.attr.transform.scale=t,this.changedAttribute.transform=this.attr.transform,this.attrChanged=!0,li.vDomChanged(this.vDomIndex),this},Ai.prototype.skewX=function(t){return this.attr.transform||(this.attr.transform={}),this.attr.transform.skewX=[t],this.changedAttribute.transform=this.attr.transform,this.attrChanged=!0,li.vDomChanged(this.vDomIndex),this},Ai.prototype.skewY=function(t){return this.attr.transform||(this.attr.transform={}),this.attr.transform.skewY=[t],this.changedAttribute.transform=this.attr.transform,this.attrChanged=!0,li.vDomChanged(this.vDomIndex),this},Ai.prototype.translate=function(t){return this.attr.transform||(this.attr.transform={}),this.attr.transform.translate=t,this.changedAttribute.transform=this.attr.transform,this.attrChanged=!0,li.vDomChanged(this.vDomIndex),this},Ai.prototype.rotate=function(t,e,r){return this.attr.transform||(this.attr.transform={}),"[object Array]"===Object.prototype.toString.call(t)&&t.length>0?this.attr.transform.rotate=[t[0]||0,t[1]||0,t[2]||0]:this.attr.transform.rotate=[t,e||0,r||0],this.changedAttribute.transform=this.attr.transform,this.attrChanged=!0,li.vDomChanged(this.vDomIndex),this},Ai.prototype.setStyle=function(t,e){if(2===arguments.length)null==e&&null!=this.style[t]?delete this.style[t]:("function"==typeof e&&(e=e.call(this,this.dataObj)),tr.RGBAInstanceCheck(e)&&(e=e.rgba),this.style[t]=e),this.changedStyles[t]=e;else if(1===arguments.length&&"object"==typeof t)for(var r in t)null==t[r]&&null!=this.style[t]?delete this.style[r]:this.style[r]=t[r],this.changedStyles[r]=t[r];return this.styleChanged=!0,li.vDomChanged(this.vDomIndex),this},Ai.prototype.setAttr=function(t,e){if(2===arguments.length)"points"===t&&(e=ki(e)),this.attr[t]=e,this.changedAttribute[t]=e;else if(1===arguments.length&&"object"==typeof t)for(var r in t)"points"===r&&(t[r]=ki(t[r])),this.attr[r]=t[r],this.changedAttribute[r]=t[r];return this.attrChanged=!0,li.vDomChanged(this.vDomIndex),this},Ai.prototype.execute=function(){if(this.styleChanged||this.attrChanged){this.transFormAttributes();for(var t=0,e=this.children.length;t<e;t+=1)this.children[t].execute();for(var r in this.changedStyles)"object"==typeof this.changedStyles[r]&&(this.changedStyles[r]instanceof gi||this.changedStyles[r]instanceof xi||this.changedStyles[r]instanceof yi||this.changedStyles[r]instanceof pi)&&(this.changedStyles[r]=this.changedStyles[r].exe()),this.dom.style.setProperty(r,this.changedStyles[r],"");this.changedStyles={}}else for(var i=0,n=this.children.length;i<n;i+=1)this.children[i].execute()},Ai.prototype.child=function(t){var e=this.dom;if(t instanceof di){for(var r=document.createDocumentFragment(),i=0,n=t.stack.length;i<n;i++)r.appendChild(t.stack[i].dom),t.stack[i].parentNode=this,this.children[this.children.length]=t.stack[i];e.appendChild(r)}else t instanceof Ai?(e.appendChild(t.dom),t.parentNode=this,this.children.push(t)):console.log("wrong node type");return this},Ai.prototype.animatePathTo=qe.animatePathTo,Ai.prototype.morphTo=qe.morphTo,Ai.prototype.createRadialGradient=function(t){var e=new gi(t,"radial",this);return e.radialGradient(),e},Ai.prototype.createLinearGradient=function(t){var e=new gi(t,"linear",this);return e.linearGradient(),e},Ai.prototype.on=function(t,e){var r=this;if(r.events[t]&&"drag"!==t&&"zoom"!==t&&(r.dom.removeEventListener(t,r.events[t]),delete r.events[t]),"drag"===t&&delete r.dom.drag_,"zoom"===t&&(r.dom.removeEventListener("wheel",r.events[t]),delete r.dom.drag_),e){if("drag"===t)r.dom.drag_=function(t,i){e.execute(r,t,i)};else if("zoom"===t){var i,n=0,o=0;r.events[t]=function(t){e.disableWheel||(e.zoomExecute(r,t),n+=1,i&&(clearTimeout(i),i=null,o=n),i=setTimeout((function(){o!==n?o=n:(i=null,e.onZoomEnd(r,t),n=0)}),100))},r.dom.addEventListener("wheel",r.events[t]),r.dom.drag_=function(t,i,n){e.panFlag&&e.panExecute(r,t,i,n)}}else{var a=e.bind(r);r.events[t]=function(t){a(t)},r.dom.addEventListener(t,r.events[t])}return this}},Ai.prototype.html=function(t){return arguments.length?(this.dom.innerHTML(t),this):this.dom.innerHTML},Ai.prototype.text=function(t){return arguments.length?(this.attr.text=t,this.changedAttribute.text=t,this):this.attr.text},Ai.prototype.remove=function(){this.parentNode.removeChild(this)},Ai.prototype.createEls=function(t,e){var r=new di({type:"SVG"},t,e,this.vDomIndex);return this.child(r),li.vDomChanged(this.vDomIndex),r},Ai.prototype.createEl=function(t){var e=bi(t,this.vDomIndex);return this.child(e),li.vDomChanged(this.vDomIndex),e},Ai.prototype.removeChild=function(t){var e=this.children,r=e.indexOf(t);if(-1!==r){var i=e.splice(r,1)[0].dom;if(!this.dom.contains(i))return;this.dom.removeChild(i)}};var Si=x,Ei=J,Mi=0;function Ci(){return Mi+=1}function Di(t,e,r){var i=e.dx;void 0===i&&(i=0);var n=e.dy;void 0===n&&(n=0);var o=t.transform.translate,a=t.transform.scale,s=a[0],h=a[1];return void 0===h&&(h=s),function(t,e,r){var i=e[0],n=e[1];return r[0]>=t[0][0]*i&&r[0]<=t[1][0]*i&&r[1]>=t[0][1]*n&&r[1]<=t[1][1]*n}(r,[s,h],[o[0]+i,o[1]+n])&&(i/=s,n/=h,t.dx=i,t.dy=n,o[0]/=s,o[1]/=h,o[0]+=i,o[1]+=n,o[0]*=s,o[1]*=h),t}var _i=function(){var t=this;this.dragStartFlag=!1,this.dragExtent=[[-1/0,-1/0],[1/0,1/0]],this.event={x:0,y:0,dx:0,dy:0,transform:{translate:[0,0],scale:[1,1]}},this.onDragStart=function(e,r){t.event.x=r.offsetX,t.event.y=r.offsetY,t.event.dx=0,t.event.dy=0,t.dragStartFlag=!0},this.onDrag=function(){},this.onDragEnd=function(){t.event.x=event.offsetX,t.event.y=event.offsetY,t.event.dx=0,t.event.dy=0,t.dragStartFlag=!1}};function zi(t,e){return e<=t[0]?t[0]:e>=t[1]?t[1]:e}function Pi(t,e,r,i){return t.translate[0]/=e,t.translate[1]/=e,t.translate[0]-=i[0]/e-i[0]/r,t.translate[1]-=i[1]/e-i[1]/r,t.scale=[r,r],t.translate[0]*=r,t.translate[1]*=r,t}_i.prototype={dragExtent:function(t){return this.dragExtent=t,this},dragStart:function(t){var e=this;return"function"==typeof t&&(this.onDragStart=function(r,i){e.event.x=i.offsetX,e.event.y=i.offsetY,e.event.dx=0,e.event.dy=0,t.call(r,e.event),e.dragStartFlag=!0}),this},drag:function(t){var e=this;return"function"==typeof t&&(this.onDrag=function(r,i){var n=i.offsetX-e.event.x,o=i.offsetY-e.event.y;e.event.x=i.offsetX,e.event.y=i.offsetY,e.event=Di(this.event,{dx:n,dy:o},e.dragExtent),t.call(r,e.event)}),this},dragEnd:function(t){var e=this;return"function"==typeof t&&(this.onDragEnd=function(r,i){e.dragStartFlag=!1,e.event.x=i.offsetX,e.event.y=i.offsetY,e.event.dx=0,e.event.dy=0,t.call(r,e.event)}),this},bindMethods:function(t){var e=this;t.dragTo=function(r,i){e.dragTo(t,r,i)}},execute:function(t,e,r){var i=this;this.event.e=e,e.preventDefault&&e.preventDefault(),this.dragStartFlag||"mousedown"!==r&&"pointerdown"!==r?this.onDragEnd&&this.dragStartFlag&&("mouseup"===r||"mouseleave"===r||"pointerleave"===r||"pointerup"===r)?i.onDragEnd(t,e):this.dragStartFlag&&this.onDrag&&i.onDrag(t,e):i.onDragStart(t,e)}};var Li=function(){var t=this;this.event={x:0,y:0,dx:0,dy:0,distance:0},this.event.pointers=[],this.event.transform={translate:[0,0],scale:[1,1]},this.zoomBy_=.001,this.zoomExtent_=[0,1/0],this.zoomStartFlag=!1,this.zoomDuration=250,this.onZoomStart=function(e,r){t.event.x=r.offsetX,t.event.y=r.offsetY,t.event.dx=0,t.event.dy=0,t.zoomStartFlag=!0,t.event.distance=0},this.onZoom=function(e,r){t.event.x=r.offsetX,t.event.y=r.offsetY},this.onZoomEnd=function(e,r){t.event.x=r.offsetX,t.event.y=r.offsetY,t.event.dx=0,t.event.dy=0,t.zoomStartFlag=!1,t.event.distance=0},this.onPanStart=function(t,e){},this.onPan=function(t,e){},this.onPanEnd=function(){},this.disableWheel=!1,this.disableDbclick=!1};Li.prototype.zoomStart=function(t){var e=this;return"function"==typeof t&&(this.zoomStartExe=t,this.onZoomStart=function(r,i,n){if(n.pointers&&2===n.pointers.length){var o=n.pointers;i={x:o[0].offsetX+.5*(o[1].offsetX-o[0].offsetX),y:o[0].offsetY+.5*(o[1].offsetY-o[0].offsetY)}}e.event.x=i.offsetX,e.event.y=i.offsetY,e.event.dx=0,e.event.dy=0,e.zoomStartFlag||t.call(r,e.event),e.zoomStartFlag=!0,e.event.distance=0}),this},Li.prototype.zoom=function(t){var e=this;return"function"==typeof t&&(this.zoomExe=t,this.onZoom=function(r,i){var n=e.event.transform,o=n.scale[0],a=o,s=i.deltaY,h=i.offsetX,c=i.offsetY;a=zi(e.zoomExtent_,a+-1*s*e.zoomBy_),e.event.transform=Pi(n,o,a,[h,c]),e.event.x=h,e.event.y=c,t.call(r,e.event)}),this},Li.prototype.zoomEnd=function(t){var e=this;return"function"==typeof t&&(this.zoomEndExe=t,this.onZoomEnd=function(r,i){e.event.x=i.offsetX,e.event.y=i.offsetY,e.event.dx=0,e.event.dy=0,e.zoomStartFlag=!1,t.call(r,e.event),e.event.distance=0}),this},Li.prototype.zoomTransition=function(){},Li.prototype.zoomExecute=function(t,e,r){this.eventType="zoom",e.preventDefault&&e.preventDefault(),this.zoomStartFlag?this.onZoom(t,e):this.onZoomStart(t,e,r)},Li.prototype.zoomPinch=function(t,e,r){var i=r.pointers;if(e.preventDefault&&e.preventDefault(),2===r.pointers.length)if(this.zoomStartFlag){for(var n=this.event.distance,o=0;o<i.length;o++)if(e.pointerId===i[o].pointerId){i[o]=e;break}var a=N.getDistance({x:i[0].offsetX,y:i[0].offsetY},{x:i[1].offsetX,y:i[1].offsetY}),s={offsetX:this.event.x,offsetY:this.event.y,deltaY:n?n-a:0};this.event.distance=a,this.onZoom(t,s)}else this.onZoomStart(t,e,r)},Li.prototype.scaleBy=function(t,e,r){var i=this,n=i.event.transform,o=e*n.scale[0],a=n.scale[0],s=this.zoomTarget_||r,h=(s[0]-r[0])*a,c=(s[1]-r[1])*a,l=0,u={run:function(e){var s=n.scale[0],u=zi(i.zoomExtent_,a+(o-a)*e);i.event.transform=Pi(n,s,u,r),i.event.transform.translate[0]+=h*(e-l)/u,i.event.transform.translate[1]+=c*(e-l)/u,l=e,i.zoomExe&&i.zoomExe.call(t,i.event)},target:t,duration:i.zoomDuration,delay:0,end:function(){i.onZoomEnd&&i.onZoomEnd(t,{})},loop:1,direction:"default",ease:"default"};Si.add(Ci(),u,Ei(u.ease))},Li.prototype.zoomTarget=function(t){this.zoomTarget_=t},Li.prototype.scaleTo=function(t,e,r){var i=this,n=i.event.transform,o=n.scale[0],a=this.zoomTarget_||r,s=(a[0]-r[0])*o,h=(a[1]-r[1])*o,c=0,l={run:function(a){var l=n.scale[0],u=zi(i.zoomExtent_,o+(e-o)*a);i.event.transform=Pi(n,l,u,r),i.event.transform.translate[0]+=s*(a-c)/u,i.event.transform.translate[1]+=h*(a-c)/u,c=a,i.zoomStartFlag||i.onZoomStart(t,{offsetX:r[0],offsetY:r[1]},{}),i.zoomExe&&i.zoomExe.call(t,i.event)},target:t,duration:i.zoomDuration,delay:0,end:function(){i.onZoomEnd&&i.onZoomEnd(t,i.event)},loop:1,direction:"default",ease:"default"};Si.add(Ci(),l,Ei(l.ease))},Li.prototype.panTo=function(t,e){var r=this,i=r.event.transform,n=e[0]-r.event.x,o=e[1]-r.event.y,a=0,s={run:function(e){var s=i.scale[0];i.translate[0]+=n*(e-a)/s,i.translate[1]+=o*(e-a)/s,a=e,r.zoomExe&&r.zoomExe.call(t,r.event)},target:t,duration:r.zoomDuration,delay:0,end:function(){r.onZoomEnd&&r.onZoomEnd(t,r.event)},loop:1,direction:"default",ease:"default"};Si.add(Ci(),s,Ei(s.ease))},Li.prototype.bindMethods=function(t){var e=this;t.scaleTo=function(r,i){e.scaleTo(t,r,i)},t.scaleBy=function(r,i){return e.scaleBy(t,r,i),t},t.panTo=function(r,i){return e.panTo(t,r,i),t}},Li.prototype.zoomFactor=function(t){return this.zoomBy_=t,this},Li.prototype.scaleExtent=function(t){return this.zoomExtent_=t,this},Li.prototype.duration=function(t){return this.zoomDuration=t||250,this},Li.prototype.panExtent=function(t){return this.panExtent_=t,this.panFlag=!0,this},Li.prototype.panExecute=function(t,e,r,i){if(1===i.pointers.length){if(this.event.e=e,this.eventType="pan",e.preventDefault&&e.preventDefault(),"touchstart"!==e.type&&"touchmove"!==e.type&&"touchend"!==e.type&&"touchcancel"!==e.type||(e.offsetX=e.touches[0].clientX,e.offsetY=e.touches[0].clientY),this.zoomStartFlag||"mousedown"!==r&&"pointerdown"!==r)if(!this.onZoomEnd||"mouseup"!==r&&"mouseleave"!==r&&"pointerup"!==r&&"pointerleave"!==r){if(this.zoomExe){var n=e.offsetX-this.event.x,o=e.offsetY-this.event.y;this.event.x=e.offsetX,this.event.y=e.offsetY,this.event=Di(this.event,{dx:n,dy:o},this.panExtent_),this.zoomExe.call(t,this.event)}}else this.onZoomEnd(t,e);else this.onZoomStart(t,e,{});e.preventDefault&&e.preventDefault()}};var Ii={drag:function(){return new _i},zoom:function(){return new Li}},Oi=N,Fi=x,Ni=0,Ri=Ii.zoom(),ji=Ii.drag();function Xi(){return Ni+=1}var Yi=function(){ai.apply(this,arguments)};function Gi(t){var e=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1);return e<1?1:e}function Ui(t){var e={translateX:0,translateY:0,scaleX:1,scaleY:1};return t&&(t.translate&&t.translate.length>0&&(e.translateX=t.translate[0],e.translateY=t.translate[1]),t.scale&&t.scale.length>0&&(e.scaleX=t.scale[0],e.scaleY=t.scale[1]||e.scaleX)),e}function qi(){var t=this,e=t.attr,r=e.transform,i=e.points;void 0===i&&(i=[]);var n=Ui(r),o=n.translateX,a=n.translateY,s=n.scaleX,h=n.scaleY;if(i&&i.length>0){for(var c=i[0].x,l=i[0].x,u=i[0].y,f=i[0].y,d=1;d<i.length;d+=1)c>i[d].x&&(c=i[d].x),l<i[d].x&&(l=i[d].x),u>i[d].y&&(u=i[d].y),f<i[d].y&&(f=i[d].y);t.BBox={x:o+c*s,y:a+u*h,width:(l-c)*s,height:(f-u)*h}}else t.BBox={x:0,y:0,width:0,height:0};r&&r.rotate?t.BBoxHit=Oi.rotateBBox(this.BBox,r):t.BBoxHit=this.BBox}function Hi(t,e){this.config=t,this.type=e||"linear",this.mode=this.config.mode&&"percent"!==this.config.mode?"absolute":"percent"}function Vi(t,e,r){this.imageData=t,this.width=e,this.height=r}function Zi(t,e){void 0===e&&(e={});var r=e.id?e.id:"mask-"+Math.ceil(1e3*Math.random());this.config=e,this.mask=new pn(t.dom.ctx,{el:"g",attr:{id:r}},Xi(),t.vDomIndex)}function Wi(t){return new Zi(this,t)}function Qi(t,e){void 0===e&&(e={});var r=e.id?e.id:"clip-"+Math.ceil(1e3*Math.random());this.clip=new pn(t.dom.ctx,{el:"g",attr:{id:r}},Xi(),t.vDomIndex)}function $i(t){return new Qi(this,t)}function Ji(t,e,r,i){void 0===e&&(e={}),void 0===r&&(r=0),void 0===i&&(i=0);var n=this,o=e.id?e.id:"pattern-"+Math.ceil(1e3*Math.random());this.repeatInd=e.repeat?e.repeat:"repeat","NODE"===t.ENV?n.pattern=bn({},i,r):(n.pattern=xn(null,{},{enableEvents:!1,enableResize:!1}),n.pattern.setSize(r,i)),n.pattern.setAttr("id",o),t.prependChild([n.pattern]),n.pattern.vDomIndex=t.vDomIndex+":"+o,n.pattern.onChange((function(){n.patternObj=t.ctx.createPattern(n.pattern.domEl,n.repeatInd)}))}function Ki(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=0),new Ji(this,t,e,r)}function tn(){this.BBox={x:0,y:0,width:0,height:0},this.BBoxHit={x:0,y:0,width:0,height:0}}function en(t,e,r,i,n,o){var a=this;for(var s in a.ctx=t,a.attr=e,a.style=r,a.nodeName="Image",a.nodeExe=o,e)this.setAttr(s,e[s]);Fi.vDomChanged(o.vDomIndex),a.stack=[a]}function rn(t,e,r){var i=this;i.ctx=t,i.attr=e,i.style=r,i.nodeName="text",i.stack=[i]}(Yi.prototype=new ai).constructor=Yi,Yi.prototype.createNode=function(t,e,r){return new pn(t,e,Xi(),r)},Hi.prototype.exe=function(t,e){return"linear"===this.type&&"percent"===this.mode?this.linearGradient(t,e):"linear"===this.type&&"absolute"===this.mode?this.absoluteLinearGradient(t):"radial"===this.type&&"percent"===this.mode?this.radialGradient(t,e):"radial"===this.type&&"absolute"===this.mode?this.absoluteRadialGradient(t):void console.error("wrong Gradiant type")},Hi.prototype.linearGradient=function(t,e){var r=t.createLinearGradient(e.x+e.width*(this.config.x1/100),e.y+e.height*(this.config.y1/100),e.x+e.width*(this.config.x2/100),e.y+e.height*(this.config.y2/100));return this.config.colorStops.forEach((function(t){r.addColorStop(t.value/100,t.color)})),r},Hi.prototype.absoluteLinearGradient=function(t){var e=t.createLinearGradient(this.config.x1,this.config.y1,this.config.x2,this.config.y2);return this.config.colorStops.forEach((function(t){e.addColorStop(t.value,t.color)})),e},Hi.prototype.radialGradient=function(t,e){var r=t.createRadialGradient(e.x+e.width*(this.config.innerCircle.x/100),e.y+e.height*(this.config.innerCircle.y/100),e.width>e.height?e.width*this.config.innerCircle.r/100:e.height*this.config.innerCircle.r/100,e.x+e.width*(this.config.outerCircle.x/100),e.y+e.height*(this.config.outerCircle.y/100),e.width>e.height?e.width*this.config.outerCircle.r/100:e.height*this.config.outerCircle.r/100);return this.config.colorStops.forEach((function(t){r.addColorStop(t.value/100,t.color)})),r},Hi.prototype.absoluteRadialGradient=function(t,e){var r=t.createRadialGradient(this.config.innerCircle.x,this.config.innerCircle.y,this.config.innerCircle.r,this.config.outerCircle.x,this.config.outerCircle.y,this.config.outerCircle.r);return this.config.colorStops.forEach((function(t){r.addColorStop(t.value/100,t.color)})),r},Hi.prototype.colorStops=function(t){return"[object Array]"===Object.prototype.toString.call(t)&&(this.config.colorStops=t,this)},Vi.prototype.get=function(t){var e=this.imageData?this.imageData.pixels:[],r=(t.y-1)*(4*this.width)+4*(t.x-1);return"rgba("+e[r]+", "+e[r+1]+", "+e[r+2]+", "+e[r+3]+")"},Vi.prototype.put=function(t,e){var r=(t.y-1)*(4*this.width)+4*(t.x-1);return this.imageData.pixels[r]=e[0],this.imageData.pixels[r+1]=e[1],this.imageData.pixels[r+2]=e[2],this.imageData.pixels[r+3]=e[3],this},Zi.prototype.setAttr=function(t,e){this.config[t]=e},Zi.prototype.exe=function(){return this.mask.execute(),this.mask.dom.ctx.globalCompositeOperation=this.config.globalCompositeOperation||"destination-atop",!0},Qi.prototype.exe=function(){return this.clip.execute(),this.clip.dom.ctx.clip(),!0},Ji.prototype.repeat=function(t){this.repeatInd=t},Ji.prototype.exe=function(){return this.patternObj},tn.prototype={render:function(t){var e=this;if(t.transform){var r=t.transform,i=r.scale;void 0===i&&(i=[1,1]);var n=r.skew;void 0===n&&(n=[0,0]);var o=r.translate;void 0===o&&(o=[0,0]);var a=i[0];void 0===a&&(a=1);var s=i[1];void 0===s&&(s=a);var h=n[0];void 0===h&&(h=0);var c=n[1];void 0===c&&(c=h);var l=o[0];void 0===l&&(l=0);var u=o[1];void 0===u&&(u=l),e.ctx.transform(a,h,c,s,l,u),r.rotate&&r.rotate.length>0&&(e.ctx.translate(r.rotate[1]||0,r.rotate[2]||0),e.ctx.rotate(r.rotate[0]*(Math.PI/180)),e.ctx.translate(-r.rotate[1]||0,-r.rotate[2]||0))}for(var f=0;f<e.stack.length;f+=1)e.stack[f].execute()},setAttr:function(t,e){null==e&&null!=this.attr[t]?delete this.attr[t]:this.attr[t]=e},setStyle:function(t,e){null==e&&null!=this.style[t]?delete this.style[t]:this.style[t]=e},applyStyles:function(){"#000000"!==this.ctx.fillStyle&&this.ctx.fill(),"#000000"!==this.ctx.strokeStyle&&this.ctx.stroke()}},en.prototype=new tn,en.prototype.constructor=en,en.prototype.setAttr=function(t,e){var r=this;"src"===t&&("string"==typeof e?(r.image=r.image?r.image:function(t){var e=new Image;return e.crossOrigin="anonymous",e.onload=function(){t.attr.height=t.attr.height?t.attr.height:this.height,t.attr.width=t.attr.width?t.attr.width:this.width,t.imageObj=this,t.nodeExe.attr.onload&&"function"==typeof t.nodeExe.attr.onload&&t.nodeExe.attr.onload.call(t.nodeExe,t.image),t.nodeExe.BBoxUpdate=!0,Fi.vDomChanged(t.nodeExe.vDomIndex)},e.onerror=function(e){t.nodeExe.attr.onerror&&"function"==typeof t.nodeExe.attr.onerror&&t.nodeExe.attr.onerror.call(t.nodeExe,e)},e}(r),r.image.src!==e&&(r.image.src=e)):e instanceof HTMLImageElement||e instanceof SVGImageElement||e instanceof HTMLCanvasElement?(r.imageObj=e,r.attr.height=r.attr.height?r.attr.height:e.height,r.attr.width=r.attr.width?r.attr.width:e.width):(e instanceof pn||e instanceof wn)&&(r.imageObj=e.domEl,r.attr.height=r.attr.height?r.attr.height:e.attr.height,r.attr.width=r.attr.width?r.attr.width:e.attr.width)),this.attr[t]=e,Fi.vDomChanged(this.nodeExe.vDomIndex)},en.prototype.updateBBox=function(){var t=this,e=t.attr,r=e.transform,i=e.x;void 0===i&&(i=0);var n=e.y;void 0===n&&(n=0);var o=e.width;void 0===o&&(o=0);var a=e.height;void 0===a&&(a=0);var s=Ui(r),h=s.translateX,c=s.translateY,l=s.scaleX,u=s.scaleY;t.BBox={x:(h+i)*l,y:(c+n)*u,width:o*l,height:a*u},r&&r.rotate?t.BBoxHit=Oi.rotateBBox(this.BBox,r):t.BBoxHit=this.BBox},en.prototype.execute=function(){var t=this.attr,e=t.width;void 0===e&&(e=0);var r=t.height;void 0===r&&(r=0);var i=t.x;void 0===i&&(i=0);var n=t.y;void 0===n&&(n=0),this.imageObj&&this.ctx.drawImage(this.imageObj,i,n,e,r)},en.prototype.applyStyles=function(){},en.prototype.in=function(t){var e=this.attr,r=e.width;void 0===r&&(r=0);var i=e.height;void 0===i&&(i=0);var n=e.x;void 0===n&&(n=0);var o=e.y;return void 0===o&&(o=0),t.x>=n&&t.x<=n+r&&t.y>=o&&t.y<=o+i},rn.prototype=new tn,rn.prototype.constructor=rn,rn.prototype.text=function(t){this.attr.text=t},rn.prototype.updateBBox=function(){var t,e=this,r=1,i=e.attr,n=i.x;void 0===n&&(n=0);var o=i.y;void 0===o&&(o=0);var a=i.transform,s=Ui(a),h=s.translateX,c=s.translateY,l=s.scaleX,u=s.scaleY;this.style.font&&(this.ctx.font=this.style.font,r=parseInt(this.style.font.replace(/[^\d.]/g,""),10)||1),t=this.ctx.measureText(this.attr.text).width,"center"===this.style.textAlign?n-=t/2:"right"===this.style.textAlign&&(n-=t),e.width=t,e.height=r,e.x=n,e.y=o,e.BBox={x:(h+n)*l,y:(c+o)*u,width:t*l,height:r*u},a&&a.rotate?e.BBoxHit=Oi.rotateBBox(this.BBox,a):e.BBoxHit=this.BBox},rn.prototype.execute=function(){void 0!==this.attr.text&&null!==this.attr.text&&("#000000"!==this.ctx.fillStyle&&this.ctx.fillText(this.attr.text,this.attr.x,this.attr.y+this.height),"#000000"!==this.ctx.strokeStyle&&this.ctx.strokeText(this.attr.text,this.attr.x,this.attr.y+this.height))},rn.prototype.applyStyles=function(){},rn.prototype.in=function(t){var e=this,r=e.x;void 0===r&&(r=0);var i=e.y;void 0===i&&(i=0);var n=e.width;void 0===n&&(n=0);var o=e.height;return void 0===o&&(o=0),t.x>=r&&t.x<=r+n&&t.y>=i&&t.y<=i+o};var nn=function(t,e,r){var i=this;i.ctx=t,i.attr=e,i.style=r,i.nodeName="circle",i.stack=[i]};(nn.prototype=new tn).constructor=nn,nn.prototype.updateBBox=function(){var t=this,e=t.attr,r=e.transform,i=e.r;void 0===i&&(i=0);var n=e.cx;void 0===n&&(n=0);var o=e.cy;void 0===o&&(o=0);var a=Ui(r),s=a.translateX,h=a.translateY,c=a.scaleX,l=a.scaleY;t.BBox={x:s+(n-i)*c,y:h+(o-i)*l,width:2*i*c,height:2*i*l},r&&r.rotate?t.BBoxHit=Oi.rotateBBox(this.BBox,r):t.BBoxHit=this.BBox},nn.prototype.execute=function(){var t=this.attr,e=t.r;void 0===e&&(e=0);var r=t.cx;void 0===r&&(r=0);var i=t.cy;void 0===i&&(i=0),this.ctx.beginPath(),this.ctx.arc(r,i,e,0,2*Math.PI,!1),this.applyStyles(),this.ctx.closePath()},nn.prototype.in=function(t,e){var r=this.attr,i=r.r;void 0===i&&(i=0);var n=r.cx;void 0===n&&(n=0);var o=r.cy;return void 0===o&&(o=0),Math.sqrt((t.x-n)*(t.x-n)+(t.y-o)*(t.y-o))<=i};var on=function(t,e,r){var i=this;i.ctx=t,i.attr=e,i.style=r,i.nodeName="line",i.stack=[i]};function an(t,e,r){var i=this;i.ctx=t,i.attr=e,i.style=r,i.nodeName="polyline",i.stack=[i]}(on.prototype=new tn).constructor=on,on.prototype.updateBBox=function(){var t=this,e=t.attr,r=e.transform,i=e.x1;void 0===i&&(i=0);var n=e.y1;void 0===n&&(n=0);var o=e.x2;void 0===o&&(o=0);var a=e.y2;void 0===a&&(a=0);var s=Ui(r),h=s.translateX,c=s.translateY,l=s.scaleX,u=s.scaleY;t.BBox={x:h+(i<o?i:o)*l,y:c+(n<a?n:a)*u,width:Math.abs(o-i)*l,height:Math.abs(a-n)*u},r&&r.rotate?t.BBoxHit=Oi.rotateBBox(this.BBox,r):t.BBoxHit=this.BBox},on.prototype.execute=function(){var t=this.ctx,e=this.attr,r=e.x1;void 0===r&&(r=0);var i=e.y1;void 0===i&&(i=0);var n=e.x2;void 0===n&&(n=0);var o=e.y2;void 0===o&&(o=0),t.beginPath(),t.moveTo(r,i),t.lineTo(n,o),this.applyStyles(),t.closePath()},on.prototype.in=function(t){var e=this.attr,r=e.x1;void 0===r&&(r=0);var i=e.y1;void 0===i&&(i=0);var n=e.x2;void 0===n&&(n=0);var o=e.y2;return void 0===o&&(o=0),parseFloat(Oi.getDistance({x:r,y:i},t)+Oi.getDistance(t,{x:n,y:o})).toFixed(1)===parseFloat(Oi.getDistance({x:r,y:i},{x:n,y:o})).toFixed(1)},an.prototype=new tn,an.constructor=an,an.prototype.execute=function(){var t;if(this.attr.points&&0!==this.attr.points.length){this.ctx.beginPath(),this.ctx.moveTo(this.attr.points[0].x,this.attr.points[0].y);for(var e=1;e<this.attr.points.length;e++)t=this.attr.points[e],this.ctx.lineTo(t.x,t.y);this.applyStyles(),this.ctx.closePath()}},an.prototype.updateBBox=qi,an.prototype.in=function(t){for(var e=!1,r=0,i=this.attr.points.length;r<=i-2;r++){var n=this.attr.points[r],o=this.attr.points[r+1];e=e||parseFloat(Oi.getDistance({x:n.x,y:n.y},t)+Oi.getDistance(t,{x:o.x,y:o.y})).toFixed(1)===parseFloat(Oi.getDistance({x:n.x,y:n.y},{x:o.x,y:o.y})).toFixed(1)}return e};var sn=function(t,e,r){var i=this;return i.ctx=t,i.angle=0,i.nodeName="path",i.attr=e,i.style=r,i.attr.d&&(qe.isTypePath(i.attr.d)?(i.path=i.attr.d,i.attr.d=i.attr.d.fetchPathString()):i.path=qe.instance(i.attr.d),i.pathNode=new Path2D(i.attr.d)),i.stack=[i],i};function hn(t){if("[object Array]"===Object.prototype.toString.call(t)){if(!t||0!==t.length){var e=new Path2D;e.moveTo(t[0].x,t[0].y);for(var r=1;r<t.length;r++)e.lineTo(t[r].x,t[r].y);return e.closePath(),{path:e,points:t,execute:function(t){t.beginPath();var e=this.points;t.moveTo(e[0].x,e[0].y);for(var r=1;r<e.length;r++)t.lineTo(e[r].x,e[r].y);t.closePath()}}}}else console.error("Points expected as array [{x: , y:}]")}(sn.prototype=new tn).constructor=sn,sn.prototype.updateBBox=function(){var t=this,e=t.attr.transform,r=Ui(e),i=r.translateX,n=r.translateY,o=r.scaleX,a=r.scaleY;t.BBox=t.path?t.path.BBox:{x:0,y:0,width:0,height:0},t.BBox.x=i+t.BBox.x*o,t.BBox.y=n+t.BBox.y*a,t.BBox.width*=o,t.BBox.height*=a,e&&e.rotate?t.BBoxHit=Oi.rotateBBox(this.BBox,e):t.BBoxHit=this.BBox},sn.prototype.setAttr=function(t,e){this.attr[t]=e,"d"===t&&(qe.isTypePath(e)?(this.path=e,this.attr.d=e.fetchPathString()):this.path=qe.instance(this.attr.d),this.pathNode=new Path2D(this.attr.d))},sn.prototype.getPointAtLength=function(t){return this.path?this.path.getPointAtLength(t):{x:0,y:0}},sn.prototype.getAngleAtLength=function(t){return this.path?this.path.getAngleAtLength(t):0},sn.prototype.getTotalLength=function(){return this.path?this.path.getTotalLength():0},sn.prototype.execute=function(){this.attr.d&&("#000000"!==this.ctx.fillStyle||"#000000"!==this.ctx.strokeStyle?("#000000"!==this.ctx.fillStyle&&this.ctx.fill(this.pathNode),"#000000"!==this.ctx.strokeStyle&&this.ctx.stroke(this.pathNode)):this.path.execute(this.ctx))},sn.prototype.applyStyles=function(){},sn.prototype.in=function(t){var e=!1;return this.attr.d&&this.pathNode?(this.ctx.save(),this.ctx.scale(1/this.ctx.pixelRatio,1/this.ctx.pixelRatio),e=this.ctx.isPointInPath(this.pathNode,t.x,t.y),this.ctx.restore(),e):e};var cn=function(t,e,r){var i=this;return i.ctx=t,i.nodeName="polygon",i.attr=e,i.style=r,i.stack=[i],i.attr.points&&(i.polygon=hn(i.attr.points)),this};(cn.prototype=new tn).constructor=cn,cn.prototype.setAttr=function(t,e){this.attr[t]=e,"points"===t&&(this.polygon=hn(this.attr.points),this.polygon&&(this.attr.points=this.polygon.points))},cn.prototype.updateBBox=qi,cn.prototype.execute=function(){this.polygon&&("#000000"!==this.ctx.fillStyle||"#000000"!==this.ctx.strokeStyle?("#000000"!==this.ctx.fillStyle&&this.ctx.fill(this.polygon.path),"#000000"!==this.ctx.strokeStyle&&this.ctx.stroke(this.polygon.path)):this.polygon.execute(this.ctx))},cn.prototype.applyStyles=function(){},cn.prototype.in=function(t){var e=!1;return!!this.polygon&&(this.ctx.save(),this.ctx.scale(1/this.ctx.pixelRatio,1/this.ctx.pixelRatio),e=this.style.fillStyle?this.ctx.isPointInPath(this.polygon.path,t.x,t.y):e,this.ctx.restore(),e)};var ln=function(t,e,r){var i=this;return i.ctx=t,i.nodeName="ellipse",i.attr=e,i.style=r,i.stack=[i],this};(ln.prototype=new tn).constructor=ln,ln.prototype.updateBBox=function(){var t=this,e=t.attr,r=e.transform,i=e.cx;void 0===i&&(i=0);var n=e.cy;void 0===n&&(n=0);var o=e.rx;void 0===o&&(o=0);var a=e.ry;void 0===a&&(a=0);var s=Ui(r),h=s.translateX,c=s.translateY,l=s.scaleX,u=s.scaleY;t.BBox={x:h+(i-o)*l,y:c+(n-a)*u,width:2*o*l,height:2*a*u},r&&r.rotate?t.BBoxHit=Oi.rotateBBox(this.BBox,r):t.BBoxHit=this.BBox},ln.prototype.execute=function(){var t=this.ctx,e=this.attr,r=e.cx;void 0===r&&(r=0);var i=e.cy;void 0===i&&(i=0);var n=e.rx;void 0===n&&(n=0);var o=e.ry;void 0===o&&(o=0),t.beginPath(),t.ellipse(r,i,n,o,0,0,2*Math.PI),this.applyStyles(),t.closePath()},ln.prototype.in=function(t){var e=this.attr,r=e.cx;void 0===r&&(r=0);var i=e.cy;void 0===i&&(i=0);var n=e.rx;void 0===n&&(n=0);var o=e.ry;return void 0===o&&(o=0),(t.x-r)*(t.x-r)/(n*n)+(t.y-i)*(t.y-i)/(o*o)<=1};var un=function(t,e,r){var i=this;return i.ctx=t,i.nodeName="rect",i.attr=e,i.style=r,i.stack=[i],this};function fn(t,e){var r=e.x;void 0===r&&(r=0);var i=e.y;void 0===i&&(i=0);var n=e.width;void 0===n&&(n=0);var o=e.height;void 0===o&&(o=0);var a=e.rx;void 0===a&&(a=0);var s=e.ry;void 0===s&&(s=0),t.beginPath(),t.moveTo(r+a,i),t.lineTo(r+n-a,i),t.quadraticCurveTo(r+n,i,r+n,i+s),t.lineTo(r+n,i+o-s),t.quadraticCurveTo(r+n,i+o,r+n-a,i+o),t.lineTo(r+a,i+o),t.quadraticCurveTo(r,i+o,r,i+o-s),t.lineTo(r,i+s),t.quadraticCurveTo(r,i,r+a,i),t.closePath()}(un.prototype=new tn).constructor=un,un.prototype.updateBBox=function(){var t=this,e=t.attr,r=e.transform,i=e.x;void 0===i&&(i=0);var n=e.y;void 0===n&&(n=0);var o=e.width;void 0===o&&(o=0);var a=e.height;void 0===a&&(a=0);var s=Ui(r),h=s.translateX,c=s.translateY,l=s.scaleX,u=s.scaleY;t.BBox={x:h+i*l,y:c+n*u,width:o*l,height:a*u},r&&r.rotate?t.BBoxHit=Oi.rotateBBox(this.BBox,r):t.BBoxHit=this.BBox},un.prototype.applyStyles=function(){},un.prototype.execute=function(){var t=this.ctx,e=this.attr,r=e.x;void 0===r&&(r=0);var i=e.y;void 0===i&&(i=0);var n=e.width;void 0===n&&(n=0);var o=e.height;void 0===o&&(o=0);var a=e.rx;void 0===a&&(a=0);var s=e.ry;void 0===s&&(s=0),"#000000"!==t.fillStyle||"#000000"!==t.strokeStyle?("#000000"!==t.fillStyle&&(a||s?(fn(t,{x:r,y:i,width:n,height:o,rx:a,ry:s}),t.fill()):t.fillRect(r,i,n,o)),"#000000"!==t.strokeStyle&&(a||s?(fn(t,{x:r,y:i,width:n,height:o,rx:a,ry:s}),t.stroke()):t.strokeRect(r,i,n,o))):t.rect(r,i,n,o)},un.prototype.in=function(t){var e=this.attr,r=e.x;void 0===r&&(r=0);var i=e.y;void 0===i&&(i=0);var n=e.width;void 0===n&&(n=0);var o=e.height;return void 0===o&&(o=0),t.x>=r&&t.x<=r+n&&t.y>=i&&t.y<=i+o};var dn=function(t,e,r){var i=this;return i.nodeName="g",i.ctx=t,i.attr=e,i.style=r,i.stack=new Array(0),this};(dn.prototype=new tn).constructor=dn,dn.prototype.updateBBox=function(t){var e,r,i,n,o=this,a=Ui(o.attr.transform),s=a.translateX,h=a.translateY,c=a.scaleX,l=a.scaleY;if(o.BBox={},t&&t.length>0)for(var u,f,d,p=0;p<t.length;p+=1)f=(u=t[p]).dom.BBoxHit.x,d=u.dom.BBoxHit.y,e=void 0===e||e>f?f:e,i=void 0===i||i>d?d:i,r=void 0===r||r<f+u.dom.BBoxHit.width?f+u.dom.BBoxHit.width:r,n=void 0===n||n<d+u.dom.BBoxHit.height?d+u.dom.BBoxHit.height:n;e=void 0===e?0:e,i=void 0===i?0:i,r=void 0===r?0:r,n=void 0===n?0:n,o.BBox.x=s+e*c,o.BBox.y=h+i*l,o.BBox.width=Math.abs(r-e)*c,o.BBox.height=Math.abs(n-i)*l,o.attr.transform&&o.attr.transform.rotate?o.BBoxHit=Oi.rotateBBox(this.BBox,this.attr.transform):o.BBoxHit=this.BBox},dn.prototype.child=function(t){var e=this,r=t;r instanceof pn?(r.dom.parent=e,e.stack[e.stack.length]=r):r instanceof Yi?r.stack.forEach((function(t){t.dom.parent=e,e.stack[e.stack.length]=t})):console.log("wrong Object")},dn.prototype.in=function(t){var e=t.x,r=t.y,i=this.BBox,n=Ui(this.attr.transform),o=n.translateX,a=n.translateY,s=n.scaleX,h=n.scaleY;return e>=(i.x-o)/s&&e<=(i.x-o+i.width)/s&&r>=(i.y-a)/h&&r<=(i.y-a+i.height)/h};var pn=function(t,e,r,i){switch(this.style=e.style||{},this.setStyle(e.style),this.attr=e.attr||{},this.id=r,this.nodeName=e.el,this.nodeType="CANVAS",this.children=[],this.events={},this.ctx=t,this.vDomIndex=i,this.bbox=void 0===e.bbox||e.bbox,e.el){case"circle":this.dom=new nn(this.ctx,this.attr,this.style);break;case"rect":this.dom=new un(this.ctx,this.attr,this.style);break;case"line":this.dom=new on(this.ctx,this.attr,this.style);break;case"polyline":this.dom=new an(this.ctx,this.attr,this.style);break;case"path":this.dom=new sn(this.ctx,this.attr,this.style);break;case"group":case"g":this.dom=new dn(this.ctx,this.attr,this.style);break;case"text":this.dom=new rn(this.ctx,this.attr,this.style);break;case"image":this.dom=new en(this.ctx,this.attr,this.style,e.onload,e.onerror,this);break;case"polygon":this.dom=new cn(this.ctx,this.attr,this.style,this);break;case"ellipse":this.dom=new ln(this.ctx,this.attr,this.style,this);break;default:this.dom=null}this.dom.nodeExe=this,this.BBoxUpdate=!0};function yn(t){return tr.RGBAInstanceCheck(t)&&(t=t.rgba),"#000"===t||"#000000"===t||"black"===t?"rgb(1, 1, 1)":t}function xn(t,e,r){void 0===e&&(e={}),void 0===r&&(r={});var i=t?document.querySelector(t):null,n=i?i.clientHeight:0,o=i?i.clientWidth:0,a=document.createElement("canvas"),s=a.getContext("2d",e),h=r.enableEvents;void 0===h&&(h=!0);var c=r.autoUpdate;void 0===c&&(c=!0);var l=r.enableResize;void 0===l&&(l=!0);var u=Gi(s);s.pixelRatio=u;var f,d=function(t){t.clearRect(0,0,o*u,n*u)};a.setAttribute("height",n*u),a.setAttribute("width",o*u),a.style.height=n+"px",a.style.width=o+"px",a.style.position="absolute";var p,y,x,g,m=999999;i?(i.appendChild(a),f=new v,c&&(m=Fi.addVdom(f))):h=!1;var w=new pn(s,{el:"g",attr:{id:"rootNode"}},Xi(),m);f&&f.rootNode(w);var b=w.execute.bind(w);w.container=i,w.domEl=a,w.height=n,w.width=o,w.type="CANVAS",w.ctx=s,w.setClear=function(t){d=t},w.setAttr=function(t,e){"viewBox"===t&&this.setViewBox.apply(this,e.split(",")),a.setAttribute(t,e),this.attr[t]=e},w.enableEvents=function(t){h=t},w.setStyle=function(t,e){this.domEl.style[t]=e},w.addDependentLayer=function(t){if(t instanceof pn){var e=t.attr.id?t.attr.id:"dep-"+Math.ceil(1e3*Math.random());t.setAttr("id",e),t.vDomIndex=this.vDomIndex+":"+e,this.prependChild([t])}};var A=function(e){document.querySelector(t)?(n=p||e.height,o=y||e.width,w.width=o,w.height=n,B(w.domEl,o,n),x&&x(),w.execute()):ci(w)},B=function(t,e,r){t.setAttribute("height",r*u),t.setAttribute("width",e*u),t.style.height=r+"px",t.style.width=e+"px"};if(w.setPixelRatio=function(t){u=t,this.ctx.pixelRatio=u,B(this.domEl,this.width,this.height)},w.onResize=function(t){x=t},w.onChange=function(t){g=t},w.toDataURL=function(t){return this.domEl.toDataURL(t)},w.invokeOnChange=function(){},w.setSize=function(t,e){p=e,y=t,o=t,n=e,this.width=o,this.height=n,B(this.domEl,o,n),this.execute()},w.setViewBox=function(t,e,r,i){},w.getPixels=function(t,e,r,i){return new Vi(this.ctx.getImageData(t,e,r,i),r,i)},w.putPixels=function(t,e,r){if(t instanceof Vi)return this.ctx.putImageData(t.imageData,e,r)},w.clear=function(){d()},w.setContext=function(t,e){this.ctx[t]&&"function"==typeof this.ctx[t]?this.ctx[t].apply(null,e):this.ctx[t]&&(this.ctx[t]=e)},w.createPattern=Ki,w.createClip=$i,w.createMask=Wi,w.execute=function(){d(s),s.setTransform(u,0,0,u,0,0),this.updateBBox(),b(),g&&this.stateModified&&g(),this.stateModified=!1},w.update=function(){this.execute()},w.createTexture=function(t){return new wn(this,t)},w.createAsyncTexture=function(t){var e=this;return new Promise((function(r,i){var n=new wn(e,t);n.onLoad((function(){r(n)}))}))},w.destroy=function(){var e=document.querySelector(t);e&&e.contains(a)&&e.removeChild(a),Fi.removeVdom(m),ci(w,A)},h){var T=new er(w);a.addEventListener("mousemove",(function(t){t.preventDefault(),T.mousemoveCheck(t)})),a.addEventListener("mousedown",(function(t){T.mousedownCheck(t)})),a.addEventListener("mouseup",(function(t){T.mouseupCheck(t)})),a.addEventListener("mouseleave",(function(t){T.mouseleaveCheck(t)})),a.addEventListener("contextmenu",(function(t){T.contextmenuCheck(t)})),a.addEventListener("touchstart",(function(t){T.touchstartCheck(t)})),a.addEventListener("touchend",(function(t){T.touchendCheck(t)})),a.addEventListener("touchmove",(function(t){t.preventDefault(),T.touchmoveCheck(t)})),a.addEventListener("touchcancel",(function(t){T.touchcancelCheck(t)})),a.addEventListener("wheel",(function(t){T.wheelEventCheck(t)})),a.addEventListener("pointerdown",(function(t){T.addPointer(t),T.pointerdownCheck(t)})),a.addEventListener("pointerup",(function(t){T.removePointer(t),T.pointerupCheck(t)})),a.addEventListener("pointermove",(function(t){t.preventDefault(),T.pointermoveCheck(t)}))}return Fi.execute(),l&&w.container&&hi(w,A),w}function vn(t,e){var r=document.createElement("canvas");r.setAttribute("height",e),r.setAttribute("width",t),this.canvas=r,this.context=this.canvas.getContext("2d")}function gn(t,e){var r=new Image;return r.crossOrigin="anonymous",r.src=e,t?(r.onload=function(){t&&(t.attr&&(t.attr.height=t.attr.height?t.attr.height:this.naturalHeight,t.attr.width=t.attr.width?t.attr.width:this.naturalWidth),t instanceof wn&&t.setSize(t.attr.width,t.attr.height),t.imageObj=this,t.attr&&t.attr.onload&&"function"==typeof t.attr.onload&&t.attr.onload.call(t,t.image),t.asyncOnLoad&&"function"==typeof t.asyncOnLoad&&t.asyncOnLoad(t.image),mn(t))},r.onerror=function(e){console.error(e),t.nodeExe.attr.onerror&&"function"==typeof t.nodeExe.attr.onerror&&t.nodeExe.attr.onerror.call(t.nodeExe,e),t.asyncOnLoad&&"function"==typeof t.asyncOnLoad&&t.asyncOnLoad(t.image)},r):r}function mn(t){t.imageObj&&(t.attr&&t.attr.clip?function(t){var e=t.ctx,r=t.attr,i=r.clip,n=r.width;void 0===n&&(n=0);var o=r.height;void 0===o&&(o=0);var a=i.sx;void 0===a&&(a=0);var s=i.sy;void 0===s&&(s=0);var h=i.swidth;void 0===h&&(h=n);var c=i.sheight;void 0===c&&(c=o);e.clearRect(0,0,n,o),e.drawImage(t.imageObj,a,s,h,c,0,0,n,o)}(t):t.execute(),t.attr&&t.attr.filter&&function(t){var e=t.ctx,r=t.attr,i=r.width;void 0===i&&(i=0);var n=r.height;void 0===n&&(n=0);var o=e.getImageData(0,0,i,n);e.putImageData(t.attr.filter(o),0,0)}(t),Fi.vDomChanged(t.nodeExe.vDomIndex))}function wn(t,e){void 0===e&&(e={});var r=this;r.attr=Object.assign({},e.attr)||{},r.style=Object.assign({},e.style)||{};var i=r.attr.scale||1;for(var n in r.rImageObj=new vn((r.attr.width||1)*i,(r.attr.height||1)*i),r.ctx=r.rImageObj.context,r.domEl=r.rImageObj.canvas,r.imageArray=[],r.seekIndex=0,r.nodeName="Sprite",r.nodeExe=t,r.attr)r.setAttr(n,r.attr[n]);Fi.vDomChanged(t.vDomIndex)}function bn(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r=0),!Canvas)return console.error("Canvas missing from node"),console.error('Install "Canvas" "canvas-5-polyfill" node modules'),void console.error('Make "Canvas" "Image" "Path2D" objects global from the above modules');var i,n=new Canvas(r,e),o=n.getContext("2d",t),a=Gi(o),s=function(t){t.clearRect(0,0,r*a,e*a)},h=new v,c=Fi.addVdom(h),l=new pn(o,{el:"g",attr:{id:"rootNode"}},Xi(),c);h.rootNode(l);var u=l.execute.bind(l);return l.domEl=n,l.height=e,l.width=r,l.type="CANVAS",l.ENV="NODE",l.setClear=function(t){s=t},l.onChange=function(t){i=t},l.getPixels=function(t,e,r,i){return this.ctx.getImageData(t,e,r,i)},l.putPixels=function(t,e,r){return this.ctx.putImageData(t,e,r)},l.clear=function(){s()},l.setContext=function(t,e){this.ctx[t]&&"function"==typeof this.ctx[t]?this.ctx[t].apply(null,e):this.ctx[t]&&(this.ctx[t]=e)},l.setSize=function(i,n){r=i,e=n,this.domEl=new Canvas(r,e),o=this.domEl.getContext("2d",t),this.width=r,this.height=e,this.ctx=o,this.execute()},l.execute=function(){s(o),o.setTransform(a,0,0,a,0,0),l.updateBBox(),u()},l.execute=function(){s(o),o.setTransform(a,0,0,a,0,0),this.updateBBox(),u(),i&&this.stateModified&&i(),this.stateModified=!1},l.update=function(){this.execute()},l.toDataURL=function(t){return this.domEl.toDataURL(t)},l.getPixels=function(t,e,r,i){return new Vi(this.ctx.getImageData(t,e,r,i),r,i)},l.putPixels=function(t,e,r){if(t instanceof Vi)return this.ctx.putImageData(t.imageData,e,r)},l.clear=function(){s()},l.createTexture=function(t){return new wn(this,t)},l.createAsyncTexture=function(t){var e=this;return new Promise((function(r,i){var n=new wn(e,t);n.onLoad((function(){r(n)}))}))},l.setContext=function(t,e){this.ctx[t]&&"function"==typeof this.ctx[t]?this.ctx[t].apply(null,e):this.ctx[t]&&(this.ctx[t]=e)},l.createPattern=Ki,l.createClip=$i,l.createMask=Wi,l}pn.prototype=new ii,pn.prototype.node=function(){return this.updateBBox(),this.dom},pn.prototype.stylesExe=function(){var t,e,r=this.style;for(e in r)"string"==typeof r[e]||"number"==typeof r[e]?t=r[e]:"object"==typeof r[e]?t=r[e]instanceof Hi||r[e]instanceof Ji||r[e]instanceof Qi||r[e]instanceof Zi?r[e].exe(this.ctx,this.dom.BBox):r[e]:"function"==typeof r[e]?(r[e]=r[e].call(this,this.dataObj),t=r[e]):console.log("unkonwn Style"),"function"!=typeof this.ctx[e]?this.ctx[e]=t:"function"==typeof this.ctx[e]?this.ctx[e](t):console.log("junk comp")},pn.prototype.remove=function(){var t=this.dom.parent.children,e=t.indexOf(this);-1!==e&&t.splice(e,1),this.dom.parent.BBoxUpdate=!0,Fi.vDomChanged(this.vDomIndex)},pn.prototype.attributesExe=function(){this.dom.render(this.attr)},pn.prototype.setStyle=function(t,e){if(2===arguments.length)null==e&&null!=this.style[t]?delete this.style[t]:this.style[t]=yn(e);else if(1===arguments.length&&"object"==typeof t)for(var r=Object.keys(t),i=0,n=r.length;i<n;i+=1)null==t[r[i]]&&null!=this.style[r[i]]?delete this.style[r[i]]:this.style[r[i]]=yn(t[r[i]]);return Fi.vDomChanged(this.vDomIndex),this},pn.prototype.setAttr=function(t,e){if(2===arguments.length)null==e&&null!=this.attr[t]?delete this.attr[t]:this.attr[t]=e,this.dom.setAttr(t,e);else if(1===arguments.length&&"object"==typeof t)for(var r=Object.keys(t),i=0;i<r.length;i+=1)null==t[r[i]]&&null!=this.attr[r[i]]?delete this.attr[r[i]]:this.attr[r[i]]=t[r[i]],this.dom.setAttr(r[i],t[r[i]]);return this.BBoxUpdate=!0,Fi.vDomChanged(this.vDomIndex),this},pn.prototype.rotate=function(t,e,r){return this.attr.transform||(this.attr.transform={}),"[object Array]"===Object.prototype.toString.call(t)?this.attr.transform.rotate=[t[0]||0,t[1]||0,t[2]||0]:this.attr.transform.rotate=[t,e||0,r||0],this.dom.setAttr("transform",this.attr.transform),this.BBoxUpdate=!0,Fi.vDomChanged(this.vDomIndex),this},pn.prototype.scale=function(t){return this.attr.transform||(this.attr.transform={}),t.length<1?null:(this.attr.transform.scale=[t[0],t[1]?t[1]:t[0]],this.dom.setAttr("transform",this.attr.transform),this.BBoxUpdate=!0,Fi.vDomChanged(this.vDomIndex),this)},pn.prototype.translate=function(t){return this.attr.transform||(this.attr.transform={}),this.attr.transform.translate=t,this.dom.setAttr("transform",this.attr.transform),this.BBoxUpdate=!0,Fi.vDomChanged(this.vDomIndex),this},pn.prototype.skewX=function(t){return this.attr.transform||(this.attr.transform={}),this.attr.transform.skew||(this.attr.transform.skew=[]),this.attr.transform.skew[0]=t,this.dom.setAttr("transform",this.attr.transform),this.BBoxUpdate=!0,Fi.vDomChanged(this.vDomIndex),this},pn.prototype.skewY=function(t){return this.attr.transform||(this.attr.transform={}),this.attr.transform.skew||(this.attr.transform.skew=[]),this.attr.transform.skew[1]=t,this.dom.setAttr("transform",this.attr.transform),this.BBoxUpdate=!0,Fi.vDomChanged(this.vDomIndex),this},pn.prototype.execute=function(){if("none"!==this.style.display){if(this.ctx.save(),this.stylesExe(),this.attributesExe(),this.dom instanceof dn)for(var t=0,e=this.children.length;t<e;t+=1)this.children[t].execute();this.ctx.restore()}},pn.prototype.prependChild=function(t){var e=this,r=t;if(e.dom instanceof dn)for(var i=0;i<r.length;i+=1)r[i].dom.parent=e,e.children.unshift(r[i]);else console.error("Trying to insert child to nonGroup Element");return this.BBoxUpdate=!0,Fi.vDomChanged(this.vDomIndex),e},pn.prototype.child=function(t){var e=this,r=t;if(e.dom instanceof dn)for(var i=0;i<r.length;i+=1)r[i].dom.parent=e,e.children[e.children.length]=r[i];else console.error("Trying to insert child to nonGroup Element");return this.BBoxUpdate=!0,Fi.vDomChanged(this.vDomIndex),e},pn.prototype.updateBBox=function(){var t;if(this.bbox){for(var e=0,r=this.children.length;e<r;e+=1)this.children[e]&&(t=this.children[e].updateBBox()||t);if(this.BBoxUpdate||t)return this.dom.updateBBox(this.children),this.BBoxUpdate=!1,!0}return!1},pn.prototype.in=function(t){return this.dom.in(t)},pn.prototype.on=function(t,e){if(this.events||(this.events={}),!e&&this.events[t])delete this.events[t];else if(e)if("function"==typeof e){var r=e.bind(this);this.events[t]=function(t){r(t)}}else"object"==typeof e&&(this.events[t]=e,e.constructor!==Ri.constructor&&e.constructor!==ji.constructor||e.bindMethods(this));return this},pn.prototype.animatePathTo=qe.animatePathTo,pn.prototype.morphTo=qe.morphTo,pn.prototype.vDomIndex=null,pn.prototype.createRadialGradient=function(t){return new Hi(t,"radial")},pn.prototype.createLinearGradient=function(t){return new Hi(t,"linear")},pn.prototype.createEls=function(t,e){var r=new Yi({type:"CANVAS",ctx:this.dom.ctx},t,e,this.vDomIndex);return this.child(r.stack),Fi.vDomChanged(this.vDomIndex),r},pn.prototype.text=function(t){return this.dom instanceof rn&&this.dom.text(t),Fi.vDomChanged(this.vDomIndex),this},pn.prototype.createEl=function(t){var e=new pn(this.dom.ctx,t,Xi(),this.vDomIndex);return this.child([e]),Fi.vDomChanged(this.vDomIndex),e},pn.prototype.removeChild=function(t){var e=-1;if(this.children.forEach((function(r,i){r===t&&(e=i)})),-1!==e){var r=this.children.splice(e,1)[0];this.dom.removeChild(r.dom)}this.BBoxUpdate=!0,Fi.vDomChanged(this.vDomIndex)},pn.prototype.getBBox=function(){return{x:this.dom.BBox.x,y:this.dom.BBox.y,width:this.dom.BBox.width,height:this.dom.BBox.height}},pn.prototype.getPixels=function(){return new Vi(this.ctx.getImageData(this.dom.BBox.x,this.dom.BBox.y,this.dom.BBox.width,this.dom.BBox.height),this.dom.BBox.width,this.dom.BBox.height)},pn.prototype.putPixels=function(t){if(t instanceof Vi)return this.ctx.putImageData(t.imageData,this.dom.BBox.x,this.dom.BBox.y)},vn.prototype.setAttr=function(t,e){"height"===t?this.canvas.setAttribute("height",e):"width"===t&&this.canvas.setAttribute("width",e)},wn.prototype=new ii,wn.prototype.constructor=wn,wn.prototype.setSize=function(t,e){var r=this.attr.scale||1;this.rImageObj.setAttr("width",t*r),this.rImageObj.setAttr("height",e*r),mn(this)},wn.prototype.setAttr=function(t,e){var r=this;if("src"===t)if(Array.isArray(e)){var i=e.map((function(t){return new Promise((function(e,r){var i=gn(null,t);i.onload=function(){e(this)},i.onerror=function(t){r(t)}}))}));Promise.all(i).then((function(t){r.image=t,r.imageObj=t[r.seekIndex],r.attr&&r.attr.onload&&"function"==typeof r.attr.onload&&r.attr.onload.call(r,t),r.asyncOnLoad&&"function"==typeof r.asyncOnLoad&&r.asyncOnLoad(t),mn(r)}))}else"string"==typeof e?(r.image||(r.image=gn(r,e)),r.image.src!==e&&(r.image.src=e)):e instanceof HTMLImageElement||e instanceof SVGImageElement||e instanceof HTMLCanvasElement?(r.imageObj=e,r.attr.height=r.attr.height?r.attr.height:e.height,r.attr.width=r.attr.width?r.attr.width:e.width,mn(r)):(e instanceof pn||e instanceof wn)&&(r.imageObj=e.domEl,r.attr.height=r.attr.height?r.attr.height:e.attr.height,r.attr.width=r.attr.width?r.attr.width:e.attr.width,mn(r));this.attr[t]=e,"height"!==t&&"width"!==t||(this.rImageObj.setAttr(t,e),mn(r)),"clip"!==t&&"filter"!==t||mn(r)},wn.prototype.onLoad=function(t){this.asyncOnLoad=t},wn.prototype.clone=function(){var t=Object.assign({},this.attr),e=Object.assign({},this.style);return t.src=this,new wn(this.nodeExe,{attr:t,style:e})},wn.prototype.execute=function(){var t=this.attr,e=t.width;void 0===e&&(e=0);var r=t.height;void 0===r&&(r=0);var i=this.attr.draw||{},n=this.attr.scale||1;this.ctx.clearRect(0,0,e*n,r*n),this.ctx.drawImage(this.imageObj,i.x||0,i.y||0,(i.width||e)*n,(i.height||r)*n)},wn.prototype.next=function(t){Array.isArray(this.image)&&(t<this.image.length&&t>=0?this.seekIndex=t:this.seekIndex<this.image.length-1&&this.seekIndex++,this.imageObj=this.image[this.seekIndex],mn(this))};var An=xn,Bn=bn;function Tn(t){var e;switch(t){case"point":e={vertexShader:"\n          precision highp float;\n          attribute vec2 a_position;\n          attribute vec4 a_color;\n          attribute float a_size;\n          \n          attribute mat3 a_transformMatrix;\n          \n          varying vec4 v_color;\n          void main() {\n            gl_Position = vec4(a_transformMatrix * vec3(a_position, 1), 1);\n            gl_PointSize = a_size;\n            v_color = a_color;\n          }\n          ",fragmentShader:"\n                    precision mediump float;\n                    varying vec4 v_color;\n                    void main() {\n                        gl_FragColor = v_color;\n                    }\n                    "};break;case"circle":e={vertexShader:"\n                  precision highp float;\n                    attribute vec2 a_position;\n                    attribute vec4 a_color;\n                    attribute float a_radius;\n                    attribute mat3 a_transformMatrix;\n                    varying vec4 v_color;\n\n                    void main() {\n                      gl_Position = vec4(a_transformMatrix * vec3(a_position, 1), 1);\n                      gl_PointSize = a_radius; // * a_transform.z * u_transform.z;\n                      v_color = a_color;\n                    }\n                    ",fragmentShader:"\n                    precision mediump float;\n                    varying vec4 v_color;\n                    void main() {\n                      float r = 0.0, delta = 0.0, alpha = 1.0;\n                      vec2 cxy = 2.0 * gl_PointCoord - 1.0;\n                      r = dot(cxy, cxy);\n                      if(r > 1.0) {\n                        discard;\n                      }\n                      delta = 0.09;\n                      alpha = 1.0 - smoothstep(1.0 - delta, 1.0 + delta, r);\n                      gl_FragColor = v_color * alpha;\n                    }\n                    "};break;case"image":e={vertexShader:"\n                    precision highp float;\n                    attribute vec2 a_position;\n                    attribute vec2 a_texCoord;\n                    uniform mat3 u_transformMatrix;\n                    varying vec2 v_texCoord;\n\n                    void main() {\n                      gl_Position = vec4(u_transformMatrix * vec3(a_position, 1), 1);\n                      v_texCoord = a_texCoord;\n                    }\n          ",fragmentShader:"\n                    precision mediump float;\n                    uniform sampler2D u_image;\n                    uniform float u_opacity;\n                    varying vec2 v_texCoord;\n                    void main() {\n                      vec4 col = texture2D(u_image, v_texCoord);\n                      if (col.a == 0.0) {\n                        discard;\n                      } else {\n                        gl_FragColor = col;\n                        gl_FragColor.a *= u_opacity;\n                      }\n                    }\n                    "};break;case"polyline":case"polygon":e={vertexShader:"\n                    precision highp float;\n                    attribute vec2 a_position;\n                    uniform mat3 u_transformMatrix;\n\n                    void main() {\n                      gl_Position = vec4(u_transformMatrix * vec3(a_position, 1), 1);\n                    }\n                    ",fragmentShader:"\n                    precision mediump float;\n                    uniform vec4 u_color;\n                    void main() {\n                        gl_FragColor = u_color;\n                    }\n                    "};break;case"rect":case"line":e={vertexShader:"\n                    precision highp float;\n                    attribute vec2 a_position;\n                    attribute vec4 a_color;\n                    attribute mat3 a_transformMatrix;\n                    varying vec4 v_color;\n\n                    void main() {\n                      gl_Position = vec4(a_transformMatrix * vec3(a_position, 1), 1);\n                      v_color = a_color;\n                    }\n                    ",fragmentShader:"\n                    precision mediump float;\n                    varying vec4 v_color;\n                    void main() {\n                        gl_FragColor = v_color;\n                    }\n                    "};break;default:e={vertexShader:"\n                    precision highp float;\n                    attribute vec2 a_position;\n                    attribute vec4 a_color;\n                    attribute mat3 a_transformMatrix;\n                    varying vec4 v_color;\n\n                    void main() {\n                      gl_Position = vec4(a_transformMatrix * vec3(a_position, 1), 1);\n                      v_color = a_color;\n                    }\n                    ",fragmentShader:"\n                    precision mediump float;\n                    varying vec4 v_color;\n                    void main() {\n                        gl_FragColor = v_color;\n                    }\n                    "}}return e}var kn,Sn=N,En=x,Mn=Ii.zoom(),Cn=Ii.drag();var Dn=0;function _n(){return Dn+=1}function zn(t){var e={translateX:0,translateY:0,scaleX:1,scaleY:1,angle:0};return t&&(t.translate&&t.translate.length>0&&(e.translateX=t.translate[0],e.translateY=t.translate[1]),t.scale&&t.scale.length>0&&(e.scaleX=t.scale[0],e.scaleY=t.scale[1]||e.scaleX),t.rotate&&t.rotate.length>0&&(e.angle=t.rotate[0])),e}function Pn(){var t=this,e=t.attr,r=e.transform,i=e.points;void 0===i&&(i=[]);var n=zn(r),o=n.translateX,a=n.translateY,s=n.scaleX,h=n.scaleY;if(i&&i.length>0){for(var c=i[0].x,l=i[0].x,u=i[0].y,f=i[0].y,d=1;d<i.length;d+=1)c>i[d].x&&(c=i[d].x),l<i[d].x&&(l=i[d].x),u>i[d].y&&(u=i[d].y),f<i[d].y&&(f=i[d].y);t.BBox={x:o+c*s,y:a+u*h,width:(l-c)*s,height:(f-u)*h}}else t.BBox={x:0,y:0,width:0,height:0};r&&r.rotate?t.BBoxHit=Sn.rotateBBox(this.BBox,r):t.BBoxHit=this.BBox}var Ln=function(t,e){var r=t[0],i=t[1],n=t[2],o=t[3],a=t[4],s=t[5],h=t[6],c=t[7],l=t[8],u=e[0],f=e[1],d=e[2],p=e[3],y=e[4],x=e[5],v=e[6],g=e[7],m=e[8];return[u*r+f*o+d*h,u*i+f*a+d*c,u*n+f*s+d*l,p*r+y*o+x*h,p*i+y*a+x*c,p*n+y*s+x*l,v*r+g*o+m*h,v*i+g*a+m*c,v*n+g*s+m*l]},In=function(t,e,r){return r&&r[6]===t&&r[7]===e?r:[1,0,0,0,1,0,t,e,1]},On=function(t){var e=Math.cos(t),r=Math.sin(t);return[e,-r,0,r,e,0,0,0,1]},Fn=function(t,e){return[t,0,0,0,e,0,0,0,1]},Nn=function(){return[1,0,0,0,1,0,0,0,1]},Rn=function(t,e){return[2/t,0,0,0,-2/e,0,-1,1,1]};function jn(t){var e=this.attr.transform,r=t||this.projectionMatrix;if(e&&e.translate&&(this.translationMatrix=In(e.translate[0],e.translate[1],this.translationMatrix),r=Ln(r,this.translationMatrix)),e&&e.rotate){var i=Math.PI/180*e.rotate[0];this.rotationMatrix=On(i),this.rotationCentric=In(e.rotate[1]||0,e.rotate[2]||0,this.rotationCentric),r=Ln(r,this.rotationMatrix)}e&&e.scale&&(this.scaleMatrix=Fn(e.scale[0],e.scale[1]),r=Ln(r,this.scaleMatrix)),this.rotationCentric&&(r=Ln(r,this.rotationCentric)),this.transformMatrix=r}var Xn=function(){ai.apply(this,arguments)};function Yn(t,e,r){var i=t.createShader(r);if(t.shaderSource(i,e),t.compileShader(i),!t.getShaderParameter(i,t.COMPILE_STATUS)){var n=t.getShaderInfoLog(i);return console.error("*** Error compiling shader '"+i+"':"+n),t.deleteShader(i),null}return i}function Gn(t,e){return function(t,e){var r=t.createProgram();if(e.forEach((function(e){t.attachShader(r,e)})),t.linkProgram(r),!t.getProgramParameter(r,t.LINK_STATUS)){var i=t.getProgramInfoLog(r);return console.error("Error in program linking:"+i),t.deleteProgram(r),null}return r}(t,[Yn(t,e.vertexShader,t.VERTEX_SHADER),Yn(t,e.fragmentShader,t.FRAGMENT_SHADER)])}function Un(){this.BBox={x:0,y:0,width:0,height:0},this.BBoxHit={x:0,y:0,width:0,height:0}}function qn(t,e,r){this.ctx=t,this.attr=e||{},this.style=r||{},this.projectionMatrix=Rn(this.ctx.canvas.width/kn,this.ctx.canvas.height/kn),this.transformMatrix=Ln(this.projectionMatrix,Nn()),this.attr.transform&&this.exec(jn,null)}function Hn(t,e,r){this.ctx=t,this.attr=e||{},this.style=r||{},this.projectionMatrix=Rn(this.ctx.canvas.width/kn,this.ctx.canvas.height/kn),this.transformMatrix=Ln(this.projectionMatrix,Nn()),this.attr.transform&&this.exec(jn,null)}function Vn(t,e,r){var i=this;this.ctx=t,this.attr=e,this.style=r,this.pointsGeometry=[],this.transform=[0,0,1,1],this.projectionMatrix=Rn(this.ctx.canvas.width/kn,this.ctx.canvas.height/kn),i.attr.d&&(qe.isTypePath(i.attr.d)?(i.path=i.attr.d,i.attr.d=i.attr.d.fetchPathString()):i.path=qe.instance(i.attr.d),this.points=new Float32Array(this.path.getPoints())),this.style.stroke&&(this.color=new Float32Array([this.style.stroke.r/255,this.style.stroke.g/255,this.style.stroke.b/255,void 0===this.style.stroke.a?1:this.style.stroke.a/255])),this.transformMatrix=Ln(this.projectionMatrix,Nn()),this.attr.transform&&this.exec(jn,null)}function Zn(t,e,r){this.ctx=t,this.attr=e||{},this.style=r||{},this.points=[],this.transform=[0,0,1,1];var i=[];if(this.projectionMatrix=Rn(this.ctx.canvas.width/kn,this.ctx.canvas.height/kn),this.attr.points){for(var n=this.attr.points,o=0,a=n.length;o<a;o++)i[2*o]=n[o].x,i[2*o+1]=n[o].y;this.points=new Float32Array(i)}this.style.stroke&&(this.color=new Float32Array([this.style.stroke.r/255,this.style.stroke.g/255,this.style.stroke.b/255,void 0===this.style.stroke.a?1:this.style.stroke.a/255])),this.transformMatrix=Ln(this.projectionMatrix,Nn()),this.attr.transform&&this.exec(jn,null)}function Wn(t,e,r){this.ctx=t,this.attr=e||{},this.style=r||{},this.projectionMatrix=Rn(this.ctx.canvas.width/kn,this.ctx.canvas.height/kn),this.transformMatrix=Ln(this.projectionMatrix,Nn()),this.attr.transform&&this.exec(jn,null)}function Qn(t){return Ce(t.reduce((function(t,e){return t[t.length]=e.x,t[t.length]=e.y,t}),[])).map((function(e){return t[e]}))}function $n(t,e,r){this.ctx=t,this.attr=e,this.style=r,this.positionArray=[],this.transform=[0,0,1,1];var i=[];if(this.projectionMatrix=Rn(this.ctx.canvas.width/kn,this.ctx.canvas.height/kn),this.attr.points){for(var n=Qn(this.attr.points),o=0,a=n.length;o<a;o++)i[2*o]=n[o].x,i[2*o+1]=n[o].y;this.points=new Float32Array(i)}this.style.fill&&(this.color=new Float32Array([this.style.stroke.r/255,this.style.stroke.g/255,this.style.stroke.b/255,void 0===this.style.stroke.a?1:this.style.stroke.a/255])),this.transformMatrix=Ln(this.projectionMatrix,Nn()),this.attr.transform&&this.exec(jn,null)}function Jn(t,e,r){this.ctx=t,this.attr=e,this.style=r,this.projectionMatrix=Rn(this.ctx.canvas.width/kn,this.ctx.canvas.height/kn),this.transformMatrix=Ln(this.projectionMatrix,Nn()),this.attr.transform&&this.exec(jn,null)}(Xn.prototype=new ai).constructor=Xn,Xn.prototype.createNode=function(t,e,r){return new _o(t,e,_n(),r)},Un.prototype.exec=function(t,e){"function"!=typeof t&&console.error("Wrong Exe type"),t.call(this,e)},Un.prototype.setStyle=function(t,e){e?(this.style[t]=e,this.shader&&"fill"===t&&(void 0!==this.style.opacity&&(e.a*=this.style.opacity),this.shader.indexBased&&this.shader.updateColor(this.pindex,e)),this.shader&&"opacity"===t&&(void 0!==this.style.fill&&(this.style.fill.a*=this.style.opacity),this.shader.updateColor(this.pindex,this.style.fill))):this.style[t]&&delete this.style[t]},Un.prototype.getAttr=function(t){return this.attr[t]},Un.prototype.getStyle=function(t){return this.style[t]},qn.prototype=new Un,qn.prototype.constructor=qn,qn.prototype.setShader=function(t){this.shader=t,this.shader&&(this.shader.addVertex(this.attr.x||0,this.attr.y||0,this.pindex),this.shader.addColors(this.style.fill||oo,this.pindex),this.shader.addSize(this.attr.size||0,this.pindex),this.shader.addTransform(this.transformMatrix,this.pindex))},qn.prototype.setAttr=function(t,e){this.attr[t]=e,"transform"===t&&this.exec(jn,this.p_matrix),this.shader&&("x"===t||"y"===t?this.shader.updateVertex(this.pindex,this.attr.x,this.attr.y):"size"===t?this.shader.updateSize(this.pindex,this.attr.size||0):"transform"===t&&this.shader.updateTransform(this.pindex,this.transformMatrix))},qn.prototype.applyTransformationMatrix=function(t){this.p_matrix=t,this.exec(jn,t),this.shader&&this.shader.addTransform(this.transformMatrix,this.pindex)},qn.prototype.in=function(t){var e=this.attr,r=e.x;void 0===r&&(r=0);var i=e.y;void 0===i&&(i=0);var n=e.size;return void 0===n&&(n=0),t.x>=r&&t.x<=r+n&&t.y>=i&&t.y<=i+n},qn.prototype.updateBBox=function(){var t=this,e=t.attr,r=e.transform,i=e.x;void 0===i&&(i=0);var n=e.y;void 0===n&&(n=0);var o=e.size;void 0===o&&(o=0);var a=zn(r),s=a.translateX,h=a.translateY,c=a.scaleX,l=a.scaleY;t.BBox={x:s+i*c,y:h+n*l,width:o*c,height:o*l},r&&r.rotate?t.BBoxHit=Sn.rotateBBox(this.BBox,r):t.BBoxHit=this.BBox},Hn.prototype=new Un,Hn.prototype.constructor=Hn,Hn.prototype.setShader=function(t){this.shader=t,this.shader&&(this.shader.addVertex(this.attr.x||0,this.attr.y||0,this.attr.width||0,this.attr.height||0,this.pindex),this.shader.addColors(this.style.fill||oo,this.pindex),this.shader.addTransform(this.transformMatrix,this.pindex))},Hn.prototype.applyTransformationMatrix=function(t){this.p_matrix=t,this.exec(jn,t),this.shader&&this.shader.addTransform(this.transformMatrix,this.pindex)},Hn.prototype.setAttr=function(t,e){this.attr[t]=e,"transform"===t&&this.exec(jn,this.p_matrix),this.shader&&("x"===t||"width"===t||"y"===t||"height"===t?this.shader.updateVertex(this.pindex,this.attr.x||0,this.attr.y||0,this.attr.width||0,this.attr.height||0):"transform"===t&&this.shader.updateTransform(this.pindex,this.transformMatrix))},Hn.prototype.in=function(t){var e=this.attr,r=e.x;void 0===r&&(r=0);var i=e.y;void 0===i&&(i=0);var n=e.width;void 0===n&&(n=0);var o=e.height;return void 0===o&&(o=0),t.x>=r&&t.x<=r+n&&t.y>=i&&t.y<=i+o},Hn.prototype.updateBBox=function(){var t=this,e=t.attr,r=e.transform,i=e.x;void 0===i&&(i=0);var n=e.y;void 0===n&&(n=0);var o=e.width;void 0===o&&(o=0);var a=e.height;void 0===a&&(a=0);var s=zn(r),h=s.translateX,c=s.translateY,l=s.scaleX,u=s.scaleY;t.BBox={x:h+i*l,y:c+n*u,width:o*l,height:a*u},r&&r.rotate?t.BBoxHit=Sn.rotateBBox(this.BBox,r):t.BBoxHit=this.BBox},Vn.prototype=new Un,Vn.prototype.constructor=Vn,Vn.prototype.setShader=function(t){this.shader=t},Vn.prototype.applyTransformationMatrix=function(t){this.p_matrix=t,this.exec(jn,t)},Vn.prototype.setAttr=function(t,e){this.attr[t]=e,null!==e?"d"===t?(qe.isTypePath(e)?(this.path=e,this.attr.d=e.fetchPathString()):this.path=qe.instance(this.attr.d),this.points=new Float32Array(this.path.getPoints())):"transform"===t&&this.exec(jn,this.p_matrix):delete this.attr[t]},Vn.prototype.updateBBox=function(){var t=this,e=t.attr.transform,r=zn(e),i=r.translateX,n=r.translateY,o=r.scaleX,a=r.scaleY;t.BBox=t.path?t.path.BBox:{x:0,y:0,width:0,height:0},t.BBox.x=i+t.BBox.x*o,t.BBox.y=n+t.BBox.y*a,t.BBox.width*=o,t.BBox.height*=a,e&&e.rotate?t.BBoxHit=Sn.rotateBBox(this.BBox,e):t.BBoxHit=this.BBox},Zn.prototype=new Un,Zn.prototype.constructor=Zn,Zn.prototype.setShader=function(t){this.shader=t},Zn.prototype.applyTransformationMatrix=function(t){this.p_matrix=t,this.exec(jn,t)},Zn.prototype.setAttr=function(t,e){if(this.attr[t]=e,"points"===t){for(var r=this.attr.points,i=[],n=0,o=r.length;n<o;n++)i[2*n]=r[n].x,i[2*n+1]=r[n].y;this.points=new Float32Array(i)}else"transform"===t&&this.exec(jn,this.p_matrix)},Zn.prototype.updateBBox=Pn,Zn.prototype.setStyle=function(t,e){this.style[t]=e,"stroke"===t&&(this.color=new Float32Array([this.style.stroke.r/255,this.style.stroke.g/255,this.style.stroke.b/255,void 0===this.style.stroke.a?1:this.style.stroke.a/255]))},Wn.prototype=new Un,Wn.prototype.constructor=Wn,Wn.prototype.setShader=function(t){this.shader=t;var e=this.attr,r=e.x1;void 0===r&&(r=0);var i=e.y1;void 0===i&&(i=0);var n=e.x2;void 0===n&&(n=r);var o=e.y2;void 0===o&&(o=i),this.shader&&(this.shader.addVertex(r,i,n,o,this.pindex),this.shader.addColors(this.style.stroke||oo,this.pindex),this.shader.addTransform(this.transformMatrix,this.pindex))},Wn.prototype.applyTransformationMatrix=function(t){this.p_matrix=t,this.exec(jn,t),this.shader&&this.shader.addTransform(this.transformMatrix,this.pindex)},Wn.prototype.setAttr=function(t,e){this.attr[t]=e,null!==e||null===this.attr[t]?("transform"===t&&this.exec(jn,this.p_matrix),!this.shader||"x1"!==t&&"y1"!==t&&"x2"!==t&&"y2"!==t?this.shader&&"transform"===t&&this.shader.updateTransform(this.pindex,this.transformMatrix):this.shader.updateVertex(this.pindex,this.attr.x1,this.attr.y1,this.attr.x2,this.attr.y2)):delete this.attr[t]},Wn.prototype.updateBBox=function(){var t=this,e=t.attr,r=e.transform,i=e.x1;void 0===i&&(i=0);var n=e.y1;void 0===n&&(n=0);var o=e.x2;void 0===o&&(o=0);var a=e.y2;void 0===a&&(a=0);var s=zn(r),h=s.translateX,c=s.translateY,l=s.scaleX,u=s.scaleY;t.BBox={x:h+(i<o?i:o)*l,y:c+(n<a?n:a)*u,width:Math.abs(o-i)*l,height:Math.abs(a-n)*u},r&&r.rotate?t.BBoxHit=Sn.rotateBBox(this.BBox,r):t.BBoxHit=this.BBox},$n.prototype=new Un,$n.prototype.constructor=$n,$n.prototype.setShader=function(t){this.shader=t},$n.prototype.applyTransformationMatrix=function(t){this.p_matrix=t,this.exec(jn,t)},$n.prototype.setAttr=function(t,e){if(this.attr[t]=e,null!==e)if("points"===t){for(var r=[],i=Qn(e),n=0,o=i.length;n<o;n++)r[2*n]=i[n].x,r[2*n+1]=i[n].y;this.points=new Float32Array(r)}else"transform"===t&&this.exec(jn,this.p_matrix);else delete this.attr[t]},$n.prototype.setStyle=function(t,e){this.style[t]=e,"fill"===t&&(this.color=new Float32Array([this.style.fill.r/255,this.style.fill.g/255,this.style.fill.b/255,void 0===this.style.fill.a?1:this.style.fill.a/255]))},$n.prototype.updateBBox=Pn,Jn.prototype=new Un,Jn.prototype.constructor=Jn,Jn.prototype.setShader=function(t){this.shader=t,this.shader&&(this.shader.addVertex(this.attr.cx||0,this.attr.cy||0,this.pindex),this.shader.addColors(this.style.fill||oo,this.pindex),this.shader.addSize(this.attr.r||0,this.pindex),this.shader.addTransform(this.transformMatrix,this.pindex))},Jn.prototype.applyTransformationMatrix=function(t){this.p_matrix=t,this.exec(jn,t),this.shader&&this.shader.addTransform(this.transformMatrix,this.pindex)},Jn.prototype.setAttr=function(t,e){this.attr[t]=e,null!==e?("transform"===t&&this.exec(jn,this.p_matrix),"cx"!==t&&"cy"!==t||!this.shader?"r"===t&&this.shader?this.shader.updateSize(this.pindex,this.attr.r||0):"transform"===t&&this.shader&&this.shader.updateTransform(this.pindex,this.transformMatrix):this.shader.updateVertex(this.pindex,this.attr.cx,this.attr.cy)):delete this.attr[t]},Jn.prototype.in=function(t,e){var r=this.attr,i=r.r;void 0===i&&(i=0);var n=r.cx;void 0===n&&(n=0);var o=r.cy;return void 0===o&&(o=0),Math.sqrt((t.x-n)*(t.x-n)+(t.y-o)*(t.y-o))<=i},Jn.prototype.updateBBox=function(){var t=this,e=t.attr,r=e.transform,i=e.r;void 0===i&&(i=0);var n=e.cx;void 0===n&&(n=0);var o=e.cy;void 0===o&&(o=0);var a=zn(r),s=a.translateX,h=a.translateY,c=a.scaleX,l=a.scaleY;t.BBox={x:s+(n-i)*c,y:h+(o-i)*l,width:2*i*c,height:2*i*l},r&&r.rotate?t.BBoxHit=Sn.rotateBBox(this.BBox,r):t.BBoxHit=this.BBox};var Kn={};function to(t){return 0==(t&t-1)}function eo(t,e){var r=document.createElement("canvas"),i=r.getContext("2d");(e=e||{fill:"#fff"}).font||(e.font="10px Arial");var n=parseFloat(e.font,10)||12;i.font=e.font;var o=i.measureText(t).width,a=n;for(var s in r.setAttribute("height",a*kn),r.setAttribute("width",o*kn),r.style.width=o,r.style.height=a,e.font=n*kn+(isNaN(parseFloat(e.font,10))?e.font:e.font.substring(n.toString().length)),e)i[s]=e[s];return i.fillText(t,0,.75*a*kn),{dom:r,ctx:i,width:o,height:a,ratio:kn,style:e,str:t,updateText:function(){for(var t in function(t,e,r,i){t.clearRect(0,0,e*i,r*i)}(this.ctx,this.width,this.height,this.ratio),this.style)this.ctx[t]=this.style[t];this.ctx.fillText(this.str,0,.75*this.height)}}}function ro(t,e,r,i){var n=this;this.ctx=t,this.attr=e,this.style=r,this.vDomIndex=i,this.positionArray=new Float32Array(12),this.transform=[0,0,1,1],this.projectionMatrix=Rn(this.ctx.canvas.width/kn,this.ctx.canvas.height/kn),this.transformMatrix=Ln(this.projectionMatrix,Nn()),this.attr.transform&&this.exec(jn,null),n.attr.text&&"string"==typeof n.attr.text&&(this.text=eo(n.attr.text,n.style),this.attr.width=this.text.width,this.attr.height=this.text.height),this.text&&(this.textureNode=new Lo(t,{src:this.text.dom},this.vDomIndex))}function io(t,e,r,i){var n=this;if(this.ctx=t,this.attr=e,this.style=r,this.vDomIndex=i,this.positionArray=new Float32Array(12),this.transform=[0,0,1,1],this.projectionMatrix=Rn(this.ctx.canvas.width/kn,this.ctx.canvas.height/kn),this.transformMatrix=Ln(this.projectionMatrix,Nn()),this.attr.transform&&this.exec(jn,null),n.attr.src&&"string"==typeof n.attr.src&&!Kn[n.attr.src]?(this.textureNode=new Lo(t,{src:this.attr.src},this.vDomIndex),Kn[n.attr.src]=this.textureNode):n.attr.src&&n.attr.src instanceof ii?this.textureNode=new Lo(t,{src:this.attr.src},this.vDomIndex):"string"==typeof n.attr.src&&Kn[n.attr.src]?this.textureNode=Kn[n.attr.src]:n.attr.src&&n.attr.src instanceof Lo&&(this.textureNode=n.attr.src),this.attr.x||this.attr.y||this.attr.width||this.attr.height){var o=this.attr.x||0,a=this.attr.y||0,s=o+(this.attr.width||0),h=a+(this.attr.height||0);this.positionArray[0]=this.positionArray[4]=this.positionArray[6]=o,this.positionArray[1]=this.positionArray[3]=this.positionArray[9]=a,this.positionArray[2]=this.positionArray[8]=this.positionArray[10]=s,this.positionArray[5]=this.positionArray[7]=this.positionArray[11]=h}}function no(t,e,r,i,n){this.ctx=t,this.attr=e,this.style=r,this.renderTarget=i,this.vDomIndex=n,e.shaderType&&(this.shader=Do(t,e,r,e.shaderType,this.renderTarget,n)),this.projectionMatrix=Rn(this.ctx.canvas.width/kn,this.ctx.canvas.height/kn),this.transformMatrix=Ln(this.projectionMatrix,Nn()),this.attr.transform&&this.exec(jn,null)}ro.prototype=new Un,ro.prototype.constructor=ro,ro.prototype.setShader=function(t){this.shader=t},ro.prototype.setAttr=function(t,e){if(this.attr[t]=e,null!==e){if("text"===t&&"string"==typeof e&&(this.text?this.text=eo(this.attr.text,this.style):this.text=eo(e,this.style),this.attr.width=this.text.width,this.attr.height=this.text.height,this.textureNode?this.textureNode.setAttr("src",this.text.dom):this.textureNode=new Lo(this.ctx,{src:this.text.dom},this.vDomIndex)),"transform"===t)this.exec(jn,this.p_matrix);else if("x"===t||"y"===t){var r=this.attr.x||0,i=this.attr.y||0,n=r+(this.attr.width||0),o=i+(this.attr.height||0);this.positionArray[0]=this.positionArray[4]=this.positionArray[6]=r,this.positionArray[1]=this.positionArray[3]=this.positionArray[9]=i,this.positionArray[2]=this.positionArray[8]=this.positionArray[10]=n,this.positionArray[5]=this.positionArray[7]=this.positionArray[11]=o}}else delete this.attr[t]},ro.prototype.applyTransformationMatrix=function(t){this.p_matrix=t,this.exec(jn,t)},ro.prototype.setStyle=function(t,e){if(this.style[t]=e,this.text)if(this.text.style[t]=e,"font"===t){var r=parseFloat(e,10)||12;this.text.ctx.font=e;var i=this.text.ctx.measureText(this.attr.text).width,n=r;this.text.style.font=r*kn+(isNaN(parseFloat(e,10))?this.style.font:this.style.font.substring(r.toString().length)),this.text.updateText(),this.text.dom.setAttribute("height",n*kn),this.text.dom.setAttribute("width",i*kn),this.attr.width=i,this.attr.height=n,this.shader.updateVertexX(this.pindex,this.attr.x||0,this.attr.width||0),this.shader.updateVertexY(this.pindex,this.attr.y||0,this.attr.height||0)}else this.text.style[t]=e,this.text.updateText(),this.textureNode.setAttr("src",this.text.dom)},ro.prototype.getAttr=function(t){return this.attr[t]},ro.prototype.getStyle=function(t){return this.style[t]},ro.prototype.in=function(t){var e=this.attr,r=e.width;void 0===r&&(r=0);var i=e.height;void 0===i&&(i=0);var n=e.x;void 0===n&&(n=0);var o=e.y;return void 0===o&&(o=0),t.x>=n&&t.x<=n+r&&t.y>=o&&t.y<=o+i},ro.prototype.updateBBox=function(){var t=this,e=t.attr,r=e.transform,i=e.x;void 0===i&&(i=0);var n=e.y;void 0===n&&(n=0);var o=e.width;void 0===o&&(o=0);var a=e.height;void 0===a&&(a=0);var s=zn(r),h=s.translateX,c=s.translateY,l=s.scaleX,u=s.scaleY;t.BBox={x:(h+i)*l,y:(c+n)*u,width:o*l,height:a*u},r&&r.rotate?t.BBoxHit=Sn.rotateBBox(this.BBox,r):t.BBoxHit=this.BBox},io.prototype=new Un,io.prototype.constructor=io,io.prototype.setShader=function(t){this.shader=t},io.prototype.applyTransformationMatrix=function(t){this.p_matrix=t,this.exec(jn,t)},io.prototype.setAttr=function(t,e){if(this.attr[t]=e,null!==e)if("src"===t&&"string"==typeof e)e&&!Kn[e]?(this.textureNode=new Lo(this.ctx,{src:e},this.vDomIndex),Kn[e]=this.textureNode):e&&Kn[e]&&(this.textureNode=Kn[e]);else if("src"===t&&e instanceof ii)this.textureNode=new Lo(this.ctx,{src:e},this.vDomIndex);else if("src"===t&&e instanceof Lo)this.textureNode=e;else if("x"===t||"width"===t||"y"===t||"height"===t){var r=this.attr.x||0,i=this.attr.y||0,n=r+(this.attr.width||0),o=i+(this.attr.height||0);this.positionArray[0]=this.positionArray[4]=this.positionArray[6]=r,this.positionArray[1]=this.positionArray[3]=this.positionArray[9]=i,this.positionArray[2]=this.positionArray[8]=this.positionArray[10]=n,this.positionArray[5]=this.positionArray[7]=this.positionArray[11]=o}else"transform"===t&&this.exec(jn,this.p_matrix);else delete this.attr[t]},io.prototype.setStyle=function(t,e){e?this.style[t]=e:this.style[t]&&delete this.style[t]},io.prototype.getAttr=function(t){return this.attr[t]},io.prototype.getStyle=function(t){return this.style[t]},io.prototype.in=function(t){var e=this.attr,r=e.width;void 0===r&&(r=0);var i=e.height;void 0===i&&(i=0);var n=e.x;void 0===n&&(n=0);var o=e.y;return void 0===o&&(o=0),t.x>=n&&t.x<=n+r&&t.y>=o&&t.y<=o+i},io.prototype.updateBBox=function(){var t=this,e=t.attr,r=e.transform,i=e.x;void 0===i&&(i=0);var n=e.y;void 0===n&&(n=0);var o=e.width;void 0===o&&(o=0);var a=e.height;void 0===a&&(a=0);var s=zn(r),h=s.translateX,c=s.translateY,l=s.scaleX,u=s.scaleY;t.BBox={x:(h+i)*l,y:(c+n)*u,width:o*l,height:a*u},r&&r.rotate?t.BBoxHit=Sn.rotateBBox(this.BBox,r):t.BBoxHit=this.BBox},no.prototype=new Un,no.prototype.constructor=no,no.prototype.applyTransformationMatrix=function(t){this.p_matrix=t,this.exec(jn,t),this.transformMatrix=Ln(this.transformMatrix,t)},no.prototype.setAttr=function(t,e){this.attr[t]=e,"shaderType"===t&&(this.shader=Do(this.ctx,this.attr,this.style,e,this.renderTarget,this.vDomIndex)),"transform"===t&&this.exec(jn,this.p_matrix)},no.prototype.setShader=function(){},no.prototype.in=function(t){var e=t.x,r=t.y,i=this.BBox,n=zn(this.attr.transform),o=n.translateX,a=n.translateY,s=n.scaleX,h=n.scaleY;return e>=(i.x-o)/s&&e<=(i.x-o+i.width)/s&&r>=(i.y-a)/h&&r<=(i.y-a+i.height)/h},no.prototype.updateBBox=function(t){var e,r,i,n,o=this,a=zn(o.attr.transform),s=a.translateX,h=a.translateY,c=a.scaleX,l=a.scaleY;if(o.BBox={},t&&t.length>0)for(var u,f,d,p=0;p<t.length;p+=1)(u=t[p])&&(f=u.dom.BBoxHit.x,d=u.dom.BBoxHit.y,e=void 0===e||e>f?f:e,i=void 0===i||i>d?d:i,r=void 0===r||r<f+u.dom.BBoxHit.width?f+u.dom.BBoxHit.width:r,n=void 0===n||n<d+u.dom.BBoxHit.height?d+u.dom.BBoxHit.height:n);e=void 0===e?0:e,i=void 0===i?0:i,r=void 0===r?0:r,n=void 0===n?0:n,o.BBox.x=s+e*c,o.BBox.y=h+i*l,o.BBox.width=Math.abs(r-e)*c,o.BBox.height=Math.abs(n-i)*l,o.attr.transform&&o.attr.transform.rotate?o.BBoxHit=Sn.rotateBBox(this.BBox,this.attr.transform):o.BBoxHit=this.BBox};var oo=tr.rgba(0,0,0,255);function ao(t,e,r,i){var n=i.type;n||(n="FLOAT",i.value instanceof Float32Array?n="FLOAT":i.value instanceof Int8Array?n="BYTE":i.value instanceof Int16Array?n="SHORT":i.value instanceof Uint8Array?n="UNSIGNED_BYTE":i.value instanceof Uint16Array&&(n="UNSIGNED_SHORT"));var o=t.createBuffer(),a={bufferType:t.ARRAY_BUFFER,buffer:o,drawType:t.STATIC_DRAW,valueType:t[n],size:i.size,attributeLocation:t.getAttribLocation(e,r),value:i.value,attr:r};return t.bindBuffer(a.bufferType,a.buffer),t.bufferData(a.bufferType,a.value,a.drawType),a}function so(t,e,r,i){var n,o=i.size?i.size:i.value.length;return i.matrix?Number.isInteger(Math.sqrt(i.value.length))?n="uniformMatrix"+Math.sqrt(i.value.length)+"fv":console.error("Not Square Matrix"):i.value instanceof Lo?n="uniform1i":i.value instanceof Float32Array?n="uniform"+o+"fv":i.value instanceof Int8Array||i.value instanceof Int16Array||i.value instanceof Uint8Array?n="uniform"+o+"iv":Number.isInteger(i.value)?Number.isInteger(i.value)&&(n="uniform1i"):n="uniform1f",{matrix:i.matrix,transpose:void 0!==i.transpose&&i.transpose,type:n,value:i.value,uniformLocation:t.getUniformLocation(e,r)}}function ho(t,e,r){for(var i in this.ctx=t,this.dom={BBoxHit:{x:0,y:0,height:0,width:0}},this.shader=e,this.vDomIndex=r,this.program=Gn(t,e),this.uniforms={},this.attr={},this.attrObjs={},this.indexesObj=null,this.preDraw=e.preDraw,this.postDraw=e.postDraw,this.geometry=e.geometry,this.renderTarget=e.renderTarget,e.uniforms)this.uniforms[i]=so(t,this.program,i,e.uniforms[i]);for(var n in this.geometry&&(this.geometry instanceof Fo||this.geometry instanceof No||this.geometry instanceof Ro?(this.attributes=this.geometry.attributes,this.indexes=this.geometry.indexes):console.error("Wrong Geometry type")),this.attributes)this.attrObjs[n]=ao(t,this.program,n,this.attributes[n]);this.indexes&&(this.indexesObj=function(t,e,r){var i="FLOAT";return r.value instanceof Float32Array?i="FLOAT":r.value instanceof Int8Array?i="BYTE":r.value instanceof Int16Array?i="SHORT":r.value instanceof Uint8Array?i="UNSIGNED_BYTE":r.value instanceof Uint16Array&&(i="UNSIGNED_SHORT"),{bufferType:t.ELEMENT_ARRAY_BUFFER,buffer:t.createBuffer(),drawType:t.STATIC_DRAW,valueType:t[i],value:r.value,count:r.count,offset:r.offset}}(t,this.program,this.indexes))}function co(){}function lo(t,e,r,i){t.transform=t.transformTyped&&t.transformTyped.length>0?Array.from(t.transformTyped):t.transform,t.transformTyped=null;for(var n=e*r*9,o=0;o<r;)t.transform[n+9*o]=i[0],t.transform[n+9*o+1]=i[1],t.transform[n+9*o+2]=i[2],t.transform[n+9*o+3]=i[3],t.transform[n+9*o+4]=i[4],t.transform[n+9*o+5]=i[5],t.transform[n+9*o+6]=i[6],t.transform[n+9*o+7]=i[7],t.transform[n+9*o+8]=i[8],o++;t.addTransform_=!0,t.transformUpdate=!0}function uo(t,e,r,i){for(var n=t.addTransform_?t.transform:t.transformTyped,o=e*r*9,a=0;a<r;)n[o+9*a]=i[0],n[o+9*a+1]=i[1],n[o+9*a+2]=i[2],n[o+9*a+3]=i[3],n[o+9*a+4]=i[4],n[o+9*a+5]=i[5],n[o+9*a+6]=i[6],n[o+9*a+7]=i[7],n[o+9*a+8]=i[8],a++;t.updateTransform_=!0}function fo(t,e,r){for(var i=t.addTransform_?t.transform:t.transformTyped,n=e*r*9,o=0;o<r;)i[n+9*o]=void 0,i[n+9*o+1]=void 0,i[n+9*o+2]=void 0,i[n+9*o+3]=void 0,i[n+9*o+4]=void 0,i[n+9*o+5]=void 0,i[n+9*o+6]=void 0,i[n+9*o+7]=void 0,i[n+9*o+8]=void 0,o++;t.clearTransform_=!0,t.filterTransformUpdate=!0}function po(t){t.addTransform_&&(t.clearTransform_&&(t.transform=t.transform.filter((function(t){return!isNaN(t)})),t.clearTransform_=!1),t.transformTyped=new Float32Array(t.transform),t.transform=[],t.addTransform_=!1,t.updateTransform_=!1,t.shaderInstance.setAttributeData("a_transformMatrix",t.transformTyped)),t.clearTransform_&&(t.transformTyped=t.transformTyped.filter((function(t){return!isNaN(t)})),t.clearTransform_=!1,t.shaderInstance.setAttributeData("a_transformMatrix",t.transformTyped)),t.updateTransform_&&(t.shaderInstance.setAttributeData("a_transformMatrix",t.transformTyped),t.updateTransform_=!1)}function yo(t,e,r,i){t.positionArray=t.typedPositionArray&&t.typedPositionArray.length>0?Array.from(t.typedPositionArray):t.positionArray,t.typedPositionArray=null;for(var n=e*r*2,o=0;o<i.length;)t.positionArray[n+o]=i[o],o++;t.addVertex_=!0}function xo(t,e,r,i){var n=t.addVertex_?t.positionArray:t.typedPositionArray,o=e*r*2,a=0;for(isNaN(n[o])&&console.log("overriding Nan");a<i.length;)n[o+a]=i[a],a++;t.updateVertex_=!0}function vo(t,e,r){for(var i=t.addVertex_?t.positionArray:t.typedPositionArray,n=e*r*2,o=0;o<r;)i[n+2*o]=void 0,i[n+2*o+1]=void 0,o++;t.filterVertex_=!0}function go(t){t.addVertex_&&(t.filterVertex_&&(t.positionArray=t.positionArray.filter((function(t){return!isNaN(t)})),t.filterVertex_=!1),t.typedPositionArray=new Float32Array(t.positionArray),t.positionArray=[],t.addVertex_=!1,t.updateVertex_=!1,t.shaderInstance.setAttributeData("a_position",t.typedPositionArray)),t.filterVertex_&&(t.typedPositionArray=t.typedPositionArray.filter((function(t){return!isNaN(t)})),t.filterVertex_=!1,t.shaderInstance.setAttributeData("a_position",t.typedPositionArray)),t.updateVertex_&&(t.shaderInstance.setAttributeData("a_position",t.typedPositionArray),t.updateVertex_=!1)}function mo(t,e,r,i){t.colorArray=t.typedColorArray&&t.typedColorArray.length>0?Array.from(t.typedColorArray):t.colorArray,t.typedColorArray=null;var n=e*r*4,o=0;for(i=tr.colorToRGB(i);o<r;)t.colorArray[n+4*o]=i.r/255,t.colorArray[n+4*o+1]=i.g/255,t.colorArray[n+4*o+2]=i.b/255,t.colorArray[n+4*o+3]=void 0===i.a?1:i.a/255,o++;t.addColor_=!0}function wo(t,e,r,i){var n=t.addColor_?t.colorArray:t.typedColorArray;isNaN(n[e*r*4])&&console.log("overriding Nan");for(var o=e*r*4,a=0;a<r;)n[o+4*a]=i.r/255,n[o+4*a+1]=i.g/255,n[o+4*a+2]=i.b/255,n[o+4*a+3]=void 0===i.a?1:i.a/255,a++;t.updateColor_=!0}function bo(t,e,r){var i=t.addColor_?t.colorArray:t.typedColorArray;isNaN(i[e*r*4])&&console.log("overriding Nan");for(var n=e*r*4,o=0;o<r;)i[n+4*o]=void 0,i[n+4*o+1]=void 0,i[n+4*o+2]=void 0,i[n+4*o+3]=void 0,o++;t.filterColor_=!0}function Ao(t){t.addColor_&&(t.filterColor_&&(t.colorArray=t.colorArray.filter((function(t){return!isNaN(t)})),t.filterColor_=!1),t.typedColorArray=new Float32Array(t.colorArray),t.colorArray=[],t.addColor_=!1,t.updateColor_=!1,t.shaderInstance.setAttributeData("a_color",t.typedColorArray)),t.filterColor_&&(t.typedColorArray=t.typedColorArray.filter((function(t){return!isNaN(t)})),t.shaderInstance.setAttributeData("a_color",t.typedColorArray),t.filterColor_=!1),t.updateColor_&&(t.shaderInstance.setAttributeData("a_color",t.typedColorArray),t.updateColor_=!1)}function Bo(t,e,r,i){this.ctx=t,this.dom={},this.attr=e||{},this.style=r||{},this.vDomIndex=i,this.indexBased=!0,this.transform=[],this.selftransform=[0,0,1,1],this.attr.transform||(this.attr.transform={translate:[0,0],scale:[1,1]}),this.geometry=new No,this.geometry.setAttr("a_color",{value:new Float32Array([]),size:4}),this.geometry.setAttr("a_size",{value:new Float32Array([]),size:1}),this.geometry.setAttr("a_position",{value:new Float32Array([]),size:2}),this.geometry.setAttr("a_transformMatrix",{value:new Float32Array(this.transform),size:3}),this.shaderInstance=new ho(t,{fragmentShader:Tn("point").fragmentShader,vertexShader:Tn("point").vertexShader,uniforms:{},geometry:this.geometry},i),this.positionArray=[],this.colorArray=[],this.pointsSize=[],this.transform=[],this.vertexUpdate=!0,this.colorUpdate=!0,this.sizeUpdate=!0,this.transformUpdate=!0}function To(t,e,r,i,n){this.ctx=t,this.dom={},this.positionArray=[],this.colorArray=[],this.transform=[],this.rotate=[],this.attr=e||{},this.style=r||{},this.vDomIndex=n,this.renderTarget=i,this.indexBased=!0,this.selftransform=[0,0,1,1],this.attr.transform||(this.attr.transform={translate:[0,0],scale:[1,1]}),this.geometry=new Fo,this.geometry.setAttr("a_transformMatrix",{value:new Float32Array(this.transform),size:3}),this.geometry.setAttr("a_color",{value:new Float32Array(this.colorArray),size:4}),this.geometry.setAttr("a_position",{value:new Float32Array(this.positionArray),size:2}),this.geometry.setDrawRange(0,this.positionArray.length/2),this.shaderInstance=new ho(t,{fragmentShader:Tn("rect").fragmentShader,vertexShader:Tn("rect").vertexShader,uniforms:{},geometry:this.geometry},n)}function ko(t,e,r,i,n){this.ctx=t,this.dom={},this.attr=e||{},this.style=r||{},this.vDomIndex=n,this.positionArray=[],this.colorArray=[],this.transform=[],this.vertexUpdate=!0,this.colorUpdate=!0,this.renderTarget=i,this.indexBased=!0,this.selftransform=new Float32Array([0,0,1,1]),this.attr.transform||(this.attr.transform={translate:[0,0],scale:[1,1]}),this.geometry=new Ro,this.geometry.setAttr("a_color",{value:new Float32Array(this.colorArray),size:4}),this.geometry.setAttr("a_position",{value:new Float32Array(this.positionArray),size:2}),this.geometry.setAttr("a_transformMatrix",{value:new Float32Array(this.transform),size:3}),this.geometry.setDrawRange(0,this.positionArray.length/2),this.shaderInstance=new ho(t,{fragmentShader:Tn("line").fragmentShader,vertexShader:Tn("line").vertexShader,uniforms:{},geometry:this.geometry},n)}function So(t,e,r,i,n){this.ctx=t,this.dom={},this.attr=e||{},this.style=r||{},this.vDomIndex=n,this.positionArray=[],this.colorArray=[],this.renderTarget=i,this.indexBased=!1,this.attr.transform||(this.attr.transform={translate:[0,0],scale:[1,1]});var o=zn(this.attr.transform),a=o.translateX,s=o.translateY,h=o.scaleX,c=o.scaleY;this.transform=new Float32Array([a,s,h,c]),this.geometry=new Ro,this.geometry.drawType="LINE_STRIP",this.geometry.setAttr("a_position",{value:new Float32Array(this.positionArray),size:2}),this.geometry.setDrawRange(0,this.positionArray.length/2),this.shaderInstance=new ho(t,{fragmentShader:Tn("polyline").fragmentShader,vertexShader:Tn("polyline").vertexShader,uniforms:{u_transformMatrix:{value:new Float32Array(Nn()),matrix:!0},u_color:{value:new Float32Array(4)}},geometry:this.geometry},n)}function Eo(t,e,r,i,n){this.ctx=t,this.dom={},this.attr=e||{},this.style=r||{},this.vDomIndex=n,this.colorArray=[],this.positionArray=[],this.renderTarget=i,this.indexBased=!1,this.attr.transform||(this.attr.transform={translate:[0,0],scale:[1,1]});var o=zn(this.attr.transform),a=o.translateX,s=o.translateY,h=o.scaleX,c=o.scaleY;this.transform=new Float32Array([a,s,h,c]),this.geometry=new Fo,this.geometry.setAttr("a_position",{value:new Float32Array([]),size:2}),this.shaderInstance=new ho(t,{fragmentShader:Tn("polygon").fragmentShader,vertexShader:Tn("polygon").vertexShader,uniforms:{u_transformMatrix:{value:new Float32Array(Nn()),matrix:!0},u_color:{value:new Float32Array(4)}},geometry:this.geometry},n)}function Mo(t,e,r,i,n){this.ctx=t,this.dom={},this.attr=e||{},this.style=r||{},this.vDomIndex=n,this.positionArray=[],this.colorArray=[],this.transform=[],this.pointsSize=[],this.renderTarget=i,this.indexBased=!0,this.attr.transform||(this.attr.transform={translate:[0,0],scale:[1,1]}),this.geometry=new No,this.geometry.setAttr("a_transformMatrix",{value:new Float32Array(this.transform),size:3}),this.geometry.setAttr("a_color",{value:new Float32Array(this.colorArray),size:4}),this.geometry.setAttr("a_radius",{value:new Float32Array(this.pointsSize),size:1}),this.geometry.setAttr("a_position",{value:new Float32Array(this.positionArray),size:2}),this.geometry.setDrawRange(0,0),this.shaderInstance=new ho(t,{fragmentShader:Tn("circle").fragmentShader,vertexShader:Tn("circle").vertexShader,uniforms:{},geometry:this.geometry},n)}function Co(t,e,r,i,n){this.ctx=t,this.dom={},this.attr=e||{},this.style=r||{},this.vDomIndex=n,this.textCoor=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),this.renderTarget=i,this.indexBased=!1,this.attr.transform||(this.attr.transform={translate:[0,0],scale:[1,1]}),this.geometry=new Fo,this.geometry.setAttr("a_texCoord",{value:this.textCoor,size:2}),this.geometry.setAttr("a_position",{value:new Float32Array([0,0]),size:2}),this.geometry.setDrawRange(0,6),this.shaderInstance=new ho(t,{fragmentShader:Tn("image").fragmentShader,vertexShader:Tn("image").vertexShader,uniforms:{u_transformMatrix:{value:new Float32Array(Nn()),matrix:!0},u_image:{value:new Lo(this.ctx,{},this.vDomIndex)},u_opacity:{value:1..toFixed(2)}},geometry:this.geometry},n),this.positionArray=[],this.vertexUpdate=!0}function Do(t,e,r,i,n,o){var a;switch(i){case"rect":a=new To(t,e,r,n,o);break;case"point":a=new Bo(t,e,r,n,o);break;case"line":a=new ko(t,e,r,n,o);break;case"polyline":case"path":a=new So(t,e,r,n,o);break;case"polygon":a=new Eo(t,e,r,n,o);break;case"circle":a=new Mo(t,e,r,n,o);break;case"image":case"text":a=new Co(t,e,r,n,o);break;default:a=null}return a}function _o(t,e,r,i){switch(this.ctx=t,this.style=e.style||{},this.attr=e.attr||{},this.id=r,this.nodeName=e.el,this.nodeType="WEBGL",this.children=[],this.ctx=t,this.vDomIndex=i,this.el=e.el,this.shaderType=e.shaderType,this.exeCtx=e.ctx,this.bbox=void 0===e.bbox||e.bbox,this.events={},e.el){case"point":this.dom=new qn(this.ctx,this.attr,this.style);break;case"rect":this.dom=new Hn(this.ctx,this.attr,this.style);break;case"line":this.dom=new Wn(this.ctx,this.attr,this.style);break;case"polyline":this.dom=new Zn(this.ctx,this.attr,this.style);break;case"polygon":this.dom=new $n(this.ctx,this.attr,this.style);break;case"path":this.dom=new Vn(this.ctx,this.attr,this.style);break;case"circle":this.dom=new Jn(this.ctx,this.attr,this.style);break;case"image":this.dom=new io(this.ctx,this.attr,this.style,i);break;case"text":this.dom=new ro(this.ctx,this.attr,this.style,i);break;case"group":this.dom=new no(this.ctx,this.attr,this.style,e.renderTarget,i);break;default:this.dom=null}this.dom.nodeExe=this,this.dom instanceof no||(delete this.createEl,delete this.createEls)}function zo(t){var e=new Image;return e.crossOrigin="anonymous",e.onload=function(){t.update(),t.updated=!0,En.vDomChanged(t.vDomIndex)},e.onerror=function(t){},e}function Po(t,e){return new Uint8Array(new ArrayBuffer(t*e*4))}function Lo(t,e,r){var i=this,n=t.getParameter(t.MAX_TEXTURE_SIZE);this.ctx=t,this.texture=t.createTexture(),this.type="TEXTURE_2D",this.width=e.width>n?n:e.width,this.height=e.height>n?n:e.height,this.border=e.border?e.border:0,this.format=e.format?e.format:"RGBA",this.type=e.type?e.type:"UNSIGNED_BYTE",this.warpS=e.warpS?e.warpS:"CLAMP_TO_EDGE",this.warpT=e.warpT?e.warpT:"CLAMP_TO_EDGE",this.magFilter=e.magFilter?e.magFilter:"LINEAR",this.minFilter=e.minFilter?e.minFilter:"LINEAR",this.mipMap=e.mipMap,this.updated=!1,this.image=null,this.vDomIndex=r,"string"==typeof e.src?(i.image=zo(i),i.image.src=e.src):e.src instanceof HTMLImageElement||e.src instanceof SVGImageElement||e.src instanceof HTMLCanvasElement||e.src instanceof Uint8Array?(i.image=e.src,i.update(),i.updated=!0):e.src instanceof ii?(i.image=e.src.domEl,i.update(),i.updated=!0):(this.width&&this.height&&(i.image=Po(this.width,this.height),i.update()),i.updated=!0),En.vDomChanged(i.vDomIndex)}function Io(t,e){this.ctx=t,this.fbo=t.createFramebuffer(),this.texture=e.texture,this.texture.updated||this.texture.update()}function Oo(){}function Fo(t){this.attributes={},this.drawType="TRIANGLES",this.indexes=null,this.drawRange=[0,0]}function No(t){this.attributes={},this.drawType="POINTS",this.indexes=null,this.drawRange=[0,0]}function Ro(t){this.attributes={},this.drawType="LINES",this.indexes=null,this.drawRange=[0,0]}ho.prototype=new co,ho.prototype.constructor=ho,ho.prototype.useProgram=function(){this.ctx.useProgram(this.program)},ho.prototype.applyUniforms=function(){for(var t in this.uniforms)this.uniforms[t].matrix?this.ctx[this.uniforms[t].type](this.uniforms[t].uniformLocation,this.uniforms[t].transpose,this.uniforms[t].value):this.uniforms[t].value instanceof Lo?(this.ctx[this.uniforms[t].type](this.uniforms[t].uniformLocation,this.uniforms[t].value.texture),this.uniforms[t].value.loadTexture()):this.ctx[this.uniforms[t].type](this.uniforms[t].uniformLocation,this.uniforms[t].value)},ho.prototype.applyAttributes=function(){var t;for(var e in this.attrObjs)t=this.attrObjs[e],"a_transformMatrix"===e?(this.ctx.enableVertexAttribArray(t.attributeLocation+0),this.ctx.enableVertexAttribArray(t.attributeLocation+1),this.ctx.enableVertexAttribArray(t.attributeLocation+2),this.ctx.bindBuffer(t.bufferType,t.buffer),this.ctx.vertexAttribPointer(t.attributeLocation+0,t.size,t.valueType,!1,4*t.size*3,0),this.ctx.vertexAttribPointer(t.attributeLocation+1,t.size,t.valueType,!1,4*t.size*3,12),this.ctx.vertexAttribPointer(t.attributeLocation+2,t.size,t.valueType,!1,4*t.size*3,24)):(this.ctx.enableVertexAttribArray(t.attributeLocation),this.ctx.bindBuffer(t.bufferType,t.buffer),this.ctx.vertexAttribPointer(t.attributeLocation,t.size,t.valueType,!1,0,0))},ho.prototype.applyIndexes=function(){var t=this.indexesObj;this.ctx.bindBuffer(t.bufferType,t.buffer),this.ctx.bufferData(t.bufferType,t.value,t.drawType)},ho.prototype.draw=function(){this.ctx.drawArrays(this.ctx[this.geometry.drawType],this.geometry.drawRange[0],this.geometry.drawRange[1])},ho.prototype.drawElements=function(){this.ctx.drawElements(this.ctx[this.geometry.drawType],this.indexesObj.count,this.indexesObj.type?this.indexesObj.type:this.ctx.UNSIGNED_SHORT,this.indexesObj.offset)},ho.prototype.updateBBox=function(t){return!0},ho.prototype.execute=function(){this.ctx.useProgram(this.program),this.applyUniforms(),this.applyAttributes(),this.renderTarget&&this.renderTarget instanceof Io&&this.renderTarget.update(),this.indexesObj?(this.applyIndexes(),this.drawElements()):this.draw(),this.renderTarget&&this.renderTarget instanceof Io&&this.renderTarget.clear()},ho.prototype.addUniform=function(t,e){this.uniforms[t]=so(this.ctx,this.program,t,e),En.vDomChanged(this.vDomIndex)},ho.prototype.addAttribute=function(t,e){this.attributes[t]=e,this.attrObjs[t]=ao(this.ctx,this.program,t,e),En.vDomChanged(this.vDomIndex)},ho.prototype.setAttributeData=function(t,e){var r=this.attrObjs[t];this.attributes[t].value=e,this.attrObjs[t].value=e,this.ctx.bindBuffer(r.bufferType,r.buffer),this.ctx.bufferData(r.bufferType,r.value,r.drawType),En.vDomChanged(this.vDomIndex)},ho.prototype.applyAttributeData=function(t,e){this.attributes[t].value=e,this.attrObjs[t].value=e;var r=this.attrObjs[t];this.ctx.bindBuffer(r.bufferType,r.buffer),this.ctx.bufferData(r.bufferType,this.attributes[r.attr].value,r.drawType),this.ctx.enableVertexAttribArray(r.attributeLocation),this.ctx.vertexAttribPointer(r.attributeLocation,r.size,r.valueType,!1,0,0)},ho.prototype.setUniformData=function(t,e){this.uniforms[t].value=e,En.vDomChanged(this.vDomIndex)},ho.prototype.applyUniformData=function(t,e){this.uniforms[t].value=e,this.uniforms[t].matrix?this.ctx[this.uniforms[t].type](this.uniforms[t].uniformLocation,this.uniforms[t].transpose,this.uniforms[t].value):this.ctx[this.uniforms[t].type](this.uniforms[t].uniformLocation,this.uniforms[t].value)},co.prototype.setAttr=function(t,e){if(this.attr[t]=e,"transform"===t){var r=zn(this.attr.transform),i=r.translateX,n=r.translateY,o=r.scaleX,a=r.scaleY;this.selftransform=new Float32Array([i,n,o,a])}},co.prototype.translate=function(t){this.attr.transform.translate=t},co.prototype.scale=function(t){this.attr.transform.scale=t},co.prototype.rotate=function(t){this.attr.transform.rotate=t},Bo.prototype=new co,Bo.prototype.constructor=Bo,Bo.prototype.clear=function(t){bo(this,t,1),vo(this,t,1),fo(this,t,1),(this.sizeUpdate?this.pointsSize:this.typedSizeArray)[t]=void 0,this.filterSizeFlag=!0},Bo.prototype.addTransform=function(t,e){lo(this,e,1,t)},Bo.prototype.updateTransform=function(t,e){uo(this,t,1,e)},Bo.prototype.updateVertex=function(t,e,r){xo(this,t,1,[e,r])},Bo.prototype.updateSize=function(t,e){(this.sizeUpdate?this.pointsSize:this.typedSizeArray)[t]=e},Bo.prototype.updateColor=function(t,e){wo(this,t,1,e)},Bo.prototype.addVertex=function(t,e,r){yo(this,r,1,[t,e])},Bo.prototype.addSize=function(t,e){this.pointsSize=this.typedSizeArray&&this.typedSizeArray.length>0?Array.from(this.typedSizeArray):this.pointsSize,this.pointsSize[e]=t,this.sizeUpdate=!0},Bo.prototype.addColors=function(t,e){mo(this,e,1,t)},Bo.prototype.execute=function(t){this.renderTarget&&this.renderTarget instanceof Io&&this.renderTarget.update(),go(this),Ao(this),po(this),this.sizeUpdate&&(this.filterSizeFlag&&(this.pointsSize=this.pointsSize.filter((function(t){return!isNaN(t)})),this.filterSizeFlag=!1),this.typedSizeArray=new Float32Array(this.pointsSize),this.pointsSize=[],this.sizeUpdate=!1),this.filterSizeFlag&&(this.typedSizeArray=this.typedSizeArray.filter((function(t){return!isNaN(t)})),this.filterSizeFlag=!1),this.shaderInstance.setAttributeData("a_size",this.typedSizeArray),this.geometry.setDrawRange(0,this.typedPositionArray.length/2),this.shaderInstance.execute(),this.renderTarget&&this.renderTarget instanceof Io&&this.renderTarget.update()},To.prototype=new co,To.prototype.constructor=To,To.prototype.clear=function(t){bo(this,t,6),vo(this,t,6),fo(this,t,6)},To.prototype.updateVertex=function(t,e,r,i,n){var o=e+i,a=r+n;xo(this,t,6,[e,r,o,r,e,a,e,a,o,r,o,a])},To.prototype.updateTransform=function(t,e){uo(this,t,6,e)},To.prototype.addTransform=function(t,e){lo(this,e,6,t)},To.prototype.updateColor=function(t,e){wo(this,t,6,e)},To.prototype.addVertex=function(t,e,r,i,n){var o=t+r,a=e+i;yo(this,n,6,[t,e,o,e,t,a,t,a,o,e,o,a])},To.prototype.addColors=function(t,e){mo(this,e,6,t)},To.prototype.execute=function(t){this.renderTarget&&this.renderTarget instanceof Io&&this.renderTarget.update(),Ao(this),po(this),go(this),this.geometry.setDrawRange(0,this.typedPositionArray.length/2),this.shaderInstance.execute(),this.renderTarget&&this.renderTarget instanceof Io&&this.renderTarget.clear()},ko.prototype=new co,ko.prototype.constructor=ko,ko.prototype.clear=function(t){bo(this,t,2),vo(this,t,2)},ko.prototype.updateTransform=function(t,e){uo(this,t,2,e)},ko.prototype.addTransform=function(t,e){lo(this,e,2,t)},ko.prototype.updateVertex=function(t,e,r,i,n){xo(this,t,2,[e,r,i,n])},ko.prototype.updateColor=function(t,e){wo(this,t,2,e)},ko.prototype.addVertex=function(t,e,r,i,n){yo(this,n,2,[t,e,r,i])},ko.prototype.addColors=function(t,e){mo(this,e,2,t)},ko.prototype.execute=function(t){this.renderTarget&&this.renderTarget instanceof Io&&this.renderTarget.update(),go(this),Ao(this),po(this),this.geometry.setDrawRange(0,this.typedPositionArray.length/2),this.shaderInstance.execute(),this.renderTarget&&this.renderTarget instanceof Io&&this.renderTarget.clear()},So.prototype=new co,So.prototype.constructor=So,So.prototype.execute=function(t){this.renderTarget&&this.renderTarget instanceof Io&&this.renderTarget.update();for(var e=0,r=t.length;e<r;e++)this.shaderInstance.setUniformData("u_transformMatrix",t[e].dom.transformMatrix),this.shaderInstance.setAttributeData("a_position",t[e].dom.points),this.shaderInstance.setUniformData("u_color",t[e].dom.color),this.geometry.setDrawRange(0,t[e].dom.points.length/2),this.shaderInstance.execute();this.renderTarget&&this.renderTarget instanceof Io&&this.renderTarget.clear()},Eo.prototype=new co,Eo.prototype.constructor=Eo,Eo.prototype.execute=function(t){this.renderTarget&&this.renderTarget instanceof Io&&this.renderTarget.update(),this.shaderInstance.useProgram();for(var e=0,r=t.length;e<r;e++)this.shaderInstance.setUniformData("u_transformMatrix",t[e].dom.transformMatrix),this.shaderInstance.setAttributeData("a_position",t[e].dom.points),this.shaderInstance.setUniformData("u_color",t[e].dom.color),this.geometry.setDrawRange(0,t[e].dom.points.length/2),this.shaderInstance.execute();this.renderTarget&&this.renderTarget instanceof Io&&this.renderTarget.clear()},Mo.prototype=new co,Mo.prototype.constructor=Mo,Mo.prototype.clear=function(t){bo(this,t,1),vo(this,t,1),fo(this,t,1),(this.sizeUpdate?this.pointsSize:this.typedSizeArray)[t]=void 0,this.filterSizeFlag=!0},Mo.prototype.updateTransform=function(t,e){uo(this,t,1,e)},Mo.prototype.addTransform=function(t,e){lo(this,e,1,t)},Mo.prototype.updateVertex=function(t,e,r){xo(this,t,1,[e,r])},Mo.prototype.updateColor=function(t,e){wo(this,t,1,e)},Mo.prototype.updateSize=function(t,e){(this.sizeUpdate?this.pointsSize:this.typedSizeArray)[t]=e},Mo.prototype.addVertex=function(t,e,r){yo(this,r,1,[t,e])},Mo.prototype.addSize=function(t,e){this.pointsSize=this.typedSizeArray&&this.typedSizeArray.length>0?Array.from(this.typedSizeArray):this.pointsSize,this.pointsSize[e]=t,this.sizeUpdate=!0},Mo.prototype.addColors=function(t,e){mo(this,e,1,t)},Mo.prototype.execute=function(t){this.renderTarget&&this.renderTarget instanceof Io&&this.renderTarget.update(),go(this),Ao(this),po(this),this.sizeUpdate&&(this.filterSizeFlag&&(this.pointsSize=this.pointsSize.filter((function(t){return!isNaN(t)})),this.filterSizeFlag=!1),this.typedSizeArray=new Float32Array(this.pointsSize),this.pointsSize=[],this.sizeUpdate=!1),this.filterSizeFlag&&(this.typedSizeArray=this.typedSizeArray.filter((function(t){return!isNaN(t)})),this.filterSizeFlag=!1),this.shaderInstance.setAttributeData("a_radius",this.typedSizeArray),this.geometry.setDrawRange(0,this.typedPositionArray.length/2),this.shaderInstance.execute(),this.renderTarget&&this.renderTarget instanceof Io&&this.renderTarget.clear()},Co.prototype=new co,Co.prototype.constructor=Co,Co.prototype.execute=function(t){this.renderTarget&&this.renderTarget instanceof Io&&this.renderTarget.update(),this.shaderInstance.useProgram(),this.shaderInstance.applyAttributeData("a_texCoord",this.textCoor);for(var e,r=void 0!==this.style.opacity?this.style.opacity:1,i=0,n=t.length;i<n;i++){var o=t[i];o.dom.textureNode&&o.dom.textureNode.updated&&("none"!==o.style.display&&(this.shaderInstance.applyUniformData("u_transformMatrix",o.dom.transformMatrix),o.dom.textureNode!==e&&(o.dom.textureNode.loadTexture(),e=o.dom.textureNode,this.shaderInstance.applyUniformData("u_image",o.dom.textureNode)),this.shaderInstance.applyAttributeData("a_position",o.dom.positionArray),this.shaderInstance.applyUniformData("u_opacity",((void 0!==o.style.opacity?o.style.opacity:1)*r).toFixed(2)),this.shaderInstance.draw()))}this.renderTarget&&this.renderTarget instanceof Io&&this.renderTarget.clear()},_o.prototype=new ii,_o.prototype.reIndexChildren=function(t){for(var e=t||this,r=e.children,i=0,n=(r=r.filter((function(t){return t}))).length;i<n;i++)r[i].dom.pindex=i;e.children=r},_o.prototype.applyTransformationMatrix=function(t){this.dom.applyTransformationMatrix(t),this.children.forEach((function(t){t.applyTransformationMatrix(self.dom.transformMatrix)}))},_o.prototype.setAttr=function(t,e){var r=this;if(2===arguments.length)null===e&&null!==this.attr[t]?delete this.attr[t]:this.attr[t]=e,this.dom.setAttr(t,e),"transform"===t&&this.children.length>0&&this.children.forEach((function(t){t.applyTransformationMatrix(r.dom.transformMatrix)}));else if(1===arguments.length&&"object"==typeof t)for(var i in t)null===t[i]&&null!==this.attr[t]?delete this.attr[i]:this.attr[i]=t[i],this.dom.setAttr(i,t[i]),"transform"===t&&this.children.length>0&&this.children.forEach((function(t){t.applyTransformationMatrix(r.dom.transformMatrix)}));return this.BBoxUpdate=!0,En.vDomChanged(this.vDomIndex),this},_o.prototype.scale=function(t){return this.attr.transform||(this.attr.transform={}),t.length<1?null:(this.attr.transform.scale=[t[0],t[1]?t[1]:t[0]],this.dom.setAttr("transform",this.attr.transform),this.BBoxUpdate=!0,En.vDomChanged(this.vDomIndex),this)},_o.prototype.translate=function(t){return this.attr.transform||(this.attr.transform={}),this.attr.transform.translate=t,this.dom.setAttr("transform",this.attr.transform),this.BBoxUpdate=!0,En.vDomChanged(this.vDomIndex),this},_o.prototype.rotate=function(t,e,r){return this.attr.transform||(this.attr.transform={}),"[object Array]"===Object.prototype.toString.call(t)?this.attr.transform.rotate=[t[0]||0,t[1]||0,t[2]||0]:this.attr.transform.rotate=[t,e||0,r||0],this.dom.setAttr("transform",this.attr.transform),this.BBoxUpdate=!0,En.vDomChanged(this.vDomIndex),this},_o.prototype.setStyle=function(t,e){if(2===arguments.length)null===e&&null!=this.style[t]?delete this.style[t]:("fill"!==t&&"stroke"!==t||(e=tr.colorToRGB(e)),this.style[t]=e),this.dom.setStyle(t,e);else if(1===arguments.length&&"object"==typeof t)for(var r in t)null===(e=t[r])&&null!=this.style[r]?delete this.style[r]:("fill"!==r&&"stroke"!==r||(e=tr.colorToRGB(e)),this.style[r]=e),this.dom.setStyle(r,e);return En.vDomChanged(this.vDomIndex),this},_o.prototype.setReIndex=function(){this.reindex=!0},_o.prototype.updateBBox=function(){var t;if(this.bbox){for(var e=0,r=this.children.length;e<r;e+=1)this.children[e]&&(t=this.children[e].updateBBox()||t);if(this.BBoxUpdate||t)return this.dom.updateBBox(this.children),this.BBoxUpdate=!1,!0}return!1},_o.prototype.in=function(t){return this.dom.in(t)},_o.prototype.on=function(t,e){if(this.events||(this.events={}),null===e&&null!==this.events[t])delete this.events[t];else if(e)if("function"==typeof e){var r=e.bind(this);this.events[t]=function(t){r(t)}}else"object"==typeof e&&(this.events[t]=e,e.constructor!==Mn.constructor&&e.constructor!==Cn.constructor||e.bindMethods(this));return this},_o.prototype.execute=function(){if("none"!==this.style.display)if(!this.dom.shader&&!this.dom.shaderGroup&&this.dom instanceof no)for(var t=0,e=this.children.length;t<e;t+=1)this.children[t].execute();else if(this.dom.shader&&this.dom instanceof no)this.reindex&&(this.reIndexChildren(),this.reindex=!1),this.exeCtx&&this.exeCtx(this.ctx),this.dom.shader.execute(this.children);else if(this.dom.shaderGroup&&this.dom instanceof no)for(var r in this.exeCtx&&this.exeCtx(this.ctx),this.dom.shaderGroup){var i=this.dom.shaderGroup[r];i.reindex&&(this.reIndexChildren(i),i.reindex=!1),i.shader.execute(i.children)}},_o.prototype.child=function(t){var e,r=this;if(r.dom instanceof no)for(var i=0;i<t.length;i+=1)(e=t[i]).dom.parent=r,r.children[r.children.length]=e,e.dom.pindex=r.children.length-1,e instanceof ho||e.dom instanceof no||(this.dom.shader?e.el===this.dom.shader.attr.shaderType?e.dom.setShader(this.dom.shader):(console.warn("wrong el type '"+e.el+"' being added to shader group - '"+this.dom.shader.attr.shaderType+"'"),r.children.pop()):(this.dom.shaderGroup||(this.dom.shaderGroup={}),this.dom.shaderGroup[e.el]||(this.dom.shaderGroup[e.el]={children:[],shader:Do(r.ctx,r.attr,r.style,e.el,r.renderTarget,r.vDomIndex)}),this.dom.shaderGroup[e.el].children[this.dom.shaderGroup[e.el].children.length]=e,e.dom.pindex=this.dom.shaderGroup[e.el].children.length-1,e.dom.setShader(this.dom.shaderGroup[e.el].shader))),r.dom.attr&&r.dom.attr.transform&&e.applyTransformationMatrix(r.dom.transformMatrix);else console.log("Error");return this.BBoxUpdate=!0,En.vDomChanged(this.vDomIndex),r},_o.prototype.createEls=function(t,e){var r=new Xn({type:"WEBGL",ctx:this.dom.ctx},t,e,this.vDomIndex);return this.child(r.stack),En.vDomChanged(this.vDomIndex),r},_o.prototype.createEl=function(t){var e=new _o(this.ctx,t,_n(),this.vDomIndex);return this.child([e]),En.vDomChanged(this.vDomIndex),e},_o.prototype.createShaderEl=function(t){var e=new ho(this.ctx,t,this.vDomIndex);return this.child([e]),En.vDomChanged(this.vDomIndex),e},_o.prototype.remove=function(){var t=this.dom.parent.children,e=t.indexOf(this);if(-1!==e)if(this.dom.parent.dom.shader)this.dom.parent.dom.shader.indexBased&&this.dom.parent.dom.shader.clear(this.dom.pindex),this.dom.parent.setReIndex(),t[this.dom.pindex]=void 0;else if(this.dom.parent.dom.shaderGroup){var r=this.dom.parent.dom.shaderGroup[this.el];if(r){var i=r.children.indexOf(this);r.reindex=!0,r.shader.indexBased&&(r.shader.clear(this.dom.pindex),this.dom.parent.setReIndex()),r.children[i]=void 0}t[e]=void 0}else t.splice(e,1);this.BBoxUpdate=!0,En.vDomChanged(this.vDomIndex)},_o.prototype.removeChild=function(t){var e=-1;if(this.children.forEach((function(r,i){r===t&&(e=i)})),-1!==e){var r=this.children.splice(e,1)[0];this.dom.removeChild(r.dom)}this.BBoxUpdate=!0,En.vDomChanged(this.vDomIndex)},Lo.prototype.setAttr=function(t,e){if(1===arguments.length)for(var r in t)this[r]=t[r],"src"===r&&("string"==typeof e?(this.image&&this.image instanceof Image||(this.image=zo(this)),this.image.src=e):e instanceof HTMLImageElement||e instanceof SVGImageElement||e instanceof HTMLCanvasElement||e instanceof Uint8Array?(this.image=e,this.update()):e instanceof ii&&(this.image=e.domEl,this.update())),(t.height||t.width)&&(self.image=Po(this.width,this.height));else this[t]=e,console.warning("Instead of key, value, pass Object of key,value for optimal rendering"),"src"===t&&("string"==typeof e?(this.image&&this.image instanceof Image||(this.image=zo(this)),this.image.src=e):e instanceof HTMLImageElement||e instanceof SVGImageElement||e instanceof HTMLCanvasElement||e instanceof Uint8Array?(this.image=e,this.update()):e instanceof ii&&(this.image=e.domEl,this.update()))},Lo.prototype.loadTexture=function(){this.updated&&(this.ctx.activeTexture(this.ctx.TEXTURE0),this.ctx.bindTexture(this.ctx.TEXTURE_2D,this.texture))},Lo.prototype.clear=function(t){},Lo.prototype.update=function(){var t=this.ctx;t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,this.texture),!this.image||this.image instanceof Uint8Array?t.texImage2D(t.TEXTURE_2D,this.border,t[this.format],this.width,this.height,0,t[this.format],t[this.type],this.image):t.texImage2D(t.TEXTURE_2D,this.border,t[this.format],t[this.format],t[this.type],this.image),this.mipMap?(to(self.image.width)&&to(self.image.height)||console.warn("Image dimension not in power of 2"),t.generateMipmap(t.TEXTURE_2D),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t[this.minFilter]),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t[this.magFilter])):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t[this.warpS]),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t[this.warpT]),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t[this.minFilter]),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t[this.minFilter])),this.updated=!0},Io.prototype.setAttr=function(t,e){this[t]=e},Io.prototype.update=function(){this.texture&&this.texture instanceof Lo&&(this.ctx.bindFramebuffer(this.ctx.FRAMEBUFFER,this.fbo),this.ctx.framebufferTexture2D(this.ctx.FRAMEBUFFER,this.ctx.COLOR_ATTACHMENT0,this.ctx.TEXTURE_2D,this.texture.texture,0),this.ctx.clearColor(0,0,0,0),this.ctx.clear(this.ctx.COLOR_BUFFER_BIT|this.ctx.DEPTH_BUFFER_BIT))},Io.prototype.clear=function(){this.ctx.bindFramebuffer(this.ctx.FRAMEBUFFER,null)},Oo.prototype.setAttr=function(t,e){!e&&this.attributes[t]?delete this.attributes[t]:this.attributes[t]=e},Oo.prototype.setDrawRange=function(t,e){this.drawRange=[t,e]},Oo.prototype.setDrawType=function(t){this.drawType=t},Oo.prototype.setIndex=function(t){this.indexes=t},Fo.prototype=new Oo,Fo.constructor=Fo,No.prototype=new Oo,No.constructor=No,Ro.prototype=new Oo,Ro.constructor=Ro;var jo=[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],Xo=[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];var Yo=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},Go={blur:function(t){return void 0===t&&(t=1),function(e){return function(t,e,r,i,n,o){for(var a,s=t.data,h=2*o+1,c=i-1,l=n-1,u=o+1,f=u*(u+1)/2,d=new Yo,p=d,y=1;y<h;y++)p=p.next=new Yo,y===u&&(a=p);p.next=d;for(var x=null,v=null,g=0,m=0,w=jo[o],b=Xo[o],A=0;A<n;A++){p=d;for(var B=s[m],T=s[m+1],k=s[m+2],S=s[m+3],E=0;E<u;E++)p.r=B,p.g=T,p.b=k,p.a=S,p=p.next;for(var M=0,C=0,D=0,_=0,z=u*B,P=u*T,L=u*k,I=u*S,O=f*B,F=f*T,N=f*k,R=f*S,j=1;j<u;j++){var X=m+((c<j?c:j)<<2),Y=s[X],G=s[X+1],U=s[X+2],q=s[X+3],H=u-j;O+=(p.r=Y)*H,F+=(p.g=G)*H,N+=(p.b=U)*H,R+=(p.a=q)*H,M+=Y,C+=G,D+=U,_+=q,p=p.next}x=d,v=a;for(var V=0;V<i;V++){var Z=R*w>>b;if(s[m+3]=Z,0!==Z){var W=255/Z;s[m]=(O*w>>b)*W,s[m+1]=(F*w>>b)*W,s[m+2]=(N*w>>b)*W}else s[m]=s[m+1]=s[m+2]=0;O-=z,F-=P,N-=L,R-=I,z-=x.r,P-=x.g,L-=x.b,I-=x.a;var Q=V+o+1;Q=g+(Q<c?Q:c)<<2,O+=M+=x.r=s[Q],F+=C+=x.g=s[Q+1],N+=D+=x.b=s[Q+2],R+=_+=x.a=s[Q+3],x=x.next;var $=v,J=$.r,K=$.g,tt=$.b,et=$.a;z+=J,P+=K,L+=tt,I+=et,M-=J,C-=K,D-=tt,_-=et,v=v.next,m+=4}g+=i}for(var rt=0;rt<i;rt++){var it=s[m=rt<<2],nt=s[m+1],ot=s[m+2],at=s[m+3],st=u*it,ht=u*nt,ct=u*ot,lt=u*at,ut=f*it,ft=f*nt,dt=f*ot,pt=f*at;p=d;for(var yt=0;yt<u;yt++)p.r=it,p.g=nt,p.b=ot,p.a=at,p=p.next;for(var xt=i,vt=0,gt=0,mt=0,wt=0,bt=1;bt<=o;bt++){m=xt+rt<<2;var At=u-bt;ut+=(p.r=it=s[m])*At,ft+=(p.g=nt=s[m+1])*At,dt+=(p.b=ot=s[m+2])*At,pt+=(p.a=at=s[m+3])*At,wt+=it,vt+=nt,gt+=ot,mt+=at,p=p.next,bt<l&&(xt+=i)}m=rt,x=d,v=a;for(var Bt=0;Bt<n;Bt++){var Tt=m<<2;s[Tt+3]=at=pt*w>>b,at>0?(at=255/at,s[Tt]=(ut*w>>b)*at,s[Tt+1]=(ft*w>>b)*at,s[Tt+2]=(dt*w>>b)*at):s[Tt]=s[Tt+1]=s[Tt+2]=0,ut-=st,ft-=ht,dt-=ct,pt-=lt,st-=x.r,ht-=x.g,ct-=x.b,lt-=x.a,Tt=rt+((Tt=Bt+u)<l?Tt:l)*i<<2,ut+=wt+=x.r=s[Tt],ft+=vt+=x.g=s[Tt+1],dt+=gt+=x.b=s[Tt+2],pt+=mt+=x.a=s[Tt+3],x=x.next,st+=it=v.r,ht+=nt=v.g,ct+=ot=v.b,lt+=at=v.a,wt-=it,vt-=nt,gt-=ot,mt-=at,v=v.next,m+=i}}return t}(e,0,0,e.width,e.height,t)}},greyScale:function(){}},Uo=qe.instance,qo=An,Ho=Bn;t.Path=Uo,t.behaviour=Ii,t.canvasLayer=qo,t.canvasNodeLayer=Ho,t.chain=yt,t.color=tr,t.ease=J,t.geometry=N,t.queue=x,t.svgLayer=function(t,e){void 0===e&&(e={});var r=document.querySelector(t),i=r.clientHeight,n=r.clientWidth,o=e.autoUpdate;void 0===o&&(o=!0);var a=e.enableResize;void 0===a&&(a=!0);var s,h=document.createElementNS(mi.svg,"svg");h.setAttribute("height",i),h.setAttribute("width",n),h.style.position="absolute";var c,l,u,f,d=999999;r&&(r.appendChild(h),s=new v,o&&(d=li.addVdom(s)));var p=new Ai(h,{},fi(),d);p.container=r,p.type="SVG",p.width=n,p.height=i,p.domEl=h;var y=new er(p);s&&s.rootNode(p),p.setLayerId=function(t){h.setAttribute("id",t)},p.onResize=function(t){u=t},p.onChange=function(t){f=t},p.invokeOnChange=function(){f&&f()},p.setSize=function(t,e){this.dom.setAttribute("height",e),this.dom.setAttribute("width",t),this.width=t,this.height=e,c=e,l=t},p.update=function(){this.execute()},p.setViewBox=function(t,e,r,i){this.dom.setAttribute("viewBox",t+","+e+","+i+","+r)},p.destroy=function(){var e=document.querySelector(t);e&&e.contains(h)&&e.removeChild(h),li.removeVdom(d)},p.createPattern=function(t){return new xi(this,t)},p.createClip=function(t){return new yi(this,t)},p.createMask=function(t){return new pi(this,t)};var x=null;return p.dom.addEventListener("pointerdown",(function(t){y.addPointer(t),t.target.drag_&&(t.target.drag_(t,"pointerdown",y),x=t.target)})),p.dom.addEventListener("pointerup",(function(t){x&&(x.drag_(t,"pointerup",y),x=null),y.removePointer(t)})),p.dom.addEventListener("pointermove",(function(t){t.preventDefault(),x&&x.drag_(t,"pointermove",y)})),li.execute(),a&&hi(p,(function(e){document.querySelector(t)?(i=c||e.height,n=l||e.width,h.setAttribute("height",i),h.setAttribute("width",n),p.width=n,p.height=i,u&&u(),p.update()):ci(p)})),p},t.utility=Go,t.webglLayer=function(t,e,r){void 0===e&&(e={}),void 0===r&&(r={});var i=t?document.querySelector(t):null,n=i?i.clientHeight:0,o=i?i.clientWidth:0,a=tr.rgba(0,0,0,0),s=r.enableEvents;void 0===s&&(s=!1);var h=r.autoUpdate;void 0===h&&(h=!0);var c=r.enableResize;void 0===c&&(c=!1),(e=e||{premultipliedAlpha:!1,depth:!1,antialias:!1,alpha:!0}).premultipliedAlpha=void 0!==e.premultipliedAlpha&&e.premultipliedAlpha,e.depth=void 0!==e.depth&&e.depth,e.antialias=void 0!==e.antialias&&e.antialias,e.alpha=void 0===e.alpha||e.alpha;var l,u=document.createElement("canvas"),f=u.getContext("webgl",e),d=function(t){var e=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1);return e<1?1:e}(f);kn=d>=2?2:Math.floor(d),u.setAttribute("height",n*kn),u.setAttribute("width",o*kn),u.style.height=n+"px",u.style.width=o+"px",u.style.position="absolute";var p,y,x=999999;i&&(i.appendChild(u),l=new v,h&&(x=En.addVdom(l)));var g=new _o(f,{el:"group",attr:{id:"rootNode"},ctx:function(t){t.enable(t.BLEND),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.clearColor(a.r,a.g,a.b,a.a)}},_n(),x);l&&l.rootNode(g);var m=g.execute.bind(g);g.container=i,g.domEl=u,g.height=n,g.width=o,g.type="WEBGL",g.ctx.pixelRatio=kn;var w=function(t){t.viewport(0,0,t.canvas.width,t.canvas.height),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)};g.execute=function(){w(this.ctx),this.updateBBox(),this.ctx.enable(this.ctx.BLEND),this.ctx.blendFunc(this.ctx.SRC_ALPHA,this.ctx.ONE_MINUS_SRC_ALPHA),m()},g.update=function(){this.execute()},g.destroy=function(){var e=document.querySelector(t);e&&e.contains(u)&&e.removeChild(u),En.removeVdom(x)},g.getPixels=function(t,e,r,i){var n=new Uint8Array(r*i*4);return this.ctx.readPixels(t,e,r,i,this.ctx.RGBA,this.ctx.UNSIGNED_BYTE,n),n},g.putPixels=function(t,e,r){return this.ctx.putImageData(t,e,r)},g.clear=function(){w(this.ctx)},g.setClearColor=function(t){a=t},g.setClear=function(t){w=t};var b=function(t,e,r){t.width=Math.floor(e*kn),t.height=Math.floor(r*kn),t.style.height=r+"px",t.style.width=e+"px"};if(g.onResize=function(t){p=t},g.onChange=function(t){y=t},g.invokeOnChange=function(){y&&y()},g.setPixelRatio=function(t){kn=t,this.ctx.pixelRatio=kn,b(this.domEl,this.width,this.height)},g.setSize=function(t,e){this.width=t,this.height=e,n=e,o=t,b(this.domEl,this.width,this.height),this.execute()},g.setViewBox=function(t,e,r,i){},g.setStyle=function(t,e){this.domEl.style[t]=e},g.setAttr=function(t,e){"viewBox"===t&&this.setViewBox.apply(this,e.split(",")),u.setAttribute(t,e)},g.setContext=function(t,e){this.ctx[t]&&"function"==typeof this.ctx[t]?this.ctx[t].apply(null,e):this.ctx[t]&&(this.ctx[t]=e)},g.MeshGeometry=function(){return new Fo(this.ctx)},g.PointsGeometry=function(){return new No(this.ctx)},g.LineGeometry=function(){return new Ro(this.ctx)},g.createWebglTexture=function(t){return new Lo(this.ctx,t,this.vDomIndex)},g.RenderTarget=function(t){return new Io(this.ctx,t,this.vDomIndex)},s){var A=new er(g);u.addEventListener("mousemove",(function(t){t.preventDefault(),A.mousemoveCheck(t)})),u.addEventListener("mousedown",(function(t){A.mousedownCheck(t)})),u.addEventListener("mouseup",(function(t){A.mouseupCheck(t)})),u.addEventListener("mouseleave",(function(t){A.mouseleaveCheck(t)})),u.addEventListener("contextmenu",(function(t){A.contextmenuCheck(t)})),u.addEventListener("touchstart",(function(t){A.touchstartCheck(t)})),u.addEventListener("touchend",(function(t){A.touchendCheck(t)})),u.addEventListener("touchmove",(function(t){t.preventDefault(),A.touchmoveCheck(t)})),u.addEventListener("touchcancel",(function(t){A.touchcancelCheck(t)})),u.addEventListener("wheel",(function(t){A.wheelEventCheck(t)})),u.addEventListener("pointerdown",(function(t){A.addPointer(t),A.pointerdownCheck(t)})),u.addEventListener("pointerup",(function(t){A.removePointer(t),A.pointerupCheck(t)})),u.addEventListener("pointermove",(function(t){t.preventDefault(),A.pointermoveCheck(t)}))}return En.execute(),c&&g.container&&hi(g,(function(e){document.querySelector(t)?(n=e.height,o=e.width,g.width=o,g.height=n,b(g.domEl,o,n),w(g.ctx),p&&p(),g.execute(),u.style.height=n+"px",u.style.width=o+"px"):ci(g)})),g},Object.defineProperty(t,"__esModule",{value:!0})}));
  