@lottiefiles/dotlottie-web
Advanced tools
Comparing version 0.13.0-beta.1 to 0.13.0
@@ -1,2 +0,2 @@ | ||
var oa=Object.defineProperty;var sa=($,u,o)=>u in $?oa($,u,{enumerable:!0,configurable:!0,writable:!0,value:o}):$[u]=o;var L=($,u,o)=>(sa($,typeof u!="symbol"?u+"":u,o),o);var Ge=class{requestAnimationFrame(u){return requestAnimationFrame(u)}cancelAnimationFrame(u){cancelAnimationFrame(u);}},Xe=class{constructor(){L(this,"_lastHandleId",0);L(this,"_lastImmediate",null);}requestAnimationFrame(u){return this._lastHandleId>=Number.MAX_SAFE_INTEGER&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{u(Date.now());}),this._lastHandleId}cancelAnimationFrame(u){this._lastImmediate&&clearImmediate(this._lastImmediate);}},Me=class{constructor(){L(this,"_strategy");this._strategy=typeof requestAnimationFrame=="function"?new Ge:new Xe;}requestAnimationFrame(u){return this._strategy.requestAnimationFrame(u)}cancelAnimationFrame(u){this._strategy.cancelAnimationFrame(u);}};var Je=typeof window<"u"&&typeof window.document<"u";var ye={name:"@lottiefiles/dotlottie-web",version:"0.13.0-beta.1",type:"module",description:"Lottie and DotLottie player for the web",repository:{type:"git",url:"git+https://github.com/LottieFiles/dotlottie-web.git",directory:"packages/web"},homepage:"https://github.com/LottieFiles/dotlottie-web#readme",bugs:"https://github.com/LottieFiles/dotlottie-web/issues",author:"LottieFiles",contributors:["Abdelrahman Ashraf <a.theashraf@gmail.com>"],license:"MIT",engines:{node:">=18"},main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",files:["dist"],keywords:["dotlottie","lottie","player","animation","web","canvas","javascript","thorvg"],scripts:{build:"tsup",dev:"tsup --watch",lint:"eslint --fix .","stats:eslint":"cross-env TIMING=1 eslint .","stats:ts":"tsc -p tsconfig.build.json --extendedDiagnostics",test:"vitest run --browser.headless","test:coverage":"vitest run --browser.headless --coverage","test:watch":"vitest","type-check":"tsc --noEmit"},devDependencies:{"@types/node":"^20.10.5","@vitest/browser":"^1.1.0","@vitest/coverage-istanbul":"^1.1.0","cross-env":"7.0.3",tsup:"8.0.1",typescript:"5.0.4",vitest:"^1.1.0",webdriverio:"^8.27.0"},publishConfig:{access:"public"}};var ua=(()=>{var $=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(u={}){var o=u,g,O;o.ready=new Promise((e,t)=>{g=e,O=t;});var Q=Object.assign({},o),Qe="./this.program",et=!0,H="";function ir(e){return o.locateFile?o.locateFile(e,H):H+e}(typeof document<"u"&&document.currentScript&&(H=document.currentScript.src),$&&(H=$),H.indexOf("blob:")!==0?H=H.substr(0,H.replace(/[?#].*/,"").lastIndexOf("/")+1):H="",(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{if(n.status==200||n.status==0&&n.response){t(n.response);return}r();},n.onerror=r,n.send(null);});var sr=o.print||console.log.bind(console),ee=o.printErr||console.error.bind(console);Object.assign(o,Q),Q=null,o.arguments&&(o.arguments),o.thisProgram&&(Qe=o.thisProgram),o.quit&&(o.quit);var oe;o.wasmBinary&&(oe=o.wasmBinary),typeof WebAssembly!="object"&&ue("no native wasm support detected");var be,tt=!1,U,R,te,se,j,E,rt,nt;function it(){var e=be.buffer;o.HEAP8=U=new Int8Array(e),o.HEAP16=te=new Int16Array(e),o.HEAPU8=R=new Uint8Array(e),o.HEAPU16=se=new Uint16Array(e),o.HEAP32=j=new Int32Array(e),o.HEAPU32=E=new Uint32Array(e),o.HEAPF32=rt=new Float32Array(e),o.HEAPF64=nt=new Float64Array(e);}var at=[],ot=[],st=[];function cr(){if(o.preRun)for(typeof o.preRun=="function"&&(o.preRun=[o.preRun]);o.preRun.length;)fr(o.preRun.shift());Re(at);}function dr(){Re(ot);}function vr(){if(o.postRun)for(typeof o.postRun=="function"&&(o.postRun=[o.postRun]);o.postRun.length;)hr(o.postRun.shift());Re(st);}function fr(e){at.unshift(e);}function pr(e){ot.unshift(e);}function hr(e){st.unshift(e);}var Y=0,le=null;function _r(e){Y++,o.monitorRunDependencies?.(Y);}function mr(e){if(Y--,o.monitorRunDependencies?.(Y),Y==0&&(le)){var t=le;le=null,t();}}function ue(e){o.onAbort?.(e),e="Aborted("+e+")",ee(e),tt=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw O(t),t}var yr="data:application/octet-stream;base64,",lt=e=>e.startsWith(yr),re;re="DotLottiePlayer.wasm",lt(re)||(re=ir(re));function ut(e){if(e==re&&oe)return new Uint8Array(oe);throw "both async and sync fetching of the wasm failed"}function gr(e){return !oe&&(et)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(t=>{if(!t.ok)throw "failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()}).catch(()=>ut(e)):Promise.resolve().then(()=>ut(e))}function ct(e,t,r){return gr(e).then(n=>WebAssembly.instantiate(n,t)).then(n=>n).then(r,n=>{ee(`failed to asynchronously prepare wasm: ${n}`),ue(n);})}function br(e,t,r,n){return !e&&typeof WebAssembly.instantiateStreaming=="function"&&!lt(t)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(i=>{var a=WebAssembly.instantiateStreaming(i,r);return a.then(n,function(s){return ee(`wasm streaming compile failed: ${s}`),ee("falling back to ArrayBuffer instantiation"),ct(t,r,n)})}):ct(t,r,n)}function Cr(){var e={a:gi};function t(n,i){return y=n.exports,be=y.xa,it(),Ft=y.Aa,pr(y.ya),mr(),y}_r();function r(n){t(n.instance);}if(o.instantiateWasm)try{return o.instantiateWasm(e,t)}catch(n){ee(`Module.instantiateWasm callback failed with error: ${n}`),O(n);}return br(oe,re,e,r).catch(O),{}}var Re=e=>{for(;e.length>0;)e.shift()(o);};o.noExitRuntime||!0;var dt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,vt=(e,t,r)=>{for(var n=t+r,i=t;e[i]&&!(i>=n);)++i;if(i-t>16&&e.buffer&&dt)return dt.decode(e.subarray(t,i));for(var a="";t<i;){var s=e[t++];if(!(s&128)){a+=String.fromCharCode(s);continue}var l=e[t++]&63;if((s&224)==192){a+=String.fromCharCode((s&31)<<6|l);continue}var c=e[t++]&63;if((s&240)==224?s=(s&15)<<12|l<<6|c:s=(s&7)<<18|l<<12|c<<6|e[t++]&63,s<65536)a+=String.fromCharCode(s);else {var v=s-65536;a+=String.fromCharCode(55296|v>>10,56320|v&1023);}}return a},N=(e,t)=>e?vt(R,e,t):"",wr=(e,t,r,n)=>{ue(`Assertion failed: ${N(e)}, at: `+[t?N(t):"unknown filename",r,n?N(n):"unknown function"]);},ft=[],pt=0,Tr=e=>{var t=new Se(e);return t.get_caught()||(t.set_caught(!0),pt--),t.set_rethrown(!1),ft.push(t),Ut(t.excPtr),t.get_exception_ptr()},q=0,Er=()=>{C(0,0);var e=ft.pop();Ot(e.excPtr),q=0;};function Se(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(t){E[this.ptr+4>>2]=t;},this.get_type=function(){return E[this.ptr+4>>2]},this.set_destructor=function(t){E[this.ptr+8>>2]=t;},this.get_destructor=function(){return E[this.ptr+8>>2]},this.set_caught=function(t){t=t?1:0,U[this.ptr+12>>0]=t;},this.get_caught=function(){return U[this.ptr+12>>0]!=0},this.set_rethrown=function(t){t=t?1:0,U[this.ptr+13>>0]=t;},this.get_rethrown=function(){return U[this.ptr+13>>0]!=0},this.init=function(t,r){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(r);},this.set_adjusted_ptr=function(t){E[this.ptr+16>>2]=t;},this.get_adjusted_ptr=function(){return E[this.ptr+16>>2]},this.get_exception_ptr=function(){var t=Bt(this.get_type());if(t)return E[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr};}var $r=e=>{throw q||(q=e),q},ht=e=>{var t=q;if(!t)return me(0),0;var r=new Se(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return me(0),t;for(var i in e){var a=e[i];if(a===0||a===n)break;var s=r.ptr+16;if(Ht(a,n,s))return me(a),t}return me(n),t},Pr=()=>ht([]),Fr=(e,t)=>ht([e,t]),Ar=(e,t,r)=>{var n=new Se(e);throw n.init(t,r),q=e,pt++,q};function Mr(e,t,r){return 0}var _t=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3;}return t},mt=(e,t,r,n)=>{if(!(n>0))return 0;for(var i=r,a=r+n-1,s=0;s<e.length;++s){var l=e.charCodeAt(s);if(l>=55296&&l<=57343){var c=e.charCodeAt(++s);l=65536+((l&1023)<<10)|c&1023;}if(l<=127){if(r>=a)break;t[r++]=l;}else if(l<=2047){if(r+1>=a)break;t[r++]=192|l>>6,t[r++]=128|l&63;}else if(l<=65535){if(r+2>=a)break;t[r++]=224|l>>12,t[r++]=128|l>>6&63,t[r++]=128|l&63;}else {if(r+3>=a)break;t[r++]=240|l>>18,t[r++]=128|l>>12&63,t[r++]=128|l>>6&63,t[r++]=128|l&63;}}return t[r]=0,r-i},Lr=(e,t,r)=>mt(e,R,t,r),kr=(e,t)=>{};function jr(e,t,r){return 0}function Rr(e,t,r,n){}var Ce={},xe=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t);}};function De(e){return this.fromWireType(j[e>>2])}var ie={},G={},we={},yt,Te=e=>{throw new yt(e)},X=(e,t,r)=>{e.forEach(function(l){we[l]=t;});function n(l){var c=r(l);c.length!==e.length&&Te("Mismatched type converter count");for(var v=0;v<e.length;++v)B(e[v],c[v]);}var i=new Array(t.length),a=[],s=0;t.forEach((l,c)=>{G.hasOwnProperty(l)?i[c]=G[l]:(a.push(l),ie.hasOwnProperty(l)||(ie[l]=[]),ie[l].push(()=>{i[c]=G[l],++s,s===a.length&&n(i);}));}),a.length===0&&n(i);},Sr=e=>{var t=Ce[e];delete Ce[e];var r=t.rawConstructor,n=t.rawDestructor,i=t.fields,a=i.map(s=>s.getterReturnType).concat(i.map(s=>s.setterArgumentType));X([e],a,s=>{var l={};return i.forEach((c,v)=>{var f=c.fieldName,h=s[v],_=c.getter,m=c.getterContext,A=s[v+i.length],x=c.setter,P=c.setterContext;l[f]={read:I=>h.fromWireType(_(m,I)),write:(I,d)=>{var p=[];x(P,I,A.toWireType(p,d)),xe(p);}};}),[{name:t.name,fromWireType:c=>{var v={};for(var f in l)v[f]=l[f].read(c);return n(c),v},toWireType:(c,v)=>{for(var f in l)if(!(f in v))throw new TypeError(`Missing field: "${f}"`);var h=r();for(f in l)l[f].write(h,v[f]);return c!==null&&c.push(n,h),h},argPackAdvance:z,readValueFromPointer:De,destructorFunction:n}]});},xr=(e,t,r,n,i)=>{},Dr=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);gt=e;},gt,S=e=>{for(var t="",r=e;R[r];)t+=gt[R[r++]];return t},ae,b=e=>{throw new ae(e)};function Ir(e,t,r={}){var n=t.name;if(e||b(`type "${n}" must have a positive integer typeid pointer`),G.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;b(`Cannot register type '${n}' twice`);}if(G[e]=t,delete we[e],ie.hasOwnProperty(e)){var i=ie[e];delete ie[e],i.forEach(a=>a());}}function B(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Ir(e,t,r)}var z=8,Wr=(e,t,r,n)=>{t=S(t),B(e,{name:t,fromWireType:function(i){return !!i},toWireType:function(i,a){return a?r:n},argPackAdvance:z,readValueFromPointer:function(i){return this.fromWireType(R[i])},destructorFunction:null});},Or=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Ie=e=>{function t(r){return r.$$.ptrType.registeredClass.name}b(t(e)+" instance already deleted");},We=!1,bt=e=>{},Ur=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr);},Ct=e=>{e.count.value-=1;var t=e.count.value===0;t&&Ur(e);},wt=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var n=wt(e,t,r.baseClass);return n===null?null:r.downcast(n)},Tt={},Hr=()=>Object.keys(ve).length,Br=()=>{var e=[];for(var t in ve)ve.hasOwnProperty(t)&&e.push(ve[t]);return e},ce=[],Oe=()=>{for(;ce.length;){var e=ce.pop();e.$$.deleteScheduled=!1,e.delete();}},de,zr=e=>{de=e,ce.length&&de&&de(Oe);},Vr=()=>{o.getInheritedInstanceCount=Hr,o.getLiveInheritedInstances=Br,o.flushPendingDeletes=Oe,o.setDelayFunction=zr;},ve={},Yr=(e,t)=>{for(t===void 0&&b("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},Nr=(e,t)=>(t=Yr(e,t),ve[t]),Ee=(e,t)=>{(!t.ptrType||!t.ptr)&&Te("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,n=!!t.smartPtr;return r!==n&&Te("Both smartPtrType and smartPtr must be specified"),t.count={value:1},fe(Object.create(e,{$$:{value:t,writable:!0}}))};function qr(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Nr(this.registeredClass,t);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function i(){return this.isSmartPointer?Ee(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Ee(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a=this.registeredClass.getActualType(t),s=Tt[a];if(!s)return i.call(this);var l;this.isConst?l=s.constPointerType:l=s.pointerType;var c=wt(t,this.registeredClass,l.registeredClass);return c===null?i.call(this):this.isSmartPointer?Ee(l.registeredClass.instancePrototype,{ptrType:l,ptr:c,smartPtrType:this,smartPtr:e}):Ee(l.registeredClass.instancePrototype,{ptrType:l,ptr:c})}var fe=e=>typeof FinalizationRegistry>"u"?(fe=t=>t,e):(We=new FinalizationRegistry(t=>{Ct(t.$$);}),fe=t=>{var r=t.$$,n=!!r.smartPtr;if(n){var i={$$:r};We.register(t,i,t);}return t},bt=t=>We.unregister(t),fe(e)),Gr=()=>{Object.assign($e.prototype,{isAliasOf(e){if(!(this instanceof $e)||!(e instanceof $e))return !1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,i=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)i=n.upcast(i),n=n.baseClass;return t===n&&r===i},clone(){if(this.$$.ptr||Ie(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=fe(Object.create(Object.getPrototypeOf(this),{$$:{value:Or(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||Ie(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),bt(this),Ct(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0);},isDeleted(){return !this.$$.ptr},deleteLater(){return this.$$.ptr||Ie(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),ce.push(this),ce.length===1&&de&&de(Oe),this.$$.deleteScheduled=!0,this}});};function $e(){}var pe=(e,t)=>Object.defineProperty(t,"name",{value:e}),Et=(e,t,r)=>{if(e[t].overloadTable===void 0){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||b(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n;}},$t=(e,t,r)=>{o.hasOwnProperty(e)?((r===void 0||o[e].overloadTable!==void 0&&o[e].overloadTable[r]!==void 0)&&b(`Cannot register public name '${e}' twice`),Et(o,e,e),o.hasOwnProperty(r)&&b(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),o[e].overloadTable[r]=t):(o[e]=t,r!==void 0&&(o[e].numArguments=r));},Xr=48,Jr=57,Kr=e=>{if(e===void 0)return "_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=Xr&&t<=Jr?`_${e}`:e};function Zr(e,t,r,n,i,a,s,l){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=i,this.getActualType=a,this.upcast=s,this.downcast=l,this.pureVirtualFunctions=[];}var Ue=(e,t,r)=>{for(;t!==r;)t.upcast||b(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function Qr(e,t){if(t===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;t.$$||b(`Cannot pass "${Ve(t)}" as a ${this.name}`),t.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass,n=Ue(t.$$.ptr,r,this.registeredClass);return n}function en(e,t){var r;if(t===null)return this.isReference&&b(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,r),r):0;(!t||!t.$$)&&b(`Cannot pass "${Ve(t)}" as a ${this.name}`),t.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&b(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=Ue(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&b("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:b(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else {var i=t.clone();r=this.rawShare(r,J.toHandle(()=>i.delete())),e!==null&&e.push(this.rawDestructor,r);}break;default:b("Unsupporting sharing policy");}return r}function tn(e,t){if(t===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;t.$$||b(`Cannot pass "${Ve(t)}" as a ${this.name}`),t.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&b(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass,n=Ue(t.$$.ptr,r,this.registeredClass);return n}function Pt(e){return this.fromWireType(E[e>>2])}var rn=()=>{Object.assign(he.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e);},argPackAdvance:z,readValueFromPointer:Pt,deleteObject(e){e!==null&&e.delete();},fromWireType:qr});};function he(e,t,r,n,i,a,s,l,c,v,f){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=i,this.pointeeType=a,this.sharingPolicy=s,this.rawGetPointee=l,this.rawConstructor=c,this.rawShare=v,this.rawDestructor=f,!i&&t.baseClass===void 0?n?(this.toWireType=Qr,this.destructorFunction=null):(this.toWireType=tn,this.destructorFunction=null):this.toWireType=en;}var nn=(e,t,r)=>{o.hasOwnProperty(e)||Te("Replacing nonexistant public symbol"),o[e].overloadTable!==void 0&&r!==void 0?o[e].overloadTable[r]=t:(o[e]=t,o[e].argCount=r);},an=(e,t,r)=>{var n=o["dynCall_"+e];return r&&r.length?n.apply(null,[t].concat(r)):n.call(null,t)},Ft,F=e=>Ft.get(e),on=(e,t,r)=>{if(e.includes("j"))return an(e,t,r);var n=F(t).apply(null,r);return n},sn=(e,t)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),on(e,t,r)}},D=(e,t)=>{e=S(e);function r(){return e.includes("j")?sn(e,t):F(t)}var n=r();return typeof n!="function"&&b(`unknown function pointer with signature ${e}: ${t}`),n},ln=(e,t)=>{var r=pe(t,function(n){this.name=t,this.message=n;var i=new Error(n).stack;i!==void 0&&(this.stack=this.toString()+` | ||
var oa=Object.defineProperty;var sa=($,u,o)=>u in $?oa($,u,{enumerable:!0,configurable:!0,writable:!0,value:o}):$[u]=o;var L=($,u,o)=>(sa($,typeof u!="symbol"?u+"":u,o),o);var Ge=class{requestAnimationFrame(u){return requestAnimationFrame(u)}cancelAnimationFrame(u){cancelAnimationFrame(u);}},Xe=class{constructor(){L(this,"_lastHandleId",0);L(this,"_lastImmediate",null);}requestAnimationFrame(u){return this._lastHandleId>=Number.MAX_SAFE_INTEGER&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{u(Date.now());}),this._lastHandleId}cancelAnimationFrame(u){this._lastImmediate&&clearImmediate(this._lastImmediate);}},Me=class{constructor(){L(this,"_strategy");this._strategy=typeof requestAnimationFrame=="function"?new Ge:new Xe;}requestAnimationFrame(u){return this._strategy.requestAnimationFrame(u)}cancelAnimationFrame(u){this._strategy.cancelAnimationFrame(u);}};var Je=typeof window<"u"&&typeof window.document<"u";var ye={name:"@lottiefiles/dotlottie-web",version:"0.13.0",type:"module",description:"Lottie and DotLottie player for the web",repository:{type:"git",url:"git+https://github.com/LottieFiles/dotlottie-web.git",directory:"packages/web"},homepage:"https://github.com/LottieFiles/dotlottie-web#readme",bugs:"https://github.com/LottieFiles/dotlottie-web/issues",author:"LottieFiles",contributors:["Abdelrahman Ashraf <a.theashraf@gmail.com>"],license:"MIT",engines:{node:">=18"},main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",files:["dist"],keywords:["dotlottie","lottie","player","animation","web","canvas","javascript","thorvg"],scripts:{build:"tsup",dev:"tsup --watch",lint:"eslint --fix .","stats:eslint":"cross-env TIMING=1 eslint .","stats:ts":"tsc -p tsconfig.build.json --extendedDiagnostics",test:"vitest run --browser.headless","test:coverage":"vitest run --browser.headless --coverage","test:watch":"vitest","type-check":"tsc --noEmit"},devDependencies:{"@types/node":"^20.10.5","@vitest/browser":"^1.1.0","@vitest/coverage-istanbul":"^1.1.0","cross-env":"7.0.3",tsup:"8.0.1",typescript:"5.0.4",vitest:"^1.1.0",webdriverio:"^8.27.0"},publishConfig:{access:"public"}};var ua=(()=>{var $=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(u={}){var o=u,g,O;o.ready=new Promise((e,t)=>{g=e,O=t;});var Q=Object.assign({},o),Qe="./this.program",et=!0,H="";function ir(e){return o.locateFile?o.locateFile(e,H):H+e}(typeof document<"u"&&document.currentScript&&(H=document.currentScript.src),$&&(H=$),H.indexOf("blob:")!==0?H=H.substr(0,H.replace(/[?#].*/,"").lastIndexOf("/")+1):H="",(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{if(n.status==200||n.status==0&&n.response){t(n.response);return}r();},n.onerror=r,n.send(null);});var sr=o.print||console.log.bind(console),ee=o.printErr||console.error.bind(console);Object.assign(o,Q),Q=null,o.arguments&&(o.arguments),o.thisProgram&&(Qe=o.thisProgram),o.quit&&(o.quit);var oe;o.wasmBinary&&(oe=o.wasmBinary),typeof WebAssembly!="object"&&ue("no native wasm support detected");var be,tt=!1,U,R,te,se,j,E,rt,nt;function it(){var e=be.buffer;o.HEAP8=U=new Int8Array(e),o.HEAP16=te=new Int16Array(e),o.HEAPU8=R=new Uint8Array(e),o.HEAPU16=se=new Uint16Array(e),o.HEAP32=j=new Int32Array(e),o.HEAPU32=E=new Uint32Array(e),o.HEAPF32=rt=new Float32Array(e),o.HEAPF64=nt=new Float64Array(e);}var at=[],ot=[],st=[];function cr(){if(o.preRun)for(typeof o.preRun=="function"&&(o.preRun=[o.preRun]);o.preRun.length;)fr(o.preRun.shift());Re(at);}function dr(){Re(ot);}function vr(){if(o.postRun)for(typeof o.postRun=="function"&&(o.postRun=[o.postRun]);o.postRun.length;)hr(o.postRun.shift());Re(st);}function fr(e){at.unshift(e);}function pr(e){ot.unshift(e);}function hr(e){st.unshift(e);}var Y=0,le=null;function _r(e){Y++,o.monitorRunDependencies?.(Y);}function mr(e){if(Y--,o.monitorRunDependencies?.(Y),Y==0&&(le)){var t=le;le=null,t();}}function ue(e){o.onAbort?.(e),e="Aborted("+e+")",ee(e),tt=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw O(t),t}var yr="data:application/octet-stream;base64,",lt=e=>e.startsWith(yr),re;re="DotLottiePlayer.wasm",lt(re)||(re=ir(re));function ut(e){if(e==re&&oe)return new Uint8Array(oe);throw "both async and sync fetching of the wasm failed"}function gr(e){return !oe&&(et)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(t=>{if(!t.ok)throw "failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()}).catch(()=>ut(e)):Promise.resolve().then(()=>ut(e))}function ct(e,t,r){return gr(e).then(n=>WebAssembly.instantiate(n,t)).then(n=>n).then(r,n=>{ee(`failed to asynchronously prepare wasm: ${n}`),ue(n);})}function br(e,t,r,n){return !e&&typeof WebAssembly.instantiateStreaming=="function"&&!lt(t)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(i=>{var a=WebAssembly.instantiateStreaming(i,r);return a.then(n,function(s){return ee(`wasm streaming compile failed: ${s}`),ee("falling back to ArrayBuffer instantiation"),ct(t,r,n)})}):ct(t,r,n)}function Cr(){var e={a:gi};function t(n,i){return y=n.exports,be=y.xa,it(),Ft=y.Aa,pr(y.ya),mr(),y}_r();function r(n){t(n.instance);}if(o.instantiateWasm)try{return o.instantiateWasm(e,t)}catch(n){ee(`Module.instantiateWasm callback failed with error: ${n}`),O(n);}return br(oe,re,e,r).catch(O),{}}var Re=e=>{for(;e.length>0;)e.shift()(o);};o.noExitRuntime||!0;var dt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,vt=(e,t,r)=>{for(var n=t+r,i=t;e[i]&&!(i>=n);)++i;if(i-t>16&&e.buffer&&dt)return dt.decode(e.subarray(t,i));for(var a="";t<i;){var s=e[t++];if(!(s&128)){a+=String.fromCharCode(s);continue}var l=e[t++]&63;if((s&224)==192){a+=String.fromCharCode((s&31)<<6|l);continue}var c=e[t++]&63;if((s&240)==224?s=(s&15)<<12|l<<6|c:s=(s&7)<<18|l<<12|c<<6|e[t++]&63,s<65536)a+=String.fromCharCode(s);else {var v=s-65536;a+=String.fromCharCode(55296|v>>10,56320|v&1023);}}return a},N=(e,t)=>e?vt(R,e,t):"",wr=(e,t,r,n)=>{ue(`Assertion failed: ${N(e)}, at: `+[t?N(t):"unknown filename",r,n?N(n):"unknown function"]);},ft=[],pt=0,Tr=e=>{var t=new Se(e);return t.get_caught()||(t.set_caught(!0),pt--),t.set_rethrown(!1),ft.push(t),Ut(t.excPtr),t.get_exception_ptr()},q=0,Er=()=>{C(0,0);var e=ft.pop();Ot(e.excPtr),q=0;};function Se(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(t){E[this.ptr+4>>2]=t;},this.get_type=function(){return E[this.ptr+4>>2]},this.set_destructor=function(t){E[this.ptr+8>>2]=t;},this.get_destructor=function(){return E[this.ptr+8>>2]},this.set_caught=function(t){t=t?1:0,U[this.ptr+12>>0]=t;},this.get_caught=function(){return U[this.ptr+12>>0]!=0},this.set_rethrown=function(t){t=t?1:0,U[this.ptr+13>>0]=t;},this.get_rethrown=function(){return U[this.ptr+13>>0]!=0},this.init=function(t,r){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(r);},this.set_adjusted_ptr=function(t){E[this.ptr+16>>2]=t;},this.get_adjusted_ptr=function(){return E[this.ptr+16>>2]},this.get_exception_ptr=function(){var t=Bt(this.get_type());if(t)return E[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr};}var $r=e=>{throw q||(q=e),q},ht=e=>{var t=q;if(!t)return me(0),0;var r=new Se(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return me(0),t;for(var i in e){var a=e[i];if(a===0||a===n)break;var s=r.ptr+16;if(Ht(a,n,s))return me(a),t}return me(n),t},Pr=()=>ht([]),Fr=(e,t)=>ht([e,t]),Ar=(e,t,r)=>{var n=new Se(e);throw n.init(t,r),q=e,pt++,q};function Mr(e,t,r){return 0}var _t=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3;}return t},mt=(e,t,r,n)=>{if(!(n>0))return 0;for(var i=r,a=r+n-1,s=0;s<e.length;++s){var l=e.charCodeAt(s);if(l>=55296&&l<=57343){var c=e.charCodeAt(++s);l=65536+((l&1023)<<10)|c&1023;}if(l<=127){if(r>=a)break;t[r++]=l;}else if(l<=2047){if(r+1>=a)break;t[r++]=192|l>>6,t[r++]=128|l&63;}else if(l<=65535){if(r+2>=a)break;t[r++]=224|l>>12,t[r++]=128|l>>6&63,t[r++]=128|l&63;}else {if(r+3>=a)break;t[r++]=240|l>>18,t[r++]=128|l>>12&63,t[r++]=128|l>>6&63,t[r++]=128|l&63;}}return t[r]=0,r-i},Lr=(e,t,r)=>mt(e,R,t,r),kr=(e,t)=>{};function jr(e,t,r){return 0}function Rr(e,t,r,n){}var Ce={},xe=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t);}};function De(e){return this.fromWireType(j[e>>2])}var ie={},G={},we={},yt,Te=e=>{throw new yt(e)},X=(e,t,r)=>{e.forEach(function(l){we[l]=t;});function n(l){var c=r(l);c.length!==e.length&&Te("Mismatched type converter count");for(var v=0;v<e.length;++v)B(e[v],c[v]);}var i=new Array(t.length),a=[],s=0;t.forEach((l,c)=>{G.hasOwnProperty(l)?i[c]=G[l]:(a.push(l),ie.hasOwnProperty(l)||(ie[l]=[]),ie[l].push(()=>{i[c]=G[l],++s,s===a.length&&n(i);}));}),a.length===0&&n(i);},Sr=e=>{var t=Ce[e];delete Ce[e];var r=t.rawConstructor,n=t.rawDestructor,i=t.fields,a=i.map(s=>s.getterReturnType).concat(i.map(s=>s.setterArgumentType));X([e],a,s=>{var l={};return i.forEach((c,v)=>{var f=c.fieldName,h=s[v],_=c.getter,m=c.getterContext,A=s[v+i.length],x=c.setter,P=c.setterContext;l[f]={read:I=>h.fromWireType(_(m,I)),write:(I,d)=>{var p=[];x(P,I,A.toWireType(p,d)),xe(p);}};}),[{name:t.name,fromWireType:c=>{var v={};for(var f in l)v[f]=l[f].read(c);return n(c),v},toWireType:(c,v)=>{for(var f in l)if(!(f in v))throw new TypeError(`Missing field: "${f}"`);var h=r();for(f in l)l[f].write(h,v[f]);return c!==null&&c.push(n,h),h},argPackAdvance:z,readValueFromPointer:De,destructorFunction:n}]});},xr=(e,t,r,n,i)=>{},Dr=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);gt=e;},gt,S=e=>{for(var t="",r=e;R[r];)t+=gt[R[r++]];return t},ae,b=e=>{throw new ae(e)};function Ir(e,t,r={}){var n=t.name;if(e||b(`type "${n}" must have a positive integer typeid pointer`),G.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;b(`Cannot register type '${n}' twice`);}if(G[e]=t,delete we[e],ie.hasOwnProperty(e)){var i=ie[e];delete ie[e],i.forEach(a=>a());}}function B(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Ir(e,t,r)}var z=8,Wr=(e,t,r,n)=>{t=S(t),B(e,{name:t,fromWireType:function(i){return !!i},toWireType:function(i,a){return a?r:n},argPackAdvance:z,readValueFromPointer:function(i){return this.fromWireType(R[i])},destructorFunction:null});},Or=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Ie=e=>{function t(r){return r.$$.ptrType.registeredClass.name}b(t(e)+" instance already deleted");},We=!1,bt=e=>{},Ur=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr);},Ct=e=>{e.count.value-=1;var t=e.count.value===0;t&&Ur(e);},wt=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var n=wt(e,t,r.baseClass);return n===null?null:r.downcast(n)},Tt={},Hr=()=>Object.keys(ve).length,Br=()=>{var e=[];for(var t in ve)ve.hasOwnProperty(t)&&e.push(ve[t]);return e},ce=[],Oe=()=>{for(;ce.length;){var e=ce.pop();e.$$.deleteScheduled=!1,e.delete();}},de,zr=e=>{de=e,ce.length&&de&&de(Oe);},Vr=()=>{o.getInheritedInstanceCount=Hr,o.getLiveInheritedInstances=Br,o.flushPendingDeletes=Oe,o.setDelayFunction=zr;},ve={},Yr=(e,t)=>{for(t===void 0&&b("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},Nr=(e,t)=>(t=Yr(e,t),ve[t]),Ee=(e,t)=>{(!t.ptrType||!t.ptr)&&Te("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,n=!!t.smartPtr;return r!==n&&Te("Both smartPtrType and smartPtr must be specified"),t.count={value:1},fe(Object.create(e,{$$:{value:t,writable:!0}}))};function qr(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Nr(this.registeredClass,t);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function i(){return this.isSmartPointer?Ee(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Ee(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a=this.registeredClass.getActualType(t),s=Tt[a];if(!s)return i.call(this);var l;this.isConst?l=s.constPointerType:l=s.pointerType;var c=wt(t,this.registeredClass,l.registeredClass);return c===null?i.call(this):this.isSmartPointer?Ee(l.registeredClass.instancePrototype,{ptrType:l,ptr:c,smartPtrType:this,smartPtr:e}):Ee(l.registeredClass.instancePrototype,{ptrType:l,ptr:c})}var fe=e=>typeof FinalizationRegistry>"u"?(fe=t=>t,e):(We=new FinalizationRegistry(t=>{Ct(t.$$);}),fe=t=>{var r=t.$$,n=!!r.smartPtr;if(n){var i={$$:r};We.register(t,i,t);}return t},bt=t=>We.unregister(t),fe(e)),Gr=()=>{Object.assign($e.prototype,{isAliasOf(e){if(!(this instanceof $e)||!(e instanceof $e))return !1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,i=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)i=n.upcast(i),n=n.baseClass;return t===n&&r===i},clone(){if(this.$$.ptr||Ie(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=fe(Object.create(Object.getPrototypeOf(this),{$$:{value:Or(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||Ie(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),bt(this),Ct(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0);},isDeleted(){return !this.$$.ptr},deleteLater(){return this.$$.ptr||Ie(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),ce.push(this),ce.length===1&&de&&de(Oe),this.$$.deleteScheduled=!0,this}});};function $e(){}var pe=(e,t)=>Object.defineProperty(t,"name",{value:e}),Et=(e,t,r)=>{if(e[t].overloadTable===void 0){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||b(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n;}},$t=(e,t,r)=>{o.hasOwnProperty(e)?((r===void 0||o[e].overloadTable!==void 0&&o[e].overloadTable[r]!==void 0)&&b(`Cannot register public name '${e}' twice`),Et(o,e,e),o.hasOwnProperty(r)&&b(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),o[e].overloadTable[r]=t):(o[e]=t,r!==void 0&&(o[e].numArguments=r));},Xr=48,Jr=57,Kr=e=>{if(e===void 0)return "_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=Xr&&t<=Jr?`_${e}`:e};function Zr(e,t,r,n,i,a,s,l){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=i,this.getActualType=a,this.upcast=s,this.downcast=l,this.pureVirtualFunctions=[];}var Ue=(e,t,r)=>{for(;t!==r;)t.upcast||b(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function Qr(e,t){if(t===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;t.$$||b(`Cannot pass "${Ve(t)}" as a ${this.name}`),t.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass,n=Ue(t.$$.ptr,r,this.registeredClass);return n}function en(e,t){var r;if(t===null)return this.isReference&&b(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,r),r):0;(!t||!t.$$)&&b(`Cannot pass "${Ve(t)}" as a ${this.name}`),t.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&b(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=Ue(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&b("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:b(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else {var i=t.clone();r=this.rawShare(r,J.toHandle(()=>i.delete())),e!==null&&e.push(this.rawDestructor,r);}break;default:b("Unsupporting sharing policy");}return r}function tn(e,t){if(t===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;t.$$||b(`Cannot pass "${Ve(t)}" as a ${this.name}`),t.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&b(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass,n=Ue(t.$$.ptr,r,this.registeredClass);return n}function Pt(e){return this.fromWireType(E[e>>2])}var rn=()=>{Object.assign(he.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e);},argPackAdvance:z,readValueFromPointer:Pt,deleteObject(e){e!==null&&e.delete();},fromWireType:qr});};function he(e,t,r,n,i,a,s,l,c,v,f){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=i,this.pointeeType=a,this.sharingPolicy=s,this.rawGetPointee=l,this.rawConstructor=c,this.rawShare=v,this.rawDestructor=f,!i&&t.baseClass===void 0?n?(this.toWireType=Qr,this.destructorFunction=null):(this.toWireType=tn,this.destructorFunction=null):this.toWireType=en;}var nn=(e,t,r)=>{o.hasOwnProperty(e)||Te("Replacing nonexistant public symbol"),o[e].overloadTable!==void 0&&r!==void 0?o[e].overloadTable[r]=t:(o[e]=t,o[e].argCount=r);},an=(e,t,r)=>{var n=o["dynCall_"+e];return r&&r.length?n.apply(null,[t].concat(r)):n.call(null,t)},Ft,F=e=>Ft.get(e),on=(e,t,r)=>{if(e.includes("j"))return an(e,t,r);var n=F(t).apply(null,r);return n},sn=(e,t)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),on(e,t,r)}},D=(e,t)=>{e=S(e);function r(){return e.includes("j")?sn(e,t):F(t)}var n=r();return typeof n!="function"&&b(`unknown function pointer with signature ${e}: ${t}`),n},ln=(e,t)=>{var r=pe(t,function(n){this.name=t,this.message=n;var i=new Error(n).stack;i!==void 0&&(this.stack=this.toString()+` | ||
`+i.replace(/^Error(:[^\n]*)?\n/,""));});return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r},At,Mt=e=>{var t=Wt(e),r=S(t);return V(t),r},He=(e,t)=>{var r=[],n={};function i(a){if(!n[a]&&!G[a]){if(we[a]){we[a].forEach(i);return}r.push(a),n[a]=!0;}}throw t.forEach(i),new At(`${e}: `+r.map(Mt).join([", "]))},un=(e,t,r,n,i,a,s,l,c,v,f,h,_)=>{f=S(f),a=D(i,a),l&&(l=D(s,l)),v&&(v=D(c,v)),_=D(h,_);var m=Kr(f);$t(m,function(){He(`Cannot construct ${f} due to unbound types`,[n]);}),X([e,t,r],n?[n]:[],function(A){var Ae;A=A[0];var x,P;n?(x=A.registeredClass,P=x.instancePrototype):P=$e.prototype;var I=pe(f,function(){if(Object.getPrototypeOf(this)!==d)throw new ae("Use 'new' to construct "+f);if(p.constructor_body===void 0)throw new ae(f+" has no accessible constructor");var Qt=p.constructor_body[arguments.length];if(Qt===void 0)throw new ae(`Tried to invoke ctor of ${f} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(p.constructor_body).toString()}) parameters instead!`);return Qt.apply(this,arguments)}),d=Object.create(P,{constructor:{value:I}});I.prototype=d;var p=new Zr(f,I,d,_,x,a,l,v);p.baseClass&&((Ae=p.baseClass).__derivedClasses??(Ae.__derivedClasses=[]),p.baseClass.__derivedClasses.push(p));var M=new he(f,p,!0,!1,!1),k=new he(f+"*",p,!1,!1,!1),K=new he(f+" const*",p,!1,!0,!1);return Tt[e]={pointerType:k,constPointerType:K},nn(m,I),[M,k,K]});},Lt=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(E[t+n*4>>2]);return r};function cn(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return !0;return !1}function kt(e,t,r,n,i,a){var s=t.length;s<2&&b("argTypes array size mismatch! Must at least get return value and 'this' types!");var l=t[1]!==null&&r!==null,c=cn(t),v=t[0].name!=="void",f=s-2,h=new Array(f),_=[],m=[],A=function(){arguments.length!==f&&b(`function ${e} called with ${arguments.length} arguments, expected ${f}`),m.length=0;var x;_.length=l?2:1,_[0]=i,l&&(x=t[1].toWireType(m,this),_[1]=x);for(var P=0;P<f;++P)h[P]=t[P+2].toWireType(m,arguments[P]),_.push(h[P]);var I=n.apply(null,_);function d(p){if(c)xe(m);else for(var M=l?1:2;M<t.length;M++){var k=M===1?x:h[M-2];t[M].destructorFunction!==null&&t[M].destructorFunction(k);}if(v)return t[0].fromWireType(p)}return d(I)};return pe(e,A)}var dn=(e,t,r,n,i,a)=>{var s=Lt(t,r);i=D(n,i),X([],[e],function(l){l=l[0];var c=`constructor ${l.name}`;if(l.registeredClass.constructor_body===void 0&&(l.registeredClass.constructor_body=[]),l.registeredClass.constructor_body[t-1]!==void 0)throw new ae(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${l.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return l.registeredClass.constructor_body[t-1]=()=>{He(`Cannot construct ${l.name} due to unbound types`,s);},X([],s,v=>(v.splice(1,0,null),l.registeredClass.constructor_body[t-1]=kt(c,v,null,i,a),[])),[]});},vn=e=>{e=e.trim();let t=e.indexOf("(");return t!==-1?e.substr(0,t):e},fn=(e,t,r,n,i,a,s,l,c)=>{var v=Lt(r,n);t=S(t),t=vn(t),a=D(i,a),X([],[e],function(f){f=f[0];var h=`${f.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),l&&f.registeredClass.pureVirtualFunctions.push(t);function _(){He(`Cannot call ${h} due to unbound types`,v);}var m=f.registeredClass.instancePrototype,A=m[t];return A===void 0||A.overloadTable===void 0&&A.className!==f.name&&A.argCount===r-2?(_.argCount=r-2,_.className=f.name,m[t]=_):(Et(m,t,h),m[t].overloadTable[r-2]=_),X([],v,function(x){var P=kt(h,x,f,a,s);return m[t].overloadTable===void 0?(P.argCount=r-2,m[t]=P):m[t].overloadTable[r-2]=P,[]}),[]});};function pn(){Object.assign(jt.prototype,{get(e){return this.allocated[e]},has(e){return this.allocated[e]!==void 0},allocate(e){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=e,t},free(e){this.allocated[e]=void 0,this.freelist.push(e);}});}function jt(){this.allocated=[void 0],this.freelist=[];}var W=new jt,Be=e=>{e>=W.reserved&&--W.get(e).refcount===0&&W.free(e);},hn=()=>{for(var e=0,t=W.reserved;t<W.allocated.length;++t)W.allocated[t]!==void 0&&++e;return e},_n=()=>{W.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),W.reserved=W.allocated.length,o.count_emval_handles=hn;},J={toValue:e=>(e||b("Cannot use deleted val. handle = "+e),W.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return W.allocate({refcount:1,value:e})}}},mn=(e,t)=>{t=S(t),B(e,{name:t,fromWireType:r=>{var n=J.toValue(r);return Be(r),n},toWireType:(r,n)=>J.toHandle(n),argPackAdvance:z,readValueFromPointer:De,destructorFunction:null});},yn=(e,t,r)=>{switch(t){case 1:return r?function(n){return this.fromWireType(U[n>>0])}:function(n){return this.fromWireType(R[n>>0])};case 2:return r?function(n){return this.fromWireType(te[n>>1])}:function(n){return this.fromWireType(se[n>>1])};case 4:return r?function(n){return this.fromWireType(j[n>>2])}:function(n){return this.fromWireType(E[n>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},gn=(e,t,r,n)=>{t=S(t);function i(){}i.values={},B(e,{name:t,constructor:i,fromWireType:function(a){return this.constructor.values[a]},toWireType:(a,s)=>s.value,argPackAdvance:z,readValueFromPointer:yn(t,r,n),destructorFunction:null}),$t(t,i);},ze=(e,t)=>{var r=G[e];return r===void 0&&b(t+" has unknown type "+Mt(e)),r},bn=(e,t,r)=>{var n=ze(e,"enum");t=S(t);var i=n.constructor,a=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:pe(`${n.name}_${t}`,function(){})}});i.values[r]=a,i[t]=a;},Ve=e=>{if(e===null)return "null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e},Cn=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(rt[r>>2])};case 8:return function(r){return this.fromWireType(nt[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},wn=(e,t,r)=>{t=S(t),B(e,{name:t,fromWireType:n=>n,toWireType:(n,i)=>i,argPackAdvance:z,readValueFromPointer:Cn(t,r),destructorFunction:null});},Tn=(e,t,r)=>{switch(t){case 1:return r?n=>U[n>>0]:n=>R[n>>0];case 2:return r?n=>te[n>>1]:n=>se[n>>1];case 4:return r?n=>j[n>>2]:n=>E[n>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},En=(e,t,r,n,i)=>{t=S(t);var a=f=>f;if(n===0){var s=32-8*r;a=f=>f<<s>>>s;}var l=t.includes("unsigned"),c=(f,h)=>{},v;l?v=function(f,h){return c(h,this.name),h>>>0}:v=function(f,h){return c(h,this.name),h},B(e,{name:t,fromWireType:a,toWireType:v,argPackAdvance:z,readValueFromPointer:Tn(t,r,n!==0),destructorFunction:null});},$n=(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],i=n[t];function a(s){var l=E[s>>2],c=E[s+4>>2];return new i(U.buffer,c,l)}r=S(r),B(e,{name:r,fromWireType:a,argPackAdvance:z,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0});},Pn=(e,t,r,n,i,a,s,l,c,v,f,h)=>{r=S(r),a=D(i,a),l=D(s,l),v=D(c,v),h=D(f,h),X([e],[t],function(_){_=_[0];var m=new he(r,_.registeredClass,!1,!1,!0,_,n,a,l,v,h);return [m]});},Fn=(e,t)=>{t=S(t);var r=t==="std::string";B(e,{name:t,fromWireType(n){var i=E[n>>2],a=n+4,s;if(r)for(var l=a,c=0;c<=i;++c){var v=a+c;if(c==i||R[v]==0){var f=v-l,h=N(l,f);s===void 0?s=h:(s+="\0",s+=h),l=v+1;}}else {for(var _=new Array(i),c=0;c<i;++c)_[c]=String.fromCharCode(R[a+c]);s=_.join("");}return V(n),s},toWireType(n,i){i instanceof ArrayBuffer&&(i=new Uint8Array(i));var a,s=typeof i=="string";s||i instanceof Uint8Array||i instanceof Uint8ClampedArray||i instanceof Int8Array||b("Cannot pass non-string to std::string"),r&&s?a=_t(i):a=i.length;var l=qe(4+a+1),c=l+4;if(E[l>>2]=a,r&&s)Lr(i,c,a+1);else if(s)for(var v=0;v<a;++v){var f=i.charCodeAt(v);f>255&&(V(c),b("String has UTF-16 code units that do not fit in 8 bits")),R[c+v]=f;}else for(var v=0;v<a;++v)R[c+v]=i[v];return n!==null&&n.push(V,l),l},argPackAdvance:z,readValueFromPointer:Pt,destructorFunction(n){V(n);}});},Rt=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,An=(e,t)=>{for(var r=e,n=r>>1,i=n+t/2;!(n>=i)&&se[n];)++n;if(r=n<<1,r-e>32&&Rt)return Rt.decode(R.subarray(e,r));for(var a="",s=0;!(s>=t/2);++s){var l=te[e+s*2>>1];if(l==0)break;a+=String.fromCharCode(l);}return a},Mn=(e,t,r)=>{if(r??(r=2147483647),r<2)return 0;r-=2;for(var n=t,i=r<e.length*2?r/2:e.length,a=0;a<i;++a){var s=e.charCodeAt(a);te[t>>1]=s,t+=2;}return te[t>>1]=0,t-n},Ln=e=>e.length*2,kn=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var i=j[e+r*4>>2];if(i==0)break;if(++r,i>=65536){var a=i-65536;n+=String.fromCharCode(55296|a>>10,56320|a&1023);}else n+=String.fromCharCode(i);}return n},jn=(e,t,r)=>{if(r??(r=2147483647),r<4)return 0;for(var n=t,i=n+r-4,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343){var l=e.charCodeAt(++a);s=65536+((s&1023)<<10)|l&1023;}if(j[t>>2]=s,t+=4,t+4>i)break}return j[t>>2]=0,t-n},Rn=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4;}return t},Sn=(e,t,r)=>{r=S(r);var n,i,a,s,l;t===2?(n=An,i=Mn,s=Ln,a=()=>se,l=1):t===4&&(n=kn,i=jn,s=Rn,a=()=>E,l=2),B(e,{name:r,fromWireType:c=>{for(var v=E[c>>2],f=a(),h,_=c+4,m=0;m<=v;++m){var A=c+4+m*t;if(m==v||f[A>>l]==0){var x=A-_,P=n(_,x);h===void 0?h=P:(h+="\0",h+=P),_=A+t;}}return V(c),h},toWireType:(c,v)=>{typeof v!="string"&&b(`Cannot pass non-string to C++ string type ${r}`);var f=s(v),h=qe(4+f+t);return E[h>>2]=f>>l,i(v,h+4,f+t),c!==null&&c.push(V,h),h},argPackAdvance:z,readValueFromPointer:De,destructorFunction(c){V(c);}});},xn=(e,t,r,n,i,a)=>{Ce[e]={name:S(t),rawConstructor:D(r,n),rawDestructor:D(i,a),fields:[]};},Dn=(e,t,r,n,i,a,s,l,c,v)=>{Ce[e].fields.push({fieldName:S(t),getterReturnType:r,getter:D(n,i),getterContext:a,setterArgumentType:s,setter:D(l,c),setterContext:v});},In=(e,t)=>{t=S(t),B(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}});},Wn=()=>{throw 1/0},Ye=[],On=(e,t,r,n)=>(e=Ye[e],t=J.toValue(t),e(null,t,r,n)),Un=e=>{var t=Ye.length;return Ye.push(e),t},Hn=(e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=ze(E[t+n*4>>2],"parameter "+n);return r},Bn=Reflect.construct,zn=(e,t,r)=>{var n=[],i=e.toWireType(n,r);return n.length&&(E[t>>2]=J.toHandle(n)),i},Vn=(e,t,r)=>{var n=Hn(e,t),i=n.shift();e--;var a=new Array(e),s=(c,v,f,h)=>{for(var _=0,m=0;m<e;++m)a[m]=n[m].readValueFromPointer(h+_),_+=n[m].argPackAdvance;for(var A=r===1?Bn(v,a):v.apply(c,a),m=0;m<e;++m)n[m].deleteObject?.(a[m]);return zn(i,f,A)},l=`methodCaller<(${n.map(c=>c.name).join(", ")}) => ${i.name}>`;return Un(pe(l,s))},Yn=e=>{e>4&&(W.get(e).refcount+=1);},Nn=e=>{var t=J.toValue(e);xe(t),Be(e);},qn=(e,t)=>{e=ze(e,"_emval_take_value");var r=e.readValueFromPointer(t);return J.toHandle(r)},Gn=()=>{ue("");},St;St=()=>performance.now();var Xn=(e,t,r)=>R.copyWithin(e,t,t+r),Jn=()=>2147483648,Kn=e=>{var t=be.buffer,r=(e-t.byteLength+65535)/65536;try{return be.grow(r),it(),1}catch{}},Zn=e=>{var t=R.length;e>>>=0;var r=Jn();if(e>r)return !1;for(var n=(c,v)=>c+(v-c%v)%v,i=1;i<=4;i*=2){var a=t*(1+.2/i);a=Math.min(a,e+100663296);var s=Math.min(r,n(Math.max(e,a),65536)),l=Kn(s);if(l)return !0}return !1},Ne={},Qn=()=>Qe||"./this.program",_e=()=>{if(!_e.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Qn()};for(var r in Ne)Ne[r]===void 0?delete t[r]:t[r]=Ne[r];var n=[];for(var r in t)n.push(`${r}=${t[r]}`);_e.strings=n;}return _e.strings},ei=(e,t)=>{for(var r=0;r<e.length;++r)U[t++>>0]=e.charCodeAt(r);U[t>>0]=0;},ti=(e,t)=>{var r=0;return _e().forEach((n,i)=>{var a=t+r;E[e+i*4>>2]=a,ei(n,a),r+=n.length+1;}),0},ri=(e,t)=>{var r=_e();E[e>>2]=r.length;var n=0;return r.forEach(i=>n+=i.length+1),E[t>>2]=n,0},ni=e=>52,ii=(e,t,r,n)=>52;function oi(e,t,r,n,i){return 70}var si=[null,[],[]],li=(e,t)=>{var r=si[e];t===0||t===10?((e===1?sr:ee)(vt(r,0)),r.length=0):r.push(t);},ui=(e,t,r,n)=>{for(var i=0,a=0;a<r;a++){var s=E[t>>2],l=E[t+4>>2];t+=8;for(var c=0;c<l;c++)li(e,R[s+c]);i+=l;}return E[n>>2]=i,0},ci=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);ue("initRandomDevice");},xt=e=>(xt=ci())(e),di=(e,t)=>(xt(R.subarray(e,e+t)),0),vi=e=>e,Pe=e=>e%4===0&&(e%100!==0||e%400===0),fi=(e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r},Dt=[31,29,31,30,31,30,31,31,30,31,30,31],It=[31,28,31,30,31,30,31,31,30,31,30,31],pi=(e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=Pe(r.getFullYear()),i=r.getMonth(),a=(n?Dt:It)[i];if(t>a-r.getDate())t-=a-r.getDate()+1,r.setDate(1),i<11?r.setMonth(i+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+t),r}return r};function hi(e,t,r){var n=r>0?r:_t(e)+1,i=new Array(n),a=mt(e,i,0,i.length);return t&&(i.length=a),i}var _i=(e,t)=>{U.set(e,t);},mi=(e,t,r,n)=>{var i=E[n+40>>2],a={tm_sec:j[n>>2],tm_min:j[n+4>>2],tm_hour:j[n+8>>2],tm_mday:j[n+12>>2],tm_mon:j[n+16>>2],tm_year:j[n+20>>2],tm_wday:j[n+24>>2],tm_yday:j[n+28>>2],tm_isdst:j[n+32>>2],tm_gmtoff:j[n+36>>2],tm_zone:i?N(i):""},s=N(r),l={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var c in l)s=s.replace(new RegExp(c,"g"),l[c]);var v=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"];function h(d,p,M){for(var k=typeof d=="number"?d.toString():d||"";k.length<p;)k=M[0]+k;return k}function _(d,p){return h(d,p,"0")}function m(d,p){function M(K){return K<0?-1:K>0?1:0}var k;return (k=M(d.getFullYear()-p.getFullYear()))===0&&(k=M(d.getMonth()-p.getMonth()))===0&&(k=M(d.getDate()-p.getDate())),k}function A(d){switch(d.getDay()){case 0:return new Date(d.getFullYear()-1,11,29);case 1:return d;case 2:return new Date(d.getFullYear(),0,3);case 3:return new Date(d.getFullYear(),0,2);case 4:return new Date(d.getFullYear(),0,1);case 5:return new Date(d.getFullYear()-1,11,31);case 6:return new Date(d.getFullYear()-1,11,30)}}function x(d){var p=pi(new Date(d.tm_year+1900,0,1),d.tm_yday),M=new Date(p.getFullYear(),0,4),k=new Date(p.getFullYear()+1,0,4),K=A(M),Ae=A(k);return m(K,p)<=0?m(Ae,p)<=0?p.getFullYear()+1:p.getFullYear():p.getFullYear()-1}var P={"%a":d=>v[d.tm_wday].substring(0,3),"%A":d=>v[d.tm_wday],"%b":d=>f[d.tm_mon].substring(0,3),"%B":d=>f[d.tm_mon],"%C":d=>{var p=d.tm_year+1900;return _(p/100|0,2)},"%d":d=>_(d.tm_mday,2),"%e":d=>h(d.tm_mday,2," "),"%g":d=>x(d).toString().substring(2),"%G":d=>x(d),"%H":d=>_(d.tm_hour,2),"%I":d=>{var p=d.tm_hour;return p==0?p=12:p>12&&(p-=12),_(p,2)},"%j":d=>_(d.tm_mday+fi(Pe(d.tm_year+1900)?Dt:It,d.tm_mon-1),3),"%m":d=>_(d.tm_mon+1,2),"%M":d=>_(d.tm_min,2),"%n":()=>` | ||
@@ -3,0 +3,0 @@ `,"%p":d=>d.tm_hour>=0&&d.tm_hour<12?"AM":"PM","%S":d=>_(d.tm_sec,2),"%t":()=>" ","%u":d=>d.tm_wday||7,"%U":d=>{var p=d.tm_yday+7-d.tm_wday;return _(Math.floor(p/7),2)},"%V":d=>{var p=Math.floor((d.tm_yday+7-(d.tm_wday+6)%7)/7);if((d.tm_wday+371-d.tm_yday-2)%7<=2&&p++,p){if(p==53){var k=(d.tm_wday+371-d.tm_yday)%7;k!=4&&(k!=3||!Pe(d.tm_year))&&(p=1);}}else {p=52;var M=(d.tm_wday+7-d.tm_yday-1)%7;(M==4||M==5&&Pe(d.tm_year%400-1))&&p++;}return _(p,2)},"%w":d=>d.tm_wday,"%W":d=>{var p=d.tm_yday+7-(d.tm_wday+6)%7;return _(Math.floor(p/7),2)},"%y":d=>(d.tm_year+1900).toString().substring(2),"%Y":d=>d.tm_year+1900,"%z":d=>{var p=d.tm_gmtoff,M=p>=0;return p=Math.abs(p)/60,p=p/60*100+p%60,(M?"+":"-")+("0000"+p).slice(-4)},"%Z":d=>d.tm_zone,"%%":()=>"%"};s=s.replace(/%%/g,"\0\0");for(var c in P)s.includes(c)&&(s=s.replace(new RegExp(c,"g"),P[c](a)));s=s.replace(/\0\0/g,"%");var I=hi(s,!1);return I.length>t?0:(_i(I,e),I.length-1)},yi=(e,t,r,n,i)=>mi(e,t,r,n);yt=o.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError";}},Dr(),ae=o.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError";}},Gr(),Vr(),rn(),At=o.UnboundTypeError=ln(Error,"UnboundTypeError"),pn(),_n();var gi={m:wr,qa:Tr,pa:Er,a:Pr,f:Fr,v:Ar,d:$r,I:Mr,ea:kr,ga:jr,ha:Rr,wa:Sr,T:xr,na:Wr,P:un,O:dn,q:fn,ma:mn,Y:gn,A:bn,K:wn,s:En,p:$n,va:Pn,L:Fn,F:Sn,Q:xn,z:Dn,oa:In,ba:Wn,ua:On,la:Be,ta:Vn,G:Yn,sa:Nn,E:qn,N:Gn,w:St,ia:Xn,da:Zn,ja:ti,ka:ri,J:ni,fa:ii,S:oi,D:ui,ra:di,u:Ni,C:Ri,H:zi,h:Ui,x:Bi,g:Yi,k:Wi,n:Hi,r:Oi,M:Ji,aa:Ki,Z:ea,l:ji,b:Si,t:qi,y:Xi,c:xi,e:Ii,o:Gi,i:Vi,B:Di,R:aa,V:na,W:ra,U:ia,X:ta,_:Qi,$:Zi,j:vi,ca:yi},y=Cr(),qe=e=>(qe=y.za)(e),V=e=>(V=y.Ba)(e),Wt=e=>(Wt=y.Ca)(e),C=(e,t)=>(C=y.Da)(e,t),me=e=>(me=y.Ea)(e),w=()=>(w=y.Fa)(),T=e=>(T=y.Ga)(e),Ot=e=>(Ot=y.Ha)(e),Ut=e=>(Ut=y.Ia)(e),Ht=(e,t,r)=>(Ht=y.Ja)(e,t,r),Bt=e=>(Bt=y.Ka)(e),zt=o.dynCall_ji=(e,t)=>(zt=o.dynCall_ji=y.La)(e,t);o.dynCall_iijj=(e,t,r,n,i,a)=>(o.dynCall_iijj=y.Ma)(e,t,r,n,i,a);o.dynCall_vijj=(e,t,r,n,i,a)=>(o.dynCall_vijj=y.Na)(e,t,r,n,i,a);var Vt=o.dynCall_vijiji=(e,t,r,n,i,a,s,l)=>(Vt=o.dynCall_vijiji=y.Oa)(e,t,r,n,i,a,s,l),Yt=o.dynCall_vij=(e,t,r,n)=>(Yt=o.dynCall_vij=y.Pa)(e,t,r,n),Nt=o.dynCall_jii=(e,t,r)=>(Nt=o.dynCall_jii=y.Qa)(e,t,r),qt=o.dynCall_viijj=(e,t,r,n,i,a,s)=>(qt=o.dynCall_viijj=y.Ra)(e,t,r,n,i,a,s),Gt=o.dynCall_viij=(e,t,r,n,i)=>(Gt=o.dynCall_viij=y.Sa)(e,t,r,n,i),Xt=o.dynCall_viiiji=(e,t,r,n,i,a,s)=>(Xt=o.dynCall_viiiji=y.Ta)(e,t,r,n,i,a,s),Jt=o.dynCall_viiji=(e,t,r,n,i,a)=>(Jt=o.dynCall_viiji=y.Ua)(e,t,r,n,i,a),Kt=o.dynCall_viiij=(e,t,r,n,i,a)=>(Kt=o.dynCall_viiij=y.Va)(e,t,r,n,i,a);o.dynCall_jiji=(e,t,r,n,i)=>(o.dynCall_jiji=y.Wa)(e,t,r,n,i);o.dynCall_viijii=(e,t,r,n,i,a,s)=>(o.dynCall_viijii=y.Xa)(e,t,r,n,i,a,s);o.dynCall_iiiiij=(e,t,r,n,i,a,s)=>(o.dynCall_iiiiij=y.Ya)(e,t,r,n,i,a,s);o.dynCall_iiiiijj=(e,t,r,n,i,a,s,l,c)=>(o.dynCall_iiiiijj=y.Za)(e,t,r,n,i,a,s,l,c);o.dynCall_iiiiiijj=(e,t,r,n,i,a,s,l,c,v)=>(o.dynCall_iiiiiijj=y._a)(e,t,r,n,i,a,s,l,c,v);function ji(e){var t=w();try{F(e)();}catch(r){if(T(t),r!==r+0)throw r;C(1,0);}}function Ri(e,t){var r=w();try{return F(e)(t)}catch(n){if(T(r),n!==n+0)throw n;C(1,0);}}function Si(e,t){var r=w();try{F(e)(t);}catch(n){if(T(r),n!==n+0)throw n;C(1,0);}}function xi(e,t,r){var n=w();try{F(e)(t,r);}catch(i){if(T(n),i!==i+0)throw i;C(1,0);}}function Di(e,t,r,n,i,a,s){var l=w();try{F(e)(t,r,n,i,a,s);}catch(c){if(T(l),c!==c+0)throw c;C(1,0);}}function Ii(e,t,r,n){var i=w();try{F(e)(t,r,n);}catch(a){if(T(i),a!==a+0)throw a;C(1,0);}}function Wi(e,t,r,n){var i=w();try{return F(e)(t,r,n)}catch(a){if(T(i),a!==a+0)throw a;C(1,0);}}function Oi(e,t,r,n,i,a){var s=w();try{return F(e)(t,r,n,i,a)}catch(l){if(T(s),l!==l+0)throw l;C(1,0);}}function Ui(e,t){var r=w();try{return F(e)(t)}catch(n){if(T(r),n!==n+0)throw n;C(1,0);}}function Hi(e,t,r,n,i){var a=w();try{return F(e)(t,r,n,i)}catch(s){if(T(a),s!==s+0)throw s;C(1,0);}}function Bi(e,t,r){var n=w();try{return F(e)(t,r)}catch(i){if(T(n),i!==i+0)throw i;C(1,0);}}function zi(e){var t=w();try{return F(e)()}catch(r){if(T(t),r!==r+0)throw r;C(1,0);}}function Vi(e,t,r,n,i,a){var s=w();try{F(e)(t,r,n,i,a);}catch(l){if(T(s),l!==l+0)throw l;C(1,0);}}function Yi(e,t,r){var n=w();try{return F(e)(t,r)}catch(i){if(T(n),i!==i+0)throw i;C(1,0);}}function Ni(e){var t=w();try{return F(e)()}catch(r){if(T(t),r!==r+0)throw r;C(1,0);}}function qi(e,t,r){var n=w();try{F(e)(t,r);}catch(i){if(T(n),i!==i+0)throw i;C(1,0);}}function Gi(e,t,r,n,i){var a=w();try{F(e)(t,r,n,i);}catch(s){if(T(a),s!==s+0)throw s;C(1,0);}}function Xi(e,t,r){var n=w();try{F(e)(t,r);}catch(i){if(T(n),i!==i+0)throw i;C(1,0);}}function Ji(e,t,r,n,i,a,s,l){var c=w();try{return F(e)(t,r,n,i,a,s,l)}catch(v){if(T(c),v!==v+0)throw v;C(1,0);}}function Ki(e,t){var r=w();try{return zt(e,t)}catch(n){if(T(r),n!==n+0)throw n;C(1,0);}}function Zi(e,t,r,n,i,a,s,l){var c=w();try{Vt(e,t,r,n,i,a,s,l);}catch(v){if(T(c),v!==v+0)throw v;C(1,0);}}function Qi(e,t,r,n){var i=w();try{Yt(e,t,r,n);}catch(a){if(T(i),a!==a+0)throw a;C(1,0);}}function ea(e,t,r){var n=w();try{return Nt(e,t,r)}catch(i){if(T(n),i!==i+0)throw i;C(1,0);}}function ta(e,t,r,n,i,a,s){var l=w();try{qt(e,t,r,n,i,a,s);}catch(c){if(T(l),c!==c+0)throw c;C(1,0);}}function ra(e,t,r,n,i){var a=w();try{Gt(e,t,r,n,i);}catch(s){if(T(a),s!==s+0)throw s;C(1,0);}}function na(e,t,r,n,i,a,s){var l=w();try{Xt(e,t,r,n,i,a,s);}catch(c){if(T(l),c!==c+0)throw c;C(1,0);}}function ia(e,t,r,n,i,a){var s=w();try{Jt(e,t,r,n,i,a);}catch(l){if(T(s),l!==l+0)throw l;C(1,0);}}function aa(e,t,r,n,i,a){var s=w();try{Kt(e,t,r,n,i,a);}catch(l){if(T(s),l!==l+0)throw l;C(1,0);}}var Fe;le=function e(){Fe||Zt(),Fe||(le=e);};function Zt(){if(Y>0||(cr(),Y>0))return;function e(){Fe||(Fe=!0,o.calledRun=!0,!tt&&(dr(),g(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),vr()));}o.setStatus?(o.setStatus("Running..."),setTimeout(function(){setTimeout(function(){o.setStatus("");},1),e();},1)):e();}if(o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return Zt(),u.ready}})(),er=ua;var Z=class{constructor(){throw new Error("RendererLoader is a static class and cannot be instantiated.")}static async _tryLoad(u){return await er({locateFile:()=>u})}static async _loadWithBackup(){return this._ModulePromise||(this._ModulePromise=this._tryLoad(this._wasmURL).catch(async u=>{let o=`https://unpkg.com/${ye.name}@${ye.version}/dist/dotlottie-player.wasm`;console.warn(`Trying backup URL for WASM loading: ${o}`);try{return await this._tryLoad(o)}catch(g){throw console.error(`Both primary and backup WASM URLs failed. Primary error: ${u.message}, Backup error: ${g.message}`),new Error("WASM loading failed from all sources.")}})),this._ModulePromise}static async load(){return this._loadWithBackup()}static setWasmUrl(u){this._wasmURL=u,this._ModulePromise=null;}};L(Z,"_ModulePromise",null),L(Z,"_wasmURL",`https://cdn.jsdelivr.net/npm/${ye.name}@${ye.version}/dist/dotlottie-player.wasm`);var Le=class{constructor(){L(this,"_eventListeners",new Map);}addEventListener(u,o){let g=this._eventListeners.get(u);g||(g=new Set,this._eventListeners.set(u,g)),g.add(o);}removeEventListener(u,o){let g=this._eventListeners.get(u);g&&(o?(g.delete(o),g.size===0&&this._eventListeners.delete(u)):this._eventListeners.delete(u));}dispatch(u){this._eventListeners.get(u.type)?.forEach(g=>g(u));}removeAllEventListeners(){this._eventListeners.clear();}};var Ke=($,u)=>$==="reverse"?u.Mode.Reverse:$==="bounce"?u.Mode.Bounce:$==="reverse-bounce"?u.Mode.ReverseBounce:u.Mode.Forward,Ze=($,u)=>{let o=new u.VectorFloat;return $.length!==2||(o.push_back($[0]),o.push_back($[1])),o},tr=class{constructor(u){L(this,"_canvas");L(this,"_context");L(this,"_eventManager");L(this,"_animationFrameId",null);L(this,"_frameManager");L(this,"_dotLottieCore",null);L(this,"_wasmModule",null);L(this,"_renderConfig",{});L(this,"_isFrozen",!1);L(this,"_backgroundColor",null);this._canvas=u.canvas,this._context=this._canvas.getContext("2d"),this._eventManager=new Le,this._frameManager=new Me,this._renderConfig=u.renderConfig??{},Z.load().then(o=>{this._wasmModule=o,this._dotLottieCore=new o.DotLottiePlayer({autoplay:u.autoplay??!1,backgroundColor:0,loopAnimation:u.loop??!1,mode:Ke(u.mode??"forward",o),segments:Ze(u.segments??[],o),speed:u.speed??1,useFrameInterpolation:u.useFrameInterpolation??!0}),u.data?this._loadFromData(u.data):u.src&&this._loadFromSrc(u.src),u.backgroundColor&&this.setBackgroundColor(u.backgroundColor);}).catch(o=>{this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load wasm module: ${o}`)});});}_loadFromSrc(u){async function o(){let g=await fetch(u);if(!g.ok)throw new Error(`Failed to fetch the animation data from URL: ${u}. ${g.status}: ${g.statusText}`);let O=g.headers.get("content-type"),Q;return O?.includes("application/json")?Q=await g.text():Q=await g.arrayBuffer(),Q}o().then(g=>{this._loadFromData(g);}).catch(g=>{this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load animation data from URL: ${u}. ${g}`)});});}_loadFromData(u){if(this._dotLottieCore!==null)try{let o=this._canvas.width,g=this._canvas.height,O=!1;if(this._dotLottieCore.clear(),typeof u=="string")O=this._dotLottieCore.loadAnimationData(u,o,g);else if(u instanceof ArrayBuffer)O=this._dotLottieCore.loadDotLottieData(u,o,g);else {this._eventManager.dispatch({type:"loadError",error:new Error("Unsupported data type for animation data. Expected a string or ArrayBuffer.")});return}O?(this._eventManager.dispatch({type:"load"}),Je&&this.resize(),this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render(),this._dotLottieCore.config().autoplay&&(this._dotLottieCore.play(),this._dotLottieCore.isPlaying()?(this._eventManager.dispatch({type:"play"}),this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this))):console.error("something went wrong, the animation was suppose to autoplay"))):this._eventManager.dispatch({type:"loadError",error:new Error("Failed to load animation data")});}catch(o){this._eventManager.dispatch({type:"loadError",error:o});}}get renderConfig(){return this._renderConfig}get segments(){let u=this._dotLottieCore?.config().segments;if(u&&u.size()===2)return [u.get(0),u.get(1)]}get loop(){return this._dotLottieCore?.config().loopAnimation??!1}get mode(){let u=this._dotLottieCore?.config().mode;return u===this._wasmModule?.Mode.Reverse?"reverse":u===this._wasmModule?.Mode.Bounce?"bounce":u===this._wasmModule?.Mode.ReverseBounce?"reverse-bounce":"forward"}get isFrozen(){return this._isFrozen}get backgroundColor(){return this._backgroundColor??""}get autoplay(){return this._dotLottieCore?.config().autoplay??!1}get useFrameInterpolation(){return this._dotLottieCore?.config().useFrameInterpolation??!1}get speed(){return this._dotLottieCore?.config().speed??0}get isLoaded(){return this._dotLottieCore?.isLoaded()??!1}get isPlaying(){return this._dotLottieCore?.isPlaying()??!1}get isPaused(){return this._dotLottieCore?.isPaused()??!1}get isStopped(){return this._dotLottieCore?.isStopped()??!1}get currentFrame(){return this._dotLottieCore?.currentFrame()??0}get loopCount(){return this._dotLottieCore?.loopCount()??0}get totalFrames(){return this._dotLottieCore?.totalFrames()??0}get duration(){return this._dotLottieCore?.duration()??0}load(u){this._dotLottieCore===null||this._wasmModule===null||(this._dotLottieCore.setConfig({autoplay:u.autoplay??!1,backgroundColor:0,loopAnimation:u.loop??!1,mode:Ke(u.mode??"forward",this._wasmModule),segments:Ze(u.segments??[],this._wasmModule),speed:u.speed??1,useFrameInterpolation:u.useFrameInterpolation??!0}),u.data?this._loadFromData(u.data):u.src&&this._loadFromSrc(u.src),this.setBackgroundColor(u.backgroundColor??""));}_render(){if(this._dotLottieCore===null||this._context===null)return !1;if(this._dotLottieCore.render()){let o=this._dotLottieCore.buffer(),g=this._context.createImageData(this._canvas.width,this._canvas.height);return g.data.set(o),this._context.putImageData(g,0,0),this._eventManager.dispatch({type:"render",currentFrame:this._dotLottieCore.currentFrame()}),!0}return !1}_draw(){if(this._dotLottieCore===null||this._context===null||!this._dotLottieCore.isPlaying())return;let u=this._dotLottieCore.requestFrame();this._dotLottieCore.setFrame(u)&&(this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render()&&this._dotLottieCore.isComplete()&&(this._dotLottieCore.config().loopAnimation?this._eventManager.dispatch({type:"loop",loopCount:this._dotLottieCore.loopCount()}):this._eventManager.dispatch({type:"complete"}))),this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this));}play(){if(this._dotLottieCore===null)return;let u=this._dotLottieCore.play();this._isFrozen=!1,u&&(this._eventManager.dispatch({type:"play"}),this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this)));}pause(){if(this._dotLottieCore===null)return;this._dotLottieCore.pause()&&this._eventManager.dispatch({type:"pause"});}stop(){if(this._dotLottieCore===null)return;this._dotLottieCore.stop()&&(this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render(),this._eventManager.dispatch({type:"stop"}));}setFrame(u){if(this._dotLottieCore===null||u<0||u>this._dotLottieCore.totalFrames())return;this._dotLottieCore.seek(u)&&(this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render());}setSpeed(u){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),speed:u});}setBackgroundColor(u){this._dotLottieCore!==null&&(this._canvas instanceof HTMLCanvasElement&&(this._canvas.style.backgroundColor=u),this._backgroundColor=u);}setLoop(u){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),loopAnimation:u});}setUseFrameInterpolation(u){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),useFrameInterpolation:u});}addEventListener(u,o){this._eventManager.addEventListener(u,o);}removeEventListener(u,o){this._eventManager.removeEventListener(u,o);}destroy(){this._dotLottieCore?.delete(),this._dotLottieCore=null,this._context=null,this._eventManager.dispatch({type:"destroy"}),this._eventManager.removeAllEventListeners();}freeze(){this._animationFrameId!==null&&(this._frameManager.cancelAnimationFrame(this._animationFrameId),this._animationFrameId=null,this._isFrozen=!0,this._eventManager.dispatch({type:"freeze"}));}unfreeze(){this._animationFrameId===null&&(this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this)),this._isFrozen=!1,this._eventManager.dispatch({type:"unfreeze"}));}resize(){if(!Je)return;let u=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,{height:o,width:g}=this._canvas.getBoundingClientRect();this._canvas.width=g*u,this._canvas.height=o*u,this._dotLottieCore?.resize(this._canvas.width,this._canvas.height)&&this._render();}setSegments(u,o){this._dotLottieCore===null||this._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),segments:Ze([u,o],this._wasmModule)});}setMode(u){this._dotLottieCore===null||this._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),mode:Ke(u,this._wasmModule)});}setRenderConfig(u){this._renderConfig=u;}static setWasmUrl(u){Z.setWasmUrl(u);}}; |
{ | ||
"name": "@lottiefiles/dotlottie-web", | ||
"version": "0.13.0-beta.1", | ||
"version": "0.13.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "Lottie and DotLottie player for the web", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1388791