@pixodesk/svg-animator-web 1.0.30 → 1.0.34
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.
- package/README.md +11 -9
- package/dist/index.cjs +247 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +247 -87
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.prerendered-waapi.umd.js +135 -17
- package/dist/index.prerendered-waapi.umd.js.map +1 -1
- package/dist/index.prerendered-waapi.umd.min.js +1 -1
- package/dist/index.prerendered.umd.js +136 -18
- package/dist/index.prerendered.umd.js.map +1 -1
- package/dist/index.prerendered.umd.min.js +1 -1
- package/dist/{index.umd.js → pixodesk-svg-animator.umd.js} +240 -86
- package/dist/pixodesk-svg-animator.umd.js.map +1 -0
- package/dist/pixodesk-svg-animator.umd.min.js +1 -0
- package/package.json +5 -5
- package/dist/index.umd.js.map +0 -1
- package/dist/index.umd.min.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var PixodeskAnimator=(()=>{var n=Object.defineProperty,t=Object.defineProperties,o=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyDescriptors,e=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,c=(t,o,r)=>o in t?n(t,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[o]=r,s=(n,t)=>{for(var o in t||(t={}))i.call(t,o)&&c(n,o,t[o]);if(l)for(var o of l(t))u.call(t,o)&&c(n,o,t[o]);return n},f=(n,o)=>t(n,r(o)),a={};function v(n,t,o){return n+(t-n)*o}function d(n,t,o){const r=[],e=Math.max(n.length,t.length);for(let l=0;l<e;l++)r[l]=v(n[l]||0,t[l]||0,o);return r}function p(n,t,o){const r=Math.max(n.length,t.length),e=[];for(let l=0;l<r;l++)e.push(h(n[l],t[l],o));return e}function h(n,t,o){var r,e,l,i,u,c,s,f,a;if(!n||!t)return n||t||{v:[]};const v=Math.min(Math.max(o,0),1),p=Math.min(n.v.length,t.v.length),h=[],m=[],b=[];for(let o=0;o<p;o++){const a=n.v[o],p=t.v[o];h.push(d(a,p,v));const y=null!=(e=null==(r=n.i)?void 0:r[o])?e:a,g=null!=(i=null==(l=t.i)?void 0:l[o])?i:p;m.push(d(y,g,v));const A=null!=(c=null==(u=n.o)?void 0:u[o])?c:a,M=null!=(f=null==(s=t.o)?void 0:s[o])?f:p;b.push(d(A,M,v))}return{v:h,i:m.length?m:void 0,o:b.length?b:void 0,c:null!=(a=n.c)?a:t.c}}function m(n,t,o){if(o<=0)return 0;if(o>=1)return 1;const r=3*n,e=3*(t-n)-r,l=1-r-e;function i(n){return((l*n+e)*n+r)*n}function u(n){return(3*l*n+2*e)*n+r}let c=o,s=0,f=1;for(let n=0;n<8;n++){const n=i(c)-o;if(Math.abs(n)<1e-6)return c;const t=u(c);if(Math.abs(t)<1e-6)break;c-=n/t}for(c=o;s<f;){const n=i(c);if(Math.abs(n-o)<1e-6)return c;o>n?s=c:f=c,c=(f+s)/2}return c}function b(n){const[t,o,r,e]=n,l=3*o,i=3*(e-o)-l,u=1-l-i;return function(n){return o=m(t,r,n),((u*o+i)*o+l)*o;var o}}function y(n,t,o){return[n[0]+(t[0]-n[0])*o,n[1]+(t[1]-n[1])*o]}function g(n,t){if(!n)return{left:void 0,right:void 0};if(t<=0)return{left:void 0,right:n};if(t>=1)return{left:n,right:void 0};const[o,r,e,l]=n,i=m(o,e,t),u=[o,r],c=[e,l],{left:s,right:f}=function(n,t,o,r,e){const l=y(n,t,e),i=y(t,o,e),u=y(o,r,e),c=y(l,i,e),s=y(i,u,e),f=y(c,s,e);return{left:[n,l,c,f],right:[f,s,u,r]}}([0,0],u,c,[1,1],i),a=s[3][0],v=s[3][1];let d,p;a>1e-9&&Math.abs(v)>1e-9&&(d=[s[1][0]/a,s[1][1]/v,s[2][0]/a,s[2][1]/v]);const h=1-a,b=1-v;return h>1e-9&&Math.abs(b)>1e-9&&(p=[(f[1][0]-a)/h,(f[1][1]-v)/b,(f[2][0]-a)/h,(f[2][1]-v)/b]),{left:d,right:p}}function A(n){if(n)return[1-n[2],1-n[3],1-n[0],1-n[1]]}function M(n){if(n){if(Array.isArray(n))return n;if("string"==typeof n)return n.startsWith("#")?function(n){const t=n.slice(1),o=t.length<=4,r=o?t[0]+t[0]:t.slice(0,2),e=o?t[1]+t[1]:t.slice(2,4),l=o?t[2]+t[2]:t.slice(4,6),i=4===t.length?t[3]+t[3]:8===t.length?t.slice(6,8):null,u=[parseInt(r,16)/255,parseInt(e,16)/255,parseInt(l,16)/255];return null!==i&&u.push(parseInt(i,16)/255),u}(n):n.startsWith("rgb")?function(n){var t;const o=null==(t=n.match(/rgba?\((.*)\)/))?void 0:t[1];if(!o)throw new Error("Invalid rgb/rgba format");const r=o.split(",").map(n=>+n.trim());return[r[0]/255,r[1]/255,r[2]/255,...void 0!==r[3]?[r[3]]:[]]}(n):void console.warn("Unsupported color format: "+n)}}((t,o)=>{for(var r in o)n(t,r,{get:o[r],enumerable:!0})})(a,{PX_ANIMATOR_DATA_KEY:()=>wn,createAnimator:()=>An,setupAnimationTriggers:()=>hn});var w=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),k=new Set(["translate","rotate","scale","skew"]),j=new Set(["offset-distance","offsetDistance"]);function O(n){return!n.includes("-")&&/[a-z][A-Z]/.test(n)}var U=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","markerUnits","markerWidth","markerHeight","refX","refY","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","tableValues","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function C(n){return U.has(n)?n:n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function T(n,t,o){return Math.max(t,Math.min(n,o))}function I(n,t,o,r,e){if(e<=0)return[n[0],n[1]];if(e>=1)return[r[0],r[1]];const l=1-e,i=l*l,u=e*e,c=i*l,s=3*e*i,f=3*u*l,a=u*e;return[c*n[0]+s*t[0]+f*o[0]+a*r[0],c*n[1]+s*t[1]+f*o[1]+a*r[1]]}var S=1e-4;function P(n,t,o,r,e){const l=z(n,t,o,r,e);return 0===l[0]&&0===l[1]?z(n,t,o,r,e<.5?e+S:e-S):l}function z(n,t,o,r,e){const l=1-e,i=3*l*l,u=6*e*l,c=3*e*e;return[i*(t[0]-n[0])+u*(o[0]-t[0])+c*(r[0]-o[0]),i*(t[1]-n[1])+u*(o[1]-t[1])+c*(r[1]-o[1])]}function L(n,t){const{ts:o,ds:r}=n,e=o.length-1;if(t<=o[0])return r[0];if(t>=o[e])return r[e];let l=1,i=e;for(;l<i;){const n=l+i>>>1;o[n]<t?l=n+1:i=n}const u=o[i-1],c=o[i]-u,s=c>0?(t-u)/c:0;return r[i-1]+s*(r[i]-r[i-1])}var x={waapi:"waapi",frames:"frames"},N={before:"before",after:"after"};function _(n){var t;return(null==n?void 0:n.animator)||(null==(t=null==n?void 0:n.meta)?void 0:t.animator)}function E(n){var t;const o=null!=(t=n.value)?t:n.v;if(!o)return;if(Array.isArray(o)&&o.length>=2&&"number"==typeof o[0]&&"number"==typeof o[1])return[o[0],o[1]];const r=o.translate;return Array.isArray(r)&&r.length>=2?[r[0],r[1]]:void 0}function F(n){var t,o;return null!=(o=null!=(t=n.time)?t:n.t)?o:0}function W(n){var t;return null!=(t=n.easing)?t:n.e}var Z=new WeakMap;function R(n,t,o,r){var e,l;let i=Z.get(n);const u=null==i?void 0:i.get(t);if(u)return u;const c=null!=(e=n.tangentOut)?e:n.to,s=null!=(l=t.tangentIn)?l:t.ti,f=[o[0]+(c?c[0]:0),o[1]+(c?c[1]:0)],a=[r[0]+(s?s[0]:0),r[1]+(s?s[1]:0)],v=function(n,t,o,r,e=100){const l=e+1,i=new Float64Array(l),u=new Float64Array(l);let c=I(n,t,o,r,0);i[0]=0,u[0]=0;let s=0;for(let f=1;f<l;f++){const l=f/e,a=I(n,t,o,r,l),v=a[0]-c[0],d=a[1]-c[1];s+=Math.sqrt(v*v+d*d),i[f]=l,u[f]=s,c=a}return{ts:i,ds:u}}(o,f,a,r),d={P0:o,P1:f,P2:a,P3:r,l:v,h:v.ds[v.ds.length-1]};return i||(i=new WeakMap,Z.set(n,i)),i.set(t,d),d}var D=.5,V=5,X=32;function q(n,t){var o,r,e,l;if(!function(n){var t,o,r;const e=null!=(t=n.keyframes)?t:n.kfs;if(!Array.isArray(e))return!1;if(n.autoOrient)return!0;for(const n of e)if((null!=(o=n.tangentIn)?o:n.ti)||(null!=(r=n.tangentOut)?r:n.to))return!0;return!1}(n))return n;const i=null!=(o=n.keyframes)?o:n.kfs;if(!Array.isArray(i)||i.length<2)return n;const u=!!n.autoOrient,c=null!=(r=null==t?void 0:t.m)?r:D,s=null!=(e=null==t?void 0:t.A)?e:V,f=null!=(l=null==t?void 0:t.M)?l:X,a=[],v=E(i[0]);if(!v)return n;const d=u?function(n,t){const o=E(n),r=E(t);if(!o||!r)return 0;const e=R(n,t,o,r),l=P(e.P0,e.P1,e.P2,e.P3,0);return 180*Math.atan2(l[1],l[0])/Math.PI}(i[0],i[1]):void 0;a.push(Y(F(i[0]),$(H(i[0]),H(i[0]),0,v,d,u)));for(let n=0;n<i.length-1;n++){const t=i[n],o=i[n+1],r=E(t),e=E(o);r&&e?(u&&n>0&&Q(a,t,o,r,e,s),J(a,t,o,r,e,u,c,s,f)):a.push(Y(F(o),$(H(o),H(o),1,null!=e?e:[0,0],void 0,u)))}const p=W(i[i.length-1]);p&&(a[a.length-1].e=p),u&&function(n){var t;let o;for(const r of n){const n=null!=(t=r.v)?t:r.value;if(!n||"number"!=typeof n.rotate)continue;if(void 0===o){o=n.rotate;continue}let e=n.rotate;for(;e-o>180;)e-=360;for(;e-o<-180;)e+=360;n.rotate=e,o=e}}(a);const h={kfs:a};return void 0!==n.loop&&(h.loop=n.loop),h}function Y(n,t){return{t:n,v:t}}function H(n){var t;const o=null!=(t=n.value)?t:n.v;if(o&&"object"==typeof o&&!Array.isArray(o))return o}function K(n,t,o){if(void 0===n)return t;if(void 0===t)return n;if("number"==typeof n&&"number"==typeof t)return n+(t-n)*o;if(Array.isArray(n)&&Array.isArray(t)&&n.length===t.length){const r=new Array(n.length);for(let e=0;e<n.length;e++){const l="number"==typeof n[e]?n[e]:0,i="number"==typeof t[e]?t[e]:0;r[e]=l+(i-l)*o}return r}return o<.5?n:t}function $(n,t,o,r,e,l){const i={translate:r},u=new Set;if(n)for(const t of Object.keys(n))u.add(t);if(t)for(const n of Object.keys(t))u.add(n);for(const r of u){if("translate"===r)continue;if("rotate"===r&&l)continue;const e=null==n?void 0:n[r],u=null==t?void 0:t[r];void 0===e&&void 0===u||(i[r]=K(e,u,o))}return void 0!==e&&(i.rotate=e+B(n,t,o)),i}function B(n,t,o){const r="number"==typeof(null==n?void 0:n.rotate)?n.rotate:void 0,e="number"==typeof(null==t?void 0:t.rotate)?t.rotate:void 0;if(void 0===r&&void 0===e)return 0;const l=K(r,e,o);return"number"==typeof l?l:0}function Q(n,t,o,r,e,l){var i;const u=n[n.length-1],c=null!=(i=u.v)?i:u.value,s=null==c?void 0:c.rotate;if("number"!=typeof s)return;const f=H(t),a=s-B(f,f,0),v=R(t,o,r,e),d=P(v.P0,v.P1,v.P2,v.P3,0),p=180*Math.atan2(d[1],d[0])/Math.PI,h=function(n,t){let o=n-t;for(;o>180;)o-=360;for(;o<-180;)o+=360;return o}(p,a);if(Math.abs(h)<=l)return;const m=F(t),b=Math.min(m+G,(m+F(o))/2),y=$(H(t),H(t),0,r,p,!0);n.push(Y(b,y))}var G=.05;function J(n,t,o,r,e,l,i,u,c){const s=R(t,o,r,e),f=F(t),a=F(o),v=W(t),d=(p=v)?b([p[1],p[0],p[3],p[2]]):n=>n;var p;const h=H(t),m=H(o),y=function(n,t,o,r,e){const l=[];nn(n.P0[0],n.P1[0],n.P2[0],n.P3[0],l),nn(n.P0[1],n.P1[1],n.P2[1],n.P3[1],l),l.sort((n,t)=>n-t);const i=[0];for(const n of l)n>i[i.length-1]+1e-6&&n<.999999&&i.push(n);i.push(1);const u=[],c={k:e-i.length};for(let e=0;e<i.length-1;e++)tn(i[e],i[e+1],u,n,t,o,r,c);return u}(s,l,i,u,c),A=[];for(const n of y){const t=L(s.l,n),o=T(s.h>0?t/s.h:n,0,1),r={u:T(d(o),0,1),p:o,j:I(s.P0,s.P1,s.P2,s.P3,n)};if(l){const t=P(s.P0,s.P1,s.P2,s.P3,n);r.O=180*Math.atan2(t[1],t[0])/Math.PI}A.push(r)}let M=v,w=0;const k=n.length-1;for(let t=0;t<A.length;t++){const o=A[t],r=w<1?T((o.u-w)/(1-w),0,1):1,{left:e,right:i}=g(M,r),u=0===t?k:n.length-1;e?n[u].e=e:delete n[u].e;const c=f+o.u*(a-f),s=$(h,m,o.p,o.j,o.O,l);n.push(Y(c,s)),M=i,w=o.u}}function nn(n,t,o,r,e){const l=t-n,i=o-t,u=l-2*i+(r-o),c=2*(i-l),s=l;if(Math.abs(u)<1e-10){if(Math.abs(c)>1e-10){const n=-s/c;n>1e-6&&n<.999999&&e.push(n)}return}const f=c*c-4*u*s;if(f<0)return;const a=Math.sqrt(f),v=(-c-a)/(2*u),d=(-c+a)/(2*u);v>1e-6&&v<.999999&&e.push(v),d>1e-6&&d<.999999&&e.push(d)}function tn(n,t,o,r,e,l,i,u){const c=(n+t)/2,s=I(r.P0,r.P1,r.P2,r.P3,n),f=I(r.P0,r.P1,r.P2,r.P3,t),a=t-n,v=I(r.P0,r.P1,r.P2,r.P3,n+.25*a),d=I(r.P0,r.P1,r.P2,r.P3,c),p=I(r.P0,r.P1,r.P2,r.P3,n+.75*a),h=Math.max(on(v,s,f),on(d,s,f),on(p,s,f));let m=!0;if(e){const o=P(r.P0,r.P1,r.P2,r.P3,n),e=P(r.P0,r.P1,r.P2,r.P3,t),l=180*Math.atan2(o[1],o[0])/Math.PI,u=180*Math.atan2(e[1],e[0])/Math.PI;let c=Math.abs(l-u);c>180&&(c=360-c),c>i&&(m=!1)}h<=l&&m||u.k<=0||a<1e-6?o.push(t):(u.k-=1,tn(n,c,o,r,e,l,i,u),tn(c,t,o,r,e,l,i,u))}function on(n,t,o){const r=o[0]-t[0],e=o[1]-t[1],l=r*r+e*e;if(l<1e-20){const o=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(o*o+r*r)}const i=(n[0]-t[0])*e-(n[1]-t[1])*r;return Math.abs(i)/Math.sqrt(l)}var rn=1;function en(n,t){if(n===t)return!0;if(typeof n!=typeof t||null===n||null===t||"object"!=typeof n)return!1;if(Array.isArray(n)!==Array.isArray(t))return!1;const o=Object.keys(n),r=Object.keys(t);return o.length===r.length&&o.every(o=>en(n[o],t[o]))}function ln(n){const t=[];let o;const r=function(n){const t=n.split(/([MLCZmlcz]|[\s,]+)/).map(n=>n.trim()).filter(n=>n&&","!==n),o=[];let r=null;for(const n of t)if(/[MLCZmlcz]/.test(n))r={type:n,values:[]},o.push(r);else if(r){const t=+n;r.values.push(Number.isNaN(t)?0:t)}return o}(n);for(const n of r){const r=n.type,e=n.values;if("M"===r||"m"===r){const n=e[0]||0,r=e[1]||0;o={v:[[n,r]],i:[[n,r]],o:[[n,r]],c:!1},t.push(o);continue}if(o||(o={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},t.push(o)),"L"===r){const n=e[0]||0,t=e[1]||0;o.v.push([n,t]),o.i.push([n,t]),o.o.push([n,t])}else if("C"===r){const n=e[0]||0,t=e[1]||0,r=e[2]||0,l=e[3]||0,i=e[4]||0,u=e[5]||0;o.o[o.o.length-1]=[n,t],o.v.push([i,u]),o.i.push([r,l]),o.o.push([i,u])}else"Z"===r||"z"===r?o.c=!0:console.warn('Unsupported path command "'+r+'"')}return t}function un(n){return n.startsWith("path(")&&n.endsWith(")")?n.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(n)?n:void 0}function cn(n){return"string"==typeof n&&void 0!==un(n)}function sn(n){if(n&&"object"==typeof n&&"string"==typeof n.path){const t=un(n.path);return t?{paths:ln(t)}:n}if(n&&"object"==typeof n&&"paths"in n){const t=n.paths;if(Array.isArray(t)&&t.length>0&&cn(t[0])){const n=[];for(const o of t){const t=un(o);t&&n.push(...ln(t))}return{paths:n}}return n}if(Array.isArray(n)){if(n.length>0&&cn(n[0])){const t=[];for(const o of n){const n=un(o);n&&t.push(...ln(n))}return{paths:t}}return{paths:n}}return cn(n)?{paths:ln(un(n))}:n}function fn(n,t){var o;if(n)return Array.isArray(n)?n:(null==(o=null==t?void 0:t.easings)?void 0:o[n])?t.easings[n]:void console.warn("Unknown easing name: "+n)}function an(n,t){var o;if("string"==typeof n){const r=null==(o=null==t?void 0:t.animations)?void 0:o[n];return r||console.warn("Unknown animation name: "+n),r}return n}function vn(n,t,o,r){var e,l;return"d"===n?{paths:p(null!=(e=null==t?void 0:t.paths)?e:Array.isArray(t)?t:[],null!=(l=null==o?void 0:o.paths)?l:Array.isArray(o)?o:[],r)}:w.has(n)?function(n,t,o){return[v(n[0]||0,t[0]||0,o),v(n[1]||0,t[1]||0,o),v(n[2]||0,t[2]||0,o),v(void 0===n[3]?1:n[3],void 0===t[3]?1:t[3],o)]}(t||[0,0,0,1],o||[0,0,0,1],r):"transform"!==n||"object"!=typeof t||null===t||Array.isArray(t)||"object"!=typeof o||null===o||Array.isArray(o)?"rotate"===n&&"number"==typeof t&&"number"==typeof o?v(t,o,r):k.has(n)||"stroke-dasharray"===n||"strokeDasharray"===n?d(t||[],o||[],r):v(+(t||0),+(o||0),r):function(n,t,o){const r=new Set([...Object.keys(null!=n?n:{}),...Object.keys(null!=t?t:{})]),e={};for(const l of r){const r=null==n?void 0:n[l],i=null==t?void 0:t[l];if("rotate"===l||"skew"===l)e[l]=v(+(null!=r?r:0),+(null!=i?i:0),o);else if("translate"===l||"scale"===l||"origin"===l){const n="scale"===l?[1,1]:[0,0];e[l]=d(r||n,i||n,o)}else e[l]=null!=i?i:r}return e}(t,o,r)}function dn(n,t,o,r){var e,l,i,u,c,a,v;const d=t.keyframes||t.kfs||[],p=[];for(const t of d){const o=null!=(l=null!=(e=t.time)?e:t.t)?l:0;let s=null!=(i=t.value)?i:t.v;const f=null!=(u=t.easing)?u:t.e;"d"===n&&(s=sn(s));const d=O(n)?C(n):n;w.has(d)&&(s=null!=(c=M(s))?c:s);const h={t:o,v:s,e:fn(f,r)},m=null!=(a=t.tangentIn)?a:t.ti,b=null!=(v=t.tangentOut)?v:t.to;m&&(h.tangentIn=m),b&&(h.tangentOut=b),p.push(h)}p.sort((n,t)=>{var o,r;return(null!=(o=n.t)?o:0)-(null!=(r=t.t)?r:0)});const h=t.loop,m=!0===h?{}:h||void 0;return m&&p.length>=2?function(n,t,o,r){var e,l,i,u,c;const a=t.length-1,v=T(null!=(e=o.segmentCount)?e:a,1,a);let d;d=o.extend===N.before?t.slice(0,v+1):t.slice(a-v);const p=null!=(l=t[0].t)?l:0,h=null!=(i=t[t.length-1].t)?i:0;let m,y;o.extend===N.before?(m=0,y=p):(m=h,y=r);const M=y-m;if(M<=0)return t;const w=null!=(u=d[0].t)?u:0,k=(null!=(c=d[d.length-1].t)?c:0)-w;if(k<=0)return t;const j=d.map(n=>{var t,o;return{U:(n.t-w)/k,v:n.v,e:n.e,tangentIn:null!=(t=n.tangentIn)?t:n.ti,tangentOut:null!=(o=n.tangentOut)?o:n.to}}),O=Math.floor(M/k),U=M-O*k,C=U/k,I=[],S=o.extend!==N.before,P=t[t.length-1];let z,L=!1;function x(t,o,r){var e;let l;if(o){l=[];for(let n=j.length-1;n>=0;n--)l.push({U:1-j[n].U,v:j[n].v,e:n>0?A(j[n-1].e):void 0,tangentIn:j[n].tangentOut,tangentOut:j[n].tangentIn})}else l=j;const i=void 0!==r?r:1;for(let o=0;o<l.length;o++){const r=l[o];if(r.U>i+1e-9){const e=l[o-1],u=r.U-e.U,c=(i-e.U)/u,s=e.e?b(e.e)(c):c,f=vn(n,e.v,r.v,s),{left:a}=g(e.e,c);return I.length>0&&e.U<=i&&(I[I.length-1].e=a),void I.push({t:t+i*k,v:f,e:void 0})}const u=I.length>0?I[I.length-1]:P,c=S&&0===o&&void 0!==u&&Math.abs((null!=(e=u.t)?e:0)-(t+r.U*k))<1e-9;if(c){if(en(u.v,r.v)){I.length>0?(u.e=r.e,u.tangentOut=r.tangentOut):(z=r.e,L=!0);continue}I.length>0&&(delete u.tangentIn,delete u.tangentOut)}const s={t:t+r.U*k+(c?rn:0),v:r.v,e:o<l.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),I.push(s)}}if(o.extend===N.before){C>1e-9&&function(t,o,r){let e;if(o){e=[];for(let n=j.length-1;n>=0;n--)e.push({U:1-j[n].U,v:j[n].v,e:n>0?A(j[n-1].e):void 0,tangentIn:j[n].tangentOut,tangentOut:j[n].tangentIn})}else e=j;const l=1-r;for(let o=0;o<e.length;o++){const r=e[o];if(r.U<l-1e-9)continue;const i=e[o-1];if(i&&i.U<l-1e-9&&r.U>l+1e-9){const o=r.U-i.U,e=(l-i.U)/o,u=i.e?b(i.e)(e):e,c=vn(n,i.v,r.v,u),{right:s}=g(i.e,e);I.push({t:t,v:c,e:s})}const u={t:t+(r.U-l)*k,v:r.v,e:o<e.length-1?r.e:void 0};r.tangentIn&&(u.tangentIn=r.tangentIn),r.tangentOut&&(u.tangentOut=r.tangentOut),I.push(u)}}(m,!!o.alternate&&O%2==0,C);for(let n=0;n<O;n++){const t=O-1-n,r=!!o.alternate&&t%2==0;x(m+U+n*k,r)}}else{for(let n=0;n<O;n++){const t=!!o.alternate&&n%2==0;x(m+n*k,t)}if(C>1e-9){const n=!!o.alternate&&O%2==0;x(m+O*k,n,C)}}return o.extend===N.before?[...I,...t]:L&&t.length>0?[...t.slice(0,-1),f(s({},t[t.length-1]),{e:z}),...I]:[...t,...I]}(n,p,m,o):p}var pn=0;function hn(n,t){const{startOn:o,outAction:r="continue",scrollIntoViewThreshold:e=0}=t,l=n.getRootElement();if(!l)return console.warn("setupAnimationTriggers: No root element found for animation."),n;let i=!1;const u=()=>{i&&(i=!1,n.setPlaybackRate(1)),n.play()},c=()=>{switch(r){case"pause":n.pause();break;case"reset":n.cancel();break;case"reverse":i=!0,n.setPlaybackRate(-1),n.play()}};switch(o){case"load":{const n=()=>u();"complete"===document.readyState?n():window.addEventListener("load",n,{once:!0});break}case"mouseOver":{let n=!1;const t=()=>{n=!0,u()},o=()=>{n&&c()};l.addEventListener("mouseenter",t),l.addEventListener("mouseleave",o);break}case"click":{const t=()=>{n.isPlaying()?c():u()};l.addEventListener("click",t);break}case"scrollIntoView":{const n=n=>{var t,o;const r=n.boundingClientRect,e=n.intersectionRect;if(!(null==r?void 0:r.height)||!e)return n.intersectionRatio;const l="undefined"!=typeof window&&window.innerHeight?window.innerHeight:1/0,i=null!=(o=null==(t=n.rootBounds)?void 0:t.height)?o:1/0,u=Math.min(l,i),c=Math.min(r.height,Number.isFinite(u)?u:r.height);return c>0?e.height/c:n.intersectionRatio},t=Array.from({length:21},(n,t)=>t/20);let o=!1;new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&n(t)>=e?(o=!0,u()):o&&(o=!1,c())})},{threshold:t}).observe(l);break}}return n}function mn(n){return"#"+n}function bn(n,t,o,r){var e,l;let i=null!=(e=n.v)?e:n.value;const u=null!=(l=n.e)?l:n.easing,c={offset:t,easing:u&&Array.isArray(u)?"cubic-bezier("+u.join(",")+")":void 0};let s,f=o;var a;return w.has(o)&&Array.isArray(i)?s=function(n){const t=Math.round(255*n[0]),o=Math.round(255*n[1]),r=Math.round(255*n[2]);return 4===n.length?"rgba("+t+","+o+","+r+","+n[3]+")":"rgb("+t+","+o+","+r+")"}(i):"transform"!==o||null===i||"object"!=typeof i||Array.isArray(i)?k.has(o)?(Array.isArray(i)&&("translate"===o&&(i=i.map(n=>n+"px")),i=i.join(",")),"rotate"===o&&(i+="deg"),s=o+"("+i+")",f="transform"):s="d"===o?'path("'+(i&&"object"==typeof i&&Array.isArray(i.paths)?i.paths:[]).map(n=>function(n,t=!1){var o,r,e,l;const i=n.v,u=n.i,c=n.o,s=n.c;if(!i.length)return"";const f=[],a=i.length;f.push("M"+i[0][0]+","+i[0][1]);for(let n=1;n<a;n++){const e=i[n-1],l=null!=(o=null==c?void 0:c[n-1])?o:e,s=null!=(r=null==u?void 0:u[n])?r:i[n],a=i[n];t||l[0]!==e[0]||l[1]!==e[1]||s[0]!==a[0]||s[1]!==a[1]?f.push("C"+l[0]+","+l[1]+","+s[0]+","+s[1]+","+a[0]+","+a[1]):f.push("L"+a[0]+","+a[1])}if(s&&a>0){const n=i[a-1],o=null!=(e=null==c?void 0:c[a-1])?e:n,r=null!=(l=null==u?void 0:u[0])?l:i[0],s=i[0];!t&&o[0]===n[0]&&o[1]===n[1]&&r[0]===s[0]&&r[1]===s[1]||f.push("C"+o[0]+","+o[1]+","+r[0]+","+r[1]+","+s[0]+","+s[1]),f.push("z")}return f.join("")}(n,!0)).join("")+'")':j.has(o)&&"number"==typeof i?100*i+"%":""+i:(s=function(n,t){var o;if(!n)return"";const r=null==(o=null==t?void 0:t.C)||o,e=[],l=n.translate,i=n.origin,u=n.rotate,c=n.skew,s=n.scale,f=r?"px":"",a=r?"deg":"";return l&&e.push("translate("+l[0]+f+","+l[1]+f+")"),i&&e.push("translate("+i[0]+f+","+i[1]+f+")"),null!=u&&e.push("rotate("+u+a+")"),null!=c&&e.push("skewX("+c+a+")"),s&&e.push("scale("+s[0]+","+s[1]+")"),i&&e.push("translate("+-i[0]+f+","+-i[1]+f+")"),e.join("")}(i,{C:!0}),f="transform"),CSS.supports(C(f),s)||r.add(f),f=(a=f).includes("-")?a.replace(/-([a-z])/g,(n,t)=>t.toUpperCase()):a,c[f]=s,c}function yn(n,t,o){var r,e,l,i,u;const c=[];for(let a=0;a<t.length;a++){const v=t[a],d=null!=(r=v.t)?r:0;if(d<0){const o=t[a+1];if(o&&(null!=(e=o.t)?e:0)>=0){const t=(0-d)/((null!=(l=o.t)?l:0)-d),r=v.e?b(v.e)(t):t,{right:e}=g(v.e,t);c.push({t:0,v:vn(n,v.v,o.v,r),e:e})}continue}if(d>o){const r=t[a-1];if(r&&(null!=(i=r.t)?i:0)<=o){const t=null!=(u=r.t)?u:0,e=(o-t)/(d-t),l=r.e?b(r.e)(e):e,{left:i}=g(r.e,e);c.length>0&&(c[c.length-1]=f(s({},c[c.length-1]),{e:i})),c.push({t:o,v:vn(n,r.v,v.v,l),e:void 0})}break}c.push(v)}return c}function gn(n,t,o){var r;const e=new Map;for(const[l,i]of Object.entries(n)){const n=o.duration||1,u=yn(l,i.kfs||i.keyframes||[],n),c=[];for(let o=0;o<u.length;o++){const e=u[o],i=bn(e,T((null!=(r=e.t)?r:0)/n,0,1),l,t);0===o&&(i.offset||0)>0&&c.push(f(s({},i),{offset:0})),c.push(i)}c.length>0&&(c[c.length-1].offset||0)<1&&c.push(f(s({},c[c.length-1]),{offset:1})),c.length>0&&e.set(l,c)}return e}function An(n){const t=function(n){if(!(null==n?void 0:n.data))throw new Error("createAnimator: `data` is required");return n.data}(n);return function(n,o){let r,e=o;n.resetOnFinish&&(e=f(s({},o),{T:()=>{var n;null==(n=null==o?void 0:o.T)||n.call(o),null==r||r.cancel()}}));const l=function(n,t,o,r,e){var l;const i=_(n)||{};if(!o)if(n.id){const t=mn(n.id);(o=document.querySelector(t))||console.warn("createFrameLoopAnimator: No root element found for selector: ",t)}else console.warn("createFrameLoopAnimator: No root element provided");const u=function(n,t=x.waapi){const o=_(n)||{},r=function(n){var t;if(n)return null==(t=_(n))?void 0:t.definitions}(n),e=o.duration||1e3,l=[],i=(n,o)=>{if(!o)return null;const l=function(n,t){if(!n)return[];const o=[];if("string"==typeof n){const r=an(n,t);r&&o.push(r)}else if(Array.isArray(n))for(const r of n){const n=an(r,t);n&&o.push(n)}else o.push(n);return o}(o,r);if(0===l.length)return null;const i=function(n,t,o,r=x.waapi){const e={};for(const[l,i]of Object.entries(n)){if("transform"===l&&"offsetPath"===i.I&&void 0!==n.offsetDistance)continue;const u=dn(l,i,t,o);if(u.length>0){const n={kfs:u};void 0!==i.autoOrient&&(n.autoOrient=i.autoOrient),void 0!==i.loop&&(n.loop=i.loop),e[l]=r===x.waapi&&"transform"===l?q(n):n}}return e}(function(n){const t={};for(const o of n)for(const[n,r]of Object.entries(o))t[n]=r;return t}(l),e,r,t);return 0===Object.keys(i).length?null:{id:n,animate:i}},u=function(n){var t;if(!n)return;const o=null==(t=_(n))?void 0:t.animateById;return o?Object.entries(o).map(([n,t])=>({id:n,animate:t})):void 0}(n);if(u)for(const n of u){const t=i(n.id,n.animate);t&&l.push(t)}const c=n=>{const t=n.animate;if(t&&Object.keys(t).length>0){const o=n.id||"_px_el_"+ ++pn;n.id=o;const r=i(o,t);r&&l.push(r)}if(n.children)for(let t=0;t<n.children.length;t++)c(n.children[t])};if(n.children)for(let t=0;t<n.children.length;t++)c(n.children[t]);return l}(n,x.waapi),c=[],s=i.iterations;let f;"number"==typeof s&&(f=s),"infinite"===s&&(f=1/0);const a=new Set;let v=!1,d=!1;(null==u?void 0:u.length)||console.warn("createWebApiAnimator: No animation bindings defined");for(const n of u||[]){const r=n.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("createWebApiAnimator: Empty or unresolved binding",n);continue}const u=mn(n.id),s=(null==o?void 0:o.querySelectorAll(u))||document.querySelectorAll(u);0===s.length&&console.warn('createWebApiAnimator: No elements found for selector "'+u+'"');const p=gn(r,a,i),h=i.delay&&i.delay>0?i.delay:void 0;let m;if(i.delay&&i.delay<0&&i.duration){const n=-i.delay;m=f===1/0?n%i.duration:Math.min(n,i.duration*(null!=f?f:1))}const b={duration:i.duration,delay:h,fill:null!=(l=i.fill)?l:"forwards",direction:i.direction,iterations:f};for(let n=0;n<s.length;n++){const o=s[n];for(const[,n]of p)if(n.length>0)try{const r=new KeyframeEffect(o,n,b),l=new Animation(r,document.timeline);e,(null==t?void 0:t.T)&&(l.onfinish=()=>{var n;v||(v=!0,null==(n=t.T)||n.call(t))}),(null==t?void 0:t.S)&&(l.onremove=()=>{var n;d||(d=!0,null==(n=t.S)||n.call(t))}),void 0!==m&&(l.currentTime=m),c.push(l)}catch(n){console.warn(n)}}}const p={isReady:()=>!0,getRootElement:()=>o||null,isPlaying:()=>{var n;return"running"===(null==(n=c[0])?void 0:n.playState)},play:()=>{var n;v=!1,c.forEach(n=>n.play()),null==(n=null==t?void 0:t.P)||n.call(t)},pause:()=>{var n;c.forEach(n=>n.pause()),null==(n=null==t?void 0:t.L)||n.call(t)},cancel:()=>{var n;v=!1,c.forEach(n=>n.cancel()),null==(n=null==t?void 0:t.N)||n.call(t)},finish:()=>{var n;for(const t of c)try{(null==(n=t.effect)?void 0:n.getTiming().iterations)===1/0?(t.effect.updateTiming({iterations:1}),t.finish(),t.effect.updateTiming({iterations:1/0})):t.finish()}catch(n){t.cancel()}},setPlaybackRate:n=>(c.forEach(t=>t.playbackRate=n),p),getCurrentTime:()=>{var n,t;const o=null!=(t=null==(n=c[0])?void 0:n.currentTime)?t:null;return null!==o?+o:null},setCurrentTime:n=>{v=!1,c.forEach(t=>{t.currentTime=n})},destroy:()=>{var n;p.cancel(),c.splice(0,c.length),d||(d=!0,null==(n=null==t?void 0:t.S)||n.call(t))}};return i.trigger&&("scroll"===i.timelineSource?console.warn("scroll timeline: `animator.trigger` is ignored (triggers do not apply to scroll-driven playback)"):hn(p,i.trigger)),p}(t,e,null);return r=l,n.debugInstName&&(window[n.debugInstName]=l),l}(_(t)||{},n._)}var Mn,wn="data";return Mn=a,((t,r,l,u)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let l of e(r))i.call(t,l)||void 0===l||n(t,l,{get:()=>r[l],enumerable:!(u=o(r,l))||u.enumerable});return t})(n({},"__esModule",{value:!0}),Mn)})();
|
|
1
|
+
"use strict";var PixodeskAnimator=(()=>{var n=Object.defineProperty,t=Object.defineProperties,o=Object.getOwnPropertyDescriptor,e=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertyNames,i=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,c=(t,o,e)=>o in t?n(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,s=(n,t)=>{for(var o in t||(t={}))l.call(t,o)&&c(n,o,t[o]);if(i)for(var o of i(t))u.call(t,o)&&c(n,o,t[o]);return n},f=(n,o)=>t(n,e(o)),a=(n,t)=>{var o={};for(var e in n)l.call(n,e)&&t.indexOf(e)<0&&(o[e]=n[e]);if(null!=n&&i)for(var e of i(n))t.indexOf(e)<0&&u.call(n,e)&&(o[e]=n[e]);return o},v={};function d(n,t,o){return n+(t-n)*o}function p(n,t,o){const e=[],r=Math.max(n.length,t.length);for(let i=0;i<r;i++)e[i]=d(n[i]||0,t[i]||0,o);return e}function m(n,t,o){const e=Math.max(n.length,t.length),r=[];for(let i=0;i<e;i++)r.push(y(n[i],t[i],o));return r}function y(n,t,o){var e,r,i,l,u,c,s,f,a;if(!n||!t)return n||t||{v:[]};const v=Math.min(Math.max(o,0),1),d=Math.min(n.v.length,t.v.length),m=[],y=[],b=[];for(let o=0;o<d;o++){const a=n.v[o],d=t.v[o];m.push(p(a,d,v));const h=null!=(r=null==(e=n.i)?void 0:e[o])?r:a,g=null!=(l=null==(i=t.i)?void 0:i[o])?l:d;y.push(p(h,g,v));const A=null!=(c=null==(u=n.o)?void 0:u[o])?c:a,M=null!=(f=null==(s=t.o)?void 0:s[o])?f:d;b.push(p(A,M,v))}return{v:m,i:y.length?y:void 0,o:b.length?b:void 0,c:null!=(a=n.c)?a:t.c}}function b(n,t,o){if(o<=0)return 0;if(o>=1)return 1;const e=3*n,r=3*(t-n)-e,i=1-e-r;function l(n){return((i*n+r)*n+e)*n}function u(n){return(3*i*n+2*r)*n+e}let c=o,s=0,f=1;for(let n=0;n<8;n++){const n=l(c)-o;if(Math.abs(n)<1e-6)return c;const t=u(c);if(Math.abs(t)<1e-6)break;c-=n/t}for(c=o;s<f;){const n=l(c);if(Math.abs(n-o)<1e-6)return c;o>n?s=c:f=c,c=(f+s)/2}return c}function h(n){const[t,o,e,r]=n,i=3*o,l=3*(r-o)-i,u=1-i-l;return function(n){return o=b(t,e,n),((u*o+l)*o+i)*o;var o}}function g(n,t,o){return[n[0]+(t[0]-n[0])*o,n[1]+(t[1]-n[1])*o]}function A(n,t){if(!n)return{left:void 0,right:void 0};if(t<=0)return{left:void 0,right:n};if(t>=1)return{left:n,right:void 0};const[o,e,r,i]=n,l=b(o,r,t),u=[o,e],c=[r,i],{left:s,right:f}=function(n,t,o,e,r){const i=g(n,t,r),l=g(t,o,r),u=g(o,e,r),c=g(i,l,r),s=g(l,u,r),f=g(c,s,r);return{left:[n,i,c,f],right:[f,s,u,e]}}([0,0],u,c,[1,1],l),a=s[3][0],v=s[3][1];let d,p;a>1e-9&&Math.abs(v)>1e-9&&(d=[s[1][0]/a,s[1][1]/v,s[2][0]/a,s[2][1]/v]);const m=1-a,y=1-v;return m>1e-9&&Math.abs(y)>1e-9&&(p=[(f[1][0]-a)/m,(f[1][1]-v)/y,(f[2][0]-a)/m,(f[2][1]-v)/y]),{left:d,right:p}}function M(n){if(n)return[1-n[2],1-n[3],1-n[0],1-n[1]]}function w(n){if(n){if(Array.isArray(n))return n;if("string"==typeof n)return n.startsWith("#")?function(n){const t=n.slice(1),o=t.length<=4,e=o?t[0]+t[0]:t.slice(0,2),r=o?t[1]+t[1]:t.slice(2,4),i=o?t[2]+t[2]:t.slice(4,6),l=4===t.length?t[3]+t[3]:8===t.length?t.slice(6,8):null,u=[parseInt(e,16)/255,parseInt(r,16)/255,parseInt(i,16)/255];return null!==l&&u.push(parseInt(l,16)/255),u}(n):n.startsWith("rgb")?function(n){var t;const o=null==(t=n.match(/rgba?\((.*)\)/))?void 0:t[1];if(!o)throw new Error("Invalid rgb/rgba format");const e=o.split(",").map(n=>+n.trim());return[e[0]/255,e[1]/255,e[2]/255,...void 0!==e[3]?[e[3]]:[]]}(n):void console.warn("Unsupported color format: "+n)}}((t,o)=>{for(var e in o)n(t,e,{get:o[e],enumerable:!0})})(v,{PX_ANIMATOR_DATA_KEY:()=>kn,createAnimator:()=>wn,setupAnimationTriggers:()=>bn});var j=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),k=new Set(["translate","rotate","scale","skew"]),O=new Set(["offset-distance","offsetDistance"]);function U(n){return!n.includes("-")&&/[a-z][A-Z]/.test(n)}var C=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","markerUnits","markerWidth","markerHeight","refX","refY","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","tableValues","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function T(n){return C.has(n)?n:n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function I(n,t,o){return Math.max(t,Math.min(n,o))}function z(n,t,o,e,r){if(r<=0)return[n[0],n[1]];if(r>=1)return[e[0],e[1]];const i=1-r,l=i*i,u=r*r,c=l*i,s=3*r*l,f=3*u*i,a=u*r;return[c*n[0]+s*t[0]+f*o[0]+a*e[0],c*n[1]+s*t[1]+f*o[1]+a*e[1]]}var S=1e-4;function N(n,t,o,e,r){const i=P(n,t,o,e,r);return 0===i[0]&&0===i[1]?P(n,t,o,e,r<.5?r+S:r-S):i}function P(n,t,o,e,r){const i=1-r,l=3*i*i,u=6*r*i,c=3*r*r;return[l*(t[0]-n[0])+u*(o[0]-t[0])+c*(e[0]-o[0]),l*(t[1]-n[1])+u*(o[1]-t[1])+c*(e[1]-o[1])]}function L(n,t){const{ts:o,ds:e}=n,r=o.length-1;if(t<=o[0])return e[0];if(t>=o[r])return e[r];let i=1,l=r;for(;i<l;){const n=i+l>>>1;o[n]<t?i=n+1:l=n}const u=o[l-1],c=o[l]-u,s=c>0?(t-u)/c:0;return e[l-1]+s*(e[l]-e[l-1])}var x={waapi:"waapi",frames:"frames"},F={before:"before",after:"after"};function Z(n){var t;const o=(null==n?void 0:n.animator)||(null==(t=null==n?void 0:n.meta)?void 0:t.animator);return o?function(n){const t=n.timeline;if(null==t||"object"!=typeof t)return n;const o=_.get(n);if(o)return o;const e=n,{timeline:r}=e,i=a(e,["timeline"]);if("scroll"===t.type||"view"===t.type){i.l="scroll",void 0!==t.duration&&(i.duration=t.duration),void 0!==t.iterations&&(i.iterations=t.iterations);const n=s({},i.scroll||{});n.kind=t.type,void 0!==t.m&&(n.driver=t.m),void 0!==t.axis&&(n.axis=t.axis),void 0!==t.source&&(n.source=t.source),void 0!==t.subject&&(n.subject=t.subject),void 0!==t.smoothing&&(n.smoothing=t.smoothing),void 0!==t.range&&(n.range=t.range);const o=t.pin;"boolean"==typeof o?n.pin=o:o&&"object"==typeof o&&(n.pin=!0,void 0!==o.align&&(n.pinAlign=o.align),void 0!==o.top&&(n.pinTop=o.top),void 0!==o.distance&&(n.pinDistance=o.distance)),i.scroll=n}else{if(void 0!==t.duration&&(i.duration=t.duration),void 0!==t.trigger){const n=t.trigger,{onFinish:o}=n,e=a(n,["onFinish"]);Object.keys(e).length&&(i.trigger=e),void 0!==o&&(i.h="reset"===o)}void 0!==t.delay&&(i.delay=t.delay),void 0!==t.iterations&&(i.iterations=t.iterations),void 0!==t.direction&&(i.direction=t.direction),void 0!==t.fill&&(i.fill=t.fill)}return _.set(n,i),i}(o):void 0}var _=new WeakMap;function E(n){var t;const o=null!=(t=n.value)?t:n.v;if(!o)return;if(Array.isArray(o)&&o.length>=2&&"number"==typeof o[0]&&"number"==typeof o[1])return[o[0],o[1]];const e=o.translate;return Array.isArray(e)&&e.length>=2?[e[0],e[1]]:void 0}function W(n){var t,o;return null!=(o=null!=(t=n.time)?t:n.t)?o:0}function X(n){var t;return null!=(t=n.easing)?t:n.e}var R=new WeakMap;function D(n,t,o,e){var r,i;let l=R.get(n);const u=null==l?void 0:l.get(t);if(u)return u;const c=null!=(r=n.tangentOut)?r:n.to,s=null!=(i=t.tangentIn)?i:t.ti,f=[o[0]+(c?c[0]:0),o[1]+(c?c[1]:0)],a=[e[0]+(s?s[0]:0),e[1]+(s?s[1]:0)],v=function(n,t,o,e,r=100){const i=r+1,l=new Float64Array(i),u=new Float64Array(i);let c=z(n,t,o,e,0);l[0]=0,u[0]=0;let s=0;for(let f=1;f<i;f++){const i=f/r,a=z(n,t,o,e,i),v=a[0]-c[0],d=a[1]-c[1];s+=Math.sqrt(v*v+d*d),l[f]=i,u[f]=s,c=a}return{ts:l,ds:u}}(o,f,a,e),d={P0:o,P1:f,P2:a,P3:e,A:v,M:v.ds[v.ds.length-1]};return l||(l=new WeakMap,R.set(n,l)),l.set(t,d),d}var V=.5,q=5,Y=32;function B(n,t){var o,e,r;if(!function(n){var t,o;const e=n.keyframes;if(!Array.isArray(e))return!1;if(n.autoOrient)return!0;for(const n of e)if((null!=(t=n.tangentIn)?t:n.ti)||(null!=(o=n.tangentOut)?o:n.to))return!0;return!1}(n))return n;const i=n.keyframes;if(!Array.isArray(i)||i.length<2)return n;const l=!!n.autoOrient,u=null!=(o=null==t?void 0:t.j)?o:V,c=null!=(e=null==t?void 0:t.k)?e:q,s=null!=(r=null==t?void 0:t.O)?r:Y,f=[],a=E(i[0]);if(!a)return n;const v=l?function(n,t){const o=E(n),e=E(t);if(!o||!e)return 0;const r=D(n,t,o,e),i=N(r.P0,r.P1,r.P2,r.P3,0);return 180*Math.atan2(i[1],i[0])/Math.PI}(i[0],i[1]):void 0;f.push(H(W(i[0]),Q(K(i[0]),K(i[0]),0,a,v,l)));for(let n=0;n<i.length-1;n++){const t=i[n],o=i[n+1],e=E(t),r=E(o);e&&r?(l&&n>0&&J(f,t,o,e,r,c),tn(f,t,o,e,r,l,u,c,s)):f.push(H(W(o),Q(K(o),K(o),1,null!=r?r:[0,0],void 0,l)))}const d=X(i[i.length-1]);d&&(f[f.length-1].e=d),l&&function(n){var t;let o;for(const e of n){const n=null!=(t=e.v)?t:e.value;if(!n||"number"!=typeof n.rotate)continue;if(void 0===o){o=n.rotate;continue}let r=n.rotate;for(;r-o>180;)r-=360;for(;r-o<-180;)r+=360;n.rotate=r,o=r}}(f);const p={keyframes:f};return void 0!==n.loop&&(p.loop=n.loop),p}function H(n,t){return{t:n,v:t}}function K(n){var t;const o=null!=(t=n.value)?t:n.v;if(o&&"object"==typeof o&&!Array.isArray(o))return o}function $(n,t,o){if(void 0===n)return t;if(void 0===t)return n;if("number"==typeof n&&"number"==typeof t)return n+(t-n)*o;if(Array.isArray(n)&&Array.isArray(t)&&n.length===t.length){const e=new Array(n.length);for(let r=0;r<n.length;r++){const i="number"==typeof n[r]?n[r]:0,l="number"==typeof t[r]?t[r]:0;e[r]=i+(l-i)*o}return e}return o<.5?n:t}function Q(n,t,o,e,r,i){const l={translate:e},u=new Set;if(n)for(const t of Object.keys(n))u.add(t);if(t)for(const n of Object.keys(t))u.add(n);for(const e of u){if("translate"===e)continue;if("rotate"===e&&i)continue;const r=null==n?void 0:n[e],u=null==t?void 0:t[e];void 0===r&&void 0===u||(l[e]=$(r,u,o))}return void 0!==r&&(l.rotate=r+G(n,t,o)),l}function G(n,t,o){const e="number"==typeof(null==n?void 0:n.rotate)?n.rotate:void 0,r="number"==typeof(null==t?void 0:t.rotate)?t.rotate:void 0;if(void 0===e&&void 0===r)return 0;const i=$(e,r,o);return"number"==typeof i?i:0}function J(n,t,o,e,r,i){var l;const u=n[n.length-1],c=null!=(l=u.v)?l:u.value,s=null==c?void 0:c.rotate;if("number"!=typeof s)return;const f=K(t),a=s-G(f,f,0),v=D(t,o,e,r),d=N(v.P0,v.P1,v.P2,v.P3,0),p=180*Math.atan2(d[1],d[0])/Math.PI,m=function(n,t){let o=n-t;for(;o>180;)o-=360;for(;o<-180;)o+=360;return o}(p,a);if(Math.abs(m)<=i)return;const y=W(t),b=Math.min(y+nn,(y+W(o))/2),h=Q(K(t),K(t),0,e,p,!0);n.push(H(b,h))}var nn=.05;function tn(n,t,o,e,r,i,l,u,c){const s=D(t,o,e,r),f=W(t),a=W(o),v=X(t),d=(p=v)?h([p[1],p[0],p[3],p[2]]):n=>n;var p;const m=K(t),y=K(o),b=function(n,t,o,e,r){const i=[];on(n.P0[0],n.P1[0],n.P2[0],n.P3[0],i),on(n.P0[1],n.P1[1],n.P2[1],n.P3[1],i),i.sort((n,t)=>n-t);const l=[0];for(const n of i)n>l[l.length-1]+1e-6&&n<.999999&&l.push(n);l.push(1);const u=[],c={U:r-l.length};for(let r=0;r<l.length-1;r++)en(l[r],l[r+1],u,n,t,o,e,c);return u}(s,i,l,u,c),g=[];for(const n of b){const t=L(s.A,n),o=I(s.M>0?t/s.M:n,0,1),e={u:I(d(o),0,1),p:o,C:z(s.P0,s.P1,s.P2,s.P3,n)};if(i){const t=N(s.P0,s.P1,s.P2,s.P3,n);e.T=180*Math.atan2(t[1],t[0])/Math.PI}g.push(e)}let M=v,w=0;const j=n.length-1;for(let t=0;t<g.length;t++){const o=g[t],e=w<1?I((o.u-w)/(1-w),0,1):1,{left:r,right:l}=A(M,e),u=0===t?j:n.length-1;r?n[u].e=r:delete n[u].e;const c=f+o.u*(a-f),s=Q(m,y,o.p,o.C,o.T,i);n.push(H(c,s)),M=l,w=o.u}}function on(n,t,o,e,r){const i=t-n,l=o-t,u=i-2*l+(e-o),c=2*(l-i),s=i;if(Math.abs(u)<1e-10){if(Math.abs(c)>1e-10){const n=-s/c;n>1e-6&&n<.999999&&r.push(n)}return}const f=c*c-4*u*s;if(f<0)return;const a=Math.sqrt(f),v=(-c-a)/(2*u),d=(-c+a)/(2*u);v>1e-6&&v<.999999&&r.push(v),d>1e-6&&d<.999999&&r.push(d)}function en(n,t,o,e,r,i,l,u){const c=(n+t)/2,s=z(e.P0,e.P1,e.P2,e.P3,n),f=z(e.P0,e.P1,e.P2,e.P3,t),a=t-n,v=z(e.P0,e.P1,e.P2,e.P3,n+.25*a),d=z(e.P0,e.P1,e.P2,e.P3,c),p=z(e.P0,e.P1,e.P2,e.P3,n+.75*a),m=Math.max(rn(v,s,f),rn(d,s,f),rn(p,s,f));let y=!0;if(r){const o=N(e.P0,e.P1,e.P2,e.P3,n),r=N(e.P0,e.P1,e.P2,e.P3,t),i=180*Math.atan2(o[1],o[0])/Math.PI,u=180*Math.atan2(r[1],r[0])/Math.PI;let c=Math.abs(i-u);c>180&&(c=360-c),c>l&&(y=!1)}m<=i&&y||u.U<=0||a<1e-6?o.push(t):(u.U-=1,en(n,c,o,e,r,i,l,u),en(c,t,o,e,r,i,l,u))}function rn(n,t,o){const e=o[0]-t[0],r=o[1]-t[1],i=e*e+r*r;if(i<1e-20){const o=n[0]-t[0],e=n[1]-t[1];return Math.sqrt(o*o+e*e)}const l=(n[0]-t[0])*r-(n[1]-t[1])*e;return Math.abs(l)/Math.sqrt(i)}var ln=1;function un(n,t){if(n===t)return!0;if(typeof n!=typeof t||null===n||null===t||"object"!=typeof n)return!1;if(Array.isArray(n)!==Array.isArray(t))return!1;const o=Object.keys(n),e=Object.keys(t);return o.length===e.length&&o.every(o=>un(n[o],t[o]))}function cn(n){const t=[];let o;const e=function(n){const t=n.split(/([MLCZmlcz]|[\s,]+)/).map(n=>n.trim()).filter(n=>n&&","!==n),o=[];let e=null;for(const n of t)if(/[MLCZmlcz]/.test(n))e={type:n,values:[]},o.push(e);else if(e){const t=+n;e.values.push(Number.isNaN(t)?0:t)}return o}(n);for(const n of e){const e=n.type,r=n.values;if("M"===e||"m"===e){const n=r[0]||0,e=r[1]||0;o={v:[[n,e]],i:[[n,e]],o:[[n,e]],c:!1},t.push(o);continue}if(o||(o={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},t.push(o)),"L"===e){const n=r[0]||0,t=r[1]||0;o.v.push([n,t]),o.i.push([n,t]),o.o.push([n,t])}else if("C"===e){const n=r[0]||0,t=r[1]||0,e=r[2]||0,i=r[3]||0,l=r[4]||0,u=r[5]||0;o.o[o.o.length-1]=[n,t],o.v.push([l,u]),o.i.push([e,i]),o.o.push([l,u])}else"Z"===e||"z"===e?o.c=!0:console.warn('Unsupported path command "'+e+'"')}return t}function sn(n){return n.startsWith("path(")&&n.endsWith(")")?n.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(n)?n:void 0}function fn(n){return"string"==typeof n&&void 0!==sn(n)}function an(n){if(n&&"object"==typeof n&&"string"==typeof n.path){const t=sn(n.path);return t?{paths:cn(t)}:n}if(n&&"object"==typeof n&&"paths"in n){const t=n.paths;if(Array.isArray(t)&&t.length>0&&fn(t[0])){const n=[];for(const o of t){const t=sn(o);t&&n.push(...cn(t))}return{paths:n}}return n}if(Array.isArray(n)){if(n.length>0&&fn(n[0])){const t=[];for(const o of n){const n=sn(o);n&&t.push(...cn(n))}return{paths:t}}return{paths:n}}return fn(n)?{paths:cn(sn(n))}:n}function vn(n,t){var o;if(n)return Array.isArray(n)?n:(null==(o=null==t?void 0:t.easings)?void 0:o[n])?t.easings[n]:void console.warn("Unknown easing name: "+n)}function dn(n,t){var o;if("string"==typeof n){const e=null==(o=null==t?void 0:t.animations)?void 0:o[n];return e||console.warn("Unknown animation name: "+n),e}return n}function pn(n,t,o,e){var r,i;return"d"===n?{paths:m(null!=(r=null==t?void 0:t.paths)?r:Array.isArray(t)?t:[],null!=(i=null==o?void 0:o.paths)?i:Array.isArray(o)?o:[],e)}:j.has(n)?function(n,t,o){return[d(n[0]||0,t[0]||0,o),d(n[1]||0,t[1]||0,o),d(n[2]||0,t[2]||0,o),d(void 0===n[3]?1:n[3],void 0===t[3]?1:t[3],o)]}(t||[0,0,0,1],o||[0,0,0,1],e):"transform"!==n||"object"!=typeof t||null===t||Array.isArray(t)||"object"!=typeof o||null===o||Array.isArray(o)?"rotate"===n&&"number"==typeof t&&"number"==typeof o?d(t,o,e):k.has(n)||"stroke-dasharray"===n||"strokeDasharray"===n?p(t||[],o||[],e):d(+(t||0),+(o||0),e):function(n,t,o){const e=new Set([...Object.keys(null!=n?n:{}),...Object.keys(null!=t?t:{})]),r={};for(const i of e){const e=null==n?void 0:n[i],l=null==t?void 0:t[i];if("rotate"===i||"skew"===i)r[i]=d(+(null!=e?e:0),+(null!=l?l:0),o);else if("translate"===i||"scale"===i||"origin"===i){const n="scale"===i?[1,1]:[0,0];r[i]=p(e||n,l||n,o)}else r[i]=null!=l?l:e}return r}(t,o,e)}function mn(n,t,o,e){var r,i,l,u,c,a,v;const d=t.keyframes||[],p=[];for(const t of d){const o=null!=(i=null!=(r=t.time)?r:t.t)?i:0;let s=null!=(l=t.value)?l:t.v;const f=null!=(u=t.easing)?u:t.e;"d"===n&&(s=an(s));const d=U(n)?T(n):n;j.has(d)&&(s=null!=(c=w(s))?c:s);const m={t:o,v:s,e:vn(f,e)},y=null!=(a=t.tangentIn)?a:t.ti,b=null!=(v=t.tangentOut)?v:t.to;y&&(m.tangentIn=y),b&&(m.tangentOut=b),p.push(m)}p.sort((n,t)=>{var o,e;return(null!=(o=n.t)?o:0)-(null!=(e=t.t)?e:0)});const m=t.loop,y=!0===m?{}:m||void 0;return y&&p.length>=2?function(n,t,o,e){var r,i,l,u,c;const a=t.length-1,v=I(null!=(r=o.segmentCount)?r:a,1,a);let d;d=o.extend===F.before?t.slice(0,v+1):t.slice(a-v);const p=null!=(i=t[0].t)?i:0,m=null!=(l=t[t.length-1].t)?l:0;let y,b;o.extend===F.before?(y=0,b=p):(y=m,b=e);const g=b-y;if(g<=0)return t;const w=null!=(u=d[0].t)?u:0,j=(null!=(c=d[d.length-1].t)?c:0)-w;if(j<=0)return t;const k=d.map(n=>{var t,o;return{I:(n.t-w)/j,v:n.v,e:n.e,tangentIn:null!=(t=n.tangentIn)?t:n.ti,tangentOut:null!=(o=n.tangentOut)?o:n.to}}),O=Math.floor(g/j),U=g-O*j,C=U/j,T=[],z=o.extend!==F.before,S=t[t.length-1];let N,P=!1;function L(t,o,e){var r;let i;if(o){i=[];for(let n=k.length-1;n>=0;n--)i.push({I:1-k[n].I,v:k[n].v,e:n>0?M(k[n-1].e):void 0,tangentIn:k[n].tangentOut,tangentOut:k[n].tangentIn})}else i=k;const l=void 0!==e?e:1;for(let o=0;o<i.length;o++){const e=i[o];if(e.I>l+1e-9){const r=i[o-1],u=e.I-r.I,c=(l-r.I)/u,s=r.e?h(r.e)(c):c,f=pn(n,r.v,e.v,s),{left:a}=A(r.e,c);return T.length>0&&r.I<=l&&(T[T.length-1].e=a),void T.push({t:t+l*j,v:f,e:void 0})}const u=T.length>0?T[T.length-1]:S,c=z&&0===o&&void 0!==u&&Math.abs((null!=(r=u.t)?r:0)-(t+e.I*j))<1e-9;if(c){if(un(u.v,e.v)){T.length>0?(u.e=e.e,u.tangentOut=e.tangentOut):(N=e.e,P=!0);continue}T.length>0&&(delete u.tangentIn,delete u.tangentOut)}const s={t:t+e.I*j+(c?ln:0),v:e.v,e:o<i.length-1?e.e:void 0};e.tangentIn&&(s.tangentIn=e.tangentIn),e.tangentOut&&(s.tangentOut=e.tangentOut),T.push(s)}}if(o.extend===F.before){C>1e-9&&function(t,o,e){let r;if(o){r=[];for(let n=k.length-1;n>=0;n--)r.push({I:1-k[n].I,v:k[n].v,e:n>0?M(k[n-1].e):void 0,tangentIn:k[n].tangentOut,tangentOut:k[n].tangentIn})}else r=k;const i=1-e;for(let o=0;o<r.length;o++){const e=r[o];if(e.I<i-1e-9)continue;const l=r[o-1];if(l&&l.I<i-1e-9&&e.I>i+1e-9){const o=e.I-l.I,r=(i-l.I)/o,u=l.e?h(l.e)(r):r,c=pn(n,l.v,e.v,u),{right:s}=A(l.e,r);T.push({t:t,v:c,e:s})}const u={t:t+(e.I-i)*j,v:e.v,e:o<r.length-1?e.e:void 0};e.tangentIn&&(u.tangentIn=e.tangentIn),e.tangentOut&&(u.tangentOut=e.tangentOut),T.push(u)}}(y,!!o.alternate&&O%2==0,C);for(let n=0;n<O;n++){const t=O-1-n,e=!!o.alternate&&t%2==0;L(y+U+n*j,e)}}else{for(let n=0;n<O;n++){const t=!!o.alternate&&n%2==0;L(y+n*j,t)}if(C>1e-9){const n=!!o.alternate&&O%2==0;L(y+O*j,n,C)}}return o.extend===F.before?[...T,...t]:P&&t.length>0?[...t.slice(0,-1),f(s({},t[t.length-1]),{e:N}),...T]:[...t,...T]}(n,p,y,o):p}var yn=0;function bn(n,t){const{startOn:o,outAction:e="continue",scrollIntoViewThreshold:r=0}=t,i=n.getRootElement();if(!i)return console.warn("setupAnimationTriggers: No root element found for animation."),n;let l=!1;const u=()=>{l&&(l=!1,n.setPlaybackRate(1)),n.play()},c=()=>{switch(e){case"pause":n.pause();break;case"reset":n.cancel();break;case"reverse":l=!0,n.setPlaybackRate(-1),n.play()}};switch(o){case"load":{const n=()=>u();"complete"===document.readyState?n():window.addEventListener("load",n,{once:!0});break}case"mouseOver":{let n=!1;const t=()=>{n=!0,u()},o=()=>{n&&c()};i.addEventListener("mouseenter",t),i.addEventListener("mouseleave",o);break}case"click":{const t=()=>{n.isPlaying()?c():u()};i.addEventListener("click",t);break}case"scrollIntoView":{const n=n=>{var t,o;const e=n.boundingClientRect,r=n.intersectionRect;if(!(null==e?void 0:e.height)||!r)return n.intersectionRatio;const i="undefined"!=typeof window&&window.innerHeight?window.innerHeight:1/0,l=null!=(o=null==(t=n.rootBounds)?void 0:t.height)?o:1/0,u=Math.min(i,l),c=Math.min(e.height,Number.isFinite(u)?u:e.height);return c>0?r.height/c:n.intersectionRatio},t=Array.from({length:21},(n,t)=>t/20);let o=!1;new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&n(t)>=r?(o=!0,u()):o&&(o=!1,c())})},{threshold:t}).observe(i);break}}return n}function hn(n){return"#"+n}function gn(n,t,o,e){var r,i;let l=null!=(r=n.v)?r:n.value;const u=null!=(i=n.e)?i:n.easing,c={offset:t,easing:u&&Array.isArray(u)?"cubic-bezier("+u.join(",")+")":void 0};let s,f=o;var a;return j.has(o)&&Array.isArray(l)?s=function(n){const t=Math.round(255*n[0]),o=Math.round(255*n[1]),e=Math.round(255*n[2]);return 4===n.length?"rgba("+t+","+o+","+e+","+n[3]+")":"rgb("+t+","+o+","+e+")"}(l):"transform"!==o||null===l||"object"!=typeof l||Array.isArray(l)?k.has(o)?(Array.isArray(l)&&("translate"===o&&(l=l.map(n=>n+"px")),l=l.join(",")),"rotate"===o&&(l+="deg"),s=o+"("+l+")",f="transform"):s="d"===o?'path("'+(l&&"object"==typeof l&&Array.isArray(l.paths)?l.paths:[]).map(n=>function(n,t=!1){var o,e,r,i;const l=n.v,u=n.i,c=n.o,s=n.c;if(!l.length)return"";const f=[],a=l.length;f.push("M"+l[0][0]+","+l[0][1]);for(let n=1;n<a;n++){const r=l[n-1],i=null!=(o=null==c?void 0:c[n-1])?o:r,s=null!=(e=null==u?void 0:u[n])?e:l[n],a=l[n];t||i[0]!==r[0]||i[1]!==r[1]||s[0]!==a[0]||s[1]!==a[1]?f.push("C"+i[0]+","+i[1]+","+s[0]+","+s[1]+","+a[0]+","+a[1]):f.push("L"+a[0]+","+a[1])}if(s&&a>0){const n=l[a-1],o=null!=(r=null==c?void 0:c[a-1])?r:n,e=null!=(i=null==u?void 0:u[0])?i:l[0],s=l[0];!t&&o[0]===n[0]&&o[1]===n[1]&&e[0]===s[0]&&e[1]===s[1]||f.push("C"+o[0]+","+o[1]+","+e[0]+","+e[1]+","+s[0]+","+s[1]),f.push("z")}return f.join("")}(n,!0)).join("")+'")':O.has(o)&&"number"==typeof l?100*l+"%":""+l:(s=function(n,t){var o;if(!n)return"";const e=null==(o=null==t?void 0:t.S)||o,r=[],i=n.translate,l=n.origin,u=n.rotate,c=n.skew,s=n.scale,f=e?"px":"",a=e?"deg":"";return i&&r.push("translate("+i[0]+f+","+i[1]+f+")"),l&&r.push("translate("+l[0]+f+","+l[1]+f+")"),null!=u&&r.push("rotate("+u+a+")"),null!=c&&r.push("skewX("+c+a+")"),s&&r.push("scale("+s[0]+","+s[1]+")"),l&&r.push("translate("+-l[0]+f+","+-l[1]+f+")"),r.join("")}(l,{S:!0}),f="transform"),CSS.supports(T(f),s)||e.add(f),f=(a=f).includes("-")?a.replace(/-([a-z])/g,(n,t)=>t.toUpperCase()):a,c[f]=s,c}function An(n,t,o){var e,r,i,l,u;const c=[];for(let a=0;a<t.length;a++){const v=t[a],d=null!=(e=v.t)?e:0;if(d<0){const o=t[a+1];if(o&&(null!=(r=o.t)?r:0)>=0){const t=(0-d)/((null!=(i=o.t)?i:0)-d),e=v.e?h(v.e)(t):t,{right:r}=A(v.e,t);c.push({t:0,v:pn(n,v.v,o.v,e),e:r})}continue}if(d>o){const e=t[a-1];if(e&&(null!=(l=e.t)?l:0)<=o){const t=null!=(u=e.t)?u:0,r=(o-t)/(d-t),i=e.e?h(e.e)(r):r,{left:l}=A(e.e,r);c.length>0&&(c[c.length-1]=f(s({},c[c.length-1]),{e:l})),c.push({t:o,v:pn(n,e.v,v.v,i),e:void 0})}break}c.push(v)}return c}function Mn(n,t,o){var e;const r=new Map;for(const[i,l]of Object.entries(n)){const n=o.duration||1,u=An(i,l.keyframes||[],n),c=[];for(let o=0;o<u.length;o++){const r=u[o],l=gn(r,I((null!=(e=r.t)?e:0)/n,0,1),i,t);0===o&&(l.offset||0)>0&&c.push(f(s({},l),{offset:0})),c.push(l)}c.length>0&&(c[c.length-1].offset||0)<1&&c.push(f(s({},c[c.length-1]),{offset:1})),c.length>0&&r.set(i,c)}return r}function wn(n){const t=function(n){if(!(null==n?void 0:n.data))throw new Error("createAnimator: `data` is required");return n.data}(n);return function(n,o){let e,r=o;n.h&&(r=f(s({},o),{onFinish:()=>{var n;null==(n=null==o?void 0:o.onFinish)||n.call(o),null==e||e.cancel()}}));const i=function(n,t,o,e,r){var i;const l=Z(n)||{};if(!o)if(n.id){const t=hn(n.id);(o=document.querySelector(t))||console.warn("createFrameLoopAnimator: No root element found for selector: ",t)}else console.warn("createFrameLoopAnimator: No root element provided");const u=function(n,t=x.waapi){const o=Z(n)||{},e=function(n){var t;if(n)return null==(t=Z(n))?void 0:t.definitions}(n),r=o.duration||1e3,i=[],l=(n,o,i)=>{if(!o)return null;const l=function(n,t){if(!n)return[];const o=[];if("string"==typeof n){const e=dn(n,t);e&&o.push(e)}else if(Array.isArray(n))for(const e of n){const n=dn(e,t);n&&o.push(n)}else o.push(n);return o}(o,e);if(0===l.length)return null;const u=function(n,t,o,e=x.waapi){const r={};for(const[i,l]of Object.entries(n)){if("transform"===i&&"offsetPath"===l.N&&void 0!==n.offsetDistance)continue;const u=mn(i,l,t,o);if(u.length>0){const n={keyframes:u};void 0!==l.autoOrient&&(n.autoOrient=l.autoOrient),void 0!==l.loop&&(n.loop=l.loop),r[i]=e===x.waapi&&"transform"===i?B(n):n}}return r}(function(n,t){if(!n)return n;const o=t&&"object"==typeof t&&!Array.isArray(t)?t:function(n){var t,o;if(!n||"string"!=typeof n)return;const e={},r=/([a-zA-Z]+)\s*\(([^)]*)\)/g,i=["translate","rotate","skewX","scale"];let l,u=-1;for(;null!==(l=r.exec(n));){const n=l[1],r=i.indexOf(n);if(r<0||r<=u)return;u=r;const c=l[2].split(/[\s,]+/).filter(Boolean).map(Number);if(c.some(n=>Number.isNaN(n)))return;if("translate"===n){if(c.length<1||c.length>2)return;e.translate=[c[0],null!=(t=c[1])?t:0]}else if("rotate"===n){if(1!==c.length)return;e.rotate=c[0]}else if("skewX"===n){if(1!==c.length)return;e.skew=c[0]}else{if(c.length<1||c.length>2)return;e.scale=[c[0],null!=(o=c[1])?o:c[0]]}}return n.replace(/([a-zA-Z]+)\s*\(([^)]*)\)/g,"").replace(/[\s,]/g,"").length?void 0:Object.keys(e).length?e:void 0}(t);if(!o||!Object.keys(o).length)return n;const e=n=>n&&"object"==typeof n&&!Array.isArray(n)?s(s({},o),n):n,r=n.transform;if(r&&"object"==typeof r){const t=r;if(Array.isArray(t.keyframes)){const o=f(s({},t),{keyframes:t.keyframes.map(n=>f(s({},n),{value:e(n.value)}))});return void 0!==o.value&&(o.value=e(o.value)),f(s({},n),{transform:o})}return n}const i=Object.keys(n).filter(n=>k.has(n));if(1!==i.length)return n;const l=i[0],u=n[l];if(!u||"object"!=typeof u||!Array.isArray(u.keyframes))return n;const c=f(s({},u),{keyframes:u.keyframes.map(n=>f(s({},n),{value:f(s({},o),{[l]:n.value})}))});void 0!==c.value&&(c.value=f(s({},o),{[l]:c.value}));const a=s({},n);return delete a[l],f(s({},a),{transform:c})}(function(n){const t={};for(const o of n)for(const[n,e]of Object.entries(o))t[n]=e;return t}(l),i),r,e,t);return 0===Object.keys(u).length?null:{id:n,animate:u}},u=function(n){var t;if(!n)return;const o=null==(t=Z(n))?void 0:t.animateById;return o?Object.entries(o).map(([n,t])=>({id:n.startsWith("#")?n.slice(1):n,animate:t})):void 0}(n);if(u)for(const n of u){const t=l(n.id,n.animate);t&&i.push(t)}const c=n=>{const t=n.animate;if(t&&Object.keys(t).length>0){const o=n.id||"_px_el_"+ ++yn;n.id=o;const e=l(o,t,n.transform);e&&i.push(e)}if(n.children)for(let t=0;t<n.children.length;t++)c(n.children[t])};if(n.children)for(let t=0;t<n.children.length;t++)c(n.children[t]);return i}(n,x.waapi),c=[],a=l.iterations;let v;"number"==typeof a&&(v=a),"infinite"===a&&(v=1/0);const d=new Set;let p=!1,m=!1;(null==u?void 0:u.length)||console.warn("createWebApiAnimator: No animation bindings defined");for(const n of u||[]){const e=n.animate;if(!e||"object"!=typeof e||Array.isArray(e)){console.warn("createWebApiAnimator: Empty or unresolved binding",n);continue}const u=hn(n.id),s=(null==o?void 0:o.querySelectorAll(u))||document.querySelectorAll(u);0===s.length&&console.warn('createWebApiAnimator: No elements found for selector "'+u+'"');const f=Mn(e,d,l),a=l.delay&&l.delay>0?l.delay:void 0;let y;if(l.delay&&l.delay<0&&l.duration){const n=-l.delay;y=v===1/0?n%l.duration:Math.min(n,l.duration*(null!=v?v:1))}const b={duration:l.duration,delay:a,fill:null!=(i=l.fill)?i:"forwards",direction:l.direction,iterations:v};for(let n=0;n<s.length;n++){const o=s[n];for(const[,n]of f)if(n.length>0)try{const e=new KeyframeEffect(o,n,b),i=new Animation(e,document.timeline);r,(null==t?void 0:t.onFinish)&&(i.onfinish=()=>{var n;p||(p=!0,null==(n=t.onFinish)||n.call(t))}),(null==t?void 0:t.P)&&(i.onremove=()=>{var n;m||(m=!0,null==(n=t.P)||n.call(t))}),void 0!==y&&(i.currentTime=y),c.push(i)}catch(n){console.warn(n)}}}const y={isReady:()=>!0,getRootElement:()=>o||null,isPlaying:()=>{var n;return"running"===(null==(n=c[0])?void 0:n.playState)},play:()=>{var n;p=!1,c.forEach(n=>n.play()),null==(n=null==t?void 0:t.L)||n.call(t)},pause:()=>{var n;c.forEach(n=>n.pause()),null==(n=null==t?void 0:t.F)||n.call(t)},cancel:()=>{var n;p=!1,c.forEach(n=>n.cancel()),null==(n=null==t?void 0:t.Z)||n.call(t)},finish:()=>{var n;for(const t of c)try{(null==(n=t.effect)?void 0:n.getTiming().iterations)===1/0?(t.effect.updateTiming({iterations:1}),t.finish(),t.effect.updateTiming({iterations:1/0})):t.finish()}catch(n){t.cancel()}},setPlaybackRate:n=>(c.forEach(t=>t.playbackRate=n),y),getCurrentTime:()=>{var n,t;const o=null!=(t=null==(n=c[0])?void 0:n.currentTime)?t:null;return null!==o?+o:null},setCurrentTime:n=>{p=!1,c.forEach(t=>{t.currentTime=n})},destroy:()=>{var n;y.cancel(),c.splice(0,c.length),m||(m=!0,null==(n=null==t?void 0:t.P)||n.call(t))}};return l.trigger&&("scroll"===l.l?console.warn("scroll timeline: `animator.trigger` is ignored (triggers do not apply to scroll-driven playback)"):bn(y,l.trigger)),y}(t,r,null);return e=i,n.debugInstName&&(window[n.debugInstName]=i),i}(Z(t)||{},n._)}var jn,kn="data";return jn=v,((t,e,i,u)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of r(e))l.call(t,i)||void 0===i||n(t,i,{get:()=>e[i],enumerable:!(u=o(e,i))||u.enumerable});return t})(n({},"__esModule",{value:!0}),jn)})();
|
|
@@ -21,6 +21,18 @@ var PixodeskAnimator = (() => {
|
|
|
21
21
|
return a;
|
|
22
22
|
};
|
|
23
23
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __objRest = (source, exclude) => {
|
|
25
|
+
var target = {};
|
|
26
|
+
for (var prop in source)
|
|
27
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
if (source != null && __getOwnPropSymbols)
|
|
30
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
+
target[prop] = source[prop];
|
|
33
|
+
}
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
24
36
|
var __export = (target, all) => {
|
|
25
37
|
for (var name in all)
|
|
26
38
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -296,6 +308,38 @@ var PixodeskAnimator = (() => {
|
|
|
296
308
|
if (o) segs.push("translate(" + -o[0] + tu + "," + -o[1] + tu + ")");
|
|
297
309
|
return segs.join("");
|
|
298
310
|
}
|
|
311
|
+
function parseTransformParts(str) {
|
|
312
|
+
var _a, _b;
|
|
313
|
+
if (!str || typeof str !== "string") return void 0;
|
|
314
|
+
const out = {};
|
|
315
|
+
const re = /([a-zA-Z]+)\s*\(([^)]*)\)/g;
|
|
316
|
+
const order = ["translate", "rotate", "skewX", "scale"];
|
|
317
|
+
let lastIdx = -1;
|
|
318
|
+
let m;
|
|
319
|
+
while ((m = re.exec(str)) !== null) {
|
|
320
|
+
const fn = m[1];
|
|
321
|
+
const idx = order.indexOf(fn);
|
|
322
|
+
if (idx < 0 || idx <= lastIdx) return void 0;
|
|
323
|
+
lastIdx = idx;
|
|
324
|
+
const nums = m[2].split(/[\s,]+/).filter(Boolean).map(Number);
|
|
325
|
+
if (nums.some((n) => Number.isNaN(n))) return void 0;
|
|
326
|
+
if (fn === "translate") {
|
|
327
|
+
if (nums.length < 1 || nums.length > 2) return void 0;
|
|
328
|
+
out.translate = [nums[0], (_a = nums[1]) != null ? _a : 0];
|
|
329
|
+
} else if (fn === "rotate") {
|
|
330
|
+
if (nums.length !== 1) return void 0;
|
|
331
|
+
out.rotate = nums[0];
|
|
332
|
+
} else if (fn === "skewX") {
|
|
333
|
+
if (nums.length !== 1) return void 0;
|
|
334
|
+
out.skew = nums[0];
|
|
335
|
+
} else {
|
|
336
|
+
if (nums.length < 1 || nums.length > 2) return void 0;
|
|
337
|
+
out.scale = [nums[0], (_b = nums[1]) != null ? _b : nums[0]];
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
if (str.replace(/([a-zA-Z]+)\s*\(([^)]*)\)/g, "").replace(/[\s,]/g, "").length) return void 0;
|
|
341
|
+
return Object.keys(out).length ? out : void 0;
|
|
342
|
+
}
|
|
299
343
|
var STYLE_ATTR_NAMES = /* @__PURE__ */ new Set(["offset-distance", "offsetDistance"]);
|
|
300
344
|
var DEFAULT_DURATION_MS = 1e3;
|
|
301
345
|
function kebabToCamelCaseWord(kebab) {
|
|
@@ -517,7 +561,51 @@ var PixodeskAnimator = (() => {
|
|
|
517
561
|
};
|
|
518
562
|
function getAnimatorConfig(doc) {
|
|
519
563
|
var _a;
|
|
520
|
-
|
|
564
|
+
const cfg = (doc == null ? void 0 : doc.animator) || ((_a = doc == null ? void 0 : doc.meta) == null ? void 0 : _a.animator);
|
|
565
|
+
return cfg ? flattenAnimatorTimeline(cfg) : void 0;
|
|
566
|
+
}
|
|
567
|
+
var flattenMemo = /* @__PURE__ */ new WeakMap();
|
|
568
|
+
function flattenAnimatorTimeline(cfg) {
|
|
569
|
+
const timeline = cfg.timeline;
|
|
570
|
+
if (timeline === void 0 || timeline === null || typeof timeline !== "object") return cfg;
|
|
571
|
+
const memoised = flattenMemo.get(cfg);
|
|
572
|
+
if (memoised) return memoised;
|
|
573
|
+
const _a = cfg, { timeline: _dropped } = _a, flat = __objRest(_a, ["timeline"]);
|
|
574
|
+
if (timeline.type === "scroll" || timeline.type === "view") {
|
|
575
|
+
flat.timelineSource = "scroll";
|
|
576
|
+
if (timeline.duration !== void 0) flat.duration = timeline.duration;
|
|
577
|
+
if (timeline.iterations !== void 0) flat.iterations = timeline.iterations;
|
|
578
|
+
const scroll = __spreadValues({}, flat.scroll || {});
|
|
579
|
+
scroll.kind = timeline.type;
|
|
580
|
+
if (timeline.engine !== void 0) scroll.driver = timeline.engine;
|
|
581
|
+
if (timeline.axis !== void 0) scroll.axis = timeline.axis;
|
|
582
|
+
if (timeline.source !== void 0) scroll.source = timeline.source;
|
|
583
|
+
if (timeline.subject !== void 0) scroll.subject = timeline.subject;
|
|
584
|
+
if (timeline.smoothing !== void 0) scroll.smoothing = timeline.smoothing;
|
|
585
|
+
if (timeline.range !== void 0) scroll.range = timeline.range;
|
|
586
|
+
const pin = timeline.pin;
|
|
587
|
+
if (typeof pin === "boolean") scroll.pin = pin;
|
|
588
|
+
else if (pin && typeof pin === "object") {
|
|
589
|
+
scroll.pin = true;
|
|
590
|
+
if (pin.align !== void 0) scroll.pinAlign = pin.align;
|
|
591
|
+
if (pin.top !== void 0) scroll.pinTop = pin.top;
|
|
592
|
+
if (pin.distance !== void 0) scroll.pinDistance = pin.distance;
|
|
593
|
+
}
|
|
594
|
+
flat.scroll = scroll;
|
|
595
|
+
} else {
|
|
596
|
+
if (timeline.duration !== void 0) flat.duration = timeline.duration;
|
|
597
|
+
if (timeline.trigger !== void 0) {
|
|
598
|
+
const _b = timeline.trigger, { onFinish } = _b, restTrigger = __objRest(_b, ["onFinish"]);
|
|
599
|
+
if (Object.keys(restTrigger).length) flat.trigger = restTrigger;
|
|
600
|
+
if (onFinish !== void 0) flat.resetOnFinish = onFinish === "reset";
|
|
601
|
+
}
|
|
602
|
+
if (timeline.delay !== void 0) flat.delay = timeline.delay;
|
|
603
|
+
if (timeline.iterations !== void 0) flat.iterations = timeline.iterations;
|
|
604
|
+
if (timeline.direction !== void 0) flat.direction = timeline.direction;
|
|
605
|
+
if (timeline.fill !== void 0) flat.fill = timeline.fill;
|
|
606
|
+
}
|
|
607
|
+
flattenMemo.set(cfg, flat);
|
|
608
|
+
return flat;
|
|
521
609
|
}
|
|
522
610
|
function getDefs(doc) {
|
|
523
611
|
var _a;
|
|
@@ -529,7 +617,7 @@ var PixodeskAnimator = (() => {
|
|
|
529
617
|
if (!doc) return void 0;
|
|
530
618
|
const animateById = (_a = getAnimatorConfig(doc)) == null ? void 0 : _a.animateById;
|
|
531
619
|
if (!animateById) return void 0;
|
|
532
|
-
return Object.entries(animateById).map(([id, anim]) => ({ id, animate: anim }));
|
|
620
|
+
return Object.entries(animateById).map(([id, anim]) => ({ id: id.startsWith("#") ? id.slice(1) : id, animate: anim }));
|
|
533
621
|
}
|
|
534
622
|
|
|
535
623
|
// ../svg-animator-core/src/PxMotionPath.ts
|
|
@@ -553,12 +641,12 @@ var PixodeskAnimator = (() => {
|
|
|
553
641
|
return (_a = kf.easing) != null ? _a : kf.e;
|
|
554
642
|
}
|
|
555
643
|
function propAnimIsMotionPath(anim) {
|
|
556
|
-
var _a, _b
|
|
557
|
-
const kfs =
|
|
644
|
+
var _a, _b;
|
|
645
|
+
const kfs = anim.keyframes;
|
|
558
646
|
if (!Array.isArray(kfs)) return false;
|
|
559
647
|
if (anim.autoOrient) return true;
|
|
560
648
|
for (const kf of kfs) {
|
|
561
|
-
if (((
|
|
649
|
+
if (((_a = kf.tangentIn) != null ? _a : kf.ti) || ((_b = kf.tangentOut) != null ? _b : kf.to)) return true;
|
|
562
650
|
}
|
|
563
651
|
return false;
|
|
564
652
|
}
|
|
@@ -619,14 +707,14 @@ var PixodeskAnimator = (() => {
|
|
|
619
707
|
var DEFAULT_ROTATION_TOL = 5;
|
|
620
708
|
var DEFAULT_MAX_SAMPLES = 32;
|
|
621
709
|
function materialiseMotionPathInPropAnim(anim, opts) {
|
|
622
|
-
var _a, _b, _c
|
|
710
|
+
var _a, _b, _c;
|
|
623
711
|
if (!propAnimIsMotionPath(anim)) return anim;
|
|
624
|
-
const kfs =
|
|
712
|
+
const kfs = anim.keyframes;
|
|
625
713
|
if (!Array.isArray(kfs) || kfs.length < 2) return anim;
|
|
626
714
|
const autoOrient = !!anim.autoOrient;
|
|
627
|
-
const flatnessTol = (
|
|
628
|
-
const rotationTol = (
|
|
629
|
-
const maxSamples = (
|
|
715
|
+
const flatnessTol = (_a = opts == null ? void 0 : opts.flatnessTolerance) != null ? _a : DEFAULT_FLATNESS_TOL;
|
|
716
|
+
const rotationTol = (_b = opts == null ? void 0 : opts.rotationTolerance) != null ? _b : DEFAULT_ROTATION_TOL;
|
|
717
|
+
const maxSamples = (_c = opts == null ? void 0 : opts.maxSamplesPerSegment) != null ? _c : DEFAULT_MAX_SAMPLES;
|
|
630
718
|
const out = [];
|
|
631
719
|
const firstPos = getKfTranslate(kfs[0]);
|
|
632
720
|
if (!firstPos) return anim;
|
|
@@ -655,7 +743,7 @@ var PixodeskAnimator = (() => {
|
|
|
655
743
|
const lastInE = getKfEasing(kfs[kfs.length - 1]);
|
|
656
744
|
if (lastInE) out[out.length - 1].e = lastInE;
|
|
657
745
|
if (autoOrient) unwrapAutoOrientRotations(out);
|
|
658
|
-
const result = {
|
|
746
|
+
const result = { keyframes: out };
|
|
659
747
|
if (anim.loop !== void 0) result.loop = anim.loop;
|
|
660
748
|
return result;
|
|
661
749
|
}
|
|
@@ -1283,7 +1371,7 @@ var PixodeskAnimator = (() => {
|
|
|
1283
1371
|
}
|
|
1284
1372
|
function normalizeKeyframes(propName, propAnim, duration, defs) {
|
|
1285
1373
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
1286
|
-
const keyframes = propAnim.keyframes ||
|
|
1374
|
+
const keyframes = propAnim.keyframes || [];
|
|
1287
1375
|
const normalized = [];
|
|
1288
1376
|
for (const kf of keyframes) {
|
|
1289
1377
|
const timePct = (_b = (_a = kf.time) != null ? _a : kf.t) != null ? _b : 0;
|
|
@@ -1331,6 +1419,36 @@ var PixodeskAnimator = (() => {
|
|
|
1331
1419
|
function generateElementId() {
|
|
1332
1420
|
return "_px_el_" + ++_elementIdCounter;
|
|
1333
1421
|
}
|
|
1422
|
+
function mergeStaticTransformIntoAnimDef(animDef, staticTransform) {
|
|
1423
|
+
if (!animDef) return animDef;
|
|
1424
|
+
const staticParts = staticTransform && typeof staticTransform === "object" && !Array.isArray(staticTransform) ? staticTransform : parseTransformParts(staticTransform);
|
|
1425
|
+
if (!staticParts || !Object.keys(staticParts).length) return animDef;
|
|
1426
|
+
const mergeKfValue = (v) => v && typeof v === "object" && !Array.isArray(v) ? __spreadValues(__spreadValues({}, staticParts), v) : v;
|
|
1427
|
+
const transformAnim = animDef["transform"];
|
|
1428
|
+
if (transformAnim && typeof transformAnim === "object") {
|
|
1429
|
+
const anim = transformAnim;
|
|
1430
|
+
if (Array.isArray(anim.keyframes)) {
|
|
1431
|
+
const out = __spreadProps(__spreadValues({}, anim), {
|
|
1432
|
+
keyframes: anim.keyframes.map((kf) => __spreadProps(__spreadValues({}, kf), { value: mergeKfValue(kf.value) }))
|
|
1433
|
+
});
|
|
1434
|
+
if (out.value !== void 0) out.value = mergeKfValue(out.value);
|
|
1435
|
+
return __spreadProps(__spreadValues({}, animDef), { transform: out });
|
|
1436
|
+
}
|
|
1437
|
+
return animDef;
|
|
1438
|
+
}
|
|
1439
|
+
const channels = Object.keys(animDef).filter((k) => TRANSFORM_FN_NAMES.has(k));
|
|
1440
|
+
if (channels.length !== 1) return animDef;
|
|
1441
|
+
const ch = channels[0];
|
|
1442
|
+
const chAnim = animDef[ch];
|
|
1443
|
+
if (!chAnim || typeof chAnim !== "object" || !Array.isArray(chAnim.keyframes)) return animDef;
|
|
1444
|
+
const lifted = __spreadProps(__spreadValues({}, chAnim), {
|
|
1445
|
+
keyframes: chAnim.keyframes.map((kf) => __spreadProps(__spreadValues({}, kf), { value: __spreadProps(__spreadValues({}, staticParts), { [ch]: kf.value }) }))
|
|
1446
|
+
});
|
|
1447
|
+
if (lifted.value !== void 0) lifted.value = __spreadProps(__spreadValues({}, staticParts), { [ch]: lifted.value });
|
|
1448
|
+
const rest = __spreadValues({}, animDef);
|
|
1449
|
+
delete rest[ch];
|
|
1450
|
+
return __spreadProps(__spreadValues({}, rest), { transform: lifted });
|
|
1451
|
+
}
|
|
1334
1452
|
function normalizeAnimationDefinition(animDef, duration, defs, engine = PxAnimatorEngine.waapi) {
|
|
1335
1453
|
const normalized = {};
|
|
1336
1454
|
for (const [propName, propAnim] of Object.entries(animDef)) {
|
|
@@ -1339,7 +1457,7 @@ var PixodeskAnimator = (() => {
|
|
|
1339
1457
|
}
|
|
1340
1458
|
const normalizedKfs = normalizeKeyframes(propName, propAnim, duration, defs);
|
|
1341
1459
|
if (normalizedKfs.length > 0) {
|
|
1342
|
-
const out = {
|
|
1460
|
+
const out = { keyframes: normalizedKfs };
|
|
1343
1461
|
if (propAnim.autoOrient !== void 0) out.autoOrient = propAnim.autoOrient;
|
|
1344
1462
|
if (propAnim.loop !== void 0) out.loop = propAnim.loop;
|
|
1345
1463
|
normalized[propName] = engine === PxAnimatorEngine.waapi && propName === "transform" ? materialiseMotionPathInPropAnim(out) : out;
|
|
@@ -1352,11 +1470,11 @@ var PixodeskAnimator = (() => {
|
|
|
1352
1470
|
const defs = getDefs(doc);
|
|
1353
1471
|
const duration = animatorConfig.duration || 1e3;
|
|
1354
1472
|
const bindings = [];
|
|
1355
|
-
const processAnimation = (id, animate) => {
|
|
1473
|
+
const processAnimation = (id, animate, staticTransform) => {
|
|
1356
1474
|
if (!animate) return null;
|
|
1357
1475
|
const animDefs = resolveElementAnimation(animate, defs);
|
|
1358
1476
|
if (animDefs.length === 0) return null;
|
|
1359
|
-
const merged = mergeAnimationDefinitions(animDefs);
|
|
1477
|
+
const merged = mergeStaticTransformIntoAnimDef(mergeAnimationDefinitions(animDefs), staticTransform);
|
|
1360
1478
|
const normalizedAnim = normalizeAnimationDefinition(merged, duration, defs, engine);
|
|
1361
1479
|
if (Object.keys(normalizedAnim).length === 0) return null;
|
|
1362
1480
|
return {
|
|
@@ -1376,7 +1494,7 @@ var PixodeskAnimator = (() => {
|
|
|
1376
1494
|
if (inlineAnim && Object.keys(inlineAnim).length > 0) {
|
|
1377
1495
|
const nodeId = node.id || generateElementId();
|
|
1378
1496
|
node.id = nodeId;
|
|
1379
|
-
const normalized = processAnimation(nodeId, inlineAnim);
|
|
1497
|
+
const normalized = processAnimation(nodeId, inlineAnim, node.transform);
|
|
1380
1498
|
if (normalized) bindings.push(normalized);
|
|
1381
1499
|
}
|
|
1382
1500
|
if (node.children) {
|
|
@@ -1414,7 +1532,7 @@ var PixodeskAnimator = (() => {
|
|
|
1414
1532
|
}
|
|
1415
1533
|
function calcPropertyValue(propName, propAnim, progress) {
|
|
1416
1534
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
1417
|
-
const keyframes = propAnim.
|
|
1535
|
+
const keyframes = propAnim.keyframes || [];
|
|
1418
1536
|
if (keyframes.length === 0) return null;
|
|
1419
1537
|
const { prevKf, nextKf } = getKeyframesPair(keyframes, progress);
|
|
1420
1538
|
let localProgress = prevKf === nextKf ? 0 : remap(progress, (_a = prevKf.t) != null ? _a : 0, (_b = nextKf.t) != null ? _b : 0, 0, 1);
|
|
@@ -2053,7 +2171,7 @@ var PixodeskAnimator = (() => {
|
|
|
2053
2171
|
const result = /* @__PURE__ */ new Map();
|
|
2054
2172
|
for (const [propName, propAnim] of Object.entries(animDef)) {
|
|
2055
2173
|
const duration = config.duration || 1;
|
|
2056
|
-
const clippedKeyframes = clipKeyframesToDuration(propName, propAnim.
|
|
2174
|
+
const clippedKeyframes = clipKeyframesToDuration(propName, propAnim.keyframes || [], duration);
|
|
2057
2175
|
const cssKeyframes = [];
|
|
2058
2176
|
for (let i = 0; i < clippedKeyframes.length; i++) {
|
|
2059
2177
|
const kf = clippedKeyframes[i];
|