@pixodesk/svg-animator-web 1.0.10 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var e,t=Object.defineProperty,n=Object.defineProperties,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,u=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,c=(e,t)=>{for(var n in t||(t={}))l.call(t,n)&&u(e,n,t[n]);if(s)for(var n of s(t))a.call(t,n)&&u(e,n,t[n]);return e},f=(e,t)=>n(e,o(t)),d={};((e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})})(d,{COLOUR_ATTR_NAMES:()=>Z,PX_ANIM_ATTR_NAME:()=>h,PX_ANIM_SRC_ATTR_NAME:()=>p,STYLE_ATTR_NAMES:()=>X,TRANSFORM_FN_NAMES:()=>G,calcAnimationValues:()=>Ae,camelCaseToKebabWordIfNeeded:()=>Q,createAnimator:()=>Re,createAnimatorImpl:()=>Ne,createBasicFrameLoopAnimator:()=>xe,createFrameLoopAnimator:()=>ke,createWebApiAnimator:()=>Se,generateNewIds:()=>Oe,getAnimatorConfig:()=>E,getBindings:()=>R,getChildren:()=>P,getDefs:()=>N,getNormalizedProps:()=>se,isPxElementFileFormat:()=>b,isPxElementFileFormatDeep:()=>O,loadTagAnimators:()=>Pe,normalizeDocument:()=>ye,renderNode:()=>le,setupAnimationTriggers:()=>ae,toRGBA:()=>V}),module.exports=(e=d,((e,n,o,s)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let a of i(n))l.call(e,a)||a===o||t(e,a,{get:()=>n[a],enumerable:!(s=r(n,a))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var p="data-px-animation-src",h="_px_animator",m="animate",v="text",g="textContent",y=new Set(["type","children",m,"animator","meta","defs","bindings",v,g]);function b(e){return!(!e||"object"!=typeof e||Array.isArray(e))&&("svg"===e.type||"svg"===e.tagName)}function A(e){return e&&"object"==typeof e&&!Array.isArray(e)}function w(e,t,n){return"string"==typeof e||(!(!Array.isArray(e)||4!==e.length||!e.every(e=>"number"==typeof e))||(n.push(t+": invalid easing, expected string or [number, number, number, number]"),!1))}function x(e,t,n){if(!A(e))return n.push(t+": expected object"),!1;let r=!0;return void 0!==e.time&&"number"!=typeof e.time&&(n.push(t+".time: expected number, got "+typeof e.time),r=!1),void 0!==e.t&&"number"!=typeof e.t&&(n.push(t+".t: expected number, got "+typeof e.t),r=!1),void 0===e.easing||w(e.easing,t+".easing",n)||(r=!1),void 0===e.e||w(e.e,t+".e",n)||(r=!1),r}function k(e,t,n){if(!A(e))return n.push(t+": expected object"),!1;let r=!0;return void 0!==e.keyframes&&(Array.isArray(e.keyframes)?e.keyframes.forEach((e,o)=>{x(e,t+".keyframes["+o+"]",n)||(r=!1)}):(n.push(t+".keyframes: expected array"),r=!1)),void 0!==e.kfs&&(Array.isArray(e.kfs)?e.kfs.forEach((e,o)=>{x(e,t+".kfs["+o+"]",n)||(r=!1)}):(n.push(t+".kfs: expected array"),r=!1)),r}function j(e,t,n){if(!A(e))return n.push(t+": expected object"),!1;let r=!0;for(const o of Object.keys(e))k(e[o],t+"."+o,n)||(r=!1);return r}function T(e,t,n){if("string"==typeof e)return!0;if(Array.isArray(e)){let r=!0;return e.forEach((e,o)=>{"string"==typeof e||j(e,t+"["+o+"]",n)||(r=!1)}),r}return A(e)?j(e,t,n):(n.push(t+": expected string, array, or PxAnimationDefinition object"),!1)}function S(e,t,n){if(!A(e))return n.push(t+": expected object"),!1;let r=!0;return void 0===e.mode||["auto","webapi","frames"].includes(e.mode)||(n.push(t+'.mode: invalid value "'+e.mode+"\", expected 'auto'|'webapi'|'frames'"),r=!1),void 0!==e.duration&&"number"!=typeof e.duration&&(n.push(t+".duration: expected number, got "+typeof e.duration),r=!1),void 0!==e.delay&&"number"!=typeof e.delay&&(n.push(t+".delay: expected number, got "+typeof e.delay),r=!1),void 0!==e.iterations&&"number"!=typeof e.iterations&&"infinite"!==e.iterations&&(n.push(t+".iterations: expected number or 'infinite', got "+typeof e.iterations),r=!1),void 0===e.fill||function(e,t,n){return"forwards"===e||"backwards"===e||"both"===e||"none"===e||(n.push(t+': invalid FillMode "'+e+"\", expected 'forwards'|'backwards'|'both'|'none'"),!1)}(e.fill,t+".fill",n)||(r=!1),void 0===e.direction||function(e,t,n){return"normal"===e||"reverse"===e||"alternate"===e||"alternate-reverse"===e||(n.push(t+': invalid PlaybackDirection "'+e+"\", expected 'normal'|'reverse'|'alternate'|'alternate-reverse'"),!1)}(e.direction,t+".direction",n)||(r=!1),void 0!==e.frameRate&&"number"!=typeof e.frameRate&&(n.push(t+".frameRate: expected number, got "+typeof e.frameRate),r=!1),void 0===e.trigger||function(e,t,n){if(!A(e))return n.push(t+": expected object"),!1;let r=!0;const o=["load","mouseOver","click","scrollIntoView","programmatic"];if(o.includes(e.startOn)||(n.push(t+'.startOn: invalid value "'+e.startOn+'", expected '+o.join("|")),r=!1),void 0!==e.outAction){const o=["continue","pause","reset","reverse"];o.includes(e.outAction)||(n.push(t+'.outAction: invalid value "'+e.outAction+'", expected '+o.join("|")),r=!1)}return void 0!==e.scrollIntoViewThreshold&&"number"!=typeof e.scrollIntoViewThreshold&&(n.push(t+".scrollIntoViewThreshold: expected number, got "+typeof e.scrollIntoViewThreshold),r=!1),r}(e.trigger,t+".trigger",n)||(r=!1),r}function C(e,t,n){if(!A(e))return n.push(t+": expected object"),!1;let r=!0;return"string"!=typeof e.type&&(n.push(t+".type: expected string, got "+typeof e.type),r=!1),void 0!==e.children&&(Array.isArray(e.children)?e.children.forEach((e,o)=>{C(e,t+".children["+o+"]",n)||(r=!1)}):(n.push(t+".children: expected array"),r=!1)),void 0===e.animate||T(e.animate,t+".animate",n)||(r=!1),r}function M(e,t,n){if(!C(e,t,n))return!1;let r=!0;return"svg"!==e.type&&(n.push(t+".type: expected 'svg', got '"+e.type+"'"),r=!1),void 0!==e.width&&"number"!=typeof e.width&&(n.push(t+".width: expected number, got "+typeof e.width),r=!1),void 0!==e.height&&"number"!=typeof e.height&&(n.push(t+".height: expected number, got "+typeof e.height),r=!1),void 0!==e.viewBox&&"string"!=typeof e.viewBox&&(n.push(t+".viewBox: expected string, got "+typeof e.viewBox),r=!1),void 0===e.animator||S(e.animator,t+".animator",n)||(r=!1),void 0===e.defs||function(e,t,n){if(!A(e))return n.push(t+": expected object"),!1;let r=!0;if(void 0!==e.easings)if(A(e.easings))for(const o of Object.keys(e.easings))w(e.easings[o],t+".easings."+o,n)||(r=!1);else n.push(t+".easings: expected object"),r=!1;if(void 0!==e.animations)if(A(e.animations))for(const o of Object.keys(e.animations))j(e.animations[o],t+".animations."+o,n)||(r=!1);else n.push(t+".animations: expected object"),r=!1;return void 0===e.styles||A(e.styles)||(n.push(t+".styles: expected object"),r=!1),r}(e.defs,t+".defs",n)||(r=!1),void 0!==e.bindings&&(Array.isArray(e.bindings)?e.bindings.forEach((e,o)=>{(function(e,t,n){if(!A(e))return n.push(t+": expected object"),!1;let r=!0;return"string"!=typeof e.id&&(n.push(t+".id: expected string, got "+typeof e.id),r=!1),T(e.animate,t+".animate",n)||(r=!1),r})(e,t+".bindings["+o+"]",n)||(r=!1)}):(n.push(t+".bindings: expected array"),r=!1)),void 0===e.design||C(e.design,t+".design",n)||(r=!1),r}function O(e){const t=[];return{valid:M(e,"root",t),errors:t}}function E(e){var t,n;return(null==e?void 0:e.animator)||(null==(t=null==e?void 0:e.meta)?void 0:t.animator)||(null==e?void 0:e.animation)||(null==(n=null==e?void 0:e.meta)?void 0:n.animation)}function N(e){var t;if(e)return e.defs||(null==(t=e.meta)?void 0:t.defs)}function R(e){var t;if(e)return e.bindings||(null==(t=e.meta)?void 0:t.bindings)}function P(e){return null==e?void 0:e.children}function F(e,t,n){return e+(t-e)*n}function I(e,t,n){const r=[],o=Math.max(e.length,t.length);for(let i=0;i<o;i++)r[i]=F(e[i]||0,t[i]||0,n);return r}function L(e,t,n){return[F(e[0]||0,t[0]||0,n),F(e[1]||0,t[1]||0,n),F(e[2]||0,t[2]||0,n),F(void 0===e[3]?1:e[3],void 0===t[3]?1:t[3],n)]}function _(e,t,n){const r=Math.max(e.length,t.length),o=[];for(let i=0;i<r;i++)o.push(D(e[i],t[i],n));return o}function D(e,t,n){var r,o,i,s,l,a,u,c,f;if(!e||!t)return e||t||{v:[]};const d=Math.min(Math.max(n,0),1),p=Math.min(e.v.length,t.v.length),h=[],m=[],v=[];for(let n=0;n<p;n++){const f=e.v[n],p=t.v[n];h.push(I(f,p,d));const g=null!=(o=null==(r=e.i)?void 0:r[n])?o:f,y=null!=(s=null==(i=t.i)?void 0:i[n])?s:p;m.push(I(g,y,d));const b=null!=(a=null==(l=e.o)?void 0:l[n])?a:f,A=null!=(c=null==(u=t.o)?void 0:u[n])?c:p;v.push(I(b,A,d))}return{v:h,i:m.length?m:void 0,o:v.length?v:void 0,c:null!=(f=e.c)?f:t.c}}function U(e,t,n){if(n<=0)return 0;if(n>=1)return 1;const r=3*e,o=3*(t-e)-r,i=1-r-o;function s(e){return((i*e+o)*e+r)*e}function l(e){return(3*i*e+2*o)*e+r}let a=n,u=0,c=1;for(let e=0;e<8;e++){const e=s(a)-n;if(Math.abs(e)<1e-6)return a;const t=l(a);if(Math.abs(t)<1e-6)break;a-=e/t}for(a=n;u<c;){const e=s(a);if(Math.abs(e-n)<1e-6)return a;n>e?u=a:c=a,a=(c+u)/2}return a}function z(e){const[t,n,r,o]=e,i=3*n,s=3*(o-n)-i,l=1-i-s;return function(e){return n=U(t,r,e),((l*n+s)*n+i)*n;var n}}function W(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function q(e,t){if(!e)return{left:void 0,right:void 0};if(t<=0)return{left:void 0,right:e};if(t>=1)return{left:e,right:void 0};const[n,r,o,i]=e,s=U(n,o,t),l=[n,r],a=[o,i],{left:u,right:c}=function(e,t,n,r,o){const i=W(e,t,o),s=W(t,n,o),l=W(n,r,o),a=W(i,s,o),u=W(s,l,o),c=W(a,u,o);return{left:[e,i,a,c],right:[c,u,l,r]}}([0,0],l,a,[1,1],s),f=u[3][0],d=u[3][1];let p,h;f>1e-9&&Math.abs(d)>1e-9&&(p=[u[1][0]/f,u[1][1]/d,u[2][0]/f,u[2][1]/d]);const m=1-f,v=1-d;return m>1e-9&&Math.abs(v)>1e-9&&(h=[(c[1][0]-f)/m,(c[1][1]-d)/v,(c[2][0]-f)/m,(c[2][1]-d)/v]),{left:p,right:h}}function B(e){if(e)return[1-e[2],1-e[3],1-e[0],1-e[1]]}function V(e){const t=Math.round(255*e[0]),n=Math.round(255*e[1]),r=Math.round(255*e[2]);return 4===e.length?"rgba("+t+","+n+","+r+","+e[3]+")":"rgb("+t+","+n+","+r+")"}function K(e){if(e){if(Array.isArray(e))return e;if("string"==typeof e)return e.startsWith("#")?function(e){const t=e.slice(1),n=t.length<=4,r=n?t[0]+t[0]:t.slice(0,2),o=n?t[1]+t[1]:t.slice(2,4),i=n?t[2]+t[2]:t.slice(4,6),s=4===t.length?t[3]+t[3]:8===t.length?t.slice(6,8):null,l=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==s&&l.push(parseInt(s,16)/255),l}(e):e.startsWith("rgb")?function(e){var t;const n=null==(t=e.match(/rgba?\((.*)\)/))?void 0:t[1];if(!n)throw new Error("Invalid rgb/rgba format");const r=n.split(",").map(e=>+e.trim());return[r[0]/255,r[1]/255,r[2]/255,...void 0!==r[3]?[r[3]]:[]]}(e):void console.warn("Unsupported color format: "+e)}}var Z=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),G=new Set(["translate","rotate","scale","skew"]),$=new Set(["offset-distance","offsetDistance"]),X=new Set(["offset-distance","offsetDistance"]),Y=1e3;var H=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function Q(e){return H.has(e)?e:e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function J(e,t,n){return Math.max(t,Math.min(e,n))}var ee="http://www.w3.org/2000/svg",te=new Set(["svg","g","path","circle","ellipse","rect","line","polyline","polygon","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker","filter","feGaussianBlur","feOffset","feBlend","feColorMatrix","feMerge","feMergeNode"].map(e=>e.toLowerCase())),ne=["href","src","filter","clipPath","mask","markerStart","markerMid","markerEnd"],re=new Set(ne),oe=new Set(["href","src","fill","stroke","strokeWidth","opacity","transform","x","y","cx","cy","r","rx","ry","width","height","d","x1","y1","x2","y2","points","fontSize","fontFamily","textAnchor","id","class","viewBox","preserveAspectRatio","offset","stopColor","stopOpacity","gradientTransform","clipPath","mask","filter","stdDeviation","in","in2","result","mode",...ne]);function ie(e,t){const n=e.toLowerCase();if(oe.has(n)){if("fill"===n||"stroke"===n||"stopColor"===n){const e=String(t);return e.includes("url(")&&!/^url\(#[^)]+\)$/.test(e)?void console.warn('Attribute "'+n+'" blocked: url() references must be internal url(#id), got:',t):t}if(re.has(n)){const e=String(t);return e.startsWith("#")||/^url\(#[^)]+\)$/.test(e)?t:void 0}return t}console.warn("Attribute not in whitelist: ",n)}function se(e){const t={};for(const n of Object.keys(e)){if(y.has(n))continue;if("style"===n)continue;let r=e[n];Z.has(n)&&Array.isArray(r)?t[n]=V(r):G.has(n)?(Array.isArray(r)&&("translate"===n&&(r=r.map(e=>e+"px")),r=r.join(",")),"rotate"===n&&(r+="deg"),t.transform=n+"("+r+")"):null!=r&&(t[n]=String(r))}return t}function le(e,t){if(!e)return null;const n=e,{type:r,children:o,animate:i,style:u}=n,c=((e,t)=>{var n={};for(var r in e)l.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&s)for(var r of s(e))t.indexOf(r)<0&&a.call(e,r)&&(n[r]=e[r]);return n})(n,["type","children","animate","style"]),f=e.defs||t,d=function(e,t){var n;if(e)return"string"==typeof e?null==(n=null==t?void 0:t.styles)?void 0:n[e]:e}(u,f);let p;if(o)for(const e of o){const t=le(e,f);t&&(p||(p=[]),p.push(t))}return function(e,t,n,r,o){if(!te.has(e.toLowerCase()))return null;const i=document.createElementNS(ee,e);for(const e in t)i.setAttribute(Q(e),ie(e,t[e]));if(n)for(const e in n)i.style[e]=String(n[e]);if(r)for(const e of r)i.appendChild(e);return o&&(i.textContent=o),i}(r||"g",se(c),d,p,c[v]||c[g])}function ae(e,t){const{startOn:n,outAction:r="continue",scrollIntoViewThreshold:o=.5}=t,i=e.getRootElement();if(!i)return console.warn("setupAnimationTriggers: No root element found for animation."),e;const s=()=>{e.play()},l=()=>{switch(r){case"pause":e.pause();break;case"reset":e.cancel();break;case"reverse":e.play()}};switch(n){case"load":{const e=()=>s();"complete"===document.readyState?e():window.addEventListener("load",e,{once:!0});break}case"mouseOver":{const e=()=>s(),t=()=>l();i.addEventListener("mouseenter",e),i.addEventListener("mouseleave",t);break}case"click":{const t=()=>{e.isPlaying()?l():s()};i.addEventListener("click",t);break}case"scrollIntoView":new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&e.intersectionRatio>=o?s():l()})},{threshold:o}).observe(i);break}return e}function ue(e){const t=[];let n;const r=function(e){const t=e.split(/([MLCZmlcz]|[\s,]+)/).map(e=>e.trim()).filter(e=>e&&","!==e),n=[];let r=null;for(const e of t)if(/[MLCZmlcz]/.test(e))r={type:e,values:[]},n.push(r);else if(r){const t=+e;r.values.push(Number.isNaN(t)?0:t)}return n}(e);for(const e of r){const r=e.type,o=e.values;if("M"===r||"m"===r){const e=o[0]||0,r=o[1]||0;n={v:[[e,r]],i:[[e,r]],o:[[e,r]],c:!1},t.push(n);continue}if(n||(n={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},t.push(n)),"L"===r){const e=o[0]||0,t=o[1]||0;n.v.push([e,t]),n.i.push([e,t]),n.o.push([e,t])}else if("C"===r){const e=o[0]||0,t=o[1]||0,r=o[2]||0,i=o[3]||0,s=o[4]||0,l=o[5]||0;n.o[n.o.length-1]=[e,t],n.v.push([s,l]),n.i.push([r,i]),n.o.push([s,l])}else"Z"!==r&&"z"!==r||(n.c=!0)}return t}function ce(e){return e.startsWith("path(")&&e.endsWith(")")?e.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(e)?e:void 0}function fe(e){return"string"==typeof e&&void 0!==ce(e)}function de(e){if(e&&"object"==typeof e&&"paths"in e){const t=e.paths;if(Array.isArray(t)&&t.length>0&&fe(t[0])){const e=[];for(const n of t){const t=ce(n);t&&e.push(...ue(t))}return{paths:e}}return e}if(Array.isArray(e)){if(e.length>0&&fe(e[0])){const t=[];for(const n of e){const e=ce(n);e&&t.push(...ue(e))}return{paths:t}}return{paths:e}}if(fe(e)){return{paths:ue(ce(e))}}return e}function pe(e,t){var n;if(e)return Array.isArray(e)?e:(null==(n=null==t?void 0:t.easings)?void 0:n[e])?t.easings[e]:void console.warn("Unknown easing name: "+e)}function he(e,t){var n;if("string"==typeof e){const r=null==(n=null==t?void 0:t.animations)?void 0:n[e];return r||console.warn("Unknown animation name: "+e),r}return e}function me(e,t,n,r){var o,i;if("d"===e){return{paths:_(null!=(o=null==t?void 0:t.paths)?o:Array.isArray(t)?t:[],null!=(i=null==n?void 0:n.paths)?i:Array.isArray(n)?n:[],r)}}return Z.has(e)?L(t||[0,0,0,1],n||[0,0,0,1],r):G.has(e)||"stroke-dasharray"===e||"strokeDasharray"===e?I(t||[],n||[],r):F(+(t||0),+(n||0),r)}function ve(e,t,n,r){var o,i,s,l,a;const u=t.keyframes||t.kfs||[],c=[];for(const t of u){const n=null!=(i=null!=(o=t.time)?o:t.t)?i:0;let u=null!=(s=t.value)?s:t.v;const f=null!=(l=t.easing)?l:t.e;"d"===e&&(u=de(u)),Z.has(e)&&(u=null!=(a=K(u))?a:u),c.push({t:n,v:u,e:pe(f,r)})}c.sort((e,t)=>{var n,r;return(null!=(n=e.t)?n:0)-(null!=(r=t.t)?r:0)});const f=t.loop,d=!0===f?{}:f||void 0;return d&&c.length>=2?function(e,t,n,r){var o,i,s,l,a;const u=t.length-1,c=J(null!=(o=n.segmentCount)?o:u,1,u);let f;f=n.before?t.slice(0,c+1):t.slice(u-c);const d=null!=(i=t[0].t)?i:0,p=null!=(s=t[t.length-1].t)?s:0;let h,m;n.before?(h=0,m=d):(h=p,m=r);const v=m-h;if(v<=0)return t;const g=null!=(l=f[0].t)?l:0,y=(null!=(a=f[f.length-1].t)?a:0)-g;if(y<=0)return t;const b=f.map(e=>({relT:(e.t-g)/y,v:e.v,e:e.e})),A=Math.floor(v/y),w=(v-A*y)/y,x=[];function k(t,n,r){let o;if(n){o=[];for(let e=b.length-1;e>=0;e--)o.push({relT:1-b[e].relT,v:b[e].v,e:e>0?B(b[e-1].e):void 0})}else o=b;const i=void 0!==r?r:1;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT>i+1e-9){const s=o[n-1],l=r.relT-s.relT,a=(i-s.relT)/l,u=s.e?z(s.e)(a):a,c=me(e,s.v,r.v,u),{left:f}=q(s.e,a);return x.length>0&&s.relT<=i&&(x[x.length-1].e=f),void x.push({t:t+i*y,v:c,e:void 0})}x.push({t:t+r.relT*y,v:r.v,e:n<o.length-1?r.e:void 0})}}for(let e=0;e<A;e++){const t=n.before?A-1-e:e,r=!!n.alternate&&t%2==0;k(h+e*y,r)}if(w>1e-9){const e=!!n.alternate&&A%2==0;k(h+A*y,e,w)}return n.before?[...x,...t]:[...t,...x]}(e,c,d,n):c}var ge=0;function ye(e){const t=E(e)||{},n=N(e),r=t.duration||1e3,o=[],i=(e,t)=>{if(!t)return null;const o=function(e,t){if(!e)return[];const n=[];if("string"==typeof e){const r=he(e,t);r&&n.push(r)}else if(Array.isArray(e))for(const r of e){const e=he(r,t);e&&n.push(e)}else n.push(e);return n}(t,n);if(0===o.length)return null;const i=function(e,t,n){const r={};for(const[o,i]of Object.entries(e)){const e=ve(o,i,t,n);e.length>0&&(r[o]={kfs:e})}return r}(function(e){const t={};for(const n of e)for(const[e,r]of Object.entries(n))t[e]=r;return t}(o),r,n);return 0===Object.keys(i).length?null:{id:e,animate:i}},s=R(e);if(s)for(const e of s){const t=i(e.id,e.animate);t&&o.push(t)}const l=e=>{if(e.animate){const t=e.id||"_px_el_"+ ++ge;e.id=t;const n=i(t,e.animate);n&&o.push(n)}if(e.children)for(let t=0;t<e.children.length;t++)l(e.children[t])};if(e.children)for(let t=0;t<e.children.length;t++)l(e.children[t]);return o}function be(e,t,n){var r,o,i,s,l,a,u;const c=t.kfs||t.keyframes||[];if(0===c.length)return null;const{prevKf:f,nextKf:d}=function(e,t){var n,r;let o=e[0],i=e[e.length-1];for(let s=0;s<e.length-1;s++){const l=null!=(n=e[s].t)?n:0,a=null!=(r=e[s+1].t)?r:0;if(l<=t&&t<=a){o=e[s],i=e[s+1];break}}return{prevKf:o,nextKf:i}}(c,n);let p=f===d?0:(h=n,m=null!=(r=f.t)?r:0,v=null!=(o=d.t)?o:0,g=0,y=1,v===m?g:g+(h-m)/(v-m)*(y-g));var h,m,v,g,y;p=J(p,0,1);const b=null!=(i=f.e)?i:f.easing;if(b&&Array.isArray(b))try{p=z(b)(p)}catch(e){}let A=!(w=e).includes("-")&&/[a-z][A-Z]/.test(w)?Q(e):e;var w;let x=null;const k=null!=(s=null==f?void 0:f.v)?s:null==f?void 0:f.value,j=null!=(l=null==d?void 0:d.v)?l:null==d?void 0:d.value;if("d"===A){x=_(null!=(a=null==k?void 0:k.paths)?a:Array.isArray(k)?k:[],null!=(u=null==j?void 0:j.paths)?u:Array.isArray(j)?j:[],p).map(e=>function(e){var t,n,r,o;const i=e.v,s=e.i,l=e.o,a=e.c;if(!i.length)return"";const u=[],c=i.length;u.push("M"+i[0][0]+","+i[0][1]);for(let e=1;e<c;e++){const r=i[e-1],o=null!=(t=null==l?void 0:l[e-1])?t:r,a=null!=(n=null==s?void 0:s[e])?n:i[e],c=i[e];o[0]===r[0]&&o[1]===r[1]&&a[0]===c[0]&&a[1]===c[1]?u.push("L"+c[0]+","+c[1]):u.push("C"+o[0]+","+o[1]+","+a[0]+","+a[1]+","+c[0]+","+c[1])}if(a&&c>0){const e=i[c-1],t=null!=(r=null==l?void 0:l[c-1])?r:e,n=null!=(o=null==s?void 0:s[0])?o:i[0],a=i[0];t[0]===e[0]&&t[1]===e[1]&&n[0]===a[0]&&n[1]===a[1]||u.push("C"+t[0]+","+t[1]+","+n[0]+","+n[1]+","+a[0]+","+a[1]),u.push("z")}return u.join("")}(e)).join("")}else if(Z.has(A))x=V(L(k||[0,0,0,1],j||[0,0,0,1],p)),A=e;else if("stroke-dasharray"===A)x=I(k||[],j||[],p).join(" "),A=e;else if("translate"===A){x="translate("+I(k||[0,0],j||[0,0],p).join(",")+")",A="transform"}else if("rotate"===A){x="rotate("+F(+(k||0),+(j||0),p)+")",A="transform"}else if("scale"===A){x="scale("+I(k||[1,1],j||[1,1],p).join(",")+")",A="transform"}else{x=F(+(k||0),+(j||0),p)}return $.has(A)&&"number"==typeof x&&(x=100*x+"%"),{k:A,v:null===x?"":""+x}}function Ae(e,t){const n={};for(const[r,o]of Object.entries(e)){const e=be(r,o,t);e&&(n[e.k]=e.v)}return n}function we(e){return"#"+e}function xe(e,t,n){const r=E(e)||{},o=ye(e),i=r.iterations;let s=1;"number"==typeof i&&(s=i||1),"infinite"===i&&(s=1/0),s<1&&(s=1);const l=+(r.duration||Y),a=l&&s?l*(s===1/0?1/0:s):l?(null!=s?s:1)*l:0,u=r.direction||"normal";let c=null,f=!1,d=r.delay||0,p=0,h=1,m=!1;const v=r.frameRate,g=v&&v>0?1e3/v:0;let y=0;const b=()=>{const e=p?(Date.now()-p)*h:0;let t=d+e;return Number.isFinite(a)&&t>a&&(t=a),t<0&&(t=0),t};function A(e){let n=function(){const t=l>0?l:1;let n=0,r=0;if(l>0){e=J(e,0,s*t),r=Math.max(0,Math.ceil(e/t)-1),r=Math.min(r,s-1);n=J((e-r*t)/t,0,1)}else n=e;const o=u||"normal";let i=n;return"reverse"===o?i=1-n:"alternate"===o?r%2==1&&(i=1-n):"alternate-reverse"===o&&r%2==0&&(i=1-n),i}();for(const e of o||[]){const r=e.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",e);continue}const o=Ae(r,n*l);for(const[n,r]of Object.entries(o))t.setAttribute(e.id,n,r)}}r.delay&&A(b());const w=()=>!!f&&(!!t.isConnected()&&!(Number.isFinite(a)&&b()>=a)),x=e=>{null!==c&&(cancelAnimationFrame(c),c=null),(e||w())&&(c=requestAnimationFrame(()=>{c=null,(()=>{var e;if(!t.isConnected())return void k();const r=b();if(g>0){const e=Date.now();if(y&&e-y<g)return;y=e}if(a&&Number.isFinite(a)&&r>=a)return A(a),m||(m=!0,null==(e=null==n?void 0:n.onFinish)||e.call(n)),void k();A(r)})(),x()}))},k=()=>{f&&(d=b(),p=0,f=!1,null!==c&&(cancelAnimationFrame(c),c=null),A(d))},j={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>w(),play:()=>{var e;f||(f=!0,p=Date.now(),x(!0)),null==(e=null==n?void 0:n.onPlay)||e.call(n)},pause:()=>{var e;k(),null==(e=null==n?void 0:n.onPause)||e.call(n)},cancel:()=>{var e;k(),d=0,p=0,f=!1,m=!1,A(d),null==(e=null==n?void 0:n.onCancel)||e.call(n)},finish:()=>{((e=!0)=>{var t;d=Number.isFinite(a)?a:b(),p=0,f=!1,A(d),e&&!m&&(m=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n))})(!0)},setPlaybackRate:e=>{if(!isFinite(e)||0===e)return void console.warn("setPlaybackRate: rate must be finite and non-zero");const t=b();h=e,d=t,f&&(p=Date.now())},getCurrentTime:()=>b(),setCurrentTime:e=>{e<0&&(e=0),Number.isFinite(a)&&e>a&&(e=a),d=e,f&&(p=Date.now()),A(b())},destroy:()=>{j.cancel()}};return j}function ke(e,t,n,r){const o=E(e)||{};if(!r)if(e.id){const t=we(e.id);(r=document.querySelector(t))||console.warn("createFrameLoopAnimator: No root element found for selector: ",t)}else console.warn("createFrameLoopAnimator: No root element provided");let i=xe(e,t||function(e){const t=new Set,n={isConnected:()=>!e||e.isConnected,setAttribute:(n,r,o)=>{r=Q(r);const i=we(n),s=(null==e?void 0:e.querySelectorAll(i))||document.querySelectorAll(i);0!==s.length||t.has(i)||(t.add(i),console.warn('setAttribute: No elements found for selector "'+i+'"'));for(let e=0;e<s.length;e++){const t=s[e];t.setAttribute(r,o),X.has(r)&&(t.style[r]=o)}}};return n}(r),n);return i=f(c({},i),{getRootElement:()=>r||null}),o.trigger&&ae(i,o.trigger),i}function je(e,t,n,r){var o,i;let s=null!=(o=e.v)?o:e.value;const l=null!=(i=e.e)?i:e.easing,a={offset:t,easing:l&&Array.isArray(l)?"cubic-bezier("+l.join(",")+")":void 0};let u,c=n;var f;return Z.has(n)&&Array.isArray(s)?u=V(s):G.has(n)?(Array.isArray(s)&&("translate"===n&&(s=s.map(e=>e+"px")),s=s.join(",")),"rotate"===n&&(s+="deg"),u=n+"("+s+")",c="transform"):u=""+s,CSS.supports(c,u)||r.add(c),c=(f=c).includes("-")?f.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()):f,a[c]=u,a}function Te(e,t,n){var r,o;const i=new Map;for(const[s,l]of Object.entries(e)){const e=l.kfs||l.keyframes||[],a=[];for(let i=0;i<e.length;i++){const l=e[i];let u=null!=(o=null!=(r=l.t)?r:l.time)?o:0;u=J(u/(n.duration||1),0,1);const d=je(l,u,s,t);0===i&&(d.offset||0)>0&&a.push(f(c({},d),{offset:0})),a.push(d),i===e.length-1&&(d.offset||0)<1&&a.push(f(c({},d),{offset:1}))}a.length>0&&i.set(s,a)}return i}function Se(e,t,n,r){const o=E(e)||{},i=ye(e);if(!n)if(e.id){const t=we(e.id);(n=document.querySelector(t))||console.warn("createFrameLoopAnimator: No root element found for selector: ",t)}else console.warn("createFrameLoopAnimator: No root element provided");const s=[],l=o.iterations;let a;"number"==typeof l&&(a=l),"infinite"===l&&(a=1/0);const u=new Set;(null==i?void 0:i.length)||console.warn("createWebApiAnimator: No animation bindings defined");for(const e of i||[]){const r=e.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("createWebApiAnimator: Empty or unresolved binding",e);continue}const i=we(e.id),l=(null==n?void 0:n.querySelectorAll(i))||document.querySelectorAll(i);0===l.length&&console.warn('createWebApiAnimator: No elements found for selector "'+i+'"');const c=Te(r,u,o),f=o.delay&&o.delay>0?o.delay:void 0,d=o.delay&&o.delay<0&&o.duration?-o.delay%o.duration:void 0,p={duration:o.duration,delay:f,fill:o.fill,direction:o.direction,iterations:a};for(let e=0;e<l.length;e++){const n=l[e];for(const[,e]of c)if(e.length>0)try{const r=new KeyframeEffect(n,e,p),o=new Animation(r,document.timeline);(null==t?void 0:t.onFinish)&&(o.onfinish=()=>{var e;return null==(e=t.onFinish)?void 0:e.call(t)}),(null==t?void 0:t.onRemove)&&(o.onremove=()=>{var e;return null==(e=t.onRemove)?void 0:e.call(t)}),d&&(o.currentTime=d),s.push(o)}catch(e){console.warn(e)}}}if(!r&&u.size)return console.warn("Unsupported CSS attrs: "+[...u].join(", ")),null;const c={isReady:()=>!0,getRootElement:()=>n||null,isPlaying:()=>{var e;return"running"===(null==(e=s[0])?void 0:e.playState)},play:()=>{var e;s.forEach(e=>e.play()),null==(e=null==t?void 0:t.onPlay)||e.call(t)},pause:()=>{var e;s.forEach(e=>e.pause()),null==(e=null==t?void 0:t.onPause)||e.call(t)},cancel:()=>{var e;s.forEach(e=>e.cancel()),null==(e=null==t?void 0:t.onCancel)||e.call(t)},finish:()=>{var e;for(const t of s)try{(null==(e=t.effect)?void 0:e.getTiming().iterations)===1/0?(t.effect.updateTiming({iterations:1}),t.finish(),t.effect.updateTiming({iterations:1/0})):t.finish()}catch(e){t.cancel()}},setPlaybackRate:e=>(s.forEach(t=>t.playbackRate=e),c),getCurrentTime:()=>{var e,t;const n=null!=(t=null==(e=s[0])?void 0:e.currentTime)?t:null;return null!==n?+n:null},setCurrentTime:e=>{s.forEach(t=>{t.currentTime=e})},destroy:()=>{c.cancel(),s.splice(0,s.length)}};return o.trigger&&ae(c,o.trigger),c}var Ce=0;function Me(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(e=>Me(e));const t=e,n={};for(const e of Object.keys(t))n[e]=Me(t[e]);return n}function Oe(e){const t=Me(e),n=new Map,r=new Set(["href","xlink:href"]),o=new Set(["fill","stroke","clip-path","clipPath","mask","marker","marker-start","marker-mid","marker-end","filter","flood-color","lighting-color"]),i=new Set(["baseId","targetId","boundElementId"]);!function e(t){if(t&&"object"==typeof t){if(t.id&&"string"==typeof t.id){const e=t.id,r="_px_"+Date.now().toString(36)+(++Ce).toString(36)+Math.random().toString(36).substring(2,6);n.set(e,r),t.id=r}if(Array.isArray(t.children))for(const n of t.children)e(n)}}(t),function e(t){if(t&&"object"==typeof t)for(const[s,l]of Object.entries(t))if("children"!==s)if("string"==typeof l)if(r.has(s)&&l.startsWith("#")){const e=l.slice(1),r=n.get(e);r&&(t[s]="#"+r)}else if(o.has(s))t[s]=Ee(l,n);else if(i.has(s)){const e=n.get(l);e&&(t[s]=e)}else l.includes("url(#")&&(t[s]=Ee(l,n));else if("style"===s&&"object"==typeof l&&null!==l)for(const[e,t]of Object.entries(l))"string"==typeof t&&(l[e]=Ee(t,n));else"object"==typeof l&&null!==l&&s!==m&&e(l);else if(Array.isArray(l))for(const t of l)e(t)}(t);const s=t.bindings;if(Array.isArray(s))for(const e of s)if(e.id){const t=n.get(e.id);t&&(e.id=t)}return t}function Ee(e,t){return e.replace(/url\(#([^)]+)\)/g,(e,n)=>{const r=t.get(n);return r?"url(#"+r+")":e})}function Ne(e,t,n,r){(E(e)||{}).debug=!0;let o=null;if(r&&e.children){e=Oe(e);const t="string"==typeof r?document.querySelector(r):r;t&&(o=le(e),o&&t.replaceChildren(o))}return function(e,t,n,r){const o=E(e)||{};let i;return i="frames"===o.mode?ke(e,t,n,r):Se(e,n,r,"webapi"===o.mode)||ke(e,t,n,r),o.debugInstName&&(window[o.debugInstName]=i),i}(e,t,n,o)}function Re(e,t,n,r){if("object"==typeof e)return Ne(e,t,n,r);let o=null;return fetch(e).then(e=>e.json()).then(e=>{b(e)?o=Ne(e,t,n,r):console.error("Invalid animation document format")}),{isReady:()=>!!o,getRootElement:()=>o?o.getRootElement():null,isPlaying:()=>(null==o?void 0:o.isPlaying())||!1,play:()=>{null==o||o.play()},pause:()=>{null==o||o.pause()},cancel:()=>{null==o||o.cancel()},finish:()=>{null==o||o.finish()},setPlaybackRate:e=>{null==o||o.setPlaybackRate(e)},getCurrentTime:()=>(null==o?void 0:o.getCurrentTime())||0,setCurrentTime:e=>{null==o||o.setCurrentTime(e)},destroy:()=>{null==o||o.destroy()}}}function Pe(){const e=document.querySelectorAll("["+p+"]");for(let t=0;t<e.length;t++){const n=e[t];if(!n[h]){const e=n.getAttribute(p);e&&(n[h]=Re(e,void 0,void 0,n))}}}"undefined"!=typeof window&&(window.loadTagAnimators=Pe,window.createAnimator=Re,window.setupAnimationTriggers=ae);
1
+ "use strict";var t,e=Object.defineProperty,n=Object.defineProperties,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertyNames,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,c=(t,e)=>{for(var n in e||(e={}))s.call(e,n)&&u(t,n,e[n]);if(i)for(var n of i(e))l.call(e,n)&&u(t,n,e[n]);return t},f=(t,e)=>n(t,o(e)),d={};function m(t,e,n){const r={};return"translate"===t?r.translate=e:"rotate"===t?r.rotate=e:r.scale=e,n&&"translate"!==t&&(r.origin=n),r}function h(t){if(void 0===t)return{kind:"absent"};if(Array.isArray(t))return{kind:"static",value:t};if("object"==typeof t){const e=t;if(e.keyframes)return{kind:"animated",keyframes:e.keyframes,autoOrient:e.autoOrient};if(void 0!==e.value)return{kind:"static",value:e.value}}return{kind:"static",value:t}}function p(t,e){const n={value:e};return void 0!==t.time&&(n.time=t.time),void 0!==t.easing&&(n.easing=t.easing),void 0!==t.tangentOut&&(n.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(n.tangentIn=t.tangentIn),n}function y(t,e,n){if(!e)return t;delete t.transform;let r=t;var o;return r=v(r,"skew",e.skew,n),r=g(r,e.origin,!0),r=v(r,"scale",void 0===(o=e.scale)?void 0:Array.isArray(o)?[o[0]/100,o[1]/100]:o,n),r=v(r,"rotate",e.rotate,n),r=g(r,e.origin,!1),!function(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}(e.translate)?r=v(r,"translate",e.translate,n):(r=g(r,e.origin,!0),r=v(r,"translate",e.translate,n),r=g(r,e.origin,!1)),r}function v(t,e,n,r){if(void 0===n)return t;if("skew"===e){const e=h(n);return"static"!==e.kind?(r.warnings.push("transformation.skew: only static skew is supported"),t):{type:"g",transform:"skewX("+e.value[0]+")skewY("+e.value[1]+")",children:[t]}}const o=h(n);if("static"===o.kind)return{type:"g",transform:{value:m(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>p(t,m(e,t.value,void 0)))};return o.autoOrient&&(n.autoOrient=!0),{type:"g",animate:{transform:n},children:[t]}}return t}function g(t,e,n){if(void 0===e)return t;const r=h(e),o=t=>n?[-t[0],-t[1]]:t;return"absent"===r.kind?t:"static"===r.kind?0===r.value[0]&&0===r.value[1]?t:{type:"g",transform:{value:{translate:o(r.value)}},children:[t]}:"animated"===r.kind?{type:"g",animate:{transform:{keyframes:r.keyframes.map(t=>p(t,{translate:o(t.value)}))}},children:[t]}:t}function b(t,e,n){var r,o,a;if("use"===t.type&&"content"===(null==(o=null==(r=t.effects)?void 0:r.ref)?void 0:o.type)){const r=t.effects.ref.baseId;"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(a=t.children)||a.forEach(t=>b(t,e,n))}function A(t,e,n,r,o){const a=function(t,e){var n,r,o;const a={};let i=!1;const s=null==(n=t.animate)?void 0:n.transform;if(s&&"object"==typeof s&&Array.isArray(s.keyframes)){const e=s.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=w(s),r={keyframes:e.map(t=>{const e=t.value||{},r={};void 0!==e.translate&&(r.translate=e.translate),n&&void 0!==e.origin&&(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),void 0!==t.tangentOut&&(o.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(o.tangentIn=t.tangentIn),o})};s.autoOrient&&(r.autoOrient=!0),a.animate={transform:r};const o=e.some(t=>{const e=t.value||{};return void 0!==e.rotate||void 0!==e.scale}),l=e.map(t=>{const e=t.value||{},r={};void 0!==e.rotate&&(r.rotate=e.rotate),void 0!==e.scale&&(r.scale=e.scale),void 0===e.origin||n&&!o||(r.origin=e.origin);const a={value:r};return void 0!==t.time&&(a.time=t.time),void 0!==t.easing&&(a.easing=t.easing),a});l.every(t=>0===Object.keys(t.value).length)?(delete t.animate.transform,t.animate&&0===Object.keys(t.animate).length&&delete t.animate):t.animate.transform={keyframes:l},i=!0}}const l=void 0!==(null==e?void 0:e.translate),u=i||l,c=i&&w((null==(r=t.animate)?void 0:r.transform)||void 0)||i&&w((null==(o=a.animate)?void 0:o.transform)||void 0);if("string"==typeof t.transform){const e=function(t){const e=[],n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);)e.push({name:r[1],full:r[0]});if(!e.length)return{rest:t||void 0};if(e.every(t=>"translate"===t.name))return{translate:e.map(t=>t.full).join("")};const o=e[0],a=e[e.length-1];if("translate"===a.name&&"translate"===o.name){const n=k(a.full),r=k(o.full),i=-n[0],s=-n[1],l=r[0]-i,u=r[1]-s;if(0===l&&0===u)return{rest:t};return{translate:"translate("+l+","+u+")",rest:"translate("+i+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===a.name)return{rest:t};const i=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)i.push(e[s].full),s++;if(!i.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:i.join(""),rest:l||void 0}}(t.transform);u?void 0!==e.translate?e.rest?t.transform=e.rest:delete t.transform:!function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,n=[];let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(1!==n.length)return!1;if("translate"===n[0].name)return!0;if("matrix"!==n[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(n[0].full);if(!o)return!1;const a=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return a.length>=4&&1===a[0]&&0===a[1]&&0===a[2]&&1===a[3]}(t.transform)?c&&function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let n,r=0,o=!1;for(;n=e.exec(t);)r++,"matrix"===n[1]&&(o=!0);return 1===r&&o}(t.transform)&&delete t.transform:delete t.transform:e.translate&&(a.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}return a}(t,e);"string"==typeof t.id&&delete t.id;const{outer:i,inner:s}=function(t){if(!t)return{};const e=w(t.translate),n=void 0!==t.rotate||void 0!==t.scale,r={},o={};void 0!==t.translate&&(r.translate=t.translate);e&&void 0!==t.origin&&(r.origin=t.origin);void 0!==t.rotate&&(o.rotate=t.rotate);void 0!==t.scale&&(o.scale=t.scale);void 0!==t.skew&&(o.skew=t.skew);void 0===t.origin||e&&!n||(o.origin=t.origin);return{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(e);let l=t;l=y(l,s,o);let u={type:"g",id:n,children:[{type:"g",id:r,children:[l]}]};return void 0!==a.transform&&(u.transform=a.transform),void 0!==a.animate&&(u.animate=a.animate),i&&(delete u.id,u=y(u,i,o),u.id=n),u}function k(t){const e=/translate\(([^)]*)\)/.exec(t);if(!e)return[0,0];const n=e[1].split(/[\s,]+/).filter(Boolean).map(Number);return[n[0]||0,n[1]||0]}function w(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||!!Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}function j(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(d,{COLOUR_ATTR_NAMES:()=>Me,PX_ANIMATOR_DATA_KEY:()=>br,PX_ANIM_ATTR_NAME:()=>K,PX_ANIM_SRC_ATTR_NAME:()=>W,PX_TRANSFORM_PART_KEYS:()=>tt,PxAnimatedSvgDocumentSchema:()=>Et,PxAnimationDefinitionSchema:()=>rt,PxAnimatorConfigSchema:()=>st,PxAnimatorEngine:()=>G,PxAnimatorMode:()=>q,PxAttrValueSchema:()=>ut,PxBezierPathSchema:()=>zt,PxBindingSchema:()=>lt,PxDefsSchema:()=>it,PxEasingOrRefSchema:()=>J,PxEffectsSchema:()=>St,PxElementAnimationSchema:()=>ot,PxFillGradientEffectSchema:()=>jt,PxGradientSpreadMethod:()=>bt,PxGradientStopSchema:()=>kt,PxGradientType:()=>At,PxGradientUnits:()=>gt,PxKeyframeSchema:()=>$,PxLoopSchema:()=>H,PxMaskedByEffectSchema:()=>ht,PxNodeBase:()=>Mt,PxNodeSchema:()=>_t,PxPropertyAnimationSchema:()=>Q,PxRefEffectSchema:()=>vt,PxRepeaterEffectSchema:()=>mt,PxRetimeEffectSchema:()=>yt,PxStrokeGradientEffectSchema:()=>Pt,PxSvgNodeExtra:()=>It,PxTextAlongPathEffectSchema:()=>xt,PxTransformPartsSchema:()=>et,PxTransformValueSchema:()=>nt,PxTransformationEffectSchema:()=>dt,PxTriggerSchema:()=>at,PxTrimPathEffectSchema:()=>pt,STYLE_ATTR_NAMES:()=>ze,TRANSFORM_FN_NAMES:()=>_e,applyPlayerEffects:()=>Kn,calcAnimationValues:()=>_n,camelCaseToKebabWordIfNeeded:()=>Ue,collectSampleTimes:()=>Fr,createAnimator:()=>Ar,createAnimatorImpl:()=>gr,createBasicFrameLoopAnimator:()=>sr,createFrameLoopAnimator:()=>lr,createWebApiAnimator:()=>dr,describeSchema:()=>D,diffInEffect:()=>Dr,evaluateMotionPathSegment:()=>$e,generateNewIds:()=>yr,getAnimatorConfig:()=>Ct,getBindings:()=>Ut,getChildren:()=>Vt,getDefs:()=>Rt,getNormalizedProps:()=>rr,isPxElementFileFormat:()=>Tt,isPxElementFileFormatDeep:()=>Nt,loadTagAnimators:()=>kr,materialiseAllInTree:()=>Jn,materialiseAnimatedUseInstances:()=>Gn,materialiseInternalLoopsInPropAnim:()=>jn,materialiseInternalLoopsInTree:()=>Pn,materialiseMotionPathInPropAnim:()=>en,materialiseMotionPathsInTree:()=>dn,normalizeDocument:()=>On,propAnimIsMotionPath:()=>Ye,px:()=>B,renderNode:()=>or,schemaKeys:()=>L,setupAnimationTriggers:()=>ar,toRGBA:()=>Se,validateNodeEffects:()=>Ot,visualModelAt:()=>Lr}),module.exports=(t=d,((t,n,o,i)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let l of a(n))s.call(t,l)||l===o||e(t,l,{get:()=>n[l],enumerable:!(i=r(n,l))||i.enumerable});return t})(e({},"__esModule",{value:!0}),t));var P=class{_canSanitize(t){return this.isValid(t)}optional(){return new x(this)}},x=class extends P{constructor(t){super(),this.inner=t,this._default=void 0}sanitize(t){if(null!=t)return this.inner._canSanitize(t)?this.inner.sanitize(t):void 0}isValid(t,e,n){return null==t||this.inner.isValid(t,e,n)}_canSanitize(t){return null==t||this.inner._canSanitize(t)}},S=class extends P{constructor(t=""){super(),this._default=t}sanitize(t){return"string"==typeof t?t:this._default}isValid(t,e,n){return"string"==typeof t||(null==e||e.errors.push(j(null!=n?n:[])+": expected string, got "+typeof t),!1)}},O=class extends P{constructor(t=0){super(),this._default=t}sanitize(t){return"number"==typeof t&&isFinite(t)?t:this._default}isValid(t,e,n){return!("number"!=typeof t||!isFinite(t))||(null==e||e.errors.push(j(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},M=class extends P{constructor(t=!1){super(),this._default=t}sanitize(t){return"boolean"==typeof t?t:this._default}isValid(t,e,n){return"boolean"==typeof t||(null==e||e.errors.push(j(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},_=class extends P{constructor(t){super(),this.value=t,this._default=t}sanitize(t){return t===this.value?this.value:this._default}isValid(t,e,n){return t===this.value||(null==e||e.errors.push(j(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},I=class extends P{constructor(t,e){super(),this.values=t,this._default=null!=e?e:t[0]}sanitize(t){return this.values.includes(t)?t:this._default}isValid(t,e,n){return!!this.values.includes(t)||(null==e||e.errors.push(j(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},E=class extends P{constructor(t,e){super(),this.schemas=t,this._default=null!=e?e:t[0]._default}sanitize(t){for(const e of this.schemas)if(e.isValid(t))return e.sanitize(t);return this._default}isValid(t,e,n){var r;return!!this.schemas.some(e=>e.isValid(t))||(null==e||e.errors.push(j(null!=n?n:[])+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,60)),!1)}_canSanitize(t){return this.schemas.some(e=>e._canSanitize(t))}},z=class extends P{constructor(t,e,n){super(),this._key=t,this._schemas=e,this._default=null!=n?n:e[0]._default,this._map=new Map;for(const n of e){const e=n._shape[t];e&&this._map.set(e._default,n)}}_findSchema(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const e=t[this._key];return null!=e?this._map.get(e):void 0}sanitize(t){var e;return(null!=(e=this._findSchema(t))?e:this._schemas[0]).sanitize(t)}isValid(t,e,n){const r=this._findSchema(t);if(!r){const r=null===t||"object"!=typeof t||Array.isArray(t)?void 0:t[this._key];return null==e||e.errors.push(j(null!=n?n:[])+": no discriminated union member matched "+this._key+"="+JSON.stringify(r)),!1}return r.isValid(t,e,n)}_canSanitize(t){if(null===t||"object"!=typeof t||Array.isArray(t))return!1;const e=this._findSchema(t);return e?e._canSanitize(t):this._schemas[0]._canSanitize(t)}},T=class extends P{constructor(t){super(),this._shape=t;const e={};for(const n of Object.keys(t))e[n]=t[n]._default;this._default=e}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n={};for(const t of Object.keys(this._shape))n[t]=this._shape[t].sanitize(e[t]);return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(j(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let a=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(a=!1),o.pop();if(null==e?void 0:e.strict)for(const t of Object.keys(r))t in this._shape||(o.push(t),e.errors.push(j(o)+": unexpected extra key"),o.pop(),a=!1);return a}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},N=class extends P{constructor(t,e){super(),this._shape=t,this._openSchema=e;const n={};for(const e of Object.keys(t))n[e]=t[e]._default;this._default=n}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n=c({},e);for(const t of Object.keys(this._shape))n[t]=this._shape[t].sanitize(e[t]);if(this._openSchema)for(const t of Object.keys(e))t in this._shape||(n[t]=this._openSchema.sanitize(e[t]));return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(j(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let a=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(a=!1),o.pop();if(this._openSchema)for(const t of Object.keys(r))t in this._shape||(o.push(t),this._openSchema.isValid(r[t],e,o)||(a=!1),o.pop());return a}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},C=class extends P{constructor(t){super(),this.item=t,this._default=[]}sanitize(t){if(!Array.isArray(t))return[];const e=[];for(const n of t)this.item._canSanitize(n)&&e.push(this.item.sanitize(n));return e}isValid(t,e,n){if(!Array.isArray(t))return null==e||e.errors.push(j(null!=n?n:[])+": expected array, got "+typeof t),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<t.length;n++)r.push("["+n+"]"),this.item.isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)}},R=class extends P{constructor(t){super(),this.value=t,this._default={}}sanitize(t){if(!t||"object"!=typeof t||Array.isArray(t))return{};const e={};for(const[n,r]of Object.entries(t))this.value._canSanitize(r)&&(e[n]=this.value.sanitize(r));return e}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(j(null!=n?n:[])+": expected object/record, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(const[n,a]of Object.entries(t))r.push(n),this.value.isValid(a,e,r)||(o=!1),r.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},U=class extends P{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},V=class extends P{constructor(t,e){super(),this.fn=t,this._default=e,this.resolved=null}get schema(){var t;return null!=(t=this.resolved)?t:this.resolved=this.fn()}sanitize(t){return this.schema.sanitize(t)}isValid(t,e,n){return this.schema.isValid(t,e,n)}_canSanitize(t){return this.schema._canSanitize(t)}},F=class extends P{constructor(t){super(),this.schemas=t,this._default=t.map(t=>t._default)}sanitize(t){return Array.isArray(t)&&t.length===this.schemas.length?this.schemas.map((e,n)=>e.sanitize(t[n])):this._default}isValid(t,e,n){if(!Array.isArray(t)||t.length!==this.schemas.length)return null==e||e.errors.push(j(null!=n?n:[])+": expected tuple of length "+this.schemas.length+", got "+(Array.isArray(t)?"array["+t.length+"]":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<this.schemas.length;n++)r.push("["+n+"]"),this.schemas[n].isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)&&t.length===this.schemas.length}};function L(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function D(t){var e;const n=t;return"_shape"in n?{kind:"shape",shape:n._shape}:"item"in n?{kind:"array",item:n.item}:"inner"in n?{kind:"optional",inner:n.inner}:"fn"in n?{kind:"lazy",resolved:null!=(e=n.resolved)?e:n.fn()}:{kind:"leaf"}}var B={string:(t="")=>new S(t),number:(t=0)=>new O(t),boolean:(t=!1)=>new M(t),literal:t=>new _(t),enum:(t,e)=>new I(t,e),union:(t,e)=>new E(t,e),discriminatedUnion:(t,e)=>new z(t,e),object:t=>new T(t),openObject:(t,e)=>new N(t,e),extendedObject:(t,e)=>new T(c(c({},t._shape),e)),array:t=>new C(t),record:t=>new R(t),any:()=>new U,tuple:t=>new F(t),lazy:(t,e)=>new V(t,e)},W="data-px-animation-src",K="_px_animator",q={auto:"auto",webapi:"webapi",frames:"frames"},G={webapi:q.webapi,frames:q.frames},X="text",Y="textContent",Z=new Set(["type","children","animator","meta","animate",X,Y]),J=B.union([B.string(),B.tuple([B.number(),B.number(),B.number(),B.number()])]),$=(B.union([B.string(),B.number(),B.array(B.number()),B.lazy(()=>et,{}),B.object({path:B.string()}),B.lazy(()=>B.object({paths:B.array(zt)}),{paths:[]})]),B.object({time:B.number().optional(),t:B.number().optional(),value:B.any().optional(),v:B.any().optional(),easing:J.optional(),e:J.optional(),tangentOut:B.tuple([B.number(),B.number()]).optional(),to:B.tuple([B.number(),B.number()]).optional(),tangentIn:B.tuple([B.number(),B.number()]).optional(),ti:B.tuple([B.number(),B.number()]).optional(),selected:B.boolean().optional()})),H=B.object({segmentCount:B.number().optional(),before:B.boolean().optional(),alternate:B.boolean().optional()}),Q=B.object({keyframes:B.array($).optional(),kfs:B.array($).optional(),loop:B.union([H,B.boolean()]).optional(),autoOrient:B.boolean().optional()}),tt=["translate","rotate","scale","origin"],et=B.object({translate:B.tuple([B.number(),B.number()]).optional(),rotate:B.number().optional(),scale:B.tuple([B.number(),B.number()]).optional(),origin:B.tuple([B.number(),B.number()]).optional()}),nt=B.union([B.string(),B.object({value:et}),Q]),rt=B.record(Q),ot=B.union([B.string(),B.array(B.union([B.string(),rt])),rt]),at=B.object({startOn:B.enum(["load","mouseOver","click","scrollIntoView","programmatic"]).optional(),outAction:B.enum(["continue","pause","reset","reverse"]).optional(),scrollIntoViewThreshold:B.number().optional()}),it=B.object({easings:B.record(B.tuple([B.number(),B.number(),B.number(),B.number()])).optional(),animations:B.record(rt).optional(),styles:B.record(B.any()).optional()}),st=B.object({mode:B.enum([q.auto,q.webapi,q.frames]).optional(),duration:B.number().optional(),delay:B.number().optional(),iterations:B.union([B.number(),B.literal("infinite")]).optional(),fill:B.enum(["forwards","backwards","both","none"]).optional(),direction:B.enum(["normal","reverse","alternate","alternate-reverse"]).optional(),frameRate:B.number().optional(),trigger:at.optional(),definitions:it.optional(),animate:B.record(ot).optional(),debug:B.boolean().optional(),debugInstName:B.string().optional()}),lt=B.object({id:B.string(),animate:ot}),ut=B.union([B.string(),B.number(),B.object({value:B.any()}),Q]),ct=B.union([B.number(),B.object({value:B.number()}),B.object({keyframes:B.array($),autoOrient:B.boolean().optional()})]),ft=B.union([B.tuple([B.number(),B.number()]),B.object({value:B.tuple([B.number(),B.number()])}),B.object({keyframes:B.array($),autoOrient:B.boolean().optional()})]),dt=B.object({translate:ft.optional(),rotate:ct.optional(),scale:ft.optional(),skew:ft.optional(),origin:ft.optional()}),mt=B.object({copies:B.number().optional(),translate:ft.optional(),rotate:ct.optional(),scale:ft.optional(),origin:ft.optional()}),ht=B.object({href:B.string().optional(),maskType:B.string().optional(),maskUnits:B.string().optional(),maskContentUnits:B.string().optional()}),pt=B.object({offset:ct.optional(),range:ft.optional(),trimAllAsOne:B.boolean().optional()}),yt=B.object({baseId:B.string().optional(),start:B.number().optional(),stretch:B.number().optional(),timeCrop:B.tuple([B.number(),B.number()]).optional()}),vt=B.object({baseId:B.string().optional(),type:B.string().optional()}),gt={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},bt={pad:"pad",reflect:"reflect",repeat:"repeat"},At={linear:"linear",radial:"radial"},kt=B.object({offset:B.number(),color:B.string()}),wt=B.union([B.array(kt),B.object({value:B.array(kt)}),B.object({keyframes:B.array($)})]),jt=B.object({type:B.enum([At.linear,At.radial]),p1:B.tuple([B.number(),B.number()]).optional(),p2:B.tuple([B.number(),B.number()]).optional(),c:B.tuple([B.number(),B.number()]).optional(),r:B.number().optional(),fp:B.tuple([B.number(),B.number()]).optional(),stops:wt.optional(),gradientUnits:B.string().optional(),spreadMethod:B.string().optional(),gradientTransform:B.string().optional()}),Pt=jt,xt=B.object({href:B.string(),lengthAdjust:B.string().optional(),method:B.string().optional(),spacing:B.string().optional(),startOffset:ct.optional(),textLength:ct.optional()}),St=B.object({transformation:dt.optional(),repeater:mt.optional(),maskedBy:ht.optional(),trimPath:pt.optional(),retime:yt.optional(),isCombinedShape:B.boolean().optional(),ref:vt.optional(),fillGradient:jt.optional(),strokeGradient:Pt.optional(),textAlongPath:xt.optional()});function Ot(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!St.isValid(t.effects,r,[o+".effects"]))for(const t of r.errors)n.push(t)}t&&Array.isArray(t.children)&&t.children.forEach((t,e)=>r(t,o+".children["+e+"]"))};return r(t,"root"),n}var Mt=B.openObject({type:B.string(),id:B.string().optional(),meta:B.any().optional(),effects:St.optional(),animate:ot.optional(),style:B.union([B.string(),B.record(B.union([B.string(),B.number()]))]).optional()},ut),_t=B.openObject(f(c({},Mt._shape),{children:B.lazy(()=>B.array(_t),[]).optional()}),ut),It=B.object({width:B.number().optional(),height:B.number().optional(),viewBox:B.string().optional(),animator:st.optional()}),Et=B.openObject(f(c(c({},Mt._shape),It._shape),{type:B.literal("svg"),children:B.array(_t).optional()}),ut),zt=B.object({v:B.array(B.array(B.number())),i:B.array(B.array(B.number())).optional(),o:B.array(B.array(B.number())).optional(),c:B.boolean().optional()});function Tt(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&("svg"===t.type||"svg"===t.tagName)}function Nt(t){const e=Et.isValid(t);return{valid:e,errors:e?[]:["Document failed schema validation"]}}function Ct(t){var e,n;return(null==t?void 0:t.animator)||(null==(e=null==t?void 0:t.meta)?void 0:e.animator)||(null==t?void 0:t.animation)||(null==(n=null==t?void 0:t.meta)?void 0:n.animation)}function Rt(t){var e;if(t)return null==(e=Ct(t))?void 0:e.definitions}function Ut(t){var e;if(!t)return;const n=null==(e=Ct(t))?void 0:e.animate;return n?Object.entries(n).map(([t,e])=>({id:t,animate:e})):void 0}function Vt(t){return null==t?void 0:t.children}function Ft(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Ft);const e={};for(const n of Object.keys(t))e[n]=Ft(t[n]);return e}function Lt(t,e){const n=new Map,r=t=>{var o;if("string"==typeof t.id){const r=e();n.set(t.id,r),t.id=r}null==(o=t.children)||o.forEach(r)};r(t);const o=t=>t.replace(/url\(#([^)]+)\)/g,(t,e)=>{const r=n.get(e);return r?"url(#"+r+")":t}),a=t=>{var e;if("string"==typeof t.href&&t.href.startsWith("#")){const e=n.get(t.href.slice(1));e&&(t.href="#"+e)}for(const e of Object.keys(t)){if("children"===e||"effects"===e||"meta"===e||"animate"===e||"href"===e||"id"===e)continue;const n=t[e];"string"==typeof n&&-1!==n.indexOf("url(#")&&(t[e]=o(n))}null==(e=t.children)||e.forEach(a)};return a(t),n}function Dt(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function Bt(t){var e;const n=Dt(t.x),r=Dt(t.y);if(delete t.x,delete t.y,!n&&!r)return t;const o="translate("+n+","+r+")";if(void 0!==t.transform||void 0!==t.animate){const n={type:"g",transform:o,children:null!=(e=t.children)?e:[]};t.children=[n]}else t.transform=o;return t}function Wt(t,e){return"_lw_"+e+"_"+t.nextId++}function Kt(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function qt(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>qt(t,e))}var Gt=Ft;function Xt(t,e,n,r){if(!e)return t;const o=Wt(n,"grad"),a=function(t,e){const n={type:t.type===At.radial?"radialGradient":"linearGradient",id:e};t.type===At.linear?(t.p1&&(n.x1=String(t.p1[0]),n.y1=String(t.p1[1])),t.p2&&(n.x2=String(t.p2[0]),n.y2=String(t.p2[1]))):(t.c&&(n.cx=String(t.c[0]),n.cy=String(t.c[1])),void 0!==t.r&&(n.r=String(t.r)),t.fp&&(n.fx=String(t.fp[0]),n.fy=String(t.fp[1])));t.gradientUnits&&(n.gradientUnits=t.gradientUnits);t.spreadMethod&&(n.spreadMethod=t.spreadMethod);t.gradientTransform&&(n.gradientTransform=t.gradientTransform);return n.children=function(t){var e,n,r,o;if(!t)return[];if(Array.isArray(t))return t.map(Yt);if("object"==typeof t&&Array.isArray(t.value))return t.value.map(Yt);const a=t.keyframes;if(!Array.isArray(a)||!a.length)return[];let i=0;for(const t of a){const n=null!=(e=t.value)?e:t.v;Array.isArray(n)&&n.length>i&&(i=n.length)}if(!i)return[];const s=null!=(n=a[0].value)?n:a[0].v,l=[];for(let t=0;t<i;t++){const e=null!=(o=null!=(r=null==s?void 0:s[t])?r:Zt(a,0,t))?o:{offset:t/Math.max(1,i-1),color:"#000000"};l.push({offset:e.offset,color:e.color})}return l.map((t,e)=>function(t,e,n){var r,o,a,i,s;const l=[],u=[];let c=!1;for(const f of e){const d=null!=(o=null!=(r=f.time)?r:f.t)?o:0,m=null!=(a=f.value)?a:f.v,h=null!=(i=null==m?void 0:m[n])?i:Zt(e,e.indexOf(f),n);if(!h)continue;const p=null!=(s=f.easing)?s:f.e,y={time:d,value:h.color};void 0!==p&&(y.easing=p),l.push(y);const v={time:d,value:h.offset};void 0!==p&&(v.easing=p),u.push(v),h.offset!==t.offset&&(c=!0)}const f={type:"stop",offset:Jt(t.offset),stopColor:t.color},d={};l.length&&(d.stopColor={keyframes:l});c&&u.length&&(d.offset={keyframes:u});Object.keys(d).length&&(f.animate=d);return f}(t,a,e))}(t.stops),n}(e,o);return n.defs.push(a),t[r]="url(#"+o+")",t}function Yt(t){return{type:"stop",offset:Jt(t.offset),stopColor:t.color}}function Zt(t,e,n){var r,o;for(let o=e;o>=0;o--){const e=null!=(r=t[o].value)?r:t[o].v;if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=null!=(o=t[r].value)?o:t[r].v;if(null==e?void 0:e[n])return e[n]}}function Jt(t){return Math.round(1e3*t)/10+"%"}function $t(t,e,n,r){if(!e)return t;if(!e.href)return r.errors.push("maskedBy.href missing — cannot build mask"),t;const o=Wt(r,"mask");let a={type:"use",href:"#"+e.href};if(n)a=Ht(a,n,r);else if(ee(t))a=function(t,e){var n;const r=e.animate&&"object"==typeof e.animate&&!Array.isArray(e.animate)?e.animate:void 0,o=null==r?void 0:r.transform,a=o&&"object"==typeof o&&Array.isArray(o.keyframes)?o.keyframes:void 0;if(!a||!a.length)return t;const i=[],s=[],l=[];for(const t of a){const e=(null!=(n=t.value)?n:t.v)||{},r=p(t,void 0);if(Array.isArray(e.translate)&&i.push(f(c({},r),{value:{translate:[-e.translate[0],-e.translate[1]]}})),"number"==typeof e.rotate){const t={rotate:-e.rotate};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),s.push(f(c({},r),{value:t}))}if(Array.isArray(e.scale)){const t={scale:[1/e.scale[0],1/e.scale[1]]};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),l.push(f(c({},r),{value:t}))}}let u=t;i.length&&(u={type:"g",animate:{transform:{keyframes:i}},children:[u]});s.length&&(u={type:"g",animate:{transform:{keyframes:s}},children:[u]});l.length&&(u={type:"g",animate:{transform:{keyframes:l}},children:[u]});return u}(a,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,a,i,s,l,u,c,f,d,m;const h=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let p;const y=[];for(;null!==(p=h.exec(t));){const t=p[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);y.push({name:p[1],args:t})}if(!y.length)return;const v=y[y.length-1];if("translate"===v.name)for(let t=y.length-2;t>=0;t--){const c=y[t];if("translate"!==c.name)continue;const f=null!=(e=c.args[0])?e:0,d=null!=(n=c.args[1])?n:0,m=null!=(r=v.args[0])?r:0,h=null!=(o=v.args[1])?o:0;if(m!==-f||h!==-d)continue;const p={};p.origin=[f,d];for(let e=0;e<t;e++)if("translate"===y[e].name){const t=null!=(a=y[e].args[0])?a:0,n=null!=(i=y[e].args[1])?i:0;p.translate=p.translate?[p.translate[0]+t,p.translate[1]+n]:[t,n]}for(let e=t+1;e<y.length-1;e++){const t=y[e];if("rotate"===t.name)p.rotate=(null!=(s=p.rotate)?s:0)+(null!=(l=t.args[0])?l:0);else if("scale"===t.name){const e=null!=(u=t.args[0])?u:1,n=t.args.length>1?t.args[1]:e;p.scale=p.scale?[p.scale[0]*e,p.scale[1]*n]:[e,n]}}return p}let g,b,A;for(const t of y)if("translate"===t.name){const e=null!=(c=t.args[0])?c:0,n=null!=(f=t.args[1])?f:0;g=g?[g[0]+e,g[1]+n]:[e,n]}else if("rotate"===t.name)b=(null!=b?b:0)+(null!=(d=t.args[0])?d:0);else if("scale"===t.name){const e=null!=(m=t.args[0])?m:1,n=t.args.length>1?t.args[1]:e;A=A?[A[0]*e,A[1]*n]:[e,n]}const k={};g&&(k.translate=g);void 0!==b&&(k.rotate=b);A&&(k.scale=A);return Object.keys(k).length?k:void 0}(t.transform);if(!e)return;const n={};return e.translate&&(n.translate=e.translate),void 0!==e.rotate&&(n.rotate=e.rotate),e.scale&&(n.scale={value:e.scale}),e.origin&&(n.origin=e.origin),Object.keys(n).length?n:void 0}return}(t);e&&(a=Ht(a,e,r))}const i=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||ee(t))}(t);a=function(t,e,n,r,o){const a=r.idMap.get(n),i=r.maskAncestorChains.get(e)||[],s=o?ae(e,r):void 0,l=s?[...i,s]:i,u=a&&r.maskAncestorChains.get(a)||[];if(!l.length&&!u.length)return t;const c=new Set;for(const t of l)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);for(const t of u)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);if(!(c.size>0)){const e=ne(l),n=ne(u),r=n[0]-e[0],o=n[1]-e[1];return 0===r&&0===o?t:{type:"g",transform:"translate("+r+","+o+")",children:[t]}}const f=Array.from(c).sort((t,e)=>t-e);return{type:"g",animate:{transform:{keyframes:f.map(t=>{const e=re(l,t),n=re(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,e.href,r,i);const s={type:"mask",id:o,children:[a]};return e.maskType&&(s.maskType=e.maskType),e.maskUnits&&(s.maskUnits=e.maskUnits),e.maskContentUnits&&(s.maskContentUnits=e.maskContentUnits),r.defs.push(s),t.mask="url(#"+o+")",t}function Ht(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=h(t);if("absent"!==r.kind)return"static"===r.kind?r.value:(e.warnings.push("transformation.origin: animated origin approximated by its first keyframe"),null==(n=r.keyframes[0])?void 0:n.value)}(e.origin,n);let o=t;return o=Qt(o,"translate",e.translate,void 0,n),o=Qt(o,"rotate",e.rotate,r,n),o=Qt(o,"scale",e.scale,r,n),o}function Qt(t,e,n,r,o){if(void 0===n)return t;const a=h("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);return"static"===a.kind?{type:"g",transform:{value:m(e,te(e,a.value),r)},children:[t]}:"animated"===a.kind?{type:"g",animate:{transform:{keyframes:a.keyframes.map(t=>p(t,m(e,te(e,t.value),r)))}},children:[t]}:t}function te(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function ee(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function ne(t){let e=0,n=0;for(const r of t)r.translate&&(e+=r.translate[0],n+=r.translate[1]);return[e,n]}function re(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=oe(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function oe(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],a=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*a,r.value[1]+(o.value[1]-r.value[1])*a]}return t[t.length-1].value}function ae(t,e){var n,r,o;const a=t.transform,i=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate.transform:void 0;if(void 0===a&&!i)return;const s={};if("string"==typeof a){const t=function(t,e){const n=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,a=0,i=!1,s=!1;for(;null!==(r=n.exec(t));){const t=r[1],e=r[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);"translate"===t?(o+=e[0]||0,a+=e[1]||0,i=!0):s=!0}s&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t);return i?[o,a]:void 0}(a,e);t&&(s.translate=t)}else if(a&&"object"==typeof a){const t=a.value;t&&"object"==typeof t&&Array.isArray(t.translate)&&(s.translate=[t.translate[0]||0,t.translate[1]||0]),!t||void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: non-translate transform parts ignored (rotate/scale not yet supported)")}if(i&&Array.isArray(i.keyframes)){const t=i.keyframes,a=[];for(const i of t){const t=null!=(n=i.value)?n:i.v,s=null!=(o=null!=(r=i.time)?r:i.t)?o:0;t&&"object"==typeof t&&Array.isArray(t.translate)&&(a.push({time:s,value:[t.translate[0]||0,t.translate[1]||0]}),void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: animated non-translate parts ignored"))}a.length&&(s.translateKeyframes=a)}return s.translate||s.translateKeyframes?s:void 0}var ie="content";function se(t,e){const n={};return void 0!==t.translate&&(n.translate=function(t,e){if(Array.isArray(t))return e(t);if(t&&"object"==typeof t){const n=t;if(Array.isArray(n.keyframes))return f(c({},n),{keyframes:n.keyframes.map(t=>t&&void 0!==t.value?f(c({},t),{value:e(t.value)}):t)});if(void 0!==n.value)return f(c({},n),{value:e(n.value)})}return t}(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=function(t,e){if("number"==typeof t)return e(t);if(t&&"object"==typeof t){const n=t;if(Array.isArray(n.keyframes))return f(c({},n),{keyframes:n.keyframes.map(t=>t&&void 0!==t.value?f(c({},t),{value:e(t.value)}):t)});if(void 0!==n.value)return f(c({},n),{value:e(n.value)})}return t}(t.rotate,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){const n=t=>[Math.pow(t[0]/100,e),Math.pow(t[1]/100,e)],r=t=>[Math.pow(t[0],e),Math.pow(t[1],e)];if(Array.isArray(t))return{value:n(t)};if(t&&"object"==typeof t){const e=t;if(Array.isArray(e.keyframes))return f(c({},e),{keyframes:e.keyframes.map(t=>t&&void 0!==t.value?f(c({},t),{value:r(t.value)}):t)});if(void 0!==e.value)return f(c({},e),{value:n(e.value)})}return t}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}var le=!1;function ue(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function ce(t,e,n){const r=Kt(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=fe(r,e,n,new Set);if(o)if(le){const e=n.idMap.get(o);t.type="g",delete t.href,t.children=[e],Bt(t),n.defs=n.defs.filter(t=>t!==e)}else t.href="#"+o}function fe(t,e,n,r){var o,a;if(r.has(t))return void n.errors.push('retime: loop via "'+t+'"');const i=n.idMap.get(t);if(!i)return void n.warnings.push('retime: target "'+t+'" not found');const s=Gt(i);if(function(t,e){Lt(t,()=>Wt(e,"retimed"))}(s,n),"use"===i.type?me(s,e.start,e.stretch):de(s,e.start,e.stretch),(null==(o=s.effects)?void 0:o.retime)&&(delete s.effects.retime,0===Object.keys(s.effects).length&&delete s.effects),"use"===i.type&&i.href){const o=Kt(i.href);if(o){const c=null==(a=i.effects)?void 0:a.retime,f=c?(l=ue(c),{start:(u=e).start+u.stretch*l.start,stretch:u.stretch*l.stretch}):e,d=new Set(r);d.add(t);const m=fe(o,f,n,d);m&&(s.href="#"+m)}}var l,u;return n.defs.push(s),"string"==typeof s.id&&n.idMap.set(s.id,s),"string"==typeof s.id?s.id:void 0}function de(t,e,n){var r;me(t,e,n),null==(r=t.children)||r.forEach(t=>de(t,e,n))}function me(t,e,n){const r=t=>{for(const r of t)"number"==typeof r.time&&(r.time=e+r.time*n)};if(t.transform&&"object"==typeof t.transform&&Array.isArray(t.transform.keyframes)&&r(t.transform.keyframes),t.animate&&"object"==typeof t.animate)for(const e of Object.keys(t.animate)){const n=t.animate[e];n&&Array.isArray(n.keyframes)&&r(n.keyframes)}}function he(t,e,n){if(null!=n)if("number"!=typeof n){if("object"==typeof n){const r=n;if(Array.isArray(r.keyframes)){const n=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,o=c({},n||{});return o[e]={keyframes:r.keyframes},void(t.animate=o)}if("number"==typeof r.value)return void(t[e]=String(r.value))}}else t[e]=String(n)}function pe(t){var e,n,r,o;const a=t.v,i=t.i,s=t.o,l=t.c;if(!a.length)return"";const u=[],c=a.length;u.push("M"+a[0][0]+","+a[0][1]);for(let t=1;t<c;t++){const r=a[t-1],o=null!=(e=null==s?void 0:s[t-1])?e:r,l=null!=(n=null==i?void 0:i[t])?n:a[t],c=a[t];o[0]===r[0]&&o[1]===r[1]&&l[0]===c[0]&&l[1]===c[1]?u.push("L"+c[0]+","+c[1]):u.push("C"+o[0]+","+o[1]+","+l[0]+","+l[1]+","+c[0]+","+c[1])}if(l&&c>0){const t=a[c-1],e=null!=(r=null==s?void 0:s[c-1])?r:t,n=null!=(o=null==i?void 0:i[0])?o:a[0],l=a[0];e[0]===t[0]&&e[1]===t[1]&&n[0]===l[0]&&n[1]===l[1]||u.push("C"+e[0]+","+e[1]+","+n[0]+","+n[1]+","+l[0]+","+l[1]),u.push("z")}return u.join("")}function ye(t,e,n){return t+(e-t)*n}function ve(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let a=0;a<o;a++)r[a]=ye(t[a]||0,e[a]||0,n);return r}function ge(t,e,n){return[ye(t[0]||0,e[0]||0,n),ye(t[1]||0,e[1]||0,n),ye(t[2]||0,e[2]||0,n),ye(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function be(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let a=0;a<r;a++)o.push(Ae(t[a],e[a],n));return o}function Ae(t,e,n){var r,o,a,i,s,l,u,c,f;if(!t||!e)return t||e||{v:[]};const d=Math.min(Math.max(n,0),1),m=Math.min(t.v.length,e.v.length),h=[],p=[],y=[];for(let n=0;n<m;n++){const f=t.v[n],m=e.v[n];h.push(ve(f,m,d));const v=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,g=null!=(i=null==(a=e.i)?void 0:a[n])?i:m;p.push(ve(v,g,d));const b=null!=(l=null==(s=t.o)?void 0:s[n])?l:f,A=null!=(c=null==(u=e.o)?void 0:u[n])?c:m;y.push(ve(b,A,d))}return{v:h,i:p.length?p:void 0,o:y.length?y:void 0,c:null!=(f=t.c)?f:e.c}}function ke(t,e,n){if(n<=0)return 0;if(n>=1)return 1;const r=3*t,o=3*(e-t)-r,a=1-r-o;function i(t){return((a*t+o)*t+r)*t}function s(t){return(3*a*t+2*o)*t+r}let l=n,u=0,c=1;for(let t=0;t<8;t++){const t=i(l)-n;if(Math.abs(t)<1e-6)return l;const e=s(l);if(Math.abs(e)<1e-6)break;l-=t/e}for(l=n;u<c;){const t=i(l);if(Math.abs(t-n)<1e-6)return l;n>t?u=l:c=l,l=(c+u)/2}return l}function we(t){const[e,n,r,o]=t,a=3*n,i=3*(o-n)-a,s=1-a-i;return function(t){return n=ke(e,r,t),((s*n+i)*n+a)*n;var n}}function je(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Pe(t,e){if(!t)return{left:void 0,right:void 0};if(e<=0)return{left:void 0,right:t};if(e>=1)return{left:t,right:void 0};const[n,r,o,a]=t,i=ke(n,o,e),s=[n,r],l=[o,a],{left:u,right:c}=function(t,e,n,r,o){const a=je(t,e,o),i=je(e,n,o),s=je(n,r,o),l=je(a,i,o),u=je(i,s,o),c=je(l,u,o);return{left:[t,a,l,c],right:[c,u,s,r]}}([0,0],s,l,[1,1],i),f=u[3][0],d=u[3][1];let m,h;f>1e-9&&Math.abs(d)>1e-9&&(m=[u[1][0]/f,u[1][1]/d,u[2][0]/f,u[2][1]/d]);const p=1-f,y=1-d;return p>1e-9&&Math.abs(y)>1e-9&&(h=[(c[1][0]-f)/p,(c[1][1]-d)/y,(c[2][0]-f)/p,(c[2][1]-d)/y]),{left:m,right:h}}function xe(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function Se(t){const e=Math.round(255*t[0]),n=Math.round(255*t[1]),r=Math.round(255*t[2]);return 4===t.length?"rgba("+e+","+n+","+r+","+t[3]+")":"rgb("+e+","+n+","+r+")"}function Oe(t){if(t){if(Array.isArray(t))return t;if("string"==typeof t)return t.startsWith("#")?function(t){const e=t.slice(1),n=e.length<=4,r=n?e[0]+e[0]:e.slice(0,2),o=n?e[1]+e[1]:e.slice(2,4),a=n?e[2]+e[2]:e.slice(4,6),i=4===e.length?e[3]+e[3]:8===e.length?e.slice(6,8):null,s=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(a,16)/255];return null!==i&&s.push(parseInt(i,16)/255),s}(t):t.startsWith("rgb")?function(t){var e;const n=null==(e=t.match(/rgba?\((.*)\)/))?void 0:e[1];if(!n)throw new Error("Invalid rgb/rgba format");const r=n.split(",").map(t=>+t.trim());return[r[0]/255,r[1]/255,r[2]/255,...void 0!==r[3]?[r[3]]:[]]}(t):void console.warn("Unsupported color format: "+t)}}var Me=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),_e=new Set(["translate","rotate","scale","skew"]),Ie=new Set(["offset-distance","offsetDistance"]);function Ee(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],a=t.translate,i=t.origin,s=t.rotate,l=t.scale,u=r?"px":"",c=r?"deg":"";return a&&o.push("translate("+a[0]+u+","+a[1]+u+")"),i&&o.push("translate("+i[0]+u+","+i[1]+u+")"),null!=s&&o.push("rotate("+s+c+")"),l&&o.push("scale("+l[0]+","+l[1]+")"),i&&o.push("translate("+-i[0]+u+","+-i[1]+u+")"),o.join("")}var ze=new Set(["offset-distance","offsetDistance"]),Te=1e3;function Ne(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function Ce(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var Re=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","markerUnits","markerWidth","markerHeight","refX","refY","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function Ue(t){return Re.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Ve(t,e,n){return Math.max(e,Math.min(t,n))}function Fe(t,e,n,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const a=1-o,i=a*a,s=o*o,l=i*a,u=3*o*i,c=3*s*a,f=s*o;return[l*t[0]+u*e[0]+c*n[0]+f*r[0],l*t[1]+u*e[1]+c*n[1]+f*r[1]]}var Le=1e-4;function De(t,e,n,r,o){const a=Be(t,e,n,r,o);if(0===a[0]&&0===a[1]){return Be(t,e,n,r,o<.5?o+Le:o-Le)}return a}function Be(t,e,n,r,o){const a=1-o,i=3*a*a,s=6*o*a,l=3*o*o;return[i*(e[0]-t[0])+s*(n[0]-e[0])+l*(r[0]-n[0]),i*(e[1]-t[1])+s*(n[1]-e[1])+l*(r[1]-n[1])]}function We(t,e,n,r,o=100){const a=o+1,i=new Float64Array(a),s=new Float64Array(a);let l=Fe(t,e,n,r,0);i[0]=0,s[0]=0;let u=0;for(let c=1;c<a;c++){const a=c/o,f=Fe(t,e,n,r,a),d=f[0]-l[0],m=f[1]-l[1];u+=Math.sqrt(d*d+m*m),i[c]=a,s[c]=u,l=f}return{ts:i,ds:s}}function Ke(t,e){const{ts:n,ds:r}=t,o=n.length-1;if(e<=n[0])return r[0];if(e>=n[o])return r[o];let a=1,i=o;for(;a<i;){const t=a+i>>>1;n[t]<e?a=t+1:i=t}const s=n[i-1],l=n[i]-s,u=l>0?(e-s)/l:0;return r[i-1]+u*(r[i]-r[i-1])}function qe(t){var e;const n=null!=(e=t.value)?e:t.v;if(!n)return;if(Array.isArray(n)&&n.length>=2&&"number"==typeof n[0]&&"number"==typeof n[1])return[n[0],n[1]];const r=n.translate;return Array.isArray(r)&&r.length>=2?[r[0],r[1]]:void 0}function Ge(t){var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0}function Xe(t){var e;return null!=(e=t.easing)?e:t.e}function Ye(t){var e,n,r;const o=null!=(e=t.keyframes)?e:t.kfs;if(!Array.isArray(o))return!1;if(t.autoOrient)return!0;for(const t of o)if((null!=(n=t.tangentIn)?n:t.ti)||(null!=(r=t.tangentOut)?r:t.to))return!0;return!1}var Ze=new WeakMap;function Je(t,e,n,r){var o,a;const i=Ze.get(t);if(i)return i;const s=null!=(o=t.tangentOut)?o:t.to,l=null!=(a=e.tangentIn)?a:e.ti,u=[n[0]+(s?s[0]:0),n[1]+(s?s[1]:0)],c=[r[0]+(l?l[0]:0),r[1]+(l?l[1]:0)],f=We(n,u,c,r),d={P0:n,P1:u,P2:c,P3:r,lut:f,totalArc:f.ds[f.ds.length-1]};return Ze.set(t,d),d}function $e(t,e,n,r,o,a){const i=Je(t,e,n,r),s=0===i.totalArc?o:function(t,e){const n=t.ds[t.ds.length-1],r=e*n,{ts:o,ds:a}=t,i=a.length-1;if(r<=0)return o[0];if(r>=a[i])return o[i];let s=1,l=i;for(;s<l;){const t=s+l>>>1;a[t]<r?s=t+1:l=t}const u=a[l-1],c=a[l]-u,f=c>0?(r-u)/c:0;return o[l-1]+f*(o[l]-o[l-1])}(i.lut,o),l=Fe(i.P0,i.P1,i.P2,i.P3,s);if(!a)return{translate:l};const u=De(i.P0,i.P1,i.P2,i.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}var He=.5,Qe=5,tn=32;function en(t,e){var n,r,o,a;if(!Ye(t))return t;const i=null!=(n=t.keyframes)?n:t.kfs;if(!Array.isArray(i)||i.length<2)return t;const s=!!t.autoOrient,l=null!=(r=null==e?void 0:e.flatnessTolerance)?r:He,u=null!=(o=null==e?void 0:e.rotationTolerance)?o:Qe,c=null!=(a=null==e?void 0:e.maxSamplesPerSegment)?a:tn,f=[],d=qe(i[0]);if(!d)return t;const m=s?function(t,e){const n=qe(t),r=qe(e);if(!n||!r)return 0;const o=Je(t,e,n,r),a=De(o.P0,o.P1,o.P2,o.P3,0);return 180*Math.atan2(a[1],a[0])/Math.PI}(i[0],i[1]):void 0;f.push(nn(Ge(i[0]),an(rn(i[0]),rn(i[0]),0,d,m,s)));for(let t=0;t<i.length-1;t++){const e=i[t],n=i[t+1],r=qe(e),o=qe(n);r&&o?(s&&t>0&&sn(f,e,n,r,o,u),ln(f,e,n,r,o,s,l,u,c)):f.push(nn(Ge(n),an(rn(n),rn(n),1,null!=o?o:[0,0],void 0,s)))}const h=Xe(i[i.length-1]);h&&(f[f.length-1].e=h),s&&function(t){var e;let n;for(const r of t){const t=null!=(e=r.v)?e:r.value;if(!t||"number"!=typeof t.rotate)continue;if(void 0===n){n=t.rotate;continue}let o=t.rotate;for(;o-n>180;)o-=360;for(;o-n<-180;)o+=360;t.rotate=o,n=o}}(f);const p={kfs:f};return void 0!==t.loop&&(p.loop=t.loop),p}function nn(t,e){return{t:t,v:e}}function rn(t){var e;const n=null!=(e=t.value)?e:t.v;if(n&&"object"==typeof n&&!Array.isArray(n))return n}function on(t,e,n){if(void 0===t)return e;if(void 0===e)return t;if("number"==typeof t&&"number"==typeof e)return t+(e-t)*n;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){const r=new Array(t.length);for(let o=0;o<t.length;o++){const a="number"==typeof t[o]?t[o]:0,i="number"==typeof e[o]?e[o]:0;r[o]=a+(i-a)*n}return r}return n<.5?t:e}function an(t,e,n,r,o,a){const i={translate:r},s=new Set;if(t)for(const e of Object.keys(t))s.add(e);if(e)for(const t of Object.keys(e))s.add(t);for(const r of s){if("translate"===r)continue;if("rotate"===r&&a)continue;const o=null==t?void 0:t[r],s=null==e?void 0:e[r];void 0===o&&void 0===s||(i[r]=on(o,s,n))}return void 0!==o&&(i.rotate=o),i}function sn(t,e,n,r,o,a){var i;const s=t[t.length-1],l=null!=(i=s.v)?i:s.value,u=null==l?void 0:l.rotate;if("number"!=typeof u)return;const c=Je(e,n,r,o),f=De(c.P0,c.P1,c.P2,c.P3,0),d=180*Math.atan2(f[1],f[0])/Math.PI,m=function(t,e){let n=t-e;for(;n>180;)n-=360;for(;n<-180;)n+=360;return n}(d,u);if(Math.abs(m)<=a)return;const h=an(rn(e),rn(e),0,r,d,!0);t.push(nn(Ge(e),h))}function ln(t,e,n,r,o,a,i,s,l){const u=Je(e,n,r,o),c=Ge(e),f=Ge(n),d=Xe(e),m=(h=d)?we([h[1],h[0],h[3],h[2]]):t=>t;var h;const p=rn(e),y=rn(n),v=function(t,e,n,r,o){const a=[];un(t.P0[0],t.P1[0],t.P2[0],t.P3[0],a),un(t.P0[1],t.P1[1],t.P2[1],t.P3[1],a),a.sort((t,e)=>t-e);const i=[0];for(const t of a)t>i[i.length-1]+1e-6&&t<.999999&&i.push(t);i.push(1);const s=[],l={remaining:o-i.length};for(let o=0;o<i.length-1;o++)cn(i[o],i[o+1],s,t,e,n,r,l);return s}(u,a,i,s,l),g=[];for(const t of v){const e=Ke(u.lut,t),n=Ve(u.totalArc>0?e/u.totalArc:t,0,1),r={u:Ve(m(n),0,1),p:n,pos:Fe(u.P0,u.P1,u.P2,u.P3,t)};if(a){const e=De(u.P0,u.P1,u.P2,u.P3,t);r.rotateDeg=180*Math.atan2(e[1],e[0])/Math.PI}g.push(r)}let b=d,A=0;const k=t.length-1;for(let e=0;e<g.length;e++){const n=g[e],r=A<1?Ve((n.u-A)/(1-A),0,1):1,{left:o,right:i}=Pe(b,r),s=0===e?k:t.length-1;o?t[s].e=o:delete t[s].e;const l=c+n.u*(f-c),u=an(p,y,n.p,n.pos,n.rotateDeg,a);t.push(nn(l,u)),b=i,A=n.u}}function un(t,e,n,r,o){const a=e-t,i=n-e,s=a-2*i+(r-n),l=2*(i-a),u=a;if(Math.abs(s)<1e-10){if(Math.abs(l)>1e-10){const t=-u/l;t>1e-6&&t<.999999&&o.push(t)}return}const c=l*l-4*s*u;if(c<0)return;const f=Math.sqrt(c),d=(-l-f)/(2*s),m=(-l+f)/(2*s);d>1e-6&&d<.999999&&o.push(d),m>1e-6&&m<.999999&&o.push(m)}function cn(t,e,n,r,o,a,i,s){const l=(t+e)/2,u=Fe(r.P0,r.P1,r.P2,r.P3,t),c=Fe(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=Fe(r.P0,r.P1,r.P2,r.P3,t+.25*f),m=Fe(r.P0,r.P1,r.P2,r.P3,l),h=Fe(r.P0,r.P1,r.P2,r.P3,t+.75*f),p=Math.max(fn(d,u,c),fn(m,u,c),fn(h,u,c));let y=!0;if(o){const n=De(r.P0,r.P1,r.P2,r.P3,t),o=De(r.P0,r.P1,r.P2,r.P3,e),a=180*Math.atan2(n[1],n[0])/Math.PI,s=180*Math.atan2(o[1],o[0])/Math.PI;let l=Math.abs(a-s);l>180&&(l=360-l),l>i&&(y=!1)}p<=a&&y||s.remaining<=0||f<1e-6?n.push(e):(s.remaining-=1,cn(t,l,n,r,o,a,i,s),cn(l,e,n,r,o,a,i,s))}function fn(t,e,n){const r=n[0]-e[0],o=n[1]-e[1],a=r*r+o*o;if(a<1e-20){const n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}const i=(t[0]-e[0])*o-(t[1]-e[1])*r;return Math.abs(i)/Math.sqrt(a)}function dn(t,e){const n=mn(t,e);return null!=n?n:t}function mn(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=mn(t.children[r],e);null!==o&&(n||(n=t.children.slice()),n[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o,n=t.transform;if(n&&"object"==typeof n&&Ye(n)){const o=en(n,e);o!==n&&(r=f(c({},t),{transform:o}))}}if(!n&&!r)return null;const a=c({},t);return n&&(a.children=n),r&&(a.animate=r),a}function hn(t){const e=[];let n;const r=function(t){const e=t.split(/([MLCZmlcz]|[\s,]+)/).map(t=>t.trim()).filter(t=>t&&","!==t),n=[];let r=null;for(const t of e)if(/[MLCZmlcz]/.test(t))r={type:t,values:[]},n.push(r);else if(r){const e=+t;r.values.push(Number.isNaN(e)?0:e)}return n}(t);for(const t of r){const r=t.type,o=t.values;if("M"===r||"m"===r){const t=o[0]||0,r=o[1]||0;n={v:[[t,r]],i:[[t,r]],o:[[t,r]],c:!1},e.push(n);continue}if(n||(n={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},e.push(n)),"L"===r){const t=o[0]||0,e=o[1]||0;n.v.push([t,e]),n.i.push([t,e]),n.o.push([t,e])}else if("C"===r){const t=o[0]||0,e=o[1]||0,r=o[2]||0,a=o[3]||0,i=o[4]||0,s=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([i,s]),n.i.push([r,a]),n.o.push([i,s])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function pn(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function yn(t){return"string"==typeof t&&void 0!==pn(t)}function vn(t){if(t&&"object"==typeof t&&"string"==typeof t.path){const e=pn(t.path);return e?{paths:hn(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&yn(e[0])){const t=[];for(const n of e){const e=pn(n);e&&t.push(...hn(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&yn(t[0])){const e=[];for(const n of t){const t=pn(n);t&&e.push(...hn(t))}return{paths:e}}return{paths:t}}if(yn(t)){return{paths:hn(pn(t))}}return t}function gn(t,e){var n;if(t)return Array.isArray(t)?t:(null==(n=null==e?void 0:e.easings)?void 0:n[t])?e.easings[t]:void console.warn("Unknown easing name: "+t)}function bn(t,e){var n;if("string"==typeof t){const r=null==(n=null==e?void 0:e.animations)?void 0:n[t];return r||console.warn("Unknown animation name: "+t),r}return t}function An(t,e,n,r){var o,a;if("d"===t){return{paths:be(null!=(o=null==e?void 0:e.paths)?o:Array.isArray(e)?e:[],null!=(a=null==n?void 0:n.paths)?a:Array.isArray(n)?n:[],r)}}return Me.has(t)?ge(e||[0,0,0,1],n||[0,0,0,1],r):"transform"!==t||"object"!=typeof e||null===e||Array.isArray(e)||"object"!=typeof n||null===n||Array.isArray(n)?"rotate"===t&&"number"==typeof e&&"number"==typeof n?ye(e,n,r):_e.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?ve(e||[],n||[],r):ye(+(e||0),+(n||0),r):function(t,e,n){const r=new Set([...Object.keys(null!=t?t:{}),...Object.keys(null!=e?e:{})]),o={};for(const a of r){const r=null==t?void 0:t[a],i=null==e?void 0:e[a];if("rotate"===a)o[a]=ye(+(null!=r?r:0),+(null!=i?i:0),n);else if("translate"===a||"scale"===a||"origin"===a){const t="scale"===a?[1,1]:[0,0];o[a]=ve(r||t,i||t,n)}else o[a]=null!=i?i:r}return o}(e,n,r)}function kn(t,e,n,r){var o,a,i,s,l;const u=e.length-1,c=Ve(null!=(o=n.segmentCount)?o:u,1,u);let f;f=n.before?e.slice(0,c+1):e.slice(u-c);const d=null!=(a=e[0].t)?a:0,m=null!=(i=e[e.length-1].t)?i:0;let h,p;n.before?(h=0,p=d):(h=m,p=r);const y=p-h;if(y<=0)return e;const v=null!=(s=f[0].t)?s:0,g=(null!=(l=f[f.length-1].t)?l:0)-v;if(g<=0)return e;const b=f.map(t=>{var e,n;return{relT:(t.t-v)/g,v:t.v,e:t.e,tangentIn:null!=(e=t.tangentIn)?e:t.ti,tangentOut:null!=(n=t.tangentOut)?n:t.to}}),A=Math.floor(y/g),k=(y-A*g)/g,w=[];function j(e,n,r){let o;if(n){o=[];for(let t=b.length-1;t>=0;t--)o.push({relT:1-b[t].relT,v:b[t].v,e:t>0?xe(b[t-1].e):void 0,tangentIn:b[t].tangentOut,tangentOut:b[t].tangentIn})}else o=b;const a=void 0!==r?r:1;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT>a+1e-9){const i=o[n-1],s=r.relT-i.relT,l=(a-i.relT)/s,u=i.e?we(i.e)(l):l,c=An(t,i.v,r.v,u),{left:f}=Pe(i.e,l);return w.length>0&&i.relT<=a&&(w[w.length-1].e=f),void w.push({t:e+a*g,v:c,e:void 0})}const i={t:e+r.relT*g,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(i.tangentIn=r.tangentIn),r.tangentOut&&(i.tangentOut=r.tangentOut),w.push(i)}}for(let t=0;t<A;t++){const e=n.before?A-1-t:t,r=!!n.alternate&&e%2==0;j(h+t*g,r)}if(k>1e-9){const t=!!n.alternate&&A%2==0;j(h+A*g,t,k)}return n.before?[...w,...e]:[...e,...w]}function wn(t,e,n,r){var o,a,i,s,l,u,c;const f=e.keyframes||e.kfs||[],d=[];for(const e of f){const n=null!=(a=null!=(o=e.time)?o:e.t)?a:0;let f=null!=(i=e.value)?i:e.v;const m=null!=(s=e.easing)?s:e.e;"d"===t&&(f=vn(f));const h=Ce(t)?Ue(t):t;Me.has(h)&&(f=null!=(l=Oe(f))?l:f);const p={t:n,v:f,e:gn(m,r)},y=null!=(u=e.tangentIn)?u:e.ti,v=null!=(c=e.tangentOut)?c:e.to;y&&(p.tangentIn=y),v&&(p.tangentOut=v),d.push(p)}d.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const m=e.loop,h=!0===m?{}:m||void 0;return h&&d.length>=2?kn(t,d,h,n):d}function jn(t,e,n){var r;const o=e.loop;if(null==o||!1===o)return e;const a=!0===o?{}:o,i=null!=(r=e.keyframes)?r:e.kfs;if(!Array.isArray(i)||i.length<2)return e;const s=Ce(t)?Ue(t):t,l=Me.has(s),u=i.map(e=>{var n,r,o,a,i,s,u,c;const f=null!=(n=e.t)?n:e.time;let d=null!=(r=e.v)?r:e.value;"d"===t&&(d=vn(d)),l&&(d=null!=(o=Oe(d))?o:d);const m={t:f,v:d,e:null!=(a=e.e)?a:e.easing};return(null!=(i=e.tangentIn)?i:e.ti)&&(m.tangentIn=null!=(s=e.tangentIn)?s:e.ti),(null!=(u=e.tangentOut)?u:e.to)&&(m.tangentOut=null!=(c=e.tangentOut)?c:e.to),m}),c={kfs:kn(t,u,a,n)};return void 0!==e.autoOrient&&(c.autoOrient=e.autoOrient),c}function Pn(t,e){const n=xn(t,e);return null!=n?n:t}function xn(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=xn(t.children[r],e);null!==o&&(n||(n=t.children.slice()),n[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o;for(const n of Object.keys(t)){const o=t[n],a=jn(n,o,e);a!==o&&(r||(r=c({},t)),r[n]=a)}}if(!n&&!r)return null;const a=c({},t);return n&&(a.children=n),r&&(a.animate=r),a}var Sn=0;function On(t,e=G.webapi){const n=Ct(t)||{},r=Rt(t),o=n.duration||1e3,a=[],i=(t,n)=>{if(!n)return null;const a=function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=bn(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=bn(r,e);t&&n.push(t)}else n.push(t);return n}(n,r);if(0===a.length)return null;const i=function(t,e,n,r=G.webapi){const o={};for(const[a,i]of Object.entries(t)){const t=wn(a,i,e,n);if(t.length>0){const e={kfs:t};void 0!==i.autoOrient&&(e.autoOrient=i.autoOrient),void 0!==i.loop&&(e.loop=i.loop),o[a]=r===G.webapi&&"transform"===a?en(e):e}}return o}(function(t){const e={};for(const n of t)for(const[t,r]of Object.entries(n))e[t]=r;return e}(a),o,r,e);return 0===Object.keys(i).length?null:{id:t,animate:i}},s=Ut(t);if(s)for(const t of s){const e=i(t.id,t.animate);e&&a.push(e)}const l=t=>{const e=t.animate;if(e&&Object.keys(e).length>0){const n=t.id||"_px_el_"+ ++Sn;t.id=n;const r=i(n,e);r&&a.push(r)}if(t.children)for(let e=0;e<t.children.length;e++)l(t.children[e])};if(t.children)for(let e=0;e<t.children.length;e++)l(t.children[e]);return a}function Mn(t,e,n){var r,o,a,i,s,l,u;const c=e.kfs||e.keyframes||[];if(0===c.length)return null;const{prevKf:f,nextKf:d}=function(t,e){var n,r;let o=t[0],a=t[t.length-1];for(let i=0;i<t.length-1;i++){const s=null!=(n=t[i].t)?n:0,l=null!=(r=t[i+1].t)?r:0;if(s<=e&&e<=l){o=t[i],a=t[i+1];break}}return{prevKf:o,nextKf:a}}(c,n);let m=f===d?0:(h=n,p=null!=(r=f.t)?r:0,y=null!=(o=d.t)?o:0,v=0,g=1,y===p?v:v+(h-p)/(y-p)*(g-v));var h,p,y,v,g;m=Ve(m,0,1);const b=null!=(a=f.e)?a:f.easing;if(b&&Array.isArray(b))try{m=we(b)(m)}catch(t){}let A=Ce(t)?Ue(t):t,k=null;const w=null!=(i=null==f?void 0:f.v)?i:null==f?void 0:f.value,j=null!=(s=null==d?void 0:d.v)?s:null==d?void 0:d.value;if("d"===A){k=be(null!=(l=null==w?void 0:w.paths)?l:Array.isArray(w)?w:[],null!=(u=null==j?void 0:j.paths)?u:Array.isArray(j)?j:[],m).map(t=>pe(t)).join("")}else if(Me.has(A))k=Se(ge(w||[0,0,0,1],j||[0,0,0,1],m)),A=t;else if("stroke-dasharray"===A)k=ve(w||[],j||[],m).join(" "),A=t;else if("transform"!==A||null===w||"object"!=typeof w||Array.isArray(w))if("translate"===A){k="translate("+ve(w||[0,0],j||[0,0],m).join(",")+")",A="transform"}else if("rotate"===A){k="rotate("+ye(+(w||0),+(j||0),m)+")",A="transform"}else if("scale"===A){k="scale("+ve(w||[1,1],j||[1,1],m).join(",")+")",A="transform"}else{k=ye(+(w||0),+(j||0),m)}else{const t=new Set([...w?Object.keys(w):[],...j?Object.keys(j):[]]),n={};for(const e of t){const t=null==w?void 0:w[e],r=null==j?void 0:j[e];if("rotate"===e)n.rotate=ye(+(null!=t?t:0),+(null!=r?r:0),m);else if("translate"===e||"scale"===e||"origin"===e){const o="scale"===e?[1,1]:[0,0],a=ve(t||o,r||o,m);n[e]=a}}if(Ye(e)){const t=w.translate,r=j.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=$e(f,d,[+t[0],+t[1]],[+r[0],+r[1]],m,!!e.autoOrient);n.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(n.rotate=o.rotateDeg)}}k=Ee(n,{withUnits:!1}),A="transform"}return Ie.has(A)&&"number"==typeof k&&(k=100*k+"%"),{k:A,v:null===k?"":""+k}}function _n(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=Mn(r,o,e);t&&(n[t.k]=t.v)}return n}function In(t,e,n,r){if(!e)return t;const o=!!e.trimAllAsOne,a=[];let i=0;const s=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const e of t.children)s(e);return}const e="string"==typeof t.d?t.d:function(t){var e,n,r,o;if("rect"!==t.type)return;const a=Number(null!=(e=t.x)?e:0),i=Number(null!=(n=t.y)?n:0),s=Number(null!=(r=t.width)?r:0),l=Number(null!=(o=t.height)?o:0);return"M"+(a+s)+","+i+"L"+(a+s)+","+(i+l)+"L"+a+","+(i+l)+"L"+a+","+i+"L"+(a+s)+","+i+"z"}(t);if(void 0===e)return;const n=hn(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){o||(i=0);const e=Bn(t);r.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:i}),i+=e}a.push(r)};if(s(t),!a.length)return t;const l=i;if(o&&l<.001)return t;const u=h(e.offset),d="absent"===u.kind?{kind:"static",value:0}:u,m=function(t){const e=h(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>{var e,n,r,o;return{time:null!=(n=null!=(e=t.time)?e:t.t)?n:0,value:null!=(r=t.value)?r:t.v,easing:null!=(o=t.easing)?o:t.e}});if(!n.some(t=>t.value[0]>t.value[1]))return{kind:"animated",keyframes:n.map(t=>({time:t.time,value:t.value,easing:t.easing}))};const r=[];for(let t=1;t<n.length;t++){const e=n[t-1],o=n[t];if((e.value[1]-e.value[0])*(o.value[1]-o.value[0])<0){const t=Ln(e,o);null!==t&&t>e.time&&t<o.time&&r.push(Math.round(t))}}const o=Array.from(new Set(r)).sort((t,e)=>t-e),a=[];let i=0;for(const t of n){for(;i<o.length&&o[i]<t.time;){const t=o[i++],e=Dn(n,t),r=(e[0]+e[1])/2;a.push({time:t,value:[r,r]})}const e=t.value[0]>t.value[1]?[t.value[1],t.value[0]]:t.value;a.push({time:t.time,value:e,easing:t.easing})}for(;i<o.length;){const t=o[i++],e=Dn(n,t),r=(e[0]+e[1])/2;a.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:a}}(e.range),p="absent"===m.kind?{kind:"static",value:[0,1]}:m,y=function(t){var e;if("absent"===t.kind)return[];if("static"===t.kind)return[t.value];const n=[];for(const r of t.keyframes){const t=null!=(e=r.value)?e:r.v;"number"==typeof t&&n.push(t)}return n}(d),v=[y.length?Math.min(...y):0,y.length?Math.max(...y):0];if(1===a.length&&a[0].leaf===t&&1===a[0].subpaths.length){const e=a[0],n=e.subpaths[0],r=o?l:n.lengthPx;if(r<.001)return t;const i=o?n.startOffsetPx/r:0;return function(t,e,n,r,o,a){const i=Nn(n,e,r),s=Cn(e,r),l=c({},t);return delete l.effects,Vn(l,"strokeDasharray",Un(a,s)),Vn(l,"strokeDashoffset",Un(o,i)),Vn(l,"strokeOpacity",Fn(a)),l}(e.leaf,r,i,v,d,p)}const g=new Map;for(const t of a){const e=[];for(const n of t.subpaths){const a=o?l:n.lengthPx;if(a<.001)continue;const i=o?n.startOffsetPx/a:0;e.push(...zn(t.leaf,n.subpath,a,i,v,d,p,r))}g.set(t.leaf,En(t.leaf,e))}const b=t=>{const e=g.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?f(c({},t),{children:t.children.map(b)}):t)};return b(t)}function En(t,e){const n=f(c({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function zn(t,e,n,r,o,a,i,s){const l=Nn(r,n,o),u=Cn(n,o),c=Un(a,l),f=Un(i,u),d=Fn(i),m=function(t){return{type:"path",d:t}}(pe(e));return Vn(m,"strokeDasharray",f),Vn(m,"strokeDashoffset",c),Vn(m,"strokeOpacity",d),[m]}var Tn=1;function Nn(t,e,n){const[r]=Rn(n);return n=>e*(-n-r+t)+Tn}function Cn(t,e){const[n,r]=Rn(e),o=r-n+1;return e=>{const n=Ve(e[0],0,1),r=Ve(e[1],0,1),a=Math.min(n,r),i=Math.max(n,r),s=[0];let l=Tn;for(let e=0;e<o;e++)s.push(l+a*t),s.push((i-a)*t),l=(1-i)*t;return s.push(l+Tn),s}}function Rn(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function Un(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>{var n,r,o,a;return{time:null!=(r=null!=(n=t.time)?n:t.t)?r:0,value:e(null!=(o=t.value)?o:t.v),easing:null!=(a=t.easing)?a:t.e}})}}function Vn(t,e,n){if(!n)return;if("static"===n.kind)return void(t[e]=n.value);const r=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,o=c({},r||{});o[e]={keyframes:n.keyframes},t.animate=o}function Fn(t){var e,n,r,o,a,i;const s=t=>t[0]===t[1];if("absent"===t.kind)return;if("static"===t.kind)return s(t.value)?{kind:"static",value:0}:void 0;const l=t.keyframes;let u=!1,c=!0;for(const t of l)s(null!=(e=t.value)?e:t.v)?u=!0:c=!1;if(!u)return;if(c)return{kind:"static",value:0};const f=[];for(let t=0;t<l.length;t++){const e=l[t],u=t>0?l[t-1]:void 0,c=t<l.length-1?l[t+1]:void 0,d=null!=(r=null!=(n=e.time)?n:e.t)?r:0,m=s(null!=(o=e.value)?o:e.v),h=u?m&&s(null!=(a=u.value)?a:u.v):m,p=c?m&&s(null!=(i=c.value)?i:c.v):m;h&&!p?(f.push({time:d,value:0}),f.push({time:d+1,value:1})):!h&&p&&(f.push({time:d-1,value:1}),f.push({time:d,value:0}))}return f.length<=1?void 0:{kind:"animated",keyframes:f}}function Ln(t,e){const n=n=>{const r=(n-t.time)/(e.time-t.time),o=t.value[0]+(e.value[0]-t.value[0])*r;return t.value[1]+(e.value[1]-t.value[1])*r-o};let r=t.time,o=e.time,a=n(r);if(0===a)return r;const i=n(o);if(0===i)return o;if(a*i>0)return null;for(let t=0;t<100;t++){const t=(r+o)/2,e=n(t);if(0===e||Math.abs(o-r)<1e-4)return t;a*e<0?o=t:(r=t,a=e)}return(r+o)/2}function Dn(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],a=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*a,r.value[1]+(o.value[1]-r.value[1])*a]}return t[t.length-1].value}function Bn(t){const e=t.v;if(!e||e.length<2)return 0;let n=0;for(let r=0;r<e.length-1;r++)n+=Wn(t,r,r+1);return t.c&&e.length>1&&(n+=Wn(t,e.length-1,0)),n}function Wn(t,e,n){var r,o,a,i;const s=t.v,l=s[e],u=s[n],c=We(l,null!=(o=null==(r=t.o)?void 0:r[e])?o:l,null!=(i=null==(a=t.i)?void 0:a[n])?i:u,u);return c.ds[c.ds.length-1]}function Kn(t){const e={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map},n=Gt(t);qt(n,e.idMap),b(n,e,()=>Wt(e,"inner")),function(t,e){const n=new Set,r=t=>{var o,a;const i=null==(a=null==(o=t.effects)?void 0:o.maskedBy)?void 0:a.href;if("string"==typeof i){n.add(t);const r=e.idMap.get(i);r&&n.add(r)}if(Array.isArray(t.children))for(const e of t.children)r(e)};if(r(t),0===n.size)return;const o=(t,r)=>{if(n.has(t)&&e.maskAncestorChains.set(t,r),Array.isArray(t.children)){const n=ae(t,e),a=n?[...r,n]:r;for(const e of t.children)o(e,a)}};o(t,[])}(n,e);const r=function(t,e){return function(t,e){var n;e.idMap.clear(),qt(t,e.idMap);const r=[],o=t=>{var e,n;(null==(e=t.effects)?void 0:e.retime)&&r.push(t),null==(n=t.children)||n.forEach(o)};o(t);for(const t of r){const r=null==(n=t.effects)?void 0:n.retime;r&&(delete t.effects.retime,0===Object.keys(t.effects).length&&delete t.effects,ce(t,ue(r),e))}}(t,e),t}(qn(n,e),e);return function(t,e){if(!e.length)return;(t.children||(t.children=[])).unshift({type:"defs",children:e})}(r,e.defs),{root:r,defs:e.defs,warnings:e.warnings,errors:e.errors}}function qn(t,e){t.children&&(t.children=t.children.map(t=>qn(t,e)));const n=t.effects,r="string"==typeof t.id?t.id:void 0,o=r?e.contentRefInnerIds.get(r):void 0;if(!n&&!o)return t;const{transformation:a,repeater:i,maskedBy:s,trimPath:l,retime:u,ref:c,fillGradient:f,strokeGradient:d,textAlongPath:m}=null!=n?n:{};null==n||n.isCombinedShape;n&&delete t.effects;let h=t;return h=function(t,e){var n;if(!e)return t;const r={type:"textPath",href:"string"!=typeof e.href||e.href.startsWith("#")?e.href:"#"+e.href,children:null!=(n=t.children)?n:[]};return void 0!==e.lengthAdjust&&(r.lengthAdjust=e.lengthAdjust),void 0!==e.method&&(r.method=e.method),void 0!==e.spacing&&(r.spacing=e.spacing),he(r,"startOffset",e.startOffset),he(r,"textLength",e.textLength),t.children=[r],t}(h,m),h=function(t,e,n){return Xt(t,e,n,"fill")}(h,f,e),h=function(t,e,n){return Xt(t,e,n,"stroke")}(h,d,e),h=In(h,l,0,e),h=function(t,e,n){var r,o;if(!e)return t;const a=null!=(r=e.copies)?r:1;if(a<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const i=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=Gt(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate);const u=[l];for(let t=1;t<a;t++){const r=Gt(l),o=se(e,t),a=o?y(r,o,n):r;u.push(a)}const c={type:"g",children:u};return void 0!==i&&(c.transform=i),void 0!==s&&(c.animate={transform:s}),c}(h,i,e),h=$t(h,s,a,e),h=o?A(h,a,r,o,e):function(t,e,n,r){if(e){const n=e.baseId;if(n){const o=e.type===ie&&r.contentRefInnerIds.get(n)||n;t.href="#"+o}else r.errors.push("ref: missing baseId")}return y(t,n,r)}(h,c,a,e),u&&(t.effects={retime:u}),r&&e.idMap.set(r,h),h}function Gn(t){var e;const n=function(t){const e=new Map,n=t=>{var r;"string"==typeof t.id&&e.set(t.id,t),null==(r=t.children)||r.forEach(n)};return n(t),e}(t),r=function(t,e){const n=new WeakMap,r=new Set,o=(t,r)=>{const a=n.get(t);if(void 0!==a)return a;if(r.has(t))return!1;r.add(t);let i=!1;if(t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate))for(const e in t.animate){i=!0;break}if(!i&&t.children)for(const e of t.children)if(o(e,r)){i=!0;break}if(!i&&"use"===t.type&&"string"==typeof t.href){const n=Xn(t.href),a=n?e.get(n):void 0;a&&(i=o(a,r))}return r.delete(t),n.set(t,i),i};for(const[t,n]of e)o(n,new Set)&&r.add(t);return r}(0,n);if(0===r.size)return t;let o=0;const a=[],i=Zn(t,n,r,()=>"_lw_use_mat_"+ ++o,a);if(0===a.length)return i;const s={type:"defs",children:a},l=[...null!=(e=i.children)?e:[],s];return f(c({},i),{children:l})}function Xn(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function Yn(t,e,n,r,o,a){const i=Ft(e);Lt(i,o);const s="symbol"===i.type?function(t,e,n){const r=function(t){if("string"!=typeof t)return;const e=t.trim().split(/[\s,]+/).map(Number);return e.length<4||e.some(t=>!Number.isFinite(t))?void 0:[e[0],e[1],e[2],e[3]]}(t.viewBox),o=f(c({},t),{type:"g"});if(delete o.viewBox,delete o.preserveAspectRatio,delete o.width,delete o.height,!r)return o;const[a,i,s,l]=r;0===a&&0===i||(o.transform="translate("+-a+","+-i+")");const u=e();return n.push({type:"clipPath",id:u,children:[{type:"rect",x:a,y:i,width:s,height:l}]}),o.clipPath="url(#"+u+")",o}(i,o,a):i,l=Zn(s,n,r,o,a),u=f(c({},t),{type:"g",children:[l]});return delete u.href,Bt(u)}function Zn(t,e,n,r,o){if("use"===t.type&&"string"==typeof t.href){const a=Xn(t.href);if(a&&n.has(a)){const i=e.get(a);if(i)return Yn(t,i,e,n,r,o)}}if(!t.children)return t;let a=!1;const i=t.children.map(t=>{const i=Zn(t,e,n,r,o);return i!==t&&(a=!0),i});return a?f(c({},t),{children:i}):t}function Jn(t,e,n){var r,o;let a=Kn(t).root;return a=Pn(a,null!=(o=null==(r=Ct(a))?void 0:r.duration)?o:Te),e===G.webapi&&(a=dn(a,null==n?void 0:n.motionPath),a=Gn(a)),a}var $n="http://www.w3.org/2000/svg",Hn=new Set(["script","foreignobject"]),Qn=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),tr=new Set(["href","xlink:href","src"]),er=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i;function nr(t,e){const n=t.toLowerCase();if(!function(t){return!!t.startsWith("on")}(n)){if("fill"===n||"stroke"===n||"stopcolor"===n){const t=String(e);return t.includes("url(")&&!/^url\(#[^)]+\)$/.test(t)?void console.warn('Attribute "'+n+'" blocked: url() must be internal url(#id), got:',e):e}if(Qn.has(n)){const t=String(e);return t.startsWith("#")||(/^url\(#[^)]+\)$/.test(t)||tr.has(n)&&er.test(t))?e:void console.warn('Attribute "'+n+'" blocked: must be #id, url(#id), or base64 raster data: URI, got:',e)}return e}console.warn("Attribute blocked (event handler / dangerous): ",n)}function rr(t){const e={};for(const n of Object.keys(t)){const r=Ne(n);if(Z.has(r))continue;if("style"===r)continue;let o=t[n];Me.has(r)&&Array.isArray(o)?e[r]=Se(o):"transform"===r&&null!==o&&"object"==typeof o&&!Array.isArray(o)&&o.value&&"object"==typeof o.value?e.transform=Ee(o.value,{withUnits:!1}):_e.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),e.transform=r+"("+o+")"):null!=o&&(e[r]=String(o))}return e}function or(t,e){if(!t)return null;const n=t,{type:r,children:o,style:a}=n,u=((t,e)=>{var n={};for(var r in t)s.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&i)for(var r of i(t))e.indexOf(r)<0&&l.call(t,r)&&(n[r]=t[r]);return n})(n,["type","children","style"]),c=Rt(t)||e,f=function(t,e){var n;if(t)return"string"==typeof t?null==(n=null==e?void 0:e.styles)?void 0:n[t]:t}(a,c);let d;if(o)for(const t of o){const e=or(t,c);e&&(d||(d=[]),d.push(e))}return function(t,e,n,r,o){if(Hn.has(t.toLowerCase()))return console.warn("SVG tag blocked (dangerous): ",t),null;const a=document.createElementNS($n,t);for(const t in e){const n=nr(t,e[t]);void 0!==n&&a.setAttribute(Ue(t),n)}if(n)for(const t in n)a.style[t]=String(n[t]);if(r)for(const t of r)a.appendChild(t);return o&&(a.textContent=o),a}(r||"g",rr(u),f,d,u[X]||u[Y])}function ar(t,e){const{startOn:n,outAction:r="continue",scrollIntoViewThreshold:o=.5}=e,a=t.getRootElement();if(!a)return console.warn("setupAnimationTriggers: No root element found for animation."),t;const i=()=>{t.play()},s=()=>{switch(r){case"pause":t.pause();break;case"reset":t.cancel();break;case"reverse":t.play()}};switch(n){case"load":{const t=()=>i();"complete"===document.readyState?t():window.addEventListener("load",t,{once:!0});break}case"mouseOver":{const t=()=>i(),e=()=>s();a.addEventListener("mouseenter",t),a.addEventListener("mouseleave",e);break}case"click":{const e=()=>{t.isPlaying()?s():i()};a.addEventListener("click",e);break}case"scrollIntoView":new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&t.intersectionRatio>=o?i():s()})},{threshold:o}).observe(a);break}return t}function ir(t){return"#"+t}function sr(t,e,n){const r=Ct(t)||{},o=On(t,G.frames),a=r.iterations;let i=1;"number"==typeof a&&(i=a||1),"infinite"===a&&(i=1/0),i<1&&(i=1);const s=+(r.duration||Te),l=s&&i?s*(i===1/0?1/0:i):s?(null!=i?i:1)*s:0,u=r.direction||"normal";let c=null,f=!1,d=r.delay||0,m=0,h=1,p=!1;const y=r.frameRate,v=y&&y>0?1e3/y:0;let g=0;const b=()=>{const t=m?(Date.now()-m)*h:0;let e=d+t;return Number.isFinite(l)&&e>l&&(e=l),e<0&&(e=0),e};function A(t){let n=function(){const e=s>0?s:1;let n=0,r=0;if(s>0){t=Ve(t,0,i*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,i-1);n=Ve((t-r*e)/e,0,1)}else n=t;const o=u||"normal";let a=n;return"reverse"===o?a=1-n:"alternate"===o?r%2==1&&(a=1-n):"alternate-reverse"===o&&r%2==0&&(a=1-n),a}();for(const t of o||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=_n(r,n*s);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}r.delay&&A(b());const k=()=>!!f&&(!!e.isConnected()&&!(Number.isFinite(l)&&b()>=l)),w=t=>{null!==c&&(cancelAnimationFrame(c),c=null),(t||k())&&(c=requestAnimationFrame(()=>{c=null,(()=>{var t;if(!e.isConnected())return void j();const r=b();if(v>0){const t=Date.now();if(g&&t-g<v)return;g=t}if(l&&Number.isFinite(l)&&r>=l)return A(l),p||(p=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)),void j();A(r)})(),w()}))},j=()=>{f&&(d=b(),m=0,f=!1,null!==c&&(cancelAnimationFrame(c),c=null),A(d))},P={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>k(),play:()=>{var t;f||(Number.isFinite(l)&&d>=l&&(d=0,p=!1),f=!0,m=Date.now(),w(!0)),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;j(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;j(),d=0,m=0,f=!1,p=!1,A(d),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;d=Number.isFinite(l)?l:b(),m=0,f=!1,A(d),t&&!p&&(p=!0,null==(e=null==n?void 0:n.onFinish)||e.call(n))})(!0)},setPlaybackRate:t=>{if(!isFinite(t)||0===t)return void console.warn("setPlaybackRate: rate must be finite and non-zero");const e=b();h=t,d=e,f&&(m=Date.now())},getCurrentTime:()=>b(),setCurrentTime:t=>{t<0&&(t=0),Number.isFinite(l)&&t>l&&(t=l),d=t,f&&(m=Date.now()),A(b())},destroy:()=>{P.cancel()}};return P}function lr(t,e,n,r){const o=Ct(t)||{};if(!r)if(t.id){const e=ir(t.id);(r=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");let a=sr(t,e||function(t){const e=new Set,n={isConnected:()=>!t||t.isConnected,setAttribute:(n,r,o)=>{r=Ue(r);const a=ir(n),i=(null==t?void 0:t.querySelectorAll(a))||document.querySelectorAll(a);0!==i.length||e.has(a)||(e.add(a),console.warn('setAttribute: No elements found for selector "'+a+'"'));for(let t=0;t<i.length;t++){const e=i[t];e.setAttribute(r,o),ze.has(r)&&(e.style[r]=o)}}};return n}(r),n);return a=f(c({},a),{getRootElement:()=>r||null}),o.trigger&&ar(a,o.trigger),a}function ur(t,e,n,r){var o,a;let i=null!=(o=t.v)?o:t.value;const s=null!=(a=t.e)?a:t.easing,l={offset:e,easing:s&&Array.isArray(s)?"cubic-bezier("+s.join(",")+")":void 0};let u,c=n;return Me.has(n)&&Array.isArray(i)?u=Se(i):"transform"!==n||null===i||"object"!=typeof i||Array.isArray(i)?_e.has(n)?(Array.isArray(i)&&("translate"===n&&(i=i.map(t=>t+"px")),i=i.join(",")),"rotate"===n&&(i+="deg"),u=n+"("+i+")",c="transform"):u=""+i:(u=Ee(i,{withUnits:!0}),c="transform"),CSS.supports(c,u)||r.add(c),c=Ne(c),l[c]=u,l}function cr(t,e,n){var r,o,a,i,s;const l=[];for(let u=0;u<e.length;u++){const d=e[u],m=null!=(r=d.t)?r:0;if(m<0){const n=e[u+1];if(n&&(null!=(o=n.t)?o:0)>=0){const e=(0-m)/((null!=(a=n.t)?a:0)-m),r=d.e?we(d.e)(e):e,{right:o}=Pe(d.e,e);l.push({t:0,v:An(t,d.v,n.v,r),e:o})}continue}if(m>n){const r=e[u-1];if(r&&(null!=(i=r.t)?i:0)<=n){const e=null!=(s=r.t)?s:0,o=(n-e)/(m-e),a=r.e?we(r.e)(o):o,{left:i}=Pe(r.e,o);l.length>0&&(l[l.length-1]=f(c({},l[l.length-1]),{e:i})),l.push({t:n,v:An(t,r.v,d.v,a),e:void 0})}break}l.push(d)}return l}function fr(t,e,n){var r;const o=new Map;for(const[a,i]of Object.entries(t)){const t=n.duration||1,s=cr(a,i.kfs||i.keyframes||[],t),l=[];for(let n=0;n<s.length;n++){const o=s[n],i=ur(o,Ve((null!=(r=o.t)?r:0)/t,0,1),a,e);0===n&&(i.offset||0)>0&&l.push(f(c({},i),{offset:0})),l.push(i)}l.length>0&&(l[l.length-1].offset||0)<1&&l.push(f(c({},l[l.length-1]),{offset:1})),l.length>0&&o.set(a,l)}return o}function dr(t,e,n,r){var o;const a=Ct(t)||{};if(!n)if(t.id){const e=ir(t.id);(n=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");const i=On(t,G.webapi),s=[],l=a.iterations;let u;"number"==typeof l&&(u=l),"infinite"===l&&(u=1/0);const c=new Set;(null==i?void 0:i.length)||console.warn("createWebApiAnimator: No animation bindings defined");for(const t of i||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("createWebApiAnimator: Empty or unresolved binding",t);continue}const i=ir(t.id),l=(null==n?void 0:n.querySelectorAll(i))||document.querySelectorAll(i);0===l.length&&console.warn('createWebApiAnimator: No elements found for selector "'+i+'"');const f=fr(r,c,a),d=a.delay&&a.delay>0?a.delay:void 0,m=a.delay&&a.delay<0&&a.duration?-a.delay%a.duration:void 0,h={duration:a.duration,delay:d,fill:null!=(o=a.fill)?o:"forwards",direction:a.direction,iterations:u};for(let t=0;t<l.length;t++){const n=l[t];for(const[,t]of f)if(t.length>0)try{const r=new KeyframeEffect(n,t,h),o=new Animation(r,document.timeline);(null==e?void 0:e.onFinish)&&(o.onfinish=()=>{var t;return null==(t=e.onFinish)?void 0:t.call(e)}),(null==e?void 0:e.onRemove)&&(o.onremove=()=>{var t;return null==(t=e.onRemove)?void 0:t.call(e)}),m&&(o.currentTime=m),s.push(o)}catch(t){console.warn(t)}}}if(!r&&c.size)return console.warn("Unsupported CSS attrs: "+[...c].join(", ")),null;const f={isReady:()=>!0,getRootElement:()=>n||null,isPlaying:()=>{var t;return"running"===(null==(t=s[0])?void 0:t.playState)},play:()=>{var t;s.forEach(t=>t.play()),null==(t=null==e?void 0:e.onPlay)||t.call(e)},pause:()=>{var t;s.forEach(t=>t.pause()),null==(t=null==e?void 0:e.onPause)||t.call(e)},cancel:()=>{var t;s.forEach(t=>t.cancel()),null==(t=null==e?void 0:e.onCancel)||t.call(e)},finish:()=>{var t;for(const e of s)try{(null==(t=e.effect)?void 0:t.getTiming().iterations)===1/0?(e.effect.updateTiming({iterations:1}),e.finish(),e.effect.updateTiming({iterations:1/0})):e.finish()}catch(t){e.cancel()}},setPlaybackRate:t=>(s.forEach(e=>e.playbackRate=t),f),getCurrentTime:()=>{var t,e;const n=null!=(e=null==(t=s[0])?void 0:t.currentTime)?e:null;return null!==n?+n:null},setCurrentTime:t=>{s.forEach(e=>{e.currentTime=t})},destroy:()=>{f.cancel(),s.splice(0,s.length)}};return a.trigger&&ar(f,a.trigger),f}var mr=0;function hr(){return"_px_"+Date.now().toString(36)+(++mr).toString(36)+Math.random().toString(36).substring(2,6)}function pr(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>pr(t));const e=t,n={};for(const t of Object.keys(e))n[t]=pr(e[t]);return n}function yr(t){var e,n;const r=pr(t),o=new Map,a=new Set(["href","xlink:href"]),i=new Set(["fill","stroke","clip-path","clipPath","mask","marker","marker-start","marker-mid","marker-end","filter","flood-color","lighting-color"]),s=new Set(["baseId","targetId","boundElementId"]);!function t(e){if(e&&"object"==typeof e){if(e.id&&"string"==typeof e.id){const t=e.id,n=hr();o.set(t,n),e.id=n}else e.animate&&(e.id=hr());if(Array.isArray(e.children))for(const n of e.children)t(n)}}(r),function t(e){if(e&&"object"==typeof e)for(const[n,r]of Object.entries(e))if("children"!==n)if("string"==typeof r)if(a.has(n)&&r.startsWith("#")){const t=r.slice(1),a=o.get(t);a&&(e[n]="#"+a)}else if(i.has(n))e[n]=vr(r,o);else if(s.has(n)){const t=o.get(r);t&&(e[n]=t)}else r.includes("url(#")&&(e[n]=vr(r,o));else if("style"===n&&"object"==typeof r&&null!==r)for(const[t,e]of Object.entries(r))"string"==typeof e&&(r[t]=vr(e,o));else"object"==typeof r&&null!==r&&t(r);else if(Array.isArray(r))for(const e of r)t(e)}(r);const l=null==(e=r.animator)?void 0:e.animate;if(l&&"object"==typeof l){const t={};for(const[e,r]of Object.entries(l)){t[null!=(n=o.get(e))?n:e]=r}r.animator=f(c({},r.animator),{animate:t})}return r}function vr(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}function gr(t,e,n,r){const o=Ot(t);for(const t of o)console.warn("[PxAnimator] effects shape warning:",t);const a=Ct(t)||{};a.debug=!0;t=Jn(t,a.mode===q.frames?G.frames:G.webapi);let i=null;if(r&&t.children){t=yr(t);const e="string"==typeof r?document.querySelector(r):r;e&&(i=or(t),i&&e.replaceChildren(i))}return function(t,e,n,r){const o=Ct(t)||{};let a;return a=o.mode===q.frames?lr(t,e,n,r):dr(t,n,r,o.mode===q.webapi)||lr(t,e,n,r),o.debugInstName&&(window[o.debugInstName]=a),a}(t,e,n,i)}var br="data";function Ar(t){const{src:e,data:n,adapter:r,callbacks:o,container:a}=t;if(void 0!==n&&void 0!==e)throw new Error("createAnimator: provide either `src` or `data`, not both");if(void 0===n&&void 0===e)throw new Error("createAnimator: either `src` or `data` is required");if(void 0!==n)return gr(n,r,o,a);let i=null;return fetch(e).then(t=>t.json()).then(t=>{Tt(t)?i=gr(t,r,o,a):console.error("Invalid animation document format")}),{isReady:()=>!!i,getRootElement:()=>i?i.getRootElement():null,isPlaying:()=>(null==i?void 0:i.isPlaying())||!1,play:()=>{null==i||i.play()},pause:()=>{null==i||i.pause()},cancel:()=>{null==i||i.cancel()},finish:()=>{null==i||i.finish()},setPlaybackRate:t=>{null==i||i.setPlaybackRate(t)},getCurrentTime:()=>(null==i?void 0:i.getCurrentTime())||0,setCurrentTime:t=>{null==i||i.setCurrentTime(t)},destroy:()=>{null==i||i.destroy()}}}function kr(){const t=document.querySelectorAll("["+W+"]");for(let e=0;e<t.length;e++){const n=t[e];if(!n[K]){const t=n.getAttribute(W);t&&(n[K]=Ar({src:t,container:n}))}}}"undefined"!=typeof window&&(window.loadTagAnimators=kr,window.createAnimator=Ar,window.setupAnimationTriggers=ar);var wr=[1,0,0,1,0,0];function jr(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}var Pr=(t,e)=>[1,0,0,1,t,e],xr=(t,e)=>[t,0,0,e,0,0];function Sr(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var Or=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],Mr=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function _r(t){let e=wr;t.translate&&(e=jr(e,Pr(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=jr(e,Pr(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=jr(e,Sr(t.rotate))),t.scale&&(e=jr(e,xr(t.scale[0],t.scale[1]))),n&&(e=jr(e,Pr(-t.origin[0],-t.origin[1]))),e}function Ir(t,e,n){return t+(e-t)*n}function Er(t,e){return null==t?wr:"string"==typeof t?function(t){let e=wr;const n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);){const t=r[1],n=r[2].split(/[\s,]+/).filter(Boolean).map(Number);"translate"===t?e=jr(e,Pr(n[0]||0,n[1]||0)):"scale"===t?e=jr(e,xr(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=jr(e,Sr(n[0])):"skewX"===t?e=jr(e,Or(n[0])):"skewY"===t?e=jr(e,Mr(n[0])):"matrix"===t&&(e=jr(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?_r(function(t,e){var n,r,o,a,i,s,l;if(!t.length)return{};if(e<=(null!=(n=t[0].time)?n:0))return t[0].value||{};if(e>=(null!=(r=t[t.length-1].time)?r:0))return t[t.length-1].value||{};let u=0;for(;u<t.length-1&&(null!=(o=t[u+1].time)?o:0)<e;)u++;const c=t[u],f=t[u+1],d=(e-(null!=(a=c.time)?a:0))/((null!=(i=f.time)?i:0)-(null!=(s=c.time)?s:0)||1),m=c.value||{},h=f.value||{},p={};return m.translate&&h.translate?p.translate=[Ir(m.translate[0],h.translate[0],d),Ir(m.translate[1],h.translate[1],d)]:p.translate=m.translate||h.translate,void 0!==m.rotate&&void 0!==h.rotate?p.rotate=Ir(m.rotate,h.rotate,d):p.rotate=null!=(l=m.rotate)?l:h.rotate,m.scale&&h.scale?p.scale=[Ir(m.scale[0],h.scale[0],d),Ir(m.scale[1],h.scale[1],d)]:p.scale=m.scale||h.scale,p.origin=m.origin||h.origin,p}(t.keyframes,e)):t.value?_r(t.value):wr}var zr=new Set(["svg","g","symbol"]),Tr=new Set(["defs","mask","clipPath","title"]);function Nr(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Nr(t,e))}function Cr(t){return null==t?0:Number(t)}function Rr(t){return Math.round(100*t)/100+0}function Ur(t,e,n){var r,o,a,i,s;const l=null!=(r=t.fill)?r:"",u=null!=(o=t.stroke)?o:"",c=null!=(i=null!=(a=t["stroke-width"])?a:t.strokeWidth)?i:"",f=Rr(function(t,e,n,r){var o,a,i,s,l,u;if(t&&t.keyframes&&t.keyframes.length){const e=t.keyframes;if(r<=(null!=(o=e[0].time)?o:0))return e[0].value;if(r>=(null!=(a=e[e.length-1].time)?a:0))return e[e.length-1].value;let n=0;for(;n<e.length-1&&(null!=(i=e[n+1].time)?i:0)<r;)n++;const c=e[n],f=e[n+1],d=(r-(null!=(s=c.time)?s:0))/((null!=(l=f.time)?l:0)-(null!=(u=c.time)?u:0)||1);return Ir(c.value,f.value,d)}return void 0!==e?Number(e):n}(null==(s=t.animate)?void 0:s.opacity,t.opacity,1,n)),d=t.mask?1:0,m=e.map(Rr).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return Cr(t.width)+","+Cr(t.height)+","+Cr(t.x)+","+Cr(t.y);case"ellipse":return Cr(t.rx)+","+Cr(t.ry)+","+Cr(t.cx)+","+Cr(t.cy);case"circle":return Cr(t.r)+","+Cr(t.cx)+","+Cr(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+m+"]|f:"+l+"|s:"+u+"|sw:"+(Cr(c)||"")+"|o:"+f+"|m:"+d}function Vr(t,e,n,r,o){var a;const i=t.type||"";if(Tr.has(i))return;const s=jr(e,function(t,e){return t.animate&&t.animate.transform?Er(t.animate.transform,e):void 0!==t.transform?Er(t.transform,e):wr}(t,n));if("use"===i){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",a=r.get(e),i=jr(s,Pr(Cr(t.x),Cr(t.y)));return void(a?Vr(a,i,n,r,o):o.push("UNRESOLVED_USE:#"+e))}zr.has(i)?null==(a=t.children)||a.forEach(t=>Vr(t,s,n,r,o)):o.push(Ur(t,s,n))}function Fr(t,e){var n;e.add(0);(t=>{var n;if(t&&"object"==typeof t)for(const r of Object.keys(t)){const o=null==(n=t[r])?void 0:n.keyframes;Array.isArray(o)&&o.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)})}})(t.animate),t.transform&&"object"==typeof t.transform&&t.transform.keyframes&&t.transform.keyframes.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)}),null==(n=t.children)||n.forEach(t=>Fr(t,e))}function Lr(t,e){const n=new Map;Nr(t,n);const r=[];return Vr(t,wr,e,n,r),r.sort()}function Dr(t,e){const n=new Set;Fr(t,n),Fr(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=Lr(t,o),a=Lr(e,o),i=Br(n,a),s=Br(a,n);(i.length||s.length)&&r.push({time:o,onlyInA:i,onlyInB:s})}return r}function Br(t,e){const n=new Map;for(const t of e)n.set(t,(n.get(t)||0)+1);const r=[];for(const e of t){const t=n.get(e)||0;t>0?n.set(e,t-1):r.push(e)}return r}