@aarsteinmedia/dotlottie-player 5.2.2 → 5.2.3
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/CHANGELOG.md +2 -1
- package/dist/index.js +7 -7
- package/dist/unpkg.js +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
Changelog was only added since [3.2.3], so it's not exhaustive. [Please report any missing noteable changes to us](https://github.com/aarsteinmedia/dotlottie-player/issues), and we'll add them promptly.
|
|
9
9
|
|
|
10
|
-
## [5.2.
|
|
10
|
+
## [5.2.3] - 11-06-2025
|
|
11
11
|
|
|
12
12
|
### Changed
|
|
13
13
|
|
|
@@ -289,6 +289,7 @@ Changelog was only added since [3.2.3], so it's not exhaustive. [Please report a
|
|
|
289
289
|
- Removed dependencies
|
|
290
290
|
- `@lit`
|
|
291
291
|
|
|
292
|
+
[5.2.3]: https://www.npmjs.com/package/@aarsteinmedia/dotlottie-player/v/5.2.3
|
|
292
293
|
[5.2.0]: https://www.npmjs.com/package/@aarsteinmedia/dotlottie-player/v/5.2.0
|
|
293
294
|
[5.1.13]: https://www.npmjs.com/package/@aarsteinmedia/dotlottie-player/v/5.1.13
|
|
294
295
|
[5.1.11]: https://www.npmjs.com/package/@aarsteinmedia/dotlottie-player/v/5.1.11
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isServer, createElementID, PreserveAspectRatio as PreserveAspectRatio$1, PlayerEvents } from '@aarsteinmedia/lottie-web/utils';
|
|
2
2
|
export { PlayerEvents } from '@aarsteinmedia/lottie-web/utils';
|
|
3
3
|
import Lottie from '@aarsteinmedia/lottie-web';
|
|
4
4
|
import { strToU8, zip, strFromU8, unzip as unzip$1 } from 'fflate';
|
|
@@ -6,7 +6,7 @@ import { strToU8, zip, strFromU8, unzip as unzip$1 } from 'fflate';
|
|
|
6
6
|
/**
|
|
7
7
|
* Credit to: Leonardo Favre https://github.com/leofavre/observed-properties.
|
|
8
8
|
*/ const updateOnConnected = Symbol('UPDATE_ON_CONNECTED');
|
|
9
|
-
if (
|
|
9
|
+
if (isServer) {
|
|
10
10
|
// Mock HTMLElement for server-side rendering
|
|
11
11
|
global.HTMLElement = // eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
12
12
|
class EmptyHTMLElement {
|
|
@@ -258,13 +258,13 @@ const hasExt = (path)=>{
|
|
|
258
258
|
*
|
|
259
259
|
* @param str - Base64 encoded string.
|
|
260
260
|
* @returns UTF-8/Latin-1 binary.
|
|
261
|
-
*/ base64ToU8 = (str)=>strToU8(
|
|
261
|
+
*/ base64ToU8 = (str)=>strToU8(isServer ? Buffer.from(parseBase64(str), 'base64').toString('binary') : atob(parseBase64(str)), true), getExtFromB64 = (str)=>{
|
|
262
262
|
const mime = str.split(':')[1].split(';')[0], ext = mime.split('/')[1].split('+')[0];
|
|
263
263
|
return ext;
|
|
264
264
|
}, handleErrors = (err)=>{
|
|
265
265
|
const res = {
|
|
266
266
|
message: 'Unknown error',
|
|
267
|
-
status:
|
|
267
|
+
status: isServer ? 500 : 400
|
|
268
268
|
};
|
|
269
269
|
if (err && typeof err === 'object') {
|
|
270
270
|
if ('message' in err && typeof err.message === 'string') {
|
|
@@ -474,7 +474,7 @@ async function resolveAssets(unzipped, assets) {
|
|
|
474
474
|
}
|
|
475
475
|
toResolve.push(new Promise((resolveAsset)=>{
|
|
476
476
|
let assetB64;
|
|
477
|
-
if (
|
|
477
|
+
if (isServer) {
|
|
478
478
|
assetB64 = Buffer.from(u8).toString('base64');
|
|
479
479
|
} else {
|
|
480
480
|
let result = '';
|
|
@@ -1678,7 +1678,7 @@ const generator = '@aarsteinmedia/dotlottie-player';
|
|
|
1678
1678
|
if (!this.animateOnScroll || !this._lottieInstance) {
|
|
1679
1679
|
return;
|
|
1680
1680
|
}
|
|
1681
|
-
if (
|
|
1681
|
+
if (isServer) {
|
|
1682
1682
|
console.warn('DotLottie: Scroll animations might not work properly in a Server Side Rendering context. Try to wrap this in a client component.');
|
|
1683
1683
|
return;
|
|
1684
1684
|
}
|
|
@@ -1874,7 +1874,7 @@ const generator = '@aarsteinmedia/dotlottie-player';
|
|
|
1874
1874
|
*
|
|
1875
1875
|
*/ globalThis.dotLottiePlayer = ()=>new DotLottiePlayer();
|
|
1876
1876
|
const tagName = 'dotlottie-player';
|
|
1877
|
-
if (!
|
|
1877
|
+
if (!isServer) {
|
|
1878
1878
|
customElements.define(tagName, DotLottiePlayer);
|
|
1879
1879
|
}
|
|
1880
1880
|
|
package/dist/unpkg.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t){"use strict";let e,s,i,r=()=>"",a=(s=0,()=>(s++,`${r()}__lottie_element_${s}`));var n,o,h,l,p,m,c,d,u,f,g,y,v,b,_,x=((n={}).Complete="complete",n.Destroyed="destroyed",n.Error="error",n.Frame="frame",n.Freeze="freeze",n.Load="load",n.Loop="loop",n.Next="next",n.Pause="pause",n.Play="play",n.Previous="previous",n.Ready="ready",n.Rendered="rendered",n.Stop="stop",n),w=((o={}).Contain="xMidYMid meet",o.Cover="xMidYMid slice",o.Initial="none",o.None="xMinYMin slice",o);let E=!("undefined"!=typeof window&&document);class C{constructor(t,e,s,i){this.type=t,this.currentTime=e,this.totalTime=s,this.direction=i<0?-1:1}}class S{constructor(t,e){this.type=t,this.direction=e<0?-1:1}}class k{constructor(t,e,s,i){this.type=t,this.direction=s,this.currentTime=e,this.totalTime=i}}class M{constructor(t,e,s,i){this.type=t,this.currentLoop=s,this.totalLoops=e,this.direction=i<0?-1:1}}class P{constructor(t,e,s){this.type=t,this.firstFrame=e,this.totalFrames=s}}class A{constructor(t,e){this.type=t,this.target=e}}class T{constructor(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}}class D{constructor(t,e){this.type="configError",this.nativeError=t}}class I{addEventListener(t,e){return this._cbs[t]=this._cbs[t]??[],this._cbs[t].push(e),()=>{this.removeEventListener(t,e)}}removeEventListener(t,e){if(!e){this._cbs[t]=null;return}if(this._cbs[t]){let s=0,{length:i}=this._cbs[t];for(;s<i;)this._cbs[t][s]===e&&(this._cbs[t].splice(s,1),s--,i--),s++;0===this._cbs[t].length&&(this._cbs[t]=null)}}triggerEvent(t,e){if(!this._cbs[t])return;let{length:s}=this._cbs[t];for(let i=0;i<s;i++)this._cbs[t][i](e)}constructor(){this._cbs={}}}var F=((h={}).Float32="float32",h.Int16="int16",h.Int32="int32",h.Uint8="uint8",h.Uint8c="uint8c",h),L=((l={}).MouseModifier="ms",l.OffsetPathModifier="op",l.PuckerAndBloatModifier="pb",l.RepeaterModifier="rp",l.RoundCornersModifier="rd",l.TrimModifier="tm",l.ZigZagModifier="zz",l),$=((p={}).Contain="xMidYMid meet",p.Cover="xMidYMid slice",p.Initial="none",p.None="xMinYMin slice",p),N=((m={}).Canvas="canvas",m.HTML="html",m.SVG="svg",m),V=((c={}).Ellipse="el",c.Fill="fl",c.GradientFill="gf",c.GradientStroke="gs",c.Group="gr",c.Merge="mm",c.NoStyle="no",c.OffsetPath="op",c.Path="sh",c.PolygonStar="sr",c.PuckerBloat="pb",c.Rectangle="rc",c.Repeater="rp",c.RoundedCorners="rd",c.Stroke="st",c.Transform="tr",c.Trim="tm",c.Twist="tw",c.Unknown="ms",c.ZigZag="zz",c),R=((d={}).TransformEffect="transformEffect",d),O=((u={}).MultiDimensional="multidimensiional",u.Shape="shape",u.TextSelector="textSelector",u.Transform="transform",u.UniDimensional="unidimensional",u);let z={1:"butt",2:"round",3:"square"},B={1:"miter",2:"round",3:"bevel"},G={},q=(t,e)=>{G[t]=e},j=t=>{if(!G[t])throw Error("Could not get renderer");return G[t]},W=()=>{if(G.canvas)return N.Canvas;let t=Object.keys(G),{length:e}=t;for(let s=0;s<e;s++)if(G[t[s]])return t[s];return N.SVG},H="",Y=()=>H,U=(t,e)=>1e5*Math.abs(t-e)<=Math.min(Math.abs(t),Math.abs(e)),J=t=>1e-5>=Math.abs(t),X=(t,e)=>U(t[0],e[0])&&U(t[1],e[1]),K=(i=0,()=>(i++,`${Y()}__lottie_element_${i}`)),Z=(t,e=0,s=100)=>{let i=e,r=s;if(i>r){let t=r;r=i,i=t}return Math.min(Math.max(t,i),r)},Q=t=>Symbol.iterator in Object(t)&&t.length>0,tt=t=>Q(t)&&"number"==typeof t[0],te=t=>!(!t||Q(t))&&"_type"in t&&"ShapePath"===t._type,ts=(t,e,s)=>{let i,r=[];for(let t=0;t<256;t++)i=t.toString(16),r[t]=1===i.length?`0${i}`:i;let a=t,n=e,o=s;return t<0&&(a=0),e<0&&(n=0),s<0&&(o=0),`#${r[a]}${r[n]}${r[o]}`},ti=Math.PI/180,tr="http://www.w3.org/1999/xlink",ta="http://www.w3.org/2000/svg",tn=!("undefined"!=typeof window&&document),to="undefined"!=typeof navigator,th="undefined"!=typeof navigator&&/^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent);class tl{constructor(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}addAudio(t){this.audios.push(t)}createAudio(t){return this.audioFactory?this.audioFactory(t):!tn&&"Howl"in window?new window.Howl({src:[t]}):{isPlaying:!1,play:()=>{this.isPlaying=!0},playing:()=>{throw Error(`${this.constructor.name}: Method playing is not implemented`)},rate:()=>{throw Error(`${this.constructor.name}: Method rate is not implemented`)},seek:()=>{this.isPlaying=!1},setVolume:()=>{throw Error(`${this.constructor.name}: Method setVolume is not implemented`)}}}getVolume(){return this._volume}mute(){this._isMuted=!0,this._updateVolume()}pause(){for(let t of this.audios)t.pause()}resume(){for(let t of this.audios)t.resume()}setAudioFactory(t){this.audioFactory=t}setRate(t){for(let e of this.audios)e.setRate(t)}setVolume(t){this._volume=t,this._updateVolume()}unmute(){this._isMuted=!1,this._updateVolume()}_updateVolume(){let{length:t}=this.audios;for(let e=0;e<t;e++)this.audios[e].volume(!this._isMuted*this._volume)}}function tp(t,e,s,i){let r,a=new XMLHttpRequest;try{a.responseType="json"}catch(t){}a.onreadystatechange=()=>{if(4===a.readyState){if(200===a.status)return void s(r=tm(a));try{r=tm(a),s(r)}catch(t){i?.(t)}}};try{a.open("GET",t,!0)}catch(s){a.open("GET",`${e}/${t}`,!0)}a.send()}function tm(t){let e=t.getResponseHeader("content-type");return e&&"json"===t.responseType&&e.includes("json")||t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):null}function tc(t,e){let s,{length:i}=t;for(let a=0;a<i;a++)if("ks"in(s=t[a])&&!s.completed){if(s.completed=!0,s.hasMask){let t=s.masksProperties,{length:e}=t??[];for(let s=0;s<e;s++){let e=t?.[s].pt?.k;if(!e)continue;if(!Q(e)){tf(e);continue}let{length:i}=e;for(let t=0;t<i;t++){let s=e[t].e,i=e[t].s;s&&tf(s[0]),i&&tf(i[0])}}}switch(s.ty){case 0:s.layers=td(s.refId,e),tc(s.layers,e);break;case 4:tu(s.shapes);break;case 5:var r;r=s,r.t?.a?.length===0&&r.t.p}}}function td(t,e){if(!t||!e)return;let s=function(t,e){let s=0,{length:i}=e;for(;s<i;){if(e[s].id===t)return e[s];s++}return null}(t,e);return s?.layers?s.layers.__used?JSON.parse(JSON.stringify(s.layers)):(s.layers.__used=!0,s.layers):null}function tu(t=[]){let{length:e}=t;for(let s=e-1;s>=0;s--){if(t[s].ty===V.Group){tu(t[s].it);continue}if(t[s].ty===V.Path){let e=t[s].ks?.k;if(!Q(e)){tf(e);continue}let{length:i}=e;for(let t=0;t<i;t++){let s=e[t].e,i=e[t].s;s&&tf(s[0]),i&&tf(i[0])}}}}function tf(t){if(!t)return;let{length:e}=t.i;for(let s=0;s<e;s++)t.i[s][0]+=t.v[s][0],t.i[s][1]+=t.v[s][1],t.o[s][0]+=t.v[s][0],t.o[s][1]+=t.v[s][1]}function tg(t,e){let s=e?e.split(".").map(Number):[100,100,100];return t[0]>s[0]||!(s[0]>t[0])&&(t[1]>s[1]||!(s[1]>t[1])&&(t[2]>s[2]||!(s[2]>t[2])&&null))}let ty=(t,e,s)=>{let{length:i}=t;for(let r=0;r<i;r++)t[r].ty===s&&e(t[r])},tv=(()=>{let t=[4,4,14],e=t=>{let e=t.t?.d;t.t&&e&&(t.t.d={k:[{s:e,t:0}]})};return s=>{if(!tg(t,s.v))return;ty(s.layers,e,5);let{length:i}=s.assets;for(let t=0;t<i;t++)s.assets[t].layers&&ty(s.assets[t].layers,e,5)}})(),tb=(()=>{let t=[4,7,99];return e=>{if(!e.chars||tg(t,e.v))return;let{length:s}=e.chars;for(let t=0;t<s;t++){let s=e.chars[t];s.data?.shapes&&(tu(s.data.shapes),s.data.ip=0,s.data.op=99999,s.data.st=0,s.data.sr=1,s.data.ks={a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]}},e.chars[t].t||(s.data.shapes.push({ty:V.NoStyle}),s.data.shapes[0].it?.push({a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sa:{a:0,k:0},sk:{a:0,k:0},ty:V.Transform})))}}})(),t_=(()=>{let t=[5,7,15],e=t=>{let e=t.t?.p;e&&("number"==typeof e.a&&(e.a={a:0,k:e.a}),"number"==typeof e.p&&(e.p={a:0,k:e.p}),"number"==typeof e.r&&(e.r={a:0,k:e.r}))};return s=>{if(!tg(t,s.v))return;ty(s.layers,e,5);let{length:i}=s.assets;for(let t=0;t<i;t++)s.assets[t].layers&&ty(s.assets[t].layers,e,5)}})(),tx=(()=>{let t=[4,1,9],e=t=>{let{length:s}=t;for(let i=0;i<s;i++){if(t[i].ty===V.Group){e(t[i].it??[]);continue}if(t[i].ty!==V.Fill&&t[i].ty!==V.Stroke)continue;let s=t[i].c?.k;if(!s||"number"==typeof s)continue;if(Q(s)&&tt(s)){s[0]/=255,s[1]/=255,s[2]/=255,s[3]/=255;continue}let{length:r}=s;for(let t=0;t<r;t+=1)s[t].s[0]/=255,s[t].s[1]/=255,s[t].s[2]/=255,s[t].s[3]/=255,s[t].e[0]/=255,s[t].e[1]/=255,s[t].e[2]/=255,s[t].e[3]/=255}},s=t=>{let{length:s}=t;for(let i=0;i<s;i++)4===t[i].ty&&e(t[i].shapes)};return e=>{if(!tg(t,e.v))return;s(e.layers);let{length:i}=e.assets;for(let t=0;t<i;t++)e.assets[t].layers&&s(e.assets[t].layers)}})(),tw=(()=>{let t=[4,4,18],e=t=>{let{length:s}=t;for(let i=s-1;i>=0;i--){if(t[i].ty===V.Group){e(t[i].it??[]);continue}if(t[i].ty!==V.Path)continue;let s=t[i].ks?.k;if(!s)continue;let r=!!t[i].closed;if(!Q(s)){s.c=r;continue}let{length:a}=s;for(let t=0;t<a;t+=1){let e=s[t].e,i=s[t].s;e&&(e[0].c=r),i&&(i[0].c=r)}}},s=t=>{let s,{length:i}=t;for(let r=0;r<i;r++){if((s=t[r]).hasMask){let t=s.masksProperties,{length:e}=t??[];for(let s=0;s<e;s++){let e=t?.[s].pt?.k;if(!e)continue;let i=!!t[s].cl;if(!Q(e)){e.c=i;continue}let{length:r}=e;for(let t=0;t<r;t++){let s=e[t].e,r=e[t].s;s&&(s[0].c=i),r&&(r[0].c=i)}}}4===s.ty&&e(s.shapes)}};return e=>{if(!tg(t,e.v))return;s(e.layers);let{length:i}=e.assets;for(let t=0;t<i;t++)e.assets[t].layers&&s(e.assets[t].layers)}})(),tE={checkChars:tb,checkColors:tx,checkPathProperties:t_,checkShapes:tw,completeData:function(t){t.__complete||(tx(t),tv(t),tb(t),t_(t),tw(t),tc(t.layers,t.assets),function(t,e){if(!t)return;let{length:s}=t;for(let i=0;i<s;i++){if(1!==t[i].t)continue;let{data:s}=t[i];s&&(s.layers=td(s.refId,e)),tc(t[i].data?.layers??[],e)}}(t.chars,t.assets),t.__complete=!0)},completeLayers:tc},tC=!1,tS=()=>tC,tk=1,tM,tP="Function not implemented.",tA={addEventListener:(t,e,s)=>{throw Error(tP)},dispatchEvent:t=>{throw Error(tP)},onerror:null,onmessage:t=>{throw Error("workerProxy: Method onmessage not implemented")},onmessageerror:null,postMessage:t=>{tM({data:t})},removeEventListener:(t,e,s)=>{throw Error(tP)},terminate:()=>{throw Error(tP)}},tT={postMessage:t=>{tA.onmessage&&tA.onmessage({AT_TARGET:2,bubbles:!1,BUBBLING_PHASE:3,cancelable:!1,cancelBubble:!1,CAPTURING_PHASE:1,composed:!1,composedPath:()=>{throw Error(tP)},currentTarget:null,data:t,defaultPrevented:!1,eventPhase:0,initEvent:(t,e,s)=>{throw Error(tP)},initMessageEvent:(t,e,s,i,r,a,n,o)=>{throw Error(tP)},isTrusted:!1,lastEventId:"",NONE:0,origin:"",ports:[],preventDefault:()=>{throw Error(tP)},returnValue:!1,source:null,srcElement:null,stopImmediatePropagation:()=>{throw Error(tP)},stopPropagation:()=>{throw Error(tP)},target:null,timeStamp:0,type:""})}},tD={};function tI(){e||((e=function(t){if(!tn&&tS()){let e=new Blob(["var _workerSelf = self; self.onmessage = ",t.toString()],{type:"text/javascript"});return new Worker(URL.createObjectURL(e))}return tM=t,tA}(t=>{if(tT.dataManager=tT.dataManager??tE,"loadAnimation"===t.data.type)return void tp(t.data.path,t.data.fullPath,e=>{e&&tE.completeData(e),tT.postMessage({id:t.data.id,payload:e,status:"success"})},()=>{tT.postMessage({id:t.data.id,status:"error"})});if("complete"===t.data.type){let{animation:e,id:s}=t.data;tE.completeData(e),tT.postMessage({id:s,payload:e,status:"success"});return}"loadData"===t.data.type&&tp(t.data.path,t.data.fullPath,e=>{tT.postMessage({id:t.data.id,payload:e,status:"success"})},()=>{tT.postMessage({id:t.data.id,status:"error"})})})).onmessage=({data:t})=>{let{id:e,payload:s,status:i}=t,r=tD[e];if(tD[e]=null,"success"===i)return void r.onComplete(s);r.onError&&r.onError()})}function tF(t,e){tk++;let s=`processId_${tk}`;try{return tD[s]={onComplete:t,onError:e},s}catch(t){throw console.error("DataManager}:\n",t),Error("Could not create animation proccess")}}function tL(t,s,i){tI();let r=tF(s,i);e?.postMessage({fullPath:tn?t:window.location.origin+window.location.pathname,id:r,path:t,type:"loadData"})}function t$(t,s,i){tI();let r=tF(s,i);e?.postMessage({animation:t,id:r,type:"complete"})}let tN={interface:null,plugin:null},tV=()=>tN.plugin,tR=()=>tN.interface;class tO{getComposition(t){let e=0,{length:s}=this.compositions;for(;e<s;){if(this.compositions[e].data&&this.compositions[e].data?.nm===t)return this.compositions[e].data?.xt&&this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e++}return null}registerComposition(t){this.compositions.push(t)}constructor(){this.compositions=[],this.currentFrame=0}}let tz={current:!0},tB=()=>tz.current;function tG(t){return tn?null:document.createElement(t)}function tq(t){return tn?null:document.createElementNS(ta,t)}class tj{constructor(){this._imageLoaded=this.imageLoaded.bind(this),this._footageLoaded=this.footageLoaded.bind(this),this.testImageLoaded=this.testImageLoaded.bind(this),this.createFootageData=this.createFootageData.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[],this.proxyImage=this._createProxyImage()}createFootageData(t){let e={assetData:t,img:null};return tL(this.getAssetsPath(t,this.assetsPath,this.path),t=>{t&&(e.img=t),this._footageLoaded()},()=>{this._footageLoaded()}),e}createImageData(t){let e=this.getAssetsPath(t,this.assetsPath,this.path),s=tq("image"),i={assetData:t,img:s};return th?this.testImageLoaded(s):s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",()=>{this.proxyImage&&(i.img=this.proxyImage),this._imageLoaded()},!1),s.setAttributeNS(tr,"href",e),this._elementHelper?.append?this._elementHelper.append(s):this._elementHelper?.appendChild(s),i}destroy(){this.imagesLoadedCb=null,this.images.length=0}footageLoaded(){this.loadedFootagesCount++,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}getAsset(t){let e=0,{length:s}=this.images;for(;e<s;){if(this.images[e].assetData===t)return this.images[e].img;e++}return null}imageLoaded(){this.loadedAssets++,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}loadAssets(t,e){this.imagesLoadedCb=e;let{length:s}=t;for(let e=0;e<s;e++)if(!t[e].layers){if((!t[e].t||"seq"===t[e].t)&&this._createImageData){this.totalImages++;let s=this._createImageData(t[e]);s&&this.images.push(s);continue}3===Number(t[e].t)&&(this.totalFootages++,this.images.push(this.createFootageData(t[e])))}}loadedFootages(){return this.totalFootages===this.loadedFootagesCount}loadedImages(){return this.totalImages===this.loadedAssets}setAssetsPath(t){this.assetsPath=t||""}setCacheType(t,e){t===N.SVG?(this._elementHelper=e,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}setPath(t){this.path=t||""}_createProxyImage(){if(tn)return null;let t=tG(N.Canvas);t.width=1,t.height=1;let e=t.getContext("2d");return e&&(e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1)),t}createImgData(t){let e=this.getAssetsPath(t,this.assetsPath,this.path),s=tG("img"),i={assetData:t,img:s};return s.crossOrigin="anonymous",s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",()=>{this.proxyImage&&(i.img=this.proxyImage),this._imageLoaded()},!1),s.src=e,i}getAssetsPath(t,e,s){if(t.e)return t.p||"";if(e){let s=t.p;return s?.indexOf("images/")!==-1&&(s=s?.split("/")[1]),`${e}${s||""}`}let i=s;return i+=t.u??"",i+=t.p??""}testImageLoaded(t){if(tn)return;let e=0,s=setInterval(()=>{(t.getBBox().width||e>500)&&(this._imageLoaded(),clearInterval(s)),e++},50)}}let tW=t=>{let e=t.split("\r\n"),s={},{length:i}=e,r=0;for(let t=0;t<i;t++){let i=e[t].split(":");2===i.length&&(s[i[0]]=i[1].trim(),r++)}if(0===r)throw Error("Could not parse markers");return s};class tH extends I{constructor(){super(),this.wrapper=null,this.autoloadSegments=!1,this.onComplete=null,this.onDestroy=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onSegmentStart=null,this._cbs={},this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=60,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.frameModifier=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=K(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=tB(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=new tO,this.imagePreloader=new tj,this.audioController=new tl(void 0),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new C("drawnFrame",0,0,0),this.expressionsPlugin=tV()}adjustSegment(t,e){this.playCount=0,t[1]<t[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")}advanceTime(t){if(this.isPaused||!this.isLoaded)return;let e=this.currentRawFrame+t*this.frameModifier,s=!1;e>=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount++,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(s=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&!0!==this.loop)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(s=!0,e=0)):this.setCurrentRawFrameValue(e),s&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}checkLoaded(){if(this.isLoaded||!this.renderer.globalData?.fontManager?.isLoaded||!this.imagePreloader?.loadedImages()&&this.renderer.rendererType===N.Canvas||!this.imagePreloader?.loadedFootages())return;this.isLoaded=!0;let t=tV();t?.initExpressions(this),this.renderer.initItems(),setTimeout(()=>{this.trigger("DOMLoaded")},0),this.gotoFrame(),this.autoplay&&this.play()}checkSegments(t){return this.segments.length>0&&(this.adjustSegment(this.segments.shift()??[0,0],t),!0)}configAnimation(t){try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor((this.animationData.op||1)-(this.animationData.ip||0)),this.firstFrame=Math.round(this.animationData.ip||0)),this.renderer.configAnimation(t),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,void 0!==this.animationData.fr&&(this.frameMult=this.animationData.fr/1e3),this.renderer.searchExtraCompositions(t.assets),this.markers=function(t){let e=[],{length:s}=t;for(let i=0;i<s;i++){if("duration"in t[i]){e.push(t[i]);continue}let s={duration:t[i].dr,time:t[i].tm};try{s.payload=JSON.parse(t[i].cm)}catch(e){try{s.payload=tW(t[i].cm)}catch(e){s.payload={name:t[i].cm}}}e.push(s)}return e}(t.markers??[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}}destroy(t){t&&this.name!==t||(this.renderer.destroy(),this.imagePreloader?.destroy(),this.trigger("destroy"),this._cbs={},this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)}getAssetData(t){let e=0,{length:s}=this.assets;for(;e<s;){if(t===this.assets[e].id)return this.assets[e];e++}return null}getAssetsPath(t){let e;if(!t)return"";if(t.e)e=t.p||"";else if(this.assetsPath){let s=t.p;s?.indexOf("images/")!==-1&&(s=s?.split("/")[1]),e=this.assetsPath+(s||"")}else e=this.path+(t.u??"")+(t.p??"");return e}getDuration(t){return t?this.totalFrames:this.totalFrames/this.frameRate}getMarkerData(t){for(let e=0;e<this.markers.length;e++)if(this.markers[e].payload?.name===t)return this.markers[e];return null}getPath(){return this.path}getVolume(){return this.audioController.getVolume()}goToAndPlay(t,e,s){if(s&&this.name!==s)return;let i=Number(t);if(isNaN(i)){let e=this.getMarkerData(t);e&&(e.duration?this.playSegments([e.time,e.time+e.duration],!0):this.goToAndStop(e.time,!0))}else this.goToAndStop(i,e,s);this.play()}goToAndStop(t,e,s){if(!s||this.name===s){if(isNaN(Number(t))){let e=this.getMarkerData(t);e&&this.goToAndStop(e.time,!0)}else e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier);this.pause()}}gotoFrame(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")}hide(){this.renderer.hide()}imagesLoaded(){this.trigger("loaded_images"),this.checkLoaded()}includeLayers(t){this.animationData.op&&t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-(this.animationData.ip||0)));let{assets:e,layers:s}=this.animationData,i,{length:r}=s,a=t.layers,{length:n}=a;for(let t=0;t<n;t++)for(i=0;i<r;){if(s[i].id===a[t].id){s[i]=a[t];break}i++}for((t.chars||t.fonts)&&(this.renderer.globalData?.fontManager?.addChars(t.chars),this.renderer.globalData?.fontManager?.addFonts(t.fonts,this.renderer.globalData.defs)),r=t.assets.length,i=0;i<r;i++)e.push(t.assets[i]);this.animationData.__complete=!1,t$(this.animationData,this.onSegmentComplete)}loadNextSegment(){let{segments:t}=this.animationData;if(!t||0===t.length||!this.autoloadSegments){this.trigger("data_ready"),this.timeCompleted=this.totalFrames;return}let e=t.shift();this.timeCompleted=Number(e?.time)*this.frameRate;let s=`${this.path+(this.fileName||"")}_${this.segmentPos}.json`;this.segmentPos++,tL(s,this.includeLayers.bind(this),()=>{this.trigger("data_failed")})}loadSegments(){let{segments:t}=this.animationData;t||(this.timeCompleted=this.totalFrames),this.loadNextSegment()}mute(t){t&&this.name!==t||this.audioController.mute()}onSegmentComplete(t){this.animationData=t;let e=tV();e?.initExpressions(this),this.loadNextSegment()}onSetupError(){this.trigger("data_failed")}pause(t){(!t||this.name===t)&&(this.isPaused||(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause()))}play(t){(!t||this.name===t)&&this.isPaused&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))}playSegments(t,e){if(e&&(this.segments.length=0),Q(t[0])){let{length:e}=t;for(let s=0;s<e;s++)this.segments.push(t[s])}else this.segments.push(t);this.segments.length>0&&e&&this.adjustSegment(this.segments.shift()??[0,0],0),this.isPaused&&this.play()}preloadImages(){this.imagePreloader&&(this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this)))}renderFrame(t){if(this.isLoaded)try{this.expressionsPlugin?.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}}resetSegments(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)}resize(t,e){this.renderer.updateContainerSize("number"==typeof t?t:void 0,"number"==typeof e?e:void 0)}setCurrentRawFrameValue(t){this.currentRawFrame=t,this.gotoFrame()}setData(t,e){try{let s=e;s&&"object"!=typeof s&&(s=JSON.parse(s));let i={animationData:s,wrapper:t},r=t.attributes;i.path=r.getNamedItem("data-animation-path")?.value??r.getNamedItem("data-bm-path")?.value??r.getNamedItem("bm-path")?.value??"";let a=r.getNamedItem("data-anim-type")?.value??r.getNamedItem("data-bm-type")?.value??r.getNamedItem("bm-type")?.value??r.getNamedItem("data-bm-renderer")?.value??r.getNamedItem("bm-renderer")?.value??W();Object.values(N).includes(a)?i.animType=a:i.animType=N.Canvas;let n=r.getNamedItem("data-anim-loop")?.value??r.getNamedItem("data-bm-loop")?.value??r.getNamedItem("bm-loop")?.value??"";"false"===n?i.loop=!1:"true"===n?i.loop=!0:""!==n&&(i.loop=parseInt(n,10));let o=r.getNamedItem("data-anim-autoplay")?.value??r.getNamedItem("data-bm-autoplay")?.value??r.getNamedItem("bm-autoplay")?.value??!0;i.autoplay="false"!==o,i.name=r.getNamedItem("data-name")?.value??r.getNamedItem("data-bm-name")?.value??r.getNamedItem("bm-name")?.value??"";let h=r.getNamedItem("data-anim-prerender")?.value??r.getNamedItem("data-bm-prerender")?.value??r.getNamedItem("bm-prerender")?.value??"";"false"===h&&(i.prerender=!1),i.path?this.setParams(i):this.trigger("destroy")}catch(t){throw console.error(`${this.constructor.name}:
|
|
1
|
+
!function(t){"use strict";let e,s,i,r=()=>"",a=(s=0,()=>(s++,`${r()}__lottie_element_${s}`));var n,o,h,l,p,m,c,d,u,f,g,y,v,b,_,x=((n={}).Complete="complete",n.Destroyed="destroyed",n.Error="error",n.Frame="frame",n.Freeze="freeze",n.Load="load",n.Loop="loop",n.Next="next",n.Pause="pause",n.Play="play",n.Previous="previous",n.Ready="ready",n.Rendered="rendered",n.Stop="stop",n),w=((o={}).Contain="xMidYMid meet",o.Cover="xMidYMid slice",o.Initial="none",o.None="xMinYMin slice",o);let E=!("undefined"!=typeof window&&document);class C{constructor(t,e,s,i){this.type=t,this.currentTime=e,this.totalTime=s,this.direction=i<0?-1:1}}class S{constructor(t,e){this.type=t,this.direction=e<0?-1:1}}class k{constructor(t,e,s,i){this.type=t,this.direction=s,this.currentTime=e,this.totalTime=i}}class M{constructor(t,e,s,i){this.type=t,this.currentLoop=s,this.totalLoops=e,this.direction=i<0?-1:1}}class P{constructor(t,e,s){this.type=t,this.firstFrame=e,this.totalFrames=s}}class A{constructor(t,e){this.type=t,this.target=e}}class T{constructor(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}}class D{constructor(t,e){this.type="configError",this.nativeError=t}}class I{addEventListener(t,e){return this._cbs[t]=this._cbs[t]??[],this._cbs[t].push(e),()=>{this.removeEventListener(t,e)}}removeEventListener(t,e){if(!e){this._cbs[t]=null;return}if(this._cbs[t]){let s=0,{length:i}=this._cbs[t];for(;s<i;)this._cbs[t][s]===e&&(this._cbs[t].splice(s,1),s--,i--),s++;0===this._cbs[t].length&&(this._cbs[t]=null)}}triggerEvent(t,e){if(!this._cbs[t])return;let{length:s}=this._cbs[t];for(let i=0;i<s;i++)this._cbs[t][i](e)}constructor(){this._cbs={}}}var F=((h={}).Float32="float32",h.Int16="int16",h.Int32="int32",h.Uint8="uint8",h.Uint8c="uint8c",h),L=((l={}).MouseModifier="ms",l.OffsetPathModifier="op",l.PuckerAndBloatModifier="pb",l.RepeaterModifier="rp",l.RoundCornersModifier="rd",l.TrimModifier="tm",l.ZigZagModifier="zz",l),$=((p={}).Contain="xMidYMid meet",p.Cover="xMidYMid slice",p.Initial="none",p.None="xMinYMin slice",p),N=((m={}).Canvas="canvas",m.HTML="html",m.SVG="svg",m),V=((c={}).Ellipse="el",c.Fill="fl",c.GradientFill="gf",c.GradientStroke="gs",c.Group="gr",c.Merge="mm",c.NoStyle="no",c.OffsetPath="op",c.Path="sh",c.PolygonStar="sr",c.PuckerBloat="pb",c.Rectangle="rc",c.Repeater="rp",c.RoundedCorners="rd",c.Stroke="st",c.Transform="tr",c.Trim="tm",c.Twist="tw",c.Unknown="ms",c.ZigZag="zz",c),R=((d={}).TransformEffect="transformEffect",d),O=((u={}).MultiDimensional="multidimensiional",u.Shape="shape",u.TextSelector="textSelector",u.Transform="transform",u.UniDimensional="unidimensional",u);let z={1:"butt",2:"round",3:"square"},B={1:"miter",2:"round",3:"bevel"},G={},q=(t,e)=>{G[t]=e},j=t=>{if(!G[t])throw Error("Could not get renderer");return G[t]},W=()=>{if(G.canvas)return N.Canvas;let t=Object.keys(G),{length:e}=t;for(let s=0;s<e;s++)if(G[t[s]])return t[s];return N.SVG},H="",Y=()=>H,U=(t,e)=>1e5*Math.abs(t-e)<=Math.min(Math.abs(t),Math.abs(e)),J=t=>1e-5>=Math.abs(t),X=(t,e)=>U(t[0],e[0])&&U(t[1],e[1]),K=(i=0,()=>(i++,`${Y()}__lottie_element_${i}`)),Z=(t,e=0,s=100)=>{let i=e,r=s;if(i>r){let t=r;r=i,i=t}return Math.min(Math.max(t,i),r)},Q=t=>Symbol.iterator in Object(t)&&t.length>0,tt=t=>Q(t)&&"number"==typeof t[0],te=t=>!(!t||Q(t))&&"_type"in t&&"ShapePath"===t._type,ts=(t,e,s)=>{let i,r=[];for(let t=0;t<256;t++)i=t.toString(16),r[t]=1===i.length?`0${i}`:i;let a=t,n=e,o=s;return t<0&&(a=0),e<0&&(n=0),s<0&&(o=0),`#${r[a]}${r[n]}${r[o]}`},ti=Math.PI/180,tr="http://www.w3.org/1999/xlink",ta="http://www.w3.org/2000/svg",tn=!("undefined"!=typeof window&&document),to="undefined"!=typeof navigator,th=!!to&&/^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent);class tl{constructor(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}addAudio(t){this.audios.push(t)}createAudio(t){return this.audioFactory?this.audioFactory(t):!tn&&"Howl"in window?new window.Howl({src:[t]}):{isPlaying:!1,play:()=>{this.isPlaying=!0},playing:()=>{throw Error(`${this.constructor.name}: Method playing is not implemented`)},rate:()=>{throw Error(`${this.constructor.name}: Method rate is not implemented`)},seek:()=>{this.isPlaying=!1},setVolume:()=>{throw Error(`${this.constructor.name}: Method setVolume is not implemented`)}}}getVolume(){return this._volume}mute(){this._isMuted=!0,this._updateVolume()}pause(){for(let t of this.audios)t.pause()}resume(){for(let t of this.audios)t.resume()}setAudioFactory(t){this.audioFactory=t}setRate(t){for(let e of this.audios)e.setRate(t)}setVolume(t){this._volume=t,this._updateVolume()}unmute(){this._isMuted=!1,this._updateVolume()}_updateVolume(){let{length:t}=this.audios;for(let e=0;e<t;e++)this.audios[e].volume(!this._isMuted*this._volume)}}function tp(t,e,s,i){let r,a=new XMLHttpRequest;try{a.responseType="json"}catch(t){}a.onreadystatechange=()=>{if(4===a.readyState){if(200===a.status)return void s(r=tm(a));try{r=tm(a),s(r)}catch(t){i?.(t)}}};try{a.open("GET",t,!0)}catch(s){a.open("GET",`${e}/${t}`,!0)}a.send()}function tm(t){let e=t.getResponseHeader("content-type");return e&&"json"===t.responseType&&e.includes("json")||t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):null}function tc(t,e){let s,{length:i}=t;for(let a=0;a<i;a++)if("ks"in(s=t[a])&&!s.completed){if(s.completed=!0,s.hasMask){let t=s.masksProperties,{length:e}=t??[];for(let s=0;s<e;s++){let e=t?.[s].pt?.k;if(!e)continue;if(!Q(e)){tf(e);continue}let{length:i}=e;for(let t=0;t<i;t++){let s=e[t].e,i=e[t].s;s&&tf(s[0]),i&&tf(i[0])}}}switch(s.ty){case 0:s.layers=td(s.refId,e),tc(s.layers,e);break;case 4:tu(s.shapes);break;case 5:var r;r=s,r.t?.a?.length===0&&r.t.p}}}function td(t,e){if(!t||!e)return;let s=function(t,e){let s=0,{length:i}=e;for(;s<i;){if(e[s].id===t)return e[s];s++}return null}(t,e);return s?.layers?s.layers.__used?JSON.parse(JSON.stringify(s.layers)):(s.layers.__used=!0,s.layers):null}function tu(t=[]){let{length:e}=t;for(let s=e-1;s>=0;s--){if(t[s].ty===V.Group){tu(t[s].it);continue}if(t[s].ty===V.Path){let e=t[s].ks?.k;if(!Q(e)){tf(e);continue}let{length:i}=e;for(let t=0;t<i;t++){let s=e[t].e,i=e[t].s;s&&tf(s[0]),i&&tf(i[0])}}}}function tf(t){if(!t)return;let{length:e}=t.i;for(let s=0;s<e;s++)t.i[s][0]+=t.v[s][0],t.i[s][1]+=t.v[s][1],t.o[s][0]+=t.v[s][0],t.o[s][1]+=t.v[s][1]}function tg(t,e){let s=e?e.split(".").map(Number):[100,100,100];return t[0]>s[0]||!(s[0]>t[0])&&(t[1]>s[1]||!(s[1]>t[1])&&(t[2]>s[2]||!(s[2]>t[2])&&null))}let ty=(t,e,s)=>{let{length:i}=t;for(let r=0;r<i;r++)t[r].ty===s&&e(t[r])},tv=(()=>{let t=[4,4,14],e=t=>{let e=t.t?.d;t.t&&e&&(t.t.d={k:[{s:e,t:0}]})};return s=>{if(!tg(t,s.v))return;ty(s.layers,e,5);let{length:i}=s.assets;for(let t=0;t<i;t++)s.assets[t].layers&&ty(s.assets[t].layers,e,5)}})(),tb=(()=>{let t=[4,7,99];return e=>{if(!e.chars||tg(t,e.v))return;let{length:s}=e.chars;for(let t=0;t<s;t++){let s=e.chars[t];s.data?.shapes&&(tu(s.data.shapes),s.data.ip=0,s.data.op=99999,s.data.st=0,s.data.sr=1,s.data.ks={a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]}},e.chars[t].t||(s.data.shapes.push({ty:V.NoStyle}),s.data.shapes[0].it?.push({a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sa:{a:0,k:0},sk:{a:0,k:0},ty:V.Transform})))}}})(),t_=(()=>{let t=[5,7,15],e=t=>{let e=t.t?.p;e&&("number"==typeof e.a&&(e.a={a:0,k:e.a}),"number"==typeof e.p&&(e.p={a:0,k:e.p}),"number"==typeof e.r&&(e.r={a:0,k:e.r}))};return s=>{if(!tg(t,s.v))return;ty(s.layers,e,5);let{length:i}=s.assets;for(let t=0;t<i;t++)s.assets[t].layers&&ty(s.assets[t].layers,e,5)}})(),tx=(()=>{let t=[4,1,9],e=t=>{let{length:s}=t;for(let i=0;i<s;i++){if(t[i].ty===V.Group){e(t[i].it??[]);continue}if(t[i].ty!==V.Fill&&t[i].ty!==V.Stroke)continue;let s=t[i].c?.k;if(!s||"number"==typeof s)continue;if(Q(s)&&tt(s)){s[0]/=255,s[1]/=255,s[2]/=255,s[3]/=255;continue}let{length:r}=s;for(let t=0;t<r;t+=1)s[t].s[0]/=255,s[t].s[1]/=255,s[t].s[2]/=255,s[t].s[3]/=255,s[t].e[0]/=255,s[t].e[1]/=255,s[t].e[2]/=255,s[t].e[3]/=255}},s=t=>{let{length:s}=t;for(let i=0;i<s;i++)4===t[i].ty&&e(t[i].shapes)};return e=>{if(!tg(t,e.v))return;s(e.layers);let{length:i}=e.assets;for(let t=0;t<i;t++)e.assets[t].layers&&s(e.assets[t].layers)}})(),tw=(()=>{let t=[4,4,18],e=t=>{let{length:s}=t;for(let i=s-1;i>=0;i--){if(t[i].ty===V.Group){e(t[i].it??[]);continue}if(t[i].ty!==V.Path)continue;let s=t[i].ks?.k;if(!s)continue;let r=!!t[i].closed;if(!Q(s)){s.c=r;continue}let{length:a}=s;for(let t=0;t<a;t+=1){let e=s[t].e,i=s[t].s;e&&(e[0].c=r),i&&(i[0].c=r)}}},s=t=>{let s,{length:i}=t;for(let r=0;r<i;r++){if((s=t[r]).hasMask){let t=s.masksProperties,{length:e}=t??[];for(let s=0;s<e;s++){let e=t?.[s].pt?.k;if(!e)continue;let i=!!t[s].cl;if(!Q(e)){e.c=i;continue}let{length:r}=e;for(let t=0;t<r;t++){let s=e[t].e,r=e[t].s;s&&(s[0].c=i),r&&(r[0].c=i)}}}4===s.ty&&e(s.shapes)}};return e=>{if(!tg(t,e.v))return;s(e.layers);let{length:i}=e.assets;for(let t=0;t<i;t++)e.assets[t].layers&&s(e.assets[t].layers)}})(),tE={checkChars:tb,checkColors:tx,checkPathProperties:t_,checkShapes:tw,completeData:function(t){t.__complete||(tx(t),tv(t),tb(t),t_(t),tw(t),tc(t.layers,t.assets),function(t,e){if(!t)return;let{length:s}=t;for(let i=0;i<s;i++){if(1!==t[i].t)continue;let{data:s}=t[i];s&&(s.layers=td(s.refId,e)),tc(t[i].data?.layers??[],e)}}(t.chars,t.assets),t.__complete=!0)},completeLayers:tc},tC=!1,tS=()=>tC,tk=1,tM,tP="Function not implemented.",tA={addEventListener:(t,e,s)=>{throw Error(tP)},dispatchEvent:t=>{throw Error(tP)},onerror:null,onmessage:t=>{throw Error("workerProxy: Method onmessage not implemented")},onmessageerror:null,postMessage:t=>{tM({data:t})},removeEventListener:(t,e,s)=>{throw Error(tP)},terminate:()=>{throw Error(tP)}},tT={postMessage:t=>{tA.onmessage&&tA.onmessage({AT_TARGET:2,bubbles:!1,BUBBLING_PHASE:3,cancelable:!1,cancelBubble:!1,CAPTURING_PHASE:1,composed:!1,composedPath:()=>{throw Error(tP)},currentTarget:null,data:t,defaultPrevented:!1,eventPhase:0,initEvent:(t,e,s)=>{throw Error(tP)},initMessageEvent:(t,e,s,i,r,a,n,o)=>{throw Error(tP)},isTrusted:!1,lastEventId:"",NONE:0,origin:"",ports:[],preventDefault:()=>{throw Error(tP)},returnValue:!1,source:null,srcElement:null,stopImmediatePropagation:()=>{throw Error(tP)},stopPropagation:()=>{throw Error(tP)},target:null,timeStamp:0,type:""})}},tD={};function tI(){e||((e=function(t){if(!tn&&tS()){let e=new Blob(["var _workerSelf = self; self.onmessage = ",t.toString()],{type:"text/javascript"});return new Worker(URL.createObjectURL(e))}return tM=t,tA}(t=>{if(tT.dataManager=tT.dataManager??tE,"loadAnimation"===t.data.type)return void tp(t.data.path,t.data.fullPath,e=>{e&&tE.completeData(e),tT.postMessage({id:t.data.id,payload:e,status:"success"})},()=>{tT.postMessage({id:t.data.id,status:"error"})});if("complete"===t.data.type){let{animation:e,id:s}=t.data;tE.completeData(e),tT.postMessage({id:s,payload:e,status:"success"});return}"loadData"===t.data.type&&tp(t.data.path,t.data.fullPath,e=>{tT.postMessage({id:t.data.id,payload:e,status:"success"})},()=>{tT.postMessage({id:t.data.id,status:"error"})})})).onmessage=({data:t})=>{let{id:e,payload:s,status:i}=t,r=tD[e];if(tD[e]=null,"success"===i)return void r.onComplete(s);r.onError&&r.onError()})}function tF(t,e){tk++;let s=`processId_${tk}`;try{return tD[s]={onComplete:t,onError:e},s}catch(t){throw console.error("DataManager}:\n",t),Error("Could not create animation proccess")}}function tL(t,s,i){tI();let r=tF(s,i);e?.postMessage({fullPath:tn?t:window.location.origin+window.location.pathname,id:r,path:t,type:"loadData"})}function t$(t,s,i){tI();let r=tF(s,i);e?.postMessage({animation:t,id:r,type:"complete"})}let tN={interface:null,plugin:null},tV=()=>tN.plugin,tR=()=>tN.interface;class tO{getComposition(t){let e=0,{length:s}=this.compositions;for(;e<s;){if(this.compositions[e].data&&this.compositions[e].data?.nm===t)return this.compositions[e].data?.xt&&this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e++}return null}registerComposition(t){this.compositions.push(t)}constructor(){this.compositions=[],this.currentFrame=0}}let tz={current:!0},tB=()=>tz.current;function tG(t){return tn?null:document.createElement(t)}function tq(t){return tn?null:document.createElementNS(ta,t)}class tj{constructor(){this._imageLoaded=this.imageLoaded.bind(this),this._footageLoaded=this.footageLoaded.bind(this),this.testImageLoaded=this.testImageLoaded.bind(this),this.createFootageData=this.createFootageData.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[],this.proxyImage=this._createProxyImage()}createFootageData(t){let e={assetData:t,img:null};return tL(this.getAssetsPath(t,this.assetsPath,this.path),t=>{t&&(e.img=t),this._footageLoaded()},()=>{this._footageLoaded()}),e}createImageData(t){let e=this.getAssetsPath(t,this.assetsPath,this.path),s=tq("image"),i={assetData:t,img:s};return th?this.testImageLoaded(s):s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",()=>{this.proxyImage&&(i.img=this.proxyImage),this._imageLoaded()},!1),s.setAttributeNS(tr,"href",e),this._elementHelper?.append?this._elementHelper.append(s):this._elementHelper?.appendChild(s),i}destroy(){this.imagesLoadedCb=null,this.images.length=0}footageLoaded(){this.loadedFootagesCount++,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}getAsset(t){let e=0,{length:s}=this.images;for(;e<s;){if(this.images[e].assetData===t)return this.images[e].img;e++}return null}imageLoaded(){this.loadedAssets++,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}loadAssets(t,e){this.imagesLoadedCb=e;let{length:s}=t;for(let e=0;e<s;e++)if(!t[e].layers){if((!t[e].t||"seq"===t[e].t)&&this._createImageData){this.totalImages++;let s=this._createImageData(t[e]);s&&this.images.push(s);continue}3===Number(t[e].t)&&(this.totalFootages++,this.images.push(this.createFootageData(t[e])))}}loadedFootages(){return this.totalFootages===this.loadedFootagesCount}loadedImages(){return this.totalImages===this.loadedAssets}setAssetsPath(t){this.assetsPath=t||""}setCacheType(t,e){t===N.SVG?(this._elementHelper=e,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}setPath(t){this.path=t||""}_createProxyImage(){if(tn)return null;let t=tG(N.Canvas);t.width=1,t.height=1;let e=t.getContext("2d");return e&&(e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1)),t}createImgData(t){let e=this.getAssetsPath(t,this.assetsPath,this.path),s=tG("img"),i={assetData:t,img:s};return s.crossOrigin="anonymous",s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",()=>{this.proxyImage&&(i.img=this.proxyImage),this._imageLoaded()},!1),s.src=e,i}getAssetsPath(t,e,s){if(t.e)return t.p||"";if(e){let s=t.p;return s?.indexOf("images/")!==-1&&(s=s?.split("/")[1]),`${e}${s||""}`}let i=s;return i+=t.u??"",i+=t.p??""}testImageLoaded(t){if(tn)return;let e=0,s=setInterval(()=>{(t.getBBox().width||e>500)&&(this._imageLoaded(),clearInterval(s)),e++},50)}}let tW=t=>{let e=t.split("\r\n"),s={},{length:i}=e,r=0;for(let t=0;t<i;t++){let i=e[t].split(":");2===i.length&&(s[i[0]]=i[1].trim(),r++)}if(0===r)throw Error("Could not parse markers");return s};class tH extends I{constructor(){super(),this.wrapper=null,this.autoloadSegments=!1,this.onComplete=null,this.onDestroy=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onSegmentStart=null,this._cbs={},this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=60,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.frameModifier=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=K(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=tB(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=new tO,this.imagePreloader=new tj,this.audioController=new tl(void 0),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new C("drawnFrame",0,0,0),this.expressionsPlugin=tV()}adjustSegment(t,e){this.playCount=0,t[1]<t[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")}advanceTime(t){if(this.isPaused||!this.isLoaded)return;let e=this.currentRawFrame+t*this.frameModifier,s=!1;e>=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount++,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(s=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&!0!==this.loop)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(s=!0,e=0)):this.setCurrentRawFrameValue(e),s&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}checkLoaded(){if(this.isLoaded||!this.renderer.globalData?.fontManager?.isLoaded||!this.imagePreloader?.loadedImages()&&this.renderer.rendererType===N.Canvas||!this.imagePreloader?.loadedFootages())return;this.isLoaded=!0;let t=tV();t?.initExpressions(this),this.renderer.initItems(),setTimeout(()=>{this.trigger("DOMLoaded")},0),this.gotoFrame(),this.autoplay&&this.play()}checkSegments(t){return this.segments.length>0&&(this.adjustSegment(this.segments.shift()??[0,0],t),!0)}configAnimation(t){try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor((this.animationData.op||1)-(this.animationData.ip||0)),this.firstFrame=Math.round(this.animationData.ip||0)),this.renderer.configAnimation(t),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,void 0!==this.animationData.fr&&(this.frameMult=this.animationData.fr/1e3),this.renderer.searchExtraCompositions(t.assets),this.markers=function(t){let e=[],{length:s}=t;for(let i=0;i<s;i++){if("duration"in t[i]){e.push(t[i]);continue}let s={duration:t[i].dr,time:t[i].tm};try{s.payload=JSON.parse(t[i].cm)}catch(e){try{s.payload=tW(t[i].cm)}catch(e){s.payload={name:t[i].cm}}}e.push(s)}return e}(t.markers??[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}}destroy(t){t&&this.name!==t||(this.renderer.destroy(),this.imagePreloader?.destroy(),this.trigger("destroy"),this._cbs={},this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)}getAssetData(t){let e=0,{length:s}=this.assets;for(;e<s;){if(t===this.assets[e].id)return this.assets[e];e++}return null}getAssetsPath(t){let e;if(!t)return"";if(t.e)e=t.p||"";else if(this.assetsPath){let s=t.p;s?.indexOf("images/")!==-1&&(s=s?.split("/")[1]),e=this.assetsPath+(s||"")}else e=this.path+(t.u??"")+(t.p??"");return e}getDuration(t){return t?this.totalFrames:this.totalFrames/this.frameRate}getMarkerData(t){for(let e=0;e<this.markers.length;e++)if(this.markers[e].payload?.name===t)return this.markers[e];return null}getPath(){return this.path}getVolume(){return this.audioController.getVolume()}goToAndPlay(t,e,s){if(s&&this.name!==s)return;let i=Number(t);if(isNaN(i)){let e=this.getMarkerData(t);e&&(e.duration?this.playSegments([e.time,e.time+e.duration],!0):this.goToAndStop(e.time,!0))}else this.goToAndStop(i,e,s);this.play()}goToAndStop(t,e,s){if(!s||this.name===s){if(isNaN(Number(t))){let e=this.getMarkerData(t);e&&this.goToAndStop(e.time,!0)}else e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier);this.pause()}}gotoFrame(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")}hide(){this.renderer.hide()}imagesLoaded(){this.trigger("loaded_images"),this.checkLoaded()}includeLayers(t){this.animationData.op&&t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-(this.animationData.ip||0)));let{assets:e,layers:s}=this.animationData,i,{length:r}=s,a=t.layers,{length:n}=a;for(let t=0;t<n;t++)for(i=0;i<r;){if(s[i].id===a[t].id){s[i]=a[t];break}i++}for((t.chars||t.fonts)&&(this.renderer.globalData?.fontManager?.addChars(t.chars),this.renderer.globalData?.fontManager?.addFonts(t.fonts,this.renderer.globalData.defs)),r=t.assets.length,i=0;i<r;i++)e.push(t.assets[i]);this.animationData.__complete=!1,t$(this.animationData,this.onSegmentComplete)}loadNextSegment(){let{segments:t}=this.animationData;if(!t||0===t.length||!this.autoloadSegments){this.trigger("data_ready"),this.timeCompleted=this.totalFrames;return}let e=t.shift();this.timeCompleted=Number(e?.time)*this.frameRate;let s=`${this.path+(this.fileName||"")}_${this.segmentPos}.json`;this.segmentPos++,tL(s,this.includeLayers.bind(this),()=>{this.trigger("data_failed")})}loadSegments(){let{segments:t}=this.animationData;t||(this.timeCompleted=this.totalFrames),this.loadNextSegment()}mute(t){t&&this.name!==t||this.audioController.mute()}onSegmentComplete(t){this.animationData=t;let e=tV();e?.initExpressions(this),this.loadNextSegment()}onSetupError(){this.trigger("data_failed")}pause(t){(!t||this.name===t)&&(this.isPaused||(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause()))}play(t){(!t||this.name===t)&&this.isPaused&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))}playSegments(t,e){if(e&&(this.segments.length=0),Q(t[0])){let{length:e}=t;for(let s=0;s<e;s++)this.segments.push(t[s])}else this.segments.push(t);this.segments.length>0&&e&&this.adjustSegment(this.segments.shift()??[0,0],0),this.isPaused&&this.play()}preloadImages(){this.imagePreloader&&(this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this)))}renderFrame(t){if(this.isLoaded)try{this.expressionsPlugin?.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}}resetSegments(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)}resize(t,e){this.renderer.updateContainerSize("number"==typeof t?t:void 0,"number"==typeof e?e:void 0)}setCurrentRawFrameValue(t){this.currentRawFrame=t,this.gotoFrame()}setData(t,e){try{let s=e;s&&"object"!=typeof s&&(s=JSON.parse(s));let i={animationData:s,wrapper:t},r=t.attributes;i.path=r.getNamedItem("data-animation-path")?.value??r.getNamedItem("data-bm-path")?.value??r.getNamedItem("bm-path")?.value??"";let a=r.getNamedItem("data-anim-type")?.value??r.getNamedItem("data-bm-type")?.value??r.getNamedItem("bm-type")?.value??r.getNamedItem("data-bm-renderer")?.value??r.getNamedItem("bm-renderer")?.value??W();Object.values(N).includes(a)?i.animType=a:i.animType=N.Canvas;let n=r.getNamedItem("data-anim-loop")?.value??r.getNamedItem("data-bm-loop")?.value??r.getNamedItem("bm-loop")?.value??"";"false"===n?i.loop=!1:"true"===n?i.loop=!0:""!==n&&(i.loop=parseInt(n,10));let o=r.getNamedItem("data-anim-autoplay")?.value??r.getNamedItem("data-bm-autoplay")?.value??r.getNamedItem("bm-autoplay")?.value??!0;i.autoplay="false"!==o,i.name=r.getNamedItem("data-name")?.value??r.getNamedItem("data-bm-name")?.value??r.getNamedItem("bm-name")?.value??"";let h=r.getNamedItem("data-anim-prerender")?.value??r.getNamedItem("data-bm-prerender")?.value??r.getNamedItem("bm-prerender")?.value??"";"false"===h&&(i.prerender=!1),i.path?this.setParams(i):this.trigger("destroy")}catch(t){throw console.error(`${this.constructor.name}:
|
|
2
2
|
`,t),Error(`${this.constructor.name}: Could not set data`)}}setDirection(t,e){e&&this.name!==e||(this.playDirection=t<0?-1:1,this.updaFrameModifier())}setLoop(t){this.loop=t}setParams(t){try{(t.wrapper||t.container)&&(this.wrapper=t.wrapper??t.container??null);let s=N.SVG;t.animType?s=t.animType:t.renderer&&(s=t.renderer);let i=j(s);this.renderer=new i(this,t.rendererSettings),this.imagePreloader?.setCacheType(s,this.renderer.globalData?.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=s,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(`${t.loop}`,10),this.autoplay=!!(!("autoplay"in t)||t.autoplay),this.name=t.name??"",this.autoloadSegments=!!(!Object.hasOwn(t,"autoloadSegments")||t.autoloadSegments),this.assetsPath=t.assetsPath??this.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.setupAnimation(t.animationData):t.path&&(t.path.includes("\\")?this.path=t.path.slice(0,Math.max(0,t.path.lastIndexOf("\\")+1)):this.path=t.path.slice(0,Math.max(0,t.path.lastIndexOf("/")+1)),this.fileName=t.path.slice(Math.max(0,t.path.lastIndexOf("/")+1)),this.fileName=this.fileName.slice(0,Math.max(0,this.fileName.lastIndexOf(".json"))),function(t,s,i){tI();let r=tF(s,i);e?.postMessage({fullPath:tn?t:window.location.origin+window.location.pathname,id:r,path:t,type:"loadAnimation"})}(t.path,this.configAnimation,this.onSetupError))}catch(t){throw console.error(`${this.constructor.name}:
|
|
3
3
|
`,t),Error(`${this.constructor.name}: Could not set params`)}}setSegment(t,e){let s=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?s=t:this.currentRawFrame+this.firstFrame>e&&(s=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,-1!==s&&this.goToAndStop(s,!0)}setSpeed(t,e){e&&this.name!==e||(this.playSpeed=t,this.updaFrameModifier())}setSubframe(t){this.isSubframeEnabled=!!t}setupAnimation(t){t$(t,this.configAnimation)}setVolume(t,e){e&&this.name!==e||this.audioController.setVolume(t)}show(){this.renderer.show()}stop(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))}togglePause(t){t&&this.name!==t||(this.isPaused?this.play():this.pause())}trigger(t){try{if(!this._cbs[t])return;switch(t){case"enterFrame":this.triggerEvent(t,new C(t,this.currentFrame,this.totalFrames,this.frameModifier)),this.onEnterFrame?.(new C(t,this.currentFrame,this.totalFrames,this.frameMult));break;case"drawnFrame":this.triggerEvent(t,new k(t,this.currentFrame,this.frameModifier,this.totalFrames));break;case"loopComplete":this.triggerEvent(t,new M(t,Number(this.loop),this.playCount,this.frameMult)),this.onLoopComplete?.(new M(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new S(t,this.frameMult)),this.onComplete?.(new S(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new P(t,this.firstFrame,this.totalFrames)),this.onSegmentStart?.(new P(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new A(t,this)),this.onDestroy?.(new A(t,this));break;default:this.triggerEvent(t)}}catch(t){console.error(`${this.constructor.name}:
|
|
4
4
|
`,t)}}triggerConfigError(t){let e=new D(t,this.currentFrame);this.triggerEvent("error",e),this.onError?.(e)}triggerRenderFrameError(t){let e=new T(t,this.currentFrame);this.triggerEvent("error",e),this.onError?.(e)}unmute(t){t&&this.name!==t||this.audioController.unmute()}updaFrameModifier(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)}updateDocumentData(t,e,s){try{let i=this.renderer.getElementByPath(t);i?.updateDocumentData([],e,s)}catch(t){console.error(this.constructor.name,t)}}waitForFontsLoaded(){if(this.renderer.globalData?.fontManager?.isLoaded)return void this.checkLoaded();setTimeout(this.waitForFontsLoaded.bind(this),20)}}let tY=!0,tU=0,tJ=0,tX=0,tK=[];function tZ(){tX++,tX&&tY&&!tn&&(window.requestAnimationFrame(tQ),tY=!1)}function tQ(t){tU=t,tn||window.requestAnimationFrame(t1)}function t0({target:t}){let e=0;if(!t)throw Error("No animation to remove");for(;e<tJ;)tK[e].animation===t&&(tK.splice(e,1),e--,tJ-=1,t.isPaused||t3()),e++}function t1(t){let e=t-tU;for(let t=0;t<tJ;t++)tK[t].animation.advanceTime(e);tU=t,tX&&1?tn||window.requestAnimationFrame(t1):tY=!0}function t2(t,e){t.addEventListener("destroy",t0),t.addEventListener("_active",tZ),t.addEventListener("_idle",t3),tK.push({animation:t,elem:e}),tJ++}function t3(){tX--}let t5=(()=>{function t(t,e){let s,i=[];switch(t){case F.Int16:case F.Uint8c:s=1;break;case F.Float32:case F.Int32:case F.Uint8:default:s=1.1}for(let t=0;t<e;t++)i.push(s);return i}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(e,s){return e===F.Float32?new Float32Array(s):e===F.Int16?new Int16Array(s):e===F.Uint8c?new Uint8ClampedArray(s):t(e,s)}:t})();function t4(t){return Array.from({length:t})}class t6{constructor(){this.props=t5(F.Float32,16),this._identity=!0,this._identityCalculated=!1,this.reset()}applyToPoint(t,e,s){return{x:t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}}applyToPointArray(t,e,s){return this.isIdentity()?[t,e,s]:[t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]]}applyToPointStringified(t,e){if(this.isIdentity())return`${t},${e}`;let s=this.props;return`${Math.round((t*s[0]+e*s[4]+s[12])*100)/100},${Math.round((t*s[1]+e*s[5]+s[13])*100)/100}`}applyToTriplePoints(t,e,s){let i=t5(F.Float32,6);if(this.isIdentity())i.set([t[0],t[1],e[0],e[1],s[0],s[1]]);else{let r=this.props[0],a=this.props[1],n=this.props[4],o=this.props[5],h=this.props[12],l=this.props[13];i.set([t[0]*r+t[1]*n+h,t[0]*a+t[1]*o+l,e[0]*r+e[1]*n+h,e[0]*a+e[1]*o+l,s[0]*r+s[1]*n+h,s[0]*a+s[1]*o+l])}return i}applyToX(t,e,s){return t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12]}applyToY(t,e,s){return t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13]}applyToZ(t,e,s){return t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}clone(t){return t.props.set(this.props),t}cloneFromProps(t){return this.props.set(t),this}equals(t){return this.props.every((e,s)=>e===t?.props[s])}getInverseMatrix(){let t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,s=-this.props[1]/t,i=-this.props[4]/t,r=this.props[0]/t,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,o=new t6;return o.setTransform(e,s,0,0,i,r,0,0,0,0,1,0,a,n,0,1),o}inversePoint(t){return this.getInverseMatrix().applyToPoint(t[0],t[1],t[2]||0)}inversePoints(t){return t.map(t=>this.inversePoint(t))}isIdentity(){return this._identityCalculated||(this._identity=1===this.props[0]&&0===this.props[1]&&0===this.props[2]&&0===this.props[3]&&0===this.props[4]&&1===this.props[5]&&0===this.props[6]&&0===this.props[7]&&0===this.props[8]&&0===this.props[9]&&1===this.props[10]&&0===this.props[11]&&0===this.props[12]&&0===this.props[13]&&0===this.props[14]&&1===this.props[15],this._identityCalculated=!0),this._identity}multiply(t){return this.transform(...t.props)}reset(){return this.props.set([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this}rotate(t){if(!t)return this;let e=Math.cos(t),s=Math.sin(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}rotateX(t){if(!t)return this;let e=Math.cos(t),s=Math.sin(t);return this._t(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1)}rotateY(t){if(!t)return this;let e=Math.cos(t),s=Math.sin(t);return this._t(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1)}rotateZ(t){return this.rotate(t)}scale(t,e,s=1){return 1===t&&1===e&&1===s?this:this._t(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1)}setTransform(t,e,s,i,r,a,n,o,h,l,p,m,c,d,u,f){return this.props.set([t,e,s,i,r,a,n,o,h,l,p,m,c,d,u,f]),this}shear(t,e){return this._t(1,e,t,1,0,0)}skew(t,e){return this.shear(Math.tan(t),Math.tan(e))}skewFromAxis(t,e){let s=Math.cos(e),i=Math.sin(e);return this._t(s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,Math.tan(t),1,0,0,0,0,1,0,0,0,0,1)._t(s,-i,0,0,i,s,0,0,0,0,1,0,0,0,0,1)}to2dCSS(){let t=this.roundMatrixProperty(this.props[0]),e=this.roundMatrixProperty(this.props[1]),s=this.roundMatrixProperty(this.props[4]),i=this.roundMatrixProperty(this.props[5]),r=this.roundMatrixProperty(this.props[12]),a=this.roundMatrixProperty(this.props[13]);return`matrix(${t},${e},${s},${i},${r},${a})`}toCSS(){let t="matrix3d(";for(let e=0;e<16;e++)t+=`${Math.round(1e4*this.props[e])/1e4}`+(15===e?")":",");return t}transform(t,e,s,i,r,a,n,o,h,l,p,m,c,d,u,f){let g=this.props;if(1===t&&0===e&&0===s&&0===i&&0===r&&1===a&&0===n&&0===o&&0===h&&0===l&&1===p&&0===m)return g[12]=g[12]*t+g[15]*c,g[13]=g[13]*a+g[15]*d,g[14]=g[14]*p+g[15]*u,g[15]*=f,this._identityCalculated=!1,this;let y=g[0],v=g[1],b=g[2],_=g[3],x=g[4],w=g[5],E=g[6],C=g[7],S=g[8],k=g[9],M=g[10],P=g[11],A=g[12],T=g[13],D=g[14],I=g[15];return g[0]=y*t+v*r+b*h+_*c,g[1]=y*e+v*a+b*l+_*d,g[2]=y*s+v*n+b*p+_*u,g[3]=y*i+v*o+b*m+_*f,g[4]=x*t+w*r+E*h+C*c,g[5]=x*e+w*a+E*l+C*d,g[6]=x*s+w*n+E*p+C*u,g[7]=x*i+w*o+E*m+C*f,g[8]=S*t+k*r+M*h+P*c,g[9]=S*e+k*a+M*l+P*d,g[10]=S*s+k*n+M*p+P*u,g[11]=S*i+k*o+M*m+P*f,g[12]=A*t+T*r+D*h+I*c,g[13]=A*e+T*a+D*l+I*d,g[14]=A*s+T*n+D*p+I*u,g[15]=A*i+T*o+D*m+I*f,this._identityCalculated=!1,this}translate(t,e,s){let i=s||0;return 0!==t||0!==e||0!==i?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1):this}_t(...t){return this.transform(...t)}roundMatrixProperty(t){return t<1e-6&&t>0||t>-1e-6&&t<0?Math.round(1e4*t)/1e4:t}}class t8{init(t){this.effectsManager=t,this.type=R.TransformEffect,this.matrix=new t6,this.opacity=-1,this._mdf=!1,this._opMdf=!1}renderFrame(t){if(this._opMdf=!1,this._mdf=!1,!t&&!this.effectsManager?._mdf)return;let e=this.effectsManager?.effectElements??[],s=e[0].p.v,i=e[1].p.v,r=1===e[2].p.v,a=e[3].p.v,n=r?a:e[4].p.v,o=e[5].p.v,h=e[6].p.v,l=e[7].p.v;this.matrix?.reset(),this.matrix?.translate(-s[0],-s[1],s[2]),this.matrix?.scale(.01*n,.01*a,1),this.matrix?.rotate(-l*ti),this.matrix?.skewFromAxis(-o*ti,(h+90)*ti),this.matrix?.translate(i[0],i[1],0),this._mdf=!0,this.opacity!==e[8].p.v&&(this.opacity=e[8].p.v,this._opMdf=!0)}constructor(){this.opacity=1}}class t9{createMergeNode(t,e){let s,i=tq("feMerge");i.setAttribute("result",t);let{length:r}=e;for(let t=0;t<r;t++)(s=tq("feMergeNode")).setAttribute("in",e[t]),i.appendChild(s),i.appendChild(s);return i}}let t7=[],et="",ee=()=>et,es="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0",ei={};class er{constructor(t){let e,{length:s}=t.data.ef??[];this.filters=[];for(let i=0;i<s;i++){e=null;let s=t.data.ef?.[i].ty;s&&ei[s]&&(e=new ei[s].effect(t.effectsManager?.effectElements[i],t)),e&&this.filters.push(e)}this.filters.length>0&&t.addRenderableComponent(this)}getEffects(t){let{length:e}=this.filters,s=[];for(let i=0;i<e;i++)this.filters[i].type===t&&s.push(this.filters[i]);return s}renderFrame(t){let{length:e}=this.filters;for(let s=0;s<e;s++)this.filters[s].renderFrame(t)}}let ea={createAlphaToLuminanceFilter:function(){let t=tq("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),t},createFilter:function(t,e){let s=tq("filter");return s.id=t,e||(s.setAttribute("filterUnits","objectBoundingBox"),s.setAttribute("x","0%"),s.setAttribute("y","0%"),s.setAttribute("width","100%"),s.setAttribute("height","100%")),s}},en="filter_result_",eo={};class eh{constructor(t){let e,s="SourceGraphic",i=K(),r=ea.createFilter(i,!0),a=0;this.filters=[];let{length:n}=t.data.ef??[];for(let i=0;i<n;i++){e=null;let{ty:n}=t.data.ef?.[i]??{ty:null},o=null!==n&&eo[n]?eo[n].effect:null;o&&n&&t.effectsManager&&(e=new o(r,t.effectsManager.effectElements[i],t,`${en}${a}`,s),s=`${en}${a}`,eo[n]?.countsAsEffect&&a++),e&&this.filters.push(e)}a&&(t.globalData?.defs.appendChild(r),t.layerElement?.setAttribute("filter",`url(${ee()}#${i})`)),this.filters.length>0&&t.addRenderableComponent(this)}getEffects(t){let{length:e}=this.filters,s=[];for(let i=0;i<e;i++)this.filters[i].type===t&&s.push(this.filters[i]);return s}renderFrame(t){let{length:e}=this.filters;for(let s=0;s<e;s++)this.filters[s].renderFrame(t)}}let el=(t,e,s)=>{eo[t]={countsAsEffect:s,effect:e}};class ep{constructor(t,e,s){this._length=0,this._maxLength=t,this._create=e,this._release=s,this.pool=t4(this._maxLength),this.newElement=this.newElement.bind(this),this.release=this.release.bind(this)}newElement(){let t;return this._length?(this._length-=1,t=this.pool[this._length]):t=this._create(),t}release(t){if(this._length===this._maxLength){var e;this.pool=[...e=this.pool,...t4(e.length)],this._maxLength*=2}this._release&&this._release(t),this.pool[this._length]=t,this._length++}}let em=new ep(8,()=>t5(F.Float32,2));class ec{get _type(){return"ShapePath"}constructor(){this.lengths=[],this.c=!1,this._length=0,this._maxLength=8,this.v=t4(this._maxLength),this.o=t4(this._maxLength),this.i=t4(this._maxLength)}doubleArrayLength(){this.v=[...this.v,...t4(this._maxLength)],this.i=[...this.i,...t4(this._maxLength)],this.o=[...this.o,...t4(this._maxLength)],this._maxLength*=2}length(){return this._length}reverse(){let t=new ec;t.setPathData(this.c,this._length);let e=this.v,s=this.o,i=this.i,r=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],s[0][0],s[0][1],0,!1),r=1);let{_length:a}=this,n=a-1;for(let o=r;o<a;o++)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],s[n][0],s[n][1],o,!1),n-=1;return t}setLength(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t}setPathData(t,e){this.c=t,this.setLength(e);let s=0;for(;s<e;)this.v[s]=em.newElement(),this.o[s]=em.newElement(),this.i[s]=em.newElement(),s++}setTripleAt(t,e,s,i,r,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(s,i,"o",n,o),this.setXYAt(r,a,"i",n,o)}setXYAt(t,e,s,i,r){let a;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),s){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[]}a[i]&&(!a[i]||r)||(a[i]=em.newElement()),a[i][0]=t,a[i][1]=e}}let ed=new ep(4,function(){return new ec},function(t){if(!te(t))return;let e=t._length;for(let s=0;s<e;s++)em.release(t.v[s]),em.release(t.i[s]),em.release(t.o[s]),t.v[s]=null,t.i[s]=null,t.o[s]=null;t._length=0,t.c=!1}),{newElement:eu}=ed,{release:ef}=ed;function eg(t){let e=eu(),s=t._length??t.v.length;e.setLength(s),e.c=t.c;for(let i=0;i<s;i++)e.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],i);return e}let ey={clone:eg,newElement:eu};class ev{constructor(){this._length=0,this._maxLength=4,this.shapes=t4(this._maxLength)}addShape(t){this._length===this._maxLength&&(this.shapes=[...this.shapes,...t4(this._maxLength)],this._maxLength*=2),this.shapes[this._length]=t,this._length++}releaseShapes(){for(let t=0;t<this._length;t++)ef(this.shapes[t]);this._length=0}}function eb(){return new ev}t4(4);let e_={default:150},ex=()=>e_.default,ew=new ep(8,()=>({addedLength:0,lengths:t5(F.Float32,ex()),percents:t5(F.Float32,ex())})),eE=new ep(8,()=>({lengths:[],totalLength:0}),t=>{if(!te(t))return;let{length:e}=t.lengths;for(let s=0;s<e;s++)ew.release(t.lengths[s]);t.lengths.length=0}),eC=t5(F.Float32,8);function eS(t,e,s,i){let r={},a=`${t[0]}_${t[1]}_${e[0]}_${e[1]}_${s[0]}_${s[1]}_${i[0]}_${i[1]}`.replaceAll(".","p");if(!r[a]){let n=ex(),o,h,l=0,p,m,c=null;2===t.length&&(t[0]!==e[0]||t[1]!==e[1])&&eP(t[0],t[1],e[0],e[1],t[0]+s[0],t[1]+s[1])&&eP(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(n=2);let d=new eI(n),{length:u}=s;for(let r=0;r<n;r++){m=t4(u),h=r/(n-1),p=0;for(let r=0;r<u;r++)o=Math.pow(1-h,3)*t[r]+3*Math.pow(1-h,2)*h*(t[r]+s[r])+3*(1-h)*Math.pow(h,2)*(e[r]+i[r])+Math.pow(h,3)*e[r],m[r]=o,null!==c&&(p+=Math.pow(Number(m[r])-Number(c[r]),2));l+=p=Math.sqrt(p),d.points[r]=new eF(p,m),c=m}d.segmentLength=l,r[a]=d}return r[a]}function ek(t,e,s,i,r,a,n){let o=r,h=a;o<0?o=0:o>1&&(o=1);let l=eD(o,n),p=eD(h=h>1?1:h,n),m=1-l,c=1-p,d=m*m*m,u=l*m*m*3,f=l*l*m*3,g=l*l*l,y=m*m*c,v=l*m*c+m*l*c+m*m*p,b=l*l*c+m*l*p+l*m*p,_=l*l*p,x=m*c*c,w=l*c*c+m*p*c+m*c*p,E=l*p*c+m*p*p+l*c*p,C=l*p*p,S=c*c*c,k=p*c*c+c*p*c+c*c*p,M=p*p*c+c*p*p+p*c*p,P=p*p*p,{length:A}=t;for(let r=0;r<A;r++)eC[4*r]=Math.round((d*t[r]+u*s[r]+f*i[r]+g*e[r])*1e3)/1e3,eC[4*r+1]=Math.round((y*t[r]+v*s[r]+b*i[r]+_*e[r])*1e3)/1e3,eC[4*r+2]=Math.round((x*t[r]+w*s[r]+E*i[r]+C*e[r])*1e3)/1e3,eC[4*r+3]=Math.round((S*t[r]+k*s[r]+M*i[r]+P*e[r])*1e3)/1e3;return eC}function eM(t){let e,s=eE.newElement(),i=t.c,r=t.v,a=t.o,n=t.i,o=t._length||0,{lengths:h}=s,l=0;for(e=0;e<o-1;e++)h[e]=eT(r[e],r[e+1],a[e],n[e+1]),l+=h[e].addedLength;return i&&o&&(h[e]=eT(r[e],r[0],a[e],n[0]),l+=h[e].addedLength),s.totalLength=l,s}function eP(t,e,s,i,r,a){let n=t*i+e*r+s*a-r*i-a*t-s*e;return n>-.001&&n<.001}function eA(t,e,s,i,r,a,n,o,h){let l;if(0===s&&0===a&&0===h)return eP(t,e,i,r,n,o);let p=Math.sqrt(Math.pow(i-t,2)+Math.pow(r-e,2)+Math.pow(a-s,2)),m=Math.sqrt(Math.pow(n-t,2)+Math.pow(o-e,2)+Math.pow(h-s,2)),c=Math.sqrt(Math.pow(n-i,2)+Math.pow(o-r,2)+Math.pow(h-a,2));return(l=p>m?p>c?p-m-c:c-m-p:c>m?c-m-p:m-p-c)>-1e-4&&l<1e-4}function eT(t,e,s,i){let r=ex(),a,n,o=0,h,l=[],p=[],m=ew.newElement(),c=s.length;for(let d=0;d<r;d++){n=d/(r-1),h=0;for(let r=0;r<c;r++)a=Math.pow(1-n,3)*t[r]+3*Math.pow(1-n,2)*n*s[r]+3*(1-n)*Math.pow(n,2)*i[r]+Math.pow(n,3)*e[r],l[r]=a,"number"==typeof p[r]&&(h+=Math.pow(l[r]-p[r],2)),p[r]=l[r];h&&(o+=h=Math.sqrt(h)),m.percents[d]=n,m.lengths[d]=o}return m.addedLength=o,m}function eD(t,{addedLength:e,lengths:s,percents:i}){let{length:r}=i,a=Math.floor((r-1)*t),n=t*e,o=0;if(a===r-1||0===a||n===s[a])return i[a];let h=s[a]>n?-1:1,l=!0;for(;l;)if(s[a]<=n&&s[a+1]>n?(o=(n-s[a])/(s[a+1]-s[a]),l=!1):a+=h,a<0||a>=r-1){if(a===r-1)return i[a];l=!1}return i[a]+(i[a+1]-i[a])*o}class eI{constructor(t){this.segmentLength=0,this.points=Array.from({length:t})}}class eF{constructor(t,e){this.partialLength=t,this.point=e}}let eL={getPointInSegment:function(t,e,s,i,r,a){let n=eD(r,a),o=1-n;return[Math.round((o*o*o*t[0]+(n*o*o+o*n*o+o*o*n)*s[0]+(n*n*o+o*n*n+n*o*n)*i[0]+n*n*n*e[0])*1e3)/1e3,Math.round((o*o*o*t[1]+(n*o*o+o*n*o+o*o*n)*s[1]+(n*n*o+o*n*n+n*o*n)*i[1]+n*n*n*e[1])*1e3)/1e3]},getSegmentsLength:eM},e$={};function eN(t,e,s,i,r){let a=r||`bez_${t}_${e}_${s}_${i}`.replaceAll(".","p");if(e$[a])return e$[a];let n=new eV([t,e,s,i]);return e$[a]=n,n}class eV{constructor(t){this.float32ArraySupported="function"==typeof Float32Array,this.kSplineTableSize=11,this.kSampleStepSize=1/(this.kSplineTableSize-1),this.NEWTON_ITERATIONS=4,this.NEWTON_MIN_SLOPE=.001,this.SUBDIVISION_MAX_ITERATIONS=10,this.SUBDIVISION_PRECISION=1e-7,this._p=t,this._mSampleValues=this.float32ArraySupported?new Float32Array(this.kSplineTableSize):Array.from({length:this.kSplineTableSize}),this._precomputed=!1,this.get=this.get.bind(this)}_calcSampleValues(){let t=this._p[0],e=this._p[2];for(let s=0;s<this.kSplineTableSize;++s)this._mSampleValues[s]=this.calcBezier(s*this.kSampleStepSize,t,e)}_getTForX(t){let e=this._p[0],s=this._p[2],i=this._mSampleValues,r=0,a=1,n=this.kSplineTableSize-1;for(;a!==n&&Number(i[a])<=t;++a)r+=this.kSampleStepSize;let o=r+(t-Number(i[--a]))/(Number(i[a+1])-Number(i[a]))*this.kSampleStepSize,h=this.getSlope(o,e,s);return h>=this.NEWTON_MIN_SLOPE?this.newtonRaphsonIterate(t,o,e,s):0===h?o:this.binarySubdivide(t,r,r+this.kSampleStepSize,e,s)}_precompute(){let t=this._p[0],e=this._p[1],s=this._p[2],i=this._p[3];this._precomputed=!0,(t!==e||s!==i)&&this._calcSampleValues()}get(t){let e=this._p[0],s=this._p[1],i=this._p[2],r=this._p[3];return(this._precomputed||this._precompute(),e===s&&i===r)?t:0===t?0:1===t?1:this.calcBezier(this._getTForX(t),s,r)}A(t,e){return 1-3*e+3*t}B(t,e){return 3*e-6*t}binarySubdivide(t,e,s,i,r){let a=e,n=s,o,h,l=0;do h=a+(n-a)/2,(o=this.calcBezier(h,i,r)-t)>0?n=h:a=h;while(Math.abs(o)>this.SUBDIVISION_PRECISION&&++l<this.SUBDIVISION_MAX_ITERATIONS);return h}C(t){return 3*t}calcBezier(t,e,s){return((this.A(e,s)*t+this.B(e,s))*t+this.C(e))*t}getSlope(t,e,s){return 3*this.A(e,s)*t*t+2*this.B(e,s)*t+this.C(e)}newtonRaphsonIterate(t,e,s,i){let r=e;for(let e=0;e<this.NEWTON_ITERATIONS;++e){let e=this.getSlope(r,s,i);if(0===e)break;let a=this.calcBezier(r,s,i)-t;r-=a/e}return r}}class eR{addDynamicProperty(t){this.dynamicProperties.includes(t)||(this.dynamicProperties.push(t),this.container?.addDynamicProperty(this),this._isAnimated=!0)}getValue(t){throw Error(`${this.constructor.name}: Method getValue is not implemented`)}initDynamicPropertyContainer(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}iterateDynamicProperties(){this._mdf=!1;let{length:t}=this.dynamicProperties;for(let e=0;e<t;e++)this.dynamicProperties[e].getValue(),this.dynamicProperties[e]._mdf&&(this._mdf=!0);return 0}setGroupProperty(t){}constructor(){this.dynamicProperties=[]}}let eO=(t,e)=>{let s=e[0],i=e[1],r=e[2],a=e[3],n=Math.atan2(2*i*a-2*s*r,1-2*i*i-2*r*r),o=Math.asin(2*s*i+2*r*a),h=Math.atan2(2*s*a-2*i*r,1-2*s*s-2*r*r);t[0]=n/ti,t[1]=o/ti,t[2]=h/ti},ez=t=>{let e=t[0]*ti,s=t[1]*ti,i=t[2]*ti,r=Math.cos(e/2),a=Math.cos(s/2),n=Math.cos(i/2),o=Math.sin(e/2),h=Math.sin(s/2),l=Math.sin(i/2);return[o*h*n+r*a*l,o*a*n+r*h*l,r*h*n-o*a*l,r*a*n-o*h*l]},eB=(t,e,s)=>{let i=[0,0,0,0],r=t[0],a=t[1],n=t[2],o=t[3],h=e[0],l=e[1],p=e[2],m=e[3],c,d,u,f,g;return(d=r*h+a*l+n*p+o*m)<0&&(d=-d,h=-h,l=-l,p=-p,m=-m),1-d>1e-6?(u=Math.sin(c=Math.acos(d)),f=Math.sin((1-s)*c)/u,g=Math.sin(s*c)/u):(f=1-s,g=s),i[0]=f*r+g*h,i[1]=f*a+g*l,i[2]=f*n+g*p,i[3]=f*o+g*m,i};class eG extends eR{addEffect(t){this.effectsSequence.push(t),this.container?.addDynamicProperty(this)}getSpeedAtTime(t){throw Error(`${this.constructor.name}: Method getSpeedAtTime is not implemented`)}getValueAtCurrentTime(){if(this._caching=this._caching??{},!this.keyframes)return;let t=Number(this.offsetTime),e=Number(this.comp?.renderedFrame)-t,s=this.keyframes[0].t-t,i=this.keyframes.length-1,r=this.keyframes[i].t-t,a=Number(this._caching.lastFrame);if(!(e===a||-999999!==a&&(a>=r&&e>=r||a<s&&e<s))){a>=e&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);let t=this.interpolateValue(e,this._caching);this.pv=t}return this._caching.lastFrame=e,this.pv}getValueAtTime(t,e){throw Error(`${this.constructor.name}: Method getValueAtTime is not implemented`)}getVelocityAtTime(t){throw Error(`${this.constructor.name}: Method getVelocityAtTime is not implemented`)}initiateExpression(t,e,s){throw Error("Method not implemented")}interpolateValue(t,e={}){let s,i=Number(this.offsetTime),r=[0,0,0];this.propType===O.MultiDimensional&&this.pv&&(r=t5(F.Float32,this.pv.length));let{keyframes:a=[],keyframesMetadata:n,propType:o}=this,h=e.lastIndex||0,l=h,p=a.length-1,m=!0,c=a[0],d=a[1];for(;m;){if(c=a[l],d=a[l+1],l===p-1&&t>=d.t-i){c.h&&(c=d),h=0;break}if(d.t-i>t){h=l;break}l<p-1?l++:(h=0,m=!1)}let u=n[l]??{},f,g,y,v,b=null,_=d.t-i,x=c.t-i;if(c.to&&c.s){u.bezierData=u.bezierData??eS(c.s,d.s??c.e,c.to,c.ti);let{__fnct:s,bezierData:i}=u;if(t>=_||t<x){let e=t>=_?i.points.length-1:0;f=i.points[e].point.length;for(let t=0;t<f;t++)r[t]=i.points[e].point[t]}else{s?b=s:u.__fnct=b=eN(c.o.x,c.o.y,c.i.x,c.i.y,c.n).get,g=b((t-x)/(_-x));let a=i.segmentLength*g,n,o=Number(e.lastFrame)<t&&e._lastKeyframeIndex===l?e._lastAddedLength:0;for(v=Number(e.lastFrame)<t&&e._lastKeyframeIndex===l?e._lastPoint:0,m=!0,y=i.points.length;m;){if(o+=i.points[v].partialLength,0===a||0===g||v===i.points.length-1){f=i.points[v].point.length;for(let t=0;t<f;t++)r[t]=i.points[v].point[t];break}if(a>=o&&a<o+i.points[v+1].partialLength){n=(a-o)/i.points[v+1].partialLength,f=i.points[v].point.length;for(let t=0;t<f;t++)r[t]=i.points[v].point[t]+(i.points[v+1].point[t]-i.points[v].point[t])*n;break}v<y-1?v++:m=!1}e._lastPoint=v,e._lastAddedLength=o-i.points[v].partialLength,e._lastKeyframeIndex=l}}else{let e,i,a,n,h;if(p=c.s?.length||0,s=d.s??c.e,this.sh&&1!==c.h)t>=_?(r[0]=s[0],r[1]=s[1],r[2]=s[2]):t<=x&&c.s?(r[0]=c.s[0],r[1]=c.s[1],r[2]=c.s[2]):eO(r,eB(ez(c.s),ez(s),(t-x)/(_-x)));else for(l=0;l<p;l++)1!==c.h&&(t>=_?g=1:t<x?g=0:(c.o.x.constructor===Array?(u.__fnct=u.__fnct??[],u.__fnct[l]?b=u.__fnct[l]:Q(c.o.y)&&Q(c.i.y)&&Q(c.i.x)&&(e=c.o.x[l]??c.o.x[0],i=c.o.y[l]??c.o.y[0],b=eN(e,i,a=c.i.x[l]??c.i.x[0],c.i.y[l]??c.i.y[0]).get,u.__fnct[l]=b)):u.__fnct?b=u.__fnct:(e=c.o.x,i=c.o.y,b=eN(e,i,a=c.i.x,c.i.y).get,c.keyframeMetadata=b),g=b?.((t-x)/(_-x)))),s=d.s??c.e,void 0!==(h=1===c.h?c.s?.[l]:Number(c.s?.[l])+(s[l]-Number(c.s?.[l]))*Number(g))&&(o===O.MultiDimensional?r[l]=h:r=h)}return e.lastIndex=h,r}processEffectsSequence(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.elem)throw Error(`${this.constructor.name}: elem (ElementInterface) is not implemented`);if(this.elem.globalData?.frameId===this.frameId)return 0;if(0===this.effectsSequence.length)return this._mdf=!1,0;if(this.lock&&this.pv)return this.setVValue(this.pv),0;this.lock=!0,this._mdf=!!this._isFirstFrame;let t=this.effectsSequence.length,e=this.kf?this.pv:this.data.k;for(let s=0;s<t;s++)e=this.effectsSequence[s](e);return this.setVValue(e),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData?.frameId,0}setVValue(t){let e;if("number"==typeof t&&this.propType===O.UniDimensional){e=t*Number(this.mult),Math.abs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);return}let s=0,{length:i}=this.v;for(;s<i;)e=t[s]*Number(this.mult),Math.abs(this.v[s]-e)>1e-5&&(this.v[s]=e,this._mdf=!0),s++}speedAtTime(t){throw Error("Method is not implemented")}valueAtTime(t,e){throw Error(`${this.constructor.name}: Method valueAtTime is not implemented`)}velocityAtTime(t){throw Error("Method is not implemented")}constructor(...t){super(...t),this.effectsSequence=[],this.initFrame=-999999,this.keyframesMetadata=[],this.offsetTime=0}}class eq extends eG{constructor(t,e,s=null,i=null){let r,a,n,o;super(),this.propType=O.MultiDimensional;let{length:h}=e.k;for(let t=0;t<h-1;t++)e.k[t].to&&e.k[t].s&&e.k[t+1]?.s&&(r=e.k[t].s,a=e.k[t+1].s,n=e.k[t].to,o=e.k[t].ti,(2===r.length&&(r[0]!==a[0]||r[1]!==a[1])&&eP(r[0],r[1],a[0],a[1],r[0]+n[0],r[1]+n[1])&&eP(r[0],r[1],a[0],a[1],a[0]+o[0],a[1]+o[1])||3===r.length&&(r[0]!==a[0]||r[1]!==a[1]||r[2]!==a[2])&&eA(r[0],r[1],r[2],a[0],a[1],a[2],r[0]+n[0],r[1]+n[1],r[2]+n[2])&&eA(r[0],r[1],r[2],a[0],a[1],a[2],a[0]+o[0],a[1]+o[1],a[2]+o[2]))&&(e.k[t].to=null,e.k[t].ti=null),(r[0]===a[0]&&r[1]===a[1]&&0===n[0]&&0===n[1]&&0===o[0]&&0===o[1]&&2===r.length||r[2]===a[2]&&0===n[2]&&0===o[2])&&(e.k[t].to=null,e.k[t].ti=null));this.effectsSequence=[this.getValueAtCurrentTime.bind(this)],this.data=e,this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=this.processEffectsSequence,this.frameId=-1;let l=e.k[0].s?.length||0;this.v=t5(F.Float32,l),this.pv=t5(F.Float32,l);for(let t=0;t<l;t++)this.v[t]=this.initFrame,this.pv[t]=this.initFrame;this._caching={lastFrame:this.initFrame,lastIndex:0,value:t5(F.Float32,l)}}}class ej extends eG{constructor(t,e,s=null,i=null){super(),this.propType=O.UniDimensional,this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.frameId=-1,this._caching={_lastKeyframeIndex:-1,lastFrame:this.initFrame,lastIndex:0,value:0},this.k=!0,this.kf=!0,this.data=e,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=this.initFrame,this.pv=this.initFrame,this._isFirstFrame=!0,this.getValue=this.processEffectsSequence,this.effectsSequence=[this.getValueAtCurrentTime.bind(this)]}}class eW extends eG{constructor(t,e,s=null,i=null){super(),this.propType=O.MultiDimensional,this.mult=s||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;let{length:r}=e.k;this.v=t5(F.Float32,r),this.pv=t5(F.Float32,r),this.vel=t5(F.Float32,r);for(let t=0;t<r;t++)this.v[t]=e.k[t]*this.mult,this.pv[t]=e.k[t];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=this.processEffectsSequence}}class eH extends eG{constructor(){super(),this.propType=!1}}class eY extends eG{constructor(t,e,s=null,i=null){super(),this.propType=O.UniDimensional,this.mult=s||1,this.data=e,this.v=e.k*(s||1),this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=this.processEffectsSequence}}let eU={getProp:function(t,e,s,i,r){let a,n=e;if(n&&"sid"in n&&n.sid&&(n=t.globalData?.slotManager?.getProp(n)),n?.k?.length)if("number"==typeof(n?.k)[0])a=new eW(t,n,i,r);else switch(s){case 0:a=new ej(t,n,i,r);break;case 1:a=new eq(t,n,i,r)}else a=new eY(t,n,i,r);return(a=a??new eH).effectsSequence.length>0&&r?.addDynamicProperty(a),a}};class eJ extends eR{getValueAtTime(t,e){throw Error(`${this.constructor.name}: Method getShapeValueAtTime is not implemented`)}initiateExpression(t,e,s){throw Error(`${this.constructor.name}: Method initiateExpression is not implemented`)}interpolateShape(t,e,s={}){let i=s.lastIndex||0,r,a,n,o=0,h,l=this.keyframes??[];if(t<l[0].t-this.offsetTime)r=l[0].s?.[0],n=!0,i=0;else if(t>=l[l.length-1].t-this.offsetTime)r=l[l.length-1].s?l[l.length-1].s?.[0]:l[l.length-2].e[0],n=!0;else{let e,s,h=i,p=l.length-1,m=!0;for(;m&&(e=l[h],!((s=l[h+1]).t-this.offsetTime>t));)h<p-1?h++:m=!1;if(!e||!s)throw Error(`${this.constructor.name}: Could not set keyframe data`);let c=this.keyframesMetadata[h]||{};if(n=1===e.h,i=h,!n){if(t>=s.t-this.offsetTime)o=1;else if(t<e.t-this.offsetTime)o=0;else{let i;c.__fnct?i=c.__fnct:"number"==typeof e.o.x&&"number"==typeof e.o.y&&"number"==typeof e.i.x&&"number"==typeof e.i.y&&(c.__fnct=i=eN(e.o.x,e.o.y,e.i.x,e.i.y).get),o=i?.((t-(e.t-this.offsetTime))/(s.t-this.offsetTime-(e.t-this.offsetTime)))||0}a=s.s?s.s[0]:e.e[0]}r=e.s?.[0]}if(!r||"number"==typeof r||Q(r)||"number"==typeof a)return;let p=e._length,m=r.i[0].length;s.lastIndex=i;for(let t=0;t<p;t++)for(let s=0;s<m;s++)h=n?r.i[t][s]:r.i[t][s]+((a?.i[t][s]??0)-r.i[t][s])*o,e.i[t][s]=h,h=n?r.o[t][s]:r.o[t][s]+((a?.o[t][s]??0)-r.o[t][s])*o,e.o[t][s]=h,h=n?r.v[t][s]:r.v[t][s]+((a?.v[t][s]??0)-r.v[t][s])*o,e.v[t][s]=h}interpolateShapeCurrentTime(){if(!this.pv)throw Error(`${this.constructor.name}: Cannot parse ShapePath v value`);if(!this.keyframes)return;this._caching=this._caching??{};let t=Number(this.comp?.renderedFrame)-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=Number(this._caching.lastFrame);return -999999!==i&&(i<e&&t<e||i>s&&t>s)||(this._caching.lastIndex=i<t?Number(this._caching.lastIndex):0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}processEffectsSequence(t){let e,s;if(!this.data)throw Error(`${this.constructor.name}: data (Shape) is not implemented`);if(this.elem?.globalData?.frameId===this.frameId)return 0;if(0===this.effectsSequence.length)return this._mdf=!1,0;if(this.lock&&this.pv)return this.setVValue(this.pv),0;this.lock=!0,this._mdf=!1,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt?.k;let i=this.effectsSequence.length;for(s=0;s<i;s++)e=this.effectsSequence[s](e);return this.setVValue(e),this.lock=!1,this.frameId=this.elem?.globalData?.frameId||0,0}reset(){this.paths=this.localShapeCollection}setVValue(t){if(!this.v||!t)throw Error(`${this.constructor.name}: ShapePath is not set`);if(!this.localShapeCollection)throw Error(`${this.constructor.name}: localShapeCollection is not set`);this.shapesEqual(this.v,t)||(this.v=eg(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}shapesEqual(t,e){if(t._length!==e._length||t.c!==e.c)return!1;let s=t._length||0;for(let i=0;i<s;i++)if(t.v[i]?.[0]!==e.v[i]?.[0]||t.v[i]?.[1]!==e.v[i]?.[1]||t.o[i]?.[0]!==e.o[i]?.[0]||t.o[i]?.[1]!==e.o[i]?.[1]||t.i[i]?.[0]!==e.i[i]?.[0]||t.i[i]?.[1]!==e.i[i]?.[1])return!1;return!0}constructor(...t){super(...t),this.effectsSequence=[],this.keyframesMetadata=[],this.offsetTime=0}}class eX extends eJ{constructor(t,e){super(),this._cPoint=.5519,this.v=eu(),this.v.setPathData(!0,4),this.localShapeCollection=eb(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=eU.getProp(t,e.p,1,0,this),this.s=eU.getProp(t,e.s,1,0,this),this.dynamicProperties.length>0?this.k=!0:(this.k=!1,this.convertEllToPath())}convertEllToPath(){if(!this.p)return;let t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,r=3!==this.d,a=this.v;if(!a)throw Error(`${this.constructor.name}: Could not get value of ellipse`);a.v[0][0]=t,a.v[0][1]=e-i,a.v[1][0]=r?t+s:t-s,a.v[1][1]=e,a.v[2][0]=t,a.v[2][1]=e+i,a.v[3][0]=r?t-s:t+s,a.v[3][1]=e,a.i[0][0]=r?t-s*this._cPoint:t+s*this._cPoint,a.i[0][1]=e-i,a.i[1][0]=r?t+s:t-s,a.i[1][1]=e-i*this._cPoint,a.i[2][0]=r?t+s*this._cPoint:t-s*this._cPoint,a.i[2][1]=e+i,a.i[3][0]=r?t-s:t+s,a.i[3][1]=e+i*this._cPoint,a.o[0][0]=r?t+s*this._cPoint:t-s*this._cPoint,a.o[0][1]=e-i,a.o[1][0]=r?t+s:t-s,a.o[1][1]=e+i*this._cPoint,a.o[2][0]=r?t-s*this._cPoint:t+s*this._cPoint,a.o[2][1]=e+i,a.o[3][0]=r?t-s:t+s,a.o[3][1]=e-i*this._cPoint}getValue(t){return this.elem?.globalData?.frameId===this.frameId||(this.frameId=this.elem?.globalData?.frameId||0,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath()),0}}class eK extends eJ{constructor(t,e){super(),this.v=eu(),this.v.c=!0,this.localShapeCollection=eb(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=eU.getProp(t,e.p,1,0,this),this.s=eU.getProp(t,e.s,1,0,this),this.r=eU.getProp(t,e.r,0,0,this),this.dynamicProperties.length>0?this.k=!0:(this.k=!1,this.convertRectToPath())}convertRectToPath(){if(!this.p)throw Error(`${this.constructor.name}: p value is not implemented`);let t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,r=Math.min(s,i,this.r.v),a=.44810000000000005*r;this.v&&(this.v._length=0),2===this.d||1===this.d?(this.v?.setTripleAt(t+s,e-i+r,t+s,e-i+r,t+s,e-i+a,0,!0),this.v?.setTripleAt(t+s,e+i-r,t+s,e+i-a,t+s,e+i-r,1,!0),0===r?(this.v?.setTripleAt(t-s,e+i,t-s+a,e+i,t-s,e+i,2),this.v?.setTripleAt(t-s,e-i,t-s,e-i+a,t-s,e-i,3)):(this.v?.setTripleAt(t+s-r,e+i,t+s-r,e+i,t+s-a,e+i,2,!0),this.v?.setTripleAt(t-s+r,e+i,t-s+a,e+i,t-s+r,e+i,3,!0),this.v?.setTripleAt(t-s,e+i-r,t-s,e+i-r,t-s,e+i-a,4,!0),this.v?.setTripleAt(t-s,e-i+r,t-s,e-i+a,t-s,e-i+r,5,!0),this.v?.setTripleAt(t-s+r,e-i,t-s+r,e-i,t-s+a,e-i,6,!0),this.v?.setTripleAt(t+s-r,e-i,t+s-a,e-i,t+s-r,e-i,7,!0))):(this.v?.setTripleAt(t+s,e-i+r,t+s,e-i+a,t+s,e-i+r,0,!0),0===r?(this.v?.setTripleAt(t-s,e-i,t-s+a,e-i,t-s,e-i,1,!0),this.v?.setTripleAt(t-s,e+i,t-s,e+i-a,t-s,e+i,2,!0),this.v?.setTripleAt(t+s,e+i,t+s-a,e+i,t+s,e+i,3,!0)):(this.v?.setTripleAt(t+s-r,e-i,t+s-r,e-i,t+s-a,e-i,1,!0),this.v?.setTripleAt(t-s+r,e-i,t-s+a,e-i,t-s+r,e-i,2,!0),this.v?.setTripleAt(t-s,e-i+r,t-s,e-i+r,t-s,e-i+a,3,!0),this.v?.setTripleAt(t-s,e+i-r,t-s,e+i-a,t-s,e+i-r,4,!0),this.v?.setTripleAt(t-s+r,e+i,t-s+r,e+i,t-s+a,e+i,5,!0),this.v?.setTripleAt(t+s-r,e+i,t+s-a,e+i,t+s-r,e+i,6,!0),this.v?.setTripleAt(t+s,e+i-r,t+s,e+i-r,t+s,e+i-a,7,!0)))}getValue(){return this.elem?.globalData?.frameId===this.frameId||(this.elem?.globalData?.frameId&&(this.frameId=this.elem.globalData.frameId),this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath()),0}}class eZ extends eJ{constructor(t,e,s){super(),this.propType=O.Shape,this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;let i=3===s?e.pt?.k:e.ks?.k;if(!i)throw Error(`${this.constructor.name}: Could now get Path Data`);this.v=eg(i),this.pv=eg(this.v),this.localShapeCollection=eb(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.effectsSequence=[],this.getValue=this.processEffectsSequence}}class eQ extends eJ{constructor(t,e,s){super(),this.data=e,this.propType=O.Shape,this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data?.st||0,this.keyframes=3===s?e.pt?.k:e.ks?.k??[],this.keyframesMetadata=[],this.k=!0,this.kf=!0;let i=this.keyframes[0].s,{length:r}=i?.[0].i??[];this.v=eu(),this.v.setPathData(!!i?.[0].c,r),this.pv=eg(this.v),this.localShapeCollection=eb(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=-999999,this._caching={lastFrame:-999999,lastIndex:0},this.effectsSequence=[this.interpolateShapeCurrentTime.bind(this)],this.getValue=this.processEffectsSequence}}class e0 extends eJ{constructor(t,e){super(),this.v=eu(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=eU.getProp(t,e.ir,0,0,this),this.is=eU.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=eU.getProp(t,e.pt,0,0,this),this.p=eU.getProp(t,e.p,1,0,this),this.r=eU.getProp(t,e.r,0,ti,this),this.or=eU.getProp(t,e.or,0,0,this),this.os=eU.getProp(t,e.os,0,.01,this),this.localShapeCollection=eb(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length>0?this.k=!0:(this.k=!1,this.convertToPath())}convertPolygonToPath(){if(!this.data)throw Error(`${this.constructor.name}: data (Shape) is not implemented`);if(!this.p)throw Error(`${this.constructor.name}: p value is not implemented`);let t=Math.floor(this.pt.v),e=2*Math.PI/t,s=this.or.v,i=this.os.v,r=2*Math.PI*s/(4*t),a=-(.5*Math.PI),n=3===this.data.d?-1:1;a+=this.r.v,this.v&&(this.v._length=0);for(let o=0;o<t;o++){let t=s*Math.cos(a),h=s*Math.sin(a),l=0===t&&0===h?0:h/Math.sqrt(t*t+h*h),p=0===t&&0===h?0:-t/Math.sqrt(t*t+h*h);t+=Number(this.p.v[0]),h+=Number(this.p.v[1]),this.v?.setTripleAt(t,h,t-l*r*i*n,h-p*r*i*n,t+l*r*i*n,h+p*r*i*n,o,!0),a+=e*n}this.paths.length=0,this.paths[0]=this.v}convertStarToPath(){if(!this.data)throw Error(`${this.constructor.name}: data (Shape) is not implemented`);if(!this.v)throw Error(`${this.constructor.name}: v (ShapePath) is not implemented`);let t=2*Math.floor(this.pt.v),e=2*Math.PI/t,s=!0,i=this.or.v,r=Number(this.ir?.v),a=this.os.v,n=Number(this.is?.v),o=2*Math.PI*i/(2*t),h=2*Math.PI*r/(2*t),l,p,m,c=-Math.PI/2;c+=this.r.v;let d=3===this.data.d?-1:1;this.v._length=0;for(let u=0;u<t;u++){l=s?i:r,p=s?a:n,m=s?o:h;let t=l*Math.cos(c),f=l*Math.sin(c),g=0===t&&0===f?0:f/Math.sqrt(t*t+f*f),y=0===t&&0===f?0:-t/Math.sqrt(t*t+f*f);t+=Number(this.p?.v[0]),f+=Number(this.p?.v[1]),this.v.setTripleAt(t,f,t-g*m*p*d,f-y*m*p*d,t+g*m*p*d,f+y*m*p*d,u,!0),s=!s,c+=e*d}}convertToPath(){throw Error(`${this.constructor.name}: Method convertToPath is not implemented`)}getValue(t){return this.elem?.globalData?.frameId===this.frameId||(this.frameId=this.elem?.globalData?.frameId||0,this.iterateDynamicProperties(),this._mdf&&this.convertToPath()),0}}let e1={getConstructorFunction:function(){return eZ},getKeyframedConstructorFunction:function(){return eQ},getShapeProp:function(t,e,s,i,r){let a=null;switch(s){case 3:case 4:{let i=3===s?e.pt:e.ks,r=i?.k;if(r?.length){a=new eQ(t,e,s);break}a=new eZ(t,e,s);break}case 5:a=new eK(t,e);break;case 6:a=new eX(t,e);break;case 7:a=new e0(t,e)}return a?.k&&t.addDynamicProperty(a),a}};class e2{constructor(t,e){this.data=t,this.element=e,this.masksProperties=this.data.masksProperties??[],this.viewData=t4(this.masksProperties.length);let{length:s}=this.masksProperties,i=!1;for(let t=0;t<s;t++)"n"!==this.masksProperties[t].mode&&(i=!0),this.viewData[t]=e1.getShapeProp(this.element,this.masksProperties[t],3);this.hasMasks=i,i&&this.element.addRenderableComponent(this)}destroy(){this.element=null}getMaskProperty(t){return this.viewData[t]}renderFrame(t){let e,s;if(!this.element.globalData?.compSize)throw Error(`${this.constructor.name}: element->globalData->compSize is not implemented`);if(!this.hasMasks)return;let i=this.element.finalTransform?.mat,r=this.element.canvasContext,{length:a}=this.masksProperties;r?.beginPath();for(let t=0;t<a;t++)if("n"!==this.masksProperties[t].mode){this.masksProperties[t].inv&&(r?.moveTo(0,0),r?.lineTo(this.element.globalData.compSize.w,0),r?.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),r?.lineTo(0,this.element.globalData.compSize.h),r?.lineTo(0,0));let a=this.viewData[t].v;if(!a)throw Error(`${this.constructor.name}: Could not access ShapePath`);let n=i?.applyToPointArray(a.v[0][0],a.v[0][1],0)??[];r?.moveTo(n[0],n[1]);let o=a._length;for(e=1;e<o;e++)s=i?.applyToTriplePoints(a.o[e-1],a.i[e],a.v[e])??[],r?.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);s=i?.applyToTriplePoints(a.o[e-1],a.i[0],a.v[0])??[],r?.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}this.element.globalData.renderer.save(!0),r?.clip()}}class e3{constructor(t,e,s){this.p=eU.getProp(e,t.v,0,0,s)}}class e5{constructor(t,e,s){this.p=eU.getProp(e,t.v,1,0,s)}}class e4 extends e3{}class e6 extends e3{}class e8 extends e5{}class e9 extends e5{}class e7 extends e3{}class st extends e3{}class se extends e3{}class ss{constructor(){this.p={}}}class si extends eR{constructor(t,e,s){super(),this.effectElements=[],this.getValue=this.iterateDynamicProperties,this.init(t,e,s)}init(t,e,s){let i;this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);let r=this.data.ef,{length:a}=r;for(let t=0;t<a;t++){switch(r[t].ty){case 0:i=new e4(r[t],e,this);break;case 1:i=new e6(r[t],e,this);break;case 2:i=new e8(r[t],e,this);break;case 3:i=new e9(r[t],e,this);break;case 4:case 7:i=new se(r[t],e,this);break;case 10:i=new e7(r[t],e,this);break;case 11:i=new st(r[t],e,this);break;case 5:i=new sr(s,e);break;default:i=new ss}this.effectElements.push(i)}}renderFrame(t){throw Error(`${this.constructor.name}: Method renderFrame is not implemented yet`)}}class sr{constructor(t,e,s){let i=t.ef??[];this.effectElements=[];let{length:r}=i;for(let s=0;s<r;s++){let r=new si(i[s],e,t);this.effectElements.push(r)}}}function sa(t=16){return({0:"source-over",1:"multiply",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light"})[t]||""}class sn{buildAllItems(){throw Error(`${this.constructor.name}: Method buildAllItems is not implemented`)}checkLayers(t){throw Error(`${this.constructor.name}: Method checkLayers is not implemented`)}checkMasks(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not initialized`);if(!this.data.hasMask)return!1;let t=0,{length:e}=this.data.masksProperties??[];for(;t<e;){if(this.data.masksProperties?.[t].mode!=="n"&&this.data.masksProperties?.[t].cl!==!1)return!0;t++}return!1}destroy(){}destroyBaseElement(){throw Error(`${this.constructor.name}: Method destroyBaseElement is not implemented`)}getBaseElement(){throw Error(`${this.constructor.name}: Method getBaseElement is not implemented`)}getType(){return this.type}initBaseData(t,e,s){this.globalData=e,this.comp=s,this.data=t,this.layerId=K(),this.data.sr||(this.data.sr=1),this.effectsManager=new sr(this.data,this,this.dynamicProperties)}initExpressions(){try{if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);let t=tR();if(!t)return;let e=t("layer"),s=t("effects"),i=t("shape"),r=t("text"),a=t("comp");this.layerInterface=new e(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);let n=new s().createEffectsInterface(this,this.layerInterface);if(this.layerInterface.registerEffectsInterface(n),0===this.data.ty||this.data.xt){this.compInterface=new a(this);return}if(4===this.data.ty){this.layerInterface.shapeInterface=new i(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface;return}5===this.data.ty&&(this.layerInterface.textInterface=new r(this),this.layerInterface.text=this.layerInterface.textInterface)}catch(t){console.error(this.constructor.name,t)}}setBlendMode(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);let t=sa(this.data.bm),e=this.baseElement??this.layerElement;if(!e)throw Error(`${this.constructor.name}: Both baseElement and layerElement are not implemented`);e.style.mixBlendMode=t}sourceRectAtTime(){throw Error(`${this.constructor.name}: Method sourceRectAtTime is not implemented`)}constructor(){this.dynamicProperties=[],this.frameDuration=1,this.itemsData=[],this.layerInterface=null,this.shapesData=[]}}class so extends eG{constructor(t,e,s){if(super(),this.defaultVector=[0,0],this.elem=t,this.frameId=-1,this.propType=O.Transform,this.data=e,this.v=new t6,this.pre=new t6,this.appliedTransformations=0,this.initDynamicPropertyContainer(s??t),e.p&&"s"in e.p?(this.px=eU.getProp(t,e.p.x,0,0,this),this.py=eU.getProp(t,e.p.y,0,0,this),"z"in e.p&&(this.pz=eU.getProp(t,e.p.z,0,0,this))):this.p=eU.getProp(t,e.p??{k:[0,0,0]},1,0,this),"rx"in e){if(this.rx=eU.getProp(t,e.rx,0,ti,this),this.ry=eU.getProp(t,e.ry,0,ti,this),this.rz=eU.getProp(t,e.rz,0,ti,this),e.or?.k[0].ti){let{length:t}=e.or.k;for(let s=0;s<t;s++)e.or.k[s].to=null,e.or.k[s].ti=null}this.or=eU.getProp(t,e.or,1,ti,this),this.or.sh=!0}else this.r=eU.getProp(t,e.r??{k:0},0,ti,this);e.sk&&(this.sk=eU.getProp(t,e.sk,0,ti,this),this.sa=eU.getProp(t,e.sa,0,ti,this)),this.a=eU.getProp(t,e.a??{k:[0,0,0]},1,0,this),this.s=eU.getProp(t,e.s??{k:[100,100,100]},1,.01,this),e.o?this.o=eU.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,0===this.dynamicProperties.length&&this.getValue(!0)}addDynamicProperty(t){super.addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0}applyToMatrix(t){if(!this.data)throw Error(`${this.constructor.name}: data (Shape) is not implemented`);this.iterateDynamicProperties(),this._mdf=!!this._mdf,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,Number(this.sa?.v)),this.r?t.rotate(-Number(this.r.v)):t.rotateZ(-Number(this.rz?.v)).rotateY(Number(this.ry?.v)).rotateX(Number(this.rx?.v)).rotateZ(-Number(this.or?.v[2])).rotateY(Number(this.or?.v[1])).rotateX(Number(this.or?.v[0])),this.data.p&&"s"in this.data.p?"z"in this.data.p?t.translate(Number(this.px?.v),Number(this.py?.v),-Number(this.pz?.v)):t.translate(Number(this.px?.v),Number(this.py?.v),0):t.translate(Number(this.p?.v[0]),Number(this.p?.v[1]),-Number(this.p?.v[2]))}autoOrient(){throw Error(`${this.constructor.name}: Method autoOrient not implemented`)}getValue(t){if(this.elem.globalData?.frameId===this.frameId)return 0;if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.a&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.s&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,Number(this.sa?.v)),this.r&&this.appliedTransformations<4?this.v.rotate(-Number(this.r.v)):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-Number(this.rz?.v)).rotateY(Number(this.ry?.v)).rotateX(Number(this.rx?.v)).rotateZ(-Number(this.or?.v[2])).rotateY(Number(this.or?.v[1])).rotateX(Number(this.or?.v[0])),this.autoOriented){let t,e,{frameRate:s}=this.elem.globalData??{frameRate:60};if(this.p?.keyframes)Number(this.p._caching?.lastFrame)+Number(this.p.offsetTime)<=this.p.keyframes[0].t?(t=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/s,0),e=this.p.getValueAtTime(Number(this.p.keyframes[0].t)/s,0)):Number(this.p._caching?.lastFrame)+Number(this.p.offsetTime)>=this.p.keyframes[this.p.keyframes.length-1].t?(t=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/s,0),e=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/s,0)):(t=this.p.pv,e=this.p.getValueAtTime((Number(this.p._caching?.lastFrame)+Number(this.p.offsetTime)-.01)/s,Number(this.p.offsetTime)));else if(this.px?.keyframes&&this.py?.keyframes){t=[0,0],e=[0,0];let{px:i,py:r}=this,{keyframes:a=[]}=i,{keyframes:n=[]}=r;Number(i._caching?.lastFrame)+Number(i.offsetTime)<=a[0].t?(t[0]=i.getValueAtTime((a[0].t+.01)/s,0),t[1]=r.getValueAtTime((n[0].t+.01)/s,0),e[0]=i.getValueAtTime(a[0].t/s,0),e[1]=r.getValueAtTime(Number(n[0]?.t)/s,0)):Number(i._caching?.lastFrame)+i.offsetTime>=a[a.length-1].t?(t[0]=i.getValueAtTime(a[a.length-1].t/s,0),t[1]=r.getValueAtTime(n[n.length-1].t/s,0),e[0]=i.getValueAtTime((a[a.length-1].t-.01)/s,0),e[1]=r.getValueAtTime((n[n.length-1].t-.01)/s,0)):(t=[i.pv,r.pv],e[0]=i.getValueAtTime((Number(i._caching?.lastFrame)+i.offsetTime-.01)/s,i.offsetTime),e[1]=r.getValueAtTime((Number(r._caching?.lastFrame)+r.offsetTime-.01)/s,r.offsetTime))}else t=e=this.defaultVector;this.v.rotate(-Math.atan2(t[1]-e[1],t[0]-e[0]))}this.data.p&&"s"in this.data.p?"z"in this.data.p?this.v.translate(Number(this.px?.v),Number(this.py?.v),-Number(this.pz?.v)):this.v.translate(Number(this.px?.v),Number(this.py?.v),0):this.p&&this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}return this.frameId=this.elem.globalData?.frameId,0}precalculateMatrix(){if(this.appliedTransformations=0,this.pre.reset(),!this.a?.effectsSequence.length){if(!this.a)throw Error(`${this.constructor.name}: Cannot read 'a' value`);if(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s?.effectsSequence.length){if(!this.s)throw Error(`${this.constructor.name}: Cannot read 's' value`);if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length>0||this.sa?.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,Number(this.sa?.v)),this.appliedTransformations=3}if(this.r){0===this.r.effectsSequence.length&&(this.pre.rotate(-Number(this.r.v)),this.appliedTransformations=4);return}this.rz?.effectsSequence.length||this.ry?.effectsSequence.length||this.rx?.effectsSequence.length||this.or?.effectsSequence.length||(this.pre.rotateZ(-Number(this.rz?.v)).rotateY(Number(this.ry?.v)).rotateX(Number(this.rx?.v)).rotateZ(-Number(this.or?.v[2])).rotateY(this.or?.v[1]).rotateX(this.or?.v[0]),this.appliedTransformations=4)}}}}let sh={getTransformProperty:(t,e,s)=>new so(t,e,s)};class sl extends sn{globalToLocal(t){let e,s=t,i=[];i.push(this.finalTransform);let r=!0,{comp:a}=this;for(;r;)a?.finalTransform?(a.data?.hasMask&&i.splice(0,0,a.finalTransform),a=a.comp):r=!1;let{length:n}=i;for(let t=0;t<n;t++)e=i[t]?.mat.applyToPointArray(0,0,0),s=[s[0]-Number(e?.[0]),s[1]-Number(e?.[1]),0];return s}initTransform(){if(!this.data)throw Error(`${this.constructor.name}: LottiePlayer is not initialized`);let t=new t6;this.finalTransform={_localMatMdf:!1,_matMdf:!1,_opMdf:!1,localMat:t,localOpacity:1,mat:t,mProp:this.data.ks?sh.getTransformProperty(this,this.data.ks,this):{o:0}},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0)}renderLocalTransform(){if(!this.localTransforms)return;if(!this.finalTransform)throw Error(`${this.constructor.name}: finalTransform is not initialized`);let t=0,{length:e}=this.localTransforms;if(this.finalTransform._localMatMdf=!!this.finalTransform._matMdf,!this.finalTransform._localMatMdf||!this.finalTransform._opMdf)for(;t<e;)this.localTransforms[t]._mdf&&(this.finalTransform._localMatMdf=!0),this.localTransforms[t]._opMdf&&!this.finalTransform._opMdf&&(this.finalTransform.localOpacity=Number(this.finalTransform.mProp.o?.v),this.finalTransform._opMdf=!0),t++;if(this.finalTransform._localMatMdf){let{localMat:s,mat:i}=this.finalTransform;for(this.localTransforms[0].matrix?.clone(s),t=1;t<e;t++){let e=this.localTransforms[t].matrix;e&&s.multiply(e)}s.multiply(i)}if(this.finalTransform._opMdf){let s=this.finalTransform.localOpacity;for(t=0;t<e;t++)s*=.01*this.localTransforms[t].opacity;this.finalTransform.localOpacity=s}}renderTransform(){if(!this.finalTransform)throw Error(`${this.constructor.name}: finalTransform is not initialized`);if(this.finalTransform._opMdf=!!(this.finalTransform.mProp.o?._mdf||this._isFirstFrame),this.finalTransform._matMdf=!!(this.finalTransform.mProp._mdf||this._isFirstFrame),this.hierarchy){let t=this.finalTransform.mat,e=0,{length:s}=this.hierarchy;if(!this.finalTransform._matMdf)for(;e<s;){if(this.hierarchy[e].finalTransform?.mProp._mdf){this.finalTransform._matMdf=!0;break}e++}if(this.finalTransform._matMdf){let i=this.finalTransform.mProp.v.props;for(t.cloneFromProps(i),e=0;e<s;e++)if(this.hierarchy[e].finalTransform?.mProp.v){let{v:s}=this.hierarchy[e].finalTransform?.mProp??{v:null};s&&t.multiply(s)}}}this.finalTransform._matMdf&&(this.finalTransform._localMatMdf=this.finalTransform._matMdf),this.finalTransform._opMdf&&(this.finalTransform.localOpacity=Number(this.finalTransform.mProp.o?.v))}searchEffectTransforms(){if(!this.renderableEffectsManager)return;let t=this.renderableEffectsManager.getEffects(R.TransformEffect);if(0===t.length)return;this.localTransforms=[],this.finalTransform&&(this.finalTransform.localMat=new t6);let{length:e}=t;for(let s=0;s<e;s++)this.localTransforms.push(t[s])}constructor(...t){super(...t),this.mHelper=new t6}}class sp extends sl{checkParenting(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.comp)throw Error(`${this.constructor.name}: comp (ElementInterface) is not implemented`);void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}initHierarchy(){this.hierarchy=[],this._isParent=!1,this.checkParenting()}setAsParent(){this._isParent=!0}setHierarchy(t){this.hierarchy=t}}class sm extends sp{addDynamicProperty(t){this.dynamicProperties.includes(t)||this.dynamicProperties.push(t)}initFrame(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1}prepareProperties(t,e){let{length:s}=this.dynamicProperties;for(let t=0;t<s;t++)(e||this._isParent&&this.dynamicProperties[t].propType===O.Transform)&&(this.dynamicProperties[t].getValue(),this.globalData&&this.dynamicProperties[t]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))}constructor(...t){super(...t),this.displayStartTime=0}}class sc extends sm{addRenderableComponent(t){this.renderableComponents.includes(t)||this.renderableComponents.push(t)}checkLayerLimits(t){this.data&&this.globalData&&(this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide()))}checkTransparency(){if(!this.finalTransform)throw Error(`${this.constructor.name}: finalTransform is not implemented`);if(0>=Number(this.finalTransform.mProp.o?.v)){!this.isTransparent&&(this.globalData?.renderConfig).hideOnTransparent&&(this.isTransparent=!0,this.hide());return}this.isTransparent&&(this.isTransparent=!1,this.show())}getLayerSize(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);return 5===this.data.ty?{h:Number(this.data.textData?.height),w:Number(this.data.textData?.width)}:{h:Number(this.data.height),w:Number(this.data.width)}}hide(){}initRenderable(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]}prepareRenderableFrame(t,e){this.checkLayerLimits(t)}removeRenderableComponent(t){this.renderableComponents.includes(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)}renderRenderable(){let{length:t}=this.renderableComponents;for(let e=0;e<t;e++)this.renderableComponents[e].renderFrame(Number(this._isFirstFrame))}show(){throw Error(`${this.constructor.name}: Method show is not implemented`)}sourceRectAtTime(){return{height:100,left:0,top:0,width:100}}constructor(...t){super(...t),this.renderableComponents=[]}}let sd=new class{constructor(){if(this.maskType=!0,this.offscreenCanvas="undefined"!=typeof OffscreenCanvas,this.svgLumaHidden=!0,!to)return;this.maskType=!/MSIE 10/i.test(navigator.userAgent)&&!/MSIE 9/i.test(navigator.userAgent)&&!/rv:11.0/i.test(navigator.userAgent)&&!/Edge\/\d./i.test(navigator.userAgent),this.svgLumaHidden=!/firefox/i.test(navigator.userAgent)}},su="__lottie_element_luma_buffer",sf=null,sg=null,sy=null;function sv(){(!sf||!sg)&&(sy=function(){let t=tq("svg"),e=tq("filter"),s=tq("feColorMatrix");return e.id=su,s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0"),e.appendChild(s),t.appendChild(e),t.id=`${su}_svg`,sd.svgLumaHidden&&(t.style.display="none"),t}(),document.body.appendChild(sy),(sg=(sf=tG("canvas")).getContext("2d"))&&(sg.filter=`url(#${su})`,sg.fillStyle="rgba(0,0,0,0)",sg.fillRect(0,0,1,1)))}let sb={createCanvas:function(t,e){if(sd.offscreenCanvas)return new OffscreenCanvas(t,e);let s=tG("canvas");return s.width=t,s.height=e,s},getLumaCanvas:function(t){if(sf&&sg||sv(),!sf||!sg)throw Error("Could not create Canvas Element");return sf.width=t.width,sf.height=t.height,sg.filter=`url(#${su})`,sf},loadLumaCanvas:sv},s_={1:"source-in",2:"source-out",3:"source-in",4:"source-out"};class sx extends sc{clearCanvas(t){if(!this.transformCanvas)throw Error(`${this.constructor.name}: transformCanvas is not implemented`);t?.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)}createContainerElements(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.globalData.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented in globalData`);if(this.data.tt&&this.data.tt>=1){this.buffers=[];let{canvasContext:t}=this.globalData,e=sb.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(e);let s=sb.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(s),this.data.tt>=3&&!document._isProxy&&sb.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new er(this),this.searchEffectTransforms()}createContent(){}createElements(){throw Error(`${this.constructor.name}: createElements is not implemented`)}createRenderableComponents(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);this.maskManager=new e2(this.data,this),this.renderableEffectsManager&&(this.transformEffects=this.renderableEffectsManager.getEffects(R.TransformEffect))}destroy(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager?.destroy()}exitLayer(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);let t=this.data.tt||0;if(t<1)return;let e=this.buffers[1],s=e.getContext("2d");this.clearCanvas(s),s.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);let i=Number(this.data.ind)-1;"tp"in this.data&&void 0!==this.data.tp&&(i=this.data.tp);let r=this.comp?.getElementById(i);if(r?.renderFrame(1),this.canvasContext.setTransform(1,0,0,1,0,0),t>=3&&!document._isProxy){let t=sb.getLumaCanvas(this.canvasContext.canvas),e=t.getContext("2d");e?.drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(t,0,0)}this.canvasContext.globalCompositeOperation=s_[t],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}hideElement(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)}initRendererElement(){}prepareLayer(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);if(1>(this.data.tt||0))return;let t=this.buffers[0].getContext("2d");this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}renderFrame(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(this.hidden||this.data.hd||1===this.data.td&&!t)return;this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();let e=0===this.data.ty;this.prepareLayer();let{renderer:s}=this.globalData;s.save(e),s.ctxTransform(this.finalTransform?.localMat.props),s.ctxOpacity(this.finalTransform?.localOpacity),this.renderInnerContent(),s.restore(e),this.exitLayer(),this.maskManager?.hasMasks&&s.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}renderInnerContent(){throw Error("Method is not implemented")}setBlendMode(){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);let{data:t,globalData:e}=this;if(!e.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented in globalData`);if(e.blendMode!==t.bm){e.blendMode=t.bm;let s=sa(t.bm);e.canvasContext.globalCompositeOperation=s}}showElement(){if(!this.maskManager)throw Error(`${this.constructor.name}: Method maskManager is not implemented`);this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)}constructor(...t){super(...t),this.buffers=[],this.transformEffects=[]}}sx.prototype.hide=sx.prototype.hideElement,sx.prototype.show=sx.prototype.showElement;class sw extends sc{createContainerElements(){throw Error(`${this.constructor.name}: Method createContainerElements is not implemented`)}createContent(){throw Error(`${this.constructor.name}: Method createContent is not implemented`)}createRenderableComponents(){throw Error(`${this.constructor.name}: Method createRenderableComponents is not implemented`)}destroy(){this.innerElem=null,this.destroyBaseElement()}hide(){if(this.hidden||this.isInRange&&!this.isTransparent)return;let t=this.baseElement??this.layerElement;t&&(t.style.display="none"),this.hidden=!0}initElement(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initTransform(),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()}initRendererElement(){throw Error(`${this.constructor.name}: Method initRendererElement is not implemented`)}prepareFrame(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()}renderElement(){throw Error(`${this.constructor.name}: Method renderElement is not implemented`)}renderFrame(t){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))}renderInnerContent(){throw Error(`${this.constructor.name}: Method renderInnerContent is not implemented`)}show(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(this.isInRange||!this.isTransparent){if(!this.data.hd){let t=this.baseElement??this.layerElement;if(!t)throw Error(`${this.constructor.name}: Neither baseElement or layerElement is implemented`);t.style.display="block"}this.hidden=!1,this._isFirstFrame=!0}}}class sE extends sw{destroy(){this.destroyElements(),this.destroyBaseElement()}destroyElements(){let{length:t}=this.layers;for(let e=0;e<t;e++)this.elements[e]?.destroy()}getElements(){return this.elements}initElement(t,e,s){if(this.initFrame(),this.initBaseData(t,e,s),this.initTransform(),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);(this.data.xt||!e.progressiveLoad)&&this.buildAllItems(),this.hide()}prepareFrame(t){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),!this.isInRange&&!this.data.xt)return;if(this.tm?._placeholder)this.renderedFrame=t/Number(this.data.sr);else{let t=this.tm?.v||0;t===this.data.op&&(t=this.data.op-1),this.renderedFrame=t}let{length:e}=this.elements;this.completeLayers||this.checkLayers(this.renderedFrame);for(let t=e-1;t>=0;t--)(this.completeLayers||this.elements[t])&&(this.elements[t]?.prepareFrame(this.renderedFrame-this.layers[t].st),this.elements[t]?._mdf&&(this._mdf=!0))}renderInnerContent(){let{length:t}=this.layers;for(let e=0;e<t;e++)(this.completeLayers||this.elements[e])&&this.elements[e]?.renderFrame()}setElements(t){this.elements=t}constructor(...t){super(...t),this.currentFrame=0,this.elements=[],this.layers=[]}}class sC{constructor(t,e,s){this.masksProperties=[],this.data=t,this.element=e,this.globalData=s,this.storedData=[],this.masksProperties=this.data.masksProperties??[],this.maskElement=null;let{defs:i}=this.globalData,{length:r}=this.masksProperties;this.viewData=t4(r),this.solidPath="";let a=this.masksProperties,n=0,o=[],h=K(),l,p,m,c="clipPath",d="clip-path";for(let t=0;t<r;t++){let e;("a"!==a[t].mode&&"n"!==a[t].mode||a[t].inv||a[t].o?.k!==100||a[t].o?.x)&&(c="mask",d="mask"),("s"===a[t].mode||"i"===a[t].mode)&&0===n?((l=tq("rect")).setAttribute("fill","#ffffff"),l.setAttribute("width",`${Number(this.element.comp?.data?.w)}`),l.setAttribute("height",`${Number(this.element.comp?.data?.h)}`),o.push(l)):l=null;let s=tq("path");if("n"===a[t].mode){this.viewData[t]={elem:s,lastPath:"",op:eU.getProp(this.element,a[t].o,0,.01,this.element),prop:e1.getShapeProp(this.element,a[t],3)},i.appendChild(s);continue}if(n++,s.setAttribute("fill","s"===a[t].mode?"#000000":"#ffffff"),s.setAttribute("clip-rule","nonzero"),a[t].x?.k===0)p=null,m=null;else{c="mask",d="mask",m=eU.getProp(this.element,a[t].x,0,null,this.element),e=K();let r=tq("filter");r.id=e,(p=tq("feMorphology")).setAttribute("operator","erode"),p.setAttribute("in","SourceGraphic"),p.setAttribute("radius","0"),r.appendChild(p),i.appendChild(r),s.setAttribute("stroke","s"===a[t].mode?"#000000":"#ffffff")}if(this.storedData[t]={elem:s,expan:p,filterId:e,lastOperator:"",lastPath:"",lastRadius:0,x:m},"i"===a[t].mode){let{length:t}=o,e=tq("g");for(let s=0;s<t;s++)e.appendChild(o[s]);let r=tq("mask");r.setAttribute("mask-type","alpha"),r.id=`${h}_${n}`,r.appendChild(s),i.appendChild(r),e.setAttribute("mask",`url(${ee()}#${h}_${n})`),o.length=0,o.push(e)}else o.push(s);a[t].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[t]={elem:s,invRect:l,lastPath:"",op:eU.getProp(this.element,a[t].o,0,.01,this.element),prop:e1.getShapeProp(this.element,a[t],3)};let r=this.viewData[t].prop?.v;!this.viewData[t].prop?.k&&r&&this.drawPath(a[t],r,this.viewData[t])}this.maskElement=tq(c);let{length:u}=o;for(let t=0;t<u;t++)this.maskElement.appendChild(o[t]);n>0&&(this.maskElement.id=h,this.element.maskedElement?.setAttribute(d,`url(${ee()}#${h})`),i.appendChild(this.maskElement)),this.viewData.length>0&&this.element.addRenderableComponent(this)}createLayerSolidPath(){let t="M0,0 ";return t+` h${this.globalData.compSize?.w||0} v${this.globalData.compSize?.h||0} h-${this.globalData.compSize?.w||0} v-${this.globalData.compSize?.h||0} `}destroy(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null}drawPath(t,e,s){let i,r=` M${e.v[0]?.[0]},${e.v[0]?.[1]}`,a=e._length||0;for(i=1;i<a;i++)r+=` C${e.o[i-1]?.[0]},${e.o[i-1]?.[1]} ${e.i[i]?.[0]},${e.i[i]?.[1]} ${e.v[i]?.[0]},${e.v[i]?.[1]}`;if(e.c&&a>1&&(r+=` C${e.o[i-1]?.[0]},${e.o[i-1]?.[1]} ${e.i[0]?.[0]},${e.i[0]?.[1]} ${e.v[0]?.[0]},${e.v[0]?.[1]}`),s.lastPath!==r){let i="";s.elem&&(e.c&&(i=t?.inv?this.solidPath+r:r),s.elem.setAttribute("d",i)),s.lastPath=r}}getMaskelement(){return this.maskElement}getMaskProperty(t){return this.viewData[t].prop}renderFrame(t){let e=this.element.finalTransform?.mat,{length:s}=this.masksProperties;for(let i=0;i<s;i++){let s=this.viewData[i].prop?.v;if(s&&(this.viewData[i].prop?._mdf||t)&&this.drawPath(this.masksProperties[i]||null,s,this.viewData[i]),(this.viewData[i].op._mdf||t)&&this.viewData[i].elem.setAttribute("fill-opacity",`${this.viewData[i].op.v}`),"n"===this.masksProperties[i].mode||(this.viewData[i].invRect&&(this.element.finalTransform?.mProp._mdf||t)&&this.viewData[i].invRect?.setAttribute("transform",`${e?.getInverseMatrix().to2dCSS()}`),!this.storedData[i]?.x||!(this.storedData[i].x?._mdf||t)))continue;let r=this.storedData[i].expan;if(0>Number(this.storedData[i].x?.v)){"erode"!==this.storedData[i].lastOperator&&(this.storedData[i].lastOperator="erode",this.storedData[i].elem.setAttribute("filter",`url(${ee()}#${this.storedData[i].filterId})`)),r?.setAttribute("radius",`${-Number(this.storedData[i].x?.v)}`);continue}"dilate"!==this.storedData[i].lastOperator&&(this.storedData[i].lastOperator="dilate",this.storedData[i].elem.removeAttribute("filter")),this.storedData[i].elem.setAttribute("stroke-width",`${2*Number(this.storedData[i].x?.v)}`)}}}class sS extends sw{createContainerElements(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.layerElement)throw Error(`${this.constructor.name}: layerElement is not implemented`);this.matteElement=tq("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;let t=null;if(this.data.td){this.matteMasks={};let e=tq("g");this.layerId&&(e.id=this.layerId),e.appendChild(this.layerElement),t=e,this.globalData.defs.appendChild(e)}else this.data.tt?(this.matteElement.appendChild(this.layerElement),t=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&(this.layerElement.id=this.data.ln),this.data.cl&&this.layerElement.classList.add(this.data.cl),0===this.data.ty&&!this.data.hd){let e=tq("clipPath"),s=tq("path");s.setAttribute("d",`M0,0 L${this.data.w},0 L${this.data.w},${this.data.h} L0,${this.data.h}z`);let i=K();if(e.id=i,e.appendChild(s),this.globalData.defs.appendChild(e),this.checkMasks()){let e=tq("g");e.setAttribute("clip-path",`url(${ee()}#${i})`),e.appendChild(this.layerElement),this.transformedElement=e,t?t.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path",`url(${ee()}#${i})`)}0!==this.data.bm&&this.setBlendMode()}createRenderableComponents(){if(!this.data)throw Error(`${this.constructor.name}: layerData is not initialized`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not initialized`);this.maskManager=new sC(this.data,this,this.globalData),this.renderableEffectsManager=new eh(this),this.searchEffectTransforms()}destroyBaseElement(){this.layerElement=null,this.matteElement=null,this.maskManager?.destroy()}getBaseElement(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);return this.data.hd?null:this.baseElement??null}getMatte(t=1){let e,s,i,r;if(this.matteMasks=this.matteMasks??{},this.matteMasks[t])return this.matteMasks[t];let a=`${this.layerId}_${t}`;switch(t){case 1:case 3:{let n=tq("mask");if(n.id=a,n.setAttribute("mask-type",3===t?"luminance":"alpha"),(i=tq("use")).setAttributeNS(tr,"href",`#${this.layerId}`),n.appendChild(i),this.globalData?.defs.appendChild(n),sd.maskType||1!==t)break;n.setAttribute("mask-type","luminance"),e=K(),s=ea.createFilter(e),this.globalData?.defs.appendChild(s),s.appendChild(ea.createAlphaToLuminanceFilter()),(r=tq("g")).appendChild(i),n.appendChild(r),r.setAttribute("filter",`url(${ee()}#${e})`)}break;case 2:{let t=tq("mask");t.id=a,t.setAttribute("mask-type","alpha");let n=tq("g");t.appendChild(n),e=K(),s=ea.createFilter(e);let o=tq("feComponentTransfer");o.setAttribute("in","SourceGraphic"),s.appendChild(o);let h=tq("feFuncA");h.setAttribute("type","table"),h.setAttribute("tableValues","1.0 0.0"),o.appendChild(h),this.globalData?.defs.appendChild(s);let l=tq("rect");l.width.baseVal.value=this.comp?.data?.w||0,l.height.baseVal.value=this.comp?.data?.h||0,l.x.baseVal.value=0,l.y.baseVal.value=0,l.setAttribute("fill","#ffffff"),l.setAttribute("opacity","0"),n.setAttribute("filter",`url(${ee()}#${e})`),n.appendChild(l),(i=tq("use")).setAttributeNS(tr,"href",`#${this.layerId}`),n.appendChild(i),sd.maskType||(t.setAttribute("mask-type","luminance"),s.appendChild(ea.createAlphaToLuminanceFilter()),r=tq("g"),n.appendChild(l),this.layerElement&&r.appendChild(this.layerElement),n.appendChild(r)),this.globalData?.defs.appendChild(t)}}return this.matteMasks[t]=a,this.matteMasks[t]}initRendererElement(){this.layerElement=tq("g")}renderElement(){if(!this.finalTransform)throw Error(`${this.constructor.name}: finalTransform is not implemented`);this.finalTransform._localMatMdf&&this.transformedElement?.setAttribute("transform",this.finalTransform.localMat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement?.setAttribute("opacity",`${this.finalTransform.localOpacity}`)}setMatte(t){this.matteElement&&this.matteElement.setAttribute("mask",`url(${ee()}#${t})`)}}class sk extends sS{constructor(t,e,s){super(),this.layers=[],t.refId&&(this.assetData=e.getAssetData(t.refId)),this.assetData?.sid&&(this.assetData=e.slotManager?.getProp(this.assetData)||null),this.initElement(t,e,s),this.sourceRect={height:Number(this.assetData?.h),left:0,top:0,width:Number(this.assetData?.w)}}createContent(){let t="";this.assetData&&this.globalData?.getAssetsPath&&(t=this.globalData.getAssetsPath(this.assetData)),this.assetData&&(this.innerElem=tq("image"),this.innerElem.setAttribute("width",`${this.assetData.w}px`),this.innerElem.setAttribute("height",`${this.assetData.h}px`),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData?.renderConfig?.imagePreserveAspectRatio||""),this.innerElem.setAttributeNS(tr,"href",t),this.layerElement?.appendChild(this.innerElem))}renderInnerContent(){}sourceRectAtTime(){return this.sourceRect}}class sM{constructor(){this.it=[],this.prevViewData=[],this.gr=tq("g")}}function sP(t,e,s,i){if(0===e)return"";let r=t.o,a=t.i,n=t.v,o,h=` M${i.applyToPointStringified(n[0][0],n[0][1])}`;for(o=1;o<e;o++)h+=` C${i.applyToPointStringified(r[o-1][0],r[o-1][1])} ${i.applyToPointStringified(a[o][0],a[o][1])} ${i.applyToPointStringified(n[o][0],n[o][1])}`;return s&&e&&(h+=` C${i.applyToPointStringified(r[o-1][0],r[o-1][1])} ${i.applyToPointStringified(a[0][0],a[0][1])} ${i.applyToPointStringified(n[0][0],n[0][1])}z`),h}let sA=new t6,sT=new t6;function sD(t,e,s){if(!e)throw Error("SVGElementsRenderer: Method renderContetTransform is missing data");(s||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",`${e.transform.op.v}`),(s||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function sI(t,e,s){if(!e)throw Error("SVGElementsRenderer: Method renderFill is missing data");let i=e.style;e.c?.v&&(e.c._mdf||s)&&i.pElem.setAttribute("fill",`rgb(${Math.floor(e.c.v[0])},${Math.floor(e.c.v[1])},${e.c.v[2]})`),(e.o?._mdf||s)&&i.pElem.setAttribute("fill-opacity",`${e.o?.v}`)}function sF(t,e,s){let i,r;if(!e)throw Error("SVGElementsRenderer: Method renderGradient is missing data");let a=e.gf,n=e.g?._hasOpacity,o=e.s?.v??[0,0],h=e.e?.v??[0,0];if(e.o?._mdf||s){let s=t.ty===V.GradientFill?"fill-opacity":"stroke-opacity";e.style?.pElem.setAttribute(s,`${e.o?.v}`)}if(e.s?._mdf||s){let s=1===t.t?"x1":"cx",i="x1"===s?"y1":"cy";a?.setAttribute(s,`${o[0]}`),a?.setAttribute(i,`${o[1]}`),n&&!e.g?._collapsable&&(e.of?.setAttribute(s,`${o[0]}`),e.of?.setAttribute(i,`${o[1]}`))}if(e.g&&(e.g._cmdf||s)){i=e.cst;let t=e.g.c,{length:s}=i;for(let e=0;e<s;e++)(r=i[e]).setAttribute("offset",`${t[4*e]}%`),r.setAttribute("stop-color",`rgb(${t[4*e+1]},${t[4*e+2]},${t[4*e+3]})`)}if(n&&e.g&&(e.g._omdf||s)){let t=e.g.o,{length:s}=i=e.g._collapsable?e.cst:e.ost;for(let a=0;a<s;a++)r=i[a],e.g._collapsable||r.setAttribute("offset",`${t[2*a]}%`),r.setAttribute("stop-opacity",`${t[2*a+1]}`)}if(1===t.t)(e.e?._mdf||s)&&(a?.setAttribute("x2",`${h[0]}`),a?.setAttribute("y2",`${h[1]}`),n&&!e.g?._collapsable&&(e.of?.setAttribute("x2",`${h[0]}`),e.of?.setAttribute("y2",`${h[1]}`)));else{let t=0;if((e.s?._mdf||e.e?._mdf||s)&&(t=Math.sqrt(Math.pow(o[0]-h[0],2)+Math.pow(o[1]-h[1],2)),a?.setAttribute("r",`${t}`),n&&!e.g?._collapsable&&e.of?.setAttribute("r",`${t}`)),e.e?._mdf||e.h?._mdf||e.a?._mdf||s){t||(t=Math.sqrt(Math.pow(o[0]-h[0],2)+Math.pow(o[1]-h[1],2)));let s=Math.atan2(h[1]-o[1],h[0]-o[0]),i=Number(e.h?.v);i>=1?i=.99:i<=-1&&(i=-.99);let r=t*i,l=Math.cos(s+Number(e.a?.v))*r+o[0],p=Math.sin(s+Number(e.a?.v))*r+o[1];a?.setAttribute("fx",`${l}`),a?.setAttribute("fy",`${p}`),n&&!e.g?._collapsable&&(e.of?.setAttribute("fx",`${l}`),e.of?.setAttribute("fy",`${p}`))}}}function sL(t,e,s){sF(t,e,s),sV(t,e,s)}function s$(t){}function sN(t,e,s){let i,r,a,n,o,h,l;if(!e)throw Error("SVGElementsRenderer: Method renderPath is missing data");let{caches:p,lvl:m,sh:c,styles:d,transformers:u}=e,{length:f}=d;for(let e=0;e<f;e++){if(r=c?._mdf||!!s,d[e].lvl<m){for(o=sT.reset(),h=m-d[e].lvl,l=u.length-1;!r&&h>0;)r=u[l].mProps._mdf||r,h--,l--;if(r)for(h=m-d[e].lvl,l=u.length-1;h>0;)o.multiply(u[l].mProps.v),h--,l--}else o=sA;n=c?.paths;let f=n?._length||0;if(r){i="";for(let t=0;t<f;t++)a=n?.shapes[t],a?._length&&(i+=sP(a,a._length,!!a.c,o));p[e]=i}else i=p[e];d[e].d+=!0===t.hd?"":i,d[e]._mdf=r||d[e]._mdf}}function sV(t,e,s){if(!e?.style)throw Error("SVGElementsRenderer: Method renderStroke is missing data");let{c:i,d:r,o:a,style:{msElem:n,pElem:o},w:h}=e;r&&(r._mdf||s)&&r.dashStr&&(o.setAttribute("stroke-dasharray",r.dashStr),o.setAttribute("stroke-dashoffset",`${r.dashoffset[0]}`)),i&&(i._mdf||s)&&o.setAttribute("stroke",`rgb(${Math.floor(i.v[0])},${Math.floor(i.v[1])},${Math.floor(i.v[2])})`),(a?._mdf||s)&&o.setAttribute("stroke-opacity",`${a?.v??1}`),(h?._mdf||s)&&(o.setAttribute("stroke-width",`${h?.v||0}`),n?.setAttribute("stroke-width",`${h?.v||0}`))}class sR extends eR{constructor(t,e,s){super(),this.it=[],this.prevViewData=[],this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=eU.getProp(t,e.o,0,.01,this),this.c=eU.getProp(t,e.c,1,255,this),this.style=s}}class sO extends eR{constructor(t,e,s){super(),this.data=e,this.c=t5(F.Uint8c,4*e.p);let i=e.k.k?.[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=t5(F.Float32,i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(s),this.prop=eU.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}checkCollapsable(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k?.[0].s){let t=0,e=this.data.k.k.length;for(;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t++}}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0}comparePoints(t,e){let s=0,i=this.o.length/2;for(;s<i;){if(Math.abs(t[4*s]-t[4*e+2*s])>.01)return!1;s++}return!0}getValue(t){let e,s;if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,!this.prop._mdf&&!t||!tt(this.prop.v))return 0;let i=4*this.data.p;for(let r=0;r<i;r++)e=r%4==0?100:255,s=Math.round(this.prop.v[r]*e),this.c[r]!==s&&(this.c[r]=s,this._cmdf=!t);if(this.o.length>0){let{length:e}=this.prop.v;for(let i=4*this.data.p;i<e;i++)s=i%2==0?Math.round(100*this.prop.v[i]):this.prop.v[i],this.o[i-4*this.data.p]!==s&&(this.o[i-4*this.data.p]=s,this._omdf=!t)}return this._mdf=!t,0}}class sz extends eR{constructor(t,e,s){super(),this.cst=[],this.it=[],this.ost=[],this.prevViewData=[],this.stops=[],this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,s)}initGradientData(t,e,s){this.o=eU.getProp(t,e.o,0,.01,this),this.s=eU.getProp(t,e.s,1,null,this),this.e=eU.getProp(t,e.e,1,null,this),this.h=eU.getProp(t,e.h??{k:0},0,.01,this),this.a=eU.getProp(t,e.a??{k:0},0,ti,this),this.g=new sO(t,e.g,this),this.style=s,this.stops=[],this.setGradientData(s.pElem,e),this.setGradientOpacity(e,s),this._isAnimated=!!this._isAnimated}setGradientData(t,e){let s,i=K(),r=tq(1===e.t?"linearGradient":"radialGradient");r.id=i,r.setAttribute("spreadMethod","pad"),r.setAttribute("gradientUnits","userSpaceOnUse");let a=[],n=4*(e.g?.p||1);for(let t=0;t<n;t+=4)s=tq("stop"),r.appendChild(s),a.push(s);t.setAttribute(e.ty===V.GradientFill?"fill":"stroke",`url(${ee()}#${i})`),this.gf=r,this.cst=a}setGradientOpacity(t,e){let s;if(!this.g?._hasOpacity||this.g._collapsable)return;let i=tq("mask"),r=tq("path");i.appendChild(r);let a=K(),n=K();i.id=n;let o=tq(1===t.t?"linearGradient":"radialGradient");o.id=a,o.setAttribute("spreadMethod","pad"),o.setAttribute("gradientUnits","userSpaceOnUse");let h=(t.g?.k.k?.[0].s?(t.g?.k.k)[0].s.length:t.g?.k.k.length)||0,{stops:l}=this;for(let e=4*(t.g?.p||1);e<h;e+=2)(s=tq("stop")).setAttribute("stop-color","rgb(255,255,255)"),o.appendChild(s),l.push(s);r.setAttribute(t.ty===V.GradientFill?"fill":"stroke",`url(${ee()}#${a})`),t.ty===V.GradientStroke&&(r.setAttribute("stroke-linecap",z[t.lc||2]),r.setAttribute("stroke-linejoin",B[t.lj||2]),1===t.lj&&r.setAttribute("stroke-miterlimit",`${Number(t.ml)}`)),this.of=o,this.ms=i,this.ost=l,this.maskId=n,e.msElem=r}}class sB extends eR{constructor(t,e,s,i){let r;super(),this.elem=t,this.frameId=-1,this.dataProps=t4(e.length),this.renderer=s,this.k=!1,this.dashStr="",this.dashArray=t5(F.Float32,e.length>0?e.length-1:0),this.dashoffset=t5(F.Float32,1),this.initDynamicPropertyContainer(i);let a=e.length||0;for(let s=0;s<a;s++)r=eU.getProp(t,e[s].v,0,0,this),this.k=r.k||this.k,this.dataProps[s]={n:e[s].n,p:r};this.k||this.getValue(!0),this._isAnimated=this.k}getValue(t){if(this.elem.globalData?.frameId===this.frameId&&!t||(this.elem.globalData?.frameId&&(this.frameId=this.elem.globalData.frameId),this.iterateDynamicProperties(),this._mdf=this._mdf||!!t,!this._mdf))return 0;let e=this.dataProps.length;this.renderer===N.SVG&&(this.dashStr="");for(let t=0;t<e;t++){if("o"===this.dataProps[t].n){this.dashoffset[0]=this.dataProps[t].p.v;continue}if(this.renderer===N.SVG){this.dashStr+=` ${this.dataProps[t].p.v}`;continue}this.dashArray[t]=this.dataProps[t].p.v}return 0}}class sG extends sz{constructor(t,e,s){super(t,e,s),this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=eU.getProp(t,e.w,0,null,this),this.d=new sB(t,e.d||[],N.SVG,this),this.initGradientData(t,e,s),this._isAnimated=!!this._isAnimated}}class sq extends eR{constructor(t,e,s){super(),this.it=[],this.prevViewData=[],this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.style=s}}class sj{setAsAnimated(){this._isAnimated=!0}constructor(){this.caches=[],this.it=[],this.lStr="",this.lvl=0,this.pathsData=[],this.prevViewData=[],this.sh=null,this.styledShapes=[],this.styles=[],this.tr=[],this.transformers=[],this.trNodes=[]}}class sW extends sj{constructor(t,e,s){super(),this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=s,this.lvl=e,this._isAnimated=!!s.k;let i=0,{length:r}=t;for(;i<r;){if(t[i].mProps.dynamicProperties.length>0){this._isAnimated=!0;break}i++}}}class sH extends sR{constructor(t,e,s){super(t,e,s),this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=eU.getProp(t,e.o,0,.01,this),this.w=eU.getProp(t,e.w,0,null,this),this.d=new sB(t,e.d||[],N.SVG,this),this.c=eU.getProp(t,e.c,1,255,this),this.style=s,this._isAnimated=!!this._isAnimated}}class sY{constructor(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!0===t.hd,this.pElem=tq("path"),this.msElem=null}reset(){this.d="",this._mdf=!1}}class sU{constructor(t,e,s){this.transform={container:s,mProps:t,op:e},this.elements=[],this._isAnimated=!!(this.transform.mProps.dynamicProperties.length>0||this.transform.op.effectsSequence.length>0)}}class sJ{constructor(t,e){this.elem=t,this.pos=e}}class sX extends sw{addProcessedElement(t,e){let{processedElements:s}=this,i=s.length;for(;i;)if(s[--i].elem===t){s[i].pos=e;return}s.push(new sJ(t,e))}addShapeToModifiers(t){let{length:e}=this.shapeModifiers;for(let s=0;s<e;s++)this.shapeModifiers[s].addShape(t)}isShapeInAnimatedModifiers(t){let e=0,{length:s}=this.shapeModifiers;for(;e<s;){if(this.shapeModifiers[e].isAnimatedWithShape(t))return!0;e++}return!1}prepareFrame(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}renderModifiers(){if(0===this.shapeModifiers.length)return;let{length:t}=this.shapes;for(let e=0;e<t;e++)this.shapes[e].sh?.reset();let{length:e}=this.shapeModifiers;for(let t=e-1;t>=0&&!this.shapeModifiers[t].processShapes(!!this._isFirstFrame);t--);}searchProcessedElement(t){let{processedElements:e}=this,{length:s}=e,i=0;for(;i<s;){if(e[i].elem===t)return e[i].pos;i++}return 0}constructor(...t){super(...t),this.processedElements=[],this.shapeModifiers=[],this.shapes=[]}}let sK={};function sZ(t,e,s){if(!sK[t])throw Error("Invalid modifier");return new sK[t]}function sQ(t,e){sK[t]=sK[t]??e}class s0 extends sX{constructor(t,e,s){super(),this.createContainerElements=sS.prototype.createContainerElements,this.createRenderableComponents=sS.prototype.createRenderableComponents,this.destroyBaseElement=sS.prototype.destroyBaseElement,this.getBaseElement=sS.prototype.getBaseElement,this.getMatte=sS.prototype.getMatte,this.identityMatrix=new t6,this.initRendererElement=sS.prototype.initRendererElement,this.renderElement=sS.prototype.renderElement,this.setMatte=sS.prototype.setMatte,this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,s),this.prevViewData=[]}addToAnimatedContents(t,e){let s=0,{length:i}=this.animatedContents;for(;s<i;){if(this.animatedContents[s].element===e)return;s++}this.animatedContents.push({data:t,element:e,fn:function(t){switch(t.ty){case V.Fill:return sI;case V.GradientFill:return sF;case V.GradientStroke:return sL;case V.Stroke:return sV;case V.Path:case V.Ellipse:case V.Rectangle:case V.PolygonStar:return sN;case V.Transform:return sD;case V.NoStyle:return s$;default:return null}}(t)})}buildExpressionInterface(){}createContent(){if(!this.layerElement)throw Error(`${this.constructor.name}: Could not access Layer`);this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()}createGroupElement(t){let e=new sM;return t.ln&&(e.gr.id=t.ln),t.cl&&e.gr.classList.add(t.cl),t.bm&&(e.gr.style.mixBlendMode=sa(t.bm)),e}createShapeElement(t,e,s){let i=4;switch(t.ty){case V.Rectangle:i=5;break;case V.Ellipse:i=6;break;case V.PolygonStar:i=7}let r=new sW(e,s,e1.getShapeProp(this,t,i));return this.shapes.push(r),this.addShapeToModifiers(r),this.addToAnimatedContents(t,r),r}createStyleElement(t,e){let s=null,i=new sY(t,e),r=i.pElem;switch(t.ty){case V.Stroke:s=new sH(this,t,i);break;case V.Fill:s=new sR(this,t,i);break;case V.GradientFill:case V.GradientStroke:(s=new(t.ty===V.GradientFill?sz:sG)(this,t,i)).gf&&this.globalData?.defs.appendChild(s.gf),s.maskId&&s.ms&&s.of&&(this.globalData?.defs.appendChild(s.ms),this.globalData?.defs.appendChild(s.of),r.setAttribute("mask",`url(${ee()}#${s.maskId})`));break;case V.NoStyle:s=new sq(this,t,i)}return(t.ty===V.Stroke||t.ty===V.GradientStroke)&&(r.setAttribute("stroke-linecap",z[t.lc||2]),r.setAttribute("stroke-linejoin",B[t.lj||2]),r.setAttribute("fill-opacity","0"),1===t.lj&&t.ml&&r.setAttribute("stroke-miterlimit",`${t.ml}`)),2===t.r&&r.setAttribute("fill-rule","evenodd"),t.ln&&(r.id=t.ln),t.cl&&r.classList.add(t.cl),t.bm&&(r.style.mixBlendMode=sa(t.bm)),this.stylesList.push(i),s&&this.addToAnimatedContents(t,s),s}createTransformElement(t,e){let s=sh.getTransformProperty(this,t,this);if(!s.o)throw Error(`${this.constructor.name}: Missing required data in TransformProperty`);let i=new sU(s,s.o,e);return this.addToAnimatedContents(t,i),i}destroy(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null}filterUniqueShapes(){let t,e,{length:s}=this.shapes,i=this.stylesList.length,r=[];for(let a=0;a<i;a++){t=this.stylesList[a],e=!1,r.length=0;for(let i=0;i<s;i++)this.shapes[i].styles.includes(t)&&(r.push(this.shapes[i]),e=this.shapes[i]._isAnimated||e);r.length>1&&e&&this.setShapesAsAnimated(r)}}initSecondaryElement(){}reloadShapes(){if(!this.layerElement)throw Error(`${this.constructor.name}: Could not access layerElement`);this._isFirstFrame=!0;let{length:t}=this.itemsData;for(let e=0;e<t;e++)this.prevViewData[e]=this.itemsData[e];this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes();let{length:e}=this.dynamicProperties;for(let t=0;t<e;t++)this.dynamicProperties[t].getValue();this.renderModifiers()}renderInnerContent(){this.renderModifiers();let{length:t}=this.stylesList;for(let e=0;e<t;e++)this.stylesList[e].reset();this.renderShape();for(let e=0;e<t;e++)(this.stylesList[e]._mdf||this._isFirstFrame)&&(this.stylesList[e].msElem&&(this.stylesList[e].msElem?.setAttribute("d",this.stylesList[e].d),this.stylesList[e].d=`M0 0${this.stylesList[e].d}`),this.stylesList[e].pElem.setAttribute("d",this.stylesList[e].d||"M0 0"))}renderShape(){let{length:t}=this.animatedContents;for(let e=0;e<t;e++)(this._isFirstFrame||this.animatedContents[e].element._isAnimated)&&!0!==this.animatedContents[e].data&&this.animatedContents[e].fn&&this.animatedContents[e].fn?.(this.animatedContents[e].data,this.animatedContents[e].element,this._isFirstFrame)}searchShapes(t,e,s,i,r,a,n){let o,h,l=n,p=[...a],m=[],c=[],{length:d}=t;for(let a=d-1;a>=0;a--){let n=this.searchProcessedElement(t[a]);switch(n?e[a]=s[n-1]:t[a]._shouldRender=l,t[a].ty){case V.Fill:case V.Stroke:case V.GradientFill:case V.GradientStroke:case V.NoStyle:if(n){let{style:t}=e[a]??{style:null};t&&(t.closed=!1)}else e[a]=this.createStyleElement(t[a],r);if(t[a]._shouldRender&&e[a]?.style?.pElem.parentNode!==i){let{pElem:t}=e[a].style??{pElem:null};t&&i.appendChild(t)}m.push(e[a]?.style);break;case V.Group:if(n){let{length:t}=e[a]?.it??[];for(let s=0;s<t;s++){let{it:t,prevViewData:i}=e[a]??{it:null,prevViewData:null};i&&t&&(i[s]=t[s])}}else e[a]=this.createGroupElement(t[a]);if(this.searchShapes(t[a].it,e[a]?.it??[],e[a]?.prevViewData??[],e[a].gr,r+1,p,l),t[a]._shouldRender&&e[a]?.gr?.parentNode!==i){let{gr:t}=e[a];t&&i.appendChild(t)}break;case V.Transform:n||(e[a]=this.createTransformElement(t[a],i)),(o=e[a]?.transform)&&p.push(o);break;case V.Path:case V.Rectangle:case V.Ellipse:case V.PolygonStar:n||(e[a]=this.createShapeElement(t[a],p,r)),this.setElementStyles(e[a]);break;case V.Trim:case V.RoundedCorners:case V.Unknown:case V.PuckerBloat:case V.ZigZag:case V.OffsetPath:n?(h=e[a]).closed=!1:((h=sZ(t[a].ty)).init(this,t[a]),e[a]=h,this.shapeModifiers.push(h)),c.push(h);break;case V.Repeater:if(n){(h=e[a]).closed=!0,c.push(h);break}h=sZ(t[a].ty),e[a]=h,h.init(this,t,a,e),this.shapeModifiers.push(h),l=!1,c.push(h)}this.addProcessedElement(t[a],a+1)}let{length:u}=m;for(let t=0;t<u;t++){let e=m[t];e&&(e.closed=!0)}let{length:f}=c;for(let t=0;t<f;t++)c[t].closed=!0}setElementStyles(t){let{length:e}=this.stylesList;for(let s=0;s<e;s++)this.stylesList[s].closed||t.styles.push(this.stylesList[s])}setShapesAsAnimated(t){let{length:e}=t;for(let s=0;s<e;s++)t[s].setAsAnimated()}}class s1 extends sx{constructor(t,e,s){if(super(),this.initElement=s0.prototype.initElement,this.prepareFrame=sk.prototype.prepareFrame,this.assetData=e.getAssetData(t.refId),!e.imageLoader)throw Error(`${this.constructor.name} imageLoader is not implemented in globalData`);this.img=e.imageLoader.getAsset(this.assetData),this.initElement(t,e,s)}createContent(){let t,e;if(!this.assetData)throw Error(`${this.constructor.name}: assetData is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.img.width||this.assetData.w===this.img.width&&this.assetData.h===this.img.height)return;let s=tG("canvas");s.width=Number(this.assetData.w),s.height=Number(this.assetData.h);let i=s.getContext("2d"),r=this.img.width,a=this.img.height,n=r/a,o=Number(this.assetData.w)/Number(this.assetData.h),h=this.assetData.pr||this.globalData.renderConfig?.imagePreserveAspectRatio;n>o&&"xMidYMid slice"===h||n<o&&"xMidYMid slice"!==h?t=(e=a)*o:e=(t=r)/o,i?.drawImage(this.img,(r-t)/2,(a-e)/2,t,e,0,0,Number(this.assetData.w),Number(this.assetData.h)),this.img=s}destroy(){this.img=null}renderInnerContent(){this.canvasContext?.drawImage(this.img,0,0)}}class s2 extends sj{constructor(t,e,s,i){let r,a;switch(super(),this.styledShapes=[],this.tr=[0,0,0,0,0,0],e.ty){case V.Rectangle:r=5;break;case V.Ellipse:r=6;break;case V.PolygonStar:r=7;break;default:r=4}this.sh=e1.getShapeProp(t,e,r);let{length:n}=s;for(let t=0;t<n;t++)s[t].closed||(a={transforms:i.addTransformSequence(s[t].transforms),trNodes:[]},this.styledShapes.push(a),s[t].elements.push(a))}}class s3{constructor(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}addTransformSequence(t){let{length:e}=t,s="_";for(let i=0;i<e;i++)s+=`${t[i].transform.key}_`;let i=this.sequences[s];return i||(i={_mdf:!1,finalTransform:new t6,transforms:[...t]},this.sequences[s]=i,this.sequenceList.push(i)),i}getNewKey(){return this.transform_key_count++,`_${this.transform_key_count}`}processSequence(t,e){let s=0,{length:i}=t.transforms??[],r=e;if(!e)for(;s<i;){if(t.transforms?.[s].transform.mProps._mdf){r=!0;break}s++}if(r)for(t.finalTransform?.reset(),s=i-1;s>=0;s-=1){let{v:e}=t.transforms?.[s].transform.mProps??{v:null};e&&t.finalTransform?.multiply(e)}t._mdf=r}processSequences(t){let{length:e}=this.sequenceList;for(let s=0;s<e;s++)this.processSequence(this.sequenceList[s],t)}}class s5 extends sX{constructor(t,e,s){super(),this.clearCanvas=sx.prototype.clearCanvas,this.createContainerElements=sx.prototype.createContainerElements,this.createRenderableComponents=sx.prototype.createRenderableComponents,this.dashResetter=[],this.exitLayer=sx.prototype.exitLayer,this.hide=sx.prototype.hide,this.initRendererElement=sx.prototype.initRendererElement,this.prepareLayer=sx.prototype.prepareLayer,this.renderFrame=sx.prototype.renderFrame,this.setBlendMode=sx.prototype.setBlendMode,this.show=sx.prototype.show,this.transformHelper={_opMdf:!1,opacity:1},this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new s3,this.initElement(t,e,s)}addTransformToStyleList(t){let{length:e}=this.stylesList;for(let s=0;s<e;s++)this.stylesList[s].closed||this.stylesList[s].transforms.push(t)}closeStyles(t){let{length:e}=t;for(let s=0;s<e;s++)t[s].closed=!0}createContent(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])}createGroupElement(t){return{it:[],prevViewData:[]}}createShapeElement(t){let e=new s2(this,t,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e}createStyleElement(t,e){try{let s={closed:!0===t.hd,data:t,elements:[],preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],type:t.ty},i={};switch(t.ty){case V.Fill:case V.Stroke:i.c=eU.getProp(this,t.c,1,255,this),i.c.k||(s.co=`rgb(${Math.floor(i.c.v[0])},${Math.floor(i.c.v[1])},${Math.floor(i.c.v[2])})`);break;case V.GradientFill:case V.GradientStroke:i.s=eU.getProp(this,t.s,1,null,this),i.e=eU.getProp(this,t.e,1,null,this),i.h=eU.getProp(this,t.h??{k:0},0,.01,this),i.a=eU.getProp(this,t.a??{k:0},0,ti,this),t.g&&(i.g=new sO(this,t.g,this))}return i.o=eU.getProp(this,t.o,0,.01,this),t.ty===V.Stroke||t.ty===V.GradientStroke?(s.lc=z[t.lc||2],s.lj=B[t.lj||2],1===t.lj&&(s.ml=t.ml),i.w=eU.getProp(this,t.w,0,null,this),i.w.k||(s.wi=i.w.v),t.d&&"object"==typeof t.d&&(i.d=new sB(this,t.d,N.Canvas,this),i.d.k||(s.da=i.d.dashArray,s.do=i.d.dashoffset[0]))):s.r=2===t.r?"evenodd":"nonzero",this.stylesList.push(s),i.style=s,i}catch(t){return console.error(this.constructor.name,t),null}}createTransformElement(t){return{transform:{_opMdf:!1,key:this.transformsManager.getNewKey(),mProps:sh.getTransformProperty(this,t,this),op:eU.getProp(this,t.o,0,.01,this),opacity:1}}}destroy(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0}drawLayer(){try{let t;if(!this.globalData)throw Error(`${this.constructor.name} globalData is not implemented`);if(!this.globalData.renderer)throw Error(`${this.constructor.name} renderer is not implemented`);let{length:e}=this.stylesList,{renderer:s}=this.globalData,i=this.globalData.canvasContext;for(let r=0;r<e;r++){let{co:e,coOp:a,da:n,data:o,elements:h,grd:l,lc:p,lj:m,ml:c,preTransforms:d,r:u,type:f,wi:g}=t=this.stylesList[r],y=f===V.Stroke||f===V.GradientStroke;if(y&&0===g||!o._shouldRender||0===a||0===this.globalData.currentGlobalAlpha)continue;s.save(),y?(s.ctxStrokeStyle(f===V.Stroke?e:l),s.ctxLineWidth(g||0),p&&s.ctxLineCap(p),m&&s.ctxLineJoin(m),s.ctxMiterLimit(c||0)):s.ctxFillStyle(f===V.Fill?e:l),s.ctxOpacity(a),f!==V.Stroke&&f!==V.GradientStroke&&i?.beginPath(),s.ctxTransform(d.finalTransform?.props);let{length:v}=h;for(let e=0;e<v;e++){(f===V.Stroke||f===V.GradientStroke)&&(i?.beginPath(),i&&n&&(i.setLineDash(n),i.lineDashOffset=t.do||0));let r=h[e].trNodes,{length:a}=r;for(let t=0;t<a;t++){let{p:e=[],pts:s=[]}=r[t];"m"===r[t].t?i?.moveTo(e[0],e[1]):"c"===r[t].t?i?.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]):i?.closePath()}y&&(s.ctxStroke(),n&&i?.setLineDash(this.dashResetter))}y||this.globalData.renderer.ctxFill(u),s.restore()}}catch(t){console.error(this.constructor.name,t)}}reloadShapes(){this._isFirstFrame=!0;let{length:t}=this.itemsData;for(let e=0;e<t;e++)this.prevViewData[e]=this.itemsData[e];this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]);let{length:e}=this.dynamicProperties;for(let t=0;t<e;t++)this.dynamicProperties[t].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)}removeTransformFromStyleList(){let{length:t}=this.stylesList;for(let e=0;e<t;e++)this.stylesList[e].closed||this.stylesList[e].transforms.pop()}renderFill(t,e,s){let i=e.style;(e.c._mdf||this._isFirstFrame)&&(i.co=`rgb(${Math.floor(e.c.v[0])},${Math.floor(e.c.v[1])},${Math.floor(e.c.v[2])})`),(e.o._mdf||s._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*s.opacity)}renderGradientFill(t,e,s){let i;if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);let r=e.style;if(!r?.grd||e.g?._mdf||e.s?._mdf||e.e?._mdf||1!==t.t&&(e.h?._mdf||e.a?._mdf)){let s=this.globalData.canvasContext,a=e.s?.v??[0,0],n=e.e?.v??[0,0];if(1===t.t)i=s?.createLinearGradient(a[0],a[1],n[0],n[1]);else{let t=Math.sqrt(Math.pow(a[0]-n[0],2)+Math.pow(a[1]-n[1],2)),r=Math.atan2(n[1]-a[1],n[0]-a[0]),o=e.h?.v??0;o>=1?o=.99:o<=-1&&(o=-.99);let h=t*o,l=e.a?.v??0,p=Math.cos(r+l)*h+a[0],m=Math.sin(r+l)*h+a[1];i=s?.createRadialGradient(p,m,0,a[0],a[1],t)}let o=t.g?.p??0,h=e.g?.c??[],l=1;for(let t=0;t<o;t++)e.g?._hasOpacity&&e.g._collapsable&&(l=e.g.o[2*t+1]),i?.addColorStop(h[4*t]/100,`rgba(${h[4*t+1]},${h[4*t+2]},${h[4*t+3]},${l})`);r&&(r.grd=i)}r&&(r.coOp=(e.o?.v??0)*s.opacity)}renderInnerContent(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)}renderPath(t,e){if(!0===t.hd||!t._shouldRender||!e.sh)return;let{length:s}=e.styledShapes;for(let t=0;t<s;t++)this.renderStyledShape(e.styledShapes[t],e.sh)}renderShape(t,e,s,i){try{let r,a=e.length-1;r=t;for(let i=a;i>=0;i--)switch(e[i].ty){case V.Transform:(r=s[i].transform)&&this.renderShapeTransform(t,r);break;case V.Path:case V.Ellipse:case V.Rectangle:case V.PolygonStar:this.renderPath(e[i],s[i]);break;case V.Fill:this.renderFill(e[i],s[i],r);break;case V.Stroke:this.renderStroke(e[i],s[i],r);break;case V.GradientFill:case V.GradientStroke:this.renderGradientFill(e[i],s[i],r);break;case V.Group:this.renderShape(r,e[i].it??[],s[i].it);case V.Trim:}i&&this.drawLayer()}catch(t){console.error(this.constructor.name,t)}}renderShapeTransform(t,e){(t._opMdf||e.op._mdf||this._isFirstFrame)&&(e.opacity=t.opacity,e.opacity*=e.op.v,e._opMdf=!0)}renderStroke(t,e,s){let i=e.style,{c:r,d:a,o:n,w:o}=e;a&&(a._mdf||this._isFirstFrame)&&(i.da=a.dashArray,i.do=a.dashoffset[0]),(r._mdf||this._isFirstFrame)&&(i.co=`rgb(${Math.floor(r.v[0])},${Math.floor(r.v[1])},${Math.floor(r.v[2])})`),(n._mdf||s._opMdf||this._isFirstFrame)&&(i.coOp=n.v*s.opacity),(o._mdf||this._isFirstFrame)&&(i.wi=o.v)}renderStyledShape(t,e){let s,i,r;if(!this._isFirstFrame&&!e._mdf&&!t.transforms._mdf)return;let{transforms:a,trNodes:n}=t,{paths:o}=e,h=o?._length||0;n.length=0;let l=a?.finalTransform;for(r=0;r<h;r++){let t=o?.shapes[r];if(t?.v){for(s=1,i=t._length;s<i;s++)1===s&&n.push({p:l?.applyToPointArray(t.v[0][0],t.v[0][1],0),t:"m"}),n.push({pts:l?.applyToTriplePoints(t.o[s-1],t.i[s],t.v[s]),t:"c"});1===i&&n.push({p:l?.applyToPointArray(t.v[0][0],t.v[0][1],0),t:"m"}),t.c&&i&&n.push({pts:l?.applyToTriplePoints(t.o[s-1],t.i[0],t.v[0]),t:"c"},{t:"z"})}}t.trNodes=n}searchShapes(t,e,s,i,r){let a,n,o=i,h=t.length-1,l=[],p=[],m=[...r];for(let i=h;i>=0;i--){let r=this.searchProcessedElement(t[i]);switch(r?e[i]=s[r-1]:t[i]._shouldRender=o,t[i].ty){case V.Fill:case V.Stroke:case V.GradientFill:case V.GradientStroke:r?e[i].style.closed=!1:e[i]=this.createStyleElement(t[i],m),l.push(e[i].style);break;case V.Group:if(r){let{length:t}=e[i].it;for(let s=0;s<t;s++)e[i].prevViewData[s]=e[i].it[s]}else e[i]=this.createGroupElement(t[i]);this.searchShapes(t[i].it??[],e[i].it,e[i].prevViewData,o,m);break;case V.Transform:r||(n=this.createTransformElement(t[i]),e[i]=n),m.push(e[i]),this.addTransformToStyleList(e[i]);break;case V.Path:case V.Rectangle:case V.Ellipse:case V.PolygonStar:r||(e[i]=this.createShapeElement(t[i]));break;case V.Trim:case V.RoundedCorners:case V.PuckerBloat:case V.ZigZag:case V.OffsetPath:r?(a=e[i]).closed=!1:((a=sZ(t[i].ty)).init(this,t[i]),e[i]=a,this.shapeModifiers.push(a)),p.push(a);break;case V.Repeater:r?(a=e[i]).closed=!0:(a=sZ(t[i].ty),e[i]=a,a.init(this,t,i,e),this.shapeModifiers.push(a),o=!1),p.push(a)}this.addProcessedElement(t[i],i+1)}this.removeTransformFromStyleList(),this.closeStyles(l);let{length:c}=p;for(let t=0;t<c;t++)p[t].closed=!0}}class s4 extends sx{constructor(t,e,s){super(),this.initElement=s0.prototype.initElement,this.prepareFrame=sk.prototype.prepareFrame,this.initElement(t,e,s)}renderInnerContent(){if(!this.globalData)throw Error(`${this.constructor.name}: globalData it not implemented`);if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) it not implemented`);if(!this.globalData.renderer)throw Error(`${this.constructor.name}: globalData.renderer it not implemented`);this.globalData.renderer.ctxFillStyle(this.data.sc),this.globalData.renderer.ctxFillRect(0,0,this.data.sw||0,this.data.sh||0)}}class s6{constructor(t,e,s,i,r,a){this.o=t,this.sw=e,this.sc=s,this.fc=i,this.m=r,this.p=a,this._mdf={fc:!!i,m:!0,o:!0,p:!0,sc:!!s,sw:!!e}}update(t,e,s,i,r,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;let n=!1;return this.o!==t&&(this.o=t,this._mdf.o=!0,n=!0),this.sw!==e&&(this.sw=e,this._mdf.sw=!0,n=!0),this.sc!==s&&(this.sc=s,this._mdf.sc=!0,n=!0),this.fc!==i&&(this.fc=i,this._mdf.fc=!0,n=!0),this.m!==r&&(this.m=r,this._mdf.m=!0,n=!0),a&&a.length>0&&(this.p[0]!==a[0]||this.p[1]!==a[1]||this.p[4]!==a[4]||this.p[5]!==a[5]||this.p[12]!==a[12]||this.p[13]!==a[13])&&(this.p=a,this._mdf.p=!0,n=!0),n}}class s8 extends eG{constructor(t,e){super(),this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=eU.getProp(t,e.s??{a:0,k:0},0,0,this),"e"in e?this.e=eU.getProp(t,e.e,0,0,this):this.e={v:100},this.o=eU.getProp(t,e.o??{a:0,k:0},0,0,this),this.xe=eU.getProp(t,e.xe??{a:0,k:0},0,0,this),this.ne=eU.getProp(t,e.ne??{a:0,k:0},0,0,this),this.sm=eU.getProp(t,e.sm??{a:0,k:100},0,0,this),this.a=eU.getProp(t,e.a,0,.01,this),0===this.dynamicProperties.length&&this.getValue()}getMult(t,e){let s=t;this._currentTextLength!==this.elem.textProperty?.currentData.l.length&&this.getValue();let i=0,r=0,a=1,n=1;this.ne.v>0?i=this.ne.v/100:r=-this.ne.v/100,this.xe.v>0?a=1-this.xe.v/100:n=1+this.xe.v/100;let o=eN(i,r,a,n).get,h=0,l=this.finalS,p=this.finalE;switch(this.data.sh){case 2:h=o(h=p===l?+(s>=p):Math.max(0,Math.min(.5/(p-l)+(s-l)/(p-l),1)));break;case 3:h=o(h=p===l?s>=p?0:1:1-Math.max(0,Math.min(.5/(p-l)+(s-l)/(p-l),1)));break;case 4:p===l?h=0:(h=Math.max(0,Math.min(.5/(p-l)+(s-l)/(p-l),1)))<.5?h*=2:h=1-2*(h-.5),h=o(h);break;case 5:if(p===l)h=0;else{let t=p-l,e=-t/2+(s=Math.min(Math.max(0,s+.5-l),p-l)),i=t/2;h=Math.sqrt(1-e*e/(i*i))}h=o(h);break;case 6:h=o(h=p===l?0:(1+Math.cos(Math.PI+2*Math.PI*(s=Math.min(Math.max(0,s+.5-l),p-l))/(p-l)))/2);break;default:s>=Math.floor(l)&&(h=s-l<0?Math.max(0,Math.min(Math.min(p,1)-(l-s),1)):Math.max(0,Math.min(p-s,1))),h=o(h)}if(100!==this.sm.v){let t=.01*this.sm.v;0===t&&(t=1e-8);let e=.5-.5*t;h<e?h=0:(h=(h-e)/t)>1&&(h=1)}return h*Number(this.a.v)}getTextSelectorProp(t,e,s){throw Error("Method not implemented")}getValue(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty?.currentData.l.length||0,t&&2===this.data.r&&this.e.v&&(this.e.v=this._currentTextLength);let e=2===this.data.r?1:100/this.data.totalChars,s=Number(this.o.v)/e,i=Number(this.s?.v)/e+s,r=Number(this.e.v)/e+s;if(i>r){let t=i;i=r,r=t}return this.finalS=i,this.finalE=r,0}}class s9{constructor(t,e,s){let i={propType:!1},r=e?.a;this.a={a:r?.a?eU.getProp(t,r.a,1,0,s):i,fb:r?.fb?eU.getProp(t,r.fb,0,.01,s):i,fc:r?.fc?eU.getProp(t,r.fc,1,0,s):i,fh:r?.fh?eU.getProp(t,r.fh,0,0,s):i,fs:r?.fs?eU.getProp(t,r.fs,0,.01,s):i,o:r?.o?eU.getProp(t,r.o,0,.01,s):i,p:r?.p?eU.getProp(t,r.p,1,0,s):i,r:r?.r?eU.getProp(t,r.r,0,ti,s):i,rx:r?.rx?eU.getProp(t,r.rx,0,ti,s):i,ry:r?.ry?eU.getProp(t,r.ry,0,ti,s):i,s:r?.s?eU.getProp(t,r.s,1,.01,s):i,sa:r?.sa?eU.getProp(t,r.sa,0,ti,s):i,sc:r?.sc?eU.getProp(t,r.sc,1,0,s):i,sk:r?.sk?eU.getProp(t,r.sk,0,ti,s):i,sw:r?.sw?eU.getProp(t,r.sw,0,0,s):i,t:r?.t?eU.getProp(t,r.t,0,0,s):i},this.s=new s8(t,e?.s),this.s.t=e?.s?.t}}let s7=(t,e,s)=>{let i=Math.max(t,e,s),r=Math.min(t,e,s),a=i-r,n=0;switch(i){case r:n=0;break;case t:n=(e-s+6*(e<s)*a)/(6*a);break;case e:n=(s-t+2*a)/(6*a);break;case s:n=(t-e+4*a)/(6*a)}return[n,0===i?0:a/i,i/255]},it=(t,e,s)=>{let i=0,r=0,a=0,n=Math.floor(6*t),o=6*t-n,h=s*(1-e),l=s*(1-o*e),p=s*(1-(1-o)*e);switch(n%6){case 0:i=s,r=p,a=h;break;case 1:i=l,r=s,a=h;break;case 2:i=h,r=s,a=p;break;case 3:i=h,r=l,a=s;break;case 4:i=p,r=h,a=s;break;case 5:i=s,r=h,a=l}return[i,r,a]},ie=(t,e)=>{let s=s7(255*t[0],255*t[1],255*t[2]);return s[2]+=e,s[2]>1?s[2]=1:s[2]<0&&(s[2]=0),it(s[0],s[1],s[2])},is=(t,e)=>{let s=s7(255*t[0],255*t[1],255*t[2]);return s[0]+=e/360,s[0]>1?s[0]-=1:s[0]<0&&s[0]++,it(s[0],s[1],s[2])},ii=(t,e)=>{let s=s7(255*t[0],255*t[1],255*t[2]);return s[1]+=e,s[1]>1?s[1]=1:s[1]<=0&&(s[1]=0),it(s[0],s[1],s[2])};class ir extends eR{constructor(t,e,s){super(),this.defaultPropsArray=[],this.mHelper=new t6,this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=s,this._animatorsData=t4(Number(this._textData.a?.length)),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(s)}getMeasures(t,e){try{if(this.lettersChangedFlag=!!e,!this._mdf&&!this._isFirstFrame&&!e&&(!this._hasMaskedPath||!this._pathData.m?._mdf))return;this._isFirstFrame=!1;let s=this._moreOptions.alignment.v,i=this._animatorsData,r=this._textData,a=this.mHelper,n=this._renderType,o=this.renderedLetters.length,h,l,p,m,c=t.l,d,u=0,f,g=0,y,v=0,b=0,_,x=null,w=[],E=0,C=0,S,k,M=null;if(this._hasMaskedPath&&this._pathData.m){if(M=this._pathData.m,!this._pathData.n||this._pathData._mdf){let t=M.v;if(t){let e;for(this._pathData.r?.v&&(t=t.reverse()),d={segments:[],tLength:0},m=Number(t._length)-1,C=0,p=0;p<m;p++)Q(t)||(e=eS(t.v[p],t.v[p+1],[t.o[p][0]-t.v[p][0],t.o[p][1]-t.v[p][1]],[t.i[p+1][0]-t.v[p+1][0],t.i[p+1][1]-t.v[p+1][1]]),d.tLength+=e.segmentLength,d.segments.push(e),C+=e.segmentLength);p=m,M.v?.c&&!Q(t)&&(e=eS(t.v[p],t.v[0],[t.o[p][0]-t.v[p][0],t.o[p][1]-t.v[p][1]],[t.i[0][0]-t.v[0][0],t.i[0][1]-t.v[0][1]]),d.tLength+=e.segmentLength,d.segments.push(e),C+=e.segmentLength),this._pathData.pi=d}}if(d=this._pathData.pi,u=this._pathData.f?.v??0,b=0,v=1,g=0,w=d?.segments??[],u>0&&M.v?.c)for((d?.tLength??0<Math.abs(u))&&(u=-Math.abs(u)%(d?.tLength??0)),b=w.length-1,v=(x=w[b].points).length-1;u<0;)u+=x[v]?.partialLength,(v-=1)<0&&(b-=1,v=(x=w[b].points).length-1);_=(x=w[b]?.points??[])[v-1],E=(f=x[v]).partialLength}m=c.length||0,h=0,l=0;let P=1.2*(t.finalSize||0)*.714,A=!0,T,D,I,F,L=i.length,$,V=-1,R,O=0,z=0,B=u,G=b,q=v,j=-1,W,H=[0,0,0],Y=0,U=[0,0,0],J,X,K,Z,tt="",te=this.defaultPropsArray,ts;if(2===t.j||1===t.j){let e=0,s=0,a=2===t.j?-.5:-1,n=0,o=!0;for(p=0;p<m;p++){if(c[p].n){for(e&&(e+=s);n<p;)c[n].animatorJustifyOffset=e,n++;e=0,o=!0;continue}for(I=0;I<L;I++){if(T=i[I].a,!T?.t.propType)continue;let{v:n}=T.t;"number"==typeof n&&(o&&2===t.j&&(s+=n*a),D=i[I].s,$=D?.getMult(c[p].anIndexes[I],r.a?.[I].s?.totalChars),void 0!==$&&(Q($)?e+=n*$[0]*a:e+=n*$*a))}o=!1}for(e&&(e+=s);n<p;)c[n].animatorJustifyOffset=e,n++}for(p=0;p<m;p++){if(a.reset(),W=1,c[p].n)h=0,l+=t.yOffset||0,l+=+!!A,u=B,A=!1,this._hasMaskedPath&&(b=G||0,v=q||0,_=(x=w[b]?.points??[])[v-1],E=(f=x[v]).partialLength,g=0),tt="",Z="",X="",ts="",te=this.defaultPropsArray;else{if(this._hasMaskedPath){if(j!==c[p].line){switch(t.j){case 1:u+=C-t.lineWidths[c[p].line];break;case 2:u+=(C-t.lineWidths[c[p].line])/2}j=c[p].line||0}V!==c[p].ind&&(c[V]&&(u+=Number(c[V].extra)),u+=(c[p].an||0)/2,V=c[p].ind||0),u+=s[0]*(c[p].an||0)*.005;let e=0;for(I=0;I<L;I++){if(T=i[I].a,T?.p.propType){if(D=i[I].s,!($=D?.getMult(c[p].anIndexes[I],r.a?.[I].s?.totalChars)))continue;Q(T.p.v)&&(Q($)?e+=T.p.v[0]*$[0]:e+=T.p.v[0]*$)}if(T?.a.propType){if((D=i[I].s,$=D?.getMult(Number(c[p].anIndexes[I]),r.a?.[I].s?.totalChars))&&Q(T.a.v)){if(Q($)){e+=T.a.v[0]*$[0];continue}e+=T.a.v[0]*$}}}for(y=!0,this._pathData.a?.v&&(u=.5*(c[0].an||0)+(C-Number(this._pathData.f?.v)-.5*(c[0].an||0)-.5*c[c.length-1].an)*V/(m-1)+Number(this._pathData.f?.v));y;)g+E>=u+e||!x?(S=(u+e-g)/(f?.partialLength||0),O=Number(_?.point[0])+(Number(f?.point[0])-Number(_?.point[0]))*S,z=Number(_?.point[1])+(Number(f?.point[1])-Number(_?.point[1]))*S,a.translate(-s[0]*c[p].an*.005,-(.01*(s[1]*P))),y=!1):x.length>0&&(g+=Number(f?.partialLength),++v>=x.length&&(v=0,w[++b]?x=w[b].points:M?.v?.c?(v=0,x=w[b=0].points):(g-=Number(f?.partialLength),x=null)),x&&(_=f,E=(f=x[v]).partialLength));R=c[p].an/2-c[p].add,a.translate(-R,0,0)}else R=c[p].an/2-c[p].add,a.translate(-R,0,0),a.translate(-s[0]*c[p].an*.005,-s[1]*P*.01,0);for(I=0;I<L;I++)if(T=i[I].a,T?.t.propType&&(D=i[I].s,$=D?.getMult(Number(c[p].anIndexes[I]),r.a?.[I].s?.totalChars),0!==h||0!==t.j)){if(this._hasMaskedPath){Q($)?u+=Number(T.t.v)*$[0]:u+=Number(T.t.v)*Number($);continue}if(Q($)){h+=Number(T.t.v)*$[0];continue}h+=Number(T.t.v)*Number($)}for(t.strokeWidthAnim&&(Y=t.sw||0),t.strokeColorAnim&&(H=t.sc?[Number(t.sc[0]),Number(t.sc[1]),Number(t.sc[2])]:[0,0,0]),t.fillColorAnim&&t.fc&&(U=[Number(t.fc[0]),Number(t.fc[1]),Number(t.fc[2])]),I=0;I<L;I++)if(T=i[I].a,T?.a.propType){if(D=i[I].s,!($=D?.getMult(c[p].anIndexes[I],r.a?.[I].s?.totalChars))||!Q(T.a.v))continue;if(Q($)){a.translate(-T.a.v[0]*$[0],-T.a.v[1]*$[1],T.a.v[2]*$[2]);continue}a.translate(-T.a.v[0]*$,-T.a.v[1]*$,T.a.v[2]*$)}for(I=0;I<L;I++)if(T=i[I].a,T?.s.propType){if(D=i[I].s,!($=D?.getMult(c[p].anIndexes[I],r.a?.[I].s?.totalChars))||!Q(T.s.v))continue;if(Q($)){a.scale(1+(T.s.v[0]-1)*$[0],1+(T.s.v[1]-1)*$[1],1);continue}a.scale(1+(T.s.v[0]-1)*$,1+(T.s.v[1]-1)*$,1)}for(I=0;I<L;I++)if(T=i[I].a,D=i[I].s,$=D?.getMult(c[p].anIndexes[I],r.a?.[I].s?.totalChars)){if(T?.sk.propType&&(Q($)?a.skewFromAxis(-Number(T.sk.v)*$[0],Number(T.sa.v)*$[1]):a.skewFromAxis(-Number(T.sk.v)*$,Number(T.sa.v)*$)),T?.r.propType&&(Q($)?a.rotateZ(-Number(T.r.v)*$[2]):a.rotateZ(-Number(T.r.v)*$)),T?.ry.propType&&(Q($)?a.rotateY(Number(T.ry.v)*$[1]):a.rotateY(Number(T.ry.v)*$)),T?.rx.propType&&(Q($)?a.rotateX(Number(T.rx.v)*$[0]):a.rotateX(Number(T.rx.v)*$)),T?.o.propType&&(Q($)?W+=(Number(T.o.v)*$[0]-W)*$[0]:W+=(Number(T.o.v)*$-W)*$),t.strokeWidthAnim&&T?.sw.propType&&(Q($)?Y+=Number(T.sw.v)*$[0]:Y+=Number(T.sw.v)*$),t.strokeColorAnim&&T?.sc.propType&&Q(T.sc.v))for(J=0;J<3;J++)Q($)?H[J]+=(T.sc.v[J]-H[J])*$[0]:H[J]+=(T.sc.v[J]-H[J])*$;if(t.fillColorAnim&&t.fc){if(T?.fc.propType)for(J=0;J<3;J++)Q(T.fc.v)&&(Q($)?U[J]+=(T.fc.v[J]-U[J])*$[0]:U[J]+=(T.fc.v[J]-U[J])*$);T?.fh.propType&&(U=Q($)?is(U,Number(T.fh.v)*$[0]):is(U,Number(T.fh.v)*$)),T?.fs.propType&&(U=Q($)?ii(U,Number(T.fs.v)*$[0]):ii(U,Number(T.fs.v)*$)),T?.fb.propType&&(U=Q($)?ie(U,Number(T.fb.v)*$[0]):ie(U,Number(T.fb.v)*$))}}for(I=0;I<L;I++)if(T=i[I].a,T?.p.propType){if(D=i[I].s,!($=D?.getMult(c[p].anIndexes[I],r.a?.[I].s?.totalChars))||!Q(T.p.v))continue;this._hasMaskedPath?Q($)?a.translate(0,T.p.v[1]*$[0],-T.p.v[2]*$[1]):a.translate(0,T.p.v[1]*$,-T.p.v[2]*$):Q($)?a.translate(T.p.v[0]*$[0],T.p.v[1]*$[1],-T.p.v[2]*$[2]):a.translate(T.p.v[0]*$,T.p.v[1]*$,-T.p.v[2]*$)}if(t.strokeWidthAnim&&(X=Y<0?0:Y),t.strokeColorAnim&&(K=`rgb(${Math.round(255*H[0])},${Math.round(255*H[1])},${Math.round(255*H[2])})`),t.fillColorAnim&&t.fc&&(Z=`rgb(${Math.round(255*U[0])},${Math.round(255*U[1])},${Math.round(255*U[2])})`),this._hasMaskedPath){if(a.translate(0,-Number(t.ls)),a.translate(0,s[1]*P*.01+l,0),this._pathData.p?.v){k=(Number(f?.point[1])-Number(_?.point[1]))/(Number(f?.point[0])-Number(_?.point[0]));let t=180*Math.atan(k)/Math.PI;Number(f?.point[0])<Number(_?.point[0])&&(t+=180),a.rotate(-t*Math.PI/180)}a.translate(O,z,0),u-=s[0]*c[p].an*.005,c[p+1]&&V!==c[p+1].ind&&(u+=c[p].an/2,u+=.001*t.tr*Number(t.finalSize))}else{switch(a.translate(h,l,0),t.ps&&a.translate(t.ps[0],t.ps[1]+Number(t.ascent),0),t.j){case 1:a.translate(c[p].animatorJustifyOffset+Number(t.justifyOffset)+(Number(t.boxWidth)-Number(t.lineWidths[c[p].line])),0,0);break;case 2:a.translate(c[p].animatorJustifyOffset+Number(t.justifyOffset)+(Number(t.boxWidth)-Number(t.lineWidths[c[p].line]))/2,0,0)}a.translate(0,-Number(t.ls)),a.translate(R,0,0),a.translate(s[0]*Number(c[p].an)*.005,s[1]*P*.01,0),h+=c[p].l+.001*t.tr*Number(t.finalSize)}n===N.HTML?tt=a.toCSS():n===N.SVG?tt=a.to2dCSS():te=[a.props[0],a.props[1],a.props[2],a.props[3],a.props[4],a.props[5],a.props[6],a.props[7],a.props[8],a.props[9],a.props[10],a.props[11],a.props[12],a.props[13],a.props[14],a.props[15]],ts=W}if(o<=p){F=new s6(Number(ts),Number(X),K,Z,tt,te),this.renderedLetters.push(F),o++,this.lettersChangedFlag=!0;continue}F=this.renderedLetters[p],this.lettersChangedFlag=F.update(Number(ts),Number(X),K,Z,tt,te)||this.lettersChangedFlag}}catch(t){console.error(this.constructor.name,t)}}getValue(){return this._elem.globalData?.frameId===this._frameId||(this._frameId=this._elem.globalData?.frameId??0,this.iterateDynamicProperties()),0}searchProperties(t){let{length:e}=this._textData.a??[],{getProp:s}=eU;for(let t=0;t<e;t++)this._animatorsData[t]=new s9(this._elem,this._textData.a?.[t],this);this._textData.p&&"m"in this._textData.p&&this._elem.maskManager?(this._pathData={a:s(this._elem,this._textData.p.a,0,0,this),f:s(this._elem,this._textData.p.f,0,0,this),l:s(this._elem,this._textData.p.l,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m),p:s(this._elem,this._textData.p.p,0,0,this),r:s(this._elem,this._textData.p.r,0,0,this)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=s(this._elem,this._textData.m?.a,1,0,this)}}function ia(t){let e=t.fStyle?t.fStyle.split(" "):[],s="normal",i="normal",{length:r}=e;for(let t=0;t<r;t++)switch(e[t].toLowerCase()){case"italic":i="italic";break;case"bold":s="700";break;case"black":s="900";break;case"medium":s="500";break;case"regular":case"normal":s="400";break;case"light":case"thin":s="200"}return{style:i,weight:t.fWeight||s}}let io=[2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403],ih={data:{shapes:[]},shapes:[],size:0,w:0},il=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"];function ip(t){let e=im(t);return e>=127462&&e<=127487}function im(t){let e=0,s=t.charCodeAt(0);if(s>=55296&&s<=56319){let i=t.charCodeAt(1);i>=56320&&i<=57343&&(e=(s-55296)*1024+i-56320+65536)}return e}function ic(t,e){if(tn)return;let s=tG("span");s.setAttribute("aria-hidden","true"),s.style.fontFamily=e;let i=tG("span");i.innerText="giItT1WQy@!-/#",s.style.position="absolute",s.style.left="-10000px",s.style.top="-10000px",s.style.fontSize="300px",s.style.fontVariant="normal",s.style.fontStyle="normal",s.style.fontWeight="normal",s.style.letterSpacing="0",s.appendChild(i),document.body.appendChild(s);let r=i.offsetWidth;return i.style.fontFamily=`${function(t){let e=t.split(","),{length:s}=e,i=[];for(let t=0;t<s;t++)"sans-serif"!==e[t]&&"monospace"!==e[t]&&i.push(e[t]);return i.join(",")}(t)}, ${e}`,{node:i,parent:s,w:r}}class id{constructor(){this.chars=null,this.fonts=[],this.isLoaded=!1,this.typekitLoaded=0,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)}addChars(t){if(!t)return;this.chars=this.chars??[];let{length:e}=t,s,{length:i}=this.chars,r;for(let a=0;a<e;a++){for(s=0,r=!1;s<i;)this.chars[s].style===t[a].style&&this.chars[s].fFamily===t[a].fFamily&&this.chars[s].ch===t[a].ch&&(r=!0),s++;!r&&(this.chars.push(t[a]),i++)}}addFonts(t,e){if(!t){this.isLoaded=!0;return}if(this.chars){this.isLoaded=!0,this.fonts=t.list;return}let{length:s}=t.list;if(!tn){this.isLoaded=!0;for(let e=0;e<s;e++)t.list[e].helper=this.createHelper(t.list[e]),t.list[e].cache={};this.fonts=t.list;return}let i=s;for(let s=0;s<i;s++){let r=!0,a;if(t.list[s].loaded=!1,t.list[s].monoCase=ic(t.list[s].fFamily,"monospace"),t.list[s].sansCase=ic(t.list[s].fFamily,"sans-serif"),t.list[s].fPath){if("p"===t.list[s].fOrigin||3===t.list[s].origin){if((a=document.querySelectorAll(`style[f-forigin="p"][f-family="${t.list[s].fFamily}"], style[f-origin="3"][f-family="${t.list[s].fFamily}"]`)).length>0&&(r=!1),r){let i=tG("style");i.setAttribute("f-forigin",t.list[s].fOrigin),i.setAttribute("f-origin",`${t.list[s].origin}`),i.setAttribute("f-family",t.list[s].fFamily),i.innerText=`@font-face {font-family: ${t.list[s].fFamily}; font-style: normal; src: url('${t.list[s].fPath}');}`,e?.appendChild(i)}}else if("g"===t.list[s].fOrigin||1===t.list[s].origin){let{length:e}=a=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');for(s=0;s<e;s++)a[s].href.includes(t.list[s].fPath)&&(r=!1);if(r){let e=tG("link");e.setAttribute("f-forigin",t.list[s].fOrigin),e.setAttribute("f-origin",`${t.list[s].origin}`),e.type="text/css",e.rel="stylesheet",e.href=t.list[s].fPath,document.body.appendChild(e)}}else if("t"===t.list[s].fOrigin||2===t.list[s].origin){let{length:i}=a=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');for(s=0;s<i;s++)t.list[s].fPath===a[s].src&&(r=!1);if(r){let i=tG("link");i.setAttribute("f-forigin",t.list[s].fOrigin),i.setAttribute("f-origin",`${t.list[s].origin}`),i.rel="stylesheet",i.href=t.list[s].fPath,e?.appendChild(i)}}}else t.list[s].loaded=!0,i-=1;t.list[s].helper=this.createHelper(t.list[s],e),t.list[s].cache={},this.fonts.push(t.list[s])}0===i?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}getCharData(t,e,s){let i=0,{length:r}=this.chars??[];for(;i<r;){if(this.chars?.[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===s)return this.chars[i];i++}return("string"!=typeof t||13===t.charCodeAt(0))&&t||this._warned||(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,s)),ih}getFontByName(t){let e=0,{length:s}=this.fonts;for(;e<s;){if(this.fonts[e].fName===t)return this.fonts[e];e++}return this.fonts[0]}measureText(t,e,s){let i=this.getFontByName(e);if(i.cache&&!i.cache[t]){let e=i.helper;if(" "===t){let s=Number(e?.measureText(`|${t}|`)),r=Number(e?.measureText("||"));i.cache[t]=(s-r)/100}else i.cache[t]=Number(e?.measureText(t))/100}return Number(i.cache?.[t])*Number(s)}checkLoadedFonts(){let t,e,s=this.fonts.length;for(let i=0;i<s;i++){if(this.fonts[i].loaded){s-=1;continue}if("n"===this.fonts[i].fOrigin||0===this.fonts[i].origin){this.fonts[i].loaded=!0;continue}if(t=this.fonts[i].monoCase?.node,e=this.fonts[i].monoCase?.w||0,t?.offsetWidth===e?(t=this.fonts[i].sansCase?.node,e=this.fonts[i].sansCase?.w||0,t?.offsetWidth!==e&&(s-=1,this.fonts[i].loaded=!0)):(s-=1,this.fonts[i].loaded=!0),!this.fonts[i].loaded)continue;let{monoCase:r,sansCase:a}=this.fonts[i];a&&this.fonts[i].sansCase?.parent.parentNode?.removeChild(a.parent),r&&this.fonts[i].monoCase?.parent.parentNode?.removeChild(r.parent)}if(0!==s&&Date.now()-this.initTime<5e3)return void setTimeout(this.checkLoadedFontsBinded,20);setTimeout(this.setIsLoadedBinded,10)}createHelper(t,e){let s;if(tn)return;let i=e?N.SVG:N.Canvas,r=ia(t);if(i===N.SVG){let i=tq("text");i.style.fontSize="100px",i.setAttribute("font-family",t.fFamily),i.setAttribute("font-style",r.style),i.setAttribute("font-weight",r.weight),i.textContent="1",t.fClass?(i.style.fontFamily="inherit",i.classList.add(t.fClass)):i.style.fontFamily=t.fFamily,e?.appendChild(i),s=i}else{let e=new OffscreenCanvas(500,500).getContext("2d");e&&(e.font=`${r.style} ${r.weight} 100px ${t.fFamily}`,s=e)}return{measureText:t=>i===N.SVG?(s.textContent=t,s.getComputedTextLength()):s.measureText(t).width}}setIsLoaded(){this.isLoaded=!0}}class iu extends eG{constructor(t,e){super(),this.defaultBoxWidth=[0,0],this._frameId=-999999,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,e.d?.sid&&(e.d=t.globalData?.slotManager?.getProp(e.d)),this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={__complete:!1,ascent:0,boxWidth:this.defaultBoxWidth,f:"",fc:"",fillColorAnim:!1,finalLineHeight:0,finalSize:0,finalText:[],fStyle:"",fWeight:"",justifyOffset:0,l:[],lh:0,lineWidths:[],ls:0,of:"",ps:null,s:0,sc:"",strokeColorAnim:!1,strokeWidthAnim:!1,sw:0,t:0,tr:0,yOffset:0};let s=this.data.d?.k[0].s;s&&this.copyData(this.currentData,s),this.searchProperty()||this.completeTextData(this.currentData)}addEffect(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)}buildFinalText(t){let e=[],s=0,i=t.length,r,a,n,o=!1,h;for(;s<i;){var l;(n=o,o=!1,r=t.charCodeAt(s),h=t.charAt(s),io.includes(r))?n=!0:r>=55296&&r<=56319?function(t,e){let s=e,i=im(t.slice(s,2));if(127988!==i)return!1;let r=0;for(s+=2;r<5;){if((i=im(t.slice(s,2)))<917601||i>917626)return!1;r++,s+=2}return 917631===im(t.slice(s,2))}(t,s)?h=t.slice(s,14):(a=t.charCodeAt(s+1))>=56320&&a<=57343&&(function(t,e){let s=t.toString(16)+e.toString(16);return il.includes(s)}(r,a)?(h=t.slice(s,2),n=!0):h=ip((l=t.slice(s,4)).slice(0,2))&&ip(l.slice(2,2))?t.slice(s,4):t.slice(s,2)):r>56319?65039===r&&(n=!0):8205===r&&(n=!0,o=!0),n?e[e.length-1]+=h:e.push(h),s+=h.length}return e}calculateExpression(t){throw Error(`${this.constructor.name}: Method calculateExpression is not implemented`)}canResizeFont(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)}completeTextData(t){let e,s,i,r,a,n,o;t.__complete=!0;let{fontManager:h}=this.elem.globalData??{};if(!h)throw Error(`${this.constructor.name}: FontManager not loaded to globalData`);let{canResize:l,data:p,minimumFontSize:m}=this,c=[],d,u,f=0,g,y=p.m?.g,v=0,b=0,_=0,x=[],w,E=0,C=h.getFontByName(t.f),S=ia(C);t.fWeight=S.weight,t.fStyle=S.style,t.finalSize=t.s,t.finalText=this.buildFinalText(`${t.t}`),d=t.finalText.length||0,t.finalLineHeight=t.lh;let k=t.tr/1e3*t.finalSize;if(t.sz){let r,a,n=!0,[o,p]=t.sz;for(;n;){a=this.buildFinalText(`${t.t}`),r=0,w=0,d=a.length,k=t.tr/1e3*t.finalSize;let c=-1;for(let n=0;n<d;n++)i=a[n].charCodeAt(0),u=!1," "===a[n]?c=n:(13===i||3===i)&&(w=0,u=!0,r+=t.finalLineHeight||1.2*t.finalSize),h.chars?(e=h.getCharData(a[n],C.fStyle,C.fFamily),s=u?0:e.w*t.finalSize/100):s=h.measureText(a[n],t.f,t.finalSize)||0,w+s>o&&" "!==a[n]?(-1===c?d++:n=c,r+=t.finalLineHeight||1.2*t.finalSize,a.splice(n,+(c===n),"\r"),c=-1,w=0):(w+=s,w+=k);r+=Number(C.ascent)*t.finalSize/100,l&&t.finalSize>m&&p<r?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=a,d=t.finalText.length,n=!1)}}w=-k;let M=0,P;for(let r=0;r<d;r++)if(u=!1,13===(i=(P=t.finalText[r]).charCodeAt(0))||3===i?(M=0,x.push(w),E=w>E?w:E,w=-2*k,g="",u=!0,_++):g=P,h.chars?(e=h.getCharData(P,C.fStyle,h.getFontByName(t.f).fFamily),s=u?0:e.w*t.finalSize/100):s=h.measureText(g,t.f,t.finalSize)," "===P?M+=s+k:(w+=s+k+M,M=0),c.push({add:v,an:s,animatorJustifyOffset:0,anIndexes:[],l:s,line:_,n:u,val:g}),2===y){if(v+=s,""===g||" "===g||r===d-1){for((""===g||" "===g)&&(v-=s);b<=r;)c[b].an=v,c[b].ind=f,c[b].extra=s,b++;f++,v=0}}else if(3===y){if(v+=s,""===g||r===d-1){for(""===g&&(v-=s);b<=r;)c[b].an=v,c[b].ind=f,c[b].extra=s,b++;v=0,f++}}else c[f].ind=f,c[f].extra=0,f++;if(t.l=c,E=w>E?w:E,x.push(w),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=E,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=x;let A=p.a,{length:T}=A??[],D=[];for(let e=0;e<T;e++){if(!(r=A?.[e]))continue;r.a?.sc&&(t.strokeColorAnim=!0),r.a?.sw&&(t.strokeWidthAnim=!0),(r.a?.fc||r.a?.fh||r.a?.fs||r.a?.fb)&&(t.fillColorAnim=!0),o=0,n=Number(r.s?.b);for(let t=0;t<d;t++)(a=c[t]).anIndexes[e]=o,(1===n&&""!==a.val||2===n&&""!==a.val&&" "!==a.val||3===n&&(a.n||" "===a.val||t===d-1)||4===n&&(a.n||t===d-1))&&(1===Number(r.s?.rn)&&D.push(o),o++);let s=p.a?.[e].s;s&&(s.totalChars=o);let i=-1,h;if(r.s?.rn===1)for(let t=0;t<d;t++)i!==Number((a=c[t]).anIndexes[e])&&(i=a.anIndexes[e],h=D.splice(Math.floor(Math.random()*D.length),1)[0]),h&&(a.anIndexes[e]=h)}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=Number(C.ascent)*t.finalSize/100}copyData(t,e){let s=Object.keys(e),{length:i}=s;for(let r=0;r<i;r++)Object.hasOwn(e,s[r])&&(t[s[r]]=e[s[r]]);return t}getExpressionValue(t,e){throw Error(`${this.constructor.name}: Method getExpressionValue is not implemented`)}getKeyframeValue(){let t=this.data.d?.k??[],e=Number(this.elem.comp?.renderedFrame),s=0,i=t.length;for(;s<=i-1&&!(s===i-1||Number(t[s+1].t)>e);)s++;return this.keysIndex!==s&&(this.keysIndex=s),this.data.d?.k[this.keysIndex].s}getValue(t){if((this.elem.globalData?.frameId===this.frameId||0===this.effectsSequence.length)&&!t)return 0;let e=this.data.d?.k[this.keysIndex].s.t;e&&(this.currentData.t=e);let s=this.currentData,i=this.keysIndex;if(this.lock)return this.setCurrentData(this.currentData),0;this.lock=!0,this._mdf=!1;let{length:r}=this.effectsSequence,a=t??this.data.d?.k[this.keysIndex].s;for(let t=0;t<r;t++)a=i===this.keysIndex?this.effectsSequence[t](this.currentData,a?.t):this.effectsSequence[t](a,a?.t);return s!==a&&this.setCurrentData(a),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData?.frameId,0}recalculate(t){if(!this.data.d)throw Error(`${this.constructor.name}: data.k (TextData -> DocumentData) is not implemented`);let e=this.data.d.k[t].s;e&&(e.__complete=!1),this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)}searchExpressions(){throw Error(`${this.constructor.name}: Method searchExpressions is not implemented`)}searchKeyframes(){if(!this.data.d)throw Error(`${this.constructor.name}: data.k (TextData -> DocumentData) is not implemented`);return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf}searchProperty(){return this.searchKeyframes()}setCurrentData(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0}setMinimumFontSize(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)}updateDocumentData(t,e){if(!this.data.d)throw Error(`${this.constructor.name}: data.k (TextData -> DocumentData) is not implemented`);let s=e;s=s??this.keysIndex;let i=this.copyData({},this.data.d.k[s].s);i=this.copyData(i,t),this.data.d.k[s].s=i,this.recalculate(s),this.setCurrentData(i),this.elem.addDynamicProperty(this)}}class ig extends sw{applyTextPropertiesToMatrix(t,e,s,i,r){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+Number(t.ascent),0),e.translate(0,-Number(t.ls),0),t.j){case 1:e.translate(Number(t.justifyOffset)+(Number(t.boxWidth)-Number(t.lineWidths[s])),0,0);break;case 2:e.translate(Number(t.justifyOffset)+(Number(t.boxWidth)-Number(t.lineWidths[s]))/2,0,0)}e.translate(i,r,0)}buildColor(t){return`rgb(${Math.round(255*t[0])},${Math.round(255*t[1])},${Math.round(255*t[2])})`}buildNewText(){throw Error(`${this.constructor.name}: Method buildNewText is not implemented`)}canResizeFont(t){this.textProperty?.canResizeFont(t)}createPathShape(t,e){let s,i="",{length:r}=e;for(let a=0;a<r;a++)e[a].ty===V.Path&&e[a].ks?.k&&(i+=sP(s=e[a].ks?.k,s.i.length,!0,t));return i}initElement(t,e,s){if(!t.t)throw Error(`${this.constructor.name}: data.t (LottieLayer -> TextData) can't be undefined`);this.emptyProp=new s6,this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,s),this.textProperty=new iu(this,t.t),this.textAnimator=new ir(t.t,this.renderType||N.SVG,this),this.initTransform(),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)}prepareFrame(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}setMinimumFontSize(t){this.textProperty?.setMinimumFontSize(t)}updateDocumentData(t,e){this.textProperty?.updateDocumentData(t,e)}validateText(){(this.textProperty?._mdf||this.textProperty?._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)}}let iy="rgba(0,0,0,0)";class iv extends ig{constructor(t,e,s){super(),this.clearCanvas=sx.prototype.clearCanvas,this.createContainerElements=sx.prototype.createContainerElements,this.createContent=sx.prototype.createContent,this.createElements=sx.prototype.createElements,this.createRenderableComponents=sx.prototype.createRenderableComponents,this.destroy=sx.prototype.destroy,this.exitLayer=sx.prototype.exitLayer,this.hide=sx.prototype.hide,this.hideElement=sx.prototype.hideElement,this.initRendererElement=sx.prototype.initRendererElement,this.prepareLayer=sx.prototype.prepareLayer,this.renderedLetters=[],this.renderFrame=sx.prototype.renderFrame,this.renderLocalTransform=sx.prototype.renderLocalTransform,this.renderRenderable=sx.prototype.renderRenderable,this.searchEffectTransforms=sx.prototype.searchEffectTransforms,this.setBlendMode=sx.prototype.setBlendMode,this.show=sx.prototype.show,this.showElement=sx.prototype.showElement,this.tHelper=tG("canvas").getContext("2d"),this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType=N.Canvas,this.values={fill:iy,fValue:"",stroke:iy,sWidth:0},this.initElement(t,e,s)}buildNewText(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.globalData.fontManager)throw Error(`${this.constructor.name}: fontManager is not implemented in globalData`);if(!this.textProperty)throw Error(`${this.constructor.name}: textProperty is not implemented`);let t=this.textProperty.currentData;this.renderedLetters=t4(t.l.length||0);let e=!1;t.fc?(e=!0,this.values.fill=this.buildColor(t.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=e;let s=!1;t.sc&&(s=!0,this.values.stroke=this.buildColor(t.sc),this.values.sWidth=Number(t.sw));let i=this.globalData.fontManager.getFontByName(t.f),r=t.l,a=this.mHelper;this.stroke=s,this.values.fValue=`${t.finalSize}px ${this.globalData.fontManager.getFontByName(t.f).fFamily}`;let{singleShape:n}=this.data,o=.001*t.tr*Number(t.finalSize),h,l=0,p=0,m=!0,c=0,{length:d}=t.finalText;for(let e=0;e<d;e++){let s=this.globalData.fontManager.getCharData(t.finalText[e],i.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily).data??{};a.reset(),n&&r[e].n&&(l=-o,p+=Number(t.yOffset),p+=+!!m,m=!1);let d=s.shapes?.[0].it??[];a.scale(Number(t.finalSize)/100,Number(t.finalSize)/100),n&&this.applyTextPropertiesToMatrix(t,a,r[e].line,l,p);let{length:u}=d,f=t4(u-1),g=0;for(let t=0;t<u;t++){if(d[t].ty!==V.Path)continue;let{length:e}=(d[t].ks?.k).i,s=d[t].ks?.k,i=[];for(h=1;h<e;h++)1===h&&i.push(a.applyToX(s.v[0][0],s.v[0][1],0),a.applyToY(s.v[0][0],s.v[0][1],0)),i.push(a.applyToX(s.o[h-1][0],s.o[h-1][1],0),a.applyToY(s.o[h-1][0],s.o[h-1][1],0),a.applyToX(s.i[h][0],s.i[h][1],0),a.applyToY(s.i[h][0],s.i[h][1],0),a.applyToX(s.v[h][0],s.v[h][1],0),a.applyToY(s.v[h][0],s.v[h][1],0));i.push(a.applyToX(s.o[h-1][0],s.o[h-1][1],0),a.applyToY(s.o[h-1][0],s.o[h-1][1],0),a.applyToX(s.i[0][0],s.i[0][1],0),a.applyToY(s.i[0][0],s.i[0][1],0),a.applyToX(s.v[0][0],s.v[0][1],0),a.applyToY(s.v[0][0],s.v[0][1],0)),f[g]=i,g++}n&&(l+=r[e].l,l+=o),this.textSpans[c]?this.textSpans[c].elem=f:this.textSpans[c]={elem:f},c++}}renderInnerContent(){let t,e,s,i;if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.textAnimator)throw Error(`${this.constructor.name}: textAnimator is not implemented`);if(!this.textProperty)throw Error(`${this.constructor.name}: textProperty is not implemented`);if(!this.canvasContext)throw Error(`${this.constructor.name}: canvasContext is not implemented`);this.validateText(),this.canvasContext.font=this.values.fValue,this.globalData.renderer?.ctxLineCap("butt"),this.globalData.renderer?.ctxLineJoin("miter"),this.globalData.renderer?.ctxMiterLimit(4),this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);let{renderedLetters:r}=this.textAnimator,a=this.textProperty.currentData.l,n,o=null,h=null,l=null,p,m,c=this.globalData.renderer,{length:d}=a;for(let u=0;u<d;u++)if(!a[u].n){if(n=r[u],c.save(),c.ctxTransform(n.p),c.ctxOpacity(n.o),this.fill){n.fc?o!==n.fc&&(c.ctxFillStyle(n.fc),o=n.fc):o!==this.values.fill&&(o=this.values.fill,c.ctxFillStyle(this.values.fill));let{length:e}=p=this.textSpans[u].elem??[];for(this.globalData.canvasContext?.beginPath(),t=0;t<e;t++){let{length:e}=m=p[t]||[];for(this.globalData.canvasContext?.moveTo(m[0],m[1]),s=2;s<e;s+=6)this.globalData.canvasContext?.bezierCurveTo(m[s],m[s+1],m[s+2],m[s+3],m[s+4],m[s+5])}this.globalData.canvasContext?.closePath(),c.ctxFill()}if(this.stroke){for(n.sw?l!==n.sw&&(l=n.sw,c.ctxLineWidth(n.sw)):l!==this.values.sWidth&&(l=this.values.sWidth,c.ctxLineWidth(this.values.sWidth)),n.sc?h!==n.sc&&(h=n.sc,c.ctxStrokeStyle(n.sc)):h!==this.values.stroke&&(h=this.values.stroke,c.ctxStrokeStyle(this.values.stroke)),e=(p=this.textSpans[u].elem??[]).length,this.globalData.canvasContext?.beginPath(),t=0;t<e;t++)for(i=(m=p[t]).length,this.globalData.canvasContext?.moveTo(m[0],m[1]),s=2;s<i;s+=6)this.globalData.canvasContext?.bezierCurveTo(m[s],m[s+1],m[s+2],m[s+3],m[s+4],m[s+5]);this.globalData.canvasContext?.closePath(),c.ctxStroke()}this.globalData.renderer?.restore()}}}class ib extends sc{constructor(t,e,s){super(),this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId)??null,this.initBaseData(t,e,s),this._isPlaying=!1,this._canPlay=!1;let i=this.globalData?.getAssetsPath(this.assetData);this.audio=this.globalData?.audioController?.createAudio(i),this._currentTime=0,this.globalData?.audioController?.addAudio(this),this._volumeMultiplier=1,this._volume=1,this._previousVolume=null,this.tm=t.tm?eU.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0},this.lv=eU.getProp(this,t.au?.lv??{k:[100]},1,.01,this)}getBaseElement(){return null}hide(){this.audio.pause(),this._isPlaying=!1}initExpressions(){}pause(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1}prepareFrame(t){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder?this._currentTime=t/Number(this.data.sr):this._currentTime=this.tm.v,this._volume=Number(this.lv.v[0]);let e=this._volume*Number(this._volumeMultiplier);this._previousVolume!==e&&(this._previousVolume=e,this.audio.volume(e))}renderFrame(t){if(this.isInRange&&this._canPlay){if(!this._isPlaying){this.audio.play(),this.audio.seek(this._currentTime/Number(this.globalData?.frameRate)),this._isPlaying=!0;return}(!this.audio.playing()||Math.abs(this._currentTime/Number(this.globalData?.frameRate)-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/Number(this.globalData?.frameRate))}}resume(){this._canPlay=!0}setRate(t){this.audio.rate(t)}show(){}sourceRectAtTime(){return null}volume(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume)}}class i_ extends sc{constructor(t,e,s){if(super(),this.assetData=null,this.initFrame(),this.initRenderable(),t.refId&&(this.assetData=e.getAssetData(t.refId)),!e.imageLoader)throw Error(`${this.constructor.name}: imageLoader is not implemented in globalData`);this.footageData=e.imageLoader.getAsset(this.assetData),this.initBaseData(t,e,s)}getBaseElement(){return null}getFootageData(){return this.footageData}initExpressions(){let t=tR();if(!t)return;let e=t("footage");this.layerInterface=new e(this)}prepareFrame(){}renderFrame(){}}class ix{constructor(t){this.animationData=t}getProp(t){let{sid:e}=t;return e&&this.animationData.slots?.[e]?Object.assign(t,this.animationData.slots[e].p):t}}class iw extends sm{addPendingElement(t){this.pendingElements.push(t)}buildAllItems(){let{length:t}=this.layers;for(let e=0;e<t;e++)this.buildItem(e);this.checkPendingElements()}buildElementParenting(t,e,s=[]){let{elements:i,layers:r}=this,{length:a}=r,n=0;for(;n<a;){if(r[n].ind!==e){n++;continue}if(!i[n]||!0===i[n]){this.buildItem(n),this.addPendingElement(t),n++;continue}if(s.push(i[n]),i[n].setAsParent(),void 0===r[n].parent){t.setHierarchy(s),n++;continue}this.buildElementParenting(t,r[n].parent,s),n++}}buildItem(t){throw Error(`${this.constructor.name}: Method buildItem not yet implemented`)}checkLayers(t){this.completeLayers=!0;let{length:e}=this.layers;for(let s=e-1;s>=0;s--)!this.elements[s]&&this.layers[s].ip-this.layers[s].st<=Number(t)-this.layers[s].st&&this.layers[s].op-this.layers[s].st>Number(t)-this.layers[s].st&&this.buildItem(s),this.completeLayers=!!this.elements[s]&&this.completeLayers;this.checkPendingElements()}checkPendingElements(){throw Error(`${this.constructor.name}: Method checkPendingElements not yet implemented`)}createAudio(t){if(!this.globalData)throw Error(`${this.constructor.name}: Can't access globalData`);return new ib(t,this.globalData,this)}createCamera(t){throw Error("You're using a 3d camera. Try the html renderer.")}createComp(t,e,s,i){throw Error(`${this.constructor.name}: Method createComp not yet implemented`)}createFootage(t){if(!this.globalData)throw Error(`${this.constructor.name}: Can't access globalData`);return new i_(t,this.globalData,this)}createImage(t){throw Error(`${this.constructor.name}: Method createImage is not implemented`)}createItem(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:default:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t)}}createNull(t){throw Error(`${this.constructor.name}: Method createNull not implemented`)}createShape(t){throw Error(`${this.constructor.name}: Method createShape not implemented`)}createSolid(t){throw Error(`${this.constructor.name}: Method createSolid not implemented`)}createText(t){throw Error(`${this.constructor.name}: Method createText not implemented`)}getElementById(t){let{length:e}=this.elements;for(let s=0;s<e;s++)if(this.elements[s]?.data.ind===t)return this.elements[s];return null}getElementByPath(t){let e,s=t.shift();if("number"==typeof s)e=this.elements[s];else{let{length:t}=this.elements;for(let i=0;i<t;i++)if(this.elements[i]?.data.nm===s){e=this.elements[i];break}}return 0===t.length?e:e?.getElementByPath(t)}includeLayers(t){this.completeLayers=!1;let{length:e}=t,{length:s}=this.layers;for(let i=0;i<e;i++){let e=0;for(;e<s;){if(this.layers[e].id===t[i].id){this.layers[e]=t[i];break}e++}}}initItems(){this.globalData?.progressiveLoad||this.buildAllItems()}prepareFrame(t){throw Error(`${this.constructor.name}: Method prepareFrame not yet implemented`)}searchExtraCompositions(t){let{length:e}=t;for(let s=0;s<e;s++)if(t[s].xt){let e=this.createComp(t[s]);e.initExpressions(),this.globalData?.projectInterface.registerComposition(e)}}setProjectInterface(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);t&&(this.globalData.projectInterface=t)}setupGlobalData(t,e){if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.animationItem)throw Error(`${this.constructor.name}: animationItem is not implemented`);this.globalData.fontManager=new id,this.globalData.slotManager=new ix(t),this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr||60,this.globalData.nm=t.nm,this.globalData.compSize={h:Number(t.h),w:Number(t.w)}}constructor(...t){super(...t),this.currentFrame=0,this.elements=[],this.layers=[],this.pendingElements=[],this.renderedFrame=-1}}class iE extends sm{constructor(t,e,s){super(),this.initFrame(),this.initBaseData(t,e,s),this.initTransform(),this.initHierarchy()}getBaseElement(){return null}prepareFrame(t){this.prepareProperties(t,!0)}renderFrame(t){return null}}class iC extends sk{constructor(t,e,s){super(t,e,s),this.initElement(t,e,s)}createContent(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);let t=tq("rect");t.width.baseVal.value=this.data.sw||0,t.height.baseVal.value=this.data.sh||0,this.data.sc&&t.setAttribute("fill",this.data.sc),this.layerElement?.appendChild(t)}}let iS={shapes:[]};class ik extends ig{constructor(t,e,s){super(),this.createContainerElements=sS.prototype.createContainerElements,this.createRenderableComponents=sS.prototype.createRenderableComponents,this.destroyBaseElement=sS.prototype.destroyBaseElement,this.getBaseElement=sS.prototype.getBaseElement,this.getMatte=sS.prototype.getMatte,this.initRendererElement=sS.prototype.initRendererElement,this.renderedLetters=[],this.renderElement=sS.prototype.renderElement,this.setMatte=sS.prototype.setMatte,this.textSpans=[],this.renderType=N.SVG,this.initElement(t,e,s)}buildNewText(){let t,e;if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);if(!this.layerElement)throw Error(`${this.constructor.name}: layerElement is not implemented`);if(!this.textProperty?.currentData)throw Error(`${this.constructor.name}: DocumentData is not implemented`);this.addDynamicProperty(this);let s=this.textProperty.currentData;this.renderedLetters=t4(s.l.length||0),s.fc?this.layerElement.setAttribute("fill",this.buildColor(s.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),s.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(s.sc)),this.layerElement.setAttribute("stroke-width",`${s.sw||0}`)),this.layerElement.setAttribute("font-size",`${s.finalSize||0}`);let i=this.globalData.fontManager?.getFontByName(s.f);if(i?.fClass)this.layerElement.classList.add(i.fClass);else{i?.fFamily&&this.layerElement.setAttribute("font-family",i.fFamily);let{fWeight:t}=s,{fStyle:e}=s;this.layerElement.setAttribute("font-style",e),this.layerElement.setAttribute("font-weight",t)}this.layerElement.ariaLabel=`${s.t}`;let r=s.l,a=!!this.globalData.fontManager?.chars;e=r.length;let n=null,o=this.mHelper,{singleShape:h}=this.data,l=0,p=0,m=!0,c=.001*s.tr*Number(s.finalSize);if(!h||a||s.sz){let d,u=this.textSpans.length;for(t=0;t<e;t++){if(this.textSpans[t]||(this.textSpans[t]={childSpan:null,glyph:null,span:null}),!a||!h||0===t){if(!(n=u>t?this.textSpans[t]?.span:tq(a?"g":"text")))throw Error("Could not create tSpan");if(u<=t){if(n.setAttribute("stroke-linecap","butt"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("stroke-miterlimit","4"),this.textSpans[t]&&(this.textSpans[t].span=n),a){let e=tq("g");n.appendChild(e),this.textSpans[t]&&(this.textSpans[t].childSpan=e)}this.textSpans[t]&&(this.textSpans[t].span=n),this.layerElement.appendChild(n)}n.style.display="inherit"}if(o.reset(),h&&(r[t].n&&(l=-c,p+=Number(s.yOffset),p+=+!!m,m=!1),this.applyTextPropertiesToMatrix(s,o,r[t].line,l,p),l+=r[t].l||0,l+=c),a){let e;if(d=this.globalData.fontManager?.getCharData(s.finalText[t],i?.fStyle,this.globalData.fontManager.getFontByName(s.f).fFamily),d?.t===1)e=new iP(d.data,this.globalData,this);else{let t=iS;d?.data?.shapes&&(t=this.buildShapeData(d.data,Number(s.finalSize))),e=new s0(t,this.globalData,this)}if(this.textSpans[t]){let{glyph:s}=this.textSpans[t];s&&(s.layerElement&&this.textSpans[t]?.childSpan?.removeChild(s.layerElement),s.destroy()),this.textSpans[t].glyph=e}e._debug=!0,e.prepareFrame(0),e.renderFrame(),e.layerElement&&this.textSpans[t]?.childSpan?.appendChild(e.layerElement),d?.t===1&&this.textSpans[t]?.childSpan?.setAttribute("transform",`scale(${Number(s.finalSize)/100},${Number(s.finalSize)/100})`);continue}n&&(h&&n.setAttribute("transform",`translate(${o.props[12]},${o.props[13]})`),n.textContent=r[t].val,n.style.whiteSpace="preserve")}h&&n?.setAttribute("d","")}else{let i,r=this.textContainer;switch(s.j){case 1:i="end";break;case 2:i="middle";break;default:i="start"}r?.setAttribute("text-anchor",i),r?.setAttribute("letter-spacing",`${c}`);let a=this.buildTextContents(s.finalText);for(t=0,e=a.length,p=s.ps?s.ps[1]+Number(s.ascent):0;t<e;t++)(n=this.textSpans[t]?.span??tq("tspan")).textContent=a[t],n.setAttribute("x","0"),n.setAttribute("y",`${p}`),n.style.display="inherit",r?.appendChild(n),this.textSpans[t]||(this.textSpans[t]={glyph:null,span:null}),this.textSpans[t].span=n,p+=Number(s.finalLineHeight);r&&this.layerElement.appendChild(r)}let d=this.textSpans[t]?.span;if(d)for(;t<this.textSpans.length;)d.style.display="none",t++;this._sizeChanged=!0}buildShapeData(t,e){if(t.shapes.length>0){let s=t.shapes[0];if(s.it){let t=s.it[s.it.length-1];t.s&&(t.s.k[0]=e,t.s.k[1]=e)}}return t}buildTextContents(t){let e=0,{length:s}=t,i=[],r="";for(;e<s;)"\r"===t[e]||"\x03"===t[e]?(i.push(r),r=""):r+=t[e],e++;return i.push(r),i}createContent(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.globalData)throw Error(`${this.constructor.name}: globalData is not implemented`);this.data.singleShape&&!this.globalData.fontManager?.chars&&(this.textContainer=tq("text"))}getValue(){let t;if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);let{length:e}=this.textSpans;this.renderedFrame=this.comp?.renderedFrame;for(let s=0;s<e;s++)(t=this.textSpans[s].glyph)&&(t.prepareFrame(Number(this.comp?.renderedFrame)-Number(this.data.st)),t._mdf&&(this._mdf=!0))}renderInnerContent(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(this.validateText(),!this.data.singleShape||this._mdf){if(!this.textProperty)throw Error(`${this.constructor.name}: textProperty is not initialized`);if(this.textAnimator?.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator?.lettersChangedFlag){let t,e,s;this._sizeChanged=!0;let i=this.textAnimator?.renderedLetters,r=this.textProperty.currentData.l,{length:a}=r;for(let n=0;n<a;n++)!r[n].n&&(t=i?.[n],e=this.textSpans[n].span,(s=this.textSpans[n].glyph)&&s.renderFrame(),t?._mdf.m&&e?.setAttribute("transform",t.m),t?._mdf.o&&e?.setAttribute("opacity",`${t.o??1}`),t?._mdf.sw&&e?.setAttribute("stroke-width",`${t.sw||0}`),t?._mdf.sc&&e?.setAttribute("stroke",t.sc),t?._mdf.fc&&e?.setAttribute("fill",t.fc))}}}sourceRectAtTime(){if(!this.data)throw Error(`${this.constructor.name}: data (LottieLayer) is not implemented`);if(!this.comp)throw Error(`${this.constructor.name}: comp (ElementInterface) is not implemented`);if(!this.layerElement)throw Error(`${this.constructor.name}: layerElement is not implemented`);if(this.prepareFrame(Number(this.comp.renderedFrame)-Number(this.data.st)),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;let t=this.layerElement.getBBox();return this.bbox={height:t.height,left:t.x,top:t.y,width:t.width},this.bbox}return null}}class iM extends iw{appendElementInPos(t,e){let s=t.getBaseElement();if(!s)return;let i=0,r;for(;i<e;)r=this.elements[i]?.getBaseElement?.(),i++;r?this.layerElement?.insertBefore(s,r):this.layerElement?.appendChild(s)}buildItem(t){if(!this.globalData)throw Error(`${this.constructor.name}: globalData it not implemented`);let{elements:e,globalData:s,layers:i}=this;if(e[t]||99===i[t].ty)return;e[t]=!0;let r=this.createItem(i[t]);if(e[t]=r,tV()&&(0===i[t].ty&&s.projectInterface.registerComposition(r),r.initExpressions()),this.appendElementInPos(r,t),i[t].tt){let s="tp"in i[t]?this.findIndexByInd(i[t].tp):t-1;if(-1===s)return;if(!e[s]||!0===e[s]){this.buildItem(s),this.addPendingElement(r);return}let a=e[s].getMatte(i[t].tt);r.setMatte(a)}}checkPendingElements(){for(;this.pendingElements.length>0;){let t=this.pendingElements.pop();if(t?.checkParenting(),t?.data.tt){let e=0,{length:s}=this.elements;for(;e<s;){if(this.elements[e]!==t){e++;continue}let s="tp"in t.data?this.findIndexByInd(t.data.tp):e-1,i=this.elements[s].getMatte(this.layers[e].tt);t.setMatte(i);break}}}}configAnimation(t){try{if(!this.animationItem)throw Error(`${this.constructor.name}: Can't access animationItem`);if(!this.globalData)throw Error(`${this.constructor.name}: Can't access globalData`);if(!this.renderConfig)throw Error(`${this.constructor.name}: Can't access renderConfig`);if(!this.svgElement)throw Error(`${this.constructor.name}: Can't access svgElement`);this.svgElement.setAttribute("xmlns",ta),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox",`0 0 ${t.w} ${t.h}`),!this.renderConfig.viewBoxOnly&&(this.svgElement.setAttribute("width",`${t.w}`),this.svgElement.setAttribute("height",`${t.h}`),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.renderConfig.contentVisibility&&(this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility)),this.renderConfig.width&&this.svgElement.setAttribute("width",`${this.renderConfig.width}`),this.renderConfig.height&&this.svgElement.setAttribute("height",`${this.renderConfig.height}`),this.renderConfig.className&&this.svgElement.classList.add(this.renderConfig.className),this.renderConfig.id&&(this.svgElement.id=this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",`${this.renderConfig.focusable}`),this.renderConfig.preserveAspectRatio&&this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper?.appendChild(this.svgElement);let{defs:e}=this.globalData;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;let s=tq("clipPath"),i=tq("rect");i.width.baseVal.value=t.w,i.height.baseVal.value=t.h,i.x.baseVal.value=0,i.y.baseVal.value=0;let r=K();s.id=r,s.appendChild(i),this.layerElement?.setAttribute("clip-path",`url(${ee()}#${r})`),e.appendChild(s),this.layers=t.layers,this.elements=t4(t.layers.length)}catch(t){console.error(`${this.constructor.name}:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aarsteinmedia/dotlottie-player",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.3",
|
|
4
4
|
"description": "Web Component for playing Lottie animations in your web app. Previously @johanaarstein/dotlottie-player",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"lint:css:fix": "npx stylelint **/*.css --fix"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@aarsteinmedia/lottie-web": "^1.0.
|
|
51
|
+
"@aarsteinmedia/lottie-web": "^1.0.11",
|
|
52
52
|
"fflate": "^0.8.2"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
"@rollup/plugin-json": "^6.1.0",
|
|
63
63
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
64
64
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
65
|
-
"@swc/core": "^1.
|
|
65
|
+
"@swc/core": "^1.12.0",
|
|
66
66
|
"@types/mocha": "^10.0.10",
|
|
67
67
|
"@types/node": "^24.0.0",
|
|
68
68
|
"@types/path-browserify": "^1.0.3",
|
|
69
69
|
"@types/postcss-flexbugs-fixes": "^5.0.3",
|
|
70
|
-
"@types/react": "^19.1.
|
|
70
|
+
"@types/react": "^19.1.7",
|
|
71
71
|
"@web/dev-server-esbuild": "^1.0.4",
|
|
72
72
|
"@web/dev-server-import-maps": "^0.2.1",
|
|
73
73
|
"@web/dev-server-rollup": "^0.6.4",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"prettier": "^3.5.3",
|
|
86
86
|
"react": "^19.1.0",
|
|
87
87
|
"rimraf": "^6.0.1",
|
|
88
|
-
"rollup": "^4.
|
|
88
|
+
"rollup": "^4.43.0",
|
|
89
89
|
"rollup-plugin-dts": "^6.2.1",
|
|
90
90
|
"rollup-plugin-esbuild-minify": "^1.3.0",
|
|
91
91
|
"rollup-plugin-html-literals": "^2.0.0",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"tsc-alias": "^1.8.16",
|
|
101
101
|
"tslib": "^2.8.1",
|
|
102
102
|
"typescript": "^5.8.3",
|
|
103
|
-
"typescript-eslint": "^8.
|
|
103
|
+
"typescript-eslint": "^8.34.0"
|
|
104
104
|
},
|
|
105
105
|
"pnpm": {
|
|
106
106
|
"onlyBuiltDependencies": [
|