@pixodesk/svg-animator-core 1.0.43 → 1.0.44
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 +1 -1
- package/dist/{PxDocumentDiagnostic-DkBZYJ7X.d.cts → PxDocumentDiagnostic-n8yiyL0k.d.cts} +106 -70
- package/dist/{PxDocumentDiagnostic-DkBZYJ7X.d.ts → PxDocumentDiagnostic-n8yiyL0k.d.ts} +106 -70
- package/dist/{chunk-BOTZI36B.js → chunk-EFQLDGFY.js} +75 -25
- package/dist/chunk-EFQLDGFY.js.map +1 -0
- package/dist/chunk-YWBPS6E4.min.js +1 -0
- package/dist/index.cjs +81 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.js +1 -1
- package/dist/internal.cjs +24 -16
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +1 -1
- package/dist/internal.min.cjs +1 -1
- package/dist/internal.min.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-BOTZI36B.js.map +0 -1
- package/dist/chunk-CAZFG2HW.min.js +0 -1
package/dist/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{OFFSET_DISTANCE_ATTR as t,PX_DEFAULT_DURATION_MS as e,PX_TIMELINE_SHARED_KEYS as n,PX_TIME_ONLY_TIMELINE_KEYS as r,PX_TRANSFORM_PART_KEYS as o,PX_TRIGGER_DEFAULTS as i,PX_WIRE_BASELINE_VERSION as a,PX_WIRE_SCHEMA_VERSION as s,PX_WIRE_STEPS as l,PX_WIRE_VERSION as u,PX_WIRE_VERSION_KEY as c,PxAlongPathMode as f,PxAnimatedSvgDocumentSchema as d,PxAnimatorConfigSchema as m,PxAttrValueSchema as v,PxBezierPathSchema as h,PxClipPathEffectSchema as g,PxCloneEffectSchema as p,PxCloneWithout as y,PxControlMode as k,PxDefinitionsSchema as b,PxDiagnosticKind as A,PxEffectsSchema as w,PxElementAnimationSchema as O,PxFillGradientEffectSchema as j,PxFillMode as x,PxFinishAction as N,PxGradientSpreadMethod as M,PxGradientStopSchema as F,PxGradientType as S,PxKeyframeSchema as C,PxKeyframeValueSchema as P,PxLengthAdjust as R,PxLoopDirection as I,PxLoopRepeatAt as D,PxLoopSchema as B,PxMaskType as T,PxMaskedByEffectSchema as E,PxNodeBaseSchema as U,PxNodeSchema as K,PxOutAction as z,PxPathOverflow as G,PxPinAlign as L,PxPlaybackDirection as W,PxPropertyAnimationSchema as _,PxRepeaterEffectSchema as X,PxRetimeEffectSchema as Y,PxScrollAxis as Z,PxScrollKind as q,PxScrollPhase as J,PxScrollRangePointSchema as H,PxScrollRangeSchema as Q,PxScrollSchema as V,PxScrollSource as $,PxStartOn as tt,PxStrokeTrimEffectSchema as et,PxStrokeTrimSubPaths as nt,PxSvgNodeRootSchema as rt,PxTextEffectSchema as ot,PxTextPathEffectSchema as it,PxTextPathMethod as at,PxTextPathSpacing as st,PxTimelineEngine as lt,PxTimelineEngineSetting as ut,PxTimelineSchema as ct,PxTransformByEffectSchema as ft,PxTransformPartsSchema as dt,PxTransformValueSchema as mt,PxTriggerSchema as vt,PxUnits as ht,PxWireStepKind as gt,PxWireVersionRelation as pt,TRANSFORM_ATTR as yt,TRANSFORM_PART as kt,__spreadProps as bt,__spreadValues as At,applyTextGlyphsAlongPath as wt,applyTextGlyphsEffect as Ot,applyTextPathEffect as jt,applyUseOffsetToG as xt,applyWireSteps as Nt,bezier2D_arcLengthLUT as Mt,bezierToSvgPath as Ft,calcAnimationValues as St,clamp as Ct,clone as Pt,compareWireVersion as Rt,controlModeTakesOverTrigger as It,convertWireDocument as Dt,deepClonePxNode as Bt,describeSchema as Tt,diagnoseDocument as Et,downgradeWireDocument as Ut,flattenAnimatorTimeline as Kt,formatWireVersion as zt,genId as Gt,generateNewIds as Lt,getAnimatorConfig as Wt,getBindings as _t,getChildren as Xt,getDefinitions as Yt,indexById as Zt,isNativeForced as qt,isPxDocument as Jt,isValidPxDocument as Ht,keyframeEasing as Qt,keyframeTangentIn as Vt,keyframeTangentOut as $t,keyframeTime as te,keyframeValue as ee,keyframeWith as ne,materializeInternalLoopsInTree as re,materializeMotionPathsInTree as oe,mayUseNativeScrollTimeline as ie,nestAnimatorTimeline as ae,normalizeBindings as se,parseSvgPathToBezier as le,parseWireVersion as ue,partsRecord as ce,px as fe,readAnimatable as de,readStaticOrigin as me,readWireVersion as ve,regenerateIdsAndRewriteRefs as he,regenerateIdsInClone as ge,resolveControlMode as pe,resolveTimelineEngine as ye,resolveTrigger as ke,schemaKeys as be,spliceDefs as Ae,stripHash as we,toDomProps as Oe,validateDocument as je,validateNodeEffects as xe,wireVersionAdvice as Ne,writeAnimatableChannel as Me}from"./chunk-CAZFG2HW.min.js";function Fe(t,e,n){if(!e)return t;delete t.transform;let r=t;return r=Ce(r,e.origin,!0),r=Se(r,"scale",e.scale,n),r=Se(r,"skew",e.skew,n),r=Se(r,"rotate",e.rotate,n),r=Ce(r,e.origin,!1),!function(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}(e.translate)?r=Se(r,"translate",e.translate,n):(r=Ce(r,e.origin,!0),r=Se(r,"translate",e.translate,n),r=Ce(r,e.origin,!1)),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function Se(t,e,n,r){if(void 0===n)return t;const o=de(n);if("static"===o.kind)return{type:"g",transform:{value:ce(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>ne(t,ce(e,t.value,void 0)))};return o.autoOrient&&(n.autoOrient=!0),void 0!==o.loop&&(n.loop=o.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function Ce(t,e,n){if(void 0===e)return t;const r=de(e),o=t=>n?[-t[0],-t[1]]:t;if("absent"===r.kind)return t;if("static"===r.kind)return 0===r.value[0]&&0===r.value[1]?t:{type:"g",transform:{value:{translate:o(r.value)}},children:[t]};if("animated"===r.kind){const e={keyframes:r.keyframes.map(t=>ne(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function Pe(t,e,n){var r,o,i;if("use"===t.type&&"translate"===(null==(o=null==(r=t.effects)?void 0:r.clone)?void 0:o.without)){const r=we(t.effects.clone.source);"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(i=t.children)||i.forEach(t=>Pe(t,e,n))}function Re(t,e,n,r,o){const i=function(t,e){var n,r,o;const i={};let a=!1;const s=null==(n=t.animate)?void 0:n.transform;if(s&&"object"==typeof s&&Array.isArray(s.keyframes)){const e=s.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=De(s),r={keyframes:e.map(t=>{const e=t.value||{},r={};void 0!==e.translate&&(r.translate=e.translate),n&&void 0!==e.origin&&(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),void 0!==t.tangentOut&&(o.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(o.tangentIn=t.tangentIn),o})};s.autoOrient&&(r.autoOrient=!0);const o=s.loop;void 0!==o&&(r.loop=o),i.animate={transform:r};const l=e.some(t=>{const e=t.value||{};return void 0!==e.rotate||void 0!==e.scale}),u=e.map(t=>{const e=t.value||{},r={};void 0!==e.rotate&&(r.rotate=e.rotate),void 0!==e.scale&&(r.scale=e.scale),void 0===e.origin||n&&!l||(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),o});if(u.every(t=>0===Object.keys(t.value).length))delete t.animate.transform,t.animate&&0===Object.keys(t.animate).length&&delete t.animate;else{const e={keyframes:u};void 0!==o&&(e.loop=o),t.animate.transform=e}a=!0}}const l=void 0!==(null==e?void 0:e.translate),u=a||l,c=a&&De((null==(r=t.animate)?void 0:r.transform)||void 0)||a&&De((null==(o=i.animate)?void 0:o.transform)||void 0);if("string"==typeof t.transform){const e=function(t){const e=[],n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);)e.push({name:r[1],full:r[0]});if(!e.length)return{rest:t||void 0};if(e.every(t=>"translate"===t.name))return{translate:e.map(t=>t.full).join("")};const o=e[0],i=e[e.length-1];if("translate"===i.name&&"translate"===o.name){const n=Ie(i.full),r=Ie(o.full),a=-n[0],s=-n[1],l=r[0]-a,u=r[1]-s;if(0===l&&0===u)return{rest:t};return{translate:"translate("+l+","+u+")",rest:"translate("+a+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===i.name)return{rest:t};const a=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)a.push(e[s].full),s++;if(!a.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:a.join(""),rest:l||void 0}}(t.transform);u?void 0!==e.translate?e.rest?t.transform=e.rest:delete t.transform:!function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,n=[];let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(1!==n.length)return!1;if("translate"===n[0].name)return!0;if("matrix"!==n[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(n[0].full);if(!o)return!1;const i=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return i.length>=4&&1===i[0]&&0===i[1]&&0===i[2]&&1===i[3]}(t.transform)?c&&function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let n,r=0,o=!1;for(;n=e.exec(t);)r++,"matrix"===n[1]&&(o=!0);return 1===r&&o}(t.transform)&&delete t.transform:delete t.transform:e.translate&&(i.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}else if(t.transform&&"object"==typeof t.transform&&!Array.isArray(t.transform)&&!t.transform.keyframes){const e=t.transform.value,n=!(!e||"object"!=typeof e),r=n?e:t.transform,o=t=>n?{value:t}:t;if(Array.isArray(r.translate)){const e=At({},r);delete e.translate;const n=Object.keys(e).length>0;u||(i.transform=o({translate:r.translate})),n?t.transform=o(e):delete t.transform}}return i}(t,e);"string"==typeof t.id&&delete t.id;const{outer:a,inner:s}=function(t){if(!t)return{};const e=De(t.translate),n=void 0!==t.rotate||void 0!==t.scale,r={},o={};void 0!==t.translate&&(r.translate=t.translate);e&&void 0!==t.origin&&(r.origin=t.origin);void 0!==t.rotate&&(o.rotate=t.rotate);void 0!==t.scale&&(o.scale=t.scale);void 0!==t.skew&&(o.skew=t.skew);void 0===t.origin||e&&!n||(o.origin=t.origin);return{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(e);let l=t;l=Fe(l,s,o);let u={type:"g",id:n,children:[{type:"g",id:r,children:[l]}]};return void 0!==i.transform&&(u.transform=i.transform),void 0!==i.animate&&(u.animate=i.animate),a&&(delete u.id,u=Fe(u,a,o),u.id=n),u}function Ie(t){const e=/translate\(([^)]*)\)/.exec(t);if(!e)return[0,0];const n=e[1].split(/[\s,]+/).filter(Boolean).map(Number);return[n[0]||0,n[1]||0]}function De(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||!!Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}function Be(t,e,n,r){if(!e)return t;const o=Gt(n,"grad"),i=function(t,e){const n={type:t.type===S.radial?"radialGradient":"linearGradient",id:e};t.type===S.linear?(Te(n,"x1","y1",t.start),Te(n,"x2","y2",t.end)):(Te(n,"cx","cy",t.center),function(t,e,n){const r=de(n);if("absent"===r.kind)return;Me(t,e,r,{asString:!0})}(n,"r",t.radius),Te(n,"fx","fy",t.focal));t.gradientUnits&&(n.gradientUnits=t.gradientUnits);t.spreadMethod&&(n.spreadMethod=t.spreadMethod);t.gradientTransform&&(n.gradientTransform=t.gradientTransform);return n.children=function(t){var e,n;if(!t)return[];const r=de(t);if("absent"===r.kind)return[];if("static"===r.kind)return Array.isArray(r.value)?r.value.map(Ee):[];const o=r.keyframes;if(!o.length)return[];const i=r.loop;let a=0;for(const t of o){const e=ee(t);Array.isArray(e)&&e.length>a&&(a=e.length)}if(!a)return[];const s=ee(o[0]),l=[];for(let t=0;t<a;t++){const r=null!=(n=null!=(e=null==s?void 0:s[t])?e:Ue(o,0,t))?n:{offset:t/Math.max(1,a-1),color:"#000000"};l.push({offset:r.offset,color:r.color})}return l.map((t,e)=>function(t,e,n,r,o){var i;const a=[],s=[];let l=!1;for(const r of e){const o=te(r),u=ee(r),c=null!=(i=null==u?void 0:u[n])?i:Ue(e,e.indexOf(r),n);if(!c)continue;const f=Qt(r),d={time:o,value:c.color};void 0!==f&&(d.easing=f),a.push(d);const m={time:o,value:c.offset};void 0!==f&&(m.easing=f),s.push(m),c.offset!==t.offset&&(l=!0)}const u={type:"stop",offset:Ke(t.offset),stopColor:t.color},c={};a.length&&(c.stopColor={keyframes:a},void 0!==o&&(c.stopColor.loop=o));l&&s.length&&(c.offset={keyframes:s},void 0!==o&&(c.offset.loop=o));Object.keys(c).length&&(u.animate=c);return u}(t,o,e,0,i))}(t.stops),n}(e,o);return n.defs.push(i),t[r]="url(#"+o+")",t}function Te(t,e,n,r){var o,i,a;const s=de(r);if("absent"===s.kind)return;if("static"===s.kind)return t[e]=String(s.value[0]),void(t[n]=String(s.value[1]));const l=t=>{const e={keyframes:s.keyframes.map(e=>{const n={time:e.time,value:Array.isArray(e.value)?e.value[t]:void 0};return void 0!==e.easing&&(n.easing=e.easing),n})};return void 0!==s.loop&&(e.loop=s.loop),e},u=null!=(o=t.animate)?o:{};u[e]=l(0),u[n]=l(1),t.animate=u;const c=null!=(a=s.base)?a:null==(i=s.keyframes[0])?void 0:i.value;Array.isArray(c)&&(t[e]=String(c[0]),t[n]=String(c[1]))}function Ee(t){return{type:"stop",offset:Ke(t.offset),stopColor:t.color}}function Ue(t,e,n){for(let r=e;r>=0;r--){const e=ee(t[r]);if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=ee(t[r]);if(null==e?void 0:e[n])return e[n]}}function Ke(t){return Math.round(1e3*t)/10+"%"}function ze(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.pathData?t.pathData:void 0}function Ge(t,e,n,r){if(!e)return t;const o=we(e.source);if(!o)return r.errors.push("maskedBy.source missing — cannot build mask"),t;const i=Gt(r,"mask");let a={type:"use",href:"#"+o};if(n)a=Le(a,n,r);else if(Ye(t))a=function(t,e){var n;const r=e.animate&&"object"==typeof e.animate&&!Array.isArray(e.animate)?e.animate:void 0,o=null==r?void 0:r.transform,i=o&&"object"==typeof o&&Array.isArray(o.keyframes)?o.keyframes:void 0;if(!i||!i.length)return t;const a=[],s=[],l=[];for(const t of i){const e=(null!=(n=t.value)?n:t.v)||{},r=ne(t,void 0);if(Array.isArray(e.translate)&&a.push(bt(At(At({},r),Xe(t)),{value:{translate:[-e.translate[0],-e.translate[1]]}})),"number"==typeof e.rotate){const t={rotate:-e.rotate};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),s.push(bt(At({},r),{value:t}))}if(Array.isArray(e.scale)){const t={scale:[1/e.scale[0],1/e.scale[1]]};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),l.push(bt(At({},r),{value:t}))}}const u=null==o?void 0:o.loop,c=t=>{const e={keyframes:t};return void 0!==u&&(e.loop=u),e};let f=t;a.length&&(f={type:"g",animate:{transform:c(a)},children:[f]});s.length&&(f={type:"g",animate:{transform:c(s)},children:[f]});l.length&&(f={type:"g",animate:{transform:c(l)},children:[f]});return f}(a,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,i,a,s,l,u,c,f,d,m;const v=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let h;const g=[];for(;null!==(h=v.exec(t));){const t=h[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);g.push({name:h[1],args:t})}if(!g.length)return;const p=g[g.length-1];if("translate"===p.name)for(let t=g.length-2;t>=0;t--){const c=g[t];if("translate"!==c.name)continue;const f=null!=(e=c.args[0])?e:0,d=null!=(n=c.args[1])?n:0,m=null!=(r=p.args[0])?r:0,v=null!=(o=p.args[1])?o:0;if(m!==-f||v!==-d)continue;const h={};h.origin=[f,d];for(let e=0;e<t;e++)if("translate"===g[e].name){const t=null!=(i=g[e].args[0])?i:0,n=null!=(a=g[e].args[1])?a:0;h.translate=h.translate?[h.translate[0]+t,h.translate[1]+n]:[t,n]}for(let e=t+1;e<g.length-1;e++){const t=g[e];if("rotate"===t.name)h.rotate=(null!=(s=h.rotate)?s:0)+(null!=(l=t.args[0])?l:0);else if("scale"===t.name){const e=null!=(u=t.args[0])?u:1,n=t.args.length>1?t.args[1]:e;h.scale=h.scale?[h.scale[0]*e,h.scale[1]*n]:[e,n]}}return h}let y,k,b;for(const t of g)if("translate"===t.name){const e=null!=(c=t.args[0])?c:0,n=null!=(f=t.args[1])?f:0;y=y?[y[0]+e,y[1]+n]:[e,n]}else if("rotate"===t.name)k=(null!=k?k:0)+(null!=(d=t.args[0])?d:0);else if("scale"===t.name){const e=null!=(m=t.args[0])?m:1,n=t.args.length>1?t.args[1]:e;b=b?[b[0]*e,b[1]*n]:[e,n]}const A={};y&&(A.translate=y);void 0!==k&&(A.rotate=k);b&&(A.scale=b);return Object.keys(A).length?A:void 0}(t.transform);if(!e)return;const n={};return e.translate&&(n.translate=e.translate),void 0!==e.rotate&&(n.rotate=e.rotate),e.scale&&(n.scale={value:e.scale}),e.origin&&(n.origin=e.origin),Object.keys(n).length?n:void 0}if(t.transform&&"object"==typeof t.transform&&!t.transform.keyframes){const e=t.transform.value,n=e&&"object"==typeof e?e:t.transform;if(n&&"object"==typeof n){const t={};return Array.isArray(n.translate)&&(t.translate=n.translate),"number"==typeof n.rotate&&(t.rotate=n.rotate),"number"==typeof n.skew&&(t.skew=n.skew),Array.isArray(n.scale)&&(t.scale={value:n.scale}),Array.isArray(n.origin)&&(t.origin=n.origin),Object.keys(t).length?t:void 0}}return}(t);e&&(a=Le(a,e,r))}const s=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||Ye(t))}(t);a=function(t,e,n,r,o){const i=r.idMap.get(n),a=r.maskAncestorChains.get(e)||[],s=o?He(e,r):void 0,l=s?[...a,s]:a,u=i&&r.maskAncestorChains.get(i)||[];if(!l.length&&!u.length)return t;const c=new Set;for(const t of l)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);for(const t of u)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);if(!(c.size>0)){const e=Ze(l),n=Ze(u),r=n[0]-e[0],o=n[1]-e[1];return 0===r&&0===o?t:{type:"g",transform:"translate("+r+","+o+")",children:[t]}}const f=Array.from(c).sort((t,e)=>t-e);return{type:"g",animate:{transform:{keyframes:f.map(t=>{const e=qe(l,t),n=qe(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,o,r,s);const l={type:"mask",id:i,children:[a]};return e.maskType&&(l.maskType=e.maskType),e.maskUnits&&(l.maskUnits=e.maskUnits),e.maskContentUnits&&(l.maskContentUnits=e.maskContentUnits),void 0!==e.x&&(l.x=String(e.x)),void 0!==e.y&&(l.y=String(e.y)),void 0!==e.width&&(l.width=String(e.width)),void 0!==e.height&&(l.height=String(e.height)),r.defs.push(l),t.mask="url(#"+i+")",t}function Le(t,e,n){if(!e)return t;const r=me(e.origin,n);let o=t;return o=We(o,"translate",e.translate,void 0,n),o=We(o,"rotate",e.rotate,r,n),o=We(o,"scale",e.scale,r,n),o}function We(t,e,n,r,o){if(void 0===n)return t;const i="scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n,a=de(i);if("static"===a.kind)return{type:"g",transform:{value:ce(e,_e(e,a.value),r)},children:[t]};if("animated"===a.kind){const n={keyframes:a.keyframes.map(t=>{const n=ne(t,ce(e,_e(e,t.value),r));return"translate"===e?At(At({},n),Xe(t)):n})};return void 0!==a.loop&&(n.loop=a.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function _e(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function Xe(t){var e,n;const r={},o=null!=(e=t.tangentOut)?e:t.to,i=null!=(n=t.tangentIn)?n:t.ti;return Array.isArray(o)&&(r.tangentOut=[-o[0],-o[1]]),Array.isArray(i)&&(r.tangentIn=[-i[0],-i[1]]),r}function Ye(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function Ze(t){let e=0,n=0;for(const r of t)r.translate&&(e+=r.translate[0],n+=r.translate[1]);return[e,n]}function qe(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=Je(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function Je(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function He(t,e){var n,r,o;const i=t.transform,a=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate.transform:void 0;if(void 0===i&&!a)return;const s={};if("string"==typeof i){const t=function(t,e){const n=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,i=0,a=!1,s=!1;for(;null!==(r=n.exec(t));){const t=r[1],e=r[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);"translate"===t?(o+=e[0]||0,i+=e[1]||0,a=!0):s=!0}s&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t);return a?[o,i]:void 0}(i,e);t&&(s.translate=t)}else if(i&&"object"==typeof i&&!i.keyframes){const t=i.value,n=t&&"object"==typeof t?t:i;n&&"object"==typeof n&&Array.isArray(n.translate)&&(s.translate=[n.translate[0]||0,n.translate[1]||0]),!n||void 0===n.rotate&&void 0===n.scale&&void 0===n.skew||e.warnings.push("maskedBy ancestor: non-translate transform parts ignored (rotate/scale not yet supported)")}if(a&&Array.isArray(a.keyframes)){const t=a.keyframes,i=[];for(const a of t){const t=null!=(n=a.value)?n:a.v,s=null!=(o=null!=(r=a.time)?r:a.t)?o:0;t&&"object"==typeof t&&Array.isArray(t.translate)&&(i.push({time:s,value:[t.translate[0]||0,t.translate[1]||0]}),void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: animated non-translate parts ignored"))}i.length&&(s.translateKeyframes=i)}return s.translate||s.translateKeyframes?s:void 0}function Qe(t,e,n){if(!e)return;const r=we(e.source);if(!r)return void(e.without===y.translate&&n.errors.push("clone: content ref missing `source`"));const o=e.without===y.translate&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function Ve(t,e){const n={};return void 0!==t.translate&&(n.translate=$e(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=$e(t.rotate,t=>t*e)),void 0!==t.skew&&(n.skew=$e(t.skew,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){const n=t=>[Math.pow(t[0],e),Math.pow(t[1],e)];return $e(t,n,!0)}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function $e(t,e,n=!1){const r=de(t);if("absent"===r.kind)return t;if("static"===r.kind){const o=e(r.value);return("number"==typeof t||Array.isArray(t))&&!n?o:{value:o}}const o={keyframes:r.keyframes.map(t=>t&&void 0!==t.value?bt(At({},t),{value:e(t.value)}):t)};return void 0!==r.loop&&(o.loop=r.loop),void 0!==r.autoOrient&&(o.autoOrient=r.autoOrient),void 0!==r.base&&(o.value=e(r.base)),o}function tn(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function en(t,e,n){const[r,o]=e;if(!Number.isFinite(r)||!Number.isFinite(o))return void n.warnings.push("retime: timeCrop is not a pair of finite numbers — ignored");const i=o<=r?[{time:0,value:0}]:[...r>0?[{time:Math.max(0,r-1),value:0}]:[],{time:Math.max(0,r),value:1},{time:o,value:1},{time:o+1,value:0}],a=At({},t);for(const e of Object.keys(t))delete t[e];t.type="g",t.children=[a],t.animate={opacity:{keyframes:i}}}function nn(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function rn(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function on(t){var e;const n=null==(e=t.effects)?void 0:e.clone;n&&(delete n.retime,0===Object.keys(n).length&&delete t.effects.clone,t.effects&&0===Object.keys(t.effects).length&&delete t.effects)}function an(t,e,n){const r=we(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=sn(r,e,n,new Set);o&&(t.href="#"+o)}function sn(t,e,n,r){if(r.has(t))return void n.errors.push('retime: loop via "'+t+'"');const o=n.idMap.get(t);if(!o)return void n.warnings.push('retime: target "'+t+'" not found');const i=Pt(o);if(ge(i,n),"use"===o.type?un(i,e.start,e.stretch):ln(i,e.start,e.stretch),on(i),"use"===o.type&&o.href){const a=we(o.href);if(a){const s=rn(o),l=s?nn(tn(s),e):e,u=new Set(r);u.add(t);const c=sn(a,l,n,u);c&&(i.href="#"+c)}}else!function(t,e,n,r,o){const i=t=>{var a;const s=rn(t);if("use"===t.type&&s&&t.href){const i=we(t.href);if(i){const a=nn(tn(s),e),l=new Set(r);l.add(o);const u=sn(i,a,n,l);u&&(t.href="#"+u)}on(t)}null==(a=t.children)||a.forEach(i)};i(t)}(i,e,n,r,t);return n.defs.push(i),"string"==typeof i.id&&n.idMap.set(i.id,i),"string"==typeof i.id?i.id:void 0}function ln(t,e,n){var r;un(t,e,n),null==(r=t.children)||r.forEach(t=>ln(t,e,n))}function un(t,e,n){const r=t=>{for(const r of t)"number"==typeof r.time&&(r.time=e+r.time*n)};if(t.transform&&"object"==typeof t.transform&&Array.isArray(t.transform.keyframes)&&r(t.transform.keyframes),t.animate&&"object"==typeof t.animate)for(const e of Object.keys(t.animate)){const n=t.animate[e];n&&Array.isArray(n.keyframes)&&r(n.keyframes)}}function cn(t,e,n){if(!e)return t;const r=e.subPaths===nt.combined,o=[],i=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const e of t.children)i(e);return}const e="string"==typeof t.d?t.d:function(t){var e,n,r,o,i,a,s,l,u,c;if("rect"===t.type){const i=Number(null!=(e=t.x)?e:0),a=Number(null!=(n=t.y)?n:0),s=Number(null!=(r=t.width)?r:0),l=Number(null!=(o=t.height)?o:0);return"M"+(i+s)+","+a+"L"+(i+s)+","+(a+l)+"L"+i+","+(a+l)+"L"+i+","+a+"L"+(i+s)+","+a+"z"}if("ellipse"===t.type||"circle"===t.type){const e=Number(null!=(i=t.cx)?i:0),n=Number(null!=(a=t.cy)?a:0),r="circle"===t.type?Number(null!=(s=t.r)?s:0):Number(null!=(l=t.rx)?l:0),o="circle"===t.type?Number(null!=(u=t.r)?u:0):Number(null!=(c=t.ry)?c:0);if(!(r>0&&o>0))return;const f=r*xn,d=o*xn,m=(t,e,n,r,o,i)=>"C"+t+","+e+" "+n+","+r+" "+o+","+i;return"M"+(e+r)+","+n+m(e+r,n+d,e+f,n+o,e,n+o)+m(e-f,n+o,e-r,n+d,e-r,n)+m(e-r,n-d,e-f,n-o,e,n-o)+m(e+f,n-o,e+r,n-d,e+r,n)+"z"}return}(t);if(void 0===e)return;const n=le(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){const e=On(t);r.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}o.push(r)};if(i(t),!o.length)return t;let a=0;const s=r?[...o].reverse():o;for(const t of s)for(const e of t.subpaths)r||(a=0),e.startOffsetPx=a,a+=e.lengthPx;const l=a;if(r&&l<.001)return t;const u=de(e.offset),c="absent"===u.kind?{kind:"static",value:0}:u,f=function(t){const e=de(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>({time:te(t),value:ee(t),easing:Qt(t)}));if(!n.some(t=>t.value[0]>t.value[1]))return{kind:"animated",keyframes:n.map(t=>({time:t.time,value:t.value,easing:t.easing}))};const r=[];for(let t=1;t<n.length;t++){const e=n[t-1],o=n[t];if((e.value[1]-e.value[0])*(o.value[1]-o.value[0])<0){const t=An(e,o);null!==t&&t>e.time&&t<o.time&&r.push(Math.round(t))}}const o=Array.from(new Set(r)).sort((t,e)=>t-e),i=[];let a=0;for(const t of n){for(;a<o.length&&o[a]<t.time;){const t=o[a++],e=wn(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}const e=t.value[0]>t.value[1]?[t.value[1],t.value[0]]:t.value;i.push({time:t.time,value:e,easing:t.easing})}for(;a<o.length;){const t=o[a++],e=wn(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:i}}(e.range),d="absent"===f.kind?{kind:"static",value:[0,1]}:f,m=function(t){if("absent"===t.kind)return[];if("static"===t.kind)return[t.value];const e=[];for(const n of t.keyframes){const t=ee(n);"number"==typeof t&&e.push(t)}return e}(c),v=[m.length?Math.min(...m):0,m.length?Math.max(...m):0];if(1===o.length&&o[0].leaf===t&&1===o[0].subpaths.length){const e=o[0],n=e.subpaths[0],i=r?l:n.lengthPx;if(i<.001)return t;const a=r?n.startOffsetPx/i:0;return function(t,e,n,r,o,i){const a=vn(n,e,r),s=hn(e,r),l=At({},t);return delete l.effects,yn(l,"strokeDasharray",pn(i,s)),yn(l,"strokeDashoffset",pn(o,a)),yn(l,"strokeOpacity",bn(i)),l}(e.leaf,i,a,v,c,d)}const h=new Map;for(const t of o){const e=[];for(const o of t.subpaths){const i=r?l:o.lengthPx;if(i<.001)continue;const a=r?o.startOffsetPx/i:0;e.push(...dn(t.leaf,o.subpath,i,a,v,c,d,n))}h.set(t.leaf,fn(t.leaf,e))}const g=t=>{const e=h.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?bt(At({},t),{children:t.children.map(g)}):t)};return g(t)}function fn(t,e){const n=bt(At({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function dn(t,e,n,r,o,i,a,s){const l=vn(r,n,o),u=hn(n,o),c=pn(i,l),f=pn(a,u),d=bn(a),m=function(t){return{type:"path",d:t}}(Ft(e));return yn(m,"strokeDasharray",f),yn(m,"strokeDashoffset",c),yn(m,"strokeOpacity",d),[m]}var mn=1;function vn(t,e,n){const[r]=gn(n);return n=>e*(-n-r+t)+mn}function hn(t,e){const[n,r]=gn(e),o=r-n+1;return e=>{const n=Ct(e[0],0,1),r=Ct(e[1],0,1),i=Math.min(n,r),a=Math.max(n,r),s=[0];let l=mn;for(let e=0;e<o;e++)s.push(l+i*t),s.push((a-i)*t),l=(1-a)*t;return s.push(l+mn),s}}function gn(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function pn(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>({time:te(t),value:e(ee(t)),easing:Qt(t)})),loop:t.loop}}function yn(t,e,n){n&&Me(t,e,n)}var kn=10;function bn(t){const e=t=>t[0]===t[1];if("absent"===t.kind)return;if("static"===t.kind)return e(t.value)?{kind:"static",value:0}:void 0;const n=t.keyframes;let r=!1,o=!0;for(const t of n)e(ee(t))?r=!0:o=!1;if(!r)return;if(o)return{kind:"static",value:0};const i=[];for(let t=0;t<n.length;t++){const r=n[t],o=t>0?n[t-1]:void 0,a=t<n.length-1?n[t+1]:void 0,s=te(r),l=e(ee(r)),u=o?l&&e(ee(o)):l,c=a?l&&e(ee(a)):l;u&&!c?(i.push({time:s,value:0}),i.push({time:s+kn,value:1})):!u&&c&&(i.push({time:s-kn,value:1}),i.push({time:s,value:0}))}return i.length<=1?void 0:{kind:"animated",keyframes:i}}function An(t,e){const n=n=>{const r=(n-t.time)/(e.time-t.time),o=t.value[0]+(e.value[0]-t.value[0])*r;return t.value[1]+(e.value[1]-t.value[1])*r-o};let r=t.time,o=e.time,i=n(r);if(0===i)return r;const a=n(o);if(0===a)return o;if(i*a>0)return null;for(let t=0;t<100;t++){const t=(r+o)/2,e=n(t);if(0===e||Math.abs(o-r)<1e-4)return t;i*e<0?o=t:(r=t,i=e)}return(r+o)/2}function wn(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function On(t){const e=t.v;if(!e||e.length<2)return 0;let n=0;for(let r=0;r<e.length-1;r++)n+=jn(t,r,r+1);return t.c&&e.length>1&&(n+=jn(t,e.length-1,0)),n}function jn(t,e,n){var r,o,i,a;const s=t.v,l=s[e],u=s[n],c=null!=(o=null==(r=t.o)?void 0:r[e])?o:l,f=null!=(a=null==(i=t.i)?void 0:i[n])?a:u,d=Mt(l,c,f,u);return d.ds[d.ds.length-1]}var xn=.5522847498307936;function Nn(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:ye(null==(e=Wt(t))?void 0:e.engine),glyphs:null==(n=Yt(t))?void 0:n.fonts},o=Pt(t);Zt(o,r.idMap),Pe(o,r,()=>Gt(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const a=we(null==(i=null==(o=t.effects)?void 0:o.maskedBy)?void 0:i.source);if("string"==typeof a){n.add(t);const r=e.idMap.get(a);r&&n.add(r)}if(Array.isArray(t.children))for(const e of t.children)r(e)};if(r(t),0===n.size)return;const o=(t,r)=>{if(n.has(t)&&e.maskAncestorChains.set(t,r),Array.isArray(t.children)){const n=He(t,e),i=n?[...r,n]:r;for(const e of t.children)o(e,i)}};o(t,[])}(o,r);const i=function(t,e){return function(t,e){e.idMap.clear(),Zt(t,e.idMap);const n=[],r=t=>{var e;rn(t)&&n.push(t),null==(e=t.children)||e.forEach(r)};r(t);const o=new Map;for(const t of n){let n=0;const r=new Set,i=o=>{var a;if(o){if(o!==t&&rn(o)&&n++,"use"===o.type&&o.href){const t=we(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(a=o.children)||a.forEach(i)}},a=we(t.href);a&&(r.add(a),i(e.idMap.get(a))),o.set(t,n)}n.sort((t,e)=>{var n,r;return(null!=(n=o.get(e))?n:0)-(null!=(r=o.get(t))?r:0)});for(const t of n){const n=rn(t);if(!n)continue;const r=n.timeCrop;on(t),an(t,tn(n),e),r&&en(t,r,e)}}(t,e),t}(Mn(o,r),r);return Ae(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function Mn(t,e){t.children&&(t.children=t.children.map(t=>Mn(t,e)));const n=t.effects,r="string"==typeof t.id?t.id:void 0,o=r?e.contentRefInnerIds.get(r):void 0;if(!n&&!o)return t;const{transformBy:i,repeater:a,maskedBy:s,clipPath:l,strokeTrim:u,clone:c,fillGradient:f,strokeGradient:d,textPath:m,text:v}=null!=n?n:{};n&&delete t.effects;let h=t,g=!1;if(null==v?void 0:v.useGlyphs)if(m){const t="string"==typeof m.pathData?m.pathData:void 0,n=wt(h,e,t,m.startOffset,m.textLength,m.pathOverflow);n&&(h=n,g=!0)}else h=Ot(h,v,e),g=!0;return g||(h=jt(h,m,e)),h=function(t,e,n){return Be(t,e,n,"fill")}(h,f,e),h=function(t,e,n){return Be(t,e,n,"stroke")}(h,d,e),h=cn(h,u,e),h=function(t,e,n){var r,o;if(!e)return t;const i=null!=(r=e.copies)?r:1;if(i<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const a=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=Pt(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate),delete l.id;const u=[l];for(let t=1;t<i;t++){const r=Pt(l),o=Ve(e,t),i=o?Fe(r,o,n):r;u.push(i)}const c={type:"g",children:u};return t.id&&(c.id=t.id),void 0!==a&&(c.transform=a),void 0!==s&&(c.animate={transform:s}),c}(h,a,e),h=Ge(h,s,i,e),h=function(t,e,n){if(!(null==e?void 0:e.pathData))return t;const r=Gt(n,"clip"),o={type:"path"},i=de(e.pathData);return"absent"!==i.kind&&("static"===i.kind?o.d=ze(i.value):(Me(o,"d",i),void 0!==o.d&&(o.d=ze(o.d)))),n.defs.push({type:"clipPath",id:r,children:[o]}),t.clipPath="url(#"+r+")",t}(h,l,e),o?(Qe(h,c,e),h=Re(h,i,r,o,e)):h=function(t,e,n,r){return Qe(t,e,r),Fe(t,n,r)}(h,c,i,e),(null==c?void 0:c.retime)&&(t.effects={clone:{retime:c.retime}}),r&&e.idMap.set(r,h),h}function Fn(t,e,n,r,o){const i=1-o,a=i*i*i,s=3*i*i*o,l=3*i*o*o,u=o*o*o;return[a*t[0]+s*e[0]+l*n[0]+u*r[0],a*t[1]+s*e[1]+l*n[1]+u*r[1]]}function Sn(t,e,n,r,o=64){let i=0,a=t;for(let s=1;s<=o;s++){const l=Fn(t,e,n,r,s/o);i+=Math.hypot(l[0]-a[0],l[1]-a[1]),a=l}return i}var Cn=t=>{const e=Math.round(1e4*t)/1e4;return Object.is(e,-0)?"0":String(e)};function Pn(e){const n=e=>{var r;let o=e;const i=e.animate,a=null==i?void 0:i.transform;if(a){const n=function(t){var e,n,r;if("offsetPath"!==t.alongPathMode)return;const o=t.keyframes;if(!o||o.length<2)return;const i=ee(o[0]),a=(null==i?void 0:i.origin)&&i.origin.length>=2?[i.origin[0],i.origin[1]]:[0,0],s=[];for(const t of o){const n=ee(t),r=null==n?void 0:n.translate;if(!r||r.length<2)return;if(Object.keys(n).some(t=>"translate"!==t&&"origin"!==t))return;const o=null!=(e=null==n?void 0:n.origin)?e:[0,0];if(o[0]!==a[0]||o[1]!==a[1])return;s.push([r[0]+a[0],r[1]+a[1]])}if(!o.some(t=>Vt(t)||$t(t)))return;let l="M"+Cn(s[0][0])+","+Cn(s[0][1]);const u=[];for(let t=0;t<s.length-1;t++){const e=s[t],i=s[t+1],a=null!=(n=$t(o[t]))?n:[0,0],c=null!=(r=Vt(o[t+1]))?r:[0,0],f=[e[0]+a[0],e[1]+a[1]],d=[i[0]+c[0],i[1]+c[1]];l+="C"+Cn(f[0])+","+Cn(f[1])+","+Cn(d[0])+","+Cn(d[1])+","+Cn(i[0])+","+Cn(i[1]),u.push(Sn(e,f,d,i))}const c=u.reduce((t,e)=>t+e,0);if(!(c>0))return;const f=[];let d=0;for(let t=0;t<o.length;t++){t>0&&(d+=u[t-1]);const e={t:te(o[t]),v:d/c},n=Qt(o[t]);void 0!==n&&(e.e=n),f.push(e)}return{pathStr:l,distanceKfs:f,autoOrient:!!t.autoOrient,anchor:a}}(a);if(n){const r=At({},i);delete r[yt];const s={keyframes:n.distanceKfs};void 0!==a.loop&&(s.loop=a.loop),r[t]=s;const l=e.transform;let u=l;if(l&&"object"==typeof l){const t=At({},l);delete t[kt.translate],delete t[kt.origin],u=Object.keys(t).length?t:void 0}o=bt(At({},e),{animate:r,style:bt(At({},e.style),{offsetPath:"path('"+n.pathStr+"')",offsetAnchor:Cn(n.anchor[0])+"px "+Cn(n.anchor[1])+"px",offsetRotate:n.autoOrient?"auto":"0deg",offsetDistance:"0%"})}),void 0!==u?o.transform=u:delete o.transform}}if(null==(r=o.children)?void 0:r.length){const t=o.children.map(n);t.some((t,e)=>t!==o.children[e])&&(o=bt(At({},o),{children:t}))}return o};return n(e)}function Rn(t){var e;const n=function(t){const e=new Map,n=t=>{var r;"string"==typeof t.id&&e.set(t.id,t),null==(r=t.children)||r.forEach(n)};return n(t),e}(t),r=function(t,e){const n=new WeakMap,r=new Set,o=(t,r)=>{const i=n.get(t);if(void 0!==i)return i;if(r.has(t))return!1;r.add(t);let a=!1;if(t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate))for(const e in t.animate){a=!0;break}if(!a&&t.children)for(const e of t.children)if(o(e,r)){a=!0;break}if(!a&&"use"===t.type&&"string"==typeof t.href){const n=Dn(t.href),i=n?e.get(n):void 0;i&&(a=o(i,r))}return r.delete(t),n.set(t,a),a};for(const[t,n]of e)o(n,new Set)&&r.add(t);return r}(0,n);if(0===r.size)return t;let o=0;const i=function(t){const e=Tn(t.viewBox);if(e)return[e[2],e[3]];const n=In(t.width),r=In(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),a=[],s=En(t,n,r,()=>"_lw_use_mat_"+ ++o,a,i);if(0===a.length)return s;const l={type:"defs",children:a},u=[...null!=(e=s.children)?e:[],l];return bt(At({},s),{children:u})}function In(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function Dn(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function Bn(t,e,n,r,o,i,a){var s,l,u,c;const f=Bt(e);he(f,o);const d="symbol"===f.type?Tn(f.viewBox):void 0,m=null!=(l=null!=(s=In(t.width))?s:null==d?void 0:d[2])?l:a[0],v=null!=(c=null!=(u=In(t.height))?u:null==d?void 0:d[3])?c:a[1],h="symbol"===f.type?function(t,e,n,r,o){const i=Tn(t.viewBox),a=bt(At({},t),{type:"g"});if(delete a.viewBox,delete a.preserveAspectRatio,delete a.width,delete a.height,!i)return a;const[s,l,u,c]=i,f=u>0&&c>0?Math.min(r/u,o/c):1,d=(r-u*f)/2,m=(o-c*f)/2,v=[];0===d&&0===m||v.push("translate("+d+","+m+")");1!==f&&v.push("scale("+f+")");0===s&&0===l||v.push("translate("+-s+","+-l+")");v.length&&(a.transform=v.join(""));const h=e();return n.push({type:"clipPath",id:h,children:[{type:"rect",x:s,y:l,width:u,height:c}]}),a.clipPath="url(#"+h+")",a}(f,o,i,m,v):f,g=En(h,n,r,o,i,a),p=bt(At({},t),{type:"g",children:[g]});return delete p.href,delete p.width,delete p.height,xt(p)}function Tn(t){if("string"!=typeof t)return;const e=t.trim().split(/[\s,]+/).map(Number);return e.length<4||e.some(t=>!Number.isFinite(t))?void 0:[e[0],e[1],e[2],e[3]]}function En(t,e,n,r,o,i){if("use"===t.type&&"string"==typeof t.href){const a=Dn(t.href);if(a&&n.has(a)){const s=e.get(a);if(s)return Bn(t,s,e,n,r,o,i)}}if(!t.children)return t;let a=!1;const s=t.children.map(t=>{const s=En(t,e,n,r,o,i);return s!==t&&(a=!0),s});return a?bt(At({},t),{children:s}):t}function Un(t,n,r){var o,i;let a=Nn(t).root;a=Pn(a);const s=null!=(i=null==(o=Wt(a))?void 0:o.duration)?i:e;return a=re(a,s),n===lt.native&&(a=oe(a,null==r?void 0:r.motionPath),a=Rn(a),a=function(t){const e=t=>t.startsWith("#")?t.slice(1):t,n=(t,e)=>{var r;e(t),null==(r=t.children)||r.forEach(t=>n(t,e))};let r=!0;for(;r;){r=!1;const o=new Set;n(t,t=>{"use"===t.type&&"string"==typeof t.href&&o.add(e(t.href))}),n(t,t=>{if(!t.children)return;let e=t.children;"defs"===t.type&&(e=e.filter(t=>!(("g"===t.type||"symbol"===t.type)&&"string"==typeof t.id&&!o.has(t.id)))),e=e.filter(t=>!("defs"===t.type&&(!t.children||0===t.children.length))),e.length!==t.children.length&&(t.children=e,r=!0)})}return t}(a)),a}var Kn="setPlaybackRate: rate must be finite and non-zero";function zn(t){return Number.isFinite(t)&&0!==t}function Gn(t,e){return t>0?e===1/0?1/0:t*(e>0?e:1):0}function Ln(t,e){return t>0?e===1/0?t:t*(e>0?e:1):0}function Wn(t,e){return Number.isNaN(t)||t<0?0:Number.isFinite(e)?t>e?e:t:Number.isFinite(t)?t:0}function _n(t,e,n){const r=Ln(e,n);return r>0&&Number.isFinite(t)?t<=0?0:n===1/0?t%r/r:t>=r?1:t/r:0}function Xn(t,e,n){const r=Ln(e,n);return r>0&&Number.isFinite(t)?t<=0?0:t>=1?r:t*r:0}function Yn(t,e=Date.now){let n=0,r=0,o=!1,i=1;const a=()=>Wn(o?n+(e()-r)*i:n,t);return{now:a,isRunning:()=>o,start:(s,l)=>{n=Wn(null!=l?l:a(),t),i=zn(s)?s:1,r=e(),o=!0},stop:()=>{n=a(),r=0,o=!1},seek:i=>{n=Wn(i,t),o&&(r=e())}}}function Zn(t){const e=globalThis;"function"!=typeof e.cancelAnimationFrame?e.clearTimeout(t):e.cancelAnimationFrame(t)}function qn(t,n,r){var o;const i=Wt(t)||{},a=se(t,lt.js),s=i.iterations;let l=1;"number"==typeof s&&(l=s||1),"infinite"===s&&(l=1/0),l<1&&(l=1);const u=+(i.duration||e),c=u&&l?u*(l===1/0?1/0:l):u?(null!=l?l:1)*u:0,f=i.direction||"normal",d=null!=(o=i.fill)?o:"forwards",m="forwards"===d||"both"===d,v="backwards"===d||"both"===d;let h=null,g=!1,p=-(i.delay||0),y=0,k=1,b=!1;const A=i.frameRate,w=A&&A>0?1e3/A:0;let O=0;const j=()=>{const t=y?(Date.now()-y)*k:0;return p+t},x=()=>{let t=j();return Number.isFinite(c)&&t>c&&(t=c),t<0&&(t=0),t};function N(t){let e=function(){const e=u>0?u:1;let n=0,r=0;if(u>0){t=Ct(t,0,l*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,l-1);n=Ct((t-r*e)/e,0,1)}else n=t;const o=f||"normal";let i=n;return"reverse"===o?i=1-n:"alternate"===o?r%2==1&&(i=1-n):"alternate-reverse"===o&&r%2==0&&(i=1-n),i}();for(const t of a||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=St(r,e*u);for(const[e,r]of Object.entries(o))n.setAttribute(t.id,e,r)}}i.delay&&(i.delay<0?N(x()):v&&N(0));const M=()=>!!g&&(!!n.isConnected()&&(k<0?j()>0:!(Number.isFinite(c)&&x()>=c))),F=t=>{null!==h&&(Zn(h),h=null),(t||M())&&(h=function(t){const e=globalThis;return"function"==typeof e.requestAnimationFrame?e.requestAnimationFrame(t):e.setTimeout(t,16)}(()=>{h=null,(()=>{var t,e;if(!n.isConnected())return void S();const o=x(),i=j();if(i<0&&k>0)v&&N(0);else{if(k<0&&i<=0)return S(),N(0),void(b||(b=!0,null==(t=null==r?void 0:r.onFinish)||t.call(r)));if(k>0&&c&&Number.isFinite(c)&&o>=c)return S(),N(m?c:0),void(b||(b=!0,null==(e=null==r?void 0:r.onFinish)||e.call(r)));if(w>0){const t=Date.now();if(O&&t-O<w)return;O=t}N(o)}})(),F()}))},S=()=>{if(!g)return;let t=j();Number.isFinite(c)&&t>c&&(t=c),p=t,y=0,g=!1,null!==h&&(Zn(h),h=null),t>=0?N(t):v&&N(0)},C={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>M(),play:()=>{var t;(()=>{if(!g){if(k>=0)Number.isFinite(c)&&p>=c&&(p=0);else if(p<=0){if(!Number.isFinite(c))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");p=c}b=!1,g=!0,y=Date.now(),F(!0)}})(),null==(t=null==r?void 0:r.onPlay)||t.call(r)},pause:()=>{var t;S(),null==(t=null==r?void 0:r.onPause)||t.call(r)},cancel:()=>{var t;S(),p=0,y=0,g=!1,b=!1,N(p),null==(t=null==r?void 0:r.onCancel)||t.call(r)},finish:()=>{((t=!0)=>{var e;p=Number.isFinite(c)?c:x(),y=0,g=!1,null!==h&&(Zn(h),h=null),N(m?p:0),t&&!b&&(b=!0,null==(e=null==r?void 0:r.onFinish)||e.call(r))})(!0)},setPlaybackRate:t=>{if(!zn(t))return void console.warn(Kn);let e=j();Number.isFinite(c)&&e>c&&(e=c),t<0!=k<0&&(b=!1),k=t,p=e,g&&(y=Date.now())},getCurrentTime:()=>x(),setCurrentTime:t=>{t=Wn(t,c),p=t,g&&(y=Date.now()),(!Number.isFinite(c)||t<c)&&(b=!1),N(x())},getCurrentProgress:()=>_n(x(),u,l),setCurrentProgress:t=>{C.setCurrentTime(Xn(t,u,l))},destroy:()=>{var t;C.cancel(),null==(t=null==r?void 0:r.onRemove)||t.call(r)}};return C}var Jn=(t=>(t[t.buildFailed=1001]="buildFailed",t[t.invalidDocumentAtSrc=1002]="invalidDocumentAtSrc",t[t.loadFailed=1003]="loadFailed",t[t.animationBuildFailed=1004]="animationBuildFailed",t[t.effectsShape=1101]="effectsShape",t[t.timelineOverrideIgnored=1102]="timelineOverrideIgnored",t[t.blockedTag=1103]="blockedTag",t[t.unsupportedAnimatedAttrs=1104]="unsupportedAnimatedAttrs",t[t.noBindings=1105]="noBindings",t[t.unresolvedBinding=1106]="unresolvedBinding",t[t.triggersNoRoot=1201]="triggersNoRoot",t[t.noRootForSelector=1202]="noRootForSelector",t[t.noRootElement=1203]="noRootElement",t[t.noElementsForSelector=1206]="noElementsForSelector",t[t.setAttributeNoElement=1207]="setAttributeNoElement",t[t.scrollSmoothingNeedsOwnDriver=1301]="scrollSmoothingNeedsOwnDriver",t[t.scrollNativeUnavailable=1302]="scrollNativeUnavailable",t[t.scrollSubjectInvalid=1303]="scrollSubjectInvalid",t[t.scrollSubjectNoMatch=1304]="scrollSubjectNoMatch",t[t.scrollNoRootToObserve=1305]="scrollNoRootToObserve",t[t.scrollTriggerIgnored=1306]="scrollTriggerIgnored",t[t.rateRejected=1401]="rateRejected",t[t.controlPropsConflict=1501]="controlPropsConflict",t[t.rnCompileFailed=1601]="rnCompileFailed",t[t.rnRenderFailed=1602]="rnRenderFailed",t[t.rnBoundaryCaught=1603]="rnBoundaryCaught",t[t.rnUnsupported=1604]="rnUnsupported",t))(Jn||{}),Hn=["timelineSource","scroll","trigger","delay","iterations","direction","fill","resetOnFinish","duration","mode","frameRate"],Qn=["definitions","bindings"],Vn=t=>!!t&&"object"==typeof t&&!Array.isArray(t);function $n(t,e){const n=Vn(t)?At({},t):{};for(const t of Object.keys(e)){const r=e[t];null!==r?Vn(r)?n[t]=$n(n[t],r):n[t]=r:delete n[t]}return n}function tr(t,e,o){const i=Vn(a=t)&&"string"==typeof a.type?a.type:"time";var a;const s=Vn(e)&&"string"==typeof e.type?String(e.type):i;let l;if(s!==i){const r={};if(Vn(t))for(const e of n)void 0!==t[e]&&(r[e]=t[e]);l=$n(r,e)}else l=$n(t,e);if("scroll"===(u=s)||"view"===u){for(const t of r)void 0!==l[t]&&(o("animator.timeline."+t+": no slot on a '"+s+"' timeline — dropped"),delete l[t]);"infinite"===l.iterations&&(o("animator.timeline.iterations: 'infinite' cannot map onto a scroll range — dropped"),delete l.iterations)}var u;return l}function er(t,e){let n;if("string"==typeof t)try{n=JSON.parse(t)}catch(t){console.warn("timeline override: not valid JSON — ignored",t),n=void 0}else n=null!=t?t:void 0;const{duration:r,delay:o,iterations:i,startOn:a}=e;if(void 0===r&&void 0===o&&void 0===i&&void 0===a)return void 0===n?void 0:{timeline:n};const s=Vn(n)?At({},n):{};return void 0!==r&&(s.duration=r),void 0!==o&&(s.delay=o),void 0!==i&&(s.iterations=i),void 0!==a&&(s.trigger=bt(At({},s.trigger),{startOn:a})),{timeline:s}}function nr(t,e){const n=[],r=t=>n.push(t);if(null===e)return{config:void 0,warnings:n};if(!Vn(e)||0===Object.keys(e).length)return{config:t,warnings:n};const o=Vn(t)?Hn.filter(e=>void 0!==t[e]):[];o.length&&r("animator: the base carries the flat runtime spelling ("+o.join(", ")+"); the patch merges the wire spelling only");const i=Vn(t)?At({},t):{};for(const t of Object.keys(e)){const n=e[t];null!==n?"timeline"!==t?Vn(n)?i[t]=$n(i[t],n):i[t]=n:i.timeline=Vn(n)?tr(i.timeline,n,r):n:delete i[t]}return{config:i,warnings:n}}function rr(t,e,n){var r,o;const i=!!(null==n?void 0:n.resetTimeline);if(!(t&&void 0!==e&&(i||null!==e&&Vn(e)&&Object.keys(e).length)))return{doc:t,warnings:[]};const a=t,s=Vn(a.animator),l=!s&&Vn(null==(r=a.meta)?void 0:r.animator),u=s?a.animator:l?a.meta.animator:void 0,c=[];s&&Vn(null==(o=a.meta)?void 0:o.animator)&&c.push("animator: doc.meta.animator is shadowed by doc.animator and was not patched");let f=u;if(i){const t={};for(const e of Qn)Vn(u)&&void 0!==u[e]&&(t[e]=u[e]);f=t}const d=nr(f,null!=e?e:{});return c.push(...d.warnings),d.config===u?{doc:t,warnings:c}:l?{doc:bt(At({},a),{meta:bt(At({},a.meta),{animator:d.config})}),warnings:c}:{doc:bt(At({},a),{animator:d.config}),warnings:c}}export{Kn as PX_RATE_REJECTED,o as PX_TRANSFORM_PART_KEYS,i as PX_TRIGGER_DEFAULTS,a as PX_WIRE_BASELINE_VERSION,s as PX_WIRE_SCHEMA_VERSION,l as PX_WIRE_STEPS,u as PX_WIRE_VERSION,c as PX_WIRE_VERSION_KEY,f as PxAlongPathMode,d as PxAnimatedSvgDocumentSchema,m as PxAnimatorConfigSchema,v as PxAttrValueSchema,h as PxBezierPathSchema,g as PxClipPathEffectSchema,p as PxCloneEffectSchema,y as PxCloneWithout,k as PxControlMode,b as PxDefinitionsSchema,Jn as PxDiagnosticCode,A as PxDiagnosticKind,w as PxEffectsSchema,O as PxElementAnimationSchema,j as PxFillGradientEffectSchema,x as PxFillMode,N as PxFinishAction,M as PxGradientSpreadMethod,F as PxGradientStopSchema,S as PxGradientType,C as PxKeyframeSchema,P as PxKeyframeValueSchema,R as PxLengthAdjust,I as PxLoopDirection,D as PxLoopRepeatAt,B as PxLoopSchema,T as PxMaskType,E as PxMaskedByEffectSchema,U as PxNodeBaseSchema,K as PxNodeSchema,z as PxOutAction,G as PxPathOverflow,L as PxPinAlign,W as PxPlaybackDirection,_ as PxPropertyAnimationSchema,X as PxRepeaterEffectSchema,Y as PxRetimeEffectSchema,Z as PxScrollAxis,q as PxScrollKind,J as PxScrollPhase,H as PxScrollRangePointSchema,Q as PxScrollRangeSchema,V as PxScrollSchema,$ as PxScrollSource,tt as PxStartOn,et as PxStrokeTrimEffectSchema,nt as PxStrokeTrimSubPaths,rt as PxSvgNodeRootSchema,ot as PxTextEffectSchema,it as PxTextPathEffectSchema,at as PxTextPathMethod,st as PxTextPathSpacing,lt as PxTimelineEngine,ut as PxTimelineEngineSetting,ct as PxTimelineSchema,ft as PxTransformByEffectSchema,dt as PxTransformPartsSchema,mt as PxTransformValueSchema,vt as PxTriggerSchema,ht as PxUnits,gt as PxWireStepKind,pt as PxWireVersionRelation,rr as applyAnimatorConfig,Nt as applyWireSteps,St as calcAnimationValues,Wn as clampSeekMs,Rt as compareWireVersion,It as controlModeTakesOverTrigger,Dt as convertWireDocument,qn as createAdapterAnimator,Yn as createRunClock,Tt as describeSchema,Et as diagnoseDocument,Ut as downgradeWireDocument,Kt as flattenAnimatorTimeline,er as foldTimelineOverride,zt as formatWireVersion,Lt as generateNewIds,Wt as getAnimatorConfig,_t as getBindings,Xt as getChildren,Yt as getDefinitions,qt as isNativeForced,Jt as isPxDocument,zn as isValidPlaybackRate,Ht as isValidPxDocument,Un as materializeAllInTree,Nn as materializeNodeEffects,ie as mayUseNativeScrollTimeline,nr as mergeAnimatorConfig,ae as nestAnimatorTimeline,se as normalizeBindings,ue as parseWireVersion,Ln as progressSpanMs,Xn as progressToTimeMs,fe as px,ve as readWireVersion,pe as resolveControlMode,ye as resolveTimelineEngine,ke as resolveTrigger,be as schemaKeys,Gn as seekCeilingMs,_n as timeToProgress,Oe as toDomProps,je as validateDocument,xe as validateNodeEffects,Ne as wireVersionAdvice};
|
|
1
|
+
import{OFFSET_DISTANCE_ATTR as t,PX_DEFAULT_DURATION_MS as e,PX_TIMELINE_SHARED_KEYS as n,PX_TIME_ONLY_TIMELINE_KEYS as r,PX_TRANSFORM_PART_KEYS as o,PX_TRIGGER_DEFAULTS as i,PX_WIRE_BASELINE_VERSION as a,PX_WIRE_SCHEMA_VERSION as s,PX_WIRE_STEPS as l,PX_WIRE_VERSION as u,PX_WIRE_VERSION_KEY as c,PxAlongPathMode as f,PxAnimatedSvgDocumentSchema as d,PxAnimatorConfigSchema as m,PxAttrValueSchema as v,PxBezierPathSchema as h,PxClipPathEffectSchema as g,PxCloneEffectSchema as p,PxCloneWithout as y,PxControlMode as k,PxDefinitionsSchema as b,PxDiagnosticKind as A,PxEffectsSchema as w,PxElementAnimationSchema as j,PxFillGradientEffectSchema as O,PxFillMode as x,PxFinishAction as N,PxGradientSpreadMethod as M,PxGradientStopSchema as F,PxGradientType as S,PxKeyframeSchema as C,PxKeyframeValueSchema as P,PxLengthAdjust as R,PxLoopDirection as I,PxLoopRepeatAt as D,PxLoopSchema as B,PxMaskType as T,PxMaskedByEffectSchema as E,PxMouseOutAction as U,PxNodeBaseSchema as K,PxNodeSchema as z,PxOffScreenAction as G,PxPathOverflow as L,PxPinAlign as W,PxPlaybackDirection as Y,PxPropertyAnimationSchema as _,PxRepeaterEffectSchema as X,PxRetimeEffectSchema as q,PxScrollAxis as J,PxScrollKind as Z,PxScrollPhase as H,PxScrollRangePointSchema as Q,PxScrollRangeSchema as V,PxScrollSchema as $,PxScrollSource as tt,PxStrokeTrimEffectSchema as et,PxStrokeTrimSubPaths as nt,PxSvgNodeRootSchema as rt,PxTextEffectSchema as ot,PxTextPathEffectSchema as it,PxTextPathMethod as at,PxTextPathSpacing as st,PxTimelineEngine as lt,PxTimelineEngineSetting as ut,PxTimelineSchema as ct,PxTransformByEffectSchema as ft,PxTransformPartsSchema as dt,PxTransformValueSchema as mt,PxTriggerSchema as vt,PxTriggerStart as ht,PxUnits as gt,PxWireStepKind as pt,PxWireVersionRelation as yt,TRANSFORM_ATTR as kt,TRANSFORM_PART as bt,__spreadProps as At,__spreadValues as wt,applyTextGlyphsAlongPath as jt,applyTextGlyphsEffect as Ot,applyTextPathEffect as xt,applyUseOffsetToG as Nt,applyWireSteps as Mt,bezier2D_arcLengthLUT as Ft,bezierToSvgPath as St,calcAnimationValues as Ct,clamp as Pt,clone as Rt,compareWireVersion as It,controlModeTakesOverTrigger as Dt,convertWireDocument as Bt,deepClonePxNode as Tt,describeSchema as Et,diagnoseDocument as Ut,downgradeWireDocument as Kt,flattenAnimatorTimeline as zt,formatWireVersion as Gt,genId as Lt,generateNewIds as Wt,getAnimatorConfig as Yt,getBindings as _t,getChildren as Xt,getDefinitions as qt,indexById as Jt,isNativeForced as Zt,isPxDocument as Ht,isValidPxDocument as Qt,keyframeEasing as Vt,keyframeTangentIn as $t,keyframeTangentOut as te,keyframeTime as ee,keyframeValue as ne,keyframeWith as re,materializeInternalLoopsInTree as oe,materializeMotionPathsInTree as ie,mayUseNativeScrollTimeline as ae,nestAnimatorTimeline as se,normalizeBindings as le,parseSvgPathToBezier as ue,parseWireVersion as ce,partsRecord as fe,px as de,readAnimatable as me,readStaticOrigin as ve,readWireVersion as he,regenerateIdsAndRewriteRefs as ge,regenerateIdsInClone as pe,resolveControlMode as ye,resolveTimelineEngine as ke,resolveTrigger as be,schemaKeys as Ae,spliceDefs as we,stripHash as je,toDomProps as Oe,validateDocument as xe,validateNodeEffects as Ne,wireVersionAdvice as Me,writeAnimatableChannel as Fe}from"./chunk-YWBPS6E4.min.js";function Se(t,e,n){if(!e)return t;delete t.transform;let r=t;return r=Pe(r,e.origin,!0),r=Ce(r,"scale",e.scale,n),r=Ce(r,"skew",e.skew,n),r=Ce(r,"rotate",e.rotate,n),r=Pe(r,e.origin,!1),!function(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}(e.translate)?r=Ce(r,"translate",e.translate,n):(r=Pe(r,e.origin,!0),r=Ce(r,"translate",e.translate,n),r=Pe(r,e.origin,!1)),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function Ce(t,e,n,r){if(void 0===n)return t;const o=me(n);if("static"===o.kind)return{type:"g",transform:{value:fe(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>re(t,fe(e,t.value,void 0)))};return o.autoOrient&&(n.autoOrient=!0),void 0!==o.loop&&(n.loop=o.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function Pe(t,e,n){if(void 0===e)return t;const r=me(e),o=t=>n?[-t[0],-t[1]]:t;if("absent"===r.kind)return t;if("static"===r.kind)return 0===r.value[0]&&0===r.value[1]?t:{type:"g",transform:{value:{translate:o(r.value)}},children:[t]};if("animated"===r.kind){const e={keyframes:r.keyframes.map(t=>re(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function Re(t,e,n){var r,o,i;if("use"===t.type&&"translate"===(null==(o=null==(r=t.effects)?void 0:r.clone)?void 0:o.without)){const r=je(t.effects.clone.source);"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(i=t.children)||i.forEach(t=>Re(t,e,n))}function Ie(t,e,n,r,o){const i=function(t,e){var n,r,o;const i={};let a=!1;const s=null==(n=t.animate)?void 0:n.transform;if(s&&"object"==typeof s&&Array.isArray(s.keyframes)){const e=s.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=Be(s),r={keyframes:e.map(t=>{const e=t.value||{},r={};void 0!==e.translate&&(r.translate=e.translate),n&&void 0!==e.origin&&(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),void 0!==t.tangentOut&&(o.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(o.tangentIn=t.tangentIn),o})};s.autoOrient&&(r.autoOrient=!0);const o=s.loop;void 0!==o&&(r.loop=o),i.animate={transform:r};const l=e.some(t=>{const e=t.value||{};return void 0!==e.rotate||void 0!==e.scale}),u=e.map(t=>{const e=t.value||{},r={};void 0!==e.rotate&&(r.rotate=e.rotate),void 0!==e.scale&&(r.scale=e.scale),void 0===e.origin||n&&!l||(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),o});if(u.every(t=>0===Object.keys(t.value).length))delete t.animate.transform,t.animate&&0===Object.keys(t.animate).length&&delete t.animate;else{const e={keyframes:u};void 0!==o&&(e.loop=o),t.animate.transform=e}a=!0}}const l=void 0!==(null==e?void 0:e.translate),u=a||l,c=a&&Be((null==(r=t.animate)?void 0:r.transform)||void 0)||a&&Be((null==(o=i.animate)?void 0:o.transform)||void 0);if("string"==typeof t.transform){const e=function(t){const e=[],n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);)e.push({name:r[1],full:r[0]});if(!e.length)return{rest:t||void 0};if(e.every(t=>"translate"===t.name))return{translate:e.map(t=>t.full).join("")};const o=e[0],i=e[e.length-1];if("translate"===i.name&&"translate"===o.name){const n=De(i.full),r=De(o.full),a=-n[0],s=-n[1],l=r[0]-a,u=r[1]-s;if(0===l&&0===u)return{rest:t};return{translate:"translate("+l+","+u+")",rest:"translate("+a+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===i.name)return{rest:t};const a=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)a.push(e[s].full),s++;if(!a.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:a.join(""),rest:l||void 0}}(t.transform);u?void 0!==e.translate?e.rest?t.transform=e.rest:delete t.transform:!function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,n=[];let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(1!==n.length)return!1;if("translate"===n[0].name)return!0;if("matrix"!==n[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(n[0].full);if(!o)return!1;const i=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return i.length>=4&&1===i[0]&&0===i[1]&&0===i[2]&&1===i[3]}(t.transform)?c&&function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let n,r=0,o=!1;for(;n=e.exec(t);)r++,"matrix"===n[1]&&(o=!0);return 1===r&&o}(t.transform)&&delete t.transform:delete t.transform:e.translate&&(i.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}else if(t.transform&&"object"==typeof t.transform&&!Array.isArray(t.transform)&&!t.transform.keyframes){const e=t.transform.value,n=!(!e||"object"!=typeof e),r=n?e:t.transform,o=t=>n?{value:t}:t;if(Array.isArray(r.translate)){const e=wt({},r);delete e.translate;const n=Object.keys(e).length>0;u||(i.transform=o({translate:r.translate})),n?t.transform=o(e):delete t.transform}}return i}(t,e);"string"==typeof t.id&&delete t.id;const{outer:a,inner:s}=function(t){if(!t)return{};const e=Be(t.translate),n=void 0!==t.rotate||void 0!==t.scale,r={},o={};void 0!==t.translate&&(r.translate=t.translate);e&&void 0!==t.origin&&(r.origin=t.origin);void 0!==t.rotate&&(o.rotate=t.rotate);void 0!==t.scale&&(o.scale=t.scale);void 0!==t.skew&&(o.skew=t.skew);void 0===t.origin||e&&!n||(o.origin=t.origin);return{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(e);let l=t;l=Se(l,s,o);let u={type:"g",id:n,children:[{type:"g",id:r,children:[l]}]};return void 0!==i.transform&&(u.transform=i.transform),void 0!==i.animate&&(u.animate=i.animate),a&&(delete u.id,u=Se(u,a,o),u.id=n),u}function De(t){const e=/translate\(([^)]*)\)/.exec(t);if(!e)return[0,0];const n=e[1].split(/[\s,]+/).filter(Boolean).map(Number);return[n[0]||0,n[1]||0]}function Be(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||!!Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}function Te(t,e,n,r){if(!e)return t;const o=Lt(n,"grad"),i=function(t,e){const n={type:t.type===S.radial?"radialGradient":"linearGradient",id:e};t.type===S.linear?(Ee(n,"x1","y1",t.start),Ee(n,"x2","y2",t.end)):(Ee(n,"cx","cy",t.center),function(t,e,n){const r=me(n);if("absent"===r.kind)return;Fe(t,e,r,{asString:!0})}(n,"r",t.radius),Ee(n,"fx","fy",t.focal));t.gradientUnits&&(n.gradientUnits=t.gradientUnits);t.spreadMethod&&(n.spreadMethod=t.spreadMethod);t.gradientTransform&&(n.gradientTransform=t.gradientTransform);return n.children=function(t){var e,n;if(!t)return[];const r=me(t);if("absent"===r.kind)return[];if("static"===r.kind)return Array.isArray(r.value)?r.value.map(Ue):[];const o=r.keyframes;if(!o.length)return[];const i=r.loop;let a=0;for(const t of o){const e=ne(t);Array.isArray(e)&&e.length>a&&(a=e.length)}if(!a)return[];const s=ne(o[0]),l=[];for(let t=0;t<a;t++){const r=null!=(n=null!=(e=null==s?void 0:s[t])?e:Ke(o,0,t))?n:{offset:t/Math.max(1,a-1),color:"#000000"};l.push({offset:r.offset,color:r.color})}return l.map((t,e)=>function(t,e,n,r,o){var i;const a=[],s=[];let l=!1;for(const r of e){const o=ee(r),u=ne(r),c=null!=(i=null==u?void 0:u[n])?i:Ke(e,e.indexOf(r),n);if(!c)continue;const f=Vt(r),d={time:o,value:c.color};void 0!==f&&(d.easing=f),a.push(d);const m={time:o,value:c.offset};void 0!==f&&(m.easing=f),s.push(m),c.offset!==t.offset&&(l=!0)}const u={type:"stop",offset:ze(t.offset),stopColor:t.color},c={};a.length&&(c.stopColor={keyframes:a},void 0!==o&&(c.stopColor.loop=o));l&&s.length&&(c.offset={keyframes:s},void 0!==o&&(c.offset.loop=o));Object.keys(c).length&&(u.animate=c);return u}(t,o,e,0,i))}(t.stops),n}(e,o);return n.defs.push(i),t[r]="url(#"+o+")",t}function Ee(t,e,n,r){var o,i,a;const s=me(r);if("absent"===s.kind)return;if("static"===s.kind)return t[e]=String(s.value[0]),void(t[n]=String(s.value[1]));const l=t=>{const e={keyframes:s.keyframes.map(e=>{const n={time:e.time,value:Array.isArray(e.value)?e.value[t]:void 0};return void 0!==e.easing&&(n.easing=e.easing),n})};return void 0!==s.loop&&(e.loop=s.loop),e},u=null!=(o=t.animate)?o:{};u[e]=l(0),u[n]=l(1),t.animate=u;const c=null!=(a=s.base)?a:null==(i=s.keyframes[0])?void 0:i.value;Array.isArray(c)&&(t[e]=String(c[0]),t[n]=String(c[1]))}function Ue(t){return{type:"stop",offset:ze(t.offset),stopColor:t.color}}function Ke(t,e,n){for(let r=e;r>=0;r--){const e=ne(t[r]);if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=ne(t[r]);if(null==e?void 0:e[n])return e[n]}}function ze(t){return Math.round(1e3*t)/10+"%"}function Ge(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.pathData?t.pathData:void 0}function Le(t,e,n,r){if(!e)return t;const o=je(e.source);if(!o)return r.errors.push("maskedBy.source missing — cannot build mask"),t;const i=Lt(r,"mask");let a={type:"use",href:"#"+o};if(n)a=We(a,n,r);else if(qe(t))a=function(t,e){var n;const r=e.animate&&"object"==typeof e.animate&&!Array.isArray(e.animate)?e.animate:void 0,o=null==r?void 0:r.transform,i=o&&"object"==typeof o&&Array.isArray(o.keyframes)?o.keyframes:void 0;if(!i||!i.length)return t;const a=[],s=[],l=[];for(const t of i){const e=(null!=(n=t.value)?n:t.v)||{},r=re(t,void 0);if(Array.isArray(e.translate)&&a.push(At(wt(wt({},r),Xe(t)),{value:{translate:[-e.translate[0],-e.translate[1]]}})),"number"==typeof e.rotate){const t={rotate:-e.rotate};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),s.push(At(wt({},r),{value:t}))}if(Array.isArray(e.scale)){const t={scale:[1/e.scale[0],1/e.scale[1]]};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),l.push(At(wt({},r),{value:t}))}}const u=null==o?void 0:o.loop,c=t=>{const e={keyframes:t};return void 0!==u&&(e.loop=u),e};let f=t;a.length&&(f={type:"g",animate:{transform:c(a)},children:[f]});s.length&&(f={type:"g",animate:{transform:c(s)},children:[f]});l.length&&(f={type:"g",animate:{transform:c(l)},children:[f]});return f}(a,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,i,a,s,l,u,c,f,d,m;const v=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let h;const g=[];for(;null!==(h=v.exec(t));){const t=h[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);g.push({name:h[1],args:t})}if(!g.length)return;const p=g[g.length-1];if("translate"===p.name)for(let t=g.length-2;t>=0;t--){const c=g[t];if("translate"!==c.name)continue;const f=null!=(e=c.args[0])?e:0,d=null!=(n=c.args[1])?n:0,m=null!=(r=p.args[0])?r:0,v=null!=(o=p.args[1])?o:0;if(m!==-f||v!==-d)continue;const h={};h.origin=[f,d];for(let e=0;e<t;e++)if("translate"===g[e].name){const t=null!=(i=g[e].args[0])?i:0,n=null!=(a=g[e].args[1])?a:0;h.translate=h.translate?[h.translate[0]+t,h.translate[1]+n]:[t,n]}for(let e=t+1;e<g.length-1;e++){const t=g[e];if("rotate"===t.name)h.rotate=(null!=(s=h.rotate)?s:0)+(null!=(l=t.args[0])?l:0);else if("scale"===t.name){const e=null!=(u=t.args[0])?u:1,n=t.args.length>1?t.args[1]:e;h.scale=h.scale?[h.scale[0]*e,h.scale[1]*n]:[e,n]}}return h}let y,k,b;for(const t of g)if("translate"===t.name){const e=null!=(c=t.args[0])?c:0,n=null!=(f=t.args[1])?f:0;y=y?[y[0]+e,y[1]+n]:[e,n]}else if("rotate"===t.name)k=(null!=k?k:0)+(null!=(d=t.args[0])?d:0);else if("scale"===t.name){const e=null!=(m=t.args[0])?m:1,n=t.args.length>1?t.args[1]:e;b=b?[b[0]*e,b[1]*n]:[e,n]}const A={};y&&(A.translate=y);void 0!==k&&(A.rotate=k);b&&(A.scale=b);return Object.keys(A).length?A:void 0}(t.transform);if(!e)return;const n={};return e.translate&&(n.translate=e.translate),void 0!==e.rotate&&(n.rotate=e.rotate),e.scale&&(n.scale={value:e.scale}),e.origin&&(n.origin=e.origin),Object.keys(n).length?n:void 0}if(t.transform&&"object"==typeof t.transform&&!t.transform.keyframes){const e=t.transform.value,n=e&&"object"==typeof e?e:t.transform;if(n&&"object"==typeof n){const t={};return Array.isArray(n.translate)&&(t.translate=n.translate),"number"==typeof n.rotate&&(t.rotate=n.rotate),"number"==typeof n.skew&&(t.skew=n.skew),Array.isArray(n.scale)&&(t.scale={value:n.scale}),Array.isArray(n.origin)&&(t.origin=n.origin),Object.keys(t).length?t:void 0}}return}(t);e&&(a=We(a,e,r))}const s=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||qe(t))}(t);a=function(t,e,n,r,o){const i=r.idMap.get(n),a=r.maskAncestorChains.get(e)||[],s=o?Qe(e,r):void 0,l=s?[...a,s]:a,u=i&&r.maskAncestorChains.get(i)||[];if(!l.length&&!u.length)return t;const c=new Set;for(const t of l)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);for(const t of u)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);if(!(c.size>0)){const e=Je(l),n=Je(u),r=n[0]-e[0],o=n[1]-e[1];return 0===r&&0===o?t:{type:"g",transform:"translate("+r+","+o+")",children:[t]}}const f=Array.from(c).sort((t,e)=>t-e);return{type:"g",animate:{transform:{keyframes:f.map(t=>{const e=Ze(l,t),n=Ze(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,o,r,s);const l={type:"mask",id:i,children:[a]};return e.maskType&&(l.maskType=e.maskType),e.maskUnits&&(l.maskUnits=e.maskUnits),e.maskContentUnits&&(l.maskContentUnits=e.maskContentUnits),void 0!==e.x&&(l.x=String(e.x)),void 0!==e.y&&(l.y=String(e.y)),void 0!==e.width&&(l.width=String(e.width)),void 0!==e.height&&(l.height=String(e.height)),r.defs.push(l),t.mask="url(#"+i+")",t}function We(t,e,n){if(!e)return t;const r=ve(e.origin,n);let o=t;return o=Ye(o,"translate",e.translate,void 0,n),o=Ye(o,"rotate",e.rotate,r,n),o=Ye(o,"scale",e.scale,r,n),o}function Ye(t,e,n,r,o){if(void 0===n)return t;const i="scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n,a=me(i);if("static"===a.kind)return{type:"g",transform:{value:fe(e,_e(e,a.value),r)},children:[t]};if("animated"===a.kind){const n={keyframes:a.keyframes.map(t=>{const n=re(t,fe(e,_e(e,t.value),r));return"translate"===e?wt(wt({},n),Xe(t)):n})};return void 0!==a.loop&&(n.loop=a.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function _e(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function Xe(t){var e,n;const r={},o=null!=(e=t.tangentOut)?e:t.to,i=null!=(n=t.tangentIn)?n:t.ti;return Array.isArray(o)&&(r.tangentOut=[-o[0],-o[1]]),Array.isArray(i)&&(r.tangentIn=[-i[0],-i[1]]),r}function qe(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function Je(t){let e=0,n=0;for(const r of t)r.translate&&(e+=r.translate[0],n+=r.translate[1]);return[e,n]}function Ze(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=He(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function He(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function Qe(t,e){var n,r,o;const i=t.transform,a=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate.transform:void 0;if(void 0===i&&!a)return;const s={};if("string"==typeof i){const t=function(t,e){const n=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,i=0,a=!1,s=!1;for(;null!==(r=n.exec(t));){const t=r[1],e=r[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);"translate"===t?(o+=e[0]||0,i+=e[1]||0,a=!0):s=!0}s&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t);return a?[o,i]:void 0}(i,e);t&&(s.translate=t)}else if(i&&"object"==typeof i&&!i.keyframes){const t=i.value,n=t&&"object"==typeof t?t:i;n&&"object"==typeof n&&Array.isArray(n.translate)&&(s.translate=[n.translate[0]||0,n.translate[1]||0]),!n||void 0===n.rotate&&void 0===n.scale&&void 0===n.skew||e.warnings.push("maskedBy ancestor: non-translate transform parts ignored (rotate/scale not yet supported)")}if(a&&Array.isArray(a.keyframes)){const t=a.keyframes,i=[];for(const a of t){const t=null!=(n=a.value)?n:a.v,s=null!=(o=null!=(r=a.time)?r:a.t)?o:0;t&&"object"==typeof t&&Array.isArray(t.translate)&&(i.push({time:s,value:[t.translate[0]||0,t.translate[1]||0]}),void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: animated non-translate parts ignored"))}i.length&&(s.translateKeyframes=i)}return s.translate||s.translateKeyframes?s:void 0}function Ve(t,e,n){if(!e)return;const r=je(e.source);if(!r)return void(e.without===y.translate&&n.errors.push("clone: content ref missing `source`"));const o=e.without===y.translate&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function $e(t,e){const n={};return void 0!==t.translate&&(n.translate=tn(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=tn(t.rotate,t=>t*e)),void 0!==t.skew&&(n.skew=tn(t.skew,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){const n=t=>[Math.pow(t[0],e),Math.pow(t[1],e)];return tn(t,n,!0)}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function tn(t,e,n=!1){const r=me(t);if("absent"===r.kind)return t;if("static"===r.kind){const o=e(r.value);return("number"==typeof t||Array.isArray(t))&&!n?o:{value:o}}const o={keyframes:r.keyframes.map(t=>t&&void 0!==t.value?At(wt({},t),{value:e(t.value)}):t)};return void 0!==r.loop&&(o.loop=r.loop),void 0!==r.autoOrient&&(o.autoOrient=r.autoOrient),void 0!==r.base&&(o.value=e(r.base)),o}function en(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function nn(t,e,n){const[r,o]=e;if(!Number.isFinite(r)||!Number.isFinite(o))return void n.warnings.push("retime: timeCrop is not a pair of finite numbers — ignored");const i=o<=r?[{time:0,value:0}]:[...r>0?[{time:Math.max(0,r-1),value:0}]:[],{time:Math.max(0,r),value:1},{time:o,value:1},{time:o+1,value:0}],a=wt({},t);for(const e of Object.keys(t))delete t[e];t.type="g",t.children=[a],t.animate={opacity:{keyframes:i}}}function rn(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function on(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function an(t){var e;const n=null==(e=t.effects)?void 0:e.clone;n&&(delete n.retime,0===Object.keys(n).length&&delete t.effects.clone,t.effects&&0===Object.keys(t.effects).length&&delete t.effects)}function sn(t,e,n){const r=je(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=ln(r,e,n,new Set);o&&(t.href="#"+o)}function ln(t,e,n,r){if(r.has(t))return void n.errors.push('retime: loop via "'+t+'"');const o=n.idMap.get(t);if(!o)return void n.warnings.push('retime: target "'+t+'" not found');const i=Rt(o);if(pe(i,n),"use"===o.type?cn(i,e.start,e.stretch):un(i,e.start,e.stretch),an(i),"use"===o.type&&o.href){const a=je(o.href);if(a){const s=on(o),l=s?rn(en(s),e):e,u=new Set(r);u.add(t);const c=ln(a,l,n,u);c&&(i.href="#"+c)}}else!function(t,e,n,r,o){const i=t=>{var a;const s=on(t);if("use"===t.type&&s&&t.href){const i=je(t.href);if(i){const a=rn(en(s),e),l=new Set(r);l.add(o);const u=ln(i,a,n,l);u&&(t.href="#"+u)}an(t)}null==(a=t.children)||a.forEach(i)};i(t)}(i,e,n,r,t);return n.defs.push(i),"string"==typeof i.id&&n.idMap.set(i.id,i),"string"==typeof i.id?i.id:void 0}function un(t,e,n){var r;cn(t,e,n),null==(r=t.children)||r.forEach(t=>un(t,e,n))}function cn(t,e,n){const r=t=>{for(const r of t)"number"==typeof r.time&&(r.time=e+r.time*n)};if(t.transform&&"object"==typeof t.transform&&Array.isArray(t.transform.keyframes)&&r(t.transform.keyframes),t.animate&&"object"==typeof t.animate)for(const e of Object.keys(t.animate)){const n=t.animate[e];n&&Array.isArray(n.keyframes)&&r(n.keyframes)}}function fn(t,e,n){if(!e)return t;const r=e.subPaths===nt.combined,o=[],i=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const e of t.children)i(e);return}const e="string"==typeof t.d?t.d:function(t){var e,n,r,o,i,a,s,l,u,c;if("rect"===t.type){const i=Number(null!=(e=t.x)?e:0),a=Number(null!=(n=t.y)?n:0),s=Number(null!=(r=t.width)?r:0),l=Number(null!=(o=t.height)?o:0);return"M"+(i+s)+","+a+"L"+(i+s)+","+(a+l)+"L"+i+","+(a+l)+"L"+i+","+a+"L"+(i+s)+","+a+"z"}if("ellipse"===t.type||"circle"===t.type){const e=Number(null!=(i=t.cx)?i:0),n=Number(null!=(a=t.cy)?a:0),r="circle"===t.type?Number(null!=(s=t.r)?s:0):Number(null!=(l=t.rx)?l:0),o="circle"===t.type?Number(null!=(u=t.r)?u:0):Number(null!=(c=t.ry)?c:0);if(!(r>0&&o>0))return;const f=r*Nn,d=o*Nn,m=(t,e,n,r,o,i)=>"C"+t+","+e+" "+n+","+r+" "+o+","+i;return"M"+(e+r)+","+n+m(e+r,n+d,e+f,n+o,e,n+o)+m(e-f,n+o,e-r,n+d,e-r,n)+m(e-r,n-d,e-f,n-o,e,n-o)+m(e+f,n-o,e+r,n-d,e+r,n)+"z"}return}(t);if(void 0===e)return;const n=ue(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){const e=On(t);r.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}o.push(r)};if(i(t),!o.length)return t;let a=0;const s=r?[...o].reverse():o;for(const t of s)for(const e of t.subpaths)r||(a=0),e.startOffsetPx=a,a+=e.lengthPx;const l=a;if(r&&l<.001)return t;const u=me(e.offset),c="absent"===u.kind?{kind:"static",value:0}:u,f=function(t){const e=me(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>({time:ee(t),value:ne(t),easing:Vt(t)}));if(!n.some(t=>t.value[0]>t.value[1]))return{kind:"animated",keyframes:n.map(t=>({time:t.time,value:t.value,easing:t.easing}))};const r=[];for(let t=1;t<n.length;t++){const e=n[t-1],o=n[t];if((e.value[1]-e.value[0])*(o.value[1]-o.value[0])<0){const t=wn(e,o);null!==t&&t>e.time&&t<o.time&&r.push(Math.round(t))}}const o=Array.from(new Set(r)).sort((t,e)=>t-e),i=[];let a=0;for(const t of n){for(;a<o.length&&o[a]<t.time;){const t=o[a++],e=jn(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}const e=t.value[0]>t.value[1]?[t.value[1],t.value[0]]:t.value;i.push({time:t.time,value:e,easing:t.easing})}for(;a<o.length;){const t=o[a++],e=jn(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:i}}(e.range),d="absent"===f.kind?{kind:"static",value:[0,1]}:f,m=function(t){if("absent"===t.kind)return[];if("static"===t.kind)return[t.value];const e=[];for(const n of t.keyframes){const t=ne(n);"number"==typeof t&&e.push(t)}return e}(c),v=[m.length?Math.min(...m):0,m.length?Math.max(...m):0];if(1===o.length&&o[0].leaf===t&&1===o[0].subpaths.length){const e=o[0],n=e.subpaths[0],i=r?l:n.lengthPx;if(i<.001)return t;const a=r?n.startOffsetPx/i:0;return function(t,e,n,r,o,i){const a=hn(n,e,r),s=gn(e,r),l=wt({},t);return delete l.effects,kn(l,"strokeDasharray",yn(i,s)),kn(l,"strokeDashoffset",yn(o,a)),kn(l,"strokeOpacity",An(i)),l}(e.leaf,i,a,v,c,d)}const h=new Map;for(const t of o){const e=[];for(const o of t.subpaths){const i=r?l:o.lengthPx;if(i<.001)continue;const a=r?o.startOffsetPx/i:0;e.push(...mn(t.leaf,o.subpath,i,a,v,c,d,n))}h.set(t.leaf,dn(t.leaf,e))}const g=t=>{const e=h.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?At(wt({},t),{children:t.children.map(g)}):t)};return g(t)}function dn(t,e){const n=At(wt({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function mn(t,e,n,r,o,i,a,s){const l=hn(r,n,o),u=gn(n,o),c=yn(i,l),f=yn(a,u),d=An(a),m=function(t){return{type:"path",d:t}}(St(e));return kn(m,"strokeDasharray",f),kn(m,"strokeDashoffset",c),kn(m,"strokeOpacity",d),[m]}var vn=1;function hn(t,e,n){const[r]=pn(n);return n=>e*(-n-r+t)+vn}function gn(t,e){const[n,r]=pn(e),o=r-n+1;return e=>{const n=Pt(e[0],0,1),r=Pt(e[1],0,1),i=Math.min(n,r),a=Math.max(n,r),s=[0];let l=vn;for(let e=0;e<o;e++)s.push(l+i*t),s.push((a-i)*t),l=(1-a)*t;return s.push(l+vn),s}}function pn(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function yn(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>({time:ee(t),value:e(ne(t)),easing:Vt(t)})),loop:t.loop}}function kn(t,e,n){n&&Fe(t,e,n)}var bn=10;function An(t){const e=t=>t[0]===t[1];if("absent"===t.kind)return;if("static"===t.kind)return e(t.value)?{kind:"static",value:0}:void 0;const n=t.keyframes;let r=!1,o=!0;for(const t of n)e(ne(t))?r=!0:o=!1;if(!r)return;if(o)return{kind:"static",value:0};const i=[];for(let t=0;t<n.length;t++){const r=n[t],o=t>0?n[t-1]:void 0,a=t<n.length-1?n[t+1]:void 0,s=ee(r),l=e(ne(r)),u=o?l&&e(ne(o)):l,c=a?l&&e(ne(a)):l;u&&!c?(i.push({time:s,value:0}),i.push({time:s+bn,value:1})):!u&&c&&(i.push({time:s-bn,value:1}),i.push({time:s,value:0}))}return i.length<=1?void 0:{kind:"animated",keyframes:i}}function wn(t,e){const n=n=>{const r=(n-t.time)/(e.time-t.time),o=t.value[0]+(e.value[0]-t.value[0])*r;return t.value[1]+(e.value[1]-t.value[1])*r-o};let r=t.time,o=e.time,i=n(r);if(0===i)return r;const a=n(o);if(0===a)return o;if(i*a>0)return null;for(let t=0;t<100;t++){const t=(r+o)/2,e=n(t);if(0===e||Math.abs(o-r)<1e-4)return t;i*e<0?o=t:(r=t,i=e)}return(r+o)/2}function jn(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function On(t){const e=t.v;if(!e||e.length<2)return 0;let n=0;for(let r=0;r<e.length-1;r++)n+=xn(t,r,r+1);return t.c&&e.length>1&&(n+=xn(t,e.length-1,0)),n}function xn(t,e,n){var r,o,i,a;const s=t.v,l=s[e],u=s[n],c=null!=(o=null==(r=t.o)?void 0:r[e])?o:l,f=null!=(a=null==(i=t.i)?void 0:i[n])?a:u,d=Ft(l,c,f,u);return d.ds[d.ds.length-1]}var Nn=.5522847498307936;function Mn(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:ke(null==(e=Yt(t))?void 0:e.engine),glyphs:null==(n=qt(t))?void 0:n.fonts},o=Rt(t);Jt(o,r.idMap),Re(o,r,()=>Lt(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const a=je(null==(i=null==(o=t.effects)?void 0:o.maskedBy)?void 0:i.source);if("string"==typeof a){n.add(t);const r=e.idMap.get(a);r&&n.add(r)}if(Array.isArray(t.children))for(const e of t.children)r(e)};if(r(t),0===n.size)return;const o=(t,r)=>{if(n.has(t)&&e.maskAncestorChains.set(t,r),Array.isArray(t.children)){const n=Qe(t,e),i=n?[...r,n]:r;for(const e of t.children)o(e,i)}};o(t,[])}(o,r);const i=function(t,e){return function(t,e){e.idMap.clear(),Jt(t,e.idMap);const n=[],r=t=>{var e;on(t)&&n.push(t),null==(e=t.children)||e.forEach(r)};r(t);const o=new Map;for(const t of n){let n=0;const r=new Set,i=o=>{var a;if(o){if(o!==t&&on(o)&&n++,"use"===o.type&&o.href){const t=je(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(a=o.children)||a.forEach(i)}},a=je(t.href);a&&(r.add(a),i(e.idMap.get(a))),o.set(t,n)}n.sort((t,e)=>{var n,r;return(null!=(n=o.get(e))?n:0)-(null!=(r=o.get(t))?r:0)});for(const t of n){const n=on(t);if(!n)continue;const r=n.timeCrop;an(t),sn(t,en(n),e),r&&nn(t,r,e)}}(t,e),t}(Fn(o,r),r);return we(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function Fn(t,e){t.children&&(t.children=t.children.map(t=>Fn(t,e)));const n=t.effects,r="string"==typeof t.id?t.id:void 0,o=r?e.contentRefInnerIds.get(r):void 0;if(!n&&!o)return t;const{transformBy:i,repeater:a,maskedBy:s,clipPath:l,strokeTrim:u,clone:c,fillGradient:f,strokeGradient:d,textPath:m,text:v}=null!=n?n:{};n&&delete t.effects;let h=t,g=!1;if(null==v?void 0:v.useGlyphs)if(m){const t="string"==typeof m.pathData?m.pathData:void 0,n=jt(h,e,t,m.startOffset,m.textLength,m.pathOverflow);n&&(h=n,g=!0)}else h=Ot(h,v,e),g=!0;return g||(h=xt(h,m,e)),h=function(t,e,n){return Te(t,e,n,"fill")}(h,f,e),h=function(t,e,n){return Te(t,e,n,"stroke")}(h,d,e),h=fn(h,u,e),h=function(t,e,n){var r,o;if(!e)return t;const i=null!=(r=e.copies)?r:1;if(i<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const a=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=Rt(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate),delete l.id;const u=[l];for(let t=1;t<i;t++){const r=Rt(l),o=$e(e,t),i=o?Se(r,o,n):r;u.push(i)}const c={type:"g",children:u};return t.id&&(c.id=t.id),void 0!==a&&(c.transform=a),void 0!==s&&(c.animate={transform:s}),c}(h,a,e),h=Le(h,s,i,e),h=function(t,e,n){if(!(null==e?void 0:e.pathData))return t;const r=Lt(n,"clip"),o={type:"path"},i=me(e.pathData);return"absent"!==i.kind&&("static"===i.kind?o.d=Ge(i.value):(Fe(o,"d",i),void 0!==o.d&&(o.d=Ge(o.d)))),n.defs.push({type:"clipPath",id:r,children:[o]}),t.clipPath="url(#"+r+")",t}(h,l,e),o?(Ve(h,c,e),h=Ie(h,i,r,o,e)):h=function(t,e,n,r){return Ve(t,e,r),Se(t,n,r)}(h,c,i,e),(null==c?void 0:c.retime)&&(t.effects={clone:{retime:c.retime}}),r&&e.idMap.set(r,h),h}function Sn(t,e,n,r,o){const i=1-o,a=i*i*i,s=3*i*i*o,l=3*i*o*o,u=o*o*o;return[a*t[0]+s*e[0]+l*n[0]+u*r[0],a*t[1]+s*e[1]+l*n[1]+u*r[1]]}function Cn(t,e,n,r,o=64){let i=0,a=t;for(let s=1;s<=o;s++){const l=Sn(t,e,n,r,s/o);i+=Math.hypot(l[0]-a[0],l[1]-a[1]),a=l}return i}var Pn=t=>{const e=Math.round(1e4*t)/1e4;return Object.is(e,-0)?"0":String(e)};function Rn(e){const n=e=>{var r;let o=e;const i=e.animate,a=null==i?void 0:i.transform;if(a){const n=function(t){var e,n,r;if("offsetPath"!==t.alongPathMode)return;const o=t.keyframes;if(!o||o.length<2)return;const i=ne(o[0]),a=(null==i?void 0:i.origin)&&i.origin.length>=2?[i.origin[0],i.origin[1]]:[0,0],s=[];for(const t of o){const n=ne(t),r=null==n?void 0:n.translate;if(!r||r.length<2)return;if(Object.keys(n).some(t=>"translate"!==t&&"origin"!==t))return;const o=null!=(e=null==n?void 0:n.origin)?e:[0,0];if(o[0]!==a[0]||o[1]!==a[1])return;s.push([r[0]+a[0],r[1]+a[1]])}if(!o.some(t=>$t(t)||te(t)))return;let l="M"+Pn(s[0][0])+","+Pn(s[0][1]);const u=[];for(let t=0;t<s.length-1;t++){const e=s[t],i=s[t+1],a=null!=(n=te(o[t]))?n:[0,0],c=null!=(r=$t(o[t+1]))?r:[0,0],f=[e[0]+a[0],e[1]+a[1]],d=[i[0]+c[0],i[1]+c[1]];l+="C"+Pn(f[0])+","+Pn(f[1])+","+Pn(d[0])+","+Pn(d[1])+","+Pn(i[0])+","+Pn(i[1]),u.push(Cn(e,f,d,i))}const c=u.reduce((t,e)=>t+e,0);if(!(c>0))return;const f=[];let d=0;for(let t=0;t<o.length;t++){t>0&&(d+=u[t-1]);const e={t:ee(o[t]),v:d/c},n=Vt(o[t]);void 0!==n&&(e.e=n),f.push(e)}return{pathStr:l,distanceKfs:f,autoOrient:!!t.autoOrient,anchor:a}}(a);if(n){const r=wt({},i);delete r[kt];const s={keyframes:n.distanceKfs};void 0!==a.loop&&(s.loop=a.loop),r[t]=s;const l=e.transform;let u=l;if(l&&"object"==typeof l){const t=wt({},l);delete t[bt.translate],delete t[bt.origin],u=Object.keys(t).length?t:void 0}o=At(wt({},e),{animate:r,style:At(wt({},e.style),{offsetPath:"path('"+n.pathStr+"')",offsetAnchor:Pn(n.anchor[0])+"px "+Pn(n.anchor[1])+"px",offsetRotate:n.autoOrient?"auto":"0deg",offsetDistance:"0%"})}),void 0!==u?o.transform=u:delete o.transform}}if(null==(r=o.children)?void 0:r.length){const t=o.children.map(n);t.some((t,e)=>t!==o.children[e])&&(o=At(wt({},o),{children:t}))}return o};return n(e)}function In(t){var e;const n=function(t){const e=new Map,n=t=>{var r;"string"==typeof t.id&&e.set(t.id,t),null==(r=t.children)||r.forEach(n)};return n(t),e}(t),r=function(t,e){const n=new WeakMap,r=new Set,o=(t,r)=>{const i=n.get(t);if(void 0!==i)return i;if(r.has(t))return!1;r.add(t);let a=!1;if(t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate))for(const e in t.animate){a=!0;break}if(!a&&t.children)for(const e of t.children)if(o(e,r)){a=!0;break}if(!a&&"use"===t.type&&"string"==typeof t.href){const n=Bn(t.href),i=n?e.get(n):void 0;i&&(a=o(i,r))}return r.delete(t),n.set(t,a),a};for(const[t,n]of e)o(n,new Set)&&r.add(t);return r}(0,n);if(0===r.size)return t;let o=0;const i=function(t){const e=En(t.viewBox);if(e)return[e[2],e[3]];const n=Dn(t.width),r=Dn(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),a=[],s=Un(t,n,r,()=>"_lw_use_mat_"+ ++o,a,i);if(0===a.length)return s;const l={type:"defs",children:a},u=[...null!=(e=s.children)?e:[],l];return At(wt({},s),{children:u})}function Dn(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function Bn(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function Tn(t,e,n,r,o,i,a){var s,l,u,c;const f=Tt(e);ge(f,o);const d="symbol"===f.type?En(f.viewBox):void 0,m=null!=(l=null!=(s=Dn(t.width))?s:null==d?void 0:d[2])?l:a[0],v=null!=(c=null!=(u=Dn(t.height))?u:null==d?void 0:d[3])?c:a[1],h="symbol"===f.type?function(t,e,n,r,o){const i=En(t.viewBox),a=At(wt({},t),{type:"g"});if(delete a.viewBox,delete a.preserveAspectRatio,delete a.width,delete a.height,!i)return a;const[s,l,u,c]=i,f=u>0&&c>0?Math.min(r/u,o/c):1,d=(r-u*f)/2,m=(o-c*f)/2,v=[];0===d&&0===m||v.push("translate("+d+","+m+")");1!==f&&v.push("scale("+f+")");0===s&&0===l||v.push("translate("+-s+","+-l+")");v.length&&(a.transform=v.join(""));const h=e();return n.push({type:"clipPath",id:h,children:[{type:"rect",x:s,y:l,width:u,height:c}]}),a.clipPath="url(#"+h+")",a}(f,o,i,m,v):f,g=Un(h,n,r,o,i,a),p=At(wt({},t),{type:"g",children:[g]});return delete p.href,delete p.width,delete p.height,Nt(p)}function En(t){if("string"!=typeof t)return;const e=t.trim().split(/[\s,]+/).map(Number);return e.length<4||e.some(t=>!Number.isFinite(t))?void 0:[e[0],e[1],e[2],e[3]]}function Un(t,e,n,r,o,i){if("use"===t.type&&"string"==typeof t.href){const a=Bn(t.href);if(a&&n.has(a)){const s=e.get(a);if(s)return Tn(t,s,e,n,r,o,i)}}if(!t.children)return t;let a=!1;const s=t.children.map(t=>{const s=Un(t,e,n,r,o,i);return s!==t&&(a=!0),s});return a?At(wt({},t),{children:s}):t}function Kn(t,n,r){var o,i;let a=Mn(t).root;a=Rn(a);const s=null!=(i=null==(o=Yt(a))?void 0:o.duration)?i:e;return a=oe(a,s),n===lt.native&&(a=ie(a,null==r?void 0:r.motionPath),a=In(a),a=function(t){const e=t=>t.startsWith("#")?t.slice(1):t,n=(t,e)=>{var r;e(t),null==(r=t.children)||r.forEach(t=>n(t,e))};let r=!0;for(;r;){r=!1;const o=new Set;n(t,t=>{"use"===t.type&&"string"==typeof t.href&&o.add(e(t.href))}),n(t,t=>{if(!t.children)return;let e=t.children;"defs"===t.type&&(e=e.filter(t=>!(("g"===t.type||"symbol"===t.type)&&"string"==typeof t.id&&!o.has(t.id)))),e=e.filter(t=>!("defs"===t.type&&(!t.children||0===t.children.length))),e.length!==t.children.length&&(t.children=e,r=!0)})}return t}(a)),a}var zn="setPlaybackRate: rate must be finite and non-zero";function Gn(t){return Number.isFinite(t)&&0!==t}function Ln(t,e){return t>0?e===1/0?1/0:t*(e>0?e:1):0}function Wn(t,e){return t>0?e===1/0?t:t*(e>0?e:1):0}function Yn(t,e){return Number.isNaN(t)||t<0?0:Number.isFinite(e)?t>e?e:t:Number.isFinite(t)?t:0}function _n(t,e,n){const r=Wn(e,n);return r>0&&Number.isFinite(t)?t<=0?0:n===1/0?t%r/r:t>=r?1:t/r:0}function Xn(t,e,n){const r=Wn(e,n);return r>0&&Number.isFinite(t)?t<=0?0:t>=1?r:t*r:0}function qn(t,e=Date.now){let n=0,r=0,o=!1,i=1;const a=()=>Yn(o?n+(e()-r)*i:n,t);return{now:a,isRunning:()=>o,start:(s,l)=>{n=Yn(null!=l?l:a(),t),i=Gn(s)?s:1,r=e(),o=!0},stop:()=>{n=a(),r=0,o=!1},seek:i=>{n=Yn(i,t),o&&(r=e())}}}function Jn(t){const e=globalThis;"function"!=typeof e.cancelAnimationFrame?e.clearTimeout(t):e.cancelAnimationFrame(t)}function Zn(t,n,r){var o;const i=Yt(t)||{},a=le(t,lt.js),s=i.iterations;let l=1;"number"==typeof s&&(l=s||1),"infinite"===s&&(l=1/0),l<1&&(l=1);const u=+(i.duration||e),c=u&&l?u*(l===1/0?1/0:l):u?(null!=l?l:1)*u:0,f=i.direction||"normal",d=null!=(o=i.fill)?o:"forwards",m="forwards"===d||"both"===d,v="backwards"===d||"both"===d;let h=null,g=!1,p=-(i.delay||0),y=0,k=1,b=!1;const A=i.frameRate,w=A&&A>0?1e3/A:0;let j=0;const O=()=>{const t=y?(Date.now()-y)*k:0;return p+t},x=()=>{let t=O();return Number.isFinite(c)&&t>c&&(t=c),t<0&&(t=0),t};function N(t){let e=function(){const e=u>0?u:1;let n=0,r=0;if(u>0){t=Pt(t,0,l*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,l-1);n=Pt((t-r*e)/e,0,1)}else n=t;const o=f||"normal";let i=n;return"reverse"===o?i=1-n:"alternate"===o?r%2==1&&(i=1-n):"alternate-reverse"===o&&r%2==0&&(i=1-n),i}();for(const t of a||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=Ct(r,e*u);for(const[e,r]of Object.entries(o))n.setAttribute(t.id,e,r)}}i.delay&&(i.delay<0?N(x()):v&&N(0));const M=()=>!!g&&(!!n.isConnected()&&(k<0?O()>0:!(Number.isFinite(c)&&x()>=c))),F=t=>{null!==h&&(Jn(h),h=null),(t||M())&&(h=function(t){const e=globalThis;return"function"==typeof e.requestAnimationFrame?e.requestAnimationFrame(t):e.setTimeout(t,16)}(()=>{h=null,(()=>{var t,e;if(!n.isConnected())return void S();const o=x(),i=O();if(i<0&&k>0)v&&N(0);else{if(k<0&&i<=0)return S(),N(0),void(b||(b=!0,null==(t=null==r?void 0:r.onFinish)||t.call(r)));if(k>0&&c&&Number.isFinite(c)&&o>=c)return S(),N(m?c:0),void(b||(b=!0,null==(e=null==r?void 0:r.onFinish)||e.call(r)));if(w>0){const t=Date.now();if(j&&t-j<w)return;j=t}N(o)}})(),F()}))},S=()=>{if(!g)return;let t=O();Number.isFinite(c)&&t>c&&(t=c),p=t,y=0,g=!1,null!==h&&(Jn(h),h=null),t>=0?N(t):v&&N(0)},C={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>M(),play:()=>{var t;(()=>{if(!g){if(k>=0)Number.isFinite(c)&&p>=c&&(p=0);else if(p<=0){if(!Number.isFinite(c))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");p=c}b=!1,g=!0,y=Date.now(),F(!0)}})(),null==(t=null==r?void 0:r.onPlay)||t.call(r)},pause:()=>{var t;S(),null==(t=null==r?void 0:r.onPause)||t.call(r)},cancel:()=>{var t;S(),p=0,y=0,g=!1,b=!1,N(p),null==(t=null==r?void 0:r.onCancel)||t.call(r)},finish:()=>{((t=!0)=>{var e;p=Number.isFinite(c)?c:x(),y=0,g=!1,null!==h&&(Jn(h),h=null),N(m?p:0),t&&!b&&(b=!0,null==(e=null==r?void 0:r.onFinish)||e.call(r))})(!0)},setPlaybackRate:t=>{if(!Gn(t))return void console.warn(zn);let e=O();Number.isFinite(c)&&e>c&&(e=c),t<0!=k<0&&(b=!1),k=t,p=e,g&&(y=Date.now())},getCurrentTime:()=>x(),setCurrentTime:t=>{t=Yn(t,c),p=t,g&&(y=Date.now()),(!Number.isFinite(c)||t<c)&&(b=!1),N(x())},getCurrentProgress:()=>_n(x(),u,l),setCurrentProgress:t=>{C.setCurrentTime(Xn(t,u,l))},destroy:()=>{var t;C.cancel(),null==(t=null==r?void 0:r.onRemove)||t.call(r)}};return C}var Hn=(t=>(t[t.buildFailed=1001]="buildFailed",t[t.invalidDocumentAtSrc=1002]="invalidDocumentAtSrc",t[t.loadFailed=1003]="loadFailed",t[t.animationBuildFailed=1004]="animationBuildFailed",t[t.effectsShape=1101]="effectsShape",t[t.timelineOverrideIgnored=1102]="timelineOverrideIgnored",t[t.blockedTag=1103]="blockedTag",t[t.unsupportedAnimatedAttrs=1104]="unsupportedAnimatedAttrs",t[t.noBindings=1105]="noBindings",t[t.unresolvedBinding=1106]="unresolvedBinding",t[t.triggersNoRoot=1201]="triggersNoRoot",t[t.noRootForSelector=1202]="noRootForSelector",t[t.noRootElement=1203]="noRootElement",t[t.noElementsForSelector=1206]="noElementsForSelector",t[t.setAttributeNoElement=1207]="setAttributeNoElement",t[t.scrollSmoothingNeedsOwnDriver=1301]="scrollSmoothingNeedsOwnDriver",t[t.scrollNativeUnavailable=1302]="scrollNativeUnavailable",t[t.scrollSubjectInvalid=1303]="scrollSubjectInvalid",t[t.scrollSubjectNoMatch=1304]="scrollSubjectNoMatch",t[t.scrollNoRootToObserve=1305]="scrollNoRootToObserve",t[t.scrollTriggerIgnored=1306]="scrollTriggerIgnored",t[t.rateRejected=1401]="rateRejected",t[t.controlPropsConflict=1501]="controlPropsConflict",t[t.rnCompileFailed=1601]="rnCompileFailed",t[t.rnRenderFailed=1602]="rnRenderFailed",t[t.rnBoundaryCaught=1603]="rnBoundaryCaught",t[t.rnUnsupported=1604]="rnUnsupported",t))(Hn||{}),Qn=["timelineSource","scroll","trigger","delay","iterations","direction","fill","resetOnFinish","duration","mode","frameRate"],Vn=["definitions","bindings"],$n=t=>!!t&&"object"==typeof t&&!Array.isArray(t);function tr(t,e){const n=$n(t)?wt({},t):{};for(const t of Object.keys(e)){const r=e[t];null!==r?$n(r)?n[t]=tr(n[t],r):n[t]=r:delete n[t]}return n}function er(t,e,o){const i=$n(a=t)&&"string"==typeof a.type?a.type:"time";var a;const s=$n(e)&&"string"==typeof e.type?String(e.type):i;let l;if(s!==i){const r={};if($n(t))for(const e of n)void 0!==t[e]&&(r[e]=t[e]);l=tr(r,e)}else l=tr(t,e);if("scroll"===(u=s)||"view"===u){for(const t of r)void 0!==l[t]&&(o("animator.timeline."+t+": no slot on a '"+s+"' timeline — dropped"),delete l[t]);"infinite"===l.iterations&&(o("animator.timeline.iterations: 'infinite' cannot map onto a scroll range — dropped"),delete l.iterations)}var u;return l}function nr(t,e){let n;if("string"==typeof t)try{n=JSON.parse(t)}catch(t){console.warn("timeline override: not valid JSON — ignored",t),n=void 0}else n=null!=t?t:void 0;const{duration:r,delay:o,iterations:i,start:a}=e;if(void 0===r&&void 0===o&&void 0===i&&void 0===a)return void 0===n?void 0:{timeline:n};const s=$n(n)?wt({},n):{};return void 0!==r&&(s.duration=r),void 0!==o&&(s.delay=o),void 0!==i&&(s.iterations=i),void 0!==a&&(s.trigger=At(wt({},s.trigger),{start:a})),{timeline:s}}function rr(t,e){const n=[],r=t=>n.push(t);if(null===e)return{config:void 0,warnings:n};if(!$n(e)||0===Object.keys(e).length)return{config:t,warnings:n};const o=$n(t)?Qn.filter(e=>void 0!==t[e]):[];o.length&&r("animator: the base carries the flat runtime spelling ("+o.join(", ")+"); the patch merges the wire spelling only");const i=$n(t)?wt({},t):{};for(const t of Object.keys(e)){const n=e[t];null!==n?"timeline"!==t?$n(n)?i[t]=tr(i[t],n):i[t]=n:i.timeline=$n(n)?er(i.timeline,n,r):n:delete i[t]}return{config:i,warnings:n}}function or(t,e,n){var r,o;const i=!!(null==n?void 0:n.resetTimeline);if(!(t&&void 0!==e&&(i||null!==e&&$n(e)&&Object.keys(e).length)))return{doc:t,warnings:[]};const a=t,s=$n(a.animator),l=!s&&$n(null==(r=a.meta)?void 0:r.animator),u=s?a.animator:l?a.meta.animator:void 0,c=[];s&&$n(null==(o=a.meta)?void 0:o.animator)&&c.push("animator: doc.meta.animator is shadowed by doc.animator and was not patched");let f=u;if(i){const t={};for(const e of Vn)$n(u)&&void 0!==u[e]&&(t[e]=u[e]);f=t}const d=rr(f,null!=e?e:{});return c.push(...d.warnings),d.config===u?{doc:t,warnings:c}:l?{doc:At(wt({},a),{meta:At(wt({},a.meta),{animator:d.config})}),warnings:c}:{doc:At(wt({},a),{animator:d.config}),warnings:c}}export{zn as PX_RATE_REJECTED,o as PX_TRANSFORM_PART_KEYS,i as PX_TRIGGER_DEFAULTS,a as PX_WIRE_BASELINE_VERSION,s as PX_WIRE_SCHEMA_VERSION,l as PX_WIRE_STEPS,u as PX_WIRE_VERSION,c as PX_WIRE_VERSION_KEY,f as PxAlongPathMode,d as PxAnimatedSvgDocumentSchema,m as PxAnimatorConfigSchema,v as PxAttrValueSchema,h as PxBezierPathSchema,g as PxClipPathEffectSchema,p as PxCloneEffectSchema,y as PxCloneWithout,k as PxControlMode,b as PxDefinitionsSchema,Hn as PxDiagnosticCode,A as PxDiagnosticKind,w as PxEffectsSchema,j as PxElementAnimationSchema,O as PxFillGradientEffectSchema,x as PxFillMode,N as PxFinishAction,M as PxGradientSpreadMethod,F as PxGradientStopSchema,S as PxGradientType,C as PxKeyframeSchema,P as PxKeyframeValueSchema,R as PxLengthAdjust,I as PxLoopDirection,D as PxLoopRepeatAt,B as PxLoopSchema,T as PxMaskType,E as PxMaskedByEffectSchema,U as PxMouseOutAction,K as PxNodeBaseSchema,z as PxNodeSchema,G as PxOffScreenAction,L as PxPathOverflow,W as PxPinAlign,Y as PxPlaybackDirection,_ as PxPropertyAnimationSchema,X as PxRepeaterEffectSchema,q as PxRetimeEffectSchema,J as PxScrollAxis,Z as PxScrollKind,H as PxScrollPhase,Q as PxScrollRangePointSchema,V as PxScrollRangeSchema,$ as PxScrollSchema,tt as PxScrollSource,et as PxStrokeTrimEffectSchema,nt as PxStrokeTrimSubPaths,rt as PxSvgNodeRootSchema,ot as PxTextEffectSchema,it as PxTextPathEffectSchema,at as PxTextPathMethod,st as PxTextPathSpacing,lt as PxTimelineEngine,ut as PxTimelineEngineSetting,ct as PxTimelineSchema,ft as PxTransformByEffectSchema,dt as PxTransformPartsSchema,mt as PxTransformValueSchema,vt as PxTriggerSchema,ht as PxTriggerStart,gt as PxUnits,pt as PxWireStepKind,yt as PxWireVersionRelation,or as applyAnimatorConfig,Mt as applyWireSteps,Ct as calcAnimationValues,Yn as clampSeekMs,It as compareWireVersion,Dt as controlModeTakesOverTrigger,Bt as convertWireDocument,Zn as createAdapterAnimator,qn as createRunClock,Et as describeSchema,Ut as diagnoseDocument,Kt as downgradeWireDocument,zt as flattenAnimatorTimeline,nr as foldTimelineOverride,Gt as formatWireVersion,Wt as generateNewIds,Yt as getAnimatorConfig,_t as getBindings,Xt as getChildren,qt as getDefinitions,Zt as isNativeForced,Ht as isPxDocument,Gn as isValidPlaybackRate,Qt as isValidPxDocument,Kn as materializeAllInTree,Mn as materializeNodeEffects,ae as mayUseNativeScrollTimeline,rr as mergeAnimatorConfig,se as nestAnimatorTimeline,le as normalizeBindings,ce as parseWireVersion,Wn as progressSpanMs,Xn as progressToTimeMs,de as px,he as readWireVersion,ye as resolveControlMode,ke as resolveTimelineEngine,be as resolveTrigger,Ae as schemaKeys,Ln as seekCeilingMs,_n as timeToProgress,Oe as toDomProps,xe as validateDocument,Ne as validateNodeEffects,Me as wireVersionAdvice};
|
package/dist/internal.cjs
CHANGED
|
@@ -642,14 +642,18 @@ var PxPlaybackDirection = {
|
|
|
642
642
|
};
|
|
643
643
|
var PX_ANIM_SRC_ATTR_NAME = "data-px-animation-src";
|
|
644
644
|
var PX_ANIM_ATTR_NAME = "_px_animator";
|
|
645
|
-
var
|
|
645
|
+
var PxTriggerStart = {
|
|
646
646
|
load: "load",
|
|
647
647
|
mouseOver: "mouseOver",
|
|
648
648
|
click: "click",
|
|
649
|
-
|
|
650
|
-
|
|
649
|
+
none: "none"
|
|
650
|
+
};
|
|
651
|
+
var PxOffScreenAction = {
|
|
652
|
+
pause: "pause",
|
|
653
|
+
continue: "continue",
|
|
654
|
+
reset: "reset"
|
|
651
655
|
};
|
|
652
|
-
var
|
|
656
|
+
var PxMouseOutAction = {
|
|
653
657
|
continue: "continue",
|
|
654
658
|
pause: "pause",
|
|
655
659
|
reset: "reset",
|
|
@@ -708,9 +712,11 @@ var PxTimelineEngineSetting = __spreadProps(__spreadValues({}, PxTimelineEngine)
|
|
|
708
712
|
auto: "auto"
|
|
709
713
|
});
|
|
710
714
|
var PX_TRIGGER_DEFAULTS = {
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
715
|
+
start: "load",
|
|
716
|
+
offScreen: "pause",
|
|
717
|
+
mouseOut: "continue",
|
|
718
|
+
visibilityThreshold: 0.5,
|
|
719
|
+
visibilityDebounce: 150
|
|
714
720
|
};
|
|
715
721
|
var PxLoopRepeatAt = {
|
|
716
722
|
/** Segment from the START; the repetition runs BEFORE the first keyframe
|
|
@@ -829,9 +835,9 @@ function flattenAnimatorTimeline(cfg) {
|
|
|
829
835
|
} else {
|
|
830
836
|
if (timeline.duration !== void 0) flat.duration = timeline.duration;
|
|
831
837
|
if (timeline.trigger !== void 0) {
|
|
832
|
-
const _b = timeline.trigger, {
|
|
838
|
+
const _b = timeline.trigger, { finish } = _b, restTrigger = __objRest(_b, ["finish"]);
|
|
833
839
|
if (Object.keys(restTrigger).length) flat.trigger = restTrigger;
|
|
834
|
-
if (
|
|
840
|
+
if (finish !== void 0) flat.resetOnFinish = finish === "reset";
|
|
835
841
|
}
|
|
836
842
|
if (timeline.delay !== void 0) flat.delay = timeline.delay;
|
|
837
843
|
if (timeline.iterations !== void 0) flat.iterations = timeline.iterations;
|
|
@@ -843,7 +849,7 @@ function flattenAnimatorTimeline(cfg) {
|
|
|
843
849
|
}
|
|
844
850
|
|
|
845
851
|
// src/version/PxSchemaVersion.ts
|
|
846
|
-
var PX_WIRE_SCHEMA_VERSION = "1.
|
|
852
|
+
var PX_WIRE_SCHEMA_VERSION = "1.2";
|
|
847
853
|
|
|
848
854
|
// src/version/PxWireVersion.ts
|
|
849
855
|
var VERSION_RE = /^(\d+)\.(\d+)(?:\.(\d+))?$/;
|
|
@@ -936,13 +942,15 @@ var PxElementAnimationSchema = implementsInterface()(px.union([
|
|
|
936
942
|
PxAnimationDefinitionSchema
|
|
937
943
|
]));
|
|
938
944
|
var PxTriggerSchema = implementsInterface()(px.object({
|
|
939
|
-
|
|
940
|
-
|
|
945
|
+
start: px.enum([PxTriggerStart.load, PxTriggerStart.mouseOver, PxTriggerStart.click, PxTriggerStart.none], PX_TRIGGER_DEFAULTS.start).optional(),
|
|
946
|
+
offScreen: px.enum([PxOffScreenAction.pause, PxOffScreenAction.continue, PxOffScreenAction.reset], PX_TRIGGER_DEFAULTS.offScreen).optional(),
|
|
947
|
+
mouseOut: px.enum([PxMouseOutAction.continue, PxMouseOutAction.pause, PxMouseOutAction.reset, PxMouseOutAction.reverse], PX_TRIGGER_DEFAULTS.mouseOut).optional(),
|
|
941
948
|
// What happens after a NATURAL finish — `'hold'` (default: keep the end state per
|
|
942
|
-
// `fill`) or `'reset'` (snap back to the start state).
|
|
943
|
-
//
|
|
944
|
-
|
|
945
|
-
|
|
949
|
+
// `fill`) or `'reset'` (snap back to the start state). One of four occasion keys
|
|
950
|
+
// (`start`, `offScreen`, `mouseOut`, `finish`), all named the same way.
|
|
951
|
+
finish: px.enum([PxFinishAction.hold, PxFinishAction.reset]).optional(),
|
|
952
|
+
visibilityThreshold: px.number().optional(),
|
|
953
|
+
visibilityDebounce: px.number().optional()
|
|
946
954
|
}));
|
|
947
955
|
var PxGlyphSchema = implementsInterface()(px.object({
|
|
948
956
|
width: px.number(),
|