/*! * MorphSVGPlugin 3.14.2 * https://gsap.com * * @license Copyright 2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license. * @author: Jack Doyle, jack@greensock.com */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).window=t.window||{})}(this,function(t){"use strict";function _extends(){return(_extends=Object.assign||function(t){for(var e=1;ee){for(;--a&&t[a]>e;);a<0&&(a=0)}else for(;t[++a]r&&(r=t[n],e=n);return e}function da(t,e){for(var n=[],r=[],a=t.length-2,o=0;oc[0].length&&da(c[0],(f[0].length-c[0].length)/6|0),P=c.length;dMath.abs(o[0]-i[i.length-2])+Math.abs(o[1]-i[i.length-1])+Math.abs(o[o.length-2]-i[0])+Math.abs(o[o.length-1]-i[1])||n%2)?(reverseSegment(i),M[P]=-1,x=!0):"auto"===n?M[P]=0:"reverse"===n&&(M[P]=-1),i.closed!==o.closed&&(i.closed=o.closed=!1));return w&&R("shapeIndex:["+M.join(",")+"]"),t.shapeIndex=M}}function ja(t,e,n,r,a){var o=stringToRawPath(t[0]),i=stringToRawPath(t[1]);ia(o,i,e||0===e?e:"auto",n,a)&&(t[0]=rawPathToString(o),t[1]=rawPathToString(i),"log"!==r&&!0!==r||R('precompile:["'+t[0]+'","'+t[1]+'"]'))}function la(t,e){var n,r,a,o,i,h,s,l=0,g=parseFloat(t[0]),u=parseFloat(t[1]),p=g+","+u+" ";for(n=.5*e/(.5*(a=t.length)-1),r=0;rc?a:o,sl:g,cl:M(s*s+l*l)-g,i:n}}function ua(t){n=D(),a=a||n&&n.plugins.morphSVG,n&&a?(I=n.utils.toArray,m=n.core.reverting||function(){},a.prototype._tweenRotation=ta,q=1):t&&R("Please gsap.registerPlugin(MorphSVGPlugin)")}var n,I,F,q,a,m,p=Math.atan2,v=Math.cos,P=Math.sin,M=Math.sqrt,e=Math.PI,i=2*e,f=.3*e,c=.7*e,x=1e20,G=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/gi,K=/(^[#.][a-z]|[a-y][a-z])/i,tt=/[achlmqstvz]/i,et="Use MorphSVGPlugin.convertToPath() to convert to a path before morphing.",nt={version:"3.14.2",name:"morphSVG",rawVars:1,register:function register(t,e){n=t,a=e,ua()},init:function init(t,e,n,r,a){if(q||ua(1),!e)return R("invalid shape"),!1;var o,i,h,s,l,g,u,p,f,c,d,m,v,P,_,M,x,w,y,S;if(E(e)&&(e=e.call(n,r,t,a)),"string"==typeof e||e.getBBox||e[0])e={shape:e};else if("object"==typeof e){for(i in o={},e)o[i]=E(e[i])&&"render"!==i?e[i].call(n,r,t,a):e[i];e=o}var b=t.nodeType?window.getComputedStyle(t):{},T=b.fill+"",N=!("none"===T||"0"===(T.match(G)||[])[3]||"evenodd"===b.fillRule),z=e.smooth,A=(e.origin||"50 50").split(",");if(!0===z||"auto"===z?z={}:"number"==typeof z&&(z={points:z}),l="POLYLINE"===(o=(t.nodeName+"").toUpperCase())||"POLYGON"===o,"PATH"!==o&&!l&&!e.prop)return R("Cannot morph a <"+o+"> element. "+et),!1;if(i="PATH"===o?"d":"points",!e.prop&&!E(t.setAttribute))return!1;if(s=function _parseShape(t,e,n){var r,a;return(!("string"==typeof t)||K.test(t)||(t.match(G)||[]).length<3)&&((r=I(t)[0])?(a=(r.nodeName+"").toUpperCase(),e&&"PATH"!==a&&(r=convertToPath(r,!1),a="PATH"),t=r.getAttribute("PATH"===a?"d":"points")||"",r===n&&(t=r.getAttributeNS(null,"data-original")||t)):(R("WARNING: invalid morph to: "+t),t=!1)),t}(e.shape||e.d||e.points||"","d"===i,t),l&&tt.test(s))return R("A <"+o+"> cannot accept path data. "+et),!1;if(g=e.shapeIndex||0===e.shapeIndex?e.shapeIndex:"auto",u=e.map||nt.defaultMap,this._prop=e.prop,this._render=e.render||nt.defaultRender,this._apply="updateTarget"in e?e.updateTarget:nt.defaultUpdateTarget,this._rnd=Math.pow(10,isNaN(e.precision)?2:+e.precision),this._tween=n,s){if(this._target=t,x="object"==typeof e.precompile,c=this._original=this._prop?t[this._prop]:t.getAttribute(i),this._prop||t.getAttributeNS(null,"data-original")||t.setAttributeNS(null,"data-original",c),"d"===i||this._prop){if(c=stringToRawPath(x?e.precompile[0]:c),d=stringToRawPath(x?e.precompile[1]:s),z){for(v=c.length;--v;)ga(c[v])&&c.splice(v,1);ha(c,_extends({},z,{points:+z.points||Math.max(ea(c),ea(d)),maxSegments:d.length})),ha(d,!1===z.redraw?z:_extends({},z,{points:c}))}if(!x&&!ia(c,d,g,u,N))return!1;for("log"!==e.precompile&&!0!==e.precompile||R('precompile:["'+rawPathToString(c)+'","'+rawPathToString(d)+'"]'),y="linear"!==(e.type||nt.defaultType),S=e.curveMode||y,pa(c),pa(d),y&&(c.size||V(c),d.size||V(d),w=qa(A[0]),this._origin=c.origin={x:c.left+w.x*c.width,y:c.top+w.y*c.height},A[1]&&(w=qa(A[1])),this._eOrigin={x:d.left+w.x*d.width,y:d.top+w.y*d.height}),this._rawPath=t._gsRawPath=c,v=c.length;-1<--v;){for(_=c[v],M=d[v],p=_.cpData,f=M.cpData,P=_.length,m=F=0;m element or an SVG path data string")},stringToRawPath:stringToRawPath,rawPathToString:rawPathToString,smoothRawPath:ha,normalizeStrings:function normalizeStrings(t,e,n){var r=n.shapeIndex,a=n.map,o=[t,e];return ja(o,r,a),o},pathFilter:ja,pointsFilter:ma,getTotalSize:V,equalizeSegmentQuantity:ia,convertToPath:function convertToPath$1(t,e){return I(t).map(function(t){return convertToPath(t,!1!==e)})},defaultType:"linear",defaultUpdateTarget:!0,defaultMap:"size"};D()&&n.registerPlugin(nt),t.MorphSVGPlugin=nt,t.default=nt;if (typeof(window)==="undefined"||window!==t){Object.defineProperty(t,"__esModule",{value:!0})} else {delete t.default}});