Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svg-path-properties

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svg-path-properties - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

dist/svg-path-properties.cjs.js

@@ -1,2 +0,2 @@

// http://geoexamples.com/path-properties/ v1.0.0 Copyright 2019 Roger Veciana i Rovira
// http://geoexamples.com/path-properties/ v1.0.1 Copyright 2019 Roger Veciana i Rovira
"use strict";function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_nonIterableSpread()}function _arrayWithoutHoles(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}function _iterableToArray(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}Object.defineProperty(exports,"__esModule",{value:!0});var length={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},segmentRegExp=/([astvzqmhlc])([^astvzqmhlc]*)/gi,numberRegExp=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi,parse=function(t){var e=t.match(segmentRegExp);if(!e)throw new Error("No path elements found in string ".concat(t));return e.reduce((function(t,e){var n=e.charAt(0),i=n.toLowerCase(),r=parseValues(e.substr(1));for("m"===i&&r.length>2&&(t.push([n].concat(_toConsumableArray(r.splice(0,2)))),i="l",n="m"===n?"l":"L");r.length>=0;){if(r.length===length[i]){t.push([n].concat(_toConsumableArray(r.splice(0,length[i]))));break}if(r.length<length[i])throw new Error('Malformed path data: "'.concat(n,'" must have ').concat(length[i]," elements and has ").concat(r.length,": ").concat(e));t.push([n].concat(_toConsumableArray(r.splice(0,length[i]))))}return t}),[])},parseValues=function(t){var e=t.match(numberRegExp);return e?e.map(Number):[]},LinearPosition=function(t,e,n,i){var r=this;_defineProperty(this,"x0",void 0),_defineProperty(this,"x1",void 0),_defineProperty(this,"y0",void 0),_defineProperty(this,"y1",void 0),_defineProperty(this,"getTotalLength",(function(){return Math.sqrt(Math.pow(r.x0-r.x1,2)+Math.pow(r.y0-r.y1,2))})),_defineProperty(this,"getPointAtLength",(function(t){var e=t/Math.sqrt(Math.pow(r.x0-r.x1,2)+Math.pow(r.y0-r.y1,2)),n=(r.x1-r.x0)*e,i=(r.y1-r.y0)*e;return{x:r.x0+n,y:r.y0+i}})),_defineProperty(this,"getTangentAtLength",(function(t){var e=Math.sqrt((r.x1-r.x0)*(r.x1-r.x0)+(r.y1-r.y0)*(r.y1-r.y0));return{x:(r.x1-r.x0)/e,y:(r.y1-r.y0)/e}})),_defineProperty(this,"getPropertiesAtLength",(function(t){var e=r.getPointAtLength(t),n=r.getTangentAtLength(t);return{x:e.x,y:e.y,tangentX:n.x,tangentY:n.y}})),this.x0=t,this.x1=e,this.y0=n,this.y1=i},Arc=function(t,e,n,i,r,h,a,o,s){var g=this;_defineProperty(this,"x0",void 0),_defineProperty(this,"y0",void 0),_defineProperty(this,"rx",void 0),_defineProperty(this,"ry",void 0),_defineProperty(this,"xAxisRotate",void 0),_defineProperty(this,"LargeArcFlag",void 0),_defineProperty(this,"SweepFlag",void 0),_defineProperty(this,"x1",void 0),_defineProperty(this,"y1",void 0),_defineProperty(this,"length",void 0),_defineProperty(this,"getTotalLength",(function(){return g.length})),_defineProperty(this,"getPointAtLength",(function(t){t<0?t=0:t>g.length&&(t=g.length);var e=pointOnEllipticalArc({x:g.x0,y:g.y0},g.rx,g.ry,g.xAxisRotate,g.LargeArcFlag,g.SweepFlag,{x:g.x1,y:g.y1},t/g.length);return{x:e.x,y:e.y}})),_defineProperty(this,"getTangentAtLength",(function(t){t<0?t=0:t>g.length&&(t=g.length);var e=pointOnEllipticalArc({x:g.x0,y:g.y0},g.rx,g.ry,g.xAxisRotate,g.LargeArcFlag,g.SweepFlag,{x:g.x1,y:g.y1},t/g.length);return{x:Math.cos(e.ellipticalArcAngle-Math.PI/2),y:Math.sin(e.ellipticalArcAngle-Math.PI/2)}})),_defineProperty(this,"getPropertiesAtLength",(function(t){var e=g.getTangentAtLength(t),n=g.getPointAtLength(t);return{x:n.x,y:n.y,tangentX:e.x,tangentY:e.y}})),this.x0=t,this.y0=e,this.rx=n,this.ry=i,this.xAxisRotate=r,this.LargeArcFlag=h,this.SweepFlag=a,this.x1=o,this.y1=s;var c=approximateArcLengthOfCurve(300,(function(g){return pointOnEllipticalArc({x:t,y:e},n,i,r,h,a,{x:o,y:s},g)}));this.length=c.arcLength},pointOnEllipticalArc=function(t,e,n,i,r,h,a,o){e=Math.abs(e),n=Math.abs(n),i=mod(i,360);var s=toRadians(i);if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var g=(t.x-a.x)/2,c=(t.y-a.y)/2,l={x:Math.cos(s)*g+Math.sin(s)*c,y:-Math.sin(s)*g+Math.cos(s)*c},u=Math.pow(l.x,2)/Math.pow(e,2)+Math.pow(l.y,2)/Math.pow(n,2);u>1&&(e=Math.sqrt(u)*e,n=Math.sqrt(u)*n);var f=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(l.y,2)-Math.pow(n,2)*Math.pow(l.x,2))/(Math.pow(e,2)*Math.pow(l.y,2)+Math.pow(n,2)*Math.pow(l.x,2));f=f<0?0:f;var p=(r!==h?1:-1)*Math.sqrt(f),y=p*(e*l.y/n),x=p*(-n*l.x/e),d={x:Math.cos(s)*y-Math.sin(s)*x+(t.x+a.x)/2,y:Math.sin(s)*y+Math.cos(s)*x+(t.y+a.y)/2},v={x:(l.x-y)/e,y:(l.y-x)/n},P=angleBetween({x:1,y:0},v),L=angleBetween(v,{x:(-l.x-y)/e,y:(-l.y-x)/n});!h&&L>0?L-=2*Math.PI:h&&L<0&&(L+=2*Math.PI);var A=P+(L%=2*Math.PI)*o,M=e*Math.cos(A),w=n*Math.sin(A);return{x:Math.cos(s)*M-Math.sin(s)*w+d.x,y:Math.sin(s)*M+Math.cos(s)*w+d.y,ellipticalArcStartAngle:P,ellipticalArcEndAngle:P+L,ellipticalArcAngle:A,ellipticalArcCenter:d,resultantRx:e,resultantRy:n}},approximateArcLengthOfCurve=function(t,e){t=t||500;for(var n,i=0,r=[],h=[],a=e(0),o=0;o<t;o++){var s=clamp(o*(1/t),0,1);n=e(s),i+=distance(a,n),h.push([a,n]),r.push({t:s,arcLength:i}),a=n}return n=e(1),h.push([a,n]),i+=distance(a,n),r.push({t:1,arcLength:i}),{arcLength:i,arcLengthMap:r,approximationLines:h}},mod=function(t,e){return(t%e+e)%e},toRadians=function(t){return t*(Math.PI/180)},distance=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},clamp=function(t,e,n){return Math.min(Math.max(t,e),n)},angleBetween=function(t,e){var n=t.x*e.x+t.y*e.y,i=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2)));return(t.x*e.y-t.y*e.x<0?-1:1)*Math.acos(n/i)},tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]],cubicPoint=function(t,e,n){return{x:(1-n)*(1-n)*(1-n)*t[0]+3*(1-n)*(1-n)*n*t[1]+3*(1-n)*n*n*t[2]+n*n*n*t[3],y:(1-n)*(1-n)*(1-n)*e[0]+3*(1-n)*(1-n)*n*e[1]+3*(1-n)*n*n*e[2]+n*n*n*e[3]}},cubicDerivative=function(t,e,n){return quadraticPoint([3*(t[1]-t[0]),3*(t[2]-t[1]),3*(t[3]-t[2])],[3*(e[1]-e[0]),3*(e[2]-e[1]),3*(e[3]-e[2])],n)},getCubicArcLength=function(t,e,n){var i,r,h;i=n/2,r=0;for(var a=0;a<20;a++)h=i*tValues[20][a]+i,r+=cValues[20][a]*B(t,e,h);return i*r},quadraticPoint=function(t,e,n){return{x:(1-n)*(1-n)*t[0]+2*(1-n)*n*t[1]+n*n*t[2],y:(1-n)*(1-n)*e[0]+2*(1-n)*n*e[1]+n*n*e[2]}},getQuadraticArcLength=function(t,e,n){void 0===n&&(n=1);var i=t[0]-2*t[1]+t[2],r=e[0]-2*e[1]+e[2],h=2*t[1]-2*t[0],a=2*e[1]-2*e[0],o=4*(i*i+r*r),s=4*(i*h+r*a),g=h*h+a*a;if(0===o)return n*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(e[2]-e[0],2));var c=s/(2*o),l=n+c,u=g/o-c*c,f=l*l+u>0?Math.sqrt(l*l+u):0,p=c*c+u>0?Math.sqrt(c*c+u):0,y=c+Math.sqrt(c*c+u)!==0?u*Math.log(Math.abs((l+f)/(c+p))):0;return Math.sqrt(o)/2*(l*f-c*p+y)},quadraticDerivative=function(t,e,n){return{x:2*(1-n)*(t[1]-t[0])+2*n*(t[2]-t[1]),y:2*(1-n)*(e[1]-e[0])+2*n*(e[2]-e[1])}};function B(t,e,n){var i=getDerivative(1,n,t),r=getDerivative(1,n,e),h=i*i+r*r;return Math.sqrt(h)}var getDerivative=function t(e,n,i){var r,h,a=i.length-1;if(0===a)return 0;if(0===e){h=0;for(var o=0;o<=a;o++)h+=binomialCoefficients[a][o]*Math.pow(1-n,a-o)*Math.pow(n,o)*i[o];return h}r=new Array(a);for(var s=0;s<a;s++)r[s]=a*(i[s+1]-i[s]);return t(e-1,n,r)},t2length=function(t,e,n,i,r){for(var h=1,a=t/e,o=(t-n(i,r,a))/e,s=0;h>.001;){var g=n(i,r,a+o),c=n(i,r,a-o),l=Math.abs(t-g)/e,u=Math.abs(t-c)/e;if(l<h?(h=l,a+=o):u<h?(h=u,a-=o):o/=2,++s>500)break}return a},Bezier=function(t,e,n,i,r,h,a,o){var s=this;_defineProperty(this,"a",void 0),_defineProperty(this,"b",void 0),_defineProperty(this,"c",void 0),_defineProperty(this,"d",void 0),_defineProperty(this,"length",void 0),_defineProperty(this,"getArcLength",void 0),_defineProperty(this,"getPoint",void 0),_defineProperty(this,"getDerivative",void 0),_defineProperty(this,"getTotalLength",(function(){return s.length})),_defineProperty(this,"getPointAtLength",(function(t){var e=t2length(t,s.length,s.getArcLength,[s.a.x,s.b.x,s.c.x,s.d.x],[s.a.y,s.b.y,s.c.y,s.d.y]);return s.getPoint([s.a.x,s.b.x,s.c.x,s.d.x],[s.a.y,s.b.y,s.c.y,s.d.y],e)})),_defineProperty(this,"getTangentAtLength",(function(t){var e=t2length(t,s.length,s.getArcLength,[s.a.x,s.b.x,s.c.x,s.d.x],[s.a.y,s.b.y,s.c.y,s.d.y]),n=s.getDerivative([s.a.x,s.b.x,s.c.x,s.d.x],[s.a.y,s.b.y,s.c.y,s.d.y],e),i=Math.sqrt(n.x*n.x+n.y*n.y);return i>0?{x:n.x/i,y:n.y/i}:{x:0,y:0}})),_defineProperty(this,"getPropertiesAtLength",(function(t){var e,n=t2length(t,s.length,s.getArcLength,[s.a.x,s.b.x,s.c.x,s.d.x],[s.a.y,s.b.y,s.c.y,s.d.y]),i=s.getDerivative([s.a.x,s.b.x,s.c.x,s.d.x],[s.a.y,s.b.y,s.c.y,s.d.y],n),r=Math.sqrt(i.x*i.x+i.y*i.y);e=r>0?{x:i.x/r,y:i.y/r}:{x:0,y:0};var h=s.getPoint([s.a.x,s.b.x,s.c.x,s.d.x],[s.a.y,s.b.y,s.c.y,s.d.y],n);return{x:h.x,y:h.y,tangentX:e.x,tangentY:e.y}})),_defineProperty(this,"getC",(function(){return s.c})),_defineProperty(this,"getD",(function(){return s.d})),this.a={x:t,y:e},this.b={x:n,y:i},this.c={x:r,y:h},void 0!==a&&void 0!==o?(this.getArcLength=getCubicArcLength,this.getPoint=cubicPoint,this.getDerivative=cubicDerivative,this.d={x:a,y:o}):(this.getArcLength=getQuadraticArcLength,this.getPoint=quadraticPoint,this.getDerivative=quadraticDerivative,this.d={x:0,y:0}),this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],1)},SVGPathProperties=function(t){var e=this;_defineProperty(this,"length",0),_defineProperty(this,"partial_lengths",[]),_defineProperty(this,"functions",[]),_defineProperty(this,"getPartAtLength",(function(t){t<0?t=0:t>e.length&&(t=e.length);for(var n=e.partial_lengths.length-1;e.partial_lengths[n]>=t&&e.partial_lengths[n]>0;)n--;return n++,{fraction:t-e.partial_lengths[n-1],i:n}})),_defineProperty(this,"getTotalLength",(function(){return e.length})),_defineProperty(this,"getPointAtLength",(function(t){var n=e.getPartAtLength(t),i=e.functions[n.i];if(i)return i.getPointAtLength(n.fraction);throw new Error("Wrong function at this part.")})),_defineProperty(this,"getTangentAtLength",(function(t){var n=e.getPartAtLength(t),i=e.functions[n.i];if(i)return i.getTangentAtLength(n.fraction);throw new Error("Wrong function at this part.")})),_defineProperty(this,"getPropertiesAtLength",(function(t){var n=e.getPartAtLength(t),i=e.functions[n.i];if(i)return i.getPropertiesAtLength(n.fraction);throw new Error("Wrong function at this part.")})),_defineProperty(this,"getParts",(function(){for(var t=[],n=0;n<e.functions.length;n++)if(null!==e.functions[n]){e.functions[n]=e.functions[n];var i={start:e.functions[n].getPointAtLength(0),end:e.functions[n].getPointAtLength(e.partial_lengths[n]-e.partial_lengths[n-1]),length:e.partial_lengths[n]-e.partial_lengths[n-1],getPointAtLength:e.functions[n].getPointAtLength,getTangentAtLength:e.functions[n].getTangentAtLength,getPropertiesAtLength:e.functions[n].getPropertiesAtLength};t.push(i)}return t}));for(var n,i=parse(t),r=[0,0],h=[0,0],a=[0,0],o=0;o<i.length;o++){if("M"===i[o][0])a=[(r=[i[o][1],i[o][2]])[0],r[1]],this.functions.push(null);else if("m"===i[o][0])a=[(r=[i[o][1]+r[0],i[o][2]+r[1]])[0],r[1]],this.functions.push(null);else if("L"===i[o][0])this.length+=Math.sqrt(Math.pow(r[0]-i[o][1],2)+Math.pow(r[1]-i[o][2],2)),this.functions.push(new LinearPosition(r[0],i[o][1],r[1],i[o][2])),r=[i[o][1],i[o][2]];else if("l"===i[o][0])this.length+=Math.sqrt(Math.pow(i[o][1],2)+Math.pow(i[o][2],2)),this.functions.push(new LinearPosition(r[0],i[o][1]+r[0],r[1],i[o][2]+r[1])),r=[i[o][1]+r[0],i[o][2]+r[1]];else if("H"===i[o][0])this.length+=Math.abs(r[0]-i[o][1]),this.functions.push(new LinearPosition(r[0],i[o][1],r[1],r[1])),r[0]=i[o][1];else if("h"===i[o][0])this.length+=Math.abs(i[o][1]),this.functions.push(new LinearPosition(r[0],r[0]+i[o][1],r[1],r[1])),r[0]=i[o][1]+r[0];else if("V"===i[o][0])this.length+=Math.abs(r[1]-i[o][1]),this.functions.push(new LinearPosition(r[0],r[0],r[1],i[o][1])),r[1]=i[o][1];else if("v"===i[o][0])this.length+=Math.abs(i[o][1]),this.functions.push(new LinearPosition(r[0],r[0],r[1],r[1]+i[o][1])),r[1]=i[o][1]+r[1];else if("z"===i[o][0]||"Z"===i[o][0])this.length+=Math.sqrt(Math.pow(a[0]-r[0],2)+Math.pow(a[1]-r[1],2)),this.functions.push(new LinearPosition(r[0],a[0],r[1],a[1])),r=[a[0],a[1]];else if("C"===i[o][0])n=new Bezier(r[0],r[1],i[o][1],i[o][2],i[o][3],i[o][4],i[o][5],i[o][6]),this.length+=n.getTotalLength(),r=[i[o][5],i[o][6]],this.functions.push(n);else if("c"===i[o][0])(n=new Bezier(r[0],r[1],r[0]+i[o][1],r[1]+i[o][2],r[0]+i[o][3],r[1]+i[o][4],r[0]+i[o][5],r[1]+i[o][6])).getTotalLength()>0?(this.length+=n.getTotalLength(),this.functions.push(n),r=[i[o][5]+r[0],i[o][6]+r[1]]):this.functions.push(new LinearPosition(r[0],r[0],r[1],r[1]));else if("S"===i[o][0]){if(o>0&&["C","c","S","s"].indexOf(i[o-1][0])>-1){if(n){var s=n.getC();n=new Bezier(r[0],r[1],2*r[0]-s.x,2*r[1]-s.y,i[o][1],i[o][2],i[o][3],i[o][4])}}else n=new Bezier(r[0],r[1],r[0],r[1],i[o][1],i[o][2],i[o][3],i[o][4]);n&&(this.length+=n.getTotalLength(),r=[i[o][3],i[o][4]],this.functions.push(n))}else if("s"===i[o][0]){if(o>0&&["C","c","S","s"].indexOf(i[o-1][0])>-1){if(n){var g=n.getC(),c=n.getD();n=new Bezier(r[0],r[1],r[0]+c.x-g.x,r[1]+c.y-g.y,r[0]+i[o][1],r[1]+i[o][2],r[0]+i[o][3],r[1]+i[o][4])}}else n=new Bezier(r[0],r[1],r[0],r[1],r[0]+i[o][1],r[1]+i[o][2],r[0]+i[o][3],r[1]+i[o][4]);n&&(this.length+=n.getTotalLength(),r=[i[o][3]+r[0],i[o][4]+r[1]],this.functions.push(n))}else if("Q"===i[o][0]){if(r[0]==i[o][1]&&r[1]==i[o][2]){var l=new LinearPosition(i[o][1],i[o][3],i[o][2],i[o][4]);this.length+=l.getTotalLength(),this.functions.push(l)}else n=new Bezier(r[0],r[1],i[o][1],i[o][2],i[o][3],i[o][4],void 0,void 0),this.length+=n.getTotalLength(),this.functions.push(n);r=[i[o][3],i[o][4]],h=[i[o][1],i[o][2]]}else if("q"===i[o][0]){if(0!=i[o][1]||0!=i[o][2])n=new Bezier(r[0],r[1],r[0]+i[o][1],r[1]+i[o][2],r[0]+i[o][3],r[1]+i[o][4],void 0,void 0),this.length+=n.getTotalLength(),this.functions.push(n);else{var u=new LinearPosition(r[0]+i[o][1],r[0]+i[o][3],r[1]+i[o][2],r[1]+i[o][4]);this.length+=u.getTotalLength(),this.functions.push(u)}h=[r[0]+i[o][1],r[1]+i[o][2]],r=[i[o][3]+r[0],i[o][4]+r[1]]}else if("T"===i[o][0]){if(o>0&&["Q","q","T","t"].indexOf(i[o-1][0])>-1)n=new Bezier(r[0],r[1],2*r[0]-h[0],2*r[1]-h[1],i[o][1],i[o][2],void 0,void 0),this.functions.push(n),this.length+=n.getTotalLength();else{var f=new LinearPosition(r[0],i[o][1],r[1],i[o][2]);this.functions.push(f),this.length+=f.getTotalLength()}h=[2*r[0]-h[0],2*r[1]-h[1]],r=[i[o][1],i[o][2]]}else if("t"===i[o][0]){if(o>0&&["Q","q","T","t"].indexOf(i[o-1][0])>-1)n=new Bezier(r[0],r[1],2*r[0]-h[0],2*r[1]-h[1],r[0]+i[o][1],r[1]+i[o][2],void 0,void 0),this.length+=n.getTotalLength(),this.functions.push(n);else{var p=new LinearPosition(r[0],r[0]+i[o][1],r[1],r[1]+i[o][2]);this.length+=p.getTotalLength(),this.functions.push(p)}h=[2*r[0]-h[0],2*r[1]-h[1]],r=[i[o][1]+r[0],i[o][2]+r[0]]}else if("A"===i[o][0]){var y=new Arc(r[0],r[1],i[o][1],i[o][2],i[o][3],1===i[o][4],1===i[o][5],i[o][6],i[o][7]);this.length+=y.getTotalLength(),r=[i[o][6],i[o][7]],this.functions.push(y)}else if("a"===i[o][0]){var x=new Arc(r[0],r[1],i[o][1],i[o][2],i[o][3],1===i[o][4],1===i[o][5],r[0]+i[o][6],r[1]+i[o][7]);this.length+=x.getTotalLength(),r=[r[0]+i[o][6],r[1]+i[o][7]],this.functions.push(x)}this.partial_lengths.push(this.length)}},_svgPathProperties=function(t){var e=this;if(_defineProperty(this,"inst",void 0),_defineProperty(this,"getTotalLength",(function(){return e.inst.getTotalLength()})),_defineProperty(this,"getPointAtLength",(function(t){return e.inst.getPointAtLength(t)})),_defineProperty(this,"getTangentAtLength",(function(t){return e.inst.getTangentAtLength(t)})),_defineProperty(this,"getPropertiesAtLength",(function(t){return e.inst.getPropertiesAtLength(t)})),_defineProperty(this,"getParts",(function(){return e.inst.getParts()})),this.inst=new SVGPathProperties(t),!(this instanceof svgPathProperties))return new svgPathProperties(t)},svgPathProperties=_svgPathProperties;exports.svgPathProperties=svgPathProperties;

@@ -1,2 +0,2 @@

// http://geoexamples.com/path-properties/ v1.0.0 Copyright 2019 Roger Veciana i Rovira
// http://geoexamples.com/path-properties/ v1.0.1 Copyright 2019 Roger Veciana i Rovira
function t(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function n(t){return function(t){if(Array.isArray(t)){for(var n=0,e=new Array(t.length);n<t.length;n++)e[n]=t[n];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var e={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=/([astvzqmhlc])([^astvzqmhlc]*)/gi,h=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi,r=function(t){var n=t.match(h);return n?n.map(Number):[]},s=function(n,e,i,h){var r=this;t(this,"x0",void 0),t(this,"x1",void 0),t(this,"y0",void 0),t(this,"y1",void 0),t(this,"getTotalLength",(function(){return Math.sqrt(Math.pow(r.x0-r.x1,2)+Math.pow(r.y0-r.y1,2))})),t(this,"getPointAtLength",(function(t){var n=t/Math.sqrt(Math.pow(r.x0-r.x1,2)+Math.pow(r.y0-r.y1,2)),e=(r.x1-r.x0)*n,i=(r.y1-r.y0)*n;return{x:r.x0+e,y:r.y0+i}})),t(this,"getTangentAtLength",(function(t){var n=Math.sqrt((r.x1-r.x0)*(r.x1-r.x0)+(r.y1-r.y0)*(r.y1-r.y0));return{x:(r.x1-r.x0)/n,y:(r.y1-r.y0)/n}})),t(this,"getPropertiesAtLength",(function(t){var n=r.getPointAtLength(t),e=r.getTangentAtLength(t);return{x:n.x,y:n.y,tangentX:e.x,tangentY:e.y}})),this.x0=n,this.x1=e,this.y0=i,this.y1=h},a=function(n,e,i,h,r,s,a,u,c){var l=this;t(this,"x0",void 0),t(this,"y0",void 0),t(this,"rx",void 0),t(this,"ry",void 0),t(this,"xAxisRotate",void 0),t(this,"LargeArcFlag",void 0),t(this,"SweepFlag",void 0),t(this,"x1",void 0),t(this,"y1",void 0),t(this,"length",void 0),t(this,"getTotalLength",(function(){return l.length})),t(this,"getPointAtLength",(function(t){t<0?t=0:t>l.length&&(t=l.length);var n=o({x:l.x0,y:l.y0},l.rx,l.ry,l.xAxisRotate,l.LargeArcFlag,l.SweepFlag,{x:l.x1,y:l.y1},t/l.length);return{x:n.x,y:n.y}})),t(this,"getTangentAtLength",(function(t){t<0?t=0:t>l.length&&(t=l.length);var n=o({x:l.x0,y:l.y0},l.rx,l.ry,l.xAxisRotate,l.LargeArcFlag,l.SweepFlag,{x:l.x1,y:l.y1},t/l.length);return{x:Math.cos(n.ellipticalArcAngle-Math.PI/2),y:Math.sin(n.ellipticalArcAngle-Math.PI/2)}})),t(this,"getPropertiesAtLength",(function(t){var n=l.getTangentAtLength(t),e=l.getPointAtLength(t);return{x:e.x,y:e.y,tangentX:n.x,tangentY:n.y}})),this.x0=n,this.y0=e,this.rx=i,this.ry=h,this.xAxisRotate=r,this.LargeArcFlag=s,this.SweepFlag=a,this.x1=u,this.y1=c;var f=g(300,(function(t){return o({x:n,y:e},i,h,r,s,a,{x:u,y:c},t)}));this.length=f.arcLength},o=function(t,n,e,i,h,r,s,a){n=Math.abs(n),e=Math.abs(e),i=u(i,360);var o=c(i);if(t.x===s.x&&t.y===s.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===n||0===e)return{x:0,y:0,ellipticalArcAngle:0};var g=(t.x-s.x)/2,l=(t.y-s.y)/2,f={x:Math.cos(o)*g+Math.sin(o)*l,y:-Math.sin(o)*g+Math.cos(o)*l},y=Math.pow(f.x,2)/Math.pow(n,2)+Math.pow(f.y,2)/Math.pow(e,2);y>1&&(n=Math.sqrt(y)*n,e=Math.sqrt(y)*e);var p=(Math.pow(n,2)*Math.pow(e,2)-Math.pow(n,2)*Math.pow(f.y,2)-Math.pow(e,2)*Math.pow(f.x,2))/(Math.pow(n,2)*Math.pow(f.y,2)+Math.pow(e,2)*Math.pow(f.x,2));p=p<0?0:p;var v=(h!==r?1:-1)*Math.sqrt(p),M=v*(n*f.y/e),w=v*(-e*f.x/n),L={x:Math.cos(o)*M-Math.sin(o)*w+(t.x+s.x)/2,y:Math.sin(o)*M+Math.cos(o)*w+(t.y+s.y)/2},A={x:(f.x-M)/n,y:(f.y-w)/e},d=x({x:1,y:0},A),P=x(A,{x:(-f.x-M)/n,y:(-f.y-w)/e});!r&&P>0?P-=2*Math.PI:r&&P<0&&(P+=2*Math.PI);var b=d+(P%=2*Math.PI)*a,T=n*Math.cos(b),q=e*Math.sin(b);return{x:Math.cos(o)*T-Math.sin(o)*q+L.x,y:Math.sin(o)*T+Math.cos(o)*q+L.y,ellipticalArcStartAngle:d,ellipticalArcEndAngle:d+P,ellipticalArcAngle:b,ellipticalArcCenter:L,resultantRx:n,resultantRy:e}},g=function(t,n){t=t||500;for(var e,i=0,h=[],r=[],s=n(0),a=0;a<t;a++){var o=f(a*(1/t),0,1);e=n(o),i+=l(s,e),r.push([s,e]),h.push({t:o,arcLength:i}),s=e}return e=n(1),r.push([s,e]),i+=l(s,e),h.push({t:1,arcLength:i}),{arcLength:i,arcLengthMap:h,approximationLines:r}},u=function(t,n){return(t%n+n)%n},c=function(t){return t*(Math.PI/180)},l=function(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))},f=function(t,n,e){return Math.min(Math.max(t,n),e)},x=function(t,n){var e=t.x*n.x+t.y*n.y,i=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(n.x,2)+Math.pow(n.y,2)));return(t.x*n.y-t.y*n.x<0?-1:1)*Math.acos(e/i)},y=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],p=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],v=[[1],[1,1],[1,2,1],[1,3,3,1]],M=function(t,n,e){return{x:(1-e)*(1-e)*(1-e)*t[0]+3*(1-e)*(1-e)*e*t[1]+3*(1-e)*e*e*t[2]+e*e*e*t[3],y:(1-e)*(1-e)*(1-e)*n[0]+3*(1-e)*(1-e)*e*n[1]+3*(1-e)*e*e*n[2]+e*e*e*n[3]}},w=function(t,n,e){return A([3*(t[1]-t[0]),3*(t[2]-t[1]),3*(t[3]-t[2])],[3*(n[1]-n[0]),3*(n[2]-n[1]),3*(n[3]-n[2])],e)},L=function(t,n,e){var i,h,r;i=e/2,h=0;for(var s=0;s<20;s++)r=i*y[20][s]+i,h+=p[20][s]*b(t,n,r);return i*h},A=function(t,n,e){return{x:(1-e)*(1-e)*t[0]+2*(1-e)*e*t[1]+e*e*t[2],y:(1-e)*(1-e)*n[0]+2*(1-e)*e*n[1]+e*e*n[2]}},d=function(t,n,e){void 0===e&&(e=1);var i=t[0]-2*t[1]+t[2],h=n[0]-2*n[1]+n[2],r=2*t[1]-2*t[0],s=2*n[1]-2*n[0],a=4*(i*i+h*h),o=4*(i*r+h*s),g=r*r+s*s;if(0===a)return e*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(n[2]-n[0],2));var u=o/(2*a),c=e+u,l=g/a-u*u,f=c*c+l>0?Math.sqrt(c*c+l):0,x=u*u+l>0?Math.sqrt(u*u+l):0,y=u+Math.sqrt(u*u+l)!==0?l*Math.log(Math.abs((c+f)/(u+x))):0;return Math.sqrt(a)/2*(c*f-u*x+y)},P=function(t,n,e){return{x:2*(1-e)*(t[1]-t[0])+2*e*(t[2]-t[1]),y:2*(1-e)*(n[1]-n[0])+2*e*(n[2]-n[1])}};function b(t,n,e){var i=T(1,e,t),h=T(1,e,n),r=i*i+h*h;return Math.sqrt(r)}var T=function t(n,e,i){var h,r,s=i.length-1;if(0===s)return 0;if(0===n){r=0;for(var a=0;a<=s;a++)r+=v[s][a]*Math.pow(1-e,s-a)*Math.pow(e,a)*i[a];return r}h=new Array(s);for(var o=0;o<s;o++)h[o]=s*(i[o+1]-i[o]);return t(n-1,e,h)},q=function(t,n,e,i,h){for(var r=1,s=t/n,a=(t-e(i,h,s))/n,o=0;r>.001;){var g=e(i,h,s+a),u=e(i,h,s-a),c=Math.abs(t-g)/n,l=Math.abs(t-u)/n;if(c<r?(r=c,s+=a):l<r?(r=l,s-=a):a/=2,++o>500)break}return s},m=function(n,e,i,h,r,s,a,o){var g=this;t(this,"a",void 0),t(this,"b",void 0),t(this,"c",void 0),t(this,"d",void 0),t(this,"length",void 0),t(this,"getArcLength",void 0),t(this,"getPoint",void 0),t(this,"getDerivative",void 0),t(this,"getTotalLength",(function(){return g.length})),t(this,"getPointAtLength",(function(t){var n=q(t,g.length,g.getArcLength,[g.a.x,g.b.x,g.c.x,g.d.x],[g.a.y,g.b.y,g.c.y,g.d.y]);return g.getPoint([g.a.x,g.b.x,g.c.x,g.d.x],[g.a.y,g.b.y,g.c.y,g.d.y],n)})),t(this,"getTangentAtLength",(function(t){var n=q(t,g.length,g.getArcLength,[g.a.x,g.b.x,g.c.x,g.d.x],[g.a.y,g.b.y,g.c.y,g.d.y]),e=g.getDerivative([g.a.x,g.b.x,g.c.x,g.d.x],[g.a.y,g.b.y,g.c.y,g.d.y],n),i=Math.sqrt(e.x*e.x+e.y*e.y);return i>0?{x:e.x/i,y:e.y/i}:{x:0,y:0}})),t(this,"getPropertiesAtLength",(function(t){var n,e=q(t,g.length,g.getArcLength,[g.a.x,g.b.x,g.c.x,g.d.x],[g.a.y,g.b.y,g.c.y,g.d.y]),i=g.getDerivative([g.a.x,g.b.x,g.c.x,g.d.x],[g.a.y,g.b.y,g.c.y,g.d.y],e),h=Math.sqrt(i.x*i.x+i.y*i.y);n=h>0?{x:i.x/h,y:i.y/h}:{x:0,y:0};var r=g.getPoint([g.a.x,g.b.x,g.c.x,g.d.x],[g.a.y,g.b.y,g.c.y,g.d.y],e);return{x:r.x,y:r.y,tangentX:n.x,tangentY:n.y}})),t(this,"getC",(function(){return g.c})),t(this,"getD",(function(){return g.d})),this.a={x:n,y:e},this.b={x:i,y:h},this.c={x:r,y:s},void 0!==a&&void 0!==o?(this.getArcLength=L,this.getPoint=M,this.getDerivative=w,this.d={x:a,y:o}):(this.getArcLength=d,this.getPoint=A,this.getDerivative=P,this.d={x:0,y:0}),this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],1)},S=function(h){var o=this;t(this,"length",0),t(this,"partial_lengths",[]),t(this,"functions",[]),t(this,"getPartAtLength",(function(t){t<0?t=0:t>o.length&&(t=o.length);for(var n=o.partial_lengths.length-1;o.partial_lengths[n]>=t&&o.partial_lengths[n]>0;)n--;return n++,{fraction:t-o.partial_lengths[n-1],i:n}})),t(this,"getTotalLength",(function(){return o.length})),t(this,"getPointAtLength",(function(t){var n=o.getPartAtLength(t),e=o.functions[n.i];if(e)return e.getPointAtLength(n.fraction);throw new Error("Wrong function at this part.")})),t(this,"getTangentAtLength",(function(t){var n=o.getPartAtLength(t),e=o.functions[n.i];if(e)return e.getTangentAtLength(n.fraction);throw new Error("Wrong function at this part.")})),t(this,"getPropertiesAtLength",(function(t){var n=o.getPartAtLength(t),e=o.functions[n.i];if(e)return e.getPropertiesAtLength(n.fraction);throw new Error("Wrong function at this part.")})),t(this,"getParts",(function(){for(var t=[],n=0;n<o.functions.length;n++)if(null!==o.functions[n]){o.functions[n]=o.functions[n];var e={start:o.functions[n].getPointAtLength(0),end:o.functions[n].getPointAtLength(o.partial_lengths[n]-o.partial_lengths[n-1]),length:o.partial_lengths[n]-o.partial_lengths[n-1],getPointAtLength:o.functions[n].getPointAtLength,getTangentAtLength:o.functions[n].getTangentAtLength,getPropertiesAtLength:o.functions[n].getPropertiesAtLength};t.push(e)}return t}));for(var g,u=function(t){var h=t.match(i);if(!h)throw new Error("No path elements found in string ".concat(t));return h.reduce((function(t,i){var h=i.charAt(0),s=h.toLowerCase(),a=r(i.substr(1));for("m"===s&&a.length>2&&(t.push([h].concat(n(a.splice(0,2)))),s="l",h="m"===h?"l":"L");a.length>=0;){if(a.length===e[s]){t.push([h].concat(n(a.splice(0,e[s]))));break}if(a.length<e[s])throw new Error('Malformed path data: "'.concat(h,'" must have ').concat(e[s]," elements and has ").concat(a.length,": ").concat(i));t.push([h].concat(n(a.splice(0,e[s]))))}return t}),[])}(h),c=[0,0],l=[0,0],f=[0,0],x=0;x<u.length;x++){if("M"===u[x][0])f=[(c=[u[x][1],u[x][2]])[0],c[1]],this.functions.push(null);else if("m"===u[x][0])f=[(c=[u[x][1]+c[0],u[x][2]+c[1]])[0],c[1]],this.functions.push(null);else if("L"===u[x][0])this.length+=Math.sqrt(Math.pow(c[0]-u[x][1],2)+Math.pow(c[1]-u[x][2],2)),this.functions.push(new s(c[0],u[x][1],c[1],u[x][2])),c=[u[x][1],u[x][2]];else if("l"===u[x][0])this.length+=Math.sqrt(Math.pow(u[x][1],2)+Math.pow(u[x][2],2)),this.functions.push(new s(c[0],u[x][1]+c[0],c[1],u[x][2]+c[1])),c=[u[x][1]+c[0],u[x][2]+c[1]];else if("H"===u[x][0])this.length+=Math.abs(c[0]-u[x][1]),this.functions.push(new s(c[0],u[x][1],c[1],c[1])),c[0]=u[x][1];else if("h"===u[x][0])this.length+=Math.abs(u[x][1]),this.functions.push(new s(c[0],c[0]+u[x][1],c[1],c[1])),c[0]=u[x][1]+c[0];else if("V"===u[x][0])this.length+=Math.abs(c[1]-u[x][1]),this.functions.push(new s(c[0],c[0],c[1],u[x][1])),c[1]=u[x][1];else if("v"===u[x][0])this.length+=Math.abs(u[x][1]),this.functions.push(new s(c[0],c[0],c[1],c[1]+u[x][1])),c[1]=u[x][1]+c[1];else if("z"===u[x][0]||"Z"===u[x][0])this.length+=Math.sqrt(Math.pow(f[0]-c[0],2)+Math.pow(f[1]-c[1],2)),this.functions.push(new s(c[0],f[0],c[1],f[1])),c=[f[0],f[1]];else if("C"===u[x][0])g=new m(c[0],c[1],u[x][1],u[x][2],u[x][3],u[x][4],u[x][5],u[x][6]),this.length+=g.getTotalLength(),c=[u[x][5],u[x][6]],this.functions.push(g);else if("c"===u[x][0])(g=new m(c[0],c[1],c[0]+u[x][1],c[1]+u[x][2],c[0]+u[x][3],c[1]+u[x][4],c[0]+u[x][5],c[1]+u[x][6])).getTotalLength()>0?(this.length+=g.getTotalLength(),this.functions.push(g),c=[u[x][5]+c[0],u[x][6]+c[1]]):this.functions.push(new s(c[0],c[0],c[1],c[1]));else if("S"===u[x][0]){if(x>0&&["C","c","S","s"].indexOf(u[x-1][0])>-1){if(g){var y=g.getC();g=new m(c[0],c[1],2*c[0]-y.x,2*c[1]-y.y,u[x][1],u[x][2],u[x][3],u[x][4])}}else g=new m(c[0],c[1],c[0],c[1],u[x][1],u[x][2],u[x][3],u[x][4]);g&&(this.length+=g.getTotalLength(),c=[u[x][3],u[x][4]],this.functions.push(g))}else if("s"===u[x][0]){if(x>0&&["C","c","S","s"].indexOf(u[x-1][0])>-1){if(g){var p=g.getC(),v=g.getD();g=new m(c[0],c[1],c[0]+v.x-p.x,c[1]+v.y-p.y,c[0]+u[x][1],c[1]+u[x][2],c[0]+u[x][3],c[1]+u[x][4])}}else g=new m(c[0],c[1],c[0],c[1],c[0]+u[x][1],c[1]+u[x][2],c[0]+u[x][3],c[1]+u[x][4]);g&&(this.length+=g.getTotalLength(),c=[u[x][3]+c[0],u[x][4]+c[1]],this.functions.push(g))}else if("Q"===u[x][0]){if(c[0]==u[x][1]&&c[1]==u[x][2]){var M=new s(u[x][1],u[x][3],u[x][2],u[x][4]);this.length+=M.getTotalLength(),this.functions.push(M)}else g=new m(c[0],c[1],u[x][1],u[x][2],u[x][3],u[x][4],void 0,void 0),this.length+=g.getTotalLength(),this.functions.push(g);c=[u[x][3],u[x][4]],l=[u[x][1],u[x][2]]}else if("q"===u[x][0]){if(0!=u[x][1]||0!=u[x][2])g=new m(c[0],c[1],c[0]+u[x][1],c[1]+u[x][2],c[0]+u[x][3],c[1]+u[x][4],void 0,void 0),this.length+=g.getTotalLength(),this.functions.push(g);else{var w=new s(c[0]+u[x][1],c[0]+u[x][3],c[1]+u[x][2],c[1]+u[x][4]);this.length+=w.getTotalLength(),this.functions.push(w)}l=[c[0]+u[x][1],c[1]+u[x][2]],c=[u[x][3]+c[0],u[x][4]+c[1]]}else if("T"===u[x][0]){if(x>0&&["Q","q","T","t"].indexOf(u[x-1][0])>-1)g=new m(c[0],c[1],2*c[0]-l[0],2*c[1]-l[1],u[x][1],u[x][2],void 0,void 0),this.functions.push(g),this.length+=g.getTotalLength();else{var L=new s(c[0],u[x][1],c[1],u[x][2]);this.functions.push(L),this.length+=L.getTotalLength()}l=[2*c[0]-l[0],2*c[1]-l[1]],c=[u[x][1],u[x][2]]}else if("t"===u[x][0]){if(x>0&&["Q","q","T","t"].indexOf(u[x-1][0])>-1)g=new m(c[0],c[1],2*c[0]-l[0],2*c[1]-l[1],c[0]+u[x][1],c[1]+u[x][2],void 0,void 0),this.length+=g.getTotalLength(),this.functions.push(g);else{var A=new s(c[0],c[0]+u[x][1],c[1],c[1]+u[x][2]);this.length+=A.getTotalLength(),this.functions.push(A)}l=[2*c[0]-l[0],2*c[1]-l[1]],c=[u[x][1]+c[0],u[x][2]+c[0]]}else if("A"===u[x][0]){var d=new a(c[0],c[1],u[x][1],u[x][2],u[x][3],1===u[x][4],1===u[x][5],u[x][6],u[x][7]);this.length+=d.getTotalLength(),c=[u[x][6],u[x][7]],this.functions.push(d)}else if("a"===u[x][0]){var P=new a(c[0],c[1],u[x][1],u[x][2],u[x][3],1===u[x][4],1===u[x][5],c[0]+u[x][6],c[1]+u[x][7]);this.length+=P.getTotalLength(),c=[c[0]+u[x][6],c[1]+u[x][7]],this.functions.push(P)}this.partial_lengths.push(this.length)}},_=function(n){var e=this;if(t(this,"inst",void 0),t(this,"getTotalLength",(function(){return e.inst.getTotalLength()})),t(this,"getPointAtLength",(function(t){return e.inst.getPointAtLength(t)})),t(this,"getTangentAtLength",(function(t){return e.inst.getTangentAtLength(t)})),t(this,"getPropertiesAtLength",(function(t){return e.inst.getPropertiesAtLength(t)})),t(this,"getParts",(function(){return e.inst.getParts()})),this.inst=new S(n),!(this instanceof _))return new _(n)};export{_ as svgPathProperties};

@@ -1,2 +0,2 @@

// http://geoexamples.com/path-properties/ v1.0.0 Copyright 2019 Roger Veciana i Rovira
// http://geoexamples.com/path-properties/ v1.0.1 Copyright 2019 Roger Veciana i Rovira
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t=t||self).svgPathProperties={})}(this,(function(t){"use strict";function n(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function e(t){return function(t){if(Array.isArray(t)){for(var n=0,e=new Array(t.length);n<t.length;n++)e[n]=t[n];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var i={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},h=/([astvzqmhlc])([^astvzqmhlc]*)/gi,s=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi,r=function(t){var n=t.match(s);return n?n.map(Number):[]},a=function(t,e,i,h){var s=this;n(this,"x0",void 0),n(this,"x1",void 0),n(this,"y0",void 0),n(this,"y1",void 0),n(this,"getTotalLength",(function(){return Math.sqrt(Math.pow(s.x0-s.x1,2)+Math.pow(s.y0-s.y1,2))})),n(this,"getPointAtLength",(function(t){var n=t/Math.sqrt(Math.pow(s.x0-s.x1,2)+Math.pow(s.y0-s.y1,2)),e=(s.x1-s.x0)*n,i=(s.y1-s.y0)*n;return{x:s.x0+e,y:s.y0+i}})),n(this,"getTangentAtLength",(function(t){var n=Math.sqrt((s.x1-s.x0)*(s.x1-s.x0)+(s.y1-s.y0)*(s.y1-s.y0));return{x:(s.x1-s.x0)/n,y:(s.y1-s.y0)/n}})),n(this,"getPropertiesAtLength",(function(t){var n=s.getPointAtLength(t),e=s.getTangentAtLength(t);return{x:n.x,y:n.y,tangentX:e.x,tangentY:e.y}})),this.x0=t,this.x1=e,this.y0=i,this.y1=h},o=function(t,e,i,h,s,r,a,o,c){var l=this;n(this,"x0",void 0),n(this,"y0",void 0),n(this,"rx",void 0),n(this,"ry",void 0),n(this,"xAxisRotate",void 0),n(this,"LargeArcFlag",void 0),n(this,"SweepFlag",void 0),n(this,"x1",void 0),n(this,"y1",void 0),n(this,"length",void 0),n(this,"getTotalLength",(function(){return l.length})),n(this,"getPointAtLength",(function(t){t<0?t=0:t>l.length&&(t=l.length);var n=g({x:l.x0,y:l.y0},l.rx,l.ry,l.xAxisRotate,l.LargeArcFlag,l.SweepFlag,{x:l.x1,y:l.y1},t/l.length);return{x:n.x,y:n.y}})),n(this,"getTangentAtLength",(function(t){t<0?t=0:t>l.length&&(t=l.length);var n=g({x:l.x0,y:l.y0},l.rx,l.ry,l.xAxisRotate,l.LargeArcFlag,l.SweepFlag,{x:l.x1,y:l.y1},t/l.length);return{x:Math.cos(n.ellipticalArcAngle-Math.PI/2),y:Math.sin(n.ellipticalArcAngle-Math.PI/2)}})),n(this,"getPropertiesAtLength",(function(t){var n=l.getTangentAtLength(t),e=l.getPointAtLength(t);return{x:e.x,y:e.y,tangentX:n.x,tangentY:n.y}})),this.x0=t,this.y0=e,this.rx=i,this.ry=h,this.xAxisRotate=s,this.LargeArcFlag=r,this.SweepFlag=a,this.x1=o,this.y1=c;var f=u(300,(function(n){return g({x:t,y:e},i,h,s,r,a,{x:o,y:c},n)}));this.length=f.arcLength},g=function(t,n,e,i,h,s,r,a){n=Math.abs(n),e=Math.abs(e),i=c(i,360);var o=l(i);if(t.x===r.x&&t.y===r.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===n||0===e)return{x:0,y:0,ellipticalArcAngle:0};var g=(t.x-r.x)/2,u=(t.y-r.y)/2,f={x:Math.cos(o)*g+Math.sin(o)*u,y:-Math.sin(o)*g+Math.cos(o)*u},x=Math.pow(f.x,2)/Math.pow(n,2)+Math.pow(f.y,2)/Math.pow(e,2);x>1&&(n=Math.sqrt(x)*n,e=Math.sqrt(x)*e);var p=(Math.pow(n,2)*Math.pow(e,2)-Math.pow(n,2)*Math.pow(f.y,2)-Math.pow(e,2)*Math.pow(f.x,2))/(Math.pow(n,2)*Math.pow(f.y,2)+Math.pow(e,2)*Math.pow(f.x,2));p=p<0?0:p;var v=(h!==s?1:-1)*Math.sqrt(p),M=v*(n*f.y/e),w=v*(-e*f.x/n),d={x:Math.cos(o)*M-Math.sin(o)*w+(t.x+r.x)/2,y:Math.sin(o)*M+Math.cos(o)*w+(t.y+r.y)/2},L={x:(f.x-M)/n,y:(f.y-w)/e},A=y({x:1,y:0},L),P=y(L,{x:(-f.x-M)/n,y:(-f.y-w)/e});!s&&P>0?P-=2*Math.PI:s&&P<0&&(P+=2*Math.PI);var b=A+(P%=2*Math.PI)*a,T=n*Math.cos(b),q=e*Math.sin(b);return{x:Math.cos(o)*T-Math.sin(o)*q+d.x,y:Math.sin(o)*T+Math.cos(o)*q+d.y,ellipticalArcStartAngle:A,ellipticalArcEndAngle:A+P,ellipticalArcAngle:b,ellipticalArcCenter:d,resultantRx:n,resultantRy:e}},u=function(t,n){t=t||500;for(var e,i=0,h=[],s=[],r=n(0),a=0;a<t;a++){var o=x(a*(1/t),0,1);e=n(o),i+=f(r,e),s.push([r,e]),h.push({t:o,arcLength:i}),r=e}return e=n(1),s.push([r,e]),i+=f(r,e),h.push({t:1,arcLength:i}),{arcLength:i,arcLengthMap:h,approximationLines:s}},c=function(t,n){return(t%n+n)%n},l=function(t){return t*(Math.PI/180)},f=function(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))},x=function(t,n,e){return Math.min(Math.max(t,n),e)},y=function(t,n){var e=t.x*n.x+t.y*n.y,i=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(n.x,2)+Math.pow(n.y,2)));return(t.x*n.y-t.y*n.x<0?-1:1)*Math.acos(e/i)},p=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],v=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],M=[[1],[1,1],[1,2,1],[1,3,3,1]],w=function(t,n,e){return{x:(1-e)*(1-e)*(1-e)*t[0]+3*(1-e)*(1-e)*e*t[1]+3*(1-e)*e*e*t[2]+e*e*e*t[3],y:(1-e)*(1-e)*(1-e)*n[0]+3*(1-e)*(1-e)*e*n[1]+3*(1-e)*e*e*n[2]+e*e*e*n[3]}},d=function(t,n,e){return A([3*(t[1]-t[0]),3*(t[2]-t[1]),3*(t[3]-t[2])],[3*(n[1]-n[0]),3*(n[2]-n[1]),3*(n[3]-n[2])],e)},L=function(t,n,e){var i,h,s;i=e/2,h=0;for(var r=0;r<20;r++)s=i*p[20][r]+i,h+=v[20][r]*T(t,n,s);return i*h},A=function(t,n,e){return{x:(1-e)*(1-e)*t[0]+2*(1-e)*e*t[1]+e*e*t[2],y:(1-e)*(1-e)*n[0]+2*(1-e)*e*n[1]+e*e*n[2]}},P=function(t,n,e){void 0===e&&(e=1);var i=t[0]-2*t[1]+t[2],h=n[0]-2*n[1]+n[2],s=2*t[1]-2*t[0],r=2*n[1]-2*n[0],a=4*(i*i+h*h),o=4*(i*s+h*r),g=s*s+r*r;if(0===a)return e*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(n[2]-n[0],2));var u=o/(2*a),c=e+u,l=g/a-u*u,f=c*c+l>0?Math.sqrt(c*c+l):0,x=u*u+l>0?Math.sqrt(u*u+l):0,y=u+Math.sqrt(u*u+l)!==0?l*Math.log(Math.abs((c+f)/(u+x))):0;return Math.sqrt(a)/2*(c*f-u*x+y)},b=function(t,n,e){return{x:2*(1-e)*(t[1]-t[0])+2*e*(t[2]-t[1]),y:2*(1-e)*(n[1]-n[0])+2*e*(n[2]-n[1])}};function T(t,n,e){var i=q(1,e,t),h=q(1,e,n),s=i*i+h*h;return Math.sqrt(s)}var q=function t(n,e,i){var h,s,r=i.length-1;if(0===r)return 0;if(0===n){s=0;for(var a=0;a<=r;a++)s+=M[r][a]*Math.pow(1-e,r-a)*Math.pow(e,a)*i[a];return s}h=new Array(r);for(var o=0;o<r;o++)h[o]=r*(i[o+1]-i[o]);return t(n-1,e,h)},m=function(t,n,e,i,h){for(var s=1,r=t/n,a=(t-e(i,h,r))/n,o=0;s>.001;){var g=e(i,h,r+a),u=e(i,h,r-a),c=Math.abs(t-g)/n,l=Math.abs(t-u)/n;if(c<s?(s=c,r+=a):l<s?(s=l,r-=a):a/=2,++o>500)break}return r},_=function(t,e,i,h,s,r,a,o){var g=this;n(this,"a",void 0),n(this,"b",void 0),n(this,"c",void 0),n(this,"d",void 0),n(this,"length",void 0),n(this,"getArcLength",void 0),n(this,"getPoint",void 0),n(this,"getDerivative",void 0),n(this,"getTotalLength",(function(){return g.length})),n(this,"getPointAtLength",(function(t){var n=m(t,g.length,g.getArcLength,[g.a.x,g.b.x,g.c.x,g.d.x],[g.a.y,g.b.y,g.c.y,g.d.y]);return g.getPoint([g.a.x,g.b.x,g.c.x,g.d.x],[g.a.y,g.b.y,g.c.y,g.d.y],n)})),n(this,"getTangentAtLength",(function(t){var n=m(t,g.length,g.getArcLength,[g.a.x,g.b.x,g.c.x,g.d.x],[g.a.y,g.b.y,g.c.y,g.d.y]),e=g.getDerivative([g.a.x,g.b.x,g.c.x,g.d.x],[g.a.y,g.b.y,g.c.y,g.d.y],n),i=Math.sqrt(e.x*e.x+e.y*e.y);return i>0?{x:e.x/i,y:e.y/i}:{x:0,y:0}})),n(this,"getPropertiesAtLength",(function(t){var n,e=m(t,g.length,g.getArcLength,[g.a.x,g.b.x,g.c.x,g.d.x],[g.a.y,g.b.y,g.c.y,g.d.y]),i=g.getDerivative([g.a.x,g.b.x,g.c.x,g.d.x],[g.a.y,g.b.y,g.c.y,g.d.y],e),h=Math.sqrt(i.x*i.x+i.y*i.y);n=h>0?{x:i.x/h,y:i.y/h}:{x:0,y:0};var s=g.getPoint([g.a.x,g.b.x,g.c.x,g.d.x],[g.a.y,g.b.y,g.c.y,g.d.y],e);return{x:s.x,y:s.y,tangentX:n.x,tangentY:n.y}})),n(this,"getC",(function(){return g.c})),n(this,"getD",(function(){return g.d})),this.a={x:t,y:e},this.b={x:i,y:h},this.c={x:s,y:r},void 0!==a&&void 0!==o?(this.getArcLength=L,this.getPoint=w,this.getDerivative=d,this.d={x:a,y:o}):(this.getArcLength=P,this.getPoint=A,this.getDerivative=b,this.d={x:0,y:0}),this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],1)},S=function(t){var s=this;n(this,"length",0),n(this,"partial_lengths",[]),n(this,"functions",[]),n(this,"getPartAtLength",(function(t){t<0?t=0:t>s.length&&(t=s.length);for(var n=s.partial_lengths.length-1;s.partial_lengths[n]>=t&&s.partial_lengths[n]>0;)n--;return n++,{fraction:t-s.partial_lengths[n-1],i:n}})),n(this,"getTotalLength",(function(){return s.length})),n(this,"getPointAtLength",(function(t){var n=s.getPartAtLength(t),e=s.functions[n.i];if(e)return e.getPointAtLength(n.fraction);throw new Error("Wrong function at this part.")})),n(this,"getTangentAtLength",(function(t){var n=s.getPartAtLength(t),e=s.functions[n.i];if(e)return e.getTangentAtLength(n.fraction);throw new Error("Wrong function at this part.")})),n(this,"getPropertiesAtLength",(function(t){var n=s.getPartAtLength(t),e=s.functions[n.i];if(e)return e.getPropertiesAtLength(n.fraction);throw new Error("Wrong function at this part.")})),n(this,"getParts",(function(){for(var t=[],n=0;n<s.functions.length;n++)if(null!==s.functions[n]){s.functions[n]=s.functions[n];var e={start:s.functions[n].getPointAtLength(0),end:s.functions[n].getPointAtLength(s.partial_lengths[n]-s.partial_lengths[n-1]),length:s.partial_lengths[n]-s.partial_lengths[n-1],getPointAtLength:s.functions[n].getPointAtLength,getTangentAtLength:s.functions[n].getTangentAtLength,getPropertiesAtLength:s.functions[n].getPropertiesAtLength};t.push(e)}return t}));for(var g,u=function(t){var n=t.match(h);if(!n)throw new Error("No path elements found in string ".concat(t));return n.reduce((function(t,n){var h=n.charAt(0),s=h.toLowerCase(),a=r(n.substr(1));for("m"===s&&a.length>2&&(t.push([h].concat(e(a.splice(0,2)))),s="l",h="m"===h?"l":"L");a.length>=0;){if(a.length===i[s]){t.push([h].concat(e(a.splice(0,i[s]))));break}if(a.length<i[s])throw new Error('Malformed path data: "'.concat(h,'" must have ').concat(i[s]," elements and has ").concat(a.length,": ").concat(n));t.push([h].concat(e(a.splice(0,i[s]))))}return t}),[])}(t),c=[0,0],l=[0,0],f=[0,0],x=0;x<u.length;x++){if("M"===u[x][0])f=[(c=[u[x][1],u[x][2]])[0],c[1]],this.functions.push(null);else if("m"===u[x][0])f=[(c=[u[x][1]+c[0],u[x][2]+c[1]])[0],c[1]],this.functions.push(null);else if("L"===u[x][0])this.length+=Math.sqrt(Math.pow(c[0]-u[x][1],2)+Math.pow(c[1]-u[x][2],2)),this.functions.push(new a(c[0],u[x][1],c[1],u[x][2])),c=[u[x][1],u[x][2]];else if("l"===u[x][0])this.length+=Math.sqrt(Math.pow(u[x][1],2)+Math.pow(u[x][2],2)),this.functions.push(new a(c[0],u[x][1]+c[0],c[1],u[x][2]+c[1])),c=[u[x][1]+c[0],u[x][2]+c[1]];else if("H"===u[x][0])this.length+=Math.abs(c[0]-u[x][1]),this.functions.push(new a(c[0],u[x][1],c[1],c[1])),c[0]=u[x][1];else if("h"===u[x][0])this.length+=Math.abs(u[x][1]),this.functions.push(new a(c[0],c[0]+u[x][1],c[1],c[1])),c[0]=u[x][1]+c[0];else if("V"===u[x][0])this.length+=Math.abs(c[1]-u[x][1]),this.functions.push(new a(c[0],c[0],c[1],u[x][1])),c[1]=u[x][1];else if("v"===u[x][0])this.length+=Math.abs(u[x][1]),this.functions.push(new a(c[0],c[0],c[1],c[1]+u[x][1])),c[1]=u[x][1]+c[1];else if("z"===u[x][0]||"Z"===u[x][0])this.length+=Math.sqrt(Math.pow(f[0]-c[0],2)+Math.pow(f[1]-c[1],2)),this.functions.push(new a(c[0],f[0],c[1],f[1])),c=[f[0],f[1]];else if("C"===u[x][0])g=new _(c[0],c[1],u[x][1],u[x][2],u[x][3],u[x][4],u[x][5],u[x][6]),this.length+=g.getTotalLength(),c=[u[x][5],u[x][6]],this.functions.push(g);else if("c"===u[x][0])(g=new _(c[0],c[1],c[0]+u[x][1],c[1]+u[x][2],c[0]+u[x][3],c[1]+u[x][4],c[0]+u[x][5],c[1]+u[x][6])).getTotalLength()>0?(this.length+=g.getTotalLength(),this.functions.push(g),c=[u[x][5]+c[0],u[x][6]+c[1]]):this.functions.push(new a(c[0],c[0],c[1],c[1]));else if("S"===u[x][0]){if(x>0&&["C","c","S","s"].indexOf(u[x-1][0])>-1){if(g){var y=g.getC();g=new _(c[0],c[1],2*c[0]-y.x,2*c[1]-y.y,u[x][1],u[x][2],u[x][3],u[x][4])}}else g=new _(c[0],c[1],c[0],c[1],u[x][1],u[x][2],u[x][3],u[x][4]);g&&(this.length+=g.getTotalLength(),c=[u[x][3],u[x][4]],this.functions.push(g))}else if("s"===u[x][0]){if(x>0&&["C","c","S","s"].indexOf(u[x-1][0])>-1){if(g){var p=g.getC(),v=g.getD();g=new _(c[0],c[1],c[0]+v.x-p.x,c[1]+v.y-p.y,c[0]+u[x][1],c[1]+u[x][2],c[0]+u[x][3],c[1]+u[x][4])}}else g=new _(c[0],c[1],c[0],c[1],c[0]+u[x][1],c[1]+u[x][2],c[0]+u[x][3],c[1]+u[x][4]);g&&(this.length+=g.getTotalLength(),c=[u[x][3]+c[0],u[x][4]+c[1]],this.functions.push(g))}else if("Q"===u[x][0]){if(c[0]==u[x][1]&&c[1]==u[x][2]){var M=new a(u[x][1],u[x][3],u[x][2],u[x][4]);this.length+=M.getTotalLength(),this.functions.push(M)}else g=new _(c[0],c[1],u[x][1],u[x][2],u[x][3],u[x][4],void 0,void 0),this.length+=g.getTotalLength(),this.functions.push(g);c=[u[x][3],u[x][4]],l=[u[x][1],u[x][2]]}else if("q"===u[x][0]){if(0!=u[x][1]||0!=u[x][2])g=new _(c[0],c[1],c[0]+u[x][1],c[1]+u[x][2],c[0]+u[x][3],c[1]+u[x][4],void 0,void 0),this.length+=g.getTotalLength(),this.functions.push(g);else{var w=new a(c[0]+u[x][1],c[0]+u[x][3],c[1]+u[x][2],c[1]+u[x][4]);this.length+=w.getTotalLength(),this.functions.push(w)}l=[c[0]+u[x][1],c[1]+u[x][2]],c=[u[x][3]+c[0],u[x][4]+c[1]]}else if("T"===u[x][0]){if(x>0&&["Q","q","T","t"].indexOf(u[x-1][0])>-1)g=new _(c[0],c[1],2*c[0]-l[0],2*c[1]-l[1],u[x][1],u[x][2],void 0,void 0),this.functions.push(g),this.length+=g.getTotalLength();else{var d=new a(c[0],u[x][1],c[1],u[x][2]);this.functions.push(d),this.length+=d.getTotalLength()}l=[2*c[0]-l[0],2*c[1]-l[1]],c=[u[x][1],u[x][2]]}else if("t"===u[x][0]){if(x>0&&["Q","q","T","t"].indexOf(u[x-1][0])>-1)g=new _(c[0],c[1],2*c[0]-l[0],2*c[1]-l[1],c[0]+u[x][1],c[1]+u[x][2],void 0,void 0),this.length+=g.getTotalLength(),this.functions.push(g);else{var L=new a(c[0],c[0]+u[x][1],c[1],c[1]+u[x][2]);this.length+=L.getTotalLength(),this.functions.push(L)}l=[2*c[0]-l[0],2*c[1]-l[1]],c=[u[x][1]+c[0],u[x][2]+c[0]]}else if("A"===u[x][0]){var A=new o(c[0],c[1],u[x][1],u[x][2],u[x][3],1===u[x][4],1===u[x][5],u[x][6],u[x][7]);this.length+=A.getTotalLength(),c=[u[x][6],u[x][7]],this.functions.push(A)}else if("a"===u[x][0]){var P=new o(c[0],c[1],u[x][1],u[x][2],u[x][3],1===u[x][4],1===u[x][5],c[0]+u[x][6],c[1]+u[x][7]);this.length+=P.getTotalLength(),c=[c[0]+u[x][6],c[1]+u[x][7]],this.functions.push(P)}this.partial_lengths.push(this.length)}},C=function(t){var e=this;if(n(this,"inst",void 0),n(this,"getTotalLength",(function(){return e.inst.getTotalLength()})),n(this,"getPointAtLength",(function(t){return e.inst.getPointAtLength(t)})),n(this,"getTangentAtLength",(function(t){return e.inst.getTangentAtLength(t)})),n(this,"getPropertiesAtLength",(function(t){return e.inst.getPropertiesAtLength(t)})),n(this,"getParts",(function(){return e.inst.getParts()})),this.inst=new S(t),!(this instanceof C))return new C(t)};t.svgPathProperties=C,Object.defineProperty(t,"__esModule",{value:!0})}));
{
"name": "svg-path-properties",
"version": "1.0.1",
"version": "1.0.2",
"description": "Calculate the length for an SVG path, to use it with node or a Canvas element",

@@ -15,3 +15,4 @@ "keywords": [

"module": "dist/svg-path-properties.esm.js",
"browser": "dist/svg-path-properties.min.js",
"unpkg": "dist/svg-path-properties.min.js",
"jsnext:main": "dist/index",
"types": "dist/types/index.d.ts",

@@ -18,0 +19,0 @@ "repository": {

@@ -44,6 +44,6 @@ import commonjs from "rollup-plugin-commonjs";

file: pkg.module,
format: "esm"
format: "es"
},
{
file: pkg.browser,
file: pkg.unpkg,
format: "umd",

@@ -50,0 +50,0 @@ name,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc