16 lines
19 KiB
JavaScript
16 lines
19 KiB
JavaScript
|
import{n as Tr}from"./@babel.80d29b7b.js";var z={exports:{}},hr;function vr(){return hr||(hr=1,function(Or,cr){(function(v,W){W(cr)})(Tr,function(v){/*! *****************************************************************************
|
||
|
Copyright (c) Microsoft Corporation.
|
||
|
|
||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||
|
purpose with or without fee is hereby granted.
|
||
|
|
||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||
|
PERFORMANCE OF THIS SOFTWARE.
|
||
|
***************************************************************************** */var W=function(e,t){return(W=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,n){c.__proto__=n}||function(c,n){for(var y in n)Object.prototype.hasOwnProperty.call(n,y)&&(c[y]=n[y])})(e,t)};function k(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function c(){this.constructor=e}W(e,t),e.prototype=t===null?Object.create(t):(c.prototype=t.prototype,new c)}var d=" ";function J(e){var t="";Array.isArray(e)||(e=[e]);for(var c=0;c<e.length;c++){var n=e[c];if(n.type===h.CLOSE_PATH)t+="z";else if(n.type===h.HORIZ_LINE_TO)t+=(n.relative?"h":"H")+n.x;else if(n.type===h.VERT_LINE_TO)t+=(n.relative?"v":"V")+n.y;else if(n.type===h.MOVE_TO)t+=(n.relative?"m":"M")+n.x+d+n.y;else if(n.type===h.LINE_TO)t+=(n.relative?"l":"L")+n.x+d+n.y;else if(n.type===h.CURVE_TO)t+=(n.relative?"c":"C")+n.x1+d+n.y1+d+n.x2+d+n.y2+d+n.x+d+n.y;else if(n.type===h.SMOOTH_CURVE_TO)t+=(n.relative?"s":"S")+n.x2+d+n.y2+d+n.x+d+n.y;else if(n.type===h.QUAD_TO)t+=(n.relative?"q":"Q")+n.x1+d+n.y1+d+n.x+d+n.y;else if(n.type===h.SMOOTH_QUAD_TO)t+=(n.relative?"t":"T")+n.x+d+n.y;else{if(n.type!==h.ARC)throw new Error('Unexpected command type "'+n.type+'" at index '+c+".");t+=(n.relative?"a":"A")+n.rX+d+n.rY+d+n.xRot+d+ +n.lArcFlag+d+ +n.sweepFlag+d+n.x+d+n.y}}return t}function B(e,t){var c=e[0],n=e[1];return[c*Math.cos(t)-n*Math.sin(t),c*Math.sin(t)+n*Math.cos(t)]}function g(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var c=0;c<e.length;c++)if(typeof e[c]!="number")throw new Error("assertNumbers arguments["+c+"] is not a number. "+typeof e[c]+" == typeof "+e[c]);return!0}var G=Math.PI;function K(e,t,c){e.lArcFlag=e.lArcFlag===0?0:1,e.sweepFlag=e.sweepFlag===0?0:1;var n=e.rX,y=e.rY,T=e.x,_=e.y;n=Math.abs(e.rX),y=Math.abs(e.rY);var r=B([(t-T)/2,(c-_)/2],-e.xRot/180*G),s=r[0],a=r[1],o=Math.pow(s,2)/Math.pow(n,2)+Math.pow(a,2)/Math.pow(y,2);1<o&&(n*=Math.sqrt(o),y*=Math.sqrt(o)),e.rX=n,e.rY=y;var m=Math.pow(n,2)*Math.pow(a,2)+Math.pow(y,2)*Math.pow(s,2),u=(e.lArcFlag!==e.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(y,2)-m)/m)),i=n*a/y*u,O=-y*s/n*u,p=B([i,O],e.xRot/180*G);e.cX=p[0]+(t+T)/2,e.cY=p[1]+(c+_)/2,e.phi1=Math.atan2((a-O)/y,(s-i)/n),e.phi2=Math.atan2((-a-O)/y,(-s-i)/n),e.sweepFlag===0&&e.phi2>e.phi1&&(e.phi2-=2*G),e.sweepFlag===1&&e.phi2<e.phi1&&(e.phi2+=2*G),e.phi1*=180/G,e.phi2*=180/G}function $(e,t,c){g(e,t,c);var n=e*e+t*t-c*c;if(0>n)return[];if(n===0)return[[e*c/(e*e+t*t),t*c/(e*e+t*t)]];var y=Math.sqrt(n);return[[(e*c+t*y)/(e*e+t*t),(t*c-e*y)/(e*e+t*t)],[(e*c-t*y)/(e*e+t*t),(t*c+e*y)/(e*e+t*t)]]}var H=Math.PI/180;function rr(e,t,c){return(1-c)*e+c*t}function er(e,t,c,n){return e+Math.cos(n/180*G)*t+Math.sin(n/180*G)*c}function tr(e,t,c,n){var y=1e-6,T=t-e,_=c-t,r=3*T+3*(n-c)-6*_,s=6*(_-T),a=3*T;return Math.abs(r)<y?[-a/s]:function(o,m,u){u===void 0&&(u=1e-6);var i=o*o/4-m;if(i<-u)return[];if(i<=u)return[-o/2];var O=Math.sqrt(i);return[-o/2-O,-o/2+O]}(s/r,a/r,y)}function ar(e,t,c,n,y){var T=1-y;return e*(T*T*T)+t*(3*T*T*y)+c*(3*T*y*y)+n*(y*y*y)}v.SVGPathDataTransformer=void 0,function(e){function t(){return y(function(r,s,a){return r.relative&&(r.x1!==void 0&&(r.x1+=s),r.y1!==void 0&&(r.y1+=a),r.x2!==void 0&&(r.x2+=s),r.y2!==void 0&&(r.y2+=a),r.x!==void 0&&(r.x+=s),r.y!==void 0&&(r.y+=a),r.relative=!1),r})}function c(){var r=NaN,s=NaN,a=NaN,o=NaN;return y(function(m,u,i){return m.type&h.SMOOTH_CURVE_TO&&(m.type=h.CURVE_TO,r=isNaN(r)?u:r,s=isNaN(s)?i:s,m.x1=m.relative?u-r:2*u-r,m.y1=m.relative?i-s:2*i-s),m.type&h.CURVE_TO?(r=m.relative?u+m.x2:m.x2,s=m.relative?i+m.y2:m.y2):(r=NaN,s=NaN),m.type&h.SMOOTH_QUAD_TO&&(m.type=h.QUAD_TO,a=isNaN(a)?u:a,o=isNaN(o)?i:o,m.x1=m.relative?u-a:2*u-a,m.y1=m.relative?i-o:2*i-o),m.type&h.QUAD_TO?(a=m.relative?u+m.x1:m.x1,o=m.relative?i+m.y1:m.y1):(a=NaN,o=NaN),m})}function n(){var r=NaN,s=NaN;return y(function(a,o,m){if(a.type&h.SMOOTH_QUAD_TO&&(a.type=h.QUAD_TO,r=isNaN(r)?o:r,s=isNaN(s)?m:s,a.x1=a.relative?o-r:2*o-r,
|
||
|
`},or=function(e){return"0".charCodeAt(0)<=e.charCodeAt(0)&&e.charCodeAt(0)<="9".charCodeAt(0)},sr=function(e){function t(){var c=e.call(this)||this;return c.curNumber="",c.curCommandType=-1,c.curCommandRelative=!1,c.canParseCommandOrComma=!0,c.curNumberHasExp=!1,c.curNumberHasExpDigits=!1,c.curNumberHasDecimal=!1,c.curArgs=[],c}return k(t,e),t.prototype.finish=function(c){if(c===void 0&&(c=[]),this.parse(" ",c),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return c},t.prototype.parse=function(c,n){var y=this;n===void 0&&(n=[]);for(var T=function(m){n.push(m),y.curArgs.length=0,y.canParseCommandOrComma=!0},_=0;_<c.length;_++){var r=c[_],s=!(this.curCommandType!==h.ARC||this.curArgs.length!==3&&this.curArgs.length!==4||this.curNumber.length!==1||this.curNumber!=="0"&&this.curNumber!=="1"),a=or(r)&&(this.curNumber==="0"&&r==="0"||s);if(!or(r)||a)if(r!=="e"&&r!=="E")if(r!=="-"&&r!=="+"||!this.curNumberHasExp||this.curNumberHasExpDigits)if(r!=="."||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&this.curCommandType!==-1){var o=Number(this.curNumber);if(isNaN(o))throw new SyntaxError("Invalid number ending at "+_);if(this.curCommandType===h.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>o)throw new SyntaxError('Expected positive number, got "'+o+'" at index "'+_+'"')}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+_+'"')}this.curArgs.push(o),this.curArgs.length===ur[this.curCommandType]&&(h.HORIZ_LINE_TO===this.curCommandType?T({type:h.HORIZ_LINE_TO,relative:this.curCommandRelative,x:o}):h.VERT_LINE_TO===this.curCommandType?T({type:h.VERT_LINE_TO,relative:this.curCommandRelative,y:o}):this.curCommandType===h.MOVE_TO||this.curCommandType===h.LINE_TO||this.curCommandType===h.SMOOTH_QUAD_TO?(T({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),h.MOVE_TO===this.curCommandType&&(this.curCommandType=h.LINE_TO)):this.curCommandType===h.CURVE_TO?T({type:h.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===h.SMOOTH_CURVE_TO?T({type:h.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===h.QUAD_TO?T({type:h.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===h.ARC&&T({type:h.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!mr(r))if(r===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(r!=="+"&&r!=="-"&&r!==".")if(a)this.curNumber=r,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+_+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+r+'" at index '+_+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,r!=="z"&&r!=="Z")if(r==="h"||r==="H")this.curCommandType=h.HORIZ_LINE_TO,this.curCommandRelative=r==="h";else if(r==="v"||r==="V")this.curCommandType=h.VERT_LINE_TO,this.curCommandRelative=r==="v";else if(r==="m"||r==="M")this.curCommandType=h.MOVE_TO,this.curCommandRelative=r==="m";else if(r==="l"||r==="L")this.curCommandType=h.LINE_TO,this.curCommandRelative=r==="l";else if(r==="c"||r==="C")this.curCommandType=h.CURVE_TO,this.curCommandRelative=r==="c";else if(r==="s"||r==="S")this.curCommandType=h.SMOOTH_CURVE_TO,this.curCommandRelative=r==="s";else if(r==="q"||r==="Q")this.curCommandType=h.QUAD_TO,this.curCommandRelative=r==="q";else if(r==="t"||r==="T
|