UNPKG

x-cnhis-editor

Version:

``` npm install ```

1 lines 160 kB
(("undefined"!==typeof self?self:this)["webpackChunkhoeditor"]=("undefined"!==typeof self?self:this)["webpackChunkhoeditor"]||[]).push([[652],{28652:function(t,r,i){"use strict";i.r(r),i.d(r,{AElement:function(){return Vt},AnimateColorElement:function(){return Zt},AnimateElement:function(){return At},AnimateTransformElement:function(){return Tt},BoundingBox:function(){return ot},CB1:function(){return CB1},CB2:function(){return CB2},CB3:function(){return CB3},CB4:function(){return CB4},Canvg:function(){return re},CircleElement:function(){return gt},ClipPathElement:function(){return Ut},DefsElement:function(){return kt},DescElement:function(){return Jt},Document:function(){return ee},Element:function(){return nt},EllipseElement:function(){return dt},FeColorMatrixElement:function(){return zt},FeCompositeElement:function(){return Yt},FeDropShadowElement:function(){return Wt},FeGaussianBlurElement:function(){return Qt},FeMorphologyElement:function(){return Xt},FilterElement:function(){return Ht},Font:function(){return at},FontElement:function(){return Mt},FontFaceElement:function(){return _t},GElement:function(){return wt},GlyphElement:function(){return $t},GradientElement:function(){return Et},ImageElement:function(){return Lt},LineElement:function(){return vt},LinearGradientElement:function(){return Ct},MarkerElement:function(){return St},MaskElement:function(){return jt},Matrix:function(){return K},MissingGlyphElement:function(){return Nt},Mouse:function(){return G},PSEUDO_ZERO:function(){return L},Parser:function(){return W},PathElement:function(){return ft},PathParser:function(){return ht},PatternElement:function(){return bt},Point:function(){return I},PolygonElement:function(){return xt},PolylineElement:function(){return mt},Property:function(){return B},QB1:function(){return QB1},QB2:function(){return QB2},QB3:function(){return QB3},RadialGradientElement:function(){return Pt},RectElement:function(){return yt},RenderedElement:function(){return st},Rotate:function(){return Y},SVGElement:function(){return pt},SVGFontLoader:function(){return Ot},Scale:function(){return Q},Screen:function(){return q},Skew:function(){return J},SkewX:function(){return tt},SkewY:function(){return et},StopElement:function(){return Rt},StyleElement:function(){return It},SymbolElement:function(){return Bt},TRefElement:function(){return Dt},TSpanElement:function(){return ct},TextElement:function(){return ut},TextPathElement:function(){return Ft},TitleElement:function(){return Kt},Transform:function(){return rt},Translate:function(){return X},UnknownElement:function(){return it},UseElement:function(){return Gt},ViewPort:function(){return O},compressSpaces:function(){return compressSpaces},default:function(){return ie},getSelectorSpecificity:function(){return getSelectorSpecificity},normalizeAttributeName:function(){return normalizeAttributeName},normalizeColor:function(){return normalizeColor},parseExternalUrl:function(){return parseExternalUrl},presets:function(){return ne},toNumbers:function(){return toNumbers},trimLeft:function(){return trimLeft},trimRight:function(){return trimRight},vectorMagnitude:function(){return vectorMagnitude},vectorsAngle:function(){return vectorsAngle},vectorsRatio:function(){return vectorsRatio}});i(44936),i(39458),i(98694),i(63887),i(81910),i(33408);var a=i(62185),o=(i(5560),i(93813),i(50270),i(34877),i(69928),i(69874),i(16544),i(48795)),u=i.n(o),l=i(62802),h=i(27581),p=i(15129),y=i(76723),g=(i(42793),i(53048),i(33462),i(39801),i(55859),i(29934),i(50222)),d=i.n(g),v=(i(28539),i(66781)),x=i.n(v),b=(i(92268),i(80849),i(44750)),S=i(76206),k=i(4917),w=(i(93827),i(19993),i(50030),i(85878),i(47554),i(78447),i(41420)),E=(i(26275),i(29130),i(58718)),C=(i(64523),i(93641),i(51880),i(81274));i(63365),i(85219),i(20256),i(46722),i(35265),i(17085),i(82925),i(41665);function _typeof(t){return _typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}var P=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],R=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function getImageDataFromCanvas(t,r,i,a,o){if("string"===typeof t&&(t=document.getElementById(t)),!t||"object"!==_typeof(t)||!("getContext"in t))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var u=t.getContext("2d");try{return u.getImageData(r,i,a,o)}catch(l){throw new Error("unable to access image data: "+l)}}function processCanvasRGBA(t,r,i,a,o,u){if(!(isNaN(u)||u<1)){u|=0;var l=getImageDataFromCanvas(t,r,i,a,o);l=processImageDataRGBA(l,r,i,a,o,u),t.getContext("2d").putImageData(l,r,i)}}function processImageDataRGBA(t,r,i,a,o,u){for(var l,h=t.data,p=2*u+1,y=a-1,g=o-1,d=u+1,v=d*(d+1)/2,x=new A,b=x,S=1;S<p;S++)b=b.next=new A,S===d&&(l=b);b.next=x;for(var k=null,w=null,E=0,C=0,Z=P[u],T=R[u],M=0;M<o;M++){b=x;for(var _=h[C],N=h[C+1],$=h[C+2],D=h[C+3],V=0;V<d;V++)b.r=_,b.g=N,b.b=$,b.a=D,b=b.next;for(var L=0,B=0,O=0,I=0,G=d*_,z=d*N,j=d*$,q=d*D,U=v*_,H=v*N,W=v*$,X=v*D,Y=1;Y<d;Y++){var Q=C+((y<Y?y:Y)<<2),K=h[Q],J=h[Q+1],tt=h[Q+2],et=h[Q+3],rt=d-Y;U+=(b.r=K)*rt,H+=(b.g=J)*rt,W+=(b.b=tt)*rt,X+=(b.a=et)*rt,L+=K,B+=J,O+=tt,I+=et,b=b.next}k=x,w=l;for(var nt=0;nt<a;nt++){var it=X*Z>>T;if(h[C+3]=it,0!==it){var at=255/it;h[C]=(U*Z>>T)*at,h[C+1]=(H*Z>>T)*at,h[C+2]=(W*Z>>T)*at}else h[C]=h[C+1]=h[C+2]=0;U-=G,H-=z,W-=j,X-=q,G-=k.r,z-=k.g,j-=k.b,q-=k.a;var ot=nt+u+1;ot=E+(ot<y?ot:y)<<2,L+=k.r=h[ot],B+=k.g=h[ot+1],O+=k.b=h[ot+2],I+=k.a=h[ot+3],U+=L,H+=B,W+=O,X+=I,k=k.next;var st=w,ut=st.r,ct=st.g,lt=st.b,ht=st.a;G+=ut,z+=ct,j+=lt,q+=ht,L-=ut,B-=ct,O-=lt,I-=ht,w=w.next,C+=4}E+=a}for(var ft=0;ft<a;ft++){C=ft<<2;var pt=h[C],yt=h[C+1],gt=h[C+2],dt=h[C+3],vt=d*pt,mt=d*yt,xt=d*gt,bt=d*dt,St=v*pt,kt=v*yt,wt=v*gt,Et=v*dt;b=x;for(var Ct=0;Ct<d;Ct++)b.r=pt,b.g=yt,b.b=gt,b.a=dt,b=b.next;for(var Pt=a,Rt=0,At=0,Zt=0,Tt=0,Mt=1;Mt<=u;Mt++){C=Pt+ft<<2;var _t=d-Mt;St+=(b.r=pt=h[C])*_t,kt+=(b.g=yt=h[C+1])*_t,wt+=(b.b=gt=h[C+2])*_t,Et+=(b.a=dt=h[C+3])*_t,Tt+=pt,Rt+=yt,At+=gt,Zt+=dt,b=b.next,Mt<g&&(Pt+=a)}C=ft,k=x,w=l;for(var Nt=0;Nt<o;Nt++){var $t=C<<2;h[$t+3]=dt=Et*Z>>T,dt>0?(dt=255/dt,h[$t]=(St*Z>>T)*dt,h[$t+1]=(kt*Z>>T)*dt,h[$t+2]=(wt*Z>>T)*dt):h[$t]=h[$t+1]=h[$t+2]=0,St-=vt,kt-=mt,wt-=xt,Et-=bt,vt-=k.r,mt-=k.g,xt-=k.b,bt-=k.a,$t=ft+(($t=Nt+d)<g?$t:g)*a<<2,St+=Tt+=k.r=h[$t],kt+=Rt+=k.g=h[$t+1],wt+=At+=k.b=h[$t+2],Et+=Zt+=k.a=h[$t+3],k=k.next,vt+=pt=w.r,mt+=yt=w.g,xt+=gt=w.b,bt+=dt=w.a,Tt-=pt,Rt-=yt,At-=gt,Zt-=dt,w=w.next,C+=a}}return t}var A=function BlurStack(){_classCallCheck(this,BlurStack),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};function compressSpaces(t){return t.replace(/(?!\u3000)\s+/gm," ")}function trimLeft(t){return t.replace(/^[\n \t]+/,"")}function trimRight(t){return t.replace(/[\n \t]+$/,"")}function toNumbers(t){var r=(t||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return r.map(parseFloat)}var Z=/^[A-Z-]+$/;function normalizeAttributeName(t){return Z.test(t)?t.toLowerCase():t}function parseExternalUrl(t){var r=t.match(/url\(('([^']+)'|"([^"]+)"|([^'"\)]+))\)/)||[];return r[2]||r[3]||r[4]}function normalizeColor(t){if(!t.startsWith("rgb"))return t;var r=3,i=t.replace(/\d+(\.\d+)?/g,(function(t,i){return r--&&i?String(Math.round(parseFloat(t))):t}));return i}var T=/(\[[^\]]+\])/g,M=/(#[^\s\+>~\.\[:]+)/g,_=/(\.[^\s\+>~\.\[:]+)/g,N=/(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi,$=/(:[\w-]+\([^\)]*\))/gi,D=/(:[^\s\+>~\.\[:]+)/g,V=/([^\s\+>~\.\[:]+)/g;function findSelectorMatch(t,r){var i=t.match(r);return i?[t.replace(r," "),i.length]:[t,0]}function getSelectorSpecificity(t){var r=[0,0,0],i=t.replace(/:not\(([^\)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),o=0,u=findSelectorMatch(i,T),l=(0,a.Z)(u,2);i=l[0],o=l[1],r[1]+=o;var h=findSelectorMatch(i,M),p=(0,a.Z)(h,2);i=p[0],o=p[1],r[0]+=o;var y=findSelectorMatch(i,_),g=(0,a.Z)(y,2);i=g[0],o=g[1],r[1]+=o;var d=findSelectorMatch(i,N),v=(0,a.Z)(d,2);i=v[0],o=v[1],r[2]+=o;var x=findSelectorMatch(i,$),b=(0,a.Z)(x,2);i=b[0],o=b[1],r[1]+=o;var S=findSelectorMatch(i,D),k=(0,a.Z)(S,2);i=k[0],o=k[1],r[1]+=o,i=i.replace(/[\*\s\+>~]/g," ").replace(/[#\.]/g," ");var w=findSelectorMatch(i,V),E=(0,a.Z)(w,2);return i=E[0],o=E[1],r[2]+=o,r.join("")}var L=1e-8;function vectorMagnitude(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))}function vectorsRatio(t,r){return(t[0]*r[0]+t[1]*r[1])/(vectorMagnitude(t)*vectorMagnitude(r))}function vectorsAngle(t,r){return(t[0]*r[1]<t[1]*r[0]?-1:1)*Math.acos(vectorsRatio(t,r))}function CB1(t){return t*t*t}function CB2(t){return 3*t*t*(1-t)}function CB3(t){return 3*t*(1-t)*(1-t)}function CB4(t){return(1-t)*(1-t)*(1-t)}function QB1(t){return t*t}function QB2(t){return 2*t*(1-t)}function QB3(t){return(1-t)*(1-t)}function createCommonjsModule(t,r){return r={exports:{}},t(r,r.exports),r.exports}createCommonjsModule((function(t){var r=function(t){var r,i=Object.prototype,a=i.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",h=o.toStringTag||"@@toStringTag";function wrap(t,r,i,a){var o=r&&r.prototype instanceof Generator?r:Generator,u=Object.create(o.prototype),l=new Context(a||[]);return u._invoke=makeInvokeMethod(t,i,l),u}function tryCatch(t,r,i){try{return{type:"normal",arg:t.call(r,i)}}catch(a){return{type:"throw",arg:a}}}t.wrap=wrap;var p="suspendedStart",y="suspendedYield",g="executing",d="completed",v={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var x={};x[u]=function(){return this};var b=Object.getPrototypeOf,S=b&&b(b(values([])));S&&S!==i&&a.call(S,u)&&(x=S);var k=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(x);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){t[r]=function(t){return this._invoke(r,t)}}))}function AsyncIterator(t,r){function invoke(i,o,u,l){var h=tryCatch(t[i],t,o);if("throw"!==h.type){var p=h.arg,y=p.value;return y&&"object"===typeof y&&a.call(y,"__await")?r.resolve(y.__await).then((function(t){invoke("next",t,u,l)}),(function(t){invoke("throw",t,u,l)})):r.resolve(y).then((function(t){p.value=t,u(p)}),(function(t){return invoke("throw",t,u,l)}))}l(h.arg)}var i;function enqueue(t,a){function callInvokeWithMethodAndArg(){return new r((function(r,i){invoke(t,a,r,i)}))}return i=i?i.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}this._invoke=enqueue}function makeInvokeMethod(t,r,i){var a=p;return function invoke(o,u){if(a===g)throw new Error("Generator is already running");if(a===d){if("throw"===o)throw u;return doneResult()}i.method=o,i.arg=u;while(1){var l=i.delegate;if(l){var h=maybeInvokeDelegate(l,i);if(h){if(h===v)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(a===p)throw a=d,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);a=g;var x=tryCatch(t,r,i);if("normal"===x.type){if(a=i.done?d:y,x.arg===v)continue;return{value:x.arg,done:i.done}}"throw"===x.type&&(a=d,i.method="throw",i.arg=x.arg)}}}function maybeInvokeDelegate(t,i){var a=t.iterator[i.method];if(a===r){if(i.delegate=null,"throw"===i.method){if(t.iterator["return"]&&(i.method="return",i.arg=r,maybeInvokeDelegate(t,i),"throw"===i.method))return v;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=tryCatch(a,t.iterator,i.arg);if("throw"===o.type)return i.method="throw",i.arg=o.arg,i.delegate=null,v;var u=o.arg;return u?u.done?(i[t.resultName]=u.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=r),i.delegate=null,v):u:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,v)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(t){if(t){var i=t[u];if(i)return i.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var o=-1,l=function next(){while(++o<t.length)if(a.call(t,o))return next.value=t[o],next.done=!1,next;return next.value=r,next.done=!0,next};return l.next=l}}return{next:doneResult}}function doneResult(){return{value:r,done:!0}}return GeneratorFunction.prototype=k.constructor=GeneratorFunctionPrototype,GeneratorFunctionPrototype.constructor=GeneratorFunction,GeneratorFunctionPrototype[h]=GeneratorFunction.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var r="function"===typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,h in t||(t[h]="GeneratorFunction")),t.prototype=Object.create(k),t},t.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),AsyncIterator.prototype[l]=function(){return this},t.AsyncIterator=AsyncIterator,t.async=function(r,i,a,o,u){void 0===u&&(u=Promise);var l=new AsyncIterator(wrap(r,i,a,o),u);return t.isGeneratorFunction(i)?l:l.next().then((function(t){return t.done?t.value:l.next()}))},defineIteratorMethods(k),k[h]="Generator",k[u]=function(){return this},k.toString=function(){return"[object Generator]"},t.keys=function(t){var r=[];for(var i in t)r.push(i);return r.reverse(),function next(){while(r.length){var i=r.pop();if(i in t)return next.value=i,next.done=!1,next}return next.done=!0,next}},t.values=values,Context.prototype={constructor:Context,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(resetTryEntry),!t)for(var i in this)"t"===i.charAt(0)&&a.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0],r=t.completion;if("throw"===r.type)throw r.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function handle(a,o){return l.type="throw",l.arg=t,i.next=a,o&&(i.method="next",i.arg=r),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],l=u.completion;if("root"===u.tryLoc)return handle("end");if(u.tryLoc<=this.prev){var h=a.call(u,"catchLoc"),p=a.call(u,"finallyLoc");if(h&&p){if(this.prev<u.catchLoc)return handle(u.catchLoc,!0);if(this.prev<u.finallyLoc)return handle(u.finallyLoc)}else if(h){if(this.prev<u.catchLoc)return handle(u.catchLoc,!0)}else{if(!p)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return handle(u.finallyLoc)}}}},abrupt:function(t,r){for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&a.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var u=o;break}}u&&("break"===t||"continue"===t)&&u.tryLoc<=r&&r<=u.finallyLoc&&(u=null);var l=u?u.completion:{};return l.type=t,l.arg=r,u?(this.method="next",this.next=u.finallyLoc,v):this.complete(l)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),v},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),resetTryEntry(i),v}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc===t){var a=i.completion;if("throw"===a.type){var o=a.arg;resetTryEntry(i)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,i,a){return this.delegate={iterator:values(t),resultName:i,nextLoc:a},"next"===this.method&&(this.arg=r),v}},t}(t.exports);try{regeneratorRuntime=r}catch(i){Function("r","regeneratorRuntime = r")(r)}}));var B=function(){function Property(t,r,i){(0,p.Z)(this,Property),this.document=t,this.name=r,this.value=i,this.isNormalizedColor=!1}return(0,y.Z)(Property,[{key:"hasValue",value:function hasValue(){var t=this.value;return null!==t&&""!==t&&0!==t&&"undefined"!==typeof t}},{key:"isString",value:function isString(t){var r=this.value,i="string"===typeof r;return i&&t?t.test(r):i}},{key:"isUrlDefinition",value:function isUrlDefinition(){return this.isString(/^url\(/)}},{key:"isPixels",value:function isPixels(){if(!this.hasValue())return!1;var t=this.getString();switch(!0){case/px$/.test(t):case/^[0-9]+$/.test(t):return!0;default:return!1}}},{key:"setValue",value:function setValue(t){return this.value=t,this}},{key:"getValue",value:function getValue(t){return"undefined"===typeof t||this.hasValue()?this.value:t}},{key:"getNumber",value:function getNumber(t){if(!this.hasValue())return"undefined"===typeof t?0:parseFloat(t);var r=this.value,i=parseFloat(r);return this.isString(/%$/)&&(i/=100),i}},{key:"getString",value:function getString(t){return"undefined"===typeof t||this.hasValue()?"undefined"===typeof this.value?"":String(this.value):String(t)}},{key:"getColor",value:function getColor(t){var r=this.getString(t);return this.isNormalizedColor||(this.isNormalizedColor=!0,r=normalizeColor(r),this.value=r),r}},{key:"getDpi",value:function getDpi(){return 96}},{key:"getRem",value:function getRem(){return this.document.rootEmSize}},{key:"getEm",value:function getEm(){return this.document.emSize}},{key:"getUnits",value:function getUnits(){return this.getString().replace(/[0-9\.\-]/g,"")}},{key:"getPixels",value:function getPixels(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasValue())return 0;var i="boolean"===typeof t?[void 0,t]:[t],o=(0,a.Z)(i,2),u=o[0],l=o[1],h=this.document.screen.viewPort;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(h.computeSize("x"),h.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(h.computeSize("x"),h.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*h.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*h.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return 15*this.getNumber();case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case this.isString(/%$/)&&l:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*h.computeSize(u);default:var p=this.getNumber();return r&&p<1?p*h.computeSize(u):p}}},{key:"getMilliseconds",value:function getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}},{key:"getRadians",value:function getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}},{key:"getDefinition",value:function getDefinition(){var t=this.getString(),r=t.match(/#([^\)'"]+)/);return r&&(r=r[1]),r||(r=t),this.document.definitions[r]}},{key:"getFillStyleDefinition",value:function getFillStyleDefinition(t,r){var i=this.getDefinition();if(!i)return null;if("function"===typeof i.createGradient)return i.createGradient(this.document.ctx,t,r);if("function"===typeof i.createPattern){if(i.getHrefAttribute().hasValue()){var a=i.getAttribute("patternTransform");i=i.getHrefAttribute().getDefinition(),a.hasValue()&&i.getAttribute("patternTransform",!0).setValue(a.value)}return i.createPattern(this.document.ctx,t,r)}return null}},{key:"getTextBaseline",value:function getTextBaseline(){return this.hasValue()?Property.textBaselineMapping[this.getString()]:null}},{key:"addOpacity",value:function addOpacity(t){for(var r=this.getColor(),i=r.length,a=0,o=0;o<i;o++)if(","===r[o]&&a++,3===a)break;if(t.hasValue()&&this.isString()&&3!==a){var u=new(x())(r);u.ok&&(u.alpha=t.getNumber(),r=u.toRGBA())}return new Property(this.document,this.name,r)}}],[{key:"empty",value:function empty(t){return new Property(t,"EMPTY","")}}]),Property}();B.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};var O=function(){function ViewPort(){(0,p.Z)(this,ViewPort),this.viewPorts=[]}return(0,y.Z)(ViewPort,[{key:"clear",value:function clear(){this.viewPorts=[]}},{key:"setCurrent",value:function setCurrent(t,r){this.viewPorts.push({width:t,height:r})}},{key:"removeCurrent",value:function removeCurrent(){this.viewPorts.pop()}},{key:"getCurrent",value:function getCurrent(){var t=this.viewPorts;return t[t.length-1]}},{key:"computeSize",value:function computeSize(t){return"number"===typeof t?t:"x"===t?this.width:"y"===t?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}},{key:"width",get:function get(){return this.getCurrent().width}},{key:"height",get:function get(){return this.getCurrent().height}}]),ViewPort}(),I=function(){function Point(t,r){(0,p.Z)(this,Point),this.x=t,this.y=r}return(0,y.Z)(Point,[{key:"angleTo",value:function angleTo(t){return Math.atan2(t.y-this.y,t.x-this.x)}},{key:"applyTransform",value:function applyTransform(t){var r=this.x,i=this.y,a=r*t[0]+i*t[2]+t[4],o=r*t[1]+i*t[3]+t[5];this.x=a,this.y=o}}],[{key:"parse",value:function parse(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=toNumbers(t),o=(0,a.Z)(i,2),u=o[0],l=void 0===u?r:u,h=o[1],p=void 0===h?r:h;return new Point(l,p)}},{key:"parseScale",value:function parseScale(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=toNumbers(t),o=(0,a.Z)(i,2),u=o[0],l=void 0===u?r:u,h=o[1],p=void 0===h?l:h;return new Point(l,p)}},{key:"parsePath",value:function parsePath(t){for(var r=toNumbers(t),i=r.length,a=[],o=0;o<i;o+=2)a.push(new Point(r[o],r[o+1]));return a}}]),Point}(),G=function(){function Mouse(t){(0,p.Z)(this,Mouse),this.screen=t,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}return(0,y.Z)(Mouse,[{key:"isWorking",value:function isWorking(){return this.working}},{key:"start",value:function start(){if(!this.working){var t=this.screen,r=this.onClick,i=this.onMouseMove,a=t.ctx.canvas;a.onclick=r,a.onmousemove=i,this.working=!0}}},{key:"stop",value:function stop(){if(this.working){var t=this.screen.ctx.canvas;this.working=!1,t.onclick=null,t.onmousemove=null}}},{key:"hasEvents",value:function hasEvents(){return this.working&&this.events.length>0}},{key:"runEvents",value:function runEvents(){if(this.working){var t=this.screen,r=this.events,i=this.eventElements,a=t.ctx.canvas.style;a&&(a.cursor=""),r.forEach((function(t,r){var a=t.run,o=i[r];while(o)a(o),o=o.parent})),this.events=[],this.eventElements=[]}}},{key:"checkPath",value:function checkPath(t,r){if(this.working&&r){var i=this.events,a=this.eventElements;i.forEach((function(i,o){var u=i.x,l=i.y;!a[o]&&r.isPointInPath&&r.isPointInPath(u,l)&&(a[o]=t)}))}}},{key:"checkBoundingBox",value:function checkBoundingBox(t,r){if(this.working&&r){var i=this.events,a=this.eventElements;i.forEach((function(i,o){var u=i.x,l=i.y;!a[o]&&r.isPointInBox(u,l)&&(a[o]=t)}))}}},{key:"mapXY",value:function mapXY(t,r){var i=this.screen,a=i.window,o=i.ctx,u=new I(t,r),l=o.canvas;while(l)u.x-=l.offsetLeft,u.y-=l.offsetTop,l=l.offsetParent;return a.scrollX&&(u.x+=a.scrollX),a.scrollY&&(u.y+=a.scrollY),u}},{key:"onClick",value:function onClick(t){var r=this.mapXY((t||event).clientX,(t||event).clientY),i=r.x,a=r.y;this.events.push({type:"onclick",x:i,y:a,run:function run(t){t.onClick&&t.onClick()}})}},{key:"onMouseMove",value:function onMouseMove(t){var r=this.mapXY((t||event).clientX,(t||event).clientY),i=r.x,a=r.y;this.events.push({type:"onmousemove",x:i,y:a,run:function run(t){t.onMouseMove&&t.onMouseMove()}})}}]),Mouse}(),z="undefined"!==typeof window?window:null,j="undefined"!==typeof fetch?fetch.bind(void 0):null,q=function(){function Screen(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.fetch,a=void 0===i?j:i,o=r.window,u=void 0===o?z:o;(0,p.Z)(this,Screen),this.ctx=t,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new O,this.mouse=new G(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=u,this.fetch=a}return(0,y.Z)(Screen,[{key:"wait",value:function wait(t){this.waits.push(t)}},{key:"ready",value:function ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}},{key:"isReady",value:function isReady(){if(this.isReadyLock)return!0;var t=this.waits.every((function(t){return t()}));return t&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=t,t}},{key:"setDefaults",value:function setDefaults(t){t.strokeStyle="rgba(0,0,0,0)",t.lineCap="butt",t.lineJoin="miter",t.miterLimit=4}},{key:"setViewBox",value:function setViewBox(t){var r=t.document,i=t.ctx,o=t.aspectRatio,u=t.width,l=t.desiredWidth,h=t.height,p=t.desiredHeight,y=t.minX,g=void 0===y?0:y,d=t.minY,v=void 0===d?0:d,x=t.refX,b=t.refY,S=t.clip,k=void 0!==S&&S,w=t.clipX,E=void 0===w?0:w,C=t.clipY,P=void 0===C?0:C,R=compressSpaces(o).replace(/^defer\s/,""),A=R.split(" "),Z=(0,a.Z)(A,2),T=Z[0],M=Z[1],_=T||"xMidYMid",N=M||"meet",$=u/l,D=h/p,V=Math.min($,D),L=Math.max($,D),O=l,I=p;"meet"===N&&(O*=V,I*=V),"slice"===N&&(O*=L,I*=L);var G=new B(r,"refX",x),z=new B(r,"refY",b),j=G.hasValue()&&z.hasValue();if(j&&i.translate(-V*G.getPixels("x"),-V*z.getPixels("y")),k){var q=V*E,U=V*P;i.beginPath(),i.moveTo(q,U),i.lineTo(u,U),i.lineTo(u,h),i.lineTo(q,h),i.closePath(),i.clip()}if(!j){var H="meet"===N&&V===D,W="slice"===N&&L===D,X="meet"===N&&V===$,Y="slice"===N&&L===$;/^xMid/.test(_)&&(H||W)&&i.translate(u/2-O/2,0),/YMid$/.test(_)&&(X||Y)&&i.translate(0,h/2-I/2),/^xMax/.test(_)&&(H||W)&&i.translate(u-O,0),/YMax$/.test(_)&&(X||Y)&&i.translate(0,h-I)}switch(!0){case"none"===_:i.scale($,D);break;case"meet"===N:i.scale(V,V);break;case"slice"===N:i.scale(L,L);break}i.translate(-g,-v)}},{key:"start",value:function start(t){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.enableRedraw,o=void 0!==a&&a,u=i.ignoreMouse,l=void 0!==u&&u,h=i.ignoreAnimation,p=void 0!==h&&h,y=i.ignoreDimensions,g=void 0!==y&&y,v=i.ignoreClear,x=void 0!==v&&v,b=i.forceRedraw,S=i.scaleWidth,k=i.scaleHeight,w=i.offsetX,E=i.offsetY,C=this.FRAMERATE,P=this.mouse,R=1e3/C;if(this.frameDuration=R,this.readyPromise=new Promise((function(t){r.resolveReady=t})),this.isReady()&&this.render(t,g,x,S,k,w,E),o){var A=Date.now(),Z=A,T=0,M=function tick(){A=Date.now(),T=A-Z,T>=R&&(Z=A-T%R,r.shouldUpdate(p,b)&&(r.render(t,g,x,S,k,w,E),P.runEvents())),r.intervalId=d()(tick)};l||P.start(),this.intervalId=d()(M)}}},{key:"stop",value:function stop(){this.intervalId&&(d().cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}},{key:"shouldUpdate",value:function shouldUpdate(t,r){if(!t){var i=this.frameDuration,shouldUpdate=this.animations.reduce((function(t,r){return r.update(i)||t}),!1);if(shouldUpdate)return!0}return!("function"!==typeof r||!r())||(!(this.isReadyLock||!this.isReady())||!!this.mouse.hasEvents())}},{key:"render",value:function render(t,r,i,a,o,u,l){var h=this.CLIENT_WIDTH,p=this.CLIENT_HEIGHT,y=this.viewPort,g=this.ctx,d=this.isFirstRender,v=g.canvas;y.clear(),v.width&&v.height?y.setCurrent(v.width,v.height):y.setCurrent(h,p);var x=t.getStyle("width"),b=t.getStyle("height");!r&&(d||"number"!==typeof a&&"number"!==typeof o)&&(x.hasValue()&&(v.width=x.getPixels("x"),v.style&&(v.style.width="".concat(v.width,"px"))),b.hasValue()&&(v.height=b.getPixels("y"),v.style&&(v.style.height="".concat(v.height,"px"))));var S=v.clientWidth||v.width,k=v.clientHeight||v.height;if(r&&x.hasValue()&&b.hasValue()&&(S=x.getPixels("x"),k=b.getPixels("y")),y.setCurrent(S,k),"number"===typeof u&&t.getAttribute("x",!0).setValue(u),"number"===typeof l&&t.getAttribute("y",!0).setValue(l),"number"===typeof a||"number"===typeof o){var w=toNumbers(t.getAttribute("viewBox").getString()),E=0,C=0;if("number"===typeof a){var P=t.getStyle("width");P.hasValue()?E=P.getPixels("x")/a:isNaN(w[2])||(E=w[2]/a)}if("number"===typeof o){var R=t.getStyle("height");R.hasValue()?C=R.getPixels("y")/o:isNaN(w[3])||(C=w[3]/o)}E||(E=C),C||(C=E),t.getAttribute("width",!0).setValue(a),t.getAttribute("height",!0).setValue(o);var A=t.getStyle("transform",!0,!0);A.setValue("".concat(A.getString()," scale(").concat(1/E,", ").concat(1/C,")"))}i||g.clearRect(0,0,S,k),t.render(g),d&&(this.isFirstRender=!1)}}]),Screen}();q.defaultWindow=z,q.defaultFetch=j;var U=q.defaultFetch,H="undefined"!==typeof DOMParser?DOMParser:null,W=function(){function Parser(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.fetch,i=void 0===r?U:r,a=t.DOMParser,o=void 0===a?H:a;(0,p.Z)(this,Parser),this.fetch=i,this.DOMParser=o}return(0,y.Z)(Parser,[{key:"parse",value:function(){var t=(0,l.Z)(u().mark((function _callee(t){return u().wrap((function _callee$(r){while(1)switch(r.prev=r.next){case 0:if(!/^</.test(t)){r.next=2;break}return r.abrupt("return",this.parseFromString(t));case 2:return r.abrupt("return",this.load(t));case 3:case"end":return r.stop()}}),_callee,this)})));function parse(r){return t.apply(this,arguments)}return parse}()},{key:"parseFromString",value:function parseFromString(t){var r=new this.DOMParser;try{return this.checkDocument(r.parseFromString(t,"image/svg+xml"))}catch(i){return this.checkDocument(r.parseFromString(t,"text/xml"))}}},{key:"checkDocument",value:function checkDocument(t){var r=t.getElementsByTagName("parsererror")[0];if(r)throw new Error(r.textContent);return t}},{key:"load",value:function(){var t=(0,l.Z)(u().mark((function _callee2(t){var r,i;return u().wrap((function _callee2$(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,this.fetch(t);case 2:return r=a.sent,a.next=5,r.text();case 5:return i=a.sent,a.abrupt("return",this.parseFromString(i));case 7:case"end":return a.stop()}}),_callee2,this)})));function load(r){return t.apply(this,arguments)}return load}()}]),Parser}(),X=function(){function Translate(t,r){(0,p.Z)(this,Translate),this.type="translate",this.point=null,this.point=I.parse(r)}return(0,y.Z)(Translate,[{key:"apply",value:function apply(t){var r=this.point,i=r.x,a=r.y;t.translate(i||0,a||0)}},{key:"unapply",value:function unapply(t){var r=this.point,i=r.x,a=r.y;t.translate(-1*i||0,-1*a||0)}},{key:"applyToPoint",value:function applyToPoint(t){var r=this.point,i=r.x,a=r.y;t.applyTransform([1,0,0,1,i||0,a||0])}}]),Translate}(),Y=function(){function Rotate(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];(0,p.Z)(this,Rotate),this.type="rotate",this.angle=null,this.cx=0,this.cy=0;var a=toNumbers(r);this.angle=new B(t,"angle",a[0]),this.cx=(a[1]||0)+(i[0]||0),this.cy=(a[2]||0)+(i[1]||0)}return(0,y.Z)(Rotate,[{key:"apply",value:function apply(t){var r=this.cx,i=this.cy,a=this.angle;t.translate(r,i),t.rotate(a.getRadians()),t.translate(-r,-i)}},{key:"unapply",value:function unapply(t){var r=this.cx,i=this.cy,a=this.angle;t.translate(r,i),t.rotate(-1*a.getRadians()),t.translate(-r,-i)}},{key:"applyToPoint",value:function applyToPoint(t){var r=this.cx,i=this.cy,a=this.angle,o=a.getRadians();t.applyTransform([1,0,0,1,r||0,i||0]),t.applyTransform([Math.cos(o),Math.sin(o),-Math.sin(o),Math.cos(o),0,0]),t.applyTransform([1,0,0,1,-r||0,-i||0])}}]),Rotate}(),Q=function(){function Scale(t,r){(0,p.Z)(this,Scale),this.type="scale",this.scale=null;var i=I.parseScale(r);0!==i.x&&0!==i.y||(i.x=L,i.y=L),this.scale=i}return(0,y.Z)(Scale,[{key:"apply",value:function apply(t){var r=this.scale,i=r.x,a=r.y;t.scale(i,a||i)}},{key:"unapply",value:function unapply(t){var r=this.scale,i=r.x,a=r.y;t.scale(1/i,1/a||i)}},{key:"applyToPoint",value:function applyToPoint(t){var r=this.scale,i=r.x,a=r.y;t.applyTransform([i||0,0,0,a||0,0,0])}}]),Scale}(),K=function(){function Matrix(t,r){(0,p.Z)(this,Matrix),this.type="matrix",this.matrix=[],this.matrix=toNumbers(r)}return(0,y.Z)(Matrix,[{key:"apply",value:function apply(t){var r=this.matrix;t.transform(r[0],r[1],r[2],r[3],r[4],r[5])}},{key:"unapply",value:function unapply(t){var r=this.matrix,i=r[0],a=r[2],o=r[4],u=r[1],l=r[3],h=r[5],p=0,y=0,g=1,d=1/(i*(l*g-h*y)-a*(u*g-h*p)+o*(u*y-l*p));t.transform(d*(l*g-h*y),d*(h*p-u*g),d*(o*y-a*g),d*(i*g-o*p),d*(a*h-o*l),d*(o*u-i*h))}},{key:"applyToPoint",value:function applyToPoint(t){t.applyTransform(this.matrix)}}]),Matrix}();function _createSuper(t){return function(){var r,i=(0,S.Z)(t);if(_isNativeReflectConstruct()){var a=(0,S.Z)(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return(0,b.Z)(this,r)}}function _isNativeReflectConstruct(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}var J=function(t){(0,k.Z)(Skew,t);var r=_createSuper(Skew);function Skew(t,i){var a;return(0,p.Z)(this,Skew),a=r.call(this,t,i),a.type="skew",a.angle=null,a.angle=new B(t,"angle",i),a}return Skew}(K);function _createSuper$1(t){return function(){var r,i=(0,S.Z)(t);if(_isNativeReflectConstruct$1()){var a=(0,S.Z)(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return(0,b.Z)(this,r)}}function _isNativeReflectConstruct$1(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}var tt=function(t){(0,k.Z)(SkewX,t);var r=_createSuper$1(SkewX);function SkewX(t,i){var a;return(0,p.Z)(this,SkewX),a=r.call(this,t,i),a.type="skewX",a.matrix=[1,0,Math.tan(a.angle.getRadians()),1,0,0],a}return SkewX}(J);function _createSuper$2(t){return function(){var r,i=(0,S.Z)(t);if(_isNativeReflectConstruct$2()){var a=(0,S.Z)(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return(0,b.Z)(this,r)}}function _isNativeReflectConstruct$2(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}var et=function(t){(0,k.Z)(SkewY,t);var r=_createSuper$2(SkewY);function SkewY(t,i){var a;return(0,p.Z)(this,SkewY),a=r.call(this,t,i),a.type="skewY",a.matrix=[1,Math.tan(a.angle.getRadians()),0,1,0,0],a}return SkewY}(J);function parseTransforms(t){return compressSpaces(t).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function parseTransform(t){var r=t.split("("),i=(0,a.Z)(r,2),o=i[0],u=i[1];return[o.trim(),u.trim().replace(")","")]}var rt=function(){function Transform(t,r,i){var o=this;(0,p.Z)(this,Transform),this.document=t,this.transforms=[];var u=parseTransforms(r),l=i?toNumbers(i):[];u.forEach((function(t){if("none"!==t){var r=parseTransform(t),i=(0,a.Z)(r,2),u=i[0],h=i[1],p=Transform.transformTypes[u];"undefined"!==typeof p&&o.transforms.push(new p(o.document,h,l))}}))}return(0,y.Z)(Transform,[{key:"apply",value:function apply(t){for(var r=this.transforms,i=r.length,a=0;a<i;a++)r[a].apply(t)}},{key:"unapply",value:function unapply(t){for(var r=this.transforms,i=r.length,a=i-1;a>=0;a--)r[a].unapply(t)}},{key:"applyToPoint",value:function applyToPoint(t){for(var r=this.transforms,i=r.length,a=0;a<i;a++)r[a].applyToPoint(t)}}],[{key:"fromElement",value:function fromElement(t,r){var i=r.getStyle("transform",!1,!0),a=r.getStyle("transform-origin",!1,!0);return i.hasValue()?new Transform(t,i.getString(),a.getString()):null}}]),Transform}();rt.transformTypes={translate:X,rotate:Y,scale:Q,matrix:K,skewX:tt,skewY:et};var nt=function(){function Element(t,r){var i=this,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if((0,p.Z)(this,Element),this.document=t,this.node=r,this.captureTextNodes=o,this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],r&&1===r.nodeType){if(Array.from(r.attributes).forEach((function(r){var a=normalizeAttributeName(r.nodeName);i.attributes[a]=new B(t,a,r.value)})),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var u=this.getAttribute("style").getString().split(";").map((function(t){return t.trim()}));u.forEach((function(r){if(r){var o=r.split(":").map((function(t){return t.trim()})),u=(0,a.Z)(o,2),l=u[0],h=u[1];i.styles[l]=new B(t,l,h)}}))}var l=t.definitions,h=this.getAttribute("id");h.hasValue()&&(l[h.getValue()]||(l[h.getValue()]=this)),Array.from(r.childNodes).forEach((function(r){if(1===r.nodeType)i.addChild(r);else if(o&&(3===r.nodeType||4===r.nodeType)){var a=t.createTextNode(r);a.getText().length>0&&i.addChild(a)}}))}}return(0,y.Z)(Element,[{key:"getAttribute",value:function getAttribute(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.attributes[t];if(!i&&r){var a=new B(this.document,t,"");return this.attributes[t]=a,a}return i||B.empty(this.document)}},{key:"getHrefAttribute",value:function getHrefAttribute(){for(var t in this.attributes)if("href"===t||/:href$/.test(t))return this.attributes[t];return B.empty(this.document)}},{key:"getStyle",value:function getStyle(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=this.styles[t];if(a)return a;var o=this.getAttribute(t);if(o&&o.hasValue())return this.styles[t]=o,o;if(!i){var u=this.parent;if(u){var l=u.getStyle(t);if(l&&l.hasValue())return l}}if(r){var h=new B(this.document,t,"");return this.styles[t]=h,h}return a||B.empty(this.document)}},{key:"render",value:function render(t){if("none"!==this.getStyle("display").getString()&&"hidden"!==this.getStyle("visibility").getString()){if(t.save(),this.getStyle("mask").hasValue()){var r=this.getStyle("mask").getDefinition();r&&(this.applyEffects(t),r.apply(t,this))}else if("none"!==this.getStyle("filter").getValue("none")){var i=this.getStyle("filter").getDefinition();i&&(this.applyEffects(t),i.apply(t,this))}else this.setContext(t),this.renderChildren(t),this.clearContext(t);t.restore()}}},{key:"setContext",value:function setContext(t){}},{key:"applyEffects",value:function applyEffects(t){var r=rt.fromElement(this.document,this);r&&r.apply(t);var i=this.getStyle("clip-path",!1,!0);if(i.hasValue()){var a=i.getDefinition();a&&a.apply(t)}}},{key:"clearContext",value:function clearContext(t){}},{key:"renderChildren",value:function renderChildren(t){this.children.forEach((function(r){r.render(t)}))}},{key:"addChild",value:function addChild(t){var r=t instanceof Element?t:this.document.createElement(t);r.parent=this,Element.ignoreChildTypes.includes(r.type)||this.children.push(r)}},{key:"matchesSelector",value:function matchesSelector(t){var r=this.node;if("function"===typeof r.matches)return r.matches(t);var i=r.getAttribute("class");return!(!i||""===i)&&i.split(" ").some((function(r){if(".".concat(r)===t)return!0}))}},{key:"addStylesFromStyleDefinition",value:function addStylesFromStyleDefinition(){var t=this.document,r=t.styles,i=t.stylesSpecificity;for(var a in r)if("@"!==a[0]&&this.matchesSelector(a)){var o=r[a],u=i[a];if(o)for(var l in o){var h=this.stylesSpecificity[l];"undefined"===typeof h&&(h="000"),u>=h&&(this.styles[l]=o[l],this.stylesSpecificity[l]=u)}}}},{key:"removeStyles",value:function removeStyles(t,r){var i=r.reduce((function(r,i){var a=t.getStyle(i);if(!a.hasValue())return r;var o=a.getString();return a.setValue(""),[].concat((0,w.Z)(r),[[i,o]])}),[]);return i}},{key:"restoreStyles",value:function restoreStyles(t,r){r.forEach((function(r){var i=(0,a.Z)(r,2),o=i[0],u=i[1];t.getStyle(o,!0).setValue(u)}))}}]),Element}();function _createSuper$3(t){return function(){var r,i=(0,S.Z)(t);if(_isNativeReflectConstruct$3()){var a=(0,S.Z)(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return(0,b.Z)(this,r)}}function _isNativeReflectConstruct$3(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}nt.ignoreChildTypes=["title"];var it=function(t){(0,k.Z)(UnknownElement,t);var r=_createSuper$3(UnknownElement);function UnknownElement(t,i,a){var o;return(0,p.Z)(this,UnknownElement),o=r.call(this,t,i,a),o}return UnknownElement}(nt);function wrapFontFamily(t){var r=t.trim();return/^('|")/.test(r)?r:'"'.concat(r,'"')}function prepareFontFamily(t){return"undefined"===typeof process?t:t.trim().split(",").map(wrapFontFamily).join(",")}function prepareFontStyle(t){if(!t)return"";var r=t.trim().toLowerCase();switch(r){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return r;default:return/^oblique\s+(-|)\d+deg$/.test(r)?r:""}}function prepareFontWeight(t){if(!t)return"";var r=t.trim().toLowerCase();switch(r){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return r;default:return/^[\d.]+$/.test(r)?r:""}}var at=function(){function Font(t,r,i,a,o,u){(0,p.Z)(this,Font);var l=u?"string"===typeof u?Font.parse(u):u:{};this.fontFamily=o||l.fontFamily,this.fontSize=a||l.fontSize,this.fontStyle=t||l.fontStyle,this.fontWeight=i||l.fontWeight,this.fontVariant=r||l.fontVariant}return(0,y.Z)(Font,[{key:"toString",value:function toString(){return[prepareFontStyle(this.fontStyle),this.fontVariant,prepareFontWeight(this.fontWeight),this.fontSize,prepareFontFamily(this.fontFamily)].join(" ").trim()}}],[{key:"parse",value:function parse(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0,i="",o="",u="",l="",h="",p=compressSpaces(t).trim().split(" "),y={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return p.forEach((function(t){switch(!0){case!y.fontStyle&&Font.styles.includes(t):"inherit"!==t&&(i=t),y.fontStyle=!0;break;case!y.fontVariant&&Font.variants.includes(t):"inherit"!==t&&(o=t),y.fontStyle=!0,y.fontVariant=!0;break;case!y.fontWeight&&Font.weights.includes(t):"inherit"!==t&&(u=t),y.fontStyle=!0,y.fontVariant=!0,y.fontWeight=!0;break;case!y.fontSize:if("inherit"!==t){var r=t.split("/"),p=(0,a.Z)(r,1);l=p[0]}y.fontStyle=!0,y.fontVariant=!0,y.fontWeight=!0,y.fontSize=!0;break;default:"inherit"!==t&&(h+=t)}})),new Font(i,o,u,l,h,r)}}]),Font}();at.styles="normal|italic|oblique|inherit",at.variants="normal|small-caps|inherit",at.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";var ot=function(){function BoundingBox(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.NaN,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.NaN,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.NaN,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Number.NaN;(0,p.Z)(this,BoundingBox),this.x1=t,this.y1=r,this.x2=i,this.y2=a,this.addPoint(t,r),this.addPoint(i,a)}return(0,y.Z)(BoundingBox,[{key:"addPoint",value:function addPoint(t,r){"undefined"!==typeof t&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),"undefined"!==typeof r&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=r,this.y2=r),r<this.y1&&(this.y1=r),r>this.y2&&(this.y2=r))}},{key:"addX",value:function addX(t){this.addPoint(t,null)}},{key:"addY",value:function addY(t){this.addPoint(null,t)}},{key:"addBoundingBox",value:function addBoundingBox(t){if(t){var r=t.x1,i=t.y1,a=t.x2,o=t.y2;this.addPoint(r,i),this.addPoint(a,o)}}},{key:"sumCubic",value:function sumCubic(t,r,i,a,o){return Math.pow(1-t,3)*r+3*Math.pow(1-t,2)*t*i+3*(1-t)*Math.pow(t,2)*a+Math.pow(t,3)*o}},{key:"bezierCurveAdd",value:function bezierCurveAdd(t,r,i,a,o){var u=6*r-12*i+6*a,l=-3*r+9*i-9*a+3*o,h=3*i-3*r;if(0!==l){var p=Math.pow(u,2)-4*h*l;if(!(p<0)){var y=(-u+Math.sqrt(p))/(2*l);0<y&&y<1&&(t?this.addX(this.sumCubic(y,r,i,a,o)):this.addY(this.sumCubic(y,r,i,a,o)));var g=(-u-Math.sqrt(p))/(2*l);0<g&&g<1&&(t?this.addX(this.sumCubic(g,r,i,a,o)):this.addY(this.sumCubic(g,r,i,a,o)))}}else{if(0===u)return;var d=-h/u;0<d&&d<1&&(t?this.addX(this.sumCubic(d,r,i,a,o)):this.addY(this.sumCubic(d,r,i,a,o)))}}},{key:"addBezierCurve",value:function addBezierCurve(t,r,i,a,o,u,l,h){this.addPoint(t,r),this.addPoint(l,h),this.bezierCurveAdd(!0,t,i,o,l),this.bezierCurveAdd(!1,r,a,u,h)}},{key:"addQuadraticCurve",value:function addQuadraticCurve(t,r,i,a,o,u){var l=t+2/3*(i-t),h=r+2/3*(a-r),p=l+1/3*(o-t),y=h+1/3*(u-r);this.addBezierCurve(t,r,l,p,h,y,o,u)}},{key:"isPointInBox",value:function isPointInBox(t,r){var i=this.x1,a=this.y1,o=this.x2,u=this.y2;return i<=t&&t<=o&&a<=r&&r<=u}},{key:"x",get:function get(){return this.x1}},{key:"y",get:function get(){return this.y1}},{key:"width",get:function get(){return this.x2-this.x1}},{key:"height",get:function get(){return this.y2-this.y1}}]),BoundingBox}();function _createSuper$4(t){return function(){var r,i=(0,S.Z)(t);if(_isNativeReflectConstruct$4()){var a=(0,S.Z)(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return(0,b.Z)(this,r)}}function _isNativeReflectConstruct$4(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}var st=function(t){(0,k.Z)(RenderedElement,t);var r=_createSuper$4(RenderedElement);function RenderedElement(){var t;return(0,p.Z)(this,RenderedElement),t=r.apply(this,arguments),t.modifiedEmSizeStack=!1,t}return(0,y.Z)(RenderedElement,[{key:"calculateOpacity",value:function calculateOpacity(){var t=1,r=this;while(r){var i=r.getStyle("opacity",!1,!0);i.hasValue()&&(t*=i.getNumber()),r=r.parent}return t}},{key:"setContext",value:function setContext(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!r){var i=this.getStyle("fill"),a=this.getStyle("fill-opacity"),o=this.getStyle("stroke"),u=this.getStyle("stroke-opacity");if(i.isUrlDefinition()){var l=i.getFillStyleDefinition(this,a);l&&(t.fillStyle=l)}else if(i.hasValue()){"currentColor"===i.getString()&&i.setValue(this.getStyle("color").getColor());var h=i.getColor();"inherit"!==h&&(t.fillStyle="none"===h?"rgba(0,0,0,0)":h)}if(a.hasValue()){var p=new B(this.document,"fill",t.fillStyle).addOpacity(a).getColor();t.fillStyle=p}if(o.isUrlDefinition()){var y=o.getFillStyleDefinition(this,u);y&&(t.strokeStyle=y)}else if(o.hasValue()){"currentColor"===o.getString()&&o.setValue(this.getStyle("color").getColor());var g=o.getString();"inherit"!==g&&(t.strokeStyle="none"===g?"rgba(0,0,0,0)":g)}if(u.hasValue()){var d=new B(this.document,"stroke",t.strokeStyle).addOpacity(u).getString();t.strokeStyle=d}var v=this.getStyle("stroke-width");if(v.hasValue()){var x=v.getPixels();t.lineWidth=x||L}var b=this.getStyle("stroke-linecap"),S=this.getStyle("stroke-linejoin"),k=this.getStyle("stroke-miterlimit"),w=this.getStyle("paint-order"),E=this.getStyle("stroke-dasharray"),C=this.getStyle("stroke-dashoffset");if(b.hasValue()&&(t.lineCap=b.getString()),S.hasValue()&&(t.lineJoin=S.getString()),k.hasValue()&&(t.miterLimit=k.getNumber()),w.hasValue()&&(t.paintOrde