@pixodesk/svg-animator-web 1.0.8 → 1.0.15

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,a=Object.prototype.hasOwnProperty,l=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={};function f(e,t,n){return e+(t-e)*n}function d(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 p(e,t,n){var r,o,i,s,a,l,u,c,f;if(!e||!t)return e||t||{v:[]};const p=Math.min(Math.max(n,0),1),m=Math.min(e.v.length,t.v.length),h=[],v=[],y=[];for(let n=0;n<m;n++){const f=e.v[n],m=t.v[n];h.push(d(f,m,p));const g=null!=(o=null==(r=e.i)?void 0:r[n])?o:f,b=null!=(s=null==(i=t.i)?void 0:i[n])?s:m;v.push(d(g,b,p));const A=null!=(l=null==(a=e.o)?void 0:a[n])?l:f,w=null!=(c=null==(u=t.o)?void 0:u[n])?c:m;y.push(d(A,w,p))}return{v:h,i:v.length?v:void 0,o:y.length?y:void 0,c:null!=(f=e.c)?f:t.c}}function m(e){const[t,n,r,o]=e,i=3*t,s=3*(r-t)-i,a=1-i-s,l=3*n,u=3*(o-n)-l,c=1-l-u;function f(e){return((a*e+s)*e+i)*e}function d(e){return(3*a*e+2*s)*e+i}return function(e){return t=function(e){if(e<=0)return 0;if(e>=1)return 1;let t=e,n=0,r=1;for(let n=0;n<8;n++){const n=f(t)-e;if(Math.abs(n)<1e-6)return t;const r=d(t);if(Math.abs(r)<1e-6)break;t-=n/r}for(t=e;n<r;){const o=f(t);if(Math.abs(o-e)<1e-6)return t;e>o?n=t:r=t,t=(r+n)/2}return t}(e),((c*t+u)*t+l)*t;var t}}function h(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 v(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,a=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==s&&a.push(parseInt(s,16)/255),a}(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)}}((e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})})(c,{COLOUR_ATTR_NAMES:()=>y,PX_ANIM_ATTR_NAME:()=>R,PX_ANIM_SRC_ATTR_NAME:()=>N,STYLE_ATTR_NAMES:()=>A,TRANSFORM_FN_NAMES:()=>g,calcAnimationValues:()=>oe,camelCaseToKebabWordIfNeeded:()=>j,createAnimator:()=>he,createAnimatorImpl:()=>me,createBasicFrameLoopAnimator:()=>se,createFrameLoopAnimator:()=>ae,createWebApiAnimator:()=>ue,generateNewIds:()=>de,getAnimatorConfig:()=>B,getBindings:()=>Z,getChildren:()=>X,getDefs:()=>K,getNormalizedProps:()=>M,isPxElementFileFormat:()=>P,isPxElementFileFormatDeep:()=>V,loadTagAnimators:()=>ve,normalizeDocument:()=>ne,renderNode:()=>C,setupAnimationTriggers:()=>T,toRGBA:()=>h}),module.exports=(e=c,((e,n,o,s)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let l of i(n))a.call(e,l)||l===o||t(e,l,{get:()=>n[l],enumerable:!(s=r(n,l))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var y=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),g=new Set(["translate","rotate","scale","skew"]),b=new Set(["offset-distance","offsetDistance"]),A=new Set(["offset-distance","offsetDistance"]),w=1e3;function x(e){return e.includes("-")?e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()):e}var k=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 j(e){return k.has(e)?e:e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function O(e,t,n){return Math.max(t,Math.min(e,n))}var S="http://www.w3.org/2000/svg",E=new Set(["type","children","animate","style","animator","defs","bindings"]);function M(e){const t={};for(const n of Object.keys(e)){if(E.has(n))continue;let r=e[n];y.has(n)&&Array.isArray(r)?t[n]=h(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 C(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)a.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&&l.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=C(e,f);t&&(p||(p=[]),p.push(t))}return function(e,t,n,r){const o=document.createElementNS(S,e);for(const e in t)o.setAttribute(j(e),t[e]);if(n)for(const e in n)o.style[e]=String(n[e]);if(r)for(const e of r)o.appendChild(e);return o}(r||"g",M(c),d,p)}function T(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()},a=()=>{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=()=>a();i.addEventListener("mouseenter",e),i.addEventListener("mouseleave",t);break}case"click":{const t=()=>{e.isPlaying()?a():s()};i.addEventListener("click",t);break}case"scrollIntoView":new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&e.intersectionRatio>=o?s():a()})},{threshold:o}).observe(i);break}return e}var N="data-px-animation-src",R="_px_animator";function P(e){return!(!e||"object"!=typeof e||Array.isArray(e))&&("svg"===e.type||"svg"===e.tagName)}function F(e){return e&&"object"==typeof e&&!Array.isArray(e)}function I(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 _(e,t,n){if(!F(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||I(e.easing,t+".easing",n)||(r=!1),void 0===e.e||I(e.e,t+".e",n)||(r=!1),r}function L(e,t,n){if(!F(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)=>{_(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)=>{_(e,t+".kfs["+o+"]",n)||(r=!1)}):(n.push(t+".kfs: expected array"),r=!1)),r}function D(e,t,n){if(!F(e))return n.push(t+": expected object"),!1;let r=!0;for(const o of Object.keys(e))L(e[o],t+"."+o,n)||(r=!1);return r}function U(e,t,n){if("string"==typeof e)return!0;if(Array.isArray(e)){let r=!0;return e.forEach((e,o)=>{"string"==typeof e||D(e,t+"["+o+"]",n)||(r=!1)}),r}return F(e)?D(e,t,n):(n.push(t+": expected string, array, or PxAnimationDefinition object"),!1)}function z(e,t,n){if(!F(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(!F(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 q(e,t,n){if(!F(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)=>{q(e,t+".children["+o+"]",n)||(r=!1)}):(n.push(t+".children: expected array"),r=!1)),void 0===e.animate||U(e.animate,t+".animate",n)||(r=!1),r}function W(e,t,n){if(!q(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||z(e.animator,t+".animator",n)||(r=!1),void 0===e.defs||function(e,t,n){if(!F(e))return n.push(t+": expected object"),!1;let r=!0;if(void 0!==e.easings)if(F(e.easings))for(const o of Object.keys(e.easings))I(e.easings[o],t+".easings."+o,n)||(r=!1);else n.push(t+".easings: expected object"),r=!1;if(void 0!==e.animations)if(F(e.animations))for(const o of Object.keys(e.animations))D(e.animations[o],t+".animations."+o,n)||(r=!1);else n.push(t+".animations: expected object"),r=!1;return void 0===e.styles||F(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(!F(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),U(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||q(e.design,t+".design",n)||(r=!1),r}function V(e){const t=[];return{valid:W(e,"root",t),errors:t}}function B(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 K(e){var t;if(e)return e.defs||(null==(t=e.meta)?void 0:t.defs)}function Z(e){var t;if(e)return e.bindings||(null==(t=e.meta)?void 0:t.bindings)}function X(e){return null==e?void 0:e.children}function Y(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,a=o[5]||0;n.o[n.o.length-1]=[e,t],n.v.push([s,a]),n.i.push([r,i]),n.o.push([s,a])}else"Z"!==r&&"z"!==r||(n.c=!0)}return t}function $(e){return e.startsWith("path(")&&e.endsWith(")")?e.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(e)?e:void 0}function G(e){return"string"==typeof e&&void 0!==$(e)}function H(e){if(e&&"object"==typeof e&&"paths"in e){const t=e.paths;if(Array.isArray(t)&&t.length>0&&G(t[0])){const e=[];for(const n of t){const t=$(n);t&&e.push(...Y(t))}return{paths:e}}return e}if(Array.isArray(e)){if(e.length>0&&G(e[0])){const t=[];for(const n of e){const e=$(n);e&&t.push(...Y(e))}return{paths:t}}return{paths:e}}if(G(e)){return{paths:Y($(e))}}return e}function Q(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 J(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 ee(e,t,n,r){var o,i,s,a,l;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!=(a=t.easing)?a:t.e;"d"===e&&(u=H(u)),y.has(e)&&(u=null!=(l=v(u))?l:u),c.push({t:n,v:u,e:Q(f,r)})}return c.sort((e,t)=>{var n,r;return(null!=(n=e.t)?n:0)-(null!=(r=t.t)?r:0)}),c}var te=0;function ne(e){const t=B(e)||{},n=K(e),r=(t.duration,[]),o=(e,t)=>{if(!t)return null;const r=function(e,t){if(!e)return[];const n=[];if("string"==typeof e){const r=J(e,t);r&&n.push(r)}else if(Array.isArray(e))for(const r of e){const e=J(r,t);e&&n.push(e)}else n.push(e);return n}(t,n);if(0===r.length)return null;const o=function(e,t,n){const r={};for(const[t,o]of Object.entries(e)){const e=ee(t,o,0,n);e.length>0&&(r[t]={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}(r),0,n);return 0===Object.keys(o).length?null:{id:e,animate:o}},i=Z(e);if(i)for(const e of i){const t=o(e.id,e.animate);t&&r.push(t)}const s=e=>{if(e.animate){const t=e.id||"_px_el_"+ ++te;e.id=t;const n=o(t,e.animate);n&&r.push(n)}if(e.children)for(let t=0;t<e.children.length;t++)s(e.children[t])};if(e.children)for(let t=0;t<e.children.length;t++)s(e.children[t]);return r}function re(e,t,n){var r,o,i,s,a,l,u;const c=t.kfs||t.keyframes||[];if(0===c.length)return null;const{prevKf:v,nextKf:g}=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 a=null!=(n=e[s].t)?n:0,l=null!=(r=e[s+1].t)?r:0;if(a<=t&&t<=l){o=e[s],i=e[s+1];break}}return{prevKf:o,nextKf:i}}(c,n);let A=v===g?0:(w=n,x=null!=(r=v.t)?r:0,k=null!=(o=g.t)?o:0,S=0,E=1,k===x?S:S+(w-x)/(k-x)*(E-S));var w,x,k,S,E;A=O(A,0,1);const M=null!=(i=v.e)?i:v.easing;if(M&&Array.isArray(M))try{A=m(M)(A)}catch(e){}let C=!(T=e).includes("-")&&/[a-z][A-Z]/.test(T)?j(e):e;var T;let N=null;const R=null!=(s=null==v?void 0:v.v)?s:null==v?void 0:v.value,P=null!=(a=null==g?void 0:g.v)?a:null==g?void 0:g.value;if("d"===C){N=function(e,t,n){const r=Math.max(e.length,t.length),o=[];for(let i=0;i<r;i++)o.push(p(e[i],t[i],n));return o}(null!=(l=null==R?void 0:R.paths)?l:Array.isArray(R)?R:[],null!=(u=null==P?void 0:P.paths)?u:Array.isArray(P)?P:[],A).map(e=>function(e){var t,n,r,o;const i=e.v,s=e.i,a=e.o,l=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==a?void 0:a[e-1])?t:r,l=null!=(n=null==s?void 0:s[e])?n:i[e],c=i[e];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 e=i[c-1],t=null!=(r=null==a?void 0:a[c-1])?r:e,n=null!=(o=null==s?void 0:s[0])?o:i[0],l=i[0];t[0]===e[0]&&t[1]===e[1]&&n[0]===l[0]&&n[1]===l[1]||u.push("C"+t[0]+","+t[1]+","+n[0]+","+n[1]+","+l[0]+","+l[1]),u.push("z")}return u.join("")}(e)).join("")}else if(y.has(C))N=h((I=P||[0,0,0,1],_=A,[f((F=R||[0,0,0,1])[0]||0,I[0]||0,_),f(F[1]||0,I[1]||0,_),f(F[2]||0,I[2]||0,_),f(void 0===F[3]?1:F[3],void 0===I[3]?1:I[3],_)])),C=e;else if("stroke-dasharray"===C)N=d(R||[],P||[],A).join(" "),C=e;else if("translate"===C){N="translate("+d(R||[0,0],P||[0,0],A).join(",")+")",C="transform"}else if("rotate"===C){N="rotate("+f(+(R||0),+(P||0),A)+")",C="transform"}else if("scale"===C){N="scale("+d(R||[1,1],P||[1,1],A).join(",")+")",C="transform"}else{N=f(+(R||0),+(P||0),A)}var F,I,_;return b.has(C)&&"number"==typeof N&&(N=100*N+"%"),{k:C,v:null===N?"":""+N}}function oe(e,t){const n={};for(const[r,o]of Object.entries(e)){const e=re(r,o,t);e&&(n[e.k]=e.v)}return n}function ie(e){return"#"+e}function se(e,t,n){const r=B(e)||{},o=ne(e),i=r.iterations;let s=1;"number"==typeof i&&(s=i||1),"infinite"===i&&(s=1/0),s<1&&(s=1);const a=+(r.duration||w),l=a&&s?a*(s===1/0?1/0:s):a?(null!=s?s:1)*a:0,u=r.direction||"normal";let c=null,f=!1,d=r.delay||0,p=0,m=1,h=!1;const v=r.frameRate,y=v&&v>0?1e3/v:0;let g=0;const b=()=>{const e=p?(Date.now()-p)*m:0;let t=d+e;return Number.isFinite(l)&&t>l&&(t=l),t<0&&(t=0),t};function A(e){let n=function(){const t=a>0?a:1;let n=0,r=0;if(a>0){e=O(e,0,s*t),r=Math.max(0,Math.ceil(e/t)-1),r=Math.min(r,s-1);n=O((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=oe(r,n*a);for(const[n,r]of Object.entries(o))t.setAttribute(e.id,n,r)}}r.delay&&A(b());const x=()=>!!f&&(!!t.isConnected()&&!(Number.isFinite(l)&&b()>=l)),k=e=>{null!==c&&(cancelAnimationFrame(c),c=null),(e||x())&&(c=requestAnimationFrame(()=>{c=null,(()=>{var e;if(!t.isConnected())return void j();const r=b();if(y>0){const e=Date.now();if(g&&e-g<y)return;g=e}if(l&&Number.isFinite(l)&&r>=l)return A(l),h||(h=!0,null==(e=null==n?void 0:n.onFinish)||e.call(n)),void j();A(r)})(),k()}))},j=()=>{f&&(d=b(),p=0,f=!1,null!==c&&(cancelAnimationFrame(c),c=null),A(d))},S={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>x(),play:()=>{var e;f||(f=!0,p=Date.now(),k(!0)),null==(e=null==n?void 0:n.onPlay)||e.call(n)},pause:()=>{var e;j(),null==(e=null==n?void 0:n.onPause)||e.call(n)},cancel:()=>{var e;j(),d=0,p=0,f=!1,h=!1,A(d),null==(e=null==n?void 0:n.onCancel)||e.call(n)},finish:()=>{((e=!0)=>{var t;d=Number.isFinite(l)?l:b(),p=0,f=!1,A(d),e&&!h&&(h=!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();m=e,d=t,f&&(p=Date.now())},getCurrentTime:()=>b(),setCurrentTime:e=>{e<0&&(e=0),Number.isFinite(l)&&e>l&&(e=l),d=e,f&&(p=Date.now()),A(b())},destroy:()=>{S.cancel()}};return S}function ae(e,t,r,i){const c=B(e)||{};if(!i)if(e.id){const t=ie(e.id);(i=document.querySelector(t))||console.warn("createFrameLoopAnimator: No root element found for selector: ",t)}else console.warn("createFrameLoopAnimator: No root element provided");let f=se(e,t||function(e){const t=new Set,n={isConnected:()=>!e||e.isConnected,setAttribute:(n,r,o)=>{r=j(r);const i=ie(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),A.has(r)&&(t.style[r]=o)}}};return n}(i),r);var d;return d=((e,t)=>{for(var n in t||(t={}))a.call(t,n)&&u(e,n,t[n]);if(s)for(var n of s(t))l.call(t,n)&&u(e,n,t[n]);return e})({},f),f=n(d,o({getRootElement:()=>i||null})),c.trigger&&T(f,c.trigger),f}function le(e,t,n){var r,o,i,s;const a=new Map;for(const[l,u]of Object.entries(e)){const e=u.kfs||u.keyframes||[],c=[];for(const a of e){let e=null!=(o=null!=(r=a.t)?r:a.time)?o:0;e=O(e/(n.duration||1),0,1);let u=null!=(i=a.v)?i:a.value;const f=null!=(s=a.e)?s:a.easing,d={offset:e,easing:f&&Array.isArray(f)?"cubic-bezier("+f.join(",")+")":void 0};let p,m=l;y.has(l)&&Array.isArray(u)?p=h(u):g.has(l)?(Array.isArray(u)&&("translate"===l&&(u=u.map(e=>e+"px")),u=u.join(",")),"rotate"===l&&(u+="deg"),p=l+"("+u+")",m="transform"):p=""+u,CSS.supports(m,p)||t.add(m),m=x(m),d[m]=p,c.push(d)}c.length>0&&a.set(l,c)}return a}function ue(e,t,n,r){const o=B(e)||{},i=ne(e);if(!n)if(e.id){const t=ie(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=[],a=o.iterations;let l;"number"==typeof a&&(l=a),"infinite"===a&&(l=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=ie(e.id),a=(null==n?void 0:n.querySelectorAll(i))||document.querySelectorAll(i);0===a.length&&console.warn('createWebApiAnimator: No elements found for selector "'+i+'"');const c=le(r,u,o);for(let e=0;e<a.length;e++){const n=a[e],r=o.delay&&o.delay>0?o.delay:void 0,i=o.delay&&o.delay<0&&o.duration?-o.delay%o.duration:void 0,u={duration:o.duration,delay:r,fill:o.fill,direction:o.direction,iterations:l};for(const[,e]of c)if(e.length>0)try{const r=new KeyframeEffect(n,e,u),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)}),i&&(o.currentTime=i),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:()=>{s.forEach(e=>e.finish())},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&&T(c,o.trigger),c}var ce=0;function fe(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(e=>fe(e));const t=e,n={};for(const e of Object.keys(t))n[e]=fe(t[e]);return n}function de(e){const t=fe(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,a]of Object.entries(t))if("children"!==s)if("string"==typeof a)if(r.has(s)&&a.startsWith("#")){const e=a.slice(1),r=n.get(e);r&&(t[s]="#"+r)}else if(o.has(s))t[s]=pe(a,n);else if(i.has(s)){const e=n.get(a);e&&(t[s]=e)}else a.includes("url(#")&&(t[s]=pe(a,n));else if("style"===s&&"object"==typeof a&&null!==a)for(const[e,t]of Object.entries(a))"string"==typeof t&&(a[e]=pe(t,n));else"object"==typeof a&&null!==a&&"animate"!==s&&e(a);else if(Array.isArray(a))for(const t of a)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 pe(e,t){return e.replace(/url\(#([^)]+)\)/g,(e,n)=>{const r=t.get(n);return r?"url(#"+r+")":e})}function me(e,t,n,r){(B(e)||{}).debug=!0;let o=null;if(r&&e.children){e=de(e);const t="string"==typeof r?document.querySelector(r):r;t&&(o=C(e),o&&t.replaceChildren(o))}return function(e,t,n,r){const o=B(e)||{};let i;return i="frames"===o.mode?ae(e,t,n,r):ue(e,n,r,"webapi"===o.mode)||ae(e,t,n,r),o.debugInstName&&(window[o.debugInstName]=i),i}(e,t,n,o)}function he(e,t,n,r){if("object"==typeof e)return me(e,t,n,r);let o=null;return fetch(e).then(e=>e.json()).then(e=>{P(e)?o=me(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 ve(){const e=document.querySelectorAll("["+N+"]");for(let t=0;t<e.length;t++){const n=e[t];if(!n[R]){const e=n.getAttribute(N);e&&(n[R]=he(e,void 0,void 0,n))}}}"undefined"!=typeof window&&(window.loadTagAnimators=ve,window.createAnimator=he,window.setupAnimationTriggers=T);
1
+ "use strict";var t,e=Object.defineProperty,n=Object.defineProperties,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=Math.pow,c=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,f=(t,e)=>{for(var n in e||(e={}))s.call(e,n)&&c(t,n,e[n]);if(a)for(var n of a(e))l.call(e,n)&&c(t,n,e[n]);return t},d=(t,e)=>n(t,o(e)),m={};function h(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 p(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 y(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 v(t,e,n){if(!e)return t;delete t.transform;let r=t;var o;return r=g(r,"skew",e.skew,n),r=b(r,e.origin,!0),r=g(r,"scale",void 0===(o=e.scale)?void 0:Array.isArray(o)?[o[0]/100,o[1]/100]:o,n),r=g(r,"rotate",e.rotate,n),r=b(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=g(r,"translate",e.translate,n):(r=b(r,e.origin,!0),r=g(r,"translate",e.translate,n),r=b(r,e.origin,!1)),r}function g(t,e,n,r){if(void 0===n)return t;if("skew"===e){const e=p(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=p(n);if("static"===o.kind)return{type:"g",transform:{value:h(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>y(t,h(e,t.value,void 0)))};return o.autoOrient&&(n.autoOrient=!0),{type:"g",animate:{transform:n},children:[t]}}return t}function b(t,e,n){if(void 0===e)return t;const r=p(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=>y(t,{translate:o(t.value)}))}},children:[t]}:t}function A(t,e,n){var r,o,i;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==(i=t.children)||i.forEach(t=>A(t,e,n))}function k(t,e,n,r,o){const i=function(t,e){var n;const r={};let o=!1;const i=null==(n=t.animate)?void 0:n.transform;if(i&&"object"==typeof i&&Array.isArray(i.keyframes)){const e=i.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=j(i),a={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})};i.autoOrient&&(a.autoOrient=!0),r.animate={transform:a};const s=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&&!s||(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),o});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},o=!0}}const a=void 0!==(null==e?void 0:e.translate),s=o||a;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],i=e[e.length-1];if("translate"===i.name&&"translate"===o.name){const n=w(i.full),r=w(o.full),a=-n[0],s=-n[1],l=r[0]-a,u=r[1]-s;if(0===l&&0===u)return{rest:t};return{translate:"translate("+l+","+u+")",rest:"translate("+a+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===i.name)return{rest:t};const a=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)a.push(e[s].full),s++;if(!a.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:a.join(""),rest:l||void 0}}(t.transform);s?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 i=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return i.length>=4&&1===i[0]&&0===i[1]&&0===i[2]&&1===i[3]}(t.transform)&&delete t.transform:e.translate&&(r.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}return r}(t,e);"string"==typeof t.id&&delete t.id;const{outer:a,inner:s}=function(t){if(!t)return{};const e=j(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=v(l,s,o);let u={type:"g",id:n,children:[{type:"g",id:r,children:[l]}]};return void 0!==i.transform&&(u.transform=i.transform),void 0!==i.animate&&(u.animate=i.animate),a&&(delete u.id,u=v(u,a,o),u.id=n),u}function w(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 j(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 S(t,e){return"_lw_"+e+"_"+t.nextId++}function x(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>x(t,e))}function _(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(_);const e={};for(const n of Object.keys(t))e[n]=_(t[n]);return e}function O(t,e){const n=new Map,r=t=>{var o;if("string"==typeof t.id){const r=S(e,"retimed");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}),i=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||"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(i)};return i(t),n}function P(t,e,n,r){if(!e)return t;if(!e.href)return r.errors.push("maskedBy.href missing — cannot build mask"),t;const o=S(r,"mask");let i={type:"use",href:"#"+e.href};i=function(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=p(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=M(o,"translate",e.translate,void 0,n),o=M(o,"rotate",e.rotate,r,n),o=M(o,"scale",e.scale,r,n),o}(i,n,r);const a={type:"mask",id:o,children:[i]};return e.maskType&&(a.maskType=e.maskType),e.maskUnits&&(a.maskUnits=e.maskUnits),e.maskContentUnits&&(a.maskContentUnits=e.maskContentUnits),r.defs.push(a),t.mask="url(#"+o+")",t}function M(t,e,n,r,o){if(void 0===n)return t;const i=p(n);return"static"===i.kind?{type:"g",transform:{value:h(e,z(e,i.value),r)},children:[t]}:"animated"===i.kind?{type:"g",animate:{transform:{keyframes:i.keyframes.map(t=>y(t,h(e,z(e,t.value),r)))}},children:[t]}:t}function z(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(m,{COLOUR_ATTR_NAMES:()=>re,PX_ANIMATOR_DATA_KEY:()=>Qe,PX_ANIM_ATTR_NAME:()=>at,PX_ANIM_SRC_ATTR_NAME:()=>it,PX_TRANSFORM_PART_KEYS:()=>ht,PxAnimatedSvgDocumentSchema:()=>Vt,PxAnimationDefinitionSchema:()=>vt,PxAnimatorConfigSchema:()=>kt,PxAttrValueSchema:()=>jt,PxBezierPathSchema:()=>Lt,PxBindingSchema:()=>wt,PxDefsSchema:()=>At,PxEasingOrRefSchema:()=>ct,PxEffectsSchema:()=>It,PxElementAnimationSchema:()=>gt,PxKeyframeSchema:()=>ft,PxLoopSchema:()=>dt,PxMaskedByEffectSchema:()=>Pt,PxNodeBase:()=>Tt,PxNodeSchema:()=>Ct,PxPropertyAnimationSchema:()=>mt,PxRefEffectSchema:()=>Et,PxRepeaterEffectSchema:()=>Ot,PxRetimeEffectSchema:()=>zt,PxSvgNodeExtra:()=>Rt,PxTransformPartsSchema:()=>pt,PxTransformValueSchema:()=>yt,PxTransformationEffectSchema:()=>_t,PxTriggerSchema:()=>bt,PxTrimPathEffectSchema:()=>Mt,STYLE_ATTR_NAMES:()=>se,TRANSFORM_FN_NAMES:()=>oe,applyPlayerEffects:()=>R,calcAnimationValues:()=>Fe,camelCaseToKebabWordIfNeeded:()=>ce,collectSampleTimes:()=>An,createAnimator:()=>tn,createAnimatorImpl:()=>He,createBasicFrameLoopAnimator:()=>De,createFrameLoopAnimator:()=>Be,createWebApiAnimator:()=>Xe,describeSchema:()=>rt,diffInEffect:()=>wn,generateNewIds:()=>Ge,getAnimatorConfig:()=>Dt,getBindings:()=>Wt,getChildren:()=>qt,getDefs:()=>Bt,getNormalizedProps:()=>we,isPxElementFileFormat:()=>Ft,isPxElementFileFormatDeep:()=>Ut,loadTagAnimators:()=>en,normalizeDocument:()=>Ve,px:()=>ot,renderNode:()=>je,schemaKeys:()=>nt,setupAnimationTriggers:()=>Se,toRGBA:()=>ee,validateNodeEffects:()=>Nt,visualModelAt:()=>kn}),module.exports=(t=m,((t,n,o,a)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let l of i(n))s.call(t,l)||l===o||e(t,l,{get:()=>n[l],enumerable:!(a=r(n,l))||a.enumerable});return t})(e({},"__esModule",{value:!0}),t));var E="content";function I(t,e){const n={};return t.translate&&(n.translate=[t.translate[0]*e,t.translate[1]*e]),void 0!==t.rotate&&(n.rotate=t.rotate*e),t.scale&&(n.scale=[u(t.scale[0]/100,e),u(t.scale[1]/100,e)]),t.origin&&(n.origin=[t.origin[0]*e,t.origin[1]*e]),n}var N=!0;function T(t,e,n){var r;const o=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)&&o(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)&&o(n.keyframes)}null==(r=t.children)||r.forEach(t=>T(t,e,n))}function C(t,e,n){var r;if(!e&&!n)return t;const o=null!=(r=t.d)?r:function(t){var e,n,r,o;if("rect"!==t.type)return;const i=Number(null!=(e=t.x)?e:0),a=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"+(i+s)+","+a+"L"+(i+s)+","+(a+l)+"L"+i+","+(a+l)+"L"+i+","+a+"L"+(i+s)+","+a+"z"}(t);if(void 0===o)return t;const i=d(f({},t),{type:"g"});delete i.d;const a=i.meta=f({},i.meta||{}),s=a.effects=f({},a.effects||{});return e&&(s.trimPath=e),s.isCombinedShape=!0,i.children=[{type:"path",d:o}],i}function R(t){const e={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map},n=_(t);x(n,e.idMap),A(n,e,()=>S(e,"inner"));const r=L(V(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 V(t,e){t.children&&(t.children=t.children.map(t=>V(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:i,repeater:a,maskedBy:s,trimPath:l,retime:u,ref:c}=null!=n?n:{},f=null==n?void 0:n.isCombinedShape;n&&delete t.effects;let d=t;return d=C(d,l,f),d=function(t,e,n){var r,o;if(!e)return t;const i=null!=(r=e.copies)?r:1;if(i<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const a=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=_(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<i;t++){const n=_(l);n.transform={value:I(e,t)},u.push(n)}const c={type:"g",children:u};return void 0!==a&&(c.transform=a),void 0!==s&&(c.animate={transform:s}),c}(d,a,e),d=P(d,s,i,e),d=o?k(d,i,r,o,e):function(t,e,n,r){if(e){const n=e.baseId;if(n){const o=e.type===E&&r.contentRefInnerIds.get(n)||n;t.href="#"+o}else r.errors.push("ref: missing baseId")}return v(t,n,r)}(d,c,i,e),u&&(t.effects={retime:u}),r&&e.idMap.set(r,d),d}function L(t,e){var n;t.children&&(t.children=t.children.map(t=>L(t,e)));const r=null==(n=t.effects)?void 0:n.retime;return r?(delete t.effects,function(t,e,n){var r,o,i,a;if(!e)return t;const s=e.baseId;if(!s)return n.errors.push("retime: missing baseId"),t;const l=n.idMap.get(s);if(!l)return n.warnings.push('retime: target "'+s+'" not found'),t;const u=null!=(r=e.start)?r:0,c=null!=(o=e.stretch)?o:1;if(N){const e=_(l);O(e,n);const r=S(n,"retime");return e.id=r,T(e,u,c),n.defs.push(e),t.href="#"+r,t}const m=("symbol"===l.type?l.children||[]:[l]).map(t=>{const e=_(t);return O(e,n),T(e,u,c),e}),h=d(f({},t),{type:"g",children:m});delete h.href;const p=Number(null!=(i=t.x)?i:0),y=Number(null!=(a=t.y)?a:0);if(p||y){const t="translate("+p+","+y+")";h.transform="string"==typeof h.transform?t+h.transform:t,delete h.x,delete h.y}return h}(t,r,e)):t}function F(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var U=class{_canSanitize(t){return this.isValid(t)}optional(){return new D(this)}},D=class extends U{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)}},B=class extends U{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(F(null!=n?n:[])+": expected string, got "+typeof t),!1)}},W=class extends U{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(F(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},q=class extends U{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(F(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},K=class extends U{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(F(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},X=class extends U{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(F(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},Y=class extends U{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(F(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))}},J=class extends U{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(F(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)}},Z=class extends U{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(F(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(i=!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(F(o)+": unexpected extra key"),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},G=class extends U{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=f({},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(F(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(i=!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)||(i=!1),o.pop());return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},$=class extends U{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(F(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)}},H=class extends U{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(F(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,i]of Object.entries(t))r.push(n),this.value.isValid(i,e,r)||(o=!1),r.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},Q=class extends U{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},tt=class extends U{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)}},et=class extends U{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(F(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 nt(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function rt(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 ot={string:(t="")=>new B(t),number:(t=0)=>new W(t),boolean:(t=!1)=>new q(t),literal:t=>new K(t),enum:(t,e)=>new X(t,e),union:(t,e)=>new Y(t,e),discriminatedUnion:(t,e)=>new J(t,e),object:t=>new Z(t),openObject:(t,e)=>new G(t,e),extendedObject:(t,e)=>new Z(f(f({},t._shape),e)),array:t=>new $(t),record:t=>new H(t),any:()=>new Q,tuple:t=>new et(t),lazy:(t,e)=>new tt(t,e)},it="data-px-animation-src",at="_px_animator",st="text",lt="textContent",ut=new Set(["type","children","animator","meta","animate",st,lt]),ct=ot.union([ot.string(),ot.tuple([ot.number(),ot.number(),ot.number(),ot.number()])]),ft=(ot.union([ot.string(),ot.number(),ot.array(ot.number()),ot.lazy(()=>pt,{}),ot.object({path:ot.string()}),ot.lazy(()=>ot.object({paths:ot.array(Lt)}),{paths:[]})]),ot.object({time:ot.number().optional(),t:ot.number().optional(),value:ot.any().optional(),v:ot.any().optional(),easing:ct.optional(),e:ct.optional(),tangentOut:ot.tuple([ot.number(),ot.number()]).optional(),to:ot.tuple([ot.number(),ot.number()]).optional(),tangentIn:ot.tuple([ot.number(),ot.number()]).optional(),ti:ot.tuple([ot.number(),ot.number()]).optional(),selected:ot.boolean().optional()})),dt=ot.object({segmentCount:ot.number().optional(),before:ot.boolean().optional(),alternate:ot.boolean().optional()}),mt=ot.object({keyframes:ot.array(ft).optional(),kfs:ot.array(ft).optional(),loop:ot.union([dt,ot.boolean()]).optional(),autoOrient:ot.boolean().optional()}),ht=["translate","rotate","scale","origin"],pt=ot.object({translate:ot.tuple([ot.number(),ot.number()]).optional(),rotate:ot.number().optional(),scale:ot.tuple([ot.number(),ot.number()]).optional(),origin:ot.tuple([ot.number(),ot.number()]).optional()}),yt=ot.union([ot.string(),ot.object({value:pt}),mt]),vt=ot.record(mt),gt=ot.union([ot.string(),ot.array(ot.union([ot.string(),vt])),vt]),bt=ot.object({startOn:ot.enum(["load","mouseOver","click","scrollIntoView","programmatic"]).optional(),outAction:ot.enum(["continue","pause","reset","reverse"]).optional(),scrollIntoViewThreshold:ot.number().optional()}),At=ot.object({easings:ot.record(ot.tuple([ot.number(),ot.number(),ot.number(),ot.number()])).optional(),animations:ot.record(vt).optional(),styles:ot.record(ot.any()).optional()}),kt=ot.object({mode:ot.enum(["auto","webapi","frames"]).optional(),duration:ot.number().optional(),delay:ot.number().optional(),iterations:ot.union([ot.number(),ot.literal("infinite")]).optional(),fill:ot.enum(["forwards","backwards","both","none"]).optional(),direction:ot.enum(["normal","reverse","alternate","alternate-reverse"]).optional(),frameRate:ot.number().optional(),trigger:bt.optional(),definitions:At.optional(),animate:ot.record(gt).optional(),debug:ot.boolean().optional(),debugInstName:ot.string().optional()}),wt=ot.object({id:ot.string(),animate:gt}),jt=ot.union([ot.string(),ot.number(),ot.object({value:ot.any()}),mt]),St=ot.union([ot.number(),ot.object({value:ot.number()}),ot.object({keyframes:ot.array(ft),autoOrient:ot.boolean().optional()})]),xt=ot.union([ot.tuple([ot.number(),ot.number()]),ot.object({value:ot.tuple([ot.number(),ot.number()])}),ot.object({keyframes:ot.array(ft),autoOrient:ot.boolean().optional()})]),_t=ot.object({translate:xt.optional(),rotate:St.optional(),scale:xt.optional(),skew:xt.optional(),origin:xt.optional()}),Ot=ot.object({copies:ot.number().optional(),translate:ot.tuple([ot.number(),ot.number()]).optional(),rotate:ot.number().optional(),scale:ot.tuple([ot.number(),ot.number()]).optional(),origin:ot.tuple([ot.number(),ot.number()]).optional()}),Pt=ot.object({href:ot.string().optional(),maskType:ot.string().optional(),maskUnits:ot.string().optional(),maskContentUnits:ot.string().optional()}),Mt=ot.any(),zt=ot.object({baseId:ot.string().optional(),start:ot.number().optional(),stretch:ot.number().optional(),timeCrop:ot.tuple([ot.number(),ot.number()]).optional()}),Et=ot.object({baseId:ot.string().optional(),type:ot.string().optional()}),It=ot.object({transformation:_t.optional(),repeater:Ot.optional(),maskedBy:Pt.optional(),trimPath:Mt.optional(),retime:zt.optional(),isCombinedShape:ot.boolean().optional(),ref:Et.optional()});function Nt(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!It.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 Tt=ot.openObject({type:ot.string(),id:ot.string().optional(),meta:ot.any().optional(),effects:It.optional(),animate:vt.optional(),style:ot.union([ot.string(),ot.record(ot.union([ot.string(),ot.number()]))]).optional()},jt),Ct=ot.openObject(d(f({},Tt._shape),{children:ot.lazy(()=>ot.array(Ct),[]).optional()}),jt),Rt=ot.object({width:ot.number().optional(),height:ot.number().optional(),viewBox:ot.string().optional(),animator:kt.optional()}),Vt=ot.openObject(d(f(f({},Tt._shape),Rt._shape),{type:ot.literal("svg"),children:ot.array(Ct).optional()}),jt),Lt=ot.object({v:ot.array(ot.array(ot.number())),i:ot.array(ot.array(ot.number())).optional(),o:ot.array(ot.array(ot.number())).optional(),c:ot.boolean().optional()});function Ft(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&("svg"===t.type||"svg"===t.tagName)}function Ut(t){const e=Vt.isValid(t);return{valid:e,errors:e?[]:["Document failed schema validation"]}}function Dt(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 Bt(t){var e;if(t)return null==(e=Dt(t))?void 0:e.definitions}function Wt(t){var e;if(!t)return;const n=null==(e=Dt(t))?void 0:e.animate;return n?Object.entries(n).map(([t,e])=>({id:t,animate:e})):void 0}function qt(t){return null==t?void 0:t.children}function Kt(t,e,n){return t+(e-t)*n}function Xt(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let i=0;i<o;i++)r[i]=Kt(t[i]||0,e[i]||0,n);return r}function Yt(t,e,n){return[Kt(t[0]||0,e[0]||0,n),Kt(t[1]||0,e[1]||0,n),Kt(t[2]||0,e[2]||0,n),Kt(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function Jt(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++)o.push(Zt(t[i],e[i],n));return o}function Zt(t,e,n){var r,o,i,a,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(Xt(f,m,d));const v=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,g=null!=(a=null==(i=e.i)?void 0:i[n])?a:m;p.push(Xt(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(Xt(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 Gt(t,e,n){if(n<=0)return 0;if(n>=1)return 1;const r=3*t,o=3*(e-t)-r,i=1-r-o;function a(t){return((i*t+o)*t+r)*t}function s(t){return(3*i*t+2*o)*t+r}let l=n,u=0,c=1;for(let t=0;t<8;t++){const t=a(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=a(l);if(Math.abs(t-n)<1e-6)return l;n>t?u=l:c=l,l=(c+u)/2}return l}function $t(t){const[e,n,r,o]=t,i=3*n,a=3*(o-n)-i,s=1-i-a;return function(t){return n=Gt(e,r,t),((s*n+a)*n+i)*n;var n}}function Ht(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Qt(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,i]=t,a=Gt(n,o,e),s=[n,r],l=[o,i],{left:u,right:c}=function(t,e,n,r,o){const i=Ht(t,e,o),a=Ht(e,n,o),s=Ht(n,r,o),l=Ht(i,a,o),u=Ht(a,s,o),c=Ht(l,u,o);return{left:[t,i,l,c],right:[c,u,s,r]}}([0,0],s,l,[1,1],a),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 te(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function ee(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 ne(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),i=n?e[2]+e[2]:e.slice(4,6),a=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(i,16)/255];return null!==a&&s.push(parseInt(a,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 re=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),oe=new Set(["translate","rotate","scale","skew"]),ie=new Set(["offset-distance","offsetDistance"]);function ae(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],i=t.translate,a=t.origin,s=t.rotate,l=t.scale,u=r?"px":"",c=r?"deg":"";return i&&o.push("translate("+i[0]+u+","+i[1]+u+")"),a&&o.push("translate("+a[0]+u+","+a[1]+u+")"),null!=s&&o.push("rotate("+s+c+")"),l&&o.push("scale("+l[0]+","+l[1]+")"),a&&o.push("translate("+-a[0]+u+","+-a[1]+u+")"),o.join("")}var se=new Set(["offset-distance","offsetDistance"]),le=1e3;var ue=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 ce(t){return ue.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function fe(t,e,n){return Math.max(e,Math.min(t,n))}function de(t,e,n,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const i=1-o,a=i*i,s=o*o,l=a*i,u=3*o*a,c=3*s*i,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 me=1e-4;function he(t,e,n,r,o){const i=1-o,a=3*i*i,s=6*o*i,l=3*o*o;return[a*(e[0]-t[0])+s*(n[0]-e[0])+l*(r[0]-n[0]),a*(e[1]-t[1])+s*(n[1]-e[1])+l*(r[1]-n[1])]}var pe="http://www.w3.org/2000/svg",ye=new Set(["svg","g","path","circle","ellipse","rect","line","polyline","polygon","text","tspan","textPath","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker","filter","feGaussianBlur","feOffset","feBlend","feColorMatrix","feMerge","feMergeNode"].map(t=>t.toLowerCase())),ve=["href","src","filter","clipPath","mask","markerStart","markerMid","markerEnd"],ge=new Set(ve),be=["href","src","fill","fillOpacity","fillRule","stroke","strokeWidth","strokeOpacity","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeDasharray","strokeDashoffset","opacity","transform","x","y","cx","cy","r","rx","ry","width","height","d","x1","y1","x2","y2","points","dx","dy","fontSize","fontFamily","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","space","xml:space","textDecoration","textTransform","whiteSpace","white-space","dominantBaseline","alignmentBaseline","rotate","id","class","viewBox","preserveAspectRatio","offset","stopColor","stopOpacity","gradientTransform","clipPath","mask","offsetPath","offsetDistance","offsetRotate","offsetAnchor","offsetPosition","startOffset","textLength","lengthAdjust","filter","stdDeviation","in","in2","result","mode",...ve],Ae=new Set(be.map(t=>t.toLowerCase()));function ke(t,e){const n=t.toLowerCase();if(Ae.has(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() references must be internal url(#id), got:',e):e}if(ge.has(n)){const t=String(e);return t.startsWith("#")||/^url\(#[^)]+\)$/.test(t)?e:void 0}return e}console.warn("Attribute not in whitelist: ",n)}function we(t){const e={};for(const n of Object.keys(t)){if(ut.has(n))continue;if("style"===n)continue;let r=t[n];re.has(n)&&Array.isArray(r)?e[n]=ee(r):"transform"===n&&null!==r&&"object"==typeof r&&!Array.isArray(r)&&r.value&&"object"==typeof r.value?e.transform=ae(r.value,{withUnits:!1}):oe.has(n)?(Array.isArray(r)&&("translate"===n&&(r=r.map(t=>t+"px")),r=r.join(",")),"rotate"===n&&(r+="deg"),e.transform=n+"("+r+")"):null!=r&&(e[n]=String(r))}return e}function je(t,e){if(!t)return null;const n=t,{type:r,children:o,style:i}=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&&a)for(var r of a(t))e.indexOf(r)<0&&l.call(t,r)&&(n[r]=t[r]);return n})(n,["type","children","style"]),c=Bt(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}(i,c);let d;if(o)for(const t of o){const e=je(t,c);e&&(d||(d=[]),d.push(e))}return function(t,e,n,r,o){if(!ye.has(t.toLowerCase()))return console.warn("Attribute not in whitelist: ",t),null;const i=document.createElementNS(pe,t);for(const t in e)i.setAttribute(ce(t),ke(t,e[t]));if(n)for(const t in n)i.style[t]=String(n[t]);if(r)for(const t of r)i.appendChild(t);return o&&(i.textContent=o),i}(r||"g",we(u),f,d,u[st]||u[lt])}function Se(t,e){const{startOn:n,outAction:r="continue",scrollIntoViewThreshold:o=.5}=e,i=t.getRootElement();if(!i)return console.warn("setupAnimationTriggers: No root element found for animation."),t;const a=()=>{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=()=>a();"complete"===document.readyState?t():window.addEventListener("load",t,{once:!0});break}case"mouseOver":{const t=()=>a(),e=()=>s();i.addEventListener("mouseenter",t),i.addEventListener("mouseleave",e);break}case"click":{const e=()=>{t.isPlaying()?s():a()};i.addEventListener("click",e);break}case"scrollIntoView":new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&t.intersectionRatio>=o?a():s()})},{threshold:o}).observe(i);break}return t}var xe=new WeakMap;function _e(t,e,n,r){const o=xe.get(t);if(o)return o;const i=t.tangentOut,a=e.tangentIn,s=[n[0]+(i?i[0]:0),n[1]+(i?i[1]:0)],l=[r[0]+(a?a[0]:0),r[1]+(a?a[1]:0)],u=function(t,e,n,r,o=100){const i=o+1,a=new Float64Array(i),s=new Float64Array(i);let l=de(t,e,n,r,0);a[0]=0,s[0]=0;let u=0;for(let c=1;c<i;c++){const i=c/o,f=de(t,e,n,r,i),d=f[0]-l[0],m=f[1]-l[1];u+=Math.sqrt(d*d+m*m),a[c]=i,s[c]=u,l=f}return{ts:a,ds:s}}(n,s,l,r),c={P0:n,P1:s,P2:l,P3:r,lut:u,totalArc:u.ds[u.ds.length-1]};return xe.set(t,c),c}function Oe(t,e,n,r,o,i){const a=_e(t,e,n,r),s=0===a.totalArc?o:function(t,e){const{ts:n,ds:r}=t,o=r.length-1;if(e<=0)return n[0];if(e>=r[o])return n[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;r[t]<e?i=t+1:a=t}const s=r[a-1],l=r[a]-s,u=l>0?(e-s)/l:0;return n[a-1]+u*(n[a]-n[a-1])}(a.lut,o*a.totalArc),l=de(a.P0,a.P1,a.P2,a.P3,s);if(!i)return{translate:l};const u=function(t,e,n,r,o){const i=he(t,e,n,r,o);if(0===i[0]&&0===i[1])return he(t,e,n,r,o<.5?o+me:o-me);return i}(a.P0,a.P1,a.P2,a.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}function Pe(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,i=o[3]||0,a=o[4]||0,s=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([a,s]),n.i.push([r,i]),n.o.push([a,s])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function Me(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function ze(t){return"string"==typeof t&&void 0!==Me(t)}function Ee(t){if(t&&"object"==typeof t&&"string"==typeof t.path){const e=Me(t.path);return e?{paths:Pe(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&ze(e[0])){const t=[];for(const n of e){const e=Me(n);e&&t.push(...Pe(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&ze(t[0])){const e=[];for(const n of t){const t=Me(n);t&&e.push(...Pe(t))}return{paths:e}}return{paths:t}}if(ze(t)){return{paths:Pe(Me(t))}}return t}function Ie(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 Ne(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 Te(t,e,n,r){var o,i;if("d"===t){return{paths:Jt(null!=(o=null==e?void 0:e.paths)?o:Array.isArray(e)?e:[],null!=(i=null==n?void 0:n.paths)?i:Array.isArray(n)?n:[],r)}}return re.has(t)?Yt(e||[0,0,0,1],n||[0,0,0,1],r):oe.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?Xt(e||[],n||[],r):Kt(+(e||0),+(n||0),r)}function Ce(t,e,n,r){var o,i,a,s,l;const u=e.keyframes||e.kfs||[],c=[];for(const e of u){const n=null!=(i=null!=(o=e.time)?o:e.t)?i:0;let u=null!=(a=e.value)?a:e.v;const f=null!=(s=e.easing)?s:e.e;"d"===t&&(u=Ee(u)),re.has(t)&&(u=null!=(l=ne(u))?l:u),c.push({t:n,v:u,e:Ie(f,r)})}c.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const f=e.loop,d=!0===f?{}:f||void 0;return d&&c.length>=2?function(t,e,n,r){var o,i,a,s,l;const u=e.length-1,c=fe(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!=(i=e[0].t)?i:0,m=null!=(a=e[e.length-1].t)?a: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=>({relT:(t.t-v)/g,v:t.v,e:t.e})),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?te(b[t-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 a=o[n-1],s=r.relT-a.relT,l=(i-a.relT)/s,u=a.e?$t(a.e)(l):l,c=Te(t,a.v,r.v,u),{left:f}=Qt(a.e,l);return w.length>0&&a.relT<=i&&(w[w.length-1].e=f),void w.push({t:e+i*g,v:c,e:void 0})}w.push({t:e+r.relT*g,v:r.v,e:n<o.length-1?r.e:void 0})}}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]}(t,c,d,n):c}var Re=0;function Ve(t){const e=Dt(t)||{},n=Bt(t),r=e.duration||1e3,o=[],i=(t,e)=>{if(!e)return null;const o=function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=Ne(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=Ne(r,e);t&&n.push(t)}else n.push(t);return n}(e,n);if(0===o.length)return null;const i=function(t,e,n){const r={};for(const[o,i]of Object.entries(t)){const t=Ce(o,i,e,n);t.length>0&&(r[o]={kfs:t})}return r}(function(t){const e={};for(const n of t)for(const[t,r]of Object.entries(n))e[t]=r;return e}(o),r,n);return 0===Object.keys(i).length?null:{id:t,animate:i}},a=Wt(t);if(a)for(const t of a){const e=i(t.id,t.animate);e&&o.push(e)}const s=t=>{const e=t.animate;if(e&&Object.keys(e).length>0){const n=t.id||"_px_el_"+ ++Re;t.id=n;const r=i(n,e);r&&o.push(r)}if(t.children)for(let e=0;e<t.children.length;e++)s(t.children[e])};if(t.children)for(let e=0;e<t.children.length;e++)s(t.children[e]);return o}function Le(t,e,n){var r,o,i,a,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],i=t[t.length-1];for(let a=0;a<t.length-1;a++){const s=null!=(n=t[a].t)?n:0,l=null!=(r=t[a+1].t)?r:0;if(s<=e&&e<=l){o=t[a],i=t[a+1];break}}return{prevKf:o,nextKf:i}}(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=fe(m,0,1);const b=null!=(i=f.e)?i:f.easing;if(b&&Array.isArray(b))try{m=$t(b)(m)}catch(t){}let A=!(k=t).includes("-")&&/[a-z][A-Z]/.test(k)?ce(t):t;var k;let w=null;const j=null!=(a=null==f?void 0:f.v)?a:null==f?void 0:f.value,S=null!=(s=null==d?void 0:d.v)?s:null==d?void 0:d.value;if("d"===A){w=Jt(null!=(l=null==j?void 0:j.paths)?l:Array.isArray(j)?j:[],null!=(u=null==S?void 0:S.paths)?u:Array.isArray(S)?S:[],m).map(t=>function(t){var e,n,r,o;const i=t.v,a=t.i,s=t.o,l=t.c;if(!i.length)return"";const u=[],c=i.length;u.push("M"+i[0][0]+","+i[0][1]);for(let t=1;t<c;t++){const r=i[t-1],o=null!=(e=null==s?void 0:s[t-1])?e:r,l=null!=(n=null==a?void 0:a[t])?n:i[t],c=i[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=i[c-1],e=null!=(r=null==s?void 0:s[c-1])?r:t,n=null!=(o=null==a?void 0:a[0])?o:i[0],l=i[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("")}(t)).join("")}else if(re.has(A))w=ee(Yt(j||[0,0,0,1],S||[0,0,0,1],m)),A=t;else if("stroke-dasharray"===A)w=Xt(j||[],S||[],m).join(" "),A=t;else if("transform"!==A||null===j||"object"!=typeof j||Array.isArray(j))if("translate"===A){w="translate("+Xt(j||[0,0],S||[0,0],m).join(",")+")",A="transform"}else if("rotate"===A){w="rotate("+Kt(+(j||0),+(S||0),m)+")",A="transform"}else if("scale"===A){w="scale("+Xt(j||[1,1],S||[1,1],m).join(",")+")",A="transform"}else{w=Kt(+(j||0),+(S||0),m)}else{const t=new Set([...j?Object.keys(j):[],...S?Object.keys(S):[]]),n={};for(const e of t){const t=null==j?void 0:j[e],r=null==S?void 0:S[e];if("rotate"===e)n.rotate=Kt(+(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],i=Xt(t||o,r||o,m);n[e]=i}}if(function(t){var e;const n=null!=(e=t.keyframes)?e:t.kfs;if(!Array.isArray(n))return!1;if(t.autoOrient)return!0;for(const t of n)if(t.tangentIn||t.tangentOut)return!0;return!1}(e)){const t=j.translate,r=S.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=Oe(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)}}w=ae(n,{withUnits:!1}),A="transform"}return ie.has(A)&&"number"==typeof w&&(w=100*w+"%"),{k:A,v:null===w?"":""+w}}function Fe(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=Le(r,o,e);t&&(n[t.k]=t.v)}return n}function Ue(t){return"#"+t}function De(t,e,n){const r=Dt(t)||{},o=Ve(t),i=r.iterations;let a=1;"number"==typeof i&&(a=i||1),"infinite"===i&&(a=1/0),a<1&&(a=1);const s=+(r.duration||le),l=s&&a?s*(a===1/0?1/0:a):s?(null!=a?a: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=fe(t,0,a*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,a-1);n=fe((t-r*e)/e,0,1)}else n=t;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 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=Fe(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))},S={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>k(),play:()=>{var t;f||(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:()=>{S.cancel()}};return S}function Be(t,e,n,r){const o=Dt(t)||{};if(!r)if(t.id){const e=Ue(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 i=De(t,e||function(t){const e=new Set,n={isConnected:()=>!t||t.isConnected,setAttribute:(n,r,o)=>{r=ce(r);const i=Ue(n),a=(null==t?void 0:t.querySelectorAll(i))||document.querySelectorAll(i);0!==a.length||e.has(i)||(e.add(i),console.warn('setAttribute: No elements found for selector "'+i+'"'));for(let t=0;t<a.length;t++){const e=a[t];e.setAttribute(r,o),se.has(r)&&(e.style[r]=o)}}};return n}(r),n);return i=d(f({},i),{getRootElement:()=>r||null}),o.trigger&&Se(i,o.trigger),i}function We(t,e,n,r){var o,i;let a=null!=(o=t.v)?o:t.value;const s=null!=(i=t.e)?i:t.easing,l={offset:e,easing:s&&Array.isArray(s)?"cubic-bezier("+s.join(",")+")":void 0};let u,c=n;var f;return re.has(n)&&Array.isArray(a)?u=ee(a):"transform"!==n||null===a||"object"!=typeof a||Array.isArray(a)?oe.has(n)?(Array.isArray(a)&&("translate"===n&&(a=a.map(t=>t+"px")),a=a.join(",")),"rotate"===n&&(a+="deg"),u=n+"("+a+")",c="transform"):u=""+a:(u=ae(a,{withUnits:!0}),c="transform"),CSS.supports(c,u)||r.add(c),c=(f=c).includes("-")?f.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):f,l[c]=u,l}function qe(t,e,n){var r,o,i,a,s;const l=[];for(let u=0;u<e.length;u++){const c=e[u],m=null!=(r=c.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!=(i=n.t)?i:0)-m),r=c.e?$t(c.e)(e):e,{right:o}=Qt(c.e,e);l.push({t:0,v:Te(t,c.v,n.v,r),e:o})}continue}if(m>n){const r=e[u-1];if(r&&(null!=(a=r.t)?a:0)<=n){const e=null!=(s=r.t)?s:0,o=(n-e)/(m-e),i=r.e?$t(r.e)(o):o,{left:a}=Qt(r.e,o);l.length>0&&(l[l.length-1]=d(f({},l[l.length-1]),{e:a})),l.push({t:n,v:Te(t,r.v,c.v,i),e:void 0})}break}l.push(c)}return l}function Ke(t,e,n){var r;const o=new Map;for(const[i,a]of Object.entries(t)){const t=n.duration||1,s=qe(i,a.kfs||a.keyframes||[],t),l=[];for(let n=0;n<s.length;n++){const o=s[n],a=We(o,fe((null!=(r=o.t)?r:0)/t,0,1),i,e);0===n&&(a.offset||0)>0&&l.push(d(f({},a),{offset:0})),l.push(a)}l.length>0&&(l[l.length-1].offset||0)<1&&l.push(d(f({},l[l.length-1]),{offset:1})),l.length>0&&o.set(i,l)}return o}function Xe(t,e,n,r){var o;const i=Dt(t)||{},a=Ve(t);if(!n)if(t.id){const e=Ue(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 s=[],l=i.iterations;let u;"number"==typeof l&&(u=l),"infinite"===l&&(u=1/0);const c=new Set;(null==a?void 0:a.length)||console.warn("createWebApiAnimator: No animation bindings defined");for(const t of a||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("createWebApiAnimator: Empty or unresolved binding",t);continue}const a=Ue(t.id),l=(null==n?void 0:n.querySelectorAll(a))||document.querySelectorAll(a);0===l.length&&console.warn('createWebApiAnimator: No elements found for selector "'+a+'"');const f=Ke(r,c,i),d=i.delay&&i.delay>0?i.delay:void 0,m=i.delay&&i.delay<0&&i.duration?-i.delay%i.duration:void 0,h={duration:i.duration,delay:d,fill:null!=(o=i.fill)?o:"forwards",direction:i.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 i.trigger&&Se(f,i.trigger),f}var Ye=0;function Je(){return"_px_"+Date.now().toString(36)+(++Ye).toString(36)+Math.random().toString(36).substring(2,6)}function Ze(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>Ze(t));const e=t,n={};for(const t of Object.keys(e))n[t]=Ze(e[t]);return n}function Ge(t){var e,n;const r=Ze(t),o=new Map,i=new Set(["href","xlink:href"]),a=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=Je();o.set(t,n),e.id=n}else e.animate&&(e.id=Je());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(i.has(n)&&r.startsWith("#")){const t=r.slice(1),i=o.get(t);i&&(e[n]="#"+i)}else if(a.has(n))e[n]=$e(r,o);else if(s.has(n)){const t=o.get(r);t&&(e[n]=t)}else r.includes("url(#")&&(e[n]=$e(r,o));else if("style"===n&&"object"==typeof r&&null!==r)for(const[t,e]of Object.entries(r))"string"==typeof e&&(r[t]=$e(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=d(f({},r.animator),{animate:t})}return r}function $e(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}function He(t,e,n,r){const o=Nt(t);for(const t of o)console.warn("[PxAnimator] effects shape warning:",t);(Dt(t=R(t).root)||{}).debug=!0;let i=null;if(r&&t.children){t=Ge(t);const e="string"==typeof r?document.querySelector(r):r;e&&(i=je(t),i&&e.replaceChildren(i))}return function(t,e,n,r){const o=Dt(t)||{};let i;return i="frames"===o.mode?Be(t,e,n,r):Xe(t,n,r,"webapi"===o.mode)||Be(t,e,n,r),o.debugInstName&&(window[o.debugInstName]=i),i}(t,e,n,i)}var Qe="data";function tn(t){const{src:e,data:n,adapter:r,callbacks:o,container:i}=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 He(n,r,o,i);let a=null;return fetch(e).then(t=>t.json()).then(t=>{Ft(t)?a=He(t,r,o,i):console.error("Invalid animation document format")}),{isReady:()=>!!a,getRootElement:()=>a?a.getRootElement():null,isPlaying:()=>(null==a?void 0:a.isPlaying())||!1,play:()=>{null==a||a.play()},pause:()=>{null==a||a.pause()},cancel:()=>{null==a||a.cancel()},finish:()=>{null==a||a.finish()},setPlaybackRate:t=>{null==a||a.setPlaybackRate(t)},getCurrentTime:()=>(null==a?void 0:a.getCurrentTime())||0,setCurrentTime:t=>{null==a||a.setCurrentTime(t)},destroy:()=>{null==a||a.destroy()}}}function en(){const t=document.querySelectorAll("["+it+"]");for(let e=0;e<t.length;e++){const n=t[e];if(!n[at]){const t=n.getAttribute(it);t&&(n[at]=tn({src:t,container:n}))}}}"undefined"!=typeof window&&(window.loadTagAnimators=en,window.createAnimator=tn,window.setupAnimationTriggers=Se);var nn=[1,0,0,1,0,0];function rn(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 on=(t,e)=>[1,0,0,1,t,e],an=(t,e)=>[t,0,0,e,0,0];function sn(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var ln=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],un=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function cn(t){let e=nn;t.translate&&(e=rn(e,on(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=rn(e,on(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=rn(e,sn(t.rotate))),t.scale&&(e=rn(e,an(t.scale[0],t.scale[1]))),n&&(e=rn(e,on(-t.origin[0],-t.origin[1]))),e}function fn(t,e,n){return t+(e-t)*n}function dn(t,e){return null==t?nn:"string"==typeof t?function(t){let e=nn;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=rn(e,on(n[0]||0,n[1]||0)):"scale"===t?e=rn(e,an(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=rn(e,sn(n[0])):"skewX"===t?e=rn(e,ln(n[0])):"skewY"===t?e=rn(e,un(n[0])):"matrix"===t&&(e=rn(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?cn(function(t,e){var n,r,o,i,a,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!=(i=c.time)?i:0))/((null!=(a=f.time)?a:0)-(null!=(s=c.time)?s:0)||1),m=c.value||{},h=f.value||{},p={};return m.translate&&h.translate?p.translate=[fn(m.translate[0],h.translate[0],d),fn(m.translate[1],h.translate[1],d)]:p.translate=m.translate||h.translate,void 0!==m.rotate&&void 0!==h.rotate?p.rotate=fn(m.rotate,h.rotate,d):p.rotate=null!=(l=m.rotate)?l:h.rotate,m.scale&&h.scale?p.scale=[fn(m.scale[0],h.scale[0],d),fn(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?cn(t.value):nn}var mn=new Set(["svg","g","symbol"]),hn=new Set(["defs","mask","clipPath","title"]);function pn(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>pn(t,e))}function yn(t){return null==t?0:Number(t)}function vn(t){return Math.round(100*t)/100+0}function gn(t,e,n){var r,o,i,a,s;const l=null!=(r=t.fill)?r:"",u=null!=(o=t.stroke)?o:"",c=null!=(a=null!=(i=t["stroke-width"])?i:t.strokeWidth)?a:"",f=vn(function(t,e,n,r){var o,i,a,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!=(i=e[e.length-1].time)?i:0))return e[e.length-1].value;let n=0;for(;n<e.length-1&&(null!=(a=e[n+1].time)?a: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 fn(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(vn).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return yn(t.width)+","+yn(t.height)+","+yn(t.x)+","+yn(t.y);case"ellipse":return yn(t.rx)+","+yn(t.ry)+","+yn(t.cx)+","+yn(t.cy);case"circle":return yn(t.r)+","+yn(t.cx)+","+yn(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+m+"]|f:"+l+"|s:"+u+"|sw:"+(yn(c)||"")+"|o:"+f+"|m:"+d}function bn(t,e,n,r,o){var i;const a=t.type||"";if(hn.has(a))return;const s=rn(e,function(t,e){return t.animate&&t.animate.transform?dn(t.animate.transform,e):void 0!==t.transform?dn(t.transform,e):nn}(t,n));if("use"===a){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",i=r.get(e),a=rn(s,on(yn(t.x),yn(t.y)));return void(i?bn(i,a,n,r,o):o.push("UNRESOLVED_USE:#"+e))}mn.has(a)?null==(i=t.children)||i.forEach(t=>bn(t,s,n,r,o)):o.push(gn(t,s,n))}function An(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=>An(t,e))}function kn(t,e){const n=new Map;pn(t,n);const r=[];return bn(t,nn,e,n,r),r.sort()}function wn(t,e){const n=new Set;An(t,n),An(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=kn(t,o),i=kn(e,o),a=jn(n,i),s=jn(i,n);(a.length||s.length)&&r.push({time:o,onlyInA:a,onlyInB:s})}return r}function jn(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}
package/dist/index.min.js CHANGED
@@ -1 +1 @@
1
- var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,s=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r;function l(e,t,n){return e+(t-e)*n}function a(e,t,n){const r=[],o=Math.max(e.length,t.length);for(let i=0;i<o;i++)r[i]=l(e[i]||0,t[i]||0,n);return r}function u(e,t,n){var r,o,i,s,l,u,c,f,d;if(!e||!t)return e||t||{v:[]};const p=Math.min(Math.max(n,0),1),h=Math.min(e.v.length,t.v.length),m=[],v=[],y=[];for(let n=0;n<h;n++){const d=e.v[n],h=t.v[n];m.push(a(d,h,p));const g=null!=(o=null==(r=e.i)?void 0:r[n])?o:d,b=null!=(s=null==(i=t.i)?void 0:i[n])?s:h;v.push(a(g,b,p));const A=null!=(u=null==(l=e.o)?void 0:l[n])?u:d,w=null!=(f=null==(c=t.o)?void 0:c[n])?f:h;y.push(a(A,w,p))}return{v:m,i:v.length?v:void 0,o:y.length?y:void 0,c:null!=(d=e.c)?d:t.c}}function c(e){const[t,n,r,o]=e,i=3*t,s=3*(r-t)-i,l=1-i-s,a=3*n,u=3*(o-n)-a,c=1-a-u;function f(e){return((l*e+s)*e+i)*e}function d(e){return(3*l*e+2*s)*e+i}return function(e){return t=function(e){if(e<=0)return 0;if(e>=1)return 1;let t=e,n=0,r=1;for(let n=0;n<8;n++){const n=f(t)-e;if(Math.abs(n)<1e-6)return t;const r=d(t);if(Math.abs(r)<1e-6)break;t-=n/r}for(t=e;n<r;){const o=f(t);if(Math.abs(o-e)<1e-6)return t;e>o?n=t:r=t,t=(r+n)/2}return t}(e),((c*t+u)*t+a)*t;var t}}function f(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 d(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 p=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),h=new Set(["translate","rotate","scale","skew"]),m=new Set(["offset-distance","offsetDistance"]),v=new Set(["offset-distance","offsetDistance"]);function y(e){return e.includes("-")?e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()):e}var g=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 b(e){return g.has(e)?e:e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function A(e,t,n){return Math.max(t,Math.min(e,n))}var w=new Set(["type","children","animate","style","animator","defs","bindings"]);function k(e){const t={};for(const n of Object.keys(e)){if(w.has(n))continue;let r=e[n];p.has(n)&&Array.isArray(r)?t[n]=f(r):h.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 x(e,t){if(!e)return null;const n=e,{type:s,children:l,animate:a,style:u}=n,c=((e,t)=>{var n={};for(var s in e)o.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&r)for(var s of r(e))t.indexOf(s)<0&&i.call(e,s)&&(n[s]=e[s]);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(l)for(const e of l){const t=x(e,f);t&&(p||(p=[]),p.push(t))}return function(e,t,n,r){const o=document.createElementNS("http://www.w3.org/2000/svg",e);for(const e in t)o.setAttribute(b(e),t[e]);if(n)for(const e in n)o.style[e]=String(n[e]);if(r)for(const e of r)o.appendChild(e);return o}(s||"g",k(c),d,p)}function j(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}var S="data-px-animation-src",O="_px_animator";function C(e){return!(!e||"object"!=typeof e||Array.isArray(e))&&("svg"===e.type||"svg"===e.tagName)}function E(e){return e&&"object"==typeof e&&!Array.isArray(e)}function M(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 R(e,t,n){if(!E(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||M(e.easing,t+".easing",n)||(r=!1),void 0===e.e||M(e.e,t+".e",n)||(r=!1),r}function P(e,t,n){if(!E(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)=>{R(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)=>{R(e,t+".kfs["+o+"]",n)||(r=!1)}):(n.push(t+".kfs: expected array"),r=!1)),r}function T(e,t,n){if(!E(e))return n.push(t+": expected object"),!1;let r=!0;for(const o of Object.keys(e))P(e[o],t+"."+o,n)||(r=!1);return r}function I(e,t,n){if("string"==typeof e)return!0;if(Array.isArray(e)){let r=!0;return e.forEach((e,o)=>{"string"==typeof e||T(e,t+"["+o+"]",n)||(r=!1)}),r}return E(e)?T(e,t,n):(n.push(t+": expected string, array, or PxAnimationDefinition object"),!1)}function N(e,t,n){if(!E(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(!E(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 F(e,t,n){if(!E(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)=>{F(e,t+".children["+o+"]",n)||(r=!1)}):(n.push(t+".children: expected array"),r=!1)),void 0===e.animate||I(e.animate,t+".animate",n)||(r=!1),r}function L(e,t,n){if(!F(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||N(e.animator,t+".animator",n)||(r=!1),void 0===e.defs||function(e,t,n){if(!E(e))return n.push(t+": expected object"),!1;let r=!0;if(void 0!==e.easings)if(E(e.easings))for(const o of Object.keys(e.easings))M(e.easings[o],t+".easings."+o,n)||(r=!1);else n.push(t+".easings: expected object"),r=!1;if(void 0!==e.animations)if(E(e.animations))for(const o of Object.keys(e.animations))T(e.animations[o],t+".animations."+o,n)||(r=!1);else n.push(t+".animations: expected object"),r=!1;return void 0===e.styles||E(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(!E(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),I(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||F(e.design,t+".design",n)||(r=!1),r}function U(e){const t=[];return{valid:L(e,"root",t),errors:t}}function D(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 z(e){var t;if(e)return e.defs||(null==(t=e.meta)?void 0:t.defs)}function q(e){var t;if(e)return e.bindings||(null==(t=e.meta)?void 0:t.bindings)}function V(e){return null==e?void 0:e.children}function W(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 _(e){return e.startsWith("path(")&&e.endsWith(")")?e.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(e)?e:void 0}function Z(e){return"string"==typeof e&&void 0!==_(e)}function B(e){if(e&&"object"==typeof e&&"paths"in e){const t=e.paths;if(Array.isArray(t)&&t.length>0&&Z(t[0])){const e=[];for(const n of t){const t=_(n);t&&e.push(...W(t))}return{paths:e}}return e}if(Array.isArray(e)){if(e.length>0&&Z(e[0])){const t=[];for(const n of e){const e=_(n);e&&t.push(...W(e))}return{paths:t}}return{paths:e}}if(Z(e)){return{paths:W(_(e))}}return e}function K(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 $(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 H(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=B(u)),p.has(e)&&(u=null!=(a=d(u))?a:u),c.push({t:n,v:u,e:K(f,r)})}return c.sort((e,t)=>{var n,r;return(null!=(n=e.t)?n:0)-(null!=(r=t.t)?r:0)}),c}var Q=0;function X(e){const t=D(e)||{},n=z(e),r=(t.duration,[]),o=(e,t)=>{if(!t)return null;const r=function(e,t){if(!e)return[];const n=[];if("string"==typeof e){const r=$(e,t);r&&n.push(r)}else if(Array.isArray(e))for(const r of e){const e=$(r,t);e&&n.push(e)}else n.push(e);return n}(t,n);if(0===r.length)return null;const o=function(e,t,n){const r={};for(const[t,o]of Object.entries(e)){const e=H(t,o,0,n);e.length>0&&(r[t]={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}(r),0,n);return 0===Object.keys(o).length?null:{id:e,animate:o}},i=q(e);if(i)for(const e of i){const t=o(e.id,e.animate);t&&r.push(t)}const s=e=>{if(e.animate){const t=e.id||"_px_el_"+ ++Q;e.id=t;const n=o(t,e.animate);n&&r.push(n)}if(e.children)for(let t=0;t<e.children.length;t++)s(e.children[t])};if(e.children)for(let t=0;t<e.children.length;t++)s(e.children[t]);return r}function Y(e,t,n){var r,o,i,s,d,h,v;const y=t.kfs||t.keyframes||[];if(0===y.length)return null;const{prevKf:g,nextKf:w}=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}}(y,n);let k=g===w?0:(x=n,j=null!=(r=g.t)?r:0,S=null!=(o=w.t)?o:0,O=0,C=1,S===j?O:O+(x-j)/(S-j)*(C-O));var x,j,S,O,C;k=A(k,0,1);const E=null!=(i=g.e)?i:g.easing;if(E&&Array.isArray(E))try{k=c(E)(k)}catch(e){}let M=!(R=e).includes("-")&&/[a-z][A-Z]/.test(R)?b(e):e;var R;let P=null;const T=null!=(s=null==g?void 0:g.v)?s:null==g?void 0:g.value,I=null!=(d=null==w?void 0:w.v)?d:null==w?void 0:w.value;if("d"===M){P=function(e,t,n){const r=Math.max(e.length,t.length),o=[];for(let i=0;i<r;i++)o.push(u(e[i],t[i],n));return o}(null!=(h=null==T?void 0:T.paths)?h:Array.isArray(T)?T:[],null!=(v=null==I?void 0:I.paths)?v:Array.isArray(I)?I:[],k).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(p.has(M))P=f((F=I||[0,0,0,1],L=k,[l((N=T||[0,0,0,1])[0]||0,F[0]||0,L),l(N[1]||0,F[1]||0,L),l(N[2]||0,F[2]||0,L),l(void 0===N[3]?1:N[3],void 0===F[3]?1:F[3],L)])),M=e;else if("stroke-dasharray"===M)P=a(T||[],I||[],k).join(" "),M=e;else if("translate"===M){P="translate("+a(T||[0,0],I||[0,0],k).join(",")+")",M="transform"}else if("rotate"===M){P="rotate("+l(+(T||0),+(I||0),k)+")",M="transform"}else if("scale"===M){P="scale("+a(T||[1,1],I||[1,1],k).join(",")+")",M="transform"}else{P=l(+(T||0),+(I||0),k)}var N,F,L;return m.has(M)&&"number"==typeof P&&(P=100*P+"%"),{k:M,v:null===P?"":""+P}}function G(e,t){const n={};for(const[r,o]of Object.entries(e)){const e=Y(r,o,t);e&&(n[e.k]=e.v)}return n}function J(e){return"#"+e}function ee(e,t,n){const r=D(e)||{},o=X(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||1e3),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,y=v&&v>0?1e3/v:0;let g=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 w(e){let n=function(){const t=l>0?l:1;let n=0,r=0;if(l>0){e=A(e,0,s*t),r=Math.max(0,Math.ceil(e/t)-1),r=Math.min(r,s-1);n=A((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=G(r,n*l);for(const[n,r]of Object.entries(o))t.setAttribute(e.id,n,r)}}r.delay&&w(b());const k=()=>!!f&&(!!t.isConnected()&&!(Number.isFinite(a)&&b()>=a)),x=e=>{null!==c&&(cancelAnimationFrame(c),c=null),(e||k())&&(c=requestAnimationFrame(()=>{c=null,(()=>{var e;if(!t.isConnected())return void j();const r=b();if(y>0){const e=Date.now();if(g&&e-g<y)return;g=e}if(a&&Number.isFinite(a)&&r>=a)return w(a),m||(m=!0,null==(e=null==n?void 0:n.onFinish)||e.call(n)),void j();w(r)})(),x()}))},j=()=>{f&&(d=b(),p=0,f=!1,null!==c&&(cancelAnimationFrame(c),c=null),w(d))},S={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>k(),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;j(),null==(e=null==n?void 0:n.onPause)||e.call(n)},cancel:()=>{var e;j(),d=0,p=0,f=!1,m=!1,w(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,w(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()),w(b())},destroy:()=>{S.cancel()}};return S}function te(e,l,a,u){const c=D(e)||{};if(!u)if(e.id){const t=J(e.id);(u=document.querySelector(t))||console.warn("createFrameLoopAnimator: No root element found for selector: ",t)}else console.warn("createFrameLoopAnimator: No root element provided");let f=ee(e,l||function(e){const t=new Set,n={isConnected:()=>!e||e.isConnected,setAttribute:(n,r,o)=>{r=b(r);const i=J(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),v.has(r)&&(t.style[r]=o)}}};return n}(u),a);var d;return d=((e,t)=>{for(var n in t||(t={}))o.call(t,n)&&s(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&s(e,n,t[n]);return e})({},f),f=t(d,n({getRootElement:()=>u||null})),c.trigger&&j(f,c.trigger),f}function ne(e,t,n){var r,o,i,s;const l=new Map;for(const[a,u]of Object.entries(e)){const e=u.kfs||u.keyframes||[],c=[];for(const l of e){let e=null!=(o=null!=(r=l.t)?r:l.time)?o:0;e=A(e/(n.duration||1),0,1);let u=null!=(i=l.v)?i:l.value;const d=null!=(s=l.e)?s:l.easing,m={offset:e,easing:d&&Array.isArray(d)?"cubic-bezier("+d.join(",")+")":void 0};let v,g=a;p.has(a)&&Array.isArray(u)?v=f(u):h.has(a)?(Array.isArray(u)&&("translate"===a&&(u=u.map(e=>e+"px")),u=u.join(",")),"rotate"===a&&(u+="deg"),v=a+"("+u+")",g="transform"):v=""+u,CSS.supports(g,v)||t.add(g),g=y(g),m[g]=v,c.push(m)}c.length>0&&l.set(a,c)}return l}function re(e,t,n,r){const o=D(e)||{},i=X(e);if(!n)if(e.id){const t=J(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=J(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=ne(r,u,o);for(let e=0;e<l.length;e++){const n=l[e],r=o.delay&&o.delay>0?o.delay:void 0,i=o.delay&&o.delay<0&&o.duration?-o.delay%o.duration:void 0,u={duration:o.duration,delay:r,fill:o.fill,direction:o.direction,iterations:a};for(const[,e]of c)if(e.length>0)try{const r=new KeyframeEffect(n,e,u),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)}),i&&(o.currentTime=i),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:()=>{s.forEach(e=>e.finish())},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&&j(c,o.trigger),c}var oe=0;function ie(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(e=>ie(e));const t=e,n={};for(const e of Object.keys(t))n[e]=ie(t[e]);return n}function se(e){const t=ie(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)+(++oe).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]=le(l,n);else if(i.has(s)){const e=n.get(l);e&&(t[s]=e)}else l.includes("url(#")&&(t[s]=le(l,n));else if("style"===s&&"object"==typeof l&&null!==l)for(const[e,t]of Object.entries(l))"string"==typeof t&&(l[e]=le(t,n));else"object"==typeof l&&null!==l&&"animate"!==s&&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 le(e,t){return e.replace(/url\(#([^)]+)\)/g,(e,n)=>{const r=t.get(n);return r?"url(#"+r+")":e})}function ae(e,t,n,r){(D(e)||{}).debug=!0;let o=null;if(r&&e.children){e=se(e);const t="string"==typeof r?document.querySelector(r):r;t&&(o=x(e),o&&t.replaceChildren(o))}return function(e,t,n,r){const o=D(e)||{};let i;return i="frames"===o.mode?te(e,t,n,r):re(e,n,r,"webapi"===o.mode)||te(e,t,n,r),o.debugInstName&&(window[o.debugInstName]=i),i}(e,t,n,o)}function ue(e,t,n,r){if("object"==typeof e)return ae(e,t,n,r);let o=null;return fetch(e).then(e=>e.json()).then(e=>{C(e)?o=ae(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 ce(){const e=document.querySelectorAll("["+S+"]");for(let t=0;t<e.length;t++){const n=e[t];if(!n[O]){const e=n.getAttribute(S);e&&(n[O]=ue(e,void 0,void 0,n))}}}"undefined"!=typeof window&&(window.loadTagAnimators=ce,window.createAnimator=ue,window.setupAnimationTriggers=j);export{p as COLOUR_ATTR_NAMES,O as PX_ANIM_ATTR_NAME,S as PX_ANIM_SRC_ATTR_NAME,v as STYLE_ATTR_NAMES,h as TRANSFORM_FN_NAMES,G as calcAnimationValues,b as camelCaseToKebabWordIfNeeded,ue as createAnimator,ae as createAnimatorImpl,ee as createBasicFrameLoopAnimator,te as createFrameLoopAnimator,re as createWebApiAnimator,se as generateNewIds,D as getAnimatorConfig,q as getBindings,V as getChildren,z as getDefs,k as getNormalizedProps,C as isPxElementFileFormat,U as isPxElementFileFormatDeep,ce as loadTagAnimators,X as normalizeDocument,x as renderNode,j as setupAnimationTriggers,f as toRGBA};
1
+ var t=Object.defineProperty,e=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=Math.pow,s=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,l=(t,e)=>{for(var n in e||(e={}))o.call(e,n)&&s(t,n,e[n]);if(r)for(var n of r(e))i.call(e,n)&&s(t,n,e[n]);return t},u=(t,r)=>e(t,n(r));function c(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 f(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 d(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 h(t,e,n){if(!e)return t;delete t.transform;let r=t;var o;return r=p(r,"skew",e.skew,n),r=m(r,e.origin,!0),r=p(r,"scale",void 0===(o=e.scale)?void 0:Array.isArray(o)?[o[0]/100,o[1]/100]:o,n),r=p(r,"rotate",e.rotate,n),r=m(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=p(r,"translate",e.translate,n):(r=m(r,e.origin,!0),r=p(r,"translate",e.translate,n),r=m(r,e.origin,!1)),r}function p(t,e,n,r){if(void 0===n)return t;if("skew"===e){const e=f(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=f(n);if("static"===o.kind)return{type:"g",transform:{value:c(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>d(t,c(e,t.value,void 0)))};return o.autoOrient&&(n.autoOrient=!0),{type:"g",animate:{transform:n},children:[t]}}return t}function m(t,e,n){if(void 0===e)return t;const r=f(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=>d(t,{translate:o(t.value)}))}},children:[t]}:t}function y(t,e,n){var r,o,i;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==(i=t.children)||i.forEach(t=>y(t,e,n))}function v(t,e,n,r,o){const i=function(t,e){var n;const r={};let o=!1;const i=null==(n=t.animate)?void 0:n.transform;if(i&&"object"==typeof i&&Array.isArray(i.keyframes)){const e=i.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=b(i),a={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})};i.autoOrient&&(a.autoOrient=!0),r.animate={transform:a};const s=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&&!s||(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),o});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},o=!0}}const a=void 0!==(null==e?void 0:e.translate),s=o||a;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],i=e[e.length-1];if("translate"===i.name&&"translate"===o.name){const n=g(i.full),r=g(o.full),a=-n[0],s=-n[1],l=r[0]-a,u=r[1]-s;if(0===l&&0===u)return{rest:t};return{translate:"translate("+l+","+u+")",rest:"translate("+a+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===i.name)return{rest:t};const a=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)a.push(e[s].full),s++;if(!a.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:a.join(""),rest:l||void 0}}(t.transform);s?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 i=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return i.length>=4&&1===i[0]&&0===i[1]&&0===i[2]&&1===i[3]}(t.transform)&&delete t.transform:e.translate&&(r.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}return r}(t,e);"string"==typeof t.id&&delete t.id;const{outer:a,inner:s}=function(t){if(!t)return{};const e=b(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=h(l,s,o);let u={type:"g",id:n,children:[{type:"g",id:r,children:[l]}]};return void 0!==i.transform&&(u.transform=i.transform),void 0!==i.animate&&(u.animate=i.animate),a&&(delete u.id,u=h(u,a,o),u.id=n),u}function g(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 b(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 k(t,e){return"_lw_"+e+"_"+t.nextId++}function A(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>A(t,e))}function w(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(w);const e={};for(const n of Object.keys(t))e[n]=w(t[n]);return e}function j(t,e){const n=new Map,r=t=>{var o;if("string"==typeof t.id){const r=k(e,"retimed");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}),i=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||"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(i)};return i(t),n}function O(t,e,n,r){if(!e)return t;if(!e.href)return r.errors.push("maskedBy.href missing — cannot build mask"),t;const o=k(r,"mask");let i={type:"use",href:"#"+e.href};i=function(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=f(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=_(o,"translate",e.translate,void 0,n),o=_(o,"rotate",e.rotate,r,n),o=_(o,"scale",e.scale,r,n),o}(i,n,r);const a={type:"mask",id:o,children:[i]};return e.maskType&&(a.maskType=e.maskType),e.maskUnits&&(a.maskUnits=e.maskUnits),e.maskContentUnits&&(a.maskContentUnits=e.maskContentUnits),r.defs.push(a),t.mask="url(#"+o+")",t}function _(t,e,n,r,o){if(void 0===n)return t;const i=f(n);return"static"===i.kind?{type:"g",transform:{value:c(e,x(e,i.value),r)},children:[t]}:"animated"===i.kind?{type:"g",animate:{transform:{keyframes:i.keyframes.map(t=>d(t,c(e,x(e,t.value),r)))}},children:[t]}:t}function x(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function S(t,e){const n={};return t.translate&&(n.translate=[t.translate[0]*e,t.translate[1]*e]),void 0!==t.rotate&&(n.rotate=t.rotate*e),t.scale&&(n.scale=[a(t.scale[0]/100,e),a(t.scale[1]/100,e)]),t.origin&&(n.origin=[t.origin[0]*e,t.origin[1]*e]),n}function z(t,e,n){var r;const o=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)&&o(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)&&o(n.keyframes)}null==(r=t.children)||r.forEach(t=>z(t,e,n))}function M(t,e,n){var r;if(!e&&!n)return t;const o=null!=(r=t.d)?r:function(t){var e,n,r,o;if("rect"!==t.type)return;const i=Number(null!=(e=t.x)?e:0),a=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"+(i+s)+","+a+"L"+(i+s)+","+(a+l)+"L"+i+","+(a+l)+"L"+i+","+a+"L"+(i+s)+","+a+"z"}(t);if(void 0===o)return t;const i=u(l({},t),{type:"g"});delete i.d;const a=i.meta=l({},i.meta||{}),s=a.effects=l({},a.effects||{});return e&&(s.trimPath=e),s.isCombinedShape=!0,i.children=[{type:"path",d:o}],i}function I(t){const e={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map},n=w(t);A(n,e.idMap),y(n,e,()=>k(e,"inner"));const r=P(C(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 C(t,e){t.children&&(t.children=t.children.map(t=>C(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:i,repeater:a,maskedBy:s,trimPath:l,retime:u,ref:c}=null!=n?n:{},f=null==n?void 0:n.isCombinedShape;n&&delete t.effects;let d=t;return d=M(d,l,f),d=function(t,e,n){var r,o;if(!e)return t;const i=null!=(r=e.copies)?r:1;if(i<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const a=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=w(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<i;t++){const n=w(l);n.transform={value:S(e,t)},u.push(n)}const c={type:"g",children:u};return void 0!==a&&(c.transform=a),void 0!==s&&(c.animate={transform:s}),c}(d,a,e),d=O(d,s,i,e),d=o?v(d,i,r,o,e):function(t,e,n,r){if(e){const n=e.baseId;if(n){const o="content"===e.type&&r.contentRefInnerIds.get(n)||n;t.href="#"+o}else r.errors.push("ref: missing baseId")}return h(t,n,r)}(d,c,i,e),u&&(t.effects={retime:u}),r&&e.idMap.set(r,d),d}function P(t,e){var n;t.children&&(t.children=t.children.map(t=>P(t,e)));const r=null==(n=t.effects)?void 0:n.retime;return r?(delete t.effects,function(t,e,n){var r,o;if(!e)return t;const i=e.baseId;if(!i)return n.errors.push("retime: missing baseId"),t;const a=n.idMap.get(i);if(!a)return n.warnings.push('retime: target "'+i+'" not found'),t;const s=null!=(r=e.start)?r:0,l=null!=(o=e.stretch)?o:1;{const e=w(a);j(e,n);const r=k(n,"retime");return e.id=r,z(e,s,l),n.defs.push(e),t.href="#"+r,t}}(t,r,e)):t}function E(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var N=class{_canSanitize(t){return this.isValid(t)}optional(){return new T(this)}},T=class extends N{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)}},V=class extends N{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(E(null!=n?n:[])+": expected string, got "+typeof t),!1)}},R=class extends N{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(E(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},U=class extends N{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(E(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},L=class extends N{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(E(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},F=class extends N{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(E(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},D=class extends N{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(E(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))}},W=class extends N{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(E(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)}},B=class extends N{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(E(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(i=!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(E(o)+": unexpected extra key"),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},q=class extends N{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=l({},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(E(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(i=!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)||(i=!1),o.pop());return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},J=class extends N{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(E(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)}},X=class extends N{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(E(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,i]of Object.entries(t))r.push(n),this.value.isValid(i,e,r)||(o=!1),r.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},Y=class extends N{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},Z=class extends N{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)}},K=class extends N{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(E(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 $(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function G(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 H={string:(t="")=>new V(t),number:(t=0)=>new R(t),boolean:(t=!1)=>new U(t),literal:t=>new L(t),enum:(t,e)=>new F(t,e),union:(t,e)=>new D(t,e),discriminatedUnion:(t,e)=>new W(t,e),object:t=>new B(t),openObject:(t,e)=>new q(t,e),extendedObject:(t,e)=>new B(l(l({},t._shape),e)),array:t=>new J(t),record:t=>new X(t),any:()=>new Y,tuple:t=>new K(t),lazy:(t,e)=>new Z(t,e)},Q="data-px-animation-src",tt="_px_animator",et="text",nt="textContent",rt=new Set(["type","children","animator","meta","animate",et,nt]),ot=H.union([H.string(),H.tuple([H.number(),H.number(),H.number(),H.number()])]),it=(H.union([H.string(),H.number(),H.array(H.number()),H.lazy(()=>ut,{}),H.object({path:H.string()}),H.lazy(()=>H.object({paths:H.array(Pt)}),{paths:[]})]),H.object({time:H.number().optional(),t:H.number().optional(),value:H.any().optional(),v:H.any().optional(),easing:ot.optional(),e:ot.optional(),tangentOut:H.tuple([H.number(),H.number()]).optional(),to:H.tuple([H.number(),H.number()]).optional(),tangentIn:H.tuple([H.number(),H.number()]).optional(),ti:H.tuple([H.number(),H.number()]).optional(),selected:H.boolean().optional()})),at=H.object({segmentCount:H.number().optional(),before:H.boolean().optional(),alternate:H.boolean().optional()}),st=H.object({keyframes:H.array(it).optional(),kfs:H.array(it).optional(),loop:H.union([at,H.boolean()]).optional(),autoOrient:H.boolean().optional()}),lt=["translate","rotate","scale","origin"],ut=H.object({translate:H.tuple([H.number(),H.number()]).optional(),rotate:H.number().optional(),scale:H.tuple([H.number(),H.number()]).optional(),origin:H.tuple([H.number(),H.number()]).optional()}),ct=H.union([H.string(),H.object({value:ut}),st]),ft=H.record(st),dt=H.union([H.string(),H.array(H.union([H.string(),ft])),ft]),ht=H.object({startOn:H.enum(["load","mouseOver","click","scrollIntoView","programmatic"]).optional(),outAction:H.enum(["continue","pause","reset","reverse"]).optional(),scrollIntoViewThreshold:H.number().optional()}),pt=H.object({easings:H.record(H.tuple([H.number(),H.number(),H.number(),H.number()])).optional(),animations:H.record(ft).optional(),styles:H.record(H.any()).optional()}),mt=H.object({mode:H.enum(["auto","webapi","frames"]).optional(),duration:H.number().optional(),delay:H.number().optional(),iterations:H.union([H.number(),H.literal("infinite")]).optional(),fill:H.enum(["forwards","backwards","both","none"]).optional(),direction:H.enum(["normal","reverse","alternate","alternate-reverse"]).optional(),frameRate:H.number().optional(),trigger:ht.optional(),definitions:pt.optional(),animate:H.record(dt).optional(),debug:H.boolean().optional(),debugInstName:H.string().optional()}),yt=H.object({id:H.string(),animate:dt}),vt=H.union([H.string(),H.number(),H.object({value:H.any()}),st]),gt=H.union([H.number(),H.object({value:H.number()}),H.object({keyframes:H.array(it),autoOrient:H.boolean().optional()})]),bt=H.union([H.tuple([H.number(),H.number()]),H.object({value:H.tuple([H.number(),H.number()])}),H.object({keyframes:H.array(it),autoOrient:H.boolean().optional()})]),kt=H.object({translate:bt.optional(),rotate:gt.optional(),scale:bt.optional(),skew:bt.optional(),origin:bt.optional()}),At=H.object({copies:H.number().optional(),translate:H.tuple([H.number(),H.number()]).optional(),rotate:H.number().optional(),scale:H.tuple([H.number(),H.number()]).optional(),origin:H.tuple([H.number(),H.number()]).optional()}),wt=H.object({href:H.string().optional(),maskType:H.string().optional(),maskUnits:H.string().optional(),maskContentUnits:H.string().optional()}),jt=H.any(),Ot=H.object({baseId:H.string().optional(),start:H.number().optional(),stretch:H.number().optional(),timeCrop:H.tuple([H.number(),H.number()]).optional()}),_t=H.object({baseId:H.string().optional(),type:H.string().optional()}),xt=H.object({transformation:kt.optional(),repeater:At.optional(),maskedBy:wt.optional(),trimPath:jt.optional(),retime:Ot.optional(),isCombinedShape:H.boolean().optional(),ref:_t.optional()});function St(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!xt.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 zt=H.openObject({type:H.string(),id:H.string().optional(),meta:H.any().optional(),effects:xt.optional(),animate:ft.optional(),style:H.union([H.string(),H.record(H.union([H.string(),H.number()]))]).optional()},vt),Mt=H.openObject(u(l({},zt._shape),{children:H.lazy(()=>H.array(Mt),[]).optional()}),vt),It=H.object({width:H.number().optional(),height:H.number().optional(),viewBox:H.string().optional(),animator:mt.optional()}),Ct=H.openObject(u(l(l({},zt._shape),It._shape),{type:H.literal("svg"),children:H.array(Mt).optional()}),vt),Pt=H.object({v:H.array(H.array(H.number())),i:H.array(H.array(H.number())).optional(),o:H.array(H.array(H.number())).optional(),c:H.boolean().optional()});function Et(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&("svg"===t.type||"svg"===t.tagName)}function Nt(t){const e=Ct.isValid(t);return{valid:e,errors:e?[]:["Document failed schema validation"]}}function Tt(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 Vt(t){var e;if(t)return null==(e=Tt(t))?void 0:e.definitions}function Rt(t){var e;if(!t)return;const n=null==(e=Tt(t))?void 0:e.animate;return n?Object.entries(n).map(([t,e])=>({id:t,animate:e})):void 0}function Ut(t){return null==t?void 0:t.children}function Lt(t,e,n){return t+(e-t)*n}function Ft(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let i=0;i<o;i++)r[i]=Lt(t[i]||0,e[i]||0,n);return r}function Dt(t,e,n){return[Lt(t[0]||0,e[0]||0,n),Lt(t[1]||0,e[1]||0,n),Lt(t[2]||0,e[2]||0,n),Lt(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function Wt(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++)o.push(Bt(t[i],e[i],n));return o}function Bt(t,e,n){var r,o,i,a,s,l,u,c,f;if(!t||!e)return t||e||{v:[]};const d=Math.min(Math.max(n,0),1),h=Math.min(t.v.length,e.v.length),p=[],m=[],y=[];for(let n=0;n<h;n++){const f=t.v[n],h=e.v[n];p.push(Ft(f,h,d));const v=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,g=null!=(a=null==(i=e.i)?void 0:i[n])?a:h;m.push(Ft(v,g,d));const b=null!=(l=null==(s=t.o)?void 0:s[n])?l:f,k=null!=(c=null==(u=e.o)?void 0:u[n])?c:h;y.push(Ft(b,k,d))}return{v:p,i:m.length?m:void 0,o:y.length?y:void 0,c:null!=(f=t.c)?f:e.c}}function qt(t,e,n){if(n<=0)return 0;if(n>=1)return 1;const r=3*t,o=3*(e-t)-r,i=1-r-o;function a(t){return((i*t+o)*t+r)*t}function s(t){return(3*i*t+2*o)*t+r}let l=n,u=0,c=1;for(let t=0;t<8;t++){const t=a(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=a(l);if(Math.abs(t-n)<1e-6)return l;n>t?u=l:c=l,l=(c+u)/2}return l}function Jt(t){const[e,n,r,o]=t,i=3*n,a=3*(o-n)-i,s=1-i-a;return function(t){return n=qt(e,r,t),((s*n+a)*n+i)*n;var n}}function Xt(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Yt(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,i]=t,a=qt(n,o,e),s=[n,r],l=[o,i],{left:u,right:c}=function(t,e,n,r,o){const i=Xt(t,e,o),a=Xt(e,n,o),s=Xt(n,r,o),l=Xt(i,a,o),u=Xt(a,s,o),c=Xt(l,u,o);return{left:[t,i,l,c],right:[c,u,s,r]}}([0,0],s,l,[1,1],a),f=u[3][0],d=u[3][1];let h,p;f>1e-9&&Math.abs(d)>1e-9&&(h=[u[1][0]/f,u[1][1]/d,u[2][0]/f,u[2][1]/d]);const m=1-f,y=1-d;return m>1e-9&&Math.abs(y)>1e-9&&(p=[(c[1][0]-f)/m,(c[1][1]-d)/y,(c[2][0]-f)/m,(c[2][1]-d)/y]),{left:h,right:p}}function Zt(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function Kt(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 $t(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),i=n?e[2]+e[2]:e.slice(4,6),a=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(i,16)/255];return null!==a&&s.push(parseInt(a,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 Gt=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),Ht=new Set(["translate","rotate","scale","skew"]),Qt=new Set(["offset-distance","offsetDistance"]);function te(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],i=t.translate,a=t.origin,s=t.rotate,l=t.scale,u=r?"px":"",c=r?"deg":"";return i&&o.push("translate("+i[0]+u+","+i[1]+u+")"),a&&o.push("translate("+a[0]+u+","+a[1]+u+")"),null!=s&&o.push("rotate("+s+c+")"),l&&o.push("scale("+l[0]+","+l[1]+")"),a&&o.push("translate("+-a[0]+u+","+-a[1]+u+")"),o.join("")}var ee=new Set(["offset-distance","offsetDistance"]);var ne=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 re(t){return ne.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function oe(t,e,n){return Math.max(e,Math.min(t,n))}function ie(t,e,n,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const i=1-o,a=i*i,s=o*o,l=a*i,u=3*o*a,c=3*s*i,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 ae=1e-4;function se(t,e,n,r,o){const i=1-o,a=3*i*i,s=6*o*i,l=3*o*o;return[a*(e[0]-t[0])+s*(n[0]-e[0])+l*(r[0]-n[0]),a*(e[1]-t[1])+s*(n[1]-e[1])+l*(r[1]-n[1])]}var le=new Set(["svg","g","path","circle","ellipse","rect","line","polyline","polygon","text","tspan","textPath","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker","filter","feGaussianBlur","feOffset","feBlend","feColorMatrix","feMerge","feMergeNode"].map(t=>t.toLowerCase())),ue=["href","src","filter","clipPath","mask","markerStart","markerMid","markerEnd"],ce=new Set(ue),fe=["href","src","fill","fillOpacity","fillRule","stroke","strokeWidth","strokeOpacity","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeDasharray","strokeDashoffset","opacity","transform","x","y","cx","cy","r","rx","ry","width","height","d","x1","y1","x2","y2","points","dx","dy","fontSize","fontFamily","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","space","xml:space","textDecoration","textTransform","whiteSpace","white-space","dominantBaseline","alignmentBaseline","rotate","id","class","viewBox","preserveAspectRatio","offset","stopColor","stopOpacity","gradientTransform","clipPath","mask","offsetPath","offsetDistance","offsetRotate","offsetAnchor","offsetPosition","startOffset","textLength","lengthAdjust","filter","stdDeviation","in","in2","result","mode",...ue],de=new Set(fe.map(t=>t.toLowerCase()));function he(t,e){const n=t.toLowerCase();if(de.has(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() references must be internal url(#id), got:',e):e}if(ce.has(n)){const t=String(e);return t.startsWith("#")||/^url\(#[^)]+\)$/.test(t)?e:void 0}return e}console.warn("Attribute not in whitelist: ",n)}function pe(t){const e={};for(const n of Object.keys(t)){if(rt.has(n))continue;if("style"===n)continue;let r=t[n];Gt.has(n)&&Array.isArray(r)?e[n]=Kt(r):"transform"===n&&null!==r&&"object"==typeof r&&!Array.isArray(r)&&r.value&&"object"==typeof r.value?e.transform=te(r.value,{withUnits:!1}):Ht.has(n)?(Array.isArray(r)&&("translate"===n&&(r=r.map(t=>t+"px")),r=r.join(",")),"rotate"===n&&(r+="deg"),e.transform=n+"("+r+")"):null!=r&&(e[n]=String(r))}return e}function me(t,e){if(!t)return null;const n=t,{type:a,children:s,style:l}=n,u=((t,e)=>{var n={};for(var a in t)o.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(null!=t&&r)for(var a of r(t))e.indexOf(a)<0&&i.call(t,a)&&(n[a]=t[a]);return n})(n,["type","children","style"]),c=Vt(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}(l,c);let d;if(s)for(const t of s){const e=me(t,c);e&&(d||(d=[]),d.push(e))}return function(t,e,n,r,o){if(!le.has(t.toLowerCase()))return console.warn("Attribute not in whitelist: ",t),null;const i=document.createElementNS("http://www.w3.org/2000/svg",t);for(const t in e)i.setAttribute(re(t),he(t,e[t]));if(n)for(const t in n)i.style[t]=String(n[t]);if(r)for(const t of r)i.appendChild(t);return o&&(i.textContent=o),i}(a||"g",pe(u),f,d,u[et]||u[nt])}function ye(t,e){const{startOn:n,outAction:r="continue",scrollIntoViewThreshold:o=.5}=e,i=t.getRootElement();if(!i)return console.warn("setupAnimationTriggers: No root element found for animation."),t;const a=()=>{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=()=>a();"complete"===document.readyState?t():window.addEventListener("load",t,{once:!0});break}case"mouseOver":{const t=()=>a(),e=()=>s();i.addEventListener("mouseenter",t),i.addEventListener("mouseleave",e);break}case"click":{const e=()=>{t.isPlaying()?s():a()};i.addEventListener("click",e);break}case"scrollIntoView":new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&t.intersectionRatio>=o?a():s()})},{threshold:o}).observe(i);break}return t}var ve=new WeakMap;function ge(t,e,n,r){const o=ve.get(t);if(o)return o;const i=t.tangentOut,a=e.tangentIn,s=[n[0]+(i?i[0]:0),n[1]+(i?i[1]:0)],l=[r[0]+(a?a[0]:0),r[1]+(a?a[1]:0)],u=function(t,e,n,r,o=100){const i=o+1,a=new Float64Array(i),s=new Float64Array(i);let l=ie(t,e,n,r,0);a[0]=0,s[0]=0;let u=0;for(let c=1;c<i;c++){const i=c/o,f=ie(t,e,n,r,i),d=f[0]-l[0],h=f[1]-l[1];u+=Math.sqrt(d*d+h*h),a[c]=i,s[c]=u,l=f}return{ts:a,ds:s}}(n,s,l,r),c={P0:n,P1:s,P2:l,P3:r,lut:u,totalArc:u.ds[u.ds.length-1]};return ve.set(t,c),c}function be(t,e,n,r,o,i){const a=ge(t,e,n,r),s=0===a.totalArc?o:function(t,e){const{ts:n,ds:r}=t,o=r.length-1;if(e<=0)return n[0];if(e>=r[o])return n[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;r[t]<e?i=t+1:a=t}const s=r[a-1],l=r[a]-s,u=l>0?(e-s)/l:0;return n[a-1]+u*(n[a]-n[a-1])}(a.lut,o*a.totalArc),l=ie(a.P0,a.P1,a.P2,a.P3,s);if(!i)return{translate:l};const u=function(t,e,n,r,o){const i=se(t,e,n,r,o);if(0===i[0]&&0===i[1])return se(t,e,n,r,o<.5?o+ae:o-ae);return i}(a.P0,a.P1,a.P2,a.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}function ke(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,i=o[3]||0,a=o[4]||0,s=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([a,s]),n.i.push([r,i]),n.o.push([a,s])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function Ae(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function we(t){return"string"==typeof t&&void 0!==Ae(t)}function je(t){if(t&&"object"==typeof t&&"string"==typeof t.path){const e=Ae(t.path);return e?{paths:ke(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&we(e[0])){const t=[];for(const n of e){const e=Ae(n);e&&t.push(...ke(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&we(t[0])){const e=[];for(const n of t){const t=Ae(n);t&&e.push(...ke(t))}return{paths:e}}return{paths:t}}if(we(t)){return{paths:ke(Ae(t))}}return t}function Oe(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 _e(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 xe(t,e,n,r){var o,i;if("d"===t){return{paths:Wt(null!=(o=null==e?void 0:e.paths)?o:Array.isArray(e)?e:[],null!=(i=null==n?void 0:n.paths)?i:Array.isArray(n)?n:[],r)}}return Gt.has(t)?Dt(e||[0,0,0,1],n||[0,0,0,1],r):Ht.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?Ft(e||[],n||[],r):Lt(+(e||0),+(n||0),r)}function Se(t,e,n,r){var o,i,a,s,l;const u=e.keyframes||e.kfs||[],c=[];for(const e of u){const n=null!=(i=null!=(o=e.time)?o:e.t)?i:0;let u=null!=(a=e.value)?a:e.v;const f=null!=(s=e.easing)?s:e.e;"d"===t&&(u=je(u)),Gt.has(t)&&(u=null!=(l=$t(u))?l:u),c.push({t:n,v:u,e:Oe(f,r)})}c.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const f=e.loop,d=!0===f?{}:f||void 0;return d&&c.length>=2?function(t,e,n,r){var o,i,a,s,l;const u=e.length-1,c=oe(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!=(i=e[0].t)?i:0,h=null!=(a=e[e.length-1].t)?a:0;let p,m;n.before?(p=0,m=d):(p=h,m=r);const y=m-p;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=>({relT:(t.t-v)/g,v:t.v,e:t.e})),k=Math.floor(y/g),A=(y-k*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?Zt(b[t-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 a=o[n-1],s=r.relT-a.relT,l=(i-a.relT)/s,u=a.e?Jt(a.e)(l):l,c=xe(t,a.v,r.v,u),{left:f}=Yt(a.e,l);return w.length>0&&a.relT<=i&&(w[w.length-1].e=f),void w.push({t:e+i*g,v:c,e:void 0})}w.push({t:e+r.relT*g,v:r.v,e:n<o.length-1?r.e:void 0})}}for(let t=0;t<k;t++){const e=n.before?k-1-t:t,r=!!n.alternate&&e%2==0;j(p+t*g,r)}if(A>1e-9){const t=!!n.alternate&&k%2==0;j(p+k*g,t,A)}return n.before?[...w,...e]:[...e,...w]}(t,c,d,n):c}var ze=0;function Me(t){const e=Tt(t)||{},n=Vt(t),r=e.duration||1e3,o=[],i=(t,e)=>{if(!e)return null;const o=function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=_e(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=_e(r,e);t&&n.push(t)}else n.push(t);return n}(e,n);if(0===o.length)return null;const i=function(t,e,n){const r={};for(const[o,i]of Object.entries(t)){const t=Se(o,i,e,n);t.length>0&&(r[o]={kfs:t})}return r}(function(t){const e={};for(const n of t)for(const[t,r]of Object.entries(n))e[t]=r;return e}(o),r,n);return 0===Object.keys(i).length?null:{id:t,animate:i}},a=Rt(t);if(a)for(const t of a){const e=i(t.id,t.animate);e&&o.push(e)}const s=t=>{const e=t.animate;if(e&&Object.keys(e).length>0){const n=t.id||"_px_el_"+ ++ze;t.id=n;const r=i(n,e);r&&o.push(r)}if(t.children)for(let e=0;e<t.children.length;e++)s(t.children[e])};if(t.children)for(let e=0;e<t.children.length;e++)s(t.children[e]);return o}function Ie(t,e,n){var r,o,i,a,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],i=t[t.length-1];for(let a=0;a<t.length-1;a++){const s=null!=(n=t[a].t)?n:0,l=null!=(r=t[a+1].t)?r:0;if(s<=e&&e<=l){o=t[a],i=t[a+1];break}}return{prevKf:o,nextKf:i}}(c,n);let h=f===d?0:(p=n,m=null!=(r=f.t)?r:0,y=null!=(o=d.t)?o:0,v=0,g=1,y===m?v:v+(p-m)/(y-m)*(g-v));var p,m,y,v,g;h=oe(h,0,1);const b=null!=(i=f.e)?i:f.easing;if(b&&Array.isArray(b))try{h=Jt(b)(h)}catch(t){}let k=!(A=t).includes("-")&&/[a-z][A-Z]/.test(A)?re(t):t;var A;let w=null;const j=null!=(a=null==f?void 0:f.v)?a:null==f?void 0:f.value,O=null!=(s=null==d?void 0:d.v)?s:null==d?void 0:d.value;if("d"===k){w=Wt(null!=(l=null==j?void 0:j.paths)?l:Array.isArray(j)?j:[],null!=(u=null==O?void 0:O.paths)?u:Array.isArray(O)?O:[],h).map(t=>function(t){var e,n,r,o;const i=t.v,a=t.i,s=t.o,l=t.c;if(!i.length)return"";const u=[],c=i.length;u.push("M"+i[0][0]+","+i[0][1]);for(let t=1;t<c;t++){const r=i[t-1],o=null!=(e=null==s?void 0:s[t-1])?e:r,l=null!=(n=null==a?void 0:a[t])?n:i[t],c=i[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=i[c-1],e=null!=(r=null==s?void 0:s[c-1])?r:t,n=null!=(o=null==a?void 0:a[0])?o:i[0],l=i[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("")}(t)).join("")}else if(Gt.has(k))w=Kt(Dt(j||[0,0,0,1],O||[0,0,0,1],h)),k=t;else if("stroke-dasharray"===k)w=Ft(j||[],O||[],h).join(" "),k=t;else if("transform"!==k||null===j||"object"!=typeof j||Array.isArray(j))if("translate"===k){w="translate("+Ft(j||[0,0],O||[0,0],h).join(",")+")",k="transform"}else if("rotate"===k){w="rotate("+Lt(+(j||0),+(O||0),h)+")",k="transform"}else if("scale"===k){w="scale("+Ft(j||[1,1],O||[1,1],h).join(",")+")",k="transform"}else{w=Lt(+(j||0),+(O||0),h)}else{const t=new Set([...j?Object.keys(j):[],...O?Object.keys(O):[]]),n={};for(const e of t){const t=null==j?void 0:j[e],r=null==O?void 0:O[e];if("rotate"===e)n.rotate=Lt(+(null!=t?t:0),+(null!=r?r:0),h);else if("translate"===e||"scale"===e||"origin"===e){const o="scale"===e?[1,1]:[0,0],i=Ft(t||o,r||o,h);n[e]=i}}if(function(t){var e;const n=null!=(e=t.keyframes)?e:t.kfs;if(!Array.isArray(n))return!1;if(t.autoOrient)return!0;for(const t of n)if(t.tangentIn||t.tangentOut)return!0;return!1}(e)){const t=j.translate,r=O.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=be(f,d,[+t[0],+t[1]],[+r[0],+r[1]],h,!!e.autoOrient);n.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(n.rotate=o.rotateDeg)}}w=te(n,{withUnits:!1}),k="transform"}return Qt.has(k)&&"number"==typeof w&&(w=100*w+"%"),{k:k,v:null===w?"":""+w}}function Ce(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=Ie(r,o,e);t&&(n[t.k]=t.v)}return n}function Pe(t){return"#"+t}function Ee(t,e,n){const r=Tt(t)||{},o=Me(t),i=r.iterations;let a=1;"number"==typeof i&&(a=i||1),"infinite"===i&&(a=1/0),a<1&&(a=1);const s=+(r.duration||1e3),l=s&&a?s*(a===1/0?1/0:a):s?(null!=a?a:1)*s:0,u=r.direction||"normal";let c=null,f=!1,d=r.delay||0,h=0,p=1,m=!1;const y=r.frameRate,v=y&&y>0?1e3/y:0;let g=0;const b=()=>{const t=h?(Date.now()-h)*p:0;let e=d+t;return Number.isFinite(l)&&e>l&&(e=l),e<0&&(e=0),e};function k(t){let n=function(){const e=s>0?s:1;let n=0,r=0;if(s>0){t=oe(t,0,a*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,a-1);n=oe((t-r*e)/e,0,1)}else n=t;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 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=Ce(r,n*s);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}r.delay&&k(b());const A=()=>!!f&&(!!e.isConnected()&&!(Number.isFinite(l)&&b()>=l)),w=t=>{null!==c&&(cancelAnimationFrame(c),c=null),(t||A())&&(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 k(l),m||(m=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)),void j();k(r)})(),w()}))},j=()=>{f&&(d=b(),h=0,f=!1,null!==c&&(cancelAnimationFrame(c),c=null),k(d))},O={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>A(),play:()=>{var t;f||(f=!0,h=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,h=0,f=!1,m=!1,k(d),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;d=Number.isFinite(l)?l:b(),h=0,f=!1,k(d),t&&!m&&(m=!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();p=t,d=e,f&&(h=Date.now())},getCurrentTime:()=>b(),setCurrentTime:t=>{t<0&&(t=0),Number.isFinite(l)&&t>l&&(t=l),d=t,f&&(h=Date.now()),k(b())},destroy:()=>{O.cancel()}};return O}function Ne(t,e,n,r){const o=Tt(t)||{};if(!r)if(t.id){const e=Pe(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 i=Ee(t,e||function(t){const e=new Set,n={isConnected:()=>!t||t.isConnected,setAttribute:(n,r,o)=>{r=re(r);const i=Pe(n),a=(null==t?void 0:t.querySelectorAll(i))||document.querySelectorAll(i);0!==a.length||e.has(i)||(e.add(i),console.warn('setAttribute: No elements found for selector "'+i+'"'));for(let t=0;t<a.length;t++){const e=a[t];e.setAttribute(r,o),ee.has(r)&&(e.style[r]=o)}}};return n}(r),n);return i=u(l({},i),{getRootElement:()=>r||null}),o.trigger&&ye(i,o.trigger),i}function Te(t,e,n,r){var o,i;let a=null!=(o=t.v)?o:t.value;const s=null!=(i=t.e)?i:t.easing,l={offset:e,easing:s&&Array.isArray(s)?"cubic-bezier("+s.join(",")+")":void 0};let u,c=n;var f;return Gt.has(n)&&Array.isArray(a)?u=Kt(a):"transform"!==n||null===a||"object"!=typeof a||Array.isArray(a)?Ht.has(n)?(Array.isArray(a)&&("translate"===n&&(a=a.map(t=>t+"px")),a=a.join(",")),"rotate"===n&&(a+="deg"),u=n+"("+a+")",c="transform"):u=""+a:(u=te(a,{withUnits:!0}),c="transform"),CSS.supports(c,u)||r.add(c),c=(f=c).includes("-")?f.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):f,l[c]=u,l}function Ve(t,e,n){var r,o,i,a,s;const c=[];for(let f=0;f<e.length;f++){const d=e[f],h=null!=(r=d.t)?r:0;if(h<0){const n=e[f+1];if(n&&(null!=(o=n.t)?o:0)>=0){const e=(0-h)/((null!=(i=n.t)?i:0)-h),r=d.e?Jt(d.e)(e):e,{right:o}=Yt(d.e,e);c.push({t:0,v:xe(t,d.v,n.v,r),e:o})}continue}if(h>n){const r=e[f-1];if(r&&(null!=(a=r.t)?a:0)<=n){const e=null!=(s=r.t)?s:0,o=(n-e)/(h-e),i=r.e?Jt(r.e)(o):o,{left:a}=Yt(r.e,o);c.length>0&&(c[c.length-1]=u(l({},c[c.length-1]),{e:a})),c.push({t:n,v:xe(t,r.v,d.v,i),e:void 0})}break}c.push(d)}return c}function Re(t,e,n){var r;const o=new Map;for(const[i,a]of Object.entries(t)){const t=n.duration||1,s=Ve(i,a.kfs||a.keyframes||[],t),c=[];for(let n=0;n<s.length;n++){const o=s[n],a=Te(o,oe((null!=(r=o.t)?r:0)/t,0,1),i,e);0===n&&(a.offset||0)>0&&c.push(u(l({},a),{offset:0})),c.push(a)}c.length>0&&(c[c.length-1].offset||0)<1&&c.push(u(l({},c[c.length-1]),{offset:1})),c.length>0&&o.set(i,c)}return o}function Ue(t,e,n,r){var o;const i=Tt(t)||{},a=Me(t);if(!n)if(t.id){const e=Pe(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 s=[],l=i.iterations;let u;"number"==typeof l&&(u=l),"infinite"===l&&(u=1/0);const c=new Set;(null==a?void 0:a.length)||console.warn("createWebApiAnimator: No animation bindings defined");for(const t of a||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("createWebApiAnimator: Empty or unresolved binding",t);continue}const a=Pe(t.id),l=(null==n?void 0:n.querySelectorAll(a))||document.querySelectorAll(a);0===l.length&&console.warn('createWebApiAnimator: No elements found for selector "'+a+'"');const f=Re(r,c,i),d=i.delay&&i.delay>0?i.delay:void 0,h=i.delay&&i.delay<0&&i.duration?-i.delay%i.duration:void 0,p={duration:i.duration,delay:d,fill:null!=(o=i.fill)?o:"forwards",direction:i.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,p),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)}),h&&(o.currentTime=h),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 i.trigger&&ye(f,i.trigger),f}var Le=0;function Fe(){return"_px_"+Date.now().toString(36)+(++Le).toString(36)+Math.random().toString(36).substring(2,6)}function De(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>De(t));const e=t,n={};for(const t of Object.keys(e))n[t]=De(e[t]);return n}function We(t){var e,n;const r=De(t),o=new Map,i=new Set(["href","xlink:href"]),a=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=Fe();o.set(t,n),e.id=n}else e.animate&&(e.id=Fe());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(i.has(n)&&r.startsWith("#")){const t=r.slice(1),i=o.get(t);i&&(e[n]="#"+i)}else if(a.has(n))e[n]=Be(r,o);else if(s.has(n)){const t=o.get(r);t&&(e[n]=t)}else r.includes("url(#")&&(e[n]=Be(r,o));else if("style"===n&&"object"==typeof r&&null!==r)for(const[t,e]of Object.entries(r))"string"==typeof e&&(r[t]=Be(e,o));else"object"==typeof r&&null!==r&&t(r);else if(Array.isArray(r))for(const e of r)t(e)}(r);const c=null==(e=r.animator)?void 0:e.animate;if(c&&"object"==typeof c){const t={};for(const[e,r]of Object.entries(c)){t[null!=(n=o.get(e))?n:e]=r}r.animator=u(l({},r.animator),{animate:t})}return r}function Be(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}function qe(t,e,n,r){const o=St(t);for(const t of o)console.warn("[PxAnimator] effects shape warning:",t);(Tt(t=I(t).root)||{}).debug=!0;let i=null;if(r&&t.children){t=We(t);const e="string"==typeof r?document.querySelector(r):r;e&&(i=me(t),i&&e.replaceChildren(i))}return function(t,e,n,r){const o=Tt(t)||{};let i;return i="frames"===o.mode?Ne(t,e,n,r):Ue(t,n,r,"webapi"===o.mode)||Ne(t,e,n,r),o.debugInstName&&(window[o.debugInstName]=i),i}(t,e,n,i)}var Je="data";function Xe(t){const{src:e,data:n,adapter:r,callbacks:o,container:i}=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 qe(n,r,o,i);let a=null;return fetch(e).then(t=>t.json()).then(t=>{Et(t)?a=qe(t,r,o,i):console.error("Invalid animation document format")}),{isReady:()=>!!a,getRootElement:()=>a?a.getRootElement():null,isPlaying:()=>(null==a?void 0:a.isPlaying())||!1,play:()=>{null==a||a.play()},pause:()=>{null==a||a.pause()},cancel:()=>{null==a||a.cancel()},finish:()=>{null==a||a.finish()},setPlaybackRate:t=>{null==a||a.setPlaybackRate(t)},getCurrentTime:()=>(null==a?void 0:a.getCurrentTime())||0,setCurrentTime:t=>{null==a||a.setCurrentTime(t)},destroy:()=>{null==a||a.destroy()}}}function Ye(){const t=document.querySelectorAll("["+Q+"]");for(let e=0;e<t.length;e++){const n=t[e];if(!n[tt]){const t=n.getAttribute(Q);t&&(n[tt]=Xe({src:t,container:n}))}}}"undefined"!=typeof window&&(window.loadTagAnimators=Ye,window.createAnimator=Xe,window.setupAnimationTriggers=ye);var Ze=[1,0,0,1,0,0];function Ke(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 $e=(t,e)=>[1,0,0,1,t,e],Ge=(t,e)=>[t,0,0,e,0,0];function He(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var Qe=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],tn=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function en(t){let e=Ze;t.translate&&(e=Ke(e,$e(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=Ke(e,$e(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=Ke(e,He(t.rotate))),t.scale&&(e=Ke(e,Ge(t.scale[0],t.scale[1]))),n&&(e=Ke(e,$e(-t.origin[0],-t.origin[1]))),e}function nn(t,e,n){return t+(e-t)*n}function rn(t,e){return null==t?Ze:"string"==typeof t?function(t){let e=Ze;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=Ke(e,$e(n[0]||0,n[1]||0)):"scale"===t?e=Ke(e,Ge(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=Ke(e,He(n[0])):"skewX"===t?e=Ke(e,Qe(n[0])):"skewY"===t?e=Ke(e,tn(n[0])):"matrix"===t&&(e=Ke(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?en(function(t,e){var n,r,o,i,a,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!=(i=c.time)?i:0))/((null!=(a=f.time)?a:0)-(null!=(s=c.time)?s:0)||1),h=c.value||{},p=f.value||{},m={};return h.translate&&p.translate?m.translate=[nn(h.translate[0],p.translate[0],d),nn(h.translate[1],p.translate[1],d)]:m.translate=h.translate||p.translate,void 0!==h.rotate&&void 0!==p.rotate?m.rotate=nn(h.rotate,p.rotate,d):m.rotate=null!=(l=h.rotate)?l:p.rotate,h.scale&&p.scale?m.scale=[nn(h.scale[0],p.scale[0],d),nn(h.scale[1],p.scale[1],d)]:m.scale=h.scale||p.scale,m.origin=h.origin||p.origin,m}(t.keyframes,e)):t.value?en(t.value):Ze}var on=new Set(["svg","g","symbol"]),an=new Set(["defs","mask","clipPath","title"]);function sn(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>sn(t,e))}function ln(t){return null==t?0:Number(t)}function un(t){return Math.round(100*t)/100+0}function cn(t,e,n){var r,o,i,a,s;const l=null!=(r=t.fill)?r:"",u=null!=(o=t.stroke)?o:"",c=null!=(a=null!=(i=t["stroke-width"])?i:t.strokeWidth)?a:"",f=un(function(t,e,n,r){var o,i,a,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!=(i=e[e.length-1].time)?i:0))return e[e.length-1].value;let n=0;for(;n<e.length-1&&(null!=(a=e[n+1].time)?a: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 nn(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,h=e.map(un).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return ln(t.width)+","+ln(t.height)+","+ln(t.x)+","+ln(t.y);case"ellipse":return ln(t.rx)+","+ln(t.ry)+","+ln(t.cx)+","+ln(t.cy);case"circle":return ln(t.r)+","+ln(t.cx)+","+ln(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+h+"]|f:"+l+"|s:"+u+"|sw:"+(ln(c)||"")+"|o:"+f+"|m:"+d}function fn(t,e,n,r,o){var i;const a=t.type||"";if(an.has(a))return;const s=Ke(e,function(t,e){return t.animate&&t.animate.transform?rn(t.animate.transform,e):void 0!==t.transform?rn(t.transform,e):Ze}(t,n));if("use"===a){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",i=r.get(e),a=Ke(s,$e(ln(t.x),ln(t.y)));return void(i?fn(i,a,n,r,o):o.push("UNRESOLVED_USE:#"+e))}on.has(a)?null==(i=t.children)||i.forEach(t=>fn(t,s,n,r,o)):o.push(cn(t,s,n))}function dn(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=>dn(t,e))}function hn(t,e){const n=new Map;sn(t,n);const r=[];return fn(t,Ze,e,n,r),r.sort()}function pn(t,e){const n=new Set;dn(t,n),dn(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=hn(t,o),i=hn(e,o),a=mn(n,i),s=mn(i,n);(a.length||s.length)&&r.push({time:o,onlyInA:a,onlyInB:s})}return r}function mn(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}export{Gt as COLOUR_ATTR_NAMES,Je as PX_ANIMATOR_DATA_KEY,tt as PX_ANIM_ATTR_NAME,Q as PX_ANIM_SRC_ATTR_NAME,lt as PX_TRANSFORM_PART_KEYS,Ct as PxAnimatedSvgDocumentSchema,ft as PxAnimationDefinitionSchema,mt as PxAnimatorConfigSchema,vt as PxAttrValueSchema,Pt as PxBezierPathSchema,yt as PxBindingSchema,pt as PxDefsSchema,ot as PxEasingOrRefSchema,xt as PxEffectsSchema,dt as PxElementAnimationSchema,it as PxKeyframeSchema,at as PxLoopSchema,wt as PxMaskedByEffectSchema,zt as PxNodeBase,Mt as PxNodeSchema,st as PxPropertyAnimationSchema,_t as PxRefEffectSchema,At as PxRepeaterEffectSchema,Ot as PxRetimeEffectSchema,It as PxSvgNodeExtra,ut as PxTransformPartsSchema,ct as PxTransformValueSchema,kt as PxTransformationEffectSchema,ht as PxTriggerSchema,jt as PxTrimPathEffectSchema,ee as STYLE_ATTR_NAMES,Ht as TRANSFORM_FN_NAMES,I as applyPlayerEffects,Ce as calcAnimationValues,re as camelCaseToKebabWordIfNeeded,dn as collectSampleTimes,Xe as createAnimator,qe as createAnimatorImpl,Ee as createBasicFrameLoopAnimator,Ne as createFrameLoopAnimator,Ue as createWebApiAnimator,G as describeSchema,pn as diffInEffect,We as generateNewIds,Tt as getAnimatorConfig,Rt as getBindings,Ut as getChildren,Vt as getDefs,pe as getNormalizedProps,Et as isPxElementFileFormat,Nt as isPxElementFileFormatDeep,Ye as loadTagAnimators,Me as normalizeDocument,H as px,me as renderNode,$ as schemaKeys,ye as setupAnimationTriggers,Kt as toRGBA,St as validateNodeEffects,hn as visualModelAt};