@pixodesk/svg-animator-web 1.0.19 → 1.0.20
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 +31 -14
- package/dist/index.cjs +363 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +285 -4
- package/dist/index.d.ts +285 -4
- package/dist/index.js +361 -65
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.umd.js +361 -65
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/package.json +2 -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,a=Object.prototype.propertyIsEnumerable,i=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))a.call(e,n)&&s(t,n,e[n]);return t},u=(t,r)=>e(t,n(r));function c(t,e,n){const r={};return"translate"===t?r.translate=e:"rotate"===t?r.rotate=e:r.scale=e,n&&"translate"!==t&&(r.origin=n),r}function f(t){if(void 0===t)return{kind:"absent"};if(Array.isArray(t))return{kind:"static",value:t};if("object"==typeof t){const e=t;if(e.keyframes)return{kind:"animated",keyframes:e.keyframes,autoOrient:e.autoOrient,loop:e.loop};if(void 0!==e.value)return{kind:"static",value:e.value}}return{kind:"static",value:t}}function d(t,e){const n={value:e};return void 0!==t.time&&(n.time=t.time),void 0!==t.easing&&(n.easing=t.easing),void 0!==t.tangentOut&&(n.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(n.tangentIn=t.tangentIn),n}function h(t,e,n){if(!e)return t;delete t.transform;let r=t;var o;return r=p(r,"skew",e.skew,n),r=m(r,e.origin,!0),r=p(r,"scale",void 0===(o=e.scale)?void 0:Array.isArray(o)?[o[0]/100,o[1]/100]:o,n),r=p(r,"rotate",e.rotate,n),r=m(r,e.origin,!1),!function(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}(e.translate)?r=p(r,"translate",e.translate,n):(r=m(r,e.origin,!0),r=p(r,"translate",e.translate,n),r=m(r,e.origin,!1)),r}function p(t,e,n,r){if(void 0===n)return t;if("skew"===e){const e=f(n);return"static"!==e.kind?(r.warnings.push("transformation.skew: only static skew is supported"),t):{type:"g",transform:"skewX("+e.value[0]+")skewY("+e.value[1]+")",children:[t]}}const o=f(n);if("static"===o.kind)return{type:"g",transform:{value:c(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>d(t,c(e,t.value,void 0)))};return o.autoOrient&&(n.autoOrient=!0),void 0!==o.loop&&(n.loop=o.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function m(t,e,n){if(void 0===e)return t;const r=f(e),o=t=>n?[-t[0],-t[1]]:t;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=>d(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function y(t,e,n){var r,o,a;if("use"===t.type&&"content"===(null==(o=null==(r=t.effects)?void 0:r.clone)?void 0:o.type)){const r=t.effects.clone.baseId;"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(a=t.children)||a.forEach(t=>y(t,e,n))}function v(t,e,n,r,o){const a=function(t,e){var n,r,o;const a={};let i=!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=b(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),a.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}i=!0}}const l=void 0!==(null==e?void 0:e.translate),u=i||l,c=i&&b((null==(r=t.animate)?void 0:r.transform)||void 0)||i&&b((null==(o=a.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],a=e[e.length-1];if("translate"===a.name&&"translate"===o.name){const n=g(a.full),r=g(o.full),i=-n[0],s=-n[1],l=r[0]-i,u=r[1]-s;if(0===l&&0===u)return{rest:t};return{translate:"translate("+l+","+u+")",rest:"translate("+i+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===a.name)return{rest:t};const i=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)i.push(e[s].full),s++;if(!i.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:i.join(""),rest:l||void 0}}(t.transform);u?void 0!==e.translate?e.rest?t.transform=e.rest:delete t.transform:!function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,n=[];let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(1!==n.length)return!1;if("translate"===n[0].name)return!0;if("matrix"!==n[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(n[0].full);if(!o)return!1;const a=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return a.length>=4&&1===a[0]&&0===a[1]&&0===a[2]&&1===a[3]}(t.transform)?c&&function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let n,r=0,o=!1;for(;n=e.exec(t);)r++,"matrix"===n[1]&&(o=!0);return 1===r&&o}(t.transform)&&delete t.transform:delete t.transform:e.translate&&(a.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}return a}(t,e);"string"==typeof t.id&&delete t.id;const{outer:i,inner:s}=function(t){if(!t)return{};const e=b(t.translate),n=void 0!==t.rotate||void 0!==t.scale,r={},o={};void 0!==t.translate&&(r.translate=t.translate);e&&void 0!==t.origin&&(r.origin=t.origin);void 0!==t.rotate&&(o.rotate=t.rotate);void 0!==t.scale&&(o.scale=t.scale);void 0!==t.skew&&(o.skew=t.skew);void 0===t.origin||e&&!n||(o.origin=t.origin);return{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(e);let l=t;l=h(l,s,o);let u={type:"g",id:n,children:[{type:"g",id:r,children:[l]}]};return void 0!==a.transform&&(u.transform=a.transform),void 0!==a.animate&&(u.animate=a.animate),i&&(delete u.id,u=h(u,i,o),u.id=n),u}function g(t){const e=/translate\(([^)]*)\)/.exec(t);if(!e)return[0,0];const n=e[1].split(/[\s,]+/).filter(Boolean).map(Number);return[n[0]||0,n[1]||0]}function b(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||!!Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}function k(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var A=class{_canSanitize(t){return this.isValid(t)}optional(){return new w(this)}},w=class extends A{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)}},j=class extends A{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(k(null!=n?n:[])+": expected string, got "+typeof t),!1)}},x=class extends A{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(k(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},O=class extends A{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(k(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},S=class extends A{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(k(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},P=class extends A{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(k(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},M=class extends A{constructor(t,e){super(),this.schemas=t,this._default=null!=e?e:t[0]._default}sanitize(t){for(const e of this.schemas)if(e.isValid(t))return e.sanitize(t);return this._default}isValid(t,e,n){var r;return!!this.schemas.some(e=>e.isValid(t))||(null==e||e.errors.push(k(null!=n?n:[])+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,60)),!1)}_canSanitize(t){return this.schemas.some(e=>e._canSanitize(t))}},_=class extends A{constructor(t,e,n){super(),this._key=t,this._schemas=e,this._default=null!=n?n:e[0]._default,this._map=new Map;for(const n of e){const e=n._shape[t];e&&this._map.set(e._default,n)}}_findSchema(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const e=t[this._key];return null!=e?this._map.get(e):void 0}sanitize(t){var e;return(null!=(e=this._findSchema(t))?e:this._schemas[0]).sanitize(t)}isValid(t,e,n){const r=this._findSchema(t);if(!r){const r=null===t||"object"!=typeof t||Array.isArray(t)?void 0:t[this._key];return null==e||e.errors.push(k(null!=n?n:[])+": no discriminated union member matched "+this._key+"="+JSON.stringify(r)),!1}return r.isValid(t,e,n)}_canSanitize(t){if(null===t||"object"!=typeof t||Array.isArray(t))return!1;const e=this._findSchema(t);return e?e._canSanitize(t):this._schemas[0]._canSanitize(t)}},z=class extends A{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(k(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let a=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(a=!1),o.pop();if(null==e?void 0:e.strict)for(const t of Object.keys(r))t in this._shape||(o.push(t),e.errors.push(k(o)+": unexpected extra key"),o.pop(),a=!1);return a}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},I=class extends A{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(k(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let a=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(a=!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)||(a=!1),o.pop());return a}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},C=class extends A{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(k(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)}},N=class extends A{constructor(t){super(),this.value=t,this._default={}}sanitize(t){if(!t||"object"!=typeof t||Array.isArray(t))return{};const e={};for(const[n,r]of Object.entries(t))this.value._canSanitize(r)&&(e[n]=this.value.sanitize(r));return e}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(k(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,a]of Object.entries(t))r.push(n),this.value.isValid(a,e,r)||(o=!1),r.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},T=class extends A{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},E=class extends A{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)}},L=class extends A{constructor(t){super(),this.schemas=t,this._default=t.map(t=>t._default)}sanitize(t){return Array.isArray(t)&&t.length===this.schemas.length?this.schemas.map((e,n)=>e.sanitize(t[n])):this._default}isValid(t,e,n){if(!Array.isArray(t)||t.length!==this.schemas.length)return null==e||e.errors.push(k(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 F(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function U(t){var e;const n=t;return"_shape"in n?{kind:"shape",shape:n._shape}:"item"in n?{kind:"array",item:n.item}:"inner"in n?{kind:"optional",inner:n.inner}:"fn"in n?{kind:"lazy",resolved:null!=(e=n.resolved)?e:n.fn()}:{kind:"leaf"}}var V={string:(t="")=>new j(t),number:(t=0)=>new x(t),boolean:(t=!1)=>new O(t),literal:t=>new S(t),enum:(t,e)=>new P(t,e),union:(t,e)=>new M(t,e),discriminatedUnion:(t,e)=>new _(t,e),object:t=>new z(t),openObject:(t,e)=>new I(t,e),extendedObject:(t,e)=>new z(l(l({},t._shape),e)),array:t=>new C(t),record:t=>new N(t),any:()=>new T,tuple:t=>new L(t),lazy:(t,e)=>new E(t,e)},D="data-px-animation-src",W="_px_animator",R={auto:"auto",webapi:"webapi",frames:"frames"},B={webapi:R.webapi,frames:R.frames},q="text",G="textContent",K=new Set(["type","children","animator","meta","animate",q,G]),Z=V.union([V.string(),V.tuple([V.number(),V.number(),V.number(),V.number()])]),Q=(V.union([V.string(),V.number(),V.array(V.number()),V.lazy(()=>H,{}),V.object({path:V.string()}),V.lazy(()=>V.object({paths:V.array(Ct)}),{paths:[]})]),V.object({time:V.number().optional(),t:V.number().optional(),value:V.any().optional(),v:V.any().optional(),easing:Z.optional(),e:Z.optional(),tangentOut:V.tuple([V.number(),V.number()]).optional(),to:V.tuple([V.number(),V.number()]).optional(),tangentIn:V.tuple([V.number(),V.number()]).optional(),ti:V.tuple([V.number(),V.number()]).optional(),selected:V.boolean().optional()})),J=V.object({segmentCount:V.number().optional(),before:V.boolean().optional(),alternate:V.boolean().optional()}),X=V.object({keyframes:V.array(Q).optional(),kfs:V.array(Q).optional(),loop:V.union([J,V.boolean()]).optional(),autoOrient:V.boolean().optional()}),Y=["translate","rotate","scale","origin"],H=V.object({translate:V.tuple([V.number(),V.number()]).optional(),rotate:V.number().optional(),scale:V.tuple([V.number(),V.number()]).optional(),origin:V.tuple([V.number(),V.number()]).optional()}),$=V.union([V.string(),V.object({value:H}),X]),tt=V.record(X),et=V.union([V.string(),V.array(V.union([V.string(),tt])),tt]),nt=V.object({startOn:V.enum(["load","mouseOver","click","scrollIntoView","programmatic"]).optional(),outAction:V.enum(["continue","pause","reset","reverse"]).optional(),scrollIntoViewThreshold:V.number().optional()}),rt=V.object({width:V.number(),d:V.string()}),ot=V.object({fFamily:V.string(),style:V.string(),ascent:V.number(),unitsPerEm:V.number(),glyphs:V.record(rt)}),at=V.object({easings:V.record(V.tuple([V.number(),V.number(),V.number(),V.number()])).optional(),animations:V.record(tt).optional(),styles:V.record(V.any()).optional(),glyphs:V.record(ot).optional()}),it=V.object({mode:V.enum([R.auto,R.webapi,R.frames]).optional(),duration:V.number().optional(),delay:V.number().optional(),iterations:V.union([V.number(),V.literal("infinite")]).optional(),fill:V.enum(["forwards","backwards","both","none"]).optional(),direction:V.enum(["normal","reverse","alternate","alternate-reverse"]).optional(),frameRate:V.number().optional(),trigger:nt.optional(),definitions:at.optional(),animate:V.record(et).optional(),debug:V.boolean().optional(),debugInstName:V.string().optional()}),st=V.object({id:V.string(),animate:et}),lt=V.union([V.string(),V.number(),V.object({value:V.any()}),X]),ut=V.union([V.number(),V.object({value:V.number()}),V.object({keyframes:V.array(Q),autoOrient:V.boolean().optional()})]),ct=V.union([V.tuple([V.number(),V.number()]),V.object({value:V.tuple([V.number(),V.number()])}),V.object({keyframes:V.array(Q),autoOrient:V.boolean().optional()})]),ft=V.object({translate:ct.optional(),rotate:ut.optional(),scale:ct.optional(),skew:ct.optional(),origin:ct.optional()}),dt=V.object({copies:V.number().optional(),translate:ct.optional(),rotate:ut.optional(),scale:ct.optional(),origin:ct.optional()}),ht=V.object({href:V.string().optional(),maskType:V.string().optional(),maskUnits:V.string().optional(),maskContentUnits:V.string().optional()}),pt=V.object({offset:ut.optional(),range:ct.optional(),trimAllAsOne:V.boolean().optional()}),mt=V.object({baseId:V.string().optional(),start:V.number().optional(),stretch:V.number().optional(),timeCrop:V.tuple([V.number(),V.number()]).optional()}),yt=V.object({type:V.string().optional(),baseId:V.string().optional(),retime:mt.optional()}),vt={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},gt={pad:"pad",reflect:"reflect",repeat:"repeat"},bt={linear:"linear",radial:"radial"},kt=V.object({offset:V.number(),color:V.string()}),At=V.union([V.array(kt),V.object({value:V.array(kt)}),V.object({keyframes:V.array(Q)})]),wt=V.object({type:V.enum([bt.linear,bt.radial]),p1:V.tuple([V.number(),V.number()]).optional(),p2:V.tuple([V.number(),V.number()]).optional(),c:V.tuple([V.number(),V.number()]).optional(),r:V.number().optional(),fp:V.tuple([V.number(),V.number()]).optional(),stops:At.optional(),gradientUnits:V.string().optional(),spreadMethod:V.string().optional(),gradientTransform:V.string().optional()}),jt=wt,xt=V.object({path:V.string(),pathOverflow:V.string().optional(),lengthAdjust:V.string().optional(),method:V.string().optional(),spacing:V.string().optional(),startOffset:ut.optional(),textLength:ut.optional()}),Ot=V.object({useGlyphs:V.boolean().optional()}),St=V.object({transformation:ft.optional(),repeater:dt.optional(),maskedBy:ht.optional(),trimPath:pt.optional(),clone:yt.optional(),isCombinedShape:V.boolean().optional(),fillGradient:wt.optional(),strokeGradient:jt.optional(),textPath:xt.optional(),text:Ot.optional()});function Pt(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!St.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 Mt=V.openObject({type:V.string(),id:V.string().optional(),meta:V.any().optional(),effects:St.optional(),animate:et.optional(),style:V.union([V.string(),V.record(V.union([V.string(),V.number()]))]).optional()},lt),_t=V.openObject(u(l({},Mt._shape),{children:V.lazy(()=>V.array(_t),[]).optional()}),lt),zt=V.object({width:V.number().optional(),height:V.number().optional(),viewBox:V.string().optional(),animator:it.optional()}),It=V.openObject(u(l(l({},Mt._shape),zt._shape),{type:V.literal("svg"),children:V.array(_t).optional()}),lt),Ct=V.object({v:V.array(V.array(V.number())),i:V.array(V.array(V.number())).optional(),o:V.array(V.array(V.number())).optional(),c:V.boolean().optional()});function Nt(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&("svg"===t.type||"svg"===t.tagName)}function Tt(t){const e=It.isValid(t);return{valid:e,errors:e?[]:["Document failed schema validation"]}}function Et(t){var e,n;return(null==t?void 0:t.animator)||(null==(e=null==t?void 0:t.meta)?void 0:e.animator)||(null==t?void 0:t.animation)||(null==(n=null==t?void 0:t.meta)?void 0:n.animation)}function Lt(t){var e;if(t)return null==(e=Et(t))?void 0:e.definitions}function Ft(t){var e;if(!t)return;const n=null==(e=Et(t))?void 0:e.animate;return n?Object.entries(n).map(([t,e])=>({id:t,animate:e})):void 0}function Ut(t){return null==t?void 0:t.children}function Vt(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Vt);const e={};for(const n of Object.keys(t))e[n]=Vt(t[n]);return e}function Dt(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}),a=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(a)};return a(t),n}function Wt(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function Rt(t){var e;const n=Wt(t.x),r=Wt(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 Bt(t,e){return"_lw_"+e+"_"+t.nextId++}function qt(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function Gt(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Gt(t,e))}var Kt=Vt;function Zt(t,e,n,r){if(!e)return t;const o=Bt(n,"grad"),a=function(t,e){const n={type:t.type===bt.radial?"radialGradient":"linearGradient",id:e};t.type===bt.linear?(t.p1&&(n.x1=String(t.p1[0]),n.y1=String(t.p1[1])),t.p2&&(n.x2=String(t.p2[0]),n.y2=String(t.p2[1]))):(t.c&&(n.cx=String(t.c[0]),n.cy=String(t.c[1])),void 0!==t.r&&(n.r=String(t.r)),t.fp&&(n.fx=String(t.fp[0]),n.fy=String(t.fp[1])));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[];if(Array.isArray(t))return t.map(Qt);if("object"==typeof t&&Array.isArray(t.value))return t.value.map(Qt);const a=t,i=a.keyframes;if(!Array.isArray(i)||!i.length)return[];const s=a.loop;let l=0;for(const t of i){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=i[0].value)?n:i[0].v,c=[];for(let t=0;t<l;t++){const e=null!=(o=null!=(r=null==u?void 0:u[t])?r:Jt(i,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 a,i,s,l,u;const c=[],f=[];let d=!1;for(const r of e){const o=null!=(i=null!=(a=r.time)?a:r.t)?i:0,h=null!=(s=r.value)?s:r.v,p=null!=(l=null==h?void 0:h[n])?l:Jt(e,e.indexOf(r),n);if(!p)continue;const m=null!=(u=r.easing)?u:r.e,y={time:o,value:p.color};void 0!==m&&(y.easing=m),c.push(y);const v={time:o,value:p.offset};void 0!==m&&(v.easing=m),f.push(v),p.offset!==t.offset&&(d=!0)}const h={type:"stop",offset:Xt(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,i,e,0,s))}(t.stops),n}(e,o);return n.defs.push(a),t[r]="url(#"+o+")",t}function Qt(t){return{type:"stop",offset:Xt(t.offset),stopColor:t.color}}function Jt(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 Xt(t){return Math.round(1e3*t)/10+"%"}function Yt(t,e,n,r){if(!e)return t;if(!e.href)return r.errors.push("maskedBy.href missing — cannot build mask"),t;const o=Bt(r,"mask");let a={type:"use",href:"#"+e.href};if(n)a=Ht(a,n,r);else if(ee(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,a=o&&"object"==typeof o&&Array.isArray(o.keyframes)?o.keyframes:void 0;if(!a||!a.length)return t;const i=[],s=[],c=[];for(const t of a){const e=(null!=(n=t.value)?n:t.v)||{},r=d(t,void 0);if(Array.isArray(e.translate)&&i.push(u(l({},r),{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,h=t=>{const e={keyframes:t};return void 0!==f&&(e.loop=f),e};let p=t;i.length&&(p={type:"g",animate:{transform:h(i)},children:[p]});s.length&&(p={type:"g",animate:{transform:h(s)},children:[p]});c.length&&(p={type:"g",animate:{transform:h(c)},children:[p]});return p}(a,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,a,i,s,l,u,c,f,d,h;const p=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let m;const y=[];for(;null!==(m=p.exec(t));){const t=m[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);y.push({name:m[1],args:t})}if(!y.length)return;const v=y[y.length-1];if("translate"===v.name)for(let t=y.length-2;t>=0;t--){const c=y[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"===y[e].name){const t=null!=(a=y[e].args[0])?a:0,n=null!=(i=y[e].args[1])?i:0;m.translate=m.translate?[m.translate[0]+t,m.translate[1]+n]:[t,n]}for(let e=t+1;e<y.length-1;e++){const t=y[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 g,b,k;for(const t of y)if("translate"===t.name){const e=null!=(c=t.args[0])?c:0,n=null!=(f=t.args[1])?f:0;g=g?[g[0]+e,g[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={};g&&(A.translate=g);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}return}(t);e&&(a=Ht(a,e,r))}const i=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||ee(t))}(t);a=function(t,e,n,r,o){const a=r.idMap.get(n),i=r.maskAncestorChains.get(e)||[],s=o?ae(e,r):void 0,l=s?[...i,s]:i,u=a&&r.maskAncestorChains.get(a)||[];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=ne(l),n=ne(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=re(l,t),n=re(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,e.href,r,i);const s={type:"mask",id:o,children:[a]};return e.maskType&&(s.maskType=e.maskType),e.maskUnits&&(s.maskUnits=e.maskUnits),e.maskContentUnits&&(s.maskContentUnits=e.maskContentUnits),r.defs.push(s),t.mask="url(#"+o+")",t}function Ht(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=f(t);if("absent"!==r.kind)return"static"===r.kind?r.value:(e.warnings.push("transformation.origin: animated origin approximated by its first keyframe"),null==(n=r.keyframes[0])?void 0:n.value)}(e.origin,n);let o=t;return o=$t(o,"translate",e.translate,void 0,n),o=$t(o,"rotate",e.rotate,r,n),o=$t(o,"scale",e.scale,r,n),o}function $t(t,e,n,r,o){if(void 0===n)return t;const a=f("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);if("static"===a.kind)return{type:"g",transform:{value:c(e,te(e,a.value),r)},children:[t]};if("animated"===a.kind){const n={keyframes:a.keyframes.map(t=>d(t,c(e,te(e,t.value),r)))};return void 0!==a.loop&&(n.loop=a.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function te(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function ee(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function ne(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 re(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=oe(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function oe(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],a=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*a,r.value[1]+(o.value[1]-r.value[1])*a]}return t[t.length-1].value}function ae(t,e){var n,r,o;const a=t.transform,i=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate.transform:void 0;if(void 0===a&&!i)return;const s={};if("string"==typeof a){const t=function(t,e){const n=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,a=0,i=!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,a+=e[1]||0,i=!0):s=!0}s&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t);return i?[o,a]:void 0}(a,e);t&&(s.translate=t)}else if(a&&"object"==typeof a){const t=a.value;t&&"object"==typeof t&&Array.isArray(t.translate)&&(s.translate=[t.translate[0]||0,t.translate[1]||0]),!t||void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: non-translate transform parts ignored (rotate/scale not yet supported)")}if(i&&Array.isArray(i.keyframes)){const t=i.keyframes,a=[];for(const i of t){const t=null!=(n=i.value)?n:i.v,s=null!=(o=null!=(r=i.time)?r:i.t)?o:0;t&&"object"==typeof t&&Array.isArray(t.translate)&&(a.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"))}a.length&&(s.translateKeyframes=a)}return s.translate||s.translateKeyframes?s:void 0}var ie="content";function se(t,e,n){if(!e)return;const r=e.baseId;if(!r)return void(e.type===ie&&n.errors.push("clone: content ref missing baseId"));const o=e.type===ie&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function le(t,e){const n={};return void 0!==t.translate&&(n.translate=function(t,e){if(Array.isArray(t))return e(t);if(t&&"object"==typeof t){const n=t;if(Array.isArray(n.keyframes))return u(l({},n),{keyframes:n.keyframes.map(t=>t&&void 0!==t.value?u(l({},t),{value:e(t.value)}):t)});if(void 0!==n.value)return u(l({},n),{value:e(n.value)})}return t}(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=function(t,e){if("number"==typeof t)return e(t);if(t&&"object"==typeof t){const n=t;if(Array.isArray(n.keyframes))return u(l({},n),{keyframes:n.keyframes.map(t=>t&&void 0!==t.value?u(l({},t),{value:e(t.value)}):t)});if(void 0!==n.value)return u(l({},n),{value:e(n.value)})}return t}(t.rotate,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){const n=t=>[Math.pow(t[0]/100,e),Math.pow(t[1]/100,e)],r=t=>[Math.pow(t[0],e),Math.pow(t[1],e)];if(Array.isArray(t))return{value:n(t)};if(t&&"object"==typeof t){const e=t;if(Array.isArray(e.keyframes))return u(l({},e),{keyframes:e.keyframes.map(t=>t&&void 0!==t.value?u(l({},t),{value:r(t.value)}):t)});if(void 0!==e.value)return u(l({},e),{value:n(e.value)})}return t}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function ue(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function ce(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function fe(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function de(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 he(t,e,n){const r=qt(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=pe(r,e,n,new Set);o&&(t.href="#"+o)}function pe(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 a=Kt(o);if(function(t,e){Dt(t,()=>Bt(e,"retimed"))}(a,n),"use"===o.type?ye(a,e.start,e.stretch):me(a,e.start,e.stretch),de(a),"use"===o.type&&o.href){const i=qt(o.href);if(i){const s=fe(o),l=s?ce(ue(s),e):e,u=new Set(r);u.add(t);const c=pe(i,l,n,u);c&&(a.href="#"+c)}}else!function(t,e,n,r,o){const a=t=>{var i;const s=fe(t);if("use"===t.type&&s&&t.href){const a=qt(t.href);if(a){const i=ce(ue(s),e),l=new Set(r);l.add(o);const u=pe(a,i,n,l);u&&(t.href="#"+u)}de(t)}null==(i=t.children)||i.forEach(a)};a(t)}(a,e,n,r,t);return n.defs.push(a),"string"==typeof a.id&&n.idMap.set(a.id,a),"string"==typeof a.id?a.id:void 0}function me(t,e,n){var r;ye(t,e,n),null==(r=t.children)||r.forEach(t=>me(t,e,n))}function ye(t,e,n){const r=t=>{for(const r of t)"number"==typeof r.time&&(r.time=e+r.time*n)};if(t.transform&&"object"==typeof t.transform&&Array.isArray(t.transform.keyframes)&&r(t.transform.keyframes),t.animate&&"object"==typeof t.animate)for(const e of Object.keys(t.animate)){const n=t.animate[e];n&&Array.isArray(n.keyframes)&&r(n.keyframes)}}function ve(t){var e,n,r,o;const a=t.v,i=t.i,s=t.o,l=t.c;if(!a.length)return"";const u=[],c=a.length;u.push("M"+a[0][0]+","+a[0][1]);for(let t=1;t<c;t++){const r=a[t-1],o=null!=(e=null==s?void 0:s[t-1])?e:r,l=null!=(n=null==i?void 0:i[t])?n:a[t],c=a[t];o[0]===r[0]&&o[1]===r[1]&&l[0]===c[0]&&l[1]===c[1]?u.push("L"+c[0]+","+c[1]):u.push("C"+o[0]+","+o[1]+","+l[0]+","+l[1]+","+c[0]+","+c[1])}if(l&&c>0){const t=a[c-1],e=null!=(r=null==s?void 0:s[c-1])?r:t,n=null!=(o=null==i?void 0:i[0])?o:a[0],l=a[0];e[0]===t[0]&&e[1]===t[1]&&n[0]===l[0]&&n[1]===l[1]||u.push("C"+e[0]+","+e[1]+","+n[0]+","+n[1]+","+l[0]+","+l[1]),u.push("z")}return u.join("")}function ge(t,e,n){return t+(e-t)*n}function be(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let a=0;a<o;a++)r[a]=ge(t[a]||0,e[a]||0,n);return r}function ke(t,e,n){return[ge(t[0]||0,e[0]||0,n),ge(t[1]||0,e[1]||0,n),ge(t[2]||0,e[2]||0,n),ge(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function Ae(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let a=0;a<r;a++)o.push(we(t[a],e[a],n));return o}function we(t,e,n){var r,o,a,i,s,l,u,c,f;if(!t||!e)return t||e||{v:[]};const d=Math.min(Math.max(n,0),1),h=Math.min(t.v.length,e.v.length),p=[],m=[],y=[];for(let n=0;n<h;n++){const f=t.v[n],h=e.v[n];p.push(be(f,h,d));const v=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,g=null!=(i=null==(a=e.i)?void 0:a[n])?i:h;m.push(be(v,g,d));const b=null!=(l=null==(s=t.o)?void 0:s[n])?l:f,k=null!=(c=null==(u=e.o)?void 0:u[n])?c:h;y.push(be(b,k,d))}return{v:p,i:m.length?m:void 0,o:y.length?y:void 0,c:null!=(f=t.c)?f:e.c}}function je(t,e,n){if(n<=0)return 0;if(n>=1)return 1;const r=3*t,o=3*(e-t)-r,a=1-r-o;function i(t){return((a*t+o)*t+r)*t}function s(t){return(3*a*t+2*o)*t+r}let l=n,u=0,c=1;for(let t=0;t<8;t++){const t=i(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=i(l);if(Math.abs(t-n)<1e-6)return l;n>t?u=l:c=l,l=(c+u)/2}return l}function xe(t){const[e,n,r,o]=t,a=3*n,i=3*(o-n)-a,s=1-a-i;return function(t){return n=je(e,r,t),((s*n+i)*n+a)*n;var n}}function Oe(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Se(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,a]=t,i=je(n,o,e),s=[n,r],l=[o,a],{left:u,right:c}=function(t,e,n,r,o){const a=Oe(t,e,o),i=Oe(e,n,o),s=Oe(n,r,o),l=Oe(a,i,o),u=Oe(i,s,o),c=Oe(l,u,o);return{left:[t,a,l,c],right:[c,u,s,r]}}([0,0],s,l,[1,1],i),f=u[3][0],d=u[3][1];let h,p;f>1e-9&&Math.abs(d)>1e-9&&(h=[u[1][0]/f,u[1][1]/d,u[2][0]/f,u[2][1]/d]);const m=1-f,y=1-d;return m>1e-9&&Math.abs(y)>1e-9&&(p=[(c[1][0]-f)/m,(c[1][1]-d)/y,(c[2][0]-f)/m,(c[2][1]-d)/y]),{left:h,right:p}}function Pe(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function Me(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 _e(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),a=n?e[2]+e[2]:e.slice(4,6),i=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(a,16)/255];return null!==i&&s.push(parseInt(i,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 ze=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),Ie=new Set(["translate","rotate","scale","skew"]),Ce=new Set(["offset-distance","offsetDistance"]);function Ne(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],a=t.translate,i=t.origin,s=t.rotate,l=t.scale,u=r?"px":"",c=r?"deg":"";return a&&o.push("translate("+a[0]+u+","+a[1]+u+")"),i&&o.push("translate("+i[0]+u+","+i[1]+u+")"),null!=s&&o.push("rotate("+s+c+")"),l&&o.push("scale("+l[0]+","+l[1]+")"),i&&o.push("translate("+-i[0]+u+","+-i[1]+u+")"),o.join("")}var Te=new Set(["offset-distance","offsetDistance"]);function Ee(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function Le(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var Fe=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","markerUnits","markerWidth","markerHeight","refX","refY","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function Ue(t){return Fe.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Ve(t,e,n){return Math.max(e,Math.min(t,n))}function De(t,e,n,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const a=1-o,i=a*a,s=o*o,l=i*a,u=3*o*i,c=3*s*a,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 We=1e-4;function Re(t,e,n,r,o){const a=Be(t,e,n,r,o);if(0===a[0]&&0===a[1]){return Be(t,e,n,r,o<.5?o+We:o-We)}return a}function Be(t,e,n,r,o){const a=1-o,i=3*a*a,s=6*o*a,l=3*o*o;return[i*(e[0]-t[0])+s*(n[0]-e[0])+l*(r[0]-n[0]),i*(e[1]-t[1])+s*(n[1]-e[1])+l*(r[1]-n[1])]}function qe(t,e,n,r,o=100){const a=o+1,i=new Float64Array(a),s=new Float64Array(a);let l=De(t,e,n,r,0);i[0]=0,s[0]=0;let u=0;for(let c=1;c<a;c++){const a=c/o,f=De(t,e,n,r,a),d=f[0]-l[0],h=f[1]-l[1];u+=Math.sqrt(d*d+h*h),i[c]=a,s[c]=u,l=f}return{ts:i,ds:s}}function Ge(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 a=1,i=o;for(;a<i;){const t=a+i>>>1;n[t]<e?a=t+1:i=t}const s=n[i-1],l=n[i]-s,u=l>0?(e-s)/l:0;return r[i-1]+u*(r[i]-r[i-1])}var Ke=/[MmLlHhVvCcSsQqTtAaZz]/;function Ze(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 Qe(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,a=0,i=0,s=0,l=0,u=0,c=0,f=0,d="";const h=()=>parseFloat(e[r++]),p=(t,e,r)=>{const i=[o,a],s=qe(i,t,e,r,48);n.push({P0:i,P1:t,P2:e,P3:r,lut:s,len:s.ds[s.ds.length-1]}),o=r[0],a=r[1]},m=(t,e)=>{p([o+(t-o)/3,a+(e-a)/3],[o+2*(t-o)/3,a+2*(e-a)/3],[t,e])};for(;r<e.length;){let t=e[r];Ke.test(t)?r++:t="M"===d?"L":"m"===d?"l":d;const n=t>="a",y=t.toUpperCase();if("Z"!==y){if("M"===y){const e=h()+(n?o:0),r=h()+(n?a:0);o=e,a=r,i=e,s=r,d=t;continue}if("L"===y)m(h()+(n?o:0),h()+(n?a:0));else if("H"===y)m(h()+(n?o:0),a);else if("V"===y)m(o,h()+(n?a:0));else if("C"===y){const t=[h()+(n?o:0),h()+(n?a:0)],e=[h()+(n?o:0),h()+(n?a:0)],r=[h()+(n?o:0),h()+(n?a:0)];l=e[0],u=e[1],p(t,e,r)}else if("S"===y){const t="C"===d.toUpperCase()||"S"===d.toUpperCase()?[2*o-l,2*a-u]:[o,a],e=[h()+(n?o:0),h()+(n?a:0)],r=[h()+(n?o:0),h()+(n?a:0)];l=e[0],u=e[1],p(t,e,r)}else if("Q"===y){const t=[h()+(n?o:0),h()+(n?a:0)],e=[h()+(n?o:0),h()+(n?a:0)];c=t[0],f=t[1];const{P1:r,P2:i}=Ze([o,a],t,e);p(r,i,e)}else if("T"===y){const t="Q"===d.toUpperCase()||"T"===d.toUpperCase()?[2*o-c,2*a-f]:[o,a],e=[h()+(n?o:0),h()+(n?a:0)];c=t[0],f=t[1];const{P1:r,P2:i}=Ze([o,a],t,e);p(r,i,e)}else{if("A"!==y){r++;continue}r+=5,m(h()+(n?o:0),h()+(n?a:0))}d=t}else m(i,s),o=i,a=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,a=e[e.length-1].P3,i=Math.hypot(a[0]-o[0],a[1]-o[1])<.001,s=t=>{let r=0;for(;r<e.length-1&&t>n[r+1];)r++;const o=e[r],a=t-n[r],i=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 a=1,i=o;for(;a<i;){const t=a+i>>>1;r[t]<e?a=t+1:i=t}const s=r[i-1],l=r[i]-s,u=l>0?(e-s)/l:0;return n[i-1]+u*(n[i]-n[i-1])}(o.lut,a):0,[s,l]=De(o.P0,o.P1,o.P2,o.P3,i),[u,c]=Re(o.P0,o.P1,o.P2,o.P3,i);return{x:s,y:l,angle:Math.atan2(c,u)}};return{totalLength:r,closed:i,sampleAtDistance(t){if(!i&&(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 Je(t){if("number"==typeof t)return{min:t,max:t};if(t&&"object"==typeof t){const e=t;if("number"==typeof e.value)return{min:e.value,max:e.value};if(Array.isArray(e.keyframes)&&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 Xe(t){let e=0,n=16;const r=t=>{var o,a;const i=parseFloat(String(null!=(o=t.fontSize)?o:""))||0;i&&(n=Math.max(n,i));const s=null!=(a=t.text)?a: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 Ye=t=>Math.round(1e3*t)/1e3;function He(t,e){if(!e||null==t)return t;if("number"==typeof t)return t+e;const n=t;return"number"==typeof n.value?u(l({},n),{value:n.value+e}):Array.isArray(n.keyframes)?u(l({},n),{keyframes:n.keyframes.map(t=>u(l({},t),{value:(Number(t.value)||0)+e}))}):t}function $e(t,e){var n;if("clip"===e.pathOverflow)return{d:t,startShift:0};const r=Qe(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,a=.15*o,i=Je(e.startOffset),s=Je(e.textLength).max||(null!=(n=e.advance)?n:0),l=Math.max(0,-i.min),u=Math.max(0,i.max+s-o),c=l>0?l+a:0,f=u>0?u+a: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"+Ye(e)+","+Ye(n)+"L"+Ye(d.x)+","+Ye(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"+Ye(t)+","+Ye(e)}return{d:p,startShift:c}}function tn(t,e,n){if(null!=n)if("number"!=typeof n){if("object"==typeof n&&null!==n){const r=n;if(Array.isArray(r.keyframes)){const n=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,o=l({},n||{}),a={keyframes:r.keyframes};return void 0!==r.loop&&(a.loop=r.loop),o[e]=a,void(t.animate=o)}if("number"==typeof r.value)return void(t[e]=String(r.value))}}else t[e]=String(n)}var en=(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 nn(t,e){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function rn(t,e){let n="";for(let r=0;r<t.length;r++){const o=nn(t[r],e);r>0&&45!==o.charCodeAt(0)&&(n+=" "),n+=o}return n}function on(t,e,n){return[t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}var an=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function sn(t,e,n=2){const r=[];let o;for(an.lastIndex=0;null!==(o=an.exec(t));)r.push(o[0]);let a="",i=0;const s=()=>parseFloat(r[i++]);for(;i<r.length;){const t=r[i++];if("M"===t||"L"===t){const[r,o]=on(e,s(),s());a+=t+rn([r,o],n)}else if("C"===t){const[t,r]=on(e,s(),s()),[o,i]=on(e,s(),s()),[l,u]=on(e,s(),s());a+="C"+rn([t,r,o,i,l,u],n)}else if("Q"===t){const[t,r]=on(e,s(),s()),[o,i]=on(e,s(),s());a+="Q"+rn([t,r,o,i],n)}else"Z"!==t&&"z"!==t||(a+="Z")}return a}var ln=["fontFamily","fontSize","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","textDecoration","textTransform","whiteSpace","x","y","dx","dy","lengthAdjust","fill","stroke","strokeWidth","effects",q,G,"xml:space"];function un(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?void 0:e}}function cn(t){return"string"==typeof t?t:void 0}function fn(t,e){var n,r,o,a,i,s,l;return{fontFamily:null!=(n=cn(t.fontFamily))?n:e.fontFamily,fontSize:null!=(r=un(t.fontSize))?r:e.fontSize,fill:null!=(o=t.fill)?o:e.fill,stroke:null!=(a=t.stroke)?a:e.stroke,strokeWidth:null!=(i=t.strokeWidth)?i:e.strokeWidth,letterSpacing:null!=(s=un(t.letterSpacing))?s:e.letterSpacing,wordSpacing:null!=(l=un(t.wordSpacing))?l:e.wordSpacing}}function dn(t){var e,n,r;return{fontFamily:cn(t.fontFamily),fontSize:null!=(e=un(t.fontSize))?e:16,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(n=un(t.letterSpacing))?n:0,wordSpacing:null!=(r=un(t.wordSpacing))?r:0}}function hn(t){const e={};return void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),e}function pn(t,e,n,r){var o;const a=t.fontFamily?e[t.fontFamily]:n;return a||null==r||r.push('textGlyphs: no glyphs for font "'+(null!=(o=t.fontFamily)?o:"")+'"'),a}function mn(t){const e=Object.keys(t);return 1===e.length?t[e[0]]:void 0}function yn(t,e){var n,r,o,a;const{glyphs:i,create:s=en,warnings:l}=e,u=mn(i),c={x:null!=(n=un(t.x))?n:0,y:null!=(r=un(t.y))?r:0},f=[],d=[{start:c.x,end:c.x}];let h=0;const p=(t,e)=>{const n=pn(e,i,u,l);if(!n)return;const r=e.fontSize/n.unitsPerEm,o=hn(e);for(let a=0;a<t.length;a++){const i=t.charAt(a),s=n.glyphs[i];s&&s.d&&f.push({glyphD:s.d,m:[r,0,0,r,c.x,c.y],paint:o,line:h,x:c.x,y:c.y,scale:r}),c.x+=(s?s.width:0)*r+e.letterSpacing+(" "===i?e.wordSpacing:0),d[h].end=c.x}},m=(t,e)=>{var n,r,o,a;const i=fn(t,e),s=un(t.x),l=un(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=un(t.dx))?n:0,c.y+=null!=(r=un(t.dy))?r:0;const u=null!=(o=cn(t[q]))?o:cn(t[G]);if(u&&!(null==(a=t.children)?void 0:a.length)&&p(u,i),t.children)for(const e of t.children)m(e,i)},y=dn(t);if(t.children)for(const e of t.children)m(e,y);const v=null!=(o=cn(t[q]))?o:cn(t[G]);v&&!(null==(a=t.children)?void 0:a.length)&&p(v,y);const g=cn(t.textAnchor);if("middle"===g||"end"===g)for(const t of f){const e=d[t.line].end-d[t.line].start,n="middle"===g?-e/2:-e;t.m=[t.scale,0,0,t.scale,t.x+n,t.y]}return xn(t,jn(f,s,l),s)}function vn(t,e,n,r){const{x:o,y:a,angle:i}=t.sampleAtDistance(e),s=Math.cos(i),l=Math.sin(i),u=r/2;return[n*s,n*l,-n*l,n*s,o-n*s*u,a-n*l*u]}function gn(t,e,n,r,o,a){var i;const{glyphs:s,create:c=en,warnings:d}=r,h=e?Qe(e):null;if(!h)return null==d||d.push("textGlyphs: unparsable along-path geometry"),null;const p=mn(s),{cells:m,width:y}=function(t,e,n,r){const o=[];let a=0;const i=(t,s)=>{var l,u;const c=fn(t,s),f=null!=(l=cn(t[q]))?l:cn(t[G]);if(f&&!(null==(u=t.children)?void 0:u.length)){const t=pn(c,e,n,r);if(t){const e=c.fontSize/t.unitsPerEm,n=hn(c);for(let r=0;r<f.length;r++){const i=f.charAt(r),s=t.glyphs[i],l=(s?s.width:0)*e;s&&s.d&&o.push({glyphD:s.d,widthEm:s.width,scale:e,paint:n,midBase:a+l/2}),a+=l+c.letterSpacing+(" "===i?c.wordSpacing:0)}}}if(t.children)for(const e of t.children)i(e,c)};return i(t,dn(t)),{cells:o,width:a}}(t,s,p,d);if(!m.length)return xn(t,[],c);if(o&&o>0&&y>0){const t=o/y;for(const e of m)e.midBase*=t}const v="clip"===a&&!h.closed,g=f(n);if("animated"===g.kind&&g.keyframes.length>=2)return xn(t,function(t,e,n,r,o,a){const i=Math.max(e.totalLength/bn,.5),s=t=>Number(t.time)||0,c=t=>Number(t.value)||0,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=sn(h.glyphD,t),m=(t,n)=>{const{x:r,y:o,angle:a}=e.sampleAtDistance(t);return{time:n,value:{translate:[An(r,3),An(o,3)],rotate:An(180*a/Math.PI,3)}}},y=[],v=[],g=(t,e)=>{y.push(m(t,e)),a&&v.push({time:e,value:f(t)?1:0})};g(c(n[0])+h.midBase,s(n[0]));for(let t=1;t<n.length;t++){const e=s(n[t-1]),r=s(n[t]),o=c(n[t-1]),a=c(n[t]),l=Math.min(kn,Math.max(1,Math.ceil(Math.abs(a-o)/i)));for(let t=1;t<=l;t++){const n=t/l;g(o+n*(a-o)+h.midBase,e+n*(r-e))}}const b={keyframes:y};void 0!==r&&(b.loop=r);const k={transform:b};if(a&&v.some(t=>0===t.value)){const t={keyframes:v};void 0!==r&&(t.loop=r),k.opacity=t}d.push(o("path",u(l({d:p},wn(h.paint)),{animate:k}),[]))}return d}(m,h,g.keyframes,g.loop,c,v),c);const b="animated"===g.kind?Number(null==(i=g.keyframes[0])?void 0:i.value)||0:"static"===g.kind&&Number(g.value)||0;return xn(t,jn((v?m.filter(t=>{const e=b+t.midBase;return e>=0&&e<=h.totalLength}):m).map(t=>({glyphD:t.glyphD,paint:t.paint,m:vn(h,b+t.midBase,t.scale,t.widthEm)})),c,d),c)}var bn=48,kn=64;function An(t,e){const n=i(10,e);return Math.round(t*n)/n}function wn(t){const e={};return void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),e}function jn(t,e,n){var r,o,a;if(!t.length)return null==n||n.push("textGlyphs: nothing to render"),[];const i=new Map;for(const e of t){const t=JSON.stringify([null!=(r=e.paint.fill)?r:null,null!=(o=e.paint.stroke)?o:null,null!=(a=e.paint.strokeWidth)?a:null]),n=sn(e.glyphD,e.m),s=i.get(t);s?s.d+=n:i.set(t,{paint:e.paint,d:n})}const s=[];for(const{paint:t,d:n}of i.values())s.push(e("path",l({d:n},wn(t)),[]));return s}function xn(t,e,n){const r={};for(const e of Object.keys(t))"type"!==e&&"children"!==e&&-1===ln.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 On(t,e){return e.alongPath?gn(t,e.alongPath.pathD,e.alongPath.startOffset,e,e.alongPath.textLength,e.alongPath.pathOverflow):yn(t,e)}function Sn(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 Pn(t){var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0}function Mn(t){var e;return null!=(e=t.easing)?e:t.e}function _n(t){var e,n,r;const o=null!=(e=t.keyframes)?e:t.kfs;if(!Array.isArray(o))return!1;if(t.autoOrient)return!0;for(const t of o)if((null!=(n=t.tangentIn)?n:t.ti)||(null!=(r=t.tangentOut)?r:t.to))return!0;return!1}var zn=new WeakMap;function In(t,e,n,r){var o,a;const i=zn.get(t);if(i)return i;const s=null!=(o=t.tangentOut)?o:t.to,l=null!=(a=e.tangentIn)?a:e.ti,u=[n[0]+(s?s[0]:0),n[1]+(s?s[1]:0)],c=[r[0]+(l?l[0]:0),r[1]+(l?l[1]:0)],f=qe(n,u,c,r),d={P0:n,P1:u,P2:c,P3:r,lut:f,totalArc:f.ds[f.ds.length-1]};return zn.set(t,d),d}function Cn(t,e,n,r,o,a){const i=In(t,e,n,r),s=0===i.totalArc?o:function(t,e){const n=t.ds[t.ds.length-1],r=e*n,{ts:o,ds:a}=t,i=a.length-1;if(r<=0)return o[0];if(r>=a[i])return o[i];let s=1,l=i;for(;s<l;){const t=s+l>>>1;a[t]<r?s=t+1:l=t}const u=a[l-1],c=a[l]-u,f=c>0?(r-u)/c:0;return o[l-1]+f*(o[l]-o[l-1])}(i.lut,o),l=De(i.P0,i.P1,i.P2,i.P3,s);if(!a)return{translate:l};const u=Re(i.P0,i.P1,i.P2,i.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}function Nn(t,e){var n,r,o,a;if(!_n(t))return t;const i=null!=(n=t.keyframes)?n:t.kfs;if(!Array.isArray(i)||i.length<2)return t;const s=!!t.autoOrient,l=null!=(r=null==e?void 0:e.flatnessTolerance)?r:.5,u=null!=(o=null==e?void 0:e.rotationTolerance)?o:5,c=null!=(a=null==e?void 0:e.maxSamplesPerSegment)?a:32,f=[],d=Sn(i[0]);if(!d)return t;const h=s?function(t,e){const n=Sn(t),r=Sn(e);if(!n||!r)return 0;const o=In(t,e,n,r),a=Re(o.P0,o.P1,o.P2,o.P3,0);return 180*Math.atan2(a[1],a[0])/Math.PI}(i[0],i[1]):void 0;f.push(Tn(Pn(i[0]),Fn(En(i[0]),En(i[0]),0,d,h,s)));for(let t=0;t<i.length-1;t++){const e=i[t],n=i[t+1],r=Sn(e),o=Sn(n);r&&o?(s&&t>0&&Un(f,e,n,r,o,u),Vn(f,e,n,r,o,s,l,u,c)):f.push(Tn(Pn(n),Fn(En(n),En(n),1,null!=o?o:[0,0],void 0,s)))}const p=Mn(i[i.length-1]);p&&(f[f.length-1].e=p),s&&function(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}}(f);const m={kfs:f};return void 0!==t.loop&&(m.loop=t.loop),m}function Tn(t,e){return{t:t,v:e}}function En(t){var e;const n=null!=(e=t.value)?e:t.v;if(n&&"object"==typeof n&&!Array.isArray(n))return n}function Ln(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 a="number"==typeof t[o]?t[o]:0,i="number"==typeof e[o]?e[o]:0;r[o]=a+(i-a)*n}return r}return n<.5?t:e}function Fn(t,e,n,r,o,a){const i={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&&a)continue;const o=null==t?void 0:t[r],s=null==e?void 0:e[r];void 0===o&&void 0===s||(i[r]=Ln(o,s,n))}return void 0!==o&&(i.rotate=o),i}function Un(t,e,n,r,o,a){var i;const s=t[t.length-1],l=null!=(i=s.v)?i:s.value,u=null==l?void 0:l.rotate;if("number"!=typeof u)return;const c=In(e,n,r,o),f=Re(c.P0,c.P1,c.P2,c.P3,0),d=180*Math.atan2(f[1],f[0])/Math.PI,h=function(t,e){let n=t-e;for(;n>180;)n-=360;for(;n<-180;)n+=360;return n}(d,u);if(Math.abs(h)<=a)return;const p=Fn(En(e),En(e),0,r,d,!0);t.push(Tn(Pn(e),p))}function Vn(t,e,n,r,o,a,i,s,l){const u=In(e,n,r,o),c=Pn(e),f=Pn(n),d=Mn(e),h=(p=d)?xe([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=En(e),y=En(n),v=function(t,e,n,r,o){const a=[];Dn(t.P0[0],t.P1[0],t.P2[0],t.P3[0],a),Dn(t.P0[1],t.P1[1],t.P2[1],t.P3[1],a),a.sort((t,e)=>t-e);const i=[0];for(const t of a)t>i[i.length-1]+1e-6&&t<.999999&&i.push(t);i.push(1);const s=[],l={remaining:o-i.length};for(let o=0;o<i.length-1;o++)Wn(i[o],i[o+1],s,t,e,n,r,l);return s}(u,a,i,s,l),g=[];for(const t of v){const e=Ge(u.lut,t),n=Ve(u.totalArc>0?e/u.totalArc:t,0,1),r={u:Ve(h(n),0,1),p:n,pos:De(u.P0,u.P1,u.P2,u.P3,t)};if(a){const e=Re(u.P0,u.P1,u.P2,u.P3,t);r.rotateDeg=180*Math.atan2(e[1],e[0])/Math.PI}g.push(r)}let b=d,k=0;const A=t.length-1;for(let e=0;e<g.length;e++){const n=g[e],r=k<1?Ve((n.u-k)/(1-k),0,1):1,{left:o,right:i}=Se(b,r),s=0===e?A:t.length-1;o?t[s].e=o:delete t[s].e;const l=c+n.u*(f-c),u=Fn(m,y,n.p,n.pos,n.rotateDeg,a);t.push(Tn(l,u)),b=i,k=n.u}}function Dn(t,e,n,r,o){const a=e-t,i=n-e,s=a-2*i+(r-n),l=2*(i-a),u=a;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 Wn(t,e,n,r,o,a,i,s){const l=(t+e)/2,u=De(r.P0,r.P1,r.P2,r.P3,t),c=De(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=De(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=De(r.P0,r.P1,r.P2,r.P3,l),p=De(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(Rn(d,u,c),Rn(h,u,c),Rn(p,u,c));let y=!0;if(o){const n=Re(r.P0,r.P1,r.P2,r.P3,t),o=Re(r.P0,r.P1,r.P2,r.P3,e),a=180*Math.atan2(n[1],n[0])/Math.PI,s=180*Math.atan2(o[1],o[0])/Math.PI;let l=Math.abs(a-s);l>180&&(l=360-l),l>i&&(y=!1)}m<=a&&y||s.remaining<=0||f<1e-6?n.push(e):(s.remaining-=1,Wn(t,l,n,r,o,a,i,s),Wn(l,e,n,r,o,a,i,s))}function Rn(t,e,n){const r=n[0]-e[0],o=n[1]-e[1],a=r*r+o*o;if(a<1e-20){const n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}const i=(t[0]-e[0])*o-(t[1]-e[1])*r;return Math.abs(i)/Math.sqrt(a)}function Bn(t,e){const n=qn(t,e);return null!=n?n:t}function qn(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=qn(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&&_n(n)){const o=Nn(n,e);o!==n&&(r=u(l({},t),{transform:o}))}}if(!n&&!r)return null;const a=l({},t);return n&&(a.children=n),r&&(a.animate=r),a}function Gn(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,a=o[3]||0,i=o[4]||0,s=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([i,s]),n.i.push([r,a]),n.o.push([i,s])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function Kn(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function Zn(t){return"string"==typeof t&&void 0!==Kn(t)}function Qn(t){if(t&&"object"==typeof t&&"string"==typeof t.path){const e=Kn(t.path);return e?{paths:Gn(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&Zn(e[0])){const t=[];for(const n of e){const e=Kn(n);e&&t.push(...Gn(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&Zn(t[0])){const e=[];for(const n of t){const t=Kn(n);t&&e.push(...Gn(t))}return{paths:e}}return{paths:t}}if(Zn(t)){return{paths:Gn(Kn(t))}}return t}function Jn(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 Xn(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 Yn(t,e,n,r){var o,a;if("d"===t){return{paths:Ae(null!=(o=null==e?void 0:e.paths)?o:Array.isArray(e)?e:[],null!=(a=null==n?void 0:n.paths)?a:Array.isArray(n)?n:[],r)}}return ze.has(t)?ke(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?ge(e,n,r):Ie.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?be(e||[],n||[],r):ge(+(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 a of r){const r=null==t?void 0:t[a],i=null==e?void 0:e[a];if("rotate"===a)o[a]=ge(+(null!=r?r:0),+(null!=i?i:0),n);else if("translate"===a||"scale"===a||"origin"===a){const t="scale"===a?[1,1]:[0,0];o[a]=be(r||t,i||t,n)}else o[a]=null!=i?i:r}return o}(e,n,r)}function Hn(t,e,n,r){var o,a,i,s,l;const u=e.length-1,c=Ve(null!=(o=n.segmentCount)?o:u,1,u);let f;f=n.before?e.slice(0,c+1):e.slice(u-c);const d=null!=(a=e[0].t)?a:0,h=null!=(i=e[e.length-1].t)?i:0;let p,m;n.before?(p=0,m=d):(p=h,m=r);const y=m-p;if(y<=0)return e;const v=null!=(s=f[0].t)?s:0,g=(null!=(l=f[f.length-1].t)?l:0)-v;if(g<=0)return e;const b=f.map(t=>{var e,n;return{relT:(t.t-v)/g,v:t.v,e:t.e,tangentIn:null!=(e=t.tangentIn)?e:t.ti,tangentOut:null!=(n=t.tangentOut)?n:t.to}}),k=Math.floor(y/g),A=y-k*g,w=A/g,j=[];function x(e,n,r){let o;if(n){o=[];for(let t=b.length-1;t>=0;t--)o.push({relT:1-b[t].relT,v:b[t].v,e:t>0?Pe(b[t-1].e):void 0,tangentIn:b[t].tangentOut,tangentOut:b[t].tangentIn})}else o=b;const a=void 0!==r?r:1;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT>a+1e-9){const i=o[n-1],s=r.relT-i.relT,l=(a-i.relT)/s,u=i.e?xe(i.e)(l):l,c=Yn(t,i.v,r.v,u),{left:f}=Se(i.e,l);return j.length>0&&i.relT<=a&&(j[j.length-1].e=f),void j.push({t:e+a*g,v:c,e:void 0})}const i={t:e+r.relT*g,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(i.tangentIn=r.tangentIn),r.tangentOut&&(i.tangentOut=r.tangentOut),j.push(i)}}if(n.before){if(w>1e-9){!function(e,n,r){let o;if(n){o=[];for(let t=b.length-1;t>=0;t--)o.push({relT:1-b[t].relT,v:b[t].v,e:t>0?Pe(b[t-1].e):void 0,tangentIn:b[t].tangentOut,tangentOut:b[t].tangentIn})}else o=b;const a=1-r;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT<a-1e-9)continue;const i=o[n-1];if(i&&i.relT<a-1e-9&&r.relT>a+1e-9){const n=r.relT-i.relT,o=(a-i.relT)/n,s=i.e?xe(i.e)(o):o,l=Yn(t,i.v,r.v,s),{right:u}=Se(i.e,o);j.push({t:e,v:l,e:u})}const s={t:e+(r.relT-a)*g,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),j.push(s)}}(p,!!n.alternate&&k%2==0,w)}for(let t=0;t<k;t++){const e=k-1-t,r=!!n.alternate&&e%2==0;x(p+A+t*g,r)}}else{for(let t=0;t<k;t++){const e=!!n.alternate&&t%2==0;x(p+t*g,e)}if(w>1e-9){const t=!!n.alternate&&k%2==0;x(p+k*g,t,w)}}return n.before?[...j,...e]:[...e,...j]}function $n(t,e,n,r){var o,a,i,s,l,u,c;const f=e.keyframes||e.kfs||[],d=[];for(const e of f){const n=null!=(a=null!=(o=e.time)?o:e.t)?a:0;let f=null!=(i=e.value)?i:e.v;const h=null!=(s=e.easing)?s:e.e;"d"===t&&(f=Qn(f));const p=Le(t)?Ue(t):t;ze.has(p)&&(f=null!=(l=_e(f))?l:f);const m={t:n,v:f,e:Jn(h,r)},y=null!=(u=e.tangentIn)?u:e.ti,v=null!=(c=e.tangentOut)?c:e.to;y&&(m.tangentIn=y),v&&(m.tangentOut=v),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?Hn(t,d,p,n):d}function tr(t,e,n){var r;const o=e.loop;if(null==o||!1===o)return e;const a=!0===o?{}:o,i=null!=(r=e.keyframes)?r:e.kfs;if(!Array.isArray(i)||i.length<2)return e;const s=Le(t)?Ue(t):t,l=ze.has(s),u=i.map(e=>{var n,r,o,a,i,s,u,c;const f=null!=(n=e.t)?n:e.time;let d=null!=(r=e.v)?r:e.value;"d"===t&&(d=Qn(d)),l&&(d=null!=(o=_e(d))?o:d);const h={t:f,v:d,e:null!=(a=e.e)?a:e.easing};return(null!=(i=e.tangentIn)?i:e.ti)&&(h.tangentIn=null!=(s=e.tangentIn)?s:e.ti),(null!=(u=e.tangentOut)?u:e.to)&&(h.tangentOut=null!=(c=e.tangentOut)?c:e.to),h}),c={kfs:Hn(t,u,a,n)};return void 0!==e.autoOrient&&(c.autoOrient=e.autoOrient),c}function er(t,e){const n=nr(t,e);return null!=n?n:t}function nr(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=nr(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],a=tr(n,o,e);a!==o&&(r||(r=l({},t)),r[n]=a)}}if(!n&&!r)return null;const a=l({},t);return n&&(a.children=n),r&&(a.animate=r),a}var rr=0;function or(t,e=B.webapi){const n=Et(t)||{},r=Lt(t),o=n.duration||1e3,a=[],i=(t,n)=>{if(!n)return null;const a=function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=Xn(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=Xn(r,e);t&&n.push(t)}else n.push(t);return n}(n,r);if(0===a.length)return null;const i=function(t,e,n,r=B.webapi){const o={};for(const[a,i]of Object.entries(t)){const t=$n(a,i,e,n);if(t.length>0){const e={kfs:t};void 0!==i.autoOrient&&(e.autoOrient=i.autoOrient),void 0!==i.loop&&(e.loop=i.loop),o[a]=r===B.webapi&&"transform"===a?Nn(e):e}}return o}(function(t){const e={};for(const n of t)for(const[t,r]of Object.entries(n))e[t]=r;return e}(a),o,r,e);return 0===Object.keys(i).length?null:{id:t,animate:i}},s=Ft(t);if(s)for(const t of s){const e=i(t.id,t.animate);e&&a.push(e)}const l=t=>{const e=t.animate;if(e&&Object.keys(e).length>0){const n=t.id||"_px_el_"+ ++rr;t.id=n;const r=i(n,e);r&&a.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 a}function ar(t,e,n){var r,o,a,i,s,l,u;const c=e.kfs||e.keyframes||[];if(0===c.length)return null;const{prevKf:f,nextKf:d}=function(t,e){var n,r;let o=t[0],a=t[t.length-1];for(let i=0;i<t.length-1;i++){const s=null!=(n=t[i].t)?n:0,l=null!=(r=t[i+1].t)?r:0;if(s<=e&&e<=l){o=t[i],a=t[i+1];break}}return{prevKf:o,nextKf:a}}(c,n);let h=f===d?0:(p=n,m=null!=(r=f.t)?r:0,y=null!=(o=d.t)?o:0,v=0,g=1,y===m?v:v+(p-m)/(y-m)*(g-v));var p,m,y,v,g;h=Ve(h,0,1);const b=null!=(a=f.e)?a:f.easing;if(b&&Array.isArray(b))try{h=xe(b)(h)}catch(t){}let k=Le(t)?Ue(t):t,A=null;const w=null!=(i=null==f?void 0:f.v)?i:null==f?void 0:f.value,j=null!=(s=null==d?void 0:d.v)?s:null==d?void 0:d.value;if("d"===k){A=Ae(null!=(l=null==w?void 0:w.paths)?l:Array.isArray(w)?w:[],null!=(u=null==j?void 0:j.paths)?u:Array.isArray(j)?j:[],h).map(t=>ve(t)).join("")}else if(ze.has(k))A=Me(ke(w||[0,0,0,1],j||[0,0,0,1],h)),k=t;else if("stroke-dasharray"===k)A=be(w||[],j||[],h).join(" "),k=t;else if("transform"!==k||null===w||"object"!=typeof w||Array.isArray(w))if("translate"===k){A="translate("+be(w||[0,0],j||[0,0],h).join(",")+")",k="transform"}else if("rotate"===k){A="rotate("+ge(+(w||0),+(j||0),h)+")",k="transform"}else if("scale"===k){A="scale("+be(w||[1,1],j||[1,1],h).join(",")+")",k="transform"}else{A=ge(+(w||0),+(j||0),h)}else{const t=new Set([...w?Object.keys(w):[],...j?Object.keys(j):[]]),n={};for(const e of t){const t=null==w?void 0:w[e],r=null==j?void 0:j[e];if("rotate"===e)n.rotate=ge(+(null!=t?t:0),+(null!=r?r:0),h);else if("translate"===e||"scale"===e||"origin"===e){const o="scale"===e?[1,1]:[0,0],a=be(t||o,r||o,h);n[e]=a}}if(_n(e)){const t=w.translate,r=j.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=Cn(f,d,[+t[0],+t[1]],[+r[0],+r[1]],h,!!e.autoOrient);n.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(n.rotate=o.rotateDeg)}}A=Ne(n,{withUnits:!1}),k="transform"}return Ce.has(k)&&"number"==typeof A&&(A=100*A+"%"),{k:k,v:null===A?"":""+A}}function ir(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=ar(r,o,e);t&&(n[t.k]=t.v)}return n}function sr(t,e,n,r){if(!e)return t;const o=!!e.trimAllAsOne,a=[],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;if("rect"!==t.type)return;const a=Number(null!=(e=t.x)?e:0),i=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"+(a+s)+","+i+"L"+(a+s)+","+(i+l)+"L"+a+","+(i+l)+"L"+a+","+i+"L"+(a+s)+","+i+"z"}(t);if(void 0===e)return;const n=Gn(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){const e=kr(t);r.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}a.push(r)};if(i(t),!a.length)return t;let s=0;const c=o?[...a].reverse():a;for(const t of c)for(const e of t.subpaths)o||(s=0),e.startOffsetPx=s,s+=e.lengthPx;const d=s;if(o&&d<.001)return t;const h=f(e.offset),p="absent"===h.kind?{kind:"static",value:0}:h,m=function(t){const e=f(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=gr(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),a=[];let i=0;for(const t of n){for(;i<o.length&&o[i]<t.time;){const t=o[i++],e=br(n,t),r=(e[0]+e[1])/2;a.push({time:t,value:[r,r]})}const e=t.value[0]>t.value[1]?[t.value[1],t.value[0]]:t.value;a.push({time:t.time,value:e,easing:t.easing})}for(;i<o.length;){const t=o[i++],e=br(n,t),r=(e[0]+e[1])/2;a.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:a}}(e.range),y="absent"===m.kind?{kind:"static",value:[0,1]}:m,v=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}(p),g=[v.length?Math.min(...v):0,v.length?Math.max(...v):0];if(1===a.length&&a[0].leaf===t&&1===a[0].subpaths.length){const e=a[0],n=e.subpaths[0],r=o?d:n.lengthPx;if(r<.001)return t;const i=o?n.startOffsetPx/r:0;return function(t,e,n,r,o,a){const i=fr(n,e,r),s=dr(e,r),u=l({},t);return delete u.effects,mr(u,"strokeDasharray",pr(a,s)),mr(u,"strokeDashoffset",pr(o,i)),mr(u,"strokeOpacity",vr(a)),u}(e.leaf,r,i,g,p,y)}const b=new Map;for(const t of a){const e=[];for(const n of t.subpaths){const a=o?d:n.lengthPx;if(a<.001)continue;const i=o?n.startOffsetPx/a:0;e.push(...ur(t.leaf,n.subpath,a,i,g,p,y,r))}b.set(t.leaf,lr(t.leaf,e))}const k=t=>{const e=b.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?u(l({},t),{children:t.children.map(k)}):t)};return k(t)}function lr(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 ur(t,e,n,r,o,a,i,s){const l=fr(r,n,o),u=dr(n,o),c=pr(a,l),f=pr(i,u),d=vr(i),h=function(t){return{type:"path",d:t}}(ve(e));return mr(h,"strokeDasharray",f),mr(h,"strokeDashoffset",c),mr(h,"strokeOpacity",d),[h]}var cr=1;function fr(t,e,n){const[r]=hr(n);return n=>e*(-n-r+t)+cr}function dr(t,e){const[n,r]=hr(e),o=r-n+1;return e=>{const n=Ve(e[0],0,1),r=Ve(e[1],0,1),a=Math.min(n,r),i=Math.max(n,r),s=[0];let l=cr;for(let e=0;e<o;e++)s.push(l+a*t),s.push((i-a)*t),l=(1-i)*t;return s.push(l+cr),s}}function hr(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function pr(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,a;return{time:null!=(r=null!=(n=t.time)?n:t.t)?r:0,value:e(null!=(o=t.value)?o:t.v),easing:null!=(a=t.easing)?a:t.e}}),loop:t.loop}}function mr(t,e,n){var r,o;if(!n)return;if("static"===n.kind)return void(t[e]=n.value);const a=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,i=l({},a||{}),s={keyframes:n.keyframes};void 0!==n.loop&&(s.loop=n.loop),i[e]=s,t.animate=i;const u=n.keyframes[0];u&&void 0!==(null!=(r=u.value)?r:u.v)&&(t[e]=null!=(o=u.value)?o:u.v)}var yr=10;function vr(t){var e,n,r,o,a,i;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!=(a=u.value)?a:u.v):h,m=c?h&&s(null!=(i=c.value)?i:c.v):h;p&&!m?(f.push({time:d,value:0}),f.push({time:d+yr,value:1})):!p&&m&&(f.push({time:d-yr,value:1}),f.push({time:d,value:0}))}return f.length<=1?void 0:{kind:"animated",keyframes:f}}function gr(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,a=n(r);if(0===a)return r;const i=n(o);if(0===i)return o;if(a*i>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;a*e<0?o=t:(r=t,a=e)}return(r+o)/2}function br(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],a=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*a,r.value[1]+(o.value[1]-r.value[1])*a]}return t[t.length-1].value}function kr(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+=Ar(t,r,r+1);return t.c&&e.length>1&&(n+=Ar(t,e.length-1,0)),n}function Ar(t,e,n){var r,o,a,i;const s=t.v,l=s[e],u=s[n],c=qe(l,null!=(o=null==(r=t.o)?void 0:r[e])?o:l,null!=(i=null==(a=t.i)?void 0:a[n])?i:u,u);return c.ds[c.ds.length-1]}function wr(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:(null==(e=Et(t))?void 0:e.mode)===R.frames?B.frames:B.webapi,glyphs:null==(n=Lt(t))?void 0:n.glyphs},o=Kt(t);Gt(o,r.idMap),y(o,r,()=>Bt(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,a;const i=null==(a=null==(o=t.effects)?void 0:o.maskedBy)?void 0:a.href;if("string"==typeof i){n.add(t);const r=e.idMap.get(i);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=ae(t,e),a=n?[...r,n]:r;for(const e of t.children)o(e,a)}};o(t,[])}(o,r);const a=function(t,e){return function(t,e){e.idMap.clear(),Gt(t,e.idMap);const n=[],r=t=>{var e;fe(t)&&n.push(t),null==(e=t.children)||e.forEach(r)};r(t);for(const t of n){const n=fe(t);n&&(de(t),he(t,ue(n),e))}}(t,e),t}(jr(o,r),r);return function(t,e){if(!e.length)return;(t.children||(t.children=[])).unshift({type:"defs",children:e})}(a,r.defs),{root:a,defs:r.defs,warnings:r.warnings,errors:r.errors}}function jr(t,e){var n;t.children&&(t.children=t.children.map(t=>jr(t,e)));const r=t.effects,o="string"==typeof t.id?t.id:void 0,a=o?e.contentRefInnerIds.get(o):void 0;if(!r&&!a)return t;const{transformation:i,repeater:s,maskedBy:l,trimPath:u,clone:c,fillGradient:f,strokeGradient:d,textPath:p,text:m}=null!=r?r:{};null==r||r.isCombinedShape;r&&delete t.effects;let y=t,g=!1;if(null==m?void 0:m.useGlyphs)if(p){const t="string"==typeof p.path?p.path:void 0,r=p.textLength,o="number"==typeof r?r:r&&"object"==typeof r?"number"==typeof r.value?r.value:Array.isArray(r.keyframes)&&r.keyframes.length?Number(null==(n=r.keyframes[0])?void 0:n.value):void 0:void 0,a=function(t,e,n,r,o,a){return e.glyphs?gn(t,n,r,{glyphs:e.glyphs,warnings:e.warnings},o,a):(e.warnings.push("textGlyphs: no definitions.glyphs"),null)}(y,e,t,p.startOffset,o,p.pathOverflow);a&&(y=a,g=!0)}else y=function(t,e,n){return(null==e?void 0:e.useGlyphs)?n.glyphs?yn(t,{glyphs:n.glyphs,warnings:n.warnings}):(n.warnings.push("textGlyphs: no definitions.glyphs — left as native <text>"),t):t}(y,m,e),g=!0;return g||(y=function(t,e,n){var r;if(!e||"string"!=typeof e.path||!e.path)return t;const o=Bt(n,"tpath"),{d:a,startShift:i}=$e(e.path,{pathOverflow:e.pathOverflow,startOffset:e.startOffset,textLength:e.textLength,advance:Xe(t)});n.defs.push({type:"path",id:o,d:a});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),tn(s,"startOffset",He(e.startOffset,i)),tn(s,"textLength",e.textLength),t.children=[s],t}(y,p,e)),y=function(t,e,n){return Zt(t,e,n,"fill")}(y,f,e),y=function(t,e,n){return Zt(t,e,n,"stroke")}(y,d,e),y=sr(y,u,0,e),y=function(t,e,n){var r,o;if(!e)return t;const a=null!=(r=e.copies)?r:1;if(a<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const i=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=Kt(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate);const u=[l];for(let t=1;t<a;t++){const r=Kt(l),o=le(e,t),a=o?h(r,o,n):r;u.push(a)}const c={type:"g",children:u};return void 0!==i&&(c.transform=i),void 0!==s&&(c.animate={transform:s}),c}(y,s,e),y=Yt(y,l,i,e),a?(se(y,c,e),y=v(y,i,o,a,e)):y=function(t,e,n,r){return se(t,e,r),h(t,n,r)}(y,c,i,e),(null==c?void 0:c.retime)&&(t.effects={clone:{retime:c.retime}}),o&&e.idMap.set(o,y),y}function xr(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 a=n.get(t);if(void 0!==a)return a;if(r.has(t))return!1;r.add(t);let i=!1;if(t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate))for(const e in t.animate){i=!0;break}if(!i&&t.children)for(const e of t.children)if(o(e,r)){i=!0;break}if(!i&&"use"===t.type&&"string"==typeof t.href){const n=Sr(t.href),a=n?e.get(n):void 0;a&&(i=o(a,r))}return r.delete(t),n.set(t,i),i};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 a=function(t){const e=Mr(t.viewBox);if(e)return[e[2],e[3]];const n=Or(t.width),r=Or(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),i=[],s=_r(t,n,r,()=>"_lw_use_mat_"+ ++o,i,a);if(0===i.length)return s;const c={type:"defs",children:i},f=[...null!=(e=s.children)?e:[],c];return u(l({},s),{children:f})}function Or(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function Sr(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function Pr(t,e,n,r,o,a,i){var s,c,f,d;const h=Vt(e);Dt(h,o);const p="symbol"===h.type?Mr(h.viewBox):void 0,m=null!=(c=null!=(s=Or(t.width))?s:null==p?void 0:p[2])?c:i[0],y=null!=(d=null!=(f=Or(t.height))?f:null==p?void 0:p[3])?d:i[1],v="symbol"===h.type?function(t,e,n,r,o){const a=Mr(t.viewBox),i=u(l({},t),{type:"g"});if(delete i.viewBox,delete i.preserveAspectRatio,delete i.width,delete i.height,!a)return i;const[s,c,f,d]=a,h=f>0&&d>0?Math.min(r/f,o/d):1,p=(r-f*h)/2,m=(o-d*h)/2,y=[];0===p&&0===m||y.push("translate("+p+","+m+")");1!==h&&y.push("scale("+h+")");0===s&&0===c||y.push("translate("+-s+","+-c+")");y.length&&(i.transform=y.join(""));const v=e();return n.push({type:"clipPath",id:v,children:[{type:"rect",x:s,y:c,width:f,height:d}]}),i.clipPath="url(#"+v+")",i}(h,o,a,m,y):h,g=_r(v,n,r,o,a,i),b=u(l({},t),{type:"g",children:[g]});return delete b.href,delete b.width,delete b.height,Rt(b)}function Mr(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 _r(t,e,n,r,o,a){if("use"===t.type&&"string"==typeof t.href){const i=Sr(t.href);if(i&&n.has(i)){const s=e.get(i);if(s)return Pr(t,s,e,n,r,o,a)}}if(!t.children)return t;let i=!1;const s=t.children.map(t=>{const s=_r(t,e,n,r,o,a);return s!==t&&(i=!0),s});return i?u(l({},t),{children:s}):t}function zr(t,e,n){var r,o;let a=wr(t).root;return a=er(a,null!=(o=null==(r=Et(a))?void 0:r.duration)?o:1e3),e===B.webapi&&(a=Bn(a,null==n?void 0:n.motionPath),a=xr(a),a=function(t){const e=t=>t.startsWith("#")?t.slice(1):t,n=(t,e)=>{var r;e(t),null==(r=t.children)||r.forEach(t=>n(t,e))};let r=!0;for(;r;){r=!1;const o=new Set;n(t,t=>{"use"===t.type&&"string"==typeof t.href&&o.add(e(t.href))}),n(t,t=>{if(!t.children)return;let e=t.children;"defs"===t.type&&(e=e.filter(t=>!(("g"===t.type||"symbol"===t.type)&&"string"==typeof t.id&&!o.has(t.id)))),e=e.filter(t=>!("defs"===t.type&&(!t.children||0===t.children.length))),e.length!==t.children.length&&(t.children=e,r=!0)})}return t}(a)),a}var Ir=new Set(["script","foreignobject"]),Cr=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),Nr=new Set(["href","xlink:href","src"]),Tr=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,Er=/^data:image\/svg\+xml(?:;[^,]*)?,/i,Lr=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,Fr=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function Ur(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(Cr.has(n)){const t=String(e);return t.startsWith("#")||(/^url\(#[^)]+\)$/.test(t)||Nr.has(n)&&(Tr.test(t)||Er.test(t)||function(t){const e=Lr.exec(t);return!!e&&Fr.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 Vr(t){const e={};for(const n of Object.keys(t)){const r=Ee(n);if(K.has(r))continue;if("style"===r)continue;let o=t[n];ze.has(r)&&Array.isArray(o)?e[r]=Me(o):"transform"===r&&null!==o&&"object"==typeof o&&!Array.isArray(o)&&o.value&&"object"==typeof o.value?e.transform=Ne(o.value,{withUnits:!1}):Ie.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),e.transform=r+"("+o+")"):null!=o&&(e[r]=String(o))}return e}function Dr(t,e){if(!t)return null;const n=t,{type:i,children:s,style:l}=n,u=((t,e)=>{var n={};for(var i in t)o.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&r)for(var i of r(t))e.indexOf(i)<0&&a.call(t,i)&&(n[i]=t[i]);return n})(n,["type","children","style"]),c=Lt(t)||e,f=function(t,e){var n;if(t)return"string"==typeof t?null==(n=null==e?void 0:e.styles)?void 0:n[t]:t}(l,c);let d;if(s)for(const t of s){const e=Dr(t,c);e&&(d||(d=[]),d.push(e))}return function(t,e,n,r,o){if(Ir.has(t.toLowerCase()))return console.warn("SVG tag blocked (dangerous): ",t),null;const a=document.createElementNS("http://www.w3.org/2000/svg",t);for(const t in e){const n=Ur(t,e[t]);void 0!==n&&a.setAttribute(Ue(t),n)}if(n)for(const t in n)a.style[t]=String(n[t]);if(r)for(const t of r)a.appendChild(t);return o&&(a.textContent=o),a}(i||"g",Vr(u),f,d,u[q]||u[G])}function Wr(t,e){const{startOn:n,outAction:r="continue",scrollIntoViewThreshold:o=.5}=e,a=t.getRootElement();if(!a)return console.warn("setupAnimationTriggers: No root element found for animation."),t;const i=()=>{t.play()},s=()=>{switch(r){case"pause":t.pause();break;case"reset":t.cancel();break;case"reverse":t.play()}};switch(n){case"load":{const t=()=>i();"complete"===document.readyState?t():window.addEventListener("load",t,{once:!0});break}case"mouseOver":{const t=()=>i(),e=()=>s();a.addEventListener("mouseenter",t),a.addEventListener("mouseleave",e);break}case"click":{const e=()=>{t.isPlaying()?s():i()};a.addEventListener("click",e);break}case"scrollIntoView":new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&t.intersectionRatio>=o?i():s()})},{threshold:o}).observe(a);break}return t}function Rr(t){return"#"+t}function Br(t,e,n){const r=Et(t)||{},o=or(t,B.frames),a=r.iterations;let i=1;"number"==typeof a&&(i=a||1),"infinite"===a&&(i=1/0),i<1&&(i=1);const s=+(r.duration||1e3),l=s&&i?s*(i===1/0?1/0:i):s?(null!=i?i:1)*s:0,u=r.direction||"normal";let c=null,f=!1,d=r.delay||0,h=0,p=1,m=!1;const y=r.frameRate,v=y&&y>0?1e3/y:0;let g=0;const b=()=>{const t=h?(Date.now()-h)*p:0;let e=d+t;return Number.isFinite(l)&&e>l&&(e=l),e<0&&(e=0),e};function k(t){let n=function(){const e=s>0?s:1;let n=0,r=0;if(s>0){t=Ve(t,0,i*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,i-1);n=Ve((t-r*e)/e,0,1)}else n=t;const o=u||"normal";let a=n;return"reverse"===o?a=1-n:"alternate"===o?r%2==1&&(a=1-n):"alternate-reverse"===o&&r%2==0&&(a=1-n),a}();for(const t of o||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=ir(r,n*s);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}r.delay&&k(b());const A=()=>!!f&&(!!e.isConnected()&&!(Number.isFinite(l)&&b()>=l)),w=t=>{null!==c&&(cancelAnimationFrame(c),c=null),(t||A())&&(c=requestAnimationFrame(()=>{c=null,(()=>{var t;if(!e.isConnected())return void j();const r=b();if(v>0){const t=Date.now();if(g&&t-g<v)return;g=t}if(l&&Number.isFinite(l)&&r>=l)return k(l),m||(m=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)),void j();k(r)})(),w()}))},j=()=>{f&&(d=b(),h=0,f=!1,null!==c&&(cancelAnimationFrame(c),c=null),k(d))},x={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>A(),play:()=>{var t;f||(Number.isFinite(l)&&d>=l&&(d=0,m=!1),f=!0,h=Date.now(),w(!0)),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;j(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;j(),d=0,h=0,f=!1,m=!1,k(d),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;d=Number.isFinite(l)?l:b(),h=0,f=!1,k(d),t&&!m&&(m=!0,null==(e=null==n?void 0:n.onFinish)||e.call(n))})(!0)},setPlaybackRate:t=>{if(!isFinite(t)||0===t)return void console.warn("setPlaybackRate: rate must be finite and non-zero");const e=b();p=t,d=e,f&&(h=Date.now())},getCurrentTime:()=>b(),setCurrentTime:t=>{t<0&&(t=0),Number.isFinite(l)&&t>l&&(t=l),d=t,f&&(h=Date.now()),k(b())},destroy:()=>{x.cancel()}};return x}function qr(t,e,n,r){const o=Et(t)||{};if(!r)if(t.id){const e=Rr(t.id);(r=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");let a=Br(t,e||function(t){const e=new Set,n={isConnected:()=>!t||t.isConnected,setAttribute:(n,r,o)=>{r=Ue(r);const a=Rr(n),i=(null==t?void 0:t.querySelectorAll(a))||document.querySelectorAll(a);0!==i.length||e.has(a)||(e.add(a),console.warn('setAttribute: No elements found for selector "'+a+'"'));for(let t=0;t<i.length;t++){const e=i[t];e.setAttribute(r,o),Te.has(r)&&(e.style[r]=o)}}};return n}(r),n);return a=u(l({},a),{getRootElement:()=>r||null}),o.trigger&&Wr(a,o.trigger),a}function Gr(t,e,n,r){var o,a;let i=null!=(o=t.v)?o:t.value;const s=null!=(a=t.e)?a:t.easing,l={offset:e,easing:s&&Array.isArray(s)?"cubic-bezier("+s.join(",")+")":void 0};let u,c=n;return ze.has(n)&&Array.isArray(i)?u=Me(i):"transform"!==n||null===i||"object"!=typeof i||Array.isArray(i)?Ie.has(n)?(Array.isArray(i)&&("translate"===n&&(i=i.map(t=>t+"px")),i=i.join(",")),"rotate"===n&&(i+="deg"),u=n+"("+i+")",c="transform"):u=""+i:(u=Ne(i,{withUnits:!0}),c="transform"),CSS.supports(c,u)||r.add(c),c=Ee(c),l[c]=u,l}function Kr(t,e,n){var r,o,a,i,s;const c=[];for(let f=0;f<e.length;f++){const d=e[f],h=null!=(r=d.t)?r:0;if(h<0){const n=e[f+1];if(n&&(null!=(o=n.t)?o:0)>=0){const e=(0-h)/((null!=(a=n.t)?a:0)-h),r=d.e?xe(d.e)(e):e,{right:o}=Se(d.e,e);c.push({t:0,v:Yn(t,d.v,n.v,r),e:o})}continue}if(h>n){const r=e[f-1];if(r&&(null!=(i=r.t)?i:0)<=n){const e=null!=(s=r.t)?s:0,o=(n-e)/(h-e),a=r.e?xe(r.e)(o):o,{left:i}=Se(r.e,o);c.length>0&&(c[c.length-1]=u(l({},c[c.length-1]),{e:i})),c.push({t:n,v:Yn(t,r.v,d.v,a),e:void 0})}break}c.push(d)}return c}function Zr(t,e,n){var r;const o=new Map;for(const[a,i]of Object.entries(t)){const t=n.duration||1,s=Kr(a,i.kfs||i.keyframes||[],t),c=[];for(let n=0;n<s.length;n++){const o=s[n],i=Gr(o,Ve((null!=(r=o.t)?r:0)/t,0,1),a,e);0===n&&(i.offset||0)>0&&c.push(u(l({},i),{offset:0})),c.push(i)}c.length>0&&(c[c.length-1].offset||0)<1&&c.push(u(l({},c[c.length-1]),{offset:1})),c.length>0&&o.set(a,c)}return o}function Qr(t,e,n,r){var o;const a=Et(t)||{};if(!n)if(t.id){const e=Rr(t.id);(n=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");const i=or(t,B.webapi),s=[],l=a.iterations;let u;"number"==typeof l&&(u=l),"infinite"===l&&(u=1/0);const c=new Set;(null==i?void 0:i.length)||console.warn("createWebApiAnimator: No animation bindings defined");for(const t of i||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("createWebApiAnimator: Empty or unresolved binding",t);continue}const i=Rr(t.id),l=(null==n?void 0:n.querySelectorAll(i))||document.querySelectorAll(i);0===l.length&&console.warn('createWebApiAnimator: No elements found for selector "'+i+'"');const f=Zr(r,c,a),d=a.delay&&a.delay>0?a.delay:void 0,h=a.delay&&a.delay<0&&a.duration?-a.delay%a.duration:void 0,p={duration:a.duration,delay:d,fill:null!=(o=a.fill)?o:"forwards",direction:a.direction,iterations:u};for(let t=0;t<l.length;t++){const n=l[t];for(const[,t]of f)if(t.length>0)try{const r=new KeyframeEffect(n,t,p),o=new Animation(r,document.timeline);(null==e?void 0:e.onFinish)&&(o.onfinish=()=>{var t;return null==(t=e.onFinish)?void 0:t.call(e)}),(null==e?void 0:e.onRemove)&&(o.onremove=()=>{var t;return null==(t=e.onRemove)?void 0:t.call(e)}),h&&(o.currentTime=h),s.push(o)}catch(t){console.warn(t)}}}if(!r&&c.size)return console.warn("Unsupported CSS attrs: "+[...c].join(", ")),null;const f={isReady:()=>!0,getRootElement:()=>n||null,isPlaying:()=>{var t;return"running"===(null==(t=s[0])?void 0:t.playState)},play:()=>{var t;s.forEach(t=>t.play()),null==(t=null==e?void 0:e.onPlay)||t.call(e)},pause:()=>{var t;s.forEach(t=>t.pause()),null==(t=null==e?void 0:e.onPause)||t.call(e)},cancel:()=>{var t;s.forEach(t=>t.cancel()),null==(t=null==e?void 0:e.onCancel)||t.call(e)},finish:()=>{var t;for(const e of s)try{(null==(t=e.effect)?void 0:t.getTiming().iterations)===1/0?(e.effect.updateTiming({iterations:1}),e.finish(),e.effect.updateTiming({iterations:1/0})):e.finish()}catch(t){e.cancel()}},setPlaybackRate:t=>(s.forEach(e=>e.playbackRate=t),f),getCurrentTime:()=>{var t,e;const n=null!=(e=null==(t=s[0])?void 0:t.currentTime)?e:null;return null!==n?+n:null},setCurrentTime:t=>{s.forEach(e=>{e.currentTime=t})},destroy:()=>{f.cancel(),s.splice(0,s.length)}};return a.trigger&&Wr(f,a.trigger),f}var Jr=0;function Xr(){return"_px_"+Date.now().toString(36)+(++Jr).toString(36)+Math.random().toString(36).substring(2,6)}function Yr(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>Yr(t));const e=t,n={};for(const t of Object.keys(e))n[t]=Yr(e[t]);return n}function Hr(t){var e,n;const r=Yr(t),o=new Map,a=new Set(["href","xlink:href"]),i=new Set(["fill","stroke","clip-path","clipPath","mask","marker","marker-start","marker-mid","marker-end","filter","flood-color","lighting-color"]),s=new Set(["baseId","targetId","boundElementId"]);!function t(e){if(e&&"object"==typeof e){if(e.id&&"string"==typeof e.id){const t=e.id,n=Xr();o.set(t,n),e.id=n}else e.animate&&(e.id=Xr());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(a.has(n)&&r.startsWith("#")){const t=r.slice(1),a=o.get(t);a&&(e[n]="#"+a)}else if(i.has(n))e[n]=$r(r,o);else if(s.has(n)){const t=o.get(r);t&&(e[n]=t)}else r.includes("url(#")&&(e[n]=$r(r,o));else if("style"===n&&"object"==typeof r&&null!==r)for(const[t,e]of Object.entries(r))"string"==typeof e&&(r[t]=$r(e,o));else"object"==typeof r&&null!==r&&t(r);else if(Array.isArray(r))for(const e of r)t(e)}(r);const c=null==(e=r.animator)?void 0:e.animate;if(c&&"object"==typeof c){const t={};for(const[e,r]of Object.entries(c)){t[null!=(n=o.get(e))?n:e]=r}r.animator=u(l({},r.animator),{animate:t})}return r}function $r(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}function to(t,e,n,r){const o=Pt(t);for(const t of o)console.warn("[PxAnimator] effects shape warning:",t);const a=Et(t)||{};a.debug=!0;t=zr(t,a.mode===R.frames?B.frames:B.webapi);let i=null;if(r&&t.children){t=Hr(t);const e="string"==typeof r?document.querySelector(r):r;e&&(i=Dr(t),i&&e.replaceChildren(i))}return function(t,e,n,r){const o=Et(t)||{};let a;return a=o.mode===R.frames?qr(t,e,n,r):Qr(t,n,r,o.mode===R.webapi)||qr(t,e,n,r),o.debugInstName&&(window[o.debugInstName]=a),a}(t,e,n,i)}var eo="data";function no(t){const{src:e,data:n,adapter:r,callbacks:o,container:a}=t;if(void 0!==n&&void 0!==e)throw new Error("createAnimator: provide either `src` or `data`, not both");if(void 0===n&&void 0===e)throw new Error("createAnimator: either `src` or `data` is required");if(void 0!==n)return to(n,r,o,a);let i=null;return fetch(e).then(t=>t.json()).then(t=>{Nt(t)?i=to(t,r,o,a):console.error("Invalid animation document format")}),{isReady:()=>!!i,getRootElement:()=>i?i.getRootElement():null,isPlaying:()=>(null==i?void 0:i.isPlaying())||!1,play:()=>{null==i||i.play()},pause:()=>{null==i||i.pause()},cancel:()=>{null==i||i.cancel()},finish:()=>{null==i||i.finish()},setPlaybackRate:t=>{null==i||i.setPlaybackRate(t)},getCurrentTime:()=>(null==i?void 0:i.getCurrentTime())||0,setCurrentTime:t=>{null==i||i.setCurrentTime(t)},destroy:()=>{null==i||i.destroy()}}}function ro(){const t=document.querySelectorAll("["+D+"]");for(let e=0;e<t.length;e++){const n=t[e];if(!n[W]){const t=n.getAttribute(D);t&&(n[W]=no({src:t,container:n}))}}}"undefined"!=typeof window&&(window.loadTagAnimators=ro,window.createAnimator=no,window.setupAnimationTriggers=Wr);var oo=[1,0,0,1,0,0];function ao(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 io=(t,e)=>[1,0,0,1,t,e],so=(t,e)=>[t,0,0,e,0,0];function lo(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var uo=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],co=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function fo(t){let e=oo;t.translate&&(e=ao(e,io(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=ao(e,io(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=ao(e,lo(t.rotate))),t.scale&&(e=ao(e,so(t.scale[0],t.scale[1]))),n&&(e=ao(e,io(-t.origin[0],-t.origin[1]))),e}function ho(t,e,n){return t+(e-t)*n}function po(t,e){return null==t?oo:"string"==typeof t?function(t){let e=oo;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=ao(e,io(n[0]||0,n[1]||0)):"scale"===t?e=ao(e,so(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=ao(e,lo(n[0])):"skewX"===t?e=ao(e,uo(n[0])):"skewY"===t?e=ao(e,co(n[0])):"matrix"===t&&(e=ao(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?fo(function(t,e){var n,r,o,a,i,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!=(a=c.time)?a:0))/((null!=(i=f.time)?i:0)-(null!=(s=c.time)?s:0)||1),h=c.value||{},p=f.value||{},m={};return h.translate&&p.translate?m.translate=[ho(h.translate[0],p.translate[0],d),ho(h.translate[1],p.translate[1],d)]:m.translate=h.translate||p.translate,void 0!==h.rotate&&void 0!==p.rotate?m.rotate=ho(h.rotate,p.rotate,d):m.rotate=null!=(l=h.rotate)?l:p.rotate,h.scale&&p.scale?m.scale=[ho(h.scale[0],p.scale[0],d),ho(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?fo(t.value):oo}var mo=new Set(["svg","g","symbol"]),yo=new Set(["defs","mask","clipPath","title"]);function vo(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>vo(t,e))}function go(t){return null==t?0:Number(t)}function bo(t){return Math.round(100*t)/100+0}function ko(t,e,n){var r,o,a,i,s;const l=null!=(r=t.fill)?r:"",u=null!=(o=t.stroke)?o:"",c=null!=(i=null!=(a=t["stroke-width"])?a:t.strokeWidth)?i:"",f=bo(function(t,e,n,r){var o,a,i,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!=(a=e[e.length-1].time)?a:0))return e[e.length-1].value;let n=0;for(;n<e.length-1&&(null!=(i=e[n+1].time)?i: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 ho(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(bo).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return go(t.width)+","+go(t.height)+","+go(t.x)+","+go(t.y);case"ellipse":return go(t.rx)+","+go(t.ry)+","+go(t.cx)+","+go(t.cy);case"circle":return go(t.r)+","+go(t.cx)+","+go(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+h+"]|f:"+l+"|s:"+u+"|sw:"+(go(c)||"")+"|o:"+f+"|m:"+d}function Ao(t,e,n,r,o){var a;const i=t.type||"";if(yo.has(i))return;const s=ao(e,function(t,e){return t.animate&&t.animate.transform?po(t.animate.transform,e):void 0!==t.transform?po(t.transform,e):oo}(t,n));if("use"===i){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",a=r.get(e),i=ao(s,io(go(t.x),go(t.y)));return void(a?Ao(a,i,n,r,o):o.push("UNRESOLVED_USE:#"+e))}mo.has(i)?null==(a=t.children)||a.forEach(t=>Ao(t,s,n,r,o)):o.push(ko(t,s,n))}function wo(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=>wo(t,e))}function jo(t,e){const n=new Map;vo(t,n);const r=[];return Ao(t,oo,e,n,r),r.sort()}function xo(t,e){const n=new Set;wo(t,n),wo(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=jo(t,o),a=jo(e,o),i=Oo(n,a),s=Oo(a,n);(i.length||s.length)&&r.push({time:o,onlyInA:i,onlyInB:s})}return r}function Oo(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{ze as COLOUR_ATTR_NAMES,eo as PX_ANIMATOR_DATA_KEY,W as PX_ANIM_ATTR_NAME,D as PX_ANIM_SRC_ATTR_NAME,Y as PX_TRANSFORM_PART_KEYS,It as PxAnimatedSvgDocumentSchema,tt as PxAnimationDefinitionSchema,it as PxAnimatorConfigSchema,B as PxAnimatorEngine,R as PxAnimatorMode,lt as PxAttrValueSchema,Ct as PxBezierPathSchema,st as PxBindingSchema,yt as PxCloneEffectSchema,at as PxDefsSchema,Z as PxEasingOrRefSchema,St as PxEffectsSchema,et as PxElementAnimationSchema,wt as PxFillGradientEffectSchema,gt as PxGradientSpreadMethod,kt as PxGradientStopSchema,bt as PxGradientType,vt as PxGradientUnits,Q as PxKeyframeSchema,J as PxLoopSchema,ht as PxMaskedByEffectSchema,Mt as PxNodeBase,_t as PxNodeSchema,X as PxPropertyAnimationSchema,dt as PxRepeaterEffectSchema,mt as PxRetimeEffectSchema,jt as PxStrokeGradientEffectSchema,zt as PxSvgNodeExtra,Ot as PxTextEffectSchema,xt as PxTextPathEffectSchema,H as PxTransformPartsSchema,$ as PxTransformValueSchema,ft as PxTransformationEffectSchema,nt as PxTriggerSchema,pt as PxTrimPathEffectSchema,Te as STYLE_ATTR_NAMES,Ie as TRANSFORM_FN_NAMES,wr as applyPlayerEffects,ir as calcAnimationValues,Ue as camelCaseToKebabWordIfNeeded,wo as collectSampleTimes,no as createAnimator,to as createAnimatorImpl,Br as createBasicFrameLoopAnimator,qr as createFrameLoopAnimator,Qr as createWebApiAnimator,U as describeSchema,xo as diffInEffect,Cn as evaluateMotionPathSegment,$e as extendedPathForBrowser,Hr as generateNewIds,Et as getAnimatorConfig,Ft as getBindings,Ut as getChildren,Lt as getDefs,Vr as getNormalizedProps,Nt as isPxElementFileFormat,Tt as isPxElementFileFormatDeep,en as jsonElementFactory,ro as loadTagAnimators,zr as materialiseAllInTree,xr as materialiseAnimatedUseInstances,On as materialiseGlyphText,gn as materialiseGlyphTextAlongPath,yn as materialiseGlyphTextHorizontal,tr as materialiseInternalLoopsInPropAnim,er as materialiseInternalLoopsInTree,Nn as materialiseMotionPathInPropAnim,Bn as materialiseMotionPathsInTree,or as normalizeDocument,_n as propAnimIsMotionPath,V as px,Dr as renderNode,F as schemaKeys,Wr as setupAnimationTriggers,He as shiftAnimatable,Me as toRGBA,Pt as validateNodeEffects,jo as visualModelAt};
|
|
1
|
+
var t=Object.defineProperty,e=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,i=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))a.call(e,n)&&s(t,n,e[n]);return t},u=(t,r)=>e(t,n(r)),c=(t,e)=>{var n={};for(var i in t)o.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&r)for(var i of r(t))e.indexOf(i)<0&&a.call(t,i)&&(n[i]=t[i]);return n};function f(t,e,n){const r={};return"translate"===t?r.translate=e:"rotate"===t?r.rotate=e:r.scale=e,n&&"translate"!==t&&(r.origin=n),r}function d(t){if(void 0===t)return{kind:"absent"};if(Array.isArray(t))return{kind:"static",value:t};if("object"==typeof t){const e=t;if(e.keyframes)return{kind:"animated",keyframes:e.keyframes,autoOrient:e.autoOrient,loop:e.loop};if(void 0!==e.value)return{kind:"static",value:e.value}}return{kind:"static",value:t}}function h(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 p(t,e,n){if(!e)return t;delete t.transform;let r=t;var o;return r=m(r,"skew",e.skew,n),r=y(r,e.origin,!0),r=m(r,"scale",void 0===(o=e.scale)?void 0:Array.isArray(o)?[o[0]/100,o[1]/100]:o,n),r=m(r,"rotate",e.rotate,n),r=y(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=m(r,"translate",e.translate,n):(r=y(r,e.origin,!0),r=m(r,"translate",e.translate,n),r=y(r,e.origin,!1)),r}function m(t,e,n,r){if(void 0===n)return t;if("skew"===e){const e=d(n);return"static"!==e.kind?(r.warnings.push("transformation.skew: only static skew is supported"),t):{type:"g",transform:"skewX("+e.value[0]+")skewY("+e.value[1]+")",children:[t]}}const o=d(n);if("static"===o.kind)return{type:"g",transform:{value:f(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>h(t,f(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 y(t,e,n){if(void 0===e)return t;const r=d(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=>h(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function v(t,e,n){var r,o,a;if("use"===t.type&&"content"===(null==(o=null==(r=t.effects)?void 0:r.clone)?void 0:o.type)){const r=t.effects.clone.baseId;"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(a=t.children)||a.forEach(t=>v(t,e,n))}function g(t,e,n,r,o){const a=function(t,e){var n,r,o;const a={};let i=!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=k(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),a.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}i=!0}}const l=void 0!==(null==e?void 0:e.translate),u=i||l,c=i&&k((null==(r=t.animate)?void 0:r.transform)||void 0)||i&&k((null==(o=a.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],a=e[e.length-1];if("translate"===a.name&&"translate"===o.name){const n=b(a.full),r=b(o.full),i=-n[0],s=-n[1],l=r[0]-i,u=r[1]-s;if(0===l&&0===u)return{rest:t};return{translate:"translate("+l+","+u+")",rest:"translate("+i+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===a.name)return{rest:t};const i=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)i.push(e[s].full),s++;if(!i.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:i.join(""),rest:l||void 0}}(t.transform);u?void 0!==e.translate?e.rest?t.transform=e.rest:delete t.transform:!function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,n=[];let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(1!==n.length)return!1;if("translate"===n[0].name)return!0;if("matrix"!==n[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(n[0].full);if(!o)return!1;const a=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return a.length>=4&&1===a[0]&&0===a[1]&&0===a[2]&&1===a[3]}(t.transform)?c&&function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let n,r=0,o=!1;for(;n=e.exec(t);)r++,"matrix"===n[1]&&(o=!0);return 1===r&&o}(t.transform)&&delete t.transform:delete t.transform:e.translate&&(a.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}return a}(t,e);"string"==typeof t.id&&delete t.id;const{outer:i,inner:s}=function(t){if(!t)return{};const e=k(t.translate),n=void 0!==t.rotate||void 0!==t.scale,r={},o={};void 0!==t.translate&&(r.translate=t.translate);e&&void 0!==t.origin&&(r.origin=t.origin);void 0!==t.rotate&&(o.rotate=t.rotate);void 0!==t.scale&&(o.scale=t.scale);void 0!==t.skew&&(o.skew=t.skew);void 0===t.origin||e&&!n||(o.origin=t.origin);return{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(e);let l=t;l=p(l,s,o);let u={type:"g",id:n,children:[{type:"g",id:r,children:[l]}]};return void 0!==a.transform&&(u.transform=a.transform),void 0!==a.animate&&(u.animate=a.animate),i&&(delete u.id,u=p(u,i,o),u.id=n),u}function b(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 k(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 A(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var w=class{_canSanitize(t){return this.isValid(t)}optional(){return new x(this)}},x=class extends w{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)}},j=class extends w{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(A(null!=n?n:[])+": expected string, got "+typeof t),!1)}},S=class extends w{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(A(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},O=class extends w{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(A(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},P=class extends w{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(A(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},M=class extends w{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(A(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},_=class extends w{constructor(t,e){super(),this.schemas=t,this._default=null!=e?e:t[0]._default}sanitize(t){for(const e of this.schemas)if(e.isValid(t))return e.sanitize(t);return this._default}isValid(t,e,n){var r;return!!this.schemas.some(e=>e.isValid(t))||(null==e||e.errors.push(A(null!=n?n:[])+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,60)),!1)}_canSanitize(t){return this.schemas.some(e=>e._canSanitize(t))}},z=class extends w{constructor(t,e,n){super(),this._key=t,this._schemas=e,this._default=null!=n?n:e[0]._default,this._map=new Map;for(const n of e){const e=n._shape[t];e&&this._map.set(e._default,n)}}_findSchema(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const e=t[this._key];return null!=e?this._map.get(e):void 0}sanitize(t){var e;return(null!=(e=this._findSchema(t))?e:this._schemas[0]).sanitize(t)}isValid(t,e,n){const r=this._findSchema(t);if(!r){const r=null===t||"object"!=typeof t||Array.isArray(t)?void 0:t[this._key];return null==e||e.errors.push(A(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)}},I=class extends w{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(A(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let a=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(a=!1),o.pop();if(null==e?void 0:e.strict)for(const t of Object.keys(r))t in this._shape||(o.push(t),e.errors.push(A(o)+": unexpected extra key"),o.pop(),a=!1);return a}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},C=class extends w{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(A(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let a=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(a=!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)||(a=!1),o.pop());return a}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},N=class extends w{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(A(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)}},E=class extends w{constructor(t){super(),this.value=t,this._default={}}sanitize(t){if(!t||"object"!=typeof t||Array.isArray(t))return{};const e={};for(const[n,r]of Object.entries(t))this.value._canSanitize(r)&&(e[n]=this.value.sanitize(r));return e}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(A(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,a]of Object.entries(t))r.push(n),this.value.isValid(a,e,r)||(o=!1),r.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},T=class extends w{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},L=class extends w{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)}},F=class extends w{constructor(t){super(),this.schemas=t,this._default=t.map(t=>t._default)}sanitize(t){return Array.isArray(t)&&t.length===this.schemas.length?this.schemas.map((e,n)=>e.sanitize(t[n])):this._default}isValid(t,e,n){if(!Array.isArray(t)||t.length!==this.schemas.length)return null==e||e.errors.push(A(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 D(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function U(t){var e;const n=t;return"_shape"in n?{kind:"shape",shape:n._shape}:"item"in n?{kind:"array",item:n.item}:"inner"in n?{kind:"optional",inner:n.inner}:"fn"in n?{kind:"lazy",resolved:null!=(e=n.resolved)?e:n.fn()}:{kind:"leaf"}}var V={string:(t="")=>new j(t),number:(t=0)=>new S(t),boolean:(t=!1)=>new O(t),literal:t=>new P(t),enum:(t,e)=>new M(t,e),union:(t,e)=>new _(t,e),discriminatedUnion:(t,e)=>new z(t,e),object:t=>new I(t),openObject:(t,e)=>new C(t,e),extendedObject:(t,e)=>new I(l(l({},t._shape),e)),array:t=>new N(t),record:t=>new E(t),any:()=>new T,tuple:t=>new F(t),lazy:(t,e)=>new L(t,e)},R="data-px-animation-src",W="_px_animator",B={auto:"auto",webapi:"webapi",frames:"frames"},q={webapi:B.webapi,frames:B.frames},G="text",Z="textContent",K=new Set(["type","children","animator","meta","animate",G,Z]),Q=V.union([V.string(),V.tuple([V.number(),V.number(),V.number(),V.number()])]),X=(V.union([V.string(),V.number(),V.array(V.number()),V.lazy(()=>$,{}),V.object({path:V.string()}),V.lazy(()=>V.object({paths:V.array(Et)}),{paths:[]})]),V.object({time:V.number().optional(),t:V.number().optional(),value:V.any().optional(),v:V.any().optional(),easing:Q.optional(),e:Q.optional(),tangentOut:V.tuple([V.number(),V.number()]).optional(),to:V.tuple([V.number(),V.number()]).optional(),tangentIn:V.tuple([V.number(),V.number()]).optional(),ti:V.tuple([V.number(),V.number()]).optional(),selected:V.boolean().optional()})),Y=V.object({segmentCount:V.number().optional(),before:V.boolean().optional(),alternate:V.boolean().optional()}),J=V.object({keyframes:V.array(X).optional(),kfs:V.array(X).optional(),loop:V.union([Y,V.boolean()]).optional(),autoOrient:V.boolean().optional()}),H=["translate","rotate","scale","origin"],$=V.object({translate:V.tuple([V.number(),V.number()]).optional(),rotate:V.number().optional(),scale:V.tuple([V.number(),V.number()]).optional(),origin:V.tuple([V.number(),V.number()]).optional()}),tt=V.union([V.string(),V.object({value:$}),J]),et=V.record(J),nt=V.union([V.string(),V.array(V.union([V.string(),et])),et]),rt=V.object({startOn:V.enum(["load","mouseOver","click","scrollIntoView","programmatic"]).optional(),outAction:V.enum(["continue","pause","reset","reverse"]).optional(),scrollIntoViewThreshold:V.number().optional()}),ot=V.object({width:V.number(),d:V.string()}),at=V.object({fFamily:V.string(),style:V.string(),ascent:V.number(),unitsPerEm:V.number(),glyphs:V.record(ot)}),it=V.object({easings:V.record(V.tuple([V.number(),V.number(),V.number(),V.number()])).optional(),animations:V.record(et).optional(),styles:V.record(V.any()).optional(),glyphs:V.record(at).optional()}),st=V.object({mode:V.enum([B.auto,B.webapi,B.frames]).optional(),duration:V.number().optional(),delay:V.number().optional(),iterations:V.union([V.number(),V.literal("infinite")]).optional(),fill:V.enum(["forwards","backwards","both","none"]).optional(),direction:V.enum(["normal","reverse","alternate","alternate-reverse"]).optional(),frameRate:V.number().optional(),trigger:rt.optional(),definitions:it.optional(),animate:V.record(nt).optional(),debug:V.boolean().optional(),debugInstName:V.string().optional()}),lt=V.object({id:V.string(),animate:nt}),ut=V.union([V.string(),V.number(),V.object({value:V.any()}),J]),ct=V.union([V.number(),V.object({value:V.number()}),V.object({keyframes:V.array(X),autoOrient:V.boolean().optional()})]),ft=V.union([V.tuple([V.number(),V.number()]),V.object({value:V.tuple([V.number(),V.number()])}),V.object({keyframes:V.array(X),autoOrient:V.boolean().optional()})]),dt=V.object({translate:ft.optional(),rotate:ct.optional(),scale:ft.optional(),skew:ft.optional(),origin:ft.optional()}),ht=V.object({copies:V.number().optional(),translate:ft.optional(),rotate:ct.optional(),scale:ft.optional(),origin:ft.optional()}),pt=V.object({href:V.string().optional(),maskType:V.string().optional(),maskUnits:V.string().optional(),maskContentUnits:V.string().optional()}),mt=V.object({d:V.string().optional(),animate:J.optional()}),yt=V.object({offset:ct.optional(),range:ft.optional(),trimAllAsOne:V.boolean().optional()}),vt=V.object({baseId:V.string().optional(),start:V.number().optional(),stretch:V.number().optional(),timeCrop:V.tuple([V.number(),V.number()]).optional()}),gt=V.object({type:V.string().optional(),baseId:V.string().optional(),retime:vt.optional()}),bt={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},kt={pad:"pad",reflect:"reflect",repeat:"repeat"},At={linear:"linear",radial:"radial"},wt=V.object({offset:V.number(),color:V.string()}),xt=V.union([V.array(wt),V.object({value:V.array(wt)}),V.object({keyframes:V.array(X)})]),jt=V.object({type:V.enum([At.linear,At.radial]),p1:V.tuple([V.number(),V.number()]).optional(),p2:V.tuple([V.number(),V.number()]).optional(),c:V.tuple([V.number(),V.number()]).optional(),r:V.number().optional(),fp:V.tuple([V.number(),V.number()]).optional(),stops:xt.optional(),gradientUnits:V.string().optional(),spreadMethod:V.string().optional(),gradientTransform:V.string().optional()}),St=jt,Ot=V.object({path:V.string(),pathOverflow:V.string().optional(),lengthAdjust:V.string().optional(),method:V.string().optional(),spacing:V.string().optional(),startOffset:ct.optional(),textLength:ct.optional()}),Pt=V.object({useGlyphs:V.boolean().optional()}),Mt=V.object({transformation:dt.optional(),repeater:ht.optional(),maskedBy:pt.optional(),clipPath:mt.optional(),trimPath:yt.optional(),clone:gt.optional(),isCombinedShape:V.boolean().optional(),fillGradient:jt.optional(),strokeGradient:St.optional(),textPath:Ot.optional(),text:Pt.optional()});function _t(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!Mt.isValid(t.effects,r,[o+".effects"]))for(const t of r.errors)n.push(t)}t&&Array.isArray(t.children)&&t.children.forEach((t,e)=>r(t,o+".children["+e+"]"))};return r(t,"root"),n}var zt=V.openObject({type:V.string(),id:V.string().optional(),meta:V.any().optional(),effects:Mt.optional(),animate:nt.optional(),style:V.union([V.string(),V.record(V.union([V.string(),V.number()]))]).optional()},ut),It=V.openObject(u(l({},zt._shape),{children:V.lazy(()=>V.array(It),[]).optional()}),ut),Ct=V.object({width:V.number().optional(),height:V.number().optional(),viewBox:V.string().optional(),animator:st.optional()}),Nt=V.openObject(u(l(l({},zt._shape),Ct._shape),{type:V.literal("svg"),children:V.array(It).optional()}),ut),Et=V.object({v:V.array(V.array(V.number())),i:V.array(V.array(V.number())).optional(),o:V.array(V.array(V.number())).optional(),c:V.boolean().optional()});function Tt(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&("svg"===t.type||"svg"===t.tagName)}function Lt(t){const e=Nt.isValid(t);return{valid:e,errors:e?[]:["Document failed schema validation"]}}function Ft(t){var e,n;return(null==t?void 0:t.animator)||(null==(e=null==t?void 0:t.meta)?void 0:e.animator)||(null==t?void 0:t.animation)||(null==(n=null==t?void 0:t.meta)?void 0:n.animation)}function Dt(t){var e;if(t)return null==(e=Ft(t))?void 0:e.definitions}function Ut(t){var e;if(!t)return;const n=null==(e=Ft(t))?void 0:e.animate;return n?Object.entries(n).map(([t,e])=>({id:t,animate:e})):void 0}function Vt(t){return null==t?void 0:t.children}function Rt(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Rt);const e={};for(const n of Object.keys(t))e[n]=Rt(t[n]);return e}function Wt(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}),a=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(a)};return a(t),n}function Bt(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function qt(t){var e;const n=Bt(t.x),r=Bt(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 Gt(t,e){return"_lw_"+e+"_"+t.nextId++}function Zt(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function Kt(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Kt(t,e))}var Qt=Rt;function Xt(t,e,n,r){if(!e)return t;const o=Gt(n,"grad"),a=function(t,e){const n={type:t.type===At.radial?"radialGradient":"linearGradient",id:e};t.type===At.linear?(t.p1&&(n.x1=String(t.p1[0]),n.y1=String(t.p1[1])),t.p2&&(n.x2=String(t.p2[0]),n.y2=String(t.p2[1]))):(t.c&&(n.cx=String(t.c[0]),n.cy=String(t.c[1])),void 0!==t.r&&(n.r=String(t.r)),t.fp&&(n.fx=String(t.fp[0]),n.fy=String(t.fp[1])));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[];if(Array.isArray(t))return t.map(Yt);if("object"==typeof t&&Array.isArray(t.value))return t.value.map(Yt);const a=t,i=a.keyframes;if(!Array.isArray(i)||!i.length)return[];const s=a.loop;let l=0;for(const t of i){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=i[0].value)?n:i[0].v,c=[];for(let t=0;t<l;t++){const e=null!=(o=null!=(r=null==u?void 0:u[t])?r:Jt(i,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 a,i,s,l,u;const c=[],f=[];let d=!1;for(const r of e){const o=null!=(i=null!=(a=r.time)?a:r.t)?i:0,h=null!=(s=r.value)?s:r.v,p=null!=(l=null==h?void 0:h[n])?l:Jt(e,e.indexOf(r),n);if(!p)continue;const m=null!=(u=r.easing)?u:r.e,y={time:o,value:p.color};void 0!==m&&(y.easing=m),c.push(y);const v={time:o,value:p.offset};void 0!==m&&(v.easing=m),f.push(v),p.offset!==t.offset&&(d=!0)}const h={type:"stop",offset:Ht(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,i,e,0,s))}(t.stops),n}(e,o);return n.defs.push(a),t[r]="url(#"+o+")",t}function Yt(t){return{type:"stop",offset:Ht(t.offset),stopColor:t.color}}function Jt(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 Ht(t){return Math.round(1e3*t)/10+"%"}function $t(t,e,n,r){if(!e)return t;if(!e.href)return r.errors.push("maskedBy.href missing — cannot build mask"),t;const o=Gt(r,"mask");let a={type:"use",href:"#"+e.href};if(n)a=te(a,n,r);else if(re(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,a=o&&"object"==typeof o&&Array.isArray(o.keyframes)?o.keyframes:void 0;if(!a||!a.length)return t;const i=[],s=[],c=[];for(const t of a){const e=(null!=(n=t.value)?n:t.v)||{},r=h(t,void 0);if(Array.isArray(e.translate)&&i.push(u(l({},r),{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 p=t;i.length&&(p={type:"g",animate:{transform:d(i)},children:[p]});s.length&&(p={type:"g",animate:{transform:d(s)},children:[p]});c.length&&(p={type:"g",animate:{transform:d(c)},children:[p]});return p}(a,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,a,i,s,l,u,c,f,d,h;const p=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let m;const y=[];for(;null!==(m=p.exec(t));){const t=m[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);y.push({name:m[1],args:t})}if(!y.length)return;const v=y[y.length-1];if("translate"===v.name)for(let t=y.length-2;t>=0;t--){const c=y[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"===y[e].name){const t=null!=(a=y[e].args[0])?a:0,n=null!=(i=y[e].args[1])?i:0;m.translate=m.translate?[m.translate[0]+t,m.translate[1]+n]:[t,n]}for(let e=t+1;e<y.length-1;e++){const t=y[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 g,b,k;for(const t of y)if("translate"===t.name){const e=null!=(c=t.args[0])?c:0,n=null!=(f=t.args[1])?f:0;g=g?[g[0]+e,g[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={};g&&(A.translate=g);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}return}(t);e&&(a=te(a,e,r))}const i=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||re(t))}(t);a=function(t,e,n,r,o){const a=r.idMap.get(n),i=r.maskAncestorChains.get(e)||[],s=o?se(e,r):void 0,l=s?[...i,s]:i,u=a&&r.maskAncestorChains.get(a)||[];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=oe(l),n=oe(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=ae(l,t),n=ae(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,e.href,r,i);const s={type:"mask",id:o,children:[a]};return e.maskType&&(s.maskType=e.maskType),e.maskUnits&&(s.maskUnits=e.maskUnits),e.maskContentUnits&&(s.maskContentUnits=e.maskContentUnits),r.defs.push(s),t.mask="url(#"+o+")",t}function te(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=d(t);if("absent"!==r.kind)return"static"===r.kind?r.value:(e.warnings.push("transformation.origin: animated origin approximated by its first keyframe"),null==(n=r.keyframes[0])?void 0:n.value)}(e.origin,n);let o=t;return o=ee(o,"translate",e.translate,void 0,n),o=ee(o,"rotate",e.rotate,r,n),o=ee(o,"scale",e.scale,r,n),o}function ee(t,e,n,r,o){if(void 0===n)return t;const a=d("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);if("static"===a.kind)return{type:"g",transform:{value:f(e,ne(e,a.value),r)},children:[t]};if("animated"===a.kind){const n={keyframes:a.keyframes.map(t=>h(t,f(e,ne(e,t.value),r)))};return void 0!==a.loop&&(n.loop=a.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function ne(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function re(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function oe(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 ae(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=ie(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function ie(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],a=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*a,r.value[1]+(o.value[1]-r.value[1])*a]}return t[t.length-1].value}function se(t,e){var n,r,o;const a=t.transform,i=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate.transform:void 0;if(void 0===a&&!i)return;const s={};if("string"==typeof a){const t=function(t,e){const n=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,a=0,i=!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,a+=e[1]||0,i=!0):s=!0}s&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t);return i?[o,a]:void 0}(a,e);t&&(s.translate=t)}else if(a&&"object"==typeof a){const t=a.value;t&&"object"==typeof t&&Array.isArray(t.translate)&&(s.translate=[t.translate[0]||0,t.translate[1]||0]),!t||void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: non-translate transform parts ignored (rotate/scale not yet supported)")}if(i&&Array.isArray(i.keyframes)){const t=i.keyframes,a=[];for(const i of t){const t=null!=(n=i.value)?n:i.v,s=null!=(o=null!=(r=i.time)?r:i.t)?o:0;t&&"object"==typeof t&&Array.isArray(t.translate)&&(a.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"))}a.length&&(s.translateKeyframes=a)}return s.translate||s.translateKeyframes?s:void 0}var le="content";function ue(t,e,n){if(!e)return;const r=e.baseId;if(!r)return void(e.type===le&&n.errors.push("clone: content ref missing baseId"));const o=e.type===le&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function ce(t,e){const n={};return void 0!==t.translate&&(n.translate=function(t,e){if(Array.isArray(t))return e(t);if(t&&"object"==typeof t){const n=t;if(Array.isArray(n.keyframes))return u(l({},n),{keyframes:n.keyframes.map(t=>t&&void 0!==t.value?u(l({},t),{value:e(t.value)}):t)});if(void 0!==n.value)return u(l({},n),{value:e(n.value)})}return t}(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=function(t,e){if("number"==typeof t)return e(t);if(t&&"object"==typeof t){const n=t;if(Array.isArray(n.keyframes))return u(l({},n),{keyframes:n.keyframes.map(t=>t&&void 0!==t.value?u(l({},t),{value:e(t.value)}):t)});if(void 0!==n.value)return u(l({},n),{value:e(n.value)})}return t}(t.rotate,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){const n=t=>[Math.pow(t[0]/100,e),Math.pow(t[1]/100,e)],r=t=>[Math.pow(t[0],e),Math.pow(t[1],e)];if(Array.isArray(t))return{value:n(t)};if(t&&"object"==typeof t){const e=t;if(Array.isArray(e.keyframes))return u(l({},e),{keyframes:e.keyframes.map(t=>t&&void 0!==t.value?u(l({},t),{value:r(t.value)}):t)});if(void 0!==e.value)return u(l({},e),{value:n(e.value)})}return t}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function fe(t){var e,n;return t.timeCrop&&console.warn("retime: `timeCrop` is not supported yet and will be ignored"),{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function de(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function he(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function pe(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 me(t,e,n){const r=Zt(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=ye(r,e,n,new Set);o&&(t.href="#"+o)}function ye(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 a=Qt(o);if(function(t,e){Wt(t,()=>Gt(e,"retimed"))}(a,n),"use"===o.type?ge(a,e.start,e.stretch):ve(a,e.start,e.stretch),pe(a),"use"===o.type&&o.href){const i=Zt(o.href);if(i){const s=he(o),l=s?de(fe(s),e):e,u=new Set(r);u.add(t);const c=ye(i,l,n,u);c&&(a.href="#"+c)}}else!function(t,e,n,r,o){const a=t=>{var i;const s=he(t);if("use"===t.type&&s&&t.href){const a=Zt(t.href);if(a){const i=de(fe(s),e),l=new Set(r);l.add(o);const u=ye(a,i,n,l);u&&(t.href="#"+u)}pe(t)}null==(i=t.children)||i.forEach(a)};a(t)}(a,e,n,r,t);return n.defs.push(a),"string"==typeof a.id&&n.idMap.set(a.id,a),"string"==typeof a.id?a.id:void 0}function ve(t,e,n){var r;ge(t,e,n),null==(r=t.children)||r.forEach(t=>ve(t,e,n))}function ge(t,e,n){const r=t=>{for(const r of t)"number"==typeof r.time&&(r.time=e+r.time*n)};if(t.transform&&"object"==typeof t.transform&&Array.isArray(t.transform.keyframes)&&r(t.transform.keyframes),t.animate&&"object"==typeof t.animate)for(const e of Object.keys(t.animate)){const n=t.animate[e];n&&Array.isArray(n.keyframes)&&r(n.keyframes)}}function be(t){var e,n,r,o;const a=t.v,i=t.i,s=t.o,l=t.c;if(!a.length)return"";const u=[],c=a.length;u.push("M"+a[0][0]+","+a[0][1]);for(let t=1;t<c;t++){const r=a[t-1],o=null!=(e=null==s?void 0:s[t-1])?e:r,l=null!=(n=null==i?void 0:i[t])?n:a[t],c=a[t];o[0]===r[0]&&o[1]===r[1]&&l[0]===c[0]&&l[1]===c[1]?u.push("L"+c[0]+","+c[1]):u.push("C"+o[0]+","+o[1]+","+l[0]+","+l[1]+","+c[0]+","+c[1])}if(l&&c>0){const t=a[c-1],e=null!=(r=null==s?void 0:s[c-1])?r:t,n=null!=(o=null==i?void 0:i[0])?o:a[0],l=a[0];e[0]===t[0]&&e[1]===t[1]&&n[0]===l[0]&&n[1]===l[1]||u.push("C"+e[0]+","+e[1]+","+n[0]+","+n[1]+","+l[0]+","+l[1]),u.push("z")}return u.join("")}function ke(t,e,n){return t+(e-t)*n}function Ae(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let a=0;a<o;a++)r[a]=ke(t[a]||0,e[a]||0,n);return r}function we(t,e,n){return[ke(t[0]||0,e[0]||0,n),ke(t[1]||0,e[1]||0,n),ke(t[2]||0,e[2]||0,n),ke(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function xe(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let a=0;a<r;a++)o.push(je(t[a],e[a],n));return o}function je(t,e,n){var r,o,a,i,s,l,u,c,f;if(!t||!e)return t||e||{v:[]};const d=Math.min(Math.max(n,0),1),h=Math.min(t.v.length,e.v.length),p=[],m=[],y=[];for(let n=0;n<h;n++){const f=t.v[n],h=e.v[n];p.push(Ae(f,h,d));const v=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,g=null!=(i=null==(a=e.i)?void 0:a[n])?i:h;m.push(Ae(v,g,d));const b=null!=(l=null==(s=t.o)?void 0:s[n])?l:f,k=null!=(c=null==(u=e.o)?void 0:u[n])?c:h;y.push(Ae(b,k,d))}return{v:p,i:m.length?m:void 0,o:y.length?y:void 0,c:null!=(f=t.c)?f:e.c}}function Se(t,e,n){if(n<=0)return 0;if(n>=1)return 1;const r=3*t,o=3*(e-t)-r,a=1-r-o;function i(t){return((a*t+o)*t+r)*t}function s(t){return(3*a*t+2*o)*t+r}let l=n,u=0,c=1;for(let t=0;t<8;t++){const t=i(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=i(l);if(Math.abs(t-n)<1e-6)return l;n>t?u=l:c=l,l=(c+u)/2}return l}function Oe(t){const[e,n,r,o]=t,a=3*n,i=3*(o-n)-a,s=1-a-i;return function(t){return n=Se(e,r,t),((s*n+i)*n+a)*n;var n}}function Pe(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Me(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,a]=t,i=Se(n,o,e),s=[n,r],l=[o,a],{left:u,right:c}=function(t,e,n,r,o){const a=Pe(t,e,o),i=Pe(e,n,o),s=Pe(n,r,o),l=Pe(a,i,o),u=Pe(i,s,o),c=Pe(l,u,o);return{left:[t,a,l,c],right:[c,u,s,r]}}([0,0],s,l,[1,1],i),f=u[3][0],d=u[3][1];let h,p;f>1e-9&&Math.abs(d)>1e-9&&(h=[u[1][0]/f,u[1][1]/d,u[2][0]/f,u[2][1]/d]);const m=1-f,y=1-d;return m>1e-9&&Math.abs(y)>1e-9&&(p=[(c[1][0]-f)/m,(c[1][1]-d)/y,(c[2][0]-f)/m,(c[2][1]-d)/y]),{left:h,right:p}}function _e(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function ze(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 Ie(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),a=n?e[2]+e[2]:e.slice(4,6),i=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(a,16)/255];return null!==i&&s.push(parseInt(i,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 Ce=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),Ne=new Set(["translate","rotate","scale","skew"]),Ee=new Set(["offset-distance","offsetDistance"]);function Te(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],a=t.translate,i=t.origin,s=t.rotate,l=t.scale,u=r?"px":"",c=r?"deg":"";return a&&o.push("translate("+a[0]+u+","+a[1]+u+")"),i&&o.push("translate("+i[0]+u+","+i[1]+u+")"),null!=s&&o.push("rotate("+s+c+")"),l&&o.push("scale("+l[0]+","+l[1]+")"),i&&o.push("translate("+-i[0]+u+","+-i[1]+u+")"),o.join("")}var Le=new Set(["offset-distance","offsetDistance"]);function Fe(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function De(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var Ue=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 Ve(t){return Ue.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Re(t,e,n){return Math.max(e,Math.min(t,n))}function We(t,e,n,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const a=1-o,i=a*a,s=o*o,l=i*a,u=3*o*i,c=3*s*a,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 Be=1e-4;function qe(t,e,n,r,o){const a=Ge(t,e,n,r,o);if(0===a[0]&&0===a[1]){return Ge(t,e,n,r,o<.5?o+Be:o-Be)}return a}function Ge(t,e,n,r,o){const a=1-o,i=3*a*a,s=6*o*a,l=3*o*o;return[i*(e[0]-t[0])+s*(n[0]-e[0])+l*(r[0]-n[0]),i*(e[1]-t[1])+s*(n[1]-e[1])+l*(r[1]-n[1])]}function Ze(t,e,n,r,o=100){const a=o+1,i=new Float64Array(a),s=new Float64Array(a);let l=We(t,e,n,r,0);i[0]=0,s[0]=0;let u=0;for(let c=1;c<a;c++){const a=c/o,f=We(t,e,n,r,a),d=f[0]-l[0],h=f[1]-l[1];u+=Math.sqrt(d*d+h*h),i[c]=a,s[c]=u,l=f}return{ts:i,ds:s}}function Ke(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 a=1,i=o;for(;a<i;){const t=a+i>>>1;n[t]<e?a=t+1:i=t}const s=n[i-1],l=n[i]-s,u=l>0?(e-s)/l:0;return r[i-1]+u*(r[i]-r[i-1])}var Qe=/[MmLlHhVvCcSsQqTtAaZz]/;function Xe(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 Ye(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,a=0,i=0,s=0,l=0,u=0,c=0,f=0,d="";const h=()=>parseFloat(e[r++]),p=(t,e,r)=>{const i=[o,a],s=Ze(i,t,e,r,48);n.push({P0:i,P1:t,P2:e,P3:r,lut:s,len:s.ds[s.ds.length-1]}),o=r[0],a=r[1]},m=(t,e)=>{p([o+(t-o)/3,a+(e-a)/3],[o+2*(t-o)/3,a+2*(e-a)/3],[t,e])};for(;r<e.length;){let t=e[r];Qe.test(t)?r++:t="M"===d?"L":"m"===d?"l":d;const n=t>="a",y=t.toUpperCase();if("Z"!==y){if("M"===y){const e=h()+(n?o:0),r=h()+(n?a:0);o=e,a=r,i=e,s=r,d=t;continue}if("L"===y)m(h()+(n?o:0),h()+(n?a:0));else if("H"===y)m(h()+(n?o:0),a);else if("V"===y)m(o,h()+(n?a:0));else if("C"===y){const t=[h()+(n?o:0),h()+(n?a:0)],e=[h()+(n?o:0),h()+(n?a:0)],r=[h()+(n?o:0),h()+(n?a:0)];l=e[0],u=e[1],p(t,e,r)}else if("S"===y){const t="C"===d.toUpperCase()||"S"===d.toUpperCase()?[2*o-l,2*a-u]:[o,a],e=[h()+(n?o:0),h()+(n?a:0)],r=[h()+(n?o:0),h()+(n?a:0)];l=e[0],u=e[1],p(t,e,r)}else if("Q"===y){const t=[h()+(n?o:0),h()+(n?a:0)],e=[h()+(n?o:0),h()+(n?a:0)];c=t[0],f=t[1];const{P1:r,P2:i}=Xe([o,a],t,e);p(r,i,e)}else if("T"===y){const t="Q"===d.toUpperCase()||"T"===d.toUpperCase()?[2*o-c,2*a-f]:[o,a],e=[h()+(n?o:0),h()+(n?a:0)];c=t[0],f=t[1];const{P1:r,P2:i}=Xe([o,a],t,e);p(r,i,e)}else{if("A"!==y){r++;continue}r+=5,m(h()+(n?o:0),h()+(n?a:0))}d=t}else m(i,s),o=i,a=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,a=e[e.length-1].P3,i=Math.hypot(a[0]-o[0],a[1]-o[1])<.001,s=t=>{let r=0;for(;r<e.length-1&&t>n[r+1];)r++;const o=e[r],a=t-n[r],i=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 a=1,i=o;for(;a<i;){const t=a+i>>>1;r[t]<e?a=t+1:i=t}const s=r[i-1],l=r[i]-s,u=l>0?(e-s)/l:0;return n[i-1]+u*(n[i]-n[i-1])}(o.lut,a):0,[s,l]=We(o.P0,o.P1,o.P2,o.P3,i),[u,c]=qe(o.P0,o.P1,o.P2,o.P3,i);return{x:s,y:l,angle:Math.atan2(c,u)}};return{totalLength:r,closed:i,sampleAtDistance(t){if(i&&r>0&&(t<0||t>r))return s((t%r+r)%r);if(!i&&(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 Je(t){if("number"==typeof t)return{min:t,max:t};if(t&&"object"==typeof t){const e=t;if("number"==typeof e.value)return{min:e.value,max:e.value};if(Array.isArray(e.keyframes)&&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 He(t){let e=0,n=16;const r=t=>{var o,a;const i=parseFloat(String(null!=(o=t.fontSize)?o:""))||0;i&&(n=Math.max(n,i));const s=null!=(a=t.text)?a: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 $e=t=>Math.round(1e3*t)/1e3;function tn(t,e){if(!e||null==t)return t;if("number"==typeof t)return t+e;const n=t;return"number"==typeof n.value?u(l({},n),{value:n.value+e}):Array.isArray(n.keyframes)?u(l({},n),{keyframes:n.keyframes.map(t=>u(l({},t),{value:(Number(t.value)||0)+e}))}):t}function en(t,e){var n;if("clip"===e.pathOverflow)return{d:t,startShift:0};const r=Ye(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,a=.15*o,i=Je(e.startOffset),s=Je(e.textLength).max||(null!=(n=e.advance)?n:0),l=Math.max(0,-i.min),u=Math.max(0,i.max+s-o),c=l>0?l+a:0,f=u>0?u+a: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"+$e(e)+","+$e(n)+"L"+$e(d.x)+","+$e(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"+$e(t)+","+$e(e)}return{d:p,startShift:c}}function nn(t,e,n){if(null!=n)if("number"!=typeof n){if("object"==typeof n&&null!==n){const r=n;if(Array.isArray(r.keyframes)){const n=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,o=l({},n||{}),a={keyframes:r.keyframes};return void 0!==r.loop&&(a.loop=r.loop),o[e]=a,void(t.animate=o)}if("number"==typeof r.value)return void(t[e]=String(r.value))}}else t[e]=String(n)}var rn=(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 on(t,e){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function an(t,e){let n="";for(let r=0;r<t.length;r++){const o=on(t[r],e);r>0&&45!==o.charCodeAt(0)&&(n+=" "),n+=o}return n}function sn(t,e,n){return[t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}var ln=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function un(t,e,n=2){const r=[];let o;for(ln.lastIndex=0;null!==(o=ln.exec(t));)r.push(o[0]);let a="",i=0;const s=()=>parseFloat(r[i++]);for(;i<r.length;){const t=r[i++];if("M"===t||"L"===t){const[r,o]=sn(e,s(),s());a+=t+an([r,o],n)}else if("C"===t){const[t,r]=sn(e,s(),s()),[o,i]=sn(e,s(),s()),[l,u]=sn(e,s(),s());a+="C"+an([t,r,o,i,l,u],n)}else if("Q"===t){const[t,r]=sn(e,s(),s()),[o,i]=sn(e,s(),s());a+="Q"+an([t,r,o,i],n)}else"Z"!==t&&"z"!==t||(a+="Z")}return a}var cn=["fontFamily","fontSize","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","textDecoration","textTransform","whiteSpace","x","y","dx","dy","lengthAdjust","fill","stroke","strokeWidth","effects",G,Z,"xml:space"];function fn(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?void 0:e}}function dn(t){return"string"==typeof t?t:void 0}function hn(t,e){var n,r,o,a,i,s,l;return{fontFamily:null!=(n=dn(t.fontFamily))?n:e.fontFamily,fontSize:null!=(r=fn(t.fontSize))?r:e.fontSize,fill:null!=(o=t.fill)?o:e.fill,stroke:null!=(a=t.stroke)?a:e.stroke,strokeWidth:null!=(i=t.strokeWidth)?i:e.strokeWidth,letterSpacing:null!=(s=fn(t.letterSpacing))?s:e.letterSpacing,wordSpacing:null!=(l=fn(t.wordSpacing))?l:e.wordSpacing}}function pn(t){var e,n,r;return{fontFamily:dn(t.fontFamily),fontSize:null!=(e=fn(t.fontSize))?e:16,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(n=fn(t.letterSpacing))?n:0,wordSpacing:null!=(r=fn(t.wordSpacing))?r:0}}function mn(t){const e={};return void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),e}function yn(t,e,n,r){var o;const a=t.fontFamily?e[t.fontFamily]:n;return a||null==r||r.push('textGlyphs: no glyphs for font "'+(null!=(o=t.fontFamily)?o:"")+'"'),a}function vn(t){const e=Object.keys(t);return 1===e.length?t[e[0]]:void 0}function gn(t,e){if(t<=0||e<=0)return"";const n=.08,r=t*n,o=.92*t,a=.92*-e,i=o-r,s=-a,l=Math.max(1,.12*Math.min(i,s)),u="M"+r+" 0L"+o+" 0L"+o+" "+a+"L"+r+" "+a+"Z";if(i<=2*l||s<=2*l)return u;const c=r+l,f=o-l,d=-l,h=a+l;return u+"M"+c+" "+d+"L"+c+" "+h+"L"+f+" "+h+"L"+f+" "+d+"Z"}function bn(t,e){var n,r,o,a;const{glyphs:i,create:s=rn,warnings:l}=e,u=vn(i),c={x:null!=(n=fn(t.x))?n:0,y:null!=(r=fn(t.y))?r:0},f=[],d=[{start:c.x,end:c.x}];let h=0;const p=(t,e)=>{var n;const r=yn(e,i,u,l),o=(null==r?void 0:r.unitsPerEm)||1e3,a=e.fontSize/o,s=null!=(n=null==r?void 0:r.ascent)?n:.9*o,p=mn(e);for(let n=0;n<t.length;n++){const i=t.charAt(n),l=null==r?void 0:r.glyphs[i];if(l&&l.d)f.push({glyphD:l.d,m:[a,0,0,a,c.x,c.y],paint:p,line:h,x:c.x,y:c.y,scale:a}),c.x+=l.width*a;else if(/\S/.test(i)){const t=l&&l.width>0?l.width:.6*o;f.push({glyphD:gn(t,s),m:[a,0,0,a,c.x,c.y],paint:p,line:h,x:c.x,y:c.y,scale:a}),c.x+=t*a}else c.x+=(l?l.width:0)*a;c.x+=e.letterSpacing+(" "===i?e.wordSpacing:0),d[h].end=c.x}},m=(t,e)=>{var n,r,o,a;const i=hn(t,e),s=fn(t.x),l=fn(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=fn(t.dx))?n:0,c.y+=null!=(r=fn(t.dy))?r:0;const u=null!=(o=dn(t[G]))?o:dn(t[Z]);if(u&&!(null==(a=t.children)?void 0:a.length)&&p(u,i),t.children)for(const e of t.children)m(e,i)},y=pn(t);if(t.children)for(const e of t.children)m(e,y);const v=null!=(o=dn(t[G]))?o:dn(t[Z]);v&&!(null==(a=t.children)?void 0:a.length)&&p(v,y);const g=dn(t.textAnchor);if("middle"===g||"end"===g)for(const t of f){const e=d[t.line].end-d[t.line].start,n="middle"===g?-e/2:-e;t.m=[t.scale,0,0,t.scale,t.x+n,t.y]}return _n(t,Mn(f,s,l),s)}function kn(t,e){var n,r,o,a,i;if(null==(n=e.alongPath)?void 0:n.pathD)return function(t,e,n){var r;const{glyphs:o,warnings:a,alongPath:i}=n,s=Ye(e);if(!s)return null==a||a.push("textGlyphs: unparsable along-path geometry (caret)"),[];const l=vn(o),u=[];let c=0;const f=(t,e)=>{var n,r,i;const s=hn(t,e),d=null!=(n=dn(t[G]))?n:dn(t[Z]);if(d&&!(null==(r=t.children)?void 0:r.length)){const t=yn(s,o,l,a),e=(null==t?void 0:t.unitsPerEm)||1e3,n=s.fontSize/e,r=(null!=(i=null==t?void 0:t.ascent)?i:.9*e)*n;for(let e=0;e<d.length;e++){const o=d.charAt(e),a=null==t?void 0:t.glyphs[o],i=(a?a.width:0)*n,l=i+s.letterSpacing+(" "===o?s.wordSpacing:0);u.push({advStart:c,advEnd:c+l,glyphW:i,ascent:r,fontSize:s.fontSize}),c+=l}}if(t.children)for(const e of t.children)f(e,s)};f(t,pn(t));const h=c,p=(null==i?void 0:i.textLength)&&i.textLength>0&&h>0?i.textLength/h:1,m=d(null==i?void 0:i.startOffset),{along:y,perp:v}=wn(t),g=y+("animated"===m.kind?Number(null==(r=m.keyframes[0])?void 0:r.value)||0:"static"===m.kind&&Number(m.value)||0),b=t=>({x:t.x-v*Math.sin(t.angle),y:t.y+v*Math.cos(t.angle),angle:t.angle});return u.map(t=>{const e=g+t.advStart*p,n=g+t.advEnd*p,r=b(s.sampleAtDistance(e)),o=b(s.sampleAtDistance(n)),a=s.sampleAtDistance(g+(t.advStart+t.glyphW/2)*p);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*a.angle/Math.PI}})}(t,e.alongPath.pathD,e);const{glyphs:s,warnings:l}=e,u=vn(s),f={x:null!=(r=fn(t.x))?r:0,y:null!=(o=fn(t.y))?o:0},h=[],p=[{start:f.x,end:f.x}];let m=0;const y=(t,e)=>{var n;const r=yn(e,s,u,l),o=(null==r?void 0:r.unitsPerEm)||1e3,a=e.fontSize/o,i=(null!=(n=null==r?void 0:r.ascent)?n:.9*o)*a;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)*a+e.letterSpacing+(" "===o?e.wordSpacing:0);h.push({x:f.x,y:f.y,width:l,ascent:i,fontSize:e.fontSize,line:m}),f.x+=l,p[m].end=f.x}},v=(t,e)=>{var n,r,o,a;const i=hn(t,e),s=fn(t.x),l=fn(t.y);void 0!==s&&(f.x=s,m=p.length,p.push({start:f.x,end:f.x})),void 0!==l&&(f.y=l),f.x+=null!=(n=fn(t.dx))?n:0,f.y+=null!=(r=fn(t.dy))?r:0;const u=null!=(o=dn(t[G]))?o:dn(t[Z]);if(u&&!(null==(a=t.children)?void 0:a.length)&&y(u,i),t.children)for(const e of t.children)v(e,i)},g=pn(t);if(t.children)for(const e of t.children)v(e,g);const b=null!=(a=dn(t[G]))?a:dn(t[Z]);b&&!(null==(i=t.children)?void 0:i.length)&&y(b,g);const k=dn(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 An(t,e,n,r,o=0){const{x:a,y:i,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,a-n*l*c-o*u,i-n*u*c+o*l]}function wn(t){var e,n,r;return{along:(null!=(e=fn(t.x))?e:0)+(null!=(n=fn(t.dx))?n:0),perp:null!=(r=fn(t.dy))?r:0}}function xn(t,e,n,r,o,a){var i;const{glyphs:s,create:c=rn,warnings:f}=r,h=e?Ye(e):null;if(!h)return null==f||f.push("textGlyphs: unparsable along-path geometry"),null;const p=vn(s),{cells:m,width:y}=function(t,e,n,r){const o=[];let a=0;const i=(t,s)=>{var l,u,c;const f=hn(t,s),d=null!=(l=dn(t[G]))?l:dn(t[Z]);if(d&&!(null==(u=t.children)?void 0:u.length)){const t=yn(f,e,n,r);if(t){const e=f.fontSize/t.unitsPerEm,n=null!=(c=t.ascent)?c:.9*t.unitsPerEm,r=mn(f);for(let i=0;i<d.length;i++){const s=d.charAt(i),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:a+t/2}),a+=t}else if(/\S/.test(s)){const i=l&&l.width>0?l.width:.6*t.unitsPerEm,s=i*e;o.push({glyphD:gn(i,n),widthEm:i,scale:e,paint:r,midBase:a+s/2}),a+=s}else a+=(l?l.width:0)*e;a+=f.letterSpacing+(" "===s?f.wordSpacing:0)}}}if(t.children)for(const e of t.children)i(e,f)};return i(t,pn(t)),{cells:o,width:a}}(t,s,p,f);if(!m.length)return _n(t,[],c);const{along:v,perp:g}=wn(t);if(o&&o>0&&y>0){const t=o/y;for(const e of m)e.midBase*=t}const b="clip"===a&&!h.closed,k=d(n);if("animated"===k.kind&&k.keyframes.length>=2)return _n(t,function(t,e,n,r,o,a,i=0,s=0){const c=Math.max(e.totalLength/jn,.5),f=t=>Number(t.time)||0,d=t=>i+(Number(t.value)||0),h=t=>t>=0&&t<=e.totalLength,p=[];for(const i of t){const t=[i.scale,0,0,i.scale,-i.scale*(i.widthEm/2),0],m=un(i.glyphD,t),y=(t,n)=>{const{x:r,y:o,angle:a}=e.sampleAtDistance(t),i=Math.cos(a),l=Math.sin(a);return{time:n,value:{translate:[On(r-s*l,3),On(o+s*i,3)],rotate:On(180*a/Math.PI,3)}}},v=[],g=[],b=(t,e)=>{v.push(y(t,e)),a&&g.push({time:e,value:h(t)?1:0})};b(d(n[0])+i.midBase,f(n[0]));for(let t=1;t<n.length;t++){const e=f(n[t-1]),r=f(n[t]),o=d(n[t-1]),a=d(n[t]),s=Math.min(Sn,Math.max(1,Math.ceil(Math.abs(a-o)/c)));for(let t=1;t<=s;t++){const n=t/s;b(o+n*(a-o)+i.midBase,e+n*(r-e))}}const k={keyframes:v};void 0!==r&&(k.loop=r);const A={transform:k};if(a&&g.some(t=>0===t.value)){const t={keyframes:g};void 0!==r&&(t.loop=r),A.opacity=t}p.push(o("path",u(l({d:m},Pn(i.paint)),{animate:A}),[]))}return p}(m,h,k.keyframes,k.loop,c,b,v,g),c);const A=v+("animated"===k.kind?Number(null==(i=k.keyframes[0])?void 0:i.value)||0:"static"===k.kind&&Number(k.value)||0);return _n(t,Mn((b?m.filter(t=>{const e=A+t.midBase;return e>=0&&e<=h.totalLength}):m).map(t=>({glyphD:t.glyphD,paint:t.paint,m:An(h,A+t.midBase,t.scale,t.widthEm,g)})),c,f),c)}var jn=48,Sn=64;function On(t,e){const n=i(10,e);return Math.round(t*n)/n}function Pn(t){const e={};return void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),e}function Mn(t,e,n){var r,o,a;if(!t.length)return null==n||n.push("textGlyphs: nothing to render"),[];const i=new Map;for(const e of t){const t=JSON.stringify([null!=(r=e.paint.fill)?r:null,null!=(o=e.paint.stroke)?o:null,null!=(a=e.paint.strokeWidth)?a:null]),n=un(e.glyphD,e.m),s=i.get(t);s?s.d+=n:i.set(t,{paint:e.paint,d:n})}const s=[];for(const{paint:t,d:n}of i.values())s.push(e("path",l({d:n},Pn(t)),[]));return s}function _n(t,e,n){const r={};for(const e of Object.keys(t))"type"!==e&&"children"!==e&&-1===cn.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 zn(t,e){return e.alongPath?xn(t,e.alongPath.pathD,e.alongPath.startOffset,e,e.alongPath.textLength,e.alongPath.pathOverflow):bn(t,e)}function In(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 Cn(t){var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0}function Nn(t){var e;return null!=(e=t.easing)?e:t.e}function En(t){var e,n,r;const o=null!=(e=t.keyframes)?e:t.kfs;if(!Array.isArray(o))return!1;if(t.autoOrient)return!0;for(const t of o)if((null!=(n=t.tangentIn)?n:t.ti)||(null!=(r=t.tangentOut)?r:t.to))return!0;return!1}var Tn=new WeakMap;function Ln(t,e,n,r){var o,a;const i=Tn.get(t);if(i)return i;const s=null!=(o=t.tangentOut)?o:t.to,l=null!=(a=e.tangentIn)?a:e.ti,u=[n[0]+(s?s[0]:0),n[1]+(s?s[1]:0)],c=[r[0]+(l?l[0]:0),r[1]+(l?l[1]:0)],f=Ze(n,u,c,r),d={P0:n,P1:u,P2:c,P3:r,lut:f,totalArc:f.ds[f.ds.length-1]};return Tn.set(t,d),d}function Fn(t,e,n,r,o,a){const i=Ln(t,e,n,r),s=0===i.totalArc?o:function(t,e){const n=t.ds[t.ds.length-1],r=e*n,{ts:o,ds:a}=t,i=a.length-1;if(r<=0)return o[0];if(r>=a[i])return o[i];let s=1,l=i;for(;s<l;){const t=s+l>>>1;a[t]<r?s=t+1:l=t}const u=a[l-1],c=a[l]-u,f=c>0?(r-u)/c:0;return o[l-1]+f*(o[l]-o[l-1])}(i.lut,o),l=We(i.P0,i.P1,i.P2,i.P3,s);if(!a)return{translate:l};const u=qe(i.P0,i.P1,i.P2,i.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}function Dn(t,e){var n,r,o,a;if(!En(t))return t;const i=null!=(n=t.keyframes)?n:t.kfs;if(!Array.isArray(i)||i.length<2)return t;const s=!!t.autoOrient,l=null!=(r=null==e?void 0:e.flatnessTolerance)?r:.5,u=null!=(o=null==e?void 0:e.rotationTolerance)?o:5,c=null!=(a=null==e?void 0:e.maxSamplesPerSegment)?a:32,f=[],d=In(i[0]);if(!d)return t;const h=s?function(t,e){const n=In(t),r=In(e);if(!n||!r)return 0;const o=Ln(t,e,n,r),a=qe(o.P0,o.P1,o.P2,o.P3,0);return 180*Math.atan2(a[1],a[0])/Math.PI}(i[0],i[1]):void 0;f.push(Un(Cn(i[0]),Wn(Vn(i[0]),Vn(i[0]),0,d,h,s)));for(let t=0;t<i.length-1;t++){const e=i[t],n=i[t+1],r=In(e),o=In(n);r&&o?(s&&t>0&&qn(f,e,n,r,o,u),Gn(f,e,n,r,o,s,l,u,c)):f.push(Un(Cn(n),Wn(Vn(n),Vn(n),1,null!=o?o:[0,0],void 0,s)))}const p=Nn(i[i.length-1]);p&&(f[f.length-1].e=p),s&&function(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}}(f);const m={kfs:f};return void 0!==t.loop&&(m.loop=t.loop),m}function Un(t,e){return{t:t,v:e}}function Vn(t){var e;const n=null!=(e=t.value)?e:t.v;if(n&&"object"==typeof n&&!Array.isArray(n))return n}function Rn(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 a="number"==typeof t[o]?t[o]:0,i="number"==typeof e[o]?e[o]:0;r[o]=a+(i-a)*n}return r}return n<.5?t:e}function Wn(t,e,n,r,o,a){const i={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&&a)continue;const o=null==t?void 0:t[r],s=null==e?void 0:e[r];void 0===o&&void 0===s||(i[r]=Rn(o,s,n))}return void 0!==o&&(i.rotate=o+Bn(t,e,n)),i}function Bn(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 a=Rn(r,o,n);return"number"==typeof a?a:0}function qn(t,e,n,r,o,a){var i;const s=t[t.length-1],l=null!=(i=s.v)?i:s.value,u=null==l?void 0:l.rotate;if("number"!=typeof u)return;const c=Vn(e),f=u-Bn(c,c,0),d=Ln(e,n,r,o),h=qe(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)<=a)return;const y=Wn(Vn(e),Vn(e),0,r,p,!0);t.push(Un(Cn(e),y))}function Gn(t,e,n,r,o,a,i,s,l){const u=Ln(e,n,r,o),c=Cn(e),f=Cn(n),d=Nn(e),h=(p=d)?Oe([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=Vn(e),y=Vn(n),v=function(t,e,n,r,o){const a=[];Zn(t.P0[0],t.P1[0],t.P2[0],t.P3[0],a),Zn(t.P0[1],t.P1[1],t.P2[1],t.P3[1],a),a.sort((t,e)=>t-e);const i=[0];for(const t of a)t>i[i.length-1]+1e-6&&t<.999999&&i.push(t);i.push(1);const s=[],l={remaining:o-i.length};for(let o=0;o<i.length-1;o++)Kn(i[o],i[o+1],s,t,e,n,r,l);return s}(u,a,i,s,l),g=[];for(const t of v){const e=Ke(u.lut,t),n=Re(u.totalArc>0?e/u.totalArc:t,0,1),r={u:Re(h(n),0,1),p:n,pos:We(u.P0,u.P1,u.P2,u.P3,t)};if(a){const e=qe(u.P0,u.P1,u.P2,u.P3,t);r.rotateDeg=180*Math.atan2(e[1],e[0])/Math.PI}g.push(r)}let b=d,k=0;const A=t.length-1;for(let e=0;e<g.length;e++){const n=g[e],r=k<1?Re((n.u-k)/(1-k),0,1):1,{left:o,right:i}=Me(b,r),s=0===e?A:t.length-1;o?t[s].e=o:delete t[s].e;const l=c+n.u*(f-c),u=Wn(m,y,n.p,n.pos,n.rotateDeg,a);t.push(Un(l,u)),b=i,k=n.u}}function Zn(t,e,n,r,o){const a=e-t,i=n-e,s=a-2*i+(r-n),l=2*(i-a),u=a;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 Kn(t,e,n,r,o,a,i,s){const l=(t+e)/2,u=We(r.P0,r.P1,r.P2,r.P3,t),c=We(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=We(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=We(r.P0,r.P1,r.P2,r.P3,l),p=We(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(Qn(d,u,c),Qn(h,u,c),Qn(p,u,c));let y=!0;if(o){const n=qe(r.P0,r.P1,r.P2,r.P3,t),o=qe(r.P0,r.P1,r.P2,r.P3,e),a=180*Math.atan2(n[1],n[0])/Math.PI,s=180*Math.atan2(o[1],o[0])/Math.PI;let l=Math.abs(a-s);l>180&&(l=360-l),l>i&&(y=!1)}m<=a&&y||s.remaining<=0||f<1e-6?n.push(e):(s.remaining-=1,Kn(t,l,n,r,o,a,i,s),Kn(l,e,n,r,o,a,i,s))}function Qn(t,e,n){const r=n[0]-e[0],o=n[1]-e[1],a=r*r+o*o;if(a<1e-20){const n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}const i=(t[0]-e[0])*o-(t[1]-e[1])*r;return Math.abs(i)/Math.sqrt(a)}function Xn(t,e){const n=Yn(t,e);return null!=n?n:t}function Yn(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=Yn(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&&En(n)){const o=Dn(n,e);o!==n&&(r=u(l({},t),{transform:o}))}}if(!n&&!r)return null;const a=l({},t);return n&&(a.children=n),r&&(a.animate=r),a}function Jn(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,a=o[3]||0,i=o[4]||0,s=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([i,s]),n.i.push([r,a]),n.o.push([i,s])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function Hn(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function $n(t){return"string"==typeof t&&void 0!==Hn(t)}function tr(t){if(t&&"object"==typeof t&&"string"==typeof t.path){const e=Hn(t.path);return e?{paths:Jn(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&$n(e[0])){const t=[];for(const n of e){const e=Hn(n);e&&t.push(...Jn(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&$n(t[0])){const e=[];for(const n of t){const t=Hn(n);t&&e.push(...Jn(t))}return{paths:e}}return{paths:t}}if($n(t)){return{paths:Jn(Hn(t))}}return t}function er(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 nr(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 rr(t,e,n,r){var o,a;if("d"===t){return{paths:xe(null!=(o=null==e?void 0:e.paths)?o:Array.isArray(e)?e:[],null!=(a=null==n?void 0:n.paths)?a:Array.isArray(n)?n:[],r)}}return Ce.has(t)?we(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?ke(e,n,r):Ne.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?Ae(e||[],n||[],r):ke(+(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 a of r){const r=null==t?void 0:t[a],i=null==e?void 0:e[a];if("rotate"===a)o[a]=ke(+(null!=r?r:0),+(null!=i?i:0),n);else if("translate"===a||"scale"===a||"origin"===a){const t="scale"===a?[1,1]:[0,0];o[a]=Ae(r||t,i||t,n)}else o[a]=null!=i?i:r}return o}(e,n,r)}function or(t,e,n,r){var o,a,i,s,l;const u=e.length-1,c=Re(null!=(o=n.segmentCount)?o:u,1,u);let f;f=n.before?e.slice(0,c+1):e.slice(u-c);const d=null!=(a=e[0].t)?a:0,h=null!=(i=e[e.length-1].t)?i:0;let p,m;n.before?(p=0,m=d):(p=h,m=r);const y=m-p;if(y<=0)return e;const v=null!=(s=f[0].t)?s:0,g=(null!=(l=f[f.length-1].t)?l:0)-v;if(g<=0)return e;const b=f.map(t=>{var e,n;return{relT:(t.t-v)/g,v:t.v,e:t.e,tangentIn:null!=(e=t.tangentIn)?e:t.ti,tangentOut:null!=(n=t.tangentOut)?n:t.to}}),k=Math.floor(y/g),A=y-k*g,w=A/g,x=[];function j(e,n,r){let o;if(n){o=[];for(let t=b.length-1;t>=0;t--)o.push({relT:1-b[t].relT,v:b[t].v,e:t>0?_e(b[t-1].e):void 0,tangentIn:b[t].tangentOut,tangentOut:b[t].tangentIn})}else o=b;const a=void 0!==r?r:1;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT>a+1e-9){const i=o[n-1],s=r.relT-i.relT,l=(a-i.relT)/s,u=i.e?Oe(i.e)(l):l,c=rr(t,i.v,r.v,u),{left:f}=Me(i.e,l);return x.length>0&&i.relT<=a&&(x[x.length-1].e=f),void x.push({t:e+a*g,v:c,e:void 0})}const i={t:e+r.relT*g,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(i.tangentIn=r.tangentIn),r.tangentOut&&(i.tangentOut=r.tangentOut),x.push(i)}}if(n.before){if(w>1e-9){!function(e,n,r){let o;if(n){o=[];for(let t=b.length-1;t>=0;t--)o.push({relT:1-b[t].relT,v:b[t].v,e:t>0?_e(b[t-1].e):void 0,tangentIn:b[t].tangentOut,tangentOut:b[t].tangentIn})}else o=b;const a=1-r;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT<a-1e-9)continue;const i=o[n-1];if(i&&i.relT<a-1e-9&&r.relT>a+1e-9){const n=r.relT-i.relT,o=(a-i.relT)/n,s=i.e?Oe(i.e)(o):o,l=rr(t,i.v,r.v,s),{right:u}=Me(i.e,o);x.push({t:e,v:l,e:u})}const s={t:e+(r.relT-a)*g,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),x.push(s)}}(p,!!n.alternate&&k%2==0,w)}for(let t=0;t<k;t++){const e=k-1-t,r=!!n.alternate&&e%2==0;j(p+A+t*g,r)}}else{for(let t=0;t<k;t++){const e=!!n.alternate&&t%2==0;j(p+t*g,e)}if(w>1e-9){const t=!!n.alternate&&k%2==0;j(p+k*g,t,w)}}return n.before?[...x,...e]:[...e,...x]}function ar(t,e,n,r){var o,a,i,s,l,u,c;const f=e.keyframes||e.kfs||[],d=[];for(const e of f){const n=null!=(a=null!=(o=e.time)?o:e.t)?a:0;let f=null!=(i=e.value)?i:e.v;const h=null!=(s=e.easing)?s:e.e;"d"===t&&(f=tr(f));const p=De(t)?Ve(t):t;Ce.has(p)&&(f=null!=(l=Ie(f))?l:f);const m={t:n,v:f,e:er(h,r)},y=null!=(u=e.tangentIn)?u:e.ti,v=null!=(c=e.tangentOut)?c:e.to;y&&(m.tangentIn=y),v&&(m.tangentOut=v),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?or(t,d,p,n):d}function ir(t,e,n){var r;const o=e.loop;if(null==o||!1===o)return e;const a=!0===o?{}:o,i=null!=(r=e.keyframes)?r:e.kfs;if(!Array.isArray(i)||i.length<2)return e;const s=De(t)?Ve(t):t,l=Ce.has(s),u=i.map(e=>{var n,r,o,a,i,s,u,c;const f=null!=(n=e.t)?n:e.time;let d=null!=(r=e.v)?r:e.value;"d"===t&&(d=tr(d)),l&&(d=null!=(o=Ie(d))?o:d);const h={t:f,v:d,e:null!=(a=e.e)?a:e.easing};return(null!=(i=e.tangentIn)?i:e.ti)&&(h.tangentIn=null!=(s=e.tangentIn)?s:e.ti),(null!=(u=e.tangentOut)?u:e.to)&&(h.tangentOut=null!=(c=e.tangentOut)?c:e.to),h}),c={kfs:or(t,u,a,n)};return void 0!==e.autoOrient&&(c.autoOrient=e.autoOrient),c}function sr(t,e){const n=lr(t,e);return null!=n?n:t}function lr(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=lr(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],a=ir(n,o,e);a!==o&&(r||(r=l({},t)),r[n]=a)}}if(!n&&!r)return null;const a=l({},t);return n&&(a.children=n),r&&(a.animate=r),a}var ur=0;function cr(t,e=q.webapi){const n=Ft(t)||{},r=Dt(t),o=n.duration||1e3,a=[],i=(t,n)=>{if(!n)return null;const a=function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=nr(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=nr(r,e);t&&n.push(t)}else n.push(t);return n}(n,r);if(0===a.length)return null;const i=function(t,e,n,r=q.webapi){const o={};for(const[a,i]of Object.entries(t)){const t=ar(a,i,e,n);if(t.length>0){const e={kfs:t};void 0!==i.autoOrient&&(e.autoOrient=i.autoOrient),void 0!==i.loop&&(e.loop=i.loop),o[a]=r===q.webapi&&"transform"===a?Dn(e):e}}return o}(function(t){const e={};for(const n of t)for(const[t,r]of Object.entries(n))e[t]=r;return e}(a),o,r,e);return 0===Object.keys(i).length?null:{id:t,animate:i}},s=Ut(t);if(s)for(const t of s){const e=i(t.id,t.animate);e&&a.push(e)}const l=t=>{const e=t.animate;if(e&&Object.keys(e).length>0){const n=t.id||"_px_el_"+ ++ur;t.id=n;const r=i(n,e);r&&a.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 a}function fr(t,e,n){var r,o,a,i,s,l,u;const c=e.kfs||e.keyframes||[];if(0===c.length)return null;const{prevKf:f,nextKf:d}=function(t,e){var n,r;let o=t[0],a=t[t.length-1];for(let i=0;i<t.length-1;i++){const s=null!=(n=t[i].t)?n:0,l=null!=(r=t[i+1].t)?r:0;if(s<=e&&e<=l){o=t[i],a=t[i+1];break}}return{prevKf:o,nextKf:a}}(c,n);let h=f===d?0:(p=n,m=null!=(r=f.t)?r:0,y=null!=(o=d.t)?o:0,v=0,g=1,y===m?v:v+(p-m)/(y-m)*(g-v));var p,m,y,v,g;h=Re(h,0,1);const b=null!=(a=f.e)?a:f.easing;if(b&&Array.isArray(b))try{h=Oe(b)(h)}catch(t){}let k=De(t)?Ve(t):t,A=null;const w=null!=(i=null==f?void 0:f.v)?i:null==f?void 0:f.value,x=null!=(s=null==d?void 0:d.v)?s:null==d?void 0:d.value;if("d"===k){A=xe(null!=(l=null==w?void 0:w.paths)?l:Array.isArray(w)?w:[],null!=(u=null==x?void 0:x.paths)?u:Array.isArray(x)?x:[],h).map(t=>be(t)).join("")}else if(Ce.has(k))A=ze(we(w||[0,0,0,1],x||[0,0,0,1],h)),k=t;else if("stroke-dasharray"===k)A=Ae(w||[],x||[],h).join(" "),k=t;else if("transform"!==k||null===w||"object"!=typeof w||Array.isArray(w))if("translate"===k){A="translate("+Ae(w||[0,0],x||[0,0],h).join(",")+")",k="transform"}else if("rotate"===k){A="rotate("+ke(+(w||0),+(x||0),h)+")",k="transform"}else if("scale"===k){A="scale("+Ae(w||[1,1],x||[1,1],h).join(",")+")",k="transform"}else{A=ke(+(w||0),+(x||0),h)}else{const t=new Set([...w?Object.keys(w):[],...x?Object.keys(x):[]]),n={};for(const e of t){const t=null==w?void 0:w[e],r=null==x?void 0:x[e];if("rotate"===e)n.rotate=ke(+(null!=t?t:0),+(null!=r?r:0),h);else if("translate"===e||"scale"===e||"origin"===e){const o="scale"===e?[1,1]:[0,0],a=Ae(t||o,r||o,h);n[e]=a}}if(En(e)){const t=w.translate,r=x.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=Fn(f,d,[+t[0],+t[1]],[+r[0],+r[1]],h,!!e.autoOrient);n.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(n.rotate=o.rotateDeg)}}A=Te(n,{withUnits:!1}),k="transform"}return Ee.has(k)&&"number"==typeof A&&(A=100*A+"%"),{k:k,v:null===A?"":""+A}}function dr(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=fr(r,o,e);t&&(n[t.k]=t.v)}return n}function hr(t,e,n,r){if(!e)return t;const o=!!e.trimAllAsOne,a=[],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;if("rect"!==t.type)return;const a=Number(null!=(e=t.x)?e:0),i=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"+(a+s)+","+i+"L"+(a+s)+","+(i+l)+"L"+a+","+(i+l)+"L"+a+","+i+"L"+(a+s)+","+i+"z"}(t);if(void 0===e)return;const n=Jn(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){const e=Or(t);r.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}a.push(r)};if(i(t),!a.length)return t;let s=0;const c=o?[...a].reverse():a;for(const t of c)for(const e of t.subpaths)o||(s=0),e.startOffsetPx=s,s+=e.lengthPx;const f=s;if(o&&f<.001)return t;const h=d(e.offset),p="absent"===h.kind?{kind:"static",value:0}:h,m=function(t){const e=d(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=jr(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),a=[];let i=0;for(const t of n){for(;i<o.length&&o[i]<t.time;){const t=o[i++],e=Sr(n,t),r=(e[0]+e[1])/2;a.push({time:t,value:[r,r]})}const e=t.value[0]>t.value[1]?[t.value[1],t.value[0]]:t.value;a.push({time:t.time,value:e,easing:t.easing})}for(;i<o.length;){const t=o[i++],e=Sr(n,t),r=(e[0]+e[1])/2;a.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:a}}(e.range),y="absent"===m.kind?{kind:"static",value:[0,1]}:m,v=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}(p),g=[v.length?Math.min(...v):0,v.length?Math.max(...v):0];if(1===a.length&&a[0].leaf===t&&1===a[0].subpaths.length){const e=a[0],n=e.subpaths[0],r=o?f:n.lengthPx;if(r<.001)return t;const i=o?n.startOffsetPx/r:0;return function(t,e,n,r,o,a){const i=vr(n,e,r),s=gr(e,r),u=l({},t);return delete u.effects,Ar(u,"strokeDasharray",kr(a,s)),Ar(u,"strokeDashoffset",kr(o,i)),Ar(u,"strokeOpacity",xr(a)),u}(e.leaf,r,i,g,p,y)}const b=new Map;for(const t of a){const e=[];for(const n of t.subpaths){const a=o?f:n.lengthPx;if(a<.001)continue;const i=o?n.startOffsetPx/a:0;e.push(...mr(t.leaf,n.subpath,a,i,g,p,y,r))}b.set(t.leaf,pr(t.leaf,e))}const k=t=>{const e=b.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?u(l({},t),{children:t.children.map(k)}):t)};return k(t)}function pr(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 mr(t,e,n,r,o,a,i,s){const l=vr(r,n,o),u=gr(n,o),c=kr(a,l),f=kr(i,u),d=xr(i),h=function(t){return{type:"path",d:t}}(be(e));return Ar(h,"strokeDasharray",f),Ar(h,"strokeDashoffset",c),Ar(h,"strokeOpacity",d),[h]}var yr=1;function vr(t,e,n){const[r]=br(n);return n=>e*(-n-r+t)+yr}function gr(t,e){const[n,r]=br(e),o=r-n+1;return e=>{const n=Re(e[0],0,1),r=Re(e[1],0,1),a=Math.min(n,r),i=Math.max(n,r),s=[0];let l=yr;for(let e=0;e<o;e++)s.push(l+a*t),s.push((i-a)*t),l=(1-i)*t;return s.push(l+yr),s}}function br(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function kr(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,a;return{time:null!=(r=null!=(n=t.time)?n:t.t)?r:0,value:e(null!=(o=t.value)?o:t.v),easing:null!=(a=t.easing)?a:t.e}}),loop:t.loop}}function Ar(t,e,n){var r,o;if(!n)return;if("static"===n.kind)return void(t[e]=n.value);const a=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,i=l({},a||{}),s={keyframes:n.keyframes};void 0!==n.loop&&(s.loop=n.loop),i[e]=s,t.animate=i;const u=n.keyframes[0];u&&void 0!==(null!=(r=u.value)?r:u.v)&&(t[e]=null!=(o=u.value)?o:u.v)}var wr=10;function xr(t){var e,n,r,o,a,i;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!=(a=u.value)?a:u.v):h,m=c?h&&s(null!=(i=c.value)?i:c.v):h;p&&!m?(f.push({time:d,value:0}),f.push({time:d+wr,value:1})):!p&&m&&(f.push({time:d-wr,value:1}),f.push({time:d,value:0}))}return f.length<=1?void 0:{kind:"animated",keyframes:f}}function jr(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,a=n(r);if(0===a)return r;const i=n(o);if(0===i)return o;if(a*i>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;a*e<0?o=t:(r=t,a=e)}return(r+o)/2}function Sr(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],a=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*a,r.value[1]+(o.value[1]-r.value[1])*a]}return t[t.length-1].value}function Or(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+=Pr(t,r,r+1);return t.c&&e.length>1&&(n+=Pr(t,e.length-1,0)),n}function Pr(t,e,n){var r,o,a,i;const s=t.v,l=s[e],u=s[n],c=Ze(l,null!=(o=null==(r=t.o)?void 0:r[e])?o:l,null!=(i=null==(a=t.i)?void 0:a[n])?i:u,u);return c.ds[c.ds.length-1]}function Mr(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:(null==(e=Ft(t))?void 0:e.mode)===B.frames?q.frames:q.webapi,glyphs:null==(n=Dt(t))?void 0:n.glyphs},o=Qt(t);Kt(o,r.idMap),v(o,r,()=>Gt(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,a;const i=null==(a=null==(o=t.effects)?void 0:o.maskedBy)?void 0:a.href;if("string"==typeof i){n.add(t);const r=e.idMap.get(i);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=se(t,e),a=n?[...r,n]:r;for(const e of t.children)o(e,a)}};o(t,[])}(o,r);const a=function(t,e){return function(t,e){e.idMap.clear(),Kt(t,e.idMap);const n=[],r=t=>{var e;he(t)&&n.push(t),null==(e=t.children)||e.forEach(r)};r(t);for(const t of n){const n=he(t);n&&(pe(t),me(t,fe(n),e))}}(t,e),t}(_r(o,r),r);return function(t,e){if(!e.length)return;(t.children||(t.children=[])).unshift({type:"defs",children:e})}(a,r.defs),{root:a,defs:r.defs,warnings:r.warnings,errors:r.errors}}function _r(t,e){var n;t.children&&(t.children=t.children.map(t=>_r(t,e)));const r=t.effects,o="string"==typeof t.id?t.id:void 0,a=o?e.contentRefInnerIds.get(o):void 0;if(!r&&!a)return t;const{transformation:i,repeater:s,maskedBy:l,clipPath:u,trimPath:c,clone:f,fillGradient:d,strokeGradient:h,textPath:m,text:y}=null!=r?r:{};null==r||r.isCombinedShape;r&&delete t.effects;let v=t,b=!1;if(null==y?void 0:y.useGlyphs)if(m){const t="string"==typeof m.path?m.path:void 0,r=m.textLength,o="number"==typeof r?r:r&&"object"==typeof r?"number"==typeof r.value?r.value:Array.isArray(r.keyframes)&&r.keyframes.length?Number(null==(n=r.keyframes[0])?void 0:n.value):void 0:void 0,a=function(t,e,n,r,o,a){return e.glyphs?xn(t,n,r,{glyphs:e.glyphs,warnings:e.warnings},o,a):(e.warnings.push("textGlyphs: no definitions.glyphs"),null)}(v,e,t,m.startOffset,o,m.pathOverflow);a&&(v=a,b=!0)}else v=function(t,e,n){return(null==e?void 0:e.useGlyphs)?n.glyphs?bn(t,{glyphs:n.glyphs,warnings:n.warnings}):(n.warnings.push("textGlyphs: no definitions.glyphs — left as native <text>"),t):t}(v,y,e),b=!0;return b||(v=function(t,e,n){var r;if(!e||"string"!=typeof e.path||!e.path)return t;const o=Gt(n,"tpath"),{d:a,startShift:i}=en(e.path,{pathOverflow:e.pathOverflow,startOffset:e.startOffset,textLength:e.textLength,advance:He(t)});n.defs.push({type:"path",id:o,d:a});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),nn(s,"startOffset",tn(e.startOffset,i)),nn(s,"textLength",e.textLength),t.children=[s],t}(v,m,e)),v=function(t,e,n){return Xt(t,e,n,"fill")}(v,d,e),v=function(t,e,n){return Xt(t,e,n,"stroke")}(v,h,e),v=hr(v,c,0,e),v=function(t,e,n){var r,o;if(!e)return t;const a=null!=(r=e.copies)?r:1;if(a<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const i=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=Qt(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate);const u=[l];for(let t=1;t<a;t++){const r=Qt(l),o=ce(e,t),a=o?p(r,o,n):r;u.push(a)}const c={type:"g",children:u};return void 0!==i&&(c.transform=i),void 0!==s&&(c.animate={transform:s}),c}(v,s,e),v=$t(v,l,i,e),v=function(t,e,n){if(!e||!e.d&&!e.animate)return t;const r=Gt(n,"clip"),o={type:"path",d:e.d};return e.animate&&(o.animate={d:e.animate}),n.defs.push({type:"clipPath",id:r,children:[o]}),t.clipPath="url(#"+r+")",t}(v,u,e),a?(ue(v,f,e),v=g(v,i,o,a,e)):v=function(t,e,n,r){return ue(t,e,r),p(t,n,r)}(v,f,i,e),(null==f?void 0:f.retime)&&(t.effects={clone:{retime:f.retime}}),o&&e.idMap.set(o,v),v}function zr(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 a=n.get(t);if(void 0!==a)return a;if(r.has(t))return!1;r.add(t);let i=!1;if(t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate))for(const e in t.animate){i=!0;break}if(!i&&t.children)for(const e of t.children)if(o(e,r)){i=!0;break}if(!i&&"use"===t.type&&"string"==typeof t.href){const n=Cr(t.href),a=n?e.get(n):void 0;a&&(i=o(a,r))}return r.delete(t),n.set(t,i),i};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 a=function(t){const e=Er(t.viewBox);if(e)return[e[2],e[3]];const n=Ir(t.width),r=Ir(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),i=[],s=Tr(t,n,r,()=>"_lw_use_mat_"+ ++o,i,a);if(0===i.length)return s;const c={type:"defs",children:i},f=[...null!=(e=s.children)?e:[],c];return u(l({},s),{children:f})}function Ir(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function Cr(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function Nr(t,e,n,r,o,a,i){var s,c,f,d;const h=Rt(e);Wt(h,o);const p="symbol"===h.type?Er(h.viewBox):void 0,m=null!=(c=null!=(s=Ir(t.width))?s:null==p?void 0:p[2])?c:i[0],y=null!=(d=null!=(f=Ir(t.height))?f:null==p?void 0:p[3])?d:i[1],v="symbol"===h.type?function(t,e,n,r,o){const a=Er(t.viewBox),i=u(l({},t),{type:"g"});if(delete i.viewBox,delete i.preserveAspectRatio,delete i.width,delete i.height,!a)return i;const[s,c,f,d]=a,h=f>0&&d>0?Math.min(r/f,o/d):1,p=(r-f*h)/2,m=(o-d*h)/2,y=[];0===p&&0===m||y.push("translate("+p+","+m+")");1!==h&&y.push("scale("+h+")");0===s&&0===c||y.push("translate("+-s+","+-c+")");y.length&&(i.transform=y.join(""));const v=e();return n.push({type:"clipPath",id:v,children:[{type:"rect",x:s,y:c,width:f,height:d}]}),i.clipPath="url(#"+v+")",i}(h,o,a,m,y):h,g=Tr(v,n,r,o,a,i),b=u(l({},t),{type:"g",children:[g]});return delete b.href,delete b.width,delete b.height,qt(b)}function Er(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 Tr(t,e,n,r,o,a){if("use"===t.type&&"string"==typeof t.href){const i=Cr(t.href);if(i&&n.has(i)){const s=e.get(i);if(s)return Nr(t,s,e,n,r,o,a)}}if(!t.children)return t;let i=!1;const s=t.children.map(t=>{const s=Tr(t,e,n,r,o,a);return s!==t&&(i=!0),s});return i?u(l({},t),{children:s}):t}function Lr(t,e,n){var r,o;let a=Mr(t).root;return a=sr(a,null!=(o=null==(r=Ft(a))?void 0:r.duration)?o:1e3),e===q.webapi&&(a=Xn(a,null==n?void 0:n.motionPath),a=zr(a),a=function(t){const e=t=>t.startsWith("#")?t.slice(1):t,n=(t,e)=>{var r;e(t),null==(r=t.children)||r.forEach(t=>n(t,e))};let r=!0;for(;r;){r=!1;const o=new Set;n(t,t=>{"use"===t.type&&"string"==typeof t.href&&o.add(e(t.href))}),n(t,t=>{if(!t.children)return;let e=t.children;"defs"===t.type&&(e=e.filter(t=>!(("g"===t.type||"symbol"===t.type)&&"string"==typeof t.id&&!o.has(t.id)))),e=e.filter(t=>!("defs"===t.type&&(!t.children||0===t.children.length))),e.length!==t.children.length&&(t.children=e,r=!0)})}return t}(a)),a}var Fr=new Set(["script","foreignobject"]),Dr=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),Ur=new Set(["href","xlink:href","src"]),Vr=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,Rr=/^data:image\/svg\+xml(?:;[^,]*)?,/i,Wr=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,Br=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function qr(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(Dr.has(n)){const t=String(e);return t.startsWith("#")||(/^url\(#[^)]+\)$/.test(t)||Ur.has(n)&&(Vr.test(t)||Rr.test(t)||function(t){const e=Wr.exec(t);return!!e&&Br.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 Gr(t){const e={};for(const n of Object.keys(t)){const r=Fe(n);if(K.has(r))continue;if("style"===r)continue;let o=t[n];Ce.has(r)&&Array.isArray(o)?e[r]=ze(o):"transform"===r&&null!==o&&"object"==typeof o&&!Array.isArray(o)&&o.value&&"object"==typeof o.value?e.transform=Te(o.value,{withUnits:!1}):Ne.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),e.transform=r+"("+o+")"):null!=o&&(e[r]=String(o))}return e}function Zr(t,e){if(!t)return null;const n=t,{type:r,children:o,style:a}=n,i=c(n,["type","children","style"]),s=i.funcType;void 0!==s&&delete i.funcType;const l=Dt(t)||e,u=function(t,e){var n;if(t)return"string"==typeof t?null==(n=null==e?void 0:e.styles)?void 0:n[t]:t}(a,l);let f;if(o)for(const t of o){const e=Zr(t,l);e&&(f||(f=[]),f.push(e))}const d=function(t,e,n,r,o){if(Fr.has(t.toLowerCase()))return console.warn("SVG tag blocked (dangerous): ",t),null;const a=document.createElementNS("http://www.w3.org/2000/svg",t);for(const t in e){const n=qr(t,e[t]);void 0!==n&&a.setAttribute(Ve(t),n)}if(n)for(const t in n)a.style[t]=String(n[t]);if(r)for(const t of r)a.appendChild(t);return o&&(a.textContent=o),a}(r||"g",Gr(i),u,f,i[G]||i[Z]);return d&&void 0!==s&&d.setAttribute("type",s),d}function Kr(t,e){const{startOn:n,outAction:r="continue",scrollIntoViewThreshold:o=.5}=e,a=t.getRootElement();if(!a)return console.warn("setupAnimationTriggers: No root element found for animation."),t;let i=!1;const s=()=>{i&&(i=!1,t.setPlaybackRate(1)),t.play()},l=()=>{switch(r){case"pause":t.pause();break;case"reset":t.cancel();break;case"reverse":i=!0,t.setPlaybackRate(-1),t.play()}};switch(n){case"load":{const t=()=>s();"complete"===document.readyState?t():window.addEventListener("load",t,{once:!0});break}case"mouseOver":{const t=()=>s(),e=()=>l();a.addEventListener("mouseenter",t),a.addEventListener("mouseleave",e);break}case"click":{const e=()=>{t.isPlaying()?l():s()};a.addEventListener("click",e);break}case"scrollIntoView":new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&t.intersectionRatio>=o?s():l()})},{threshold:o}).observe(a);break}return t}function Qr(t){return"#"+t}function Xr(t,e,n){var r;const o=Ft(t)||{},a=cr(t,q.frames),i=o.iterations;let s=1;"number"==typeof i&&(s=i||1),"infinite"===i&&(s=1/0),s<1&&(s=1);const l=+(o.duration||1e3),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,y=-(o.delay||0),v=0,g=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)*g:0;return y+t},j=()=>{let t=x();return Number.isFinite(u)&&t>u&&(t=u),t<0&&(t=0),t};function S(t){let n=function(){const e=l>0?l:1;let n=0,r=0;if(l>0){t=Re(t,0,s*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,s-1);n=Re((t-r*e)/e,0,1)}else n=t;const o=c||"normal";let a=n;return"reverse"===o?a=1-n:"alternate"===o?r%2==1&&(a=1-n):"alternate-reverse"===o&&r%2==0&&(a=1-n),a}();for(const t of a||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=dr(r,n*l);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}o.delay&&(o.delay<0?S(j()):h&&S(0));const O=()=>!!m&&(!!e.isConnected()&&(g<0?x()>0:!(Number.isFinite(u)&&j()>=u))),P=t=>{null!==p&&(cancelAnimationFrame(p),p=null),(t||O())&&(p=requestAnimationFrame(()=>{p=null,(()=>{var t,r;if(!e.isConnected())return void M();const o=j(),a=x();if(a<0&&g>0)h&&S(0);else{if(g<0&&a<=0)return M(),S(0),void(b||(b=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)));if(g>0&&u&&Number.isFinite(u)&&o>=u)return M(),S(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}S(o)}})(),P()}))},M=()=>{if(!m)return;let t=x();Number.isFinite(u)&&t>u&&(t=u),y=t,v=0,m=!1,null!==p&&(cancelAnimationFrame(p),p=null),t>=0?S(t):h&&S(0)},_={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>O(),play:()=>{var t;(()=>{if(!m){if(g>=0)Number.isFinite(u)&&y>=u&&(y=0);else if(y<=0){if(!Number.isFinite(u))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");y=u}b=!1,m=!0,v=Date.now(),P(!0)}})(),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;M(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;M(),y=0,v=0,m=!1,b=!1,S(y),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;y=Number.isFinite(u)?u:j(),v=0,m=!1,null!==p&&(cancelAnimationFrame(p),p=null),S(d?y: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!=g<0&&(b=!1),g=t,y=e,m&&(v=Date.now())},getCurrentTime:()=>j(),setCurrentTime:t=>{t<0&&(t=0),Number.isFinite(u)&&t>u&&(t=u),y=t,m&&(v=Date.now()),(!Number.isFinite(u)||t<u)&&(b=!1),S(j())},destroy:()=>{var t;_.cancel(),null==(t=null==n?void 0:n.onRemove)||t.call(n)}};return _}function Yr(t,e,n,r){const o=Ft(t)||{};if(!r)if(t.id){const e=Qr(t.id);(r=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");let a=Xr(t,e||function(t){const e=new Set,n={isConnected:()=>!t||t.isConnected,setAttribute:(n,r,o)=>{r=Ve(r);const a=Qr(n),i=(null==t?void 0:t.querySelectorAll(a))||document.querySelectorAll(a);0!==i.length||e.has(a)||(e.add(a),console.warn('setAttribute: No elements found for selector "'+a+'"'));for(let t=0;t<i.length;t++){const e=i[t];e.setAttribute(r,o),Le.has(r)&&(e.style[r]=o)}}};return n}(r),n);return a=u(l({},a),{getRootElement:()=>r||null}),o.trigger&&Kr(a,o.trigger),a}function Jr(t,e,n,r){var o,a;let i=null!=(o=t.v)?o:t.value;const s=null!=(a=t.e)?a:t.easing,l={offset:e,easing:s&&Array.isArray(s)?"cubic-bezier("+s.join(",")+")":void 0};let u,c=n;return Ce.has(n)&&Array.isArray(i)?u=ze(i):"transform"!==n||null===i||"object"!=typeof i||Array.isArray(i)?Ne.has(n)?(Array.isArray(i)&&("translate"===n&&(i=i.map(t=>t+"px")),i=i.join(",")),"rotate"===n&&(i+="deg"),u=n+"("+i+")",c="transform"):u=""+i:(u=Te(i,{withUnits:!0}),c="transform"),CSS.supports(c,u)||r.add(c),c=Fe(c),l[c]=u,l}function Hr(t,e,n){var r,o,a,i,s;const c=[];for(let f=0;f<e.length;f++){const d=e[f],h=null!=(r=d.t)?r:0;if(h<0){const n=e[f+1];if(n&&(null!=(o=n.t)?o:0)>=0){const e=(0-h)/((null!=(a=n.t)?a:0)-h),r=d.e?Oe(d.e)(e):e,{right:o}=Me(d.e,e);c.push({t:0,v:rr(t,d.v,n.v,r),e:o})}continue}if(h>n){const r=e[f-1];if(r&&(null!=(i=r.t)?i:0)<=n){const e=null!=(s=r.t)?s:0,o=(n-e)/(h-e),a=r.e?Oe(r.e)(o):o,{left:i}=Me(r.e,o);c.length>0&&(c[c.length-1]=u(l({},c[c.length-1]),{e:i})),c.push({t:n,v:rr(t,r.v,d.v,a),e:void 0})}break}c.push(d)}return c}function $r(t,e,n){var r;const o=new Map;for(const[a,i]of Object.entries(t)){const t=n.duration||1,s=Hr(a,i.kfs||i.keyframes||[],t),c=[];for(let n=0;n<s.length;n++){const o=s[n],i=Jr(o,Re((null!=(r=o.t)?r:0)/t,0,1),a,e);0===n&&(i.offset||0)>0&&c.push(u(l({},i),{offset:0})),c.push(i)}c.length>0&&(c[c.length-1].offset||0)<1&&c.push(u(l({},c[c.length-1]),{offset:1})),c.length>0&&o.set(a,c)}return o}function to(t,e,n,r){var o;const a=Ft(t)||{};if(!n)if(t.id){const e=Qr(t.id);(n=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");const i=cr(t,q.webapi),s=[],l=a.iterations;let u;"number"==typeof l&&(u=l),"infinite"===l&&(u=1/0);const c=new Set;let f=!1,d=!1;(null==i?void 0:i.length)||console.warn("createWebApiAnimator: No animation bindings defined");for(const t of i||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("createWebApiAnimator: Empty or unresolved binding",t);continue}const i=Qr(t.id),l=(null==n?void 0:n.querySelectorAll(i))||document.querySelectorAll(i);0===l.length&&console.warn('createWebApiAnimator: No elements found for selector "'+i+'"');const h=$r(r,c,a),p=a.delay&&a.delay>0?a.delay:void 0;let m;if(a.delay&&a.delay<0&&a.duration){const t=-a.delay;m=u===1/0?t%a.duration:Math.min(t,a.duration*(null!=u?u:1))}const y={duration:a.duration,delay:p,fill:null!=(o=a.fill)?o:"forwards",direction:a.direction,iterations:u};for(let t=0;t<l.length;t++){const n=l[t];for(const[,t]of h)if(t.length>0)try{const r=new KeyframeEffect(n,t,y),o=new Animation(r,document.timeline);(null==e?void 0:e.onFinish)&&(o.onfinish=()=>{var t;f||(f=!0,null==(t=e.onFinish)||t.call(e))}),(null==e?void 0:e.onRemove)&&(o.onremove=()=>{var t;d||(d=!0,null==(t=e.onRemove)||t.call(e))}),void 0!==m&&(o.currentTime=m),s.push(o)}catch(t){console.warn(t)}}}if(!r&&c.size)return console.warn("Unsupported CSS attrs: "+[...c].join(", ")),null;const h={isReady:()=>!0,getRootElement:()=>n||null,isPlaying:()=>{var t;return"running"===(null==(t=s[0])?void 0:t.playState)},play:()=>{var t;f=!1,s.forEach(t=>t.play()),null==(t=null==e?void 0:e.onPlay)||t.call(e)},pause:()=>{var t;s.forEach(t=>t.pause()),null==(t=null==e?void 0:e.onPause)||t.call(e)},cancel:()=>{var t;f=!1,s.forEach(t=>t.cancel()),null==(t=null==e?void 0:e.onCancel)||t.call(e)},finish:()=>{var t;for(const e of s)try{(null==(t=e.effect)?void 0:t.getTiming().iterations)===1/0?(e.effect.updateTiming({iterations:1}),e.finish(),e.effect.updateTiming({iterations:1/0})):e.finish()}catch(t){e.cancel()}},setPlaybackRate:t=>(s.forEach(e=>e.playbackRate=t),h),getCurrentTime:()=>{var t,e;const n=null!=(e=null==(t=s[0])?void 0:t.currentTime)?e:null;return null!==n?+n:null},setCurrentTime:t=>{f=!1,s.forEach(e=>{e.currentTime=t})},destroy:()=>{var t;h.cancel(),s.splice(0,s.length),d||(d=!0,null==(t=null==e?void 0:e.onRemove)||t.call(e))}};return a.trigger&&Kr(h,a.trigger),h}var eo=0;function no(){return"_px_"+Date.now().toString(36)+(++eo).toString(36)+Math.random().toString(36).substring(2,6)}function ro(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>ro(t));const e=t,n={};for(const t of Object.keys(e))n[t]=ro(e[t]);return n}function oo(t){var e,n;const r=ro(t),o=new Map,a=new Set(["href","xlink:href"]),i=new Set(["fill","stroke","clip-path","clipPath","mask","marker","marker-start","marker-mid","marker-end","filter","flood-color","lighting-color"]),s=new Set(["baseId","targetId","boundElementId"]);!function t(e){if(e&&"object"==typeof e){if(e.id&&"string"==typeof e.id){const t=e.id,n=no();o.set(t,n),e.id=n}else e.animate&&(e.id=no());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(a.has(n)&&r.startsWith("#")){const t=r.slice(1),a=o.get(t);a&&(e[n]="#"+a)}else if(i.has(n))e[n]=ao(r,o);else if(s.has(n)){const t=o.get(r);t&&(e[n]=t)}else r.includes("url(#")&&(e[n]=ao(r,o));else if("style"===n&&"object"==typeof r&&null!==r)for(const[t,e]of Object.entries(r))"string"==typeof e&&(r[t]=ao(e,o));else"object"==typeof r&&null!==r&&t(r);else if(Array.isArray(r))for(const e of r)t(e)}(r);const c=null==(e=r.animator)?void 0:e.animate;if(c&&"object"==typeof c){const t={};for(const[e,r]of Object.entries(c)){t[null!=(n=o.get(e))?n:e]=r}r.animator=u(l({},r.animator),{animate:t})}return r}function ao(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}function io(t,e,n,r){const o=_t(t);for(const t of o)console.warn("[PxAnimator] effects shape warning:",t);t=Lr(t,(Ft(t)||{}).mode===B.frames?q.frames:q.webapi);let a=null;if(r&&t.children){t=oo(t);const e="string"==typeof r?document.querySelector(r):r;e&&(a=Zr(t),a&&e.replaceChildren(a))}return function(t,e,n,r){const o=Ft(t)||{};let a;return a=o.mode===B.frames?Yr(t,e,n,r):to(t,n,r,o.mode===B.webapi)||Yr(t,e,n,r),o.debugInstName&&(window[o.debugInstName]=a),a}(t,e,n,a)}var so="data";function lo(t){const{src:e,data:n,adapter:r,callbacks:o,container:a}=t;if(void 0!==n&&void 0!==e)throw new Error("createAnimator: provide either `src` or `data`, not both");if(void 0===n&&void 0===e)throw new Error("createAnimator: either `src` or `data` is required");if(void 0!==n)return io(n,r,o,a);let i=null,s=[],l=!1;const u=t=>{i?t(i):s&&s.push(t)};return fetch(e).then(t=>t.json()).then(t=>{if(!l)if(Tt(t)){i=io(t,r,o,a);const e=s;s=null,null==e||e.forEach(t=>t(i))}else console.error('createAnimator: invalid animation document format at "'+e+'"')}).catch(t=>{s=null,console.error('createAnimator: failed to load "'+e+'"',t)}),{isReady:()=>!!i,getRootElement:()=>i?i.getRootElement():null,isPlaying:()=>(null==i?void 0:i.isPlaying())||!1,play:()=>{u(t=>t.play())},pause:()=>{u(t=>t.pause())},cancel:()=>{u(t=>t.cancel())},finish:()=>{u(t=>t.finish())},setPlaybackRate:t=>{u(e=>e.setPlaybackRate(t))},getCurrentTime:()=>i?i.getCurrentTime():null,setCurrentTime:t=>{u(e=>e.setCurrentTime(t))},destroy:()=>{l=!0,s=null,null==i||i.destroy()}}}function uo(){const t=document.querySelectorAll("["+R+"]");for(let e=0;e<t.length;e++){const n=t[e];if(!n[W]){const t=n.getAttribute(R);t&&(n[W]=lo({src:t,container:n}))}}}"undefined"!=typeof window&&(window.loadTagAnimators=uo,window.createAnimator=lo,window.setupAnimationTriggers=Kr);var co=[1,0,0,1,0,0];function fo(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 ho=(t,e)=>[1,0,0,1,t,e],po=(t,e)=>[t,0,0,e,0,0];function mo(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var yo=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],vo=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function go(t){let e=co;t.translate&&(e=fo(e,ho(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=fo(e,ho(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=fo(e,mo(t.rotate))),t.scale&&(e=fo(e,po(t.scale[0],t.scale[1]))),n&&(e=fo(e,ho(-t.origin[0],-t.origin[1]))),e}function bo(t,e,n){return t+(e-t)*n}function ko(t,e){return null==t?co:"string"==typeof t?function(t){let e=co;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=fo(e,ho(n[0]||0,n[1]||0)):"scale"===t?e=fo(e,po(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=fo(e,mo(n[0])):"skewX"===t?e=fo(e,yo(n[0])):"skewY"===t?e=fo(e,vo(n[0])):"matrix"===t&&(e=fo(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?go(function(t,e){var n,r,o,a,i,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!=(a=c.time)?a:0))/((null!=(i=f.time)?i:0)-(null!=(s=c.time)?s:0)||1),h=c.value||{},p=f.value||{},m={};return h.translate&&p.translate?m.translate=[bo(h.translate[0],p.translate[0],d),bo(h.translate[1],p.translate[1],d)]:m.translate=h.translate||p.translate,void 0!==h.rotate&&void 0!==p.rotate?m.rotate=bo(h.rotate,p.rotate,d):m.rotate=null!=(l=h.rotate)?l:p.rotate,h.scale&&p.scale?m.scale=[bo(h.scale[0],p.scale[0],d),bo(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?go(t.value):co}var Ao=new Set(["svg","g","symbol"]),wo=new Set(["defs","mask","clipPath","title"]);function xo(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>xo(t,e))}function jo(t){return null==t?0:Number(t)}function So(t){return Math.round(100*t)/100+0}function Oo(t,e,n){var r,o,a,i,s;const l=null!=(r=t.fill)?r:"",u=null!=(o=t.stroke)?o:"",c=null!=(i=null!=(a=t["stroke-width"])?a:t.strokeWidth)?i:"",f=So(function(t,e,n,r){var o,a,i,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!=(a=e[e.length-1].time)?a:0))return e[e.length-1].value;let n=0;for(;n<e.length-1&&(null!=(i=e[n+1].time)?i: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 bo(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(So).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return jo(t.width)+","+jo(t.height)+","+jo(t.x)+","+jo(t.y);case"ellipse":return jo(t.rx)+","+jo(t.ry)+","+jo(t.cx)+","+jo(t.cy);case"circle":return jo(t.r)+","+jo(t.cx)+","+jo(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+h+"]|f:"+l+"|s:"+u+"|sw:"+(jo(c)||"")+"|o:"+f+"|m:"+d}function Po(t,e,n,r,o){var a;const i=t.type||"";if(wo.has(i))return;const s=fo(e,function(t,e){return t.animate&&t.animate.transform?ko(t.animate.transform,e):void 0!==t.transform?ko(t.transform,e):co}(t,n));if("use"===i){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",a=r.get(e),i=fo(s,ho(jo(t.x),jo(t.y)));return void(a?Po(a,i,n,r,o):o.push("UNRESOLVED_USE:#"+e))}Ao.has(i)?null==(a=t.children)||a.forEach(t=>Po(t,s,n,r,o)):o.push(Oo(t,s,n))}function Mo(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=>Mo(t,e))}function _o(t,e){const n=new Map;xo(t,n);const r=[];return Po(t,co,e,n,r),r.sort()}function zo(t,e){const n=new Set;Mo(t,n),Mo(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=_o(t,o),a=_o(e,o),i=Io(n,a),s=Io(a,n);(i.length||s.length)&&r.push({time:o,onlyInA:i,onlyInB:s})}return r}function Io(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{Ce as COLOUR_ATTR_NAMES,so as PX_ANIMATOR_DATA_KEY,W as PX_ANIM_ATTR_NAME,R as PX_ANIM_SRC_ATTR_NAME,H as PX_TRANSFORM_PART_KEYS,Nt as PxAnimatedSvgDocumentSchema,et as PxAnimationDefinitionSchema,st as PxAnimatorConfigSchema,q as PxAnimatorEngine,B as PxAnimatorMode,ut as PxAttrValueSchema,Et as PxBezierPathSchema,lt as PxBindingSchema,gt as PxCloneEffectSchema,it as PxDefsSchema,Q as PxEasingOrRefSchema,Mt as PxEffectsSchema,nt as PxElementAnimationSchema,jt as PxFillGradientEffectSchema,kt as PxGradientSpreadMethod,wt as PxGradientStopSchema,At as PxGradientType,bt as PxGradientUnits,X as PxKeyframeSchema,Y as PxLoopSchema,pt as PxMaskedByEffectSchema,zt as PxNodeBase,It as PxNodeSchema,J as PxPropertyAnimationSchema,ht as PxRepeaterEffectSchema,vt as PxRetimeEffectSchema,St as PxStrokeGradientEffectSchema,Ct as PxSvgNodeExtra,Pt as PxTextEffectSchema,Ot as PxTextPathEffectSchema,$ as PxTransformPartsSchema,tt as PxTransformValueSchema,dt as PxTransformationEffectSchema,rt as PxTriggerSchema,yt as PxTrimPathEffectSchema,Le as STYLE_ATTR_NAMES,Ne as TRANSFORM_FN_NAMES,Mr as applyPlayerEffects,dr as calcAnimationValues,Ve as camelCaseToKebabWordIfNeeded,Mo as collectSampleTimes,lo as createAnimator,io as createAnimatorImpl,Xr as createBasicFrameLoopAnimator,Yr as createFrameLoopAnimator,Ye as createPathSampler,to as createWebApiAnimator,U as describeSchema,zo as diffInEffect,Fn as evaluateMotionPathSegment,en as extendedPathForBrowser,oo as generateNewIds,Ft as getAnimatorConfig,Ut as getBindings,Vt as getChildren,Dt as getDefs,Gr as getNormalizedProps,Tt as isPxElementFileFormat,Lt as isPxElementFileFormatDeep,rn as jsonElementFactory,kn as layoutGlyphTextChars,uo as loadTagAnimators,Lr as materialiseAllInTree,zr as materialiseAnimatedUseInstances,zn as materialiseGlyphText,xn as materialiseGlyphTextAlongPath,bn as materialiseGlyphTextHorizontal,ir as materialiseInternalLoopsInPropAnim,sr as materialiseInternalLoopsInTree,Dn as materialiseMotionPathInPropAnim,Xn as materialiseMotionPathsInTree,cr as normalizeDocument,En as propAnimIsMotionPath,V as px,Zr as renderNode,D as schemaKeys,Kr as setupAnimationTriggers,tn as shiftAnimatable,ze as toRGBA,_t as validateNodeEffects,_o as visualModelAt};
|