PageSourceSearch

https://www.watchfire.com/_next/static/chunks/6fde9f8c.1e2d08d44118b9a2.js

js watchfire.com collected 2026-09-24 09:00:52 UTC 77,137 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[724],{39957:function(t,e,i){i.d(e,{wh:function(){return tq}});var s=i(54087),r=i(26131),n=i(35851),a=i(62449),h=i(83454);function l(t){return t.replace(/(?!\u3000)\s+/gm," ")}function o(t){let e=t.match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm);return e?e.map(parseFloat):[]}let u=/^[A-Z-]+$/;function g(t){let e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(t);return e&&(e[2]||e[3]||e[4])||""}let c=/(\[[^\]]+\])/g,d=/(#[^\s+>~.[:]+)/g,p=/(\.[^\s+>~.[:]+)/g,y=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,f=/(:[\w-]+\([^)]*\))/gi,x=/(:[^\s+>~.[:]+)/g,m=/([^\s+>~.[:]+)/g;function b(t,e){let i=e.exec(t);return i?[t.replace(e," "),i.length]:[t,0]}function S(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))}function w(t,e){return(t[0]*e[0]+t[1]*e[1])/(S(t)*S(e))}function v(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(w(t,e))}function P(t){return 3*t*(1-t)*(1-t)}class A{static empty(t){return new A(t,"EMPTY","")}split(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:" ",{document:e,name:i}=this;return l(this.getString()).trim().split(t).map(t=>new A(e,i,t))}hasValue(t){let e=this.value;return null!==e&&""!==e&&(t||0!==e)&&void 0!==e}isString(t){let{value:e}=this,i="string"==typeof e;return i&&t?t.test(e):i}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;let t=this.getString();switch(!0){case t.endsWith("px"):case/^[0-9]+$/.test(t):return!0;default:return!1}}setValue(t){return this.value=t,this}getValue(t){return void 0===t||this.hasValue()?this.value:t}getNumber(t){if(!this.hasValue())return void 0===t?0:parseFloat(t);let{value:e}=this,i=parseFloat(e);return this.isString(/%$/)&&(i/=100),i}getString(t){return void 0===t||this.hasValue()?void 0===this.value?"":String(this.value):String(t)}getColor(t){let e=this.getString(t);return this.isNormalizedColor||(this.isNormalizedColor=!0,e=function(t){if(!t.startsWith("rgb"))return t;let e=3;return t.replace(/\d+(\.\d+)?/g,(t,i)=>e--&&i?String(Math.round(parseFloat(t))):t)}(e),this.value=e),e}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasValue())return 0;let[i,s]="boolean"==typeof t?[void 0,t]:[t],{viewPort:r}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(r.computeSize("x"),r.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(r.computeSize("x"),r.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*r.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*r.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);
1case 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(/%$/)&&s:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*r.computeSize(i);default:{let t=this.getNumber();if(e&&t<1)return t*r.computeSize(i);return t}}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){let t=this.getString(),e=/#([^)'"]+)/.exec(t),i=(null==e?void 0:e[1])||t;return this.document.definitions.get(i)}getFillStyleDefinition(t,e){let i=this.getDefinition();if(!i)return null;if("function"==typeof i.createGradient&&"getBoundingBox"in t)return i.createGradient(this.document.ctx,t,e);if("function"==typeof i.createPattern){if(i.getHrefAttribute().hasValue()){let t=i.getAttribute("patternTransform");(i=i.getHrefAttribute().getDefinition())&&t.hasValue()&&i.getAttribute("patternTransform",!0).setValue(t.value)}if(i)return i.createPattern(this.document.ctx,t,e)}return null}getTextBaseline(){if(!this.hasValue())return null;let t=this.getString();return A.textBaselineMapping[t]||null}addOpacity(t){let e=this.getColor(),i=e.length,s=0;for(let t=0;t<i&&(","===e[t]&&s++,3!==s);t++);if(t.hasValue()&&this.isString()&&3!==s){let i=new r(e);i.ok&&(i.alpha=t.getNumber(),e=i.toRGBA())}return new A(this.document,this.name,e)}constructor(t,e,i){this.document=t,this.name=e,this.value=i,this.isNormalizedColor=!1}}A.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};class C{clear(){this.viewPorts=[]}setCurrent(t,e){this.viewPorts.push({width:t,height:e})}removeCurrent(){this.viewPorts.pop()}getRoot(){let[t]=this.viewPorts;return t||T()}getCurrent(){let{viewPorts:t}=this;return t[t.length-1]||T()}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}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)}constructor(){this.viewPorts=[]}}function T(){return{width:C.DEFAULT_VIEWPORT_WIDTH,height:C.DEFAULT_VIEWPORT_HEIGHT}}C.DEFAULT_VIEWPORT_WIDTH=800,C.DEFAULT_VIEWPORT_HEIGHT=600;class V{static parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,[i=e,s=e]=o(t);return new V(i,s)}static parseScale(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,[i=e,s=i]=o(t);return new V(i,s)}static parsePath(t){let e=o(t),i=e.length,s=[];for(let t=0;t<i;t+=2)s.push(new V(e[t],e[t+1]));return s}angleTo(t){return Math.atan2(t.y-this.y,t.x-this.x)}applyTransform(t){let{x:e,y:i}=this,s=e*t[0]+i*t[2]+t[4],r=e*t[1]+i*t[3]+t[5];this.x=s,this.y=r}constructor(t,e){this.x=t,this.y=e}}class M{isWorking(){return this.working}start(){if(this.working)return;let{screen:t,onClick:e,onMouseMove:i}=this,s=t.ctx.canvas;s.onclick=e,s.onmousemove=i,this.working=!0}stop(){if(!this.working)return;let t=this.screen.ctx.canvas;this.working=!1,t.onclick=null,t.onmousemove=null}hasEvents(){return this.working&&this.events.length>0}runEvents(){let t;if(!this.working)return;let{screen:e,events:i,eventElements:s}=this,{style:r}=e.ctx.canvas;r&&(r.cursor=""),i.forEach((e,i)=>{let{run:r}=e;for(t=s[i];t;)r(t),t=t.parent}),this.events=[],this.eventElements=[]}checkPath(t,e){if(!this.working||!e)return;let{events:i,eventElements:s}=this;i.forEach((i,r)=>{let{x:n,y:a}=i;!s[r]&&e.isPointInPath&&e.isPointInPath(n,a)&&(s[r]=t)})}checkBoundingBox(t,e){if(!this.working||!e)return;let{events:i,eventElements:s}=this;
1i.forEach((i,r)=>{let{x:n,y:a}=i;!s[r]&&e.isPointInBox(n,a)&&(s[r]=t)})}mapXY(t,e){let{window:i,ctx:s}=this.screen,r=new V(t,e),n=s.canvas;for(;n;)r.x-=n.offsetLeft,r.y-=n.offsetTop,n=n.offsetParent;return(null==i?void 0:i.scrollX)&&(r.x+=i.scrollX),(null==i?void 0:i.scrollY)&&(r.y+=i.scrollY),r}onClick(t){let{x:e,y:i}=this.mapXY(t.clientX,t.clientY);this.events.push({type:"onclick",x:e,y:i,run(t){t.onClick&&t.onClick()}})}onMouseMove(t){let{x:e,y:i}=this.mapXY(t.clientX,t.clientY);this.events.push({type:"onmousemove",x:e,y:i,run(t){t.onMouseMove&&t.onMouseMove()}})}constructor(t){this.screen=t,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}}let k="undefined"!=typeof window?window:null,E="undefined"!=typeof fetch?fetch.bind(void 0):void 0;class N{wait(t){this.waits.push(t)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;let t=this.waits.every(t=>t());return t&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=t,t}setDefaults(t){t.strokeStyle="rgba(0,0,0,0)",t.lineCap="butt",t.lineJoin="miter",t.miterLimit=4}setViewBox(t){let{document:e,ctx:i,aspectRatio:s,width:r,desiredWidth:n,height:a,desiredHeight:h,minX:o=0,minY:u=0,refX:g,refY:c,clip:d=!1,clipX:p=0,clipY:y=0}=t,[f,x]=l(s).replace(/^defer\s/,"").split(" "),m=f||"xMidYMid",b=x||"meet",S=r/n,w=a/h,v=Math.min(S,w),P=Math.max(S,w),C=n,T=h;"meet"===b&&(C*=v,T*=v),"slice"===b&&(C*=P,T*=P);let V=new A(e,"refX",g),M=new A(e,"refY",c),k=V.hasValue()&&M.hasValue();if(k&&i.translate(-v*V.getPixels("x"),-v*M.getPixels("y")),d){let t=v*p,e=v*y;i.beginPath(),i.moveTo(t,e),i.lineTo(r,e),i.lineTo(r,a),i.lineTo(t,a),i.closePath(),i.clip()}if(!k){let t="meet"===b&&v===w,e="slice"===b&&P===w,s="meet"===b&&v===S,n="slice"===b&&P===S;m.startsWith("xMid")&&(t||e)&&i.translate(r/2-C/2,0),m.endsWith("YMid")&&(s||n)&&i.translate(0,a/2-T/2),m.startsWith("xMax")&&(t||e)&&i.translate(r-C,0),m.endsWith("YMax")&&(s||n)&&i.translate(0,a-T)}switch(!0){case"none"===m:i.scale(S,w);break;case"meet"===b:i.scale(v,v);break;case"slice"===b:i.scale(P,P)}i.translate(-o,-u)}start(t){let{enableRedraw:e=!1,ignoreMouse:i=!1,ignoreAnimation:r=!1,ignoreDimensions:n=!1,ignoreClear:a=!1,forceRedraw:h,scaleWidth:l,scaleHeight:o,offsetX:u,offsetY:g}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mouse:c}=this,d=1e3/N.FRAMERATE;if(this.isReadyLock=!1,this.frameDuration=d,this.readyPromise=new Promise(t=>{this.resolveReady=t}),this.isReady()&&this.render(t,n,a,l,o,u,g),!e)return;let p=Date.now(),y=p,f=0,x=()=>{(f=(p=Date.now())-y)>=d&&(y=p-f%d,this.shouldUpdate(r,h)&&(this.render(t,n,a,l,o,u,g),c.runEvents())),this.intervalId=s(x)};i||c.start(),this.intervalId=s(x)}stop(){this.intervalId&&(s.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(t,e){if(!t){let{frameDuration:t}=this;if(this.animations.reduce((e,i)=>i.update(t)||e,!1))return!0}return!!("function"==typeof e&&e()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(t,e,i,s,r,n,a){let{viewPort:h,ctx:l,isFirstRender:u}=this,g=l.canvas;h.clear(),g.width&&g.height&&h.setCurrent(g.width,g.height);let c=t.getStyle("width"),d=t.getStyle("height");!e&&(u||"number"!=typeof s&&"number"!=typeof r)&&(c.hasValue()&&(g.width=c.getPixels("x"),g.style&&(g.style.width="".concat(g.width,"px"))),d.hasValue()&&(g.height=d.getPixels("y"),g.style&&(g.style.height="".concat(g.height,"px"))));let p=g.clientWidth||g.width,y=g.clientHeight||g.height;if(e&&c.hasValue()&&d.hasValue()&&(p=c.getPixels("x"),y=d.getPixels("y")),h.setCurrent(p,y),"number"==typeof n&&t.getAttribute("x",!0).setValue(n),"number"==typeof a&&t.getAttribute("y",!0).setValue(a),"number"==typeof s||"number"==typeof r){let e=o(t.getAttribute("viewBox").getString()),i=0,n=0;if("number"==typeof s){let r=t.getStyle("width");r.hasValue()?i=r.getPixels("x")/s:e[2]&&!isNaN(e[2])&&(i=e[2]/s)}if("number"==typeof r){let i=t.getStyle("height");i.hasValue()?n=i.getPixels("y")/r:e[3]&&!isNaN(e[3])&&(n=e[3]/r)}i||(i=n),n||(n=i),t.getAttribute("width",!0).setValue(s),t.getAttribute("height",!0).setValue(r);let a=t.getStyle("transform",!0,!0);a.setValue("".concat(a.getString()," scale(").concat(1/i,", ").concat(1/n,")"))}i||l.clearRect(0,0,p,y),t.render(l),u&&(this.isFirstRender=!1)}constructor(t,{fetch:e=E,window:i=k}={}){if(this.ctx=t,this.viewPort=new C,this.mouse=new M(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=i,!e)throw Error("Can't find 'fetch' in 'globalThis', please provide it via options");this.fetch=e}}N.defaultWindow=k,N.defaultFetch=E,N.FRAMERATE=30,N.MAX_VIRTUAL_PIXELS=3e4;let{defaultFetch:O}=N,z="undefined"!=typeof DOMParser?DOMParser:void 0;class I{async parse(t){return t.startsWith("<")?this.parseFromString(t):this.load(t)}parseFromString(t){let e=new this.DOMParser;try{return this.checkDocument(e.parseFromString(t,"image/svg+xml"))}catch(i){return this.checkDocument(e.parseFromString(t,"text/xml"))}}checkDocument(t){let e=t.getElementsByTagName("parsererror")[0];if(e)throw Error(e.textContent||"Unknown parse error");return t}async load(t){let e=await this.fetch(t),i=await e.text();return this.parseFromString(i)}constructor({fetch:t=O,DOMParser:e=z}={}){if(!t)throw Error("Can't find 'fetch' in 'globalThis', please provide it via options");
1if(!e)throw Error("Can't find 'DOMParser' in 'globalThis', please provide it via options");this.fetch=t,this.DOMParser=e}}class B{apply(t){let{x:e,y:i}=this.point;t.translate(e||0,i||0)}unapply(t){let{x:e,y:i}=this.point;t.translate(-1*e||0,-1*i||0)}applyToPoint(t){let{x:e,y:i}=this.point;t.applyTransform([1,0,0,1,e||0,i||0])}constructor(t,e){this.type="translate",this.point=V.parse(e)}}class L{apply(t){let{cx:e,cy:i,originX:s,originY:r,angle:n}=this,a=e+s.getPixels("x"),h=i+r.getPixels("y");t.translate(a,h),t.rotate(n.getRadians()),t.translate(-a,-h)}unapply(t){let{cx:e,cy:i,originX:s,originY:r,angle:n}=this,a=e+s.getPixels("x"),h=i+r.getPixels("y");t.translate(a,h),t.rotate(-1*n.getRadians()),t.translate(-a,-h)}applyToPoint(t){let{cx:e,cy:i,angle:s}=this,r=s.getRadians();t.applyTransform([1,0,0,1,e||0,i||0]),t.applyTransform([Math.cos(r),Math.sin(r),-Math.sin(r),Math.cos(r),0,0]),t.applyTransform([1,0,0,1,-e||0,-i||0])}constructor(t,e,i){this.type="rotate";let s=o(e);this.angle=new A(t,"angle",s[0]),this.originX=i[0],this.originY=i[1],this.cx=s[1]||0,this.cy=s[2]||0}}class D{apply(t){let{scale:{x:e,y:i},originX:s,originY:r}=this,n=s.getPixels("x"),a=r.getPixels("y");t.translate(n,a),t.scale(e,i||e),t.translate(-n,-a)}unapply(t){let{scale:{x:e,y:i},originX:s,originY:r}=this,n=s.getPixels("x"),a=r.getPixels("y");t.translate(n,a),t.scale(1/e,1/i||e),t.translate(-n,-a)}applyToPoint(t){let{x:e,y:i}=this.scale;t.applyTransform([e||0,0,0,i||0,0,0])}constructor(t,e,i){this.type="scale";let s=V.parseScale(e);(0===s.x||0===s.y)&&(s.x=1e-8,s.y=1e-8),this.scale=s,this.originX=i[0],this.originY=i[1]}}class R{apply(t){let{originX:e,originY:i,matrix:s}=this,r=e.getPixels("x"),n=i.getPixels("y");t.translate(r,n),t.transform(s[0],s[1],s[2],s[3],s[4],s[5]),t.translate(-r,-n)}unapply(t){let{originX:e,originY:i,matrix:s}=this,r=s[0],n=s[2],a=s[4],h=s[1],l=s[3],o=s[5],u=1/(r*(1*l-0*o)-n*(1*h-0*o)+a*(0*h-0*l)),g=e.getPixels("x"),c=i.getPixels("y");t.translate(g,c),t.transform(u*(1*l-0*o),u*(0*o-1*h),u*(0*a-1*n),u*(1*r-0*a),u*(n*o-a*l),u*(a*h-r*o)),t.translate(-g,-c)}applyToPoint(t){t.applyTransform(this.matrix)}constructor(t,e,i){this.type="matrix",this.matrix=function(t){let e=o(t);return[e[0]||0,e[1]||0,e[2]||0,e[3]||0,e[4]||0,e[5]||0]}(e),this.originX=i[0],this.originY=i[1]}}class _ extends R{constructor(t,e,i){super(t,e,i),this.type="skew",this.angle=new A(t,"angle",e)}}class F extends _{constructor(t,e,i){super(t,e,i),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class U extends _{constructor(t,e,i){super(t,e,i),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}class W{static fromElement(t,e){let i=e.getStyle("transform",!1,!0);if(i.hasValue()){let[s,r=s]=e.getStyle("transform-origin",!1,!0).split();if(s&&r)return new W(t,i.getString(),[s,r])}return null}
1apply(t){this.transforms.forEach(e=>e.apply(t))}unapply(t){this.transforms.forEach(e=>e.unapply(t))}applyToPoint(t){this.transforms.forEach(e=>e.applyToPoint(t))}constructor(t,e,i){this.document=t,this.transforms=[],l(e).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/).forEach(t=>{if("none"===t)return;let[e,s]=function(t){let[e="",i=""]=t.split("(");return[e.trim(),i.trim().replace(")","")]}(t),r=W.transformTypes[e];r&&this.transforms.push(new r(this.document,s,i))})}}W.transformTypes={translate:B,rotate:L,scale:D,matrix:R,skewX:F,skewY:U};class X{getAttribute(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.attributes.get(t);if(!i&&e){let e=new A(this.document,t,"");return this.attributes.set(t,e),e}return i||A.empty(this.document)}getHrefAttribute(){let t;for(let[e,i]of this.attributes)if("href"===e||e.endsWith(":href")){t=i;break}return t||A.empty(this.document)}getStyle(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=this.styles.get(t);if(s)return s;let r=this.getAttribute(t);if(r.hasValue())return this.styles.set(t,r),r;if(!i){let{parent:e}=this;if(e){let i=e.getStyle(t);if(i.hasValue())return i}}if(e){let e=new A(this.document,t,"");return this.styles.set(t,e),e}return A.empty(this.document)}render(t){if("none"!==this.getStyle("display").getString()&&"hidden"!==this.getStyle("visibility").getString()){if(t.save(),this.getStyle("mask").hasValue()){let e=this.getStyle("mask").getDefinition();e&&(this.applyEffects(t),e.apply(t,this))}else if("none"!==this.getStyle("filter").getValue("none")){let e=this.getStyle("filter").getDefinition();e&&(this.applyEffects(t),e.apply(t,this))}else this.setContext(t),this.renderChildren(t),this.clearContext(t);t.restore()}}setContext(t){}applyEffects(t){let e=W.fromElement(this.document,this);e&&e.apply(t);let i=this.getStyle("clip-path",!1,!0);if(i.hasValue()){let e=i.getDefinition();e&&e.apply(t)}}clearContext(t){}renderChildren(t){this.children.forEach(e=>{e.render(t)})}addChild(t){let e=t instanceof X?t:this.document.createElement(t);e.parent=this,X.ignoreChildTypes.includes(e.type)||this.children.push(e)}matchesSelector(t){var e;let{node:i}=this;if("function"==typeof i.matches)return i.matches(t);let s=null===(e=i.getAttribute)||void 0===e?void 0:e.call(i,"class");return!!s&&""!==s&&s.split(" ").some(e=>".".concat(e)===t)}addStylesFromStyleDefinition(){let{styles:t,stylesSpecificity:e}=this.document;for(let[i,s]of t)if(!i.startsWith("@")&&this.matchesSelector(i)){let t=e.get(i);if(s)for(let[e,i]of s){let s=this.stylesSpecificity.get(e);void 0===s&&(s="000"),t&&t>=s&&(i&&this.styles.set(e,i),this.stylesSpecificity.set(e,t))}}}removeStyles(t,e){return e.reduce((e,i)=>{let s=t.getStyle(i);if(!s.hasValue())return e;let r=s.getString();return s.setValue(""),[...e,[i,r]]},[])}restoreStyles(t,e){e.forEach(e=>{let[i,s]=e;t.getStyle(i,!0).setValue(s)})}isFirstChild(){var t;return(null===(t=this.parent)||void 0===t?void 0:t.children.indexOf(this))===0}constructor(t,e,i=!1){if(this.document=t,this.node=e,this.captureTextNodes=i,this.type="",this.attributes=new Map,this.styles=new Map,this.stylesSpecificity=new Map,this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],!e||1!==e.nodeType)return;Array.from(e.attributes).forEach(e=>{var i;let s=(i=e.nodeName,u.test(i)?i.toLowerCase():i);this.attributes.set(s,new A(t,s,e.value))}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()&&this.getAttribute("style").getString().split(";").map(t=>t.trim()).forEach(e=>{if(!e)return;let[i,s]=e.split(":").map(t=>t.trim());i&&this.styles.set(i,new A(t,i,s))});let{definitions:s}=t,r=this.getAttribute("id");r.hasValue()&&!s.has(r.getString())&&s.set(r.getString(),this),Array.from(e.childNodes).forEach(e=>{if(1===e.nodeType)this.addChild(e);else if(i&&(3===e.nodeType||4===e.nodeType)){let i=t.createTextNode(e);i.getText().length>0&&this.addChild(i)}})}}X.ignoreChildTypes=["title"];class H extends X{constructor(t,e,i){super(t,e,i)}}function q(t){let e=t.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}class Y{static parse(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,i="",s="",r="",n="",a="",h=l(t).trim().split(" "),o={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return h.forEach(t=>{switch(!0){case!o.fontStyle&&Y.styles.includes(t):"inherit"!==t&&(i=t),o.fontStyle=!0;break;case!o.fontVariant&&Y.variants.includes(t):"inherit"!==t&&(s=t),o.fontStyle=!0,o.fontVariant=!0;break;case!o.fontWeight&&Y.weights.includes(t):"inherit"!==t&&(r=t),o.fontStyle=!0,o.fontVariant=!0,o.fontWeight=!0;break;case!o.fontSize:"inherit"!==t&&(n=t.split("/")[0]||""),o.fontStyle=!0,o.fontVariant=!0,o.fontWeight=!0,o.fontSize=!0;break;
1default:"inherit"!==t&&(a+=t)}}),new Y(i,s,r,n,a,e)}toString(){var t;return[function(t){if(!t)return"";let e=t.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:if(/^oblique\s+(-|)\d+deg$/.test(e))return e;return""}}(this.fontStyle),this.fontVariant,function(t){if(!t)return"";let e=t.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:if(/^[\d.]+$/.test(e))return e;return""}}(this.fontWeight),this.fontSize,(t=this.fontFamily,void 0===h?t:t.trim().split(",").map(q).join(","))].join(" ").trim()}constructor(t,e,i,s,r,n){let a=n?"string"==typeof n?Y.parse(n):n:{};this.fontFamily=r||a.fontFamily,this.fontSize=s||a.fontSize,this.fontStyle=t||a.fontStyle,this.fontWeight=i||a.fontWeight,this.fontVariant=e||a.fontVariant}}Y.styles="normal|italic|oblique|inherit",Y.variants="normal|small-caps|inherit",Y.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class G{get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(t,e){void 0!==t&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),void 0!==e&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))}addX(t){this.addPoint(t,0)}addY(t){this.addPoint(0,t)}addBoundingBox(t){if(!t)return;let{x1:e,y1:i,x2:s,y2:r}=t;this.addPoint(e,i),this.addPoint(s,r)}sumCubic(t,e,i,s,r){return Math.pow(1-t,3)*e+3*Math.pow(1-t,2)*t*i+3*(1-t)*Math.pow(t,2)*s+Math.pow(t,3)*r}bezierCurveAdd(t,e,i,s,r){let n=6*e-12*i+6*s,a=-3*e+9*i-9*s+3*r,h=3*i-3*e;if(0===a){if(0===n)return;let a=-h/n;0<a&&a<1&&(t?this.addX(this.sumCubic(a,e,i,s,r)):this.addY(this.sumCubic(a,e,i,s,r)));return}let l=Math.pow(n,2)-4*h*a;if(l<0)return;let o=(-n+Math.sqrt(l))/(2*a);0<o&&o<1&&(t?this.addX(this.sumCubic(o,e,i,s,r)):this.addY(this.sumCubic(o,e,i,s,r)));let u=(-n-Math.sqrt(l))/(2*a);0<u&&u<1&&(t?this.addX(this.sumCubic(u,e,i,s,r)):this.addY(this.sumCubic(u,e,i,s,r)))}addBezierCurve(t,e,i,s,r,n,a,h){this.addPoint(t,e),this.addPoint(a,h),this.bezierCurveAdd(!0,t,i,r,a),this.bezierCurveAdd(!1,e,s,n,h)}addQuadraticCurve(t,e,i,s,r,n){let a=t+2/3*(i-t),h=e+2/3*(s-e);this.addBezierCurve(t,e,a,a+1/3*(r-t),h,h+1/3*(n-e),r,n)}isPointInBox(t,e){let{x1:i,y1:s,x2:r,y2:n}=this;return i<=t&&t<=r&&s<=e&&e<=n}constructor(t=Number.NaN,e=Number.NaN,i=Number.NaN,s=Number.NaN){this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.addPoint(t,e),this.addPoint(i,s)}}class $ extends X{calculateOpacity(){let t=1,e=this;for(;e;){let i=e.getStyle("opacity",!1,!0);i.hasValue(!0)&&(t*=i.getNumber()),e=e.parent}return t}setContext(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e){let e=this.getStyle("fill"),i=this.getStyle("fill-opacity"),s=this.getStyle("stroke"),r=this.getStyle("stroke-opacity");if(e.isUrlDefinition()){let s=e.getFillStyleDefinition(this,i);s&&(t.fillStyle=s)}else if(e.hasValue()){"currentColor"===e.getString()&&e.setValue(this.getStyle("color").getColor());let i=e.getColor();"inherit"!==i&&(t.fillStyle="none"===i?"rgba(0,0,0,0)":i)}if(i.hasValue()){let e=new A(this.document,"fill",t.fillStyle).addOpacity(i).getColor();t.fillStyle=e}if(s.isUrlDefinition()){let e=s.getFillStyleDefinition(this,r);e&&(t.strokeStyle=e)}
1else if(s.hasValue()){"currentColor"===s.getString()&&s.setValue(this.getStyle("color").getColor());let e=s.getString();"inherit"!==e&&(t.strokeStyle="none"===e?"rgba(0,0,0,0)":e)}if(r.hasValue()){let e=new A(this.document,"stroke",t.strokeStyle).addOpacity(r).getString();t.strokeStyle=e}let n=this.getStyle("stroke-width");if(n.hasValue()){let e=n.getPixels();t.lineWidth=e||1e-8}let a=this.getStyle("stroke-linecap"),h=this.getStyle("stroke-linejoin"),l=this.getStyle("stroke-miterlimit"),u=this.getStyle("stroke-dasharray"),g=this.getStyle("stroke-dashoffset");if(a.hasValue()&&(t.lineCap=a.getString()),h.hasValue()&&(t.lineJoin=h.getString()),l.hasValue()&&(t.miterLimit=l.getNumber()),u.hasValue()&&"none"!==u.getString()){let e=o(u.getString());void 0!==t.setLineDash?t.setLineDash(e):void 0!==t.webkitLineDash?t.webkitLineDash=e:void 0===t.mozDash||1===e.length&&0===e[0]||(t.mozDash=e);let i=g.getPixels();void 0!==t.lineDashOffset?t.lineDashOffset=i:void 0!==t.webkitLineDashOffset?t.webkitLineDashOffset=i:void 0!==t.mozDashOffset&&(t.mozDashOffset=i)}}if(this.modifiedEmSizeStack=!1,void 0!==t.font){let e=this.getStyle("font"),i=this.getStyle("font-style"),s=this.getStyle("font-variant"),r=this.getStyle("font-weight"),n=this.getStyle("font-size"),a=this.getStyle("font-family"),h=new Y(i.getString(),s.getString(),r.getString(),n.hasValue()?"".concat(n.getPixels(!0),"px"):"",a.getString(),Y.parse(e.getString(),t.font));i.setValue(h.fontStyle),s.setValue(h.fontVariant),r.setValue(h.fontWeight),n.setValue(h.fontSize),a.setValue(h.fontFamily),t.font=h.toString(),n.isPixels()&&(this.document.emSize=n.getPixels(),this.modifiedEmSizeStack=!0)}e||(this.applyEffects(t),t.globalAlpha=this.calculateOpacity())}clearContext(t){super.clearContext(t),this.modifiedEmSizeStack&&this.document.popEmSize()}constructor(...t){super(...t),this.modifiedEmSizeStack=!1}}class Q extends ${setContext(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super.setContext(t,e);let i=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();i&&(t.textBaseline=i)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(t){if("text"!==this.type)return this.getTElementBoundingBox(t);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t);let e=null;return this.children.forEach((i,s)=>{let r=this.getChildBoundingBox(t,this,this,s);e?e.addBoundingBox(r):e=r}),e}getFontSize(){let{document:t,parent:e}=this,i=Y.parse(t.ctx.font).fontSize;return e.getStyle("font-size").getNumber(i)}getTElementBoundingBox(t){let e=this.getFontSize();return new G(this.x,this.y-e,this.x+this.measureText(t),this.y)}getGlyph(t,e,i){let s;let r=e[i];if(t.isArabic){var n;let a=e.length,h=e[i-1],l=e[i+1],o="isolated";(0===i||" "===h)&&i<a-1&&" "!==l&&(o="terminal"),i>0&&" "!==h&&i<a-1&&" "!==l&&(o="medial"),i>0&&" "!==h&&(i===a-1||" "===l)&&(o="initial"),s=(null===(n=t.arabicGlyphs.get(r))||void 0===n?void 0:n.get(o))||t.glyphs.get(r)}else s=t.glyphs.get(r);return s||(s=t.missingGlyph),s}getText(){return""}getTextFromNode(t){let e=t||this.node,i=Array.from(e.parentNode.childNodes),s=i.indexOf(e),r=i.length-1,n=l(e.textContent||"");return 0===s&&(n=n.replace(/^[\n \t]+/,"")),s===r&&(n=n.replace(/[\n \t]+$/,"")),n}renderChildren(t){if("text"!==this.type){this.renderTElementChildren(t);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t),this.children.forEach((e,i)=>{this.renderChild(t,this,this,i)});let{mouse:e}=this.document.screen;e.isWorking()&&e.checkBoundingBox(this,this.getBoundingBox(t))}renderTElementChildren(t){let{document:e,parent:i}=this,s=this.getText(),r=i.getStyle("font-family").getDefinition();if(r){let{unitsPerEm:n}=r.fontFace,a=Y.parse(e.ctx.font),h=i.getStyle("font-size").getNumber(a.fontSize),l=i.getStyle("font-style").getString(a.fontStyle),u=h/n,g=r.isRTL?s.split("").reverse().join(""):s,c=o(i.getAttribute("dx").getString()),d=g.length;for(let e=0;e<d;e++){let i=this.getGlyph(r,g,e);t.translate(this.x,this.y),t.scale(u,-u);let s=t.lineWidth;t.lineWidth=t.lineWidth*n/h,"italic"===l&&t.transform(1,0,.4,1,0,0),i.render(t),"italic"===l&&t.transform(1,0,-.4,1,0,0),t.lineWidth=s,t.scale(1/u,-1/u),t.translate(-this.x,-this.y),this.x+=h*(i.horizAdvX||r.horizAdvX)/n,void 0===c[e]||isNaN(c[e])||(this.x+=c[e])}return}let{x:n,y:a}=this;t.fillStyle&&t.fillText(s,n,a),t.strokeStyle&&t.strokeText(s,n,a)}
1applyAnchoring(){if(this.textChunkStart>=this.leafTexts.length)return;let t=this.leafTexts[this.textChunkStart],e=t.getStyle("text-anchor").getString("start"),i=0;i="start"===e?t.x-this.minX:"end"===e?t.x-this.maxX:t.x-(this.minX+this.maxX)/2;for(let t=this.textChunkStart;t<this.leafTexts.length;t++)this.leafTexts[t].x+=i;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}adjustChildCoordinatesRecursive(t){this.children.forEach((e,i)=>{this.adjustChildCoordinatesRecursiveCore(t,this,this,i)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(t,e,i,s){let r=i.children[s];r.children.length>0?r.children.forEach((i,s)=>{e.adjustChildCoordinatesRecursiveCore(t,e,r,s)}):this.adjustChildCoordinates(t,e,i,s)}adjustChildCoordinates(t,e,i,s){let r=i.children[s];if("function"!=typeof r.measureText)return r;t.save(),r.setContext(t,!0);let n=r.getAttribute("x"),a=r.getAttribute("y"),h=r.getAttribute("dx"),l=r.getAttribute("dy"),o=r.getStyle("font-family").getDefinition(),u=!!(null==o?void 0:o.isRTL);0!==s||(n.hasValue()||n.setValue(r.getInheritedAttribute("x")),a.hasValue()||a.setValue(r.getInheritedAttribute("y")),h.hasValue()||h.setValue(r.getInheritedAttribute("dx")),l.hasValue()||l.setValue(r.getInheritedAttribute("dy")));let g=r.measureText(t);return u&&(e.x-=g),n.hasValue()?(e.applyAnchoring(),r.x=n.getPixels("x"),h.hasValue()&&(r.x+=h.getPixels("x"))):(h.hasValue()&&(e.x+=h.getPixels("x")),r.x=e.x),e.x=r.x,u||(e.x+=g),a.hasValue()?(r.y=a.getPixels("y"),l.hasValue()&&(r.y+=l.getPixels("y"))):(l.hasValue()&&(e.y+=l.getPixels("y")),r.y=e.y),e.y=r.y,e.leafTexts.push(r),e.minX=Math.min(e.minX,r.x,r.x+g),e.maxX=Math.max(e.maxX,r.x,r.x+g),r.clearContext(t),t.restore(),r}getChildBoundingBox(t,e,i,s){let r=i.children[s];if("function"!=typeof r.getBoundingBox)return null;let n=r.getBoundingBox(t);return n&&r.children.forEach((i,s)=>{let a=e.getChildBoundingBox(t,e,r,s);n.addBoundingBox(a)}),n}renderChild(t,e,i,s){let r=i.children[s];r.render(t),r.children.forEach((i,s)=>{e.renderChild(t,e,r,s)})}measureText(t){let{measureCache:e}=this;if(~e)return e;let i=this.getText(),s=this.measureTargetText(t,i);return this.measureCache=s,s}measureTargetText(t,e){if(!e.length)return 0;let{parent:i}=this,s=i.getStyle("font-family").getDefinition();if(s){let t=this.getFontSize(),r=s.isRTL?e.split("").reverse().join(""):e,n=o(i.getAttribute("dx").getString()),a=r.length,h=0;for(let e=0;e<a;e++)h+=(this.getGlyph(s,r,e).horizAdvX||s.horizAdvX)*t/s.fontFace.unitsPerEm,void 0===n[e]||isNaN(n[e])||(h+=n[e]);return h}if(!t.measureText)return 10*e.length;t.save(),this.setContext(t,!0);let{width:r}=t.measureText(e);return this.clearContext(t),t.restore(),r}getInheritedAttribute(t){let e=this;for(;e instanceof Q&&e.isFirstChild()&&e.parent;){let i=e.parent.getAttribute(t);if(i.hasValue(!0))return i.getString("0");e=e.parent}return null}constructor(t,e,i){super(t,e,new.target===Q||i),this.type="text",this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.measureCache=-1}}class j extends Q{getText(){return this.text}constructor(t,e,i){super(t,e,new.target===j||i),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}}class Z extends j{constructor(...t){super(...t),this.type="textNode"}}class J extends n.OU{reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new V(0,0),this.control=new V(0,0),this.current=new V(0,0),this.points=[],this.angles=[]}isEnd(){let{i:t,commands:e}=this;return t>=e.length-1}next(){let t=this.commands[++this.i];return this.previousCommand=this.command,this.command=t,t}getPoint(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"x",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y",i=new V(this.command[t],this.command[e]);return this.makeAbsolute(i)}getAsControlPoint(t,e){let i=this.getPoint(t,e);return this.control=i,i}getAsCurrentPoint(t,e){let i=this.getPoint(t,e);return this.current=i,i}getReflectedControlPoint(){let t=this.previousCommand.type;if(t!==n.OU.CURVE_TO&&t!==n.OU.SMOOTH_CURVE_TO&&t!==n.OU.QUAD_TO&&t!==n.OU.SMOOTH_QUAD_TO)return this.current;let{current:{x:e,y:i}
1,control:{x:s,y:r}}=this;return new V(2*e-s,2*i-r)}makeAbsolute(t){if(this.command.relative){let{x:e,y:i}=this.current;t.x+=e,t.y+=i}return t}addMarker(t,e,i){let{points:s,angles:r}=this;i&&r.length>0&&!r[r.length-1]&&(r[r.length-1]=s[s.length-1].angleTo(i)),this.addMarkerAngle(t,e?e.angleTo(t):null)}addMarkerAngle(t,e){this.points.push(t),this.angles.push(e)}getMarkerPoints(){return this.points}getMarkerAngles(){let{angles:t}=this,e=t.length;for(let i=0;i<e;i++)if(!t[i]){for(let s=i+1;s<e;s++)if(t[s]){t[i]=t[s];break}}return t}constructor(t){super(t.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=new V(0,0),this.start=new V(0,0),this.current=new V(0,0),this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}}class K extends ${path(t){let{pathParser:e}=this,i=new G;for(e.reset(),t&&t.beginPath();!e.isEnd();)switch(e.next().type){case J.MOVE_TO:this.pathM(t,i);break;case J.LINE_TO:this.pathL(t,i);break;case J.HORIZ_LINE_TO:this.pathH(t,i);break;case J.VERT_LINE_TO:this.pathV(t,i);break;case J.CURVE_TO:this.pathC(t,i);break;case J.SMOOTH_CURVE_TO:this.pathS(t,i);break;case J.QUAD_TO:this.pathQ(t,i);break;case J.SMOOTH_QUAD_TO:this.pathT(t,i);break;case J.ARC:this.pathA(t,i);break;case J.CLOSE_PATH:this.pathZ(t,i)}return i}getBoundingBox(t){return this.path()}getMarkers(){let{pathParser:t}=this,e=t.getMarkerPoints(),i=t.getMarkerAngles();return e.map((t,e)=>[t,i[e]])}renderChildren(t){this.path(t),this.document.screen.mouse.checkPath(this,t);let e=this.getStyle("fill-rule");""!==t.fillStyle&&("inherit"!==e.getString("inherit")?t.fill(e.getString()):t.fill()),""!==t.strokeStyle&&("non-scaling-stroke"===this.getAttribute("vector-effect").getString()?(t.save(),t.setTransform(1,0,0,1,0,0),t.stroke(),t.restore()):t.stroke());let i=this.getMarkers();if(i){let e=i.length-1,s=this.getStyle("marker-start"),r=this.getStyle("marker-mid"),n=this.getStyle("marker-end");if(s.isUrlDefinition()){let e=s.getDefinition(),[r,n]=i[0];e.render(t,r,n)}if(r.isUrlDefinition()){let s=r.getDefinition();for(let r=1;r<e;r++){let[e,n]=i[r];s.render(t,e,n)}}if(n.isUrlDefinition()){let s=n.getDefinition(),[r,a]=i[e];s.render(t,r,a)}}}static pathM(t){let e=t.getAsCurrentPoint();return t.start=t.current,{point:e}}pathM(t,e){let{pathParser:i}=this,{point:s}=K.pathM(i),{x:r,y:n}=s;i.addMarker(s),e.addPoint(r,n),t&&t.moveTo(r,n)}static pathL(t){let{current:e}=t;return{current:e,point:t.getAsCurrentPoint()}}pathL(t,e){let{pathParser:i}=this,{current:s,point:r}=K.pathL(i),{x:n,y:a}=r;i.addMarker(r,s),e.addPoint(n,a),t&&t.lineTo(n,a)}static pathH(t){let{current:e,command:i}=t,s=new V((i.relative?e.x:0)+i.x,e.y);return t.current=s,{current:e,point:s}}pathH(t,e){let{pathParser:i}=this,{current:s,point:r}=K.pathH(i),{x:n,y:a}=r;i.addMarker(r,s),e.addPoint(n,a),t&&t.lineTo(n,a)}static pathV(t){let{current:e,command:i}=t,s=new V(e.x,(i.relative?e.y:0)+i.y);return t.current=s,{current:e,point:s}}pathV(t,e){let{pathParser:i}=this,{current:s,point:r}=K.pathV(i),{x:n,y:a}=r;i.addMarker(r,s),e.addPoint(n,a),t&&t.lineTo(n,a)}static pathC(t){let{current:e}=t;return{current:e,point:t.getPoint("x1","y1"),controlPoint:t.getAsControlPoint("x2","y2"),currentPoint:t.getAsCurrentPoint()}}pathC(t,e){let{pathParser:i}=this,{current:s,point:r,controlPoint:n,currentPoint:a}=K.pathC(i);i.addMarker(a,n,r),e.addBezierCurve(s.x,s.y,r.x,r.y,n.x,n.y,a.x,a.y),t&&t.bezierCurveTo(r.x,r.y,n.x,n.y,a.x,a.y)}static pathS(t){let{current:e}=t;return{current:e,point:t.getReflectedControlPoint(),controlPoint:t.getAsControlPoint("x2","y2"),currentPoint:t.getAsCurrentPoint()}}pathS(t,e){let{pathParser:i}=this,{current:s,point:r,controlPoint:n,currentPoint:a}=K.pathS(i);i.addMarker(a,n,r),e.addBezierCurve(s.x,s.y,r.x,r.y,n.x,n.y,a.x,a.y),t&&t.bezierCurveTo(r.x,r.y,n.x,n.y,a.x,a.y)}static pathQ(t){let{current:e}=t;return{current:e,controlPoint:t.getAsControlPoint("x1","y1"),currentPoint:t.getAsCurrentPoint()}}pathQ(t,e){let{pathParser:i}=this,{current:s,controlPoint:r,currentPoint:n}=K.pathQ(i);i.addMarker(n,r,r),e.addQuadraticCurve(s.x,s.y,r.x,r.y,n.x,n.y),t&&t.quadraticCurveTo(r.x,r.y,n.x,n.y)}static pathT(t){let{current:e}=t,i=t.getReflectedControlPoint();return t.control=i,{current:e,controlPoint:i,currentPoint:t.getAsCurrentPoint()}}pathT(t,e){let{pathParser:i}=this,{current:s,controlPoint:r,currentPoint:n}=K.pathT(i);i.addMarker(n,r,r),e.addQuadraticCurve(s.x,s.y,r.x,r.y,n.x,n.y),t&&t.quadraticCurveTo(r.x,r.y,n.x,n.y)}static pathA(t){let{current:e,command:i}=t,{rX:s,rY:r,xRot:n,lArcFlag:a,sweepFlag:h}
1=i,l=Math.PI/180*n,o=t.getAsCurrentPoint(),u=new V(Math.cos(l)*(e.x-o.x)/2+Math.sin(l)*(e.y-o.y)/2,-Math.sin(l)*(e.x-o.x)/2+Math.cos(l)*(e.y-o.y)/2),g=Math.pow(u.x,2)/Math.pow(s,2)+Math.pow(u.y,2)/Math.pow(r,2);g>1&&(s*=Math.sqrt(g),r*=Math.sqrt(g));let c=(a===h?-1:1)*Math.sqrt((Math.pow(s,2)*Math.pow(r,2)-Math.pow(s,2)*Math.pow(u.y,2)-Math.pow(r,2)*Math.pow(u.x,2))/(Math.pow(s,2)*Math.pow(u.y,2)+Math.pow(r,2)*Math.pow(u.x,2)));isNaN(c)&&(c=0);let d=new V(c*s*u.y/r,-(c*r)*u.x/s),p=new V((e.x+o.x)/2+Math.cos(l)*d.x-Math.sin(l)*d.y,(e.y+o.y)/2+Math.sin(l)*d.x+Math.cos(l)*d.y),y=v([1,0],[(u.x-d.x)/s,(u.y-d.y)/r]),f=[(u.x-d.x)/s,(u.y-d.y)/r],x=[(-u.x-d.x)/s,(-u.y-d.y)/r],m=v(f,x);return -1>=w(f,x)&&(m=Math.PI),w(f,x)>=1&&(m=0),{currentPoint:o,rX:s,rY:r,sweepFlag:h,xAxisRotation:l,centp:p,a1:y,ad:m}}pathA(t,e){let{pathParser:i}=this,{currentPoint:s,rX:r,rY:n,sweepFlag:a,xAxisRotation:h,centp:l,a1:o,ad:u}=K.pathA(i),g=1-a?1:-1,c=o+u/2*g,d=new V(l.x+r*Math.cos(c),l.y+n*Math.sin(c));if(i.addMarkerAngle(d,c-g*Math.PI/2),i.addMarkerAngle(s,c-g*Math.PI),e.addPoint(s.x,s.y),t&&!isNaN(o)&&!isNaN(u)){let e=r>n?1:r/n,i=r>n?n/r:1;t.translate(l.x,l.y),t.rotate(h),t.scale(e,i),t.arc(0,0,r>n?r:n,o,o+u,!!(1-a)),t.scale(1/e,1/i),t.rotate(-h),t.translate(-l.x,-l.y)}}static pathZ(t){t.current=t.start}pathZ(t,e){K.pathZ(this.pathParser),t&&e.x1!==e.x2&&e.y1!==e.y2&&t.closePath()}constructor(t,e,i){super(t,e,i),this.type="path",this.pathParser=new J(this.getAttribute("d").getString())}}class tt extends ${setContext(t){var e;let{document:i}=this,{screen:s,window:r}=i,n=t.canvas;if(s.setDefaults(t),"style"in n&&void 0!==t.font&&r&&void 0!==r.getComputedStyle){t.font=r.getComputedStyle(n).getPropertyValue("font");let e=new A(i,"fontSize",Y.parse(t.font).fontSize);e.hasValue()&&(i.rootEmSize=e.getPixels("y"),i.emSize=i.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);let{width:a,height:h}=s.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");let l=this.getAttribute("refX"),u=this.getAttribute("refY"),g=this.getAttribute("viewBox"),c=g.hasValue()?o(g.getString()):null,d=!this.root&&"visible"!==this.getStyle("overflow").getValue("hidden"),p=0,y=0,f=0,x=0;c&&(p=c[0],y=c[1]),this.root||(a=this.getStyle("width").getPixels("x"),h=this.getStyle("height").getPixels("y"),"marker"!==this.type||(f=p,x=y,p=0,y=0)),s.viewPort.setCurrent(a,h),this.node&&(!this.parent||(null===(e=this.node.parentNode)||void 0===e?void 0:e.nodeName)==="foreignObject")&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(t),t.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),c&&(a=c[2],h=c[3]),i.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s.viewPort.width,desiredWidth:a,height:s.viewPort.height,desiredHeight:h,minX:p,minY:y,refX:l.getValue(),refY:u.getValue(),clip:d,clipX:f,clipY:x}),c&&(s.viewPort.removeCurrent(),s.viewPort.setCurrent(a,h))}clearContext(t){super.clearContext(t),this.document.screen.viewPort.removeCurrent()}resize(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=this.getAttribute("width",!0),r=this.getAttribute("height",!0),n=this.getAttribute("viewBox"),a=this.getAttribute("style"),h=s.getNumber(0),l=r.getNumber(0);if(i){if("string"==typeof i)this.getAttribute("preserveAspectRatio",!0).setValue(i);else{let t=this.getAttribute("preserveAspectRatio");t.hasValue()&&t.setValue(t.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}}if(s.setValue(t),r.setValue(e),n.hasValue()||n.setValue("0 0 ".concat(h||t," ").concat(l||e)),a.hasValue()){let i=this.getStyle("width"),s=this.getStyle("height");i.hasValue()&&i.setValue("".concat(t,"px")),s.hasValue()&&s.setValue("".concat(e,"px"))}}constructor(...t){super(...t),this.type="svg",this.root=!1}}class te extends K{path(t){let e=this.getAttribute("x").getPixels("x"),i=this.getAttribute("y").getPixels("y"),s=this.getStyle("width",!1,!0).getPixels("x"),r=this.getStyle("height",!1,!0).getPixels("y"),n=this.getAttribute("rx"),a=this.getAttribute("ry"),h=n.getPixels("x"),l=a.getPixels("y");if(n.hasValue()&&!a.hasValue()&&(l=h),a.hasValue()&&!n.hasValue()&&(h=l),h=Math.min(h,s/2),l=Math.min(l,r/2),t){let n=(Math.sqrt(2)-1)/3*4;t.beginPath(),r>0&&s>0&&(t.moveTo(e+h,i),t.lineTo(e+s-h,i),t.bezierCurveTo(e+s-h+n*h,i,e+s,i+l-n*l,e+s,i+l),t.lineTo(e+s,i+r-l),t.bezierCurveTo(e+s,i+r-l+n*l,e+s-h+n*h,i+r,e+s-h,i+r),t.lineTo(e+h,i+r),t.bezierCurveTo(e+h-n*h,i+r,e,i+r-l+n*l,e,i+r-l),t.lineTo(e,i+l),t.bezierCurveTo(e,i+l-n*l,e+h-n*h,i,e+h,i),t.closePath())}return new G(e,i,e+s,i+r)}getMarkers(){return null}constructor(...t){super(...t),this.type="rect"}}class ti extends K{path(t){let e=this.getAttribute("cx").getPixels("x"),i=this.getAttribute("cy").getPixels("y"),s=this.getAttribute("r").getPixels();return t&&s>0&&(t.beginPath(),t.arc(e,i,s,0,2*Math.PI,!1),t.closePath()),new G(e-s,i-s,e+s,i+s)}getMarkers(){return null}constructor(...t){super(...t),this.type="circle"}}class ts extends K{path(t){let e=(Math.sqrt(2)-1)/3*4,i=this.getAttribute("rx").getPixels("x"),s=this.getAttribute("ry").getPixels("y"),r=this.getAttribute("cx").getPixels("x"),n=this.getAttribute("cy").getPixels("y");return t&&i>0&&s>0&&(t.beginPath(),t.moveTo(r+i,n),t.bezierCurveTo(r+i,n+e*s,r+e*i,n+s,r,n+s),t.bezierCurveTo(r-e*i,n+s,r-i,n+e*s,r-i,n),t.bezierCurveTo(r-i,n-e*s,r-e*i,n-s,r,n-s),t.bezierCurveTo(r+e*i,n-s,r+i,n-e*s,r+i,n),t.closePath()),new G(r-i,n-s,r+i,n+s)}getMarkers(){return null}constructor(...t){super(...t),this.type="ellipse"}}class tr extends K{getPoints(){return[new V(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new V(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(t){let[{x:e,y:i},{x:s,y:r}]=this.getPoints();return t&&(t.beginPath(),t.moveTo(e,i),t.lineTo(s,r)),new G(e,i,s,r)}getMarkers(){let[t,e]=this.getPoints(),i=t.angleTo(e);return[[t,i],[e,i]]}constructor(...t){super(...t),this.type="line"}}class tn extends K{path(t){let{points:e}=this,[{x:i,y:s}]=e,r=new G(i,s);
1return t&&(t.beginPath(),t.moveTo(i,s)),e.forEach(e=>{let{x:i,y:s}=e;r.addPoint(i,s),t&&t.lineTo(i,s)}),r}getMarkers(){let{points:t}=this,e=t.length-1,i=[];return t.forEach((s,r)=>{r!==e&&i.push([s,s.angleTo(t[r+1])])}),i.length>0&&i.push([t[t.length-1],i[i.length-1][1]]),i}constructor(t,e,i){super(t,e,i),this.type="polyline",this.points=[],this.points=V.parsePath(this.getAttribute("points").getString())}}class ta extends tn{path(t){let e=super.path(t),[{x:i,y:s}]=this.points;return t&&(t.lineTo(i,s),t.closePath()),e}constructor(...t){super(...t),this.type="polygon"}}class th extends X{createPattern(t,e,i){let s=this.getStyle("width").getPixels("x",!0),r=this.getStyle("height").getPixels("y",!0),n=new tt(this.document,null);n.attributes.set("viewBox",new A(this.document,"viewBox",this.getAttribute("viewBox").getValue())),n.attributes.set("width",new A(this.document,"width","".concat(s,"px"))),n.attributes.set("height",new A(this.document,"height","".concat(r,"px"))),n.attributes.set("transform",new A(this.document,"transform",this.getAttribute("patternTransform").getValue())),n.children=this.children;let a=this.document.createCanvas(s,r),h=a.getContext("2d"),l=this.getAttribute("x"),o=this.getAttribute("y");l.hasValue()&&o.hasValue()&&h.translate(l.getPixels("x",!0),o.getPixels("y",!0)),i.hasValue()?this.styles.set("fill-opacity",i):this.styles.delete("fill-opacity");for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++)h.save(),n.attributes.set("x",new A(this.document,"x",t*a.width)),n.attributes.set("y",new A(this.document,"y",e*a.height)),n.render(h),h.restore();return t.createPattern(a,"repeat")}constructor(...t){super(...t),this.type="pattern"}}class tl extends X{render(t,e,i){if(!e)return;let{x:s,y:r}=e,n=this.getAttribute("orient").getString("auto"),a=this.getAttribute("markerUnits").getString("strokeWidth");t.translate(s,r),"auto"===n&&t.rotate(i),"strokeWidth"===a&&t.scale(t.lineWidth,t.lineWidth),t.save();let h=new tt(this.document);
1h.type=this.type,h.attributes.set("viewBox",new A(this.document,"viewBox",this.getAttribute("viewBox").getValue())),h.attributes.set("refX",new A(this.document,"refX",this.getAttribute("refX").getValue())),h.attributes.set("refY",new A(this.document,"refY",this.getAttribute("refY").getValue())),h.attributes.set("width",new A(this.document,"width",this.getAttribute("markerWidth").getValue())),h.attributes.set("height",new A(this.document,"height",this.getAttribute("markerHeight").getValue())),h.attributes.set("overflow",new A(this.document,"overflow",this.getAttribute("overflow").getValue())),h.attributes.set("fill",new A(this.document,"fill",this.getAttribute("fill").getColor("black"))),h.attributes.set("stroke",new A(this.document,"stroke",this.getAttribute("stroke").getValue("none"))),h.children=this.children,h.render(t),t.restore(),"strokeWidth"===a&&t.scale(1/t.lineWidth,1/t.lineWidth),"auto"===n&&t.rotate(-i),t.translate(-s,-r)}constructor(...t){super(...t),this.type="marker"}}class to extends X{render(){}constructor(...t){super(...t),this.type="defs"}}class tu extends ${getBoundingBox(t){let e=new G;return this.children.forEach(i=>{e.addBoundingBox(i.getBoundingBox(t))}),e}constructor(...t){super(...t),this.type="g"}}class tg extends X{getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(t,e,i){let s=this;this.getHrefAttribute().hasValue()&&(s=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(s));let{stops:r}=s,n=this.getGradient(t,e);if(!n)return this.addParentOpacity(i,r[r.length-1].color);if(r.forEach(t=>{n.addColorStop(t.offset,this.addParentOpacity(i,t.color))}),this.getAttribute("gradientTransform").hasValue()){let{document:t}=this,{MAX_VIRTUAL_PIXELS:e}=N,{viewPort:i}=t.screen,s=i.getRoot(),r=new te(t);r.attributes.set("x",new A(t,"x",-e/3)),r.attributes.set("y",new A(t,"y",-e/3)),r.attributes.set("width",new A(t,"width",e)),r.attributes.set("height",new A(t,"height",e));let a=new tu(t);a.attributes.set("transform",new A(t,"transform",this.getAttribute("gradientTransform").getValue())),a.children=[r];let h=new tt(t);h.attributes.set("x",new A(t,"x",0)),h.attributes.set("y",new A(t,"y",0)),h.attributes.set("width",new A(t,"width",s.width)),h.attributes.set("height",new A(t,"height",s.height)),h.children=[a];let l=t.createCanvas(s.width,s.height),o=l.getContext("2d");return o.fillStyle=n,h.render(o),o.createPattern(l,"no-repeat")}return n}inheritStopContainer(t){this.attributesToInherit.forEach(e=>{!this.getAttribute(e).hasValue()&&t.getAttribute(e).hasValue()&&this.getAttribute(e,!0).setValue(t.getAttribute(e).getValue())})}addParentOpacity(t,e){return t.hasValue()?new A(this.document,"color",e).addOpacity(t).getColor():e}constructor(t,e,i){super(t,e,i),this.attributesToInherit=["gradientUnits"],this.stops=[];let{stops:s,children:r}=this;r.forEach(t=>{"stop"===t.type&&s.push(t)})}}class tc extends tg{getGradient(t,e){let i="objectBoundingBox"===this.getGradientUnits(),s=i?e.getBoundingBox(t):null;if(i&&!s)return null;this.getAttribute("x1").hasValue()||this.getAttribute("y1").hasValue()||this.getAttribute("x2").hasValue()||this.getAttribute("y2").hasValue()||(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));let r=i?s.x+s.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),n=i?s.y+s.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),a=i?s.x+s.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),h=i?s.y+s.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return r===a&&n===h?null:t.createLinearGradient(r,n,a,h)}constructor(t,e,i){super(t,e,i),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}}class td extends tg{getGradient(t,e){let i="objectBoundingBox"===this.getGradientUnits(),s=e.getBoundingBox(t);if(i&&!s)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");let r=i?s.x+s.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),n=i?s.y+s.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),a=r,h=n;this.getAttribute("fx").hasValue()&&(a=i?s.x+s.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(h=i?s.y+s.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));let l=i?(s.width+s.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),o=this.getAttribute("fr").getPixels();return t.createRadialGradient(a,h,o,r,n,l)}constructor(t,e,i){super(t,e,i),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}}class tp extends X{constructor(t,e,i){super(t,e,i),this.type="stop";let s=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),r=this.getStyle("stop-opacity"),n=this.getStyle("stop-color",!0);
1""===n.getString()&&n.setValue("#000"),r.hasValue()&&(n=n.addOpacity(r)),this.offset=s,this.color=n.getColor()}}class ty extends X{getProperty(){let t=this.getAttribute("attributeType").getString(),e=this.getAttribute("attributeName").getString();return"CSS"===t?this.parent.getStyle(e,!0):this.parent.getAttribute(e,!0)}calcValue(){let{initialUnits:t}=this,{progress:e,from:i,to:s}=this.getProgress(),r=i.getNumber()+(s.getNumber()-i.getNumber())*e;return"%"===t&&(r*=100),"".concat(r).concat(t)}update(t){let{parent:e}=this,i=this.getProperty();if(this.initialValue||(this.initialValue=i.getString(),this.initialUnits=i.getUnits()),this.duration>this.maxDuration){let t=this.getAttribute("fill").getString("remove");if("indefinite"===this.getAttribute("repeatCount").getString()||"indefinite"===this.getAttribute("repeatDur").getString())this.duration=0;else if("freeze"!==t||this.frozen){if("remove"===t&&!this.removed)return this.removed=!0,e&&i&&i.setValue(e.animationFrozen?e.animationFrozenValue:this.initialValue),!0}else this.frozen=!0,e&&i&&(e.animationFrozen=!0,e.animationFrozenValue=i.getString());return!1}this.duration+=t;let s=!1;if(this.begin<this.duration){let t=this.calcValue(),e=this.getAttribute("type");if(e.hasValue()){let i=e.getString();t="".concat(i,"(").concat(t,")")}i.setValue(t),s=!0}return s}getProgress(){let t,e;let{document:i,values:s}=this,r=(this.duration-this.begin)/(this.maxDuration-this.begin);if(s.hasValue()){let n;let a=r*(s.getValue().length-1),h=Math.floor(a),l=Math.ceil(a);t=new A(i,"from",(n=s.getValue()[h])?parseFloat(n):0),e=new A(i,"to",(n=s.getValue()[l])?parseFloat(n):0),r=(a-h)/(l-h)}else t=this.from,e=this.to;return{progress:r,from:t,to:e}}constructor(t,e,i){super(t,e,i),this.type="animate",this.duration=0,this.initialUnits="",this.removed=!1,this.frozen=!1,t.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new A(t,"values",null);let s=this.getAttribute("values");s.hasValue()&&this.values.setValue(s.getString().split(";"))}}class tf extends ty{calcValue(){let{progress:t,from:e,to:i}=this.getProgress(),s=new r(e.getColor()),n=new r(i.getColor());if(s.ok&&n.ok){let e=s.r+(n.r-s.r)*t,i=s.g+(n.g-s.g)*t,r=s.b+(n.b-s.b)*t;return"rgb(".concat(Math.floor(e),", ").concat(Math.floor(i),", ").concat(Math.floor(r),")")}return this.getAttribute("from").getColor()}constructor(...t){super(...t),this.type="animateColor"}}class tx extends ty{calcValue(){let{progress:t,from:e,to:i}=this.getProgress(),s=o(e.getString()),r=o(i.getString());return s.map((e,i)=>e+(r[i]-e)*t).join(" ")}constructor(...t){super(...t),this.type="animateTransform"}}class tm extends X{constructor(t,e,i){super(t,e,i),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class tb extends K{constructor(t,e,i){super(t,e,i),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class tS extends tb{constructor(...t){super(...t),this.type="missing-glyph",this.horizAdvX=0}}class tw extends X{render(){}constructor(t,e,i){super(t,e,i),this.type="font",this.isArabic=!1,this.glyphs=new Map,this.arabicGlyphs=new Map,this.isRTL=!1,this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();let{definitions:s}=t,{children:r}=this;for(let t of r)if(t instanceof tm){this.fontFace=t;let e=t.getStyle("font-family");e.hasValue()&&s.set(e.getString(),this)}else if(t instanceof tS)this.missingGlyph=t;else if(t instanceof tb){if(t.arabicForm){this.isRTL=!0,this.isArabic=!0;let e=this.arabicGlyphs.get(t.unicode);void 0===e&&(e=new Map,this.arabicGlyphs.set(t.unicode,e)),e.set(t.arabicForm,t)}else this.glyphs.set(t.unicode,t)}}}class tv extends Q{getText(){let t=this.getHrefAttribute().getDefinition();if(t){let e=t.children[0];if(e)return e.getText()}return""}constructor(...t){super(...t),this.type="tref"}}class tP extends Q{getText(){return this.text}renderChildren(t){if(this.hasText){super.renderChildren(t);let{document:e,x:i,y:s}=this,{mouse:r}=e.screen,n=new A(e,"fontSize",Y.parse(e.ctx.font).fontSize);r.isWorking()&&r.checkBoundingBox(this,new G(i,s-n.getPixels("y"),i+this.measureText(t),s))}else if(this.children.length>0){let e=new tu(this.document);e.children=this.children,e.parent=this,e.render(t)}}onClick(){let{window:t}=this.document;t&&t.open(this.getHrefAttribute().getString())}onMouseMove(){this.document.ctx.canvas.style.cursor="pointer"}constructor(t,e,i){super(t,e,i),this.type="a";let{childNodes:s}=e,r=s[0],n=s.length>0&&Array.from(s).every(t=>3===t.nodeType);this.hasText=n,this.text=n?this.getTextFromNode(r):""}}class tA extends Q{getText(){return this.text}path(t){let{dataArray:e}=this;
1t&&t.beginPath(),e.forEach(e=>{let{type:i,points:s}=e;switch(i){case J.LINE_TO:t&&t.lineTo(s[0],s[1]);break;case J.MOVE_TO:t&&t.moveTo(s[0],s[1]);break;case J.CURVE_TO:t&&t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case J.QUAD_TO:t&&t.quadraticCurveTo(s[0],s[1],s[2],s[3]);break;case J.ARC:{let[e,i,r,n,a,h,l,o]=s,u=r>n?1:r/n,g=r>n?n/r:1;t&&(t.translate(e,i),t.rotate(l),t.scale(u,g),t.arc(0,0,r>n?r:n,a,a+h,!!(1-o)),t.scale(1/u,1/g),t.rotate(-l),t.translate(-e,-i));break}case J.CLOSE_PATH:t&&t.closePath()}})}renderChildren(t){this.setTextData(t),t.save();let e=this.parent.getStyle("text-decoration").getString(),i=this.getFontSize(),{glyphInfo:s}=this,r=t.fillStyle;"underline"===e&&t.beginPath(),s.forEach((s,r)=>{let{p0:n,p1:a,rotation:h,text:l}=s;t.save(),t.translate(n.x,n.y),t.rotate(h),t.fillStyle&&t.fillText(l,0,0),t.strokeStyle&&t.strokeText(l,0,0),t.restore(),"underline"===e&&(0===r&&t.moveTo(n.x,n.y+i/8),t.lineTo(a.x,a.y+i/5))}),"underline"===e&&(t.lineWidth=i/20,t.strokeStyle=r,t.stroke(),t.closePath()),t.restore()}getLetterSpacingAt(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.letterSpacingCache[t]||0}findSegmentToFitChar(t,e,i,s,r,n,a,h,l){let o=n,u=this.measureText(t,h);" "===h&&"justify"===e&&i<s&&(u+=(s-i)/r),l>-1&&(o+=this.getLetterSpacingAt(l));let g=this.textHeight/20,c=this.getEquidistantPointOnPath(o,g,0),d=this.getEquidistantPointOnPath(o+u,g,0),p={p0:c,p1:d},y=c&&d?Math.atan2(d.y-c.y,d.x-c.x):0;if(a){let t=Math.cos(Math.PI/2+y)*a,e=Math.cos(-y)*a;p.p0={...c,x:c.x+t,y:c.y+e},p.p1={...d,x:d.x+t,y:d.y+e}}return{offset:o+=u,segment:p,rotation:y}}measureText(t,e){let{measuresCache:i}=this,s=e||this.getText();if(i.has(s))return i.get(s);let r=this.measureTargetText(t,s);return i.set(s,r),r}setTextData(t){if(this.glyphInfo)return;let e=this.getText(),i=e.split(""),s=e.split(" ").length-1,r=this.parent.getAttribute("dx").split().map(t=>t.getPixels("x")),n=this.parent.getAttribute("dy").getPixels("y"),a=this.parent.getStyle("text-anchor").getString("start"),h=this.getStyle("letter-spacing"),l=this.parent.getStyle("letter-spacing"),o=0;h.hasValue()&&"inherit"!==h.getValue()?h.hasValue()&&"initial"!==h.getValue()&&"unset"!==h.getValue()&&(o=h.getPixels()):o=l.getPixels();let u=[],g=e.length;this.letterSpacingCache=u;for(let t=0;t<g;t++)u.push(void 0!==r[t]?r[t]:o);let c=u.reduce((t,e,i)=>0===i?0:t+e||0,0),d=this.measureText(t),p=Math.max(d+c,0);this.textWidth=d,this.textHeight=this.getFontSize(),this.glyphInfo=[];let y=this.getPathLength(),f=this.getStyle("startOffset").getNumber(0)*y,x=0;("middle"===a||"center"===a)&&(x=-p/2),("end"===a||"right"===a)&&(x=-p),x+=f,i.forEach((e,r)=>{let{offset:h,segment:l,rotation:o}=this.findSegmentToFitChar(t,a,p,y,s,x,n,e,r);x=h,l.p0&&l.p1&&this.glyphInfo.push({text:i[r],p0:l.p0,p1:l.p1,rotation:o})})}parsePathData(t){if(this.pathLength=-1,!t)return[];let e=[],{pathParser:i}=t;for(i.reset();!i.isEnd();){let{current:t}=i,s=t?t.x:0,r=t?t.y:0,n=i.next(),a=n.type,h=[];switch(n.type){case J.MOVE_TO:this.pathM(i,h);break;case J.LINE_TO:a=this.pathL(i,h);break;case J.HORIZ_LINE_TO:a=this.pathH(i,h);break;case J.VERT_LINE_TO:a=this.pathV(i,h);break;case J.CURVE_TO:this.pathC(i,h);break;case J.SMOOTH_CURVE_TO:a=this.pathS(i,h);break;case J.QUAD_TO:this.pathQ(i,h);break;case J.SMOOTH_QUAD_TO:a=this.pathT(i,h);break;case J.ARC:h=this.pathA(i);break;case J.CLOSE_PATH:K.pathZ(i)}n.type!==J.CLOSE_PATH?e.push({type:a,points:h,start:{x:s,y:r},pathLength:this.calcLength(s,r,a,h)}):e.push({type:J.CLOSE_PATH,points:[],pathLength:0})}return e}pathM(t,e){let{x:i,y:s}=K.pathM(t).point;e.push(i,s)}pathL(t,e){let{x:i,y:s}=K.pathL(t).point;return e.push(i,s),J.LINE_TO}pathH(t,e){let{x:i,y:s}=K.pathH(t).point;return e.push(i,s),J.LINE_TO}pathV(t,e){let{x:i,y:s}=K.pathV(t).point;return e.push(i,s),J.LINE_TO}pathC(t,e){let{point:i,controlPoint:s,currentPoint:r}=K.pathC(t);e.push(i.x,i.y,s.x,s.y,r.x,r.y)}pathS(t,e){let{point:i,controlPoint:s,currentPoint:r}=K.pathS(t);return e.push(i.x,i.y,s.x,s.y,r.x,r.y),J.CURVE_TO}pathQ(t,e){let{controlPoint:i,currentPoint:s}=K.pathQ(t);e.push(i.x,i.y,s.x,s.y)}pathT(t,e){let{controlPoint:i,currentPoint:s}=K.pathT(t);return e.push(i.x,i.y,s.x,s.y),J.QUAD_TO}pathA(t){let{rX:e,rY:i,sweepFlag:s,xAxisRotation:r,centp:n,a1:a,ad:h}=K.pathA(t);return 0===s&&h>0&&(h-=2*Math.PI),1===s&&h<0&&(h+=2*Math.PI),[n.x,n.y,e,i,a,h,r,s]}calcLength(t,e,i,s){let r=0,n=null,a=null,h=0;switch(i){case J.LINE_TO:return this.getLineLength(t,e,s[0],s[1]);case J.CURVE_TO:for(h=.01,r=0,n=this.getPointOnCubicBezier(0,t,e,s[0],s[1],s[2],s[3],s[4],s[5]);h<=1;h+=.01)a=this.getPointOnCubicBezier(h,t,e,s[0],s[1],s[2],s[3],s[4],s[5]),r+=this.getLineLength(n.x,n.y,a.x,a.y),n=a;return r;case J.QUAD_TO:for(h=.01,r=0,n=this.getPointOnQuadraticBezier(0,t,e,s[0],s[1],s[2],s[3]);h<=1;h+=.01)a=this.getPointOnQuadraticBezier(h,t,e,s[0],s[1],s[2],s[3]),r+=this.getLineLength(n.x,n.y,a.x,a.y),n=a;return r;case J.ARC:{r=0;let t=s[4],e=s[5],i=s[4]+e,l=Math.PI/180;
1if(Math.abs(t-i)<l&&(l=Math.abs(t-i)),n=this.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],t,0),e<0)for(h=t-l;h>i;h-=l)a=this.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],h,0),r+=this.getLineLength(n.x,n.y,a.x,a.y),n=a;else for(h=t+l;h<i;h+=l)a=this.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],h,0),r+=this.getLineLength(n.x,n.y,a.x,a.y),n=a;return a=this.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],i,0),r+=this.getLineLength(n.x,n.y,a.x,a.y)}}return 0}getPointOnLine(t,e,i,s,r){let n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:i,h=(r-i)/(s-e+1e-8),l=Math.sqrt(t*t/(1+h*h));s<e&&(l*=-1);let o=h*l,u=null;if(s===e)u={x:n,y:a+o};else if((a-i)/(n-e+1e-8)===h)u={x:n+l,y:a+o};else{let g=0,c=0,d=this.getLineLength(e,i,s,r);if(d<1e-8)return null;let p=(n-e)*(s-e)+(a-i)*(r-i);p/=d*d,g=e+p*(s-e),c=i+p*(r-i);let y=this.getLineLength(n,a,g,c),f=Math.sqrt(t*t-y*y);l=Math.sqrt(f*f/(1+h*h)),s<e&&(l*=-1),o=h*l,u={x:g+l,y:c+o}}return u}getPointOnPath(t){let e=this.getPathLength(),i=0,s=null;if(t<-.00005||t-5e-5>e)return null;let{dataArray:r}=this;for(let e of r){if(e&&(e.pathLength<5e-5||i+e.pathLength+5e-5<t)){i+=e.pathLength;continue}let r=t-i,n=0;switch(e.type){case J.LINE_TO:s=this.getPointOnLine(r,e.start.x,e.start.y,e.points[0],e.points[1],e.start.x,e.start.y);break;case J.ARC:{let t=e.points[4],i=e.points[5],a=e.points[4]+i;if(n=t+r/e.pathLength*i,i<0&&n<a||i>=0&&n>a)break;s=this.getPointOnEllipticalArc(e.points[0],e.points[1],e.points[2],e.points[3],n,e.points[6]);break}case J.CURVE_TO:(n=r/e.pathLength)>1&&(n=1),s=this.getPointOnCubicBezier(n,e.start.x,e.start.y,e.points[0],e.points[1],e.points[2],e.points[3],e.points[4],e.points[5]);break;case J.QUAD_TO:(n=r/e.pathLength)>1&&(n=1),s=this.getPointOnQuadraticBezier(n,e.start.x,e.start.y,e.points[0],e.points[1],e.points[2],e.points[3])}if(s)return s;break}return null}getLineLength(t,e,i,s){return Math.sqrt((i-t)*(i-t)+(s-e)*(s-e))}getPathLength(){return -1===this.pathLength&&(this.pathLength=this.dataArray.reduce((t,e)=>e.pathLength>0?t+e.pathLength:t,0)),this.pathLength}getPointOnCubicBezier(t,e,i,s,r,n,a,h,l){return{x:t*t*t*h+3*t*t*(1-t)*n+s*P(t)+(1-t)*(1-t)*(1-t)*e,y:t*t*t*l+3*t*t*(1-t)*a+r*P(t)+(1-t)*(1-t)*(1-t)*i}}getPointOnQuadraticBezier(t,e,i,s,r,n,a){return{x:t*t*n+2*t*(1-t)*s+(1-t)*(1-t)*e,y:t*t*a+2*t*(1-t)*r+(1-t)*(1-t)*i}}getPointOnEllipticalArc(t,e,i,s,r,n){let a=Math.cos(n),h=Math.sin(n),l={x:i*Math.cos(r),y:s*Math.sin(r)};return{x:t+(l.x*a-l.y*h),y:e+(l.x*h+l.y*a)}}buildEquidistantCache(t,e){let i=this.getPathLength(),s=e||.25,r=t||i/100;if(!this.equidistantCache||this.equidistantCache.step!==r||this.equidistantCache.precision!==s){this.equidistantCache={step:r,precision:s,points:[]};let t=0;for(let e=0;e<=i;e+=s){let i=this.getPointOnPath(e),n=this.getPointOnPath(e+s);i&&n&&(t+=this.getLineLength(i.x,i.y,n.x,n.y))>=r&&(this.equidistantCache.points.push({x:i.x,y:i.y,distance:e}),t-=r)}}}getEquidistantPointOnPath(t,e,i){if(this.buildEquidistantCache(e,i),t<0||t-this.getPathLength()>5e-5)return null;let s=Math.round(t/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[s]||null}constructor(t,e,i){super(t,e,i),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);let s=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(s)}}let tC=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class tT extends ${async loadImage(t){try{let e=await this.document.createImage(t);this.image=e}catch(e){console.error('Error while loading image "'.concat(t,'":'),e)}this.loaded=!0}async loadSvg(t){let e=tC.exec(t);if(e){let t=e[5];t&&("base64"===e[4]?this.image=atob(t):this.image=decodeURIComponent(t))}else try{let e=await this.document.fetch(t),i=await e.text();this.image=i}catch(e){console.error('Error while loading image "'.concat(t,'":'),e)}this.loaded=!0}renderChildren(t){let{document:e,image:i,loaded:s}=this,r=this.getAttribute("x").getPixels("x"),n=this.getAttribute("y").getPixels("y"),a=this.getStyle("width").getPixels("x"),h=this.getStyle("height").getPixels("y");if(s&&i&&a&&h){if(t.save(),t.translate(r,n),"string"==typeof i){let s=e.canvg.forkString(t,i,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:a,scaleHeight:h}),{documentElement:r}=s.document;r&&(r.parent=this),s.render()}else e.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:a,desiredWidth:i.width,height:h,desiredHeight:i.height}),!this.loaded||"complete"in i&&!i.complete||t.drawImage(i,0,0);
1t.restore()}}getBoundingBox(){let t=this.getAttribute("x").getPixels("x"),e=this.getAttribute("y").getPixels("y");return new G(t,e,t+this.getStyle("width").getPixels("x"),e+this.getStyle("height").getPixels("y"))}constructor(t,e,i){super(t,e,i),this.type="image",this.loaded=!1;let s=this.getHrefAttribute().getString();if(!s)return;let r=s.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(s);t.images.push(this),r?this.loadSvg(s):this.loadImage(s)}}class tV extends ${render(t){}constructor(...t){super(...t),this.type="symbol"}}class tM{async load(t,e){try{let{document:i}=this,s=(await i.canvg.parser.load(e)).getElementsByTagName("font");Array.from(s).forEach(e=>{let s=i.createElement(e);i.definitions.set(t,s)})}catch(t){console.error('Error while loading font "'.concat(e,'":'),t)}this.loaded=!0}constructor(t){this.document=t,this.loaded=!1,t.fonts.push(this)}}class tk extends X{constructor(t,e,i){super(t,e,i),this.type="style",l(Array.from(e.childNodes).map(t=>t.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")).split("}").forEach(e=>{let i=e.trim();if(!i)return;let s=i.split("{"),r=s[0].split(","),n=s[1].split(";");r.forEach(e=>{let i=e.trim();if(!i)return;let s=t.styles.get(i)||new Map;if(n.forEach(e=>{let i=e.indexOf(":"),r=e.substr(0,i).trim(),n=e.substr(i+1,e.length-i).trim();r&&n&&s.set(r,new A(t,r,n))}),t.styles.set(i,s),t.stylesSpecificity.set(i,function(t){let e=[0,0,0],i=t.replace(/:not\(([^)]*)\)/g,"     $1 ").replace(/{[\s\S]*/gm," "),s=0;return[i,s]=b(i,c),e[1]+=s,[i,s]=b(i,d),e[0]+=s,[i,s]=b(i,p),e[1]+=s,[i,s]=b(i,y),e[2]+=s,[i,s]=b(i,f),e[1]+=s,[i,s]=b(i,x),e[1]+=s,i=i.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[i,s]=b(i,m),e[2]+=s,e.join("")}(i)),"@font-face"===i){let e=s.get("font-family").getString().replace(/"|'/g,"");s.get("src").getString().split(",").forEach(i=>{if(i.indexOf('format("svg")')>0){let s=g(i);s&&new tM(t).load(e,s)}})}})})}}tk.parseExternalUrl=g;class tE extends ${setContext(t){super.setContext(t);let e=this.getAttribute("x"),i=this.getAttribute("y");e.hasValue()&&t.translate(e.getPixels("x"),0),i.hasValue()&&t.translate(0,i.getPixels("y"))}path(t){let{element:e}=this;e&&e.path(t)}renderChildren(t){let{document:e,element:i}=this;if(i){let s=i;if("symbol"===i.type&&((s=new tt(e)).attributes.set("viewBox",new A(e,"viewBox",i.getAttribute("viewBox").getString())),s.attributes.set("preserveAspectRatio",new A(e,"preserveAspectRatio",i.getAttribute("preserveAspectRatio").getString())),s.attributes.set("overflow",new A(e,"overflow",i.getAttribute("overflow").getString())),s.children=i.children,i.styles.set("opacity",new A(e,"opacity",this.calculateOpacity()))),"svg"===s.type){let t=this.getStyle("width",!1,!0),i=this.getStyle("height",!1,!0);t.hasValue()&&s.attributes.set("width",new A(e,"width",t.getString())),i.hasValue()&&s.attributes.set("height",new A(e,"height",i.getString()))}let r=s.parent;s.parent=this,s.render(t),s.parent=r}}getBoundingBox(t){let{element:e}=this;return e?e.getBoundingBox(t):null}elementTransform(){let{document:t,element:e}=this;return e?W.fromElement(t,e):null}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}constructor(...t){super(...t),this.type="use"}}function tN(t,e,i,s){return e+Math.cos(t)*i+Math.sin(t)*s}class tO extends X{apply(t,e,i,s,r){let{includeOpacity:n,matrix:a}=this,h=t.getImageData(0,0,s,r);for(let t=0;t<r;t++)for(let e=0;e<s;e++){var l,o,u,g,c,d,p,y,f,x,m,b,S,w,v,P,A,C,T,V;let i=h.data[t*s*4+4*e+0],r=h.data[t*s*4+4*e+1],M=h.data[t*s*4+4*e+2],k=h.data[t*s*4+4*e+3],E=a[0]*i+a[1]*r+a[2]*M+a[3]*k+1*a[4],N=a[5]*i+a[6]*r+a[7]*M+a[8]*k+1*a[9],O=a[10]*i+a[11]*r+a[12]*M+a[13]*k+1*a[14],z=a[15]*i+a[16]*r+a[17]*M+a[18]*k+1*a[19];n&&(E=0,N=0,O=0,z*=k/255),c=h.data,d=e,p=t,y=E,c[p*s*4+4*d+0]=y,f=h.data,x=e,m=t,b=N,f[m*s*4+4*x+1]=b,S=h.data,w=e,v=t,P=O,S[v*s*4+4*w+2]=P,A=h.data,C=e,T=t,V=z,A[T*s*4+4*C+3]=V}t.clearRect(0,0,s,r),t.putImageData(h,0,0)}constructor(t,e,i){super(t,e,i),this.type="feColorMatrix";let s=o(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{let t=s[0];s=[.213+.787*t,.715-.715*t,.072-.072*t,0,0,.213-.213*t,.715+.285*t,.072-.072*t,0,0,.213-.213*t,.715-.715*t,.072+.928*t,0,0,0,0,0,1,0,0,0,0,0,1];break}
1case"hueRotate":{let t=s[0]*Math.PI/180;s=[tN(t,.213,.787,-.213),tN(t,.715,-.715,-.715),tN(t,.072,-.072,.928),0,0,tN(t,.213,-.213,.143),tN(t,.715,.285,.14),tN(t,.072,-.072,-.283),0,0,tN(t,.213,-.213,-.787),tN(t,.715,-.715,.715),tN(t,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1]}this.matrix=s,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}}class tz extends X{apply(t,e){let{document:i}=this,s=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),n=this.getStyle("width").getPixels("x"),a=this.getStyle("height").getPixels("y");if(!n&&!a){let e=new G;this.children.forEach(i=>{e.addBoundingBox(i.getBoundingBox(t))}),s=Math.floor(e.x1),r=Math.floor(e.y1),n=Math.floor(e.width),a=Math.floor(e.height)}let h=this.removeStyles(e,tz.ignoreStyles),l=i.createCanvas(s+n,r+a),o=l.getContext("2d");i.screen.setDefaults(o),this.renderChildren(o),new tO(i,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(o,0,0,s+n,r+a);let u=i.createCanvas(s+n,r+a),g=u.getContext("2d");i.screen.setDefaults(g),e.render(g),g.globalCompositeOperation="destination-in",g.fillStyle=o.createPattern(l,"no-repeat"),g.fillRect(0,0,s+n,r+a),t.fillStyle=g.createPattern(u,"no-repeat"),t.fillRect(0,0,s+n,r+a),this.restoreStyles(e,h)}render(t){}constructor(...t){super(...t),this.type="mask"}}tz.ignoreStyles=["mask","transform","clip-path"];let tI=()=>{};class tB extends X{apply(t){let{document:e}=this,i=Reflect.getPrototypeOf(t),{beginPath:s,closePath:r}=t;i&&(i.beginPath=tI,i.closePath=tI),Reflect.apply(s,t,[]),this.children.forEach(s=>{if(!("path"in s))return;let n="elementTransform"in s?s.elementTransform():null;n||(n=W.fromElement(e,s)),n&&n.apply(t),s.path(t),i&&(i.closePath=r),n&&n.unapply(t)}),Reflect.apply(r,t,[]),t.clip(),i&&(i.beginPath=s,i.closePath=r)}render(t){}constructor(...t){super(...t),this.type="clipPath"}}class tL extends X{apply(t,e){let{document:i,children:s}=this,r="getBoundingBox"in e?e.getBoundingBox(t):null;if(!r)return;let n=0,a=0;s.forEach(t=>{let e=t.extraFilterDistance||0;n=Math.max(n,e),a=Math.max(a,e)});let h=Math.floor(r.width),l=Math.floor(r.height),o=h+2*n,u=l+2*a;if(o<1||u<1)return;let g=Math.floor(r.x),c=Math.floor(r.y),d=this.removeStyles(e,tL.ignoreStyles),p=i.createCanvas(o,u),y=p.getContext("2d");i.screen.setDefaults(y),y.translate(-g+n,-c+a),e.render(y),s.forEach(t=>{"function"==typeof t.apply&&t.apply(y,0,0,o,u)}),t.drawImage(p,0,0,o,u,g-n,c-a,o,u),this.restoreStyles(e,d)}render(t){}constructor(...t){super(...t),this.type="filter"}}tL.ignoreStyles=["filter","transform","clip-path"];class tD extends X{apply(t,e,i,s,r){}constructor(t,e,i){super(t,e,i),this.type="feDropShadow",this.addStylesFromStyleDefinition()}}class tR extends X{apply(t,e,i,s,r){}constructor(...t){super(...t),this.type="feMorphology"}}class t_ extends X{apply(t,e,i,s,r){}constructor(...t){super(...t),this.type="feComposite"}}class tF extends X{apply(t,e,i,s,r){let{document:n,blurRadius:h}=this,l=n.window?n.window.document.body:null,o=t.canvas;o.id=n.getUniqueId(),l&&(o.style.display="none",l.appendChild(o)),(0,a.vR)(o,e,i,s,r,h),l&&l.removeChild(o)}constructor(t,e,i){super(t,e,i),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}}class tU extends X{constructor(...t){super(...t),this.type="title"}}class tW extends X{constructor(...t){super(...t),this.type="desc"}}async function tX(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=document.createElement("img");return e&&(i.crossOrigin="Anonymous"),new Promise((e,s)=>{i.onload=()=>{e(i)},i.onerror=(t,e,i,r,n)=>{s(n)},i.src=t})}class tH{bindCreateImage(t,e){return"boolean"==typeof e?(i,s)=>t(i,"boolean"==typeof s?s:e):t}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){let{emSizeStack:t}=this;return t[t.length-1]||12}set emSize(t){let{emSizeStack:e}=this;e.push(t)}popEmSize(){let{emSizeStack:t}=this;t.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(t=>t.loaded)}isFontsLoaded(){return this.fonts.every(t=>t.loaded)}createDocumentElement(t){let e=this.createElement(t.documentElement);return e.root=!0,e.addStylesFromStyleDefinition(),this.documentElement=e,e}createElement(t){let e=t.nodeName.replace(/^[^:]+:/,""),i=tH.elementTypes[e];return i?new i(this,t):new H(this,t)}createTextNode(t){return new Z(this,t)}
1setViewBox(t){this.screen.setViewBox({document:this,...t})}constructor(t,{rootEmSize:e=12,emSize:i=12,createCanvas:s=tH.createCanvas,createImage:r=tH.createImage,anonymousCrossOrigin:n}={}){this.canvg=t,this.definitions=new Map,this.styles=new Map,this.stylesSpecificity=new Map,this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=t.screen,this.rootEmSize=e,this.emSize=i,this.createCanvas=s,this.createImage=this.bindCreateImage(r,n),this.screen.wait(()=>this.isImagesLoaded()),this.screen.wait(()=>this.isFontsLoaded())}}tH.createCanvas=function(t,e){let i=document.createElement("canvas");return i.width=t,i.height=e,i},tH.createImage=tX,tH.elementTypes={svg:tt,rect:te,circle:ti,ellipse:ts,line:tr,polyline:tn,polygon:ta,path:K,pattern:th,marker:tl,defs:to,linearGradient:tc,radialGradient:td,stop:tp,animate:ty,animateColor:tf,animateTransform:tx,font:tw,"font-face":tm,"missing-glyph":tS,glyph:tb,text:Q,tspan:j,tref:tv,a:tP,textPath:tA,image:tT,g:tu,symbol:tV,style:tk,use:tE,mask:tz,clipPath:tB,filter:tL,feDropShadow:tD,feMorphology:tR,feComposite:t_,feColorMatrix:tO,feGaussianBlur:tF,title:tU,desc:tW};class tq{static async from(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=new I(i);return new tq(t,await s.parse(e),i)}static fromString(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new tq(t,new I(i).parseFromString(e),i)}fork(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return tq.from(t,e,{...this.options,...i})}forkString(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return tq.fromString(t,e,{...this.options,...i})}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}async render(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.start({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0,...t}),await this.ready(),this.stop()}start(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{documentElement:e,screen:i,options:s}=this;i.start(e,{enableRedraw:!0,...s,...t})}stop(){this.screen.stop()}resize(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.documentElement.resize(t,e,i)}constructor(t,e,i={}){this.parser=new I(i),this.screen=new N(t,i),this.options=i;let s=new tH(this,i),r=s.createDocumentElement(e);this.document=s,this.documentElement=r}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.