PageSourceSearch

https://www.maestro.io/static/js/chunks/rive.c7c0813.js

js maestro.io collected 2026-09-24 18:24:40 UTC 198,551 bytes, 6 lines download raw bytes

1(function(){try{var St=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},vn=new St.Error().stack;vn&&(St._sentryDebugIds=St._sentryDebugIds||{},St._sentryDebugIds[vn]="6ad513aa-f051-43db-8437-b454b488d1d5",St._sentryDebugIdIdentifier="sentry-dbid-6ad513aa-f051-43db-8437-b454b488d1d5")}catch{}})();var _global=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};_global.SENTRY_RELEASE={id:"6b3b5bcd49ac3ca4e22832378da81add8169a867"},(self.webpackChunk_maestro_io_client=self.webpackChunk_maestro_io_client||[]).push([[8779],{557071:function(St,vn,Bn){var J=Bn(80247);(function(pn,Ke){St.exports=Ke()})(this,()=>(()=>{"use strict";var Dn=[,(we,Q,j)=>{j.r(Q),j.d(Q,{Animation:()=>p.Animation});var p=j(2)},(we,Q,j)=>{j.r(Q),j.d(Q,{Animation:()=>p});var p=function(){function Z(W,O,w,h){this.animation=W,this.artboard=O,this.playing=h,this.loopCount=0,this.scrubTo=null,this.instance=new w.LinearAnimationInstance(W,O)}return Object.defineProperty(Z.prototype,"name",{get:function(){return this.animation.name},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"time",{get:function(){return this.instance.time},set:function(W){this.instance.time=W},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"loopValue",{get:function(){return this.animation.loopValue},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"needsScrub",{get:function(){return this.scrubTo!==null},enumerable:!1,configurable:!0}),Z.prototype.advance=function(W){this.scrubTo===null?this.instance.advance(W):(this.instance.time=0,this.instance.advance(this.scrubTo),this.scrubTo=null)},Z.prototype.apply=function(W){this.instance.apply(W)},Z.prototype.cleanup=function(){this.instance.delete()},Z}()},(we,Q,j)=>{j.r(Q),j.d(Q,{RuntimeLoader:()=>O});var p=j(4),Z=j(5),W=function(){return W=Object.assign||function(w){for(var h,$=1,ie=arguments.length;$<ie;$++){h=arguments[$];for(var L in h)Object.prototype.hasOwnProperty.call(h,L)&&(w[L]=h[L])}return w},W.apply(this,arguments)},O=function(){function w(){}return w.notifyError=function(h){var $;for(w.isLoading=!1;w.errorCallbackQueue.length>0;)($=w.errorCallbackQueue.shift())===null||$===void 0||$(h);w.callBackQueue=[]},w.loadRuntime=function(){var h=w.wasmURL,$=w.wasmBinary;w.enablePerfMarks&&performance.mark("rive:wasm-init:start"),p.default(W({locateFile:function(){return h}},$?{wasmBinary:$}:{})).then(function(ie){var L;for(w.enablePerfMarks&&(performance.mark("rive:wasm-init:end"),performance.measure("rive:wasm-init","rive:wasm-init:start","rive:wasm-init:end")),w.runtime=ie,w.errorCallbackQueue=[];w.callBackQueue.length>0;)(L=w.callBackQueue.shift())===null||L===void 0||L(w.runtime)}).catch(function(ie){var L={message:ie?.message||"Unknown error",type:ie?.name||"Error",wasmError:ie instanceof WebAssembly.CompileError||ie instanceof WebAssembly.RuntimeError,originalError:ie};
1J.debug("Rive WASM load error details:",L);var te=w.wasmFallbackURL,C=te!==null&&h.toLowerCase()===te.toLowerCase();if(te!==null&&!C)J.warn("Failed to load WASM from ".concat(h," (").concat(L.message,"), trying fallback URL: ").concat(te)),w.wasmBinary=null,w.setWasmUrl(te),w.loadRuntime();else{var M=C?"the configured WASM URL or its fallback (".concat(te,")"):h,T=["Could not load Rive WASM file from ".concat(M,"."),"Possible reasons:","- Network connection is down","- WebAssembly is not supported in this environment","- The WASM file is corrupted or incompatible",`
2Error details:`,"- Type: ".concat(L.type),"- Message: ".concat(L.message),"- WebAssembly-specific error: ".concat(L.wasmError),`
3To resolve, you may need to:`,"1. Check your network connection","2. Set a new WASM source via RuntimeLoader.setWasmUrl()","3. Call RuntimeLoader.awaitInstance() again"].join(`
4`);J.error(T),w.notifyError(new Error(T))}})},w.getInstance=function(h,$){w.isLoading||(w.isLoading=!0,w.loadRuntime()),w.runtime?h(w.runtime):(w.callBackQueue.push(h),$&&w.errorCallbackQueue.push($))},w.awaitInstance=function(){return new Promise(function(h,$){return w.getInstance(h,$)})},w.setWasmUrl=function(h){w.wasmURL=h},w.getWasmUrl=function(){return w.wasmURL},w.setWasmFallbackUrl=function(h){w.wasmFallbackURL=h},w.getWasmFallbackUrl=function(){return w.wasmFallbackURL},w.setWasmBinary=function(h){if(h instanceof ArrayBuffer||h===null){w.wasmBinary=h;return}J.error("setWasmBinary expects an ArrayBuffer or null")},w.getWasmBinary=function(){return w.wasmBinary},w.isLoading=!1,w.callBackQueue=[],w.wasmURL="https://unpkg.com/".concat(Z.name,"@").concat(Z.version,"/rive.wasm"),w.wasmFallbackURL="https://cdn.jsdelivr.net/npm/".concat(Z.name,"@").concat(Z.version,"/rive_fallback.wasm"),w.wasmBinary=null,w.errorCallbackQueue=[],w.enablePerfMarks=!1,w}()},(we,Q,j)=>{j.r(Q),j.d(Q,{default:()=>Z});var p=(()=>{var W=globalThis.document?.currentScript?.src;return async function(O={}){var w,h=O,$=!!globalThis.window,ie=!!globalThis.WorkerGlobalScope;function L(){function e(c){const f=a;r=t=0,a=new Map,f.forEach(b=>{try{b(c)}catch(F){J.error(F)}}),this.ue(),s&&s.Xe()}let t=0,r=0,a=new Map,s=null,l=null;this.requestAnimationFrame=function(c){t||=requestAnimationFrame(e.bind(this));const f=++r;return a.set(f,c),f},this.cancelAnimationFrame=function(c){a.delete(c),t&&a.size==0&&(cancelAnimationFrame(t),t=0)},this.Te=function(c){l&&(document.body.remove(l),l=null),c||(l=document.createElement("div"),l.style.backgroundColor="black",l.style.position="fixed",l.style.right=0,l.style.top=0,l.style.color="white",l.style.padding="4px",l.innerHTML="RIVE FPS",c=function(f){l.innerHTML="RIVE FPS "+f.toFixed(1)},document.body.appendChild(l)),s=new function(){let f=0,b=0;this.Xe=function(){var F=performance.now();b?(++f,F-=b,1e3<F&&(c(1e3*f/F),f=b=0)):(b=F,f=0)}}},this.ue=function(){}}function te(){J.assert(!0);const e=new Map;let t=-1/0;this.push=function(r){return r=r+255>>8,e.has(r)&&clearTimeout(e.get(r)),e.set(r,setTimeout(function(){e.delete(r),e.length==0?t=-1/0:r==t&&(t=Math.max(...e.keys()),J.assert(t<r))},1e3)),t=Math.max(r,t),t<<8}}const C=h.onRuntimeInitialized;h.onRuntimeInitialized=function(){C&&C();let e=h.decodeAudio;h.decodeAudio=function(c,f,b=null){c=e(c,b??null),f(c)};let t=h.decodeFont;h.decodeFont=function(c,f,b=null){c=t(c,b??null),f(c)};const r=h.FileAsset.prototype.decode;h.FileAsset.prototype.decode=function(c,f){return r.call(this,c,f??null)};let a=h.setFallbackFontCb;h.setFallbackFontCallback=typeof a=="function"?function(c){a(c)}:function(){J.warn("Module.setFallbackFontCallback called, but text support is not enabled in this build.")};const s=h.FileAssetLoader;h.ptrToAsset=c=>{let f=h.ptrToFileAsset(c);return f.isImage?h.ptrToImageAsset(c):f.isFont?h.ptrToFontAsset(c):f.isAudio?h.ptrToAudioAsset(c):f},h.CustomFileAssetLoader=s.extend("CustomFileAssetLoader",{__construct:function({loadContents:c}){this.__parent.__construct.call(this),this.Ie=c},loadContents:function(c,f){return c=h.ptrToAsset(c),this.Ie(c,f)}}),h.CDNFileAssetLoader=s.extend("CDNFileAssetLoader",{__construct:function(c){this.__parent.__construct.call(this),this.Le=c??null},loadContents:function(c){let f=h.ptrToAsset(c);if(c=f.cdnUuid,c==="")return!1;const b=this.Le??null;return function(F,B){var X=new XMLHttpRequest;X.responseType="arraybuffer",X.onreadystatechange=function(){X.readyState==4&&X.status==200&&B(X)},X.open("GET",F,!0),X.send(null)}(f.cdnBaseUrl+"/"+c,F=>{f.decode(new Uint8Array(F.response),b)}),!0}}),h.FallbackFileAssetLoader=s.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.pe=[]},addLoader:function(c){this.pe.push(c)},loadContents:function(c,f){for(let b of this.pe)if(b.loadContents(c,f))return!0;return!1}});let l=h.computeAlignment;h.computeAlignment=function(c,f,b,F,B=1){return l.call(this,c,f,b,F,B)}};const M=h.onRuntimeInitialized;h.onRuntimeInitialized=function(){function e(V){this.Uc=V,this.He=V.getContext("2d"),this.je=a,this.fd=[],this.xd=0,this.clear=function(){J.assert(this.xd==0),this.fd=[],s.delete(this)},this.save=function(){++this.xd,this.fd.push(a.save.bind(a))},this.restore=function(){0<this.xd&&(this.fd.push(a.restore.bind(a)),--this.xd)},this.transform=function(H){this.fd.push(a.transform.bind(a,H))},this.align=function(H,ne,oe,ue,Fe=1){this.fd.push(a.align.bind(a,H,ne,oe,ue,Fe))},this.flush=function(){J.assert(this.xd==0),s.add(this),a.ie||r()},this.bindContext=function(){const H=this.je;H&&H.pd&&Kt(H.pd)},this.delete=function(){}}function t(V,H=!1){var ne={alpha:!0,depth:H,stencil:H,antialias:H,premultipliedAlpha:!0,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:!1,explicitSwapControl:0,renderViaOffscreenBackBuffer:0};if(H=V.getContext("webgl2",ne),!H)return null;
4ne=Tr(H,ne),Kt(ne);const oe=l(V.width,V.height);oe.pd=ne,oe.Uc=V,oe.Xd=V.width,oe.Wd=V.height,oe.gd=H,oe.Ne=function(){this.pd&&Kt(this.pd)};var ue=oe.delete;return oe.delete=function(){this.Ne(),ue.call(this);var Fe=this.pd;pt===He[Fe]&&(pt=null),typeof JSEvents=="object"&&JSEvents.Tf(He[Fe].Tc.canvas),He[Fe]?.Tc.canvas&&(He[Fe].Tc.canvas.Ge=void 0),this.pd=this.Uc=this.Xd=this.Wd=this.gd=He[Fe]=null},oe}function r(){if(a){var V=a.Ke,H=0,ne=0,oe=0,ue=Array(s.size),Fe=0;for(var Pe of s)Pe.td=Math.min(Pe.Uc.width,V),Pe.sd=Math.min(Pe.Uc.height,V),Pe.Ud=Pe.sd*Pe.td,H=Math.max(H,Pe.td),ne=Math.max(ne,Pe.sd),oe+=Pe.Ud,ue[Fe++]=Pe;if(s.clear(),!(0>=oe)){for(H=1<<(0>=H?0:32-Math.clz32(H-1)),ne=1<<(0>=ne?0:32-Math.clz32(ne-1));ne*H<oe;)H<=ne?H*=2:ne*=2;for(H=Math.min(H,V),H=Math.min(ne,V),ue.sort((bt,kn)=>kn.Ud-bt.Ud),oe=new h.DynamicRectanizer(V),Pe=0;Pe<ue.length;){for(oe.reset(H,ne),Fe=Pe;Fe<ue.length;++Fe){var Le=ue[Fe],Me=oe.addRect(Le.td,Le.sd);if(0>Me){J.assert(Fe>Pe);break}Le.Fd=Me&65535,Le.Gd=Me>>16}for(Le=b.push(oe.drawWidth()),Me=F.push(oe.drawHeight()),J.assert(Le>=oe.drawWidth()),J.assert(Me>=oe.drawHeight()),J.assert(Le<=V),J.assert(Me<=V),a.Uc.width!=Le&&(a.Uc.width=Le),a.Uc.height!=Me&&(a.Uc.height=Me),a.clear(),Le=Pe;Le<Fe;++Le){Me=ue[Le],a.saveClipRect(Me.Fd,Me.Gd,Me.Fd+Me.td,Me.Gd+Me.sd);let bt=new h.Mat2D;bt.xx=Me.td/Me.Uc.width,bt.yy=Me.sd/Me.Uc.height,bt.xy=bt.yx=0,bt.tx=Me.Fd,bt.ty=Me.Gd,a.transform(bt);for(const kn of Me.fd)kn();a.restoreClipRect(),Me.fd=[]}for(a.flush();Pe<Fe;++Pe)Le=ue[Pe],Me=Le.He,Me.globalCompositeOperation="copy",Me.drawImage(a.Uc,Le.Fd,Le.Gd,Le.td,Le.sd,0,0,Le.Uc.width,Le.Uc.height);Pe=Fe}}}}M&&M();let a=null;const s=new Set,l=h.makeRenderer;h.makeRenderer=function(V,H){if(!a){let ne=function(oe){var ue=document.createElement("canvas");return ue.width=1,ue.height=1,a=t(ue,oe),a?(a.ie=!!a.gd.getExtension("WEBGL_shader_pixel_local_storage"),a.Ke=Math.min(a.gd.getParameter(a.gd.MAX_RENDERBUFFER_SIZE),a.gd.getParameter(a.gd.MAX_TEXTURE_SIZE)),a.Vd=!a.ie,(oe=a.gd.getExtension("WEBGL_debug_renderer_info"))&&(ue=a.gd.getParameter(oe.UNMASKED_RENDERER_WEBGL),a.gd.getParameter(oe.UNMASKED_VENDOR_WEBGL).includes("Google")&&ue.includes("ANGLE Metal Renderer")&&(a.Vd=!1)),a):null};if(a=ne(!0),!a)throw"Unable to create WebGL context, your environment may not support WebGL. Try out @rive-app/canvas as an alternative.";a.Vd||(a=ne(!1))}return H?new e(V):t(V,a.Vd)};const c=h.Artboard.prototype.delete;h.Artboard.prototype.delete=function(){this.Me=!0,c.call(this)};const f=h.Artboard.prototype.draw;h.Artboard.prototype.draw=function(V){V.fd?V.fd.push(()=>{this.Me||f.call(this,V.je)}):f.call(this,V)};const b=new te,F=new te,B=new L;h.requestAnimationFrame=B.requestAnimationFrame.bind(B),h.cancelAnimationFrame=B.cancelAnimationFrame.bind(B),h.enableFPSCounter=B.Te.bind(B),B.ue=r,h.resolveAnimationFrame=r;let X=h.load;h.load=function(V,H,ne=!0,oe=null){const ue=new h.FallbackFileAssetLoader;return H!==void 0&&ue.addLoader(H),ne&&(H=new h.CDNFileAssetLoader(oe),ue.addLoader(H)),Promise.resolve(X(V,ue,oe??null))};const G=h.WebGL2Renderer.prototype.clear;h.WebGL2Renderer.prototype.clear=function(){Kt(this.pd);const V=this.Uc;(this.Xd!=V.width||this.Wd!=V.height)&&(this.resize(V.width,V.height),this.Xd=V.width,this.Wd=V.height),G.call(this)},h.decodeImage=function(V,H,ne=null){V=h.decodeWebGL2Image(V,ne??null),H(V)};let ge=h.Renderer.prototype.align;h.Renderer.prototype.align=function(V,H,ne,oe,ue=1){ge.call(this,V,H,ne,oe,ue)}};var T="./this.program";ie&&(W=self.location.href);var K="",q,fe;if($||ie){try{K=new URL(".",W).href}catch{}ie&&(fe=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),q=async e=>{if(E(e))return new Promise((r,a)=>{var s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="arraybuffer",s.onload=()=>{s.status==200||s.status==0&&s.response?r(s.response):a(s.status)},s.onerror=a,s.send(null)});var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw Error(t.status+" : "+t.url)}}var k=J.log.bind(J),D=J.error.bind(J),Y,ae=!1,E=e=>e.startsWith("file://"),v,A,S,R,I,P,g,x,ee,re,se,pe,ye=!1;function _e(){var e=xt.buffer;h.HEAP8=S=new Int8Array(e),I=new Int16Array(e),h.HEAPU8=R=new Uint8Array(e),h.HEAPU16=P=new Uint16Array(e),h.HEAP32=g=ne
4w Int32Array(e),h.HEAPU32=x=new Uint32Array(e),h.HEAPF32=ee=new Float32Array(e),re=new Float64Array(e),se=new BigInt64Array(e),pe=new BigUint64Array(e)}function me(e){throw h.onAbort?.(e),e="Aborted("+e+")",D(e),ae=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),A?.(e),e}var Ee;async function ke(e){if(!Y)try{var t=await q(e);return new Uint8Array(t)}catch{}if(e==Ee&&Y)e=new Uint8Array(Y);else if(fe)e=fe(e);else throw"both async and sync fetching of the wasm failed";return e}async function Se(e,t){try{var r=await ke(e);return await WebAssembly.instantiate(r,t)}catch(a){D(`failed to asynchronously prepare wasm: ${a}`),me(a)}}async function Ve(e){var t=Ee;if(!Y&&!E(t))try{var r=fetch(t,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(r,e)}catch(a){D(`wasm streaming compile failed: ${a}`),D("falling back to ArrayBuffer instantiation")}return Se(t,e)}var rt=e=>{for(;0<e.length;)e.shift()(h)},st=[],ut=[],ft=()=>{var e=h.preRun.shift();ut.push(e)},Be=()=>{var e=g[+Wt>>2];return Wt+=4,e},et=(e,t)=>{for(var r=0,a=e.length-1;0<=a;a--){var s=e[a];s==="."?e.splice(a,1):s===".."?(e.splice(a,1),r++):r&&(e.splice(a,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},Ye=e=>{var t=e.charAt(0)==="/",r=e.slice(-1)==="/";return(e=et(e.split("/").filter(a=>!!a),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},Ae=e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],!e&&!t?".":(t&&=t.slice(0,-1),e+t)},it=()=>e=>crypto.getRandomValues(e),We=e=>{(We=it())(e)},Ft=(...e)=>{for(var t="",r=!1,a=e.length-1;-1<=a&&!r;a--){if(r=0<=a?e[a]:"/",typeof r!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";t=r+"/"+t,r=r.charAt(0)==="/"}return t=et(t.split("/").filter(s=>!!s),!r).join("/"),(r?"/":"")+t||"."},Re=globalThis.TextDecoder&&new TextDecoder,be=(e,t,r,a)=>{if(r=t+r,a)return r;for(;e[t]&&!(t>=r);)++t;return t},ze=(e,t=0,r,a)=>{if(r=be(e,t,r,a),16<r-t&&e.buffer&&Re)return Re.decode(e.subarray(t,r));for(a="";t<r;){var s=e[t++];if(s&128){var l=e[t++]&63;if((s&224)==192)a+=String.fromCharCode((s&31)<<6|l);else{var c=e[t++]&63;s=(s&240)==224?(s&15)<<12|l<<6|c:(s&7)<<18|l<<12|c<<6|e[t++]&63,65536>s?a+=String.fromCharCode(s):(s-=65536,a+=String.fromCharCode(55296|s>>10,56320|s&1023))}}else a+=String.fromCharCode(s)}return a},wt=[],mt=e=>{for(var t=0,r=0;r<e.length;++r){var a=e.charCodeAt(r);127>=a?t++:2047>=a?t+=2:55296<=a&&57343>=a?(t+=4,++r):t+=3}return t},Xe=(e,t,r,a)=>{if(!(0<a))return 0;var s=r;a=r+a-1;for(var l=0;l<e.length;++l){var c=e.codePointAt(l);if(127>=c){if(r>=a)break;t[r++]=c}else if(2047>=c){if(r+1>=a)break;t[r++]=192|c>>6,t[r++]=128|c&63}else if(65535>=c){if(r+2>=a)break;t[r++]=224|c>>12,t[r++]=128|c>>6&63,t[r++]=128|c&63}else{if(r+3>=a)break;t[r++]=240|c>>18,t[r++]=128|c>>12&63,t[r++]=128|c>>6&63,t[r++]=128|c&63,l++}}return t[r]=0,r-s},yt=[];function Mt(e,t){yt[e]={input:[],output:[],kd:t},Qe(e,Ot)}var Ot={open(e){var t=yt[e.node.Rd];if(!t)throw new y(43);e.Mc=t,e.seekable=!1},close(e){e.Mc.kd.Hd(e.Mc)},Hd(e){e.Mc.kd.Hd(e.Mc)},read(e,t,r,a){if(!e.Mc||!e.Mc.kd.oe)throw new y(60);for(var s=0,l=0;l<a;l++){try{var c=e.Mc.kd.oe(e.Mc)}catch{throw new y(29)}if(c===void 0&&s===0)throw new y(6);if(c==null)break;s++,t[r+l]=c}return s&&(e.node.qd=Date.now()),s},write(e,t,r,a){if(!e.Mc||!e.Mc.kd.ee)throw new y(60);try{for(var s=0;s<a;s++)e.Mc.kd.ee(e.Mc,t[r+s])}catch{throw new y(29)}return a&&(e.node.$c=e.node.Xc=Date.now()),s}},Jt={oe(){e:{if(!wt.length){var e=null;if(globalThis.window?.prompt&&(e=window.prompt("Input: "),e!==null&&(e+=`
5`)),!e){var t=null;break e}t=Array(mt(e)+1),e=Xe(e,t,0,t.length),t.length=e,wt=t}t=wt.shift()}return t},ee(e,t){t===null||t===10?(k(ze(e.output)),e.output=[]):t!=0&&e.output.push(t)},Hd(e){0<e.output?.length&&(k(ze(e.output)),e.output=[])},ff(){return{Ef:25856,Gf:5,Df:191,Ff:35387,Cf:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},gf(){return 0},hf(){return[24,80]}},ht={ee(e,t){t===null||t===10?(D(ze(e.output)),e.output=[]):t!=0&&e.output.push(t)},Hd(e){0<e.output?.length&&(D(ze(e.output)),e.output=[])}},ce={cd:null,jd(){return ce.createNode(null,"/",16895,0)},createNode(e,t,r,a){if((r&61440)===24576||(r&61440)===4096)throw new y(63);return ce.cd||(ce.cd={dir:{node:{nd:ce.Jc.nd,ed:ce.Jc.ed,zd:ce.Jc.zd,Od:ce.Jc.Od,ze:ce.Jc.ze,Ee:ce.Jc.Ee,Be:ce.Jc.Be,ge:ce.Jc.ge,Td:ce.Jc.Td},stream:{bd:ce.Hc.bd}},file:{node:{nd:ce.Jc.nd,ed:ce.Jc.ed},stream:{bd:ce.Hc.bd,read:ce.Hc.read,write:ce.Hc.write,re:ce.Hc.re,te:ce.Hc.te}},link:{node:{nd:ce.Jc.nd,ed:ce.Jc.ed,Ad:ce.Jc.Ad},stream:{}},ke:{node:{nd:ce.Jc.nd,ed:ce.Jc.ed},stream:lt}}),r=Ie(e,t,r,a),(r.mode&61440)===16384?(r.Jc=ce.cd.dir.node,r.Hc=ce.cd.dir.stream,r.Ic={}
5):(r.mode&61440)===32768?(r.Jc=ce.cd.file.node,r.Hc=ce.cd.file.stream,r.Qc=0,r.Ic=null):(r.mode&61440)===40960?(r.Jc=ce.cd.link.node,r.Hc=ce.cd.link.stream):(r.mode&61440)===8192&&(r.Jc=ce.cd.ke.node,r.Hc=ce.cd.ke.stream),r.qd=r.$c=r.Xc=Date.now(),e&&(e.Ic[t]=r,e.qd=e.$c=e.Xc=r.qd),r},Lf(e){return e.Ic?e.Ic.subarray?e.Ic.subarray(0,e.Qc):new Uint8Array(e.Ic):new Uint8Array(0)},Jc:{nd(e){var t={};return t.Hf=(e.mode&61440)===8192?e.id:1,t.Nf=e.id,t.mode=e.mode,t.Rf=1,t.uid=0,t.Mf=0,t.Rd=e.Rd,(e.mode&61440)===16384?t.size=4096:(e.mode&61440)===32768?t.size=e.Qc:(e.mode&61440)===40960?t.size=e.link.length:t.size=0,t.qd=new Date(e.qd),t.$c=new Date(e.$c),t.Xc=new Date(e.Xc),t.Oe=4096,t.Bf=Math.ceil(t.size/t.Oe),t},ed(e,t){for(var r of["mode","atime","mtime","ctime"])t[r]!=null&&(e[r]=t[r]);t.size!==void 0&&(t=t.size,e.Qc!=t&&(t==0?(e.Ic=null,e.Qc=0):(r=e.Ic,e.Ic=new Uint8Array(t),r&&e.Ic.set(r.subarray(0,Math.min(t,e.Qc))),e.Qc=t)))},zd(){throw ce.Zd||(ce.Zd=new y(44),ce.Zd.stack="<generic error, no stack>"),ce.Zd},Od(e,t,r,a){return ce.createNode(e,t,r,a)},ze(e,t,r){try{var a=he(t,r)}catch{}if(a){if((e.mode&61440)===16384)for(var s in a.Ic)throw new y(55);if(s=le(a.parent.id,a.name),i[s]===a)i[s]=a.vd;else for(s=i[s];s;){if(s.vd===a){s.vd=a.vd;break}s=s.vd}}delete e.parent.Ic[e.name],t.Ic[r]=e,e.name=r,t.Xc=t.$c=e.parent.Xc=e.parent.$c=Date.now()},Ee(e,t){delete e.Ic[t],e.Xc=e.$c=Date.now()},Be(e,t){var r=he(e,t),a;for(a in r.Ic)throw new y(55);delete e.Ic[t],e.Xc=e.$c=Date.now()},ge(e){return[".","..",...Object.keys(e.Ic)]},Td(e,t,r){return e=ce.createNode(e,t,41471,0),e.link=r,e},Ad(e){if((e.mode&61440)!==40960)throw new y(28);return e.link}},Hc:{read(e,t,r,a,s){var l=e.node.Ic;if(s>=e.node.Qc)return 0;if(e=Math.min(e.node.Qc-s,a),8<e&&l.subarray)t.set(l.subarray(s,s+e),r);else for(a=0;a<e;a++)t[r+a]=l[s+a];return e},write(e,t,r,a,s,l){if(t.buffer===S.buffer&&(l=!1),!a)return 0;if(e=e.node,e.$c=e.Xc=Date.now(),t.subarray&&(!e.Ic||e.Ic.subarray)){if(l)return e.Ic=t.subarray(r,r+a),e.Qc=a;if(e.Qc===0&&s===0)return e.Ic=t.slice(r,r+a),e.Qc=a;if(s+a<=e.Qc)return e.Ic.set(t.subarray(r,r+a),s),a}l=s+a;var c=e.Ic?e.Ic.length:0;if(c>=l||(l=Math.max(l,c*(1048576>c?2:1.125)>>>0),c!=0&&(l=Math.max(l,256)),c=e.Ic,e.Ic=new Uint8Array(l),0<e.Qc&&e.Ic.set(c.subarray(0,e.Qc),0)),e.Ic.subarray&&t.subarray)e.Ic.set(t.subarray(r,r+a),s);else for(l=0;l<a;l++)e.Ic[s+l]=t[r+l];return e.Qc=Math.max(e.Qc,s+a),a},bd(e,t,r){if(r===1?t+=e.position:r===2&&(e.node.mode&61440)===32768&&(t+=e.node.Qc),0>t)throw new y(28);return t},re(e,t,r,a,s){if((e.node.mode&61440)!==32768)throw new y(43);if(e=e.node.Ic,s&2||!e||e.buffer!==S.buffer){if(a=!0,me(),s=void 0,!s)throw new y(48);e&&((0<r||r+t<e.length)&&(e.subarray?e=e.subarray(r,r+t):e=Array.prototype.slice.call(e,r,r+t)),S.set(e,s))}else a=!1,s=e.byteOffset;return{Lc:s,Af:a}},te(e,t,r,a){return ce.Hc.write(e,t,0,a,r,!1),0}}},yn=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},Vt=null,Zt={},o=[],n=1,i=null,u=!1,d=!0,m={},y=class{name="ErrnoError";constructor(e){this.ld=e}},N=class{Dd={};node=null;get flags(){return this.Dd.flags}set flags(e){this.Dd.flags=e}get position(){return this.Dd.position}set position(e){this.Dd.position=e}},z=class{Jc={};Hc={};Pd=null;constructor(e,t,r,a){e||=this,this.parent=e,this.jd=e.jd,this.id=n++,this.name=t,this.mode=r,this.Rd=a,this.qd=this.$c=this.Xc=Date.now()}get read(){return(this.mode&365)===365}set read(e){e?this.mode|=365:this.mode&=-366}get write(){return(this.mode&146)===146}set write(e){e?this.mode|=146:this.mode&=-147}};function U(e,t={}){if(!e)throw new y(44);t.ae??(t.ae=!0),e.charAt(0)==="/"||(e="//"+e);var r=0;e:for(;40>r;r++){e=e.split("/").filter(f=>!!f);for(var a=Vt,s="/",l=0;l<e.length;l++){var c=l===e.length-1;if(c&&t.parent)break;if(e[l]!==".")if(e[l]==="..")if(s=Ae(s),a===a.parent){e=s+"/"+e.slice(l+1).join("/"),r--;continue e}else a=a.parent;else{s=Ye(s+"/"+e[l]);try{a=he(a,e[l])}catch(f){if(f?.ld===44&&c&&t.mf)return{path:s};throw f}if(!a.Pd||c&&!t.ae||(a=a.Pd.root),(a.mode&61440)===40960&&(!c||t.$d)){if(!a.Jc.Ad)throw new y(52);a=a.Jc.Ad(a),a.charAt(0)==="/"||(a=Ae(s)+"/"+a),e=a+"/"+e.slice(l+1).join("/");continue e}}}return{path:s,node:a}}throw new y(32)}function le(e,t){for(var r=0,a=0;a<t.length;a++)r=(r<<5)-r+t.charCodeAt(a)|0;return(e+r>>>0)%i.length}function he(e,t){var r=(e.mode&61440)===16384?(r=Ce(e,"x"))?r:e.Jc.zd?0:2:54;if(r)throw new y(r);for(r=i[le(e.id,t)];r;
5r=r.vd){var a=r.name;if(r.parent.id===e.id&&a===t)return r}return e.Jc.zd(e,t)}function Ie(e,t,r,a){return e=new z(e,t,r,a),t=le(e.parent.id,e.name),e.vd=i[t],i[t]=e}function De(e){var t=["r","w","rw"][e&3];return e&512&&(t+="w"),t}function Ce(e,t){if(d)return 0;if(!t.includes("r")||e.mode&292){if(t.includes("w")&&!(e.mode&146)||t.includes("x")&&!(e.mode&73))return 2}else return 2;return 0}function Ue(e,t){if((e.mode&61440)!==16384)return 54;try{return he(e,t),20}catch{}return Ce(e,"wx")}function je(e){if(e=o[e],!e)throw new y(8);return e}function at(e,t=-1){if(e=Object.assign(new N,e),t==-1)e:{for(t=0;4096>=t;t++)if(!o[t])break e;throw new y(33)}return e.md=t,o[t]=e}function vt(e,t=-1){return e=at(e,t),e.Hc?.Kf?.(e),e}function ot(e,t){var r=void 0,a=r?null:e;if(r??=e.Jc.ed,!r)throw new y(63);r(a,t)}var lt={open(e){e.Hc=Zt[e.node.Rd].Hc,e.Hc.open?.(e)},bd(){throw new y(70)}};function Qe(e,t){Zt[e]={Hc:t}}function Je(e,t){var r=t==="/";if(r&&Vt)throw new y(10);if(!r&&t){var a=U(t,{ae:!1});if(t=a.path,a=a.node,a.Pd)throw new y(10);if((a.mode&61440)!==16384)throw new y(54)}t={type:e,Sf:{},se:t,kf:[]},e=e.jd(t),e.jd=t,t.root=e,r?Vt=e:a&&(a.Pd=t,a.jd&&a.jd.kf.push(t))}function Ge(e,t,r){var a=U(e,{parent:!0}).node;if(e=e&&e.match(/([^\/]+|\/)\/*$/)[1],!e)throw new y(28);if(e==="."||e==="..")throw new y(20);var s=Ue(a,e);if(s)throw new y(s);if(!a.Jc.Od)throw new y(63);return a.Jc.Od(a,e,t,r)}function xe(e){return Ge(e,16895,0)}function ve(e,t,r){typeof r>"u"&&(r=t,t=438),Ge(e,t|8192,r)}function It(e,t){if(!Ft(e))throw new y(44);var r=U(t,{parent:!0}).node;if(!r)throw new y(44);t=t&&t.match(/([^\/]+|\/)\/*$/)[1];var a=Ue(r,t);if(a)throw new y(a);if(!r.Jc.Td)throw new y(63);r.Jc.Td(r,t,e)}function Ne(e,t,r=438){if(e==="")throw new y(44);if(typeof t=="string"){var a={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[t];if(typeof a>"u")throw Error(`Unknown file open mode: ${t}`);t=a}if(r=t&64?r&4095|32768:0,typeof e=="object")a=e;else{var s=e.endsWith("/");e=U(e,{$d:!(t&131072),mf:!0}),a=e.node,e=e.path}var l=!1;if(t&64)if(a){if(t&128)throw new y(20)}else{if(s)throw new y(31);a=Ge(e,r|511,0),l=!0}if(!a)throw new y(44);if((a.mode&61440)===8192&&(t&=-513),t&65536&&(a.mode&61440)!==16384)throw new y(54);if(!l&&(s=a?(a.mode&61440)===40960?32:(a.mode&61440)===16384&&(De(t)!=="r"||t&576)?31:Ce(a,De(t)):44))throw new y(s);if(t&512&&!l){if(s=a,s=typeof s=="string"?U(s,{$d:!0}).node:s,(s.mode&61440)===16384)throw new y(31);if((s.mode&61440)!==32768)throw new y(28);var c=Ce(s,"w");if(c)throw new y(c);ot(s,{size:0,timestamp:Date.now()})}t&=-131713;e:for(s=a;;){if(s===s.parent){s=s.jd.se;var f=f?s[s.length-1]!=="/"?`${s}/${f}`:s+f:s;break e}f=f?`${s.name}/${f}`:s.name,s=s.parent}return f=at({node:a,path:f,flags:t,seekable:!0,position:0,Hc:a.Hc,uf:[],error:!1}),f.Hc.open&&f.Hc.open(f),l&&(r&=511,a=typeof a=="string"?U(a,{$d:!0}).node:a,ot(a,{mode:r&4095|a.mode&-4096,Xc:Date.now(),Jf:void 0})),!h.logReadFiles||t&1||e in m||(m[e]=1),f}function _t(e,t,r){if(e.md===null)throw new y(8);if(!e.seekable||!e.Hc.bd)throw new y(70);if(r!=0&&r!=1&&r!=2)throw new y(28);e.position=e.Hc.bd(e,t,r),e.uf=[]}function Ze(e,t,r){e=Ye("/dev/"+e);var a=yn(!!t,!!r);Ze.qe??(Ze.qe=64);var s=Ze.qe++<<8|0;Qe(s,{open(l){l.seekable=!1},close(){r?.buffer?.length&&r(10)},read(l,c,f,b){for(var F=0,B=0;B<b;B++){try{var X=t()}catch{throw new y(29)}if(X===void 0&&F===0)throw new y(6);if(X==null)break;F++,c[f+B]=X}return F&&(l.node.qd=Date.now()),F},write(l,c,f,b){for(var F=0;F<b;F++)try{r(c[f+F])}catch{throw new y(29)}return b&&(l.node.$c=l.node.Xc=Date.now()),F}}),ve(e,a,s)}var Ct={},Wt=void 0,Ut=(e,t)=>Object.defineProperty(t,"name",{value:e}),Nn=[],Rt=[0,1,,1,null,1,!0,1,!1,1],de=class extends Error{constructor(e){super(e),this.name="BindingError"}},ct=e=>{if(!e)throw new de(`Cannot use deleted val. handle = ${e}`);return Rt[e]},At=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const t=Nn.pop()||Rt.length;return Rt[t]=e,Rt[t+1]=1,t}};class cr extends Error{}var Oe=e=>{for(var t="";;){var r=R[e++];if(!r)return t;t+=String.fromCharCode(r)}},jt={},gn=(e,t)=>{if(t===void 0)throw new de("ptr should not be undefined");for(;e.Rc;)t=e.Cd(t),e=e.Rc;return t},Pt={},Vn=e=>{e=rr(e);var t=Oe(e);return Et(e),t},bn=(e,t)=>{var r=Pt[e];if(r===void 0)throw e=`${t} has unknown type ${Vn(e)}`,new de(e);return r},qt=()=>{},wn=!1,Tt=e=>globalThis.FinalizationRegistry?(wn=new FinalizationRegistry(t=>{t=t.Fc,--t.count.value,t.count.value===0&&(t.Sc?t.Yc.dd(t.Sc):t.Nc.Gc.dd(t.Lc))}),Tt=t=>{var r=t.Fc;return r.Sc&&wn.register(t,{Fc:r},t),t},qt=t=>{wn.unregister(t)},Tt(e)):(Tt=t=>t,e),en={},zt=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function Gt(e){return this.Kc(x[e>>2])}var kt={},tn={}
5,nn=class extends Error{constructor(e){super(e),this.name="InternalError"}},tt=(e,t,r)=>{function a(f){if(f=r(f),f.length!==e.length)throw new nn("Mismatched type converter count");for(var b=0;b<e.length;++b)nt(e[b],f[b])}e.forEach(f=>tn[f]=t);var s=Array(t.length),l=[],c=0;for(let[f,b]of t.entries())Pt.hasOwnProperty(b)?s[f]=Pt[b]:(l.push(b),kt.hasOwnProperty(b)||(kt[b]=[]),kt[b].push(()=>{s[f]=Pt[b],++c,c===l.length&&a(s)}));l.length===0&&a(s)};function dr(e,t,r={}){var a=t.name;if(!e)throw new de(`type "${a}" must have a positive integer typeid pointer`);if(Pt.hasOwnProperty(e)){if(r.cf)return;throw new de(`Cannot register type '${a}' twice`)}Pt[e]=t,delete tn[e],kt.hasOwnProperty(e)&&(t=kt[e],delete kt[e],t.forEach(s=>s()))}function nt(e,t,r={}){return dr(e,t,r)}var Wn=(e,t,r)=>{switch(t){case 1:return r?a=>S[a]:a=>R[a];case 2:return r?a=>I[a>>1]:a=>P[a>>1];case 4:return r?a=>g[a>>2]:a=>x[a>>2];case 8:return r?a=>se[a>>3]:a=>pe[a>>3];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},_n=e=>{throw new de(e.Fc.Nc.Gc.name+" instance already deleted")},fr=[];function rn(){}var Un={},An=(e,t,r)=>{if(e[t].Pc===void 0){var a=e[t];e[t]=function(...s){if(!e[t].Pc.hasOwnProperty(s.length))throw new de(`Function '${r}' called with an invalid number of arguments (${s.length}) - expects one of (${e[t].Pc})!`);return e[t].Pc[s.length].apply(this,s)},e[t].Pc=[],e[t].Pc[a.hd]=a}},Ht=(e,t,r)=>{if(h.hasOwnProperty(e)){if(r===void 0||h[e].Pc!==void 0&&h[e].Pc[r]!==void 0)throw new de(`Cannot register public name '${e}' twice`);if(An(h,e,e),h[e].Pc.hasOwnProperty(r))throw new de(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`);h[e].Pc[r]=t}else h[e]=t,h[e].hd=r},hr=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e};function vr(e,t,r,a,s,l,c,f){this.name=e,this.constructor=t,this.ad=r,this.dd=a,this.Rc=s,this.Ye=l,this.Cd=c,this.Re=f,this.we=[]}var an=(e,t,r)=>{for(;t!==r;){if(!t.Cd)throw new de(`Expected null or instance of ${r.name}, got an instance of ${t.name}`);e=t.Cd(e),t=t.Rc}return e},En=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e};function pr(e,t){if(t===null){if(this.ce)throw new de(`null is not a valid ${this.name}`);return 0}if(!t.Fc)throw new de(`Cannot pass "${En(t)}" as a ${this.name}`);if(!t.Fc.Lc)throw new de(`Cannot pass deleted object as a pointer of type ${this.name}`);return an(t.Fc.Lc,t.Fc.Nc.Gc,this.Gc)}function mr(e,t){if(t===null){if(this.ce)throw new de(`null is not a valid ${this.name}`);if(this.Kd){var r=this.fe();return e!==null&&e.push(this.dd,r),r}return 0}if(!t||!t.Fc)throw new de(`Cannot pass "${En(t)}" as a ${this.name}`);if(!t.Fc.Lc)throw new de(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Jd&&t.Fc.Nc.Jd)throw new de(`Cannot convert argument of type ${t.Fc.Yc?t.Fc.Yc.name:t.Fc.Nc.name} to parameter type ${this.name}`);if(r=an(t.Fc.Lc,t.Fc.Nc.Gc,this.Gc),this.Kd){if(t.Fc.Sc===void 0)throw new de("Passing raw pointer to smart pointer is illegal");switch(this.tf){case 0:if(t.Fc.Yc===this)r=t.Fc.Sc;else throw new de(`Cannot convert argument of type ${t.Fc.Yc?t.Fc.Yc.name:t.Fc.Nc.name} to parameter type ${this.name}`);break;case 1:r=t.Fc.Sc;break;case 2:if(t.Fc.Yc===this)r=t.Fc.Sc;else{var a=t.clone();r=this.pf(r,At(()=>a.delete())),e!==null&&e.push(this.dd,r)}break;default:throw new de("Unsupported sharing policy")}}return r}function yr(e,t){if(t===null){if(this.ce)throw new de(`null is not a valid ${this.name}`);return 0}if(!t.Fc)throw new de(`Cannot pass "${En(t)}" as a ${this.name}`);if(!t.Fc.Lc)throw new de(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.Fc.Nc.Jd)throw new de(`Cannot convert argument of type ${t.Fc.Nc.name} to parameter type ${this.name}`);return an(t.Fc.Lc,t.Fc.Nc.Gc,this.Gc)}var jn=(e,t,r)=>t===r?e:r.Rc===void 0?null:(e=jn(e,t,r.Rc),e===null?null:r.Re(e)),gr=(e,t)=>(t=gn(e,t),jt[t]),on=(e,t)=>{if(!t.Nc||!t.Lc)throw new nn("makeClassHandle requires ptr and ptrType");if(!!t.Yc!=!!t.Sc)throw new nn("Both smartPtrType and smartPtr must be specified");return t.count={value:1},Tt(Object.create(e,{Fc:{value:t,writable:!0}}))};function sn(e,t,r,a,s,l,c,f,b,F,B){this.name=e,this.Gc=t,this.ce=r,this.Jd=a,this.Kd=s,this.nf=l,this.tf=c,this.ye=f,this.fe=b,this.pf=F,this.dd=B,s||t.Rc!==void 0?this.Oc=mr:(this.Oc=a?pr:yr,this.Vc=null)}var zn=(e,t,r)=>{if(!h.hasOwnProperty(e))throw new nn("Replacing nonexistent public symbol");h[e].Pc!==void 0&&r!==void 0?h[e].Pc[r]=t:(h[e]=t,h[e].hd=r)},$e=(e,t)=>
5{e=Oe(e);var r=Tn.get(t);if(typeof r!="function")throw new de(`unknown function pointer with signature ${e}: ${t}`);return r};class br extends Error{}var gt=(e,t)=>{function r(l){s[l]||Pt[l]||(tn[l]?tn[l].forEach(r):(a.push(l),s[l]=!0))}var a=[],s={};throw t.forEach(r),new br(`${e}: `+a.map(Vn).join([", "]))};function wr(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].Vc===void 0)return!0;return!1}function un(e,t,r,a,s){var l=t.length;if(2>l)throw new de("argTypes array size mismatch! Must at least get return value and 'this' types!");var c=t[1]!==null&&r!==null,f=wr(t),b=!t[0].jf,F=l-2,B=Array(F),X=[],G=[];return Ut(e,function(...ge){if(G.length=0,X.length=c?2:1,X[0]=s,c){var V=t[1].Oc(G,this);X[1]=V}for(var H=0;H<F;++H)B[H]=t[H+2].Oc(G,ge[H]),X.push(B[H]);if(ge=a(...X),f)zt(G);else for(H=c?1:2;H<t.length;H++){var ne=H===1?V:B[H-2];t[H].Vc!==null&&t[H].Vc(ne)}return V=b?t[0].Kc(ge):void 0,V})}var ln=(e,t)=>{for(var r=[],a=0;a<e;a++)r.push(x[t+4*a>>2]);return r},Sn=e=>{e=e.trim();const t=e.indexOf("(");return t===-1?e:e.slice(0,t)},Gn=(e,t,r)=>{if(!(e instanceof Object))throw new de(`${r} with invalid "this": ${e}`);if(!(e instanceof t.Gc.constructor))throw new de(`${r} incompatible with "this" of type ${e.constructor.name}`);if(!e.Fc.Lc)throw new de(`cannot call emscripten binding method ${r} on deleted object`);return an(e.Fc.Lc,e.Fc.Nc.Gc,t.Gc)},Fn=e=>{9<e&&--Rt[e+1]===0&&(Rt[e]=void 0,Nn.push(e))},_r={name:"emscripten::val",Kc:e=>{var t=ct(e);return Fn(e),t},Oc:(e,t)=>At(t),Wc:Gt,Vc:null},Mn=(e,t,r)=>{switch(t){case 1:return r?function(a){return this.Kc(S[a])}:function(a){return this.Kc(R[a])};case 2:return r?function(a){return this.Kc(I[a>>1])}:function(a){return this.Kc(P[a>>1])};case 4:return r?function(a){return this.Kc(g[a>>2])}:function(a){return this.Kc(x[a>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Ar=(e,t)=>{switch(t){case 4:return function(r){return this.Kc(ee[r>>2])};case 8:return function(r){return this.Kc(re[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Hn=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,Er=(e,t,r)=>{if(e>>=1,t=be(P,e,t/2,r),16<t-e&&Hn)return Hn.decode(P.subarray(e,t));for(r="";e<t;++e)r+=String.fromCharCode(P[e]);return r},Sr=(e,t,r)=>{if(r??=2147483647,2>r)return 0;r-=2;var a=t;r=r<2*e.length?r/2:e.length;for(var s=0;s<r;++s)I[t>>1]=e.charCodeAt(s),t+=2;return I[t>>1]=0,t-a},Fr=e=>2*e.length,Mr=(e,t,r)=>{var a="";e>>=2;for(var s=0;!(s>=t/4);s++){var l=x[e+s];if(!l&&!r)break;a+=String.fromCodePoint(l)}return a},Ir=(e,t,r)=>{if(r??=2147483647,4>r)return 0;var a=t;r=a+r-4;for(var s=0;s<e.length;++s){var l=e.codePointAt(s);if(65535<l&&s++,g[t>>2]=l,t+=4,t+4>r)break}return g[t>>2]=0,t-a},Cr=e=>{for(var t=0,r=0;r<e.length;++r)65535<e.codePointAt(r)&&r++,t+=4;return t},In=[],Rr=e=>{var t=In.length;return In.push(e),t},Pr=(e,t)=>{for(var r=Array(e),a=0;a<e;++a)r[a]=bn(x[t+4*a>>2],`parameter ${a}`);return r},Lr={},Xn=e=>{var t=Lr[e];return t===void 0?Oe(e):t},xr=[0,31,60,91,121,152,182,213,244,274,305,335],Or=[0,31,59,90,120,151,181,212,243,273,304,334],Cn=[],$n=e=>{e.If=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance")},Yn=e=>{e.Qf=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance")},_,Kn=e=>{var t="EXT_color_buffer_float EXT_conservative_depth EXT_disjoint_timer_query_webgl2 EXT_texture_norm16 NV_shader_noperspective_interpolation WEBGL_clip_cull_distance EXT_clip_control EXT_color_buffer_half_float EXT_depth_clamp EXT_float_blend EXT_polygon_offset_clamp EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_texture_float_linear WEBGL_blend_func_extended WEBGL_compressed_texture_astc WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context WEBGL_multi_draw WEBGL_polygon_mode".split(" ");return(e.getSupportedExtensions()||[]).filter(r=>t.includes(r))},Qn=1,Bt=[],qe=[],Xt=[],$t=[],Lt=[],dt=[],Yt=[],He=[],Dt=[],Jn={},Zn={},Rn=4,qn=0,cn=e=>{for(var t=Qn++,r=e.length;r<t;r++)e[r]=null;return t},Nt=(e,t,r,a)=>{for(var s=0;s<e;s++){var l=_[r](),c=l&&cn(a);l?(l.name=c,a[c]=l):Te||=1282,g[t+4*s>>2]=c}},Tr=(e,t)=>{var r=cn(He),a={handle:r,attributes:t,version:t.Pf,Tc:e};if(e.canvas&&(e.canvas.Ge=a),He[r]=a,(typeof t.Se>"u"||t.Se)&&((e=a)||(e=pt),!e.df)){e.df=!0,t=e.Tc,t.lf=t.getExtension("WEBGL_multi_draw"),t.Ve=t.getExtension("EXT_polygon_offset_clamp"),t.Ue=t.getExtension("EXT_clip_control"),t.vf=t.getExtension("WEBGL_polygon_mode"),$n(t),Yn(t),2<=e.version&&(t.me=t.getExtension("EXT_disjoint_timer_query_webgl2")),(2>e.version||!t.me)&&(t.me=t.getExtension("EXT_disjoint_timer_query"));for(var s of Kn(t))s.includes("lose_context")||s.includes("debug")||t.getExtension(s)}return r},Kt=e=>(pt=He[e],h.ctx=_=pt?.Tc,!(e&&!_)),Te,pt,Pn={},er=()=>{if(!Ln){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:T||"./this.program"},t;for(t in Pn)Pn[t]===void 0?delete e[t]:e[t]=Pn[t];var r=[];for(t in e)r.push(`${t}=${e[t]}`);Ln=r}return Ln},Ln,xn=[],On=()=>{var e=Kn(_);return e=e.concat(e.map(t=>"GL_"+t))},tr=(e,t,r)=>{if(t){var a=void 0;switch(e){case 36346:a=1;break;case 36344:r!=0&&r!=1&&(Te||=1280);return;case 34814:case 36345:a=0;break;case 34466:var s=_.getParameter(34467);a=s?s.length:0;break;case 33309:if(2>pt.version){Te||=1282;return}a=On().length;break;case 33307:case 33308:if(2>pt.version){Te||=1280;return}a=e==33307?3:0}if(a===void 0)switch(s=_.getParameter(e),typeof s){case"number":a=s;break;case"boolean":a=s?1:0;break;case"string":Te||=1280;return;case"object":if(s===null)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:a=0;break;default:Te||=1280;return}else{if(s instanceof Float32Array||s instanceof Uint32Array||s instanceof Int32Array||s instanceof Array){for(e=0;e<s.length;++e)switch(r){case 0:g[t+4*e>>2]=s[e];break;case 2:ee[t+4*e>>2]=s[e];break;case 4:S[t+e]=s[e]?1:0}return}try{a=s.name|0}catch(l){Te||=1280,D(`GL_INVALID_ENUM in glGet${r}v: Unknown object returned from WebGL getParameter(${e})! (error: ${l})`);return}}break;default:Te||=1280,D(`GL_INVALID_ENUM in glGet${r}v: Native code calling glGet${r}v(${e}) and it returns ${s} of type ${typeof s}!`);return}switch(r){case 1:r=a,x[t>>2]=r,x[t+4>>2]=(r-x[t>>2])/4294967296;break;case 0:g[t>>2]=a;break;case 2:ee[t>>2]=a;break;case 4:S[t]=a?1:0}}else Te||=1281},Qt=e=>{var t=mt(e)+1,r=fn(t);return r&&Xe(e,R,r,t),r},nr=e=>e.slice(-1)=="]"&&e.lastIndexOf("["),dn=e=>(e-=5120,e==0?S:e==1?R:e==2?I:e==4?g:e==6?ee:e==5||e==28922||e==28520||e==30779||e==30782?x:P);i=Array(4096),Je(ce,"/"),xe("/tmp"),xe("/home"),xe("/home/web_user"),function(){xe("/dev"),Qe(259,{read:()=>0,write:(a,s,l,c)=>c,bd:()=>0}),ve("/dev/null",259),Mt(1280,Jt),Mt(1536,ht),ve("/dev/tty",1280),ve("/dev/tty1",1536);var e=new Uint8Array(1024),t=0,r=()=>(t===0&&(We(e),t=e.byteLength),e[--t]);Ze("random",r),Ze("urandom",r),xe("/dev/shm"),xe("/dev/shm/tmp")}(),function(){xe("/proc");var e=xe("/proc/self");xe("/proc/self/fd"),Je({jd(){var t=Ie(e,"fd",16895,73);return t.Hc={bd:ce.Hc.bd},t.Jc={zd(r,a){r=+a;var s=je(r);return r={parent:null,jd:{se:"fake"},Jc:{Ad:()=>s.path},id:r+1},r.parent=r},ge(){return Array.from(o.entries()).filter(([,r])=>r).map(([r])=>r.toString())}},t}},"/proc/self/fd")}(),(()=>{let e=rn.prototype;Object.assign(e,{isAliasOf:function(r){if(!(this instanceof rn&&r instanceof rn))return!1;var a=this.Fc.Nc.Gc,s=this.Fc.Lc;r.Fc=r.Fc;var l=r.Fc.Nc.Gc;for(r=r.Fc.Lc;a.Rc;)s=a.Cd(s),a=a.Rc;for(;l.Rc;)r=l.Cd(r),l=l.Rc;return a===l&&s===r},clone:function(){if(this.Fc.Lc||_n(this),this.Fc.wd)return this.Fc.count.value+=1,this;var r=Tt,a=Object,s=a.create,l=Object.getPrototypeOf(this),c=this.Fc;return r=r(s.call(a,l,{Fc:{value:{count:c.count,yd:c.yd,wd:c.wd,Lc:c.Lc,Nc:c.Nc,Sc:c.Sc,Yc:c.Yc}}})),r.Fc.count.value+=1,r.Fc.yd=!1,r},delete(){if(this.Fc.Lc||_n(this),this.Fc.yd&&!this.Fc.wd)throw new de("Object already scheduled for deleti
5on");qt(this);var r=this.Fc;--r.count.value,r.count.value===0&&(r.Sc?r.Yc.dd(r.Sc):r.Nc.Gc.dd(r.Lc)),this.Fc.wd||(this.Fc.Sc=void 0,this.Fc.Lc=void 0)},isDeleted:function(){return!this.Fc.Lc},deleteLater:function(){if(this.Fc.Lc||_n(this),this.Fc.yd&&!this.Fc.wd)throw new de("Object already scheduled for deletion");return fr.push(this),this.Fc.yd=!0,this}});const t=Symbol.dispose;t&&(e[t]=e.delete)})(),Object.assign(sn.prototype,{Ze(e){return this.ye&&(e=this.ye(e)),e},le(e){this.dd?.(e)},Wc:Gt,Kc:function(e){function t(){return this.Kd?on(this.Gc.ad,{Nc:this.nf,Lc:r,Yc:this,Sc:e}):on(this.Gc.ad,{Nc:this,Lc:e})}var r=this.Ze(e);if(!r)return this.le(e),null;var a=gr(this.Gc,r);if(a!==void 0)return a.Fc.count.value===0?(a.Fc.Lc=r,a.Fc.Sc=e,a.clone()):(a=a.clone(),this.le(e),a);if(a=this.Gc.Ye(r),a=Un[a],!a)return t.call(this);a=this.Jd?a.Pe:a.pointerType;var s=jn(r,this.Gc,a.Gc);return s===null?t.call(this):this.Kd?on(a.Gc.ad,{Nc:a,Lc:s,Yc:this,Sc:e}):on(a.Gc.ad,{Nc:a,Lc:s})}});for(let e=0;32>e;++e)xn.push(Array(e));if(h.print&&(k=h.print),h.printErr&&(D=h.printErr),h.wasmBinary&&(Y=h.wasmBinary),h.thisProgram&&(T=h.thisProgram),h.preInit)for(typeof h.preInit=="function"&&(h.preInit=[h.preInit]);0<h.preInit.length;)h.preInit.shift()();var kr={342006:(e,t,r,a,s)=>{if(typeof window>"u"||(window.AudioContext||window.webkitAudioContext)===void 0)return 0;if(typeof window.miniaudio>"u"){window.miniaudio={referenceCount:0},window.miniaudio.device_type={},window.miniaudio.device_type.playback=e,window.miniaudio.device_type.capture=t,window.miniaudio.device_type.duplex=r,window.miniaudio.device_state={},window.miniaudio.device_state.stopped=a,window.miniaudio.device_state.started=s;let l=window.miniaudio;l.devices=[],l.track_device=function(c){for(var f=0;f<l.devices.length;++f)if(l.devices[f]==null)return l.devices[f]=c,f;return l.devices.push(c),l.devices.length-1},l.untrack_device_by_index=function(c){for(l.devices[c]=null;0<l.devices.length&&l.devices[l.devices.length-1]==null;)l.devices.pop()},l.untrack_device=function(c){for(var f=0;f<l.devices.length;++f)if(l.devices[f]==c)return l.untrack_device_by_index(f)},l.get_device_by_index=function(c){return l.devices[c]},l.unlock_event_types=["touchend","click"],l.unlock=function(){for(var c=0;c<l.devices.length;++c){var f=l.devices[c];f!=null&&f.Zc!=null&&f.state===l.device_state.started&&f.Zc.resume().then(()=>{ir(f.ve)},b=>{J.error("Failed to resume audiocontext",b)})}l.unlock_event_types.map(function(b){document.removeEventListener(b,l.unlock,!0)})},l.unlock_event_types.map(function(c){document.addEventListener(c,l.unlock,!0)})}return window.miniaudio.referenceCount+=1,1},344184:()=>{typeof window.miniaudio<"u"&&(window.miniaudio.unlock_event_types.map(function(e){document.removeEventListener(e,window.miniaudio.unlock,!0)}),--window.miniaudio.referenceCount,window.miniaudio.referenceCount===0&&delete window.miniaudio)},344488:()=>navigator.mediaDevices!==void 0&&navigator.mediaDevices.getUserMedia!==void 0,344592:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch{return 0}},344763:(e,t,r,a,s,l)=>{if(typeof window.miniaudio>"u")return-1;var c={},f={};return e==window.miniaudio.device_type.playback&&r!=0&&(f.sampleRate=r),c.Zc=new(window.AudioContext||window.webkitAudioContext)(f),c.Zc.suspend(),c.state=window.miniaudio.device_state.stopped,r=0,e!=window.miniaudio.device_type.playback&&(r=t),c.od=c.Zc.createScriptProcessor(a,r,t),c.od.onaudioprocess=function(b){if((c.Id==null||c.Id.length==0)&&(c.Id=new Float32Array(ee.buffer,s,a*t)),e==window.miniaudio.device_type.capture||e==window.miniaudio.device_type.duplex){for(var F=0;F<t;F+=1)for(var B=b.inputBuffer.getChannelData(F),X=c.Id,G=0;G<a;G+=1)X[G*t+F]=B[G];ar(l,a,s)}if(e==window.miniaudio.device_type.playback||e==window.miniaudio.device_type.duplex)for(or(l,a,s),F=0;F<b.outputBuffer.numberOfChannels;++F)for(B=b.outputBuffer.getChannelData(F),X=c.Id,G=0;G<a;G+=1)B[G]=X[G*t+F];else for(F=0;F<b.outputBuffer.numberOfChannels;++F)b.outputBuffer.getChannelData(F).fill(0)},e!=window.miniaudio.device_type.capture&&e!=window.miniaudio.device_type.duplex||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(function(b){c.Sd=c.Zc.createMediaStreamSource(b),c.Sd.connect(c.od),c.od.connect(c.Zc.destination)}).catch(function(b){J.log("Failed to get user media: "+b)}),e==window.miniaudio.device_type.playback&&c.od.connect(c.Zc.destination),c.ve=l,window.miniaudio.track_device(c)},347640:e=>window.miniaudio.get_device_by_index(e).Zc.sampleRate,347713:e=>{e=window.miniaudio.get_device_by_index(e),e.od!==void 0&&(e.od.onaudioprocess=function(){},e.od.disconnect(),e.od=void 0),e.Sd!==void 0&&(e.Sd.disconnect(),e.Sd=void 0),e.Zc.close(),e.Zc=void 0,e.ve=void 0},348113:e=>{window.miniaudio.untrack_device_by_index(e)}
5,348163:e=>{e=window.miniaudio.get_device_by_index(e),e.Zc.resume(),e.state=window.miniaudio.device_state.started},348302:e=>{e=window.miniaudio.get_device_by_index(e),e.Zc.suspend(),e.state=window.miniaudio.device_state.stopped}},Et,fn,rr,ir,ar,or,sr,ur,lr,xt,Tn,Br={Pa:function(e,t,r){Wt=r;try{var a=je(e);switch(t){case 0:var s=Be();if(0>s)break;for(;o[s];)s++;return vt(a,s).md;case 1:case 2:return 0;case 3:return a.flags;case 4:return s=Be(),a.flags|=s,0;case 12:return s=Be(),I[s+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(l){if(typeof Ct>"u"||l.name!=="ErrnoError")throw l;return-l.ld}},Jb:function(e,t,r){Wt=r;try{var a=je(e);switch(t){case 21509:return a.Mc?0:-59;case 21505:if(!a.Mc)return-59;if(a.Mc.kd.ff){e=[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var s=Be();g[s>>2]=25856,g[s+4>>2]=5,g[s+8>>2]=191,g[s+12>>2]=35387;for(var l=0;32>l;l++)S[s+l+17]=e[l]||0}return 0;case 21510:case 21511:case 21512:return a.Mc?0:-59;case 21506:case 21507:case 21508:if(!a.Mc)return-59;if(a.Mc.kd.gf)for(s=Be(),e=[],l=0;32>l;l++)e.push(S[s+l+17]);return 0;case 21519:return a.Mc?(s=Be(),g[s>>2]=0):-59;case 21520:return a.Mc?-28:-59;case 21537:case 21531:if(s=Be(),!a.Hc.ef)throw new y(59);return a.Hc.ef(a,t,s);case 21523:return a.Mc?(a.Mc.kd.hf&&(l=[24,80],s=Be(),I[s>>1]=l[0],I[s+2>>1]=l[1]),0):-59;case 21524:return a.Mc?0:-59;case 21515:return a.Mc?0:-59;default:return-28}}catch(c){if(typeof Ct>"u"||c.name!=="ErrnoError")throw c;return-c.ld}},Kb:function(e,t,r,a){Wt=a;try{t=t?ze(R,t):"";var s=t;if(s.charAt(0)==="/")t=s;else{var l=e===-100?"/":je(e).path;if(s.length==0)throw new y(44);t=l+"/"+s}var c=a?Be():0;return Ne(t,r,c).md}catch(f){if(typeof Ct>"u"||f.name!=="ErrnoError")throw f;return-f.ld}},Nb:()=>me(""),Ma:(e,t,r)=>{e=Oe(e),t=bn(t,"wrapper"),r=ct(r);var a=t.Gc,s=a.ad,l=a.Rc.ad,c=a.Rc.constructor;return e=Ut(e,function(...f){for(var b of a.Rc.we)if(this[b]===l[b])throw new cr(`Pure virtual function ${b} must be implemented in JavaScript`);Object.defineProperty(this,"__parent",{value:s}),this.__construct(...f)}),s.__construct=function(...f){if(this===s)throw new de("Pass correct 'this' to __construct");f=c.implement(this,...f),qt(f);var b=f.Fc;if(f.notifyOnDestruction(),b.wd=!0,Object.defineProperties(this,{Fc:{value:b}}),Tt(this),f=b.Lc,f=gn(a,f),jt.hasOwnProperty(f))throw new de(`Tried to register registered instance: ${f}`);jt[f]=this},s.__destruct=function(){if(this===s)throw new de("Pass correct 'this' to __destruct");qt(this);var f=this.Fc.Lc;if(f=gn(a,f),jt.hasOwnProperty(f))delete jt[f];else throw new de(`Tried to unregister unregistered instance: ${f}`)},e.prototype=Object.create(s),Object.assign(e.prototype,r),At(e)},bc:e=>{var t=en[e];delete en[e];var r=t.fe,a=t.dd,s=t.ne,l=s.map(c=>c.bf).concat(s.map(c=>c.rf));tt([e],l,c=>{var f={},b,F;for([b,F]of s.entries()){const B=c[b],X=F.$e,G=F.af,ge=c[b+s.length],V=F.qf,H=F.sf;f[F.We]={read:ne=>B.Kc(X(G,ne)),write:(ne,oe)=>{var ue=[];V(H,ne,ge.Oc(ue,oe)),zt(ue)},optional:B.optional}}return[{name:t.name,Kc:B=>{var X={},G;for(G in f)X[G]=f[G].read(B);return a(B),X},Oc:(B,X)=>{for(var G in f)if(!(G in X||f[G].optional))throw new TypeError(`Missing field: "${G}"`);var ge=r();for(G in f)f[G].write(ge,X[G]);return B!==null&&B.push(a,ge),ge},Wc:Gt,Vc:a}]})},Ja:(e,t,r,a,s)=>{t=Oe(t),a=a===0n;let l=c=>c;if(a){const c=8*r;l=f=>BigInt.asUintN(c,f),s=l(s)}nt(e,{name:t,Kc:l,Oc:(c,f)=>(typeof f=="number"&&(f=BigInt(f)),f),Wc:Wn(t,r,!a),Vc:null})},qb:(e,t,r,a)=>{t=Oe(t),nt(e,{name:t,Kc:function(s){return!!s},Oc:function(s,l){return l?r:a},Wc:function(s){return this.Kc(R[s])},Vc:null})},c:(e,t,r,a,s,l,c,f,b,F,B,X,G)=>{B=Oe(B),l=$e(s,l),f&&=$e(c,f),F&&=$e(b,F),G=$e(X,G);var ge=hr(B);Ht(ge,function(){gt(`Cannot construct ${B} due to unbound types`,[a])}),tt([e,t,r],a?[a]:[],V=>{if(V=V[0],a)var H=V.Gc,ne=H.ad;else ne=rn.prototype;V=Ut(B,function(...Pe){if(Object.getPrototypeOf(this)!==oe)throw new de(`Use 'new' to construct ${B}`);if(ue.rd===void 0)throw new de(`${B} has no accessible constructor`);var Le=ue.rd[Pe.length];if(Le===void 0)throw new de(`Tried to invoke ctor of ${B}
5 with invalid number of parameters (${Pe.length}) - expected (${Object.keys(ue.rd).toString()}) parameters instead!`);return Le.apply(this,Pe)});var oe=Object.create(ne,{constructor:{value:V}});V.prototype=oe;var ue=new vr(B,V,oe,G,H,l,f,F);if(ue.Rc){var Fe;(Fe=ue.Rc).Ed??(Fe.Ed=[]),ue.Rc.Ed.push(ue)}return H=new sn(B,ue,!0,!1,!1),Fe=new sn(B+"*",ue,!1,!1,!1),ne=new sn(B+" const*",ue,!1,!0,!1),Un[e]={pointerType:Fe,Pe:ne},zn(ge,V),[H,Fe,ne]})},da:(e,t,r,a,s,l,c)=>{var f=ln(r,a);t=Oe(t),t=Sn(t),l=$e(s,l),tt([],[e],b=>{function F(){gt(`Cannot call ${B} due to unbound types`,f)}b=b[0];var B=`${b.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var X=b.Gc.constructor;return X[t]===void 0?(F.hd=r-1,X[t]=F):(An(X,t,B),X[t].Pc[r-1]=F),tt([],f,G=>{if(G=un(B,[G[0],null].concat(G.slice(1)),null,l,c),X[t].Pc===void 0?(G.hd=r-1,X[t]=G):X[t].Pc[r-1]=G,b.Gc.Ed)for(const ge of b.Gc.Ed)ge.constructor.hasOwnProperty(t)||(ge.constructor[t]=G);return[]}),[]})},ya:(e,t,r,a,s,l,c,f)=>{t=Oe(t),l=$e(s,l),tt([],[e],b=>{b=b[0];var F=`${b.name}.${t}`,B={get(){gt(`Cannot access ${F} due to unbound types`,[r])},enumerable:!0,configurable:!0};return B.set=f?()=>{gt(`Cannot access ${F} due to unbound types`,[r])}:()=>{throw new de(`${F} is a read-only property`)},Object.defineProperty(b.Gc.constructor,t,B),tt([],[r],X=>{X=X[0];var G={get(){return X.Kc(l(a))},enumerable:!0};return f&&(f=$e(c,f),G.set=ge=>{var V=[];f(a,X.Oc(V,ge)),zt(V)}),Object.defineProperty(b.Gc.constructor,t,G),[]}),[]})},U:(e,t,r,a,s,l)=>{var c=ln(t,r);s=$e(a,s),tt([],[e],f=>{f=f[0];var b=`constructor ${f.name}`;if(f.Gc.rd===void 0&&(f.Gc.rd=[]),f.Gc.rd[t-1]!==void 0)throw new de(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${f.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return f.Gc.rd[t-1]=()=>{gt(`Cannot construct ${f.name} due to unbound types`,c)},tt([],c,F=>(F.splice(1,0,null),f.Gc.rd[t-1]=un(b,F,null,s,l),[])),[]})},a:(e,t,r,a,s,l,c,f)=>{var b=ln(r,a);t=Oe(t),t=Sn(t),l=$e(s,l),tt([],[e],F=>{function B(){gt(`Cannot call ${X} due to unbound types`,b)}F=F[0];var X=`${F.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),f&&F.Gc.we.push(t);var G=F.Gc.ad,ge=G[t];return ge===void 0||ge.Pc===void 0&&ge.className!==F.name&&ge.hd===r-2?(B.hd=r-2,B.className=F.name,G[t]=B):(An(G,t,X),G[t].Pc[r-2]=B),tt([],b,V=>(V=un(X,V,F,l,c),G[t].Pc===void 0?(V.hd=r-2,G[t]=V):G[t].Pc[r-2]=V,[])),[]})},b:(e,t,r,a,s,l,c,f,b,F)=>{t=Oe(t),s=$e(a,s),tt([],[e],B=>{B=B[0];var X=`${B.name}.${t}`,G={get(){gt(`Cannot access ${X} due to unbound types`,[r,c])},enumerable:!0,configurable:!0};return G.set=b?()=>gt(`Cannot access ${X} due to unbound types`,[r,c]):()=>{throw new de(X+" is a read-only property")},Object.defineProperty(B.Gc.ad,t,G),tt([],b?[r,c]:[r],ge=>{var V=ge[0],H={get(){var oe=Gn(this,B,X+" getter");return V.Kc(s(l,oe))},enumerable:!0};if(b){b=$e(f,b);var ne=ge[1];H.set=function(oe){var ue=Gn(this,B,X+" setter"),Fe=[];b(F,ue,ne.Oc(Fe,oe)),zt(Fe)}}return Object.defineProperty(B.Gc.ad,t,H),[]}),[]})},nb:e=>nt(e,_r),Qa:(e,t,r,a,s)=>{switch(t=Oe(t),s=s===0?"object":s===1?"number":"string",s){case"object":let c=function(){};c.values={},nt(e,{name:t,constructor:c,valueType:s,Kc:function(f){return this.constructor.values[f]},Oc:(f,b)=>b.value,Wc:Mn(t,r,a),Vc:null}),Ht(t,c);break;case"number":var l={};nt(e,{name:t,de:l,valueType:s,Kc:f=>f,Oc:(f,b)=>b,Wc:Mn(t,r,a),Vc:null}),Ht(t,l),delete h[t].hd;break;case"string":l={},nt(e,{name:t,Fe:{},Ae:{},de:l,valueType:s,Kc:function(f){return this.Ae[f]},Oc:function(f,b){return this.Fe[b]},Wc:Mn(t,r,a),Vc:null}),Ht(t,l),delete h[t].hd}},r:(e,t,r)=>{var a=bn(e,"enum");switch(t=Oe(t),a.valueType){case"object":e=a.constructor,a=Object.create(a.constructor.prototype,{value:{value:r},constructor:{value:Ut(`${a.name}_${t}`,function(){})}}),e.values[r]=a,e[t]=a;break;case"number":a.de[t]=r;break;case"string":a.Fe[t]=r,a.Ae[r]=t,a.de[t]=t}},Ia:(e,t,r)=>{t=Oe(t),nt(e,{name:t,Kc:a=>a,Oc:(a,s)=>s,Wc:Ar(t,r),Vc:null})},l:(e,t,r,a,s,l)=>{var c=ln(t,r);e=Oe(e),e=Sn(e),s=$e(a,s),Ht(e,function(){gt(`Cannot call ${e} due to unbound types`,c)},t-1),tt([],c,f=>(zn(e,un(e,[f[0],null].concat(f.slice(1)),null,s,l),t-1),[]))},C:(e,t,r,a,s)=>{t=Oe(t);let l=f=>f;if(a===0){var c=32-8*r;l=f=>f<<c>>>c,s=l(s)}nt(e,{name:t,Kc:l,Oc:(f,b)=>b,Wc:Wn(t,r,a!==0),Vc:null})},k:(e,t,r)=>{function a(l){return new s(S.buffer,x[l+4>>2],x[l>>2])}var s=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array
5][t];r=Oe(r),nt(e,{name:r,Kc:a,Wc:a},{cf:!0})},ob:(e,t)=>{t=Oe(t),nt(e,{name:t,Kc(r){var a=(a=r+4)?ze(R,a,x[r>>2],!0):"";return Et(r),a},Oc(r,a){a instanceof ArrayBuffer&&(a=new Uint8Array(a));var s=typeof a=="string";if(!(s||ArrayBuffer.isView(a)&&a.BYTES_PER_ELEMENT==1))throw new de("Cannot pass non-string to std::string");var l=s?mt(a):a.length,c=fn(4+l+1),f=c+4;return x[c>>2]=l,s?Xe(a,R,f,l+1):R.set(a,f),r!==null&&r.push(Et,c),c},Wc:Gt,Vc(r){Et(r)}})},sa:(e,t,r)=>{if(r=Oe(r),t===2)var a=Er,s=Sr,l=Fr;else a=Mr,s=Ir,l=Cr;nt(e,{name:r,Kc:c=>{var f=a(c+4,x[c>>2]*t,!0);return Et(c),f},Oc:(c,f)=>{if(typeof f!="string")throw new de(`Cannot pass non-string to C++ string type ${r}`);var b=l(f),F=fn(4+b+t);return x[F>>2]=b/t,s(f,F+4,b+t),c!==null&&c.push(Et,F),F},Wc:Gt,Vc(c){Et(c)}})},Fb:(e,t,r,a,s,l)=>{en[e]={name:Oe(t),fe:$e(r,a),dd:$e(s,l),ne:[]}},yb:(e,t,r,a,s,l,c,f,b,F)=>{en[e].ne.push({We:Oe(t),bf:r,$e:$e(a,s),af:l,rf:c,qf:$e(f,b),sf:F})},rb:(e,t)=>{t=Oe(t),nt(e,{jf:!0,name:t,Kc:()=>{},Oc:()=>{}})},zb:()=>{throw 1/0},q:(e,t,r)=>{var[a,...s]=Pr(e,t),l=a.Oc.bind(a),c=s.map(b=>b.Wc.bind(b));e--;var f=Array(e);return t=`methodCaller<(${s.map(b=>b.name)}) => ${a.name}>`,Rr(Ut(t,(b,F,B,X)=>{for(var G=0,ge=0;ge<e;++ge)f[ge]=c[ge](X+G),G+=8;switch(r){case 0:var V=ct(b).apply(null,f);break;case 2:V=Reflect.construct(ct(b),f);break;case 3:V=f[0];break;case 1:V=ct(b)[Xn(F)](...f)}return b=[],V=l(b,V),b.length&&(x[B>>2]=At(b)),V}))},xb:Fn,pb:(e,t)=>
5(e=ct(e),t=ct(t),At(e[t])),Ha:e=>{9<e&&(Rt[e+1]+=1)},p:(e,t,r,a,s)=>In[e](t,r,a,s),ub:()=>At([]),wb:e=>At(Xn(e)),nc:()=>At({}),_a:e=>{var t=ct(e);zt(t),Fn(e)},w:(e,t,r)=>{e=ct(e),t=ct(t),r=ct(r),e[t]=r},Bb:function(e,t){e=-9007199254740992>e||9007199254740992<e?NaN:Number(e),e=new Date(1e3*e),g[t>>2]=e.getUTCSeconds(),g[t+4>>2]=e.getUTCMinutes(),g[t+8>>2]=e.getUTCHours(),g[t+12>>2]=e.getUTCDate(),g[t+16>>2]=e.getUTCMonth(),g[t+20>>2]=e.getUTCFullYear()-1900,g[t+24>>2]=e.getUTCDay(),g[t+28>>2]=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Cb:function(e,t){e=-9007199254740992>e||9007199254740992<e?NaN:Number(e),e=new Date(1e3*e),g[t>>2]=e.getSeconds(),g[t+4>>2]=e.getMinutes(),g[t+8>>2]=e.getHours(),g[t+12>>2]=e.getDate(),g[t+16>>2]=e.getMonth(),g[t+20>>2]=e.getFullYear()-1900,g[t+24>>2]=e.getDay();var r=e.getFullYear();g[t+28>>2]=(r%4!==0||r%100===0&&r%400!==0?Or:xr)[e.getMonth()]+e.getDate()-1|0,g[t+36>>2]=-(60*e.getTimezoneOffset()),r=new Date(e.getFullYear(),6,1).getTimezoneOffset();var a=new Date(e.getFullYear(),0,1).getTimezoneOffset();g[t+32>>2]=(r!=a&&e.getTimezoneOffset()==Math.min(a,r))|0},Db:(e,t,r,a)=>{var s=new Date().getFullYear(),l=new Date(s,0,1).getTimezoneOffset();s=new Date(s,6,1).getTimezoneOffset(),x[e>>2]=60*Math.max(l,s),g[t>>2]=+(l!=s),t=c=>{var f=Math.abs(c);return`UTC${0<=c?"-":"+"}${String(Math.floor(f/60)).padStart(2,"0")}${String(f%60).padStart(2,"0")}`},e=t(l),t=t(s),s<l?(Xe(e,R,r,17),Xe(t,R,a,17)):(Xe(e,R,a,17),Xe(t,R,r,17))},bb:function(e,t,r){(e=He[e].Tc.Qd)&&e.beginPixelLocalStorageWEBGL(new Uint32Array(xt.buffer,4*r,t))},Mb:function(e,t,r){return 0<=e&&3>=e?(se[r>>3]=BigInt(Math.round(1e6*(e===0?Date.now():performance.now()))),0):28},tb:function(e,t,r){var a=h.images;a||(a=new Map,h.images=a);var s=new Image;a.set(e,s),t=h.HEAP8.subarray(t,t+r),r=new Uint8Array(r),r.set(t),s.src=URL.createObjectURL(new Blob([r],{type:"image/png"})),s.onload=function(){h._setWebImage(e,s.width,s.height)}},sb:function(e){var t=h.images;t&&t.get(e)&&t.delete(e)},y:(e,t,r)=>{Cn.length=0;for(var a;a=R[t++];){var s=a!=105;s&=a!=112,r+=s&&r%8?4:0,Cn.push(a==112?x[r>>2]:a==106?se[r>>3]:a==105?g[r>>2]:re[r>>3]),r+=s?8:4}return kr[e](...Cn)},Lb:()=>Date.now(),jb:()=>performance.now(),Ab:e=>{var t=R.length;if(e>>>=0,2147483648<e)return!1;for(var r=1;4>=r;r*=2){var a=t*(1+.2/r);a=Math.min(a,e+100663296);e:{a=(Math.min(2147483648,65536*Math.ceil(Math.max(e,a)/65536))-xt.buffer.byteLength+65535)/65536|0;try{xt.grow(a),_e();var s=1;break e}catch{}s=void 0}if(s)return!0}return!1},t:(e,t)=>(e=He[e],t=t?ze(R,t):"",t.startsWith("GL_")&&(t=t.slice(3)),t=="WEBGL_draw_instanced_base_vertex_base_instance"&&$n(_),t=="WEBGL_multi_draw_instanced_base_vertex_base_instance"&&Yn(_),t=="WEBGL_multi_draw"&&(_.lf=_.getExtension("WEBGL_multi_draw")),t=="EXT_polygon_offset_clamp"&&(_.Ve=_.getExtension("EXT_polygon_offset_clamp")),t=="EXT_clip_control"&&(_.Ue=_.getExtension("EXT_clip_control")),t=="WEBGL_polygon_mode"&&(_.vf=_.getExtension("WEBGL_polygon_mode")),!!e.Tc.getExtension(t)),i:()=>pt?pt.handle:0,Ka:e=>Kt(e)?0:-5,$a:function(e){return e=He[e].Tc,e.xe=e.getExtension("WEBGL_provoking_vertex"),!!e.xe},eb:function(e){e=He[e].Tc;const t=e.getExtension("WEBGL_shader_pixel_local_storage");if(t&&t.isCoherent()){if(t.framebufferTexturePixelLocalStorageWEBGL.length==5)return e.Qd=t,!0;J.warn("WEBGL_shader_pixel_local_storage is advertised, but a deprecated version has been detected. Disabling.")}return!1},ab:function(e,t,r){(e=He[e].Tc.Qd)&&e.endPixelLocalStorageWEBGL(new Uint32Array(xt.buffer,4*r,t))},Gb:(e,t)=>{var r=0,a=0,s;for(s of er()){var l=t+r;x[e+a>>2]=l,r+=Xe(s,R,l,1/0)+1,a+=4}return 0},Hb:(e,t)=>{var r=er();x[e>>2]=r.length,e=0;for(var a of r)e+=mt(a)+1;return x[t>>2]=e,0},Na:function(e){try{var t=je(e);if(t.md===null)throw new y(8);t.be&&(t.be=null);try{t.Hc.close&&t.Hc.close(t)}catch(r){throw r}finally{o[t.md]=null}return t.md=null,0}catch(r){if(typeof Ct>"u"||r.name!=="ErrnoError")throw r;return r.ld}},Ib:function(e,t,r,a){try{e:{var s=je(e);e=t;for(var l,c=t=0;c<r;c++){var f=x[e>>2],b=x[e+4>>2];e+=8;var F=s,B=f,X=b,G=l,ge=S;if(0>X||0>G)throw new y(28);if(F.md===null)throw new y(8);if((F.flags&2097155)===1)throw new y(8);if((F.node.mode&61440)===16384)throw new y(31);if(!F.Hc.read)throw new y(28);var V=typeof G<"u";if(!V)G=F.position;else if(!F.seekable)throw new y(70);var H=F.Hc.read(F,ge,B,X,G);V||(F.position+=H);var ne=H;if(0>ne){var oe=-1;break e}if(t+=ne,ne<b)break;typeof l<"u"&&(l+=ne)}oe=t}return x[a>>2]=oe,0}catch(ue){if(typeof Ct>"u"||ue.name!=="ErrnoError")throw ue;return ue.ld}},Eb:function(e,t,r,a){t=-9007199254740992>t||9007199254740992<t?NaN:Number(t);try{if(isNaN(t))return 61;var s=je(e);return _t(s,t,r),se[a>>3]=BigInt(s.position),s.be&&t===0&&r===0&&(s.be=null),0}catch(l){if(typeof Ct>"u"||l.name!=="ErrnoError")throw l;return l.ld}},Oa:function(e,t,r,a){try{e:{var s=je(e);e=t;for(var l,c=t=0;c<r;c++){var f=x[e>>2],b=x[e+4>>2];e+=8;var F=s,B=f,X=b,G=l,ge=S;if(0>X||0>G)throw new y(28);if(F.md===null)throw new y(8);if(!(F.flags&2097155))throw new y(8);if((F.node.mode&61440)===16384)throw new y(31);if(!F.Hc.write)throw new y(28);F.seekable&&F.flags&1024&&_t(F,0,2);var V=typeof G<"u";if(!V)G=F.position;else if(!F.seekable)throw new y(70);var H=F.Hc.write(F,ge,B,X,G,void 0);V||(F.position+=H);var ne=H;if(0>ne){var oe=-1;break e}if(t+=ne,ne<b)break;typeof l<"u"&&(l+=ne)}oe=t}return x[a>>2]=oe,0}catch(ue){if(typeof Ct>"u"||ue.name!=="ErrnoError")throw ue;return ue.ld}},cb:function(e,t,r,a,s,l){(e=He[e].Tc.Qd)&&e.framebufferPixelLocalClearValuefvWEBGL(t,[r,a,s,l])},db:function(e,t,r,a,s,l){(e=He[e].Tc.Qd)&&e.framebufferTexturePixelLocalStorageWEBGL(t,Lt[r],a,s,l)},f:e=>_.activeTexture(e),E:(e,t)=>{_.attachShader(qe[e],dt[t])},$b:(e,t,r)=>{_.bindAttribLocation(qe[e],t,r?ze(R,r):"")},m:(e,t)=>
5{e==35051?_.Yd=t:e==35052&&(_.ud=t),_.bindBuffer(e,Bt[t])},ta:(e,t,r,a,s)=>{_.bindBufferRange(e,t,Bt[r],a,s)},e:(e,t)=>{_.bindFramebuffer(e,Xt[t])},ha:(e,t)=>{_.bindRenderbuffer(e,$t[t])},Aa:(e,t)=>{_.bindSampler(e,Dt[t])},d:(e,t)=>{_.bindTexture(e,Lt[t])},Z:e=>{_.bindVertexArray(Yt[e])},Ub:(e,t,r,a)=>_.blendColor(e,t,r,a),j:e=>_.blendEquation(e),Vb:(e,t)=>_.blendEquationSeparate(e,t),ba:(e,t)=>_.blendFunc(e,t),Wb:(e,t,r,a)=>_.blendFuncSeparate(e,t,r,a),Y:(e,t,r,a,s,l,c,f,b,F)=>_.blitFramebuffer(e,t,r,a,s,l,c,f,b,F),A:(e,t,r,a)=>{r&&t?_.bufferData(e,R,a,r,t):_.bufferData(e,t,a)},ia:(e,t,r,a)=>{r&&_.bufferSubData(e,t,R,a,r)},Ob:e=>_.clear(e),Zb:(e,t,r,a)=>_.clearBufferfi(e,t,r,a),ua:(e,t,r)=>{_.clearBufferfv(e,t,ee,r>>2)},Yb:(e,t,r)=>{_.clearBufferiv(e,t,g,r>>2)},Qb:(e,t,r)=>{_.clearBufferuiv(e,t,x,r>>2)},Pb:(e,t,r,a)=>_.clearColor(e,t,r,a),ib:e=>_.clearDepth(e),hb:e=>_.clearStencil(e),aa:(e,t,r,a)=>{_.colorMask(!!e,!!t,!!r,!!a)},ma:e=>{_.compileShader(dt[e])},za:(e,t,r,a,s,l,c,f,b)=>{_.ud||!f?_.compressedTexSubImage2D(e,t,r,a,s,l,c,f,b):_.compressedTexSubImage2D(e,t,r,a,s,l,c,R,b,f)},hc:(e,t,r,a,s,l,c,f,b,F,B)=>{_.ud?_.compressedTexSubImage3D(e,t,r,a,s,l,c,f,b,F,B):_.compressedTexSubImage3D(e,t,r,a,s,l,c,f,b,R,B,F)},O:()=>{var e=cn(qe),t=_.createProgram();return t.name=e,t.Nd=t.Ld=t.Md=0,t.he=1,qe[e]=t,e},oa:e=>{var t=cn(dt);return dt[t]=_.createShader(e),t},Da:e=>_.cullFace(e),pa:(e,t)=>{for(var r=0;r<e;r++){var a=g[t+4*r>>2],s=Bt[a];s&&(_.deleteBuffer(s),s.name=0,Bt[a]=null,a==_.Yd&&(_.Yd=0),a==_.ud&&(_.ud=0))}},G:(e,t)=>{for(var r=0;r<e;++r){var a=g[t+4*r>>2],s=Xt[a];s&&(_.deleteFramebuffer(s),s.name=0,Xt[a]=null)}},ra:e=>{if(e){var t=qe[e];t?(_.deleteProgram(t),t.name=0,qe[e]=null):Te||=1281}},Ca:(e,t)=>{for(var r=0;r<e;r++){var a=g[t+4*r>>2],s=$t[a];s&&(_.deleteRenderbuffer(s),s.name=0,$t[a]=null)}},dc:(e,t)=>{for(var r=0;r<e;r++){var a=g[t+4*r>>2],s=Dt[a];s&&(_.deleteSampler(s),s.name=0,Dt[a]=null)}},S:e=>{if(e){var t=dt[e];t?(_.deleteShader(t),dt[e]=null):Te||=1281}},B:(e,t)=>{for(var r=0;r<e;r++){var a=g[t+4*r>>2],s=Lt[a];s&&(_.deleteTexture(s),s.name=0,Lt[a]=null)}},qa:(e,t)=>{for(var r=0;r<e;r++){var a=g[t+4*r>>2];_.deleteVertexArray(Yt[a]),Yt[a]=null}},Fa:e=>_.depthFunc(e),K:e=>{_.depthMask(!!e)},Ga:(e,t)=>_.depthRange(e,t),g:e=>_.disable(e),Sb:e=>{_.disableVertexAttribArray(e)},M:(e,t,r)=>{_.drawArrays(e,t,r)},Ta:(e,t,r,a)=>{_.drawArraysInstanced(e,t,r,a)},fa:(e,t)=>{for(var r=xn[e],a=0;a<e;a++)r[a]=g[t+4*a>>2];_.drawBuffers(r)},Tb:(e,t,r,a)=>{_.drawElements(e,t,r,a)},V:(e,t,r,a,s)=>{_.drawElementsInstanced(e,t,r,a,s)},u:e=>_.enable(e),x:e=>{_.enableVertexAttribArray(e)},mc:()=>_.finish(),Sa:()=>_.flush(),ea:(e,t,r,a)=>{_.framebufferRenderbuffer(e,t,r,$t[a])},n:(e,t,r,a,s)=>{_.framebufferTexture2D(e,t,r,Lt[a],s)},_b:(e,t,r,a,s)=>{_.framebufferTextureLayer(e,t,Lt[r],a,s)},ca:e=>_.frontFace(e),ja:(e,t)=>{Nt(e,t,"createBuffer",Bt)},I:(e,t)=>{Nt(e,t,"createFramebuffer",Xt)},Wa:(e,t)=>{Nt(e,t,"createRenderbuffer",$t)},fc:(e,t)=>{Nt(e,t,"createSampler",Dt)},D:(e,t)=>{Nt(e,t,"createTexture",Lt)},Ba:(e,t)=>{Nt(e,t,"createVertexArray",Yt)},La:e=>_.generateMipmap(e),ec:(e,t)=>tr(e,t,2),h:(e,t)=>tr(e,t,0),ac:(e,t,r,a)=>{e=_.getProgramInfoLog(qe[e]),e===null&&(e="(unknown error)"),t=0<t&&a?Xe(e,R,a,t):0,r&&(g[r>>2]=t)},ga:(e,t,r)=>{if(r)if(e>=Qn)Te||=1281;else if(e=qe[e],t==35716)e=_.getProgramInfoLog(e),e===null&&(e="(unknown error)"),g[r>>2]=e.length+1;else if(t==35719){if(!e.Nd){var a=_.getProgramParameter(e,35718);for(t=0;t<a;++t)e.Nd=Math.max(e.Nd,_.getActiveUniform(e,t).name.length+1)}g[r>>2]=e.Nd}else if(t==35722){if(!e.Ld)for(a=_.getProgramParameter(e,35721),t=0;t<a;++t)e.Ld=Math.max(e.Ld,_.getActiveAttrib(e,t).name.length+1);g[r>>2]=e.Ld}else if(t==35381){if(!e.Md)for(a=_.getProgramParameter(e,35382),t=0;t<a;++t)e.Md=Math.max(e.Md,_.getActiveUniformBlockName(e,t).length+1);g[r>>2]=e.Md}else g[r>>2]=_.getProgramParameter(e,t);else Te||=1281},cc:(e,t,r,a)=>{e=_.getShaderInfoLog(dt[e]),e===null&&(e="(unknown error)"),t=0<t&&a?Xe(e,R,a,t):0,r&&(g[r>>2]=t)},Va:(e,t,r)=>{r?t==35716?(e=_.getShaderInfoLog(dt[e]),e===null&&(e="(unknown error)"),g[r>>2]=e?e.length+1:0):t==35720?(e=_.getShaderSource(dt[e]),g[r>>2]=e?e.length+1:0):g[r>>2]=_.getShaderParameter(dt[e],t):Te||=1281},Ra:e=>{var t=Jn[e];if(!t){switch(e){case 7939:t=Qt(On().join(" "));break;case 7936:case 7937:case 37445:case 37446:(t=_.getParameter(e))||(Te||=1280),t=t?Qt(t):0;break;case 7938:t=Qt(`OpenGL ES 3.0 (${_.getParameter(7938)})`);break;case 35724:t=_.getParameter(35724);var r=t.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);r!==null&&(r[1].length==3&&(r[1]+="0"),t=`OpenGL ES GLSL ES ${r[1]} (${t})`),t=Qt(t);break;default:Te||=1280}Jn[e]=t}return t},lc:(e,t)=>{if(2>pt.version)return Te||=1282,0;var r=Zn[e];if(r)return 0>t||t>=r.length?(Te||=1281,0):r[t];switch(e){case 7939:return r=On().map(Qt),r=Zn[e]=r,0>t||t>=r.length?(Te||=1281,0):r[t];default:return Te||=1280,0}},R:(e,t)=>_.getUniformBlockIndex(qe[e],t?ze(R,t):""),X:(e,t)=>{if(t=t?ze(R,t):"",e=qe[e]){var r=e,a=r.Bd,s=r.De,l;if(!a){r.Bd=a={},r.Ce={};var c=_.getProgramParameter(r,35718);for(l=0;l<c;++l){var f=_.getActiveUniform(r,l),b=f.name;f=f.size;var F=nr(b);F=0<F?b.slice(0,F):b;var B=r.he;for(r.he+=f,s[F]=[f,B],b=0;b<f;++b)a[B]=b,r.Ce[B++]=F}}if(r=e.Bd,a=0,s=t,l=nr(t),0<l&&(a=parseInt(t.slice(l+1))>>>0,s=t.slice(0,l)),(s=e.De[s])&&a<s[0]&&(a+=s[1],r[a]=r[a]||_.getUniformLocation(e,t)))return a}else Te||=1281;return-1},L:(e,t,r)=>{for(var a=xn[t],s=0;s<t;s++)a[s]=g[r+4*s>>2];
5_.invalidateFramebuffer(e,a)},Xa:e=>(e=Bt[e])?_.isBuffer(e):0,ic:e=>(e=Xt[e])?_.isFramebuffer(e):0,kc:e=>(e=qe[e])?_.isProgram(e):0,jc:e=>(e=Yt[e])?_.isVertexArray(e):0,la:e=>{e=qe[e],_.linkProgram(e),e.Bd=0,e.De={}},v:(e,t)=>{e==3317?Rn=t:e==3314&&(qn=t),_.pixelStorei(e,t)},Xb:(e,t)=>_.polygonOffset(e,t),Ya:e=>_.readBuffer(e),Rb:(e,t,r,a,s,l,c)=>{if(_.Yd)_.readPixels(e,t,r,a,s,l,c);else{var f=dn(l);c>>>=31-Math.clz32(f.BYTES_PER_ELEMENT),_.readPixels(e,t,r,a,s,l,f,c)}},xa:(e,t,r,a,s)=>_.renderbufferStorageMultisample(e,t,r,a,s),va:(e,t,r)=>{_.samplerParameterf(Dt[e],t,r)},H:(e,t,r)=>{_.samplerParameteri(Dt[e],t,r)},Ea:(e,t,r,a)=>_.scissor(e,t,r,a),na:(e,t,r,a)=>{for(var s="",l=0;l<t;++l){var c=(c=x[r+4*l>>2])?ze(R,c,a?x[a+4*l>>2]:void 0):"";s+=c}_.shaderSource(dt[e],s)},gb:(e,t,r)=>_.stencilFunc(e,t,r),J:(e,t,r,a)=>_.stencilFuncSeparate(e,t,r,a),$:e=>_.stencilMask(e),Ua:(e,t)=>_.stencilMaskSeparate(e,t),fb:(e,t,r)=>_.stencilOp(e,t,r),_:(e,t,r,a)=>_.stencilOpSeparate(e,t,r,a),s:(e,t,r)=>_.texParameteri(e,t,r),o:(e,t,r,a,s)=>_.texStorage2D(e,t,r,a,s),wa:(e,t,r,a,s,l)=>_.texStorage3D(e,t,r,a,s,l),F:(e,t,r,a,s,l,c,f,b)=>{if(_.ud)_.texSubImage2D(e,t,r,a,s,l,c,f,b);else if(b){var F=dn(f);_.texSubImage2D(e,t,r,a,s,l,c,f,F,b>>>31-Math.clz32(F.BYTES_PER_ELEMENT))}else{if(b){F=dn(f);var B=l*((qn||s)*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[c-6402]||1)*F.BYTES_PER_ELEMENT+Rn-1&-Rn);b=F.subarray(b>>>31-Math.clz32(F.BYTES_PER_ELEMENT),b+B>>>31-Math.clz32(F.BYTES_PER_ELEMENT))}else b=null;_.texSubImage2D(e,t,r,a,s,l,c,f,b)}},gc:(e,t,r,a,s,l,c,f,b,F,B)=>{if(_.ud)_.texSubImage3D(e,t,r,a,s,l,c,f,b,F,B);else if(B){var X=dn(F);_.texSubImage3D(e,t,r,a,s,l,c,f,b,F,X,B>>>31-Math.clz32(X.BYTES_PER_ELEMENT))}else _.texSubImage3D(e,t,r,a,s,l,c,f,b,F,null)},ka:(e,t)=>{var r=_,a=r.uniform1i,s=_.Qe;if(s){var l=s.Bd[e];typeof l=="number"&&(s.Bd[e]=l=_.getUniformLocation(s,s.Ce[e]+(0<l?`[${l}]`:""))),e=l}else Te||=1282,e=void 0;a.call(r,e,t)},Q:(e,t,r)=>{e=qe[e],_.uniformBlockBinding(e,t,r)},T:e=>{e=qe[e],_.useProgram(e),_.Qe=e},P:(e,t)=>{_.vertexAttribDivisor(e,t)},W:(e,t,r,a,s)=>{_.vertexAttribIPointer(e,t,r,a,s)},z:(e,t,r,a,s,l)=>{_.vertexAttribPointer(e,t,r,!!a,s,l)},N:(e,t,r,a)=>_.viewport(e,t,r,a),kb:Dr,lb:function(){return-1<navigator.platform.indexOf("Win")},Za:function(e,t){(e=He[e].Tc.xe)&&e.provokingVertexWEBGL(t)},vb:function(e,t){var r=h.images;r&&(t=r.get(t))&&(e=He[e].Tc,e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1))},mb:function(e,t,r){t=new Uint8Array(xt.buffer,t,r),r=new Uint8Array(r),r.set(t),createImageBitmap(new Blob([r])).then(function(a){var s=new OffscreenCanvas(a.width,a.height).getContext("2d");s.drawImage(a,0,0),s=s.getImageData(0,0,a.width,a.height);var l=s.data.length,c=h.Je(l);h.wf.set(s.data,c),h.yf(e,a.width,a.height,c,l)}).catch(function(a){a=a.message||"decode failed";var s=h.Of(a)+1,l=h.Je(s);h.Uf(a,l,s),h.zf(e,l),h.xf(l)})}};function Dr(e,t,r){var a=lr();try{Tn.get(e)(t,r)}catch(s){if(ur(a),s!==s+0)throw s;sr(1,0)}}var hn;return hn=await async function(){function e(r){return r=hn=r.exports,Et=r.rc,fn=r.sc,h._setWebImage=r.tc,rr=r.uc,h._wasm_image_decode_complete=r.vc,h._wasm_image_decode_error=r.wc,ir=h._ma_device__on_notification_unlocked=r.xc,h._ma_malloc_emscripten=r.yc,h._ma_free_emscripten=r.zc,ar=h._ma_device_process_pcm_frames_capture__webaudio=r.Ac,or=h._ma_device_process_pcm_frames_playback__webaudio=r.Bc,sr=r.Cc,ur=r.Dc,lr=r.Ec,xt=r.oc,Tn=r.qc,_e(),hn}var t={a:Br};return h.instantiateWasm?new Promise(r=>{h.instantiateWasm(t,(a,s)=>{r(e(a,s))})}):(Ee??=h.locateFile?h.locateFile("webgl2_advanced.wasm",K):K+"webgl2_advanced.wasm",e((await Ve(t)).instance))}(),function(){function e(){if(h.calledRun=!0,!ae){if(ye=!0,!h.noFSInit&&!u){var t,r;u=!0,t??=h.stdin,r??=h.stdout,a??=h.stderr,t?Ze("stdin",t):It("/dev/tty","/dev/stdin"),r?Ze("stdout",null,r):It("/dev/tty","/dev/stdout"),a?Ze("stderr",null,a):It("/dev/tty1","/dev/stderr"),Ne("/dev/stdin",0),Ne("/dev/stdout",1),Ne("/dev/stderr",1)}if(hn.pc(),d=!1,v?.(h),h.onRuntimeInitialized?.(),h.postRun)for(typeof h.postRun=="function"&&(h.postRu
5n=[h.postRun]);h.postRun.length;){var a=h.postRun.shift();st.push(a)}rt(st)}}if(h.preRun)for(typeof h.preRun=="function"&&(h.preRun=[h.preRun]);h.preRun.length;)ft();rt(ut),h.setStatus?(h.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>h.setStatus(""),1),e()},1)):e()}(),ye?w=h:w=new Promise((e,t)=>{v=e,A=t}),w}})();const Z=p},we=>{we.exports=JSON.parse(`{"name":"@rive-app/webgl2","version":"2.42.0","description":"Rive's webgl2 based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <[email protected]> (https://rive.app)","Maxwell Talbot <[email protected]> (https://rive.app)","Arthur Vivian <[email protected]> (https://rive.app)","Umberto Sonnino <[email protected]> (https://rive.app)","Matthew Sullivan <[email protected]> (mailto:[email protected])","Chris Dalton <[email protected]> (https://rive.app)"],"license":"MIT","files":["rive.js","rive.wasm","rive_fallback.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils","semantics"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}`)},(we,Q,j)=>{j.r(Q),j.d(Q,{AccessibilityOverlay:()=>Z.AccessibilityOverlay,CHECK_STATE_MASK:()=>W.CHECK_STATE_MASK,CHECK_STATE_OFFSET:()=>W.CHECK_STATE_OFFSET,SemanticActionType:()=>W.SemanticActionType,SemanticCheckState:()=>W.SemanticCheckState,SemanticMode:()=>W.SemanticMode,SemanticRole:()=>W.SemanticRole,SemanticState:()=>W.SemanticState,SemanticTrait:()=>W.SemanticTrait,SemanticTreeModel:()=>p.SemanticTreeModel,checkStateOf:()=>W.checkStateOf,hasState:()=>W.hasState,hasTrait:()=>W.hasTrait,roleName:()=>W.roleName,stateNames:()=>W.stateNames,traitNames:()=>W.traitNames});var p=j(7),Z=j(9),W=j(8)},(we,Q,j)=>{j.r(Q),j.d(Q,{SemanticTreeModel:()=>W});var p=j(8),Z=function(C,M,T){if(T||arguments.length===2)for(var K=0,q=M.length,fe;K<q;K++)(fe||!(K in M))&&(fe||(fe=Array.prototype.slice.call(M,0,K)),fe[K]=M[K]);return C.concat(fe||Array.prototype.slice.call(M))},W=function(){function C(){this._nodesById=new Map,this._roots=[],this._semanticVersion=0,this._geometryVersion=0,this._geometryChangedIds=new Set,this._semanticChangedIds=new Set,this._debug=!1}return Object.defineProperty(C.prototype,"nodeCount",{get:function(){return this._nodesById.size},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"semanticVersion",{get:function(){return this._semanticVersion},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"geometryVersion",{get:function(){return this._geometryVersion},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"geometryChangedIds",{get:function(){return this._geometryChangedIds},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"semanticChangedIds",{get:function(){return this._semanticChangedIds},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"roots",{get:function(){return this._roots},enumerable:!1,configurable:!0}),C.prototype.nodeById=function(M){return this._nodesById.get(M)},C.prototype.siblingIndexOf=function(M){var T=this._nodesById.get(M);if(!T)return-1;if(T.parentId<0)return this._roots.indexOf(M);var K=this._nodesById.get(T.parentId);return K?K.children.indexOf(M):-1},C.prototype.detach=function(M){var T=this._nodesById.get(M);if(T)if(T.parentId<0){var K=this._roots.indexOf(M);K!==-1&&this._roots.splice(K,1)}else{var q=this._nodesById.get(T.parentId);if(q){var K=q.children.indexOf(M);K!==-1&&q.children.splice(K,1)}}},C.prototype.attach=function(M,T,K){var q=this._nodesById.get(M);if(q)if(T<0){q.parentId=-1;var fe=O(K,0,this._roots.length);this._roots.splice(fe,0,M)}else{var k=this._nodesById.get(T);if(!k)q.parentId=-1,this._roots.push(M);else{q.parentId=T;var fe=O(K,0,k.children.length);k.children.splice(fe,0,M)}}},C.prototype.removeSubtree=function(M){var T=this._nodesById.get(M);if(T){for(var K=Z([],T.children,!0),q=0,fe=K;q<fe.length;q++){var k=fe[q];this.removeSubtree(k)}this.detach(M),this._nodesById.delete(M)}},C.prototype.applyDiff=function(M){var T,K,q=this;this._geometryChangedIds.clear(),this._semanticChangedIds.clear();for(var fe=!1,k=!1,D=function(){fe=!0},Y=function(Ye){fe=!0,q._semanticChangedIds.add(Ye)},ae=function(Ye){k=!0,q._geometryChangedIds.add(Ye)},E=0,v=M.removed;E<v.length;E++){var A=v[E];this._nodesById.has(A)&&(this.removeSubtree(A),D())}for(var S=0,R=M.added;S<R.length;S++){var I=R[S],P=this._nodesById.get(I.id);P?($(P,I)&&(L(P,I),Y(I.id)),ie(P,I)&&(te(P,I),ae(I.id))):(this._nodesById.set(I.id,h(I)),Y(I.id),ae(I.id)),this.detach(I.id),this.attach(I.id,I.parentId,I.siblingIndex)}for(var g=0,x=M.moved;g<x.length;g++){var I=x[g],P=this._nodesById.get(I.id);if(P){var ee=P.parentId!==I.parentId,re=this.siblingIndexOf(I.id),se=ie(P,I);se&&(te(P,I),ae(I.id)),this.detach(I.id),this.attach(I.id,I.parentId,I.siblingIndex),(ee||this.siblingIndexOf(I.id)!==re)&&D()}}for(var pe=0,ye=M.childrenUpdated;pe<ye.length;pe++){var _e=ye[pe];if(_e.parentId<0){var me=_e.childIds.filter(function(Ye){return q._nodesById.has(Ye)}
5);if(!w(this._roots,me)){this._roots.length=0,(T=this._roots).push.apply(T,me);for(var Ee=0,ke=this._roots;Ee<ke.length;Ee++){var A=ke[Ee],Se=this._nodesById.get(A);Se&&(Se.parentId=-1)}D()}}else{var Ve=this._nodesById.get(_e.parentId);if(!Ve)continue;var me=_e.childIds.filter(function(Ae){return q._nodesById.has(Ae)});if(!w(Ve.children,me)){Ve.children.length=0,(K=Ve.children).push.apply(K,me);for(var rt=0,st=Ve.children;rt<st.length;rt++){var A=st[rt],Se=this._nodesById.get(A);Se&&(Se.parentId=_e.parentId)}D()}}}for(var ut=0,ft=M.updatedSemantic;ut<ft.length;ut++){var I=ft[ut],P=this._nodesById.get(I.id);P&&$(P,I)&&(L(P,I),Y(I.id))}for(var Be=0,et=M.updatedGeometry;Be<et.length;Be++){var I=et[Be],P=this._nodesById.get(I.id);P&&ie(P,I)&&(te(P,I),ae(I.id))}!fe&&!k||(fe&&this._semanticVersion++,k&&this._geometryVersion++,this._debug&&this.logDiff(M,fe,k))},Object.defineProperty(C.prototype,"debug",{set:function(M){this._debug=M},enumerable:!1,configurable:!0}),C.prototype.logDiff=function(M,T,K){for(var q=["[rive:semantics] semantic v".concat(this._semanticVersion)+(K?" geometry v".concat(this._geometryVersion):"")+(T?"":" (geometry-only)")],fe=0,k=M.removed;fe<k.length;fe++){var D=k[fe];q.push("  - removed #".concat(D))}for(var Y=0,ae=M.added;Y<ae.length;Y++){var E=ae[Y];q.push("  + added #".concat(E.id," ").concat((0,p.roleName)(E.role))+(E.label?' "'.concat(E.label,'"'):"")+" bounds:(".concat(E.minX.toFixed(1),",").concat(E.minY.toFixed(1),")-(").concat(E.maxX.toFixed(1),",").concat(E.maxY.toFixed(1),")")+" states=[".concat((0,p.stateNames)(E.stateFlags),"]")+" traits=[".concat((0,p.traitNames)(E.traitFlags),"]"))}for(var v=0,A=M.moved;v<A.length;v++){var E=A[v];q.push("  ~ moved #".concat(E.id," \u2192 parent=").concat(E.parentId," idx=").concat(E.siblingIndex)+" bounds:(".concat(E.minX.toFixed(1),",").concat(E.minY.toFixed(1),")-(").concat(E.maxX.toFixed(1),",").concat(E.maxY.toFixed(1),")"))}for(var S=0,R=M.childrenUpdated;S<R.length;S++){var I=R[S];q.push("  \u2195 children of ".concat(I.parentId<0?"root":"#"+I.parentId,": [").concat(I.childIds.join(", "),"]"))}for(var P=0,g=M.updatedSemantic;P<g.length;P++){var E=g[P];q.push("  \u270E semantic #".concat(E.id," ").concat((0,p.roleName)(E.role))+(E.label?' "'.concat(E.label,'"'):"")+" states=[".concat((0,p.stateNames)(E.stateFlags),"]")+" traits=[".concat((0,p.traitNames)(E.traitFlags),"]"))}for(var x=0,ee=M.updatedGeometry;x<ee.length;x++){var E=ee[x];q.push("  \u229E geometry #".concat(E.id," (").concat(E.minX.toFixed(1),",").concat(E.minY.toFixed(1),")-(").concat(E.maxX.toFixed(1),",").concat(E.maxY.toFixed(1),")"))}J.log(q.join(`
6`))},C.prototype.flattened=function(){for(var M=this,T=[],K=function(D,Y){var ae=M._nodesById.get(D);if(ae){T.push({depth:Y,node:ae});for(var E=0,v=ae.children;E<v.length;E++){var A=v[E];K(A,Y+1)}}},q=0,fe=this._roots;q<fe.length;q++){var k=fe[q];K(k,0)}return T},C}();function O(C,M,T){return C<M?M:C>T?T:C}function w(C,M){if(C.length!==M.length)return!1;for(var T=0;T<C.length;T++)if(C[T]!==M[T])return!1;return!0}function h(C){return{id:C.id,parentId:-1,role:C.role,label:C.label,value:C.value,hint:C.hint,stateFlags:C.stateFlags,traitFlags:C.traitFlags,headingLevel:C.headingLevel,minX:C.minX,minY:C.minY,maxX:C.maxX,maxY:C.maxY,children:[]}}function $(C,M){return C.role!==M.role||C.label!==M.label||C.value!==M.value||C.hint!==M.hint||C.stateFlags!==M.stateFlags||C.traitFlags!==M.traitFlags||C.headingLevel!==M.headingLevel}function ie(C,M){return C.minX!==M.minX||C.minY!==M.minY||C.maxX!==M.maxX||C.maxY!==M.maxY}function L(C,M){C.role=M.role,C.label=M.label,C.value=M.value,C.hint=M.hint,C.stateFlags=M.stateFlags,C.traitFlags=M.traitFlags,C.headingLevel=M.headingLevel}function te(C,M){C.minX=M.minX,C.minY=M.minY,C.maxX=M.maxX,C.maxY=M.maxY}},(we,Q,j)=>{j.r(Q),j.d(Q,{CHECK_STATE_MASK:()=>h,CHECK_STATE_OFFSET:()=>w,SemanticActionType:()=>C,SemanticCheckState:()=>O,SemanticMode:()=>ie,SemanticRole:()=>p,SemanticState:()=>Z,SemanticTrait:()=>L,checkStateOf:()=>$,hasState:()=>W,hasTrait:()=>te,roleName:()=>ae,stateNames:()=>E,traitNames:()=>v});var p={none:0,button:1,link:2,checkbox:3,switchControl:4,slider:5,textField:6,text:7,image:8,group:9,list:10,listItem:11,tab:12,tabList:13,dialog:14,alertDialog:15,radioGroup:16,radioButton:17},Z={None:0,Expanded:1,Selected:2,Toggled:16,Required:32,Disabled:64,Focused:128,Hidden:256,LiveRegion:512,ReadOnly:1024,Modal:2048,Obscured:4096,Multiline:8192};function W(A,S){return(A&S)!==0}var O={Unchecked:0,Checked:1,Mixed:2},w=2,h=3<<w;function $(A){var S=(A&h)>>w;return S>=O.Mixed?O.Mixed:S}var ie={Disabled:"disabled",Enabled:"enabled"},L={None:0,Expandable:1,Selectable:2,Checkable:4,Toggleable:8,Requirable:16,Enablable:32,Focusable:64};function te(A,S){return(A&S)!==0}for(var C={tap:0,increase:1,decrease:2},M={},T=0,K=Object.entries(p);T<K.length;T++){var q=K[T],fe=q[0],k=q[1];M[k]=fe}var D=Object.entries(Z).filter(function(A){var S=A[1];return S!==0}),Y=Object.entries(L).filter(function(A){var S=A[1];return S!==0});function ae(A){var S;return(S=M[A])!==null&&S!==void 0?S:"unknown(".concat(A,")")}function E(A){if(A===0)return"none";for(var S=[],R=0,I=D;R<I.length;R++){var P=I[R],g=P[0],x=P[1];A&x&&S.push(g)}switch($(A)){case O.Checked:S.push("Checked");break;case O.Mixed:S.push("Mixed");break}return S.join(", ")||"none"}function v(A){if(A===0)return"none";for(var S=[],R=0,I=Y;R<I.length;R++){var P=I[R],g=P[0],x=P[1];A&x&&S.push(g)}return S.join(", ")||"none"}},(we,Q,j)=>
6{j.r(Q),j.d(Q,{AccessibilityOverlay:()=>Z});var p=j(8),Z=function(){function E(v){var A=this,S;this.elements=new Map,this.descElements=new Map,this.lastSemanticVersion=-1,this.lastGeometryVersion=-1,this.pendingTextGeometry=[],this.textGeometryKeys=new WeakMap,this.lastCanvasPositioning={width:-1,height:-1,offsetTop:-1,offsetLeft:-1},this._geometryDirty=!0,this.isUpdating=!1,this.transformContainer=null,this._artboardBounds={minX:0,minY:0,maxX:0,maxY:0},this.repositionTimer=null,this.canvasResizeObserver=null,this.parentResizeObserver=null,this.positionObserver=null,this._onWindowResize=function(){return A.scheduleReposition()},this.instanceId=v.instanceId,this.fireAction=v.fireAction,this.requestFocus=v.requestFocus,this.clearFocus=v.clearFocus,this.canvas=v.canvas,this.semanticsOptions=v.semanticsOptions,this.allowFocusInterrupt=(S=v.allowFocusInterrupt)!==null&&S!==void 0?S:!1,this.container=this.createContainer(v.canvas),this.attachPositionObservers()}return E.prototype.getSemanticOverlayContainer=function(){return this.container},E.prototype.attachPositionObservers=function(){var v=this;this.canvasResizeObserver=new ResizeObserver(function(){return v.scheduleReposition()}),this.canvasResizeObserver.observe(this.canvas);var A=this.canvas.parentElement;A&&(this.parentResizeObserver=new ResizeObserver(function(){return v.scheduleReposition()}),this.parentResizeObserver.observe(A)),window.addEventListener("resize",this._onWindowResize),this.observePosition()},E.prototype.observePosition=function(){var v=this,A;if(!(typeof IntersectionObserver>"u")){(A=this.positionObserver)===null||A===void 0||A.disconnect(),this.positionObserver=null;var S=this.canvas.getBoundingClientRect();if(!(!S.width||!S.height)){var R=function(g){return"".concat(-Math.round(g),"px")},I=[S.top,window.innerWidth-S.right,window.innerHeight-S.bottom,S.left].map(R).join(" "),P=!1;this.positionObserver=new IntersectionObserver(function(){if(!P){P=!0;return}v.scheduleReposition()},{threshold:1,rootMargin:I}),this.positionObserver.observe(this.canvas)}}},E.prototype.scheduleReposition=function(){var v=this;this._geometryDirty=!0,this.repositionTimer===null&&(this.repositionTimer=setTimeout(function(){v.repositionTimer=null,v.syncContainerGeometry(),v.observePosition()},500))},E.prototype.syncContainerGeometry=function(){var v=this.canvas.getBoundingClientRect(),A=this.canvas.offsetTop,S=this.canvas.offsetLeft;v.width===this.lastCanvasPositioning.width&&v.height===this.lastCanvasPositioning.height&&A===this.lastCanvasPositioning.offsetTop&&S===this.lastCanvasPositioning.offsetLeft||(this.container.style.top=A+"px",this.container.style.left=S+"px",this.container.style.width=v.width+"px",this.container.style.height=v.height+"px",this.container.tabIndex=-1,this.lastCanvasPositioning.width=v.width,this.lastCanvasPositioning.height=v.height,this.lastCanvasPositioning.offsetTop=A,this.lastCanvasPositioning.offsetLeft=S)},E.prototype.createContainer=function(v){var A,S,R=document.createElement("div");R.id="rive-a11y-".concat(this.instanceId),R.setAttribute("role","region"),R.setAttribute("aria-label",(S=(A=this.semanticsOptions)===null||A===void 0?void 0:A.riveCanvasLabel)!==null&&S!==void 0?S:"Rive animation");var I=v.getBoundingClientRect();return R.style.cssText=["position:absolute","top:".concat(v.offsetTop,"px"),"left:".concat(v.offsetLeft,"px"),"width:".concat(I.width,"px"),"height:".concat(I.height,"px"),"overflow:hidden","pointer-events:none","opacity:0"].join(";"),v.insertAdjacentElement("afterend",R),R},E.prototype.needsUpdate=function(v){var A=v.semanticVersion!==this.lastSemanticVersion,S=v.geometryVersion!==this.lastGeometryVersion,R=this._geometryDirty||!this.transformContainer;return!A&&!S&&!R?null:{semanticChanged:A,nodeGeometryChanged:S,layoutChanged:R}},E.prototype.update=function(v,A,S,R,I){var P=I??this.needsUpdate(v);!P&&A&&(P={semanticChanged:!1,nodeGeometryChanged:!1,layoutChanged:!0}),P&&this.performUpdate(v,A,S,R,P)},E.prototype.performUpdate=function(v,A,S,R,I){var P,g=I.semanticChanged,x=I.nodeGeometryChanged,ee=v.semanticVersion-this.lastSemanticVersion>1;if(this.lastSemanticVersion=v.semanticVersion,this.lastGeometryVersion=v.geometryVersion,this.isUpdating=!0,this._artboardBounds=R,A&&(this.syncContainerGeometry(),this.syncTransformContainer(A,S,R),this._geometryDirty=!1),g){var re=(P=this.transformContainer)!==null&&P!==void 0?P:this.container,se=new Set;this.rebuildChildren(re,v.roots,v,0,0,se,ee);var pe=[];
6this.elements.forEach(function(Se,Ve){se.has(Ve)||pe.push(Ve)});for(var ye=0,_e=pe;ye<_e.length;ye++){var me=_e[ye],Ee=this.elements.get(me);Ee&&Ee.parentNode&&Ee.parentNode.removeChild(Ee),this.elements.delete(me);var ke=this.descElements.get(me);ke&&ke.parentNode&&ke.parentNode.removeChild(ke),this.descElements.delete(me)}}else x&&this.updateGeometryForChangedNodes(v);this.flushTextGeometry(),this.isUpdating=!1},E.prototype.destroy=function(){var v,A,S;this.repositionTimer!==null&&(clearTimeout(this.repositionTimer),this.repositionTimer=null),window.removeEventListener("resize",this._onWindowResize),(v=this.canvasResizeObserver)===null||v===void 0||v.disconnect(),(A=this.parentResizeObserver)===null||A===void 0||A.disconnect(),(S=this.positionObserver)===null||S===void 0||S.disconnect(),this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.elements.clear(),this.descElements.clear(),this.pendingTextGeometry.length=0},E.prototype.rebuildChildren=function(v,A,S,R,I,P,g){for(var x=0;x<A.length;x++){var ee=A[x],re=S.nodeById(ee);if(re){P.add(ee);var se=this.elements.get(ee),pe=!se;se||(se=this.createElement(re),this.elements.set(ee,se)),(pe||g||S.semanticChangedIds.has(ee))&&this.applyAttributes(se,re),this.applyPosition(se,re,R,I);var ye=v.children[x];if(ye!==se&&(ye?v.insertBefore(se,ye):v.appendChild(se)),(0,p.hasTrait)(re.traitFlags,p.SemanticTrait.Focusable)&&(0,p.hasState)(re.stateFlags,p.SemanticState.Focused)){var _e=document.activeElement,me=_e?.closest('[aria-modal="true"]'),Ee=!!me&&this.container.contains(me)&&!me.contains(se);_e!==se&&!Ee&&this.canMoveFocus()&&se.focus()}re.children.length>0&&this.rebuildChildren(se,re.children,S,re.minX,re.minY,P,g),pe&&this.autoFocusDialogOnAppear(se,re,S)}}},E.prototype.updateGeometryForChangedNodes=function(v){for(var A,S,R=0,I=Array.from(v.geometryChangedIds);R<I.length;R++){var P=I[R],g=v.nodeById(P);if(g){var x=0,ee=0,re=(A=this.transformContainer)!==null&&A!==void 0?A:this.container;if(g.parentId>=0){var se=v.nodeById(g.parentId);se&&(x=se.minX,ee=se.minY,re=(S=this.elements.get(g.parentId))!==null&&S!==void 0?S:re)}this.updateNodeGeometrySubtree(v,P,x,ee,re)}}},E.prototype.updateNodeGeometrySubtree=function(v,A,S,R,I){var P=v.nodeById(A);if(P){var g=this.elements.get(A);if(g){this.applyPosition(g,P,S,R);for(var x=0,ee=P.children;x<ee.length;x++){var re=ee[x];this.updateNodeGeometrySubtree(v,re,P.minX,P.minY,g)}}}},E.prototype.canMoveFocus=function(){var v=document.activeElement,A=v===this.canvas||this.container.contains(v);return A||this.allowFocusInterrupt},E.prototype.autoFocusDialogOnAppear=function(v,A,S){var R;if(k(A.role,A.stateFlags)&&this.canMoveFocus()){var I=document.activeElement;if(!(I&&I!==v&&v.contains(I))){var P=(R=this.routeDefaultFocusTarget(A,S))!==null&&R!==void 0?R:v;P.hasAttribute("tabindex")||P.setAttribute("tabindex","-1"),document.activeElement!==P&&P.focus({preventScroll:!0})}}},E.prototype.routeDefaultFocusTarget=function(v,A){for(var S,R=0,I=v.children;R<I.length;R++){var P=I[R],g=A.nodeById(P);if(g){var x=this.elements.get(P);if(x&&D(g))return x;if(g.children.length>0||!g.label){var ee=this.routeDefaultFocusTarget(g,A);if(ee)return ee;continue}if(x)return(S=x.querySelector(":scope > span"))!==null&&S!==void 0?S:x}}return null},Object.defineProperty(E.prototype,"nodeIdPrefix",{get:function(){return"rive-".concat(this.instanceId,"-sem-")},enumerable:!1,configurable:!0}),E.prototype.nodeIdFromElement=function(v){if(!v.id.startsWith(this.nodeIdPrefix))return null;var A=v.id.slice(this.nodeIdPrefix.length);if(!A)return null;var S=Number(A);return Number.isNaN(S)?null:S},E.prototype.createElement=function(v){var A=Y(v.role),S=document.createElement(A);if(S.id="".concat(this.nodeIdPrefix).concat(v.id),S.style.cssText=te,v.role===p.SemanticRole.text){var R=document.createElement("span");R.style.cssText=C,S.appendChild(R)}return this.attachActionHandlers(S,v),S},E.prototype.attachRovingNav=function(v,A){var S=this;v.addEventListener("keydown",function(R){var I=null;if(R.key==="ArrowRight"||R.key==="ArrowDown"?I="next":R.key==="ArrowLeft"||R.key==="ArrowUp"?I="prev":A.includeHomeEnd&&R.key==="Home"?I="first":A.includeHomeEnd&&R.key==="End"&&(I="last"),!!I){R.preventDefault();var P=A.members(),g=P.indexOf(v);if(!(g<0)){var x=P.length,ee=I==="next"?P[(g+1)%x]:I==="prev"?P[(g-1+x)%x]:I==="first"?P[0]:P[x-1];if(ee&&ee!==v){ee.focus();var re=S.nodeIdFromElement(ee);re!==null&&S.fireAction(re,p.SemanticActionType.tap)}}}})},E.prototype.attachActionHandlers=function(v,A){var S=this,R=A.role,I=A.id;if(q(R)){v.addEventListener("click",function(){S.fireAction(I,p.SemanticActionType.tap)});var P=R===p.SemanticRole.link?["Enter"]:["Enter"," "];v.addEventListener("keydown",function(g){P.includes(g.key)&&(g.preventDefault(),S.fireAction(I,p.SemanticActionType.tap))})}R===p.SemanticRole.slider&&v.addEventListener("keydown",function(g){g.key==="ArrowRight"||g.key==="ArrowUp"?(g.preventDefault(),S.fireAction(I,p.SemanticActionType.increase)):(g.key==="ArrowLeft"||g.key==="ArrowDown")&&(g.preventDefault(),S.fireAction(I,p.SemanticActionType.decrease))}),R===p.SemanticRole.tab&&this.attachRovingNav(v,{includeHomeEnd:!0,members:function(){var g=v.parentElement;return g?Array.from(g.children).filter(function(x){return x instanceof HTMLElement&&x.getAttribute("role")==="tab"}):[]}}),R===p.SemanticRole.radioButton&&this.attachRovingNav(v,{includeHomeEnd:!1,members:function(){var g,x=(g=v.closest('[role="radiogroup"]'))!==null&&g!==void 0?g:v.parentElement;return x?Array.from(x.querySelectorAll('[role="radio"]')):[]}}),(0,p.hasTrait)(A.traitFlags,p.SemanticTrait.Focusable)&&v.addEventListener("focus",function(){S.requestFocus(I)})},E.prototype.applyAttributes=function(v,A){var S,R,I,P=A.role,g=A.stateFlags,x=A.traitFlags,ee=ae(P);if(ee?M(v,"role",ee):T(v,"role"),P===p.SemanticRole.link&&M(v,"role","link"),fe(P)||(0,p.hasTrait)(x,p.SemanticTrait.Focusable)||P===p.SemanticRole.listItem?M(v,"tabindex","-1"):T(v,"tabindex"),A.label?M(v,"aria-label",A.label):T(v,"aria-label"),P===p.SemanticRole.slider){if(A.value){var re=parseFloat(A.value);Number.isFinite(re)?M(v,"aria-valuenow",String(re)):T(v,"aria-valuenow"),M(v,"aria-valuetext",A.value)}else T(v,"aria-valuenow"),T(v,"aria-valuetext");M(v,"aria-orientation","horizontal"),K(v,"aria-readonly",(0,p.hasState)(g,p.SemanticState.ReadOnly))}else T(v,"aria-valuenow"),T(v,"aria-valuetext"),T(v,"aria-orientation"),T(v,"aria-readonly");if(A.hint){var se="rive-".concat(this.instanceId,"-desc-").concat(A.id),pe=this.descElements.get(A.id);pe||(pe=document.createElement("span"),pe.id=se,pe.style.cssText=L,this.container.appendChild(pe),this.descElements.set(A.id,pe)),pe.textContent!==A.hint&&(pe.textContent=A.hint),M(v,"aria-describedby",se)}else{T(v,"aria-describedby");var ye=this.descElements.get(A.id);ye&&(ye.parentNode&&ye.parentNode.removeChild(ye),this.descElements.delete(A.id))}if(P===p.SemanticRole.text){var _e=(S=v.querySelector(":scope > span"))!==null&&S!==void 0?S:v,me=(R=A.label)!==null&&R!==void 0?R:"";_e.textContent!==me&&(_e.textContent=me),T(v,"aria-label"),A.headingLevel>0?(M(v,"role","heading"),M(v,"aria-level",String(A.headingLevel))):T(v,"aria-level")}if((0,p.hasTrait)(x,p.SemanticTrait.Expandable)&&W.has(P)?K(v,"aria-expanded",(0,p.hasState)(g,p.SemanticState.Expanded)):T(v,"aria-expanded"),P===p.SemanticRole.tab||(0,p.hasTrait)(x,p.SemanticTrait.Selectable)&&O.has(P)?K(v,"aria-selected",(0,p.hasState)(g,p.SemanticState.Selected)):T(v,"aria-selected"),(0,p.hasTrait)(x,p.SemanticTrait.Checkable)&&w.has(P)){var Ee=(0,p.checkStateOf)(g);Ee===p.SemanticCheckState.Mixed&&h.has(P)?M(v,"aria-checked","mixed"):K(v,"aria-checked",Ee===p.SemanticCheckState.Checked)}else T(v,"aria-checked");(0,p.hasTrait)(x,p.SemanticTrait.Toggleable)?($.has(P)?K(v,"aria-pressed",(0,p.hasState)(g,p.SemanticState.Toggled)):T(v,"aria-pressed"),P===p.SemanticRole.switchControl&&K(v,"aria-checked",(0,p.hasState)(g,p.SemanticState.Toggled))):T(v,"aria-pressed"),(0,p.hasTrait)(x,p.SemanticTrait.Requirable)&&ie.has(P)?K(v,"aria-required",(0,p.hasState)(g,p.SemanticState.Required)):T(v,"aria-required"),(0,p.hasTrait)(x,p.SemanticTrait.Enablable)?K(v,"aria-disabled",(0,p.hasState)(g,p.SemanticState.Disabled)):T(v,"aria-disabled");var ke=P===p.SemanticRole.image&&!A.label;if((0,p.hasState)(g,p.SemanticState.Hidden)||(0,p.hasState)(g,p.SemanticState.Obscured)||ke?M(v,"aria-hidden","true"):T(v,"aria-hidden"),(0,p.hasState)(g,p.SemanticState.LiveRegion)?M(v,"aria-live","polite"):T(v,"aria-live"),P===p.SemanticRole.textField){if(K(v,"aria-readonly",(0,p.hasState)(g,p.SemanticState.ReadOnly)),K(v,"aria-multiline",(0,p.hasState)(g,p.SemanticState.Multiline)),A.children.length===0){var Se=(I=A.value)!==null&&I!==void 0?I:"";v.textContent!==Se&&(v.textContent=Se)}}else T(v,"aria-multiline");k(P,g)?M(v,"aria-modal","true"):T(v,"aria-modal")},E.prototype.applyPosition=function(v,A,S,R){var I=this._artboardBounds,P=Math.max(A.minX,I.minX),g=Math.max(A.minY,I.minY),x=Math.min(A.maxX,I.maxX),ee=Math.min(A.maxY,I.maxY),re=P-S,se=g-R,pe=Math.max(0,x-P),ye=Math.max(0,ee-g),_e=Math.round(re),me=Math.round(se),Ee=Math.round(pe)+"px",ke=Math.round(ye)+"px",Se=_e+"px",Ve=me+"px";v.style.left!==Se&&(v.style.left=Se),v.style.top!==Ve&&(v.style.top=Ve),v.style.width!==Ee&&(v.style.width=Ee),v.style.height!==ke&&(v.style.height=ke),v.style.transform&&(v.style.transform=""),A.role===p.SemanticRole.text&&this.pendingTextGeometry.push(v)},E.prototype.flushTextGeometry=function(){var v;if(this.pendingTextGeometry.length!==0){for(var A=[],S=0,R=this.pendingTextGeometry;S<R.length;S++){var I=R[S],P=(v=I.querySelector(":scope > span"))!==null&&v!==void 0?v:I,g="".concat(I.style.width,"|").concat(I.style.height,"|").concat(P.textContent);this.textGeometryKeys.get(I)!==g&&(P.style.width="auto",P.style.height="auto",P.style.transformOrigin="0 0",P.style.transform="",A.push({host:I,span:P,key:g}))}this.pendingTextGeometry.length=0;for(var x=A.map(function(se){var pe=se.host,ye=se.span,_e=pe.getBoundingClientRect(),me=ye.getBoundingClientRect();if(me.width>0&&me.height>0){var Ee=_e.width/me.width,ke=_e.height/me.height;return"scale(".concat(Ee,", ").concat(ke,")")}return"none"}),ee=0;ee<A.length;ee++){var re=A[ee],I=re.host,P=re.span,g=re.key;P.style.transform=x[ee],this.textGeometryKeys.set(I,g)}}},E.prototype.syncTransformContainer=function(v,A,S){if(!this.transformContainer){var R=document.createElement("div");R.style.cssText=["position:absolute","top:0","left:0","overflow:visible","pointer-events:none","transform-origin:0 0"].join(";"),this.container.appendChild(R),this.transformContainer=R}var I=S.maxX-S.minX,P=S.maxY-S.minY;this.transformContainer.style.width=Math.round(I)+"px",this.transformContainer.style.height=Math.round(P)+"px";var g=1/(A||1),x=v.xx*g,ee=v.xy*g,re=v.yx*g,se=v.yy*g,pe=v.tx*g,ye=v.ty*g;this.transformContainer.style.transform="matrix(".concat(x,",").concat(ee,",").concat(re,",").concat(se,",").concat(pe,",").concat(ye,")")},E}(),W=new Set([p.SemanticRole.button,p.SemanticRole.link,p.SemanticRole.checkbox,p.SemanticRole.switchControl,p.SemanticRole.tab]),O=new Set([p.SemanticRole.tab]),w=new Set([p.SemanticRole.checkbox,p.SemanticRole.radioButton,p.SemanticRole.switchControl]),h=new Set([p.SemanticRole.checkbox]),$=new Set([p.SemanticRole.button]),ie=new Set([p.SemanticRole.checkbox,p.SemanticRole.textField,p.SemanticRole.radioGroup]),L=["position:absolute","width:1px","height:1px","overflow:hidden","pointer-events:none","left:-9999px"].join(";"),te=["position:absolute","pointer-events:none","box-sizing:border-box","overflow:visible","margin:0","padding:0","transform-origin: 0px 0px 0px","border:none","background:transparent","color:transparent"].join(";"),C=["display:inline-block","white-space:nowrap","pointer-events:none"].join(";");function M(E,v,A){E.getAttribute(v)!==A&&E.setAttribute(v,A)}function T(E,v){E.hasAttribute(v)&&E.removeAttribute(v)}function K(E,v,A){M(E,v,A?"true":"false")}function q(E){switch(E){case p.SemanticRole.button:case p.SemanticRole.link:case p.SemanticRole.checkbox:case p.SemanticRole.switchControl:case p.SemanticRole.tab:case p.SemanticRole.radioButton:return!0;default:return!1}}function fe(E){switch(E){case p.SemanticRole.button:case p.SemanticRole.link:case p.SemanticRole.checkbox:case p.SemanticRole.switchControl:case p.SemanticRole.slider:case p.SemanticRole.tab:case p.SemanticRole.radioButton:case p.SemanticRole.textField:return!0;default:return!1}}function k(E,v){return E===p.SemanticRole.alertDialog||E===p.SemanticRole.dialog&&(0,p.hasState)(v,p.SemanticState.Modal)}function D(E){return fe(E.role)||(0,p.hasTrait)(E.traitFlags,p.SemanticTrait.Focusable)}function Y(E){switch(E){case p.SemanticRole.link:return"a";case p.SemanticRole.text:return"div";default:return"div"}}function ae(E){switch(E){case p.SemanticRole.none:return"group";case p.SemanticRole.button:return"button";case p.SemanticRole.link:return null;case p.SemanticRole.checkbox:return"checkbox";case p.SemanticRole.switchControl:return"switch";case p.SemanticRole.slider:return"slider";case p.SemanticRole.textField:return"textbox";case p.SemanticRole.image:return"img";case p.SemanticRole.group:return"group";case p.SemanticRole.list:return"list";case p.SemanticRole.listItem:return"listitem";case p.SemanticRole.tab:return"tab";case p.SemanticRole.tabList:return"tablist";case p.SemanticRole.dialog:return"dialog";case p.SemanticRole.alertDialog:return"alertdialog";case p.SemanticRole.radioGroup:return"radiogroup";case p.SemanticRole.radioButton:return"radio";case p.SemanticRole.text:return null;default:return null}}},(we,Q,j)=>{j.r(Q),j.d(Q,{AudioAssetWrapper:()=>O.AudioAssetWrapper,AudioWrapper:()=>O.AudioWrapper,BLANK_URL:()=>W.BLANK_URL,CustomFileAssetLoaderWrapper:()=>O.CustomFileAssetLoaderWrapper,FileAssetWrapper:()=>O.FileAssetWrapper,FileFinalizer:()=>O.FileFinalizer,FocusSessionState:()=>Z.FocusSessionState,FontAssetWrapper:()=>O.FontAssetWrapper,FontWrapper:()=>O.FontWrapper,ImageAssetWrapper:()=>O.ImageAssetWrapper,ImageWrapper:()=>O.ImageWrapper,KeyboardInteractions:()=>Z.KeyboardInteractions,RiveFont:()=>w.RiveFont,createFinalization:()=>O.createFinalization,finalizationRegistry:()=>O.finalizationRegistry,registerTouchInteractions:()=>p.registerTouchInteractions,sanitizeUrl:()=>W.sanitizeUrl});var p=j(11),Z=j(12),W=j(13),O=j(14),w=j(15)},(we,Q,j)=>{j.r(Q),j.d(Q,{registerTouchInteractions:()=>O});var p=void 0,Z=function(w,h,$){var ie,L=[];if(h)for(var te=0;te<w.length;te++){var C=w[te];L.push({clientX:C.clientX,clientY:C.clientY,identifier:C.identifier})}else{var M=$!==null?(ie=Array.from(w).find(function(T){return T.identifier===$}))!==null&&ie!==void 0?ie:null:w[0];M&&L.push({clientX:M.clientX,clientY:M.clientY,identifier:M.identifier})}return L},W=function(w,h,$,ie){var L,te=w;return!((L=te.changedTouches)===null||L===void 0)&&L.length?(!h&&["touchstart","touchmove"].includes(w.type)&&w.preventDefault(),Z(te.changedTouches,$,ie)):[{clientX:w.clientX,clientY:w.clientY,identifier:0}]},O=function(w){var h=w.canvas,$=w.artboard,ie=w.stateMachines,L=ie===void 0?[]:ie,te=w.renderer,C=w.rive,M=w.fit,T=w.alignment,K=w.isTouchScrollEnabled,q=K===void 0?!1:K,fe=w.dispatchPointerExit,k=fe===void 0?!0:fe,D=w.enableMultiTouch,Y=D===void 0?!1:D,ae=w.layoutScaleFactor,E=ae===void 0?1:ae,v=w.advanceAndDrain;if(!h||!L.length||!te||!C||!$||typeof window>"u")return null;var A=null,S=!1,R=null,I=function(x){var ee;if(S&&x instanceof MouseEvent){x.type=="mouseup"&&(S=!1);return}S=q&&x.type==="touchend"&&A==="touchstart",A=x.type;var re=x.currentTarget.getBoundingClientRect();if(!Y&&x.type==="touchstart"&&R===null){var se=(ee=x.changedTouches)===null||ee===void 0?void 0:ee[0];se&&(R=se.identifier)}var pe=W(x,q,Y,Y?null:R),ye=C.computeAlignment(M,T,{minX:0,minY:0,maxX:re.width,maxY:re.height},$.bounds,E),_e=new C.Mat2D;switch(ye.invert(_e),pe.forEach(function(Re){var be=Re.clientX,ze=Re.clientY;if(!(!be&&!ze)){var wt=be-re.left,mt=ze-re.top,Xe=new C.Vec2D(wt,mt),yt=C.mapXY(_e,Xe),Mt=yt.x(),Ot=yt.y();Re.transformedX=Mt,Re.transformedY=Ot,yt.delete(),Xe.delete()}}),_e.delete(),ye.delete(),x.type){case"mouseout":for(var me=function(Re){k?pe.forEach(function(be){Re.pointerExit(be.transformedX,be.transformedY,be.identifier)}):pe.forEach(function(be){Re.pointerMove(be.transformedX,be.transformedY,be.identifi
6er)})},Ee=0,ke=L;Ee<ke.length;Ee++){var Se=ke[Ee];me(Se)}break;case"touchmove":case"mouseover":case"mousemove":{for(var Ve=function(Re){pe.forEach(function(be){Re.pointerMove(be.transformedX,be.transformedY,be.identifier)})},rt=0,st=L;rt<st.length;rt++){var Se=st[rt];Ve(Se)}break}case"touchstart":case"mousedown":{for(var ut=function(Re){pe.forEach(function(be){Re.pointerDown(be.transformedX,be.transformedY,be.identifier)})},ft=0,Be=L;ft<Be.length;ft++){var Se=Be[ft];ut(Se)}v(0);break}case"touchend":{for(var et=function(Re){pe.forEach(function(be){Re.pointerUp(be.transformedX,be.transformedY,be.identifier),Re.pointerExit(be.transformedX,be.transformedY,be.identifier)})},Ye=0,Ae=L;Ye<Ae.length;Ye++){var Se=Ae[Ye];et(Se)}v(0),!Y&&pe.some(function(Re){return Re.identifier===R})&&(R=null);break}case"mouseup":{for(var it=function(Re){pe.forEach(function(be){Re.pointerUp(be.transformedX,be.transformedY,be.identifier)})},We=0,Ft=L;We<Ft.length;We++){var Se=Ft[We];it(Se)}v(0);break}default:}},P=function(){R=null},g=I.bind(p);return h.addEventListener("mouseover",g),h.addEventListener("mouseout",g),h.addEventListener("mousemove",g),h.addEventListener("mousedown",g),h.addEventListener("mouseup",g),h.addEventListener("touchmove",g,{passive:q}),h.addEventListener("touchstart",g,{passive:q}),h.addEventListener("touchend",g),h.addEventListener("touchcancel",P),function(){h.removeEventListener("mouseover",g),h.removeEventListener("mouseout",g),h.removeEventListener("mousemove",g),h.removeEventListener("mousedown",g),h.removeEventListener("mouseup",g),h.removeEventListener("touchmove",g),h.removeEventListener("touchstart",g),h.removeEventListener("touchend",g),h.removeEventListener("touchcancel",P)}}},(we,Q,j)=>{j.r(Q),j.d(Q,{FocusSessionState:()=>p,KeyboardInteractions:()=>Z});var p;(function(W){W.NotFocused="notFocused",W.EntryPending="entryPending",W.RiveFocused="riveFocused"})(p||(p={}));var Z=function(){function W(O){var w=O.canvas,h=O.stateMachine,$=O.hasFocusNodes,ie=O.getOverlayElement,L=this,te;this.focusSessionState=p.NotFocused,this.canvasHasFocus=!1,this.focusDomainReleased=!1,this.currentOverlayElement=null,this.onCanvasFocus=function(C){if(L.syncOverlayListener(),L.canvasHasFocus=!0,L.focusDomainReleased=!1,!!L.hasFocusNodes&&!L.mainSm.focusState().hasFocus&&(L.focusSessionState=p.EntryPending,!!L.isKeyboardDrivenFocus())){var M=L.cameFromBeforeCanvas(C.relatedTarget);(M?L.mainSm.focusNext():L.mainSm.focusPrevious())&&(L.focusSessionState=p.RiveFocused)}},this.onCanvasBlur=function(C){L.focusSessionState=p.NotFocused,L.canvasHasFocus=!1;var M=L.isInFocusDomain(C.relatedTarget),T=C.relatedTarget===null&&!document.hasFocus();M||T||L.mainSm.clearFocus()},this.onOverlayFocusIn=function(C){L.isInOverlay(C.target)&&(L.focusDomainReleased=!1,L.hasFocusNodes&&L.focusSessionState===p.NotFocused&&(L.focusSessionState=L.mainSm.focusState().hasFocus?p.RiveFocused:p.EntryPending))},this.onFocusDomainHostFocusIn=function(C){L.syncOverlayListener(),L.onOverlayFocusIn(C)},this.onKeyDown=function(C){if(L.syncOverlayListener(),!L.focusDomainReleased&&L.shouldRiveHandleKeyEvent(C)&&C.code==="Tab"&&L.hasFocusNodes){var M=!C.shiftKey,T=M?L.mainSm.focusNext():L.mainSm.focusPrevious();T?(L.focusSessionState=p.RiveFocused,C.preventDefault()):(L.focusSessionState=p.NotFocused,L.focusDomainReleased=!0,L.canvasHasFocus=!1),L.syncOverlayListener()}},this.canvas=w,this.mainSm=h,this.hasFocusNodes=$,this.getOverlayElement=ie,this.focusDomainHost=(te=w.parentElement)!==null&&te!==void 0?te:document,w.addEventListener("focus",this.onCanvasFocus),w.addEventListener("blur",this.onCanvasBlur),w.addEventListener("keydown",this.onKeyDown),this.focusDomainHost.addEventListener("focusin",this.onFocusDomainHostFocusIn),this.syncOverlayListener()}return W.prototype.setFocusSessionState=function(O){this.focusSessionState=O},W.prototype.notifyRiveFocused=function(){this.focusSessionState=p.RiveFocused},W.prototype.shouldRiveHandleKeyEvent=function(O){if(this.focusSessionState===p.NotFocused)return!1;var w=this.isInFocusDomain(document.activeElement)||this.isInOverlay(O.target),h=O.target===this.canvas;return w||this.canvasHasFocus||h},W.prototype.isInFocusDomain=function(O){return O===this.canvas?!0:this.isInOverlay(O)},W.prototype.isInOverlay=function(O){var w,h,$;return O instanceof Node&&($=(h=(w=this.getOverlayElement)===null||w===void 0?void 0:w.call(this))===null||h===void 0?void 0:h.contains(O))!==null&&$!==void 0?$:!1},W.prototype.syncOverlayListener=function(){var O,w,h,$,ie,L,te=(w=(O=this.getOverlayElement)===null||O===void 0?void 0:O.call(this))!==null&&w!==void 0?w:null;te!==this.currentOverlayElement&&((h=this.currentOverlayElement)===null||h===void 0||h.removeEventListener("focusin",this.onOverlayFocusIn),($=this.currentOverlayElement)===null||$===void 0||$.removeEventListener("keydown",this.onKeyDown,!0),this.currentOverlayElement=te,(ie=this.currentOverlayElement)===null||ie===void 0||ie.addEventListener("focusin",this.onOverlayFocusIn),(L=this.currentOverlayElement)===null||L===void 0||L.addEventListener("keydown",this.onKeyDown,!0))},W.prototype.isKeyboardDrivenFocus=function(){try{return this.canvas.matches(":focus-visible")}catch{return!1}},W.prototype.cameFromBeforeCanvas=function(O){if(!O)return!0;var w=this.canvas.compareDocumentPosition(O);return w&Node.DOCUMENT_POSITION_PRECEDING?!0:!(w&Node.DOCUMENT_POSITION_FOLLOWING)},W.prototype.cleanup=function(){var O,w;
6this.canvas.removeEventListener("focus",this.onCanvasFocus),this.canvas.removeEventListener("blur",this.onCanvasBlur),this.canvas.removeEventListener("keydown",this.onKeyDown),this.focusDomainHost.removeEventListener("focusin",this.onFocusDomainHostFocusIn),(O=this.currentOverlayElement)===null||O===void 0||O.removeEventListener("focusin",this.onOverlayFocusIn),(w=this.currentOverlayElement)===null||w===void 0||w.removeEventListener("keydown",this.onKeyDown,!0)},W}()},(we,Q,j)=>{j.r(Q),j.d(Q,{BLANK_URL:()=>$,sanitizeUrl:()=>te});var p=/^([^\w]*)(javascript|data|vbscript)/im,Z=/&#(\w+)(^\w|;)?/g,W=/&(newline|tab);/gi,O=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,w=/^.+(:|&colon;)/gim,h=[".","/"],$="about:blank";function ie(C){return h.indexOf(C[0])>-1}function L(C){var M=C.replace(O,"");return M.replace(Z,function(T,K){return String.fromCharCode(K)})}function te(C){if(!C)return $;var M=L(C).replace(W,"").replace(O,"").trim();if(!M)return $;if(ie(M))return M;var T=M.match(w);if(!T)return M;var K=T[0];return p.test(K)?$:M}},(we,Q,j)=>{j.r(Q),j.d(Q,{AudioAssetWrapper:()=>C,AudioWrapper:()=>h,CustomFileAssetLoaderWrapper:()=>ie,FileAssetWrapper:()=>L,FileFinalizer:()=>Z,FontAssetWrapper:()=>M,FontWrapper:()=>$,ImageAssetWrapper:()=>te,ImageWrapper:()=>w,createFinalization:()=>fe,finalizationRegistry:()=>q});var p=function(){var k=function(D,Y){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ae,E){ae.__proto__=E}||function(ae,E){for(var v in E)Object.prototype.hasOwnProperty.call(E,v)&&(ae[v]=E[v])},k(D,Y)};return function(D,Y){if(typeof Y!="function"&&Y!==null)throw new TypeError("Class extends value "+String(Y)+" is not a constructor or null");k(D,Y);function ae(){this.constructor=D}D.prototype=Y===null?Object.create(Y):(ae.prototype=Y.prototype,new ae)}}(),Z=function(){function k(D,Y){Y===void 0&&(Y=null),this.selfUnref=!1,this._file=D,this._session=Y}return k.prototype.unref=function(){this._file&&this._file.unref(),this._session&&(this._session.delete(),this._session=null)},k.prototype.release=function(){this._file=null,this._session=null},k}(),W=function(){function k(D){this._finalizableObject=D}return k.prototype.unref=function(){this._finalizableObject.unref()},k}(),O=function(){function k(){this.selfUnref=!1}return k.prototype.unref=function(){},k}(),w=function(k){p(D,k);function D(Y){var ae=k.call(this)||this;return ae._nativeImage=Y,ae}return Object.defineProperty(D.prototype,"nativeImage",{get:function(){return this._nativeImage},enumerable:!1,configurable:!0}),D.prototype.unref=function(){this.selfUnref&&this._nativeImage.unref()},D}(O),h=function(k){p(D,k);function D(Y){var ae=k.call(this)||this;return ae._nativeAudio=Y,ae}return Object.defineProperty(D.prototype,"nativeAudio",{get:function(){return this._nativeAudio},enumerable:!1,configurable:!0}),D.prototype.unref=function(){this.selfUnref&&this._nativeAudio.unref()},D}(O),$=function(k){p(D,k);function D(Y){var ae=k.call(this)||this;return ae._nativeFont=Y,ae}return Object.defineProperty(D.prototype,"nativeFont",{get:function(){return this._nativeFont},enumerable:!1,configurable:!0}),D.prototype.unref=function(){this.selfUnref&&this._nativeFont.unref()},D}(O),ie=function(){function k(D,Y,ae){ae===void 0&&(ae=null),this._assetLoaderCallback=Y,this._session=ae,this.assetLoader=new D.CustomFileAssetLoader({loadContents:this.loadContents.bind(this)})}return k.prototype.loadContents=function(D,Y){var ae;if(D.isImage)ae=new te(D,this._session);else if(D.isAudio)ae=new C(D,this._session);else if(D.isFont)ae=new M(D,this._session);else return!1;return this._assetLoaderCallback(ae,Y)},k}(),L=function(){function k(D,Y){Y===void 0&&(Y=null),this._nativeFileAsset=D,this._session=Y}return k.prototype.decode=function(D){this._nativeFileAsset.decode(D,this._session)},Object.defineProperty(k.prototype,"name",{get:function(){return this._nativeFileAsset.name},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"fileExtension",{get:function(){return this._nativeFileAsset.fileExtension},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"uniqueFilename",{get:function(){return this._nativeFileAsset.uniqueFilename}
6,enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isAudio",{get:function(){return this._nativeFileAsset.isAudio},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isImage",{get:function(){return this._nativeFileAsset.isImage},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isFont",{get:function(){return this._nativeFileAsset.isFont},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"cdnUuid",{get:function(){return this._nativeFileAsset.cdnUuid},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"nativeFileAsset",{get:function(){return this._nativeFileAsset},enumerable:!1,configurable:!0}),k}(),te=function(k){p(D,k);function D(){return k!==null&&k.apply(this,arguments)||this}return D.prototype.setRenderImage=function(Y){this._nativeFileAsset.setRenderImage(Y.nativeImage)},D}(L),C=function(k){p(D,k);function D(){return k!==null&&k.apply(this,arguments)||this}return D.prototype.setAudioSource=function(Y){this._nativeFileAsset.setAudioSource(Y.nativeAudio)},D}(L),M=function(k){p(D,k);function D(){return k!==null&&k.apply(this,arguments)||this}return D.prototype.setFont=function(Y){this._nativeFileAsset.setFont(Y.nativeFont)},D}(L),T=function(){function k(D){}return k.prototype.register=function(D){D.selfUnref=!0},k.prototype.unregister=function(D){},k}(),K=typeof FinalizationRegistry<"u"?FinalizationRegistry:T,q=new K(function(k){k?.unref()}),fe=function(k,D){var Y=new W(D);q.register(k,Y)}},(we,Q,j)=>{j.r(Q),j.d(Q,{RiveFont:()=>Z});var p=j(3),Z=function(){function W(){}return W.setFallbackFontCallback=function(O){W._fallbackFontCallback=O??null,W._wireFallbackProc()},W._fontToPtr=function(O){var w;if(O==null)return null;var h=O.nativeFont,$=(w=h?.ptr)===null||w===void 0?void 0:w.call(h);return $??null},W._getFallbackPtr=function(O,w){return w<0||w>=O.length?null:W._fontToPtr(O[w])},W._wireFallbackProc=function(){p.RuntimeLoader.getInstance(function(O){var w=W._fallbackFontCallback;w?O.setFallbackFontCallback(function(h,$,ie){var L=w(h,ie);return L?Array.isArray(L)?W._getFallbackPtr(L,$):$===0?W._fontToPtr(L):null:null}):O.setFallbackFontCallback(null)})},W._fallbackFontCallback=null,W}()}],pn={};function Ke(we){var Q=pn[we];if(Q!==void 0)return Q.exports;var j=pn[we]={exports:{}};return Dn[we](j,j.exports,Ke),j.exports}Ke.d=(we,Q)=>{for(var j in Q)Ke.o(Q,j)&&!Ke.o(we,j)&&Object.defineProperty(we,j,{enumerable:!0,get:Q[j]})},Ke.o=(we,Q)=>Object.prototype.hasOwnProperty.call(we,Q),Ke.r=we=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(we,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(we,"__esModule",{value:!0})};var mn={};return(()=>{Ke.r(mn),Ke.d(mn,{Alignment:()=>te,DataEnum:()=>Ye,DataType:()=>Be,DrawOptimizationOptions:()=>C,EventType:()=>E,Fit:()=>L,Layout:()=>M,LoopType:()=>re,Rive:()=>ft,RiveEventType:()=>q,RiveFile:()=>ut,RiveFont:()=>p.RiveFont,RuntimeLoader:()=>Q.RuntimeLoader,SemanticMode:()=>j.SemanticMode,StateMachineInput:()=>K,StateMachineInputType:()=>T,Testing:()=>ce,ViewModel:()=>et,ViewModelInstance:()=>it,ViewModelInstanceArtboard:()=>Ot,ViewModelInstanceAssetFont:()=>Mt,ViewModelInstanceAssetImage:()=>yt,ViewModelInstanceBoolean:()=>be,ViewModelInstanceColor:()=>Xe,ViewModelInstanceEnum:()=>wt,ViewModelInstanceList:()=>mt,ViewModelInstanceNumber:()=>Re,ViewModelInstanceString:()=>Ft,ViewModelInstanceTrigger:()=>ze,ViewModelInstanceValue:()=>We,decodeAudio:()=>yn,decodeFont:()=>Zt,decodeImage:()=>Vt});var we=Ke(1),Q=Ke(3),j=Ke(6),p=Ke(10),Z=function(){var o=function(n,i){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var m in d)Object.prototype.hasOwnProperty.call(d,m)&&(u[m]=d[m])},o(n,i)};return function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");o(n,i);function u(){this.constructor=n}n.prototype=i===null?Object.create(i):(u.prototype=i.prototype,new u)}}(),W=function(){return W=Object.assign||function(o){for(var n,i=1,u=arguments.length;i<u;i++){n=arguments[i];for(var d in n)Object.prototype.hasOwnProperty.call(n,d)&&(o[d]=n[d])}return o},W.apply(this,arguments)},O=function(o,n,i,u){function d(m){return m instanceof i?m:new i(function(y){y(m)})}
6return new(i||(i=Promise))(function(m,y){function N(le){try{U(u.next(le))}catch(he){y(he)}}function z(le){try{U(u.throw(le))}catch(he){y(he)}}function U(le){le.done?m(le.value):d(le.value).then(N,z)}U((u=u.apply(o,n||[])).next())})},w=function(o,n){var i={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},u,d,m,y=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return y.next=N(0),y.throw=N(1),y.return=N(2),typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function N(U){return function(le){return z([U,le])}}function z(U){if(u)throw new TypeError("Generator is already executing.");for(;y&&(y=0,U[0]&&(i=0)),i;)try{if(u=1,d&&(m=U[0]&2?d.return:U[0]?d.throw||((m=d.return)&&m.call(d),0):d.next)&&!(m=m.call(d,U[1])).done)return m;switch(d=0,m&&(U=[U[0]&2,m.value]),U[0]){case 0:case 1:m=U;break;case 4:return i.label++,{value:U[1],done:!1};case 5:i.label++,d=U[1],U=[0];continue;case 7:U=i.ops.pop(),i.trys.pop();continue;default:if(m=i.trys,!(m=m.length>0&&m[m.length-1])&&(U[0]===6||U[0]===2)){i=0;continue}if(U[0]===3&&(!m||U[1]>m[0]&&U[1]<m[3])){i.label=U[1];break}if(U[0]===6&&i.label<m[1]){i.label=m[1],m=U;break}if(m&&i.label<m[2]){i.label=m[2],i.ops.push(U);break}m[2]&&i.ops.pop(),i.trys.pop();continue}U=n.call(o,i)}catch(le){U=[6,le],d=0}finally{u=m=0}if(U[0]&5)throw U[1];return{value:U[0]?U[1]:void 0,done:!0}}},h=function(o,n,i){if(i||arguments.length===2)for(var u=0,d=n.length,m;u<d;u++)(m||!(u in n))&&(m||(m=Array.prototype.slice.call(n,0,u)),m[u]=n[u]);return o.concat(m||Array.prototype.slice.call(n))},$=function(o){Z(n,o);function n(){var i=o!==null&&o.apply(this,arguments)||this;return i.isHandledError=!0,i}return n}(Error),ie=function(o){return o&&o.isHandledError?o.message:"Problem loading file; may be corrupt!"},L;(function(o){o.Cover="cover",o.Contain="contain",o.Fill="fill",o.FitWidth="fitWidth",o.FitHeight="fitHeight",o.None="none",o.ScaleDown="scaleDown",o.Layout="layout"})(L||(L={}));var te;(function(o){o.Center="center",o.TopLeft="topLeft",o.TopCenter="topCenter",o.TopRight="topRight",o.CenterLeft="centerLeft",o.CenterRight="centerRight",o.BottomLeft="bottomLeft",o.BottomCenter="bottomCenter",o.BottomRight="bottomRight"})(te||(te={}));var C;(function(o){o.AlwaysDraw="alwaysDraw",o.DrawOnChanged="drawOnChanged"})(C||(C={}));var M=function(){function o(n){var i,u,d,m,y,N,z;this.fit=(i=n?.fit)!==null&&i!==void 0?i:L.Contain,this.alignment=(u=n?.alignment)!==null&&u!==void 0?u:te.Center,this.layoutScaleFactor=(d=n?.layoutScaleFactor)!==null&&d!==void 0?d:1,this.minX=(m=n?.minX)!==null&&m!==void 0?m:0,this.minY=(y=n?.minY)!==null&&y!==void 0?y:0,this.maxX=(N=n?.maxX)!==null&&N!==void 0?N:0,this.maxY=(z=n?.maxY)!==null&&z!==void 0?z:0}return o.new=function(n){var i=n.fit,u=n.alignment,d=n.minX,m=n.minY,y=n.maxX,N=n.maxY;return J.warn("This function is deprecated: please use `new Layout({})` instead"),new o({fit:i,alignment:u,minX:d,minY:m,maxX:y,maxY:N})},o.prototype.copyWith=function(n){var i=n.fit,u=n.alignment,d=n.layoutScaleFactor,m=n.minX,y=n.minY,N=n.maxX,z=n.maxY;return new o({fit:i??this.fit,alignment:u??this.alignment,layoutScaleFactor:d??this.layoutScaleFactor,minX:m??this.minX,minY:y??this.minY,maxX:N??this.maxX,maxY:z??this.maxY})},o.prototype.runtimeFit=function(n){if(this.cachedRuntimeFit)return this.cachedRuntimeFit;var i;return this.fit===L.Cover?i=n.Fit.cover:this.fit===L.Contain?i=n.Fit.contain:this.fit===L.Fill?i=n.Fit.fill:this.fit===L.FitWidth?i=n.Fit.fitWidth:this.fit===L.FitHeight?i=n.Fit.fitHeight:this.fit===L.ScaleDown?i=n.Fit.scaleDown:this.fit===L.Layout?i=n.Fit.layout:i=n.Fit.none,this.cachedRuntimeFit=i,i},o.prototype.runtimeAlignment=function(n){if(this.cachedRuntimeAlignment)return this.cachedRuntimeAlignment;var i;return this.alignment===te.TopLeft?i=n.Alignment.topLeft:this.alignment===te.TopCenter?i=n.Alignment.topCenter:this.alignment===te.TopRight?i=n.Alignment.topRight:this.alignment===te.CenterLeft?i=n.Alignment.centerLeft:this.alignment===te.CenterRight?i=n.Alignment.centerRight:this.alignment===te.BottomLeft?i=n.Alignment.bottomLeft:this.alignment===te.BottomCenter?i=n.Alignment.bottomCenter:this.alignment===te.BottomRight?i=n.Alignment.bottomRight:i=n.Alignment.center,this.cachedRuntimeAlignment=i,i},o}(),T;(function(o){o[o.Number=56]="Number",o[o.Trigger=58]="Trigger",o[o.Boolean=59]="Boolean"})(T||(T={}));var K=function(){function o(n,i){this.type=n,this.runtimeInput=i}return Object.defineProperty(o.prototype,"name",{get:function(){return this.runtimeInput.name}
6,enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"value",{get:function(){return this.runtimeInput.value},set:function(n){this.runtimeInput.value=n},enumerable:!1,configurable:!0}),o.prototype.fire=function(){this.type===T.Trigger&&this.runtimeInput.fire()},o.prototype.delete=function(){this.runtimeInput=null},o}(),q;(function(o){o[o.General=128]="General",o[o.OpenUrl=131]="OpenUrl"})(q||(q={}));var fe=function(){function o(n){this.isBindableArtboard=!1,this.isBindableArtboard=n}return o}(),k=function(o){Z(n,o);function n(i,u){var d=o.call(this,!1)||this;return d.nativeArtboard=i,d.file=u,d}return n}(fe),D=function(o){Z(n,o);function n(i){var u=o.call(this,!0)||this;return u.selfUnref=!1,u.nativeArtboard=i,u}return Object.defineProperty(n.prototype,"viewModel",{set:function(i){this.nativeViewModel=i.nativeInstance},enumerable:!1,configurable:!0}),n.prototype.destroy=function(){var i;this.selfUnref&&(this.nativeArtboard.unref(),(i=this.nativeViewModel)===null||i===void 0||i.unref())},n}(fe),Y=function(){function o(n,i,u,d){this.stateMachine=n,this.playing=u,this.artboard=d,this.inputs=[],this.instance=new i.StateMachineInstance(n,d),this.initInputs(i)}return Object.defineProperty(o.prototype,"hasFocusNodes",{get:function(){return this.instance.hasFocusNodes()},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"name",{get:function(){return this.stateMachine.name},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"statesChanged",{get:function(){for(var n=[],i=0;i<this.instance.stateChangedCount();i++)n.push(this.instance.stateChangedNameByIndex(i));return n},enumerable:!1,configurable:!0}),o.prototype.advance=function(n){this.instance.advance(n)},o.prototype.advanceAndApply=function(n){this.instance.advanceAndApply(n)},o.prototype.enableSemantics=function(){this.instance.enableSemantics()},o.prototype.drainSemanticsDiff=function(){return this.instance.drainSemanticsDiff()},o.prototype.fireSemanticAction=function(n,i){this.instance.fireSemanticAction(n,i)},o.prototype.focusSemanticNode=function(n){return this.instance.focusSemanticNode(n)},o.prototype.reportedEventCount=function(){return this.instance.reportedEventCount()},o.prototype.reportedEventAt=function(n){return this.instance.reportedEventAt(n)},o.prototype.initInputs=function(n){for(var i=0;i<this.instance.inputCount();i++){var u=this.instance.input(i);this.inputs.push(this.mapRuntimeInput(u,n))}},o.prototype.mapRuntimeInput=function(n,i){if(n.type===i.SMIInput.bool)return new K(T.Boolean,n.asBool());if(n.type===i.SMIInput.number)return new K(T.Number,n.asNumber());if(n.type===i.SMIInput.trigger)return new K(T.Trigger,n.asTrigger())},o.prototype.cleanup=function(){this.inputs.forEach(function(n){n.delete()}),this.inputs.length=0,this.instance.delete()},o.prototype.bindViewModelInstance=function(n){n.runtimeInstance!=null&&this.instance.bindViewModelInstance(n.runtimeInstance)},o.prototype.focusState=function(){return this.instance.focusState()},o.prototype.clearFocus=function(){this.instance.clearFocus()},o}(),ae=function(){function o(n,i,u,d,m){d===void 0&&(d=[]),m===void 0&&(m=[]),this.runtime=n,this.artboard=i,this.eventManager=u,this.animations=d,this.stateMachines=m}return o.prototype.add=function(n,i,u,d){if(u===void 0&&(u=!0),d===void 0&&(d=!1),n=ht(n),n.length===0)this.animations.forEach(function(Ce){return Ce.playing=i}),this.stateMachines.forEach(function(Ce){return Ce.playing=i});else for(var m=this.animations.map(function(Ce){return Ce.name}),y=this.stateMachines.map(function(Ce){return Ce.name}),N=0;N<n.length;N++){var z=m.indexOf(n[N]),U=y.indexOf(n[N]);if(z>=0||U>=0)z>=0?this.animations[z].playing=i:this.stateMachines[U].playing=i;else{var le=this.artboard.animationByName(n[N]);if(le){var he=new we.Animation(le,this.artboard,this.runtime,i);he.advance(0),he.apply(1),this.animations.push(he)}else{var Ie=this.artboard.stateMachineByName(n[N]);if(Ie){var De=new Y(Ie,this.runtime,i,this.artboard);d&&De.enableSemantics(),this.stateMachines.push(De)}}}}return u&&(i?this.eventManager.fire({type:E.Play,data:this.playing}):this.eventManager.fire({type:E.Pause,data:this.paused})),i?this.playing:this.paused},o.prototype.initLinearAnimations=function(n,i,u){u===void 0&&(u=!1);for(var d=this.animations.map(function(le){return le.name}),m=0;m<n.length;m++){var y=d.indexOf(n[m]);if(y>=0)this.animations[y].playing=i;else{var N=this.artboard.animationByName(n[m]);if(N){var z=new we.Animation(N,this.artboard,this.runtime,i);z.advance(0),z.apply(1),this.animations.push(z)}else if(u){var U="State Machine with name ".concat(n[m]," not found");throw new $(U)}else J.error("Animation with name ".concat(n[m]," not found."))}}},o.prototype.initStateMachines=function(n,i,u){for(var d=this.stateMachines.map(function(U){return U.name}),m=0;m<n.length;m++){var y=d.indexOf(n[m]);if(y>=0)this.stateMachines[y].playing=i;else{var N=this.artboard.stateMachineByName(n[m]);if(N){var z=new Y(N,this.runtime,i,this.artboard);u&&z.enableSemantics(),this.stateMachines.push(z)}else J.warn("State Machine with name ".concat(n[m]," not found. Falling back to find an animation with the same name.")),this.initLinearAnimations([n[m]],i,!0)}}},o.prototype.play=function(n){return this.add(n,!0)},o.prototype.advanceIfPaused=function(){this.stateMachines.forEac
6h(function(n){n.playing||n.advanceAndApply(0)})},o.prototype.pause=function(n){return this.add(n,!1)},o.prototype.scrub=function(n,i){var u=this.animations.filter(function(d){return n.includes(d.name)});return u.forEach(function(d){return d.scrubTo=i}),u.map(function(d){return d.name})},Object.defineProperty(o.prototype,"playing",{get:function(){return this.animations.filter(function(n){return n.playing}).map(function(n){return n.name}).concat(this.stateMachines.filter(function(n){return n.playing}).map(function(n){return n.name}))},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"paused",{get:function(){return this.animations.filter(function(n){return!n.playing}).map(function(n){return n.name}).concat(this.stateMachines.filter(function(n){return!n.playing}).map(function(n){return n.name}))},enumerable:!1,configurable:!0}),o.prototype.stop=function(n){var i=this;n=ht(n);var u=[];if(n.length===0)u=this.animations.map(function(y){return y.name}).concat(this.stateMachines.map(function(y){return y.name})),this.animations.forEach(function(y){return y.cleanup()}),this.stateMachines.forEach(function(y){return y.cleanup()}),this.animations.splice(0,this.animations.length),this.stateMachines.splice(0,this.stateMachines.length);else{var d=this.animations.filter(function(y){return n.includes(y.name)});d.forEach(function(y){y.cleanup(),i.animations.splice(i.animations.indexOf(y),1)});var m=this.stateMachines.filter(function(y){return n.includes(y.name)});m.forEach(function(y){y.cleanup(),i.stateMachines.splice(i.stateMachines.indexOf(y),1)}),u=d.map(function(y){return y.name}).concat(m.map(function(y){return y.name}))}return this.eventManager.fire({type:E.Stop,data:u}),u},Object.defineProperty(o.prototype,"isPlaying",{get:function(){return this.animations.reduce(function(n,i){return n||i.playing},!1)||this.stateMachines.reduce(function(n,i){return n||i.playing},!1)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"isPaused",{get:function(){return!this.isPlaying&&(this.animations.length>0||this.stateMachines.length>0)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"isStopped",{get:function(){return this.animations.length===0&&this.stateMachines.length===0},enumerable:!1,configurable:!0}),o.prototype.atLeastOne=function(n,i,u){i===void 0&&(i=!0),u===void 0&&(u=!1);var d;return this.animations.length===0&&this.stateMachines.length===0&&(this.artboard.animationCount()>0?(this.artboard.stateMachineCount()>0&&g("No `stateMachine` was specified, so the artboard's first linear animation is playing by default. In the next major version, the artboard's state machine will be played by default instead when one exists. Pass the `stateMachine` parameter to adopt that behavior now."),this.add([d=this.artboard.animationByIndex(0).name],n,i)):this.artboard.stateMachineCount()>0&&this.add([d=this.artboard.stateMachineByIndex(0).name],n,i,u)),d},o.prototype.handleLooping=function(){for(var n=0,i=this.animations.filter(function(d){return d.playing});n<i.length;n++){var u=i[n];u.loopValue===0&&u.loopCount?(u.loopCount=0,this.stop(u.name)):u.loopValue===1&&u.loopCount?(this.eventManager.fire({type:E.Loop,data:{animation:u.name,type:re.Loop}}),u.loopCount=0):u.loopValue===2&&u.loopCount>1&&(this.eventManager.fire({type:E.Loop,data:{animation:u.name,type:re.PingPong}}),u.loopCount=0)}},o.prototype.handleStateChanges=function(){for(var n=[],i=0,u=this.stateMachines.filter(function(m){return m.playing});i<u.length;i++){var d=u[i];n.push.apply(n,d.statesChanged)}n.length>0&&this.eventManager.fire({type:E.StateChange,data:n})},o.prototype.handleAdvancing=function(n){this.eventManager.fire({type:E.Advance,data:n})},o}(),E;(function(o){o.Load="load",o.LoadError="loaderror",o.Play="play",o.Pause="pause",o.Stop="stop",o.Loop="loop",o.Draw="draw",o.Advance="advance",o.StateChange="statechange",o.RiveEvent="riveevent",o.AudioStatusChange="audiostatuschange"})(E||(E={}));var v="Rive Events are deprecated and will be removed in a future major version: please use data binding instead. See https://rive.app/docs/runtimes/web/rive-events for how to migrate.",A="State machine inputs are deprecated and will be removed in a future major version: please use data binding properties instead. See https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs for how to migrate.",S="Text run APIs are deprecated and will be removed in a future major version: please use data binding instead. See https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime for how to migrate.",R="Loop events are deprecated and will be removed in a future major version: they are only reported for linear animation playback, which is deprecated. Use a state machine to control playback and data binding to react to changes instead. See https://rive.app/docs/editor/data-binding/migration-guide for how to migrate.",I="State change events are deprecated and will be removed in a future major version: use data binding (view model property observers) or state machine actions to react to changes from your graphic instead. See https://rive.app/docs/editor/state-machine/states#actions for how to migrate.",P=new Set,g=function(o){P.has(o)||
6(P.add(o),J.warn("[Rive] ".concat(o)))},x=function(o,n){Array.isArray(o)&&g("Passing an array of names to `".concat(n,"()` is deprecated: in the next major version this parameter will be a single string, and playing multiple animations or state machines at once will not be supported."))},ee=function(o){g("Passing linear animation names to `".concat(o,"()` is deprecated and will be removed in a future major version: ")+"Pass a single state machine name to control playback instead.")},re;(function(o){o.OneShot="oneshot",o.Loop="loop",o.PingPong="pingpong"})(re||(re={}));var se=function(){function o(n){n===void 0&&(n=[]),this.listeners=n}return o.prototype.getListeners=function(n){return this.listeners.filter(function(i){return i.type===n})},o.prototype.add=function(n){this.listeners.includes(n)||this.listeners.push(n)},o.prototype.remove=function(n){for(var i=0;i<this.listeners.length;i++){var u=this.listeners[i];if(u.type===n.type&&u.callback===n.callback){this.listeners.splice(i,1);break}}},o.prototype.removeAll=function(n){var i=this;n?this.listeners.filter(function(u){return u.type===n}).forEach(function(u){return i.remove(u)}):this.listeners.splice(0,this.listeners.length)},o.prototype.fire=function(n){var i=this.getListeners(n.type);i.forEach(function(u){return u.callback(n)})},o}(),pe=function(){function o(n){this.eventManager=n,this.queue=[]}return o.prototype.add=function(n){this.queue.push(n)},o.prototype.process=function(){for(;this.queue.length>0;){var n=this.queue.shift();n?.action&&n.action(),n?.event&&this.eventManager.fire(n.event)}},o}(),ye;(function(o){o[o.AVAILABLE=0]="AVAILABLE",o[o.UNAVAILABLE=1]="UNAVAILABLE"})(ye||(ye={}));var _e=function(o){Z(n,o);function n(){var i=o!==null&&o.apply(this,arguments)||this;return i._started=!1,i._enabled=!1,i._status=ye.UNAVAILABLE,i}return n.prototype.delay=function(i){return O(this,void 0,void 0,function(){return w(this,function(u){return[2,new Promise(function(d){return setTimeout(d,i)})]})})},n.prototype.timeout=function(){return O(this,void 0,void 0,function(){return w(this,function(i){return[2,new Promise(function(u,d){return setTimeout(d,50)})]})})},n.prototype.reportToListeners=function(){this.fire({type:E.AudioStatusChange}),this.removeAll()},n.prototype.enableAudio=function(){return O(this,void 0,void 0,function(){return w(this,function(i){return this._enabled||(this._enabled=!0,this._status=ye.AVAILABLE,this.reportToListeners()),[2]})})},n.prototype.testAudio=function(){return O(this,void 0,void 0,function(){var i;return w(this,function(u){switch(u.label){case 0:if(!(this._status===ye.UNAVAILABLE&&this._audioContext!==null))return[3,4];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,Promise.race([this._audioContext.resume(),this.timeout()])];case 2:return u.sent(),this.enableAudio(),[3,4];case 3:return i=u.sent(),[3,4];case 4:return[2]}})})},n.prototype._establishAudio=function(){return O(this,void 0,void 0,function(){return w(this,function(i){switch(i.label){case 0:return this._started?[3,5]:(this._started=!0,typeof window>"u"?(this.enableAudio(),[3,5]):[3,1]);case 1:this._audioContext=new AudioContext,this.listenForUserAction(),i.label=2;case 2:return this._status!==ye.UNAVAILABLE?[3,5]:[4,this.testAudio()];case 3:return i.sent(),[4,this.delay(1e3)];case 4:return i.sent(),[3,2];case 5:return[2]}})})},n.prototype.listenForUserAction=function(){var i=this,u=function(){return O(i,void 0,void 0,function(){return w(this,function(d){return this.enableAudio(),[2]})})};document.addEventListener("pointerdown",u,{once:!0})},n.prototype.establishAudio=function(){return O(this,void 0,void 0,function(){return w(this,function(i){return this._establishAudio(),[2]})})},Object.defineProperty(n.prototype,"systemVolume",{get:function(){return this._status===ye.UNAVAILABLE?(this.testAudio(),0):1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),n}(se),me=new _e,Ee=function(){function o(){}return o.prototype.observe=function(){},o.prototype.unobserve=function(){},o.prototype.disconnect=function(){},o}(),ke=globalThis.ResizeObserver||Ee,Se=function(){function o(){var n=this;this._elementsMap=new Map,this._onObservedEntry=function(i){var u=n._elementsMap.get(i.target);u!==null?u.onResize(i.target.clientWidth==0||i.target.clientHeight==0):n._resizeObserver.unobserve(i.target)}
6,this._onObserved=function(i){i.forEach(n._onObservedEntry)},this._resizeObserver=new ke(this._onObserved)}return o.prototype.add=function(n,i){var u={onResize:i,element:n};return this._elementsMap.set(n,u),this._resizeObserver.observe(n),u},o.prototype.remove=function(n){this._resizeObserver.unobserve(n.element),this._elementsMap.delete(n.element)},o}(),Ve=new Se,rt=0,st=function(o){var n=o.stateMachine,i=o.animations,u=o.stateMachines;return i!==void 0&&g("The `animations` parameter is deprecated and will be removed in a future major version: please use the `stateMachine` parameter to play a state machine instead."),u!==void 0&&g("The `stateMachines` parameter is deprecated: please use `stateMachine` with a single state machine name instead."),n?{startingAnimationNames:[],startingStateMachineNames:[n]}:{startingAnimationNames:ht(i),startingStateMachineNames:ht(u)}},ut=function(){function o(n){this.enableRiveAssetCDN=!0,this.enablePerfMarks=!1,this.referenceCount=0,this.destroyed=!1,this.selfUnref=!1,this.bindableArtboards=[],this.deferred=!1,this.session=null,this._sessionClaimed=!1,this.fileFinalizer=null,this.boundElsewhereWarned=!1,this.src=n.src,this.buffer=n.buffer,this.deferred=!!n.enableGPUCanvas,n.assetLoader&&(this.assetLoader=n.assetLoader),this.enableRiveAssetCDN=typeof n.enableRiveAssetCDN=="boolean"?n.enableRiveAssetCDN:!0,this.enablePerfMarks=!!n.enablePerfMarks,this.enablePerfMarks&&(Q.RuntimeLoader.enablePerfMarks=!0),this.eventManager=new se,n.onLoad&&this.on(E.Load,n.onLoad),n.onLoadError&&this.on(E.LoadError,n.onLoadError)}return o.prototype.releaseFile=function(){var n,i;(n=this.fileFinalizer)===null||n===void 0||n.release(),(i=this.file)===null||i===void 0||i.unref(),this.fileFinalizer=null,this.file=null},o.prototype.releaseSession=function(){var n;(n=this.session)===null||n===void 0||n.delete(),this.session=null},o.prototype.releaseBindableArtboards=function(){this.bindableArtboards.forEach(function(n){return n.destroy()})},o.prototype.initData=function(){return O(this,void 0,void 0,function(){var n,i,u,d,m,y,N;return w(this,function(z){switch(z.label){case 0:if(!(this.src&&!this.buffer))return[3,4];z.label=1;case 1:return z.trys.push([1,3,,4]),n=this,[4,Jt(this.src)];case 2:return n.buffer=z.sent(),[3,4];case 3:throw i=z.sent(),i instanceof Error?i:new $(o.fileLoadErrorMessage);case 4:if(this.destroyed)return[2];this.deferred&&this.session===null&&(this.session=o.makeDeferredSession(this.runtime)),this.assetLoader&&(d=new p.CustomFileAssetLoaderWrapper(this.runtime,this.assetLoader,this.session),u=d.assetLoader),this.enablePerfMarks&&performance.mark("rive:file-load:start"),z.label=5;case 5:return z.trys.push([5,7,,8]),m=this,[4,this.runtime.load(new Uint8Array(this.buffer),u,this.enableRiveAssetCDN,this.session)];case 6:return m.file=z.sent(),[3,8];case 7:throw y=z.sent(),this.releaseSession(),y;case 8:return this.enablePerfMarks&&(performance.mark("rive:file-load:end"),performance.measure("rive:file-load","rive:file-load:start","rive:file-load:end")),this.destroyed?(this.releaseFile(),this.releaseSession(),[2]):this.file===null?(this.releaseSession(),this.fireLoadError(o.fileLoadErrorMessage),[2]):(N=new p.FileFinalizer(this.file,this.session),this.fileFinalizer=N,p.finalizationRegistry.register(this,N),this.eventManager.fire({type:E.Load,data:this}),[2])}})})},o.prototype.loadRiveFileBytes=function(){return O(this,void 0,void 0,function(){var n;return w(this,function(i){return this.enablePerfMarks&&performance.mark("rive:fetch-riv:start"),n=this.src?Jt(this.src):Promise.resolve(this.buffer),this.enablePerfMarks&&this.src&&n.then(function(){performance.mark("rive:fetch-riv:end"),performance.measure("rive:fetch-riv","rive:fetch-riv:start","rive:fetch-riv:end")}),[2,n]})})},o.prototype.loadRuntime=function(){return O(this,void 0,void 0,function(){var n;return w(this,function(i){return this.enablePerfMarks&&performance.mark("rive:await-wasm:start"),n=Q.RuntimeLoader.awaitInstance(),this.enablePerfMarks&&n.then(function(){performance.mark("rive:await-wasm:end"),performance.measure("rive:await-wasm","rive:await-wasm:start","rive:await-wasm:end")}),[2,n]})})},o.prototype.init=function(){return O(this,void 0,void 0,function(){var n,i,u,d;return w(this,function(m){switch(m.label){case 0:if(!this.src&&!this.buffer)return this.fireLoadError(o.missingErrorMessage),[2];m.label=1;case 1:return m.trys.push([1,4,,5]),[4,Promise.all([this.loadRiveFileBytes(),this.loadRuntime()])];case 2:return n=m.sent(),i=n[0],u=n[1],this.destroyed?[2]:(this.buffer=i,this.runtime=u,this.enablePerfMarks&&performance.mark("rive:init-d
6ata:start"),[4,this.initData()]);case 3:return m.sent(),this.enablePerfMarks&&(performance.mark("rive:init-data:end"),performance.measure("rive:init-data","rive:init-data:start","rive:init-data:end")),[3,5];case 4:return d=m.sent(),this.fireLoadError(d instanceof Error?d.message:o.fileLoadErrorMessage),[3,5];case 5:return[2]}})})},o.prototype.fireLoadError=function(n){throw this.eventManager.fire({type:E.LoadError,data:n}),new $(n)},o.prototype.on=function(n,i){this.eventManager.add({type:n,callback:i})},o.prototype.off=function(n,i){this.eventManager.remove({type:n,callback:i})},o.prototype.cleanup=function(){this.referenceCount-=1,this.referenceCount<=0&&(this.removeAllRiveEventListeners(),this.releaseFile(),this.releaseBindableArtboards(),this.releaseSession(),this.destroyed=!0)},o.makeDeferredSession=function(n){var i,u,d=(u=(i=n.makeDeferredSession)===null||i===void 0?void 0:i.call(n))!==null&&u!==void 0?u:null;return d===null&&!o.deferredUnsupportedWarned&&(o.deferredUnsupportedWarned=!0,J.warn("Rive: `enableGPUCanvas: true` was ignored because this runtime build has no GPU Canvas support; importing in immediate mode. Use a @rive-app/webgl2 or @rive-app/canvas build with deferred rendering compiled in.")),d},Object.defineProperty(o.prototype,"deferredSession",{get:function(){return this.session},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"deferredRequested",{get:function(){return this.deferred},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"sessionClaimed",{get:function(){return this._sessionClaimed},enumerable:!1,configurable:!0}),o.prototype.claimSession=function(){this._sessionClaimed=!0},o.prototype.warnBoundElsewhereOnce=function(){this.boundElsewhereWarned||(this.boundElsewhereWarned=!0,J.warn("Rive: this deferred RiveFile is already bound to another Rive instance's canvas, and a deferred session cannot span canvases. Re-importing the file for this instance (an extra parse of the retained buffer, no extra network request)."))},o.prototype.reimport=function(n){return O(this,void 0,void 0,function(){var i;return w(this,function(u){switch(u.label){case 0:return i=new o({buffer:this.buffer,assetLoader:this.assetLoader,enableRiveAssetCDN:this.enableRiveAssetCDN,enablePerfMarks:this.enablePerfMarks,enableGPUCanvas:n}),[4,i.init()];case 1:return u.sent(),[2,i]}})})},o.prototype.removeAllRiveEventListeners=function(n){this.eventManager.removeAll(n)},o.prototype.getInstance=function(){if(this.file!==null)return this.referenceCount+=1,this.file},o.prototype.destroyIfUnused=function(){this.referenceCount<=0&&this.cleanup()},o.prototype.createBindableArtboard=function(n){if(n!=null){var i=new D(n);return(0,p.createFinalization)(i,i.nativeArtboard),this.bindableArtboards.push(i),i}return null},o.prototype.getArtboard=function(n){var i=this.file.artboardByName(n);if(i!=null)return new k(i,this)},o.prototype.getBindableArtboard=function(n){var i=this.file.bindableArtboardByName(n);return this.createBindableArtboard(i)},o.prototype.getDefaultBindableArtboard=function(){var n=this.file.bindableArtboardDefault();return this.createBindableArtboard(n)},o.prototype.internalBindableArtboardFromArtboard=function(n){var i=this.file.internalBindableArtboardFromArtboard(n);return this.createBindableArtboard(i)},o.prototype.viewModelByName=function(n){var i=this.file.viewModelByName(n);return i!==null?new et(i):null},o.prototype.globalViewModelNames=function(){return this.file.globalViewModelNames()},o.missingErrorMessage="Rive source file or data buffer required",o.fileLoadErrorMessage="The file failed to load",o.deferredUnsupportedWarned=!1,o}(),ft=function(){function o(n){var i=this,u,d,m,y;this.loaded=!1,this.destroyed=!1,this._observed=null,this.readyForPlaying=!1,this.deferredRenderer=!1,this.ownsRiveFile=!1,this.artboard=null,this.eventCleanup=null,this._keyboardInteractions=null,this.shouldDisableRiveListeners=!1,this.automaticallyHandleEvents=!1,this.dispatchPointerExit=!0,this.enableMultiTouch=!1,this.enableRiveAssetCDN=!0,this.semanticsMode=j.SemanticMode.Disabled,this.semanticsOptions={riveCanvasLabel:"Rive animation"},this._semanticsActive=!1,this._volume=1,this._artboardWidth=void 0,this._artboardHeight=void 0,this._devicePixelRatioUsed=1,this._hasZeroSize=!1,this._needsRedraw=!1,this._currentCanvasWidth=0,this._currentCanvasHeight=0,this._audioEventListener=null,this._boundDraw=null,this._pageVisibilityHandler=null,this._explicitlyStoppedRendering=!1,this._viewModelInstance=null,this._globalViewModelInstances=new Map,this._dataEnums=null,this._tabIndex=null,this._prevHasFocus=!1,this._focusOptions={allowFocusInterrupt:!1},this._semanticTree=null,this._accessibilityOverlay=null,this._overlayTransformDirty=!0,this._instanceId="".concat(rt++),this.drawOptimization=C.DrawOnChanged,this.enablePerfMarks=!1,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=!1,this.onCanvasResize=function(N){var z=i._hasZeroSize!==N;i._hasZeroSize=N,N?(!i._layout.maxX||!i._layout.maxY)&&i.resizeToCanvas():z&&i.resizeDrawingSurfaceToCanvas()},this.frameRequestId=null,this.renderSecondTimer=0,this._boundDraw=this.draw.bind(this),typeof document<"u"&&(this._pageVisibilityHandler=this._onPageVisibilityChange.bind(this),document.addEventListener("visibilitychange",this._pageVisibilityHandler)),this.canvas=n.canvas,n.canvas.constructor===HTMLCanvasElement&&(this._observed=Ve.add(this.canvas,this.onCanvasResize)),this._currentCanvasWidth=this.canvas.width,this._currentCanvasHeight=this.canvas.height,this.src=n.src,this.buffer=n.buffer,this.riveFile=n.riveFile,this.layout=(u=n.layout)!==null&&u!==void 0?u:new M,this.shouldDisableRiveListeners=!!n.shouldDisableRiveListeners,this.isTouchScrollEnabled=!!n.isTouchScrollEnabled,n.automaticallyHandleEvents&&g("The `automaticallyHandleEvents` parameter is deprecated. "+v),this.automaticallyHandleEvents=!!n.automaticallyHandleEvents,this.dispatchPointerExit=n.dispatchPointerExit===!1?n.dispatchPointerExit:this.dispatchPointerExit,this.enableMultiTouch=!!n.enableMultiTouch,this.drawOptimization=(d=n.drawingOptions)!==null&&d!==void 0?d:this.drawOptimization,this.enableRiveAssetCDN=n.enableRiveAssetCDN===void 0?!0:n.enableRiveAssetCDN,this.enablePerfMarks=!!n.enablePerfMarks,this.enablePerfMarks&&(Q.RuntimeLoader.enablePerfMarks=!0),this._focusOptions=(m=n.focusOptions)!==null&&m!==void 0?m:this._focusOptions,this._tabIndex=(y=n.tabIndex)!==null&&y!==void 0?y:null,this.deferredRenderer=!!n.enableGPUCanvas,this.eventManager=new se,n.onLoad&&this.on(E.Load,n.onLoad),n.onLoadError&&this.on(E.LoadError,n.onLoadError),n.onPlay&&this.on(E.Play,n.onPlay),n.onPause&&this.on(E.Pause,n.onPause),n.onStop&&this.on(E.Stop,n.onStop),n.onLoop&&this.on(E.Loop,n.onLoop),n.onStateChange&&this.on(E.StateChange,n.onStateChange),n.onAdvance&&this.on(E.Advance,n.onAdvance),n.onload&&!n.onLoad&&this.on(E.Load,n.onload),n.onloaderror&&!n.onLoadError&&this.on(E.LoadError,n.onloaderror),n.onplay&&!n.onPlay&&this.on(E.Play,n.onplay),n.onpause&&!n.onPause&&this.on(E.Pause,n.onpause),n.onstop&&!n.onStop&&this.on(E.Stop,n.onstop),n.onloop&&!n.onLoop&&this.on(E.Loop,n.onloop),n.onstatechange&&!n.onStateChange&&this.on(E.StateChange,n.onstatechange),n.assetLoader&&(this.assetLoader=n.assetLoader),this.taskQueue=new pe(this.eventManager),this.init({src:this.src,buffer:this.buffer,riveFile:this.riveFile,autoplay:n.autoplay,autoBind:n.autoBind,stateMachine:n.stateMachine,animations:n.animations,stateMachines:n.stateMachines,artboard:n.artboard,useOffscreenRenderer:n.useOffscreenRenderer,tabIndex:n.tabIndex,semanticsMode:n.semanticsMode,semanticsOptions:n.semanticsOptions,enableGPUCanvas:this.deferredRenderer})}return Object.defineProperty(o.prototype,"viewModelCount",{get:function(){return this.file.viewModelCount()}
6,enumerable:!1,configurable:!0}),o.new=function(n){return J.warn("This function is deprecated: please use `new Rive({})` instead"),new o(n)},o.prototype.enableSemantics=function(){this.semanticsMode=j.SemanticMode.Enabled,this.activateSemantics()},o.prototype.activateSemantics=function(){this._semanticsActive||this.semanticsMode===j.SemanticMode.Disabled||(this._semanticsActive=!0,this.syncSemanticsOnStateMachines())},o.prototype.syncSemanticsOnStateMachines=function(){if(!(!this._semanticsActive||!this.animator))for(var n=0,i=this.animator.stateMachines;n<i.length;n++){var u=i[n];u.enableSemantics()}},o.prototype.cleanupSemantics=function(){this._semanticTree=null,this._accessibilityOverlay&&(this._accessibilityOverlay.destroy(),this._accessibilityOverlay=null)},o.prototype.onSystemAudioChanged=function(){this.volume=this._volume},o.prototype.init=function(n){var i=this,u,d,m,y,N,z=n.src,U=n.buffer,le=n.riveFile,he=n.stateMachine,Ie=n.animations,De=n.stateMachines,Ce=n.artboard,Ue=n.autoplay,je=Ue===void 0?!1:Ue,at=n.useOffscreenRenderer,vt=at===void 0?!1:at,ot=n.autoBind,lt=ot===void 0?!1:ot,Qe=n.tabIndex,Je=n.semanticsMode,Ge=n.semanticsOptions,xe=n.enableGPUCanvas;if(!this.destroyed){if(!z&&!U&&!le)throw new $(o.missingErrorMessage);this.artboard&&((d=(u=this.renderer)===null||u===void 0?void 0:u.bindContext)===null||d===void 0||d.call(u),(m=this.animator)===null||m===void 0||m.stop(),this.artboard.delete(),this.artboard=null),this.renderer&&((N=(y=this.renderer).detachSession)===null||N===void 0||N.call(y)),this.releaseCurrentRiveFile(!1),this.src=z,this.buffer=U,this.riveFile=le,this.ownsRiveFile=!1,this.deferredRenderer=xe??this.deferredRenderer,this._tabIndex=Qe??null,this.semanticsMode=Je??j.SemanticMode.Disabled,this.semanticsOptions=Ge??this.semanticsOptions;var ve=st({stateMachine:he,animations:Ie,stateMachines:De}),It=ve.startingAnimationNames,Ne=ve.startingStateMachineNames;this.loaded=!1,this.readyForPlaying=!1,Q.RuntimeLoader.awaitInstance().then(function(_t){if(!i.destroyed){i.runtime=_t,i.removeRiveListeners(),i.cleanupSemantics(),i.deleteRiveRenderer(),i.enablePerfMarks&&performance.mark("rive:make-renderer:start");try{if(i.renderer=i.runtime.makeRenderer(i.canvas,vt),!i.renderer)throw new Error("Renderer is null, cannot render Rive on the canvas.")}catch(Ze){throw J.error(Ze),new $("Unable to create the renderer, your environment may not support WebGL. Try the @rive-app/canvas runtime as an alternative.")}i.enablePerfMarks&&(performance.mark("rive:make-renderer:end"),performance.measure("rive:make-renderer","rive:make-renderer:start","rive:make-renderer:end")),i.canvas.width||i.canvas.height||i.resizeDrawingSurfaceToCanvas(),i.initData(Ce,It,Ne,je,lt).then(function(Ze){if(Ze)return i.setupRiveListeners()}).catch(function(Ze){J.error(Ze)})}}).catch(function(_t){i.eventManager.fire({type:E.LoadError,data:_t.message})})}},o.prototype.setupRiveListeners=function(n){var i=this;if(this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),!this.shouldDisableRiveListeners){var u=this.animator.stateMachines.filter(function(z){return z.playing}),d=u.filter(function(z){return i.runtime.hasListeners(z.instance)}).map(function(z){return z.instance}),m=this.isTouchScrollEnabled,y=this.dispatchPointerExit,N=this.enableMultiTouch;n&&"isTouchScrollEnabled"in n&&(m=n.isTouchScrollEnabled),this.eventCleanup=(0,p.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:d,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:m,dispatchPointerExit:y,enableMultiTouch:N,layoutScaleFactor:this._layout.layoutScaleFactor,advanceAndDrain:this.advanceAndReportChanges.bind(this)}),this.ensureKeyboardInteractions()}},o.prototype.ensureKeyboardInteractions=function(){var n=this;if(!(this._keyboardInteractions||this.shouldDisableRiveListeners||typeof window>"u"||!(this.canvas instanceof HTMLCanvasElement))){var i=this.animator.stateMachines.find(function(d){return d.playing&&d.hasFocusNodes});if(i){var u=this.canvas.tabIndex;(u===-1||isNaN(u))&&(this.canvas.tabIndex=this._tabIndex!==null?this._tabIndex:0),this._keyboardInteractions=new p.KeyboardInteractions({canvas:this.canvas,stateMachine:i.instance,hasFocusNodes:!0,getOverlayElement:function(){var d,m;return(m=(d=n._accessibilityOverlay)===null||d===void 0?void 0:d.getSemanticOverlayContainer())!==null&&m!==void 0?m:null}})}}},o.prototype.cleanupKeyboardInteractions=function(){this._keyboardInteractions&&(this._keyboardInteractions.cleanup(),this._keyboardInteractions=null)},o.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null),this.cleanupKeyboardInteractions()},o.prototype.initializeAudio=function(){var n=this,i;me.status==ye.UNAVAILABLE&&(this.file.hasAudio||!((i=this.artboard)===null||i===void 0)&&i.hasAudio&&this._audioEventListener===null)&&(this._audioEventListener={type:E.AudioStatusChange,callback:function(){return n.onSystemAudioChanged()}},me.add(this._audioEventListener),me.establishAudio())},o.prototype.initArtboardSize=function(){this.artboard&&(this._artboardWidth=this.artboard.width=this._artboardWidth||this.artboard.width,this._artboardHeight=this.artboard.height=this._artboardHeight||this.artboard.height)},o.prototype.initData=function(n,i,u,d,m){return O(this,void 0,void 0,function(){var y,N,z,U,le;return w(this,function(he){switch(he.label){case 0:return he.trys.push([0,5,,6]),this.ownsRiveFile=this.riveFile==null,this.ownsRiveFile?(y=new ut({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader,enablePerfMarks:this.enablePerfMarks,enableGPUCanvas:this.deferredRenderer}),this.riveFile=y,[4,y.init()]):[3,2];case 1:if(he.sent(),this.destroyed)return y.destroyIfUnused(),[2,!1];he.label=2;case 2:return this.riveFile.deferredSession!==null||this.deferredRenderer?[4,this.resolveDeferredRendering()]:[3,4];case 3:if(he.sent(),this.destroyed)return this.ownsRiveFile&&((U=this.riveFile)===null||U===void 0||U.destroyIfUnused()),[2,!1];he.label=4;case 4:this.file=this.riveFile.getInstance(),this.initArtboard(n,i,u,d,m),this.initArtboardSize(),this.initializeAudio(),this.semanticsMode===j.SemanticMode.Enabled?this.activateSemantics():this._semanticsActive&&this.syncSemanticsOnStateMachines();try{this.loaded=!0,this.eventManager.fire({type:E.Load,data:(le=this.src)!==null&&le!==void 0?le:"buffer"})}catch(Ie){J.error(Ie)}return this.animator.advanceIfPaused(),this.readyForPlaying=!0,this.taskQueue.process(),this.drawFrame(),[2,!0];case 5:return N=he.sent(),z=ie(N),this.eventManager.fire({type:E.LoadError,data:z}),[2,Promise.reject(z)];case 6:return[2]}})})},o.prototype.resolveDeferredRendering=function(){return O(this,void 0,void 0,function(){var n,i,u,d,m,y,N,z,U,le;return w(this,function(he){switch(he.label){case 0:return n=this.riveFile,i=this.ownsRiveFile,u=this.renderer,d=n.deferredSession,d===null?(this.deferredRenderer&&!n.deferredRequested&&J.warn("Rive: `enableGPUCanvas: true` was ignored because this RiveFile was imported without it. The mode is fixed at import: construct the RiveFile with `enableGPUCanvas: true` to opt in."),[2]):(this.deferredRenderer||J.warn("Rive: this RiveFile was imported with `enableGPUCanvas: true`, so this instance renders deferred even though `enableGPUCanvas` is false on the instance. An immediate renderer would drop the file's deferred resources and draw nothing."),m=u?.attachSession,typeof m=="function"?[3,2]:(J.warn("Rive: this renderer cannot replay a deferred session (`useOffscreenRenderer` is not supported with deferred rendering). Re-importing the file in immediate mode for this instance."),[4,n.reimport(!1)])
6);case 1:return y=he.sent(),this.destroyed?(y.destroyIfUnused(),[2]):(this.riveFile=y,this.ownsRiveFile=!0,i&&n.destroyIfUnused(),[2]);case 2:return!n.sessionClaimed&&m.call(u,d)?(n.claimSession(),[2]):(n.warnBoundElsewhereOnce(),[4,n.reimport(!0)]);case 3:return N=he.sent(),this.destroyed?(N.destroyIfUnused(),[2]):(this.riveFile=N,this.ownsRiveFile=!0,z=N.deferredSession,z!==null&&m.call(u,z)?(N.claimSession(),[2]):(J.warn("Rive: could not attach the re-imported file's deferred session to this canvas; falling back to immediate rendering for this instance."),(le=u.detachSession)===null||le===void 0||le.call(u),[4,n.reimport(!1)]));case 4:return U=he.sent(),N.destroyIfUnused(),this.destroyed?(U.destroyIfUnused(),[2]):(this.riveFile=U,this.ownsRiveFile=!0,i&&n.destroyIfUnused(),[2])}})})},o.prototype.initArtboard=function(n,i,u,d,m){if(this.file){var y=n?this.file.artboardByName(n):this.file.defaultArtboard();if(!y)throw new $("Invalid artboard name or no default artboard");this.artboard=y,y.volume=this._volume*me.systemVolume,this.animator=new ae(this.runtime,this.artboard,this.eventManager);var N;if(i.length>0||u.length>0?(N=i.concat(u),this.animator.initLinearAnimations(i,d),this.animator.initStateMachines(u,d,this._semanticsActive)):N=[this.animator.atLeastOne(d,!1,this._semanticsActive)],this.taskQueue.add({event:{type:d?E.Play:E.Pause,data:N}}),m){var z=this.file.defaultArtboardViewModel(y);if(z!==null){var U=z.defaultInstance();if(U!==null){var le=new it(U,null);(0,p.createFinalization)(le,le.runtimeInstance),this.setViewModelInstance(le)}}for(var he=0,Ie=this.file.globalViewModelNames();he<Ie.length;he++){var De=Ie[he],Ce=this.file.viewModelByName(De);if(Ce!==null){var Ue=new et(Ce).defaultInstance();Ue!==null&&this.setGlobalViewModelInstance(De,Ue)}}this.bind()}}},o.prototype.drawFrame=function(){var n,i;!((n=document?.timeline)===null||n===void 0)&&n.currentTime?this.loaded&&this.artboard&&!this.frameRequestId&&(this._boundDraw(document.timeline.currentTime),(i=this.runtime)===null||i===void 0||i.resolveAnimationFrame()):this.scheduleRendering()},o.prototype._canvasSizeChanged=function(){var n=!1;return this.canvas&&(this.canvas.width!==this._currentCanvasWidth&&(this._currentCanvasWidth=this.canvas.width,n=!0),this.canvas.height!==this._currentCanvasHeight&&(this._currentCanvasHeight=this.canvas.height,n=!0)),n},o.prototype._deferredWorkPending=function(){var n,i,u;return(u=(i=(n=this.riveFile)===null||n===void 0?void 0:n.deferredSession)===null||i===void 0?void 0:i.recordedThisFrame())!==null&&u!==void 0?u:!1},o.prototype.pollFocusState=function(){var n,i;if(this.ensureKeyboardInteractions(),!this._keyboardInteractions){this._prevHasFocus=!1;return}var u=this.animator.stateMachines.find(function(N){return N.playing&&N.hasFocusNodes});if(!u){this._prevHasFocus=!1;return}if(this.canvas instanceof HTMLCanvasElement){var d=u.focusState().hasFocus;if(d){if(this._keyboardInteractions.notifyRiveFocused(),!this._prevHasFocus){var m=(n=this._accessibilityOverlay)===null||n===void 0?void 0:n.getSemanticOverlayContainer(),y=document.activeElement===this.canvas||((i=m?.contains(document.activeElement))!==null&&i!==void 0?i:!1);!y&&this._focusOptions.allowFocusInterrupt&&this.canvas.focus(),this._prevHasFocus=!0}return}this._prevHasFocus=!1,this._keyboardInteractions.focusSessionState===p.FocusSessionState.RiveFocused&&this._keyboardInteractions.setFocusSessionState(p.FocusSessionState.NotFocused)}},o.prototype.advanceAndReportChanges=function(n){for(var i,u,d=this.animator.animations.filter(function(Ne){return Ne.playing||Ne.needsScrub}).sort(function(Ne){return Ne.needsScrub?-1:1}),m=0,y=d;m<y.length;m++){var N=y[m];N.advance(n),N.instance.didLoop&&(N.loopCount+=1),N.apply(1)}for(var z=this.animator.stateMachines.filter(function(Ne){return Ne.playing}),U=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1,le=0,he=z;le<he.length;le++){var Ie=he[le],De=Ie.reportedEventCount();if(De)for(var Ce=0;Ce<De;Ce++){var Ue=Ie.reportedEventAt(Ce);if(Ue)if(Ue.type===q.OpenUrl){if(this.eventManager.fire({type:E.RiveEvent,data:Ue}),this.automaticallyHandleEvents){var je=document.createElement("a"),at=Ue,vt=at.url,ot=at.target,lt=(0,p.sanitizeUrl)(vt);vt&&je.setAttribute("href",lt),ot&&je.setAttribute("target",ot),lt&&lt!==p.BLANK_URL&&je.click()}}else this.eventManager.fire({type:E.RiveEvent,data:Ue})}if(U>=0&&performance.mark("rive:sm-advance:start:f".concat(U)),Ie.advanceAndApply(n),U>=0&&(performance.mark("rive:sm-advance:end:f".concat(U)),performance.measure("rive:sm-advance:f".concat(U),"rive:sm-advance:start:f".concat(U),"rive:sm-advance:end:f".concat(U))),this._semanticsActive){var Qe=Ie.drainSemanticsDiff();Qe&&(this._semanticTree||(this._semanticTree=new j.SemanticTreeModel),this._semanticTree.applyDiff(Qe))}}if(this._semanticsActive&&this._semanticTree&&z.length>0&&this.canvas instanceof HTMLCanvasElement){if(!this._accessibilityOverlay){var Je=z[0];this._accessibilityOverlay=new j.AccessibilityOverlay({canvas:this.canvas,instanceId:this._instanceId,semanticsOptions:this.semanticsOptions,allowFocusInterrupt:this._focusOptions.allowFocusInterrupt,fireAction:function(Ne,_t){Je.fireSemanticAction(Ne,_t)},requestFocus:function(Ne){return Je.focusSemanticNode(Ne)},clearFocus:function(){return Je.instance.clearFocus()}})}var Ge=(i=this._accessibilityOverlay)===null||i===void 0?void 0:i.needsUpdate(this._semanticTree);if(Ge||this._overlayTransformDirty){var xe=null;if(Ge?.layoutChanged||this._overlayTransformDirty){var ve=this._layout.runtimeFit(this.runtime),It=this._layout.runtimeAlignment(this.runtime);xe=this.runtime.computeAlignment(ve,It,{minX:this._layout.minX,minY:this._layout.minY,maxX:this._layout.maxX,maxY:this._layout.maxY},this.artboard.bounds,this._devicePixelRatioUsed*this._layout.layoutScaleFactor),this._overlayTransformDirty=!1}this._accessibilityOverlay.update(this._semanticTree,xe,this._devicePixelRatioUsed,this.artboard.bounds,Ge),xe?.delete()}}this.animator.stateMachines.length==0&&this.artboard.advance(n),this.animator.handleLooping(),this.animator.handleStateChanges(),this.animator.handleAdvancing(n),this.pollFocusState(),(u=this._viewModelInstance)===null||u===void 0||u.handleCallbacks(),this._globalViewModelInstances.forEac
6h(function(Ne){Ne&&Ne.handleCallbacks()})},o.prototype.draw=function(n,i){if(this.frameRequestId=null,!!this.artboard){var u=performance.now(),d=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1;this.lastRenderTime||(this.lastRenderTime=n),this.renderSecondTimer+=n-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,i?.());var m=(n-this.lastRenderTime)/1e3;this.lastRenderTime=n,this.advanceAndReportChanges(m);var y=this.renderer;this._hasZeroSize||(this.drawOptimization==C.AlwaysDraw||this.artboard.didChange()||this._deferredWorkPending()||this._needsRedraw||this._canvasSizeChanged())&&(y.clear(),y.save(),d>=0&&performance.mark("rive:align-renderer:start:f".concat(d)),this.alignRenderer(),d>=0&&(performance.mark("rive:align-renderer:end:f".concat(d)),performance.measure("rive:align-renderer:f".concat(d),"rive:align-renderer:start:f".concat(d),"rive:align-renderer:end:f".concat(d))),d>=0&&performance.mark("rive:artboard-draw:start:f".concat(d)),this.artboard.draw(y),d>=0&&(performance.mark("rive:artboard-draw:end:f".concat(d)),performance.measure("rive:artboard-draw:f".concat(d),"rive:artboard-draw:start:f".concat(d),"rive:artboard-draw:end:f".concat(d))),y.restore(),d>=0&&performance.mark("rive:renderer-flush:start:f".concat(d)),y.flush(),d>=0&&(performance.mark("rive:renderer-flush:end:f".concat(d)),performance.measure("rive:renderer-flush:f".concat(d),"rive:renderer-flush:start:f".concat(d),"rive:renderer-flush:end:f".concat(d))),this._needsRedraw=!1),this.frameCount++;var N=performance.now();for(this.frameTimes.push(N),this.durations.push(N-u);this.frameTimes[0]<=N-1e3;)this.frameTimes.shift(),this.durations.shift();this.animator.isPlaying?this.scheduleRendering():this.animator.isPaused?this.lastRenderTime=0:this.animator.isStopped&&(this.lastRenderTime=0)}},o.prototype.alignRenderer=function(){var n=this,i=n.renderer,u=n.runtime,d=n._layout,m=n.artboard;i.align(d.runtimeFit(u),d.runtimeAlignment(u),{minX:d.minX,minY:d.minY,maxX:d.maxX,maxY:d.maxY},m.bounds,this._devicePixelRatioUsed*d.layoutScaleFactor)},Object.defineProperty(o.prototype,"fps",{get:function(){return this.durations.length},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"frameTime",{get:function(){return this.durations.length===0?0:(this.durations.reduce(function(n,i){return n+i},0)/this.durations.length).toFixed(4)},enumerable:!1,configurable:!0}),o.prototype.cleanup=function(){var n,i,u,d,m;this.destroyed=!0,this.stopRendering(),(i=(n=this.renderer)===null||n===void 0?void 0:n.bindContext)===null||i===void 0||i.call(n),this.cleanupInstances(),this._observed!==null&&Ve.remove(this._observed),this.removeRiveListeners(),this.renderer&&((d=(u=this.renderer).detachSession)===null||d===void 0||d.call(u)),this.releaseCurrentRiveFile(!0),this.riveFile=null,this.deleteRiveRenderer(),this._audioEventListener!==null&&(me.remove(this._audioEventListener),this._audioEventListener=null),this._pageVisibilityHandler&&(document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),(m=this._viewModelInstance)===null||m===void 0||m.cleanup(),this._viewModelInstance=null,this._globalViewModelInstances.forEach(function(y){return y.cleanup()}),this._globalViewModelInstances.clear(),this._dataEnums=null},o.prototype.releaseCurrentRiveFile=function(n){var i,u;this.file?((n||this.ownsRiveFile)&&((i=this.riveFile)===null||i===void 0||i.cleanup()),this.file=null):this.ownsRiveFile&&((u=this.riveFile)===null||u===void 0||u.destroyIfUnused())},o.prototype.deleteRiveRenderer=function(){var n,i;this.renderer&&((i=(n=this.renderer).detachSession)===null||i===void 0||i.call(n),this.renderer.delete()),this.renderer=null},Object.defineProperty(o.prototype,"deferredRendererActive",{get:function(){var n,i,u;return(u=(i=(n=this.renderer)===null||n===void 0?void 0:n.deferredActive)===null||i===void 0?void 0:i.call(n))!==null&&u!==void 0?u:!1},enumerable:!1,configurable:!0}),o.prototype.cleanupInstances=function(){var n;this.eventCleanup!==null&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.cleanupSemantics(),(n=this.animator)===null||n===void 0||n.stop(),this.artboard&&(this.artboard.delete(),this.artboard=null)},o.prototype.retrieveTextRun=function(n){var i;if(!n){J.warn("No text run name provided");return}if(!this.artboard){J.warn("Tried to access text run, but the Artboard is null");return}var u=this.artboard.textRun(n);if(!u){J.warn("Could not access a text run with name '".concat(n,"' in the '").concat((i=this.artboard)===null||i===void 0?void 0:i.name,"' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime."));return}return u},o.prototype.getTextRunValue=function(n){g(S);var i=this.retrieveTextRun(n);return i?i.text:void 0},o.prototype.setTextRunValue=function(n,i){g(S);var u=this.retrieveTextRun(n);u&&(u.text=i)},o.prototype.warnIfLinearAnimationNames=function(n,i){this.animator&&this.animator.animations.some(function(u){return n.includes(u.name)})&&ee(i)},o.prototype.play=function(n,i){var u=this;x(n,"play");var d=ht(n);if(!this.readyForPlaying){this.taskQueue.add({action:function(){return u.play(n,i)}});return}this.animator.play(d),this.warnIfLinearAnimationNames(d,"play"),this.syncSemanticsOnStateMachines(),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.setupRiveListeners(),this.startRendering()},o.prototype.pause=function(n){var i=this;x(n,"pause");
6var u=ht(n);if(!this.readyForPlaying){this.taskQueue.add({action:function(){return i.pause(n)}});return}this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.animator.pause(u),this.warnIfLinearAnimationNames(u,"pause")},o.prototype.scrub=function(n,i){var u=this;g("`scrub()` is deprecated and will be removed in a future major version: use a state machine to control playback instead.");var d=ht(n);if(!this.readyForPlaying){this.taskQueue.add({action:function(){return u.scrub(n,i)}});return}this.animator.scrub(d,i||0),this.drawFrame()},o.prototype.stop=function(n){var i=this;x(n,"stop");var u=ht(n);if(!this.readyForPlaying){this.taskQueue.add({action:function(){return i.stop(n)}});return}this.warnIfLinearAnimationNames(u,"stop"),this.animator&&this.animator.stop(u),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.cleanupSemantics()},o.prototype.reset=function(n){var i,u,d=n?.artboard,m=st({stateMachine:n?.stateMachine,animations:n?.animations,stateMachines:n?.stateMachines}),y=m.startingAnimationNames,N=m.startingStateMachineNames,z=(i=n?.autoplay)!==null&&i!==void 0?i:!1,U=(u=n?.autoBind)!==null&&u!==void 0?u:!1;this.cleanupInstances(),this.initArtboard(d,y,N,z,U),this.readyForPlaying&&this.taskQueue.process()},o.prototype.load=function(n){if(!n.src&&!n.buffer&&!n.riveFile)throw new $(o.missingErrorMessage);this.stop(),this.init(n)},Object.defineProperty(o.prototype,"layout",{get:function(){return this._layout},set:function(n){this._layout=n,this._overlayTransformDirty=!0,(!n.maxX||!n.maxY)&&this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame()},enumerable:!1,configurable:!0}),o.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height}),this._overlayTransformDirty=!0},o.prototype.resizeDrawingSurfaceToCanvas=function(n){if(this.canvas instanceof HTMLCanvasElement&&window){var i=this.canvas.getBoundingClientRect(),u=i.width,d=i.height,m=n||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=m,this.canvas.width=m*u,this.canvas.height=m*d,this._needsRedraw=!0,this.resizeToCanvas(),this.layout.fit===L.Layout){var y=this._layout.layoutScaleFactor;this.artboard.width=u/y,this.artboard.height=d/y}this.drawFrame()}},Object.defineProperty(o.prototype,"source",{get:function(){return this.src},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"semanticTree",{get:function(){return this._semanticTree},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"accessibilityOverlay",{get:function(){return this._accessibilityOverlay},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"animationNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var n=[],i=0;i<this.artboard.animationCount();i++)n.push(this.artboard.animationByIndex(i).name);return n},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"stateMachineNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var n=[],i=0;i<this.artboard.stateMachineCount();i++)n.push(this.artboard.stateMachineByIndex(i).name);return n},enumerable:!1,configurable:!0}),o.prototype.stateMachineInputs=function(n){if(g(A),!!this.loaded){var i=this.animator.stateMachines.find(function(u){return u.name===n});return i?.inputs}},o.prototype.retrieveInputAtPath=function(n,i){if(!n){J.warn("No input name provided for path '".concat(i,"'"));return}if(!this.artboard){J.warn("Tried to access input: '".concat(n,"', at path: '").concat(i,"', but the Artboard is null"));return}var u=this.artboard.inputByPath(n,i);if(!u){J.warn("Could not access an input with name: '".concat(n,"', at path:'").concat(i,"'"));return}return u},o.prototype.setBooleanStateAtPath=function(n,i,u){g(A);var d=this.retrieveInputAtPath(n,u);
6d&&(d.type===T.Boolean?d.asBool().value=i:J.warn("Input with name: '".concat(n,"', at path:'").concat(u,"' is not a boolean")))},o.prototype.setNumberStateAtPath=function(n,i,u){g(A);var d=this.retrieveInputAtPath(n,u);d&&(d.type===T.Number?d.asNumber().value=i:J.warn("Input with name: '".concat(n,"', at path:'").concat(u,"' is not a number")))},o.prototype.fireStateAtPath=function(n,i){g(A);var u=this.retrieveInputAtPath(n,i);u&&(u.type===T.Trigger?u.asTrigger().fire():J.warn("Input with name: '".concat(n,"', at path:'").concat(i,"' is not a trigger")))},o.prototype.retrieveTextAtPath=function(n,i){if(!n){J.warn("No text name provided for path '".concat(i,"'"));return}if(!i){J.warn("No path provided for text '".concat(n,"'"));return}if(!this.artboard){J.warn("Tried to access text: '".concat(n,"', at path: '").concat(i,"', but the Artboard is null"));return}var u=this.artboard.textByPath(n,i);if(!u){J.warn("Could not access text with name: '".concat(n,"', at path:'").concat(i,"'"));return}return u},o.prototype.getTextRunValueAtPath=function(n,i){g(S);var u=this.retrieveTextAtPath(n,i);if(!u){J.warn("Could not get text with name: '".concat(n,"', at path:'").concat(i,"'"));return}return u.text},o.prototype.setTextRunValueAtPath=function(n,i,u){g(S);var d=this.retrieveTextAtPath(n,u);if(!d){J.warn("Could not set text with name: '".concat(n,"', at path:'").concat(u,"'"));return}d.text=i},Object.defineProperty(o.prototype,"playingStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(n){return n.playing}).map(function(n){return n.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"playingAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(n){return n.playing}).map(function(n){return n.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"pausedAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(n){return!n.playing}).map(function(n){return n.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"pausedStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(n){return!n.playing}).map(function(n){return n.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"isPlaying",{get:function(){return this.animator.isPlaying},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"isPaused",{get:function(){return this.animator.isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"isStopped",{get:function(){var n,i;return(i=(n=this.animator)===null||n===void 0?void 0:n.isStopped)!==null&&i!==void 0?i:!0},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"bounds",{get:function(){return this.artboard?this.artboard.bounds:void 0},enumerable:!1,configurable:!0}),o.prototype.on=function(n,i){n===E.RiveEvent?g(v):n===E.StateChange?g(I):n===E.Loop&&g(R),this.eventManager.add({type:n,callback:i})},o.prototype.off=function(n,i){this.eventManager.remove({type:n,callback:i})},o.prototype.unsubscribe=function(n,i){J.warn("This function is deprecated: please use `off()` instead."),this.off(n,i)},o.prototype.removeAllRiveEventListeners=function(n){this.eventManager.removeAll(n)},o.prototype.unsubscribeAll=function(n){J.warn("This function is deprecated: please use `removeAllRiveEventListeners()` instead."),this.removeAllRiveEventListeners(n)},o.prototype.stopRendering=function(){this._explicitlyStoppedRendering=!0,this.loaded&&this.frameRequestId&&(this.runtime.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null)},o.prototype.startRendering=function(){this._explicitlyStoppedRendering=!1,this.drawFrame()},o.prototype.scheduleRendering=function(){this.loaded&&this.artboard&&!this.frameRequestId&&(this.runtime.requestAnimationFrame?this.frameRequestId=this.runtime.requestAnimationFrame(this._boundDraw):this.frameRequestId=requestAnimationFrame(this._boundDraw))},o.prototype._onPageVisibilityChange=function(){var n,i;document.hidden?(this.frameRequestId!==null&&(!((n=this.runtime)===null||n===void 0)&&n.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null),this.lastRenderTime=0):!((i=this.animator)===null||i===void 0)&&i.isPlaying&&!this._explicitlyStoppedRendering&&this.scheduleRendering()},o.prototype.enableFPSCounter=function(n){this.runtime.enableFPSCounter(n)},o.prototype.disableFPSCounter=function(){this.runtime.disableFPSCounter()},Object.defineProperty(o.prototype,"contents",{get:function(){if(this.loaded){for(var n={artboards:[]},i=0;i<this.file.artboardCount();i++){for(var u=this.file.artboardByIndex(i),d={name:u.name,animations:[],stateMachines:[]},m=0;m<u.animationCount();m++){var y=u.animationByIndex(m);d.animations.push(y.name)}for(var N=0;N<u.stateMachineCount();N++){for(var z=u.stateMachineByIndex(N),U=z.name,le=new this.runtime.StateMachineInstance(z,u),he=[],Ie=0;Ie<le.inputCount();Ie++){var De=le.input(Ie);he.push({name:De.name,type:De.type})}d.stateMachines.push({name:U,inputs:he})}n.artboards.push(d)}return n}}
6,enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"volume",{get:function(){return this.artboard&&this.artboard.volume!==this._volume&&(this._volume=this.artboard.volume),this._volume},set:function(n){this._volume=n,this.artboard&&(this.artboard.volume=n*me.systemVolume)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"artboardWidth",{get:function(){var n;return this.artboard?this.artboard.width:(n=this._artboardWidth)!==null&&n!==void 0?n:0},set:function(n){this._artboardWidth=n,this.artboard&&(this.artboard.width=n)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"artboardHeight",{get:function(){var n;return this.artboard?this.artboard.height:(n=this._artboardHeight)!==null&&n!==void 0?n:0},set:function(n){this._artboardHeight=n,this.artboard&&(this.artboard.height=n)},enumerable:!1,configurable:!0}),o.prototype.resetArtboardSize=function(){this.artboard?(this.artboard.resetArtboardSize(),this._artboardWidth=this.artboard.width,this._artboardHeight=this.artboard.height):(this._artboardWidth=void 0,this._artboardHeight=void 0)},Object.defineProperty(o.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(n){n!==this._devicePixelRatioUsed&&(this._overlayTransformDirty=!0),this._devicePixelRatioUsed=n},enumerable:!1,configurable:!0}),o.prototype.bindViewModelInstance=function(n){n&&(this.setViewModelInstance(n),this.bind())},o.prototype.setViewModelInstance=function(n){var i,u=n?.runtimeInstance;!this.artboard||this.destroyed||!n||!u||(n.internalIncrementReferenceCount(),(i=this._viewModelInstance)===null||i===void 0||i.cleanup(),this._viewModelInstance=n,this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(d){return d.instance.setViewModelInstance(u)}):this.artboard.setViewModelInstance(u))},o.prototype.bind=function(){!this.artboard||this.destroyed||(this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(n){return n.instance.bind()}):this.artboard.bind())},Object.defineProperty(o.prototype,"viewModelInstance",{get:function(){return this._viewModelInstance},enumerable:!1,configurable:!0}),o.prototype.setGlobalViewModelInstance=function(n,i){var u,d=i?.runtimeInstance;if(!this.artboard||this.destroyed||!d)return!1;var m=!1;return this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(y){y.instance.setGlobalViewModelInstance(n,d)&&(m=!0)}):m=this.artboard.setGlobalViewModelInstance(n,d),m&&(i.internalIncrementReferenceCount(),(u=this._globalViewModelInstances.get(n))===null||u===void 0||u.cleanup(),this._globalViewModelInstances.set(n,i)),m},o.prototype.globalViewModelInstance=function(n){var i=this._globalViewModelInstances.get(n);if(i)return i;if(!this.artboard||this.destroyed)return null;var u=this.animator.stateMachines.length>0?this.animator.stateMachines[0].instance.globalViewModelInstance(n):this.artboard.globalViewModelInstance(n);if(u===null)return null;var d=new it(u,null);return(0,p.createFinalization)(d,u),d.internalIncrementReferenceCount(),this._globalViewModelInstances.set(n,d),d},o.prototype.globalViewModelNames=function(){var n,i;return(i=(n=this.file)===null||n===void 0?void 0:n.globalViewModelNames())!==null&&i!==void 0?i:[]},o.prototype.viewModelByIndex=function(n){var i=this.file.viewModelByIndex(n);return i!==null?new et(i):null},o.prototype.viewModelByName=function(n){var i;return(i=this.riveFile)===null||i===void 0?void 0:i.viewModelByName(n)},o.prototype.enums=function(){if(this._dataEnums===null){var n=this.file.enums();this._dataEnums=n.map(function(i){return new Ye(i)})}return this._dataEnums},o.prototype.defaultViewModel=function(){if(this.artboard){var n=this.file.defaultArtboardViewModel(this.artboard);if(n)return new et(n)}return null},o.prototype.getArtboard=function(n){var i,u;return(u=(i=this.riveFile)===null||i===void 0?void 0:i.getArtboard(n))!==null&&u!==void 0?u:null},o.prototype.getBindableArtboard=function(n){var i,u;return(u=(i=this.riveFile)===null||i===void 0?void 0:i.getBindableArtboard(n))!==null&&u!==void 0?u:null},o.prototype.getDefaultBindableArtboard=function(){var n,i;return(i=(n=this.riveFile)===null||n===void 0?void 0:n.getDefaultBindableArtboard())!==null&&i!==void 0?i:null},o.prototype.clearFocus=function(){var n=this.animator.stateMachines.filter(function(i){return i.playing&&i.hasFocusNodes});
6n.forEach(function(i){return i.clearFocus()})},o.missingErrorMessage="Rive source file or data buffer required",o.cleanupErrorMessage="Attempt to use file after calling cleanup.",o}(),Be;(function(o){o.none="none",o.string="string",o.number="number",o.boolean="boolean",o.color="color",o.list="list",o.enumType="enumType",o.trigger="trigger",o.viewModel="viewModel",o.integer="integer",o.listIndex="listIndex",o.image="image",o.artboard="artboard"})(Be||(Be={}));var et=function(){function o(n){this._viewModel=n}return Object.defineProperty(o.prototype,"instanceCount",{get:function(){return this._viewModel.instanceCount},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"name",{get:function(){return this._viewModel.name},enumerable:!1,configurable:!0}),o.prototype.instanceByIndex=function(n){var i=this._viewModel.instanceByIndex(n);if(i!==null){var u=new it(i,null);return(0,p.createFinalization)(u,i),u}return null},o.prototype.instanceByName=function(n){var i=this._viewModel.instanceByName(n);if(i!==null){var u=new it(i,null);return(0,p.createFinalization)(u,i),u}return null},o.prototype.defaultInstance=function(){var n=this._viewModel.defaultInstance();if(n!==null){var i=new it(n,null);return(0,p.createFinalization)(i,n),i}return null},o.prototype.instance=function(){var n=this._viewModel.instance();if(n!==null){var i=new it(n,null);return(0,p.createFinalization)(i,n),i}return null},Object.defineProperty(o.prototype,"properties",{get:function(){return this._viewModel.getProperties()},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"instanceNames",{get:function(){return this._viewModel.getInstanceNames()},enumerable:!1,configurable:!0}),o}(),Ye=function(){function o(n){this._dataEnum=n}return Object.defineProperty(o.prototype,"name",{get:function(){return this._dataEnum.name},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"values",{get:function(){return this._dataEnum.values},enumerable:!1,configurable:!0}),o}(),Ae;(function(o){o.Number="number",o.String="string",o.Boolean="boolean",o.Color="color",o.Trigger="trigger",o.Enum="enum",o.List="list",o.Image="image",o.Font="font",o.Artboard="artboard"})(Ae||(Ae={}));var it=function(){function o(n,i){this._parents=[],this._children=[],this._viewModelInstances=new Map,this._propertiesWithCallbacks=[],this._referenceCount=0,this.selfUnref=!1,this._runtimeInstance=n,i!==null&&this._parents.push(i)}return Object.defineProperty(o.prototype,"runtimeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"nativeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),o.prototype.handleCallbacks=function(){this._propertiesWithCallbacks.length!==0&&(this._propertiesWithCallbacks.forEach(function(n){n.handleCallbacks()}),this._propertiesWithCallbacks.forEach(function(n){n.clearChanges()})),this._children.forEach(function(n){return n.handleCallbacks()})},o.prototype.addParent=function(n){this._parents.includes(n)||(this._parents.push(n),(this._propertiesWithCallbacks.length>0||this._children.length>0)&&n.addToViewModelCallbacks(this))},o.prototype.removeParent=function(n){var i=this._parents.indexOf(n);if(i!==-1){var u=this._parents[i];u.removeFromViewModelCallbacks(this),this._parents.splice(i,1)}},o.prototype.addToPropertyCallbacks=function(n){var i=this;this._propertiesWithCallbacks.includes(n)||(this._propertiesWithCallbacks.push(n),this._propertiesWithCallbacks.length>0&&this._parents.forEach(function(u){u.addToViewModelCallbacks(i)}))},o.prototype.removeFromPropertyCallbacks=function(n){var i=this;this._propertiesWithCallbacks.includes(n)&&(this._propertiesWithCallbacks=this._propertiesWithCallbacks.filter(function(u){return u!==n}),this._children.length===0&&this._propertiesWithCallbacks.length===0&&this._parents.forEach(function(u){u.removeFromViewModelCallbacks(i)}))},o.prototype.addToViewModelCallbacks=function(n){var i=this;this._children.includes(n)||(this._children.push(n),this._parents.forEach(function(u){u.addToViewModelCallbacks(i)}))}
6,o.prototype.removeFromViewModelCallbacks=function(n){var i=this;this._children.includes(n)&&(this._children=this._children.filter(function(u){return u!==n}),this._children.length===0&&this._propertiesWithCallbacks.length===0&&this._parents.forEach(function(u){u.removeFromViewModelCallbacks(i)}))},o.prototype.clearCallbacks=function(){this._propertiesWithCallbacks.forEach(function(n){n.clearCallbacks()})},o.prototype.propertyFromPath=function(n,i){var u=n.split("/");return this.propertyFromPathSegments(u,0,i)},o.prototype.viewModelFromPathSegments=function(n,i){var u=this.internalViewModelInstance(n[i]);return u!==null?i==n.length-1?u:u.viewModelFromPathSegments(n,i++):null},o.prototype.propertyFromPathSegments=function(n,i,u){var d,m,y,N,z,U,le,he,Ie,De,Ce,Ue,je,at,vt,ot,lt,Qe,Je,Ge;if(i<n.length-1){var xe=this.internalViewModelInstance(n[i]);return xe!==null?xe.propertyFromPathSegments(n,i+1,u):null}var ve=null;switch(u){case Ae.Number:if(ve=(m=(d=this._runtimeInstance)===null||d===void 0?void 0:d.number(n[i]))!==null&&m!==void 0?m:null,ve!==null)return new Re(ve,this);break;case Ae.String:if(ve=(N=(y=this._runtimeInstance)===null||y===void 0?void 0:y.string(n[i]))!==null&&N!==void 0?N:null,ve!==null)return new Ft(ve,this);break;case Ae.Boolean:if(ve=(U=(z=this._runtimeInstance)===null||z===void 0?void 0:z.boolean(n[i]))!==null&&U!==void 0?U:null,ve!==null)return new be(ve,this);break;case Ae.Color:if(ve=(he=(le=this._runtimeInstance)===null||le===void 0?void 0:le.color(n[i]))!==null&&he!==void 0?he:null,ve!==null)return new Xe(ve,this);break;case Ae.Trigger:if(ve=(De=(Ie=this._runtimeInstance)===null||Ie===void 0?void 0:Ie.trigger(n[i]))!==null&&De!==void 0?De:null,ve!==null)return new ze(ve,this);break;case Ae.Enum:if(ve=(Ue=(Ce=this._runtimeInstance)===null||Ce===void 0?void 0:Ce.enum(n[i]))!==null&&Ue!==void 0?Ue:null,ve!==null)return new wt(ve,this);break;case Ae.List:if(ve=(at=(je=this._runtimeInstance)===null||je===void 0?void 0:je.list(n[i]))!==null&&at!==void 0?at:null,ve!==null)return new mt(ve,this);break;case Ae.Image:if(ve=(ot=(vt=this._runtimeInstance)===null||vt===void 0?void 0:vt.image(n[i]))!==null&&ot!==void 0?ot:null,ve!==null)return new yt(ve,this);break;case Ae.Font:if(ve=(Qe=(lt=this._runtimeInstance)===null||lt===void 0?void 0:lt.font(n[i]))!==null&&Qe!==void 0?Qe:null,ve!==null)return new Mt(ve,this);break;case Ae.Artboard:if(ve=(Ge=(Je=this._runtimeInstance)===null||Je===void 0?void 0:Je.artboard(n[i]))!==null&&Ge!==void 0?Ge:null,ve!==null)return new Ot(ve,this);break}return null},o.prototype.internalViewModelInstance=function(n){var i;if(this._viewModelInstances.has(n))return this._viewModelInstances.get(n);var u=(i=this._runtimeInstance)===null||i===void 0?void 0:i.viewModel(n);if(u!==null){var d=new o(u,this);return(0,p.createFinalization)(d,u),d.internalIncrementReferenceCount(),this._viewModelInstances.set(n,d),d}return null},o.prototype.number=function(n){var i=this.propertyFromPath(n,Ae.Number);return i},o.prototype.string=function(n){var i=this.propertyFromPath(n,Ae.String);return i},o.prototype.boolean=function(n){var i=this.propertyFromPath(n,Ae.Boolean);return i},o.prototype.color=function(n){var i=this.propertyFromPath(n,Ae.Color);return i},o.prototype.trigger=function(n){var i=this.propertyFromPath(n,Ae.Trigger);return i},o.prototype.enum=function(n){var i=this.propertyFromPath(n,Ae.Enum);return i},o.prototype.list=function(n){var i=this.propertyFromPath(n,Ae.List);return i},o.prototype.image=function(n){var i=this.propertyFromPath(n,Ae.Image);return i},o.prototype.font=function(n){var i=this.propertyFromPath(n,Ae.Font);return i},o.prototype.artboard=function(n){var i=this.propertyFromPath(n,Ae.Artboard);return i},o.prototype.viewModel=function(n){var i=n.split("/"),u=i.length>1?this.viewModelFromPathSegments(i.slice(0,i.length-1),0):this;return u!=null?u.internalViewModelInstance(i[i.length-1]):null},o.prototype.internalReplaceViewModel=function(n,i){var u;if(i.runtimeInstance!==null){var d=((u=this._runtimeInstance)===null||u===void 0?void 0:u.replaceViewModel(n,i.runtimeInstance))||!1;if(d){i.internalIncrementReferenceCount();var m=this.internalViewModelInstance(n);m!==null&&(m.removeParent(this),this._children.includes(m)&&(this._children=this._children.filter(function(y){return y!==m})),m.cleanup()),this._viewModelInstances.set(n,i),i.addParent(this)}return d}return!1},o.prototype.replaceViewModel=function(n,i){var u,d=n.split("/"),m=d.length>1?this.viewModelFromPathSegments(d.slice(0,d.length-1),0):this;
6return(u=m?.internalReplaceViewModel(d[d.length-1],i))!==null&&u!==void 0?u:!1},o.prototype.incrementReferenceCount=function(){var n;this._referenceCount++,(n=this._runtimeInstance)===null||n===void 0||n.incrementReferenceCount()},o.prototype.decrementReferenceCount=function(){var n;this._referenceCount--,(n=this._runtimeInstance)===null||n===void 0||n.decrementReferenceCount()},Object.defineProperty(o.prototype,"properties",{get:function(){var n;return((n=this._runtimeInstance)===null||n===void 0?void 0:n.getProperties().map(function(i){return W({},i)}))||[]},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"viewModelName",{get:function(){var n,i;return(i=(n=this._runtimeInstance)===null||n===void 0?void 0:n.getViewModelName())!==null&&i!==void 0?i:""},enumerable:!1,configurable:!0}),o.prototype.internalIncrementReferenceCount=function(){this._referenceCount++},o.prototype.cleanup=function(){var n=this,i;if(this._referenceCount--,this._referenceCount<=0){this.selfUnref&&((i=this._runtimeInstance)===null||i===void 0||i.unref()),this._runtimeInstance=null,this.clearCallbacks(),this._propertiesWithCallbacks=[],this._viewModelInstances.forEach(function(m){m.cleanup()}),this._viewModelInstances.clear();var u=h([],this._children,!0);this._children.length=0;var d=h([],this._parents,!0);this._parents.length=0,u.forEach(function(m){m.removeParent(n)}),d.forEach(function(m){m.removeFromViewModelCallbacks(n)})}},o}(),We=function(){function o(n,i){this.callbacks=[],this._viewModelInstanceValue=n,this._parentViewModel=i}return o.prototype.on=function(n){this.callbacks.length===0&&this._viewModelInstanceValue.clearChanges(),this.callbacks.includes(n)||(this.callbacks.push(n),this._parentViewModel.addToPropertyCallbacks(this))},o.prototype.off=function(n){n?this.callbacks=this.callbacks.filter(function(i){return i!==n}):this.callbacks.length=0,this.callbacks.length===0&&this._parentViewModel.removeFromPropertyCallbacks(this)},o.prototype.internalHandleCallback=function(n){},o.prototype.handleCallbacks=function(){var n=this;this._viewModelInstanceValue.hasChanged&&this.callbacks.forEach(function(i){n.internalHandleCallback(i)})},o.prototype.clearChanges=function(){this._viewModelInstanceValue.clearChanges()},o.prototype.clearCallbacks=function(){this.callbacks.length=0},Object.defineProperty(o.prototype,"name",{get:function(){return this._viewModelInstanceValue.name},enumerable:!1,configurable:!0}),o}(),Ft=function(o){Z(n,o);function n(i,u){return o.call(this,i,u)||this}return Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(i){this._viewModelInstanceValue.value=i},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(i){i(this.value)},n}(We),Re=function(o){Z(n,o);function n(i,u){return o.call(this,i,u)||this}return Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(i){this._viewModelInstanceValue.value=i},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(i){i(this.value)},n}(We),be=function(o){Z(n,o);function n(i,u){return o.call(this,i,u)||this}return Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(i){this._viewModelInstanceValue.value=i},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(i){i(this.value)},n}(We),ze=function(o){Z(n,o);function n(i,u){return o.call(this,i,u)||this}return n.prototype.trigger=function(){return this._viewModelInstanceValue.trigger()},n.prototype.internalHandleCallback=function(i){i()},n}(We),wt=function(o){Z(n,o);function n(i,u){return o.call(this,i,u)||this}return Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(i){this._viewModelInstanceValue.value=i},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"valueIndex",{get:function(){return this._viewModelInstanceValue.valueIndex},set:function(i){this._viewModelInstanceValue.valueIndex=i}
6,enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this._viewModelInstanceValue.values},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(i){i(this.value)},n}(We),mt=function(o){Z(n,o);function n(i,u){return o.call(this,i,u)||this}return Object.defineProperty(n.prototype,"length",{get:function(){return this._viewModelInstanceValue.size},enumerable:!1,configurable:!0}),n.prototype.addInstance=function(i){i.runtimeInstance!=null&&(this._viewModelInstanceValue.addInstance(i.runtimeInstance),i.addParent(this._parentViewModel))},n.prototype.addInstanceAt=function(i,u){return i.runtimeInstance!=null&&this._viewModelInstanceValue.addInstanceAt(i.runtimeInstance,u)?(i.addParent(this._parentViewModel),!0):!1},n.prototype.removeInstance=function(i){i.runtimeInstance!=null&&(this._viewModelInstanceValue.removeInstance(i.runtimeInstance),i.removeParent(this._parentViewModel))},n.prototype.removeInstanceAt=function(i){this._viewModelInstanceValue.removeInstanceAt(i)},n.prototype.instanceAt=function(i){var u=this._viewModelInstanceValue.instanceAt(i);if(u!=null){var d=new it(u,this._parentViewModel);return(0,p.createFinalization)(d,u),d}return null},n.prototype.swap=function(i,u){this._viewModelInstanceValue.swap(i,u)},n.prototype.internalHandleCallback=function(i){i()},n}(We),Xe=function(o){Z(n,o);function n(i,u){return o.call(this,i,u)||this}return Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(i){this._viewModelInstanceValue.value=i},enumerable:!1,configurable:!0}),n.prototype.rgb=function(i,u,d){this._viewModelInstanceValue.rgb(i,u,d)},n.prototype.rgba=function(i,u,d,m){this._viewModelInstanceValue.argb(m,i,u,d)},n.prototype.argb=function(i,u,d,m){this._viewModelInstanceValue.argb(i,u,d,m)},n.prototype.alpha=function(i){this._viewModelInstanceValue.alpha(i)},n.prototype.opacity=function(i){this._viewModelInstanceValue.alpha(Math.round(Math.max(0,Math.min(1,i))*255))},n.prototype.internalHandleCallback=function(i){i(this.value)},n}(We),yt=function(o){Z(n,o);function n(i,u){return o.call(this,i,u)||this}return Object.defineProperty(n.prototype,"value",{set:function(i){var u;this._viewModelInstanceValue.value((u=i?.nativeImage)!==null&&u!==void 0?u:null)},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(i){i()},n}(We),Mt=function(o){Z(n,o);function n(i,u){return o.call(this,i,u)||this}return Object.defineProperty(n.prototype,"value",{set:function(i){var u;this._viewModelInstanceValue.value((u=i?.nativeFont)!==null&&u!==void 0?u:null)},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(i){i()},n}(We),Ot=function(o){Z(n,o);function n(i,u){return o.call(this,i,u)||this}return Object.defineProperty(n.prototype,"value",{set:function(i){var u,d,m;i.isBindableArtboard?m=i:m=i.file.internalBindableArtboardFromArtboard(i.nativeArtboard),this._viewModelInstanceValue.value((u=m?.nativeArtboard)!==null&&u!==void 0?u:null),m?.nativeViewModel&&this._viewModelInstanceValue.viewModelInstance((d=m?.nativeViewModel)!==null&&d!==void 0?d:null)},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(i){i()},n}(We),Jt=function(o){return O(void 0,void 0,void 0,function(){var n,i,u;return w(this,function(d){switch(d.label){case 0:return n=new Request(o),[4,fetch(n)];case 1:if(i=d.sent(),!i.ok)throw new Error("Failed to fetch the Rive file: HTTP ".concat(i.status));return[4,i.arrayBuffer()];case 2:return u=d.sent(),[2,u]}})})},ht=function(o){return typeof o=="string"?[o]:o instanceof Array?o:[]},ce={EventManager:se,TaskQueueManager:pe},yn=function(o){return O(void 0,void 0,void 0,function(){var n,i,u;return w(this,function(d){switch(d.label){case 0:return n=new Promise(function(m){return Q.RuntimeLoader.getInstance(function(y){y.decodeAudio(o,m,null)})}),[4,n];case 1:return i=d.sent(),u=new p.AudioWrapper(i),p.finalizationRegistry.register(u,i),[2,u]}})})},Vt=function(o){return O(void 0,void 0,void 0,function(){var n,i,u;return w(this,function(d){switch(d.label){case 0:return n=new Promise(function(m){return Q.RuntimeLoader.getInstance(function(y){y.decodeImage(o,m,null)})}),[4,n];case 1:return i=d.sent(),u=new p.ImageWrapper(i),p.finalizationRegistry.register(u,i),[2,u]}})})},Zt=function(o){return O(void 0,void 0,void 0,function(){var n,i,u;return w(this,function(d){switch(d.label){case 0:return n=new Promise(function(m){return Q.RuntimeLoader.getInstance(function(y){y.decodeFont(
6o,m,null)})}),[4,n];case 1:return i=d.sent(),u=new p.FontWrapper(i),p.finalizationRegistry.register(u,i),[2,u]}})})}})(),mn})())}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.