@lottiefiles/dotlottie-react
Version:
React wrapper around the dotlottie-web library
6 lines • 526 kB
JavaScript
import {useRef,useCallback,useEffect}from'react';import {jsx}from'react/jsx-runtime';var x3=Object.defineProperty,U3=(c,i,a)=>i in c?x3(c,i,{enumerable:true,configurable:true,writable:true,value:a}):c[i]=a,p=(c,i,a)=>U3(c,typeof i!="symbol"?i+"":i,a),$3=class{requestAnimationFrame(c){return requestAnimationFrame(c)}cancelAnimationFrame(c){cancelAnimationFrame(c);}},z3=class{constructor(){p(this,"_lastHandleId",0),p(this,"_lastImmediate",null);}requestAnimationFrame(c){return this._lastHandleId>=Number.MAX_SAFE_INTEGER&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{c(Date.now());}),this._lastHandleId}cancelAnimationFrame(c){this._lastImmediate&&clearImmediate(this._lastImmediate);}},B3=class{constructor(){p(this,"_strategy"),this._strategy=typeof requestAnimationFrame=="function"?new $3:new z3;}requestAnimationFrame(c){return this._strategy.requestAnimationFrame(c)}cancelAnimationFrame(c){this._strategy.cancelAnimationFrame(c);}},E=typeof window<"u"&&typeof window.document<"u",d2=new Uint8Array([80,75,3,4]),H3=["v","ip","op","layers","fr","w","h"],G2="0.50.0",V2="@lottiefiles/dotlottie-web",j3=.75,N3=4,G3=(()=>{var c=typeof document<"u"?document.currentScript?.src:void 0;return function(i={}){var a,r=i,l,w,R=new Promise((t,e)=>{l=t,w=e;}),k=Object.assign({},r),t1="./this.program",P="",_1;typeof document<"u"&&document.currentScript&&(P=document.currentScript.src),c&&(P=c),P.startsWith("blob:")?P="":P=P.substr(0,P.replace(/[?#].*/,"").lastIndexOf("/")+1),_1=async t=>{if(t=await fetch(t,{credentials:"same-origin"}),t.ok)return t.arrayBuffer();throw Error(t.status+" : "+t.url)};var K=r.printErr||console.error.bind(console);Object.assign(r,k),k=null,r.thisProgram&&(t1=r.thisProgram);var U=r.wasmBinary,e1,X=false,f1,Q,S,G,n1,$,m,i1,v1;function p1(){var t=e1.buffer;r.HEAP8=Q=new Int8Array(t),r.HEAP16=G=new Int16Array(t),r.HEAPU8=S=new Uint8Array(t),r.HEAPU16=n1=new Uint16Array(t),r.HEAP32=$=new Int32Array(t),r.HEAPU32=m=new Uint32Array(t),r.HEAPF32=i1=new Float32Array(t),r.HEAPF64=v1=new Float64Array(t);}var s1=[],P1=[],z=[];function E1(){var t=r.preRun.shift();s1.unshift(t);}var r1=0,m1=null;function O1(t){throw r.onAbort?.(t),t="Aborted("+t+")",K(t),X=true,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),w(t),t}var v2=t=>t.startsWith("data:application/octet-stream;base64,"),A1;async function Q2(t){if(!U)try{var e=await _1(t);return new Uint8Array(e)}catch{}if(t==A1&&U)t=new Uint8Array(U);else throw "both async and sync fetching of the wasm failed";return t}async function Y2(t,e){try{var n=await Q2(t);return await WebAssembly.instantiate(n,e)}catch(s){K(`failed to asynchronously prepare wasm: ${s}`),O1(s);}}async function Z2(t){var e=A1;if(!U&&typeof WebAssembly.instantiateStreaming=="function"&&!v2(e)&&typeof fetch=="function")try{var n=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(n,t)}catch(s){K(`wasm streaming compile failed: ${s}`),K("falling back to ArrayBuffer instantiation");}return Y2(e,t)}class p2{constructor(e){p(this,"name","ExitStatus"),this.message=`Program terminated with exit(${e})`,this.status=e;}}var V1=t=>{for(;0<t.length;)t.shift()(r);},J1=r.noExitRuntime||true,m2=typeof TextDecoder<"u"?new TextDecoder:void 0,D1=(t=0,e=NaN)=>{var n=S,s=t+e;for(e=t;n[e]&&!(e>=s);)++e;if(16<e-t&&n.buffer&&m2)return m2.decode(n.subarray(t,e));for(s="";t<e;){var o=n[t++];if(o&128){var h=n[t++]&63;if((o&224)==192)s+=String.fromCharCode((o&31)<<6|h);else {var u=n[t++]&63;o=(o&240)==224?(o&15)<<12|h<<6|u:(o&7)<<18|h<<12|u<<6|n[t++]&63,65536>o?s+=String.fromCharCode(o):(o-=65536,s+=String.fromCharCode(55296|o>>10,56320|o&1023));}}else s+=String.fromCharCode(o);}return s};class t3{constructor(e){this.Ca=e-24;}}var g2=0,g1=(t,e,n)=>{var s=S;if(0<n){n=e+n-1;for(var o=0;o<t.length;++o){var h=t.charCodeAt(o);if(55296<=h&&57343>=h){var u=t.charCodeAt(++o);h=65536+((h&1023)<<10)|u&1023;}if(127>=h){if(e>=n)break;s[e++]=h;}else {if(2047>=h){if(e+1>=n)break;s[e++]=192|h>>6;}else {if(65535>=h){if(e+2>=n)break;s[e++]=224|h>>12;}else {if(e+3>=n)break;s[e++]=240|h>>18,s[e++]=128|h>>12&63;}s[e++]=128|h>>6&63;}s[e++]=128|h&63;}}s[e]=0;}},k1={},q1=t=>{for(;t.length;){var e=t.pop();t.pop()(e);}};function L1(t){return this.fromWireType(m[t>>2])}var d1={},o1={},F1={},M1,a1=(t,e,n)=>{function s(d){if(d=n(d),d.length!==t.length)throw new M1("Mismatched type converter count");for(var _=0;_<t.length;++_)B(t[_],d[_]);}t.forEach(d=>F1[d]=e);var o=Array(e.length),h=[],u=0;e.forEach((d,_)=>{o1.hasOwnProperty(d)?o[_]=o1[d]:(h.push(d),d1.hasOwnProperty(d)||(d1[d]=[]),d1[d].push(()=>{o[_]=o1[d],++u,u===h.length&&s(o);}));}),h.length===0&&s(o);},L2,O=t=>{for(var e="";S[t];)e+=L2[S[t++]];return e},g;function e3(t,e,n={}){var s=e.name;if(!t)throw new g(`type "${s}" must have a positive integer typeid pointer`);if(o1.hasOwnProperty(t)){if(n.hb)return;throw new g(`Cannot register type '${s}' twice`)}o1[t]=e,delete F1[t],d1.hasOwnProperty(t)&&(e=d1[t],delete d1[t],e.forEach(o=>o()));}function B(t,e,n={}){return e3(t,e,n)}var K1=t=>{throw new g(t.Aa.Da.Ba.name+" instance already deleted")},X1=false,M2=()=>{},w2=(t,e,n)=>e===n?t:n.Ga===void 0?null:(t=w2(t,e,n.Ga),t===null?null:n.$a(t)),y2={},i3={},a3=(t,e)=>{if(e===void 0)throw new g("ptr should not be undefined");for(;t.Ga;)e=t.Qa(e),t=t.Ga;return i3[e]},T1=(t,e)=>{if(!e.Da||!e.Ca)throw new M1("makeClassHandle requires ptr and ptrType");if(!!e.Ha!=!!e.Fa)throw new M1("Both smartPtrType and smartPtr must be specified");return e.count={value:1},w1(Object.create(t,{Aa:{value:e,writable:true}}))},w1=t=>typeof FinalizationRegistry>"u"?(w1=e=>e,t):(X1=new FinalizationRegistry(e=>{e=e.Aa,--e.count.value,e.count.value===0&&(e.Fa?e.Ha.Ka(e.Fa):e.Da.Ba.Ka(e.Ca));}),w1=e=>{var n=e.Aa;return n.Fa&&X1.register(e,{Aa:n},e),e},M2=e=>{X1.unregister(e);},w1(t));function R1(){}var y1=(t,e)=>Object.defineProperty(e,"name",{value:t}),C2=(t,e,n)=>{if(t[e].Ea===void 0){var s=t[e];t[e]=function(...o){if(!t[e].Ea.hasOwnProperty(o.length))throw new g(`Function '${n}' called with an invalid number of arguments (${o.length}) - expects one of (${t[e].Ea})!`);return t[e].Ea[o.length].apply(this,o)},t[e].Ea=[],t[e].Ea[s.Na]=s;}},Q1=(t,e,n)=>{if(r.hasOwnProperty(t)){if(n===void 0||r[t].Ea!==void 0&&r[t].Ea[n]!==void 0)throw new g(`Cannot register public name '${t}' twice`);if(C2(r,t,t),r[t].Ea.hasOwnProperty(n))throw new g(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`);r[t].Ea[n]=e;}else r[t]=e,r[t].Na=n;},n3=t=>{t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return 48<=e&&57>=e?`_${t}`:t};function s3(t,e,n,s,o,h,u,d){this.name=t,this.constructor=e,this.Ma=n,this.Ka=s,this.Ga=o,this.bb=h,this.Qa=u,this.$a=d,this.jb=[];}var Y1=(t,e,n)=>{for(;e!==n;){if(!e.Qa)throw new g(`Expected null or instance of ${n.name}, got an instance of ${e.name}`);t=e.Qa(t),e=e.Ga;}return t};function r3(t,e){if(e===null){if(this.Ta)throw new g(`null is not a valid ${this.name}`);return 0}if(!e.Aa)throw new g(`Cannot pass "${a2(e)}" as a ${this.name}`);if(!e.Aa.Ca)throw new g(`Cannot pass deleted object as a pointer of type ${this.name}`);return Y1(e.Aa.Ca,e.Aa.Da.Ba,this.Ba)}function o3(t,e){if(e===null){if(this.Ta)throw new g(`null is not a valid ${this.name}`);if(this.Sa){var n=this.Ua();return t!==null&&t.push(this.Ka,n),n}return 0}if(!e||!e.Aa)throw new g(`Cannot pass "${a2(e)}" as a ${this.name}`);if(!e.Aa.Ca)throw new g(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Ra&&e.Aa.Da.Ra)throw new g(`Cannot convert argument of type ${e.Aa.Ha?e.Aa.Ha.name:e.Aa.Da.name} to parameter type ${this.name}`);if(n=Y1(e.Aa.Ca,e.Aa.Da.Ba,this.Ba),this.Sa){if(e.Aa.Fa===void 0)throw new g("Passing raw pointer to smart pointer is illegal");switch(this.ob){case 0:if(e.Aa.Ha===this)n=e.Aa.Fa;else throw new g(`Cannot convert argument of type ${e.Aa.Ha?e.Aa.Ha.name:e.Aa.Da.name} to parameter type ${this.name}`);break;case 1:n=e.Aa.Fa;break;case 2:if(e.Aa.Ha===this)n=e.Aa.Fa;else {var s=e.clone();n=this.kb(n,x1(()=>s.delete())),t!==null&&t.push(this.Ka,n);}break;default:throw new g("Unsupporting sharing policy")}}return n}function h3(t,e){if(e===null){if(this.Ta)throw new g(`null is not a valid ${this.name}`);return 0}if(!e.Aa)throw new g(`Cannot pass "${a2(e)}" as a ${this.name}`);if(!e.Aa.Ca)throw new g(`Cannot pass deleted object as a pointer of type ${this.name}`);if(e.Aa.Da.Ra)throw new g(`Cannot convert argument of type ${e.Aa.Da.name} to parameter type ${this.name}`);return Y1(e.Aa.Ca,e.Aa.Da.Ba,this.Ba)}function C1(t,e,n,s,o,h,u,d,_,v,f){this.name=t,this.Ba=e,this.Ta=n,this.Ra=s,this.Sa=o,this.ib=h,this.ob=u,this.Ya=d,this.Ua=_,this.kb=v,this.Ka=f,o||e.Ga!==void 0?this.toWireType=o3:(this.toWireType=s?r3:h3,this.Ja=null);}var b2=(t,e,n)=>{if(!r.hasOwnProperty(t))throw new M1("Replacing nonexistent public symbol");r[t].Ea!==void 0&&n!==void 0?r[t].Ea[n]=e:(r[t]=e,r[t].Na=n);},W,c3=(t,e,n=[])=>(t.includes("j")?(t=t.replace(/p/g,"i"),e=(0, r["dynCall_"+t])(e,...n)):e=W.get(e)(...n),e),d3=(t,e)=>(...n)=>c3(t,e,n),A=(t,e)=>{t=O(t);var n=t.includes("j")?d3(t,e):W.get(e);if(typeof n!="function")throw new g(`unknown function pointer with signature ${t}: ${e}`);return n},I2,S2=t=>{t=W2(t);var e=O(t);return Z(t),e},W1=(t,e)=>{function n(h){o[h]||o1[h]||(F1[h]?F1[h].forEach(n):(s.push(h),o[h]=true));}var s=[],o={};throw e.forEach(n),new I2(`${t}: `+s.map(S2).join([", "]))},Z1=(t,e)=>{for(var n=[],s=0;s<t;s++)n.push(m[e+4*s>>2]);return n};function u3(t){for(var e=1;e<t.length;++e)if(t[e]!==null&&t[e].Ja===void 0)return true;return false}function t2(t,e,n,s,o){var h=e.length;if(2>h)throw new g("argTypes array size mismatch! Must at least get return value and 'this' types!");var u=e[1]!==null&&n!==null,d=u3(e),_=e[0].name!=="void",v=h-2,f=Array(v),M=[],y=[];return y1(t,function(...F){if(y.length=0,M.length=u?2:1,M[0]=o,u){var b=e[1].toWireType(y,this);M[1]=b;}for(var I=0;I<v;++I)f[I]=e[I+2].toWireType(y,F[I]),M.push(f[I]);if(F=s(...M),d)q1(y);else for(I=u?1:2;I<e.length;I++){var H=I===1?b:f[I-2];e[I].Ja!==null&&e[I].Ja(H);}return b=_?e[0].fromWireType(F):void 0,b})}var P2=t=>{t=t.trim();let e=t.indexOf("(");return e!==-1?t.substr(0,e):t},e2=[],Y=[],i2=t=>{9<t&&--Y[t+1]===0&&(Y[t]=void 0,e2.push(t));},u1=t=>{if(!t)throw new g("Cannot use deleted val. handle = "+t);return Y[t]},x1=t=>{switch(t){case void 0:return 2;case null:return 4;case true:return 6;case false:return 8;default:let e=e2.pop()||Y.length;return Y[e]=t,Y[e+1]=1,e}},E2={name:"emscripten::val",fromWireType:t=>{var e=u1(t);return i2(t),e},toWireType:(t,e)=>x1(e),Ia:8,readValueFromPointer:L1,Ja:null},l3=(t,e,n)=>{switch(e){case 1:return n?function(s){return this.fromWireType(Q[s])}:function(s){return this.fromWireType(S[s])};case 2:return n?function(s){return this.fromWireType(G[s>>1])}:function(s){return this.fromWireType(n1[s>>1])};case 4:return n?function(s){return this.fromWireType($[s>>2])}:function(s){return this.fromWireType(m[s>>2])};default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},U1=(t,e)=>{var n=o1[t];if(n===void 0)throw t=`${e} has unknown type ${S2(t)}`,new g(t);return n},a2=t=>{if(t===null)return "null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t},_3=(t,e)=>{switch(e){case 4:return function(n){return this.fromWireType(i1[n>>2])};case 8:return function(n){return this.fromWireType(v1[n>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},f3=(t,e,n)=>{switch(e){case 1:return n?s=>Q[s]:s=>S[s];case 2:return n?s=>G[s>>1]:s=>n1[s>>1];case 4:return n?s=>$[s>>2]:s=>m[s>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},v3=Object.assign({optional:true},E2),O2=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,p3=(t,e)=>{for(var n=t>>1,s=n+e/2;!(n>=s)&&n1[n];)++n;if(n<<=1,32<n-t&&O2)return O2.decode(S.subarray(t,n));for(n="",s=0;!(s>=e/2);++s){var o=G[t+2*s>>1];if(o==0)break;n+=String.fromCharCode(o);}return n},m3=(t,e,n)=>{if(n??(n=2147483647),2>n)return 0;n-=2;var s=e;n=n<2*t.length?n/2:t.length;for(var o=0;o<n;++o)G[e>>1]=t.charCodeAt(o),e+=2;return G[e>>1]=0,e-s},g3=t=>2*t.length,L3=(t,e)=>{for(var n=0,s="";!(n>=e/4);){var o=$[t+4*n>>2];if(o==0)break;++n,65536<=o?(o-=65536,s+=String.fromCharCode(55296|o>>10,56320|o&1023)):s+=String.fromCharCode(o);}return s},M3=(t,e,n)=>{if(n??(n=2147483647),4>n)return 0;var s=e;n=s+n-4;for(var o=0;o<t.length;++o){var h=t.charCodeAt(o);if(55296<=h&&57343>=h){var u=t.charCodeAt(++o);h=65536+((h&1023)<<10)|u&1023;}if($[e>>2]=h,e+=4,e+4>n)break}return $[e>>2]=0,e-s},w3=t=>{for(var e=0,n=0;n<t.length;++n){var s=t.charCodeAt(n);55296<=s&&57343>=s&&++n,e+=4;}return e},n2=0,A2=(t,e,n)=>{var s=[];return t=t.toWireType(s,n),s.length&&(m[e>>2]=x1(s)),t},s2=[],y3=t=>{var e=s2.length;return s2.push(t),e},C3=(t,e)=>{for(var n=Array(t),s=0;s<t;++s)n[s]=U1(m[e+4*s>>2],"parameter "+s);return n},b3=Reflect.construct,b1={},D2=t=>{if(!(t instanceof p2||t=="unwind"))throw t},k2=t=>{throw f1=t,J1||0<n2||(r.onExit?.(t),X=true),new p2(t)},I3=t=>{if(!X)try{if(t(),!(J1||0<n2))try{f1=t=f1,k2(t);}catch(e){D2(e);}}catch(e){D2(e);}},r2={},F2=()=>{if(!o2){var t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:t1||"./this.program"},e;for(e in r2)r2[e]===void 0?delete t[e]:t[e]=r2[e];var n=[];for(e in t)n.push(`${e}=${t[e]}`);o2=n;}return o2},o2,S3=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return t=>crypto.getRandomValues(t);O1("initRandomDevice");},T2=t=>(T2=S3())(t);M1=r.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError";}};for(var R2=Array(256),$1=0;256>$1;++$1)R2[$1]=String.fromCharCode($1);L2=R2,g=r.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError";}},Object.assign(R1.prototype,{isAliasOf:function(t){if(!(this instanceof R1&&t instanceof R1))return false;var e=this.Aa.Da.Ba,n=this.Aa.Ca;t.Aa=t.Aa;var s=t.Aa.Da.Ba;for(t=t.Aa.Ca;e.Ga;)n=e.Qa(n),e=e.Ga;for(;s.Ga;)t=s.Qa(t),s=s.Ga;return e===s&&n===t},clone:function(){if(this.Aa.Ca||K1(this),this.Aa.Pa)return this.Aa.count.value+=1,this;var t=w1,e=Object,n=e.create,s=Object.getPrototypeOf(this),o=this.Aa;return t=t(n.call(e,s,{Aa:{value:{count:o.count,Oa:o.Oa,Pa:o.Pa,Ca:o.Ca,Da:o.Da,Fa:o.Fa,Ha:o.Ha}}})),t.Aa.count.value+=1,t.Aa.Oa=false,t},delete(){if(this.Aa.Ca||K1(this),this.Aa.Oa&&!this.Aa.Pa)throw new g("Object already scheduled for deletion");M2(this);var t=this.Aa;--t.count.value,t.count.value===0&&(t.Fa?t.Ha.Ka(t.Fa):t.Da.Ba.Ka(t.Ca)),this.Aa.Pa||(this.Aa.Fa=void 0,this.Aa.Ca=void 0);},isDeleted:function(){return !this.Aa.Ca},deleteLater:function(){if(this.Aa.Ca||K1(this),this.Aa.Oa&&!this.Aa.Pa)throw new g("Object already scheduled for deletion");return this.Aa.Oa=true,this}}),Object.assign(C1.prototype,{cb(t){return this.Ya&&(t=this.Ya(t)),t},Wa(t){this.Ka?.(t);},Ia:8,readValueFromPointer:L1,fromWireType:function(t){function e(){return this.Sa?T1(this.Ba.Ma,{Da:this.ib,Ca:n,Ha:this,Fa:t}):T1(this.Ba.Ma,{Da:this,Ca:t})}var n=this.cb(t);if(!n)return this.Wa(t),null;var s=a3(this.Ba,n);if(s!==void 0)return s.Aa.count.value===0?(s.Aa.Ca=n,s.Aa.Fa=t,s.clone()):(s=s.clone(),this.Wa(t),s);if(s=this.Ba.bb(n),s=y2[s],!s)return e.call(this);s=this.Ra?s.Za:s.pointerType;var o=w2(n,this.Ba,s.Ba);return o===null?e.call(this):this.Sa?T1(s.Ba.Ma,{Da:s,Ca:o,Ha:this,Fa:t}):T1(s.Ba.Ma,{Da:s,Ca:o})}}),I2=r.UnboundTypeError=((t,e)=>{var n=y1(e,function(s){this.name=e,this.message=s,s=Error(s).stack,s!==void 0&&(this.stack=this.toString()+`
`+s.replace(/^Error(:[^\n]*)?\n/,""));});return n.prototype=Object.create(t.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},n})(Error,"UnboundTypeError"),Y.push(0,1,void 0,1,null,1,true,1,false,1),r.count_emval_handles=()=>Y.length/2-5-e2.length;var P3={c:(t,e,n,s)=>O1(`Assertion failed: ${t?D1(t):""}, at: `+[e?e?D1(e):"":"unknown filename",n,s?s?D1(s):"":"unknown function"]),j:(t,e,n)=>{var s=new t3(t);throw m[s.Ca+16>>2]=0,m[s.Ca+4>>2]=e,m[s.Ca+8>>2]=n,g2=t,g2},P:()=>{},M:()=>{},N:()=>{},R:function(){},O:()=>{},T:()=>O1(""),w:t=>{var e=k1[t];delete k1[t];var n=e.Ua,s=e.Ka,o=e.Xa,h=o.map(u=>u.gb).concat(o.map(u=>u.mb));a1([t],h,u=>{var d={};return o.forEach((_,v)=>{var f=u[v],M=_.eb,y=_.fb,F=u[v+o.length],b=_.lb,I=_.nb;d[_.ab]={read:H=>f.fromWireType(M(y,H)),write:(H,I1)=>{var T=[];b(I,H,F.toWireType(T,I1)),q1(T);}};}),[{name:e.name,fromWireType:_=>{var v={},f;for(f in d)v[f]=d[f].read(_);return s(_),v},toWireType:(_,v)=>{for(var f in d)if(!(f in v))throw new TypeError(`Missing field: "${f}"`);var M=n();for(f in d)d[f].write(M,v[f]);return _!==null&&_.push(s,M),M},Ia:8,readValueFromPointer:L1,Ja:s}]});},F:()=>{},_:(t,e,n,s)=>{e=O(e),B(t,{name:e,fromWireType:function(o){return !!o},toWireType:function(o,h){return h?n:s},Ia:8,readValueFromPointer:function(o){return this.fromWireType(S[o])},Ja:null});},m:(t,e,n,s,o,h,u,d,_,v,f,M,y)=>{f=O(f),h=A(o,h),d&&(d=A(u,d)),v&&(v=A(_,v)),y=A(M,y);var F=n3(f);Q1(F,function(){W1(`Cannot construct ${f} due to unbound types`,[s]);}),a1([t,e,n],s?[s]:[],b=>{if(b=b[0],s)var I=b.Ba,H=I.Ma;else H=R1.prototype;b=y1(f,function(...c2){if(Object.getPrototypeOf(this)!==I1)throw new g("Use 'new' to construct "+f);if(T.La===void 0)throw new g(f+" has no accessible constructor");var $2=T.La[c2.length];if($2===void 0)throw new g(`Tried to invoke ctor of ${f} with invalid number of parameters (${c2.length}) - expected (${Object.keys(T.La).toString()}) parameters instead!`);return $2.apply(this,c2)});var I1=Object.create(H,{constructor:{value:b}});b.prototype=I1;var T=new s3(f,b,I1,y,I,h,d,v);if(T.Ga){var S1;(S1=T.Ga).Va??(S1.Va=[]),T.Ga.Va.push(T);}return I=new C1(f,T,true,false,false),S1=new C1(f+"*",T,false,false,false),H=new C1(f+" const*",T,false,true,false),y2[t]={pointerType:S1,Za:H},b2(F,b),[I,S1,H]});},r:(t,e,n,s,o,h)=>{var u=Z1(e,n);o=A(s,o),a1([],[t],d=>{d=d[0];var _=`constructor ${d.name}`;if(d.Ba.La===void 0&&(d.Ba.La=[]),d.Ba.La[e-1]!==void 0)throw new g(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${d.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return d.Ba.La[e-1]=()=>{W1(`Cannot construct ${d.name} due to unbound types`,u);},a1([],u,v=>(v.splice(1,0,null),d.Ba.La[e-1]=t2(_,v,null,o,h),[])),[]});},d:(t,e,n,s,o,h,u,d)=>{var _=Z1(n,s);e=O(e),e=P2(e),h=A(o,h),a1([],[t],v=>{function f(){W1(`Cannot call ${M} due to unbound types`,_);}v=v[0];var M=`${v.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),d&&v.Ba.jb.push(e);var y=v.Ba.Ma,F=y[e];return F===void 0||F.Ea===void 0&&F.className!==v.name&&F.Na===n-2?(f.Na=n-2,f.className=v.name,y[e]=f):(C2(y,e,M),y[e].Ea[n-2]=f),a1([],_,b=>(b=t2(M,b,v,h,u),y[e].Ea===void 0?(b.Na=n-2,y[e]=b):y[e].Ea[n-2]=b,[])),[]});},Y:t=>B(t,E2),D:(t,e,n,s)=>{function o(){}e=O(e),o.values={},B(t,{name:e,constructor:o,fromWireType:function(h){return this.constructor.values[h]},toWireType:(h,u)=>u.value,Ia:8,readValueFromPointer:l3(e,n,s),Ja:null}),Q1(e,o);},l:(t,e,n)=>{var s=U1(t,"enum");e=O(e),t=s.constructor,s=Object.create(s.constructor.prototype,{value:{value:n},constructor:{value:y1(`${s.name}_${e}`,function(){})}}),t.values[n]=s,t[e]=s;},A:(t,e,n)=>{e=O(e),B(t,{name:e,fromWireType:s=>s,toWireType:(s,o)=>o,Ia:8,readValueFromPointer:_3(e,n),Ja:null});},v:(t,e,n,s,o,h)=>{var u=Z1(e,n);t=O(t),t=P2(t),o=A(s,o),Q1(t,function(){W1(`Cannot call ${t} due to unbound types`,u);},e-1),a1([],u,d=>(b2(t,t2(t,[d[0],null].concat(d.slice(1)),null,o,h),e-1),[]));},n:(t,e,n,s,o)=>{if(e=O(e),o===-1&&(o=4294967295),o=d=>d,s===0){var h=32-8*n;o=d=>d<<h>>>h;}var u=e.includes("unsigned")?function(d,_){return _>>>0}:function(d,_){return _};B(t,{name:e,fromWireType:o,toWireType:u,Ia:8,readValueFromPointer:f3(e,n,s!==0),Ja:null});},g:(t,e,n)=>{function s(h){return new o(Q.buffer,m[h+4>>2],m[h>>2])}var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];n=O(n),B(t,{name:n,fromWireType:s,Ia:8,readValueFromPointer:s},{hb:true});},q:t=>{B(t,v3);},u:(t,e,n,s,o,h,u,d,_,v,f,M)=>{n=O(n),h=A(o,h),d=A(u,d),v=A(_,v),M=A(f,M),a1([t],[e],y=>(y=y[0],[new C1(n,y.Ba,false,false,true,y,s,h,d,v,M)]));},Z:(t,e)=>{e=O(e),B(t,{name:e,fromWireType:function(n){for(var s=m[n>>2],o=n+4,h,u=o,d=0;d<=s;++d){var _=o+d;(d==s||S[_]==0)&&(u=u?D1(u,_-u):"",h===void 0?h=u:(h+="\0",h+=u),u=_+1);}return Z(n),h},toWireType:function(n,s){s instanceof ArrayBuffer&&(s=new Uint8Array(s));var o,h=typeof s=="string";if(!(h||s instanceof Uint8Array||s instanceof Uint8ClampedArray||s instanceof Int8Array))throw new g("Cannot pass non-string to std::string");if(h)for(var u=o=0;u<s.length;++u){var d=s.charCodeAt(u);127>=d?o++:2047>=d?o+=2:55296<=d&&57343>=d?(o+=4,++u):o+=3;}else o=s.length;if(u=h2(4+o+1),d=u+4,m[u>>2]=o,h)g1(s,d,o+1);else if(h)for(h=0;h<o;++h){var _=s.charCodeAt(h);if(255<_)throw Z(d),new g("String has UTF-16 code units that do not fit in 8 bits");S[d+h]=_;}else for(h=0;h<o;++h)S[d+h]=s[h];return n!==null&&n.push(Z,u),u},Ia:8,readValueFromPointer:L1,Ja(n){Z(n);}});},y:(t,e,n)=>{if(n=O(n),e===2)var s=p3,o=m3,h=g3,u=d=>n1[d>>1];else e===4&&(s=L3,o=M3,h=w3,u=d=>m[d>>2]);B(t,{name:n,fromWireType:d=>{for(var _=m[d>>2],v,f=d+4,M=0;M<=_;++M){var y=d+4+M*e;(M==_||u(y)==0)&&(f=s(f,y-f),v===void 0?v=f:(v+="\0",v+=f),f=y+e);}return Z(d),v},toWireType:(d,_)=>{if(typeof _!="string")throw new g(`Cannot pass non-string to C++ string type ${n}`);var v=h(_),f=h2(4+v+e);return m[f>>2]=v/e,o(_,f+4,v+e),d!==null&&d.push(Z,f),f},Ia:8,readValueFromPointer:L1,Ja(d){Z(d);}});},x:(t,e,n,s,o,h)=>{k1[t]={name:O(e),Ua:A(n,s),Ka:A(o,h),Xa:[]};},i:(t,e,n,s,o,h,u,d,_,v)=>{k1[t].Xa.push({ab:O(e),gb:n,eb:A(s,o),fb:h,mb:u,lb:A(d,_),nb:v});},$:(t,e)=>{e=O(e),B(t,{pb:true,name:e,Ia:0,fromWireType:()=>{},toWireType:()=>{}});},K:()=>{J1=false,n2=0;},I:()=>{throw 1/0},C:(t,e,n)=>(t=u1(t),e=U1(e,"emval::as"),A2(e,n,t)),p:(t,e,n,s)=>(t=s2[t],e=u1(e),t(null,e,n,s)),W:i2,E:(t,e)=>(t=u1(t),e=u1(e),t==e),o:(t,e,n)=>{var s=C3(t,e),o=s.shift();t--;var h=Array(t);return e=`methodCaller<(${s.map(u=>u.name).join(", ")}) => ${o.name}>`,y3(y1(e,(u,d,_,v)=>{for(var f=0,M=0;M<t;++M)h[M]=s[M].readValueFromPointer(v+f),f+=s[M].Ia;return u=n===1?b3(d,h):d.apply(u,h),A2(o,_,u)}))},z:t=>{9<t&&(Y[t+1]+=1);},ca:t=>{var e=u1(t);q1(e),i2(t);},t:(t,e)=>(t=U1(t,"_emval_take_value"),t=t.readValueFromPointer(e),x1(t)),G:(t,e)=>{if(b1[t]&&(clearTimeout(b1[t].id),delete b1[t]),!e)return 0;var n=setTimeout(()=>{delete b1[t],I3(()=>x2(t,performance.now()));},e);return b1[t]={id:n,qb:e},0},H:(t,e,n,s)=>{var o=new Date().getFullYear(),h=new Date(o,0,1).getTimezoneOffset();o=new Date(o,6,1).getTimezoneOffset(),m[t>>2]=60*Math.max(h,o),$[e>>2]=+(h!=o),e=u=>{var d=Math.abs(u);return `UTC${0<=u?"-":"+"}${String(Math.floor(d/60)).padStart(2,"0")}${String(d%60).padStart(2,"0")}`},t=e(h),e=e(o),o<h?(g1(t,n,17),g1(e,s,17)):(g1(t,s,17),g1(e,n,17));},ba:()=>performance.now(),J:t=>{var e=S.length;if(t>>>=0,2147483648<t)return false;for(var n=1;4>=n;n*=2){var s=e*(1+.2/n);s=Math.min(s,t+100663296);t:{s=(Math.min(2147483648,65536*Math.ceil(Math.max(t,s)/65536))-e1.buffer.byteLength+65535)/65536|0;try{e1.grow(s),p1();var o=1;break t}catch{}o=void 0;}if(o)return true}return false},V:(t,e)=>{var n=0;return F2().forEach((s,o)=>{var h=e+n;for(o=m[t+4*o>>2]=h,h=0;h<s.length;++h)Q[o++]=s.charCodeAt(h);Q[o]=0,n+=s.length+1;}),0},X:(t,e)=>{var n=F2();m[t>>2]=n.length;var s=0;return n.forEach(o=>s+=o.length+1),m[e>>2]=s,0},S:()=>52,Q:()=>52,k:E3,f:R3,e:k3,B:O3,aa:W3,a:A3,b:F3,h:D3,s:T3,U:k2,L:(t,e)=>(T2(S.subarray(t,t+e)),0)},C;(async function(){function t(s){return C=s.exports,e1=C.da,p1(),W=C.ga,P1.unshift(C.ea),r1--,r.monitorRunDependencies?.(r1),r1==0&&m1&&(s=m1,m1=null,s()),C}r1++,r.monitorRunDependencies?.(r1);var e={a:P3};if(r.instantiateWasm)try{return r.instantiateWasm(e,t)}catch(s){K(`Module.instantiateWasm callback failed with error: ${s}`),w(s);}A1??(A1=v2("DotLottiePlayer.wasm")?"DotLottiePlayer.wasm":r.locateFile?r.locateFile("DotLottiePlayer.wasm",P):P+"DotLottiePlayer.wasm");try{var n=await Z2(e);return t(n.instance),n}catch(s){w(s);}})();var h2=t=>(h2=C.fa)(t),Z=t=>(Z=C.ha)(t),W2=t=>(W2=C.ia)(t),x2=(t,e)=>(x2=C.ja)(t,e),V=(t,e)=>(V=C.ka)(t,e),J=t=>(J=C.la)(t),q=()=>(q=C.ma)();r.dynCall_jiii=(t,e,n,s)=>(r.dynCall_jiii=C.na)(t,e,n,s),r.dynCall_jii=(t,e,n)=>(r.dynCall_jii=C.oa)(t,e,n),r.dynCall_vjii=(t,e,n,s,o)=>(r.dynCall_vjii=C.pa)(t,e,n,s,o),r.dynCall_vjfii=(t,e,n,s,o,h)=>(r.dynCall_vjfii=C.qa)(t,e,n,s,o,h),r.dynCall_vjiii=(t,e,n,s,o,h)=>(r.dynCall_vjiii=C.ra)(t,e,n,s,o,h),r.dynCall_vj=(t,e,n)=>(r.dynCall_vj=C.sa)(t,e,n),r.dynCall_vjiiiii=(t,e,n,s,o,h,u,d)=>(r.dynCall_vjiiiii=C.ta)(t,e,n,s,o,h,u,d),r.dynCall_vjiffii=(t,e,n,s,o,h,u,d)=>(r.dynCall_vjiffii=C.ua)(t,e,n,s,o,h,u,d),r.dynCall_vjiiii=(t,e,n,s,o,h,u)=>(r.dynCall_vjiiii=C.va)(t,e,n,s,o,h,u),r.dynCall_viijii=(t,e,n,s,o,h,u)=>(r.dynCall_viijii=C.wa)(t,e,n,s,o,h,u),r.dynCall_iiiiij=(t,e,n,s,o,h,u)=>(r.dynCall_iiiiij=C.xa)(t,e,n,s,o,h,u),r.dynCall_iiiiijj=(t,e,n,s,o,h,u,d,_)=>(r.dynCall_iiiiijj=C.ya)(t,e,n,s,o,h,u,d,_),r.dynCall_iiiiiijj=(t,e,n,s,o,h,u,d,_,v)=>(r.dynCall_iiiiiijj=C.za)(t,e,n,s,o,h,u,d,_,v);function E3(t,e){var n=q();try{return W.get(t)(e)}catch(s){if(J(n),s!==s+0)throw s;V(1,0);}}function O3(t,e,n,s,o,h){var u=q();try{return W.get(t)(e,n,s,o,h)}catch(d){if(J(u),d!==d+0)throw d;V(1,0);}}function A3(t,e){var n=q();try{W.get(t)(e);}catch(s){if(J(n),s!==s+0)throw s;V(1,0);}}function D3(t,e,n,s){var o=q();try{W.get(t)(e,n,s);}catch(h){if(J(o),h!==h+0)throw h;V(1,0);}}function k3(t,e,n,s){var o=q();try{return W.get(t)(e,n,s)}catch(h){if(J(o),h!==h+0)throw h;V(1,0);}}function F3(t,e,n){var s=q();try{W.get(t)(e,n);}catch(o){if(J(s),o!==o+0)throw o;V(1,0);}}function T3(t,e,n,s,o){var h=q();try{W.get(t)(e,n,s,o);}catch(u){if(J(h),u!==u+0)throw u;V(1,0);}}function R3(t,e,n){var s=q();try{return W.get(t)(e,n)}catch(o){if(J(s),o!==o+0)throw o;V(1,0);}}function W3(t){var e=q();try{W.get(t)();}catch(n){if(J(e),n!==n+0)throw n;V(1,0);}}var z1;m1=function t(){z1||U2(),z1||(m1=t);};function U2(){function t(){if(!z1&&(z1=true,r.calledRun=true,!X)){if(V1(P1),l(r),r.onRuntimeInitialized?.(),r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;){var e=r.postRun.shift();z.unshift(e);}V1(z);}}if(!(0<r1)){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)E1();V1(s1),0<r1||(r.setStatus?(r.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>r.setStatus(""),1),t();},1)):t());}}if(r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();return U2(),a=R,a}})(),V3=G3,B1=class{constructor(){throw new Error("RendererLoader is a static class and cannot be instantiated.")}static async _tryLoad(c){return await V3({locateFile:()=>c})}static async _loadWithBackup(){return this._ModulePromise||(this._ModulePromise=this._tryLoad(this._wasmURL).catch(async c=>{let i=`https://unpkg.com/${V2}@${G2}/dist/dotlottie-player.wasm`;console.warn(`Primary WASM load failed from ${this._wasmURL}. Error: ${c.message}`),console.warn(`Attempting to load WASM from backup URL: ${i}`);try{return await this._tryLoad(i)}catch(a){throw console.error(`Primary WASM URL failed: ${c.message}`),console.error(`Backup WASM URL failed: ${a.message}`),new Error("WASM loading failed from all sources.")}})),this._ModulePromise}static async load(){return this._loadWithBackup()}static setWasmUrl(c){c!==this._wasmURL&&(this._wasmURL=c,this._ModulePromise=null);}};p(B1,"_ModulePromise",null),p(B1,"_wasmURL",`https://cdn.jsdelivr.net/npm/${V2}@${G2}/dist/dotlottie-player.wasm`);var J2=class{constructor(){p(this,"_eventListeners",new Map);}addEventListener(c,i){let a=this._eventListeners.get(c);a||(a=new Set,this._eventListeners.set(c,a)),a.add(i);}removeEventListener(c,i){let a=this._eventListeners.get(c);a&&(i?(a.delete(i),a.size===0&&this._eventListeners.delete(c)):this._eventListeners.delete(c));}dispatch(c){this._eventListeners.get(c.type)?.forEach(i=>i(c));}removeAllEventListeners(){this._eventListeners.clear();}},j=class{static _initializeObserver(){if(this._observer)return;let c=i=>{i.forEach(a=>{let r=this._observedCanvases.get(a.target);r&&(a.isIntersecting?r.unfreeze():r.freeze());});};this._observer=new IntersectionObserver(c,{threshold:0});}static observe(c,i){this._initializeObserver(),!this._observedCanvases.has(c)&&(this._observedCanvases.set(c,i),this._observer?.observe(c));}static unobserve(c){this._observer?.unobserve(c),this._observedCanvases.delete(c),this._observedCanvases.size===0&&(this._observer?.disconnect(),this._observer=null);}};p(j,"_observer",null),p(j,"_observedCanvases",new Map);var N=class{static _initializeObserver(){if(this._observer)return;let c=i=>{i.forEach(a=>{let r=this._observedCanvases.get(a.target);if(!r)return;let[l,w]=r;clearTimeout(w);let R=setTimeout(()=>{l.resize();},100);this._observedCanvases.set(a.target,[l,R]);});};this._observer=new ResizeObserver(c);}static observe(c,i){this._initializeObserver(),!this._observedCanvases.has(c)&&(this._observedCanvases.set(c,[i,0]),this._observer?.observe(c));}static unobserve(c){let i=this._observedCanvases.get(c);if(i){let a=i[1];a&&clearTimeout(a);}this._observer?.unobserve(c),this._observedCanvases.delete(c),!this._observedCanvases.size&&this._observer&&(this._observer.disconnect(),this._observer=null);}};p(N,"_observer",null),p(N,"_observedCanvases",new Map);function J3(c){return /^#([\da-f]{6}|[\da-f]{8})$/iu.test(c)}function q3(c){if(!J3(c))return 0;let i=c.replace("#","");return i=i.length===6?`${i}ff`:i,parseInt(i,16)}function z2(c){if(c.byteLength<4)return false;let i=new Uint8Array(c.slice(0,d2.byteLength));for(let a=0;a<d2.length;a+=1)if(d2[a]!==i[a])return false;return true}function B2(c){return H3.every(i=>Object.prototype.hasOwnProperty.call(c,i))}function H2(c){if(typeof c=="string")try{return B2(JSON.parse(c))}catch{return false}else return B2(c)}function c1(){return 1+((E?window.devicePixelRatio:1)-1)*j3}function l1(c){let i=c.getBoundingClientRect(),a=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth;return !(i.bottom<0||i.top>a||i.right<0||i.left>r)}function x(c){let i=c.target;if(i instanceof HTMLCanvasElement){let a=i.getBoundingClientRect();if(a.width===0||a.height===0||i.width===0||i.height===0)return null;let r=i.width/a.width,l=i.height/a.height,w=(c.clientX-a.left)*r,R=(c.clientY-a.top)*l;return !Number.isFinite(w)||!Number.isFinite(R)||Number.isNaN(w)||Number.isNaN(R)?null:{x:w,y:R}}return null}function q2(c){let i=c.replace("OpenUrl: ",""),a=i.indexOf(" | Target: "),r,l;a===-1?(r=i,l="_blank"):(r=i.substring(0,a),l=i.substring(a+11)),window.open(r,l);}var u2=(c,i)=>c==="reverse"?i.Mode.Reverse:c==="bounce"?i.Mode.Bounce:c==="reverse-bounce"?i.Mode.ReverseBounce:i.Mode.Forward,K3=(c,i)=>c==="contain"?i.Fit.Contain:c==="cover"?i.Fit.Cover:c==="fill"?i.Fit.Fill:c==="fit-height"?i.Fit.FitHeight:c==="fit-width"?i.Fit.FitWidth:i.Fit.None,X3=(c,i)=>{let a=new i.VectorFloat;return a.push_back(c[0]),a.push_back(c[1]),a},l2=(c,i)=>{let a=new i.VectorFloat;return c.length!==2||(a.push_back(c[0]),a.push_back(c[1])),a},_2=(c,i)=>c?{align:X3(c.align??[.5,.5],i),fit:K3(c.fit??"contain",i)}:i.createDefaultLayout(),K2=class L{constructor(i){p(this,"_canvas"),p(this,"_context",null),p(this,"_eventManager"),p(this,"_animationFrameId",null),p(this,"_frameManager"),p(this,"_dotLottieCore",null),p(this,"_stateMachineId",""),p(this,"_stateMachineConfig",null),p(this,"_isStateMachineRunning",false),p(this,"_stateMachineObserverHandle",null),p(this,"_stateMachineInternalMessageObserver",null),p(this,"_dotLottieObserverHandle",null),p(this,"_renderConfig",{}),p(this,"_isFrozen",false),p(this,"_backgroundColor",null),p(this,"_boundOnClick",null),p(this,"_boundOnPointerUp",null),p(this,"_boundOnPointerDown",null),p(this,"_boundOnPointerMove",null),p(this,"_boundOnPointerEnter",null),p(this,"_boundOnPointerLeave",null),this._canvas=i.canvas,this._eventManager=new J2,this._frameManager=new B3,this._renderConfig={...i.renderConfig,devicePixelRatio:i.renderConfig?.devicePixelRatio||c1(),freezeOnOffscreen:i.renderConfig?.freezeOnOffscreen??true},B1.load().then(a=>{L._wasmModule=a;let r=new a.CallbackObserver;r.setOnLoad(()=>{setTimeout(()=>{this._eventManager.dispatch({type:"load"});},0);}),r.setOnLoadError(()=>{setTimeout(()=>{this._eventManager.dispatch({type:"loadError",error:new Error("failed to load")});},0);}),r.setOnPlay(()=>{setTimeout(()=>{this._eventManager.dispatch({type:"play"});},0);}),r.setOnPause(()=>{setTimeout(()=>{this._eventManager.dispatch({type:"pause"});},0);}),r.setOnStop(()=>{setTimeout(()=>{this._eventManager.dispatch({type:"stop"});},0);}),r.setOnLoop(l=>{setTimeout(()=>{this._eventManager.dispatch({type:"loop",loopCount:l});},0);}),r.setOnComplete(()=>{setTimeout(()=>{this._eventManager.dispatch({type:"complete"});},0);}),r.setOnFrame(l=>{setTimeout(()=>{this._eventManager.dispatch({type:"frame",currentFrame:l});},0);}),r.setOnRender(l=>{setTimeout(()=>{this._eventManager.dispatch({type:"render",currentFrame:l});},0);}),this._dotLottieCore=new a.DotLottiePlayer({animationId:i.animationId??"",themeId:i.themeId??"",stateMachineId:"",autoplay:i.autoplay??false,backgroundColor:0,loopAnimation:i.loop??false,mode:u2(i.mode??"forward",a),segment:l2(i.segment??[],a),speed:i.speed??1,useFrameInterpolation:i.useFrameInterpolation??true,marker:i.marker??"",layout:_2(i.layout,a)}),this._stateMachineId=i.stateMachineId??"",this._stateMachineConfig=i.stateMachineConfig??null,this._dotLottieObserverHandle=this._dotLottieCore.subscribe(r),this._eventManager.dispatch({type:"ready"}),i.data?this._loadFromData(i.data):i.src&&this._loadFromSrc(i.src),i.backgroundColor&&this.setBackgroundColor(i.backgroundColor);}).catch(a=>{this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load wasm module: ${a}`)});});}_dispatchError(i){console.error(i),this._eventManager.dispatch({type:"loadError",error:new Error(i)});}async _fetchData(i){let a=await fetch(i);if(!a.ok)throw new Error(`Failed to fetch animation data from URL: ${i}. ${a.status}: ${a.statusText}`);let r=await a.arrayBuffer();return z2(r)?r:new TextDecoder().decode(r)}_loadFromData(i){if(this._dotLottieCore===null)return;let a=this._canvas.width,r=this._canvas.height,l=false;if(typeof i=="string"){if(!H2(i)){this._dispatchError("Invalid Lottie JSON string: The provided string does not conform to the Lottie JSON format.");return}l=this._dotLottieCore.loadAnimationData(i,a,r);}else if(i instanceof ArrayBuffer){if(!z2(i)){this._dispatchError("Invalid dotLottie ArrayBuffer: The provided ArrayBuffer does not conform to the dotLottie format.");return}l=this._dotLottieCore.loadDotLottieData(i,a,r);}else if(typeof i=="object"){if(!H2(i)){this._dispatchError("Invalid Lottie JSON object: The provided object does not conform to the Lottie JSON format.");return}l=this._dotLottieCore.loadAnimationData(JSON.stringify(i),a,r);}else {this._dispatchError(`Unsupported data type for animation data. Expected:
- string (Lottie JSON),
- ArrayBuffer (dotLottie),
- object (Lottie JSON).
Received: ${typeof i}`);return}l&&(E&&this.resize(),setTimeout(()=>{this._eventManager.dispatch({type:"frame",currentFrame:this.currentFrame});},0),this._dotLottieCore.render(),this._draw(),this._stateMachineId?this.stateMachineLoad(this._stateMachineId)&&this.stateMachineStart()&&this._startAnimationLoop():this._dotLottieCore.isPlaying()&&this._startAnimationLoop(),E&&this._canvas instanceof HTMLCanvasElement&&(this._renderConfig.freezeOnOffscreen&&(j.observe(this._canvas,this),l1(this._canvas)||this.freeze()),this._renderConfig.autoResize&&N.observe(this._canvas,this)));}_loadFromSrc(i){this._fetchData(i).then(a=>this._loadFromData(a)).catch(a=>this._dispatchError(`Failed to load animation data from URL: ${i}. ${a}`));}get buffer(){return this._dotLottieCore?this._dotLottieCore.buffer():null}get activeAnimationId(){return this._dotLottieCore?.activeAnimationId()}get activeThemeId(){return this._dotLottieCore?.activeThemeId()}get layout(){let i=this._dotLottieCore?.config().layout;if(i)return {align:[i.align.get(0),i.align.get(1)],fit:(()=>{switch(i.fit){case L._wasmModule?.Fit.Contain:return "contain";case L._wasmModule?.Fit.Cover:return "cover";case L._wasmModule?.Fit.Fill:return "fill";case L._wasmModule?.Fit.FitHeight:return "fit-height";case L._wasmModule?.Fit.FitWidth:return "fit-width";case L._wasmModule?.Fit.None:return "none";default:return "contain"}})()}}get marker(){return this._dotLottieCore?.config().marker}get manifest(){try{let i=this._dotLottieCore?.manifestString();if(this._dotLottieCore===null||!i)return null;let a=JSON.parse(i);return Object.keys(a).length===0?null:a}catch{return null}}get renderConfig(){return this._renderConfig}get segment(){let i=this._dotLottieCore?.config().segment;if(i&&i.size()===2)return [i.get(0),i.get(1)]}get loop(){return this._dotLottieCore?.config().loopAnimation??false}get mode(){let i=this._dotLottieCore?.config().mode;return i===L._wasmModule?.Mode.Reverse?"reverse":i===L._wasmModule?.Mode.Bounce?"bounce":i===L._wasmModule?.Mode.ReverseBounce?"reverse-bounce":"forward"}get isFrozen(){return this._isFrozen}get isStateMachineRunning(){return this._isStateMachineRunning}get backgroundColor(){return this._backgroundColor??""}get autoplay(){return this._dotLottieCore?.config().autoplay??false}get useFrameInterpolation(){return this._dotLottieCore?.config().useFrameInterpolation??false}get speed(){return this._dotLottieCore?.config().speed??0}get isReady(){return this._dotLottieCore!==null}get isLoaded(){return this._dotLottieCore?.isLoaded()??false}get isPlaying(){return this._dotLottieCore?.isPlaying()??false}get isPaused(){return this._dotLottieCore?.isPaused()??false}get isStopped(){return this._dotLottieCore?.isStopped()??false}get currentFrame(){return this._dotLottieCore?Math.round(this._dotLottieCore.currentFrame()*100)/100:0}get loopCount(){return this._dotLottieCore?.loopCount()??0}get totalFrames(){return this._dotLottieCore?.totalFrames()??0}get duration(){return this._dotLottieCore?.duration()??0}get segmentDuration(){return this._dotLottieCore?.segmentDuration()??0}get canvas(){return this._canvas}load(i){this._dotLottieCore===null||L._wasmModule===null||(this._stopAnimationLoop(),E&&this._canvas instanceof HTMLCanvasElement&&(j.unobserve(this._canvas),N.unobserve(this._canvas),this._cleanupStateMachineListeners()),this._isFrozen=false,this._dotLottieCore.setConfig({animationId:i.animationId??"",themeId:i.themeId??"",stateMachineId:"",autoplay:i.autoplay??false,backgroundColor:0,loopAnimation:i.loop??false,mode:u2(i.mode??"forward",L._wasmModule),segment:l2(i.segment??[],L._wasmModule),speed:i.speed??1,useFrameInterpolation:i.useFrameInterpolation??true,marker:i.marker??"",layout:_2(i.layout,L._wasmModule)}),i.data?this._loadFromData(i.data):i.src&&this._loadFromSrc(i.src),this.setBackgroundColor(i.backgroundColor??""));}_draw(){if(this._dotLottieCore!==null&&(!this._context&&"getContext"in this._canvas&&typeof this._canvas.getContext=="function"&&(this._context=this._canvas.getContext("2d")),this._context)){let i=this._dotLottieCore.buffer(),a=this._canvas.width*this._canvas.height*N3;if(i.byteLength!==a){console.warn(`Buffer size mismatch: got ${i.byteLength}, expected ${a}`);return}let r=null,l=new Uint8ClampedArray(i,0,i.byteLength);typeof ImageData>"u"?(r=this._context.createImageData(this._canvas.width,this._canvas.height),r.data.set(l)):r=new ImageData(l,this._canvas.width,this._canvas.height),this._context.putImageData(r,0,0);}}_stopAnimationLoop(){this._animationFrameId!==null&&(this._frameManager.cancelAnimationFrame(this._animationFrameId),this._animationFrameId=null);}_startAnimationLoop(){this._animationFrameId===null&&this._dotLottieCore&&!this._isFrozen&&(this._dotLottieCore.isPlaying()||this._isStateMachineRunning)&&(this._animationFrameId=this._frameManager.requestAnimationFrame(this._animationLoop.bind(this)));}_animationLoop(){if(this._dotLottieCore===null){this._stopAnimationLoop();return}if(!this._dotLottieCore.isPlaying()&&!this._isStateMachineRunning){this._stopAnimationLoop();return}try{(this._dotLottieCore.tick()||this._dotLottieCore.render())&&this._draw(),this._animationFrameId=this._frameManager.requestAnimationFrame(this._animationLoop.bind(this));}catch(i){console.error("Error in animation frame:",i),this._eventManager.dispatch({type:"renderError",error:i}),i instanceof WebAssembly.RuntimeError&&this.destroy();}}play(){this._dotLottieCore===null||!this.isLoaded||(this._stopAnimationLoop(),(this._dotLottieCore.play()||this._dotLottieCore.isPlaying())&&(this._isFrozen=false,this._startAnimationLoop()),E&&this._canvas instanceof HTMLCanvasElement&&this._renderConfig.freezeOnOffscreen&&!l1(this._canvas)&&this.freeze());}pause(){this._dotLottieCore!==null&&(this._dotLottieCore.pause(),this._stopAnimationLoop());}stop(){if(this._dotLottieCore===null)return;let i=this._dotLottieCore.stop();this._stopAnimationLoop(),i&&(this._eventManager.dispatch({type:"frame",currentFrame:this.currentFrame}),this._dotLottieCore.render(),this._draw());}setFrame(i){this._dotLottieCore!==null&&this._dotLottieCore.seek(i)&&this._dotLottieCore.render()&&this._draw();}setSpeed(i){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),speed:i});}setBackgroundColor(i){this._dotLottieCore!==null&&(E&&this._canvas instanceof HTMLCanvasElement?this._canvas.style.backgroundColor=i:this._dotLottieCore.setConfig({...this._dotLottieCore.config(),backgroundColor:q3(i)}),this._backgroundColor=i);}setLoop(i){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),loopAnimation:i});}setUseFrameInterpolation(i){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),useFrameInterpolation:i});}addEventListener(i,a){this._eventManager.addEventListener(i,a);}removeEventListener(i,a){this._eventManager.removeEventListener(i,a);}destroy(){this._stopAnimationLoop(),this._isStateMachineRunning=false,E&&this._canvas instanceof HTMLCanvasElement&&(j.unobserve(this._canvas),N.unobserve(this._canvas)),this._stateMachineObserverHandle&&(this._dotLottieCore?.stateMachineUnsubscribe(this._stateMachineObserverHandle),this._stateMachineObserverHandle.delete(),this._stateMachineObserverHandle=null),this._stateMachineInternalMessageObserver&&(this._dotLottieCore?.stateMachineInternalUnsubscribe(this._stateMachineInternalMessageObserver),this._stateMachineInternalMessageObserver.delete(),this._stateMachineInternalMessageObserver=null),this._dotLottieObserverHandle&&(this._dotLottieCore?.unsubscribe(this._dotLottieObserverHandle),this._dotLottieObserverHandle.delete(),this._dotLottieObserverHandle=null),this._dotLottieCore?.delete(),this._dotLottieCore=null,this._context=null,this._eventManager.dispatch({type:"destroy"}),this._eventManager.removeAllEventListeners(),this._cleanupStateMachineListeners();}freeze(){this._animationFrameId!==null&&(this._stopAnimationLoop(),this._isFrozen=true,this._eventManager.dispatch({type:"freeze"}));}unfreeze(){this._animationFrameId===null&&(this._isFrozen=false,this._eventManager.dispatch({type:"unfreeze"}),this._startAnimationLoop());}resize(){if(!(!this._dotLottieCore||!this.isLoaded)){if(E&&this._canvas instanceof HTMLCanvasElement){let i=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,{height:a,width:r}=this._canvas.getBoundingClientRect();a!==0&&r!==0&&(this._canvas.width=r*i,this._canvas.height=a*i);}this._dotLottieCore.resize(this._canvas.width,this._canvas.height)&&this._draw();}}setSegment(i,a){this._dotLottieCore===null||L._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),segment:l2([i,a],L._wasmModule)});}setMode(i){this._dotLottieCore===null||L._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),mode:u2(i,L._wasmModule)});}setRenderConfig(i){let{devicePixelRatio:a,freezeOnOffscreen:r,...l}=i;this._renderConfig={...this._renderConfig,...l,devicePixelRatio:a||c1(),freezeOnOffscreen:r??true},E&&this._canvas instanceof HTMLCanvasElement&&(this._renderConfig.autoResize?N.observe(this._canvas,this):N.unobserve(this._canvas),this._renderConfig.freezeOnOffscreen?(j.observe(this._canvas,this),l1(this._canvas)||this.freeze()):(j.unobserve(this._canvas),this._isFrozen&&this.unfreeze()));}loadAnimation(i){this._dotLottieCore===null||this._dotLottieCore.activeAnimationId()===i||this._dotLottieCore.loadAnimation(i,this._canvas.width,this._canvas.height)&&this.resize();}setMarker(i){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),marker:i});}markers(){let i=this._dotLottieCore?.markers();if(i){let a=[];for(let r=0;r<i.size();r+=1){let l=i.get(r);a.push({name:l.name,time:l.time,duration:l.duration});}return a}return []}setTheme(i){if(this._dotLottieCore===null)return false;let a=this._dotLottieCore.setTheme(i);return a&&this._draw(),a}resetTheme(){if(this._dotLottieCore===null)return false;let i=this._dotLottieCore.resetTheme();return i&&this._draw(),i}setThemeData(i){if(this._dotLottieCore===null)return false;let a=this._dotLottieCore.setThemeData(i);return a&&this._draw(),a}setSlots(i){this._dotLottieCore!==null&&this._dotLottieCore.setSlots(i);}setLayout(i){this._dotLottieCore===null||L._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),layout:_2(i,L._wasmModule)});}setViewport(i,a,r,l){return this._dotLottieCore===null?false:this._dotLottieCore.setViewport(i,a,r,l)}static setWasmUrl(i){B1.setWasmUrl(i);}tween(i,a){if(!L._wasmModule)return false;let r=[0,0,1,1],l=new L._wasmModule.VectorFloat;for(let w of r)l.push_back(w);return this._dotLottieCore?.tween(i,a,l)??false}tweenToMarker(i,a){if(!L._wasmModule)return false;let r=[0,0,1,1],l=new L._wasmModule.VectorFloat;for(let w of r)l.push_back(w);return this._dotLottieCore?.tweenToMarker(i,a,l)??false}animationSize(){let i=this._dotLottieCore?.animationSize().get(0)??0,a=this._dotLottieCore?.animationSize().get(1)??0;return {width:i,height:a}}getLayerBoundingBox(i){let a=this._dotLottieCore?.getLayerBounds(i);if(!a||a.size()!==8)return;let r=[];for(let l=0;l<8;l+=1)r.push(a.get(l));return r}static transformThemeToLottieSlots(i,a){return L._wasmModule?.transformThemeToLottieSlots(i,a)??""}_setupStateMachineObservers(){if(!this._dotLottieCore||!L._wasmModule)return;let i=new L._wasmModule.CallbackStateMachineObserver;i.setOnStart(()=>{setTimeout(()=>{this._isStateMachineRunning=true,this._eventManager.dispatch({type:"stateMachineStart"}),this._startAnimationLoop();},0);}),i.setOnStop(()=>{setTimeout(()=>{this._isStateMachineRunning=false,this._eventManager.dispatch({type:"stateMachineStop"}),this._dotLottieCore?.isPlaying()||this._stopAnimationLoop();},0);}),i.setOnCustomEvent(r=>{this._eventManager.dispatch({type:"stateMachineCustomEvent",eventName:r});}),i.setOnBooleanInputValueChange((r,l,w)=>{this._eventManager.dispatch({type:"stateMachineBooleanInputValueChange",inputName:r,newValue:l,oldValue:w});}),i.setOnNumericInputValueChange((r,l,w)=>{this._eventManager.dispatch({type:"stateMachineNumericInputValueChange",inputName:r,newValue:l,oldValue:w});}),i.setOnStringInputValueChange((r,l,w)=>{this._eventManager.dispatch({type:"stateMachineStringInputValueChange",inputName:r,newValue:l,oldValue:w});}),i.setOnInputFired(r=>{this._eventManager.dispatch({type:"stateMachineInputFired",inputName:r});}),i.setOnTransition((r,l)=>{this._eventManager.dispatch({type:"stateMachineTransition",fromState:r,toState:l});}),i.setOnStateEntered(r=>{this._eventManager.dispatch({type:"stateMachineStateEntered",state:r});}),i.setOnStateExit(r=>{this._eventManager.dispatch({type:"stateMachineStateExit",state:r});}),i.setOnError(r=>{this._eventManager.dispatch({type:"stateMachineError",error:r});});let a=new L._wasmModule.CallbackStateMachineInternalObserver;a.setOnMessage(r=>{E?r.startsWith("OpenUrl: ")&&q2(r):this._eventManager.dispatch({type:"stateMachineInternalMessage",message:r});}),this._stateMachineObserverHandle=this._dotLottieCore.stateMachineSubscribe(i),this._stateMachineInternalMessageObserver=this._dotLottieCore.stateMachineInternalSubscribe(a);}_cleanupStateMachineObservers(){this._stateMachineObserverHandle&&(this._dotLottieCore?.stateMachineUnsubscribe(this._stateMachineObserverHandle),this._stateMachineObserverHandle.delete(),this._stateMachineObserverHandle=null),this._stateMachineInternalMessageObserver&&(this._dotLottieCore?.stateMachineInternalUnsubscribe(this._stateMachineInternalMessageObserver),this._stateMachineInternalMessageObserver.delete(),this._stateMachineInternalMessageObserver=null);}stateMachineLoad(i){if(!this._dotLottieCore||!L._wasmModule)return false;this._cleanupStateMachineObservers();let a=this._dotLottieCore.stateMachineLoad(i);return a&&this._setupStateMachineObservers(),a}stateMachineLoadData(i){if(!this._dotLottieCore||!L._wasmModule)return false;this._cleanupStateMachineObservers();let a=this._dotLottieCore.stateMachineLoadData(i);return a&&this._setupStateMachineObservers(),a}stateMachineSetConfig(i){this._stateMachineConfig=i;}stateMachineStart(){if(L._wasmModule===null||this._dotLottieCore===null)return false;let i=L._wasmModule.createDefaultOpenUrlPolicy();if(this._stateMachineConfig){let r=this._stateMachineConfig.openUrlPolicy;if(r&&typeof r.requireUserInteraction=="boolean"&&(i.requireUserInteraction=r.requireUserInteraction),r?.whitelist){i.whitelist=new L._wasmModule.VectorString;for(let l of r.whitelist)i.whiteli