@pixodesk/svg-animator-web 1.0.44 → 1.0.45

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,4 +1,4 @@
1
- export { e as PxInternalAnimatorOptions } from './PxAnimator-yjuSFhQw.cjs';
1
+ export { e as PxInternalAnimatorOptions } from './PxAnimator-BS-SZULN.cjs';
2
2
  import { resolveTrigger } from '@pixodesk/svg-animator-core';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- export { e as PxInternalAnimatorOptions } from './PxAnimator-yjuSFhQw.js';
1
+ export { e as PxInternalAnimatorOptions } from './PxAnimator-BS-SZULN.js';
2
2
  import { resolveTrigger } from '@pixodesk/svg-animator-core';
3
3
 
4
4
  /**
package/dist/internal.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  PLAY_WHEN_VISIBLE_DEFAULTS,
3
3
  PX_ANIMATOR_DOC_KEY,
4
4
  createVisibilityGate
5
- } from "./chunk-ZEMEZT7X.js";
5
+ } from "./chunk-QE7KJWAN.js";
6
6
  export {
7
7
  PLAY_WHEN_VISIBLE_DEFAULTS,
8
8
  PX_ANIMATOR_DOC_KEY,
@@ -1 +1 @@
1
- "use strict";var t,e=Object.defineProperty,i=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s={};((t,i)=>{for(var n in i)e(t,n,{get:i[n],enumerable:!0})})(s,{PLAY_WHEN_VISIBLE_DEFAULTS:()=>Ft,PX_ANIMATOR_DOC_KEY:()=>r,createVisibilityGate:()=>Wt}),module.exports=(t=s,((t,s,r,a)=>{if(s&&"object"==typeof s||"function"==typeof s)for(let r of n(s))o.call(t,r)||void 0===r||e(t,r,{get:()=>s[r],enumerable:!(a=i(s,r))||a.enumerable});return t})(e({},"__esModule",{value:!0}),t));var r="doc",a=Object.defineProperty,l=Object.defineProperties,p=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,d=(t,e,i)=>e in t?a(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,f=(t,e)=>{for(var i in e||(e={}))c.call(e,i)&&d(t,i,e[i]);if(u)for(var i of u(e))h.call(e,i)&&d(t,i,e[i]);return t},y=(t,e)=>l(t,p(e));function m(t){if(!t.length)return".";let e="";for(const i of t)i.startsWith("[")?e+=i:e+=(e?".":"")+i;return e}var g=class{_canSanitize(t){return this.isValid(t)}optional(){return new _(this)}},_=class extends g{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,i){return null==t||this.inner.isValid(t,e,i)}_canSanitize(t){return null==t||this.inner._canSanitize(t)}},v=class extends g{constructor(t=""){super(),this._default=t}sanitize(t){return"string"==typeof t?t:this._default}isValid(t,e,i){return"string"==typeof t||(null==e||e.errors.push(m(null!=i?i:[])+": expected string, got "+typeof t),!1)}},b=class extends g{constructor(t=0){super(),this._default=t}sanitize(t){return"number"==typeof t&&isFinite(t)?t:this._default}isValid(t,e,i){return!("number"!=typeof t||!isFinite(t))||(null==e||e.errors.push(m(null!=i?i:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},A=class extends g{constructor(t=!1){super(),this._default=t}sanitize(t){return"boolean"==typeof t?t:this._default}isValid(t,e,i){return"boolean"==typeof t||(null==e||e.errors.push(m(null!=i?i:[])+": expected boolean, got "+typeof t),!1)}},x=class extends g{constructor(t){super(),this.value=t,this._default=t}sanitize(t){return t===this.value?this.value:this._default}isValid(t,e,i){return t===this.value||(null==e||e.errors.push(m(null!=i?i:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},S=class extends g{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,i){return!!this.values.includes(t)||(null==e||e.errors.push(m(null!=i?i:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},O=class extends g{constructor(t,e){super(),this.schemas=t,this._kind="union",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,i){var n;const o=e&&{errors:[],warnings:[],strict:e.strict};if(this.schemas.some(e=>e.isValid(t,o,i?[...i]:void 0)))return!0;if(!e)return!1;const s=m(null!=i?i:[]);let r;e.errors.push(s+": no union member matched for value "+(null!=(n=JSON.stringify(t))?n:"").slice(0,240));let a=-1;const l=[];for(const n of this.schemas){const o={errors:[],warnings:[],strict:e.strict};if(n.isValid(t,o,i?[...i]:void 0),!o.errors.length)continue;const p=Math.max(...o.errors.map(t=>t.slice(0,t.indexOf(":")).length));if((p>a||p===a&&r&&o.errors.length<r.length)&&(a=p,r=o.errors),p<=s.length)for(const t of o.errors){const e=/: expected (.+?), got /.exec(t);e&&!l.includes(e[1])&&l.push(e[1])}}if(r&&a>s.length)for(const t of r.slice(0,4))e.errors.includes(t)||e.errors.push(t);else l.length&&e.errors.push(s+": expected "+l.join(" | "));return!1}_canSanitize(t){return this.schemas.some(e=>e._canSanitize(t))}},j=class extends g{constructor(t){super(),this._shape=t;const e={};for(const i of Object.keys(t))e[i]=t[i]._default;this._default=e}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},i={};for(const t of Object.keys(this._shape)){const n=this._shape[t].sanitize(e[t]);void 0!==n&&(i[t]=n)}return i}isValid(t,e,i){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(m(null!=i?i:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const n=t,o=null!=i?i:[];let s=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(n[t],e,o)||(s=!1),o.pop();if(null==e?void 0:e.strict)for(const t of Object.keys(n))t in this._shape||void 0!==n[t]&&(o.push(t),e.errors.push(m(o)+": unexpected extra key"),o.pop(),s=!1);return s}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},w=class extends g{constructor(t,e){super(),this._shape=t,this._openSchema=e;const i={};for(const e of Object.keys(t))i[e]=t[e]._default;this._default=i}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},i=f({},e);for(const t of Object.keys(this._shape)){const n=this._shape[t].sanitize(e[t]);void 0!==n&&(i[t]=n)}if(this._openSchema)for(const t of Object.keys(e))t in this._shape||(i[t]=this._openSchema.sanitize(e[t]));return i}isValid(t,e,i){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(m(null!=i?i:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const n=t,o=null!=i?i:[];let s=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(n[t],e,o)||(s=!1),o.pop();if(this._openSchema)for(const t of Object.keys(n))t in this._shape||(o.push(t),this._openSchema.isValid(n[t],e,o)||(s=!1),o.pop());return s}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},z=class extends g{constructor(t){super(),this.item=t,this._default=[]}sanitize(t){if(!Array.isArray(t))return[];const e=[];for(const i of t)this.item._canSanitize(i)&&e.push(this.item.sanitize(i));return e}isValid(t,e,i){if(!Array.isArray(t))return null==e||e.errors.push(m(null!=i?i:[])+": expected array, got "+typeof t),!1;const n=null!=i?i:[];let o=!0;for(let i=0;i<t.length;i++)n.push("["+i+"]"),this.item.isValid(t[i],e,n)||(o=!1),n.pop();return o}_canSanitize(t){return Array.isArray(t)}},k=class extends g{constructor(t){super(),this.value=t,this._kind="record",this._default={}}sanitize(t){if(!t||"object"!=typeof t||Array.isArray(t))return{};const e={};for(const[i,n]of Object.entries(t))this.value._canSanitize(n)&&(e[i]=this.value.sanitize(n));return e}isValid(t,e,i){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(m(null!=i?i:[])+": expected object/record, got "+(Array.isArray(t)?"array":typeof t)),!1;const n=null!=i?i:[];let o=!0;for(const[i,s]of Object.entries(t))n.push(i),this.value.isValid(s,e,n)||(o=!1),n.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},V=class extends g{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,i){return this.schema.isValid(t,e,i)}_canSanitize(t){return this.schema._canSanitize(t)}},P=class extends g{constructor(t){super(),this.schemas=t,this._kind="tuple",this._default=t.map(t=>t._default)}sanitize(t){return Array.isArray(t)&&t.length===this.schemas.length?this.schemas.map((e,i)=>e.sanitize(t[i])):this._default}isValid(t,e,i){if(!Array.isArray(t)||t.length!==this.schemas.length)return null==e||e.errors.push(m(null!=i?i:[])+": expected tuple of length "+this.schemas.length+", got "+(Array.isArray(t)?"array["+t.length+"]":typeof t)),!1;const n=null!=i?i:[];let o=!0;for(let i=0;i<this.schemas.length;i++)n.push("["+i+"]"),this.schemas[i].isValid(t[i],e,n)||(o=!1),n.pop();return o}_canSanitize(t){return Array.isArray(t)&&t.length===this.schemas.length}},N=(t="")=>new v(t),D=(t=0)=>new b(t),M=(t=!1)=>new A(t),T=t=>new x(t),E=(t,e)=>new S(t,e),I=(t,e)=>new O(t,e),B=t=>new j(t),J=(t,e)=>new w(t,e),R=t=>new z(t),C=t=>new k(t),G=t=>new P(t),L=(t,e)=>new V(t,e),U=/^(\d+)\.(\d+)(?:\.(\d+))?$/;!function(){const t=U.exec("1.2".trim());t&&(Number(t[1]),Number(t[2]),void 0===t[3]||Number(t[3]))}();var F,q={pause:"pause",continue:"continue",reset:"reset"},H="block",W="inline",Y="nearest",K="root",X="center",$="bottom",Q=y(f({},{native:"native",js:"js"}),{auto:"auto"}),Z="pause",tt="userSpaceOnUse",et="objectBoundingBox",it=I([N(),G([D(),D(),D(),D()])]),nt=I([N(),D(),R(D()),B({pathData:N()}),L(()=>R(Tt),[]),L(()=>at,{})]),ot=B({time:D().optional(),value:nt.optional(),easing:it.optional(),tangentOut:G([D(),D()]).optional(),tangentIn:G([D(),D()]).optional()}),st=B({segmentCount:D().optional(),repeatAt:E(["start","end"]).optional(),direction:E(["normal","alternate"]).optional()}),rt=B({value:nt.optional(),keyframes:R(ot).optional(),loop:I([st,M()]).optional(),autoOrient:M().optional(),alongPathMode:E(["sampled","offsetPath"]).optional()}),at=B({translate:G([D(),D()]).optional(),rotate:D().optional(),skew:D().optional(),scale:G([D(),D()]).optional(),origin:G([D(),D()]).optional()}),lt=(I([N(),at,B({value:at}),rt]),C(rt)),pt=I([N(),R(I([N(),lt])),lt]),ut=B({start:E(["load","mouseOver","click","none"],"load").optional(),offScreen:E([q.pause,q.continue,q.reset],Z).optional(),mouseOut:E(["continue","pause","reset","reverse"],"continue").optional(),finish:E(["hold","reset"]).optional(),visibilityThreshold:D().optional(),visibilityDebounce:D().optional()}),ct=B({width:D(),pathData:N()}),ht=B({fontFamily:N(),fontStyle:N(),ascent:D(),unitsPerEm:D(),glyphs:C(ct)}),dt=B({easings:C(G([D(),D(),D(),D()])).optional(),animations:C(lt).optional(),fonts:C(ht).optional()}),ft=B({phase:E(["cover","contain","entry","exit","entry-crossing","exit-crossing"]).optional(),fraction:D().optional()}),yt=B({start:ft.optional(),end:ft.optional()}),mt=(B({kind:E(["view","scroll"]).optional(),axis:E([H,W,"x","y"]).optional(),source:E([Y,K]).optional(),subject:N().optional(),smoothing:D().optional(),pin:M().optional(),pinAlign:E(["top",X,$]).optional(),pinOffset:D().optional(),pinDistance:D().optional(),range:yt.optional()}),B({align:E(["top",X,$]).optional(),offset:D().optional(),distance:D().optional()})),gt=E([Q.auto,Q.native,Q.js]).optional(),_t=B({type:T("time").optional(),engine:gt,frameRate:D().optional(),duration:D().optional(),trigger:ut.optional(),delay:D().optional(),iterations:I([D(),T("infinite")]).optional(),fillMode:E(["forwards","backwards","both","none"]).optional(),direction:E(["normal","reverse","alternate","alternate-reverse"]).optional()}),vt={duration:D().optional(),iterations:D().optional(),engine:gt,frameRate:D().optional(),axis:E([H,W,"x","y"]).optional(),source:E([Y,K]).optional(),subject:N().optional(),smoothing:D().optional(),pin:I([M(),mt]).optional(),range:yt.optional()},bt=(F=[_t,B(f({type:T("scroll")},vt)),B(f({type:T("view")},vt))],new class extends g{constructor(t,e,i){var n;super(),this._key=t,this._schemas=e,this._kind="discriminatedUnion",this._default=null!=i?i:e[0]._default,this._map=new Map;for(const i of e){const e=i._shape[t];if(!e)continue;const o=null!=(n=e.inner)?n:e;this._map.set(o._default,i),e.inner&&(this._absentMember=i)}}_findSchema(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const e=t[this._key];return null==e?this._absentMember:this._map.get(e)}sanitize(t){var e;return(null!=(e=this._findSchema(t))?e:this._schemas[0]).sanitize(t)}isValid(t,e,i){const n=this._findSchema(t);if(!n){const n=null===t||"object"!=typeof t||Array.isArray(t)?void 0:t[this._key];return null==e||e.errors.push(m(null!=i?i:[])+": no discriminated union member matched "+this._key+"="+JSON.stringify(n)),!1}return n.isValid(t,e,i)}_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)}}("type",F)),At=B({target:N(),animateWith:R(N())}),xt=B({timeline:bt.optional(),definitions:dt.optional(),bindings:R(At).optional(),debugGlobalName:N().optional(),version:N().optional()}),St=I([N(),D(),R(D()),B({value:new class extends g{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,i){return void 0!==t||(null==e||e.errors.push(m(null!=i?i:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}}}),at]),Ot=I([D(),rt,B({value:D()})]),jt=I([G([D(),D()]),rt,B({value:G([D(),D()])})]),wt=I([N(),rt,B({value:N()})]),zt=B({translate:jt.optional(),rotate:Ot.optional(),scale:jt.optional(),skew:Ot.optional(),origin:jt.optional()}),kt=B({copies:D().optional(),translate:jt.optional(),rotate:Ot.optional(),skew:Ot.optional(),scale:jt.optional(),origin:jt.optional()}),Vt=B({source:N().optional(),maskType:E(["luminance","alpha"]).optional(),maskUnits:E([tt,et]).optional(),maskContentUnits:E([tt,et]).optional(),x:D().optional(),y:D().optional(),width:D().optional(),height:D().optional()}),Pt=B({pathData:wt.optional()}),Nt=B({offset:Ot.optional(),range:jt.optional(),subPaths:E(["separate","combined"]).optional()}),Dt=B({start:D().optional(),stretch:D().optional(),timeCrop:G([D(),D()]).optional()}),Mt=B({without:E(["translate"]).optional(),source:N().optional(),retime:Dt.optional()}),Tt=B({offset:D(),color:N()}),Et=I([R(Tt),B({value:R(Tt)}),rt]),It=B({type:E(["linear","radial"]),start:jt.optional(),end:jt.optional(),center:jt.optional(),radius:Ot.optional(),focal:jt.optional(),stops:Et.optional(),gradientUnits:E([tt,et]).optional(),spreadMethod:E(["pad","reflect","repeat"]).optional(),gradientTransform:N().optional()}),Bt=It,Jt=B({pathData:N(),pathOverflow:E(["clip","extend"]).optional(),lengthAdjust:E(["spacing","spacingAndGlyphs"]).optional(),method:E(["align","stretch"]).optional(),spacing:E(["auto","exact"]).optional(),startOffset:Ot.optional(),textLength:Ot.optional()}),Rt=B({useGlyphs:M().optional()}),Ct=B({transformBy:zt.optional(),repeater:kt.optional(),maskedBy:Vt.optional(),clipPath:Pt.optional(),strokeTrim:Nt.optional(),clone:Mt.optional(),fillGradient:It.optional(),strokeGradient:Bt.optional(),textPath:Jt.optional(),text:Rt.optional()}),Gt=J({type:N(),domType:N().optional(),textContent:N().optional(),id:N().optional(),meta:(new class extends g{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,i){return!0}_canSanitize(t){return!0}}).optional(),effects:Ct.optional(),animate:pt.optional(),style:C(I([N(),D()])).optional()},St),Lt=J(y(f({},Gt._shape),{children:L(()=>R(Lt),[]).optional()}),St),Ut=B({width:I([D(),N()]).optional(),height:I([D(),N()]).optional(),viewBox:N().optional(),animator:xt.optional()}),Ft=(J(y(f(f({},Gt._shape),Ut._shape),{type:T("svg"),children:R(Lt).optional()}),St),B({v:R(R(D())),i:R(R(D())).optional(),o:R(R(D())).optional(),c:M().optional()}),{offScreen:Z,visibilityThreshold:.5,visibilityDebounce:150}),qt=Array.from({length:21},(t,e)=>e/20);function Ht(t){return{requestStart:()=>t.play(),dispose:()=>{}}}function Wt(t,e,i){if(e.offScreen===q.continue)return Ht(i);if("undefined"==typeof IntersectionObserver)return Ht(i);const n=e.visibilityThreshold,o=e.visibilityDebounce;let s,r,a=!1,l=!1,p=0;const u=()=>{void 0!==r&&(clearTimeout(r),r=void 0)},c=()=>{r=void 0,!0!==s&&(s=!0,(a||l)&&(a=!1,l=!1,i.play()))},h=()=>{u(),!1!==s&&(s=!1,i.isPlaying()&&(e.offScreen===q.reset?i.cancel():i.pause(),l=!0))},d=t=>{if(p=t,"undefined"==typeof document||"hidden"!==document.visibilityState)if(t>=n){if(!0===s||void 0!==r)return;o>0?r=setTimeout(c,o):c()}else t<=0?h():!0!==s&&u();else h()},f=new IntersectionObserver(t=>{const e=t[t.length-1];e&&d(e.isIntersecting?function(t){var e,i;const n=t.boundingClientRect,o=t.intersectionRect;if(!(null==n?void 0:n.height)||!o)return t.intersectionRatio;const s="undefined"!=typeof window&&window.innerHeight?window.innerHeight:1/0,r=null!=(i=null==(e=t.rootBounds)?void 0:e.height)?i:1/0,a=Math.min(s,r),l=Math.min(n.height,Number.isFinite(a)?a:n.height);return l>0?o.height/l:t.intersectionRatio}(e):0)},{threshold:qt});f.observe(t);const y=()=>{d(p)},m="undefined"!=typeof document;return m&&document.addEventListener("visibilitychange",y),{requestStart:t=>{if(t||!0===s)return u(),s=!0,a=!1,l=!1,void i.play();a=!0},dispose:()=>{u(),f.disconnect(),m&&document.removeEventListener("visibilitychange",y)}}}
1
+ var t,e=Object.defineProperty,i=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s={};((t,i)=>{for(var n in i)e(t,n,{get:i[n],enumerable:!0})})(s,{PLAY_WHEN_VISIBLE_DEFAULTS:()=>Ft,PX_ANIMATOR_DOC_KEY:()=>r,createVisibilityGate:()=>Wt}),module.exports=(t=s,((t,s,r,a)=>{if(s&&"object"==typeof s||"function"==typeof s)for(let r of n(s))o.call(t,r)||void 0===r||e(t,r,{get:()=>s[r],enumerable:!(a=i(s,r))||a.enumerable});return t})(e({},"__esModule",{value:!0}),t));var r="doc",a=Object.defineProperty,l=Object.defineProperties,p=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,d=(t,e,i)=>e in t?a(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,f=(t,e)=>{for(var i in e||(e={}))c.call(e,i)&&d(t,i,e[i]);if(u)for(var i of u(e))h.call(e,i)&&d(t,i,e[i]);return t},y=(t,e)=>l(t,p(e));function m(t){if(!t.length)return".";let e="";for(const i of t)i.startsWith("[")?e+=i:e+=(e?".":"")+i;return e}var g=class{_canSanitize(t){return this.isValid(t)}optional(){return new _(this)}},_=class extends g{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,i){return null==t||this.inner.isValid(t,e,i)}_canSanitize(t){return null==t||this.inner._canSanitize(t)}},v=class extends g{constructor(t=""){super(),this._default=t}sanitize(t){return"string"==typeof t?t:this._default}isValid(t,e,i){return"string"==typeof t||(null==e||e.errors.push(m(null!=i?i:[])+": expected string, got "+typeof t),!1)}},b=class extends g{constructor(t=0){super(),this._default=t}sanitize(t){return"number"==typeof t&&isFinite(t)?t:this._default}isValid(t,e,i){return!("number"!=typeof t||!isFinite(t))||(null==e||e.errors.push(m(null!=i?i:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},A=class extends g{constructor(t=!1){super(),this._default=t}sanitize(t){return"boolean"==typeof t?t:this._default}isValid(t,e,i){return"boolean"==typeof t||(null==e||e.errors.push(m(null!=i?i:[])+": expected boolean, got "+typeof t),!1)}},x=class extends g{constructor(t){super(),this.value=t,this._default=t}sanitize(t){return t===this.value?this.value:this._default}isValid(t,e,i){return t===this.value||(null==e||e.errors.push(m(null!=i?i:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},S=class extends g{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,i){return!!this.values.includes(t)||(null==e||e.errors.push(m(null!=i?i:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},O=class extends g{constructor(t,e){super(),this.schemas=t,this._kind="union",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,i){var n;const o=e&&{errors:[],warnings:[],strict:e.strict};if(this.schemas.some(e=>e.isValid(t,o,i?[...i]:void 0)))return!0;if(!e)return!1;const s=m(null!=i?i:[]);let r;e.errors.push(s+": no union member matched for value "+(null!=(n=JSON.stringify(t))?n:"").slice(0,240));let a=-1;const l=[];for(const n of this.schemas){const o={errors:[],warnings:[],strict:e.strict};if(n.isValid(t,o,i?[...i]:void 0),!o.errors.length)continue;const p=Math.max(...o.errors.map(t=>t.slice(0,t.indexOf(":")).length));if((p>a||p===a&&r&&o.errors.length<r.length)&&(a=p,r=o.errors),p<=s.length)for(const t of o.errors){const e=/: expected (.+?), got /.exec(t);e&&!l.includes(e[1])&&l.push(e[1])}}if(r&&a>s.length)for(const t of r.slice(0,4))e.errors.includes(t)||e.errors.push(t);else l.length&&e.errors.push(s+": expected "+l.join(" | "));return!1}_canSanitize(t){return this.schemas.some(e=>e._canSanitize(t))}},j=class extends g{constructor(t){super(),this._shape=t;const e={};for(const i of Object.keys(t))e[i]=t[i]._default;this._default=e}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},i={};for(const t of Object.keys(this._shape)){const n=this._shape[t].sanitize(e[t]);void 0!==n&&(i[t]=n)}return i}isValid(t,e,i){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(m(null!=i?i:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const n=t,o=null!=i?i:[];let s=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(n[t],e,o)||(s=!1),o.pop();if(null==e?void 0:e.strict)for(const t of Object.keys(n))t in this._shape||void 0!==n[t]&&(o.push(t),e.errors.push(m(o)+": unexpected extra key"),o.pop(),s=!1);return s}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},w=class extends g{constructor(t,e){super(),this._shape=t,this._openSchema=e;const i={};for(const e of Object.keys(t))i[e]=t[e]._default;this._default=i}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},i=f({},e);for(const t of Object.keys(this._shape)){const n=this._shape[t].sanitize(e[t]);void 0!==n&&(i[t]=n)}if(this._openSchema)for(const t of Object.keys(e))t in this._shape||(i[t]=this._openSchema.sanitize(e[t]));return i}isValid(t,e,i){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(m(null!=i?i:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const n=t,o=null!=i?i:[];let s=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(n[t],e,o)||(s=!1),o.pop();if(this._openSchema)for(const t of Object.keys(n))t in this._shape||(o.push(t),this._openSchema.isValid(n[t],e,o)||(s=!1),o.pop());return s}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},z=class extends g{constructor(t){super(),this.item=t,this._default=[]}sanitize(t){if(!Array.isArray(t))return[];const e=[];for(const i of t)this.item._canSanitize(i)&&e.push(this.item.sanitize(i));return e}isValid(t,e,i){if(!Array.isArray(t))return null==e||e.errors.push(m(null!=i?i:[])+": expected array, got "+typeof t),!1;const n=null!=i?i:[];let o=!0;for(let i=0;i<t.length;i++)n.push("["+i+"]"),this.item.isValid(t[i],e,n)||(o=!1),n.pop();return o}_canSanitize(t){return Array.isArray(t)}},k=class extends g{constructor(t){super(),this.value=t,this._kind="record",this._default={}}sanitize(t){if(!t||"object"!=typeof t||Array.isArray(t))return{};const e={};for(const[i,n]of Object.entries(t))this.value._canSanitize(n)&&(e[i]=this.value.sanitize(n));return e}isValid(t,e,i){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(m(null!=i?i:[])+": expected object/record, got "+(Array.isArray(t)?"array":typeof t)),!1;const n=null!=i?i:[];let o=!0;for(const[i,s]of Object.entries(t))n.push(i),this.value.isValid(s,e,n)||(o=!1),n.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},V=class extends g{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,i){return this.schema.isValid(t,e,i)}_canSanitize(t){return this.schema._canSanitize(t)}},P=class extends g{constructor(t){super(),this.schemas=t,this._kind="tuple",this._default=t.map(t=>t._default)}sanitize(t){return Array.isArray(t)&&t.length===this.schemas.length?this.schemas.map((e,i)=>e.sanitize(t[i])):this._default}isValid(t,e,i){if(!Array.isArray(t)||t.length!==this.schemas.length)return null==e||e.errors.push(m(null!=i?i:[])+": expected tuple of length "+this.schemas.length+", got "+(Array.isArray(t)?"array["+t.length+"]":typeof t)),!1;const n=null!=i?i:[];let o=!0;for(let i=0;i<this.schemas.length;i++)n.push("["+i+"]"),this.schemas[i].isValid(t[i],e,n)||(o=!1),n.pop();return o}_canSanitize(t){return Array.isArray(t)&&t.length===this.schemas.length}},N=(t="")=>new v(t),D=(t=0)=>new b(t),M=(t=!1)=>new A(t),T=t=>new x(t),E=(t,e)=>new S(t,e),I=(t,e)=>new O(t,e),B=t=>new j(t),J=(t,e)=>new w(t,e),R=t=>new z(t),C=t=>new k(t),G=t=>new P(t),L=(t,e)=>new V(t,e),U=/^(\d+)\.(\d+)(?:\.(\d+))?$/;!function(){const t=U.exec("1.2".trim());t&&(Number(t[1]),Number(t[2]),void 0===t[3]||Number(t[3]))}();var F,q={pause:"pause",continue:"continue",reset:"reset"},H="block",W="inline",Y="nearest",K="root",X="center",$="bottom",Q=y(f({},{native:"native",js:"js"}),{auto:"auto"}),Z="pause",tt="userSpaceOnUse",et="objectBoundingBox",it=I([N(),G([D(),D(),D(),D()])]),nt=I([N(),D(),R(D()),B({pathData:N()}),L(()=>R(Tt),[]),L(()=>at,{})]),ot=B({time:D().optional(),value:nt.optional(),easing:it.optional(),tangentOut:G([D(),D()]).optional(),tangentIn:G([D(),D()]).optional()}),st=B({segmentCount:D().optional(),repeatAt:E(["start","end"]).optional(),direction:E(["normal","alternate"]).optional()}),rt=B({value:nt.optional(),keyframes:R(ot).optional(),loop:I([st,M()]).optional(),autoOrient:M().optional(),alongPathMode:E(["sampled","offsetPath"]).optional()}),at=B({translate:G([D(),D()]).optional(),rotate:D().optional(),skew:D().optional(),scale:G([D(),D()]).optional(),origin:G([D(),D()]).optional()}),lt=(I([N(),at,B({value:at}),rt]),C(rt)),pt=I([N(),R(I([N(),lt])),lt]),ut=B({start:E(["load","mouseOver","click","none"],"load").optional(),offScreen:E([q.pause,q.continue,q.reset],Z).optional(),mouseOut:E(["continue","pause","reset","reverse"],"continue").optional(),finish:E(["hold","reset"]).optional(),visibilityThreshold:D().optional(),visibilityDebounce:D().optional()}),ct=B({width:D(),pathData:N()}),ht=B({fontFamily:N(),fontStyle:N(),ascent:D(),unitsPerEm:D(),glyphs:C(ct)}),dt=B({easings:C(G([D(),D(),D(),D()])).optional(),animations:C(lt).optional(),fonts:C(ht).optional()}),ft=B({phase:E(["cover","contain","entry","exit","entry-crossing","exit-crossing"]).optional(),fraction:D().optional()}),yt=B({start:ft.optional(),end:ft.optional()}),mt=(B({kind:E(["view","scroll"]).optional(),axis:E([H,W,"x","y"]).optional(),source:E([Y,K]).optional(),subject:N().optional(),smoothing:D().optional(),pin:M().optional(),pinAlign:E(["top",X,$]).optional(),pinOffset:D().optional(),pinDistance:D().optional(),range:yt.optional()}),B({align:E(["top",X,$]).optional(),offset:D().optional(),distance:D().optional()})),gt=E([Q.auto,Q.native,Q.js]).optional(),_t=B({type:T("time").optional(),engine:gt,frameRate:D().optional(),duration:D().optional(),trigger:ut.optional(),delay:D().optional(),iterations:I([D(),T("infinite")]).optional(),fillMode:E(["forwards","backwards","both","none"]).optional(),direction:E(["normal","reverse","alternate","alternate-reverse"]).optional()}),vt={duration:D().optional(),iterations:D().optional(),engine:gt,frameRate:D().optional(),axis:E([H,W,"x","y"]).optional(),source:E([Y,K]).optional(),subject:N().optional(),smoothing:D().optional(),pin:I([M(),mt]).optional(),range:yt.optional()},bt=(F=[_t,B(f({type:T("scroll")},vt)),B(f({type:T("view")},vt))],new class extends g{constructor(t,e,i){var n;super(),this._key=t,this._schemas=e,this._kind="discriminatedUnion",this._default=null!=i?i:e[0]._default,this._map=new Map;for(const i of e){const e=i._shape[t];if(!e)continue;const o=null!=(n=e.inner)?n:e;this._map.set(o._default,i),e.inner&&(this._absentMember=i)}}_findSchema(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const e=t[this._key];return null==e?this._absentMember:this._map.get(e)}sanitize(t){var e;return(null!=(e=this._findSchema(t))?e:this._schemas[0]).sanitize(t)}isValid(t,e,i){const n=this._findSchema(t);if(!n){const n=null===t||"object"!=typeof t||Array.isArray(t)?void 0:t[this._key];return null==e||e.errors.push(m(null!=i?i:[])+": no discriminated union member matched "+this._key+"="+JSON.stringify(n)),!1}return n.isValid(t,e,i)}_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)}}("type",F)),At=B({target:N(),animateWith:R(N())}),xt=B({timeline:bt.optional(),definitions:dt.optional(),bindings:R(At).optional(),debugGlobalName:N().optional(),version:N().optional()}),St=I([N(),D(),R(D()),B({value:new class extends g{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,i){return void 0!==t||(null==e||e.errors.push(m(null!=i?i:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}}}),at]),Ot=I([D(),rt,B({value:D()})]),jt=I([G([D(),D()]),rt,B({value:G([D(),D()])})]),wt=I([N(),rt,B({value:N()})]),zt=B({translate:jt.optional(),rotate:Ot.optional(),scale:jt.optional(),skew:Ot.optional(),origin:jt.optional()}),kt=B({copies:D().optional(),translate:jt.optional(),rotate:Ot.optional(),skew:Ot.optional(),scale:jt.optional(),origin:jt.optional()}),Vt=B({source:N().optional(),maskType:E(["luminance","alpha"]).optional(),maskUnits:E([tt,et]).optional(),maskContentUnits:E([tt,et]).optional(),x:D().optional(),y:D().optional(),width:D().optional(),height:D().optional()}),Pt=B({pathData:wt.optional()}),Nt=B({offset:Ot.optional(),range:jt.optional(),subPaths:E(["separate","combined"]).optional()}),Dt=B({start:D().optional(),stretch:D().optional(),timeCrop:G([D(),D()]).optional()}),Mt=B({without:E(["translate"]).optional(),source:N().optional(),retime:Dt.optional()}),Tt=B({offset:D(),color:N()}),Et=I([R(Tt),B({value:R(Tt)}),rt]),It=B({type:E(["linear","radial"]),start:jt.optional(),end:jt.optional(),center:jt.optional(),radius:Ot.optional(),focal:jt.optional(),stops:Et.optional(),gradientUnits:E([tt,et]).optional(),spreadMethod:E(["pad","reflect","repeat"]).optional(),gradientTransform:N().optional()}),Bt=It,Jt=B({pathData:N(),pathOverflow:E(["clip","extend"]).optional(),lengthAdjust:E(["spacing","spacingAndGlyphs"]).optional(),method:E(["align","stretch"]).optional(),spacing:E(["auto","exact"]).optional(),startOffset:Ot.optional(),textLength:Ot.optional()}),Rt=B({useGlyphs:M().optional()}),Ct=B({transformBy:zt.optional(),repeater:kt.optional(),maskedBy:Vt.optional(),clipPath:Pt.optional(),strokeTrim:Nt.optional(),clone:Mt.optional(),fillGradient:It.optional(),strokeGradient:Bt.optional(),textPath:Jt.optional(),text:Rt.optional()}),Gt=J({type:N(),domType:N().optional(),textContent:N().optional(),id:N().optional(),meta:(new class extends g{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,i){return!0}_canSanitize(t){return!0}}).optional(),effects:Ct.optional(),animate:pt.optional(),style:C(I([N(),D()])).optional()},St),Lt=J(y(f({},Gt._shape),{children:L(()=>R(Lt),[]).optional()}),St),Ut=B({width:I([D(),N()]).optional(),height:I([D(),N()]).optional(),viewBox:N().optional(),animator:xt.optional()}),Ft=(J(y(f(f({},Gt._shape),Ut._shape),{type:T("svg"),children:R(Lt).optional()}),St),B({v:R(R(D())),i:R(R(D())).optional(),o:R(R(D())).optional(),c:M().optional()}),{offScreen:Z,visibilityThreshold:.5,visibilityDebounce:150}),qt=Array.from({length:21},(t,e)=>e/20);function Ht(t){return{requestStart:()=>t.play(),dispose:()=>{}}}function Wt(t,e,i){if(e.offScreen===q.continue)return Ht(i);if("undefined"==typeof IntersectionObserver)return Ht(i);const n=e.visibilityThreshold,o=e.visibilityDebounce;let s,r,a=!1,l=!1,p=0;const u=()=>{void 0!==r&&(clearTimeout(r),r=void 0)},c=()=>{r=void 0,!0!==s&&(s=!0,(a||l)&&(a=!1,l=!1,i.play()))},h=()=>{u(),!1!==s&&(s=!1,i.isPlaying()&&(e.offScreen===q.reset?i.cancel():i.pause(),l=!0))},d=t=>{if(p=t,"undefined"==typeof document||"hidden"!==document.visibilityState)if(t>=n){if(!0===s||void 0!==r)return;o>0?r=setTimeout(c,o):c()}else t<=0?h():!0!==s&&u();else h()},f=new IntersectionObserver(t=>{const e=t[t.length-1];e&&d(e.isIntersecting?function(t){var e,i;const n=t.boundingClientRect,o=t.intersectionRect;if(!(null==n?void 0:n.height)||!o)return t.intersectionRatio;const s="undefined"!=typeof window&&window.innerHeight?window.innerHeight:1/0,r=null!=(i=null==(e=t.rootBounds)?void 0:e.height)?i:1/0,a=Math.min(s,r),l=Math.min(n.height,Number.isFinite(a)?a:n.height);return l>0?o.height/l:t.intersectionRatio}(e):0)},{threshold:qt});f.observe(t);const y=()=>{d(p)},m="undefined"!=typeof document;return m&&document.addEventListener("visibilitychange",y),{requestStart:t=>{if(t||!0===s)return u(),s=!0,a=!1,l=!1,void i.play();a=!0},dispose:()=>{u(),f.disconnect(),m&&document.removeEventListener("visibilitychange",y)}}}
@@ -1 +1 @@
1
- import{PLAY_WHEN_VISIBLE_DEFAULTS as m,PX_ANIMATOR_DOC_KEY as o,createVisibilityGate as r}from"./chunk-AROHP6GD.min.js";export{m as PLAY_WHEN_VISIBLE_DEFAULTS,o as PX_ANIMATOR_DOC_KEY,r as createVisibilityGate};
1
+ import{PLAY_WHEN_VISIBLE_DEFAULTS as m,PX_ANIMATOR_DOC_KEY as o,createVisibilityGate as r}from"./chunk-RQ5KZXDT.min.js";export{m as PLAY_WHEN_VISIBLE_DEFAULTS,o as PX_ANIMATOR_DOC_KEY,r as createVisibilityGate};
@@ -1969,6 +1969,38 @@ var PixodeskAnimator = (() => {
1969
1969
  return propsCopy;
1970
1970
  }
1971
1971
 
1972
+ // ../svg-animator-core/src/animation/PxStaticTransformMerge.ts
1973
+ function mergeStaticTransformIntoAnimDef(animDef, staticTransform) {
1974
+ if (!animDef) return animDef;
1975
+ const staticParts = staticTransform && typeof staticTransform === "object" && !Array.isArray(staticTransform) ? staticTransform : parseTransformParts(staticTransform);
1976
+ if (!staticParts || !Object.keys(staticParts).length) return animDef;
1977
+ const mergeKfValue = (v) => v && typeof v === "object" && !Array.isArray(v) ? __spreadValues(__spreadValues({}, staticParts), v) : v;
1978
+ const transformAnim = animDef[TRANSFORM_ATTR];
1979
+ if (transformAnim && typeof transformAnim === "object") {
1980
+ const anim = transformAnim;
1981
+ if (Array.isArray(anim.keyframes)) {
1982
+ const out = __spreadProps(__spreadValues({}, anim), {
1983
+ keyframes: anim.keyframes.map((kf) => __spreadProps(__spreadValues({}, kf), { value: mergeKfValue(kf.value) }))
1984
+ });
1985
+ if (out.value !== void 0) out.value = mergeKfValue(out.value);
1986
+ return __spreadProps(__spreadValues({}, animDef), { transform: out });
1987
+ }
1988
+ return animDef;
1989
+ }
1990
+ const channels = Object.keys(animDef).filter((k) => PX_TRANSFORM_FN_NAMES.has(k));
1991
+ if (channels.length !== 1) return animDef;
1992
+ const ch = channels[0];
1993
+ const chAnim = animDef[ch];
1994
+ if (!chAnim || typeof chAnim !== "object" || !Array.isArray(chAnim.keyframes)) return animDef;
1995
+ const lifted = __spreadProps(__spreadValues({}, chAnim), {
1996
+ keyframes: chAnim.keyframes.map((kf) => __spreadProps(__spreadValues({}, kf), { value: __spreadProps(__spreadValues({}, staticParts), { [ch]: kf.value }) }))
1997
+ });
1998
+ if (lifted.value !== void 0) lifted.value = __spreadProps(__spreadValues({}, staticParts), { [ch]: lifted.value });
1999
+ const rest = __spreadValues({}, animDef);
2000
+ delete rest[ch];
2001
+ return __spreadProps(__spreadValues({}, rest), { transform: lifted });
2002
+ }
2003
+
1972
2004
  // ../svg-animator-core/src/materialize/PxMotionPath.ts
1973
2005
  function getKfTranslate(kf) {
1974
2006
  const v = keyframeValue(kf);
@@ -2338,7 +2370,7 @@ var PixodeskAnimator = (() => {
2338
2370
  let newAnimate;
2339
2371
  const animBucket = node.animate;
2340
2372
  if (animBucket && typeof animBucket === "object" && !Array.isArray(animBucket)) {
2341
- const animDef = animBucket;
2373
+ const animDef = mergeStaticTransformIntoAnimDef(animBucket, node.transform);
2342
2374
  const transformAnim = animDef.transform;
2343
2375
  if (transformAnim && typeof transformAnim === "object" && propAnimIsMotionPath(transformAnim)) {
2344
2376
  const materialized = materializeMotionPathInPropAnim(transformAnim, opts);
@@ -2852,36 +2884,6 @@ var PixodeskAnimator = (() => {
2852
2884
  function generateElementId() {
2853
2885
  return "_px_el_" + ++_elementIdCounter;
2854
2886
  }
2855
- function mergeStaticTransformIntoAnimDef(animDef, staticTransform) {
2856
- if (!animDef) return animDef;
2857
- const staticParts = staticTransform && typeof staticTransform === "object" && !Array.isArray(staticTransform) ? staticTransform : parseTransformParts(staticTransform);
2858
- if (!staticParts || !Object.keys(staticParts).length) return animDef;
2859
- const mergeKfValue = (v) => v && typeof v === "object" && !Array.isArray(v) ? __spreadValues(__spreadValues({}, staticParts), v) : v;
2860
- const transformAnim = animDef[TRANSFORM_ATTR];
2861
- if (transformAnim && typeof transformAnim === "object") {
2862
- const anim = transformAnim;
2863
- if (Array.isArray(anim.keyframes)) {
2864
- const out = __spreadProps(__spreadValues({}, anim), {
2865
- keyframes: anim.keyframes.map((kf) => __spreadProps(__spreadValues({}, kf), { value: mergeKfValue(kf.value) }))
2866
- });
2867
- if (out.value !== void 0) out.value = mergeKfValue(out.value);
2868
- return __spreadProps(__spreadValues({}, animDef), { transform: out });
2869
- }
2870
- return animDef;
2871
- }
2872
- const channels = Object.keys(animDef).filter((k) => PX_TRANSFORM_FN_NAMES.has(k));
2873
- if (channels.length !== 1) return animDef;
2874
- const ch = channels[0];
2875
- const chAnim = animDef[ch];
2876
- if (!chAnim || typeof chAnim !== "object" || !Array.isArray(chAnim.keyframes)) return animDef;
2877
- const lifted = __spreadProps(__spreadValues({}, chAnim), {
2878
- keyframes: chAnim.keyframes.map((kf) => __spreadProps(__spreadValues({}, kf), { value: __spreadProps(__spreadValues({}, staticParts), { [ch]: kf.value }) }))
2879
- });
2880
- if (lifted.value !== void 0) lifted.value = __spreadProps(__spreadValues({}, staticParts), { [ch]: lifted.value });
2881
- const rest = __spreadValues({}, animDef);
2882
- delete rest[ch];
2883
- return __spreadProps(__spreadValues({}, rest), { transform: lifted });
2884
- }
2885
2887
  function normalizeAnimationDefinition(animDef, duration, defs, engine = PxTimelineEngine.native) {
2886
2888
  const normalized = {};
2887
2889
  for (const [propName, propAnim] of Object.entries(animDef)) {
@@ -2964,7 +2966,7 @@ var PixodeskAnimator = (() => {
2964
2966
  return { prevKf, nextKf };
2965
2967
  }
2966
2968
  function calcPropertyValue(propName, propAnim, progress) {
2967
- var _a2, _b, _c, _d;
2969
+ var _a2, _b, _c, _d, _e;
2968
2970
  const keyframes = propAnim.keyframes || [];
2969
2971
  if (keyframes.length === 0) return null;
2970
2972
  const { prevKf, nextKf } = getKeyframesPair(keyframes, progress);
@@ -3033,7 +3035,7 @@ var PixodeskAnimator = (() => {
3033
3035
  !!propAnim.autoOrient
3034
3036
  );
3035
3037
  partsResult.translate = [sample.translate[0], sample.translate[1]];
3036
- if (sample.rotateDeg !== void 0) partsResult.rotate = sample.rotateDeg;
3038
+ if (sample.rotateDeg !== void 0) partsResult.rotate = sample.rotateDeg + ((_e = partsResult.rotate) != null ? _e : 0);
3037
3039
  }
3038
3040
  }
3039
3041
  cssValue = composeTransformParts(partsResult, { withUnits: false });
@@ -5516,12 +5518,17 @@ var PixodeskAnimator = (() => {
5516
5518
  const first = keyframeValue(kfs[0]);
5517
5519
  const anchor = (first == null ? void 0 : first.origin) && first.origin.length >= 2 ? [first.origin[0], first.origin[1]] : [0, 0];
5518
5520
  const points = [];
5521
+ let keyframesCarryRotate = false;
5519
5522
  for (const kf of kfs) {
5520
5523
  const v = keyframeValue(kf);
5521
5524
  const tr = v == null ? void 0 : v.translate;
5522
5525
  if (!tr || tr.length < 2) return void 0;
5523
5526
  const parts = Object.keys(v);
5524
- if (parts.some((p) => p !== "translate" && p !== "origin")) return void 0;
5527
+ if (parts.some((p) => p !== TRANSFORM_PART.translate && p !== TRANSFORM_PART.origin && p !== TRANSFORM_PART.rotate)) return void 0;
5528
+ if ((v == null ? void 0 : v.rotate) !== void 0) {
5529
+ if (v.rotate !== 0) return void 0;
5530
+ keyframesCarryRotate = true;
5531
+ }
5525
5532
  const o = (_a2 = v == null ? void 0 : v.origin) != null ? _a2 : [0, 0];
5526
5533
  if (o[0] !== anchor[0] || o[1] !== anchor[1]) return void 0;
5527
5534
  points.push([tr[0] + anchor[0], tr[1] + anchor[1]]);
@@ -5549,7 +5556,7 @@ var PixodeskAnimator = (() => {
5549
5556
  if (e !== void 0) out.e = e;
5550
5557
  distanceKfs.push(out);
5551
5558
  }
5552
- return { pathStr: d, distanceKfs, autoOrient: !!propAnim.autoOrient, anchor };
5559
+ return { pathStr: d, distanceKfs, autoOrient: !!propAnim.autoOrient, anchor, keyframesCarryRotate };
5553
5560
  }
5554
5561
  function materializeOffsetPathsInTree(root) {
5555
5562
  const walk = (node) => {
@@ -5571,6 +5578,7 @@ var PixodeskAnimator = (() => {
5571
5578
  const t = __spreadValues({}, staticTr);
5572
5579
  delete t[TRANSFORM_PART.translate];
5573
5580
  delete t[TRANSFORM_PART.origin];
5581
+ if (built.keyframesCarryRotate) delete t[TRANSFORM_PART.rotate];
5574
5582
  newTransform = Object.keys(t).length ? t : void 0;
5575
5583
  }
5576
5584
  out = __spreadProps(__spreadValues({}, node), {
@@ -5743,6 +5751,78 @@ var PixodeskAnimator = (() => {
5743
5751
  return changed ? __spreadProps(__spreadValues({}, node), { children: newChildren }) : node;
5744
5752
  }
5745
5753
 
5754
+ // ../svg-animator-core/src/materialize/PxRestPose.ts
5755
+ var TRANSFORM_CHANNEL = "transform";
5756
+ var REVERSED_DIRECTIONS = /* @__PURE__ */ new Set(["reverse", "alternate-reverse"]);
5757
+ var SCRATCH_ID_PREFIX = "__px_rest_";
5758
+ function materializeRestPosesInTree(root, engine) {
5759
+ var _a2;
5760
+ const out = deepClone(root);
5761
+ const config = getAnimatorConfig(out) || {};
5762
+ const duration = +(config.duration || PX_DEFAULT_DURATION_MS);
5763
+ const firstFrameTime = REVERSED_DIRECTIONS.has(String(config.direction)) ? duration : 0;
5764
+ const nodes = animatedNodes(out);
5765
+ if (!nodes.size) return out;
5766
+ const before = bindingsOf(out, engine);
5767
+ const added = /* @__PURE__ */ new Map();
5768
+ for (const [key, animate] of before) {
5769
+ const node = nodes.get(key);
5770
+ if (!node) continue;
5771
+ for (const channel of Object.keys(animate)) {
5772
+ if (!mayCarryRestPose(node, channel)) continue;
5773
+ const value = firstFrameValue(animate, channel, firstFrameTime);
5774
+ if (value === void 0) continue;
5775
+ node[channel] = value;
5776
+ added.set(key, [...(_a2 = added.get(key)) != null ? _a2 : [], channel]);
5777
+ }
5778
+ }
5779
+ if (added.size) {
5780
+ const after = bindingsOf(out, engine);
5781
+ for (const [key, channels] of added) {
5782
+ if (JSON.stringify(after.get(key)) === JSON.stringify(before.get(key))) continue;
5783
+ const node = nodes.get(key);
5784
+ if (node) for (const channel of channels) delete node[channel];
5785
+ }
5786
+ }
5787
+ return out;
5788
+ }
5789
+ function mayCarryRestPose(node, channel) {
5790
+ if (node[channel] !== void 0) return false;
5791
+ if (PX_TRANSFORM_FN_NAMES.has(channel)) return false;
5792
+ if (channel === TRANSFORM_CHANNEL) {
5793
+ for (const part of PX_TRANSFORM_FN_NAMES) if (node[part] !== void 0) return false;
5794
+ }
5795
+ return true;
5796
+ }
5797
+ function firstFrameValue(animate, channel, timeMs) {
5798
+ const values = Object.values(calcAnimationValues({ [channel]: animate[channel] }, timeMs));
5799
+ return values.length === 1 && values[0] !== "" ? values[0] : void 0;
5800
+ }
5801
+ function bindingsOf(tree, engine) {
5802
+ const scratch = deepClone(tree);
5803
+ const keyById = /* @__PURE__ */ new Map();
5804
+ for (const [key, node] of animatedNodes(scratch)) {
5805
+ if (node.id === void 0) node.id = SCRATCH_ID_PREFIX + key;
5806
+ keyById.set(String(node.id), key);
5807
+ }
5808
+ const out = /* @__PURE__ */ new Map();
5809
+ for (const binding of normalizeBindings(scratch, engine)) {
5810
+ const key = keyById.get(binding.id);
5811
+ if (key !== void 0) out.set(key, binding.animate);
5812
+ }
5813
+ return out;
5814
+ }
5815
+ function animatedNodes(tree) {
5816
+ const out = /* @__PURE__ */ new Map();
5817
+ let counter = 0;
5818
+ const visit = (node) => {
5819
+ if (node.animate) out.set(String(counter++), node);
5820
+ if (node.children) for (const child of node.children) visit(child);
5821
+ };
5822
+ if (tree.children) for (const child of tree.children) visit(child);
5823
+ return out;
5824
+ }
5825
+
5746
5826
  // ../svg-animator-core/src/materialize/PxAnimatorMaterializeAll.ts
5747
5827
  function materializeAllInTree(doc, engine, options) {
5748
5828
  var _a2, _b;
@@ -5755,6 +5835,7 @@ var PixodeskAnimator = (() => {
5755
5835
  root = materializeAnimatedUseInstances(root);
5756
5836
  root = pruneUnreferencedDefs(root);
5757
5837
  }
5838
+ root = materializeRestPosesInTree(root, engine);
5758
5839
  return root;
5759
5840
  }
5760
5841
  function pruneUnreferencedDefs(root) {
@@ -6318,6 +6399,52 @@ var PixodeskAnimator = (() => {
6318
6399
  );
6319
6400
  }
6320
6401
 
6402
+ // ../svg-animator-core/src/render/PxRenderTree.ts
6403
+ var CLASS_NAME_KEY = "className";
6404
+ var CLASS_ATTR2 = "class";
6405
+ var DOM_TYPE_KEY = "domType";
6406
+ var TYPE_ATTR = "type";
6407
+ var DEFAULT_TAG = "g";
6408
+ function renderPxTree(node, factory, diag) {
6409
+ return node ? renderOne(node, factory, diag, true, 0) : null;
6410
+ }
6411
+ function renderOne(node, factory, diag, isRoot, index) {
6412
+ const _a2 = node, { type, children, style } = _a2, props = __objRest(_a2, ["type", "children", "style"]);
6413
+ const tag = type || DEFAULT_TAG;
6414
+ if (PX_DISALLOWED_SVG_TAGS_LOWER.has(tag.toLowerCase())) {
6415
+ (diag != null ? diag : createDiagnostics(void 0, "[PxAnimator]")).warn(PxDiagnosticKind.document, 1103 /* blockedTag */, tag);
6416
+ return null;
6417
+ }
6418
+ const domType = props[DOM_TYPE_KEY];
6419
+ if (domType !== void 0) delete props[DOM_TYPE_KEY];
6420
+ const attrs = {};
6421
+ let inlineStyle;
6422
+ const domProps = toDomProps(props);
6423
+ for (const propName of Object.keys(domProps)) {
6424
+ const sanitized = sanitizeAttributeValue(propName, domProps[propName]);
6425
+ if (sanitized === void 0) continue;
6426
+ if (PX_CSS_ONLY_STYLE_PROPS.has(propName)) {
6427
+ (inlineStyle != null ? inlineStyle : inlineStyle = {})[propName] = String(sanitized);
6428
+ continue;
6429
+ }
6430
+ attrs[propName === CLASS_NAME_KEY ? CLASS_ATTR2 : camelCaseToKebabWordIfNeeded(propName)] = sanitized;
6431
+ }
6432
+ if (domType !== void 0) attrs[TYPE_ATTR] = String(domType);
6433
+ if (style) {
6434
+ for (const styleProp of Object.keys(style)) (inlineStyle != null ? inlineStyle : inlineStyle = {})[styleProp] = String(style[styleProp]);
6435
+ }
6436
+ const rendered = [];
6437
+ if (children) {
6438
+ children.forEach((child, i) => {
6439
+ const el = renderOne(child, factory, diag, false, i);
6440
+ if (el !== null) rendered.push(el);
6441
+ });
6442
+ }
6443
+ const ownText = props[PX_TEXT_CONTENT_ATTR];
6444
+ const text = !rendered.length && typeof ownText === "string" && ownText ? ownText : void 0;
6445
+ return factory({ tag, attrs, style: inlineStyle, children: rendered, text, node, isRoot, index });
6446
+ }
6447
+
6321
6448
  // ../svg-animator-core/src/playback/PxScrollMath.ts
6322
6449
  function isScrollTimeline(config) {
6323
6450
  return (config == null ? void 0 : config.timelineSource) === "scroll";
@@ -7384,62 +7511,19 @@ var PixodeskAnimator = (() => {
7384
7511
 
7385
7512
  // src/dom/PxAnimatorDOM.ts
7386
7513
  var SVG_NS = "http://www.w3.org/2000/svg";
7387
- function createElement(tagName, normalizedProps, style, children, textContent, diag) {
7388
- if (PX_DISALLOWED_SVG_TAGS_LOWER.has(tagName.toLowerCase())) {
7389
- (diag != null ? diag : createDiagnostics(void 0, "[PxAnimator]")).warn(PxDiagnosticKind.document, 1103 /* blockedTag */, tagName);
7390
- return null;
7391
- }
7392
- const element = document.createElementNS(SVG_NS, tagName);
7393
- for (const propName in normalizedProps) {
7394
- const sanitized = sanitizeAttributeValue(propName, normalizedProps[propName]);
7395
- if (sanitized === void 0) continue;
7396
- if (PX_CSS_ONLY_STYLE_PROPS.has(propName)) {
7397
- element.style[propName] = String(sanitized);
7398
- continue;
7399
- }
7400
- element.setAttribute(camelCaseToKebabWordIfNeeded(propName), sanitized);
7401
- }
7514
+ var createDomElement = ({ tag, attrs, style, children, text }) => {
7515
+ const element = document.createElementNS(SVG_NS, tag);
7516
+ for (const name of Object.keys(attrs)) element.setAttribute(name, attrs[name]);
7402
7517
  if (style) {
7403
- for (const styleProp in style) {
7404
- element.style[styleProp] = String(style[styleProp]);
7405
- }
7406
- }
7407
- if (children == null ? void 0 : children.length) {
7408
- for (const child of children) {
7409
- element.appendChild(child);
7410
- }
7411
- } else if (textContent) {
7412
- element.textContent = textContent;
7413
- }
7414
- return element;
7415
- }
7416
- function renderNode(node, defs, diag) {
7417
- if (!node) return null;
7418
- const _a2 = node, { type, children, style } = _a2, props = __objRest(_a2, ["type", "children", "style"]);
7419
- const domType = props.domType;
7420
- if (domType !== void 0) delete props.domType;
7421
- const nodeDefs = getDefinitions(node) || defs;
7422
- const resolvedStyle = style;
7423
- let childElements;
7424
- if (children) {
7425
- for (const ch of children) {
7426
- const child = renderNode(ch, nodeDefs, diag);
7427
- if (child) {
7428
- if (!childElements) childElements = [];
7429
- childElements.push(child);
7430
- }
7431
- }
7518
+ const target = element.style;
7519
+ for (const prop of Object.keys(style)) target[prop] = style[prop];
7432
7520
  }
7433
- const element = createElement(
7434
- type || "g",
7435
- toDomProps(props),
7436
- resolvedStyle,
7437
- childElements,
7438
- props[PX_TEXT_CONTENT_ATTR],
7439
- diag
7440
- );
7441
- if (element && domType !== void 0) element.setAttribute("type", domType);
7521
+ for (const child of children) element.appendChild(child);
7522
+ if (text !== void 0) element.textContent = text;
7442
7523
  return element;
7524
+ };
7525
+ function renderNode(node, _defs, diag) {
7526
+ return renderPxTree(node, createDomElement, diag);
7443
7527
  }
7444
7528
 
7445
7529
  // src/shared/PxAnimatorKeys.ts
@@ -7449,7 +7533,7 @@ var PixodeskAnimator = (() => {
7449
7533
  function createAnimatorFromConfig(doc, adapter, callbacks, rootElement) {
7450
7534
  return bindWithEngineChoice(doc, adapter, callbacks, rootElement);
7451
7535
  }
7452
- function createAnimatorImpl(doc, adapter, callbacks, containerElement, patch, resetTimeline) {
7536
+ function createAnimatorImpl(doc, adapter, callbacks, containerElement, patch, resetTimeline, providedRoot) {
7453
7537
  const diag = createDiagnostics(callbacks, "[PxAnimator]");
7454
7538
  const effectsWarnings = validateNodeEffects(doc);
7455
7539
  for (const w of effectsWarnings) diag.warn(PxDiagnosticKind.document, 1101 /* effectsShape */, w);
@@ -7473,6 +7557,7 @@ var PixodeskAnimator = (() => {
7473
7557
  }
7474
7558
  }
7475
7559
  }
7560
+ if (!rootElement && providedRoot) rootElement = providedRoot;
7476
7561
  const api = createAnimatorFromConfig(doc, adapter, callbacks, rootElement);
7477
7562
  if (containerElement && rootElement) {
7478
7563
  const rendered = rootElement;
@@ -7485,7 +7570,7 @@ var PixodeskAnimator = (() => {
7485
7570
  return api;
7486
7571
  }
7487
7572
  function isInternalOptions(options) {
7488
- return "adapter" in options;
7573
+ return "adapter" in options || "rootElement" in options;
7489
7574
  }
7490
7575
  function resolveTimelineOption(options) {
7491
7576
  const { timeline, duration, delay, iterations, start } = options;
@@ -7494,6 +7579,7 @@ var PixodeskAnimator = (() => {
7494
7579
  function createAnimator(options) {
7495
7580
  const { src, doc, container, resetTimeline } = options;
7496
7581
  const adapter = isInternalOptions(options) ? options.adapter : void 0;
7582
+ const providedRoot = isInternalOptions(options) ? options.rootElement : void 0;
7497
7583
  const patch = resolveTimelineOption(options);
7498
7584
  let proxy;
7499
7585
  const callbacks = withRegistryEvents(toEngineCallbacks(options), () => proxy);
@@ -7526,7 +7612,7 @@ var PixodeskAnimator = (() => {
7526
7612
  };
7527
7613
  const build = (document2) => {
7528
7614
  try {
7529
- ready(createAnimatorImpl(document2, adapter, callbacks, container, patch, resetTimeline));
7615
+ ready(createAnimatorImpl(document2, adapter, callbacks, container, patch, resetTimeline, providedRoot));
7530
7616
  } catch (e) {
7531
7617
  const err = asThrownError(e);
7532
7618
  failed(PxDiagnosticKind.internal, 1001 /* buildFailed */, err);