@pixodesk/svg-animator-core 1.0.34 → 1.0.35
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 +7 -7
- package/dist/index.cjs +1054 -436
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1363 -691
- package/dist/index.d.ts +1363 -691
- package/dist/index.js +1014 -433
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.js +1 -1
- package/package.json +1 -1
package/dist/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t=Object.defineProperty,e=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=Math.pow,s=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,l=(t,e)=>{for(var n in e||(e={}))o.call(e,n)&&s(t,n,e[n]);if(r)for(var n of r(e))i.call(e,n)&&s(t,n,e[n]);return t},u=(t,r)=>e(t,n(r)),c=(t,e)=>{var n={};for(var a in t)o.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(null!=t&&r)for(var a of r(t))e.indexOf(a)<0&&i.call(t,a)&&(n[a]=t[a]);return n};function f(t,e=!1){var n,r,o,i;const a=t.v,s=t.i,l=t.o,u=t.c;if(!a.length)return"";const c=[],f=a.length;c.push("M"+a[0][0]+","+a[0][1]);for(let t=1;t<f;t++){const o=a[t-1],i=null!=(n=null==l?void 0:l[t-1])?n:o,u=null!=(r=null==s?void 0:s[t])?r:a[t],f=a[t];!e&&i[0]===o[0]&&i[1]===o[1]&&u[0]===f[0]&&u[1]===f[1]?c.push("L"+f[0]+","+f[1]):c.push("C"+i[0]+","+i[1]+","+u[0]+","+u[1]+","+f[0]+","+f[1])}if(u&&f>0){const t=a[f-1],n=null!=(o=null==l?void 0:l[f-1])?o:t,r=null!=(i=null==s?void 0:s[0])?i:a[0],u=a[0];!e&&n[0]===t[0]&&n[1]===t[1]&&r[0]===u[0]&&r[1]===u[1]||c.push("C"+n[0]+","+n[1]+","+r[0]+","+r[1]+","+u[0]+","+u[1]),c.push("z")}return c.join("")}function d(t,e,n){return t+(e-t)*n}function h(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let i=0;i<o;i++)r[i]=d(t[i]||0,e[i]||0,n);return r}function p(t,e,n){return[d(t[0]||0,e[0]||0,n),d(t[1]||0,e[1]||0,n),d(t[2]||0,e[2]||0,n),d(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function m(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++)o.push(v(t[i],e[i],n));return o}function v(t,e,n){var r,o,i,a,s,l,u,c,f;if(!t||!e)return t||e||{v:[]};const d=Math.min(Math.max(n,0),1),p=Math.min(t.v.length,e.v.length),m=[],v=[],g=[];for(let n=0;n<p;n++){const f=t.v[n],p=e.v[n];m.push(h(f,p,d));const y=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,b=null!=(a=null==(i=e.i)?void 0:i[n])?a:p;v.push(h(y,b,d));const k=null!=(l=null==(s=t.o)?void 0:s[n])?l:f,A=null!=(c=null==(u=e.o)?void 0:u[n])?c:p;g.push(h(k,A,d))}return{v:m,i:v.length?v:void 0,o:g.length?g:void 0,c:null!=(f=t.c)?f:e.c}}function g(t,e,n){if(n<=0)return 0;if(n>=1)return 1;const r=3*t,o=3*(e-t)-r,i=1-r-o;function a(t){return((i*t+o)*t+r)*t}function s(t){return(3*i*t+2*o)*t+r}let l=n,u=0,c=1;for(let t=0;t<8;t++){const t=a(l)-n;if(Math.abs(t)<1e-6)return l;const e=s(l);if(Math.abs(e)<1e-6)break;l-=t/e}for(l=n;u<c;){const t=a(l);if(Math.abs(t-n)<1e-6)return l;n>t?u=l:c=l,l=(c+u)/2}return l}function y(t){const[e,n,r,o]=t,i=3*n,a=3*(o-n)-i,s=1-i-a;return function(t){return n=g(e,r,t),((s*n+a)*n+i)*n;var n}}function b(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function k(t,e,n,r,o){const i=b(t,e,o),a=b(e,n,o),s=b(n,r,o),l=b(i,a,o),u=b(a,s,o),c=b(l,u,o);return{left:[t,i,l,c],right:[c,u,s,r]}}function A(t,e){if(!t)return{left:void 0,right:void 0};if(e<=0)return{left:void 0,right:t};if(e>=1)return{left:t,right:void 0};const[n,r,o,i]=t,a=g(n,o,e),s=[n,r],l=[o,i],{left:u,right:c}=k([0,0],s,l,[1,1],a),f=u[3][0],d=u[3][1];let h,p;f>1e-9&&Math.abs(d)>1e-9&&(h=[u[1][0]/f,u[1][1]/d,u[2][0]/f,u[2][1]/d]);const m=1-f,v=1-d;return m>1e-9&&Math.abs(v)>1e-9&&(p=[(c[1][0]-f)/m,(c[1][1]-d)/v,(c[2][0]-f)/m,(c[2][1]-d)/v]),{left:h,right:p}}function x(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function w(t){const e=Math.round(255*t[0]),n=Math.round(255*t[1]),r=Math.round(255*t[2]);return 4===t.length?"rgba("+e+","+n+","+r+","+t[3]+")":"rgb("+e+","+n+","+r+")"}function j(t){if(t){if(Array.isArray(t))return t;if("string"==typeof t)return t.startsWith("#")?function(t){const e=t.slice(1),n=e.length<=4,r=n?e[0]+e[0]:e.slice(0,2),o=n?e[1]+e[1]:e.slice(2,4),i=n?e[2]+e[2]:e.slice(4,6),a=4===e.length?e[3]+e[3]:8===e.length?e.slice(6,8):null,s=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==a&&s.push(parseInt(a,16)/255),s}(t):t.startsWith("rgb")?function(t){var e;const n=null==(e=t.match(/rgba?\((.*)\)/))?void 0:e[1];if(!n)throw new Error("Invalid rgb/rgba format");const r=n.split(",").map(t=>+t.trim());return[r[0]/255,r[1]/255,r[2]/255,...void 0!==r[3]?[r[3]]:[]]}(t):void console.warn("Unsupported color format: "+t)}}var O=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),M=new Set(["translate","rotate","scale","skew"]),S=new Set(["offset-distance","offsetDistance"]);function P(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],i=t.translate,a=t.origin,s=t.rotate,l=t.skew,u=t.scale,c=r?"px":"",f=r?"deg":"";return i&&o.push("translate("+i[0]+c+","+i[1]+c+")"),a&&o.push("translate("+a[0]+c+","+a[1]+c+")"),null!=s&&o.push("rotate("+s+f+")"),null!=l&&o.push("skewX("+l+f+")"),u&&o.push("scale("+u[0]+","+u[1]+")"),a&&o.push("translate("+-a[0]+c+","+-a[1]+c+")"),o.join("")}function _(t){var e,n;if(!t||"string"!=typeof t)return;const r={},o=/([a-zA-Z]+)\s*\(([^)]*)\)/g,i=["translate","rotate","skewX","scale"];let a,s=-1;for(;null!==(a=o.exec(t));){const t=a[1],o=i.indexOf(t);if(o<0||o<=s)return;s=o;const l=a[2].split(/[\s,]+/).filter(Boolean).map(Number);if(l.some(t=>Number.isNaN(t)))return;if("translate"===t){if(l.length<1||l.length>2)return;r.translate=[l[0],null!=(e=l[1])?e:0]}else if("rotate"===t){if(1!==l.length)return;r.rotate=l[0]}else if("skewX"===t){if(1!==l.length)return;r.skew=l[0]}else{if(l.length<1||l.length>2)return;r.scale=[l[0],null!=(n=l[1])?n:l[0]]}}return t.replace(/([a-zA-Z]+)\s*\(([^)]*)\)/g,"").replace(/[\s,]/g,"").length?void 0:Object.keys(r).length?r:void 0}var z=new Set(["offset-distance","offsetDistance"]),I=1e3;function N(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function D(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var F=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","markerUnits","markerWidth","markerHeight","refX","refY","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","tableValues","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function C(t){return F.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function T(t,e,n){return Math.max(e,Math.min(t,n))}function U(t,e,n,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const i=1-o,a=i*i,s=o*o,l=a*i,u=3*o*a,c=3*s*i,f=s*o;return[l*t[0]+u*e[0]+c*n[0]+f*r[0],l*t[1]+u*e[1]+c*n[1]+f*r[1]]}var L=1e-4;function E(t,e,n,r,o){const i=B(t,e,n,r,o);if(0===i[0]&&0===i[1]){return B(t,e,n,r,o<.5?o+L:o-L)}return i}function B(t,e,n,r,o){const i=1-o,a=3*i*i,s=6*o*i,l=3*o*o;return[a*(e[0]-t[0])+s*(n[0]-e[0])+l*(r[0]-n[0]),a*(e[1]-t[1])+s*(n[1]-e[1])+l*(r[1]-n[1])]}function V(t,e,n,r,o=100){const i=o+1,a=new Float64Array(i),s=new Float64Array(i);let l=U(t,e,n,r,0);a[0]=0,s[0]=0;let u=0;for(let c=1;c<i;c++){const i=c/o,f=U(t,e,n,r,i),d=f[0]-l[0],h=f[1]-l[1];u+=Math.sqrt(d*d+h*h),a[c]=i,s[c]=u,l=f}return{ts:a,ds:s}}function W(t,e){const{ts:n,ds:r}=t,o=n.length-1;if(e<=n[0])return r[0];if(e>=n[o])return r[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;n[t]<e?i=t+1:a=t}const s=n[a-1],l=n[a]-s,u=l>0?(e-s)/l:0;return r[a-1]+u*(r[a]-r[a-1])}function R(t){return"scroll"===(null==t?void 0:t.timelineSource)}function Z(t){return("number"==typeof(null==t?void 0:t.duration)&&t.duration>0?t.duration:I)*("number"==typeof(null==t?void 0:t.iterations)&&t.iterations>0?t.iterations:1)}function G(t,e,n){const r=e,o=n;switch(t){case"cover":return[0,r+o];case"entry":return[0,Math.min(r,o)];case"contain":return[Math.min(r,o),Math.max(r,o)];case"exit":return[Math.max(r,o),r+o];case"entry-crossing":return[0,r];case"exit-crossing":return[o,r+o]}}function K(t,e,n,r){var o;const[i,a]=G(null!=(o=null==t?void 0:t.phase)?o:"cover",n,r);return i+("number"==typeof(null==t?void 0:t.fraction)?t.fraction:e)*(a-i)}function q(t,e,n,r){const o=n-t,i=K(null==r?void 0:r.start,0,e,n),a=K(null==r?void 0:r.end,1,e,n);return a<=i?o>=a?1:0:T((o-i)/(a-i),0,1)}function X(t,e,n){var r,o;const i=e>0?T(t/e,0,1):1,a="number"==typeof(null==(r=null==n?void 0:n.start)?void 0:r.fraction)?n.start.fraction:0,s="number"==typeof(null==(o=null==n?void 0:n.end)?void 0:o.fraction)?n.end.fraction:1;return s<=a?i>=s?1:0:T((i-a)/(s-a),0,1)}function Q(t,e){const n=null!=t?t:"block";if("x"===n||"y"===n)return n;const r=!!e&&e.startsWith("vertical");return"inline"===n?r?"y":"x":r?"x":"y"}function J(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var Y=class{_canSanitize(t){return this.isValid(t)}optional(){return new H(this)}},H=class extends Y{constructor(t){super(),this.inner=t,this._default=void 0}sanitize(t){if(null!=t)return this.inner._canSanitize(t)?this.inner.sanitize(t):void 0}isValid(t,e,n){return null==t||this.inner.isValid(t,e,n)}_canSanitize(t){return null==t||this.inner._canSanitize(t)}},$=class extends Y{constructor(t=""){super(),this._default=t}sanitize(t){return"string"==typeof t?t:this._default}isValid(t,e,n){return"string"==typeof t||(null==e||e.errors.push(J(null!=n?n:[])+": expected string, got "+typeof t),!1)}},tt=class extends Y{constructor(t=0){super(),this._default=t}sanitize(t){return"number"==typeof t&&isFinite(t)?t:this._default}isValid(t,e,n){return!("number"!=typeof t||!isFinite(t))||(null==e||e.errors.push(J(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},et=class extends Y{constructor(t=!1){super(),this._default=t}sanitize(t){return"boolean"==typeof t?t:this._default}isValid(t,e,n){return"boolean"==typeof t||(null==e||e.errors.push(J(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},nt=class extends Y{constructor(t){super(),this.value=t,this._default=t}sanitize(t){return t===this.value?this.value:this._default}isValid(t,e,n){return t===this.value||(null==e||e.errors.push(J(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},rt=class extends Y{constructor(t,e){super(),this.values=t,this._default=null!=e?e:t[0]}sanitize(t){return this.values.includes(t)?t:this._default}isValid(t,e,n){return!!this.values.includes(t)||(null==e||e.errors.push(J(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},ot=class extends Y{constructor(t,e){super(),this.schemas=t,this._kind="union",this._default=null!=e?e:t[0]._default}sanitize(t){for(const e of this.schemas)if(e.isValid(t))return e.sanitize(t);return this._default}isValid(t,e,n){var r;const o=e&&{errors:[],warnings:[],strict:e.strict};return!!this.schemas.some(e=>e.isValid(t,o,n?[...n]:void 0))||(null==e||e.errors.push(J(null!=n?n:[])+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,240)),!1)}_canSanitize(t){return this.schemas.some(e=>e._canSanitize(t))}},it=class extends Y{constructor(t,e,n){super(),this._key=t,this._schemas=e,this._kind="discriminatedUnion",this._default=null!=n?n:e[0]._default,this._map=new Map;for(const n of e){const e=n._shape[t];e&&this._map.set(e._default,n)}}_findSchema(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const e=t[this._key];return null!=e?this._map.get(e):void 0}sanitize(t){var e;return(null!=(e=this._findSchema(t))?e:this._schemas[0]).sanitize(t)}isValid(t,e,n){const r=this._findSchema(t);if(!r){const r=null===t||"object"!=typeof t||Array.isArray(t)?void 0:t[this._key];return null==e||e.errors.push(J(null!=n?n:[])+": no discriminated union member matched "+this._key+"="+JSON.stringify(r)),!1}return r.isValid(t,e,n)}_canSanitize(t){if(null===t||"object"!=typeof t||Array.isArray(t))return!1;const e=this._findSchema(t);return e?e._canSanitize(t):this._schemas[0]._canSanitize(t)}},at=class extends Y{constructor(t){super(),this._shape=t;const e={};for(const n of Object.keys(t))e[n]=t[n]._default;this._default=e}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n={};for(const t of Object.keys(this._shape))n[t]=this._shape[t].sanitize(e[t]);return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(J(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(i=!1),o.pop();if(null==e?void 0:e.strict)for(const t of Object.keys(r))t in this._shape||void 0!==r[t]&&(o.push(t),e.errors.push(J(o)+": unexpected extra key"),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},st=class extends Y{constructor(t,e){super(),this._shape=t,this._openSchema=e;const n={};for(const e of Object.keys(t))n[e]=t[e]._default;this._default=n}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n=l({},e);for(const t of Object.keys(this._shape))n[t]=this._shape[t].sanitize(e[t]);if(this._openSchema)for(const t of Object.keys(e))t in this._shape||(n[t]=this._openSchema.sanitize(e[t]));return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(J(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(i=!1),o.pop();if(this._openSchema)for(const t of Object.keys(r))t in this._shape||(o.push(t),this._openSchema.isValid(r[t],e,o)||(i=!1),o.pop());return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},lt=class extends Y{constructor(t){super(),this.item=t,this._default=[]}sanitize(t){if(!Array.isArray(t))return[];const e=[];for(const n of t)this.item._canSanitize(n)&&e.push(this.item.sanitize(n));return e}isValid(t,e,n){if(!Array.isArray(t))return null==e||e.errors.push(J(null!=n?n:[])+": expected array, got "+typeof t),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<t.length;n++)r.push("["+n+"]"),this.item.isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)}},ut=class extends Y{constructor(t){super(),this.value=t,this._kind="record",this._default={}}sanitize(t){if(!t||"object"!=typeof t||Array.isArray(t))return{};const e={};for(const[n,r]of Object.entries(t))this.value._canSanitize(r)&&(e[n]=this.value.sanitize(r));return e}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(J(null!=n?n:[])+": expected object/record, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(const[n,i]of Object.entries(t))r.push(n),this.value.isValid(i,e,r)||(o=!1),r.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},ct=class extends Y{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},ft=class extends Y{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return void 0!==t||(null==e||e.errors.push(J(null!=n?n:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}},dt=class extends Y{constructor(t,e){super(),this.fn=t,this._default=e,this.resolved=null}get schema(){var t;return null!=(t=this.resolved)?t:this.resolved=this.fn()}sanitize(t){return this.schema.sanitize(t)}isValid(t,e,n){return this.schema.isValid(t,e,n)}_canSanitize(t){return this.schema._canSanitize(t)}},ht=class extends Y{constructor(t){super(),this.schemas=t,this._kind="tuple",this._default=t.map(t=>t._default)}sanitize(t){return Array.isArray(t)&&t.length===this.schemas.length?this.schemas.map((e,n)=>e.sanitize(t[n])):this._default}isValid(t,e,n){if(!Array.isArray(t)||t.length!==this.schemas.length)return null==e||e.errors.push(J(null!=n?n:[])+": expected tuple of length "+this.schemas.length+", got "+(Array.isArray(t)?"array["+t.length+"]":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<this.schemas.length;n++)r.push("["+n+"]"),this.schemas[n].isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)&&t.length===this.schemas.length}};function pt(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function mt(t){var e;const n=t;switch(n._kind){case"union":return{kind:"union",members:n.schemas};case"discriminatedUnion":return{kind:"discriminatedUnion",key:n._key,members:n._schemas};case"record":return{kind:"record",value:n.value};case"tuple":return{kind:"tuple",items:n.schemas}}return"_shape"in n?{kind:"shape",shape:n._shape,openValue:n._openSchema}:"item"in n?{kind:"array",item:n.item}:"inner"in n?{kind:"optional",inner:n.inner}:"fn"in n?{kind:"lazy",resolved:null!=(e=n.resolved)?e:n.resolved=n.fn()}:{kind:"leaf"}}var vt={string:(t="")=>new $(t),number:(t=0)=>new tt(t),boolean:(t=!1)=>new et(t),literal:t=>new nt(t),enum:(t,e)=>new rt(t,e),union:(t,e)=>new ot(t,e),discriminatedUnion:(t,e)=>new it(t,e),object:t=>new at(t),openObject:(t,e)=>new st(t,e),extendedObject:(t,e)=>new at(l(l({},t._shape),e)),array:t=>new lt(t),record:t=>new ut(t),any:()=>new ct,defined:()=>new ft,tuple:t=>new ht(t),lazy:(t,e)=>new dt(t,e)},gt="data-px-animation-src",yt="_px_animator",bt={auto:"auto",waapi:"waapi",frames:"frames"},kt={waapi:bt.waapi,frames:bt.frames},At={before:"before",after:"after"},xt="luminance",wt="alpha",jt="userSpaceOnUse",Ot="objectBoundingBox",Mt="clip",St="extend",Pt="spacing",_t="spacingAndGlyphs",zt="align",It="stretch",Nt="auto",Dt="exact",Ft={separate:"separate",combined:"combined"},Ct="text",Tt="textContent",Ut=new Set(["type","children","animator","meta","animate","effects",Ct,Tt]),Lt=["translate","rotate","scale","origin"],Et={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},Bt={pad:"pad",reflect:"reflect",repeat:"repeat"},Vt={linear:"linear",radial:"radial"};function Wt(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&"svg"===t.type}function Rt(t){var e;const n=(null==t?void 0:t.animator)||(null==(e=null==t?void 0:t.meta)?void 0:e.animator);return n?Gt(n):void 0}var Zt=new WeakMap;function Gt(t){const e=t.timeline;if(null==e||"object"!=typeof e)return t;const n=Zt.get(t);if(n)return n;const r=t,{timeline:o}=r,i=c(r,["timeline"]);if("scroll"===e.type||"view"===e.type){i.timelineSource="scroll",void 0!==e.duration&&(i.duration=e.duration),void 0!==e.iterations&&(i.iterations=e.iterations);const t=l({},i.scroll||{});t.kind=e.type,void 0!==e.engine&&(t.driver=e.engine),void 0!==e.axis&&(t.axis=e.axis),void 0!==e.source&&(t.source=e.source),void 0!==e.subject&&(t.subject=e.subject),void 0!==e.smoothing&&(t.smoothing=e.smoothing),void 0!==e.range&&(t.range=e.range);const n=e.pin;"boolean"==typeof n?t.pin=n:n&&"object"==typeof n&&(t.pin=!0,void 0!==n.align&&(t.pinAlign=n.align),void 0!==n.top&&(t.pinTop=n.top),void 0!==n.distance&&(t.pinDistance=n.distance)),i.scroll=t}else{if(void 0!==e.duration&&(i.duration=e.duration),void 0!==e.trigger){const t=e.trigger,{onFinish:n}=t,r=c(t,["onFinish"]);Object.keys(r).length&&(i.trigger=r),void 0!==n&&(i.resetOnFinish="reset"===n)}void 0!==e.delay&&(i.delay=e.delay),void 0!==e.iterations&&(i.iterations=e.iterations),void 0!==e.direction&&(i.direction=e.direction),void 0!==e.fill&&(i.fill=e.fill)}return Zt.set(t,i),i}function Kt(t){if(!t||void 0!==t.timeline)return t;const e=t,{timelineSource:n,scroll:r,trigger:o,delay:i,iterations:a,direction:s,fill:f,resetOnFinish:d,duration:h}=e,p=c(e,["timelineSource","scroll","trigger","delay","iterations","direction","fill","resetOnFinish","duration"]);if("scroll"===n){const t={type:"view"===(null==r?void 0:r.kind)?"view":"scroll"};if(void 0!==h&&(t.duration=h),"number"==typeof a&&(t.iterations=a),r){void 0!==r.driver&&(t.engine=r.driver),void 0!==r.axis&&(t.axis=r.axis),void 0!==r.source&&(t.source=r.source),void 0!==r.subject&&(t.subject=r.subject),void 0!==r.smoothing&&(t.smoothing=r.smoothing),void 0!==r.range&&(t.range=r.range);void 0!==r.pinAlign||void 0!==r.pinTop||void 0!==r.pinDistance?t.pin=l(l(l({},void 0!==r.pinAlign?{align:r.pinAlign}:{}),void 0!==r.pinTop?{top:r.pinTop}:{}),void 0!==r.pinDistance?{distance:r.pinDistance}:{}):void 0!==r.pin&&(t.pin=r.pin)}return u(l({},p),{timeline:t})}const m={type:"clock"};if(void 0!==h&&(m.duration=h),void 0!==o||d){const t=l({},o||{});d&&(t.onFinish="reset"),m.trigger=t}return void 0!==i&&(m.delay=i),void 0!==a&&(m.iterations=a),void 0!==s&&(m.direction=s),void 0!==f&&(m.fill=f),Object.keys(m).length>1?u(l({},p),{timeline:m}):p}function qt(t){var e;if(t)return null==(e=Rt(t))?void 0:e.definitions}function Xt(t){var e;if(!t)return;const n=null==(e=Rt(t))?void 0:e.animateById;return n?Object.entries(n).map(([t,e])=>({id:t.startsWith("#")?t.slice(1):t,animate:e})):void 0}function Qt(t){return null==t?void 0:t.children}var Jt=vt.union([vt.string(),vt.tuple([vt.number(),vt.number(),vt.number(),vt.number()])]),Yt=vt.union([vt.string(),vt.number(),vt.array(vt.number()),vt.object({path:vt.string()}),vt.lazy(()=>vt.object({paths:vt.array(Re)}),{paths:[]}),vt.lazy(()=>vt.array(Ie),[]),vt.lazy(()=>ee,{})]),Ht=vt.object({time:vt.number().optional(),value:Yt.optional(),easing:Jt.optional(),tangentOut:vt.tuple([vt.number(),vt.number()]).optional(),tangentIn:vt.tuple([vt.number(),vt.number()]).optional()}),$t=vt.object({segmentCount:vt.number().optional(),extend:vt.enum([At.before,At.after]).optional(),alternate:vt.boolean().optional()}),te=vt.object({value:Yt.optional(),keyframes:vt.array(Ht).optional(),loop:vt.union([$t,vt.boolean()]).optional(),autoOrient:vt.boolean().optional()}),ee=vt.object({translate:vt.tuple([vt.number(),vt.number()]).optional(),rotate:vt.number().optional(),skew:vt.number().optional(),scale:vt.tuple([vt.number(),vt.number()]).optional(),origin:vt.tuple([vt.number(),vt.number()]).optional()}),ne=vt.union([vt.string(),ee,vt.object({value:ee}),te]),re=vt.record(te),oe=vt.union([vt.string(),vt.array(vt.union([vt.string(),re])),re]),ie=vt.object({startOn:vt.enum(["load","mouseOver","click","scrollIntoView","programmatic"]).optional(),outAction:vt.enum(["continue","pause","reset","reverse"]).optional(),onFinish:vt.enum(["hold","reset"]).optional(),scrollIntoViewThreshold:vt.number().optional()}),ae=vt.object({width:vt.number(),d:vt.string()}),se=vt.object({fontFamily:vt.string(),fontStyle:vt.string(),ascent:vt.number(),unitsPerEm:vt.number(),glyphs:vt.record(ae)}),le=vt.object({easings:vt.record(vt.tuple([vt.number(),vt.number(),vt.number(),vt.number()])).optional(),animations:vt.record(re).optional(),styles:vt.record(vt.record(vt.union([vt.string(),vt.number()]))).optional(),glyphs:vt.record(se).optional()}),ue=vt.object({phase:vt.enum(["cover","contain","entry","exit","entry-crossing","exit-crossing"]).optional(),fraction:vt.number().optional()}),ce=vt.object({start:ue.optional(),end:ue.optional()}),fe=vt.object({driver:vt.enum(["custom","native"]).optional(),kind:vt.enum(["view","scroll"]).optional(),axis:vt.enum(["block","inline","x","y"]).optional(),source:vt.enum(["nearest","root"]).optional(),subject:vt.string().optional(),smoothing:vt.number().optional(),pin:vt.boolean().optional(),pinAlign:vt.enum(["top","center","bottom"]).optional(),pinTop:vt.number().optional(),pinDistance:vt.number().optional(),range:ce.optional()}),de=vt.object({align:vt.enum(["top","center","bottom"]).optional(),top:vt.number().optional(),distance:vt.number().optional()}),he=vt.object({type:vt.literal("clock"),duration:vt.number().optional(),trigger:ie.optional(),delay:vt.number().optional(),iterations:vt.union([vt.number(),vt.literal("infinite")]).optional(),fill:vt.enum(["forwards","backwards","both","none"]).optional(),direction:vt.enum(["normal","reverse","alternate","alternate-reverse"]).optional()}),pe={duration:vt.number().optional(),iterations:vt.number().optional(),engine:vt.enum(["custom","native"]).optional(),axis:vt.enum(["block","inline","x","y"]).optional(),source:vt.enum(["nearest","root"]).optional(),subject:vt.string().optional(),smoothing:vt.number().optional(),pin:vt.union([vt.boolean(),de]).optional(),range:ce.optional()},me=vt.object(l({type:vt.literal("scroll")},pe)),ve=vt.object(l({type:vt.literal("view")},pe)),ge=vt.discriminatedUnion("type",[he,me,ve]),ye=vt.object({mode:vt.enum([bt.auto,bt.waapi,bt.frames]).optional(),frameRate:vt.number().optional(),timeline:ge.optional(),definitions:le.optional(),animateById:vt.record(oe).optional(),debugInstName:vt.string().optional()}),be=vt.object({id:vt.string(),animate:oe}),ke=vt.union([vt.string(),vt.number(),vt.array(vt.number()),vt.object({value:vt.defined()}),ee]),Ae=vt.union([vt.number(),te,vt.object({value:vt.number()})]),xe=vt.union([vt.tuple([vt.number(),vt.number()]),te,vt.object({value:vt.tuple([vt.number(),vt.number()])})]),we=vt.union([vt.string(),te,vt.object({value:vt.string()})]),je=vt.object({translate:xe.optional(),rotate:Ae.optional(),scale:xe.optional(),skew:Ae.optional(),origin:xe.optional()}),Oe=vt.object({copies:vt.number().optional(),translate:xe.optional(),rotate:Ae.optional(),skew:Ae.optional(),scale:xe.optional(),origin:xe.optional()}),Me=vt.object({sourceId:vt.string().optional(),maskType:vt.enum([xt,wt]).optional(),maskUnits:vt.enum([jt,Ot]).optional(),maskContentUnits:vt.enum([jt,Ot]).optional(),x:vt.number().optional(),y:vt.number().optional(),width:vt.number().optional(),height:vt.number().optional()}),Se=vt.object({d:we.optional()}),Pe=vt.object({offset:Ae.optional(),range:xe.optional(),subPaths:vt.enum([Ft.separate,Ft.combined]).optional()}),_e=vt.object({start:vt.number().optional(),stretch:vt.number().optional(),timeCrop:vt.tuple([vt.number(),vt.number()]).optional()}),ze=vt.object({type:vt.enum(["content"]).optional(),sourceId:vt.string().optional(),retime:_e.optional()}),Ie=vt.object({offset:vt.number(),color:vt.string()}),Ne=vt.union([vt.array(Ie),vt.object({value:vt.array(Ie)}),te]),De=vt.object({type:vt.enum([Vt.linear,Vt.radial]),start:xe.optional(),end:xe.optional(),center:xe.optional(),radius:Ae.optional(),focal:xe.optional(),stops:Ne.optional(),gradientUnits:vt.enum([Et.userSpaceOnUse,Et.objectBoundingBox]).optional(),spreadMethod:vt.enum([Bt.pad,Bt.reflect,Bt.repeat]).optional(),gradientTransform:vt.string().optional()}),Fe=De,Ce=vt.object({path:vt.string(),pathOverflow:vt.enum([Mt,St]).optional(),lengthAdjust:vt.enum([Pt,_t]).optional(),method:vt.enum([zt,It]).optional(),spacing:vt.enum([Nt,Dt]).optional(),startOffset:Ae.optional(),textLength:Ae.optional()}),Te=vt.object({useGlyphs:vt.boolean().optional()}),Ue=vt.object({transformBy:je.optional(),repeater:Oe.optional(),maskedBy:Me.optional(),clipPath:Se.optional(),strokeTrim:Pe.optional(),clone:ze.optional(),fillGradient:De.optional(),strokeGradient:Fe.optional(),textPath:Ce.optional(),text:Te.optional()});function Le(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!Ue.isValid(t.effects,r,[o+".effects"]))for(const t of r.errors)n.push(t)}t&&Array.isArray(t.children)&&t.children.forEach((t,e)=>r(t,o+".children["+e+"]"))};return r(t,"root"),n}var Ee=vt.openObject({type:vt.string(),id:vt.string().optional(),meta:vt.any().optional(),effects:Ue.optional(),animate:oe.optional(),style:vt.union([vt.string(),vt.record(vt.union([vt.string(),vt.number()]))]).optional()},ke),Be=vt.openObject(u(l({},Ee._shape),{children:vt.lazy(()=>vt.array(Be),[]).optional()}),ke),Ve=vt.object({width:vt.union([vt.number(),vt.string()]).optional(),height:vt.union([vt.number(),vt.string()]).optional(),viewBox:vt.string().optional(),animator:ye.optional()}),We=vt.openObject(u(l(l({},Ee._shape),Ve._shape),{type:vt.literal("svg"),children:vt.array(Be).optional()}),ke),Re=vt.object({v:vt.array(vt.array(vt.number())),i:vt.array(vt.array(vt.number())).optional(),o:vt.array(vt.array(vt.number())).optional(),c:vt.boolean().optional()});function Ze(t){const e=We.isValid(t);return{valid:e,errors:e?[]:["Document failed schema validation"]}}var Ge=0;function Ke(){return"_px_"+Date.now().toString(36)+(++Ge).toString(36)+Math.random().toString(36).substring(2,6)}function qe(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>qe(t));const e=t,n={};for(const t of Object.keys(e))n[t]=qe(e[t]);return n}function Xe(t){var e,n;const r=qe(t),o=new Map,i=new Set(["href","xlink:href"]),a=new Set(["fill","stroke","clip-path","clipPath","mask","marker","marker-start","marker-mid","marker-end","filter","flood-color","lighting-color"]),s=new Set(["sourceId","targetId","boundElementId"]);!function t(e){if(e&&"object"==typeof e){if(e.id&&"string"==typeof e.id){const t=e.id,n=Ke();o.set(t,n),e.id=n}else e.animate&&(e.id=Ke());if(Array.isArray(e.children))for(const n of e.children)t(n)}}(r),function t(e){if(e&&"object"==typeof e)for(const[n,r]of Object.entries(e))if("children"!==n)if("string"==typeof r)if(i.has(n)&&r.startsWith("#")){const t=r.slice(1),i=o.get(t);i&&(e[n]="#"+i)}else if(a.has(n))e[n]=Qe(r,o);else if(s.has(n)){const t=r.startsWith("#"),i=o.get(t?r.slice(1):r);i&&(e[n]=t?"#"+i:i)}else r.includes("url(#")&&(e[n]=Qe(r,o));else if("style"===n&&"object"==typeof r&&null!==r)for(const[t,e]of Object.entries(r))"string"==typeof e&&(r[t]=Qe(e,o));else"object"==typeof r&&null!==r&&t(r);else if(Array.isArray(r))for(const e of r)t(e)}(r);const c=null==(e=r.animator)?void 0:e.animateById;if(c&&"object"==typeof c){const t={};for(const[e,r]of Object.entries(c)){const i=e.startsWith("#"),a=i?e.slice(1):e,s=null!=(n=o.get(a))?n:a;t[i?"#"+s:s]=r}r.animator=u(l({},r.animator),{animateById:t})}return r}function Qe(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}var Je=new Set(["script","foreignobject"]),Ye=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),He=new Set(["href","xlink:href","src"]),$e=new Set(["mixBlendMode","isolation"]),tn=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,en=/^data:image\/svg\+xml(?:;[^,]*)?,/i,nn=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,rn=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function on(t,e){const n=t.toLowerCase();if(!function(t){return!!t.startsWith("on")}(n)){if("fill"===n||"stroke"===n||"stopcolor"===n){const t=String(e);return t.includes("url(")&&!/^url\(#[^)]+\)$/.test(t)?void console.warn('Attribute "'+n+'" blocked: url() must be internal url(#id), got:',e):e}if(Ye.has(n)){const t=String(e);return t.startsWith("#")||(/^url\(#[^)]+\)$/.test(t)||He.has(n)&&(tn.test(t)||en.test(t)||function(t){const e=nn.exec(t);return!!e&&rn.some(t=>e[1].startsWith(t))}(t)))?e:void console.warn('Attribute "'+n+'" blocked: must be #id, url(#id), or data:image/… URI, got:',e)}return e}console.warn("Attribute blocked (event handler / dangerous): ",n)}function an(t,e){var n;if(t)return"string"==typeof t?null==(n=null==e?void 0:e.styles)?void 0:n[t]:t}function sn(t){const e={};for(const n of Object.keys(t)){const r=N(n);if(Ut.has(r))continue;if("style"===r)continue;let o=t[n];if(O.has(r)&&Array.isArray(o))e[r]=w(o);else if("transform"!==r||null===o||"object"!=typeof o||Array.isArray(o)||o.keyframes)M.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),e.transform=r+"("+o+")"):Array.isArray(o)?e[r]=o.join(","):null!=o&&(e[r]=String(o));else{const t=o.value&&"object"==typeof o.value?o.value:o;e.transform=P(t,{withUnits:!1})}}return e}function ln(t){var e;const n=null!=(e=t.value)?e:t.v;if(!n)return;if(Array.isArray(n)&&n.length>=2&&"number"==typeof n[0]&&"number"==typeof n[1])return[n[0],n[1]];const r=n.translate;return Array.isArray(r)&&r.length>=2?[r[0],r[1]]:void 0}function un(t){var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0}function cn(t){var e;return null!=(e=t.easing)?e:t.e}function fn(t){var e,n;const r=t.keyframes;if(!Array.isArray(r))return!1;if(t.autoOrient)return!0;for(const t of r)if((null!=(e=t.tangentIn)?e:t.ti)||(null!=(n=t.tangentOut)?n:t.to))return!0;return!1}var dn=new WeakMap;function hn(t,e,n,r){var o,i;let a=dn.get(t);const s=null==a?void 0:a.get(e);if(s)return s;const l=null!=(o=t.tangentOut)?o:t.to,u=null!=(i=e.tangentIn)?i:e.ti,c=[n[0]+(l?l[0]:0),n[1]+(l?l[1]:0)],f=[r[0]+(u?u[0]:0),r[1]+(u?u[1]:0)],d=V(n,c,f,r),h={P0:n,P1:c,P2:f,P3:r,lut:d,totalArc:d.ds[d.ds.length-1]};return a||(a=new WeakMap,dn.set(t,a)),a.set(e,h),h}function pn(t,e,n,r,o,i){const a=hn(t,e,n,r),s=0===a.totalArc?o:function(t,e){const n=t.ds[t.ds.length-1],r=e*n,{ts:o,ds:i}=t,a=i.length-1;if(r<=0)return o[0];if(r>=i[a])return o[a];let s=1,l=a;for(;s<l;){const t=s+l>>>1;i[t]<r?s=t+1:l=t}const u=i[l-1],c=i[l]-u,f=c>0?(r-u)/c:0;return o[l-1]+f*(o[l]-o[l-1])}(a.lut,o),l=U(a.P0,a.P1,a.P2,a.P3,s);if(!i)return{translate:l};const u=E(a.P0,a.P1,a.P2,a.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}function mn(t,e){var n,r,o;if(!fn(t))return t;const i=t.keyframes;if(!Array.isArray(i)||i.length<2)return t;const a=!!t.autoOrient,s=null!=(n=null==e?void 0:e.flatnessTolerance)?n:.5,l=null!=(r=null==e?void 0:e.rotationTolerance)?r:5,u=null!=(o=null==e?void 0:e.maxSamplesPerSegment)?o:32,c=[],f=ln(i[0]);if(!f)return t;const d=a?function(t,e){const n=ln(t),r=ln(e);if(!n||!r)return 0;const o=hn(t,e,n,r),i=E(o.P0,o.P1,o.P2,o.P3,0);return 180*Math.atan2(i[1],i[0])/Math.PI}(i[0],i[1]):void 0;c.push(gn(un(i[0]),kn(yn(i[0]),yn(i[0]),0,f,d,a)));for(let t=0;t<i.length-1;t++){const e=i[t],n=i[t+1],r=ln(e),o=ln(n);r&&o?(a&&t>0&&xn(c,e,n,r,o,l),jn(c,e,n,r,o,a,s,l,u)):c.push(gn(un(n),kn(yn(n),yn(n),1,null!=o?o:[0,0],void 0,a)))}const h=cn(i[i.length-1]);h&&(c[c.length-1].e=h),a&&vn(c);const p={keyframes:c};return void 0!==t.loop&&(p.loop=t.loop),p}function vn(t){var e;let n;for(const r of t){const t=null!=(e=r.v)?e:r.value;if(!t||"number"!=typeof t.rotate)continue;if(void 0===n){n=t.rotate;continue}let o=t.rotate;for(;o-n>180;)o-=360;for(;o-n<-180;)o+=360;t.rotate=o,n=o}}function gn(t,e){return{t:t,v:e}}function yn(t){var e;const n=null!=(e=t.value)?e:t.v;if(n&&"object"==typeof n&&!Array.isArray(n))return n}function bn(t,e,n){if(void 0===t)return e;if(void 0===e)return t;if("number"==typeof t&&"number"==typeof e)return t+(e-t)*n;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){const r=new Array(t.length);for(let o=0;o<t.length;o++){const i="number"==typeof t[o]?t[o]:0,a="number"==typeof e[o]?e[o]:0;r[o]=i+(a-i)*n}return r}return n<.5?t:e}function kn(t,e,n,r,o,i){const a={translate:r},s=new Set;if(t)for(const e of Object.keys(t))s.add(e);if(e)for(const t of Object.keys(e))s.add(t);for(const r of s){if("translate"===r)continue;if("rotate"===r&&i)continue;const o=null==t?void 0:t[r],s=null==e?void 0:e[r];void 0===o&&void 0===s||(a[r]=bn(o,s,n))}return void 0!==o&&(a.rotate=o+An(t,e,n)),a}function An(t,e,n){const r="number"==typeof(null==t?void 0:t.rotate)?t.rotate:void 0,o="number"==typeof(null==e?void 0:e.rotate)?e.rotate:void 0;if(void 0===r&&void 0===o)return 0;const i=bn(r,o,n);return"number"==typeof i?i:0}function xn(t,e,n,r,o,i){var a;const s=t[t.length-1],l=null!=(a=s.v)?a:s.value,u=null==l?void 0:l.rotate;if("number"!=typeof u)return;const c=yn(e),f=u-An(c,c,0),d=hn(e,n,r,o),h=E(d.P0,d.P1,d.P2,d.P3,0),p=180*Math.atan2(h[1],h[0])/Math.PI,m=function(t,e){let n=t-e;for(;n>180;)n-=360;for(;n<-180;)n+=360;return n}(p,f);if(Math.abs(m)<=i)return;const v=un(e),g=Math.min(v+wn,(v+un(n))/2),y=kn(yn(e),yn(e),0,r,p,!0);t.push(gn(g,y))}var wn=.05;function jn(t,e,n,r,o,i,a,s,l){const u=hn(e,n,r,o),c=un(e),f=un(n),d=cn(e),h=(p=d)?y([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=yn(e),v=yn(n),g=function(t,e,n,r,o){const i=[];On(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),On(t.P0[1],t.P1[1],t.P2[1],t.P3[1],i),i.sort((t,e)=>t-e);const a=[0];for(const t of i)t>a[a.length-1]+1e-6&&t<.999999&&a.push(t);a.push(1);const s=[],l={remaining:o-a.length};for(let o=0;o<a.length-1;o++)Mn(a[o],a[o+1],s,t,e,n,r,l);return s}(u,i,a,s,l),b=[];for(const t of g){const e=W(u.lut,t),n=T(u.totalArc>0?e/u.totalArc:t,0,1),r={u:T(h(n),0,1),p:n,pos:U(u.P0,u.P1,u.P2,u.P3,t)};if(i){const e=E(u.P0,u.P1,u.P2,u.P3,t);r.rotateDeg=180*Math.atan2(e[1],e[0])/Math.PI}b.push(r)}let k=d,x=0;const w=t.length-1;for(let e=0;e<b.length;e++){const n=b[e],r=x<1?T((n.u-x)/(1-x),0,1):1,{left:o,right:a}=A(k,r),s=0===e?w:t.length-1;o?t[s].e=o:delete t[s].e;const l=c+n.u*(f-c),u=kn(m,v,n.p,n.pos,n.rotateDeg,i);t.push(gn(l,u)),k=a,x=n.u}}function On(t,e,n,r,o){const i=e-t,a=n-e,s=i-2*a+(r-n),l=2*(a-i),u=i;if(Math.abs(s)<1e-10){if(Math.abs(l)>1e-10){const t=-u/l;t>1e-6&&t<.999999&&o.push(t)}return}const c=l*l-4*s*u;if(c<0)return;const f=Math.sqrt(c),d=(-l-f)/(2*s),h=(-l+f)/(2*s);d>1e-6&&d<.999999&&o.push(d),h>1e-6&&h<.999999&&o.push(h)}function Mn(t,e,n,r,o,i,a,s){const l=(t+e)/2,u=U(r.P0,r.P1,r.P2,r.P3,t),c=U(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=U(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=U(r.P0,r.P1,r.P2,r.P3,l),p=U(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(Sn(d,u,c),Sn(h,u,c),Sn(p,u,c));let v=!0;if(o){const n=E(r.P0,r.P1,r.P2,r.P3,t),o=E(r.P0,r.P1,r.P2,r.P3,e),i=180*Math.atan2(n[1],n[0])/Math.PI,s=180*Math.atan2(o[1],o[0])/Math.PI;let l=Math.abs(i-s);l>180&&(l=360-l),l>a&&(v=!1)}m<=i&&v||s.remaining<=0||f<1e-6?n.push(e):(s.remaining-=1,Mn(t,l,n,r,o,i,a,s),Mn(l,e,n,r,o,i,a,s))}function Sn(t,e,n){const r=n[0]-e[0],o=n[1]-e[1],i=r*r+o*o;if(i<1e-20){const n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}const a=(t[0]-e[0])*o-(t[1]-e[1])*r;return Math.abs(a)/Math.sqrt(i)}function Pn(t,e){const n=_n(t,e);return null!=n?n:t}function _n(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=_n(t.children[r],e);null!==o&&(n||(n=t.children.slice()),n[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o,n=t.transform;if(n&&"object"==typeof n&&fn(n)){const o=mn(n,e);o!==n&&(r=u(l({},t),{transform:o}))}}if(!n&&!r)return null;const i=l({},t);return n&&(i.children=n),r&&(i.animate=r),i}var zn=1;function In(t,e){if(t===e)return!0;if(typeof t!=typeof e||null===t||null===e||"object"!=typeof t)return!1;if(Array.isArray(t)!==Array.isArray(e))return!1;const n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(n=>In(t[n],e[n]))}function Nn(t){const e=[];let n;const r=function(t){const e=t.split(/([MLCZmlcz]|[\s,]+)/).map(t=>t.trim()).filter(t=>t&&","!==t),n=[];let r=null;for(const t of e)if(/[MLCZmlcz]/.test(t))r={type:t,values:[]},n.push(r);else if(r){const e=+t;r.values.push(Number.isNaN(e)?0:e)}return n}(t);for(const t of r){const r=t.type,o=t.values;if("M"===r||"m"===r){const t=o[0]||0,r=o[1]||0;n={v:[[t,r]],i:[[t,r]],o:[[t,r]],c:!1},e.push(n);continue}if(n||(n={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},e.push(n)),"L"===r){const t=o[0]||0,e=o[1]||0;n.v.push([t,e]),n.i.push([t,e]),n.o.push([t,e])}else if("C"===r){const t=o[0]||0,e=o[1]||0,r=o[2]||0,i=o[3]||0,a=o[4]||0,s=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([a,s]),n.i.push([r,i]),n.o.push([a,s])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function Dn(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function Fn(t){return"string"==typeof t&&void 0!==Dn(t)}function Cn(t){if(t&&"object"==typeof t&&"string"==typeof t.path){const e=Dn(t.path);return e?{paths:Nn(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&Fn(e[0])){const t=[];for(const n of e){const e=Dn(n);e&&t.push(...Nn(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&Fn(t[0])){const e=[];for(const n of t){const t=Dn(n);t&&e.push(...Nn(t))}return{paths:e}}return{paths:t}}if(Fn(t)){return{paths:Nn(Dn(t))}}return t}function Tn(t,e){var n;if(t)return Array.isArray(t)?t:(null==(n=null==e?void 0:e.easings)?void 0:n[t])?e.easings[t]:void console.warn("Unknown easing name: "+t)}function Un(t,e){var n;if("string"==typeof t){const r=null==(n=null==e?void 0:e.animations)?void 0:n[t];return r||console.warn("Unknown animation name: "+t),r}return t}function Ln(t,e,n,r){var o,i;if("d"===t){return{paths:m(null!=(o=null==e?void 0:e.paths)?o:Array.isArray(e)?e:[],null!=(i=null==n?void 0:n.paths)?i:Array.isArray(n)?n:[],r)}}return O.has(t)?p(e||[0,0,0,1],n||[0,0,0,1],r):"transform"!==t||"object"!=typeof e||null===e||Array.isArray(e)||"object"!=typeof n||null===n||Array.isArray(n)?"rotate"===t&&"number"==typeof e&&"number"==typeof n?d(e,n,r):M.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?h(e||[],n||[],r):d(+(e||0),+(n||0),r):function(t,e,n){const r=new Set([...Object.keys(null!=t?t:{}),...Object.keys(null!=e?e:{})]),o={};for(const i of r){const r=null==t?void 0:t[i],a=null==e?void 0:e[i];if("rotate"===i||"skew"===i)o[i]=d(+(null!=r?r:0),+(null!=a?a:0),n);else if("translate"===i||"scale"===i||"origin"===i){const t="scale"===i?[1,1]:[0,0];o[i]=h(r||t,a||t,n)}else o[i]=null!=a?a:r}return o}(e,n,r)}function En(t,e,n,r){var o,i,a,s,c;const f=e.length-1,d=T(null!=(o=n.segmentCount)?o:f,1,f);let h;h=n.extend===At.before?e.slice(0,d+1):e.slice(f-d);const p=null!=(i=e[0].t)?i:0,m=null!=(a=e[e.length-1].t)?a:0;let v,g;n.extend===At.before?(v=0,g=p):(v=m,g=r);const b=g-v;if(b<=0)return e;const k=null!=(s=h[0].t)?s:0,w=(null!=(c=h[h.length-1].t)?c:0)-k;if(w<=0)return e;const j=h.map(t=>{var e,n;return{relT:(t.t-k)/w,v:t.v,e:t.e,tangentIn:null!=(e=t.tangentIn)?e:t.ti,tangentOut:null!=(n=t.tangentOut)?n:t.to}}),O=Math.floor(b/w),M=b-O*w,S=M/w,P=[],_=n.extend!==At.before,z=e[e.length-1];let I,N=!1;function D(e,n,r){var o;let i;if(n){i=[];for(let t=j.length-1;t>=0;t--)i.push({relT:1-j[t].relT,v:j[t].v,e:t>0?x(j[t-1].e):void 0,tangentIn:j[t].tangentOut,tangentOut:j[t].tangentIn})}else i=j;const a=void 0!==r?r:1;for(let n=0;n<i.length;n++){const r=i[n];if(r.relT>a+1e-9){const o=i[n-1],s=r.relT-o.relT,l=(a-o.relT)/s,u=o.e?y(o.e)(l):l,c=Ln(t,o.v,r.v,u),{left:f}=A(o.e,l);return P.length>0&&o.relT<=a&&(P[P.length-1].e=f),void P.push({t:e+a*w,v:c,e:void 0})}const s=P.length>0?P[P.length-1]:z,l=_&&0===n&&void 0!==s&&Math.abs((null!=(o=s.t)?o:0)-(e+r.relT*w))<1e-9;if(l){if(In(s.v,r.v)){P.length>0?(s.e=r.e,s.tangentOut=r.tangentOut):(I=r.e,N=!0);continue}P.length>0&&(delete s.tangentIn,delete s.tangentOut)}const u={t:e+r.relT*w+(l?1:0),v:r.v,e:n<i.length-1?r.e:void 0};r.tangentIn&&(u.tangentIn=r.tangentIn),r.tangentOut&&(u.tangentOut=r.tangentOut),P.push(u)}}if(n.extend===At.before){if(S>1e-9){!function(e,n,r){let o;if(n){o=[];for(let t=j.length-1;t>=0;t--)o.push({relT:1-j[t].relT,v:j[t].v,e:t>0?x(j[t-1].e):void 0,tangentIn:j[t].tangentOut,tangentOut:j[t].tangentIn})}else o=j;const i=1-r;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT<i-1e-9)continue;const a=o[n-1];if(a&&a.relT<i-1e-9&&r.relT>i+1e-9){const n=r.relT-a.relT,o=(i-a.relT)/n,s=a.e?y(a.e)(o):o,l=Ln(t,a.v,r.v,s),{right:u}=A(a.e,o);P.push({t:e,v:l,e:u})}const s={t:e+(r.relT-i)*w,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),P.push(s)}}(v,!!n.alternate&&O%2==0,S)}for(let t=0;t<O;t++){const e=O-1-t,r=!!n.alternate&&e%2==0;D(v+M+t*w,r)}}else{for(let t=0;t<O;t++){const e=!!n.alternate&&t%2==0;D(v+t*w,e)}if(S>1e-9){const t=!!n.alternate&&O%2==0;D(v+O*w,t,S)}}if(n.extend===At.before)return[...P,...e];if(N&&e.length>0){return[...e.slice(0,-1),u(l({},e[e.length-1]),{e:I}),...P]}return[...e,...P]}function Bn(t,e,n,r){var o,i,a,s,l,u,c;const f=e.keyframes||[],d=[];for(const e of f){const n=null!=(i=null!=(o=e.time)?o:e.t)?i:0;let f=null!=(a=e.value)?a:e.v;const h=null!=(s=e.easing)?s:e.e;"d"===t&&(f=Cn(f));const p=D(t)?C(t):t;O.has(p)&&(f=null!=(l=j(f))?l:f);const m={t:n,v:f,e:Tn(h,r)},v=null!=(u=e.tangentIn)?u:e.ti,g=null!=(c=e.tangentOut)?c:e.to;v&&(m.tangentIn=v),g&&(m.tangentOut=g),d.push(m)}d.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const h=e.loop,p=!0===h?{}:h||void 0;return p&&d.length>=2?En(t,d,p,n):d}function Vn(t,e,n){const r=e.loop;if(null==r||!1===r)return e;const o=!0===r?{}:r,i=e.keyframes;if(!Array.isArray(i)||i.length<2)return e;const a=D(t)?C(t):t,s=O.has(a),l=i.map(e=>{var n,r,o,i,a,l,u,c;const f=null!=(n=e.t)?n:e.time;let d=null!=(r=e.v)?r:e.value;"d"===t&&(d=Cn(d)),s&&(d=null!=(o=j(d))?o:d);const h={t:f,v:d,e:null!=(i=e.e)?i:e.easing};return(null!=(a=e.tangentIn)?a:e.ti)&&(h.tangentIn=null!=(l=e.tangentIn)?l:e.ti),(null!=(u=e.tangentOut)?u:e.to)&&(h.tangentOut=null!=(c=e.tangentOut)?c:e.to),h}),u={keyframes:En(t,l,o,n)};return void 0!==e.autoOrient&&(u.autoOrient=e.autoOrient),u}function Wn(t,e){const n=Rn(t,e);return null!=n?n:t}function Rn(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=Rn(t.children[r],e);null!==o&&(n||(n=t.children.slice()),n[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o;for(const n of Object.keys(t)){const o=t[n],i=Vn(n,o,e);i!==o&&(r||(r=l({},t)),r[n]=i)}}if(!n&&!r)return null;const i=l({},t);return n&&(i.children=n),r&&(i.animate=r),i}var Zn=0;function Gn(t,e){if(!t)return t;const n=e&&"object"==typeof e&&!Array.isArray(e)?e:_(e);if(!n||!Object.keys(n).length)return t;const r=t=>t&&"object"==typeof t&&!Array.isArray(t)?l(l({},n),t):t,o=t.transform;if(o&&"object"==typeof o){const e=o;if(Array.isArray(e.keyframes)){const n=u(l({},e),{keyframes:e.keyframes.map(t=>u(l({},t),{value:r(t.value)}))});return void 0!==n.value&&(n.value=r(n.value)),u(l({},t),{transform:n})}return t}const i=Object.keys(t).filter(t=>M.has(t));if(1!==i.length)return t;const a=i[0],s=t[a];if(!s||"object"!=typeof s||!Array.isArray(s.keyframes))return t;const c=u(l({},s),{keyframes:s.keyframes.map(t=>u(l({},t),{value:u(l({},n),{[a]:t.value})}))});void 0!==c.value&&(c.value=u(l({},n),{[a]:c.value}));const f=l({},t);return delete f[a],u(l({},f),{transform:c})}function Kn(t,e=kt.waapi){const n=Rt(t)||{},r=qt(t),o=n.duration||1e3,i=[],a=(t,n,i)=>{if(!n)return null;const a=function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=Un(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=Un(r,e);t&&n.push(t)}else n.push(t);return n}(n,r);if(0===a.length)return null;const s=function(t,e,n,r=kt.waapi){const o={};for(const[i,a]of Object.entries(t)){if("transform"===i&&"offsetPath"===a.alongPathMode&&void 0!==t.offsetDistance)continue;const s=Bn(i,a,e,n);if(s.length>0){const t={keyframes:s};void 0!==a.autoOrient&&(t.autoOrient=a.autoOrient),void 0!==a.loop&&(t.loop=a.loop),o[i]=r===kt.waapi&&"transform"===i?mn(t):t}}return o}(Gn(function(t){const e={};for(const n of t)for(const[t,r]of Object.entries(n))e[t]=r;return e}(a),i),o,r,e);return 0===Object.keys(s).length?null:{id:t,animate:s}},s=Xt(t);if(s)for(const t of s){const e=a(t.id,t.animate);e&&i.push(e)}const l=t=>{const e=t.animate;if(e&&Object.keys(e).length>0){const n=t.id||"_px_el_"+ ++Zn;t.id=n;const r=a(n,e,t.transform);r&&i.push(r)}if(t.children)for(let e=0;e<t.children.length;e++)l(t.children[e])};if(t.children)for(let e=0;e<t.children.length;e++)l(t.children[e]);return i}function qn(t,e,n){var r,o,i,a,s,l,u;const c=e.keyframes||[];if(0===c.length)return null;const{prevKf:v,nextKf:g}=function(t,e){var n,r;const o=t.length-1;let i=t[0],a=t[o>0?1:0];for(let s=0;s<o;s++){const l=null!=(n=t[s].t)?n:0,u=null!=(r=t[s+1].t)?r:0;if(l<=e&&e<=u){i=t[s],a=t[s+1];break}e>u&&s===o-1&&(i=t[o>0?o-1:0],a=t[o])}return{prevKf:i,nextKf:a}}(c,n);let b=v===g?0:(k=n,A=null!=(r=v.t)?r:0,x=null!=(o=g.t)?o:0,j=0,M=1,x===A?j:j+(k-A)/(x-A)*(M-j));var k,A,x,j,M;b=T(b,0,1);const _=null!=(i=v.e)?i:v.easing;if(_&&Array.isArray(_))try{b=y(_)(b)}catch(t){}let z=D(t)?C(t):t,I=null;const N=null!=(a=null==v?void 0:v.v)?a:null==v?void 0:v.value,F=null!=(s=null==g?void 0:g.v)?s:null==g?void 0:g.value;if("d"===z){I=m(null!=(l=null==N?void 0:N.paths)?l:Array.isArray(N)?N:[],null!=(u=null==F?void 0:F.paths)?u:Array.isArray(F)?F:[],b).map(t=>f(t)).join("")}else if(O.has(z))I=w(p(N||[0,0,0,1],F||[0,0,0,1],b)),z=t;else if("stroke-dasharray"===z)I=h(N||[],F||[],b).join(" "),z=t;else if("transform"!==z||null===N||"object"!=typeof N||Array.isArray(N))if("translate"===z){I="translate("+h(N||[0,0],F||[0,0],b).join(",")+")",z="transform"}else if("rotate"===z){I="rotate("+d(+(N||0),+(F||0),b)+")",z="transform"}else if("scale"===z){I="scale("+h(N||[1,1],F||[1,1],b).join(",")+")",z="transform"}else{I=d(+(N||0),+(F||0),b)}else{const t=new Set([...N?Object.keys(N):[],...F?Object.keys(F):[]]),n={};for(const e of t){const t=null==N?void 0:N[e],r=null==F?void 0:F[e];if("rotate"===e||"skew"===e)n[e]=d(+(null!=t?t:0),+(null!=r?r:0),b);else if("translate"===e||"scale"===e||"origin"===e){const o="scale"===e?[1,1]:[0,0],i=h(t||o,r||o,b);n[e]=i}}if(fn(e)){const t=N.translate,r=F.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=pn(v,g,[+t[0],+t[1]],[+r[0],+r[1]],b,!!e.autoOrient);n.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(n.rotate=o.rotateDeg)}}I=P(n,{withUnits:!1}),z="transform"}return S.has(z)&&"number"==typeof I&&(I=100*I+"%"),{k:z,v:null===I?"":""+I}}function Xn(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=qn(r,o,e);t&&(n[t.k]=t.v)}return n}function Qn(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Qn);const e={};for(const n of Object.keys(t))e[n]=Qn(t[n]);return e}function Jn(t,e){const n=new Map,r=t=>{var o;if("string"==typeof t.id){const r=e();n.set(t.id,r),t.id=r}null==(o=t.children)||o.forEach(r)};r(t);const o=t=>t.replace(/url\(#([^)]+)\)/g,(t,e)=>{const r=n.get(e);return r?"url(#"+r+")":t}),i=t=>{var e;if("string"==typeof t.href&&t.href.startsWith("#")){const e=n.get(t.href.slice(1));e&&(t.href="#"+e)}for(const e of Object.keys(t)){if("children"===e||"effects"===e||"meta"===e||"animate"===e||"href"===e||"id"===e)continue;const n=t[e];"string"==typeof n&&-1!==n.indexOf("url(#")&&(t[e]=o(n))}null==(e=t.children)||e.forEach(i)};return i(t),n}function Yn(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function Hn(t){var e;const n=Yn(t.x),r=Yn(t.y);if(delete t.x,delete t.y,!n&&!r)return t;const o="translate("+n+","+r+")";if(void 0!==t.transform||void 0!==t.animate){const n={type:"g",transform:o,children:null!=(e=t.children)?e:[]};t.children=[n]}else t.transform=o;return t}function $n(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=er(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=rr(t.viewBox);if(e)return[e[2],e[3]];const n=tr(t.width),r=tr(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),a=[],s=or(t,n,r,()=>"_lw_use_mat_"+ ++o,a,i);if(0===a.length)return s;const c={type:"defs",children:a},f=[...null!=(e=s.children)?e:[],c];return u(l({},s),{children:f})}function tr(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function er(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function nr(t,e,n,r,o,i,a){var s,c,f,d;const h=Qn(e);Jn(h,o);const p="symbol"===h.type?rr(h.viewBox):void 0,m=null!=(c=null!=(s=tr(t.width))?s:null==p?void 0:p[2])?c:a[0],v=null!=(d=null!=(f=tr(t.height))?f:null==p?void 0:p[3])?d:a[1],g="symbol"===h.type?function(t,e,n,r,o){const i=rr(t.viewBox),a=u(l({},t),{type:"g"});if(delete a.viewBox,delete a.preserveAspectRatio,delete a.width,delete a.height,!i)return a;const[s,c,f,d]=i,h=f>0&&d>0?Math.min(r/f,o/d):1,p=(r-f*h)/2,m=(o-d*h)/2,v=[];0===p&&0===m||v.push("translate("+p+","+m+")");1!==h&&v.push("scale("+h+")");0===s&&0===c||v.push("translate("+-s+","+-c+")");v.length&&(a.transform=v.join(""));const g=e();return n.push({type:"clipPath",id:g,children:[{type:"rect",x:s,y:c,width:f,height:d}]}),a.clipPath="url(#"+g+")",a}(h,o,i,m,v):h,y=or(g,n,r,o,i,a),b=u(l({},t),{type:"g",children:[y]});return delete b.href,delete b.width,delete b.height,Hn(b)}function rr(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 or(t,e,n,r,o,i){if("use"===t.type&&"string"==typeof t.href){const a=er(t.href);if(a&&n.has(a)){const s=e.get(a);if(s)return nr(t,s,e,n,r,o,i)}}if(!t.children)return t;let a=!1;const s=t.children.map(t=>{const s=or(t,e,n,r,o,i);return s!==t&&(a=!0),s});return a?u(l({},t),{children:s}):t}function ir(t,e,n){const r={};return"translate"===t?r.translate=e:"rotate"===t?r.rotate=e:"skew"===t?r.skew=e:r.scale=e,n&&"translate"!==t&&(r.origin=n),r}function ar(t){var e,n,r;if(void 0===t)return{kind:"absent"};if(Array.isArray(t))return{kind:"static",value:t};if("object"==typeof t){const o=t,i=null!=(e=o.keyframes)?e:o.kfs;if(i){const t={kind:"animated",keyframes:i.map(lr),autoOrient:o.autoOrient,loop:o.loop},e=null!=(n=o.value)?n:o.v;return void 0!==e&&"animated"===t.kind&&(t.base=e),t}const a=null!=(r=o.value)?r:o.v;if(void 0!==a)return{kind:"static",value:a}}return{kind:"static",value:t}}function sr(t,e,n,r){var o,i,a,s;const u=t=>(null==r?void 0:r.asString)&&null!=t?String(t):t;if("absent"===n.kind)return;if("static"===n.kind)return void(t[e]=u(n.value));const c=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,f=l({},c||{}),d={keyframes:n.keyframes};void 0!==n.loop&&(d.loop=n.loop),void 0!==n.autoOrient&&(d.autoOrient=n.autoOrient),f[e]=d,t.animate=f;const h=null!=(s=null!=(i=n.base)?i:null==(o=n.keyframes[0])?void 0:o.value)?s:null==(a=n.keyframes[0])?void 0:a.v;void 0!==h&&(t[e]=u(h))}function lr(t){if(!t||"object"!=typeof t)return t;const e=t;if(void 0===e.t&&void 0===e.v&&void 0===e.e&&void 0===e.to&&void 0===e.ti)return t;const n=l({},e);return void 0===n.time&&void 0!==e.t&&(n.time=e.t),void 0===n.value&&void 0!==e.v&&(n.value=e.v),void 0===n.easing&&void 0!==e.e&&(n.easing=e.e),void 0===n.tangentOut&&void 0!==e.to&&(n.tangentOut=e.to),void 0===n.tangentIn&&void 0!==e.ti&&(n.tangentIn=e.ti),n}function ur(t,e){const n={value:e};return void 0!==t.time&&(n.time=t.time),void 0!==t.easing&&(n.easing=t.easing),void 0!==t.tangentOut&&(n.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(n.tangentIn=t.tangentIn),n}function cr(t,e,n){if(!e)return t;delete t.transform;let r=t;return r=dr(r,e.origin,!0),r=fr(r,"scale",e.scale,n),r=fr(r,"skew",e.skew,n),r=fr(r,"rotate",e.rotate,n),r=dr(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=fr(r,"translate",e.translate,n):(r=dr(r,e.origin,!0),r=fr(r,"translate",e.translate,n),r=dr(r,e.origin,!1)),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function fr(t,e,n,r){if(void 0===n)return t;const o=ar(n);if("static"===o.kind)return{type:"g",transform:{value:ir(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>ur(t,ir(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 dr(t,e,n){if(void 0===e)return t;const r=ar(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=>ur(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function hr(t,e){return"_lw_"+e+"_"+t.nextId++}function pr(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function mr(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>mr(t,e))}var vr=Qn;function gr(t,e,n){var r,o,i;if("use"===t.type&&"content"===(null==(o=null==(r=t.effects)?void 0:r.clone)?void 0:o.type)){const r=pr(t.effects.clone.sourceId);"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(i=t.children)||i.forEach(t=>gr(t,e,n))}function yr(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=kr(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 u=void 0!==(null==e?void 0:e.translate),c=a||u,f=a&&kr((null==(r=t.animate)?void 0:r.transform)||void 0)||a&&kr((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=br(i.full),r=br(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);c?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)?f&&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=l({},r);delete e.translate;const n=Object.keys(e).length>0;c||(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=kr(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 u=t;u=cr(u,s,o);let c={type:"g",id:n,children:[{type:"g",id:r,children:[u]}]};return void 0!==i.transform&&(c.transform=i.transform),void 0!==i.animate&&(c.animate=i.animate),a&&(delete c.id,c=cr(c,a,o),c.id=n),c}function br(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 kr(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 Ar(t,e,n,r){if(!e)return t;const o=hr(n,"grad"),i=function(t,e){const n={type:t.type===Vt.radial?"radialGradient":"linearGradient",id:e};t.type===Vt.linear?(xr(n,"x1","y1",t.start),xr(n,"x2","y2",t.end)):(xr(n,"cx","cy",t.center),function(t,e,n){const r=ar(n);if("absent"===r.kind)return;sr(t,e,r,{asString:!0})}(n,"r",t.radius),xr(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,r,o;if(!t)return[];const i=ar(t);if("absent"===i.kind)return[];if("static"===i.kind)return Array.isArray(i.value)?i.value.map(wr):[];const a=i.keyframes;if(!a.length)return[];const s=i.loop;let l=0;for(const t of a){const n=null!=(e=t.value)?e:t.v;Array.isArray(n)&&n.length>l&&(l=n.length)}if(!l)return[];const u=null!=(n=a[0].value)?n:a[0].v,c=[];for(let t=0;t<l;t++){const e=null!=(o=null!=(r=null==u?void 0:u[t])?r:jr(a,0,t))?o:{offset:t/Math.max(1,l-1),color:"#000000"};c.push({offset:e.offset,color:e.color})}return c.map((t,e)=>function(t,e,n,r,o){var i,a,s,l,u;const c=[],f=[];let d=!1;for(const r of e){const o=null!=(a=null!=(i=r.time)?i:r.t)?a:0,h=null!=(s=r.value)?s:r.v,p=null!=(l=null==h?void 0:h[n])?l:jr(e,e.indexOf(r),n);if(!p)continue;const m=null!=(u=r.easing)?u:r.e,v={time:o,value:p.color};void 0!==m&&(v.easing=m),c.push(v);const g={time:o,value:p.offset};void 0!==m&&(g.easing=m),f.push(g),p.offset!==t.offset&&(d=!0)}const h={type:"stop",offset:Or(t.offset),stopColor:t.color},p={};c.length&&(p.stopColor={keyframes:c},void 0!==o&&(p.stopColor.loop=o));d&&f.length&&(p.offset={keyframes:f},void 0!==o&&(p.offset.loop=o));Object.keys(p).length&&(h.animate=p);return h}(t,a,e,0,s))}(t.stops),n}(e,o);return n.defs.push(i),t[r]="url(#"+o+")",t}function xr(t,e,n,r){var o,i,a;const s=ar(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 wr(t){return{type:"stop",offset:Or(t.offset),stopColor:t.color}}function jr(t,e,n){var r,o;for(let o=e;o>=0;o--){const e=null!=(r=t[o].value)?r:t[o].v;if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=null!=(o=t[r].value)?o:t[r].v;if(null==e?void 0:e[n])return e[n]}}function Or(t){return Math.round(1e3*t)/10+"%"}function Mr(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.path?t.path:void 0}function Sr(t,e,n,r){if(!e)return t;const o=pr(e.sourceId);if(!o)return r.errors.push("maskedBy.sourceId missing — cannot build mask"),t;const i=hr(r,"mask");let a={type:"use",href:"#"+o};if(n)a=Pr(a,n,r);else if(Nr(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=[],c=[];for(const t of i){const e=(null!=(n=t.value)?n:t.v)||{},r=ur(t,void 0);if(Array.isArray(e.translate)&&a.push(u(l(l({},r),Ir(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(u(l({},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]]),c.push(u(l({},r),{value:t}))}}const f=null==o?void 0:o.loop,d=t=>{const e={keyframes:t};return void 0!==f&&(e.loop=f),e};let h=t;a.length&&(h={type:"g",animate:{transform:d(a)},children:[h]});s.length&&(h={type:"g",animate:{transform:d(s)},children:[h]});c.length&&(h={type:"g",animate:{transform:d(c)},children:[h]});return h}(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,h;const p=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let m;const v=[];for(;null!==(m=p.exec(t));){const t=m[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);v.push({name:m[1],args:t})}if(!v.length)return;const g=v[v.length-1];if("translate"===g.name)for(let t=v.length-2;t>=0;t--){const c=v[t];if("translate"!==c.name)continue;const f=null!=(e=c.args[0])?e:0,d=null!=(n=c.args[1])?n:0,h=null!=(r=g.args[0])?r:0,p=null!=(o=g.args[1])?o:0;if(h!==-f||p!==-d)continue;const m={};m.origin=[f,d];for(let e=0;e<t;e++)if("translate"===v[e].name){const t=null!=(i=v[e].args[0])?i:0,n=null!=(a=v[e].args[1])?a:0;m.translate=m.translate?[m.translate[0]+t,m.translate[1]+n]:[t,n]}for(let e=t+1;e<v.length-1;e++){const t=v[e];if("rotate"===t.name)m.rotate=(null!=(s=m.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;m.scale=m.scale?[m.scale[0]*e,m.scale[1]*n]:[e,n]}}return m}let y,b,k;for(const t of v)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)b=(null!=b?b:0)+(null!=(d=t.args[0])?d:0);else if("scale"===t.name){const e=null!=(h=t.args[0])?h:1,n=t.args.length>1?t.args[1]:e;k=k?[k[0]*e,k[1]*n]:[e,n]}const A={};y&&(A.translate=y);void 0!==b&&(A.rotate=b);k&&(A.scale=k);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=Pr(a,e,r))}const s=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||Nr(t))}(t);a=function(t,e,n,r,o){const i=r.idMap.get(n),a=r.maskAncestorChains.get(e)||[],s=o?Tr(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=Dr(l),n=Dr(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=Fr(l,t),n=Fr(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,o,r,s);const c={type:"mask",id:i,children:[a]};return e.maskType&&(c.maskType=e.maskType),e.maskUnits&&(c.maskUnits=e.maskUnits),e.maskContentUnits&&(c.maskContentUnits=e.maskContentUnits),void 0!==e.x&&(c.x=String(e.x)),void 0!==e.y&&(c.y=String(e.y)),void 0!==e.width&&(c.width=String(e.width)),void 0!==e.height&&(c.height=String(e.height)),r.defs.push(c),t.mask="url(#"+i+")",t}function Pr(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=ar(t);if("absent"!==r.kind)return"static"===r.kind?r.value:(e.warnings.push("transformBy.origin: animated origin approximated by its first keyframe"),null==(n=r.keyframes[0])?void 0:n.value)}(e.origin,n);let o=t;return o=_r(o,"translate",e.translate,void 0,n),o=_r(o,"rotate",e.rotate,r,n),o=_r(o,"scale",e.scale,r,n),o}function _r(t,e,n,r,o){if(void 0===n)return t;const i=ar("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);if("static"===i.kind)return{type:"g",transform:{value:ir(e,zr(e,i.value),r)},children:[t]};if("animated"===i.kind){const n={keyframes:i.keyframes.map(t=>{const n=ur(t,ir(e,zr(e,t.value),r));return"translate"===e?l(l({},n),Ir(t)):n})};return void 0!==i.loop&&(n.loop=i.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function zr(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function Ir(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 Nr(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function Dr(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 Fr(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=Cr(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function Cr(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 Tr(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&&!i.kfs){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}var Ur="content";function Lr(t,e,n){if(!e)return;const r=pr(e.sourceId);if(!r)return void(e.type===Ur&&n.errors.push("clone: content ref missing sourceId"));const o=e.type===Ur&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function Er(t,e){const n={};return void 0!==t.translate&&(n.translate=Br(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=Br(t.rotate,t=>t*e)),void 0!==t.skew&&(n.skew=Br(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 Br(t,n,!0)}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function Br(t,e,n=!1){const r=ar(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?u(l({},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 Vr(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function Wr(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=l({},t);for(const e of Object.keys(t))delete t[e];t.type="g",t.children=[a],t.animate={opacity:{keyframes:i}}}function Rr(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function Zr(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function Gr(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 Kr(t,e,n){const r=pr(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=qr(r,e,n,new Set);o&&(t.href="#"+o)}function qr(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=vr(o);if(function(t,e){Jn(t,()=>hr(e,"retimed"))}(i,n),"use"===o.type?Qr(i,e.start,e.stretch):Xr(i,e.start,e.stretch),Gr(i),"use"===o.type&&o.href){const a=pr(o.href);if(a){const s=Zr(o),l=s?Rr(Vr(s),e):e,u=new Set(r);u.add(t);const c=qr(a,l,n,u);c&&(i.href="#"+c)}}else!function(t,e,n,r,o){const i=t=>{var a;const s=Zr(t);if("use"===t.type&&s&&t.href){const i=pr(t.href);if(i){const a=Rr(Vr(s),e),l=new Set(r);l.add(o);const u=qr(i,a,n,l);u&&(t.href="#"+u)}Gr(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 Xr(t,e,n){var r;Qr(t,e,n),null==(r=t.children)||r.forEach(t=>Xr(t,e,n))}function Qr(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)}}var Jr=/[MmLlHhVvCcSsQqTtAaZz]/;function Yr(t,e,n){return{P1:[t[0]+2/3*(e[0]-t[0]),t[1]+2/3*(e[1]-t[1])],P2:[n[0]+2/3*(e[0]-n[0]),n[1]+2/3*(e[1]-n[1])]}}function Hr(t){const e=function(t){const e=function(t){const e=[],n=/([MmLlHhVvCcSsQqTtAaZz])|(-?\d*\.?\d+(?:[eE][-+]?\d+)?)/g;let r;for(;null!==(r=n.exec(t));)e.push(r[0]);return e}(t),n=[];let r=0,o=0,i=0,a=0,s=0,l=0,u=0,c=0,f=0,d="";const h=()=>parseFloat(e[r++]),p=(t,e,r)=>{const a=[o,i],s=V(a,t,e,r,48);n.push({P0:a,P1:t,P2:e,P3:r,lut:s,len:s.ds[s.ds.length-1]}),o=r[0],i=r[1]},m=(t,e)=>{p([o+(t-o)/3,i+(e-i)/3],[o+2*(t-o)/3,i+2*(e-i)/3],[t,e])};for(;r<e.length;){let t=e[r];Jr.test(t)?r++:t="M"===d?"L":"m"===d?"l":d;const n=t>="a",v=t.toUpperCase();if("Z"!==v){if("M"===v){const e=h()+(n?o:0),r=h()+(n?i:0);o=e,i=r,a=e,s=r,d=t;continue}if("L"===v)m(h()+(n?o:0),h()+(n?i:0));else if("H"===v)m(h()+(n?o:0),i);else if("V"===v)m(o,h()+(n?i:0));else if("C"===v){const t=[h()+(n?o:0),h()+(n?i:0)],e=[h()+(n?o:0),h()+(n?i:0)],r=[h()+(n?o:0),h()+(n?i:0)];l=e[0],u=e[1],p(t,e,r)}else if("S"===v){const t="C"===d.toUpperCase()||"S"===d.toUpperCase()?[2*o-l,2*i-u]:[o,i],e=[h()+(n?o:0),h()+(n?i:0)],r=[h()+(n?o:0),h()+(n?i:0)];l=e[0],u=e[1],p(t,e,r)}else if("Q"===v){const t=[h()+(n?o:0),h()+(n?i:0)],e=[h()+(n?o:0),h()+(n?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=Yr([o,i],t,e);p(r,a,e)}else if("T"===v){const t="Q"===d.toUpperCase()||"T"===d.toUpperCase()?[2*o-c,2*i-f]:[o,i],e=[h()+(n?o:0),h()+(n?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=Yr([o,i],t,e);p(r,a,e)}else{if("A"!==v){r++;continue}r+=5,m(h()+(n?o:0),h()+(n?i:0))}d=t}else m(a,s),o=a,i=s,d=t}return n.length?n:null}(t);if(!e)return null;const n=new Float64Array(e.length+1);for(let t=0;t<e.length;t++)n[t+1]=n[t]+e[t].len;const r=n[e.length],o=e[0].P0,i=e[e.length-1].P3,a=Math.hypot(i[0]-o[0],i[1]-o[1])<.001,s=t=>{let r=0;for(;r<e.length-1&&t>n[r+1];)r++;const o=e[r],i=t-n[r],a=o.len>0?function(t,e){const{ts:n,ds:r}=t,o=r.length-1;if(e<=0)return n[0];if(e>=r[o])return n[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;r[t]<e?i=t+1:a=t}const s=r[a-1],l=r[a]-s,u=l>0?(e-s)/l:0;return n[a-1]+u*(n[a]-n[a-1])}(o.lut,i):0,[s,l]=U(o.P0,o.P1,o.P2,o.P3,a),[u,c]=E(o.P0,o.P1,o.P2,o.P3,a);return{x:s,y:l,angle:Math.atan2(c,u)}};return{totalLength:r,closed:a,sampleAtDistance(t){if(a&&r>0&&(t<0||t>r))return s((t%r+r)%r);if(!a&&(t<0||t>r)){const e=t<0?0:r,n=s(e),o=t-e;return{x:n.x+Math.cos(n.angle)*o,y:n.y+Math.sin(n.angle)*o,angle:n.angle}}return s((o=r,(e=t)<(n=0)?n:e>o?o:e));var e,n,o}}}function $r(t){const e=ar(t);if("static"===e.kind&&"number"==typeof e.value)return{min:e.value,max:e.value};if("animated"===e.kind&&e.keyframes.length){const t=e.keyframes.map(t=>Number(t.value)||0);return{min:Math.min(...t),max:Math.max(...t)}}return{min:0,max:0}}function to(t){let e=0,n=16;const r=t=>{var o,i;const a=parseFloat(String(null!=(o=t.fontSize)?o:""))||0;a&&(n=Math.max(n,a));const s=null!=(i=t.text)?i:t.textContent;if("string"==typeof s&&(e+=s.length),t.children)for(const e of t.children)r(e)};return r(t),e*n}var eo=t=>Math.round(1e3*t)/1e3;function no(t,e){if(!e||null==t)return t;const n=ar(t);if("absent"===n.kind)return t;if("static"===n.kind)return"number"==typeof t?n.value+e:{value:n.value+e};const r={keyframes:n.keyframes.map(t=>u(l({},t),{value:(Number(t.value)||0)+e}))};return void 0!==n.loop&&(r.loop=n.loop),void 0!==n.autoOrient&&(r.autoOrient=n.autoOrient),void 0!==n.base&&(r.value=n.base+e),r}function ro(t,e){var n;if("clip"===e.pathOverflow)return{d:t,startShift:0};const r=Hr(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,i=.15*o,a=$r(e.startOffset),s=$r(e.textLength).max||(null!=(n=e.advance)?n:0),l=Math.max(0,-a.min),u=Math.max(0,a.max+s-o),c=l>0?l+i:0,f=u>0?u+i:0;if(f<=0&&c<=0)return{d:t,startShift:0};const d=r.sampleAtDistance(0),h=r.sampleAtDistance(o);let p=t;if(c>0){const e=d.x-Math.cos(d.angle)*c,n=d.y-Math.sin(d.angle)*c,r=t.replace(/^\s*[Mm]\s*-?[\d.]+[\s,]+-?[\d.]+/,"");p="M"+eo(e)+","+eo(n)+"L"+eo(d.x)+","+eo(d.y)+r}if(f>0){const t=h.x+Math.cos(h.angle)*f,e=h.y+Math.sin(h.angle)*f;p+="L"+eo(t)+","+eo(e)}return{d:p,startShift:c}}function oo(t,e,n){null!=n&&sr(t,e,ar(n),{asString:!0})}var io=(t,e,n)=>{const r={type:t};for(const t in e)void 0!==e[t]&&(r[t]=e[t]);const o=Array.isArray(n)?n.filter(t=>null!=t):null!=n?[n]:[];return o.length&&(r.children=o),r};function ao(t,e){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function so(t,e){let n="";for(let r=0;r<t.length;r++){const o=ao(t[r],e);r>0&&45!==o.charCodeAt(0)&&(n+=" "),n+=o}return n}function lo(t,e,n){return[t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}var uo=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function co(t,e,n=2){const r=[];let o;for(uo.lastIndex=0;null!==(o=uo.exec(t));)r.push(o[0]);let i="",a=0;const s=()=>parseFloat(r[a++]);for(;a<r.length;){const t=r[a++];if("M"===t||"L"===t){const[r,o]=lo(e,s(),s());i+=t+so([r,o],n)}else if("C"===t){const[t,r]=lo(e,s(),s()),[o,a]=lo(e,s(),s()),[l,u]=lo(e,s(),s());i+="C"+so([t,r,o,a,l,u],n)}else if("Q"===t){const[t,r]=lo(e,s(),s()),[o,a]=lo(e,s(),s());i+="Q"+so([t,r,o,a],n)}else"Z"!==t&&"z"!==t||(i+="Z")}return i}var fo=["fontFamily","fontSize","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","textDecoration","textTransform","whiteSpace","x","y","dx","dy","lengthAdjust","fill","stroke","strokeWidth","effects",Ct,Tt,"xml:space"],ho=["fillOpacity","fillRule","strokeOpacity","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","mixBlendMode","filter"],po=["fill","stroke","strokeWidth","opacity","fillOpacity","strokeOpacity","strokeDasharray","strokeDashoffset"];function mo(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?void 0:e}}function vo(t){return"string"==typeof t?t:void 0}function go(t){const e=t.animate;if(!e||"object"!=typeof e)return;let n;for(const t of po)void 0!==e[t]&&((null!=n?n:n={})[t]=e[t]);return n}function yo(t,e){var n,r,o,i,a,s,l,u,c,f;const d="text"===t.type,h=t.style,p=e=>{var n;return d?void 0:null!=(n=t[e])?n:null==h?void 0:h[e]},m={fontFamily:null!=(n=vo(t.fontFamily))?n:e.fontFamily,fontSize:null!=(r=mo(t.fontSize))?r:e.fontSize,fill:null!=(o=t.fill)?o:e.fill,stroke:null!=(i=t.stroke)?i:e.stroke,strokeWidth:null!=(a=t.strokeWidth)?a:e.strokeWidth,letterSpacing:null!=(s=mo(t.letterSpacing))?s:e.letterSpacing,wordSpacing:null!=(l=mo(t.wordSpacing))?l:e.wordSpacing,opacity:null!=(u=mo(p("opacity")))?u:e.opacity,animate:null!=(c=d?void 0:go(t))?c:e.animate};for(const t of ho){const n=null!=(f=p(t))?f:e[t];void 0!==n&&(m[t]=n)}return m}function bo(t){var e,n,r;return{fontFamily:vo(t.fontFamily),fontSize:null!=(e=mo(t.fontSize))?e:16,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(n=mo(t.letterSpacing))?n:0,wordSpacing:null!=(r=mo(t.wordSpacing))?r:0}}function ko(t){const e={};void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),void 0!==t.opacity&&1!==t.opacity&&(e.opacity=t.opacity);for(const n of ho)void 0!==t[n]&&(e[n]=t[n]);return void 0!==t.animate&&(e.animate=t.animate),e}function Ao(t,e,n,r){var o;const i=t.fontFamily?e[t.fontFamily]:n;return i||null==r||r.push('textGlyphs: no glyphs for font "'+(null!=(o=t.fontFamily)?o:"")+'"'),i}function xo(t){const e=Object.keys(t);return 1===e.length?t[e[0]]:void 0}var wo="px-missing-glyph";function jo(t,e){if(t<=0||e<=0)return"";const n=.08,r=t*n,o=.92*t,i=.92*-e,a=o-r,s=-i,l=Math.max(1,.12*Math.min(a,s)),u="M"+r+" 0L"+o+" 0L"+o+" "+i+"L"+r+" "+i+"Z";if(a<=2*l||s<=2*l)return u;const c=r+l,f=o-l,d=-l,h=i+l;return u+"M"+c+" "+d+"L"+c+" "+h+"L"+f+" "+h+"L"+f+" "+d+"Z"}function Oo(t,e){var n,r,o,i;const{glyphs:a,create:s=io,warnings:l}=e,u=xo(a),c={x:null!=(n=mo(t.x))?n:0,y:null!=(r=mo(t.y))?r:0},f=[],d=[{start:c.x,end:c.x}];let h=0;const p=(t,e)=>{var n;const r=Ao(e,a,u,l),o=(null==r?void 0:r.unitsPerEm)||1e3,i=e.fontSize/o,s=null!=(n=null==r?void 0:r.ascent)?n:.9*o,p=ko(e);for(let n=0;n<t.length;n++){const a=t.charAt(n),l=null==r?void 0:r.glyphs[a];if(l&&l.d)f.push({glyphD:l.d,m:[i,0,0,i,c.x,c.y],paint:p,line:h,x:c.x,y:c.y,scale:i}),c.x+=l.width*i;else if(/\S/.test(a)){const t=l&&l.width>0?l.width:.6*o;f.push({glyphD:jo(t,s),m:[i,0,0,i,c.x,c.y],paint:p,isMissing:!0,line:h,x:c.x,y:c.y,scale:i}),c.x+=t*i}else c.x+=(l?l.width:0)*i;c.x+=e.letterSpacing+(" "===a?e.wordSpacing:0),d[h].end=c.x}},m=(t,e)=>{var n,r,o,i;const a=yo(t,e),s=mo(t.x),l=mo(t.y);void 0!==s&&(c.x=s,h=d.length,d.push({start:c.x,end:c.x})),void 0!==l&&(c.y=l),c.x+=null!=(n=mo(t.dx))?n:0,c.y+=null!=(r=mo(t.dy))?r:0;const u=null!=(o=vo(t[Tt]))?o:vo(t[Ct]);if(u&&!(null==(i=t.children)?void 0:i.length)&&p(u,a),t.children)for(const e of t.children)m(e,a)},v=bo(t);if(t.children)for(const e of t.children)m(e,v);const g=null!=(o=vo(t[Tt]))?o:vo(t[Ct]);g&&!(null==(i=t.children)?void 0:i.length)&&p(g,v);const y=vo(t.textAnchor);if("middle"===y||"end"===y)for(const t of f){const e=d[t.line].end-d[t.line].start,n="middle"===y?-e/2:-e;t.m=[t.scale,0,0,t.scale,t.x+n,t.y]}return Uo(t,To(f,s,l),s)}function Mo(t,e){var n,r,o,i,a,s;if(null==(n=e.alongPath)?void 0:n.pathD)return function(t,e,n){var r,o;const{glyphs:i,warnings:a,alongPath:s}=n,l=Hr(e);if(!l)return null==a||a.push("textGlyphs: unparsable along-path geometry (caret)"),[];const u=xo(i),c=[];let f=0;const d=(t,e)=>{var n,r,o;const s=yo(t,e),l=null!=(n=vo(t[Tt]))?n:vo(t[Ct]);if(l&&!(null==(r=t.children)?void 0:r.length)){const t=Ao(s,i,u,a),e=(null==t?void 0:t.unitsPerEm)||1e3,n=s.fontSize/e,r=(null!=(o=null==t?void 0:t.ascent)?o:.9*e)*n;for(let e=0;e<l.length;e++){const o=l.charAt(e),i=null==t?void 0:t.glyphs[o],a=(i?i.width:0)*n,u=a+s.letterSpacing+(" "===o?s.wordSpacing:0);c.push({advStart:f,advEnd:f+u,glyphW:a,ascent:r,fontSize:s.fontSize}),f+=u}}if(t.children)for(const e of t.children)d(e,s)};d(t,bo(t));const h=f,p=ar(null==s?void 0:s.textLength),m="animated"===p.kind?Number(null==(r=p.keyframes[0])?void 0:r.value)||0:"static"===p.kind&&Number(p.value)||0,v=m>0&&h>0?m/h:1,g=ar(null==s?void 0:s.startOffset),{along:y,perp:b}=Po(t),k=y+("animated"===g.kind?Number(null==(o=g.keyframes[0])?void 0:o.value)||0:"static"===g.kind&&Number(g.value)||0),A=t=>({x:t.x-b*Math.sin(t.angle),y:t.y+b*Math.cos(t.angle),angle:t.angle});return c.map(t=>{const e=k+t.advStart*v,n=k+t.advEnd*v,r=A(l.sampleAtDistance(e)),o=A(l.sampleAtDistance(n)),i=l.sampleAtDistance(k+(t.advStart+t.glyphW/2)*v);return{x:r.x,y:r.y,width:t.advEnd-t.advStart,ascent:t.ascent,fontSize:t.fontSize,endX:o.x,endY:o.y,rotation:180*i.angle/Math.PI}})}(t,e.alongPath.pathD,e);const{glyphs:l,warnings:u}=e,f=xo(l),d={x:null!=(r=mo(t.x))?r:0,y:null!=(o=mo(t.y))?o:0},h=[],p=[{start:d.x,end:d.x}];let m=0;const v=(t,e)=>{var n;const r=Ao(e,l,f,u),o=(null==r?void 0:r.unitsPerEm)||1e3,i=e.fontSize/o,a=(null!=(n=null==r?void 0:r.ascent)?n:.9*o)*i;for(let n=0;n<t.length;n++){const o=t.charAt(n),s=null==r?void 0:r.glyphs[o],l=(s?s.width:0)*i+e.letterSpacing+(" "===o?e.wordSpacing:0);h.push({x:d.x,y:d.y,width:l,ascent:a,fontSize:e.fontSize,line:m}),d.x+=l,p[m].end=d.x}},g=(t,e)=>{var n,r,o,i;const a=yo(t,e),s=mo(t.x),l=mo(t.y);void 0!==s&&(d.x=s,m=p.length,p.push({start:d.x,end:d.x})),void 0!==l&&(d.y=l),d.x+=null!=(n=mo(t.dx))?n:0,d.y+=null!=(r=mo(t.dy))?r:0;const u=null!=(o=vo(t[Tt]))?o:vo(t[Ct]);if(u&&!(null==(i=t.children)?void 0:i.length)&&v(u,a),t.children)for(const e of t.children)g(e,a)},y=bo(t);if(t.children)for(const e of t.children){const t=h.length;if(g(e,y),h.length===t){const t=yo(e,y),n=Ao(t,l,f),r=(null==n?void 0:n.unitsPerEm)||1e3;h.push({x:d.x,y:d.y,width:0,ascent:(null!=(i=null==n?void 0:n.ascent)?i:.9*r)*(t.fontSize/r),fontSize:t.fontSize,line:m})}}const b=null!=(a=vo(t[Tt]))?a:vo(t[Ct]);b&&!(null==(s=t.children)?void 0:s.length)&&v(b,y);const k=vo(t.textAnchor);if("middle"===k||"end"===k)for(const t of h){const e=p[t.line].end-p[t.line].start;t.x+="middle"===k?-e/2:-e}return h.map(t=>{var e=t,{line:n}=e;return c(e,["line"])})}function So(t,e,n,r,o=0){const{x:i,y:a,angle:s}=t.sampleAtDistance(e),l=Math.cos(s),u=Math.sin(s),c=r/2;return[n*l,n*u,-n*u,n*l,i-n*l*c-o*u,a-n*u*c+o*l]}function Po(t){var e,n,r;return{along:(null!=(e=mo(t.x))?e:0)+(null!=(n=mo(t.dx))?n:0),perp:null!=(r=mo(t.dy))?r:0}}function _o(t,e,n,r,o,i){const{glyphs:a,create:s=io,warnings:c}=r,f=e?Hr(e):null;if(!f)return null==c||c.push("textGlyphs: unparsable along-path geometry"),null;const d=xo(a),{cells:h,width:p}=function(t,e,n,r){const o=[];let i=0;const a=(t,s)=>{var l,u,c;const f=yo(t,s),d=null!=(l=vo(t[Tt]))?l:vo(t[Ct]);if(d&&!(null==(u=t.children)?void 0:u.length)){const t=Ao(f,e,n,r);if(t){const e=f.fontSize/t.unitsPerEm,n=null!=(c=t.ascent)?c:.9*t.unitsPerEm,r=ko(f);for(let a=0;a<d.length;a++){const s=d.charAt(a),l=t.glyphs[s];if(l&&l.d){const t=l.width*e;o.push({glyphD:l.d,widthEm:l.width,scale:e,paint:r,midBase:i+t/2}),i+=t}else if(/\S/.test(s)){const a=l&&l.width>0?l.width:.6*t.unitsPerEm,s=a*e;o.push({glyphD:jo(a,n),widthEm:a,scale:e,paint:r,isMissing:!0,midBase:i+s/2}),i+=s}else i+=(l?l.width:0)*e;i+=f.letterSpacing+(" "===s?f.wordSpacing:0)}}}if(t.children)for(const e of t.children)a(e,f)};return a(t,bo(t)),{cells:o,width:i}}(t,a,d,c);if(!h.length)return Uo(t,[],s);const{along:m,perp:v}=Po(t),g=zo(n),y=zo(o),b=t=>t>0&&p>0?t/p:1,k="clip"===i&&!f.closed;if(g.animated||y.animated){const e=function(t,e){const n=[...t,...e].sort((t,e)=>t-e),r=[];for(const t of n)r.length&&t===r[r.length-1]||r.push(t);return r}(g.times,y.times),n=(t,e)=>m+g.at(e)+b(y.at(e))*t.midBase,r=g.animated?g.loop:y.loop;return Uo(t,function(t,e,n,r,o,i,a,s=0){const c=Math.max(e.totalLength/Io,.5),f=t=>t>=0&&t<=e.totalLength,d=[];for(const h of t){const t=[h.scale,0,0,h.scale,-h.scale*(h.widthEm/2),0],p=co(h.glyphD,t),m=(t,n)=>{const{x:r,y:o,angle:i}=e.sampleAtDistance(t),a=Math.cos(i),l=Math.sin(i);return{time:n,value:{translate:[Do(r-s*l,3),Do(o+s*a,3)],rotate:Do(180*i/Math.PI,3)}}},v=[],g=[],y=(t,e)=>{v.push(m(t,e)),a&&g.push({time:e,value:f(t)?1:0})};y(n(h,r[0]),r[0]);for(let t=1;t<r.length;t++){const e=r[t-1],o=r[t],i=n(h,e),a=n(h,o),s=Math.min(No,Math.max(1,Math.ceil(Math.abs(a-i)/c)));for(let t=1;t<=s;t++){const r=e+t/s*(o-e);y(n(h,r),r)}}vn(v);const b={keyframes:v};void 0!==o&&(b.loop=o);const k={transform:b};if(h.paint.animate&&Object.assign(k,h.paint.animate),a&&g.some(t=>0===t.value)){const t={keyframes:g};void 0!==o&&(t.loop=o),k.opacity=t}d.push(i("path",u(l(l({d:p},Fo(h.paint)),Co(h.isMissing)),{animate:k}),[]))}return d}(h,f,n,e,r,s,k,v),s)}const A=b(y.at(0)),x=m+g.at(0);return Uo(t,To((k?h.filter(t=>{const e=x+t.midBase*A;return e>=0&&e<=f.totalLength}):h).map(t=>({glyphD:t.glyphD,paint:t.paint,isMissing:t.isMissing,m:So(f,x+t.midBase*A,t.scale,t.widthEm,v)})),s,c),s)}function zo(t){var e;const n=ar(t);if("animated"===n.kind&&n.keyframes.length>=2){const t=[...n.keyframes].sort((t,e)=>(Number(t.time)||0)-(Number(e.time)||0)),e=t.map(t=>Number(t.time)||0),r=t.map(t=>Number(t.value)||0);return{animated:!0,times:e,loop:n.loop,at(t){if(t<=e[0])return r[0];for(let n=1;n<e.length;n++)if(t<=e[n]){const o=e[n]-e[n-1],i=o>0?(t-e[n-1])/o:1;return r[n-1]+i*(r[n]-r[n-1])}return r[r.length-1]}}}const r="animated"===n.kind?Number(null==(e=n.keyframes[0])?void 0:e.value)||0:"static"===n.kind&&Number(n.value)||0;return{animated:!1,times:[],at:()=>r}}var Io=48,No=64;function Do(t,e){const n=a(10,e);return Math.round(t*n)/n}function Fo(t){const e={};void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(e.opacity=t.opacity);for(const n of ho)void 0!==t[n]&&(e[n]=t[n]);return e}function Co(t){return t?{class:wo}:{}}function To(t,e,n){if(!t.length)return null==n||n.push("textGlyphs: nothing to render"),[];const r=new Map;for(const e of t){const t=JSON.stringify([e.paint,!!e.isMissing]),n=co(e.glyphD,e.m),o=r.get(t);o?o.d+=n:r.set(t,{paint:e.paint,d:n,isMissing:e.isMissing})}const o=[];for(const{paint:t,d:n,isMissing:i}of r.values())o.push(e("path",l(l(l({d:n},Fo(t)),Co(i)),void 0!==t.animate?{animate:l({},t.animate)}:{}),[]));return o}function Uo(t,e,n){const r={};for(const e of Object.keys(t))"type"!==e&&"children"!==e&&-1===fo.indexOf(e)&&(r[e]=t[e]);if(r.style&&"object"==typeof r.style){const t=l({},r.style);delete t["white-space"],Object.keys(t).length?r.style=t:delete r.style}return n("g",r,e)}function Lo(t,e){return e.alongPath?_o(t,e.alongPath.pathD,e.alongPath.startOffset,e,e.alongPath.textLength,e.alongPath.pathOverflow):Oo(t,e)}function Eo(t,e,n){if(!e)return t;const r=e.subPaths===Ft.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*ti,d=o*ti,h=(t,e,n,r,o,i)=>"C"+t+","+e+" "+n+","+r+" "+o+","+i;return"M"+(e+r)+","+n+h(e+r,n+d,e+f,n+o,e,n+o)+h(e-f,n+o,e-r,n+d,e-r,n)+h(e-r,n-d,e-f,n-o,e,n-o)+h(e+f,n-o,e+r,n-d,e+r,n)+"z"}return}(t);if(void 0===e)return;const n=Nn(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){const e=Ho(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 c=a;if(r&&c<.001)return t;const f=ar(e.offset),d="absent"===f.kind?{kind:"static",value:0}:f,h=function(t){const e=ar(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>{var e,n,r,o;return{time:null!=(n=null!=(e=t.time)?e:t.t)?n:0,value:null!=(r=t.value)?r:t.v,easing:null!=(o=t.easing)?o:t.e}});if(!n.some(t=>t.value[0]>t.value[1]))return{kind:"animated",keyframes:n.map(t=>({time:t.time,value:t.value,easing:t.easing}))};const r=[];for(let t=1;t<n.length;t++){const e=n[t-1],o=n[t];if((e.value[1]-e.value[0])*(o.value[1]-o.value[0])<0){const t=Jo(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=Yo(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=Yo(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:i}}(e.range),p="absent"===h.kind?{kind:"static",value:[0,1]}:h,m=function(t){var e;if("absent"===t.kind)return[];if("static"===t.kind)return[t.value];const n=[];for(const r of t.keyframes){const t=null!=(e=r.value)?e:r.v;"number"==typeof t&&n.push(t)}return n}(d),v=[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?c:n.lengthPx;if(i<.001)return t;const a=r?n.startOffsetPx/i:0;return function(t,e,n,r,o,i){const a=Ro(n,e,r),s=Zo(e,r),u=l({},t);return delete u.effects,qo(u,"strokeDasharray",Ko(i,s)),qo(u,"strokeDashoffset",Ko(o,a)),qo(u,"strokeOpacity",Qo(i)),u}(e.leaf,i,a,v,d,p)}const g=new Map;for(const t of o){const e=[];for(const o of t.subpaths){const i=r?c:o.lengthPx;if(i<.001)continue;const a=r?o.startOffsetPx/i:0;e.push(...Vo(t.leaf,o.subpath,i,a,v,d,p,n))}g.set(t.leaf,Bo(t.leaf,e))}const y=t=>{const e=g.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?u(l({},t),{children:t.children.map(y)}):t)};return y(t)}function Bo(t,e){const n=u(l({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function Vo(t,e,n,r,o,i,a,s){const l=Ro(r,n,o),u=Zo(n,o),c=Ko(i,l),d=Ko(a,u),h=Qo(a),p=function(t){return{type:"path",d:t}}(f(e));return qo(p,"strokeDasharray",d),qo(p,"strokeDashoffset",c),qo(p,"strokeOpacity",h),[p]}var Wo=1;function Ro(t,e,n){const[r]=Go(n);return n=>e*(-n-r+t)+Wo}function Zo(t,e){const[n,r]=Go(e),o=r-n+1;return e=>{const n=T(e[0],0,1),r=T(e[1],0,1),i=Math.min(n,r),a=Math.max(n,r),s=[0];let l=Wo;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+Wo),s}}function Go(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function Ko(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>{var n,r,o,i;return{time:null!=(r=null!=(n=t.time)?n:t.t)?r:0,value:e(null!=(o=t.value)?o:t.v),easing:null!=(i=t.easing)?i:t.e}}),loop:t.loop}}function qo(t,e,n){n&&sr(t,e,n)}var Xo=10;function Qo(t){var e,n,r,o,i,a;const s=t=>t[0]===t[1];if("absent"===t.kind)return;if("static"===t.kind)return s(t.value)?{kind:"static",value:0}:void 0;const l=t.keyframes;let u=!1,c=!0;for(const t of l)s(null!=(e=t.value)?e:t.v)?u=!0:c=!1;if(!u)return;if(c)return{kind:"static",value:0};const f=[];for(let t=0;t<l.length;t++){const e=l[t],u=t>0?l[t-1]:void 0,c=t<l.length-1?l[t+1]:void 0,d=null!=(r=null!=(n=e.time)?n:e.t)?r:0,h=s(null!=(o=e.value)?o:e.v),p=u?h&&s(null!=(i=u.value)?i:u.v):h,m=c?h&&s(null!=(a=c.value)?a:c.v):h;p&&!m?(f.push({time:d,value:0}),f.push({time:d+Xo,value:1})):!p&&m&&(f.push({time:d-Xo,value:1}),f.push({time:d,value:0}))}return f.length<=1?void 0:{kind:"animated",keyframes:f}}function Jo(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 Yo(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 Ho(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+=$o(t,r,r+1);return t.c&&e.length>1&&(n+=$o(t,e.length-1,0)),n}function $o(t,e,n){var r,o,i,a;const s=t.v,l=s[e],u=s[n],c=V(l,null!=(o=null==(r=t.o)?void 0:r[e])?o:l,null!=(a=null==(i=t.i)?void 0:i[n])?a:u,u);return c.ds[c.ds.length-1]}var ti=.5522847498307936;function ei(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:(null==(e=Rt(t))?void 0:e.mode)===bt.frames?kt.frames:kt.waapi,glyphs:null==(n=qt(t))?void 0:n.glyphs},o=vr(t);mr(o,r.idMap),gr(o,r,()=>hr(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const a=pr(null==(i=null==(o=t.effects)?void 0:o.maskedBy)?void 0:i.sourceId);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=Tr(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(),mr(t,e.idMap);const n=[],r=t=>{var e;Zr(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&&Zr(o)&&n++,"use"===o.type&&o.href){const t=pr(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(a=o.children)||a.forEach(i)}},a=pr(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=Zr(t);if(!n)continue;const r=n.timeCrop;Gr(t),Kr(t,Vr(n),e),r&&Wr(t,r,e)}}(t,e),t}(ni(o,r),r);return function(t,e){if(!e.length)return;(t.children||(t.children=[])).unshift({type:"defs",children:e})}(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function ni(t,e){t.children&&(t.children=t.children.map(t=>ni(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:h,text:p}=null!=n?n:{};n&&delete t.effects;let m=t,v=!1;if(null==p?void 0:p.useGlyphs)if(h){const t="string"==typeof h.path?h.path:void 0,n=function(t,e,n,r,o,i){return e.glyphs?_o(t,n,r,{glyphs:e.glyphs,warnings:e.warnings},o,i):(e.warnings.push("textGlyphs: no definitions.glyphs"),null)}(m,e,t,h.startOffset,h.textLength,h.pathOverflow);n&&(m=n,v=!0)}else m=function(t,e,n){return(null==e?void 0:e.useGlyphs)?n.glyphs?Oo(t,{glyphs:n.glyphs,warnings:n.warnings}):(n.warnings.push("textGlyphs: no definitions.glyphs — left as native <text>"),t):t}(m,p,e),v=!0;return v||(m=function(t,e,n){var r;if(!e||"string"!=typeof e.path||!e.path)return t;const o=hr(n,"tpath"),{d:i,startShift:a}=ro(e.path,{pathOverflow:e.pathOverflow,startOffset:e.startOffset,textLength:e.textLength,advance:to(t)});n.defs.push({type:"path",id:o,d:i});const s={type:"textPath",href:"#"+o,children:null!=(r=t.children)?r:[]};return void 0!==e.lengthAdjust&&(s.lengthAdjust=e.lengthAdjust),void 0!==e.method&&(s.method=e.method),void 0!==e.spacing&&(s.spacing=e.spacing),oo(s,"startOffset",no(e.startOffset,a)),oo(s,"textLength",e.textLength),t.children=[s],t}(m,h,e)),m=function(t,e,n){return Ar(t,e,n,"fill")}(m,f,e),m=function(t,e,n){return Ar(t,e,n,"stroke")}(m,d,e),m=Eo(m,u,e),m=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=vr(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=vr(l),o=Er(e,t),i=o?cr(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}(m,a,e),m=Sr(m,s,i,e),m=function(t,e,n){if(!(null==e?void 0:e.d))return t;const r=hr(n,"clip"),o={type:"path"},i=ar(e.d);return"absent"!==i.kind&&("static"===i.kind?o.d=Mr(i.value):(sr(o,"d",i),void 0!==o.d&&(o.d=Mr(o.d)))),n.defs.push({type:"clipPath",id:r,children:[o]}),t.clipPath="url(#"+r+")",t}(m,l,e),o?(Lr(m,c,e),m=yr(m,i,r,o,e)):m=function(t,e,n,r){return Lr(t,e,r),cr(t,n,r)}(m,c,i,e),(null==c?void 0:c.retime)&&(t.effects={clone:{retime:c.retime}}),r&&e.idMap.set(r,m),m}var ri=t=>{var e,n;return null!=(n=null!=(e=t.t)?e:t.time)?n:0},oi=t=>{var e;return null!=(e=t.v)?e:t.value},ii=t=>{var e;return null!=(e=t.e)?e:t.easing},ai=t=>{var e;return null!=(e=t.tangentIn)?e:t.ti},si=t=>{var e;return null!=(e=t.tangentOut)?e:t.to};function li(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 ui(t,e,n,r,o=64){let i=0,a=t;for(let s=1;s<=o;s++){const l=li(t,e,n,r,s/o);i+=Math.hypot(l[0]-a[0],l[1]-a[1]),a=l}return i}var ci=t=>{const e=Math.round(1e4*t)/1e4;return Object.is(e,-0)?"0":String(e)};function fi(t){const e=t=>{var n;let r=t;const o=t.animate,i=null==o?void 0:o.transform;if(i){const e=function(t){var e,n,r;if("offsetPath"!==t.alongPathMode)return;const o=t.keyframes;if(!o||o.length<2)return;const i=oi(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=oi(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=>ai(t)||si(t)))return;let l="M"+ci(s[0][0])+","+ci(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=si(o[t]))?n:[0,0],c=null!=(r=ai(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"+ci(f[0])+","+ci(f[1])+","+ci(d[0])+","+ci(d[1])+","+ci(i[0])+","+ci(i[1]),u.push(ui(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:ri(o[t]),v:d/c},n=ii(o[t]);void 0!==n&&(e.e=n),f.push(e)}return{pathStr:l,distanceKfs:f,autoOrient:!!t.autoOrient,anchor:a}}(i);if(e){const n=l({},o);delete n.transform;const a={keyframes:e.distanceKfs};void 0!==i.loop&&(a.loop=i.loop),n.offsetDistance=a;const s=t.transform;let c=s;if(s&&"object"==typeof s){const t=l({},s);delete t.translate,delete t.origin,c=Object.keys(t).length?t:void 0}r=u(l({},t),{animate:n,style:u(l({},t.style),{offsetPath:"path('"+e.pathStr+"')",offsetAnchor:ci(e.anchor[0])+"px "+ci(e.anchor[1])+"px",offsetRotate:e.autoOrient?"auto":"0deg",offsetDistance:"0%"})}),void 0!==c?r.transform=c:delete r.transform}}if(null==(n=r.children)?void 0:n.length){const t=r.children.map(e);t.some((t,e)=>t!==r.children[e])&&(r=u(l({},r),{children:t}))}return r};return e(t)}function di(t,e,n){var r,o;let i=ei(t).root;i=fi(i);return i=Wn(i,null!=(o=null==(r=Rt(i))?void 0:r.duration)?o:I),e===kt.waapi&&(i=Pn(i,null==n?void 0:n.motionPath),i=$n(i),i=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}(i)),i}function hi(t){const e=globalThis;"function"!=typeof e.cancelAnimationFrame?e.clearTimeout(t):e.cancelAnimationFrame(t)}function pi(t,e,n){var r;const o=Rt(t)||{},i=Kn(t,kt.frames),a=o.iterations;let s=1;"number"==typeof a&&(s=a||1),"infinite"===a&&(s=1/0),s<1&&(s=1);const l=+(o.duration||I),u=l&&s?l*(s===1/0?1/0:s):l?(null!=s?s:1)*l:0,c=o.direction||"normal",f=null!=(r=o.fill)?r:"forwards",d="forwards"===f||"both"===f,h="backwards"===f||"both"===f;let p=null,m=!1,v=-(o.delay||0),g=0,y=1,b=!1;const k=o.frameRate,A=k&&k>0?1e3/k:0;let x=0;const w=()=>{const t=g?(Date.now()-g)*y:0;return v+t},j=()=>{let t=w();return Number.isFinite(u)&&t>u&&(t=u),t<0&&(t=0),t};function O(t){let n=function(){const e=l>0?l:1;let n=0,r=0;if(l>0){t=T(t,0,s*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,s-1);n=T((t-r*e)/e,0,1)}else n=t;const o=c||"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 i||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=Xn(r,n*l);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}o.delay&&(o.delay<0?O(j()):h&&O(0));const M=()=>!!m&&(!!e.isConnected()&&(y<0?w()>0:!(Number.isFinite(u)&&j()>=u))),S=t=>{null!==p&&(hi(p),p=null),(t||M())&&(p=function(t){const e=globalThis;return"function"==typeof e.requestAnimationFrame?e.requestAnimationFrame(t):e.setTimeout(t,16)}(()=>{p=null,(()=>{var t,r;if(!e.isConnected())return void P();const o=j(),i=w();if(i<0&&y>0)h&&O(0);else{if(y<0&&i<=0)return P(),O(0),void(b||(b=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)));if(y>0&&u&&Number.isFinite(u)&&o>=u)return P(),O(d?u:0),void(b||(b=!0,null==(r=null==n?void 0:n.onFinish)||r.call(n)));if(A>0){const t=Date.now();if(x&&t-x<A)return;x=t}O(o)}})(),S()}))},P=()=>{if(!m)return;let t=w();Number.isFinite(u)&&t>u&&(t=u),v=t,g=0,m=!1,null!==p&&(hi(p),p=null),t>=0?O(t):h&&O(0)},_={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>M(),play:()=>{var t;(()=>{if(!m){if(y>=0)Number.isFinite(u)&&v>=u&&(v=0);else if(v<=0){if(!Number.isFinite(u))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");v=u}b=!1,m=!0,g=Date.now(),S(!0)}})(),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;P(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;P(),v=0,g=0,m=!1,b=!1,O(v),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;v=Number.isFinite(u)?u:j(),g=0,m=!1,null!==p&&(hi(p),p=null),O(d?v:0),t&&!b&&(b=!0,null==(e=null==n?void 0:n.onFinish)||e.call(n))})(!0)},setPlaybackRate:t=>{if(!isFinite(t)||0===t)return void console.warn("setPlaybackRate: rate must be finite and non-zero");let e=w();Number.isFinite(u)&&e>u&&(e=u),t<0!=y<0&&(b=!1),y=t,v=e,m&&(g=Date.now())},getCurrentTime:()=>j(),setCurrentTime:t=>{t<0&&(t=0),Number.isFinite(u)&&t>u&&(t=u),v=t,m&&(g=Date.now()),(!Number.isFinite(u)||t<u)&&(b=!1),O(j())},destroy:()=>{var t;_.cancel(),null==(t=null==n?void 0:n.onRemove)||t.call(n)}};return _}var mi=[1,0,0,1,0,0];function vi(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}var gi=(t,e)=>[1,0,0,1,t,e],yi=(t,e)=>[t,0,0,e,0,0];function bi(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var ki=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],Ai=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function xi(t){let e=mi;t.translate&&(e=vi(e,gi(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=vi(e,gi(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=vi(e,bi(t.rotate))),t.scale&&(e=vi(e,yi(t.scale[0],t.scale[1]))),n&&(e=vi(e,gi(-t.origin[0],-t.origin[1]))),e}function wi(t,e,n){return t+(e-t)*n}function ji(t,e){return null==t?mi:"string"==typeof t?function(t){let e=mi;const n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);){const t=r[1],n=r[2].split(/[\s,]+/).filter(Boolean).map(Number);"translate"===t?e=vi(e,gi(n[0]||0,n[1]||0)):"scale"===t?e=vi(e,yi(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=vi(e,bi(n[0])):"skewX"===t?e=vi(e,ki(n[0])):"skewY"===t?e=vi(e,Ai(n[0])):"matrix"===t&&(e=vi(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?xi(function(t,e){var n,r,o,i,a,s,l;if(!t.length)return{};if(e<=(null!=(n=t[0].time)?n:0))return t[0].value||{};if(e>=(null!=(r=t[t.length-1].time)?r:0))return t[t.length-1].value||{};let u=0;for(;u<t.length-1&&(null!=(o=t[u+1].time)?o:0)<e;)u++;const c=t[u],f=t[u+1],d=(e-(null!=(i=c.time)?i:0))/((null!=(a=f.time)?a:0)-(null!=(s=c.time)?s:0)||1),h=c.value||{},p=f.value||{},m={};return h.translate&&p.translate?m.translate=[wi(h.translate[0],p.translate[0],d),wi(h.translate[1],p.translate[1],d)]:m.translate=h.translate||p.translate,void 0!==h.rotate&&void 0!==p.rotate?m.rotate=wi(h.rotate,p.rotate,d):m.rotate=null!=(l=h.rotate)?l:p.rotate,h.scale&&p.scale?m.scale=[wi(h.scale[0],p.scale[0],d),wi(h.scale[1],p.scale[1],d)]:m.scale=h.scale||p.scale,m.origin=h.origin||p.origin,m}(t.keyframes,e)):t.value?xi(t.value):"object"!=typeof t||Array.isArray(t)?mi:xi(t)}var Oi=new Set(["svg","g","symbol"]),Mi=new Set(["defs","mask","clipPath","title"]);function Si(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Si(t,e))}function Pi(t){return null==t?0:Number(t)}function _i(t){return Math.round(100*t)/100+0}function zi(t,e,n){var r,o,i,a,s;const l=null!=(r=t.fill)?r:"",u=null!=(o=t.stroke)?o:"",c=null!=(a=null!=(i=t["stroke-width"])?i:t.strokeWidth)?a:"",f=_i(function(t,e,n,r){var o,i,a,s,l,u;if(t&&t.keyframes&&t.keyframes.length){const e=t.keyframes;if(r<=(null!=(o=e[0].time)?o:0))return e[0].value;if(r>=(null!=(i=e[e.length-1].time)?i:0))return e[e.length-1].value;let n=0;for(;n<e.length-1&&(null!=(a=e[n+1].time)?a:0)<r;)n++;const c=e[n],f=e[n+1],d=(r-(null!=(s=c.time)?s:0))/((null!=(l=f.time)?l:0)-(null!=(u=c.time)?u:0)||1);return wi(c.value,f.value,d)}return void 0!==e?Number(e):n}(null==(s=t.animate)?void 0:s.opacity,t.opacity,1,n)),d=t.mask?1:0,h=e.map(_i).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return Pi(t.width)+","+Pi(t.height)+","+Pi(t.x)+","+Pi(t.y);case"ellipse":return Pi(t.rx)+","+Pi(t.ry)+","+Pi(t.cx)+","+Pi(t.cy);case"circle":return Pi(t.r)+","+Pi(t.cx)+","+Pi(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+h+"]|f:"+l+"|s:"+u+"|sw:"+(Pi(c)||"")+"|o:"+f+"|m:"+d}function Ii(t,e,n,r,o){var i;const a=t.type||"";if(Mi.has(a))return;const s=vi(e,function(t,e){return t.animate&&t.animate.transform?ji(t.animate.transform,e):void 0!==t.transform?ji(t.transform,e):mi}(t,n));if("use"===a){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",i=r.get(e),a=vi(s,gi(Pi(t.x),Pi(t.y)));return void(i?Ii(i,a,n,r,o):o.push("UNRESOLVED_USE:#"+e))}Oi.has(a)?null==(i=t.children)||i.forEach(t=>Ii(t,s,n,r,o)):o.push(zi(t,s,n))}function Ni(t,e){var n;e.add(0);(t=>{var n;if(t&&"object"==typeof t)for(const r of Object.keys(t)){const o=null==(n=t[r])?void 0:n.keyframes;Array.isArray(o)&&o.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)})}})(t.animate),t.transform&&"object"==typeof t.transform&&t.transform.keyframes&&t.transform.keyframes.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)}),null==(n=t.children)||n.forEach(t=>Ni(t,e))}function Di(t,e){const n=new Map;Si(t,n);const r=[];return Ii(t,mi,e,n,r),r.sort()}function Fi(t,e){const n=new Set;Ni(t,n),Ni(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=Di(t,o),i=Di(e,o),a=Ci(n,i),s=Ci(i,n);(a.length||s.length)&&r.push({time:o,onlyInA:a,onlyInB:s})}return r}function Ci(t,e){const n=new Map;for(const t of e)n.set(t,(n.get(t)||0)+1);const r=[];for(const e of t){const t=n.get(e)||0;t>0?n.set(e,t-1):r.push(e)}return r}export{O as COLOUR_ATTR_NAMES,$e as CSS_ONLY_STYLE_PROPS,I as DEFAULT_DURATION_MS,Je as DISALLOWED_SVG_TAGS_LOWER,Ut as INTERNAL_ATTRS,zn as LOOP_JUMP_SHIFT_MS,wo as MISSING_GLYPH_CLASS_NAME,S as PCT_BASED_ATTR_NAMES,yt as PX_ANIM_ATTR_NAME,gt as PX_ANIM_SRC_ATTR_NAME,Lt as PX_TRANSFORM_PART_KEYS,We as PxAnimatedSvgDocumentSchema,re as PxAnimationDefinitionSchema,ye as PxAnimatorConfigSchema,kt as PxAnimatorEngine,bt as PxAnimatorMode,ke as PxAttrValueSchema,Re as PxBezierPathSchema,be as PxBindingSchema,ze as PxCloneEffectSchema,le as PxDefsSchema,Jt as PxEasingOrRefSchema,Ue as PxEffectsSchema,oe as PxElementAnimationSchema,De as PxFillGradientEffectSchema,Bt as PxGradientSpreadMethod,Ie as PxGradientStopSchema,Vt as PxGradientType,Et as PxGradientUnits,Ht as PxKeyframeSchema,Yt as PxKeyframeValueSchema,At as PxLoopExtend,$t as PxLoopSchema,Me as PxMaskedByEffectSchema,Ee as PxNodeBase,Be as PxNodeSchema,te as PxPropertyAnimationSchema,Oe as PxRepeaterEffectSchema,_e as PxRetimeEffectSchema,ue as PxScrollRangePointSchema,ce as PxScrollRangeSchema,fe as PxScrollSchema,Fe as PxStrokeGradientEffectSchema,Pe as PxStrokeTrimEffectSchema,Ft as PxStrokeTrimSubPaths,Ve as PxSvgNodeExtra,Te as PxTextEffectSchema,Ce as PxTextPathEffectSchema,de as PxTimelinePinSchema,ge as PxTimelineSchema,je as PxTransformByEffectSchema,ee as PxTransformPartsSchema,ne as PxTransformValueSchema,ie as PxTriggerSchema,z as STYLE_ATTR_NAMES,Ct as TEXT_ATTR,Tt as TEXT_CONTENT_ATTR,M as TRANSFORM_FN_NAMES,ei as applyPlayerEffects,f as bezierToSvgPath,Xn as calcAnimationValues,C as camelCaseToKebabWordIfNeeded,T as clamp,Ni as collectSampleTimes,P as composeTransformParts,pi as createBasicFrameLoopAnimator,Hr as createPathSampler,y as cubicBezier,qe as deepClone,mt as describeSchema,Fi as diffInEffect,pn as evaluateMotionPathSegment,ro as extendedPathForBrowser,Gt as flattenAnimatorTimeline,Xe as generateNewIds,Ke as generateUniqueId,Rt as getAnimatorConfig,Xt as getBindings,Qt as getChildren,qt as getDefs,Kn as getNormalisedBindings,sn as getNormalizedProps,m as interpolateBeziers,Ln as interpolateValue,Wt as isPxElementFileFormat,Ze as isPxElementFileFormatDeep,R as isScrollTimeline,io as jsonElementFactory,N as kebabToCamelCaseWord,Mo as layoutGlyphTextChars,di as materialiseAllInTree,$n as materialiseAnimatedUseInstances,Lo as materialiseGlyphText,_o as materialiseGlyphTextAlongPath,Oo as materialiseGlyphTextHorizontal,Vn as materialiseInternalLoopsInPropAnim,Wn as materialiseInternalLoopsInTree,mn as materialiseMotionPathInPropAnim,Pn as materialiseMotionPathsInTree,Gn as mergeStaticTransformIntoAnimDef,Kt as nestAnimatorTimeline,_ as parseTransformParts,fn as propAnimIsMotionPath,vt as px,an as resolveStyle,x as reverseEasing,on as sanitiseAttributeValue,pt as schemaKeys,X as scrollOffsetProgress,G as scrollPhaseInterval,Q as scrollResolveAxis,Z as scrollTotalDurationMs,q as scrollViewProgress,no as shiftAnimatable,A as splitEasing,k as subdivideCubicBezier,w as toRGBA,Le as validateNodeEffects,Di as visualModelAt};
|
|
1
|
+
var t=Object.defineProperty,e=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=Math.pow,s=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,l=(t,e)=>{for(var n in e||(e={}))o.call(e,n)&&s(t,n,e[n]);if(r)for(var n of r(e))i.call(e,n)&&s(t,n,e[n]);return t},u=(t,r)=>e(t,n(r)),c=(t,e)=>{var n={};for(var a in t)o.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(null!=t&&r)for(var a of r(t))e.indexOf(a)<0&&i.call(t,a)&&(n[a]=t[a]);return n};function f(t,e=!1){var n,r,o,i;const a=t.v,s=t.i,l=t.o,u=t.c;if(!a.length)return"";const c=[],f=a.length;c.push("M"+a[0][0]+","+a[0][1]);for(let t=1;t<f;t++){const o=a[t-1],i=null!=(n=null==l?void 0:l[t-1])?n:o,u=null!=(r=null==s?void 0:s[t])?r:a[t],f=a[t];!e&&i[0]===o[0]&&i[1]===o[1]&&u[0]===f[0]&&u[1]===f[1]?c.push("L"+f[0]+","+f[1]):c.push("C"+i[0]+","+i[1]+","+u[0]+","+u[1]+","+f[0]+","+f[1])}if(u&&f>0){const t=a[f-1],n=null!=(o=null==l?void 0:l[f-1])?o:t,r=null!=(i=null==s?void 0:s[0])?i:a[0],u=a[0];!e&&n[0]===t[0]&&n[1]===t[1]&&r[0]===u[0]&&r[1]===u[1]||c.push("C"+n[0]+","+n[1]+","+r[0]+","+r[1]+","+u[0]+","+u[1]),c.push("z")}return c.join("")}function d(t,e,n){return t+(e-t)*n}function h(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let i=0;i<o;i++)r[i]=d(t[i]||0,e[i]||0,n);return r}function p(t,e,n){return[d(t[0]||0,e[0]||0,n),d(t[1]||0,e[1]||0,n),d(t[2]||0,e[2]||0,n),d(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function m(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++)o.push(g(t[i],e[i],n));return o}function g(t,e,n){var r,o,i,a,s,l,u,c,f;if(!t||!e)return t||e||{v:[]};const d=Math.min(Math.max(n,0),1),p=Math.min(t.v.length,e.v.length),m=[],g=[],v=[];for(let n=0;n<p;n++){const f=t.v[n],p=e.v[n];m.push(h(f,p,d));const y=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,b=null!=(a=null==(i=e.i)?void 0:i[n])?a:p;g.push(h(y,b,d));const k=null!=(l=null==(s=t.o)?void 0:s[n])?l:f,A=null!=(c=null==(u=e.o)?void 0:u[n])?c:p;v.push(h(k,A,d))}return{v:m,i:g.length?g:void 0,o:v.length?v:void 0,c:null!=(f=t.c)?f:e.c}}function v(t,e,n){if(n<=0)return 0;if(n>=1)return 1;const r=3*t,o=3*(e-t)-r,i=1-r-o;function a(t){return((i*t+o)*t+r)*t}function s(t){return(3*i*t+2*o)*t+r}let l=n,u=0,c=1;for(let t=0;t<8;t++){const t=a(l)-n;if(Math.abs(t)<1e-6)return l;const e=s(l);if(Math.abs(e)<1e-6)break;l-=t/e}for(l=n;u<c;){const t=a(l);if(Math.abs(t-n)<1e-6)return l;n>t?u=l:c=l,l=(c+u)/2}return l}function y(t){const[e,n,r,o]=t,i=3*n,a=3*(o-n)-i,s=1-i-a;return function(t){return n=v(e,r,t),((s*n+a)*n+i)*n;var n}}function b(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function k(t,e,n,r,o){const i=b(t,e,o),a=b(e,n,o),s=b(n,r,o),l=b(i,a,o),u=b(a,s,o),c=b(l,u,o);return{left:[t,i,l,c],right:[c,u,s,r]}}function A(t,e){if(!t)return{left:void 0,right:void 0};if(e<=0)return{left:void 0,right:t};if(e>=1)return{left:t,right:void 0};const[n,r,o,i]=t,a=v(n,o,e),s=[n,r],l=[o,i],{left:u,right:c}=k([0,0],s,l,[1,1],a),f=u[3][0],d=u[3][1];let h,p;f>1e-9&&Math.abs(d)>1e-9&&(h=[u[1][0]/f,u[1][1]/d,u[2][0]/f,u[2][1]/d]);const m=1-f,g=1-d;return m>1e-9&&Math.abs(g)>1e-9&&(p=[(c[1][0]-f)/m,(c[1][1]-d)/g,(c[2][0]-f)/m,(c[2][1]-d)/g]),{left:h,right:p}}function w(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function x(t){const e=Math.round(255*t[0]),n=Math.round(255*t[1]),r=Math.round(255*t[2]);return 4===t.length?"rgba("+e+","+n+","+r+","+t[3]+")":"rgb("+e+","+n+","+r+")"}function j(t){if(t){if(Array.isArray(t))return t;if("string"==typeof t)return t.startsWith("#")?function(t){const e=t.slice(1),n=e.length<=4,r=n?e[0]+e[0]:e.slice(0,2),o=n?e[1]+e[1]:e.slice(2,4),i=n?e[2]+e[2]:e.slice(4,6),a=4===e.length?e[3]+e[3]:8===e.length?e.slice(6,8):null,s=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==a&&s.push(parseInt(a,16)/255),s}(t):t.startsWith("rgb")?function(t){var e;const n=null==(e=t.match(/rgba?\((.*)\)/))?void 0:e[1];if(!n)throw new Error("Invalid rgb/rgba format");const r=n.split(",").map(t=>+t.trim());return[r[0]/255,r[1]/255,r[2]/255,...void 0!==r[3]?[r[3]]:[]]}(t):void console.warn("Unsupported color format: "+t)}}var O=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),S=new Set(["translate","rotate","scale","skew"]),M=new Set(["offset-distance","offsetDistance"]);function P(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],i=t.translate,a=t.origin,s=t.rotate,l=t.skew,u=t.scale,c=r?"px":"",f=r?"deg":"";return i&&o.push("translate("+i[0]+c+","+i[1]+c+")"),a&&o.push("translate("+a[0]+c+","+a[1]+c+")"),null!=s&&o.push("rotate("+s+f+")"),null!=l&&o.push("skewX("+l+f+")"),u&&o.push("scale("+u[0]+","+u[1]+")"),a&&o.push("translate("+-a[0]+c+","+-a[1]+c+")"),o.join("")}function _(t){var e,n;if(!t||"string"!=typeof t)return;const r={},o=/([a-zA-Z]+)\s*\(([^)]*)\)/g,i=["translate","rotate","skewX","scale"];let a,s=-1;for(;null!==(a=o.exec(t));){const t=a[1],o=i.indexOf(t);if(o<0||o<=s)return;s=o;const l=a[2].split(/[\s,]+/).filter(Boolean).map(Number);if(l.some(t=>Number.isNaN(t)))return;if("translate"===t){if(l.length<1||l.length>2)return;r.translate=[l[0],null!=(e=l[1])?e:0]}else if("rotate"===t){if(1!==l.length)return;r.rotate=l[0]}else if("skewX"===t){if(1!==l.length)return;r.skew=l[0]}else{if(l.length<1||l.length>2)return;r.scale=[l[0],null!=(n=l[1])?n:l[0]]}}return t.replace(/([a-zA-Z]+)\s*\(([^)]*)\)/g,"").replace(/[\s,]/g,"").length?void 0:Object.keys(r).length?r:void 0}var z=new Set(["offset-distance","offsetDistance"]),N=1e3;function I(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function E(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var D=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","markerUnits","markerWidth","markerHeight","refX","refY","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","tableValues","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function T(t){return D.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function R(t,e,n){return Math.max(e,Math.min(t,n))}function C(t,e,n,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const i=1-o,a=i*i,s=o*o,l=a*i,u=3*o*a,c=3*s*i,f=s*o;return[l*t[0]+u*e[0]+c*n[0]+f*r[0],l*t[1]+u*e[1]+c*n[1]+f*r[1]]}var F=1e-4;function U(t,e,n,r,o){const i=L(t,e,n,r,o);if(0===i[0]&&0===i[1]){return L(t,e,n,r,o<.5?o+F:o-F)}return i}function L(t,e,n,r,o){const i=1-o,a=3*i*i,s=6*o*i,l=3*o*o;return[a*(e[0]-t[0])+s*(n[0]-e[0])+l*(r[0]-n[0]),a*(e[1]-t[1])+s*(n[1]-e[1])+l*(r[1]-n[1])]}function V(t,e,n,r,o=100){const i=o+1,a=new Float64Array(i),s=new Float64Array(i);let l=C(t,e,n,r,0);a[0]=0,s[0]=0;let u=0;for(let c=1;c<i;c++){const i=c/o,f=C(t,e,n,r,i),d=f[0]-l[0],h=f[1]-l[1];u+=Math.sqrt(d*d+h*h),a[c]=i,s[c]=u,l=f}return{ts:a,ds:s}}function B(t,e){const{ts:n,ds:r}=t,o=n.length-1;if(e<=n[0])return r[0];if(e>=n[o])return r[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;n[t]<e?i=t+1:a=t}const s=n[a-1],l=n[a]-s,u=l>0?(e-s)/l:0;return r[a-1]+u*(r[a]-r[a-1])}function W(t){return"scroll"===(null==t?void 0:t.timelineSource)}function G(t){return("number"==typeof(null==t?void 0:t.duration)&&t.duration>0?t.duration:N)*("number"==typeof(null==t?void 0:t.iterations)&&t.iterations>0?t.iterations:1)}function K(t,e,n){const r=e,o=n;switch(t){case"cover":return[0,r+o];case"entry":return[0,Math.min(r,o)];case"contain":return[Math.min(r,o),Math.max(r,o)];case"exit":return[Math.max(r,o),r+o];case"entry-crossing":return[0,r];case"exit-crossing":return[o,r+o]}}function q(t,e,n,r){var o;const[i,a]=K(null!=(o=null==t?void 0:t.phase)?o:"cover",n,r);return i+("number"==typeof(null==t?void 0:t.fraction)?t.fraction:e)*(a-i)}function Z(t,e,n,r){const o=n-t,i=q(null==r?void 0:r.start,0,e,n),a=q(null==r?void 0:r.end,1,e,n);return a<=i?o>=a?1:0:R((o-i)/(a-i),0,1)}function Y(t,e,n){var r,o;const i=e>0?R(t/e,0,1):1,a="number"==typeof(null==(r=null==n?void 0:n.start)?void 0:r.fraction)?n.start.fraction:0,s="number"==typeof(null==(o=null==n?void 0:n.end)?void 0:o.fraction)?n.end.fraction:1;return s<=a?i>=s?1:0:R((i-a)/(s-a),0,1)}function J(t,e){const n=null!=t?t:"block";if("x"===n||"y"===n)return n;const r=!!e&&e.startsWith("vertical");return"inline"===n?r?"y":"x":r?"x":"y"}var X="unexpected extra key";function Q(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var H=class{_canSanitize(t){return this.isValid(t)}optional(){return new $(this)}},$=class extends H{constructor(t){super(),this.inner=t,this._default=void 0}sanitize(t){if(null!=t)return this.inner._canSanitize(t)?this.inner.sanitize(t):void 0}isValid(t,e,n){return null==t||this.inner.isValid(t,e,n)}_canSanitize(t){return null==t||this.inner._canSanitize(t)}},tt=class extends H{constructor(t=""){super(),this._default=t}sanitize(t){return"string"==typeof t?t:this._default}isValid(t,e,n){return"string"==typeof t||(null==e||e.errors.push(Q(null!=n?n:[])+": expected string, got "+typeof t),!1)}},et=class extends H{constructor(t=0){super(),this._default=t}sanitize(t){return"number"==typeof t&&isFinite(t)?t:this._default}isValid(t,e,n){return!("number"!=typeof t||!isFinite(t))||(null==e||e.errors.push(Q(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},nt=class extends H{constructor(t=!1){super(),this._default=t}sanitize(t){return"boolean"==typeof t?t:this._default}isValid(t,e,n){return"boolean"==typeof t||(null==e||e.errors.push(Q(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},rt=class extends H{constructor(t){super(),this.value=t,this._default=t}sanitize(t){return t===this.value?this.value:this._default}isValid(t,e,n){return t===this.value||(null==e||e.errors.push(Q(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},ot=class extends H{constructor(t,e){super(),this.values=t,this._default=null!=e?e:t[0]}sanitize(t){return this.values.includes(t)?t:this._default}isValid(t,e,n){return!!this.values.includes(t)||(null==e||e.errors.push(Q(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},it=class extends H{constructor(t,e){super(),this.schemas=t,this._kind="union",this._default=null!=e?e:t[0]._default}sanitize(t){for(const e of this.schemas)if(e.isValid(t))return e.sanitize(t);return this._default}isValid(t,e,n){var r;const o=e&&{errors:[],warnings:[],strict:e.strict};return!!this.schemas.some(e=>e.isValid(t,o,n?[...n]:void 0))||(null==e||e.errors.push(Q(null!=n?n:[])+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,240)),!1)}_canSanitize(t){return this.schemas.some(e=>e._canSanitize(t))}},at=class extends H{constructor(t,e,n){var r;super(),this._key=t,this._schemas=e,this._kind="discriminatedUnion",this._default=null!=n?n:e[0]._default,this._map=new Map;for(const n of e){const e=n._shape[t];if(!e)continue;const o=null!=(r=e.inner)?r:e;this._map.set(o._default,n),e.inner&&(this._absentMember=n)}}_findSchema(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const e=t[this._key];return null==e?this._absentMember:this._map.get(e)}sanitize(t){var e;return(null!=(e=this._findSchema(t))?e:this._schemas[0]).sanitize(t)}isValid(t,e,n){const r=this._findSchema(t);if(!r){const r=null===t||"object"!=typeof t||Array.isArray(t)?void 0:t[this._key];return null==e||e.errors.push(Q(null!=n?n:[])+": no discriminated union member matched "+this._key+"="+JSON.stringify(r)),!1}return r.isValid(t,e,n)}_canSanitize(t){if(null===t||"object"!=typeof t||Array.isArray(t))return!1;const e=this._findSchema(t);return e?e._canSanitize(t):this._schemas[0]._canSanitize(t)}},st=class extends H{constructor(t){super(),this._shape=t;const e={};for(const n of Object.keys(t))e[n]=t[n]._default;this._default=e}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n={};for(const t of Object.keys(this._shape)){const r=this._shape[t].sanitize(e[t]);void 0!==r&&(n[t]=r)}return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(Q(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(i=!1),o.pop();if(null==e?void 0:e.strict)for(const t of Object.keys(r))t in this._shape||void 0!==r[t]&&(o.push(t),e.errors.push(Q(o)+": "+X),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},lt=class extends H{constructor(t,e){super(),this._shape=t,this._openSchema=e;const n={};for(const e of Object.keys(t))n[e]=t[e]._default;this._default=n}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n=l({},e);for(const t of Object.keys(this._shape)){const r=this._shape[t].sanitize(e[t]);void 0!==r&&(n[t]=r)}if(this._openSchema)for(const t of Object.keys(e))t in this._shape||(n[t]=this._openSchema.sanitize(e[t]));return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(Q(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(i=!1),o.pop();if(this._openSchema)for(const t of Object.keys(r))t in this._shape||(o.push(t),this._openSchema.isValid(r[t],e,o)||(i=!1),o.pop());return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},ut=class extends H{constructor(t){super(),this.item=t,this._default=[]}sanitize(t){if(!Array.isArray(t))return[];const e=[];for(const n of t)this.item._canSanitize(n)&&e.push(this.item.sanitize(n));return e}isValid(t,e,n){if(!Array.isArray(t))return null==e||e.errors.push(Q(null!=n?n:[])+": expected array, got "+typeof t),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<t.length;n++)r.push("["+n+"]"),this.item.isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)}},ct=class extends H{constructor(t){super(),this.value=t,this._kind="record",this._default={}}sanitize(t){if(!t||"object"!=typeof t||Array.isArray(t))return{};const e={};for(const[n,r]of Object.entries(t))this.value._canSanitize(r)&&(e[n]=this.value.sanitize(r));return e}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(Q(null!=n?n:[])+": expected object/record, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(const[n,i]of Object.entries(t))r.push(n),this.value.isValid(i,e,r)||(o=!1),r.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},ft=class extends H{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},dt=class extends H{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return void 0!==t||(null==e||e.errors.push(Q(null!=n?n:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}},ht=class extends H{constructor(t,e){super(),this.fn=t,this._default=e,this.resolved=null}get schema(){var t;return null!=(t=this.resolved)?t:this.resolved=this.fn()}sanitize(t){return this.schema.sanitize(t)}isValid(t,e,n){return this.schema.isValid(t,e,n)}_canSanitize(t){return this.schema._canSanitize(t)}},pt=class extends H{constructor(t){super(),this.schemas=t,this._kind="tuple",this._default=t.map(t=>t._default)}sanitize(t){return Array.isArray(t)&&t.length===this.schemas.length?this.schemas.map((e,n)=>e.sanitize(t[n])):this._default}isValid(t,e,n){if(!Array.isArray(t)||t.length!==this.schemas.length)return null==e||e.errors.push(Q(null!=n?n:[])+": expected tuple of length "+this.schemas.length+", got "+(Array.isArray(t)?"array["+t.length+"]":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<this.schemas.length;n++)r.push("["+n+"]"),this.schemas[n].isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)&&t.length===this.schemas.length}};function mt(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function gt(t){var e;const n=t;switch(n._kind){case"union":return{kind:"union",members:n.schemas};case"discriminatedUnion":return{kind:"discriminatedUnion",key:n._key,members:n._schemas};case"record":return{kind:"record",value:n.value};case"tuple":return{kind:"tuple",items:n.schemas}}return"_shape"in n?{kind:"shape",shape:n._shape,openValue:n._openSchema}:"item"in n?{kind:"array",item:n.item}:"inner"in n?{kind:"optional",inner:n.inner}:"fn"in n?{kind:"lazy",resolved:null!=(e=n.resolved)?e:n.resolved=n.fn()}:{kind:"leaf"}}var vt,yt={string:(t="")=>new tt(t),number:(t=0)=>new et(t),boolean:(t=!1)=>new nt(t),literal:t=>new rt(t),enum:(t,e)=>new ot(t,e),union:(t,e)=>new it(t,e),discriminatedUnion:(t,e)=>new at(t,e),object:t=>new st(t),openObject:(t,e)=>new lt(t,e),extendedObject:(t,e)=>new st(l(l({},t._shape),e)),array:t=>new ut(t),record:t=>new ct(t),any:()=>new ft,defined:()=>new dt,tuple:t=>new pt(t),lazy:(t,e)=>new ht(t,e)},bt="1.1",kt="version",At="animator",wt=(t=>(t.unstamped="unstamped",t.same="same",t.older="older",t.newer="newer",t.otherGeneration="otherGeneration",t))(wt||{}),xt=/^(\d+)\.(\d+)(?:\.(\d+))?$/;function jt(t){if("string"!=typeof t)return;const e=xt.exec(t.trim());return e?{a:Number(e[1]),b:Number(e[2]),c:void 0===e[3]?0:Number(e[3])}:void 0}function Ot(t){return t.a+"."+t.b+"."+t.c}var St=null!=(vt=jt("1.1"))?vt:{a:1,b:1,c:0};function Mt(t){if(!t||"object"!=typeof t)return;const e=Pt(t,At);if(e)return e;const n=Pt(t,"meta");return n?Pt(n,At):void 0}function Pt(t,e){const n=t[e];return n&&"object"==typeof n&&!Array.isArray(n)?n:void 0}function _t(t){const e=Mt(t);return e?jt(e[kt]):void 0}function zt(t,e,n){return t?t.a!==e.a?"otherGeneration":t.b!==e.b?t.b>e.b?"newer":"older":n&&t.c!==e.c?t.c>e.c?"newer":"older":"same":"unstamped"}function Nt(t,e,n,r){if(!e)return;const o=r?"player":"editor",i="written for schema "+Ot(e)+", this "+o+" reads "+Ot(n);switch(t){case"newer":return"This file is "+i+". Update the "+o+" to open it fully.";case"older":return"This file is "+i+". Saving it from this "+o+" rewrites it in the current format.";case"otherGeneration":return"This file is "+i+" — a different format generation, which no conversion bridges. Open it in a "+o+" of that generation, or accept this document without the parts named above.";default:return}}var It=(t=>(t.additive="additive",t.converted="converted",t))(It||{}),Et="1.1",Dt=[];function Tt(t,e){const n=_t(t),r=zt(n,e.target,e.readerReadsEditorPart);if(!n||"older"!==r)return{doc:t,from:n,relation:r,applied:[],advice:Nt(r,n,e.target,!e.readerReadsEditorPart)};const o=[];for(const t of e.steps){const r=jt(t.to);r&&("older"===zt(n,r,e.readerReadsEditorPart)&&t.up&&o.push(t))}if(!o.length||!t||"object"!=typeof t)return{doc:t,from:n,relation:r,applied:[]};const i=Ct(t),a=[];for(const t of o)try{t.up(i),a.push(t)}catch(t){break}return a.length?(Ft(i,e.target,e.readerReadsEditorPart),{doc:i,from:n,relation:r,applied:a}):{doc:t,from:n,relation:r,applied:[]}}function Rt(t){return Tt(t,{steps:Dt,target:St,readerReadsEditorPart:!1})}function Ct(t){const e=globalThis.structuredClone;return e?e(t):JSON.parse(JSON.stringify(t))}function Ft(t,e,n){const r=Mt(t);if(!r)return;const o=jt(r[kt]);r[kt]=Ot({a:e.a,b:e.b,c:n?e.c:o?o.c:0})}function Ut(t,e){const n=_t(t);if(!n)return{ok:!1,blocking:[],reason:"The document carries no version, so there is nothing to convert down from."};const r=zt(n,e.target,e.readerReadsEditorPart);if("otherGeneration"===r)return{ok:!1,blocking:[],reason:"Schema "+Ot(n)+" and "+Ot(e.target)+" are different generations; no conversion bridges them."};if("newer"!==r)return{ok:!0,doc:t,applied:[]};const o=[];for(const t of e.steps){const r=jt(t.to);r&&("newer"===zt(r,e.target,e.readerReadsEditorPart)&&"newer"!==zt(r,n,e.readerReadsEditorPart)&&o.push(t))}o.reverse();const i=o.filter(t=>"converted"===t.kind&&!t.down);if(i.length)return{ok:!1,blocking:i,reason:"Cannot convert down to "+Ot(e.target)+": "+i.map(t=>t.from+" → "+t.to+" ("+t.reason+")").join("; ")+" cannot be undone."};const a=Ct(t),s=[];for(const t of o)if(t.down)try{t.down(a),s.push(t)}catch(e){return{ok:!1,blocking:[t],reason:"Undoing "+t.from+" → "+t.to+" failed: "+String(e)}}return Ft(a,e.target,e.readerReadsEditorPart),{ok:!0,doc:a,applied:s}}function Lt(t,e){return Ut(t,{steps:Dt,target:e,readerReadsEditorPart:!1})}function Vt(t){const e=new Set,n=new Set,r=[{schema:t,path:""}];for(;r.length;){const{schema:t,path:o}=r.shift(),i=gt(t);switch(i.kind){case"shape":if(n.has(t))break;n.add(t);for(const t of Object.keys(i.shape)){const n=o?o+"."+t:t;e.add(n),r.push({schema:i.shape[t],path:n})}i.openValue&&r.push({schema:i.openValue,path:o+"{*}"});break;case"optional":r.push({schema:i.inner,path:o});break;case"array":r.push({schema:i.item,path:o+"[]"});break;case"lazy":r.push({schema:i.resolved,path:o});break;case"record":r.push({schema:i.value,path:o+"{*}"});break;case"union":i.members.forEach((t,e)=>r.push({schema:t,path:o+"|"+e}));break;case"discriminatedUnion":for(const t of i.members)r.push({schema:t,path:o+"|"+Bt(t,i.key)})}}return[...e].sort()}function Bt(t,e){const n=gt(t);if("shape"!==n.kind)return"?";const r=n.shape[e];if(void 0===r)return"?";const o=gt(r);return String(("optional"===o.kind?o.inner:r)._default)}function Wt(t,e){const n=new Set(t),r=new Set(e);return{added:e.filter(t=>!n.has(t)).sort(),removed:t.filter(t=>!r.has(t)).sort()}}function Gt(t){const e=t.added.length>0||t.removed.length>0,n=jt(t.lastReleased),r=jt(t.declared);if(!n||!r)return{changed:e,refuse:"Unparseable version: "+t.lastReleased+" / "+t.declared+"."};const o=n.a+"."+(n.b+1);if(!e){if(r.b===n.b&&r.a===n.a)return{changed:e};return t.steps.find(e=>e.to===t.declared)?{changed:e,requiredVersion:t.declared}:{changed:e,refuse:"The version moved to "+t.declared+" with no key change and no step explaining it."}}const i=t.removed.length?"converted":"additive",a=t.added.length+" key(s) added, "+t.removed.length+" removed";if(r.a!==n.a||r.b!==n.b+1)return{changed:e,requiredKind:i,requiredVersion:o,refuse:"The player schema changed ("+a+") but PX_PLAYER_SCHEMA_VERSION is "+t.declared+". Set it to "+o+" and add the PLAYER_WIRE_STEPS entry."};const s=t.steps.find(e=>e.to===t.declared);return s?"converted"===i&&"converted"!==s.kind?{changed:e,requiredKind:i,requiredVersion:o,refuse:"Keys were REMOVED ("+t.removed.join(", ")+"), which is never additive — the "+t.declared+" step must be `converted`, with an up()."}:{changed:e,requiredKind:i,requiredVersion:o}:{changed:e,requiredKind:i,requiredVersion:o,refuse:"No PLAYER_WIRE_STEPS entry reaches "+t.declared+"."}}function Kt(t,e,n,r){const o=[];if(!t.length)return["The release log is empty."];t[0].baseline&&t[0].version===r||o.push("The first release must be the baseline "+r+".");for(let n=1;n<t.length;n++){const r=jt(t[n-1].version),i=jt(t[n].version);r&&i&&i.a===r.a&&i.b===r.b+1||o.push("Release "+t[n].version+" does not follow "+t[n-1].version+" by one `b` step."),t[n].date<t[n-1].date&&o.push("Release "+t[n].version+" is dated before its predecessor.");const a=e.find(e=>e.to===t[n].version);a?t[n].removed.length&&"converted"!==a.kind&&o.push("Release "+t[n].version+" removed keys, but its step is not `converted`."):o.push("Release "+t[n].version+" has no PLAYER_WIRE_STEPS entry.")}const i=t[t.length-1].version;return i!==n&&o.push("PX_PLAYER_SCHEMA_VERSION is "+n+" but the last release record is "+i+" — a bump needs its changelog entry (run scripts/schema-release.mjs --apply)."),o}var qt="data-px-animation-src",Zt="_px_animator",Yt=["duration","iterations","engine","frameRate"],Jt=["trigger","delay","fillMode","direction"],Xt={native:"native",js:"js"},Qt=u(l({},Xt),{auto:"auto"});function Ht(t){return t===Qt.js?Xt.js:Xt.native}function $t(t){return t===Qt.native}function te(t){return t!==Qt.js}var ee={start:"start",end:"end"},ne={normal:"normal",alternate:"alternate"},re="luminance",oe="alpha",ie="userSpaceOnUse",ae="objectBoundingBox",se={translate:"translate"},le="clip",ue="extend",ce="spacing",fe="spacingAndGlyphs",de="align",he="stretch",pe="auto",me="exact",ge={separate:"separate",combined:"combined"},ve="text",ye="textContent",be="class",ke="transform",Ae=new Set(["type","children","animator","meta","animate","effects",ve,ye]),we="translate",xe="origin",je=[we,"rotate","scale",xe],Oe={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},Se={pad:"pad",reflect:"reflect",repeat:"repeat"},Me={linear:"linear",radial:"radial"};function Pe(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&"svg"===t.type}function _e(t){var e;const n=(null==t?void 0:t.animator)||(null==(e=null==t?void 0:t.meta)?void 0:e.animator);return n?Ne(n):void 0}var ze=new WeakMap;function Ne(t){const e=t.timeline;if(null==e||"object"!=typeof e)return t;const n=ze.get(t);if(n)return n;const r=t,{timeline:o}=r,i=c(r,["timeline"]);if(void 0!==e.engine&&(i.engine=e.engine),void 0!==e.frameRate&&(i.frameRate=e.frameRate),"scroll"===e.type||"view"===e.type){i.timelineSource="scroll",void 0!==e.duration&&(i.duration=e.duration),void 0!==e.iterations&&(i.iterations=e.iterations);const t=l({},i.scroll||{});t.kind=e.type,void 0!==e.axis&&(t.axis=e.axis),void 0!==e.source&&(t.source=e.source),void 0!==e.subject&&(t.subject=e.subject),void 0!==e.smoothing&&(t.smoothing=e.smoothing),void 0!==e.range&&(t.range=e.range);const n=e.pin;"boolean"==typeof n?t.pin=n:n&&"object"==typeof n&&(t.pin=!0,void 0!==n.align&&(t.pinAlign=n.align),void 0!==n.top&&(t.pinTop=n.top),void 0!==n.distance&&(t.pinDistance=n.distance)),i.scroll=t}else{if(void 0!==e.duration&&(i.duration=e.duration),void 0!==e.trigger){const t=e.trigger,{finishAction:n}=t,r=c(t,["finishAction"]);Object.keys(r).length&&(i.trigger=r),void 0!==n&&(i.resetOnFinish="reset"===n)}void 0!==e.delay&&(i.delay=e.delay),void 0!==e.iterations&&(i.iterations=e.iterations),void 0!==e.direction&&(i.direction=e.direction),void 0!==e.fillMode&&(i.fill=e.fillMode)}return ze.set(t,i),i}function Ie(t){if(!t||void 0!==t.timeline)return t;const e=t,{timelineSource:n,scroll:r,trigger:o,delay:i,iterations:a,direction:s,fill:f,resetOnFinish:d,duration:h,engine:p,frameRate:m}=e,g=c(e,["timelineSource","scroll","trigger","delay","iterations","direction","fill","resetOnFinish","duration","engine","frameRate"]);if("scroll"===n){const t={type:(v=null==r?void 0:r.kind,"scroll"===v?"scroll":"view")};if(void 0!==p&&(t.engine=p),void 0!==m&&(t.frameRate=m),void 0!==h&&(t.duration=h),"number"==typeof a&&(t.iterations=a),r){void 0!==r.axis&&(t.axis=r.axis),void 0!==r.source&&(t.source=r.source),void 0!==r.subject&&(t.subject=r.subject),void 0!==r.smoothing&&(t.smoothing=r.smoothing),void 0!==r.range&&(t.range=r.range);void 0!==r.pinAlign||void 0!==r.pinTop||void 0!==r.pinDistance?t.pin=l(l(l({},void 0!==r.pinAlign?{align:r.pinAlign}:{}),void 0!==r.pinTop?{top:r.pinTop}:{}),void 0!==r.pinDistance?{distance:r.pinDistance}:{}):void 0!==r.pin&&(t.pin=r.pin)}return u(l({},g),{timeline:t})}var v;const y={};if(void 0!==p&&(y.engine=p),void 0!==m&&(y.frameRate=m),void 0!==h&&(y.duration=h),void 0!==o||d){const t=l({},o||{});d&&(t.finishAction="reset"),y.trigger=t}return void 0!==i&&(y.delay=i),void 0!==a&&(y.iterations=a),void 0!==s&&(y.direction=s),void 0!==f&&(y.fillMode=f),Object.keys(y).length>0?u(l({},g),{timeline:y}):g}function Ee(t){var e;if(t)return null==(e=_e(t))?void 0:e.definitions}function De(t){var e;if(!t)return;const n=null==(e=_e(t))?void 0:e.animateById;return n?Object.entries(n).map(([t,e])=>({id:t.startsWith("#")?t.slice(1):t,animate:e})):void 0}function Te(t){return null==t?void 0:t.children}var Re=yt.union([yt.string(),yt.tuple([yt.number(),yt.number(),yt.number(),yt.number()])]),Ce=yt.union([yt.string(),yt.number(),yt.array(yt.number()),yt.object({path:yt.string()}),yt.lazy(()=>yt.object({paths:yt.array(Cn)}),{paths:[]}),yt.lazy(()=>yt.array(jn),[]),yt.lazy(()=>qe,{})]),Fe=yt.object({time:yt.number().optional(),value:Ce.optional(),easing:Re.optional(),tangentOut:yt.tuple([yt.number(),yt.number()]).optional(),tangentIn:yt.tuple([yt.number(),yt.number()]).optional()}),Ue=t=>{var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0},Le=t=>{var e;return null!=(e=t.value)?e:t.v},Ve=t=>{var e;return null!=(e=t.easing)?e:t.e},Be=t=>t.tangentIn,We=t=>t.tangentOut,Ge=yt.object({segmentCount:yt.number().optional(),repeatAt:yt.enum([ee.start,ee.end]).optional(),direction:yt.enum([ne.normal,ne.alternate]).optional()}),Ke=yt.object({value:Ce.optional(),keyframes:yt.array(Fe).optional(),loop:yt.union([Ge,yt.boolean()]).optional(),autoOrient:yt.boolean().optional(),alongPathMode:yt.enum(["sampled","offsetPath"]).optional()}),qe=yt.object({translate:yt.tuple([yt.number(),yt.number()]).optional(),rotate:yt.number().optional(),skew:yt.number().optional(),scale:yt.tuple([yt.number(),yt.number()]).optional(),origin:yt.tuple([yt.number(),yt.number()]).optional()}),Ze=yt.union([yt.string(),qe,yt.object({value:qe}),Ke]),Ye=yt.record(Ke),Je=yt.union([yt.string(),yt.array(yt.union([yt.string(),Ye])),Ye]),Xe=yt.object({startOn:yt.enum(["load","mouseOver","click","scrollIntoView","programmatic"]).optional(),outAction:yt.enum(["continue","pause","reset","reverse"]).optional(),finishAction:yt.enum(["hold","reset"]).optional(),scrollIntoViewThreshold:yt.number().optional()}),Qe=yt.object({width:yt.number(),d:yt.string()}),He=yt.object({fontFamily:yt.string(),fontStyle:yt.string(),ascent:yt.number(),unitsPerEm:yt.number(),glyphs:yt.record(Qe)}),$e=yt.object({easings:yt.record(yt.tuple([yt.number(),yt.number(),yt.number(),yt.number()])).optional(),animations:yt.record(Ye).optional(),styles:yt.record(yt.record(yt.union([yt.string(),yt.number()]))).optional(),fonts:yt.record(He).optional()}),tn=yt.object({phase:yt.enum(["cover","contain","entry","exit","entry-crossing","exit-crossing"]).optional(),fraction:yt.number().optional()}),en=yt.object({start:tn.optional(),end:tn.optional()}),nn=yt.object({kind:yt.enum(["view","scroll"]).optional(),axis:yt.enum(["block","inline","x","y"]).optional(),source:yt.enum(["nearest","root"]).optional(),subject:yt.string().optional(),smoothing:yt.number().optional(),pin:yt.boolean().optional(),pinAlign:yt.enum(["top","center","bottom"]).optional(),pinTop:yt.number().optional(),pinDistance:yt.number().optional(),range:en.optional()}),rn=yt.object({align:yt.enum(["top","center","bottom"]).optional(),top:yt.number().optional(),distance:yt.number().optional()}),on=yt.enum([Qt.auto,Qt.native,Qt.js]).optional(),an=yt.object({type:yt.literal("time").optional(),engine:on,frameRate:yt.number().optional(),duration:yt.number().optional(),trigger:Xe.optional(),delay:yt.number().optional(),iterations:yt.union([yt.number(),yt.literal("infinite")]).optional(),fillMode:yt.enum(["forwards","backwards","both","none"]).optional(),direction:yt.enum(["normal","reverse","alternate","alternate-reverse"]).optional()}),sn={duration:yt.number().optional(),iterations:yt.number().optional(),engine:on,frameRate:yt.number().optional(),axis:yt.enum(["block","inline","x","y"]).optional(),source:yt.enum(["nearest","root"]).optional(),subject:yt.string().optional(),smoothing:yt.number().optional(),pin:yt.union([yt.boolean(),rn]).optional(),range:en.optional()},ln=yt.object(l({type:yt.literal("scroll")},sn)),un=yt.object(l({type:yt.literal("view")},sn)),cn=yt.discriminatedUnion("type",[an,ln,un]),fn=yt.object({timeline:cn.optional(),definitions:$e.optional(),animateById:yt.record(Je).optional(),debugGlobalName:yt.string().optional(),version:yt.string().optional()}),dn=yt.object({id:yt.string(),animate:Je}),hn=yt.union([yt.string(),yt.number(),yt.array(yt.number()),yt.object({value:yt.defined()}),qe]),pn=yt.union([yt.number(),Ke,yt.object({value:yt.number()})]),mn=yt.union([yt.tuple([yt.number(),yt.number()]),Ke,yt.object({value:yt.tuple([yt.number(),yt.number()])})]),gn=yt.union([yt.string(),Ke,yt.object({value:yt.string()})]),vn=yt.object({translate:mn.optional(),rotate:pn.optional(),scale:mn.optional(),skew:pn.optional(),origin:mn.optional()}),yn=yt.object({copies:yt.number().optional(),translate:mn.optional(),rotate:pn.optional(),skew:pn.optional(),scale:mn.optional(),origin:mn.optional()}),bn=yt.object({source:yt.string().optional(),maskType:yt.enum([re,oe]).optional(),maskUnits:yt.enum([ie,ae]).optional(),maskContentUnits:yt.enum([ie,ae]).optional(),x:yt.number().optional(),y:yt.number().optional(),width:yt.number().optional(),height:yt.number().optional()}),kn=yt.object({d:gn.optional()}),An=yt.object({offset:pn.optional(),range:mn.optional(),subPaths:yt.enum([ge.separate,ge.combined]).optional()}),wn=yt.object({start:yt.number().optional(),stretch:yt.number().optional(),timeCrop:yt.tuple([yt.number(),yt.number()]).optional()}),xn=yt.object({without:yt.enum([se.translate]).optional(),source:yt.string().optional(),retime:wn.optional()}),jn=yt.object({offset:yt.number(),color:yt.string()}),On=yt.union([yt.array(jn),yt.object({value:yt.array(jn)}),Ke]),Sn=yt.object({type:yt.enum([Me.linear,Me.radial]),start:mn.optional(),end:mn.optional(),center:mn.optional(),radius:pn.optional(),focal:mn.optional(),stops:On.optional(),gradientUnits:yt.enum([Oe.userSpaceOnUse,Oe.objectBoundingBox]).optional(),spreadMethod:yt.enum([Se.pad,Se.reflect,Se.repeat]).optional(),gradientTransform:yt.string().optional()}),Mn=Sn,Pn=yt.object({pathData:yt.string(),pathOverflow:yt.enum([le,ue]).optional(),lengthAdjust:yt.enum([ce,fe]).optional(),method:yt.enum([de,he]).optional(),spacing:yt.enum([pe,me]).optional(),startOffset:pn.optional(),textLength:pn.optional()}),_n=yt.object({useGlyphs:yt.boolean().optional()}),zn=yt.object({transformBy:vn.optional(),repeater:yn.optional(),maskedBy:bn.optional(),clipPath:kn.optional(),strokeTrim:An.optional(),clone:xn.optional(),fillGradient:Sn.optional(),strokeGradient:Mn.optional(),textPath:Pn.optional(),text:_n.optional()});function Nn(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!zn.isValid(t.effects,r,[o+".effects"]))for(const t of r.errors)n.push(t)}t&&Array.isArray(t.children)&&t.children.forEach((t,e)=>r(t,o+".children["+e+"]"))};return r(t,"root"),n}function In(t){const e={errors:[],warnings:[],strict:!0},n=Rn.isValid(t,e,["root"])?[]:[...e.errors];if(t&&"object"==typeof t)for(const e of Nn(t,{strict:!0}))n.includes(e)||n.push(e);return n}var En=yt.openObject({type:yt.string(),domType:yt.string().optional(),id:yt.string().optional(),meta:yt.any().optional(),effects:zn.optional(),animate:Je.optional(),style:yt.union([yt.string(),yt.record(yt.union([yt.string(),yt.number()]))]).optional()},hn),Dn=yt.openObject(u(l({},En._shape),{children:yt.lazy(()=>yt.array(Dn),[]).optional()}),hn),Tn=yt.object({width:yt.union([yt.number(),yt.string()]).optional(),height:yt.union([yt.number(),yt.string()]).optional(),viewBox:yt.string().optional(),animator:fn.optional()}),Rn=yt.openObject(u(l(l({},En._shape),Tn._shape),{type:yt.literal("svg"),children:yt.array(Dn).optional()}),hn),Cn=yt.object({v:yt.array(yt.array(yt.number())),i:yt.array(yt.array(yt.number())).optional(),o:yt.array(yt.array(yt.number())).optional(),c:yt.boolean().optional()});function Fn(t){const e=Rn.isValid(t);return{valid:e,errors:e?[]:["Document failed schema validation"]}}var Un=0;function Ln(){return"_px_"+Date.now().toString(36)+(++Un).toString(36)+Math.random().toString(36).substring(2,6)}function Vn(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>Vn(t));const e=t,n={};for(const t of Object.keys(e))n[t]=Vn(e[t]);return n}function Bn(t){var e,n;const r=Vn(t),o=new Map,i=new Set(["href","xlink:href"]),a=new Set(["fill","stroke","clip-path","clipPath","mask","marker","marker-start","marker-mid","marker-end","filter","flood-color","lighting-color"]),s=new Set(["targetId","boundElementId"]),c=(t,e)=>"source"===t&&("maskedBy"===e||"clone"===e);!function t(e){if(e&&"object"==typeof e){if(e.id&&"string"==typeof e.id){const t=e.id,n=Ln();o.set(t,n),e.id=n}else e.animate&&(e.id=Ln());if(Array.isArray(e.children))for(const n of e.children)t(n)}}(r),function t(e,n){if(e&&"object"==typeof e)for(const[r,l]of Object.entries(e))if("children"!==r)if("string"==typeof l)if(i.has(r)&&l.startsWith("#")){const t=l.slice(1),n=o.get(t);n&&(e[r]="#"+n)}else if(a.has(r))e[r]=Wn(l,o);else if(s.has(r)||c(r,n)){const t=l.startsWith("#"),n=o.get(t?l.slice(1):l);n&&(e[r]=t?"#"+n:n)}else l.includes("url(#")&&(e[r]=Wn(l,o));else if("style"===r&&"object"==typeof l&&null!==l)for(const[t,e]of Object.entries(l))"string"==typeof e&&(l[t]=Wn(e,o));else"object"==typeof l&&null!==l&&t(l,r);else if(Array.isArray(l))for(const e of l)t(e)}(r);const f=null==(e=r.animator)?void 0:e.animateById;if(f&&"object"==typeof f){const t={};for(const[e,r]of Object.entries(f)){const i=e.startsWith("#"),a=i?e.slice(1):e,s=null!=(n=o.get(a))?n:a;t[i?"#"+s:s]=r}r.animator=u(l({},r.animator),{animateById:t})}return r}function Wn(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}var Gn=new Set(["script","foreignobject"]),Kn=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),qn=new Set(["href","xlink:href","src"]),Zn=new Set(["mixBlendMode","isolation"]),Yn=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,Jn=/^data:image\/svg\+xml(?:;[^,]*)?,/i,Xn=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,Qn=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function Hn(t,e){const n=t.toLowerCase();if(!function(t){return!!t.startsWith("on")}(n)){if("fill"===n||"stroke"===n||"stopcolor"===n){const t=String(e);return t.includes("url(")&&!/^url\(#[^)]+\)$/.test(t)?void console.warn('Attribute "'+n+'" blocked: url() must be internal url(#id), got:',e):e}if(Kn.has(n)){const t=String(e);return t.startsWith("#")||(/^url\(#[^)]+\)$/.test(t)||qn.has(n)&&(Yn.test(t)||Jn.test(t)||function(t){const e=Xn.exec(t);return!!e&&Qn.some(t=>e[1].startsWith(t))}(t)))?e:void console.warn('Attribute "'+n+'" blocked: must be #id, url(#id), or data:image/… URI, got:',e)}return e}console.warn("Attribute blocked (event handler / dangerous): ",n)}function $n(t,e){var n;if(t)return"string"==typeof t?null==(n=null==e?void 0:e.styles)?void 0:n[t]:t}function tr(t){const e={};for(const n of Object.keys(t)){const r=I(n);if(Ae.has(r))continue;if("style"===r)continue;let o=t[n];if(O.has(r)&&Array.isArray(o))e[r]=x(o);else if("transform"!==r||null===o||"object"!=typeof o||Array.isArray(o)||o.keyframes)S.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),e[ke]=r+"("+o+")"):Array.isArray(o)?e[r]=o.join(","):null!=o&&(e[r]=String(o));else{const t=o.value&&"object"==typeof o.value?o.value:o;e[ke]=P(t,{withUnits:!1})}}return e}function er(t){const e=Le(t);if(!e)return;if(Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]&&"number"==typeof e[1])return[e[0],e[1]];const n=e.translate;return Array.isArray(n)&&n.length>=2?[n[0],n[1]]:void 0}function nr(t){return Ue(t)}function rr(t){return Ve(t)}function or(t){const e=t.keyframes;if(!Array.isArray(e))return!1;if(t.autoOrient)return!0;for(const t of e)if(Be(t)||We(t))return!0;return!1}var ir=new WeakMap;function ar(t,e,n,r){let o=ir.get(t);const i=null==o?void 0:o.get(e);if(i)return i;const a=We(t),s=Be(e),l=[n[0]+(a?a[0]:0),n[1]+(a?a[1]:0)],u=[r[0]+(s?s[0]:0),r[1]+(s?s[1]:0)],c=V(n,l,u,r),f={P0:n,P1:l,P2:u,P3:r,lut:c,totalArc:c.ds[c.ds.length-1]};return o||(o=new WeakMap,ir.set(t,o)),o.set(e,f),f}function sr(t,e,n,r,o,i){const a=ar(t,e,n,r),s=0===a.totalArc?o:function(t,e){const n=t.ds[t.ds.length-1],r=e*n,{ts:o,ds:i}=t,a=i.length-1;if(r<=0)return o[0];if(r>=i[a])return o[a];let s=1,l=a;for(;s<l;){const t=s+l>>>1;i[t]<r?s=t+1:l=t}const u=i[l-1],c=i[l]-u,f=c>0?(r-u)/c:0;return o[l-1]+f*(o[l]-o[l-1])}(a.lut,o),l=C(a.P0,a.P1,a.P2,a.P3,s);if(!i)return{translate:l};const u=U(a.P0,a.P1,a.P2,a.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}function lr(t,e){var n,r,o;if(!or(t))return t;const i=t.keyframes;if(!Array.isArray(i)||i.length<2)return t;const a=!!t.autoOrient,s=null!=(n=null==e?void 0:e.flatnessTolerance)?n:.5,l=null!=(r=null==e?void 0:e.rotationTolerance)?r:5,u=null!=(o=null==e?void 0:e.maxSamplesPerSegment)?o:32,c=[],f=er(i[0]);if(!f)return t;const d=a?function(t,e){const n=er(t),r=er(e);if(!n||!r)return 0;const o=ar(t,e,n,r),i=U(o.P0,o.P1,o.P2,o.P3,0);return 180*Math.atan2(i[1],i[0])/Math.PI}(i[0],i[1]):void 0;c.push(cr(nr(i[0]),hr(fr(i[0]),fr(i[0]),0,f,d,a)));for(let t=0;t<i.length-1;t++){const e=i[t],n=i[t+1],r=er(e),o=er(n);r&&o?(a&&t>0&&mr(c,e,n,r,o,l),vr(c,e,n,r,o,a,s,l,u)):c.push(cr(nr(n),hr(fr(n),fr(n),1,null!=o?o:[0,0],void 0,a)))}const h=rr(i[i.length-1]);h&&(c[c.length-1].e=h),a&&ur(c);const p={keyframes:c};return void 0!==t.loop&&(p.loop=t.loop),p}function ur(t){let e;for(const n of t){const t=Le(n);if(!t||"number"!=typeof t.rotate)continue;if(void 0===e){e=t.rotate;continue}let r=t.rotate;for(;r-e>180;)r-=360;for(;r-e<-180;)r+=360;t.rotate=r,e=r}}function cr(t,e){return{t:t,v:e}}function fr(t){const e=Le(t);if(e&&"object"==typeof e&&!Array.isArray(e))return e}function dr(t,e,n){if(void 0===t)return e;if(void 0===e)return t;if("number"==typeof t&&"number"==typeof e)return t+(e-t)*n;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){const r=new Array(t.length);for(let o=0;o<t.length;o++){const i="number"==typeof t[o]?t[o]:0,a="number"==typeof e[o]?e[o]:0;r[o]=i+(a-i)*n}return r}return n<.5?t:e}function hr(t,e,n,r,o,i){const a={translate:r},s=new Set;if(t)for(const e of Object.keys(t))s.add(e);if(e)for(const t of Object.keys(e))s.add(t);for(const r of s){if("translate"===r)continue;if("rotate"===r&&i)continue;const o=null==t?void 0:t[r],s=null==e?void 0:e[r];void 0===o&&void 0===s||(a[r]=dr(o,s,n))}return void 0!==o&&(a.rotate=o+pr(t,e,n)),a}function pr(t,e,n){const r="number"==typeof(null==t?void 0:t.rotate)?t.rotate:void 0,o="number"==typeof(null==e?void 0:e.rotate)?e.rotate:void 0;if(void 0===r&&void 0===o)return 0;const i=dr(r,o,n);return"number"==typeof i?i:0}function mr(t,e,n,r,o,i){const a=t[t.length-1],s=Le(a),l=null==s?void 0:s.rotate;if("number"!=typeof l)return;const u=fr(e),c=l-pr(u,u,0),f=ar(e,n,r,o),d=U(f.P0,f.P1,f.P2,f.P3,0),h=180*Math.atan2(d[1],d[0])/Math.PI,p=function(t,e){let n=t-e;for(;n>180;)n-=360;for(;n<-180;)n+=360;return n}(h,c);if(Math.abs(p)<=i)return;const m=nr(e),g=Math.min(m+gr,(m+nr(n))/2),v=hr(fr(e),fr(e),0,r,h,!0);t.push(cr(g,v))}var gr=.05;function vr(t,e,n,r,o,i,a,s,l){const u=ar(e,n,r,o),c=nr(e),f=nr(n),d=rr(e),h=(p=d)?y([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=fr(e),g=fr(n),v=function(t,e,n,r,o){const i=[];yr(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),yr(t.P0[1],t.P1[1],t.P2[1],t.P3[1],i),i.sort((t,e)=>t-e);const a=[0];for(const t of i)t>a[a.length-1]+1e-6&&t<.999999&&a.push(t);a.push(1);const s=[],l={remaining:o-a.length};for(let o=0;o<a.length-1;o++)br(a[o],a[o+1],s,t,e,n,r,l);return s}(u,i,a,s,l),b=[];for(const t of v){const e=B(u.lut,t),n=R(u.totalArc>0?e/u.totalArc:t,0,1),r={u:R(h(n),0,1),p:n,pos:C(u.P0,u.P1,u.P2,u.P3,t)};if(i){const e=U(u.P0,u.P1,u.P2,u.P3,t);r.rotateDeg=180*Math.atan2(e[1],e[0])/Math.PI}b.push(r)}let k=d,w=0;const x=t.length-1;for(let e=0;e<b.length;e++){const n=b[e],r=w<1?R((n.u-w)/(1-w),0,1):1,{left:o,right:a}=A(k,r),s=0===e?x:t.length-1;o?t[s].e=o:delete t[s].e;const l=c+n.u*(f-c),u=hr(m,g,n.p,n.pos,n.rotateDeg,i);t.push(cr(l,u)),k=a,w=n.u}}function yr(t,e,n,r,o){const i=e-t,a=n-e,s=i-2*a+(r-n),l=2*(a-i),u=i;if(Math.abs(s)<1e-10){if(Math.abs(l)>1e-10){const t=-u/l;t>1e-6&&t<.999999&&o.push(t)}return}const c=l*l-4*s*u;if(c<0)return;const f=Math.sqrt(c),d=(-l-f)/(2*s),h=(-l+f)/(2*s);d>1e-6&&d<.999999&&o.push(d),h>1e-6&&h<.999999&&o.push(h)}function br(t,e,n,r,o,i,a,s){const l=(t+e)/2,u=C(r.P0,r.P1,r.P2,r.P3,t),c=C(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=C(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=C(r.P0,r.P1,r.P2,r.P3,l),p=C(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(kr(d,u,c),kr(h,u,c),kr(p,u,c));let g=!0;if(o){const n=U(r.P0,r.P1,r.P2,r.P3,t),o=U(r.P0,r.P1,r.P2,r.P3,e),i=180*Math.atan2(n[1],n[0])/Math.PI,s=180*Math.atan2(o[1],o[0])/Math.PI;let l=Math.abs(i-s);l>180&&(l=360-l),l>a&&(g=!1)}m<=i&&g||s.remaining<=0||f<1e-6?n.push(e):(s.remaining-=1,br(t,l,n,r,o,i,a,s),br(l,e,n,r,o,i,a,s))}function kr(t,e,n){const r=n[0]-e[0],o=n[1]-e[1],i=r*r+o*o;if(i<1e-20){const n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}const a=(t[0]-e[0])*o-(t[1]-e[1])*r;return Math.abs(a)/Math.sqrt(i)}function Ar(t,e){const n=wr(t,e);return null!=n?n:t}function wr(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=wr(t.children[r],e);null!==o&&(n||(n=t.children.slice()),n[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o,n=t.transform;if(n&&"object"==typeof n&&or(n)){const o=lr(n,e);o!==n&&(r=u(l({},t),{transform:o}))}}if(!n&&!r)return null;const i=l({},t);return n&&(i.children=n),r&&(i.animate=r),i}var xr=1;function jr(t,e){if(t===e)return!0;if(typeof t!=typeof e||null===t||null===e||"object"!=typeof t)return!1;if(Array.isArray(t)!==Array.isArray(e))return!1;const n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(n=>jr(t[n],e[n]))}function Or(t){const e=[];let n;const r=function(t){const e=t.split(/([MLCZmlcz]|[\s,]+)/).map(t=>t.trim()).filter(t=>t&&","!==t),n=[];let r=null;for(const t of e)if(/[MLCZmlcz]/.test(t))r={type:t,values:[]},n.push(r);else if(r){const e=+t;r.values.push(Number.isNaN(e)?0:e)}return n}(t);for(const t of r){const r=t.type,o=t.values;if("M"===r||"m"===r){const t=o[0]||0,r=o[1]||0;n={v:[[t,r]],i:[[t,r]],o:[[t,r]],c:!1},e.push(n);continue}if(n||(n={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},e.push(n)),"L"===r){const t=o[0]||0,e=o[1]||0;n.v.push([t,e]),n.i.push([t,e]),n.o.push([t,e])}else if("C"===r){const t=o[0]||0,e=o[1]||0,r=o[2]||0,i=o[3]||0,a=o[4]||0,s=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([a,s]),n.i.push([r,i]),n.o.push([a,s])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function Sr(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function Mr(t){return"string"==typeof t&&void 0!==Sr(t)}function Pr(t){if(t&&"object"==typeof t&&"string"==typeof t.path){const e=Sr(t.path);return e?{paths:Or(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&Mr(e[0])){const t=[];for(const n of e){const e=Sr(n);e&&t.push(...Or(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&Mr(t[0])){const e=[];for(const n of t){const t=Sr(n);t&&e.push(...Or(t))}return{paths:e}}return{paths:t}}if(Mr(t)){return{paths:Or(Sr(t))}}return t}function _r(t,e){var n;if(t)return Array.isArray(t)?t:(null==(n=null==e?void 0:e.easings)?void 0:n[t])?e.easings[t]:void console.warn("Unknown easing name: "+t)}function zr(t,e){var n;if("string"==typeof t){const r=null==(n=null==e?void 0:e.animations)?void 0:n[t];return r||console.warn("Unknown animation name: "+t),r}return t}function Nr(t,e,n,r){var o,i;if("d"===t){return{paths:m(null!=(o=null==e?void 0:e.paths)?o:Array.isArray(e)?e:[],null!=(i=null==n?void 0:n.paths)?i:Array.isArray(n)?n:[],r)}}return O.has(t)?p(e||[0,0,0,1],n||[0,0,0,1],r):"transform"!==t||"object"!=typeof e||null===e||Array.isArray(e)||"object"!=typeof n||null===n||Array.isArray(n)?"rotate"===t&&"number"==typeof e&&"number"==typeof n?d(e,n,r):S.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?h(e||[],n||[],r):d(+(e||0),+(n||0),r):function(t,e,n){const r=new Set([...Object.keys(null!=t?t:{}),...Object.keys(null!=e?e:{})]),o={};for(const i of r){const r=null==t?void 0:t[i],a=null==e?void 0:e[i];if("rotate"===i||"skew"===i)o[i]=d(+(null!=r?r:0),+(null!=a?a:0),n);else if("translate"===i||"scale"===i||"origin"===i){const t="scale"===i?[1,1]:[0,0];o[i]=h(r||t,a||t,n)}else o[i]=null!=a?a:r}return o}(e,n,r)}function Ir(t,e,n,r){var o,i,a,s,c;const f=e.length-1,d=R(null!=(o=n.segmentCount)?o:f,1,f);let h;h=n.repeatAt===ee.start?e.slice(0,d+1):e.slice(f-d);const p=null!=(i=e[0].t)?i:0,m=null!=(a=e[e.length-1].t)?a:0;let g,v;n.repeatAt===ee.start?(g=0,v=p):(g=m,v=r);const b=v-g;if(b<=0)return e;const k=null!=(s=h[0].t)?s:0,x=(null!=(c=h[h.length-1].t)?c:0)-k;if(x<=0)return e;const j=h.map(t=>({relT:(t.t-k)/x,v:t.v,e:t.e,tangentIn:Be(t),tangentOut:We(t)})),O=Math.floor(b/x),S=b-O*x,M=S/x,P=[],_=n.repeatAt!==ee.start,z=e[e.length-1];let N,I=!1;function E(e,n,r){var o;let i;if(n){i=[];for(let t=j.length-1;t>=0;t--)i.push({relT:1-j[t].relT,v:j[t].v,e:t>0?w(j[t-1].e):void 0,tangentIn:j[t].tangentOut,tangentOut:j[t].tangentIn})}else i=j;const a=void 0!==r?r:1;for(let n=0;n<i.length;n++){const r=i[n];if(r.relT>a+1e-9){const o=i[n-1],s=r.relT-o.relT,l=(a-o.relT)/s,u=o.e?y(o.e)(l):l,c=Nr(t,o.v,r.v,u),{left:f}=A(o.e,l);return P.length>0&&o.relT<=a&&(P[P.length-1].e=f),void P.push({t:e+a*x,v:c,e:void 0})}const s=P.length>0?P[P.length-1]:z,l=_&&0===n&&void 0!==s&&Math.abs((null!=(o=s.t)?o:0)-(e+r.relT*x))<1e-9;if(l){if(jr(s.v,r.v)){P.length>0?(s.e=r.e,s.tangentOut=r.tangentOut):(N=r.e,I=!0);continue}P.length>0&&(delete s.tangentIn,delete s.tangentOut)}const u={t:e+r.relT*x+(l?1:0),v:r.v,e:n<i.length-1?r.e:void 0};r.tangentIn&&(u.tangentIn=r.tangentIn),r.tangentOut&&(u.tangentOut=r.tangentOut),P.push(u)}}if(n.repeatAt===ee.start){if(M>1e-9){!function(e,n,r){let o;if(n){o=[];for(let t=j.length-1;t>=0;t--)o.push({relT:1-j[t].relT,v:j[t].v,e:t>0?w(j[t-1].e):void 0,tangentIn:j[t].tangentOut,tangentOut:j[t].tangentIn})}else o=j;const i=1-r;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT<i-1e-9)continue;const a=o[n-1];if(a&&a.relT<i-1e-9&&r.relT>i+1e-9){const n=r.relT-a.relT,o=(i-a.relT)/n,s=a.e?y(a.e)(o):o,l=Nr(t,a.v,r.v,s),{right:u}=A(a.e,o);P.push({t:e,v:l,e:u})}const s={t:e+(r.relT-i)*x,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),P.push(s)}}(g,n.direction===ne.alternate&&O%2==0,M)}for(let t=0;t<O;t++){const e=O-1-t,r=n.direction===ne.alternate&&e%2==0;E(g+S+t*x,r)}}else{for(let t=0;t<O;t++){const e=n.direction===ne.alternate&&t%2==0;E(g+t*x,e)}if(M>1e-9){const t=n.direction===ne.alternate&&O%2==0;E(g+O*x,t,M)}}if(n.repeatAt===ee.start)return[...P,...e];if(I&&e.length>0){return[...e.slice(0,-1),u(l({},e[e.length-1]),{e:N}),...P]}return[...e,...P]}function Er(t,e,n,r){var o;const i=e.keyframes||[],a=[];for(const e of i){const n=Ue(e);let i=Le(e);const s=Ve(e);"d"===t&&(i=Pr(i));const l=E(t)?T(t):t;O.has(l)&&(i=null!=(o=j(i))?o:i);const u={t:n,v:i,e:_r(s,r)},c=Be(e),f=We(e);c&&(u.tangentIn=c),f&&(u.tangentOut=f),a.push(u)}a.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const s=e.loop,l=!0===s?{}:s||void 0;return l&&a.length>=2?Ir(t,a,l,n):a}function Dr(t,e,n){const r=e.loop;if(null==r||!1===r)return e;const o=!0===r?{}:r,i=e.keyframes;if(!Array.isArray(i)||i.length<2)return e;const a=E(t)?T(t):t,s=O.has(a),l=i.map(e=>{var n;const r=Ue(e);let o=Le(e);"d"===t&&(o=Pr(o)),s&&(o=null!=(n=j(o))?n:o);const i={t:r,v:o,e:Ve(e)},a=Be(e),l=We(e);return a&&(i.tangentIn=a),l&&(i.tangentOut=l),i}),u={keyframes:Ir(t,l,o,n)};return void 0!==e.autoOrient&&(u.autoOrient=e.autoOrient),u}function Tr(t,e){const n=Rr(t,e);return null!=n?n:t}function Rr(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=Rr(t.children[r],e);null!==o&&(n||(n=t.children.slice()),n[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o;for(const n of Object.keys(t)){const o=t[n],i=Dr(n,o,e);i!==o&&(r||(r=l({},t)),r[n]=i)}}if(!n&&!r)return null;const i=l({},t);return n&&(i.children=n),r&&(i.animate=r),i}var Cr=0;function Fr(t,e){if(!t)return t;const n=e&&"object"==typeof e&&!Array.isArray(e)?e:_(e);if(!n||!Object.keys(n).length)return t;const r=t=>t&&"object"==typeof t&&!Array.isArray(t)?l(l({},n),t):t,o=t[ke];if(o&&"object"==typeof o){const e=o;if(Array.isArray(e.keyframes)){const n=u(l({},e),{keyframes:e.keyframes.map(t=>u(l({},t),{value:r(t.value)}))});return void 0!==n.value&&(n.value=r(n.value)),u(l({},t),{transform:n})}return t}const i=Object.keys(t).filter(t=>S.has(t));if(1!==i.length)return t;const a=i[0],s=t[a];if(!s||"object"!=typeof s||!Array.isArray(s.keyframes))return t;const c=u(l({},s),{keyframes:s.keyframes.map(t=>u(l({},t),{value:u(l({},n),{[a]:t.value})}))});void 0!==c.value&&(c.value=u(l({},n),{[a]:c.value}));const f=l({},t);return delete f[a],u(l({},f),{transform:c})}function Ur(t,e=Xt.native){const n=_e(t)||{},r=Ee(t),o=n.duration||1e3,i=[],a=(t,n,i)=>{if(!n)return null;const a=function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=zr(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=zr(r,e);t&&n.push(t)}else n.push(t);return n}(n,r);if(0===a.length)return null;const s=function(t,e,n,r=Xt.native){const o={};for(const[i,a]of Object.entries(t)){if("transform"===i&&"offsetPath"===a.alongPathMode&&void 0!==t.offsetDistance)continue;const s=Er(i,a,e,n);if(s.length>0){const t={keyframes:s};void 0!==a.autoOrient&&(t.autoOrient=a.autoOrient),void 0!==a.loop&&(t.loop=a.loop),o[i]=r===Xt.native&&"transform"===i?lr(t):t}}return o}(Fr(function(t){const e={};for(const n of t)for(const[t,r]of Object.entries(n))e[t]=r;return e}(a),i),o,r,e);return 0===Object.keys(s).length?null:{id:t,animate:s}},s=De(t);if(s)for(const t of s){const e=a(t.id,t.animate);e&&i.push(e)}const l=t=>{const e=t.animate;if(e&&Object.keys(e).length>0){const n=t.id||"_px_el_"+ ++Cr;t.id=n;const r=a(n,e,t.transform);r&&i.push(r)}if(t.children)for(let e=0;e<t.children.length;e++)l(t.children[e])};if(t.children)for(let e=0;e<t.children.length;e++)l(t.children[e]);return i}function Lr(t,e,n){var r,o,i,a;const s=e.keyframes||[];if(0===s.length)return null;const{prevKf:l,nextKf:u}=function(t,e){var n,r;const o=t.length-1;let i=t[0],a=t[o>0?1:0];for(let s=0;s<o;s++){const l=null!=(n=t[s].t)?n:0,u=null!=(r=t[s+1].t)?r:0;if(l<=e&&e<=u){i=t[s],a=t[s+1];break}e>u&&s===o-1&&(i=t[o>0?o-1:0],a=t[o])}return{prevKf:i,nextKf:a}}(s,n);let c=l===u?0:(g=n,v=null!=(r=l.t)?r:0,b=null!=(o=u.t)?o:0,k=0,A=1,b===v?k:k+(g-v)/(b-v)*(A-k));var g,v,b,k,A;c=R(c,0,1);const w=Ve(l);if(w&&Array.isArray(w))try{c=y(w)(c)}catch(t){}let j=E(t)?T(t):t,S=null;const _=null==l?void 0:l.v,z=null==u?void 0:u.v;if("d"===j){S=m(null!=(i=null==_?void 0:_.paths)?i:Array.isArray(_)?_:[],null!=(a=null==z?void 0:z.paths)?a:Array.isArray(z)?z:[],c).map(t=>f(t)).join("")}else if(O.has(j))S=x(p(_||[0,0,0,1],z||[0,0,0,1],c)),j=t;else if("stroke-dasharray"===j)S=h(_||[],z||[],c).join(" "),j=t;else if("transform"!==j||null===_||"object"!=typeof _||Array.isArray(_))if("translate"===j){S="translate("+h(_||[0,0],z||[0,0],c).join(",")+")",j="transform"}else if("rotate"===j){S="rotate("+d(+(_||0),+(z||0),c)+")",j="transform"}else if("scale"===j){S="scale("+h(_||[1,1],z||[1,1],c).join(",")+")",j="transform"}else{S=d(+(_||0),+(z||0),c)}else{const t=new Set([..._?Object.keys(_):[],...z?Object.keys(z):[]]),n={};for(const e of t){const t=null==_?void 0:_[e],r=null==z?void 0:z[e];if("rotate"===e||"skew"===e)n[e]=d(+(null!=t?t:0),+(null!=r?r:0),c);else if("translate"===e||"scale"===e||"origin"===e){const o="scale"===e?[1,1]:[0,0],i=h(t||o,r||o,c);n[e]=i}}if(or(e)){const t=_.translate,r=z.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=sr(l,u,[+t[0],+t[1]],[+r[0],+r[1]],c,!!e.autoOrient);n.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(n.rotate=o.rotateDeg)}}S=P(n,{withUnits:!1}),j="transform"}return M.has(j)&&"number"==typeof S&&(S=100*S+"%"),{k:j,v:null===S?"":""+S}}function Vr(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=Lr(r,o,e);t&&(n[t.k]=t.v)}return n}function Br(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Br);const e={};for(const n of Object.keys(t))e[n]=Br(t[n]);return e}function Wr(t,e){const n=new Map,r=t=>{var o;if("string"==typeof t.id){const r=e();n.set(t.id,r),t.id=r}null==(o=t.children)||o.forEach(r)};r(t);const o=t=>t.replace(/url\(#([^)]+)\)/g,(t,e)=>{const r=n.get(e);return r?"url(#"+r+")":t}),i=t=>{var e;if("string"==typeof t.href&&t.href.startsWith("#")){const e=n.get(t.href.slice(1));e&&(t.href="#"+e)}for(const e of Object.keys(t)){if("children"===e||"effects"===e||"meta"===e||"animate"===e||"href"===e||"id"===e)continue;const n=t[e];"string"==typeof n&&-1!==n.indexOf("url(#")&&(t[e]=o(n))}null==(e=t.children)||e.forEach(i)};return i(t),n}function Gr(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function Kr(t){var e;const n=Gr(t.x),r=Gr(t.y);if(delete t.x,delete t.y,!n&&!r)return t;const o="translate("+n+","+r+")";if(void 0!==t.transform||void 0!==t.animate){const n={type:"g",transform:o,children:null!=(e=t.children)?e:[]};t.children=[n]}else t.transform=o;return t}function qr(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=Yr(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=Xr(t.viewBox);if(e)return[e[2],e[3]];const n=Zr(t.width),r=Zr(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),a=[],s=Qr(t,n,r,()=>"_lw_use_mat_"+ ++o,a,i);if(0===a.length)return s;const c={type:"defs",children:a},f=[...null!=(e=s.children)?e:[],c];return u(l({},s),{children:f})}function Zr(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function Yr(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function Jr(t,e,n,r,o,i,a){var s,c,f,d;const h=Br(e);Wr(h,o);const p="symbol"===h.type?Xr(h.viewBox):void 0,m=null!=(c=null!=(s=Zr(t.width))?s:null==p?void 0:p[2])?c:a[0],g=null!=(d=null!=(f=Zr(t.height))?f:null==p?void 0:p[3])?d:a[1],v="symbol"===h.type?function(t,e,n,r,o){const i=Xr(t.viewBox),a=u(l({},t),{type:"g"});if(delete a.viewBox,delete a.preserveAspectRatio,delete a.width,delete a.height,!i)return a;const[s,c,f,d]=i,h=f>0&&d>0?Math.min(r/f,o/d):1,p=(r-f*h)/2,m=(o-d*h)/2,g=[];0===p&&0===m||g.push("translate("+p+","+m+")");1!==h&&g.push("scale("+h+")");0===s&&0===c||g.push("translate("+-s+","+-c+")");g.length&&(a.transform=g.join(""));const v=e();return n.push({type:"clipPath",id:v,children:[{type:"rect",x:s,y:c,width:f,height:d}]}),a.clipPath="url(#"+v+")",a}(h,o,i,m,g):h,y=Qr(v,n,r,o,i,a),b=u(l({},t),{type:"g",children:[y]});return delete b.href,delete b.width,delete b.height,Kr(b)}function Xr(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 Qr(t,e,n,r,o,i){if("use"===t.type&&"string"==typeof t.href){const a=Yr(t.href);if(a&&n.has(a)){const s=e.get(a);if(s)return Jr(t,s,e,n,r,o,i)}}if(!t.children)return t;let a=!1;const s=t.children.map(t=>{const s=Qr(t,e,n,r,o,i);return s!==t&&(a=!0),s});return a?u(l({},t),{children:s}):t}function Hr(t,e,n){const r={};return"translate"===t?r.translate=e:"rotate"===t?r.rotate=e:"skew"===t?r.skew=e:r.scale=e,n&&"translate"!==t&&(r.origin=n),r}function $r(t){var e,n;if(void 0===t)return{kind:"absent"};if(Array.isArray(t))return{kind:"static",value:t};if("object"==typeof t){const r=t,o=r.keyframes;if(o){const t={kind:"animated",keyframes:o.map(eo),autoOrient:r.autoOrient,loop:r.loop},n=null!=(e=r.value)?e:r.v;return void 0!==n&&"animated"===t.kind&&(t.base=n),t}const i=null!=(n=r.value)?n:r.v;if(void 0!==i)return{kind:"static",value:i}}return{kind:"static",value:t}}function to(t,e,n,r){var o,i,a,s;const u=t=>(null==r?void 0:r.asString)&&null!=t?String(t):t;if("absent"===n.kind)return;if("static"===n.kind)return void(t[e]=u(n.value));const c=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,f=l({},c||{}),d={keyframes:n.keyframes};void 0!==n.loop&&(d.loop=n.loop),void 0!==n.autoOrient&&(d.autoOrient=n.autoOrient),f[e]=d,t.animate=f;const h=null!=(s=null!=(i=n.base)?i:null==(o=n.keyframes[0])?void 0:o.value)?s:null==(a=n.keyframes[0])?void 0:a.v;void 0!==h&&(t[e]=u(h))}function eo(t){if(!t||"object"!=typeof t)return t;const e=t;if(void 0===e.t&&void 0===e.v&&void 0===e.e&&void 0===e.to&&void 0===e.ti)return t;const n=l({},e);return void 0===n.time&&void 0!==e.t&&(n.time=e.t),void 0===n.value&&void 0!==e.v&&(n.value=e.v),void 0===n.easing&&void 0!==e.e&&(n.easing=e.e),void 0===n.tangentOut&&void 0!==e.to&&(n.tangentOut=e.to),void 0===n.tangentIn&&void 0!==e.ti&&(n.tangentIn=e.ti),n}function no(t,e){const n={value:e};return void 0!==t.time&&(n.time=t.time),void 0!==t.easing&&(n.easing=t.easing),void 0!==t.tangentOut&&(n.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(n.tangentIn=t.tangentIn),n}function ro(t,e,n){if(!e)return t;delete t.transform;let r=t;return r=io(r,e.origin,!0),r=oo(r,"scale",e.scale,n),r=oo(r,"skew",e.skew,n),r=oo(r,"rotate",e.rotate,n),r=io(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=oo(r,"translate",e.translate,n):(r=io(r,e.origin,!0),r=oo(r,"translate",e.translate,n),r=io(r,e.origin,!1)),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function oo(t,e,n,r){if(void 0===n)return t;const o=$r(n);if("static"===o.kind)return{type:"g",transform:{value:Hr(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>no(t,Hr(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 io(t,e,n){if(void 0===e)return t;const r=$r(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=>no(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function ao(t,e){return"_lw_"+e+"_"+t.nextId++}function so(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function lo(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>lo(t,e))}var uo=Br;function co(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=so(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=>co(t,e,n))}function fo(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=po(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 u=void 0!==(null==e?void 0:e.translate),c=a||u,f=a&&po((null==(r=t.animate)?void 0:r.transform)||void 0)||a&&po((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=ho(i.full),r=ho(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);c?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)?f&&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=l({},r);delete e.translate;const n=Object.keys(e).length>0;c||(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=po(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 u=t;u=ro(u,s,o);let c={type:"g",id:n,children:[{type:"g",id:r,children:[u]}]};return void 0!==i.transform&&(c.transform=i.transform),void 0!==i.animate&&(c.animate=i.animate),a&&(delete c.id,c=ro(c,a,o),c.id=n),c}function ho(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 po(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 mo(t,e,n,r){if(!e)return t;const o=ao(n,"grad"),i=function(t,e){const n={type:t.type===Me.radial?"radialGradient":"linearGradient",id:e};t.type===Me.linear?(go(n,"x1","y1",t.start),go(n,"x2","y2",t.end)):(go(n,"cx","cy",t.center),function(t,e,n){const r=$r(n);if("absent"===r.kind)return;to(t,e,r,{asString:!0})}(n,"r",t.radius),go(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=$r(t);if("absent"===r.kind)return[];if("static"===r.kind)return Array.isArray(r.value)?r.value.map(vo):[];const o=r.keyframes;if(!o.length)return[];const i=r.loop;let a=0;for(const t of o){const e=Le(t);Array.isArray(e)&&e.length>a&&(a=e.length)}if(!a)return[];const s=Le(o[0]),l=[];for(let t=0;t<a;t++){const r=null!=(n=null!=(e=null==s?void 0:s[t])?e:yo(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=Ue(r),u=Le(r),c=null!=(i=null==u?void 0:u[n])?i:yo(e,e.indexOf(r),n);if(!c)continue;const f=Ve(r),d={time:o,value:c.color};void 0!==f&&(d.easing=f),a.push(d);const h={time:o,value:c.offset};void 0!==f&&(h.easing=f),s.push(h),c.offset!==t.offset&&(l=!0)}const u={type:"stop",offset:bo(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 go(t,e,n,r){var o,i,a;const s=$r(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 vo(t){return{type:"stop",offset:bo(t.offset),stopColor:t.color}}function yo(t,e,n){for(let r=e;r>=0;r--){const e=Le(t[r]);if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=Le(t[r]);if(null==e?void 0:e[n])return e[n]}}function bo(t){return Math.round(1e3*t)/10+"%"}function ko(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.path?t.path:void 0}function Ao(t,e,n,r){if(!e)return t;const o=so(e.source);if(!o)return r.errors.push("maskedBy.source missing — cannot build mask"),t;const i=ao(r,"mask");let a={type:"use",href:"#"+o};if(n)a=wo(a,n,r);else if(So(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=[],c=[];for(const t of i){const e=(null!=(n=t.value)?n:t.v)||{},r=no(t,void 0);if(Array.isArray(e.translate)&&a.push(u(l(l({},r),Oo(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(u(l({},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]]),c.push(u(l({},r),{value:t}))}}const f=null==o?void 0:o.loop,d=t=>{const e={keyframes:t};return void 0!==f&&(e.loop=f),e};let h=t;a.length&&(h={type:"g",animate:{transform:d(a)},children:[h]});s.length&&(h={type:"g",animate:{transform:d(s)},children:[h]});c.length&&(h={type:"g",animate:{transform:d(c)},children:[h]});return h}(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,h;const p=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let m;const g=[];for(;null!==(m=p.exec(t));){const t=m[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);g.push({name:m[1],args:t})}if(!g.length)return;const v=g[g.length-1];if("translate"===v.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,h=null!=(r=v.args[0])?r:0,p=null!=(o=v.args[1])?o:0;if(h!==-f||p!==-d)continue;const m={};m.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;m.translate=m.translate?[m.translate[0]+t,m.translate[1]+n]:[t,n]}for(let e=t+1;e<g.length-1;e++){const t=g[e];if("rotate"===t.name)m.rotate=(null!=(s=m.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;m.scale=m.scale?[m.scale[0]*e,m.scale[1]*n]:[e,n]}}return m}let y,b,k;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)b=(null!=b?b:0)+(null!=(d=t.args[0])?d:0);else if("scale"===t.name){const e=null!=(h=t.args[0])?h:1,n=t.args.length>1?t.args[1]:e;k=k?[k[0]*e,k[1]*n]:[e,n]}const A={};y&&(A.translate=y);void 0!==b&&(A.rotate=b);k&&(A.scale=k);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=wo(a,e,r))}const s=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||So(t))}(t);a=function(t,e,n,r,o){const i=r.idMap.get(n),a=r.maskAncestorChains.get(e)||[],s=o?zo(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=Mo(l),n=Mo(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=Po(l,t),n=Po(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,o,r,s);const c={type:"mask",id:i,children:[a]};return e.maskType&&(c.maskType=e.maskType),e.maskUnits&&(c.maskUnits=e.maskUnits),e.maskContentUnits&&(c.maskContentUnits=e.maskContentUnits),void 0!==e.x&&(c.x=String(e.x)),void 0!==e.y&&(c.y=String(e.y)),void 0!==e.width&&(c.width=String(e.width)),void 0!==e.height&&(c.height=String(e.height)),r.defs.push(c),t.mask="url(#"+i+")",t}function wo(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=$r(t);if("absent"!==r.kind)return"static"===r.kind?r.value:(e.warnings.push("transformBy.origin: animated origin approximated by its first keyframe"),null==(n=r.keyframes[0])?void 0:n.value)}(e.origin,n);let o=t;return o=xo(o,"translate",e.translate,void 0,n),o=xo(o,"rotate",e.rotate,r,n),o=xo(o,"scale",e.scale,r,n),o}function xo(t,e,n,r,o){if(void 0===n)return t;const i=$r("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);if("static"===i.kind)return{type:"g",transform:{value:Hr(e,jo(e,i.value),r)},children:[t]};if("animated"===i.kind){const n={keyframes:i.keyframes.map(t=>{const n=no(t,Hr(e,jo(e,t.value),r));return"translate"===e?l(l({},n),Oo(t)):n})};return void 0!==i.loop&&(n.loop=i.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function jo(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function Oo(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 So(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function Mo(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 Po(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=_o(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function _o(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 zo(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 No(t,e,n){if(!e)return;const r=so(e.source);if(!r)return void(e.without===se.translate&&n.errors.push("clone: content ref missing `source`"));const o=e.without===se.translate&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function Io(t,e){const n={};return void 0!==t.translate&&(n.translate=Eo(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=Eo(t.rotate,t=>t*e)),void 0!==t.skew&&(n.skew=Eo(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 Eo(t,n,!0)}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function Eo(t,e,n=!1){const r=$r(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?u(l({},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 Do(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function To(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=l({},t);for(const e of Object.keys(t))delete t[e];t.type="g",t.children=[a],t.animate={opacity:{keyframes:i}}}function Ro(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function Co(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function Fo(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 Uo(t,e,n){const r=so(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=Lo(r,e,n,new Set);o&&(t.href="#"+o)}function Lo(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=uo(o);if(function(t,e){Wr(t,()=>ao(e,"retimed"))}(i,n),"use"===o.type?Bo(i,e.start,e.stretch):Vo(i,e.start,e.stretch),Fo(i),"use"===o.type&&o.href){const a=so(o.href);if(a){const s=Co(o),l=s?Ro(Do(s),e):e,u=new Set(r);u.add(t);const c=Lo(a,l,n,u);c&&(i.href="#"+c)}}else!function(t,e,n,r,o){const i=t=>{var a;const s=Co(t);if("use"===t.type&&s&&t.href){const i=so(t.href);if(i){const a=Ro(Do(s),e),l=new Set(r);l.add(o);const u=Lo(i,a,n,l);u&&(t.href="#"+u)}Fo(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 Vo(t,e,n){var r;Bo(t,e,n),null==(r=t.children)||r.forEach(t=>Vo(t,e,n))}function Bo(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)}}var Wo=/[MmLlHhVvCcSsQqTtAaZz]/;function Go(t,e,n){return{P1:[t[0]+2/3*(e[0]-t[0]),t[1]+2/3*(e[1]-t[1])],P2:[n[0]+2/3*(e[0]-n[0]),n[1]+2/3*(e[1]-n[1])]}}function Ko(t){const e=function(t){const e=function(t){const e=[],n=/([MmLlHhVvCcSsQqTtAaZz])|(-?\d*\.?\d+(?:[eE][-+]?\d+)?)/g;let r;for(;null!==(r=n.exec(t));)e.push(r[0]);return e}(t),n=[];let r=0,o=0,i=0,a=0,s=0,l=0,u=0,c=0,f=0,d="";const h=()=>parseFloat(e[r++]),p=(t,e,r)=>{const a=[o,i],s=V(a,t,e,r,48);n.push({P0:a,P1:t,P2:e,P3:r,lut:s,len:s.ds[s.ds.length-1]}),o=r[0],i=r[1]},m=(t,e)=>{p([o+(t-o)/3,i+(e-i)/3],[o+2*(t-o)/3,i+2*(e-i)/3],[t,e])};for(;r<e.length;){let t=e[r];Wo.test(t)?r++:t="M"===d?"L":"m"===d?"l":d;const n=t>="a",g=t.toUpperCase();if("Z"!==g){if("M"===g){const e=h()+(n?o:0),r=h()+(n?i:0);o=e,i=r,a=e,s=r,d=t;continue}if("L"===g)m(h()+(n?o:0),h()+(n?i:0));else if("H"===g)m(h()+(n?o:0),i);else if("V"===g)m(o,h()+(n?i:0));else if("C"===g){const t=[h()+(n?o:0),h()+(n?i:0)],e=[h()+(n?o:0),h()+(n?i:0)],r=[h()+(n?o:0),h()+(n?i:0)];l=e[0],u=e[1],p(t,e,r)}else if("S"===g){const t="C"===d.toUpperCase()||"S"===d.toUpperCase()?[2*o-l,2*i-u]:[o,i],e=[h()+(n?o:0),h()+(n?i:0)],r=[h()+(n?o:0),h()+(n?i:0)];l=e[0],u=e[1],p(t,e,r)}else if("Q"===g){const t=[h()+(n?o:0),h()+(n?i:0)],e=[h()+(n?o:0),h()+(n?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=Go([o,i],t,e);p(r,a,e)}else if("T"===g){const t="Q"===d.toUpperCase()||"T"===d.toUpperCase()?[2*o-c,2*i-f]:[o,i],e=[h()+(n?o:0),h()+(n?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=Go([o,i],t,e);p(r,a,e)}else{if("A"!==g){r++;continue}r+=5,m(h()+(n?o:0),h()+(n?i:0))}d=t}else m(a,s),o=a,i=s,d=t}return n.length?n:null}(t);if(!e)return null;const n=new Float64Array(e.length+1);for(let t=0;t<e.length;t++)n[t+1]=n[t]+e[t].len;const r=n[e.length],o=e[0].P0,i=e[e.length-1].P3,a=Math.hypot(i[0]-o[0],i[1]-o[1])<.001,s=t=>{let r=0;for(;r<e.length-1&&t>n[r+1];)r++;const o=e[r],i=t-n[r],a=o.len>0?function(t,e){const{ts:n,ds:r}=t,o=r.length-1;if(e<=0)return n[0];if(e>=r[o])return n[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;r[t]<e?i=t+1:a=t}const s=r[a-1],l=r[a]-s,u=l>0?(e-s)/l:0;return n[a-1]+u*(n[a]-n[a-1])}(o.lut,i):0,[s,l]=C(o.P0,o.P1,o.P2,o.P3,a),[u,c]=U(o.P0,o.P1,o.P2,o.P3,a);return{x:s,y:l,angle:Math.atan2(c,u)}};return{totalLength:r,closed:a,sampleAtDistance(t){if(a&&r>0&&(t<0||t>r))return s((t%r+r)%r);if(!a&&(t<0||t>r)){const e=t<0?0:r,n=s(e),o=t-e;return{x:n.x+Math.cos(n.angle)*o,y:n.y+Math.sin(n.angle)*o,angle:n.angle}}return s((o=r,(e=t)<(n=0)?n:e>o?o:e));var e,n,o}}}function qo(t){const e=$r(t);if("static"===e.kind&&"number"==typeof e.value)return{min:e.value,max:e.value};if("animated"===e.kind&&e.keyframes.length){const t=e.keyframes.map(t=>Number(t.value)||0);return{min:Math.min(...t),max:Math.max(...t)}}return{min:0,max:0}}function Zo(t){let e=0,n=16;const r=t=>{var o,i;const a=parseFloat(String(null!=(o=t.fontSize)?o:""))||0;a&&(n=Math.max(n,a));const s=null!=(i=t.text)?i:t.textContent;if("string"==typeof s&&(e+=s.length),t.children)for(const e of t.children)r(e)};return r(t),e*n}var Yo=t=>Math.round(1e3*t)/1e3;function Jo(t,e){if(!e||null==t)return t;const n=$r(t);if("absent"===n.kind)return t;if("static"===n.kind)return"number"==typeof t?n.value+e:{value:n.value+e};const r={keyframes:n.keyframes.map(t=>u(l({},t),{value:(Number(t.value)||0)+e}))};return void 0!==n.loop&&(r.loop=n.loop),void 0!==n.autoOrient&&(r.autoOrient=n.autoOrient),void 0!==n.base&&(r.value=n.base+e),r}function Xo(t,e){var n;if("clip"===e.pathOverflow)return{d:t,startShift:0};const r=Ko(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,i=.15*o,a=qo(e.startOffset),s=qo(e.textLength).max||(null!=(n=e.advance)?n:0),l=Math.max(0,-a.min),u=Math.max(0,a.max+s-o),c=l>0?l+i:0,f=u>0?u+i:0;if(f<=0&&c<=0)return{d:t,startShift:0};const d=r.sampleAtDistance(0),h=r.sampleAtDistance(o);let p=t;if(c>0){const e=d.x-Math.cos(d.angle)*c,n=d.y-Math.sin(d.angle)*c,r=t.replace(/^\s*[Mm]\s*-?[\d.]+[\s,]+-?[\d.]+/,"");p="M"+Yo(e)+","+Yo(n)+"L"+Yo(d.x)+","+Yo(d.y)+r}if(f>0){const t=h.x+Math.cos(h.angle)*f,e=h.y+Math.sin(h.angle)*f;p+="L"+Yo(t)+","+Yo(e)}return{d:p,startShift:c}}function Qo(t,e,n){null!=n&&to(t,e,$r(n),{asString:!0})}var Ho=(t,e,n)=>{const r={type:t};for(const t in e)void 0!==e[t]&&(r[t]=e[t]);const o=Array.isArray(n)?n.filter(t=>null!=t):null!=n?[n]:[];return o.length&&(r.children=o),r};function $o(t,e){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function ti(t,e){let n="";for(let r=0;r<t.length;r++){const o=$o(t[r],e);r>0&&45!==o.charCodeAt(0)&&(n+=" "),n+=o}return n}function ei(t,e,n){return[t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}var ni=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function ri(t,e,n=2){const r=[];let o;for(ni.lastIndex=0;null!==(o=ni.exec(t));)r.push(o[0]);let i="",a=0;const s=()=>parseFloat(r[a++]);for(;a<r.length;){const t=r[a++];if("M"===t||"L"===t){const[r,o]=ei(e,s(),s());i+=t+ti([r,o],n)}else if("C"===t){const[t,r]=ei(e,s(),s()),[o,a]=ei(e,s(),s()),[l,u]=ei(e,s(),s());i+="C"+ti([t,r,o,a,l,u],n)}else if("Q"===t){const[t,r]=ei(e,s(),s()),[o,a]=ei(e,s(),s());i+="Q"+ti([t,r,o,a],n)}else"Z"!==t&&"z"!==t||(i+="Z")}return i}var oi=["fontFamily","fontSize","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","textDecoration","textTransform","whiteSpace","x","y","dx","dy","lengthAdjust","fill","stroke","strokeWidth","effects",ve,ye,"xml:space"],ii=["fillOpacity","fillRule","strokeOpacity","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","mixBlendMode","filter"],ai=["fill","stroke","strokeWidth","opacity","fillOpacity","strokeOpacity","strokeDasharray","strokeDashoffset"];function si(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?void 0:e}}function li(t){return"string"==typeof t?t:void 0}function ui(t){const e=t.animate;if(!e||"object"!=typeof e)return;let n;for(const t of ai)void 0!==e[t]&&((null!=n?n:n={})[t]=e[t]);return n}function ci(t,e){var n,r,o,i,a,s,l,u,c,f;const d="text"===t.type,h=t.style,p=e=>{var n;return d?void 0:null!=(n=t[e])?n:null==h?void 0:h[e]},m={fontFamily:null!=(n=li(t.fontFamily))?n:e.fontFamily,fontSize:null!=(r=si(t.fontSize))?r:e.fontSize,fill:null!=(o=t.fill)?o:e.fill,stroke:null!=(i=t.stroke)?i:e.stroke,strokeWidth:null!=(a=t.strokeWidth)?a:e.strokeWidth,letterSpacing:null!=(s=si(t.letterSpacing))?s:e.letterSpacing,wordSpacing:null!=(l=si(t.wordSpacing))?l:e.wordSpacing,opacity:null!=(u=si(p("opacity")))?u:e.opacity,animate:null!=(c=d?void 0:ui(t))?c:e.animate};for(const t of ii){const n=null!=(f=p(t))?f:e[t];void 0!==n&&(m[t]=n)}return m}function fi(t){var e,n,r;return{fontFamily:li(t.fontFamily),fontSize:null!=(e=si(t.fontSize))?e:16,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(n=si(t.letterSpacing))?n:0,wordSpacing:null!=(r=si(t.wordSpacing))?r:0}}function di(t){const e={};void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),void 0!==t.opacity&&1!==t.opacity&&(e.opacity=t.opacity);for(const n of ii)void 0!==t[n]&&(e[n]=t[n]);return void 0!==t.animate&&(e.animate=t.animate),e}function hi(t,e,n,r){var o;const i=t.fontFamily?e[t.fontFamily]:n;return i||null==r||r.push('textGlyphs: no glyphs for font "'+(null!=(o=t.fontFamily)?o:"")+'"'),i}function pi(t){const e=Object.keys(t);return 1===e.length?t[e[0]]:void 0}var mi="px-missing-glyph";function gi(t,e){if(t<=0||e<=0)return"";const n=.08,r=t*n,o=.92*t,i=.92*-e,a=o-r,s=-i,l=Math.max(1,.12*Math.min(a,s)),u="M"+r+" 0L"+o+" 0L"+o+" "+i+"L"+r+" "+i+"Z";if(a<=2*l||s<=2*l)return u;const c=r+l,f=o-l,d=-l,h=i+l;return u+"M"+c+" "+d+"L"+c+" "+h+"L"+f+" "+h+"L"+f+" "+d+"Z"}function vi(t,e){var n,r,o,i;const{glyphs:a,create:s=Ho,warnings:l}=e,u=pi(a),c={x:null!=(n=si(t.x))?n:0,y:null!=(r=si(t.y))?r:0},f=[],d=[{start:c.x,end:c.x}];let h=0;const p=(t,e)=>{var n;const r=hi(e,a,u,l),o=(null==r?void 0:r.unitsPerEm)||1e3,i=e.fontSize/o,s=null!=(n=null==r?void 0:r.ascent)?n:.9*o,p=di(e);for(let n=0;n<t.length;n++){const a=t.charAt(n),l=null==r?void 0:r.glyphs[a];if(l&&l.d)f.push({glyphD:l.d,m:[i,0,0,i,c.x,c.y],paint:p,line:h,x:c.x,y:c.y,scale:i}),c.x+=l.width*i;else if(/\S/.test(a)){const t=l&&l.width>0?l.width:.6*o;f.push({glyphD:gi(t,s),m:[i,0,0,i,c.x,c.y],paint:p,isMissing:!0,line:h,x:c.x,y:c.y,scale:i}),c.x+=t*i}else c.x+=(l?l.width:0)*i;c.x+=e.letterSpacing+(" "===a?e.wordSpacing:0),d[h].end=c.x}},m=(t,e)=>{var n,r,o,i;const a=ci(t,e),s=si(t.x),l=si(t.y);void 0!==s&&(c.x=s,h=d.length,d.push({start:c.x,end:c.x})),void 0!==l&&(c.y=l),c.x+=null!=(n=si(t.dx))?n:0,c.y+=null!=(r=si(t.dy))?r:0;const u=null!=(o=li(t[ye]))?o:li(t[ve]);if(u&&!(null==(i=t.children)?void 0:i.length)&&p(u,a),t.children)for(const e of t.children)m(e,a)},g=fi(t);if(t.children)for(const e of t.children)m(e,g);const v=null!=(o=li(t[ye]))?o:li(t[ve]);v&&!(null==(i=t.children)?void 0:i.length)&&p(v,g);const y=li(t.textAnchor);if("middle"===y||"end"===y)for(const t of f){const e=d[t.line].end-d[t.line].start,n="middle"===y?-e/2:-e;t.m=[t.scale,0,0,t.scale,t.x+n,t.y]}return _i(t,Pi(f,s,l),s)}function yi(t,e){var n,r,o,i,a,s;if(null==(n=e.alongPath)?void 0:n.pathD)return function(t,e,n){var r,o;const{glyphs:i,warnings:a,alongPath:s}=n,l=Ko(e);if(!l)return null==a||a.push("textGlyphs: unparsable along-path geometry (caret)"),[];const u=pi(i),c=[];let f=0;const d=(t,e)=>{var n,r,o;const s=ci(t,e),l=null!=(n=li(t[ye]))?n:li(t[ve]);if(l&&!(null==(r=t.children)?void 0:r.length)){const t=hi(s,i,u,a),e=(null==t?void 0:t.unitsPerEm)||1e3,n=s.fontSize/e,r=(null!=(o=null==t?void 0:t.ascent)?o:.9*e)*n;for(let e=0;e<l.length;e++){const o=l.charAt(e),i=null==t?void 0:t.glyphs[o],a=(i?i.width:0)*n,u=a+s.letterSpacing+(" "===o?s.wordSpacing:0);c.push({advStart:f,advEnd:f+u,glyphW:a,ascent:r,fontSize:s.fontSize}),f+=u}}if(t.children)for(const e of t.children)d(e,s)};d(t,fi(t));const h=f,p=$r(null==s?void 0:s.textLength),m="animated"===p.kind?Number(null==(r=p.keyframes[0])?void 0:r.value)||0:"static"===p.kind&&Number(p.value)||0,g=m>0&&h>0?m/h:1,v=$r(null==s?void 0:s.startOffset),{along:y,perp:b}=ki(t),k=y+("animated"===v.kind?Number(null==(o=v.keyframes[0])?void 0:o.value)||0:"static"===v.kind&&Number(v.value)||0),A=t=>({x:t.x-b*Math.sin(t.angle),y:t.y+b*Math.cos(t.angle),angle:t.angle});return c.map(t=>{const e=k+t.advStart*g,n=k+t.advEnd*g,r=A(l.sampleAtDistance(e)),o=A(l.sampleAtDistance(n)),i=l.sampleAtDistance(k+(t.advStart+t.glyphW/2)*g);return{x:r.x,y:r.y,width:t.advEnd-t.advStart,ascent:t.ascent,fontSize:t.fontSize,endX:o.x,endY:o.y,rotation:180*i.angle/Math.PI}})}(t,e.alongPath.pathD,e);const{glyphs:l,warnings:u}=e,f=pi(l),d={x:null!=(r=si(t.x))?r:0,y:null!=(o=si(t.y))?o:0},h=[],p=[{start:d.x,end:d.x}];let m=0;const g=(t,e)=>{var n;const r=hi(e,l,f,u),o=(null==r?void 0:r.unitsPerEm)||1e3,i=e.fontSize/o,a=(null!=(n=null==r?void 0:r.ascent)?n:.9*o)*i;for(let n=0;n<t.length;n++){const o=t.charAt(n),s=null==r?void 0:r.glyphs[o],l=(s?s.width:0)*i+e.letterSpacing+(" "===o?e.wordSpacing:0);h.push({x:d.x,y:d.y,width:l,ascent:a,fontSize:e.fontSize,line:m}),d.x+=l,p[m].end=d.x}},v=(t,e)=>{var n,r,o,i;const a=ci(t,e),s=si(t.x),l=si(t.y);void 0!==s&&(d.x=s,m=p.length,p.push({start:d.x,end:d.x})),void 0!==l&&(d.y=l),d.x+=null!=(n=si(t.dx))?n:0,d.y+=null!=(r=si(t.dy))?r:0;const u=null!=(o=li(t[ye]))?o:li(t[ve]);if(u&&!(null==(i=t.children)?void 0:i.length)&&g(u,a),t.children)for(const e of t.children)v(e,a)},y=fi(t);if(t.children)for(const e of t.children){const t=h.length;if(v(e,y),h.length===t){const t=ci(e,y),n=hi(t,l,f),r=(null==n?void 0:n.unitsPerEm)||1e3;h.push({x:d.x,y:d.y,width:0,ascent:(null!=(i=null==n?void 0:n.ascent)?i:.9*r)*(t.fontSize/r),fontSize:t.fontSize,line:m})}}const b=null!=(a=li(t[ye]))?a:li(t[ve]);b&&!(null==(s=t.children)?void 0:s.length)&&g(b,y);const k=li(t.textAnchor);if("middle"===k||"end"===k)for(const t of h){const e=p[t.line].end-p[t.line].start;t.x+="middle"===k?-e/2:-e}return h.map(t=>{var e=t,{line:n}=e;return c(e,["line"])})}function bi(t,e,n,r,o=0){const{x:i,y:a,angle:s}=t.sampleAtDistance(e),l=Math.cos(s),u=Math.sin(s),c=r/2;return[n*l,n*u,-n*u,n*l,i-n*l*c-o*u,a-n*u*c+o*l]}function ki(t){var e,n,r;return{along:(null!=(e=si(t.x))?e:0)+(null!=(n=si(t.dx))?n:0),perp:null!=(r=si(t.dy))?r:0}}function Ai(t,e,n,r,o,i){const{glyphs:a,create:s=Ho,warnings:c}=r,f=e?Ko(e):null;if(!f)return null==c||c.push("textGlyphs: unparsable along-path geometry"),null;const d=pi(a),{cells:h,width:p}=function(t,e,n,r){const o=[];let i=0;const a=(t,s)=>{var l,u,c;const f=ci(t,s),d=null!=(l=li(t[ye]))?l:li(t[ve]);if(d&&!(null==(u=t.children)?void 0:u.length)){const t=hi(f,e,n,r);if(t){const e=f.fontSize/t.unitsPerEm,n=null!=(c=t.ascent)?c:.9*t.unitsPerEm,r=di(f);for(let a=0;a<d.length;a++){const s=d.charAt(a),l=t.glyphs[s];if(l&&l.d){const t=l.width*e;o.push({glyphD:l.d,widthEm:l.width,scale:e,paint:r,midBase:i+t/2}),i+=t}else if(/\S/.test(s)){const a=l&&l.width>0?l.width:.6*t.unitsPerEm,s=a*e;o.push({glyphD:gi(a,n),widthEm:a,scale:e,paint:r,isMissing:!0,midBase:i+s/2}),i+=s}else i+=(l?l.width:0)*e;i+=f.letterSpacing+(" "===s?f.wordSpacing:0)}}}if(t.children)for(const e of t.children)a(e,f)};return a(t,fi(t)),{cells:o,width:i}}(t,a,d,c);if(!h.length)return _i(t,[],s);const{along:m,perp:g}=ki(t),v=wi(n),y=wi(o),b=t=>t>0&&p>0?t/p:1,k="clip"===i&&!f.closed;if(v.animated||y.animated){const e=function(t,e){const n=[...t,...e].sort((t,e)=>t-e),r=[];for(const t of n)r.length&&t===r[r.length-1]||r.push(t);return r}(v.times,y.times),n=(t,e)=>m+v.at(e)+b(y.at(e))*t.midBase,r=v.animated?v.loop:y.loop;return _i(t,function(t,e,n,r,o,i,a,s=0){const c=Math.max(e.totalLength/xi,.5),f=t=>t>=0&&t<=e.totalLength,d=[];for(const h of t){const t=[h.scale,0,0,h.scale,-h.scale*(h.widthEm/2),0],p=ri(h.glyphD,t),m=(t,n)=>{const{x:r,y:o,angle:i}=e.sampleAtDistance(t),a=Math.cos(i),l=Math.sin(i);return{time:n,value:{translate:[Oi(r-s*l,3),Oi(o+s*a,3)],rotate:Oi(180*i/Math.PI,3)}}},g=[],v=[],y=(t,e)=>{g.push(m(t,e)),a&&v.push({time:e,value:f(t)?1:0})};y(n(h,r[0]),r[0]);for(let t=1;t<r.length;t++){const e=r[t-1],o=r[t],i=n(h,e),a=n(h,o),s=Math.min(ji,Math.max(1,Math.ceil(Math.abs(a-i)/c)));for(let t=1;t<=s;t++){const r=e+t/s*(o-e);y(n(h,r),r)}}ur(g);const b={keyframes:g};void 0!==o&&(b.loop=o);const k={transform:b};if(h.paint.animate&&Object.assign(k,h.paint.animate),a&&v.some(t=>0===t.value)){const t={keyframes:v};void 0!==o&&(t.loop=o),k.opacity=t}d.push(i("path",u(l(l({d:p},Si(h.paint)),Mi(h.isMissing)),{animate:k}),[]))}return d}(h,f,n,e,r,s,k,g),s)}const A=b(y.at(0)),w=m+v.at(0);return _i(t,Pi((k?h.filter(t=>{const e=w+t.midBase*A;return e>=0&&e<=f.totalLength}):h).map(t=>({glyphD:t.glyphD,paint:t.paint,isMissing:t.isMissing,m:bi(f,w+t.midBase*A,t.scale,t.widthEm,g)})),s,c),s)}function wi(t){var e;const n=$r(t);if("animated"===n.kind&&n.keyframes.length>=2){const t=[...n.keyframes].sort((t,e)=>(Number(t.time)||0)-(Number(e.time)||0)),e=t.map(t=>Number(t.time)||0),r=t.map(t=>Number(t.value)||0);return{animated:!0,times:e,loop:n.loop,at(t){if(t<=e[0])return r[0];for(let n=1;n<e.length;n++)if(t<=e[n]){const o=e[n]-e[n-1],i=o>0?(t-e[n-1])/o:1;return r[n-1]+i*(r[n]-r[n-1])}return r[r.length-1]}}}const r="animated"===n.kind?Number(null==(e=n.keyframes[0])?void 0:e.value)||0:"static"===n.kind&&Number(n.value)||0;return{animated:!1,times:[],at:()=>r}}var xi=48,ji=64;function Oi(t,e){const n=a(10,e);return Math.round(t*n)/n}function Si(t){const e={};void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(e.opacity=t.opacity);for(const n of ii)void 0!==t[n]&&(e[n]=t[n]);return e}function Mi(t){return t?{[be]:mi}:{}}function Pi(t,e,n){if(!t.length)return null==n||n.push("textGlyphs: nothing to render"),[];const r=new Map;for(const e of t){const t=JSON.stringify([e.paint,!!e.isMissing]),n=ri(e.glyphD,e.m),o=r.get(t);o?o.d+=n:r.set(t,{paint:e.paint,d:n,isMissing:e.isMissing})}const o=[];for(const{paint:t,d:n,isMissing:i}of r.values())o.push(e("path",l(l(l({d:n},Si(t)),Mi(i)),void 0!==t.animate?{animate:l({},t.animate)}:{}),[]));return o}function _i(t,e,n){const r={};for(const e of Object.keys(t))"type"!==e&&"children"!==e&&-1===oi.indexOf(e)&&(r[e]=t[e]);if(r.style&&"object"==typeof r.style){const t=l({},r.style);delete t["white-space"],Object.keys(t).length?r.style=t:delete r.style}return n("g",r,e)}function zi(t,e){return e.alongPath?Ai(t,e.alongPath.pathD,e.alongPath.startOffset,e,e.alongPath.textLength,e.alongPath.pathOverflow):vi(t,e)}function Ni(t,e,n){if(!e)return t;const r=e.subPaths===ge.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*qi,d=o*qi,h=(t,e,n,r,o,i)=>"C"+t+","+e+" "+n+","+r+" "+o+","+i;return"M"+(e+r)+","+n+h(e+r,n+d,e+f,n+o,e,n+o)+h(e-f,n+o,e-r,n+d,e-r,n)+h(e-r,n-d,e-f,n-o,e,n-o)+h(e+f,n-o,e+r,n-d,e+r,n)+"z"}return}(t);if(void 0===e)return;const n=Or(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){const e=Gi(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 c=a;if(r&&c<.001)return t;const f=$r(e.offset),d="absent"===f.kind?{kind:"static",value:0}:f,h=function(t){const e=$r(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>({time:Ue(t),value:Le(t),easing:Ve(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=Bi(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=Wi(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=Wi(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:i}}(e.range),p="absent"===h.kind?{kind:"static",value:[0,1]}:h,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=Le(n);"number"==typeof t&&e.push(t)}return e}(d),g=[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?c:n.lengthPx;if(i<.001)return t;const a=r?n.startOffsetPx/i:0;return function(t,e,n,r,o,i){const a=Ti(n,e,r),s=Ri(e,r),u=l({},t);return delete u.effects,Ui(u,"strokeDasharray",Fi(i,s)),Ui(u,"strokeDashoffset",Fi(o,a)),Ui(u,"strokeOpacity",Vi(i)),u}(e.leaf,i,a,g,d,p)}const v=new Map;for(const t of o){const e=[];for(const o of t.subpaths){const i=r?c:o.lengthPx;if(i<.001)continue;const a=r?o.startOffsetPx/i:0;e.push(...Ei(t.leaf,o.subpath,i,a,g,d,p,n))}v.set(t.leaf,Ii(t.leaf,e))}const y=t=>{const e=v.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?u(l({},t),{children:t.children.map(y)}):t)};return y(t)}function Ii(t,e){const n=u(l({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function Ei(t,e,n,r,o,i,a,s){const l=Ti(r,n,o),u=Ri(n,o),c=Fi(i,l),d=Fi(a,u),h=Vi(a),p=function(t){return{type:"path",d:t}}(f(e));return Ui(p,"strokeDasharray",d),Ui(p,"strokeDashoffset",c),Ui(p,"strokeOpacity",h),[p]}var Di=1;function Ti(t,e,n){const[r]=Ci(n);return n=>e*(-n-r+t)+Di}function Ri(t,e){const[n,r]=Ci(e),o=r-n+1;return e=>{const n=R(e[0],0,1),r=R(e[1],0,1),i=Math.min(n,r),a=Math.max(n,r),s=[0];let l=Di;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+Di),s}}function Ci(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function Fi(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>({time:Ue(t),value:e(Le(t)),easing:Ve(t)})),loop:t.loop}}function Ui(t,e,n){n&&to(t,e,n)}var Li=10;function Vi(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(Le(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=Ue(r),l=e(Le(r)),u=o?l&&e(Le(o)):l,c=a?l&&e(Le(a)):l;u&&!c?(i.push({time:s,value:0}),i.push({time:s+Li,value:1})):!u&&c&&(i.push({time:s-Li,value:1}),i.push({time:s,value:0}))}return i.length<=1?void 0:{kind:"animated",keyframes:i}}function Bi(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 Wi(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 Gi(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+=Ki(t,r,r+1);return t.c&&e.length>1&&(n+=Ki(t,e.length-1,0)),n}function Ki(t,e,n){var r,o,i,a;const s=t.v,l=s[e],u=s[n],c=V(l,null!=(o=null==(r=t.o)?void 0:r[e])?o:l,null!=(a=null==(i=t.i)?void 0:i[n])?a:u,u);return c.ds[c.ds.length-1]}var qi=.5522847498307936;function Zi(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:Ht(null==(e=_e(t))?void 0:e.engine),glyphs:null==(n=Ee(t))?void 0:n.fonts},o=uo(t);lo(o,r.idMap),co(o,r,()=>ao(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const a=so(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=zo(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(),lo(t,e.idMap);const n=[],r=t=>{var e;Co(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&&Co(o)&&n++,"use"===o.type&&o.href){const t=so(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(a=o.children)||a.forEach(i)}},a=so(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=Co(t);if(!n)continue;const r=n.timeCrop;Fo(t),Uo(t,Do(n),e),r&&To(t,r,e)}}(t,e),t}(Yi(o,r),r);return function(t,e){if(!e.length)return;(t.children||(t.children=[])).unshift({type:"defs",children:e})}(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function Yi(t,e){t.children&&(t.children=t.children.map(t=>Yi(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:h,text:p}=null!=n?n:{};n&&delete t.effects;let m=t,g=!1;if(null==p?void 0:p.useGlyphs)if(h){const t="string"==typeof h.pathData?h.pathData:void 0,n=function(t,e,n,r,o,i){return e.glyphs?Ai(t,n,r,{glyphs:e.glyphs,warnings:e.warnings},o,i):(e.warnings.push("textGlyphs: no definitions.fonts"),null)}(m,e,t,h.startOffset,h.textLength,h.pathOverflow);n&&(m=n,g=!0)}else m=function(t,e,n){return(null==e?void 0:e.useGlyphs)?n.glyphs?vi(t,{glyphs:n.glyphs,warnings:n.warnings}):(n.warnings.push("textGlyphs: no definitions.fonts — left as native <text>"),t):t}(m,p,e),g=!0;return g||(m=function(t,e,n){var r;if(!e||"string"!=typeof e.pathData||!e.pathData)return t;const o=ao(n,"tpath"),{d:i,startShift:a}=Xo(e.pathData,{pathOverflow:e.pathOverflow,startOffset:e.startOffset,textLength:e.textLength,advance:Zo(t)});n.defs.push({type:"path",id:o,d:i});const s={type:"textPath",href:"#"+o,children:null!=(r=t.children)?r:[]};return void 0!==e.lengthAdjust&&(s.lengthAdjust=e.lengthAdjust),void 0!==e.method&&(s.method=e.method),void 0!==e.spacing&&(s.spacing=e.spacing),Qo(s,"startOffset",Jo(e.startOffset,a)),Qo(s,"textLength",e.textLength),t.children=[s],t}(m,h,e)),m=function(t,e,n){return mo(t,e,n,"fill")}(m,f,e),m=function(t,e,n){return mo(t,e,n,"stroke")}(m,d,e),m=Ni(m,u,e),m=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=uo(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=uo(l),o=Io(e,t),i=o?ro(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}(m,a,e),m=Ao(m,s,i,e),m=function(t,e,n){if(!(null==e?void 0:e.d))return t;const r=ao(n,"clip"),o={type:"path"},i=$r(e.d);return"absent"!==i.kind&&("static"===i.kind?o.d=ko(i.value):(to(o,"d",i),void 0!==o.d&&(o.d=ko(o.d)))),n.defs.push({type:"clipPath",id:r,children:[o]}),t.clipPath="url(#"+r+")",t}(m,l,e),o?(No(m,c,e),m=fo(m,i,r,o,e)):m=function(t,e,n,r){return No(t,e,r),ro(t,n,r)}(m,c,i,e),(null==c?void 0:c.retime)&&(t.effects={clone:{retime:c.retime}}),r&&e.idMap.set(r,m),m}function Ji(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 Xi(t,e,n,r,o=64){let i=0,a=t;for(let s=1;s<=o;s++){const l=Ji(t,e,n,r,s/o);i+=Math.hypot(l[0]-a[0],l[1]-a[1]),a=l}return i}var Qi=t=>{const e=Math.round(1e4*t)/1e4;return Object.is(e,-0)?"0":String(e)};function Hi(t){const e=t=>{var n;let r=t;const o=t.animate,i=null==o?void 0:o.transform;if(i){const e=function(t){var e,n,r;if("offsetPath"!==t.alongPathMode)return;const o=t.keyframes;if(!o||o.length<2)return;const i=Le(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=Le(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=>Be(t)||We(t)))return;let l="M"+Qi(s[0][0])+","+Qi(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=We(o[t]))?n:[0,0],c=null!=(r=Be(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"+Qi(f[0])+","+Qi(f[1])+","+Qi(d[0])+","+Qi(d[1])+","+Qi(i[0])+","+Qi(i[1]),u.push(Xi(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:Ue(o[t]),v:d/c},n=Ve(o[t]);void 0!==n&&(e.e=n),f.push(e)}return{pathStr:l,distanceKfs:f,autoOrient:!!t.autoOrient,anchor:a}}(i);if(e){const n=l({},o);delete n[ke];const a={keyframes:e.distanceKfs};void 0!==i.loop&&(a.loop=i.loop),n.offsetDistance=a;const s=t.transform;let c=s;if(s&&"object"==typeof s){const t=l({},s);delete t[we],delete t[xe],c=Object.keys(t).length?t:void 0}r=u(l({},t),{animate:n,style:u(l({},t.style),{offsetPath:"path('"+e.pathStr+"')",offsetAnchor:Qi(e.anchor[0])+"px "+Qi(e.anchor[1])+"px",offsetRotate:e.autoOrient?"auto":"0deg",offsetDistance:"0%"})}),void 0!==c?r.transform=c:delete r.transform}}if(null==(n=r.children)?void 0:n.length){const t=r.children.map(e);t.some((t,e)=>t!==r.children[e])&&(r=u(l({},r),{children:t}))}return r};return e(t)}function $i(t,e,n){var r,o;let i=Zi(t).root;i=Hi(i);return i=Tr(i,null!=(o=null==(r=_e(i))?void 0:r.duration)?o:N),e===Xt.native&&(i=Ar(i,null==n?void 0:n.motionPath),i=qr(i),i=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}(i)),i}function ta(t){const e=globalThis;"function"!=typeof e.cancelAnimationFrame?e.clearTimeout(t):e.cancelAnimationFrame(t)}function ea(t,e,n){var r;const o=_e(t)||{},i=Ur(t,Xt.js),a=o.iterations;let s=1;"number"==typeof a&&(s=a||1),"infinite"===a&&(s=1/0),s<1&&(s=1);const l=+(o.duration||N),u=l&&s?l*(s===1/0?1/0:s):l?(null!=s?s:1)*l:0,c=o.direction||"normal",f=null!=(r=o.fill)?r:"forwards",d="forwards"===f||"both"===f,h="backwards"===f||"both"===f;let p=null,m=!1,g=-(o.delay||0),v=0,y=1,b=!1;const k=o.frameRate,A=k&&k>0?1e3/k:0;let w=0;const x=()=>{const t=v?(Date.now()-v)*y:0;return g+t},j=()=>{let t=x();return Number.isFinite(u)&&t>u&&(t=u),t<0&&(t=0),t};function O(t){let n=function(){const e=l>0?l:1;let n=0,r=0;if(l>0){t=R(t,0,s*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,s-1);n=R((t-r*e)/e,0,1)}else n=t;const o=c||"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 i||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=Vr(r,n*l);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}o.delay&&(o.delay<0?O(j()):h&&O(0));const S=()=>!!m&&(!!e.isConnected()&&(y<0?x()>0:!(Number.isFinite(u)&&j()>=u))),M=t=>{null!==p&&(ta(p),p=null),(t||S())&&(p=function(t){const e=globalThis;return"function"==typeof e.requestAnimationFrame?e.requestAnimationFrame(t):e.setTimeout(t,16)}(()=>{p=null,(()=>{var t,r;if(!e.isConnected())return void P();const o=j(),i=x();if(i<0&&y>0)h&&O(0);else{if(y<0&&i<=0)return P(),O(0),void(b||(b=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)));if(y>0&&u&&Number.isFinite(u)&&o>=u)return P(),O(d?u:0),void(b||(b=!0,null==(r=null==n?void 0:n.onFinish)||r.call(n)));if(A>0){const t=Date.now();if(w&&t-w<A)return;w=t}O(o)}})(),M()}))},P=()=>{if(!m)return;let t=x();Number.isFinite(u)&&t>u&&(t=u),g=t,v=0,m=!1,null!==p&&(ta(p),p=null),t>=0?O(t):h&&O(0)},_={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>S(),play:()=>{var t;(()=>{if(!m){if(y>=0)Number.isFinite(u)&&g>=u&&(g=0);else if(g<=0){if(!Number.isFinite(u))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");g=u}b=!1,m=!0,v=Date.now(),M(!0)}})(),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;P(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;P(),g=0,v=0,m=!1,b=!1,O(g),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;g=Number.isFinite(u)?u:j(),v=0,m=!1,null!==p&&(ta(p),p=null),O(d?g:0),t&&!b&&(b=!0,null==(e=null==n?void 0:n.onFinish)||e.call(n))})(!0)},setPlaybackRate:t=>{if(!isFinite(t)||0===t)return void console.warn("setPlaybackRate: rate must be finite and non-zero");let e=x();Number.isFinite(u)&&e>u&&(e=u),t<0!=y<0&&(b=!1),y=t,g=e,m&&(v=Date.now())},getCurrentTime:()=>j(),setCurrentTime:t=>{t<0&&(t=0),Number.isFinite(u)&&t>u&&(t=u),g=t,m&&(v=Date.now()),(!Number.isFinite(u)||t<u)&&(b=!1),O(j())},destroy:()=>{var t;_.cancel(),null==(t=null==n?void 0:n.onRemove)||t.call(n)}};return _}var na=[1,0,0,1,0,0];function ra(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}var oa=(t,e)=>[1,0,0,1,t,e],ia=(t,e)=>[t,0,0,e,0,0];function aa(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var sa=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],la=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function ua(t){let e=na;t.translate&&(e=ra(e,oa(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=ra(e,oa(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=ra(e,aa(t.rotate))),t.scale&&(e=ra(e,ia(t.scale[0],t.scale[1]))),n&&(e=ra(e,oa(-t.origin[0],-t.origin[1]))),e}function ca(t,e,n){return t+(e-t)*n}function fa(t,e){return null==t?na:"string"==typeof t?function(t){let e=na;const n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);){const t=r[1],n=r[2].split(/[\s,]+/).filter(Boolean).map(Number);"translate"===t?e=ra(e,oa(n[0]||0,n[1]||0)):"scale"===t?e=ra(e,ia(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=ra(e,aa(n[0])):"skewX"===t?e=ra(e,sa(n[0])):"skewY"===t?e=ra(e,la(n[0])):"matrix"===t&&(e=ra(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?ua(function(t,e){var n,r,o,i,a,s,l;if(!t.length)return{};if(e<=(null!=(n=t[0].time)?n:0))return t[0].value||{};if(e>=(null!=(r=t[t.length-1].time)?r:0))return t[t.length-1].value||{};let u=0;for(;u<t.length-1&&(null!=(o=t[u+1].time)?o:0)<e;)u++;const c=t[u],f=t[u+1],d=(e-(null!=(i=c.time)?i:0))/((null!=(a=f.time)?a:0)-(null!=(s=c.time)?s:0)||1),h=c.value||{},p=f.value||{},m={};return h.translate&&p.translate?m.translate=[ca(h.translate[0],p.translate[0],d),ca(h.translate[1],p.translate[1],d)]:m.translate=h.translate||p.translate,void 0!==h.rotate&&void 0!==p.rotate?m.rotate=ca(h.rotate,p.rotate,d):m.rotate=null!=(l=h.rotate)?l:p.rotate,h.scale&&p.scale?m.scale=[ca(h.scale[0],p.scale[0],d),ca(h.scale[1],p.scale[1],d)]:m.scale=h.scale||p.scale,m.origin=h.origin||p.origin,m}(t.keyframes,e)):t.value?ua(t.value):"object"!=typeof t||Array.isArray(t)?na:ua(t)}var da=new Set(["svg","g","symbol"]),ha=new Set(["defs","mask","clipPath","title"]);function pa(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>pa(t,e))}function ma(t){return null==t?0:Number(t)}function ga(t){return Math.round(100*t)/100+0}function va(t,e,n){var r,o,i,a,s;const l=null!=(r=t.fill)?r:"",u=null!=(o=t.stroke)?o:"",c=null!=(a=null!=(i=t["stroke-width"])?i:t.strokeWidth)?a:"",f=ga(function(t,e,n,r){var o,i,a,s,l,u;if(t&&t.keyframes&&t.keyframes.length){const e=t.keyframes;if(r<=(null!=(o=e[0].time)?o:0))return e[0].value;if(r>=(null!=(i=e[e.length-1].time)?i:0))return e[e.length-1].value;let n=0;for(;n<e.length-1&&(null!=(a=e[n+1].time)?a:0)<r;)n++;const c=e[n],f=e[n+1],d=(r-(null!=(s=c.time)?s:0))/((null!=(l=f.time)?l:0)-(null!=(u=c.time)?u:0)||1);return ca(c.value,f.value,d)}return void 0!==e?Number(e):n}(null==(s=t.animate)?void 0:s.opacity,t.opacity,1,n)),d=t.mask?1:0,h=e.map(ga).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return ma(t.width)+","+ma(t.height)+","+ma(t.x)+","+ma(t.y);case"ellipse":return ma(t.rx)+","+ma(t.ry)+","+ma(t.cx)+","+ma(t.cy);case"circle":return ma(t.r)+","+ma(t.cx)+","+ma(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+h+"]|f:"+l+"|s:"+u+"|sw:"+(ma(c)||"")+"|o:"+f+"|m:"+d}function ya(t,e,n,r,o){var i;const a=t.type||"";if(ha.has(a))return;const s=ra(e,function(t,e){return t.animate&&t.animate.transform?fa(t.animate.transform,e):void 0!==t.transform?fa(t.transform,e):na}(t,n));if("use"===a){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",i=r.get(e),a=ra(s,oa(ma(t.x),ma(t.y)));return void(i?ya(i,a,n,r,o):o.push("UNRESOLVED_USE:#"+e))}da.has(a)?null==(i=t.children)||i.forEach(t=>ya(t,s,n,r,o)):o.push(va(t,s,n))}function ba(t,e){var n;e.add(0);(t=>{var n;if(t&&"object"==typeof t)for(const r of Object.keys(t)){const o=null==(n=t[r])?void 0:n.keyframes;Array.isArray(o)&&o.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)})}})(t.animate),t.transform&&"object"==typeof t.transform&&t.transform.keyframes&&t.transform.keyframes.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)}),null==(n=t.children)||n.forEach(t=>ba(t,e))}function ka(t,e){const n=new Map;pa(t,n);const r=[];return ya(t,na,e,n,r),r.sort()}function Aa(t,e){const n=new Set;ba(t,n),ba(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=ka(t,o),i=ka(e,o),a=wa(n,i),s=wa(i,n);(a.length||s.length)&&r.push({time:o,onlyInA:a,onlyInB:s})}return r}function wa(t,e){const n=new Map;for(const t of e)n.set(t,(n.get(t)||0)+1);const r=[];for(const e of t){const t=n.get(e)||0;t>0?n.set(e,t-1):r.push(e)}return r}var xa=["timelineSource","scroll","trigger","delay","iterations","direction","fill","resetOnFinish","duration","mode","frameRate"],ja=["definitions","animateById"],Oa=t=>!!t&&"object"==typeof t&&!Array.isArray(t);function Sa(t,e){const n=Oa(t)?l({},t):{};for(const t of Object.keys(e)){const r=e[t];null!==r?Oa(r)?n[t]=Sa(n[t],r):n[t]=r:delete n[t]}return n}function Ma(t,e,n){const r=Oa(o=t)&&"string"==typeof o.type?o.type:"time";var o;const i=Oa(e)&&"string"==typeof e.type?String(e.type):r;let a;if(i!==r){const n={};if(Oa(t))for(const e of Yt)void 0!==t[e]&&(n[e]=t[e]);a=Sa(n,e)}else a=Sa(t,e);if("scroll"===(s=i)||"view"===s){for(const t of Jt)void 0!==a[t]&&(n("animator.timeline."+t+": no slot on a '"+i+"' timeline — dropped"),delete a[t]);"infinite"===a.iterations&&(n("animator.timeline.iterations: 'infinite' cannot map onto a scroll range — dropped"),delete a.iterations)}var s;return a}function Pa(t,e){let n;if("string"==typeof t)try{n=JSON.parse(t)}catch(t){console.warn("animator config: 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 n;const s=Oa(n)?l({},n):{},c=l({},s.timeline);return void 0!==r&&(c.duration=r),void 0!==o&&(c.delay=o),void 0!==i&&(c.iterations=i),void 0!==a&&(c.trigger=u(l({},c.trigger),{startOn:a})),s.timeline=c,s}function _a(t,e){const n=[],r=t=>n.push(t);if(null===e)return{config:void 0,warnings:n};if(!Oa(e)||0===Object.keys(e).length)return{config:t,warnings:n};const o=Oa(t)?xa.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=Oa(t)?l({},t):{};for(const t of Object.keys(e)){const n=e[t];null!==n?"timeline"!==t?Oa(n)?i[t]=Sa(i[t],n):i[t]=n:i.timeline=Oa(n)?Ma(i.timeline,n,r):n:delete i[t]}return{config:i,warnings:n}}function za(t,e,n){var r,o;const i=!!(null==n?void 0:n.resetDefaults);if(!(t&&void 0!==e&&(i||null!==e&&Oa(e)&&Object.keys(e).length)))return{doc:t,warnings:[]};const a=t,s=Oa(a.animator),c=!s&&Oa(null==(r=a.meta)?void 0:r.animator),f=s?a.animator:c?a.meta.animator:void 0,d=[];s&&Oa(null==(o=a.meta)?void 0:o.animator)&&d.push("animator: doc.meta.animator is shadowed by doc.animator and was not patched");let h=f;if(i){const t={};for(const e of ja)Oa(f)&&void 0!==f[e]&&(t[e]=f[e]);h=t}const p=_a(h,null!=e?e:{});return d.push(...p.warnings),p.config===f?{doc:t,warnings:d}:c?{doc:u(l({},a),{meta:u(l({},a.meta),{animator:p.config})}),warnings:d}:{doc:u(l({},a),{animator:p.config}),warnings:d}}var Na=[...Yt,...Jt,"fill","resetOnFinish","timelineSource","scroll"],Ia=t=>Na.some(e=>t.indexOf("animator."+e+":")>=0);function Ea(t){let e;try{e=In(t)}catch(t){return{problems:[],legacy:[]}}const n=[],r=[];for(const t of e)(Ia(t)?r:n).push(t);return{problems:n,legacy:r}}function Da(t,e){const{problems:n}=Ea(t);if(!n.length)return;const r=n.slice(0,6),o=n.length-r.length;console.warn(e+": this document does not match the animation schema in "+n.length+" place"+(1===n.length?"":"s")+".\n"+r.map(t=>" - "+t).join("\n")+(o>0?"\n … and "+o+" more":"")+"\n\nIf you did not author these keys, the usual cause is a build that MANGLES PROPERTY NAMES. An animation document is data loaded at runtime, so renaming the property reads inside the player stops them matching the keys in the JSON, and the animation silently does nothing. Feed the published reserved-name list to your minifier — @pixodesk/svg-animator-web/mangle-reserved.json — see docs/library/minification.md.")}export{Et as BASELINE_PLAYER_VERSION,O as COLOUR_ATTR_NAMES,Zn as CSS_ONLY_STYLE_PROPS,N as DEFAULT_DURATION_MS,Gn as DISALLOWED_SVG_TAGS_LOWER,Ae as INTERNAL_ATTRS,xr as LOOP_JUMP_SHIFT_MS,mi as MISSING_GLYPH_CLASS_NAME,M as PCT_BASED_ATTR_NAMES,Dt as PLAYER_WIRE_STEPS,St as PLAYER_WIRE_VERSION,Zt as PX_ANIM_ATTR_NAME,qt as PX_ANIM_SRC_ATTR_NAME,bt as PX_PLAYER_SCHEMA_VERSION,je as PX_TRANSFORM_PART_KEYS,X as PX_UNKNOWN_KEY_ERROR,Rn as PxAnimatedSvgDocumentSchema,Ye as PxAnimationDefinitionSchema,fn as PxAnimatorConfigSchema,hn as PxAttrValueSchema,Cn as PxBezierPathSchema,dn as PxBindingSchema,xn as PxCloneEffectSchema,se as PxCloneWithout,$e as PxDefsSchema,Re as PxEasingOrRefSchema,zn as PxEffectsSchema,Je as PxElementAnimationSchema,Sn as PxFillGradientEffectSchema,Se as PxGradientSpreadMethod,jn as PxGradientStopSchema,Me as PxGradientType,Oe as PxGradientUnits,Fe as PxKeyframeSchema,Ce as PxKeyframeValueSchema,ne as PxLoopDirection,ee as PxLoopRepeatAt,Ge as PxLoopSchema,bn as PxMaskedByEffectSchema,En as PxNodeBase,Dn as PxNodeSchema,Ke as PxPropertyAnimationSchema,yn as PxRepeaterEffectSchema,wn as PxRetimeEffectSchema,tn as PxScrollRangePointSchema,en as PxScrollRangeSchema,nn as PxScrollSchema,Mn as PxStrokeGradientEffectSchema,An as PxStrokeTrimEffectSchema,ge as PxStrokeTrimSubPaths,Tn as PxSvgNodeExtra,_n as PxTextEffectSchema,Pn as PxTextPathEffectSchema,Xt as PxTimelineEngine,Qt as PxTimelineEngineExtra,rn as PxTimelinePinSchema,cn as PxTimelineSchema,vn as PxTransformByEffectSchema,qe as PxTransformPartsSchema,Ze as PxTransformValueSchema,Xe as PxTriggerSchema,z as STYLE_ATTR_NAMES,ve as TEXT_ATTR,ye as TEXT_CONTENT_ATTR,S as TRANSFORM_FN_NAMES,kt as WIRE_VERSION_KEY,It as WireStepKind,wt as WireVersionRelation,za as applyAnimatorConfig,Zi as applyPlayerEffects,Tt as applyWireSteps,Ut as applyWireStepsDown,f as bezierToSvgPath,Vr as calcAnimationValues,T as camelCaseToKebabWordIfNeeded,R as clamp,ba as collectSampleTimes,zt as compareWireVersion,P as composeTransformParts,Rt as convertPlayerDocument,ea as createBasicFrameLoopAnimator,Ko as createPathSampler,y as cubicBezier,Vn as deepClone,gt as describeSchema,Ea as diagnoseDocument,Wt as diffFieldUniverse,Aa as diffInEffect,Lt as downgradePlayerDocument,sr as evaluateMotionPathSegment,Xo as extendedPathForBrowser,Ne as flattenAnimatorTimeline,Pa as foldAnimatorConfigShortcuts,Ot as formatWireVersion,Bn as generateNewIds,Ln as generateUniqueId,_e as getAnimatorConfig,De as getBindings,Te as getChildren,Ee as getDefs,Ur as getNormalisedBindings,tr as getNormalizedProps,m as interpolateBeziers,Nr as interpolateValue,$t as isNativeForced,Pe as isPxElementFileFormat,Fn as isPxElementFileFormatDeep,W as isScrollTimeline,Ho as jsonElementFactory,I as kebabToCamelCaseWord,Ve as kfEasing,Be as kfTangentIn,We as kfTangentOut,Ue as kfTime,Le as kfValue,yi as layoutGlyphTextChars,$i as materialiseAllInTree,qr as materialiseAnimatedUseInstances,zi as materialiseGlyphText,Ai as materialiseGlyphTextAlongPath,vi as materialiseGlyphTextHorizontal,Dr as materialiseInternalLoopsInPropAnim,Tr as materialiseInternalLoopsInTree,lr as materialiseMotionPathInPropAnim,Ar as materialiseMotionPathsInTree,te as mayUseNativeScrollTimeline,_a as mergeAnimatorConfig,Fr as mergeStaticTransformIntoAnimDef,Ie as nestAnimatorTimeline,_ as parseTransformParts,jt as parseWireVersion,Gt as planSchemaRelease,or as propAnimIsMotionPath,yt as px,_t as readWireVersion,Kt as releaseLogProblems,Da as reportDocumentDiagnostics,$n as resolveStyle,Ht as resolveTimelineEngine,w as reverseEasing,Hn as sanitiseAttributeValue,Vt as schemaFieldUniverse,mt as schemaKeys,Y as scrollOffsetProgress,K as scrollPhaseInterval,J as scrollResolveAxis,G as scrollTotalDurationMs,Z as scrollViewProgress,Jo as shiftAnimatable,A as splitEasing,k as subdivideCubicBezier,x as toRGBA,In as validateDocument,Nn as validateNodeEffects,Nt as versionAdvice,ka as visualModelAt};
|