PageSourceSearch

https://www.stonehenge-london-tours.com/_next/static/chunks/8fdcf2da-1b4e7a8ed49c70c8.js

js stonehenge-london-tours.com collected 2026-10-07 00:21:39 UTC 188,339 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33689],{83301:function(e){var t;t=()=>(()=>{"use strict";var e,t,n,i,r,a,o,s,l,u,c,h,d,f,p,m,v,b,y,g,w,_,A,C,I,F,M,S,R,E,P,T,x,k,O,L,j,D,B,N,V,U,W,H,z,Y,X,$,G,q,K,J,Q,Z,ee,et,en,ei,er,ea,eo,es,el,eu,ec,eh,ed,ef=[,(e,t,n)=>{n.r(t),n.d(t,{Animation:()=>i.Animation});var i=n(2)},(e,t,n)=>{n.r(t),n.d(t,{Animation:()=>i});var i=function(){function e(e,t,n,i){this.animation=e,this.artboard=t,this.playing=i,this.loopCount=0,this.scrubTo=null,this.instance=new n.LinearAnimationInstance(e,t)}return Object.defineProperty(e.prototype,"name",{get:function(){return this.animation.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"time",{get:function(){return this.instance.time},set:function(e){this.instance.time=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loopValue",{get:function(){return this.animation.loopValue},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needsScrub",{get:function(){return null!==this.scrubTo},enumerable:!1,configurable:!0}),e.prototype.advance=function(e){null===this.scrubTo?this.instance.advance(e):(this.instance.time=0,this.instance.advance(this.scrubTo),this.scrubTo=null)},e.prototype.apply=function(e){this.instance.apply(e)},e.prototype.cleanup=function(){this.instance.delete()},e}()},(e,t,n)=>{n.r(t),n.d(t,{RuntimeLoader:()=>o});var i=n(4),r=n(5),a=function(){return(a=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},o=function(){function e(){}return e.notifyError=function(t){var n;for(e.isLoading=!1;e.errorCallbackQueue.length>0;)null===(n=e.errorCallbackQueue.shift())||void 0===n||n(t);e.callBackQueue=[]},e.loadRuntime=function(){var t=e.wasmURL,n=e.wasmBinary;e.enablePerfMarks&&performance.mark("rive:wasm-init:start"),i.default(a({locateFile:function(){return t}},n?{wasmBinary:n}:{})).then(function(t){var n;for(e.enablePerfMarks&&(performance.mark("rive:wasm-init:end"),performance.measure("rive:wasm-init","rive:wasm-init:start","rive:wasm-init:end")),e.runtime=t,e.errorCallbackQueue=[];e.callBackQueue.length>0;)null===(n=e.callBackQueue.shift())||void 0===n||n(e.runtime)}).catch(function(n){var i={message:(null==n?void 0:n.message)||"Unknown error",type:(null==n?void 0:n.name)||"Error",wasmError:n instanceof WebAssembly.CompileError||n instanceof WebAssembly.RuntimeError,originalError:n};
1console.debug("Rive WASM load error details:",i);var r=e.wasmFallbackURL,a=null!==r&&t.toLowerCase()===r.toLowerCase();if(null===r||a){var o=a?"the configured WASM URL or its fallback (".concat(r,")"):t,s=["Could not load Rive WASM file from ".concat(o,"."),"Possible reasons:","- Network connection is down","- WebAssembly is not supported in this environment","- The WASM file is corrupted or incompatible","\nError details:","- Type: ".concat(i.type),"- Message: ".concat(i.message),"- WebAssembly-specific error: ".concat(i.wasmError),"\nTo 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("\n");console.error(s),e.notifyError(Error(s))}else console.warn("Failed to load WASM from ".concat(t," (").concat(i.message,"), trying fallback URL: ").concat(r)),e.wasmBinary=null,e.setWasmUrl(r),e.loadRuntime()})},e.getInstance=function(t,n){e.isLoading||(e.isLoading=!0,e.loadRuntime()),e.runtime?t(e.runtime):(e.callBackQueue.push(t),n&&e.errorCallbackQueue.push(n))},e.awaitInstance=function(){return new Promise(function(t,n){return e.getInstance(t,n)})},e.setWasmUrl=function(t){e.wasmURL=t},e.getWasmUrl=function(){return e.wasmURL},e.setWasmFallbackUrl=function(t){e.wasmFallbackURL=t},e.getWasmFallbackUrl=function(){return e.wasmFallbackURL},e.setWasmBinary=function(t){if(t instanceof ArrayBuffer||null===t){e.wasmBinary=t;return}console.error("setWasmBinary expects an ArrayBuffer or null")},e.getWasmBinary=function(){return e.wasmBinary},e.isLoading=!1,e.callBackQueue=[],e.wasmURL="https://unpkg.com/".concat(r.name,"@").concat(r.version,"/rive.wasm"),e.wasmFallbackURL="https://cdn.jsdelivr.net/npm/".concat(r.name,"@").concat(r.version,"/rive_fallback.wasm"),e.wasmBinary=null,e.errorCallbackQueue=[],e.enablePerfMarks=!1,e}()},(e,t,n)=>{var i;n.r(t),n.d(t,{default:()=>r});let r=(i="undefined"!=typeof document?document.currentScript?.src:void 0,function(e={}){var t,n,r,a,o,s,l,u,c=new Promise((e,t)=>{l=e,u=t}),h="object"==typeof window,d="function"==typeof importScripts;function f(){function e(e){let a=i;n=t=0,i=new Map,a.forEach(t=>{try{t(e)}catch(e){console.error(e)}}),this.gb(),r&&r.Hb()}let t=0,n=0,i=new Map,r=null,a=null;this.requestAnimationFrame=function(r){t||=requestAnimationFrame(e.bind(this));let a=++n;return i.set(a,r),a},this.cancelAnimationFrame=function(e){i.delete(e),t&&0==i.size&&(cancelAnimationFrame(t),t=0)},this.Fb=function(e){a&&(document.body.remove(a),a=null),e||((a=document.createElement("div")).style.backgroundColor="black",a.style.position="fixed",a.style.right=0,a.style.top=0,a.style.color="white",a.style.padding="4px",a.innerHTML="RIVE FPS",e=function(e){a.innerHTML="RIVE FPS "+e.toFixed(1)},document.body.appendChild(a)),r=new function(){let t=0,n=0;this.Hb=function(){var i=performance.now();n?(++t,1e3<(i-=n)&&(e(1e3*t/i),t=n=0)):(n=i,t=0)}}},this.Cb=function(){a&&(document.body.remove(a),a=null),r=null},this.gb=function(){}}function p(e){console.assert(!0);let t=new Map,n=-1/0;this.push=function(i){return i=i+((1<<e)-1)>>e,t.has(i)&&clearTimeout(t.get(i)),t.set(i,setTimeout(function(){t.delete(i),0==t.length?n=-1/0:i==n&&console.assert((n=Math.max(...t.keys()))<i)},1e3)),(n=Math.max(i,n))<<e}}let m=e.onRuntimeInitialized;e.onRuntimeInitialized=function(){m&&m();let t=e.decodeAudio;
1e.decodeAudio=function(e,n){n(e=t(e))};let n=e.decodeFont;e.decodeFont=function(e,t){t(e=n(e))};let i=e.setFallbackFontCb;e.setFallbackFontCallback="function"==typeof i?function(e){i(e)}:function(){console.warn("Module.setFallbackFontCallback called, but text support is not enabled in this build.")};let r=e.FileAssetLoader;e.ptrToAsset=t=>{let n=e.ptrToFileAsset(t);return n.isImage?e.ptrToImageAsset(t):n.isFont?e.ptrToFontAsset(t):n.isAudio?e.ptrToAudioAsset(t):n},e.CustomFileAssetLoader=r.extend("CustomFileAssetLoader",{__construct:function({loadContents:e}){this.__parent.__construct.call(this),this.ub=e},loadContents:function(t,n){return t=e.ptrToAsset(t),this.ub(t,n)}}),e.CDNFileAssetLoader=r.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(t){var n,i,r;let a=e.ptrToAsset(t);return""!==(t=a.cdnUuid)&&(n=a.cdnBaseUrl+"/"+t,i=e=>{a.decode(new Uint8Array(e.response))},(r=new XMLHttpRequest).responseType="arraybuffer",r.onreadystatechange=function(){4==r.readyState&&200==r.status&&i(r)},r.open("GET",n,!0),r.send(null),!0)}}),e.FallbackFileAssetLoader=r.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.bb=[]},addLoader:function(e){this.bb.push(e)},loadContents:function(e,t){for(let n of this.bb)if(n.loadContents(e,t))return!0;return!1}});let a=e.computeAlignment;e.computeAlignment=function(e,t,n,i,r=1){return a.call(this,e,t,n,i,r)}};let v="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),b=new function(){function e(){if(!t){let u;var e=document.createElement("canvas"),o={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,renderViaOffscreenBackBuffer:1};if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(u=e.getContext("webgl",o),n=1,!u)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(u=e.getContext("webgl2",o))n=2;else{if(!(u=e.getContext("webgl",o)))return console.log("No WebGL support. Image mesh will not be drawn."),!1;n=1}function s(e,t,n){if(t=u.createShader(t),u.shaderSource(t,n),u.compileShader(t),0<((n=u.getShaderInfoLog(t))||"").length)throw n;u.attachShader(e,t)}if(i=Math.min((u=new Proxy(u,{get:(e,t)=>e.isContextLost()?(l||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",t),l=!0),"function"==typeof e[t])?function(){}:void 0:"function"==typeof e[t]?function(...n){return e[t].apply(e,n)}:e[t],set(e,t,n){if(!e.isContextLost())return e[t]=n,!0;l||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+t),l=!0)}})).getParameter(u.MAX_RENDERBUFFER_SIZE),u.getParameter(u.MAX_TEXTURE_SIZE)),s(e=u.createProgram(),u.VERTEX_SHADER,"attribute vec2 vertex;\n                attribute vec2 uv;\n                uniform vec4 mat;\n                uniform vec2 translate;\n                varying vec2 st;\n                void main() {\n                    st = uv;\n                    gl_Position = vec4(mat2(mat) * vertex + translate, 0, 1);\n                }"),s(e,u.FRAGMENT_SHADER,"precision highp float;\n                uniform sampler2D image;\n                varying vec2 st;\n                void main() {\n                    gl_FragColor = texture2D(image, st);\n                }"),u.bindAttribLocation(e,0,"vertex"),u.bindAttribLocation(e,1,"uv"),u.linkProgram(e),0<((o=u.getProgramInfoLog(e))||"").trim().length)throw o;r=u.getUniformLocation(e,"mat"),a=u.getUniformLocation(e,"translate"),u.useProgram(e),u.bindBuffer(u.ARRAY_BUFFER,u.createBuffer()),u.enableVertexAttribArray(0),u.enableVertexAttribArray(1),u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,u.createBuffer()),u.uniform1i(u.getUniformLocation(e,"image"),0),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t=u}return!0}let t=null,n=0,i=0,r=null,a=null,o=0,s=0,l=!1;e(),this.Tb=function(){return e(),i},this.Bb=function(e){t.deleteTexture&&t.deleteTexture(e)},this.Ab=function(i){if(!e())return null;let r=t.createTexture();return r?(t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),2==n?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_LINEAR),t.generateMipmap(t.TEXTURE_2D)):t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),r):null};let u=new p(8),c=new p(8),h=new p(10),d=new p(10);this.Eb=function(n,i,l,f,p){if(e()){var m=u.push(n),v=c.push(i);if(t.canvas){for(var b of((t.canvas.width!=m||t.canvas.height!=v)&&(t.canvas.width=m,t.canvas.height=v),t.viewport(0,v-i,n,i),t.disable(t.SCISSOR_TEST),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.enable(t.SCISSOR_TEST),l.sort((e,t)=>
1t.nb-e.nb),m=h.push(f),o!=m&&(t.bufferData(t.ARRAY_BUFFER,8*m,t.DYNAMIC_DRAW),o=m),m=0,l))t.bufferSubData(t.ARRAY_BUFFER,m,b.La),m+=4*b.La.length;for(var y of(console.assert(m==4*f),l))t.bufferSubData(t.ARRAY_BUFFER,m,y.rb),m+=4*y.rb.length;for(var g of(console.assert(m==8*f),m=d.push(p),s!=m&&(t.bufferData(t.ELEMENT_ARRAY_BUFFER,2*m,t.DYNAMIC_DRAW),s=m),b=0,l))t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,b,g.indices),b+=2*g.indices.length;for(let e of(console.assert(b==2*p),g=0,y=!0,m=b=0,l)){e.image.Da!=g&&(t.bindTexture(t.TEXTURE_2D,e.image.Ca||null),g=e.image.Da),e.Yb?(t.scissor(e.Ra,v-e.Sa-e.ab,e.kc,e.ab),y=!0):y&&(t.scissor(0,v-i,n,i),y=!1),l=2/n;let o=-2/i;t.uniform4f(r,e.da[0]*l*e.ua,e.da[1]*o*e.va,e.da[2]*l*e.ua,e.da[3]*o*e.va),t.uniform2f(a,e.da[4]*l*e.ua+l*(e.Ra-e.Ub*e.ua)-1,e.da[5]*o*e.va+o*(e.Sa-e.Vb*e.va)+1),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,m),t.vertexAttribPointer(1,2,t.FLOAT,!1,0,m+4*f),t.drawElements(t.TRIANGLES,e.indices.length,t.UNSIGNED_SHORT,b),m+=4*e.La.length,b+=2*e.indices.length}console.assert(m==4*f),console.assert(b==2*p)}}},this.canvas=function(){return e()&&t.canvas}},y=e.onRuntimeInitialized;e.onRuntimeInitialized=function(){function t(e){switch(e){case c.srcOver:return"source-over";case c.screen:return"screen";case c.overlay:return"overlay";case c.darken:return"darken";case c.lighten:return"lighten";case c.colorDodge:return"color-dodge";case c.colorBurn:return"color-burn";case c.hardLight:return"hard-light";case c.softLight:return"soft-light";case c.difference:return"difference";case c.exclusion:return"exclusion";case c.multiply:return"multiply";case c.hue:return"hue";case c.saturation:return"saturation";case c.color:return"color";case c.luminosity:return"luminosity"}}function n(e){return"rgba("+((16711680&e)>>>16)+","+((65280&e)>>>8)+","+((255&e)>>>0)+","+((4278190080&e)>>>24)/255+")"}function i(){for(let e of(0<I.length&&(b.Eb(C.drawWidth(),C.drawHeight(),I,F,M),I=[],M=F=0,C.reset(512,512)),A)){for(let t of e.G)t();e.G=[]}A.clear()}y&&y();var r=e.RenderPaintStyle;let a=e.RenderPath,o=e.RenderPaint,s=e.Renderer,l=e.StrokeCap,u=e.StrokeJoin,c=e.BlendMode,h=r.fill,d=r.stroke,p=e.FillRule.evenOdd,m=1;var g=e.RenderImage.extend("CanvasRenderImage",{__construct:function({ha:e,sa:t}={}){this.__parent.__construct.call(this),this.Da=m,m=m+1&2147483647||1,this.ha=e,this.sa=t},__destruct:function(){this.Ca&&(b.Bb(this.Ca),URL.revokeObjectURL(this.Oa)),this.__parent.__destruct.call(this)},decode:function(e){var t=this;t.sa&&t.sa(t);var n=new Image;t.Oa=URL.createObjectURL(new Blob([e],{type:"image/png"})),n.onload=function(){t.tb=n,t.Ca=b.Ab(n),t.size(n.width,n.height),t.ha&&t.ha(t)},n.src=t.Oa}}),w=a.extend("CanvasRenderPath",{__construct:function(){this.__parent.__construct.call(this),this.R=new Path2D},rewind:function(){this.R=new Path2D},addPath:function(e,t,n,i,r,a,o){var s=this.R,l=s.addPath;e=e.R;let u=new DOMMatrix;u.a=t,u.b=n,u.c=i,u.d=r,u.e=a,u.f=o,l.call(s,e,u)},fillRule:function(e){this.Na=e},moveTo:function(e,t){this.R.moveTo(e,t)},lineTo:function(e,t){this.R.lineTo(e,t)},cubicTo:function(e,t,n,i,r,a){this.R.bezierCurveTo(e,t,n,i,r,a)},close:function(){this.R.closePath()}}),_=o.extend("CanvasRenderPaint",{color:function(e){this.Pa=n(e)},thickness:function(e){this.xb=e},join:function(e){switch(e){case u.miter:this.Ba="miter";break;case u.round:this.Ba="round";break;case u.bevel:this.Ba="bevel"}},cap:function(e){switch(e){case l.butt:this.Aa="butt";break;case l.round:this.Aa="round";break;case l.square:this.Aa="square"}},style:function(e){this.wb=e},blendMode:function(e){this.sb=t(e)},clearGradient:function(){this.fa=null},linearGradient:function(e,t,n,i){this.fa={ob:e,pb:t,Va:n,Wa:i,Ja:[]}},radialGradient:function(e,t,n,i){this.fa={ob:e,pb:t,Va:n,Wa:i,Ja:[],Sb:!0}},addStop:function(e,t){this.fa.Ja.push({color:e,stop:t})},completeGradient:function(){},draw:function(e,t,i,r){let a=this.wb;var o=this.Pa,s=this.fa;let l=e.globalCompositeOperation,u=e.globalAlpha;if(e.globalCompositeOperation=this.sb,e.globalAlpha=r,null!=s){o=s.ob;let t=s.pb,i=s.Va;var c=s.Wa;r=s.Ja,s.Sb?(s=i-o,c-=t,o=e.createRadialGradient(o,t,0,o,t,Math.sqrt(s*s+c*c))):o=e.createLinearGradient(o,t,i,c);for(let e=0,t=r.length;e<t;e++)s=r[e],o.addColorStop(s.stop,n(s.color));this.Pa=o,this.fa=null}switch(a){case d:e.strokeStyle=o,e.lineWidth=this.xb,e.lineCap=this.Aa,e.lineJoin=this.Ba,e.stroke(t);break;case h:e.fillStyle=o,e.fill(t,i)}e.globalCompositeOperation=l,e.globalAlpha=u}});let A=new Set,C=null,I=[],F=0,M=0;var S=e.CanvasRenderer=s.extend("Renderer",{__construct:function(e){this.__parent.__construct.call(this),this.P=[1,0,0,1,0,0],this.D=[1],this.A=e.getContext("2d"),this.Ma=e,this.G=[]}
1,save:function(){this.P.push(...this.P.slice(this.P.length-6)),this.D.push(this.D[this.D.length-1]),this.G.push(this.A.save.bind(this.A))},restore:function(){let e=this.P.length-6;if(6>e)throw"restore() called without matching save().";this.P.splice(e),this.D.pop(),this.G.push(this.A.restore.bind(this.A))},transform:function(e,t,n,i,r,a){let o=this.P,s=o.length-6;o.splice(s,6,o[s]*e+o[s+2]*t,o[s+1]*e+o[s+3]*t,o[s]*n+o[s+2]*i,o[s+1]*n+o[s+3]*i,o[s]*r+o[s+2]*a+o[s+4],o[s+1]*r+o[s+3]*a+o[s+5]),this.G.push(this.A.transform.bind(this.A,e,t,n,i,r,a))},rotate:function(e){let t=Math.sin(e);e=Math.cos(e),this.transform(e,t,-t,e,0,0)},modulateOpacity:function(e){this.D[this.D.length-1]*=e},_drawPath:function(e,t){this.G.push(t.draw.bind(t,this.A,e.R,e.Na===p?"evenodd":"nonzero",Math.max(0,this.D[this.D.length-1])))},_drawRiveImage:function(e,n,i,r){var a=e.tb;if(a){var o=this.A,s=t(i),l=Math.max(0,r*this.D[this.D.length-1]);this.G.push(function(){o.globalCompositeOperation=s,o.globalAlpha=l,o.drawImage(a,0,0),o.globalAlpha=1})}},_getMatrix:function(e){let t=this.P,n=t.length-6;for(let i=0;6>i;++i)e[i]=t[n+i]},_drawImageMesh:function(n,r,a,o,s,l,u,c,h,d,f,p,m,v){let y,g,w;try{y=e.HEAPF32.slice(s>>2,(s>>2)+l),g=e.HEAPF32.slice(u>>2,(u>>2)+c),w=e.HEAPU16.slice(h>>1,(h>>1)+d)}catch(e){console.error("[Rive] _drawImageMesh: failed to read mesh data from WASM heap. Mesh skipped for this frame.");return}r=this.A.canvas.width,s=this.A.canvas.height,u=m-f,c=v-p,f=Math.max(f,0),p=Math.max(p,0);let _=(m=Math.min(m,r))-f,S=(v=Math.min(v,s))-p;if(console.assert(_<=Math.min(u,r)),console.assert(S<=Math.min(c,s)),!(0>=_||0>=S)){m=_<u||S<c,r=v=1;var R=Math.ceil(_*v),E=Math.ceil(S*r);s=b.Tb(),R>s&&(v*=s/R,R=s),E>s&&(r*=s/E,E=s),C||(C=new e.DynamicRectanizer(s)).reset(512,512),0>(s=C.addRect(R,E))&&(i(),A.add(this),console.assert(0<=(s=C.addRect(R,E))));var P=65535&s,T=s>>16;I.push({da:this.P.slice(this.P.length-6),image:n,Ra:P,Sa:T,Ub:f,Vb:p,kc:R,ab:E,ua:v,va:r,La:y,rb:g,indices:w,Yb:m,nb:n.Da<<1|(m?1:0)}),F+=l,M+=d;var x=this.A,k=t(a),O=Math.max(0,o*this.D[this.D.length-1]);this.G.push(function(){x.save(),x.resetTransform(),x.globalCompositeOperation=k,x.globalAlpha=O;let e=b.canvas();e&&x.drawImage(e,P,T,R,E,f,p,_,S),x.restore()})}},_clipPath:function(e){this.G.push(this.A.clip.bind(this.A,e.R,e.Na===p?"evenodd":"nonzero"))},clear:function(){A.add(this),this.G.push(this.A.clearRect.bind(this.A,0,0,this.Ma.width,this.Ma.height))},flush:function(){},translate:function(e,t){this.transform(1,0,0,1,e,t)}});e.makeRenderer=function(e){let t=new S(e),n=t.A;return new Proxy(t,{get(e,i){if("function"==typeof e[i])return function(...t){return e[i].apply(e,t)};if("function"==typeof n[i]){if(-1<v.indexOf(i))throw Error("RiveException: Method call to '"+i+"()' is not allowed, as the renderer cannot immediately pass through the return                 values of any canvas 2d context methods.");return function(...e){t.G.push(n[i].bind(n,...e))}}return e[i]},set(e,i,r){if(i in n)return t.G.push(()=>{n[i]=r}),!0}})},e.decodeImage=function(e,t){new g({ha:t}).decode(e)},e.renderFactory={makeRenderPaint:function(){return new _},makeRenderPath:function(){return new w},makeRenderImage:function(){let e=E;return new g({sa:()=>{e.total++},ha:()=>{if(e.loaded++,e.loaded===e.total){let t=e.ready;t&&(t(),e.ready=null)}}})}};let R=e.load,E=null;e.load=function(t,n,i=!0){let r=new e.FallbackFileAssetLoader;return void 0!==n&&r.addLoader(n),i&&(n=new e.CDNFileAssetLoader,r.addLoader(n)),new Promise(function(e){let n=null;E={total:0,loaded:0,ready:function(){e(n)}},n=R(t,r),0==E.total&&e(n)})};let P=e.RendererWrapper.prototype.align;e.RendererWrapper.prototype.align=function(e,t,n,i,r=1){P.call(this,e,t,n,i,r)},r=new f,e.requestAnimationFrame=r.requestAnimationFrame.bind(r),e.cancelAnimationFrame=r.cancelAnimationFrame.bind(r),e.enableFPSCounter=r.Fb.bind(r),e.disableFPSCounter=r.Cb,r.gb=i,e.resolveAnimationFrame=i,e.cleanup=function(){C&&C.delete()}};var g,w,_=Object.assign({},e),A="./this.program",C="";(h||d)&&(d?C=self.location.href:"undefined"!=typeof document&&document.currentScript&&(C=document.currentScript.src),i&&(C=i),C=C.startsWith("blob:")?"":C.substr(0,C.replace(/[?#].*/,"").lastIndexOf("/")+1),d&&(w=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),g=(e,t,n)=>{if($(e)){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=()=>{200==i.status||0==i.status&&i.response?t(i.response):n()},i.onerror=n,i.send(null)}else fetch(e,{credentials:"same-origin"}).then(e=>e.ok?e.arrayBuffer():Promise.reject(Error(e.status+" : "+e.url))).then(t,n)});var I=e.print||console.log.bind(console),F=e.printErr||console.error.bind(console);Object.assign(e,_),_=null,e.thisProgram&&(A=e.thisProgram),e.wasmBinary&&(M=e.wasmBinary);var M,S,R,E,P,T,x,k,O,L,j=!1;function D(){var t=S.buffer;e.HEAP8=R=new Int8Array(t),e.HEAP16=P=new Int16Array(t),e.HEAPU8=E=new Uint8Array(t),e.HEAPU16=T=new Uint16Array(t),e.HEAP32=x=new Int32Array(t),e.HEAPU32
1=k=new Uint32Array(t),e.HEAPF32=O=new Float32Array(t),e.HEAPF64=L=new Float64Array(t)}var B=[],N=[],V=[],U=0,W=null,H=null;function z(t){throw e.onAbort?.(t),F(t="Aborted("+t+")"),j=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),u(t),t}var Y,X=e=>e.startsWith("data:application/octet-stream;base64,"),$=e=>e.startsWith("file://");function G(e){if(e==Y&&M)return new Uint8Array(M);if(w)return w(e);throw"both async and sync fetching of the wasm failed"}function q(e,t,n){return(M?Promise.resolve().then(()=>G(e)):new Promise((t,n)=>{g(e,e=>t(new Uint8Array(e)),()=>{try{t(G(e))}catch(e){n(e)}})})).then(e=>WebAssembly.instantiate(e,t)).then(n,e=>{F(`failed to asynchronously prepare wasm: ${e}`),z(e)})}var K,J,Q={494893:(e,t,n,i,r)=>{if("undefined"==typeof window||void 0===(window.AudioContext||window.webkitAudioContext))return 0;if(void 0===window.miniaudio){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=n,window.miniaudio.device_state={},window.miniaudio.device_state.stopped=i,window.miniaudio.device_state.started=r;let a=window.miniaudio;a.devices=[],a.track_device=function(e){for(var t=0;t<a.devices.length;++t)if(null==a.devices[t])return a.devices[t]=e,t;return a.devices.push(e),a.devices.length-1},a.untrack_device_by_index=function(e){for(a.devices[e]=null;0<a.devices.length;)if(null==a.devices[a.devices.length-1])a.devices.pop();else break},a.untrack_device=function(e){for(var t=0;t<a.devices.length;++t)if(a.devices[t]==e)return a.untrack_device_by_index(t)},a.get_device_by_index=function(e){return a.devices[e]},a.unlock_event_types=["touchend","click"],a.unlock=function(){for(var e=0;e<a.devices.length;++e){var t=a.devices[e];null!=t&&null!=t.I&&t.state===a.device_state.started&&t.I.resume().then(()=>{nw(t.hb)},e=>{console.error("Failed to resume audiocontext",e)})}a.unlock_event_types.map(function(e){document.removeEventListener(e,a.unlock,!0)})},a.unlock_event_types.map(function(e){document.addEventListener(e,a.unlock,!0)})}return window.miniaudio.referenceCount+=1,1},497071:()=>{void 0!==window.miniaudio&&(window.miniaudio.unlock_event_types.map(function(e){document.removeEventListener(e,window.miniaudio.unlock,!0)}),--window.miniaudio.referenceCount,0===window.miniaudio.referenceCount&&delete window.miniaudio)},497375:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,497479:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},497650:(e,t,n,i,r,a)=>{if(void 0===window.miniaudio)return -1;var o={},s={};return e==window.miniaudio.device_type.playback&&0!=n&&(s.sampleRate=n),o.I=new(window.AudioContext||window.webkitAudioContext)(s),o.I.suspend(),o.state=window.miniaudio.device_state.stopped,n=0,e!=window.miniaudio.device_type.playback&&(n=t),o.W=o.I.createScriptProcessor(i,n,t),o.W.onaudioprocess=function(n){if((null==o.na||0==o.na.length)&&(o.na=new Float32Array(O.buffer,r,i*t)),e==window.miniaudio.device_type.capture||e==window.miniaudio.device_type.duplex){for(var s=0;s<t;s+=1)for(var l=n.inputBuffer.getChannelData(s),u=o.na,c=0;c<i;c+=1)u[c*t+s]=l[c];n_(a,i,r)}if(e==window.miniaudio.device_type.playback||e==window.miniaudio.device_type.duplex)for(nA(a,i,r),s=0;s<n.outputBuffer.numberOfChannels;++s)for(l=n.outputBuffer.getChannelData(s),u=o.na,c=0;c<i;c+=1)l[c]=u[c*t+s];else for(s=0;s<n.outputBuffer.numberOfChannels;++s)n.outputBuffer.getChannelData(s).fill(0)},e!=window.miniaudio.device_type.capture&&e!=window.miniaudio.device_type.duplex||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(function(e){o.wa=o.I.createMediaStreamSource(e),o.wa.connect(o.W),o.W.connect(o.I.destination)}).catch(function(e){console.log("Failed to get user media: "+e)}),e==window.miniaudio.device_type.playback&&o.W.connect(o.I.destination),o.hb=a,window.miniaudio.track_device(o)},500527:e=>window.miniaudio.get_device_by_index(e).I.sampleRate,500600:e=>{void 0!==(e=window.miniaudio.get_device_by_index(e)).W&&(e.W.onaudioprocess=function(){},e.W.disconnect(),e.W=void 0),void 0!==e.wa&&(e.wa.disconnect(),e.wa=void 0),e.I.close(),e.I=void 0,e.hb=void 0},501e3:e=>{window.miniaudio.untrack_device_by_index(e)},501050:e=>{(e=window.miniaudio.get_device_by_index(e)).I.resume(),e.state=window.miniaudio.device_state.started},501189:e=>{(e=window.miniaudio.get_device_by_index(e)).I.suspend(),e.state=window.miniaudio.device_state.stopped}},Z=t=>{for(;0<t.length;)t.shift()(e)};function ee(){var e=x[+e3>>2];return e3+=4,e}var et=(e,t)=>{for(var n=0,i=e.length-1;0<=i;i--){var r=e[i];"."===r?e.splice(i,1):".."===r?(e.splice(i,1),n++):n&&(e.splice(i,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},en=e=>{var t="/"===e.charAt(0),n="/"===e.substr(-1);return(e=et(e.split("/").filter(e=>!!e),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},ei=e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return(e=t[0],t=t[1],e||t)?e+(t&&=t.substr(0,t.length-1)):"."},er=e=>{if("/"===e)return"/";var t=(e=(e=en(e)).replace(/\/$/,"")).lastIndexOf("/");return -1===t?e:e.substr(t+1)},ea=()=>
1{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);z("initRandomDevice")},eo=e=>(eo=ea())(e),es=(...e)=>{for(var t="",n=!1,i=e.length-1;-1<=i&&!n;i--){if("string"!=typeof(n=0<=i?e[i]:"/"))throw TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,n="/"===n.charAt(0)}return t=et(t.split("/").filter(e=>!!e),!n).join("/"),(n?"/":"")+t||"."},el="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,eu=(e,t,n)=>{var i=t+n;for(n=t;e[n]&&!(n>=i);)++n;if(16<n-t&&e.buffer&&el)return el.decode(e.subarray(t,n));for(i="";t<n;){var r=e[t++];if(128&r){var a=63&e[t++];if(192==(224&r))i+=String.fromCharCode((31&r)<<6|a);else{var o=63&e[t++];65536>(r=224==(240&r)?(15&r)<<12|a<<6|o:(7&r)<<18|a<<12|o<<6|63&e[t++])?i+=String.fromCharCode(r):(r-=65536,i+=String.fromCharCode(55296|r>>10,56320|1023&r))}}else i+=String.fromCharCode(r)}return i},ec=[],eh=e=>{for(var t=0,n=0;n<e.length;++n){var i=e.charCodeAt(n);127>=i?t++:2047>=i?t+=2:55296<=i&&57343>=i?(t+=4,++n):t+=3}return t},ed=(e,t,n,i)=>{if(!(0<i))return 0;var r=n;i=n+i-1;for(var a=0;a<e.length;++a){var o=e.charCodeAt(a);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a)),127>=o){if(n>=i)break;t[n++]=o}else{if(2047>=o){if(n+1>=i)break;t[n++]=192|o>>6}else{if(65535>=o){if(n+2>=i)break;t[n++]=224|o>>12}else{if(n+3>=i)break;t[n++]=240|o>>18,t[n++]=128|o>>12&63}t[n++]=128|o>>6&63}t[n++]=128|63&o}}return t[n]=0,n-r};function ef(e,t){var n=Array(eh(e)+1);return e=ed(e,n,0,n.length),t&&(n.length=e),n}var ep=[];function em(e,t){ep[e]={input:[],F:[],T:t},e_[e]={l:ev}}var ev={open(e){var t=ep[e.node.ta];if(!t)throw new eM(43);e.o=t,e.seekable=!1},close(e){e.o.T.la(e.o)},la(e){e.o.T.la(e.o)},read(e,t,n,i){if(!e.o||!e.o.T.$a)throw new eM(60);for(var r=0,a=0;a<i;a++){try{var o=e.o.T.$a(e.o)}catch(e){throw new eM(29)}if(void 0===o&&0===r)throw new eM(6);if(null==o)break;r++,t[n+a]=o}return r&&(e.node.timestamp=Date.now()),r},write(e,t,n,i){if(!e.o||!e.o.T.Ga)throw new eM(60);try{for(var r=0;r<i;r++)e.o.T.Ga(e.o,t[n+r])}catch(e){throw new eM(29)}return i&&(e.node.timestamp=Date.now()),r}};function eb(e,t){var n=e.j?e.j.length:0;n>=t||(t=Math.max(t,n*(1048576>n?2:1.125)>>>0),0!=n&&(t=Math.max(t,256)),n=e.j,e.j=new Uint8Array(t),0<e.u&&e.j.set(n.subarray(0,e.u),0))}var ey={L:null,S:()=>ey.createNode(null,"/",16895,0),createNode(e,t,n,i){if(24576==(61440&n)||4096==(61440&n))throw new eM(63);return ey.L||(ey.L={dir:{node:{V:ey.i.V,N:ey.i.N,ga:ey.i.ga,qa:ey.i.qa,lb:ey.i.lb,qb:ey.i.qb,mb:ey.i.mb,kb:ey.i.kb,xa:ey.i.xa},stream:{Z:ey.l.Z}},file:{node:{V:ey.i.V,N:ey.i.N},stream:{Z:ey.l.Z,read:ey.l.read,write:ey.l.write,Qa:ey.l.Qa,cb:ey.l.cb,fb:ey.l.fb}},link:{node:{V:ey.i.V,N:ey.i.N,ia:ey.i.ia},stream:{}},Ta:{node:{V:ey.i.V,N:ey.i.N},stream:eV}}),16384==(61440&(n=eO(e,t,n,i)).mode)?(n.i=ey.L.dir.node,n.l=ey.L.dir.stream,n.j={}):32768==(61440&n.mode)?(n.i=ey.L.file.node,n.l=ey.L.file.stream,n.u=0,n.j=null):40960==(61440&n.mode)?(n.i=ey.L.link.node,n.l=ey.L.link.stream):8192==(61440&n.mode)&&(n.i=ey.L.Ta.node,n.l=ey.L.Ta.stream),n.timestamp=Date.now(),e&&(e.j[t]=n,e.timestamp=n.timestamp),n},Ac:e=>e.j?e.j.subarray?e.j.subarray(0,e.u):new Uint8Array(e.j):new Uint8Array(0),i:{V(e){var t={};return t.yc=8192==(61440&e.mode)?e.id:1,t.Cc=e.id,t.mode=e.mode,t.Gc=1,t.uid=0,t.Bc=0,t.ta=e.ta,16384==(61440&e.mode)?t.size=4096:32768==(61440&e.mode)?t.size=e.u:40960==(61440&e.mode)?t.size=e.link.length:t.size=0,t.qc=new Date(e.timestamp),t.Fc=new Date(e.timestamp),t.xc=new Date(e.timestamp),t.yb=4096,t.rc=Math.ceil(t.size/t.yb),t},N(e,t){if(void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&(t=t.size,e.u!=t)){if(0==t)e.j=null,e.u=0;else{var n=e.j;e.j=new Uint8Array(t),n&&e.j.set(n.subarray(0,Math.min(t,e.u))),e.u=t}}},ga(){throw eS[44]},qa:(e,t,n,i)=>ey.createNode(e,t,n,i),lb(e,t,n){if(16384==(61440&e.mode)){try{var i=ek(t,n)}catch(e){}if(i)for(var r in i.j)throw new eM(55)}delete e.parent.j[e.name],e.parent.timestamp=Date.now(),e.name=n,t.j[n]=e,t.timestamp=e.parent.timestamp},qb(e,t){delete e.j[t],e.timestamp=Date.now()},mb(e,t){var n,i=ek(e,t);for(n in i.j)throw new eM(55);delete e.j[t],e.timestamp=Date.now()},kb(e){var t,n=[".",".."];
1for(t of Object.keys(e.j))n.push(t);return n},xa:(e,t,n)=>((e=ey.createNode(e,t,41471,0)).link=n,e),ia(e){if(40960!=(61440&e.mode))throw new eM(28);return e.link}},l:{read(e,t,n,i,r){var a=e.node.j;if(r>=e.node.u)return 0;if(8<(e=Math.min(e.node.u-r,i))&&a.subarray)t.set(a.subarray(r,r+e),n);else for(i=0;i<e;i++)t[n+i]=a[r+i];return e},write(e,t,n,i,r,a){if(t.buffer===R.buffer&&(a=!1),!i)return 0;if((e=e.node).timestamp=Date.now(),t.subarray&&(!e.j||e.j.subarray)){if(a)return e.j=t.subarray(n,n+i),e.u=i;if(0===e.u&&0===r)return e.j=t.slice(n,n+i),e.u=i;if(r+i<=e.u)return e.j.set(t.subarray(n,n+i),r),i}if(eb(e,r+i),e.j.subarray&&t.subarray)e.j.set(t.subarray(n,n+i),r);else for(a=0;a<i;a++)e.j[r+a]=t[n+a];return e.u=Math.max(e.u,r+i),i},Z(e,t,n){if(1===n?t+=e.position:2===n&&32768==(61440&e.node.mode)&&(t+=e.node.u),0>t)throw new eM(28);return t},Qa(e,t,n){eb(e.node,t+n),e.node.u=Math.max(e.node.u,t+n)},cb(e,t,n,i,r){if(32768!=(61440&e.node.mode))throw new eM(43);if(e=e.node.j,2&r||e.buffer!==R.buffer)throw(0<n||n+t<e.length)&&(e=e.subarray?e.subarray(n,n+t):Array.prototype.slice.call(e,n,n+t)),n=!0,z(),t=void 0,new eM(48);return n=!1,{m:t=e.byteOffset,pc:n}},fb:(e,t,n,i)=>(ey.l.write(e,t,0,i,n,!1),0)}},eg=(e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n},ew=null,e_={},eA=[],eC=1,eI=null,eF=!0,eM=class{constructor(e){this.name="ErrnoError",this.Y=e}},eS={},eR=class{constructor(){this.ma={},this.node=null}get flags(){return this.ma.flags}set flags(e){this.ma.flags=e}get position(){return this.ma.position}set position(e){this.ma.position=e}},eE=class{constructor(e,t,n,i){e||=this,this.parent=e,this.S=e.S,this.ra=null,this.id=eC++,this.name=t,this.mode=n,this.i={},this.l={},this.ta=i}get read(){return 365==(365&this.mode)}set read(e){e?this.mode|=365:this.mode&=-366}get write(){return 146==(146&this.mode)}set write(e){e?this.mode|=146:this.mode&=-147}};function eP(e,t={}){if(!(e=es(e)))return{path:"",node:null};if(8<(t=Object.assign({Za:!0,Ia:0},t)).Ia)throw new eM(32);e=e.split("/").filter(e=>!!e);for(var n=ew,i="/",r=0;r<e.length;r++){var a=r===e.length-1;if(a&&t.parent)break;if(n=ek(n,e[r]),i=en(i+"/"+e[r]),n.ra&&(!a||a&&t.Za)&&(n=n.ra.root),!a||t.Ya){for(a=0;40960==(61440&n.mode);)if(n=function(e){if(!(e=eP(e).node))throw new eM(44);if(!e.i.ia)throw new eM(28);return es(eT(e.parent),e.i.ia(e))}(i),n=eP(i=es(ei(i),n),{Ia:t.Ia+1}).node,40<a++)throw new eM(32)}}return{path:i,node:n}}function eT(e){for(var t;;){if(e===e.parent)return e=e.S.eb,t?"/"!==e[e.length-1]?`${e}/${t}`:e+t:e;t=t?`${e.name}/${t}`:e.name,e=e.parent}}function ex(e,t){for(var n=0,i=0;i<t.length;i++)n=(n<<5)-n+t.charCodeAt(i)|0;return(e+n>>>0)%eI.length}function ek(e,t){var n=16384==(61440&e.mode)?(n=ej(e,"x"))?n:e.i.ga?0:2:54;if(n)throw new eM(n);for(n=eI[ex(e.id,t)];n;n=n.Xb){var i=n.name;if(n.parent.id===e.id&&i===t)return n}return e.i.ga(e,t)}function eO(e,t,n,i){return t=ex((e=new eE(e,t,n,i)).parent.id,e.name),e.Xb=eI[t],eI[t]=e}function eL(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function ej(e,t){return eF?0:t.includes("r")&&!(292&e.mode)?2:t.includes("w")&&!(146&e.mode)||t.includes("x")&&!(73&e.mode)?2:0}function eD(e,t){try{return ek(e,t),20}catch(e){}return ej(e,"wx")}function eB(e){if(!(e=eA[e]))throw new eM(8);return e}function eN(e,t=-1){if(e=Object.assign(new eR,e),-1==t)e:{for(t=0;4096>=t;t++)if(!eA[t])break e;throw new eM(33)}return e.U=t,eA[t]=e}var eV={open(e){e.l=e_[e.node.ta].l,e.l.open?.(e)},Z(){throw new eM(70)}};function eU(e,t){var n="/"===t;if(n&&ew)throw new eM(10);if(!n&&t){var i=eP(t,{Za:!1});if(t=i.path,(i=i.node).ra)throw new eM(10);if(16384!=(61440&i.mode))throw new eM(54)}t={type:e,Ic:{},eb:t,Wb:[]},(e=e.S(t)).S=t,t.root=e,n?ew=e:i&&(i.ra=t,i.S&&i.S.Wb.push(t))}function eW(e,t,n){var i=eP(e,{parent:!0}).node;if(!(e=er(e))||"."===e||".."===e)throw new eM(28);var r=eD(i,e);if(r)throw new eM(r);if(!i.i.qa)throw new eM(63);return i.i.qa(i,e,t,n)}function eH(e){return eW(e,16895,0)}function ez(e,t,n){void 0===n&&(n=t,t=438),eW(e,8192|t,n)}function eY(e,t){if(!es(e))throw new eM(44);var n=eP(t,{parent:!0}).node;if(!n)throw new eM(44);var i=eD(n,t=er(t));if(i)throw new eM(i);if(!n.i.xa)throw new eM(63);n.i.xa(n,t,e)}function eX(t,n,i){if(""===t)throw new eM(44);if("string"==typeof n){var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[n];if(void 0===r)throw Error(`Unknown file open mode: ${n}`);n=r}if(i=64&n?(void 0===i?438:i)&4095|32768:0,"object"==typeof t)var a=t;else{t=en(t);try{a=eP(t,{Ya:!(131072&n)}).node}catch(e){}}if(r=!1,64&n){if(a){if(128&n)throw new eM(20)}else a=eW(t,i,0),r=!0}if(!a)throw new eM(44);if(8192==(61440&a.mode)&&(n&=-513),65536&n&&16384!=(61440&a.mode))throw new eM(54);if(!r&&(i=a?40960==(61440&a.mode)?32:16384==(61440&a.mode)&&("r"!==eL(n)||512&n)?31:ej(a,eL(n)):44))throw new eM(i);
1if(512&n&&!r){if(!(i="string"==typeof(i=a)?eP(i,{Ya:!0}).node:i).i.N)throw new eM(63);if(16384==(61440&i.mode))throw new eM(31);if(32768!=(61440&i.mode))throw new eM(28);if(r=ej(i,"w"))throw new eM(r);i.i.N(i,{size:0,timestamp:Date.now()})}return n&=-131713,(a=eN({node:a,path:eT(a),flags:n,seekable:!0,position:0,l:a.l,jc:[],error:!1})).l.open&&a.l.open(a),!e.logReadFiles||1&n||t in(eJ||={})||(eJ[t]=1),a}function e$(e,t,n){if(null===e.U)throw new eM(8);if(!e.seekable||!e.l.Z)throw new eM(70);if(0!=n&&1!=n&&2!=n)throw new eM(28);e.position=e.l.Z(e,t,n),e.jc=[]}function eG(e,t,n){e=en("/dev/"+e);var i,r=eg(!!t,!!n);eK||=64;var a=eK++<<8|0;i={open(e){e.seekable=!1},close(){n?.buffer?.length&&n(10)},read(e,n,i,r){for(var a=0,o=0;o<r;o++){try{var s=t()}catch(e){throw new eM(29)}if(void 0===s&&0===a)throw new eM(6);if(null==s)break;a++,n[i+o]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,t,i,r){for(var a=0;a<r;a++)try{n(t[i+a])}catch(e){throw new eM(29)}return r&&(e.node.timestamp=Date.now()),a}},e_[a]={l:i},ez(e,r,a)}var eq,eK,eJ,eQ,eZ,e0,e1,e2,e4={},e3=void 0,e6=(e,t)=>Object.defineProperty(t,"name",{value:e}),e5=[],e8=[],e9=e=>{if(!e)throw new eQ("Cannot use deleted val. handle = "+e);return e8[e]},e7=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=e5.pop()||e8.length;return e8[t]=e,e8[t+1]=1,t}},te=e=>{var t=Error,n=e6(e,function(t){this.name=e,this.message=t,void 0!==(t=Error(t).stack)&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))});return n.prototype=Object.create(t.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},n},tt=e=>{for(var t="";E[e];)t+=e0[E[e++]];return t},tn=[],ti=()=>{for(;tn.length;){var e=tn.pop();e.g.ca=!1,e.delete()}},tr={},ta=(e,t)=>{if(void 0===t)throw new eQ("ptr should not be undefined");for(;e.B;)t=e.ja(t),e=e.B;return t},to={},ts=e=>{var t=tt(e=ng(e));return nb(e),t},tl=(e,t)=>{var n=to[e];if(void 0===n)throw e=`${t} has unknown type ${ts(e)}`,new eQ(e);return n},tu=()=>{},tc=!1,th=(e,t,n)=>t===n?e:void 0===n.B?null:null===(e=th(e,t,n.B))?null:n.Db(e),td={},tf=(e,t)=>tr[t=ta(e,t)],tp=(e,t)=>{if(!t.s||!t.m)throw new e2("makeClassHandle requires ptr and ptrType");if(!!t.H!=!!t.C)throw new e2("Both smartPtrType and smartPtr must be specified");return t.count={value:1},tm(Object.create(e,{g:{value:t,writable:!0}}))},tm=e=>"undefined"==typeof FinalizationRegistry?(tm=e=>e,e):(tc=new FinalizationRegistry(e=>{e=e.g,--e.count.value,0===e.count.value&&(e.C?e.H.M(e.C):e.s.h.M(e.m))}),tm=e=>{var t=e.g;return t.C&&tc.register(e,{g:t},e),e},tu=e=>{tc.unregister(e)},tm(e)),tv={},tb=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function ty(e){return this.fromWireType(k[e>>2])}var tg={},tw={},t_=(e,t,n)=>{function i(t){if((t=n(t)).length!==e.length)throw new e2("Mismatched type converter count");for(var i=0;i<e.length;++i)tA(e[i],t[i])}e.forEach(function(e){tw[e]=t});var r=Array(t.length),a=[],o=0;t.forEach((e,t)=>{to.hasOwnProperty(e)?r[t]=to[e]:(a.push(e),tg.hasOwnProperty(e)||(tg[e]=[]),tg[e].push(()=>{r[t]=to[e],++o===a.length&&i(r)}))}),0===a.length&&i(r)};function tA(e,t,n={}){if(!("argPackAdvance"in t))throw TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,n={}){var i=t.name;if(!e)throw new eQ(`type "${i}" must have a positive integer typeid pointer`);if(to.hasOwnProperty(e)){if(n.Nb)return;throw new eQ(`Cannot register type '${i}' twice`)}to[e]=t,delete tw[e],tg.hasOwnProperty(e)&&(t=tg[e],delete tg[e],t.forEach(e=>e()))}(e,t,n)}var tC=e=>{throw new eQ(e.g.s.h.name+" instance already deleted")};function tI(){}var tF=(e,t,n)=>{if(void 0===e[t].v){var i=e[t];e[t]=function(...i){if(!e[t].v.hasOwnProperty(i.length))throw new eQ(`Function '${n}' called with an invalid number of arguments (${i.length}) - expects one of (${e[t].v})!`);return e[t].v[i.length].apply(this,i)},e[t].v=[],e[t].v[i.ba]=i}},tM=(t,n,i)=>{if(e.hasOwnProperty(t)){if(void 0===i||void 0!==e[t].v&&void 0!==e[t].v[i])throw new eQ(`Cannot register public name '${t}' twice`);if(tF(e,t,t),e.hasOwnProperty(i))throw new eQ(`Cannot register multiple overloads of a function with the same number of arguments (${i})!`);e[t].v[i]=n}else e[t]=n,void 0!==i&&(e[t].Hc=i)},tS=e=>{if(void 0===e)return"_unknown";
1var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e};function tR(e,t,n,i,r,a,o,s){this.name=e,this.constructor=t,this.K=n,this.M=i,this.B=r,this.Ib=a,this.ja=o,this.Db=s,this.ib=[]}var tE=(e,t,n)=>{for(;t!==n;){if(!t.ja)throw new eQ(`Expected null or instance of ${n.name}, got an instance of ${t.name}`);e=t.ja(e),t=t.B}return e};function tP(e,t){if(null===t){if(this.Fa)throw new eQ(`null is not a valid ${this.name}`);return 0}if(!t.g)throw new eQ(`Cannot pass "${tJ(t)}" as a ${this.name}`);if(!t.g.m)throw new eQ(`Cannot pass deleted object as a pointer of type ${this.name}`);return tE(t.g.m,t.g.s.h,this.h)}function tT(e,t){if(null===t){if(this.Fa)throw new eQ(`null is not a valid ${this.name}`);if(this.pa){var n=this.Ha();return null!==e&&e.push(this.M,n),n}return 0}if(!t||!t.g)throw new eQ(`Cannot pass "${tJ(t)}" as a ${this.name}`);if(!t.g.m)throw new eQ(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.oa&&t.g.s.oa)throw new eQ(`Cannot convert argument of type ${t.g.H?t.g.H.name:t.g.s.name} to parameter type ${this.name}`);if(n=tE(t.g.m,t.g.s.h,this.h),this.pa){if(void 0===t.g.C)throw new eQ("Passing raw pointer to smart pointer is illegal");switch(this.dc){case 0:if(t.g.H===this)n=t.g.C;else throw new eQ(`Cannot convert argument of type ${t.g.H?t.g.H.name:t.g.s.name} to parameter type ${this.name}`);break;case 1:n=t.g.C;break;case 2:if(t.g.H===this)n=t.g.C;else{var i=t.clone();n=this.$b(n,e7(()=>i.delete())),null!==e&&e.push(this.M,n)}break;default:throw new eQ("Unsupporting sharing policy")}}return n}function tx(e,t){if(null===t){if(this.Fa)throw new eQ(`null is not a valid ${this.name}`);return 0}if(!t.g)throw new eQ(`Cannot pass "${tJ(t)}" as a ${this.name}`);if(!t.g.m)throw new eQ(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.g.s.oa)throw new eQ(`Cannot convert argument of type ${t.g.s.name} to parameter type ${this.name}`);return tE(t.g.m,t.g.s.h,this.h)}function tk(e,t,n,i,r,a,o,s,l,u,c){this.name=e,this.h=t,this.Fa=n,this.oa=i,this.pa=r,this.Zb=a,this.dc=o,this.jb=s,this.Ha=l,this.$b=u,this.M=c,r||void 0!==t.B?this.toWireType=tT:(this.toWireType=i?tP:tx,this.J=null)}var tO,tL,tj=(t,n,i)=>{if(!e.hasOwnProperty(t))throw new e2("Replacing nonexistent public symbol");void 0!==e[t].v&&void 0!==i?e[t].v[i]=n:(e[t]=n,e[t].ba=i)},tD=[],tB=e=>{var t=tD[e];return t||(e>=tD.length&&(tD.length=e+1),tD[e]=t=tO.get(e)),t},tN=(t,n,i=[])=>n=t.includes("j")?(0,e["dynCall_"+(t=t.replace(/p/g,"i"))])(n,...i):tB(n)(...i),tV=(e,t)=>(...n)=>tN(e,t,n),tU=(e,t)=>{var n=(e=tt(e)).includes("j")?tV(e,t):tB(t);if("function"!=typeof n)throw new eQ(`unknown function pointer with signature ${e}: ${t}`);return n},tW=(e,t)=>{var n=[],i={};throw t.forEach(function e(t){i[t]||to[t]||(tw[t]?tw[t].forEach(e):(n.push(t),i[t]=!0))}),new tL(`${e}: `+n.map(ts).join([", "]))};function tH(e,t,n,i,r){var a=t.length;if(2>a)throw new eQ("argTypes array size mismatch! Must at least get return value and 'this' types!");var o=null!==t[1]&&null!==n,s=function(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].J)return!0;return!1}(t),l="void"!==t[0].name,u=a-2,c=Array(u),h=[],d=[];return e6(e,function(...n){if(n.length!==u)throw new eQ(`function ${e} called with ${n.length} arguments, expected ${u}`);if(d.length=0,h.length=o?2:1,h[0]=r,o){var a=t[1].toWireType(d,this);h[1]=a}for(var f=0;f<u;++f)c[f]=t[f+2].toWireType(d,n[f]),h.push(c[f]);if(n=i(...h),s)tb(d);else for(f=o?1:2;f<t.length;f++){var p=1===f?a:c[f-2];null!==t[f].J&&t[f].J(p)}return l?t[0].fromWireType(n):void 0})}var tz,tY=(e,t)=>{for(var n=[],i=0;i<e;i++)n.push(k[t+4*i>>2]);return n},tX=e=>{let t=(e=e.trim()).indexOf("(");return -1!==t?e.substr(0,t):e},t$=(e,t,n)=>{if(!(e instanceof Object))throw new eQ(`${n} with invalid "this": ${e}`);if(!(e instanceof t.h.constructor))throw new eQ(`${n} incompatible with "this" of type ${e.constructor.name}`);if(!e.g.m)throw new eQ(`cannot call emscripten binding method ${n} on deleted object`);return tE(e.g.m,e.g.s.h,t.h)},tG=e=>{9<e&&0==--e8[e+1]&&(e8[e]=void 0,e5.push(e))},tq={name:"emscripten::val",fromWireType:e=>{var t=e9(e);return tG(e),t},toWireType:(e,t)=>e7(t),argPackAdvance:8,readValueFromPointer:ty,J:null},tK=(e,t,n)=>{switch(t){case 1:return n?function(e){return this.fromWireType(R[e])}:function(e){return this.fromWireType(E[e])};case 2:return n?function(e){return this.fromWireType(P[e>>1])}:function(e){return this.fromWireType(T[e>>1])};case 4:return n?function(e){return this.fromWireType(x[e>>2])}:function(e){return this.fromWireType(k[e>>
12])};default:throw TypeError(`invalid integer width (${t}): ${e}`)}},tJ=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},tQ=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(O[e>>2])};case 8:return function(e){return this.fromWireType(L[e>>3])};default:throw TypeError(`invalid float width (${t}): ${e}`)}},tZ=(e,t,n)=>{switch(t){case 1:return n?e=>R[e]:e=>E[e];case 2:return n?e=>P[e>>1]:e=>T[e>>1];case 4:return n?e=>x[e>>2]:e=>k[e>>2];default:throw TypeError(`invalid integer width (${t}): ${e}`)}},t0="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,t1=(e,t)=>{for(var n=e>>1,i=n+t/2;!(n>=i)&&T[n];)++n;if(32<(n<<=1)-e&&t0)return t0.decode(E.subarray(e,n));for(i=0,n="";!(i>=t/2);++i){var r=P[e+2*i>>1];if(0==r)break;n+=String.fromCharCode(r)}return n},t2=(e,t,n)=>{if(2>(n??=2147483647))return 0;n-=2;var i=t;n=n<2*e.length?n/2:e.length;for(var r=0;r<n;++r)P[t>>1]=e.charCodeAt(r),t+=2;return P[t>>1]=0,t-i},t4=e=>2*e.length,t3=(e,t)=>{for(var n=0,i="";!(n>=t/4);){var r=x[e+4*n>>2];if(0==r)break;++n,65536<=r?(r-=65536,i+=String.fromCharCode(55296|r>>10,56320|1023&r)):i+=String.fromCharCode(r)}return i},t6=(e,t,n)=>{if(4>(n??=2147483647))return 0;var i=t;n=i+n-4;for(var r=0;r<e.length;++r){var a=e.charCodeAt(r);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++r)),x[t>>2]=a,(t+=4)+4>n)break}return x[t>>2]=0,t-i},t5=e=>{for(var t=0,n=0;n<e.length;++n){var i=e.charCodeAt(n);55296<=i&&57343>=i&&++n,t+=4}return t},t8=(e,t,n)=>{var i=[];return e=e.toWireType(i,n),i.length&&(k[t>>2]=e7(i)),e},t9=[],t7={},ne=e=>{var t=t7[e];return void 0===t?tt(e):t},nt=e=>{var t=t9.length;return t9.push(e),t},nn=(e,t)=>{for(var n=Array(e),i=0;i<e;++i)n[i]=tl(k[t+4*i>>2],"parameter "+i);return n},ni=Reflect.construct,nr=e=>0==e%4&&(0!=e%100||0==e%400),na=[0,31,60,91,121,152,182,213,244,274,305,335],no=[0,31,59,90,120,151,181,212,243,273,304,334],ns=[],nl={},nu=()=>{if(!tz){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:A||"./this.program"};for(e in nl)void 0===nl[e]?delete t[e]:t[e]=nl[e];var n=[];for(e in t)n.push(`${e}=${t[e]}`);tz=n}return tz},nc=[31,29,31,30,31,30,31,31,30,31,30,31],nh=[31,28,31,30,31,30,31,31,30,31,30,31],nd=(e,t,n,i)=>{function r(e,t,n){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=n[0]+e;return e}function a(e,t){return r(e,t,"0")}function o(e,t){var n;function i(e){return 0>e?-1:0<e?1:0}return 0===(n=i(e.getFullYear()-t.getFullYear()))&&0===(n=i(e.getMonth()-t.getMonth()))&&(n=i(e.getDate()-t.getDate())),n}function s(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function l(e){var t=e.$;for(e=new Date(new Date(e.aa+1900,0,1).getTime());0<t;){var n=e.getMonth(),i=(nr(e.getFullYear())?nc:nh)[n];if(t>i-e.getDate())t-=i-e.getDate()+1,e.setDate(1),11>n?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1));else{e.setDate(e.getDate()+t);break}}return n=new Date(e.getFullYear()+1,0,4),t=s(new Date(e.getFullYear(),0,4)),n=s(n),0>=o(t,e)?0>=o(n,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var u=k[i+40>>2];for(var c in i={hc:x[i>>2],fc:x[i+4>>2],ya:x[i+8>>2],Ka:x[i+12>>2],za:x[i+16>>2],aa:x[i+20>>2],O:x[i+24>>2],$:x[i+28>>2],Kc:x[i+32>>2],ec:x[i+36>>2],ic:u&&u?eu(E,u):""},n=n?eu(E,n):"",u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(RegExp(c,"g"),u[c]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(c in u={"%a":e=>h[e.O].substring(0,3),"%A":e=>h[e.O],"%b":e=>d[e.za].substring(0,3),"%B":e=>d[e.za],"%C":e=>a((e.aa+1900)/100|0,2),"%d":e=>a(e.Ka,2),"%e":e=>r(e.Ka,2," "),"%g":e=>l(e).toString().substring(2),"%G":l,"%H":e=>a(e.ya,2),"%I":e=>(0==(e=e.ya)?e=12:12<e&&(e-=12),a(e,2)),"%j":e=>{for(var t=0,n=0;n<=e.za-1;t+=(nr(e.aa+1900)?nc:nh)[n++]);return a(e.Ka+t,3)},"%m":e=>a(e.za+1,2),"%M":e=>a(e.fc,2),"%n":()=>"\n","%p":e=>0<=e.ya&&12>e.ya?"AM":"PM","%S":e=>a(e.hc,2),"%t":()=>"	","%u":e=>e.O||7,"%U":e=>a(Math.floor((e.$+7-e.O)/7),2),"%V":e=>{var t=Math.floor((e.$+7-(e.O+6)%7)/7);if(2>=(e.O+371-e.$-2)%7&&t++,t)53==t&&(4==(n=(e.O+371-e.$)%7)||3==n&&nr(e.aa)||(t=1));else{t=52;var n=(e.O+7-e.$-1)%7;(4==n||5==n&&nr(e.aa%400-1))&&t++}return a(t,2)},"%w":e=>e.O,"%W":e=>a(Math.floor((e.$+7-(e.O+6)%7)/7),2),"%y":e=>(e.aa+1900).toString().substring(2),"%Y":e=>e.aa+1900,"%z":e=>{var t=0<=(e=e.ec);return(t?"+":"-")+String("0000"+((e=Math.abs(e)/60)/60*100+e%60)).slice(-4)},"%Z":e=>e.ic,"%%":()=>"%"},n=n.replace(/%%/g,"\0\0"),u)n.includes(c)&&(n=n.replace(RegExp(c,"g"),u[c](i)));return(c=ef(n=n.replace(/\0\0/g,"%"),!1)).length>t?0:(R.set(c,e),c.length-1)};
1[44].forEach(e=>{eS[e]=new eM(e),eS[e].stack="<generic error, no stack>"}),eI=Array(4096),eU(ey,"/"),eH("/tmp"),eH("/home"),eH("/home/web_user"),eH("/dev"),t={read:()=>0,write:(e,t,n,i)=>i},e_[259]={l:t},ez("/dev/null",259),em(1280,{$a(){e:{if(!ec.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(e=window.prompt("Input: "))&&(e+="\n"),!e){e=null;break e}ec=ef(e,!0)}e=ec.shift()}return e},Ga(e,t){null===t||10===t?(I(eu(e.F,0)),e.F=[]):0!=t&&e.F.push(t)},la(e){e.F&&0<e.F.length&&(I(eu(e.F,0)),e.F=[])},Pb:()=>({uc:25856,wc:5,tc:191,vc:35387,sc:[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]}),Qb:()=>0,Rb:()=>[24,80]}),em(1536,{Ga(e,t){null===t||10===t?(F(eu(e.F,0)),e.F=[]):0!=t&&e.F.push(t)},la(e){e.F&&0<e.F.length&&(F(eu(e.F,0)),e.F=[])}}),ez("/dev/tty",1280),ez("/dev/tty1",1536),n=new Uint8Array(1024),r=0,eG("random",a=()=>(0===r&&(r=eo(n).byteLength),n[--r])),eG("urandom",a),eH("/dev/shm"),eH("/dev/shm/tmp"),eH("/proc"),o=eH("/proc/self"),eH("/proc/self/fd"),eU({S(){var e=eO(o,"fd",16895,73);return e.i={ga(e,t){var n=eB(+t);return(e={parent:null,S:{eb:"fake"},i:{ia:()=>n.path}}).parent=e}},e}},"/proc/self/fd"),eQ=e.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},e8.push(0,1,void 0,1,null,1,!0,1,!1,1),e.count_emval_handles=()=>
1e8.length/2-5-e5.length,eZ=e.PureVirtualError=te("PureVirtualError");for(var nf=Array(256),np=0;256>np;++np)nf[np]=String.fromCharCode(np);e0=nf,e.getInheritedInstanceCount=()=>Object.keys(tr).length,e.getLiveInheritedInstances=()=>{var e,t=[];for(e in tr)tr.hasOwnProperty(e)&&t.push(tr[e]);return t},e.flushPendingDeletes=ti,e.setDelayFunction=e=>{e1=e,tn.length&&e1&&e1(ti)},e2=e.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(tI.prototype,{isAliasOf:function(e){if(!(this instanceof tI&&e instanceof tI))return!1;var t=this.g.s.h,n=this.g.m;e.g=e.g;var i=e.g.s.h;for(e=e.g.m;t.B;)n=t.ja(n),t=t.B;for(;i.B;)e=i.ja(e),i=i.B;return t===i&&n===e},clone:function(){if(this.g.m||tC(this),this.g.ea)return this.g.count.value+=1,this;var e=tm,t=Object,n=t.create,i=Object.getPrototypeOf(this),r=this.g;return e=e(n.call(t,i,{g:{value:{count:r.count,ca:r.ca,ea:r.ea,m:r.m,s:r.s,C:r.C,H:r.H}}})),e.g.count.value+=1,e.g.ca=!1,e},delete(){if(this.g.m||tC(this),this.g.ca&&!this.g.ea)throw new eQ("Object already scheduled for deletion");tu(this);var e=this.g;--e.count.value,0===e.count.value&&(e.C?e.H.M(e.C):e.s.h.M(e.m)),this.g.ea||(this.g.C=void 0,this.g.m=void 0)},isDeleted:function(){return!this.g.m},deleteLater:function(){if(this.g.m||tC(this),this.g.ca&&!this.g.ea)throw new eQ("Object already scheduled for deletion");return tn.push(this),1===tn.length&&e1&&e1(ti),this.g.ca=!0,this}}),Object.assign(tk.prototype,{Jb(e){return this.jb&&(e=this.jb(e)),e},Ua(e){this.M?.(e)},argPackAdvance:8,readValueFromPointer:ty,fromWireType:function(e){function t(){return this.pa?tp(this.h.K,{s:this.Zb,m:n,H:this,C:e}):tp(this.h.K,{s:this,m:e})}var n=this.Jb(e);if(!n)return this.Ua(e),null;var i=tf(this.h,n);if(void 0!==i)return 0===i.g.count.value?(i.g.m=n,i.g.C=e,i.clone()):(i=i.clone(),this.Ua(e),i);if(!(i=td[i=this.h.Ib(n)]))return t.call(this);i=this.oa?i.zb:i.pointerType;var r=th(n,this.h,i.h);return null===r?t.call(this):this.pa?tp(i.h.K,{s:i,m:r,H:this,C:e}):tp(i.h.K,{s:i,m:r})}}),tL=e.UnboundTypeError=te("UnboundTypeError");var nm={__syscall_fcntl64:function(e,t,n){e3=n;try{var i=eB(e);switch(t){case 0:var r=ee();if(0>r)break;for(;eA[r];)r++;return function(e,t=-1){return e=eN(e,t),e.l?.zc?.(e),e}(i,r).U;case 1:case 2:case 13:case 14:return 0;case 3:return i.flags;case 4:return r=ee(),i.flags|=r,0;case 12:return P[(r=ee())+0>>1]=2,0}return -28}catch(e){if(void 0===e4||"ErrnoError"!==e.name)throw e;return-e.Y}},__syscall_ioctl:function(e,t,n){e3=n;try{var i=eB(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return i.o?0:-59;case 21505:if(!i.o)return -59;if(i.o.T.Pb){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 r=ee();x[r>>2]=25856,x[r+4>>2]=5,x[r+8>>2]=191,x[r+12>>2]=35387;for(var a=0;32>a;a++)R[r+a+17]=e[a]||0}return 0;case 21506:case 21507:case 21508:if(!i.o)return -59;if(i.o.T.Qb)for(r=ee(),e=[],a=0;32>a;a++)e.push(R[r+a+17]);return 0;case 21519:if(!i.o)return -59;return x[(r=ee())>>2]=0;case 21520:return i.o?-28:-59;case 21531:if(r=ee(),!i.l.Ob)throw new eM(59);return i.l.Ob(i,t,r);case 21523:if(!i.o)return -59;return i.o.T.Rb&&(a=[24,80],P[(r=ee())>>1]=a[0],P[r+2>>1]=a[1]),0;default:return -28}}catch(e){if(void 0===e4||"ErrnoError"!==e.name)throw e;return-e.Y}}
1,__syscall_openat:function(e,t,n,i){e3=i;try{var r=t=t?eu(E,t):"";if("/"===r.charAt(0))t=r;else{var a=-100===e?"/":eB(e).path;if(0==r.length)throw new eM(44);t=en(a+"/"+r)}var o=i?ee():0;return eX(t,n,o).U}catch(e){if(void 0===e4||"ErrnoError"!==e.name)throw e;return-e.Y}},_abort_js:()=>{z("")},_embind_create_inheriting_constructor:(e,t,n)=>{e=tt(e),t=tl(t,"wrapper"),n=e9(n);var i=t.h,r=i.K,a=i.B.K,o=i.B.constructor;return e=e6(e,function(...e){i.B.ib.forEach((function(e){if(this[e]===a[e])throw new eZ(`Pure virtual function ${e} must be implemented in JavaScript`)}).bind(this)),Object.defineProperty(this,"__parent",{value:r}),this.__construct(...e)}),r.__construct=function(...e){if(this===r)throw new eQ("Pass correct 'this' to __construct");e=o.implement(this,...e),tu(e);var t=e.g;if(e.notifyOnDestruction(),t.ea=!0,Object.defineProperties(this,{g:{value:t}}),tm(this),e=ta(i,e=t.m),tr.hasOwnProperty(e))throw new eQ(`Tried to register registered instance: ${e}`);tr[e]=this},r.__destruct=function(){if(this===r)throw new eQ("Pass correct 'this' to __destruct");tu(this);var e=this.g.m;if(e=ta(i,e),tr.hasOwnProperty(e))delete tr[e];else throw new eQ(`Tried to unregister unregistered instance: ${e}`)},e.prototype=Object.create(r),Object.assign(e.prototype,n),e7(e)},_embind_finalize_value_object:e=>{var t=tv[e];delete tv[e];var n=t.Ha,i=t.M,r=t.Xa;t_([e],r.map(e=>e.Mb).concat(r.map(e=>e.bc)),e=>{var a={};return r.forEach((t,n)=>{var i=e[n],o=t.Kb,s=t.Lb,l=e[n+r.length],u=t.ac,c=t.cc;a[t.Gb]={read:e=>i.fromWireType(o(s,e)),write:(e,t)=>{var n=[];u(c,e,l.toWireType(n,t)),tb(n)}}}),[{name:t.name,fromWireType:e=>{var t,n={};for(t in a)n[t]=a[t].read(e);return i(e),n},toWireType:(e,t)=>{for(var r in a)if(!(r in t))throw TypeError(`Missing field: "${r}"`);var o=n();for(r in a)a[r].write(o,t[r]);return null!==e&&e.push(i,o),o},argPackAdvance:8,readValueFromPointer:ty,J:i}]})},_embind_register_bigint:()=>{},_embind_register_bool:(e,t,n,i)=>{tA(e,{name:t=tt(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:i},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(E[e])},J:null})},_embind_register_class:(e,t,n,i,r,a,o,s,l,u,c,h,d)=>{c=tt(c),a=tU(r,a),s&&=tU(o,s),u&&=tU(l,u),d=tU(h,d);var f=tS(c);tM(f,function(){tW(`Cannot construct ${c} due to unbound types`,[i])}),t_([e,t,n],i?[i]:[],t=>{if(t=t[0],i)var n,r=t.h,o=r.K;else o=tI.prototype;var l=Object.create(o,{constructor:{value:t=e6(c,function(...e){if(Object.getPrototypeOf(this)!==l)throw new eQ("Use 'new' to construct "+c);if(void 0===h.X)throw new eQ(c+" has no accessible constructor");var t=h.X[e.length];if(void 0===t)throw new eQ(`Tried to invoke ctor of ${c} with invalid number of parameters (${e.length}) - expected (${Object.keys(h.X).toString()}) parameters instead!`);return t.apply(this,e)})}});t.prototype=l;var h=new tR(c,t,l,d,r,a,s,u);return h.B&&((n=h.B).ka??(n.ka=[]),h.B.ka.push(h)),r=new tk(c,h,!0,!1,!1),n=new tk(c+"*",h,!1,!1,!1),o=new tk(c+" const*",h,!1,!0,!1),td[e]={pointerType:n,zb:o},tj(f,t),[r,n,o]})},_embind_register_class_class_function:(e,t,n,i,r,a,o)=>{var s=tY(n,i);t=tX(t=tt(t)),a=tU(r,a),t_([],[e],e=>{function i(){tW(`Cannot call ${r} due to unbound types`,s)}e=e[0];var r=`${e.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var l=e.h.constructor;return void 0===l[t]?(i.ba=n-1,l[t]=i):(tF(l,t,r),l[t].v[n-1]=i),t_([],s,i=>{if(i=tH(r,[i[0],null].concat(i.slice(1)),null,a,o),void 0===l[t].v?(i.ba=n-1,l[t]=i):l[t].v[n-1]=i,e.h.ka)for(let n of e.h.ka)n.constructor.hasOwnProperty(t)||(n.constructor[t]=i);return[]}),[]})},_embind_register_class_class_property:(e,t,n,i,r,a,o,s)=>{t=tt(t),a=tU(r,a),t_([],[e],e=>{e=e[0];var r=`${e.name}.${t}`,l={get(){tW(`Cannot access ${r} due to unbound types`,[n])},enumerable:!0,configurable:!0};return l.set=s?()=>{tW(`Cannot access ${r} due to unbound types`,[n])}:()=>{throw new eQ(`${r} is a read-only property`)},Object.defineProperty(e.h.constructor,t,l),t_([],[n],n=>{n=n[0];var r={get:()=>n.fromWireType(a(i)),enumerable:!0};return s&&(s=tU(o,s),r.set=e=>{var t=[];s(i,n.toWireType(t,e)),tb(t)}),Object.defineProperty(e.h.constructor,t,r),[]}),[]})},_embind_register_class_constructor:(e,t,n,i,r,a)=>{var o=tY(t,n);r=tU(i,r),t_([],[e],e=>{e=e[0];var n=`constructor ${e.name}`;if(void 0===e.h.X&&(e.h.X=[]),void 0!==e.h.X[t-1])throw new eQ(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.h.X[t-1]=()=>{tW(`Cannot construct ${e.name} due to unbound types`,o)},t_([],o,i=>(i.splice(1,0,null),e.h.X[t-1]=tH(n,i,null,r,a),[])),[]})},_embind_register_class_function:(e,t,n,i,r,a,o,s)=>{var l=tY(n,i);t=tX(t=tt(t)),a=tU(r,a),t_([],[e],e=>{function i(){tW(`Cannot call ${r} due to unbound types`,l)}e=e[0];var r=`${e.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.h.ib.push(t);var u=e.h.K,c=u[t];return void 0===c||void 0===c.v&&c.className!==e.name&&c.ba===n-2?(i.ba=n-2,i.className=e.n
1ame,u[t]=i):(tF(u,t,r),u[t].v[n-2]=i),t_([],l,i=>(i=tH(r,i,e,a,o),void 0===u[t].v?(i.ba=n-2,u[t]=i):u[t].v[n-2]=i,[])),[]})},_embind_register_class_property:(e,t,n,i,r,a,o,s,l,u)=>{t=tt(t),r=tU(i,r),t_([],[e],e=>{e=e[0];var i=`${e.name}.${t}`,c={get(){tW(`Cannot access ${i} due to unbound types`,[n,o])},enumerable:!0,configurable:!0};return c.set=l?()=>tW(`Cannot access ${i} due to unbound types`,[n,o]):()=>{throw new eQ(i+" is a read-only property")},Object.defineProperty(e.h.K,t,c),t_([],l?[n,o]:[n],n=>{var o=n[0],c={get(){var t=t$(this,e,i+" getter");return o.fromWireType(r(a,t))},enumerable:!0};if(l){l=tU(s,l);var h=n[1];c.set=function(t){var n=t$(this,e,i+" setter"),r=[];l(u,n,h.toWireType(r,t)),tb(r)}}return Object.defineProperty(e.h.K,t,c),[]}),[]})},_embind_register_emval:e=>tA(e,tq),_embind_register_enum:(e,t,n,i)=>{function r(){}t=tt(t),r.values={},tA(e,{name:t,constructor:r,fromWireType:function(e){return this.constructor.values[e]},toWireType:(e,t)=>t.value,argPackAdvance:8,readValueFromPointer:tK(t,n,i),J:null}),tM(t,r)},_embind_register_enum_value:(e,t,n)=>{var i=tl(e,"enum");t=tt(t),e=i.constructor,i=Object.create(i.constructor.prototype,{value:{value:n},constructor:{value:e6(`${i.name}_${t}`,function(){})}}),e.values[n]=i,e[t]=i},_embind_register_float:(e,t,n)=>{tA(e,{name:t=tt(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:8,readValueFromPointer:tQ(t,n),J:null})},_embind_register_function:(e,t,n,i,r,a)=>{var o=tY(t,n);e=tX(e=tt(e)),r=tU(i,r),tM(e,function(){tW(`Cannot call ${e} due to unbound types`,o)},t-1),t_([],o,n=>(tj(e,tH(e,[n[0],null].concat(n.slice(1)),null,r,a),t-1),[]))},_embind_register_integer:(e,t,n,i,r)=>{if(t=tt(t),-1===r&&(r=4294967295),r=e=>e,0===i){var a=32-8*n;r=e=>e<<a>>>a}var o=t.includes("unsigned")?function(e,t){return t>>>0}:function(e,t){return t};tA(e,{name:t,fromWireType:r,toWireType:o,argPackAdvance:8,readValueFromPointer:tZ(t,n,0!==i),J:null})},_embind_register_memory_view:(e,t,n)=>{function i(e){return new r(R.buffer,k[e+4>>2],k[e>>2])}var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];tA(e,{name:n=tt(n),fromWireType:i,argPackAdvance:8,readValueFromPointer:i},{Nb:!0})},_embind_register_std_string:(e,t)=>{var n="std::string"===(t=tt(t));tA(e,{name:t,fromWireType:function(e){var t=k[e>>2],i=e+4;if(n)for(var r=i,a=0;a<=t;++a){var o=i+a;if(a==t||0==E[o]){if(r=r?eu(E,r,o-r):"",void 0===s)var s=r;else s+="\0"+r;r=o+1}}else{for(a=0,s=Array(t);a<t;++a)s[a]=String.fromCharCode(E[i+a]);s=s.join("")}return nb(e),s},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var i="string"==typeof t;if(!(i||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array))throw new eQ("Cannot pass non-string to std::string");var r=n&&i?eh(t):t.length,a=ny(4+r+1),o=a+4;if(k[a>>2]=r,n&&i)ed(t,E,o,r+1);else if(i)for(i=0;i<r;++i){var s=t.charCodeAt(i);if(255<s)throw nb(o),new eQ("String has UTF-16 code units that do not fit in 8 bits");E[o+i]=s}else for(i=0;i<r;++i)E[o+i]=t[i];return null!==e&&e.push(nb,a),a},argPackAdvance:8,readValueFromPointer:ty,J(e){nb(e)}})},_embind_register_std_wstring:(e,t,n)=>{if(n=tt(n),2===t)var i=t1,r=t2,a=t4,o=e=>T[e>>1];else 4===t&&(i=t3,r=t6,a=t5,o=e=>k[e>>2]);tA(e,{name:n,fromWireType:e=>{for(var n,r=k[e>>2],a=e+4,s=0;s<=r;++s){var l=e+4+s*t;(s==r||0==o(l))&&(a=i(a,l-a),void 0===n?n=a:n+="\0"+a,a=l+t)}return nb(e),n},toWireType:(e,i)=>{if("string"!=typeof i)throw new eQ(`Cannot pass non-string to C++ string type ${n}`);var o=a(i),s=ny(4+o+t);return k[s>>2]=o/t,r(i,s+4,o+t),null!==e&&e.push(nb,s),s},argPackAdvance:8,readValueFromPointer:ty,J(e){nb(e)}})},_embind_register_value_object:(e,t,n,i,r,a)=>{tv[e]={name:tt(t),Ha:tU(n,i),M:tU(r,a),Xa:[]}},_embind_register_value_object_field:(e,t,n,i,r,a,o,s,l,u)=>{tv[e].Xa.push({Gb:tt(t),Mb:n,Kb:tU(i,r),Lb:a,bc:o,ac:tU(s,l),cc:u})},_embind_register_void:(e,t)=>{tA(e,{Dc:!0,name:t=tt(t),argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}})},_emscripten_get_now_is_monotonic:()=>1,_emscripten_memcpy_js:(e,t,n)=>E.copyWithin(e,t,t+n),_emscripten_throw_longjmp:()=>{throw 1/0},_emval_as:(e,t,n)=>(e=e9(e),t8(t=tl(t,"emval::as"),n,e)),_emval_call:(e,t,n,i)=>(e=t9[e])(null,t=e9(t),n,i),_emval_call_method:(e,t,n,i,r)=>
1(e=t9[e])(t=e9(t),t[n=ne(n)],i,r),_emval_decref:tG,_emval_get_method_caller:(e,t,n)=>{var i=nn(e,t),r=i.shift(),a=Array(--e);return nt(e6(t=`methodCaller<(${i.map(e=>e.name).join(", ")}) => ${r.name}>`,(t,o,s,l)=>{for(var u=0,c=0;c<e;++c)a[c]=i[c].readValueFromPointer(l+u),u+=i[c].argPackAdvance;return t8(r,s,t=1===n?ni(o,a):o.apply(t,a))}))},_emval_get_module_property:t=>e7(e[t=ne(t)]),_emval_get_property:(e,t)=>e7((e=e9(e))[t=e9(t)]),_emval_incref:e=>{9<e&&(e8[e+1]+=1)},_emval_new_array:()=>e7([]),_emval_new_cstring:e=>e7(ne(e)),_emval_new_object:()=>e7({}),_emval_run_destructors:e=>{tb(e9(e)),tG(e)},_emval_set_property:(e,t,n)=>{e=e9(e),t=e9(t),n=e9(n),e[t]=n},_emval_take_value:(e,t)=>e7(e=(e=tl(e,"_emval_take_value")).readValueFromPointer(t)),_gmtime_js:function(e,t,n){e=new Date(1e3*(t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN)),x[n>>2]=e.getUTCSeconds(),x[n+4>>2]=e.getUTCMinutes(),x[n+8>>2]=e.getUTCHours(),x[n+12>>2]=e.getUTCDate(),x[n+16>>2]=e.getUTCMonth(),x[n+20>>2]=e.getUTCFullYear()-1900,x[n+24>>2]=e.getUTCDay(),x[n+28>>2]=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},_localtime_js:function(e,t,n){e=new Date(1e3*(t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN)),x[n>>2]=e.getSeconds(),x[n+4>>2]=e.getMinutes(),x[n+8>>2]=e.getHours(),x[n+12>>2]=e.getDate(),x[n+16>>2]=e.getMonth(),x[n+20>>2]=e.getFullYear()-1900,x[n+24>>2]=e.getDay(),x[n+28>>2]=(nr(e.getFullYear())?na:no)[e.getMonth()]+e.getDate()-1|0,x[n+36>>2]=-(60*e.getTimezoneOffset()),t=new Date(e.getFullYear(),6,1).getTimezoneOffset();var i=new Date(e.getFullYear(),0,1).getTimezoneOffset();x[n+32>>2]=0|(t!=i&&e.getTimezoneOffset()==Math.min(i,t))},_tzset_js:(e,t,n,i)=>{var r=new Date().getFullYear(),a=new Date(r,0,1),o=new Date(r,6,1);r=a.getTimezoneOffset();var s=o.getTimezoneOffset();k[e>>2]=60*Math.max(r,s),x[t>>2]=Number(r!=s),a=(e=e=>e.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1])(a),o=e(o),s<r?(ed(a,E,n,17),ed(o,E,i,17)):(ed(a,E,i,17),ed(o,E,n,17))},emscripten_asm_const_int:(e,t,n)=>{ns.length=0;for(var i;i=E[t++];){var r=105!=i;r&=112!=i,n+=r&&n%8?4:0,ns.push(112==i?k[n>>2]:105==i?x[n>>2]:L[n>>3]),n+=r?8:4}return Q[e](...ns)},emscripten_date_now:()=>Date.now(),emscripten_get_now:()=>performance.now(),emscripten_resize_heap:e=>{var t=E.length;if(2147483648<(e>>>=0))return!1;for(var n=1;4>=n;n*=2){var i=t*(1+.2/n);i=Math.min(i,e+100663296);var r=Math;i=Math.max(e,i);e:{r=(r.min.call(r,2147483648,i+(65536-i%65536)%65536)-S.buffer.byteLength+65535)/65536;try{S.grow(r),D();var a=1;break e}catch(e){}a=void 0}if(a)return!0}return!1},environ_get:(e,t)=>{var n=0;return nu().forEach((i,r)=>{var a=t+n;for(r=k[e+4*r>>2]=a,a=0;a<i.length;++a)R[r++]=i.charCodeAt(a);R[r]=0,n+=i.length+1}),0},environ_sizes_get:(e,t)=>{var n=nu();k[e>>2]=n.length;var i=0;return n.forEach(e=>i+=e.length+1),k[t>>2]=i,0},fd_close:function(e){try{var t=eB(e);if(null===t.U)throw new eM(8);t.Ea&&(t.Ea=null);try{t.l.close&&t.l.close(t)}catch(e){throw e}finally{eA[t.U]=null}return t.U=null,0}catch(e){if(void 0===e4||"ErrnoError"!==e.name)throw e;return e.Y}},fd_read:function(e,t,n,i){try{e:{var r=eB(e);e=t;for(var a,o=t=0;o<n;o++){var s=k[e>>2],l=k[e+4>>2];e+=8;var u=a,c=R;if(0>l||0>u)throw new eM(28);if(null===r.U||1==(2097155&r.flags))throw new eM(8);if(16384==(61440&r.node.mode))throw new eM(31);if(!r.l.read)throw new eM(28);var h=void 0!==u;if(h){if(!r.seekable)throw new eM(70)}else u=r.position;var d=r.l.read(r,c,s,l,u);if(h||(r.position+=d),0>d){var f=-1;break e}if(t+=d,d<l)break;void 0!==a&&(a+=d)}f=t}return k[i>>2]=f,0}catch(e){if(void 0===e4||"ErrnoError"!==e.name)throw e;return e.Y}},fd_seek:function(e,t,n,i,r){t=n+2097152>>>0<4194305-!!t?(t>>>0)+4294967296*n:NaN;try{if(isNaN(t))return 61;var a=eB(e);return e$(a,t,i),J=[a.position>>>0,(K=a.position,1<=+Math.abs(K)?0<K?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],x[r>>2]=J[0],x[r+4>>2]=J[1],a.Ea&&0===t&&0===i&&(a.Ea=null),0}catch(e){if(void 0===e4||"ErrnoError"!==e.name)throw e;return e.Y}},fd_write:function(e,t,n,i){try{e:{var r=eB(e);e=t;for(var a,o=t=0;o<n;o++){var s=k[e>>2],l=k[e+4>>2];e+=8;var u=a,c=R;if(0>l||0>u)throw new eM(28);if(null===r.U||0==(2097155&r.flags))throw new eM(8);if(16384==(61440&r.node.mode))throw new eM(31);if(!r.l.write)throw new eM(28);r.seekable&&1024&r.flags&&e$(r,0,2);var h=void 0!==u;if(h){if(!r.seekable)throw new eM(70)}else u=r.position;var d=r.l.write(r,c,s,l,u,void 0);if(h||(r.position+=d),0>d){var f=-1;break e}t+=d,void 0!==a&&(a+=d)}f=t}return k[i>>2]=f,0}catch(e){if(void 0===e4||"ErrnoError"!==e.name)throw e;return e.Y}},invoke_vii:function(e,t,n){var i=nF();try{tB(e)(t,n)}catch(e){if(nI(i),e!==e+0)throw e;nC(1,0)}},isWindowsBrowser:function(){return -1<navigator.platform.indexOf("Win")},strftime:nd,strftime_l:(e,t,n,i)=>nd(e,t,n,i),wasm_start_image_decode:function(t,n,i){n=e.HEAP8.subarray(n,n+i),(i=new Uint8Array(i)).set(n),createImageBitmap(new Blob([i])).then(function(n){var i=new OffscreenCanvas(n.width,n.height).getContext("2d");
1i.drawImage(n,0,0);var r=(i=i.getImageData(0,0,n.width,n.height)).data.length,a=e.vb(r);e.lc.set(i.data,a),e.nc(t,n.width,n.height,a,r)}).catch(function(n){n=n.message||"decode failed";var i=e.Ec(n)+1,r=e.vb(i);e.Jc(n,r,i),e.oc(t,r),e.mc(r)})}},nv=function(){function t(t){return S=(nv=t.exports).memory,D(),tO=nv.__indirect_function_table,N.unshift(nv.__wasm_call_ctors),U--,e.monitorRunDependencies?.(U),0==U&&(null!==W&&(clearInterval(W),W=null),H&&(t=H,H=null,t())),nv}var n,i={env:nm,wasi_snapshot_preview1:nm};if(U++,e.monitorRunDependencies?.(U),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(e){F(`Module.instantiateWasm callback failed with error: ${e}`),u(e)}return Y||=X("canvas_advanced.wasm")?"canvas_advanced.wasm":e.locateFile?e.locateFile("canvas_advanced.wasm",C):C+"canvas_advanced.wasm",(n=function(e){t(e.instance)},M||"function"!=typeof WebAssembly.instantiateStreaming||X(Y)||$(Y)||"function"!=typeof fetch?q(Y,i,n):fetch(Y,{credentials:"same-origin"}).then(e=>WebAssembly.instantiateStreaming(e,i).then(n,function(e){return F(`wasm streaming compile failed: ${e}`),F("falling back to ArrayBuffer instantiation"),q(Y,i,n)}))).catch(u),{}}(),nb=e=>(nb=nv.free)(e),ny=e=>(ny=nv.malloc)(e),ng=e=>(ng=nv.__getTypeName)(e);e._wasm_image_decode_complete=(t,n,i,r,a)=>(e._wasm_image_decode_complete=nv.wasm_image_decode_complete)(t,n,i,r,a),e._wasm_image_decode_error=(t,n)=>(e._wasm_image_decode_error=nv.wasm_image_decode_error)(t,n);var nw=e._ma_device__on_notification_unlocked=t=>(nw=e._ma_device__on_notification_unlocked=nv.ma_device__on_notification_unlocked)(t);e._ma_malloc_emscripten=(t,n)=>(e._ma_malloc_emscripten=nv.ma_malloc_emscripten)(t,n),e._ma_free_emscripten=(t,n)=>(e._ma_free_emscripten=nv.ma_free_emscripten)(t,n);var n_=e._ma_device_process_pcm_frames_capture__webaudio=(t,n,i)=>(n_=e._ma_device_process_pcm_frames_capture__webaudio=nv.ma_device_process_pcm_frames_capture__webaudio)(t,n,i),nA=e._ma_device_process_pcm_frames_playback__webaudio=(t,n,i)=>(nA=e._ma_device_process_pcm_frames_playback__webaudio=nv.ma_device_process_pcm_frames_playback__webaudio)(t,n,i),nC=(e,t)=>(nC=nv.setThrew)(e,t),nI=e=>(nI=nv._emscripten_stack_restore)(e),nF=()=>(nF=nv.emscripten_stack_get_current)();
1function nM(){function t(){if(!s&&(s=!0,e.calledRun=!0,!j)){if(e.noFSInit||eq||(eq=!0,e.stdin=e.stdin,e.stdout=e.stdout,e.stderr=e.stderr,e.stdin?eG("stdin",e.stdin):eY("/dev/tty","/dev/stdin"),e.stdout?eG("stdout",null,e.stdout):eY("/dev/tty","/dev/stdout"),e.stderr?eG("stderr",null,e.stderr):eY("/dev/tty1","/dev/stderr"),eX("/dev/stdin",0),eX("/dev/stdout",1),eX("/dev/stderr",1)),eF=!1,Z(N),l(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();V.unshift(t)}Z(V)}}if(!(0<U)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)!function(){var t=e.preRun.shift();B.unshift(t)}();Z(B),0<U||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),t()},1)):t())}}if(e.dynCall_iiji=(t,n,i,r,a)=>(e.dynCall_iiji=nv.dynCall_iiji)(t,n,i,r,a),e.dynCall_jiji=(t,n,i,r,a)=>(e.dynCall_jiji=nv.dynCall_jiji)(t,n,i,r,a),e.dynCall_iiiji=(t,n,i,r,a,o)=>(e.dynCall_iiiji=nv.dynCall_iiiji)(t,n,i,r,a,o),e.dynCall_iij=(t,n,i,r)=>(e.dynCall_iij=nv.dynCall_iij)(t,n,i,r),e.dynCall_jii=(t,n,i)=>(e.dynCall_jii=nv.dynCall_jii)(t,n,i),e.dynCall_viijii=(t,n,i,r,a,o,s)=>(e.dynCall_viijii=nv.dynCall_viijii)(t,n,i,r,a,o,s),e.dynCall_iiiiij=(t,n,i,r,a,o,s)=>(e.dynCall_iiiiij=nv.dynCall_iiiiij)(t,n,i,r,a,o,s),e.dynCall_iiiiijj=(t,n,i,r,a,o,s,l,u)=>(e.dynCall_iiiiijj=nv.dynCall_iiiiijj)(t,n,i,r,a,o,s,l,u),e.dynCall_iiiiiijj=(t,n,i,r,a,o,s,l,u,c)=>(e.dynCall_iiiiiijj=nv.dynCall_iiiiiijj)(t,n,i,r,a,o,s,l,u,c),H=function e(){s||nM(),s||(H=e)},e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();return nM(),c})},e=>{e.exports=JSON.parse('{"name":"@rive-app/canvas","version":"2.39.2","description":"Rive\'s canvas 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])"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils","semantics"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}')},(e,t,n)=>{n.r(t),n.d(t,{AccessibilityOverlay:()=>r.AccessibilityOverlay,SemanticActionType:()=>a.SemanticActionType,SemanticMode:()=>a.SemanticMode,SemanticRole:()=>a.SemanticRole,SemanticState:()=>a.SemanticState,SemanticTrait:()=>a.SemanticTrait,SemanticTreeModel:()=>i.SemanticTreeModel,hasState:()=>a.hasState,hasTrait:()=>a.hasTrait,roleName:()=>a.roleName,stateNames:()=>a.stateNames,traitNames:()=>a.traitNames});var i=n(7),r=n(9),a=n(8)},(e,t,n)=>{n.r(t),n.d(t,{SemanticTreeModel:()=>a});var i=n(8),r=function(e,t,n){if(n||2==arguments.length)for(var i,r=0,a=t.length;r<a;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},a=function(){function e(){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(e.prototype,"nodeCount",{get:function(){return this._nodesById.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"semanticVersion",{get:function(){return this._semanticVersion},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryVersion",{get:function(){return this._geometryVersion},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryChangedIds",{get:function(){return this._geometryChangedIds},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"semanticChangedIds",{get:function(){return this._semanticChangedIds}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roots",{get:function(){return this._roots},enumerable:!1,configurable:!0}),e.prototype.nodeById=function(e){return this._nodesById.get(e)},e.prototype.siblingIndexOf=function(e){var t=this._nodesById.get(e);if(!t)return -1;if(t.parentId<0)return this._roots.indexOf(e);var n=this._nodesById.get(t.parentId);return n?n.children.indexOf(e):-1},e.prototype.detach=function(e){var t=this._nodesById.get(e);if(t){if(t.parentId<0){var n=this._roots.indexOf(e);-1!==n&&this._roots.splice(n,1)}else{var i=this._nodesById.get(t.parentId);if(i){var n=i.children.indexOf(e);-1!==n&&i.children.splice(n,1)}}}},e.prototype.attach=function(e,t,n){var i=this._nodesById.get(e);if(i){if(t<0){i.parentId=-1;var r,a=(r=this._roots.length,n<0?0:n>r?r:n);this._roots.splice(a,0,e)}else{var o=this._nodesById.get(t);if(o){i.parentId=t;var s,a=(s=o.children.length,n<0?0:n>s?s:n);o.children.splice(a,0,e)}else i.parentId=-1,this._roots.push(e)}}},e.prototype.removeSubtree=function(e){var t=this._nodesById.get(e);if(t){for(var n=r([],t.children,!0),i=0;i<n.length;i++){var a=n[i];this.removeSubtree(a)}this.detach(e),this._nodesById.delete(e)}},e.prototype.applyDiff=function(e){var t,n,i=this;this._geometryChangedIds.clear(),this._semanticChangedIds.clear();for(var r=!1,a=!1,h=function(){r=!0},d=function(e){r=!0,i._semanticChangedIds.add(e)},f=function(e){a=!0,i._geometryChangedIds.add(e)},p=0,m=e.removed;p<m.length;p++){var v=m[p];this._nodesById.has(v)&&(this.removeSubtree(v),h())}for(var b=0,y=e.added;b<y.length;b++){var g,w=y[b],_=this._nodesById.get(w.id);_?(s(_,w)&&(u(_,w),d(w.id)),l(_,w)&&(c(_,w),f(w.id))):(this._nodesById.set(w.id,{id:(g=w).id,parentId:-1,role:g.role,label:g.label,value:g.value,hint:g.hint,stateFlags:g.stateFlags,traitFlags:g.traitFlags,headingLevel:g.headingLevel,minX:g.minX,minY:g.minY,maxX:g.maxX,maxY:g.maxY,children:[]}),d(w.id),f(w.id)),this.detach(w.id),this.attach(w.id,w.parentId,w.siblingIndex)}for(var A=0,C=e.moved;A<C.length;A++){var w=C[A],_=this._nodesById.get(w.id);if(_){var I=_.parentId!==w.parentId,F=this.siblingIndexOf(w.id);l(_,w)&&(c(_,w),f(w.id)),this.detach(w.id),this.attach(w.id,w.parentId,w.siblingIndex),(I||this.siblingIndexOf(w.id)!==F)&&h()}}for(var M=0,S=e.childrenUpdated;M<S.length;M++){var R=S[M];if(R.parentId<0){var E=R.childIds.filter(function(e){return i._nodesById.has(e)});if(!o(this._roots,E)){this._roots.length=0,(t=this._roots).push.apply(t,E);for(var P=0,T=this._roots;P<T.length;P++){var v=T[P],x=this._nodesById.get(v);x&&(x.parentId=-1)}h()}}else{var k=this._nodesById.get(R.parentId);if(!k)continue;var E=R.childIds.filter(function(e){return i._nodesById.has(e)});if(!o(k.children,E)){k.children.length=0,(n=k.children).push.apply(n,E);for(var O=0,L=k.children;O<L.length;O++){var v=L[O],x=this._nodesById.get(v);x&&(x.parentId=R.parentId)}h()}}}for(var j=0,D=e.updatedSemantic;j<D.length;j++){var w=D[j],_=this._nodesById.get(w.id);_&&s(_,w)&&(u(_,w),d(w.id))}for(var B=0,N=e.updatedGeometry;B<N.length;B++){var w=N[B],_=this._nodesById.get(w.id);_&&l(_,w)&&(c(_,w),f(w.id))}(r||a)&&(r&&this._semanticVersion++,a&&this._geometryVersion++,this._debug&&this.logDiff(e,r,a))},Object.defineProperty(e.prototype,"debug",{set:function(e){this._debug=e},enumerable:!1,configurable:!0}),e.prototype.logDiff=function(e,t,n){for(var r=["[rive:semantics] semantic v".concat(this._semanticVersion)+(n?" geometry v".concat(this._geometryVersion):"")+(t?"":" (geometry-only)")],a=0,o=e.removed;a<o.length;a++){var s=o[a];r.push("  - removed #".concat(s))}for(var l=0,u=e.added;l<u.length;l++){var c=u[l];r.push("  + added #".concat(c.id," ").concat((0,i.roleName)(c.role))+(c.label?' "'.concat(c.label,'"'):"")+" bounds:(".concat(c.minX.toFixed(1),",").concat(c.minY.toFixed(1),")-(").concat(c.maxX.toFixed(1),",").concat(c.maxY.toFixed(1),")")+" states=[".concat((0,i.stateNames)(c.stateFlags),"]")+" traits=[".concat((0,i.traitNames)(c.traitFlags),"]"))}for(var h=0,d=e.moved;h<d.length;h++){var c=d[h];r.push("  ~ moved #".concat(c.id," → parent=").concat(c.parentId," idx=").concat(c.siblingIndex)+" bounds:(".concat(c.minX.toFixed(1),",").concat(c.minY.toFixed(1),")-(").concat(c.maxX.toFixed(1),",").concat(c.maxY.toFixed(1),")"))}for(var f=0,p=e.childrenUpdated;f<p.length;f++){var m=p[f];r.push("  ↕ children of ".concat(m.parentId<0?"root":"#"+m.parentId,": [").concat(m.childIds.join(", "),"]"))}for(var v=0,b=e.updatedSemantic;v<b.length;v++){var c=b[v];r.push("  ✎ semantic #".concat(c.id," ").concat((0,i.roleName)(c.role))+(c.label?' "'.concat(c.label,'"'):"")+" states=[".concat((0,i.stateNames)(c.stateFlags),"]")+" traits=[".concat((0,i.traitNames)(c.traitFlags),"]"))}for(var y=0,g=e.updatedGeometry;y<g.length;y++){var c=g[y];
1r.push("  ⊞ geometry #".concat(c.id," (").concat(c.minX.toFixed(1),",").concat(c.minY.toFixed(1),")-(").concat(c.maxX.toFixed(1),",").concat(c.maxY.toFixed(1),")"))}console.log(r.join("\n"))},e.prototype.flattened=function(){for(var e=this,t=[],n=function(i,r){var a=e._nodesById.get(i);if(a){t.push({depth:r,node:a});for(var o=0,s=a.children;o<s.length;o++)n(s[o],r+1)}},i=0,r=this._roots;i<r.length;i++)n(r[i],0);return t},e}();function o(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function s(e,t){return e.role!==t.role||e.label!==t.label||e.value!==t.value||e.hint!==t.hint||e.stateFlags!==t.stateFlags||e.traitFlags!==t.traitFlags||e.headingLevel!==t.headingLevel}function l(e,t){return e.minX!==t.minX||e.minY!==t.minY||e.maxX!==t.maxX||e.maxY!==t.maxY}function u(e,t){e.role=t.role,e.label=t.label,e.value=t.value,e.hint=t.hint,e.stateFlags=t.stateFlags,e.traitFlags=t.traitFlags,e.headingLevel=t.headingLevel}function c(e,t){e.minX=t.minX,e.minY=t.minY,e.maxX=t.maxX,e.maxY=t.maxY}},(e,t,n)=>{n.r(t),n.d(t,{SemanticActionType:()=>u,SemanticMode:()=>o,SemanticRole:()=>i,SemanticState:()=>r,SemanticTrait:()=>s,hasState:()=>a,hasTrait:()=>l,roleName:()=>b,stateNames:()=>y,traitNames:()=>g});var i={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},r={None:0,Expanded:1,Selected:2,Checked:4,Mixed:8,Toggled:16,Required:32,Disabled:64,Focused:128,Hidden:256,LiveRegion:512,ReadOnly:1024,Modal:2048,Obscured:4096,Multiline:8192};function a(e,t){return(e&t)!=0}var o={Disabled:"disabled",Enabled:"enabled"},s={None:0,Expandable:1,Selectable:2,Checkable:4,Toggleable:8,Requirable:16,Enablable:32,Focusable:64};function l(e,t){return(e&t)!=0}for(var u={tap:0,increase:1,decrease:2},c={},h=0,d=Object.entries(i);h<d.length;h++){var f=d[h],p=f[0];c[f[1]]=p}var m=Object.entries(r).filter(function(e){return 0!==e[1]}),v=Object.entries(s).filter(function(e){return 0!==e[1]});function b(e){var t;return null!==(t=c[e])&&void 0!==t?t:"unknown(".concat(e,")")}function y(e){if(0===e)return"none";for(var t=[],n=0;n<m.length;n++){var i=m[n],r=i[0];e&i[1]&&t.push(r)}return t.join(", ")||"none"}function g(e){if(0===e)return"none";for(var t=[],n=0;n<v.length;n++){var i=v[n],r=i[0];e&i[1]&&t.push(r)}return t.join(", ")||"none"}},(e,t,n)=>{n.r(t),n.d(t,{AccessibilityOverlay:()=>r});var i=n(8),r=function(){function e(e){var t,n=this;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 n.scheduleReposition()},this.instanceId=e.instanceId,this.fireAction=e.fireAction,this.requestFocus=e.requestFocus,this.clearFocus=e.clearFocus,this.canvas=e.canvas,this.semanticsOptions=e.semanticsOptions,this.allowFocusInterrupt=null!==(t=e.allowFocusInterrupt)&&void 0!==t&&t,this.container=this.createContainer(e.canvas),this.attachPositionObservers()}return e.prototype.getSemanticOverlayContainer=function(){return this.container},e.prototype.attachPositionObservers=function(){var e=this;this.canvasResizeObserver=new ResizeObserver(function(){return e.scheduleReposition()}),this.canvasResizeObserver.observe(this.canvas);var t=this.canvas.parentElement;t&&(this.parentResizeObserver=new ResizeObserver(function(){return e.scheduleReposition()}),this.parentResizeObserver.observe(t)),window.addEventListener("resize",this._onWindowResize),this.observePosition()},e.prototype.observePosition=function(){var e,t=this;if("undefined"!=typeof IntersectionObserver){null===(e=this.positionObserver)||void 0===e||e.disconnect(),this.positionObserver=null;var n=this.canvas.getBoundingClientRect();if(n.width&&n.height){var i=[n.top,window.innerWidth-n.right,window.innerHeight-n.bottom,n.left].map(function(e){return"".concat(-Math.round(e),"px")}
1).join(" "),r=!1;this.positionObserver=new IntersectionObserver(function(){if(!r){r=!0;return}t.scheduleReposition()},{threshold:1,rootMargin:i}),this.positionObserver.observe(this.canvas)}}},e.prototype.scheduleReposition=function(){var e=this;this._geometryDirty=!0,null===this.repositionTimer&&(this.repositionTimer=setTimeout(function(){e.repositionTimer=null,e.syncContainerGeometry(),e.observePosition()},500))},e.prototype.syncContainerGeometry=function(){var e=this.canvas.getBoundingClientRect(),t=this.canvas.offsetTop,n=this.canvas.offsetLeft;(e.width!==this.lastCanvasPositioning.width||e.height!==this.lastCanvasPositioning.height||t!==this.lastCanvasPositioning.offsetTop||n!==this.lastCanvasPositioning.offsetLeft)&&(this.container.style.top=t+"px",this.container.style.left=n+"px",this.container.style.width=e.width+"px",this.container.style.height=e.height+"px",this.container.tabIndex=-1,this.lastCanvasPositioning.width=e.width,this.lastCanvasPositioning.height=e.height,this.lastCanvasPositioning.offsetTop=t,this.lastCanvasPositioning.offsetLeft=n)},e.prototype.createContainer=function(e){var t,n,i=document.createElement("div");i.id="rive-a11y-".concat(this.instanceId),i.setAttribute("role","region"),i.setAttribute("aria-label",null!==(n=null===(t=this.semanticsOptions)||void 0===t?void 0:t.riveCanvasLabel)&&void 0!==n?n:"Rive animation");var r=e.getBoundingClientRect();return i.style.cssText=["position:absolute","top:".concat(e.offsetTop,"px"),"left:".concat(e.offsetLeft,"px"),"width:".concat(r.width,"px"),"height:".concat(r.height,"px"),"overflow:hidden","pointer-events:none","opacity:0"].join(";"),e.insertAdjacentElement("afterend",i),i},e.prototype.needsUpdate=function(e){var t=e.semanticVersion!==this.lastSemanticVersion,n=e.geometryVersion!==this.lastGeometryVersion,i=this._geometryDirty||!this.transformContainer;return t||n||i?{semanticChanged:t,nodeGeometryChanged:n,layoutChanged:i}:null},e.prototype.update=function(e,t,n,i,r){var a=null!=r?r:this.needsUpdate(e);!a&&t&&(a={semanticChanged:!1,nodeGeometryChanged:!1,layoutChanged:!0}),a&&this.performUpdate(e,t,n,i,a)},e.prototype.performUpdate=function(e,t,n,i,r){var a,o=r.semanticChanged,s=r.nodeGeometryChanged,l=e.semanticVersion-this.lastSemanticVersion>1;if(this.lastSemanticVersion=e.semanticVersion,this.lastGeometryVersion=e.geometryVersion,this.isUpdating=!0,this._artboardBounds=i,t&&(this.syncContainerGeometry(),this.syncTransformContainer(t,n,i),this._geometryDirty=!1),o){var u=null!==(a=this.transformContainer)&&void 0!==a?a:this.container,c=new Set;this.rebuildChildren(u,e.roots,e,0,0,c,l);var h=[];this.elements.forEach(function(e,t){c.has(t)||h.push(t)});for(var d=0;d<h.length;d++){var f=h[d],p=this.elements.get(f);p&&p.parentNode&&p.parentNode.removeChild(p),this.elements.delete(f);var m=this.descElements.get(f);m&&m.parentNode&&m.parentNode.removeChild(m),this.descElements.delete(f)}}else s&&this.updateGeometryForChangedNodes(e);this.flushTextGeometry(),this.isUpdating=!1},e.prototype.destroy=function(){var e,t,n;null!==this.repositionTimer&&(clearTimeout(this.repositionTimer),this.repositionTimer=null),window.removeEventListener("resize",this._onWindowResize),null===(e=this.canvasResizeObserver)||void 0===e||e.disconnect(),null===(t=this.parentResizeObserver)||void 0===t||t.disconnect(),null===(n=this.positionObserver)||void 0===n||n.disconnect(),this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.elements.clear(),this.descElements.clear(),this.pendingTextGeometry.length=0},e.prototype.rebuildChildren=function(e,t,n,r,a,o,s){for(var l=0;l<t.length;l++){var u=t[l],c=n.nodeById(u);if(c){o.add(u);var h=this.elements.get(u),d=!h;h||(h=this.createElement(c),this.elements.set(u,h)),(d||s||n.semanticChangedIds.has(u))&&this.applyAttributes(h,c),this.applyPosition(h,c,r,a);var f=e.children[l];if(f!==h&&(f?e.insertBefore(h,f):e.appendChild(h)),(0,i.hasTrait)(c.traitFlags,i.SemanticTrait.Focusable)&&(0,i.hasState)(c.stateFlags,i.SemanticState.Focused)){var p=document.activeElement,m=null==p?void 0:p.closest('[aria-modal="true"]'),v=!!m&&this.container.contains(m)&&!m.contains(h);p!==h&&!v&&this.canMoveFocus()&&h.focus()}c.children.length>0&&this.rebuildChildren(h,c.children,n,c.minX,c.minY,o,s),d&&this.autoFocusDialogOnAppear(h,c,n)}}},e.prototype.updateGeometryForChangedNodes=function(e){for(var t,n,i=0,r=Array.from(e.geometryChangedIds);i<r.length;i++){var a=r[i],o=e.nodeById(a);if(o){var s=0,l=0,u=null!==(t=this.transformContainer)&&void 0!==t?t:this.container;if(o.parentId>=0){var c=e.nodeById(o.parentId);c&&(s=c.minX,l=c.minY,u=null!==(n=this.elements.get(o.parentId))&&void 0!==n?n:u)}this.updateNodeGeometrySubtree(e,a,s,l,u)}}},e.prototype.updateNodeGeometrySubtree=function(e,t,n,i,r){var a=e.n
1odeById(t);if(a){var o=this.elements.get(t);if(o){this.applyPosition(o,a,n,i);for(var s=0,l=a.children;s<l.length;s++){var u=l[s];this.updateNodeGeometrySubtree(e,u,a.minX,a.minY,o)}}}},e.prototype.canMoveFocus=function(){var e=document.activeElement;return e===this.canvas||this.container.contains(e)||this.allowFocusInterrupt},e.prototype.autoFocusDialogOnAppear=function(e,t,n){if(b(t.role,t.stateFlags)&&this.canMoveFocus()){var i,r=document.activeElement;if(!(r&&r!==e&&e.contains(r))){var a=null!==(i=this.routeDefaultFocusTarget(t,n))&&void 0!==i?i:e;a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),document.activeElement!==a&&a.focus({preventScroll:!0})}}},e.prototype.routeDefaultFocusTarget=function(e,t){for(var n,r=0,a=e.children;r<a.length;r++){var o=a[r],s=t.nodeById(o);if(s){var l=this.elements.get(o);if(l&&(v(s.role)||(0,i.hasTrait)(s.traitFlags,i.SemanticTrait.Focusable)))return l;if(s.children.length>0||!s.label){var u=this.routeDefaultFocusTarget(s,t);if(u)return u;continue}if(l)return null!==(n=l.querySelector(":scope > span"))&&void 0!==n?n:l}}return null},Object.defineProperty(e.prototype,"nodeIdPrefix",{get:function(){return"rive-".concat(this.instanceId,"-sem-")},enumerable:!1,configurable:!0}),e.prototype.nodeIdFromElement=function(e){if(!e.id.startsWith(this.nodeIdPrefix))return null;var t=e.id.slice(this.nodeIdPrefix.length);if(!t)return null;var n=Number(t);return Number.isNaN(n)?null:n},e.prototype.createElement=function(e){var t=function(e){switch(e){case i.SemanticRole.link:return"a";case i.SemanticRole.text:default:return"div"}}(e.role),n=document.createElement(t);if(n.id="".concat(this.nodeIdPrefix).concat(e.id),n.style.cssText=h,e.role===i.SemanticRole.text){var r=document.createElement("span");r.style.cssText=d,n.appendChild(r)}return this.attachActionHandlers(n,e),n},e.prototype.attachRovingNav=function(e,t){var n=this;e.addEventListener("keydown",function(r){var a=null;if("ArrowRight"===r.key||"ArrowDown"===r.key?a="next":"ArrowLeft"===r.key||"ArrowUp"===r.key?a="prev":t.includeHomeEnd&&"Home"===r.key?a="first":t.includeHomeEnd&&"End"===r.key&&(a="last"),a){r.preventDefault();var o=t.members(),s=o.indexOf(e);if(!(s<0)){var l=o.length,u="next"===a?o[(s+1)%l]:"prev"===a?o[(s-1+l)%l]:"first"===a?o[0]:o[l-1];if(u&&u!==e){u.focus();var c=n.nodeIdFromElement(u);null!==c&&n.fireAction(c,i.SemanticActionType.tap)}}}})},e.prototype.attachActionHandlers=function(e,t){var n=this,r=t.role,a=t.id;if(function(e){switch(e){case i.SemanticRole.button:case i.SemanticRole.link:case i.SemanticRole.checkbox:case i.SemanticRole.switchControl:case i.SemanticRole.tab:case i.SemanticRole.radioButton:return!0;default:return!1}}(r)){e.addEventListener("click",function(){n.fireAction(a,i.SemanticActionType.tap)});var o=r===i.SemanticRole.link?["Enter"]:["Enter"," "];e.addEventListener("keydown",function(e){o.includes(e.key)&&(e.preventDefault(),n.fireAction(a,i.SemanticActionType.tap))})}r===i.SemanticRole.slider&&e.addEventListener("keydown",function(e){"ArrowRight"===e.key||"ArrowUp"===e.key?(e.preventDefault(),n.fireAction(a,i.SemanticActionType.increase)):("ArrowLeft"===e.key||"ArrowDown"===e.key)&&(e.preventDefault(),n.fireAction(a,i.SemanticActionType.decrease))}),r===i.SemanticRole.tab&&this.attachRovingNav(e,{includeHomeEnd:!0,members:function(){var t=e.parentElement;return t?Array.from(t.children).filter(function(e){return e instanceof HTMLElement&&"tab"===e.getAttribute("role")}):[]}}),r===i.SemanticRole.radioButton&&this.attachRovingNav(e,{includeHomeEnd:!1,members:function(){var t,n=null!==(t=e.closest('[role="radiogroup"]'))&&void 0!==t?t:e.parentElement;return n?Array.from(n.querySelectorAll('[role="radio"]')):[]}}),(0,i.hasTrait)(t.traitFlags,i.SemanticTrait.Focusable)&&e.addEventListener("focus",function(){n.requestFocus(a)})},e.prototype.applyAttributes=function(e,t){var n,r,h,d=t.role,y=t.stateFlags,g=t.traitFlags,w=function(e){switch(e){case i.SemanticRole.none:return"group";case i.SemanticRole.button:return"button";case i.SemanticRole.link:return null;case i.SemanticRole.checkbox:return"checkbox";case i.SemanticRole.switchControl:return"switch";case i.SemanticRole.slider:return"slider";case i.SemanticRole.textField:return"textbox";case i.SemanticRole.image:return"img";case i.SemanticRole.group:return"group";case i.SemanticRole.list:return"list";case i.SemanticRole.listItem:return"listitem";case i.SemanticRole.tab:return"tab";case i.SemanticRole.tabList:return"tablist";case i.SemanticRole.dialog:return"dialog";case i.SemanticRole.alertDialog:return"alertdialog";case i.SemanticRole.radioGroup:return"radiogroup";case i.SemanticRole.radioButton:return"radio";case i.SemanticRole.text:default:return null}}(d);if(w?f(e,"role",w):p(e,"role"),d===i.SemanticRole.link&&f(e,"role","link"),v(d)||(0,i.hasTrait)(g,i.SemanticTrait.Focusable)||d===i.SemanticRole.listItem?f(e,"tabindex","-1"):p(e,"tabindex"),t.label?f(e,"aria-label",t.label):p(e,"aria-label"),d===i.SemanticRole.slider){if(t.value){var _=parseFloat(t.value);Number.isFinite(_)?f(e,"aria-valuenow",String(_)):p(e,"aria-valuenow"),f(e,"aria-valuetext",t.value)}else p(e,"aria-valuenow"),p(e,"aria-valuetext");f(e,"aria-orientation","horizontal"),m(e,"aria-readonly",(0,i.hasState)(y,i.SemanticState.ReadOnly))}else p(e,"aria-valuenow"),p(e,"aria-valuetext"),p(e,"aria-orientation"),p(e,"aria-readonly");if(t.hint){var A="rive-".concat(this.instanceId,"-desc-").concat(t.id),C=this.descElements.get(t.id);C||((C=document.createElement("span")).id=A,C.style.cssText=c,this.container.appendChild(C),this.descElements.set(t.id,C)),C.textContent!==t.hint&&(C.textContent=t.hint),f(e,"aria-describedby",A)}
1else{p(e,"aria-describedby");var I=this.descElements.get(t.id);I&&(I.parentNode&&I.parentNode.removeChild(I),this.descElements.delete(t.id))}if(d===i.SemanticRole.text){var F=null!==(n=e.querySelector(":scope > span"))&&void 0!==n?n:e,M=null!==(r=t.label)&&void 0!==r?r:"";F.textContent!==M&&(F.textContent=M),p(e,"aria-label"),t.headingLevel>0?(f(e,"role","heading"),f(e,"aria-level",String(t.headingLevel))):p(e,"aria-level")}(0,i.hasTrait)(g,i.SemanticTrait.Expandable)&&a.has(d)?m(e,"aria-expanded",(0,i.hasState)(y,i.SemanticState.Expanded)):p(e,"aria-expanded"),d===i.SemanticRole.tab?m(e,"aria-selected",(0,i.hasState)(y,i.SemanticState.Selected)):(0,i.hasTrait)(g,i.SemanticTrait.Selectable)&&o.has(d)?m(e,"aria-selected",(0,i.hasState)(y,i.SemanticState.Selected)):p(e,"aria-selected"),(0,i.hasTrait)(g,i.SemanticTrait.Checkable)&&s.has(d)?(0,i.hasState)(y,i.SemanticState.Mixed)&&d!==i.SemanticRole.switchControl?f(e,"aria-checked","mixed"):m(e,"aria-checked",(0,i.hasState)(y,i.SemanticState.Checked)):p(e,"aria-checked"),(0,i.hasTrait)(g,i.SemanticTrait.Toggleable)?(l.has(d)?m(e,"aria-pressed",(0,i.hasState)(y,i.SemanticState.Toggled)):p(e,"aria-pressed"),d===i.SemanticRole.switchControl&&m(e,"aria-checked",(0,i.hasState)(y,i.SemanticState.Toggled))):p(e,"aria-pressed"),(0,i.hasTrait)(g,i.SemanticTrait.Requirable)&&u.has(d)?m(e,"aria-required",(0,i.hasState)(y,i.SemanticState.Required)):p(e,"aria-required"),(0,i.hasTrait)(g,i.SemanticTrait.Enablable)?m(e,"aria-disabled",(0,i.hasState)(y,i.SemanticState.Disabled)):p(e,"aria-disabled");var S=d===i.SemanticRole.image&&!t.label;if((0,i.hasState)(y,i.SemanticState.Hidden)||(0,i.hasState)(y,i.SemanticState.Obscured)||S?f(e,"aria-hidden","true"):p(e,"aria-hidden"),(0,i.hasState)(y,i.SemanticState.LiveRegion)?f(e,"aria-live","polite"):p(e,"aria-live"),d===i.SemanticRole.textField){if(m(e,"aria-readonly",(0,i.hasState)(y,i.SemanticState.ReadOnly)),m(e,"aria-multiline",(0,i.hasState)(y,i.SemanticState.Multiline)),0===t.children.length){var R=null!==(h=t.value)&&void 0!==h?h:"";e.textContent!==R&&(e.textContent=R)}}else p(e,"aria-multiline");b(d,y)?f(e,"aria-modal","true"):p(e,"aria-modal")},e.prototype.applyPosition=function(e,t,n,r){var a=this._artboardBounds,o=Math.max(t.minX,a.minX),s=Math.max(t.minY,a.minY),l=Math.min(t.maxX,a.maxX),u=Math.min(t.maxY,a.maxY),c=Math.round(Math.max(0,l-o))+"px",h=Math.round(Math.max(0,u-s))+"px",d=Math.round(o-n)+"px",f=Math.round(s-r)+"px";e.style.left!==d&&(e.style.left=d),e.style.top!==f&&(e.style.top=f),e.style.width!==c&&(e.style.width=c),e.style.height!==h&&(e.style.height=h),e.style.transform&&(e.style.transform=""),t.role===i.SemanticRole.text&&this.pendingTextGeometry.push(e)},e.prototype.flushTextGeometry=function(){if(0!==this.pendingTextGeometry.length){for(var e,t=[],n=0,i=this.pendingTextGeometry;n<i.length;n++){var r=i[n],a=null!==(e=r.querySelector(":scope > span"))&&void 0!==e?e:r,o="".concat(r.style.width,"|").concat(r.style.height,"|").concat(a.textContent);this.textGeometryKeys.get(r)!==o&&(a.style.width="auto",a.style.height="auto",a.style.transformOrigin="0 0",a.style.transform="",t.push({host:r,span:a,key:o}))}this.pendingTextGeometry.length=0;for(var s=t.map(function(e){var t=e.host,n=e.span,i=t.getBoundingClientRect(),r=n.getBoundingClientRect();if(r.width>0&&r.height>0){var a=i.width/r.width,o=i.height/r.height;return"scale(".concat(a,", ").concat(o,")")}return"none"}),l=0;l<t.length;l++){var u=t[l],r=u.host,a=u.span,o=u.key;a.style.transform=s[l],this.textGeometryKeys.set(r,o)}}},e.prototype.syncTransformContainer=function(e,t,n){if(!this.transformContainer){var i=document.createElement("div");i.style.cssText="position:absolute;top:0;left:0;overflow:visible;pointer-events:none;transform-origin:0 0",this.container.appendChild(i),this.transformContainer=i}var r=n.maxX-n.minX,a=n.maxY-n.minY;this.transformContainer.style.width=Math.round(r)+"px",this.transformContainer.style.height=Math.round(a)+"px";var o=1/(t||1),s=e.xx*o,l=e.xy*o,u=e.yx*o,c=e.yy*o,h=e.tx*o,d=e.ty*o;this.transformContainer.style.transform="matrix(".concat(s,",").concat(l,",").concat(u,",").concat(c,",").concat(h,",").concat(d,")")},e}(),a=new Set([i.SemanticRole.button,i.SemanticRole.link,i.SemanticRole.checkbox,i.SemanticRole.switchControl,i.SemanticRole.tab]),o=new Set([i.SemanticRole.tab]),s=new Set([i.SemanticRole.checkbox,i.SemanticRole.radioButton,i.SemanticRole.switchControl]),l=new Set([i.SemanticRole.button]),u=new Set([i.SemanticRole.checkbox,i.SemanticRole.textField,i.SemanticRole.radioGroup]),c="position:absolute;width:1px;height:1px;overflow:hidden;pointer-events:none;left:-9999px",h="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",d="display:inline-block;white-space:nowrap;pointer-events:none";function f(e,t,n){e.getAttribute(t)!==n&&e.setAttribute(t,n)}function p(e,t){e.hasAttribute(t)&&e.removeAttribute(t)}function m(e,t,n){f(e,t,n?"true":"false")}function v(e){switch(e){case i.SemanticRole.button:case i.SemanticRole.link:case i.SemanticRole.checkbox:case i.SemanticRole.switchControl:case i.SemanticRole.slider:case i.SemanticRole.tab:case i.SemanticRole.radioButton:case i.SemanticRole.textField:return!0;default:return!1}}function b(e,t){return e===i.SemanticRole.alertDialog||e===i.SemanticRole.dialog&&(0,i.hasState)(t,i.SemanticState.Modal)}},(e,t,n)=>{n.r(t),n.d(t,{AudioAssetWrapper:()=>o.AudioAssetWrapper,AudioWrapper:()=>o.AudioWrapper,BLANK_URL:()=>a.BLANK_URL,CustomFileAssetLoaderWrapper:()=>o.CustomFileAssetLoaderWrapper,FileAssetWrapper:()=>o.FileAssetWrapper,FileFinalizer:()=>o.FileFinalizer,FocusSessionState:()=>r.FocusSessionState,FontAssetWrapper:()=>o.FontAssetWrapper,FontWrapper:()=>o.FontWrapper,ImageAssetWrapper:()=>o.ImageAssetWrapper,ImageWrapper:()=>o.ImageWrapper,KeyboardInteractions:()=>r.KeyboardInteractions,RiveFont:()=>s.RiveFont,createFinalization:()=>o.createFinalization,finalizationRegistry:()=>o.finalizationRegistry,registerTouchInteractions:()=>i.registerTouchInteractions,sanitizeUrl:()=>a.sanitizeUrl});var i=n(11),r=n(12),a=n(13),o=n(14),s=n(15)},(e,t,n)=>{n.r(t),n.d(t,{registerTouchInteractions:()=>o});var i=void 0,r=function(e,t,n){var i,r=[];if(t)for(var a=0;a<e.length;a++){var o=e[a];r.push({clientX:o.clientX,clientY:o.clientY,identifier:o.identifier})}else{var s=null!==n?null!==(i=Array.from(e).find(function(e){return e.identifier===n}))&&void 0!==i?i:null:e[0];
1s&&r.push({clientX:s.clientX,clientY:s.clientY,identifier:s.identifier})}return r},a=function(e,t,n,i){var a;return(null===(a=e.changedTouches)||void 0===a?void 0:a.length)?(!t&&["touchstart","touchmove"].includes(e.type)&&e.preventDefault(),r(e.changedTouches,n,i)):[{clientX:e.clientX,clientY:e.clientY,identifier:0}]},o=function(e){var t=e.canvas,n=e.artboard,r=e.stateMachines,o=void 0===r?[]:r,s=e.renderer,l=e.rive,u=e.fit,c=e.alignment,h=e.isTouchScrollEnabled,d=void 0!==h&&h,f=e.dispatchPointerExit,p=void 0===f||f,m=e.enableMultiTouch,v=void 0!==m&&m,b=e.layoutScaleFactor,y=void 0===b?1:b,g=e.advanceAndDrain;if(!t||!o.length||!s||!l||!n||"undefined"==typeof window)return null;var w=null,_=!1,A=null,C=function(){A=null},I=(function(e){if(_&&e instanceof MouseEvent){"mouseup"==e.type&&(_=!1);return}_=d&&"touchend"===e.type&&"touchstart"===w,w=e.type;var t,i=e.currentTarget.getBoundingClientRect();if(!v&&"touchstart"===e.type&&null===A){var r=null===(t=e.changedTouches)||void 0===t?void 0:t[0];r&&(A=r.identifier)}var s=a(e,d,v,v?null:A),h=l.computeAlignment(u,c,{minX:0,minY:0,maxX:i.width,maxY:i.height},n.bounds,y),f=new l.Mat2D;switch(h.invert(f),s.forEach(function(e){var t=e.clientX,n=e.clientY;if(t||n){var r=t-i.left,a=n-i.top,o=new l.Vec2D(r,a),s=l.mapXY(f,o),u=s.x(),c=s.y();e.transformedX=u,e.transformedY=c,s.delete(),o.delete()}}),f.delete(),h.delete(),e.type){case"mouseout":for(var m=function(e){p?s.forEach(function(t){e.pointerExit(t.transformedX,t.transformedY,t.identifier)}):s.forEach(function(t){e.pointerMove(t.transformedX,t.transformedY,t.identifier)})},b=0;b<o.length;b++){var C=o[b];m(C)}break;case"touchmove":case"mouseover":case"mousemove":for(var I=function(e){s.forEach(function(t){e.pointerMove(t.transformedX,t.transformedY,t.identifier)})},F=0;F<o.length;F++){var C=o[F];I(C)}break;case"touchstart":case"mousedown":for(var M=function(e){s.forEach(function(t){e.pointerDown(t.transformedX,t.transformedY,t.identifier)})},S=0;S<o.length;S++){var C=o[S];M(C)}g(0);break;case"touchend":for(var R=function(e){s.forEach(function(t){e.pointerUp(t.transformedX,t.transformedY,t.identifier),e.pointerExit(t.transformedX,t.transformedY,t.identifier)})},E=0;E<o.length;E++){var C=o[E];R(C)}g(0),!v&&s.some(function(e){return e.identifier===A})&&(A=null);break;case"mouseup":for(var P=function(e){s.forEach(function(t){e.pointerUp(t.transformedX,t.transformedY,t.identifier)})},T=0;T<o.length;T++){var C=o[T];P(C)}g(0)}}).bind(i);return t.addEventListener("mouseover",I),t.addEventListener("mouseout",I),t.addEventListener("mousemove",I),t.addEventListener("mousedown",I),t.addEventListener("mouseup",I),t.addEventListener("touchmove",I,{passive:d}),t.addEventListener("touchstart",I,{passive:d}),t.addEventListener("touchend",I),t.addEventListener("touchcancel",C),function(){t.removeEventListener("mouseover",I),t.removeEventListener("mouseout",I),t.removeEventListener("mousemove",I),t.removeEventListener("mousedown",I),t.removeEventListener("mouseup",I),t.removeEventListener("touchmove",I),t.removeEventListener("touchstart",I),t.removeEventListener("touchend",I),t.removeEventListener("touchcancel",C)}}},(e,t,n)=>{n.r(t),n.d(t,{FocusSessionState:()=>r,KeyboardInteractions:()=>a}),(i=r||(r={})).NotFocused="notFocused",i.EntryPending="entryPending",i.RiveFocused="riveFocused";var i,r,a=function(){function e(e){var t,n=e.canvas,i=e.stateMachine,a=e.hasFocusNodes,o=e.getOverlayElement,s=this;this.focusSessionState=r.NotFocused,this.canvasHasFocus=!1,this.focusDomainReleased=!1,this.currentOverlayElement=null,this.onCanvasFocus=function(e){s.syncOverlayListener(),s.canvasHasFocus=!0,s.focusDomainReleased=!1,s.hasFocusNodes&&!s.mainSm.focusState().hasFocus&&(s.focusSessionState=r.EntryPending,s.isKeyboardDrivenFocus()&&(s.cameFromBeforeCanvas(e.relatedTarget)?s.mainSm.focusNext():s.mainSm.focusPrevious())&&(s.focusSessionState=r.RiveFocused))},this.onCanvasBlur=function(e){s.focusSessionState=r.NotFocused,s.canvasHasFocus=!1},this.onOverlayFocusIn=function(e){s.isInOverlay(e.target)&&(s.focusDomainReleased=!1)},this.onFocusDomainHostFocusIn=function(e){s.syncOverlayListener()},this.onKeyDown=function(e){s.syncOverlayListener(),!s.focusDomainReleased&&s.shouldRiveHandleKeyEvent(e)&&"Tab"===e.code&&s.hasFocusNodes&&((e.shiftKey?s.mainSm.focusPrevious():s.mainSm.focusNext())?(s.focusSessionState=r.RiveFocused,e.preventDefault()):(s.focusSessionState=r.NotFocused,s.focusDomainReleased=!0,s.canvasHasFocus=!1),s.syncOverlayListener())},this.canvas=n,this.mainSm=i,this.hasFocusNodes=a,this.getOverlayElement=o,this.focusDomainHost=null!==(t=n.parentElement)&&void 0!==t?t:document,n.addEventListener("focus",this.onCanvasF
1ocus),n.addEventListener("blur",this.onCanvasBlur),n.addEventListener("keydown",this.onKeyDown),this.focusDomainHost.addEventListener("focusin",this.onFocusDomainHostFocusIn),this.syncOverlayListener()}return e.prototype.setFocusSessionState=function(e){this.focusSessionState=e},e.prototype.notifyRiveFocused=function(){this.focusSessionState=r.RiveFocused},e.prototype.shouldRiveHandleKeyEvent=function(e){if(this.isInFocusDomain(document.activeElement)||this.isInOverlay(e.target))return!0;var t=this.focusSessionState!==r.NotFocused,n=e.target===this.canvas;return t&&(this.canvasHasFocus||n)},e.prototype.isInFocusDomain=function(e){return e===this.canvas||this.isInOverlay(e)},e.prototype.isInOverlay=function(e){var t,n,i;return e instanceof Node&&null!==(i=null===(n=null===(t=this.getOverlayElement)||void 0===t?void 0:t.call(this))||void 0===n?void 0:n.contains(e))&&void 0!==i&&i},e.prototype.syncOverlayListener=function(){var e,t,n,i,r,a,o=null!==(t=null===(e=this.getOverlayElement)||void 0===e?void 0:e.call(this))&&void 0!==t?t:null;o!==this.currentOverlayElement&&(null===(n=this.currentOverlayElement)||void 0===n||n.removeEventListener("focusin",this.onOverlayFocusIn),null===(i=this.currentOverlayElement)||void 0===i||i.removeEventListener("keydown",this.onKeyDown,!0),this.currentOverlayElement=o,null===(r=this.currentOverlayElement)||void 0===r||r.addEventListener("focusin",this.onOverlayFocusIn),null===(a=this.currentOverlayElement)||void 0===a||a.addEventListener("keydown",this.onKeyDown,!0))},e.prototype.isKeyboardDrivenFocus=function(){try{return this.canvas.matches(":focus-visible")}catch(e){return!1}},e.prototype.cameFromBeforeCanvas=function(e){if(!e)return!0;var t=this.canvas.compareDocumentPosition(e);return!!(t&Node.DOCUMENT_POSITION_PRECEDING)||!(t&Node.DOCUMENT_POSITION_FOLLOWING)},e.prototype.cleanup=function(){var e,t;this.canvas.removeEventListener("focus",this.onCanvasFocus),this.canvas.removeEventListener("blur",this.onCanvasBlur),this.canvas.removeEventListener("keydown",this.onKeyDown),this.focusDomainHost.removeEventListener("focusin",this.onFocusDomainHostFocusIn),null===(e=this.currentOverlayElement)||void 0===e||e.removeEventListener("focusin",this.onOverlayFocusIn),null===(t=this.currentOverlayElement)||void 0===t||t.removeEventListener("keydown",this.onKeyDown,!0)},e}()},(e,t,n)=>{n.r(t),n.d(t,{BLANK_URL:()=>u,sanitizeUrl:()=>c});var i=/^([^\w]*)(javascript|data|vbscript)/im,r=/&#(\w+)(^\w|;)?/g,a=/&(newline|tab);/gi,o=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,s=/^.+(:|&colon;)/gim,l=[".","/"],u="about:blank";function c(e){if(!e)return u;var t=e.replace(o,"").replace(r,function(e,t){return String.fromCharCode(t)}).replace(a,"").replace(o,"").trim();if(!t)return u;if(l.indexOf(t[0])>-1)return t;var n=t.match(s);if(!n)return t;var c=n[0];return i.test(c)?u:t}},(e,t,n)=>{n.r(t),n.d(t,{AudioAssetWrapper:()=>p,AudioWrapper:()=>u,CustomFileAssetLoaderWrapper:()=>h,FileAssetWrapper:()=>d,FileFinalizer:()=>a,FontAssetWrapper:()=>m,FontWrapper:()=>c,ImageAssetWrapper:()=>f,ImageWrapper:()=>l,createFinalization:()=>y,finalizationRegistry:()=>b});var i,r=(i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(){function e(e){this.selfUnref=!1,this._file=e}return e.prototype.unref=function(){this._file&&this._file.unref()},e}(),o=function(){function e(e){this._finalizableObject=e}return e.prototype.unref=function(){this._finalizableObject.unref()},e}(),s=function(){function e(){this.selfUnref=!1}return e.prototype.unref=function(){},e}(),l=function(e){function t(t){var n=e.call(this)||this;return n._nativeImage=t,n}return r(t,e),Object.defineProperty(t.prototype,"nativeImage",{get:function(){return this._nativeImage}
1,enumerable:!1,configurable:!0}),t.prototype.unref=function(){this.selfUnref&&this._nativeImage.unref()},t}(s),u=function(e){function t(t){var n=e.call(this)||this;return n._nativeAudio=t,n}return r(t,e),Object.defineProperty(t.prototype,"nativeAudio",{get:function(){return this._nativeAudio},enumerable:!1,configurable:!0}),t.prototype.unref=function(){this.selfUnref&&this._nativeAudio.unref()},t}(s),c=function(e){function t(t){var n=e.call(this)||this;return n._nativeFont=t,n}return r(t,e),Object.defineProperty(t.prototype,"nativeFont",{get:function(){return this._nativeFont},enumerable:!1,configurable:!0}),t.prototype.unref=function(){this.selfUnref&&this._nativeFont.unref()},t}(s),h=function(){function e(e,t){this._assetLoaderCallback=t,this.assetLoader=new e.CustomFileAssetLoader({loadContents:this.loadContents.bind(this)})}return e.prototype.loadContents=function(e,t){var n;if(e.isImage)n=new f(e);else if(e.isAudio)n=new p(e);else{if(!e.isFont)return!1;n=new m(e)}return this._assetLoaderCallback(n,t)},e}(),d=function(){function e(e){this._nativeFileAsset=e}return e.prototype.decode=function(e){this._nativeFileAsset.decode(e)},Object.defineProperty(e.prototype,"name",{get:function(){return this._nativeFileAsset.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fileExtension",{get:function(){return this._nativeFileAsset.fileExtension},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uniqueFilename",{get:function(){return this._nativeFileAsset.uniqueFilename},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAudio",{get:function(){return this._nativeFileAsset.isAudio},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isImage",{get:function(){return this._nativeFileAsset.isImage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isFont",{get:function(){return this._nativeFileAsset.isFont},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cdnUuid",{get:function(){return this._nativeFileAsset.cdnUuid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nativeFileAsset",{get:function(){return this._nativeFileAsset},enumerable:!1,configurable:!0}),e}(),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.setRenderImage=function(e){this._nativeFileAsset.setRenderImage(e.nativeImage)},t}(d),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.setAudioSource=function(e){this._nativeFileAsset.setAudioSource(e.nativeAudio)},t}(d),m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.setFont=function(e){this._nativeFileAsset.setFont(e.nativeFont)},t}(d),v=function(){function e(e){}return e.prototype.register=function(e){e.selfUnref=!0},e.prototype.unregister=function(e){},e}(),b=new("undefined"!=typeof FinalizationRegistry?FinalizationRegistry:v)(function(e){null==e||e.unref()}),y=function(e,t){var n=new o(t);b.register(e,n)}},(e,t,n)=>{n.r(t),n.d(t,{RiveFont:()=>r});var i=n(3),r=function(){function e(){}return e.setFallbackFontCallback=function(t){e._fallbackFontCallback=null!=t?t:null,e._wireFallbackProc()},e._fontToPtr=function(e){if(null==e)return null;var t,n=e.nativeFont,i=null===(t=null==n?void 0:n.ptr)||void 0===t?void 0:t.call(n);return null!=i?i:null},e._getFallbackPtr=function(t,n){return n<0||n>=t.length?null:e._fontToPtr(t[n])},e._wireFallbackProc=function(){i.RuntimeLoader.getInstance(function(t){var n=e._fallbackFontCallback;n?t.setFallbackFontCallback(function(t,i,r){var a=n(t,r);return a?Array.isArray(a)?e._getFallbackPtr(a,i):0===i?e._fontToPtr(a):null:null}):t.setFallbackFontCallback(null)})},e._fallbackFontCallback=null,e}()}],ep={};function em(e){var t=ep[e];if(void 0!==t)return t.exports;var n=ep[e]={exports:{}};return ef[e](n,n.exports,em),n.exports}em.d=(e,t)=>{for(var n in t)em.o(t,n)&&!em.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},em.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),em.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}
1),Object.defineProperty(e,"__esModule",{value:!0})};var ev={};return em.r(ev),em.d(ev,{Alignment:()=>t,DataEnum:()=>$,DataType:()=>l,DrawOptimizationOptions:()=>n,EventType:()=>a,Fit:()=>e,Layout:()=>I,LoopType:()=>o,Rive:()=>z,RiveEventType:()=>r,RiveFile:()=>H,RiveFont:()=>f.RiveFont,RuntimeLoader:()=>h.RuntimeLoader,SemanticMode:()=>d.SemanticMode,StateMachineInput:()=>M,StateMachineInputType:()=>i,Testing:()=>eu,ViewModel:()=>X,ViewModelInstance:()=>q,ViewModelInstanceArtboard:()=>eo,ViewModelInstanceAssetFont:()=>ea,ViewModelInstanceAssetImage:()=>er,ViewModelInstanceBoolean:()=>Z,ViewModelInstanceColor:()=>ei,ViewModelInstanceEnum:()=>et,ViewModelInstanceList:()=>en,ViewModelInstanceNumber:()=>Q,ViewModelInstanceString:()=>J,ViewModelInstanceTrigger:()=>ee,ViewModelInstanceValue:()=>K,decodeAudio:()=>ec,decodeFont:()=>ed,decodeImage:()=>eh}),c=em(1),h=em(3),d=em(6),f=em(10),p=function(e,t){return(p=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},m=function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},v=function(){return(v=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},b=function(e,t,n,i){return new(n||(n=Promise))(function(r,a){function o(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(o,s)}l((i=i.apply(e,t||[])).next())})},y=function(e,t){var n,i,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},g=function(e,t,n){if(n||2==arguments.length)for(var i,r=0,a=t.length;r<a;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},w=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isHandledError=!0,t}return m(t,e),t}(Error),(_=e||(e={})).Cover="cover",_.Contain="contain",_.Fill="fill",_.FitWidth="fitWidth",_.FitHeight="fitHeight",_.None="none",_.ScaleDown="scaleDown",_.Layout="layout",(A=t||(t={})).Center="center",A.TopLeft="topLeft",A.TopCenter="topCenter",A.TopRight="topRight",A.CenterLeft="centerLeft",A.CenterRight="centerRight",A.BottomLeft="bottomLeft",A.BottomCenter="bottomCenter",A.BottomRight="bottomRight",(C=n||(n={})).AlwaysDraw="alwaysDraw",C.DrawOnChanged="drawOnChanged",I=function(){function n(n){var i,r,a,o,s,l,u;this.fit=null!==(i=null==n?void 0:n.fit)&&void 0!==i?i:e.Contain,this.alignment=null!==(r=null==n?void 0:n.alignment)&&void 0!==r?r:t.Center,this.layoutScaleFactor=null!==(a=null==n?void 0:n.layoutScaleFactor)&&void 0!==a?a:1,this.minX=null!==(o=null==n?void 0:n.minX)&&void 0!==o?o:0,this.minY=null!==(s=null==n?void 0:n.minY)&&void 0!==s?s:0,this.maxX=null!==(l=null==n?void 0:n.maxX)&&void 0!==l?l:0,this.maxY=null!==(u=null==n?void 0:n.maxY)&&void 0!==u?u:0}return n.new=function(e){var t=e.fit,i=e.alignment,r=e.minX,a=e.minY,o=e.maxX,s=e.maxY;return console.warn("This function is deprecated: please use `new Layout({})` instead"),new n({fit:t,alignment:i,minX:r,minY:a,maxX:o,maxY:s})},n.prototype.copyWith=function(e){var t=e.fit,i=e.alignment,r=e.layoutScaleFactor,a=e.minX,o=e.minY,s=e.maxX,l=e.maxY;return new n({fit:null!=t?t:this.fit,alignment:null!=i?i:this.alignment,layoutScaleFactor:null!=r?r:this.layoutScaleFactor,minX:null!=a?a:this.minX,minY:null!=o?o:this.minY,maxX:null!=s?s:this.maxX,maxY:null!=l?l:this.maxY})},n.prototype.runtimeFit=function(t){var n;return this.cachedRuntimeFit?this.cachedRuntimeFit:(n=this.fit===e.Cover?t.Fit.cover:this.fit===e.Contain?t.Fit.contain:this.fit===e.Fill?t.Fit.fill:this.fit===e.FitWidth?t.Fit.fitWidth:this.fit===e.FitHeight?t.Fit.fitHeight:this.fit===e.ScaleDown?t.Fit.scaleDown:this.fit===e.Layout?t.Fit.layout:t.Fit.none,this.cachedRuntimeFit=n,n)},n.prototype.runtimeAlignment=function(e){var n;return this.cachedRuntimeAlignment?this.cachedRuntimeAlignment:(n=this.alignment===t.TopLeft?e.Alignment.topLeft:this.alignment===t.TopCenter?e.Alignment.topCenter:this.alignment===t.TopRight?e.Alignment.topRight:this.alignment===t.CenterLeft?e.Alignment.centerLeft:this.alignment===t.CenterRight?e.Alignment.centerRight:this.alignment===t.BottomLeft?e.Alignment.bottomLeft:this.alignment===t.BottomCenter?e.Alignment.bottomCenter:this.alignment===t.BottomRight?e.Alignment.bottomRight:e.Alignment.center,this.cachedRuntimeAlignment=n,n)},n}(),(F=i||(i={}))[F.Number=56]="Number",F[F.Trigger=58]="Trigger",F[F.Boolean=59]="Boolean",M=function(){function e(e,t){this.type=e,this.runtimeInput=t}return Object.defineProperty(e.prototype,"name",{get:function(){return this.runtimeInput.name}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.runtimeInput.value},set:function(e){this.runtimeInput.value=e},enumerable:!1,configurable:!0}),e.prototype.fire=function(){this.type===i.Trigger&&this.runtimeInput.fire()},e.prototype.delete=function(){this.runtimeInput=null},e}(),(S=r||(r={}))[S.General=128]="General",S[S.OpenUrl=131]="OpenUrl",E=function(e){function t(t,n){var i=e.call(this,!1)||this;return i.nativeArtboard=t,i.file=n,i}return m(t,e),t}(R=function(e){this.isBindableArtboard=!1,this.isBindableArtboard=e}),P=function(e){function t(t){var n=e.call(this,!0)||this;return n.selfUnref=!1,n.nativeArtboard=t,n}return m(t,e),Object.defineProperty(t.prototype,"viewModel",{set:function(e){this.nativeViewModel=e.nativeInstance},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){var e;this.selfUnref&&(this.nativeArtboard.unref(),null===(e=this.nativeViewModel)||void 0===e||e.unref())},t}(R),T=function(){function e(e,t,n,i){this.stateMachine=e,this.playing=n,this.artboard=i,this.inputs=[],this.instance=new t.StateMachineInstance(e,i),this.initInputs(t)}return Object.defineProperty(e.prototype,"hasFocusNodes",{get:function(){return this.instance.hasFocusNodes()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.stateMachine.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statesChanged",{get:function(){for(var e=[],t=0;t<this.instance.stateChangedCount();t++)e.push(this.instance.stateChangedNameByIndex(t));return e},enumerable:!1,configurable:!0}),e.prototype.advance=function(e){this.instance.advance(e)},e.prototype.advanceAndApply=function(e){this.instance.advanceAndApply(e)},e.prototype.enableSemantics=function(){this.instance.enableSemantics()},e.prototype.drainSemanticsDiff=function(){return this.instance.drainSemanticsDiff()},e.prototype.fireSemanticAction=function(e,t){this.instance.fireSemanticAction(e,t)},e.prototype.focusSemanticNode=function(e){return this.instance.focusSemanticNode(e)},e.prototype.reportedEventCount=function(){return this.instance.reportedEventCount()},e.prototype.reportedEventAt=function(e){return this.instance.reportedEventAt(e)},e.prototype.initInputs=function(e){for(var t=0;t<this.instance.inputCount();t++){var n=this.instance.input(t);this.inputs.push(this.mapRuntimeInput(n,e))}},e.prototype.mapRuntimeInput=function(e,t){return e.type===t.SMIInput.bool?new M(i.Boolean,e.asBool()):e.type===t.SMIInput.number?new M(i.Number,e.asNumber()):e.type===t.SMIInput.trigger?new M(i.Trigger,e.asTrigger()):void 0},e.prototype.cleanup=function(){this.inputs.forEach(function(e){e.delete()}),this.inputs.length=0,this.instance.delete()},e.prototype.bindViewModelInstance=function(e){null!=e.runtimeInstance&&this.instance.bindViewModelInstance(e.runtimeInstance)},e.prototype.focusState=function(){return this.instance.focusState()},e.prototype.clearFocus=function(){this.instance.clearFocus()},e}(),x=function(){function e(e,t,n,i,r){void 0===i&&(i=[]),void 0===r&&(r=[]),this.runtime=e,this.artboard=t,this.eventManager=n,this.animations=i,this.stateMachines=r}return e.prototype.add=function(e,t,n,i){if(void 0===n&&(n=!0),void 0===i&&(i=!1),0===(e=el(e)).length)this.animations.forEach(function(e){return e.playing=t}),this.stateMachines.forEach(function(e){return e.playing=t});else for(var r=this.animations.map(function(e){return e.name}),o=this.stateMachines.map(function(e){return e.name}),s=0;s<e.length;s++){var l=r.indexOf(e[s]),u=o.indexOf(e[s]);if(l>=0||u>=0)l>=0?this.animations[l].playing=t:this.stateMachines[u].playing=t;else{var h=this.artboard.animationByName(e[s]);if(h){var d=new c.Animation(h,this.artboard,this.runtime,t);d.advance(0),d.apply(1),this.animations.push(d)}else{var f=this.artboard.stateMachineByName(e[s]);if(f){var p=new T(f,this.runtime,t,this.artboard);i&&p.enableSemantics(),this.stateMachines.push(p)}}}}return n&&(t?this.eventManager.fire({type:a.Play,data:this.playing}):this.eventManager.fire({type:a.Pause,data:this.paused})),t?this.playing:this.paused},e.prototype.initLinearAnimations=function(e,t,n){void 0===n&&(n=!1);for(var i=this.animations.map(function(e){return e.name}),r=0;r<e.length;r++){var a=i.indexOf(e[r]);if(a>=0)this.animations[a].playing=t;else{var o=this.artboard.animationByName(e[r]);if(o){var s=new c.Animation(o,this.artboard,this.runtime,t);s.advance(0),s.apply(1),this.animations.push(s)}else if(n)throw new w("State Machine with name ".concat(e[r]," not found"));else console.error("Animation with name ".concat(e[r]," not found."))}}},e.prototype.initStateMachines=function(e,t,n){for(var i=this.stateMachines.map(function(e){return e.name}),r=0;r<e.length;r++){var a=i.indexOf(e[r]);if(a>=0)this.stateMachines[a].playing=t;else{var o=this.artboard.stateMachineByName(e[r]);if(o){var s=new T(o,this.runtime,t,this.artboard);n&&s.enableSemantics(),this.stateMachines.push(s)}else console.warn("State Machine with name ".concat(e[r]," not found. Falling back to find an animation with the same name.")),this.initLinearAnimations([e[r]],t,!0)}}},e.prototype.play=function(e){return this.add(e,!0)},e.prototype.advanceIfPaused=function(){this.stateMachines.forEac
1h(function(e){e.playing||e.advanceAndApply(0)})},e.prototype.pause=function(e){return this.add(e,!1)},e.prototype.scrub=function(e,t){var n=this.animations.filter(function(t){return e.includes(t.name)});return n.forEach(function(e){return e.scrubTo=t}),n.map(function(e){return e.name})},Object.defineProperty(e.prototype,"playing",{get:function(){return this.animations.filter(function(e){return e.playing}).map(function(e){return e.name}).concat(this.stateMachines.filter(function(e){return e.playing}).map(function(e){return e.name}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this.animations.filter(function(e){return!e.playing}).map(function(e){return e.name}).concat(this.stateMachines.filter(function(e){return!e.playing}).map(function(e){return e.name}))},enumerable:!1,configurable:!0}),e.prototype.stop=function(e){var t=this;e=el(e);var n=[];if(0===e.length)n=this.animations.map(function(e){return e.name}).concat(this.stateMachines.map(function(e){return e.name})),this.animations.forEach(function(e){return e.cleanup()}),this.stateMachines.forEach(function(e){return e.cleanup()}),this.animations.splice(0,this.animations.length),this.stateMachines.splice(0,this.stateMachines.length);else{var i=this.animations.filter(function(t){return e.includes(t.name)});i.forEach(function(e){e.cleanup(),t.animations.splice(t.animations.indexOf(e),1)});var r=this.stateMachines.filter(function(t){return e.includes(t.name)});r.forEach(function(e){e.cleanup(),t.stateMachines.splice(t.stateMachines.indexOf(e),1)}),n=i.map(function(e){return e.name}).concat(r.map(function(e){return e.name}))}return this.eventManager.fire({type:a.Stop,data:n}),n},Object.defineProperty(e.prototype,"isPlaying",{get:function(){return this.animations.reduce(function(e,t){return e||t.playing},!1)||this.stateMachines.reduce(function(e,t){return e||t.playing},!1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isPaused",{get:function(){return!this.isPlaying&&(this.animations.length>0||this.stateMachines.length>0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isStopped",{get:function(){return 0===this.animations.length&&0===this.stateMachines.length},enumerable:!1,configurable:!0}),e.prototype.atLeastOne=function(e,t,n){var i;return void 0===t&&(t=!0),void 0===n&&(n=!1),0===this.animations.length&&0===this.stateMachines.length&&(this.artboard.animationCount()>0?this.add([i=this.artboard.animationByIndex(0).name],e,t):this.artboard.stateMachineCount()>0&&this.add([i=this.artboard.stateMachineByIndex(0).name],e,t,n)),i},e.prototype.handleLooping=function(){for(var e=0,t=this.animations.filter(function(e){return e.playing});e<t.length;e++){var n=t[e];0===n.loopValue&&n.loopCount?(n.loopCount=0,this.stop(n.name)):1===n.loopValue&&n.loopCount?(this.eventManager.fire({type:a.Loop,data:{animation:n.name,type:o.Loop}}),n.loopCount=0):2===n.loopValue&&n.loopCount>1&&(this.eventManager.fire({type:a.Loop,data:{animation:n.name,type:o.PingPong}}),n.loopCount=0)}},e.prototype.handleStateChanges=function(){for(var e=[],t=0,n=this.stateMachines.filter(function(e){return e.playing});t<n.length;t++){var i=n[t];e.push.apply(e,i.statesChanged)}e.length>0&&this.eventManager.fire({type:a.StateChange,data:e})},e.prototype.handleAdvancing=function(e){this.eventManager.fire({type:a.Advance,data:e})},e}(),(k=a||(a={})).Load="load",k.LoadError="loaderror",k.Play="play",k.Pause="pause",k.Stop="stop",k.Loop="loop",k.Draw="draw",k.Advance="advance",k.StateChange="statechange",k.RiveEvent="riveevent",k.AudioStatusChange="audiostatuschange",(O=o||(o={})).OneShot="oneshot",O.Loop="loop",O.PingPong="pingpong",L=function(){function e(e){void 0===e&&(e=[]),this.listeners=e}return e.prototype.getListeners=function(e){return this.listeners.filter(function(t){return t.type===e})},e.prototype.add=function(e){this.listeners.includes(e)||this.listeners.push(e)},e.prototype.remove=function(e){for(var t=0;t<this.listeners.length;t++){var n=this.listeners[t];if(n.type===e.type&&n.callback===e.callback){this.listeners.splice(t,1);break}}},e.prototype.removeAll=function(e){var t=this;e?this.listeners.filter(function(t){return t.type===e}
1).forEach(function(e){return t.remove(e)}):this.listeners.splice(0,this.listeners.length)},e.prototype.fire=function(e){this.getListeners(e.type).forEach(function(t){return t.callback(e)})},e}(),j=function(){function e(e){this.eventManager=e,this.queue=[]}return e.prototype.add=function(e){this.queue.push(e)},e.prototype.process=function(){for(;this.queue.length>0;){var e=this.queue.shift();(null==e?void 0:e.action)&&e.action(),(null==e?void 0:e.event)&&this.eventManager.fire(e.event)}},e}(),(D=s||(s={}))[D.AVAILABLE=0]="AVAILABLE",D[D.UNAVAILABLE=1]="UNAVAILABLE",B=new(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._started=!1,t._enabled=!1,t._status=s.UNAVAILABLE,t}return m(t,e),t.prototype.delay=function(e){return b(this,void 0,void 0,function(){return y(this,function(t){return[2,new Promise(function(t){return setTimeout(t,e)})]})})},t.prototype.timeout=function(){return b(this,void 0,void 0,function(){return y(this,function(e){return[2,new Promise(function(e,t){return setTimeout(t,50)})]})})},t.prototype.reportToListeners=function(){this.fire({type:a.AudioStatusChange}),this.removeAll()},t.prototype.enableAudio=function(){return b(this,void 0,void 0,function(){return y(this,function(e){return this._enabled||(this._enabled=!0,this._status=s.AVAILABLE,this.reportToListeners()),[2]})})},t.prototype.testAudio=function(){return b(this,void 0,void 0,function(){return y(this,function(e){switch(e.label){case 0:if(!(this._status===s.UNAVAILABLE&&null!==this._audioContext))return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Promise.race([this._audioContext.resume(),this.timeout()])];case 2:return e.sent(),this.enableAudio(),[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}})})},t.prototype._establishAudio=function(){return b(this,void 0,void 0,function(){return y(this,function(e){switch(e.label){case 0:if(this._started)return[3,5];if(this._started=!0,"undefined"!=typeof window)return[3,1];return this.enableAudio(),[3,5];case 1:this._audioContext=new AudioContext,this.listenForUserAction(),e.label=2;case 2:if(this._status!==s.UNAVAILABLE)return[3,5];return[4,this.testAudio()];case 3:return e.sent(),[4,this.delay(1e3)];case 4:return e.sent(),[3,2];case 5:return[2]}})})},t.prototype.listenForUserAction=function(){var e=this;document.addEventListener("pointerdown",function(){return b(e,void 0,void 0,function(){return y(this,function(e){return this.enableAudio(),[2]})})},{once:!0})},t.prototype.establishAudio=function(){return b(this,void 0,void 0,function(){return y(this,function(e){return this._establishAudio(),[2]})})},Object.defineProperty(t.prototype,"systemVolume",{get:function(){return this._status===s.UNAVAILABLE?(this.testAudio(),0):1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),t}(L)),N=function(){function e(){}return e.prototype.observe=function(){},e.prototype.unobserve=function(){},e.prototype.disconnect=function(){},e}(),V=globalThis.ResizeObserver||N,U=new(function(){function e(){var e=this;this._elementsMap=new Map,this._onObservedEntry=function(t){var n=e._elementsMap.get(t.target);null!==n?n.onResize(0==t.target.clientWidth||0==t.target.clientHeight):e._resizeObserver.unobserve(t.target)},this._onObserved=function(t){t.forEach(e._onObservedEntry)},this._resizeObserver=new V(this._onObserved)}return e.prototype.add=function(e,t){var n={onResize:t,element:e};return this._elementsMap.set(e,n),this._resizeObserver.observe(e),n},e.prototype.remove=function(e){this._resizeObserver.unobserve(e.element),this._elementsMap.delete(e.element)},e}()),W=0,H=function(){function e(e){this.enableRiveAssetCDN=!0,this.enablePerfMarks=!1,this.referenceCount=0,this.destroyed=!1,this.selfUnref=!1,this.bindableArtboards=[],this.src=e.src,this.buffer=e.buffer,e.assetLoader&&(this.assetLoader=e.assetLoader),this.enableRiveAssetCDN="boolean"!=typeof e.enableRiveAssetCDN||e.enableRiveAssetCDN,this.enablePerfMarks=!!e.enablePerfMarks,this.enablePerfMarks&&(h.RuntimeLoader.enablePerfMarks=!0),this.eventManager=new L,e.onLoad&&this.on(a.Lo
1ad,e.onLoad),e.onLoadError&&this.on(a.LoadError,e.onLoadError)}return e.prototype.releaseFile=function(){var e;this.selfUnref&&(null===(e=this.file)||void 0===e||e.unref()),this.file=null},e.prototype.releaseBindableArtboards=function(){this.bindableArtboards.forEach(function(e){return e.destroy()})},e.prototype.initData=function(){return b(this,void 0,void 0,function(){var t,n,i,r,o;return y(this,function(s){switch(s.label){case 0:if(!(this.src&&!this.buffer))return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),t=this,[4,es(this.src)];case 2:return t.buffer=s.sent(),[3,4];case 3:if((n=s.sent())instanceof Error)throw n;throw new w(e.fileLoadErrorMessage);case 4:if(this.destroyed)return[2];return this.assetLoader&&(i=new f.CustomFileAssetLoaderWrapper(this.runtime,this.assetLoader).assetLoader),this.enablePerfMarks&&performance.mark("rive:file-load:start"),r=this,[4,this.runtime.load(new Uint8Array(this.buffer),i,this.enableRiveAssetCDN)];case 5:if(r.file=s.sent(),this.enablePerfMarks&&(performance.mark("rive:file-load:end"),performance.measure("rive:file-load","rive:file-load:start","rive:file-load:end")),o=new f.FileFinalizer(this.file),f.finalizationRegistry.register(this,o),this.destroyed)return this.releaseFile(),[2];return null!==this.file?this.eventManager.fire({type:a.Load,data:this}):this.fireLoadError(e.fileLoadErrorMessage),[2]}})})},e.prototype.loadRiveFileBytes=function(){return b(this,void 0,void 0,function(){var e;return y(this,function(t){return this.enablePerfMarks&&performance.mark("rive:fetch-riv:start"),e=this.src?es(this.src):Promise.resolve(this.buffer),this.enablePerfMarks&&this.src&&e.then(function(){performance.mark("rive:fetch-riv:end"),performance.measure("rive:fetch-riv","rive:fetch-riv:start","rive:fetch-riv:end")}),[2,e]})})},e.prototype.loadRuntime=function(){return b(this,void 0,void 0,function(){var e;return y(this,function(t){return this.enablePerfMarks&&performance.mark("rive:await-wasm:start"),e=h.RuntimeLoader.awaitInstance(),this.enablePerfMarks&&e.then(function(){performance.mark("rive:await-wasm:end"),performance.measure("rive:await-wasm","rive:await-wasm:start","rive:await-wasm:end")}),[2,e]})})},e.prototype.init=function(){return b(this,void 0,void 0,function(){var t,n,i,r;return y(this,function(a){switch(a.label){case 0:if(!this.src&&!this.buffer)return this.fireLoadError(e.missingErrorMessage),[2];a.label=1;case 1:return a.trys.push([1,4,,5]),[4,Promise.all([this.loadRiveFileBytes(),this.loadRuntime()])];case 2:if(n=(t=a.sent())[0],i=t[1],this.destroyed)return[2];return this.buffer=n,this.runtime=i,this.enablePerfMarks&&performance.mark("rive:init-data:start"),[4,this.initData()];case 3:return a.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 r=a.sent(),this.fireLoadError(r instanceof Error?r.message:e.fileLoadErrorMessage),[3,5];case 5:return[2]}})})},e.prototype.fireLoadError=function(e){throw this.eventManager.fire({type:a.LoadError,data:e}),new w(e)},e.prototype.on=function(e,t){this.eventManager.add({type:e,callback:t})},e.prototype.off=function(e,t){this.eventManager.remove({type:e,callback:t})},e.prototype.cleanup=function(){this.referenceCount-=1,this.referenceCount<=0&&(this.removeAllRiveEventListeners(),this.releaseFile(),this.releaseBindableArtboards(),this.destroyed=!0)},e.prototype.removeAllRiveEventListeners=function(e){this.eventManager.removeAll(e)},e.prototype.getInstance=function(){if(null!==this.file)return this.referenceCount+=1,this.file},e.prototype.destroyIfUnused=function(){this.referenceCount<=0&&this.cleanup()},e.prototype.createBindableArtboard=function(e){if(null!=e){var t=new P(e);return(0,f.createFinalization)(t,t.nativeArtboard),this.bindableArtboards.push(t),t}return null},e.prototype.getArtboard=function(e){var t=this.file.artboardByName(e);if(null!=t)return new E(t,this)},e.prototype.getBindableArtboard=function(e){var t=this.file.bindableArtboardByName(e);return this.createBindableArtboard(t)},e.prototype.getDefaultBindableArtboard=function(){var e=this.file.bindableArtboardDefault();return this.createBindableArtboard(e)},e.prototype.internalBindableArtboardFromArtboard=function(e){var t=this.file.internalBindableArtboardFromArtboard(e);return this.createBindableArtboard(t)},e.prototype.viewModelByName=function(e){var t=this.file.viewModelByName(e);return null!==t?new X(t):null},e.prototype.globalViewModelNames=function(){return this.file.globalViewModelNames()},e.missingErrorMessage="Rive source file or data buffer required",e.fileLoadErrorMessage="The file failed to load",e}(),z=function(){function t(e){var t,i,r,o,s=this;this.loaded=!1,this.destroyed=!1,this._observed=null,this.readyForPlaying=!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=d.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(W++),this.drawOptimization=n.DrawOnChanged,this.enablePerfMarks=!1,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=!1,this.onCanvasResize=function(e){var t=s._hasZeroSize!==e;s._hasZeroSize=e,e?s._layout.maxX&&s._layout.maxY||s.resizeToCanvas():t&&s.resizeDrawingSurfaceToCanvas()},this.frameRequestId=null,this.renderSecondTimer=0,this._boundDraw=this.draw.bind(this),"undefined"!=typeof document&&(this._pageVisibilityHandler=this._onPageVisibilityChange.bind(this),document.addEventListener("visibilitychange",this._pageVisibilityHandler)),this.canvas=e.canvas,e.canvas.constructor===HTMLCanvasElement&&(this._observed=U.add(this.canvas,this.onCanvasResize)),this._currentCanvasWidth=this.canvas.width,this._currentCanvasHeight=this.canvas.height,this.src=e.src,this.buffer=e.buffer,this.riveFile=e.riveFile,this.layout=null!==(t=e.layout)&&void 0!==t?t:new I,this.shouldDisableRiveListeners=!!e.shouldDisableRiveListeners,this.isTouchScrollEnabled=!!e.isTouchScrollEnabled,this.automaticallyHandleEvents=!!e.automaticallyHandleEvents,this.dispatchPointerExit=!1===e.dispatchPointerExit?e.dispatchPointerExit:this.dispatchPointerExit,this.enableMultiTouch=!!e.enableMultiTouch,this.drawOptimization=null!==(i=e.drawingOptions)&&void 0!==i?i:this.drawOptimization,this.enableRiveAssetCDN=void 0===e.enableRiveAssetCDN||e.enableRiveAssetCDN,this.enablePerfMarks=!!e.enablePerfMarks,this.enablePerfMarks&&(h.RuntimeLoader.enablePerfMarks=!0),this._focusOptions=null!==(r=e.focu
1sOptions)&&void 0!==r?r:this._focusOptions,this._tabIndex=null!==(o=e.tabIndex)&&void 0!==o?o:null,this.eventManager=new L,e.onLoad&&this.on(a.Load,e.onLoad),e.onLoadError&&this.on(a.LoadError,e.onLoadError),e.onPlay&&this.on(a.Play,e.onPlay),e.onPause&&this.on(a.Pause,e.onPause),e.onStop&&this.on(a.Stop,e.onStop),e.onLoop&&this.on(a.Loop,e.onLoop),e.onStateChange&&this.on(a.StateChange,e.onStateChange),e.onAdvance&&this.on(a.Advance,e.onAdvance),e.onload&&!e.onLoad&&this.on(a.Load,e.onload),e.onloaderror&&!e.onLoadError&&this.on(a.LoadError,e.onloaderror),e.onplay&&!e.onPlay&&this.on(a.Play,e.onplay),e.onpause&&!e.onPause&&this.on(a.Pause,e.onpause),e.onstop&&!e.onStop&&this.on(a.Stop,e.onstop),e.onloop&&!e.onLoop&&this.on(a.Loop,e.onloop),e.onstatechange&&!e.onStateChange&&this.on(a.StateChange,e.onstatechange),e.assetLoader&&(this.assetLoader=e.assetLoader),this.taskQueue=new j(this.eventManager),this.init({src:this.src,buffer:this.buffer,riveFile:this.riveFile,autoplay:e.autoplay,autoBind:e.autoBind,animations:e.animations,stateMachines:e.stateMachines,artboard:e.artboard,useOffscreenRenderer:e.useOffscreenRenderer,tabIndex:e.tabIndex,semanticsMode:e.semanticsMode,semanticsOptions:e.semanticsOptions})}return Object.defineProperty(t.prototype,"viewModelCount",{get:function(){return this.file.viewModelCount()},enumerable:!1,configurable:!0}),t.new=function(e){return console.warn("This function is deprecated: please use `new Rive({})` instead"),new t(e)},t.prototype.enableSemantics=function(){this.semanticsMode=d.SemanticMode.Enabled,this.activateSemantics()},t.prototype.activateSemantics=function(){this._semanticsActive||this.semanticsMode===d.SemanticMode.Disabled||(this._semanticsActive=!0,this.syncSemanticsOnStateMachines())},t.prototype.syncSemanticsOnStateMachines=function(){if(this._semanticsActive&&this.animator)for(var e=0,t=this.animator.stateMachines;e<t.length;e++)t[e].enableSemantics()},t.prototype.cleanupSemantics=function(){this._semanticTree=null,this._accessibilityOverlay&&(this._accessibilityOverlay.destroy(),this._accessibilityOverlay=null)},t.prototype.onSystemAudioChanged=function(){this.volume=this._volume},t.prototype.init=function(e){var n=this,i=e.src,r=e.buffer,o=e.riveFile,s=e.animations,l=e.stateMachines,u=e.artboard,c=e.autoplay,f=void 0!==c&&c,p=e.useOffscreenRenderer,m=void 0!==p&&p,v=e.autoBind,b=void 0!==v&&v,y=e.tabIndex,g=e.semanticsMode,_=e.semanticsOptions;if(!this.destroyed){if(this.src=i,this.buffer=r,this.riveFile=o,this._tabIndex=null!=y?y:null,this.semanticsMode=null!=g?g:d.SemanticMode.Disabled,this.semanticsOptions=null!=_?_:this.semanticsOptions,!this.src&&!this.buffer&&!this.riveFile)throw new w(t.missingErrorMessage);var A=el(s),C=el(l);this.loaded=!1,this.readyForPlaying=!1,h.RuntimeLoader.awaitInstance().then(function(e){if(!n.destroyed){n.runtime=e,n.removeRiveListeners(),n.cleanupSemantics(),n.deleteRiveRenderer(),n.enablePerfMarks&&performance.mark("rive:make-renderer:start");try{if(n.renderer=n.runtime.makeRenderer(n.canvas,m),!n.renderer)throw Error("Renderer is null, cannot render Rive on the canvas.")}catch(e){throw console.error(e),new w("Unable to create the renderer, your environment may not support WebGL. Try the @rive-app/canvas runtime as an alternative.")}n.enablePerfMarks&&(performance.mark("rive:make-renderer:end"),performance.measure("rive:make-renderer","rive:make-renderer:start","rive:make-renderer:end")),n.canvas.width||n.canvas.height||n.resizeDrawingSurfaceToCanvas(),n.initData(u,A,C,f,b).then(function(e){if(e)return n.setupRiveListeners()}).catch(function(e){console.error(e)})}}).catch(function(e){n.eventManager.fire({type:a.LoadError,data:e.message})})}},t.prototype.setupRiveListeners=function(e){var t=this;if(this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),!this.shouldDisableRiveListeners){var n=this.animator.stateMachines.filter(function(e){return e.playing}).filter(function(e){return t.runtime.hasListeners(e.instance)}).map(function(e){return e.instance}),i=this.isTouchScrollEnabled,r=this.dispatchPointerExit,a=this.enableMultiTouch;e&&"isTouchScrollEnabled"in e&&(i=e.isTouchScrollEnabled),this.eventCleanup=(0,f.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:n,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:i,dispatchPointerExit:r,enableMultiTouch:a,layoutScaleFactor:this._layout.layoutScaleFactor,advanceAndDrain:this.advanceAndReportChanges.bind(this)}),this.ensureKeyboardInteractions()}},t.prototype.ensureKeyboardInteractions=function(){var e=this;if(!this._keyboardInteractions&&!this.shouldDisableRiveListeners&&"undefined"!=typeof window&&this.canvas instanceof HTMLCanvasElement){var t=this.animator.stateMachines.find(function(e){return e.playing&&e.hasFocusNodes});if(t){var n=this.canvas.tabIndex;(-1===n||isNaN(n))&&(this.canvas.tabIndex=null!==this._tabIndex?this._tabIndex:0),this._keyboardInteractions=new f.KeyboardInteractions({canvas:this.canvas,stateMachine:t.instance,hasFocusNodes:!0,getOverlayElement:function(){var t,n;return null!==(n=null===(t=e._accessibilityOverlay)||void 0===t?void 0:t.getSemanticOverlayContainer())&&void 0!==n?n:null}})}}},t.prototype.cleanupKeyboardInteractions=function(){this._keyboardInteractions&&(this._keyboardInteractions.cleanup(),this._keyboardInteractions=null)},t.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null),this.cleanupKeyboardInteractions()},t.prototype.initializeAudio=function(){var e,t=this;B.status==s.UNAVAILABLE&&(this.file.hasAudio||(null===(e=this.artboard)||void 0===e?void 0:e.hasAudio)&&null===this._audioEventListener)&&(this._audioEventListener={type:a.AudioStatusChange,callback:function(){return t.onSystemAudioChanged()}},B.add(this._audioEventListener),B.establishAudio())},t.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)},t.prototype.initData=function(e,t,n,i,r){return b(this,void 0,void 0,function(){var o,s,l;return y(this,function(u){switch(u.label){case 0:if(u.trys.push([0,3,,4]),null!=this.riveFile)return[3,2];return o=new H({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader,enablePerfMarks:this.enablePerfMarks}),this.riveFile=o,[4,o.init()];case 1:if(u.sent(),this.destroyed)return o.destroyIfUnused(),[2,!1];u.label=2;case 2:this.file=this.riveFile.getInstance(),this.initArtboard(e,t,n,i,r),this.initArtboardSize(),this.initializeAudio(),this.semanticsMode===d.SemanticMode.Enabled?this.activateSemantics():this._semanticsActive&&this.syncSemanticsOnStateMachines();try{this.loaded=!0,this.eventManager.fire({type:a.Load,data:null!==(l=this.src)&&void 0!==l?l:"buffer"})}catch(e){console.error(e)}return this.animator.advanceIfPaused(),this.readyForPlaying=!0,this.taskQueue.process(),this.drawFrame(),[2,!0];case 3:var c;return s=(c=u.sent())&&c.isHandledError?c.message:"Problem loading file; may be corrupt!",this.eventManager.fire({type:a.LoadError,data:s}),[2,Promise.reject(s)];case 4:return[2]}})})},t.prototype.initArtboard=function(e,t,n,i,r){if(this.file){var o,s=e?this.file.artboardByName(e):this.file.defaultArtboard();if(!s)throw new w("Invalid artboard name or no default artboard");if(this.artboard=s,s.volume=this._volume*B.systemVolume,this.animator=new x(this.runtime,this.artboard,this.eventManager),t.length>0||n.length>0?(o=t.concat(n),this.animator.initLinearAnimations(t,i),this.animator.initStateMachines(n,i,this._semanticsActive)):o=[this.animator.atLeastOne(i,!1,this._semanticsActive)],this.taskQueue.add({event:{type:i?a.Play:a.Pause,data:o}}),r){var l=this.file.defaultArtboardViewModel(s);if(null!==l){var u=l.defaultInstance();if(null!==u){var c=new q(u,null);(0,f.createFinalization)(c,c.runtimeInstance),this.setViewModelInstance(c)}}for(var h=0,d=this.file.globalViewModelNames();h<d.length;h++){var p=d[h],m=this.file.viewModelByName(p);if(null!==m){var v=new X(m).defaultInstance();null!==v&&this.setGlobalViewModelInstance(p,v)}}this.bind()}}},t.prototype.drawFrame=function(){var e,t;(null===(e=null==document?void 0:document.timeline)||void 0===e?void 0:e.currentTime)?this.loaded&&this.artboard&&!this.frameRequestId&&(this._boundDraw(document.timeline.currentTime),null===(t=this.runtime)||void 0===t||t.resolveAnimationFrame()):this.scheduleRendering()},t.prototype._canvasSizeChanged=function(){var e=!1;return this.canvas&&(this.canvas.width!==this._currentCanvasWidth&&(this._currentCanvasWidth=this.canvas.width,e=!0),this.canvas.height!==this._currentCanvasHeight&&(this._currentCanvasHeight=this.canvas.height,e=!0)),e},t.prototype.pollFocusState=function(){if(this.ensureKeyboardInteractions(),!this._keyboardInteractions){this._prevHasFocus=!1;return}var e,t,n=this.animator.stateMachines.find(function(e){return e.playing&&e.hasFocusNodes});if(!n){this._prevHasFocus=!1;return}if(this.canvas instanceof HTMLCanvasElement){if(n.focusState().hasFocus){if(this._keyboardInteractions.notifyRiveFocused(),!this._prevHasFocus){var i=null===(e=this._accessibilityOverlay)||void 0===e?void 0:e.getSemanticOverlayContainer();!(document.activeElement===this.canvas||null!==(t=null==i?void 0:i.contains(document.activeElement))&&void 0!==t&&t)&&this._focusOptions.allowFocusInterrupt&&this.canvas.focus(),this._prevHasFocus=!0}return}this._prevHasFocus=!1,this._keyboardInteractions.focusSessionState===f.FocusSessionState.RiveFocused&&this._keyboardInteractions.setFocusSessionState(f.FocusSessionState.NotFocused)}},t.prototype.advanceAndReportChanges=function(e){for(var t,n,i=this.animator.animations.filter(function(e){return e.playing||e.needsScrub}).sort(function(e){return e.needsScrub?-1:1}),o=0;o<i.length;o++){var s=i[o];s.advance(e),s.instance.didLoop&&(s.loopCount+=1),s.apply(1)}for(var l=this.animator.stateMachines.filter(function(e){return e.playing}),u=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1,c=0;c<l.length;c++){var h=l[c],p=h.reportedEventCount();if(p)for(var m=0;m<p;m++){var v=h.reportedEventAt(m);
1if(v){if(v.type===r.OpenUrl){if(this.eventManager.fire({type:a.RiveEvent,data:v}),this.automaticallyHandleEvents){var b=document.createElement("a"),y=v.url,g=v.target,w=(0,f.sanitizeUrl)(y);y&&b.setAttribute("href",w),g&&b.setAttribute("target",g),w&&w!==f.BLANK_URL&&b.click()}}else this.eventManager.fire({type:a.RiveEvent,data:v})}}if(u>=0&&performance.mark("rive:sm-advance:start:f".concat(u)),h.advanceAndApply(e),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 _=h.drainSemanticsDiff();_&&(this._semanticTree||(this._semanticTree=new d.SemanticTreeModel),this._semanticTree.applyDiff(_))}}if(this._semanticsActive&&this._semanticTree&&l.length>0&&this.canvas instanceof HTMLCanvasElement){if(!this._accessibilityOverlay){var A=l[0];this._accessibilityOverlay=new d.AccessibilityOverlay({canvas:this.canvas,instanceId:this._instanceId,semanticsOptions:this.semanticsOptions,allowFocusInterrupt:this._focusOptions.allowFocusInterrupt,fireAction:function(e,t){A.fireSemanticAction(e,t)},requestFocus:function(e){return A.focusSemanticNode(e)},clearFocus:function(){return A.instance.clearFocus()}})}var C=null===(t=this._accessibilityOverlay)||void 0===t?void 0:t.needsUpdate(this._semanticTree);if(C||this._overlayTransformDirty){var I=null;if((null==C?void 0:C.layoutChanged)||this._overlayTransformDirty){var F=this._layout.runtimeFit(this.runtime),M=this._layout.runtimeAlignment(this.runtime);I=this.runtime.computeAlignment(F,M,{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,I,this._devicePixelRatioUsed,this.artboard.bounds,C),null==I||I.delete()}}0==this.animator.stateMachines.length&&this.artboard.advance(e),this.animator.handleLooping(),this.animator.handleStateChanges(),this.animator.handleAdvancing(e),this.pollFocusState(),null===(n=this._viewModelInstance)||void 0===n||n.handleCallbacks(),this._globalViewModelInstances.forEach(function(e){e&&e.handleCallbacks()})},t.prototype.draw=function(e,t){this.frameRequestId=null;var i=performance.now(),r=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1;this.lastRenderTime||(this.lastRenderTime=e),this.renderSecondTimer+=e-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,null==t||t());var a=(e-this.lastRenderTime)/1e3;this.lastRenderTime=e,this.advanceAndReportChanges(a);var o=this.renderer;!this._hasZeroSize&&(this.drawOptimization==n.AlwaysDraw||this.artboard.didChange()||this._needsRedraw||this._canvasSizeChanged())&&(o.clear(),o.save(),r>=0&&performance.mark("rive:align-renderer:start:f".concat(r)),this.alignRenderer(),r>=0&&(performance.mark("rive:align-renderer:end:f".concat(r)),performance.measure("rive:align-renderer:f".concat(r),"rive:align-renderer:start:f".concat(r),"rive:align-renderer:end:f".concat(r))),r>=0&&performance.mark("rive:artboard-draw:start:f".concat(r)),this.artboard.draw(o),r>=0&&(performance.mark("rive:artboard-draw:end:f".concat(r)),performance.measure("rive:artboard-draw:f".concat(r),"rive:artboard-draw:start:f".concat(r),"rive:artboard-draw:end:f".concat(r))),o.restore(),r>=0&&performance.mark("rive:renderer-flush:start:f".concat(r)),o.flush(),r>=0&&(performance.mark("rive:renderer-flush:end:f".concat(r)),performance.measure("rive:renderer-flush:f".concat(r),"rive:renderer-flush:start:f".concat(r),"rive:renderer-flush:end:f".concat(r))),this._needsRedraw=!1),this.frameCount++;var s=performance.now();for(this.frameTimes.push(s),this.durations.push(s-i);this.frameTimes[0]<=s-1e3;)this.frameTimes.shift(),this.durations.shift();this.animator.isPlaying?this.scheduleRendering():this.animator.isPaused?this.lastRenderTime=0:this.animator.isStopped&&(this.lastRenderTime=0)},t.prototype.alignRenderer=function(){var e=this.renderer,t=this.runtime,n=this._layout,i=this.artboard;e.align(n.runtimeFit(t),n.runtimeAlignment(t),{minX:n.minX,minY:n.minY,maxX:n.maxX,maxY:n.maxY},i.bounds,this._devicePixelRatioUsed*n.layoutScaleFactor)},Object.defineProperty(t.prototype,"fps",{get:function(){return this.durations.length}
1,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"frameTime",{get:function(){return 0===this.durations.length?0:(this.durations.reduce(function(e,t){return e+t},0)/this.durations.length).toFixed(4)},enumerable:!1,configurable:!0}),t.prototype.cleanup=function(){var e,t,n,i;this.destroyed=!0,this.stopRendering(),null===(t=null===(e=this.renderer)||void 0===e?void 0:e.bindContext)||void 0===t||t.call(e),this.cleanupInstances(),null!==this._observed&&U.remove(this._observed),this.removeRiveListeners(),this.file&&(null===(n=this.riveFile)||void 0===n||n.cleanup(),this.file=null),this.riveFile=null,this.deleteRiveRenderer(),null!==this._audioEventListener&&(B.remove(this._audioEventListener),this._audioEventListener=null),this._pageVisibilityHandler&&(document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),null===(i=this._viewModelInstance)||void 0===i||i.cleanup(),this._viewModelInstance=null,this._globalViewModelInstances.forEach(function(e){return e.cleanup()}),this._globalViewModelInstances.clear(),this._dataEnums=null},t.prototype.deleteRiveRenderer=function(){var e;null===(e=this.renderer)||void 0===e||e.delete(),this.renderer=null},t.prototype.cleanupInstances=function(){null!==this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.cleanupSemantics(),this.stop(),this.artboard&&(this.artboard.delete(),this.artboard=null)},t.prototype.retrieveTextRun=function(e){if(!e){console.warn("No text run name provided");return}if(!this.artboard){console.warn("Tried to access text run, but the Artboard is null");return}var t,n=this.artboard.textRun(e);if(!n){console.warn("Could not access a text run with name '".concat(e,"' in the '").concat(null===(t=this.artboard)||void 0===t?void 0:t.name,"' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime."));return}return n},t.prototype.getTextRunValue=function(e){var t=this.retrieveTextRun(e);return t?t.text:void 0},t.prototype.setTextRunValue=function(e,t){var n=this.retrieveTextRun(e);n&&(n.text=t)},t.prototype.play=function(e,t){var n=this;if(e=el(e),!this.readyForPlaying){this.taskQueue.add({action:function(){return n.play(e,t)}});return}this.animator.play(e),this.syncSemanticsOnStateMachines(),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.setupRiveListeners(),this.startRendering()},t.prototype.pause=function(e){var t=this;if(e=el(e),!this.readyForPlaying){this.taskQueue.add({action:function(){return t.pause(e)}});return}this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.animator.pause(e)},t.prototype.scrub=function(e,t){var n=this;if(e=el(e),!this.readyForPlaying){this.taskQueue.add({action:function(){return n.scrub(e,t)}});return}this.animator.scrub(e,t||0),this.drawFrame()},t.prototype.stop=function(e){var t=this;if(e=el(e),!this.readyForPlaying){this.taskQueue.add({action:function(){return t.stop(e)}});return}this.animator&&this.animator.stop(e),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.cleanupSemantics()},t.prototype.reset=function(e){var t,n,i=null==e?void 0:e.artboard,r=el(null==e?void 0:e.animations),a=el(null==e?void 0:e.stateMachines),o=null!==(t=null==e?void 0:e.autoplay)&&void 0!==t&&t,s=null!==(n=null==e?void 0:e.autoBind)&&void 0!==n&&n;this.cleanupInstances(),this.initArtboard(i,r,a,o,s),this.taskQueue.process()},t.prototype.load=function(e){this.file=null,this.stop(),this.init(e)},Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(e){this._layout=e,this._overlayTransformDirty=!0,e.maxX&&e.maxY||this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame()},enumerable:!1,configurable:!0}),t.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height}),this._overlayTransformDirty=!0},t.prototype.resizeDrawingSurfaceToCanvas=function(t){if(this.canvas instanceof HTMLCanvasElement&&window){var n=this.canvas.getBoundingClientRect(),i=n.width,r=n.height,a=t||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=a,this.canvas.width=a*i,this.canvas.height=a*r,this._needsRedraw=!0,this.resizeToCanvas(),this.layout.fit===e.Layout){var o=this._layout.layoutScaleFactor;this.artboard.width=i/o,this.artboard.height=r/o}this.drawFrame()}},Object.defineProperty(t.prototype,"source",{get:function(){return this.src}
1,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"semanticTree",{get:function(){return this._semanticTree},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessibilityOverlay",{get:function(){return this._accessibilityOverlay},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var e=[],t=0;t<this.artboard.animationCount();t++)e.push(this.artboard.animationByIndex(t).name);return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stateMachineNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var e=[],t=0;t<this.artboard.stateMachineCount();t++)e.push(this.artboard.stateMachineByIndex(t).name);return e},enumerable:!1,configurable:!0}),t.prototype.stateMachineInputs=function(e){if(this.loaded){var t=this.animator.stateMachines.find(function(t){return t.name===e});return null==t?void 0:t.inputs}},t.prototype.retrieveInputAtPath=function(e,t){if(!e){console.warn("No input name provided for path '".concat(t,"'"));return}if(!this.artboard){console.warn("Tried to access input: '".concat(e,"', at path: '").concat(t,"', but the Artboard is null"));return}var n=this.artboard.inputByPath(e,t);if(!n){console.warn("Could not access an input with name: '".concat(e,"', at path:'").concat(t,"'"));return}return n},t.prototype.setBooleanStateAtPath=function(e,t,n){var r=this.retrieveInputAtPath(e,n);r&&(r.type===i.Boolean?r.asBool().value=t:console.warn("Input with name: '".concat(e,"', at path:'").concat(n,"' is not a boolean")))},t.prototype.setNumberStateAtPath=function(e,t,n){var r=this.retrieveInputAtPath(e,n);r&&(r.type===i.Number?r.asNumber().value=t:console.warn("Input with name: '".concat(e,"', at path:'").concat(n,"' is not a number")))},t.prototype.fireStateAtPath=function(e,t){var n=this.retrieveInputAtPath(e,t);n&&(n.type===i.Trigger?n.asTrigger().fire():console.warn("Input with name: '".concat(e,"', at path:'").concat(t,"' is not a trigger")))},t.prototype.retrieveTextAtPath=function(e,t){if(!e){console.warn("No text name provided for path '".concat(t,"'"));return}if(!t){console.warn("No path provided for text '".concat(e,"'"));return}if(!this.artboard){console.warn("Tried to access text: '".concat(e,"', at path: '").concat(t,"', but the Artboard is null"));return}var n=this.artboard.textByPath(e,t);if(!n){console.warn("Could not access text with name: '".concat(e,"', at path:'").concat(t,"'"));return}return n},t.prototype.getTextRunValueAtPath=function(e,t){var n=this.retrieveTextAtPath(e,t);if(!n){console.warn("Could not get text with name: '".concat(e,"', at path:'").concat(t,"'"));return}return n.text},t.prototype.setTextRunValueAtPath=function(e,t,n){var i=this.retrieveTextAtPath(e,n);if(!i){console.warn("Could not set text with name: '".concat(e,"', at path:'").concat(n,"'"));return}i.text=t},Object.defineProperty(t.prototype,"playingStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(e){return e.playing}).map(function(e){return e.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playingAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(e){return e.playing}).map(function(e){return e.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pausedAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(e){return!e.playing}).map(function(e){return e.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pausedStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(e){return!e.playing}).map(function(e){return e.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPlaying",{get:function(){return this.animator.isPlaying},enumerable:!1,configurable:!0}
1),Object.defineProperty(t.prototype,"isPaused",{get:function(){return this.animator.isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isStopped",{get:function(){var e,t;return null===(t=null===(e=this.animator)||void 0===e?void 0:e.isStopped)||void 0===t||t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.artboard?this.artboard.bounds:void 0},enumerable:!1,configurable:!0}),t.prototype.on=function(e,t){this.eventManager.add({type:e,callback:t})},t.prototype.off=function(e,t){this.eventManager.remove({type:e,callback:t})},t.prototype.unsubscribe=function(e,t){console.warn("This function is deprecated: please use `off()` instead."),this.off(e,t)},t.prototype.removeAllRiveEventListeners=function(e){this.eventManager.removeAll(e)},t.prototype.unsubscribeAll=function(e){console.warn("This function is deprecated: please use `removeAllRiveEventListeners()` instead."),this.removeAllRiveEventListeners(e)},t.prototype.stopRendering=function(){this._explicitlyStoppedRendering=!0,this.loaded&&this.frameRequestId&&(this.runtime.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null)},t.prototype.startRendering=function(){this._explicitlyStoppedRendering=!1,this.drawFrame()},t.prototype.scheduleRendering=function(){this.loaded&&this.artboard&&!this.frameRequestId&&(this.runtime.requestAnimationFrame?this.frameRequestId=this.runtime.requestAnimationFrame(this._boundDraw):this.frameRequestId=requestAnimationFrame(this._boundDraw))},t.prototype._onPageVisibilityChange=function(){var e,t;document.hidden?(null!==this.frameRequestId&&((null===(e=this.runtime)||void 0===e?void 0:e.cancelAnimationFrame)?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null),this.lastRenderTime=0):(null===(t=this.animator)||void 0===t?void 0:t.isPlaying)&&!this._explicitlyStoppedRendering&&this.scheduleRendering()},t.prototype.enableFPSCounter=function(e){this.runtime.enableFPSCounter(e)},t.prototype.disableFPSCounter=function(){this.runtime.disableFPSCounter()},Object.defineProperty(t.prototype,"contents",{get:function(){if(this.loaded){for(var e={artboards:[]},t=0;t<this.file.artboardCount();t++){for(var n=this.file.artboardByIndex(t),i={name:n.name,animations:[],stateMachines:[]},r=0;r<n.animationCount();r++){var a=n.animationByIndex(r);i.animations.push(a.name)}for(var o=0;o<n.stateMachineCount();o++){for(var s=n.stateMachineByIndex(o),l=s.name,u=new this.runtime.StateMachineInstance(s,n),c=[],h=0;h<u.inputCount();h++){var d=u.input(h);c.push({name:d.name,type:d.type})}i.stateMachines.push({name:l,inputs:c})}e.artboards.push(i)}return e}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"volume",{get:function(){return this.artboard&&this.artboard.volume!==this._volume&&(this._volume=this.artboard.volume),this._volume},set:function(e){this._volume=e,this.artboard&&(this.artboard.volume=e*B.systemVolume)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardWidth",{get:function(){var e;return this.artboard?this.artboard.width:null!==(e=this._artboardWidth)&&void 0!==e?e:0},set:function(e){this._artboardWidth=e,this.artboard&&(this.artboard.width=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardHeight",{get:function(){var e;return this.artboard?this.artboard.height:null!==(e=this._artboardHeight)&&void 0!==e?e:0},set:function(e){this._artboardHeight=e,this.artboard&&(this.artboard.height=e)},enumerable:!1,configurable:!0}),t.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(t.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(e){e!==this._devicePixelRatioUsed&&(this._overlayTransformDirty=!0),this._devicePixelRatioUsed=e}
1,enumerable:!1,configurable:!0}),t.prototype.bindViewModelInstance=function(e){e&&(this.setViewModelInstance(e),this.bind())},t.prototype.setViewModelInstance=function(e){var t,n=null==e?void 0:e.runtimeInstance;this.artboard&&!this.destroyed&&e&&n&&(e.internalIncrementReferenceCount(),null===(t=this._viewModelInstance)||void 0===t||t.cleanup(),this._viewModelInstance=e,this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(e){return e.instance.setViewModelInstance(n)}):this.artboard.setViewModelInstance(n))},t.prototype.bind=function(){this.artboard&&!this.destroyed&&(this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(e){return e.instance.bind()}):this.artboard.bind())},Object.defineProperty(t.prototype,"viewModelInstance",{get:function(){return this._viewModelInstance},enumerable:!1,configurable:!0}),t.prototype.setGlobalViewModelInstance=function(e,t){var n,i=null==t?void 0:t.runtimeInstance;if(!this.artboard||this.destroyed||!i)return!1;var r=!1;return this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(t){t.instance.setGlobalViewModelInstance(e,i)&&(r=!0)}):r=this.artboard.setGlobalViewModelInstance(e,i),r&&(t.internalIncrementReferenceCount(),null===(n=this._globalViewModelInstances.get(e))||void 0===n||n.cleanup(),this._globalViewModelInstances.set(e,t)),r},t.prototype.globalViewModelInstance=function(e){var t=this._globalViewModelInstances.get(e);if(t)return t;if(!this.artboard||this.destroyed)return null;var n=this.animator.stateMachines.length>0?this.animator.stateMachines[0].instance.globalViewModelInstance(e):this.artboard.globalViewModelInstance(e);if(null===n)return null;var i=new q(n,null);return(0,f.createFinalization)(i,n),i.internalIncrementReferenceCount(),this._globalViewModelInstances.set(e,i),i},t.prototype.globalViewModelNames=function(){var e,t;return null!==(t=null===(e=this.file)||void 0===e?void 0:e.globalViewModelNames())&&void 0!==t?t:[]},t.prototype.viewModelByIndex=function(e){var t=this.file.viewModelByIndex(e);return null!==t?new X(t):null},t.prototype.viewModelByName=function(e){var t;return null===(t=this.riveFile)||void 0===t?void 0:t.viewModelByName(e)},t.prototype.enums=function(){if(null===this._dataEnums){var e=this.file.enums();this._dataEnums=e.map(function(e){return new $(e)})}return this._dataEnums},t.prototype.defaultViewModel=function(){if(this.artboard){var e=this.file.defaultArtboardViewModel(this.artboard);if(e)return new X(e)}return null},t.prototype.getArtboard=function(e){var t,n;return null!==(n=null===(t=this.riveFile)||void 0===t?void 0:t.getArtboard(e))&&void 0!==n?n:null},t.prototype.getBindableArtboard=function(e){var t,n;return null!==(n=null===(t=this.riveFile)||void 0===t?void 0:t.getBindableArtboard(e))&&void 0!==n?n:null},t.prototype.getDefaultBindableArtboard=function(){var e,t;return null!==(t=null===(e=this.riveFile)||void 0===e?void 0:e.getDefaultBindableArtboard())&&void 0!==t?t:null},t.prototype.clearFocus=function(){this.animator.stateMachines.filter(function(e){return e.playing&&e.hasFocusNodes}).forEach(function(e){return e.clearFocus()})},t.missingErrorMessage="Rive source file or data buffer required",t.cleanupErrorMessage="Attempt to use file after calling cleanup.",t}(),(Y=l||(l={})).none="none",Y.string="string",Y.number="number",Y.boolean="boolean",Y.color="color",Y.list="list",Y.enumType="enumType",Y.trigger="trigger",Y.viewModel="viewModel",Y.integer="integer",Y.listIndex="listIndex",Y.image="image",Y.artboard="artboard",X=function(){function e(e){this._viewModel=e}return Object.defineProperty(e.prototype,"instanceCount",{get:function(){return this._viewModel.instanceCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._viewModel.name},enumerable:!1,configurable:!0}),e.prototype.instanceByIndex=function(e){var t=this._viewModel.instanceByIndex(e);if(null!==t){var n=new q(t,null);return(0,f.createFinalization)(n,t),n}return null},e.prototype.instanceByName=function(e){var t=this._viewModel.instanceByName(e);
1if(null!==t){var n=new q(t,null);return(0,f.createFinalization)(n,t),n}return null},e.prototype.defaultInstance=function(){var e=this._viewModel.defaultInstance();if(null!==e){var t=new q(e,null);return(0,f.createFinalization)(t,e),t}return null},e.prototype.instance=function(){var e=this._viewModel.instance();if(null!==e){var t=new q(e,null);return(0,f.createFinalization)(t,e),t}return null},Object.defineProperty(e.prototype,"properties",{get:function(){return this._viewModel.getProperties()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"instanceNames",{get:function(){return this._viewModel.getInstanceNames()},enumerable:!1,configurable:!0}),e}(),$=function(){function e(e){this._dataEnum=e}return Object.defineProperty(e.prototype,"name",{get:function(){return this._dataEnum.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){return this._dataEnum.values},enumerable:!1,configurable:!0}),e}(),(G=u||(u={})).Number="number",G.String="string",G.Boolean="boolean",G.Color="color",G.Trigger="trigger",G.Enum="enum",G.List="list",G.Image="image",G.Font="font",G.Artboard="artboard",q=function(){function e(e,t){this._parents=[],this._children=[],this._viewModelInstances=new Map,this._propertiesWithCallbacks=[],this._referenceCount=0,this.selfUnref=!1,this._runtimeInstance=e,null!==t&&this._parents.push(t)}return Object.defineProperty(e.prototype,"runtimeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nativeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),e.prototype.handleCallbacks=function(){0!==this._propertiesWithCallbacks.length&&(this._propertiesWithCallbacks.forEach(function(e){e.handleCallbacks()}),this._propertiesWithCallbacks.forEach(function(e){e.clearChanges()})),this._children.forEach(function(e){return e.handleCallbacks()})},e.prototype.addParent=function(e){!this._parents.includes(e)&&(this._parents.push(e),(this._propertiesWithCallbacks.length>0||this._children.length>0)&&e.addToViewModelCallbacks(this))},e.prototype.removeParent=function(e){var t=this._parents.indexOf(e);-1!==t&&(this._parents[t].removeFromViewModelCallbacks(this),this._parents.splice(t,1))},e.prototype.addToPropertyCallbacks=function(e){var t=this;!this._propertiesWithCallbacks.includes(e)&&(this._propertiesWithCallbacks.push(e),this._propertiesWithCallbacks.length>0&&this._parents.forEach(function(e){e.addToViewModelCallbacks(t)}))},e.prototype.removeFromPropertyCallbacks=function(e){var t=this;this._propertiesWithCallbacks.includes(e)&&(this._propertiesWithCallbacks=this._propertiesWithCallbacks.filter(function(t){return t!==e}),0===this._children.length&&0===this._propertiesWithCallbacks.length&&this._parents.forEach(function(e){e.removeFromViewModelCallbacks(t)}))},e.prototype.addToViewModelCallbacks=function(e){var t=this;this._children.includes(e)||(this._children.push(e),this._parents.forEach(function(e){e.addToViewModelCallbacks(t)}))},e.prototype.removeFromViewModelCallbacks=function(e){var t=this;this._children.includes(e)&&(this._children=this._children.filter(function(t){return t!==e}),0===this._children.length&&0===this._propertiesWithCallbacks.length&&this._parents.forEach(function(e){e.removeFromViewModelCallbacks(t)}))},e.prototype.clearCallbacks=function(){this._propertiesWithCallbacks.forEach(function(e){e.clearCallbacks()})},e.prototype.propertyFromPath=function(e,t){var n=e.split("/");return this.propertyFromPathSegments(n,0,t)},e.prototype.viewModelFromPathSegments=function(e,t){var n=this.internalViewModelInstance(e[t]);return null!==n?t==e.length-1?n:n.viewModelFromPathSegments(e,t++):null},e.prototype.propertyFromPathSegments=function(e,t,n){if(t<e.length-1){var i,r,a,o,s,l,c,h,d,f,p,m,v,b,y,g,w,_,A,C,I=this.internalViewModelInstance(e[t]);return null!==I?I.propertyFromPathSegments(e,t+1,n):null}var F=null;switch(n){case u.Number:if(null!==(F=null!==(r=null===(i=this._runtimeInstance)||void 0===i?void 0:i.number(e[t]))&&void 0!==r?r:null))return new Q(F,this);break;case u.String:if(null!==(F=null!==(o=null===(a=this._runtimeInstance)||void 0===a?void 0:a.string(e[t]))&&void 0!==o?o:null))return new J
1(F,this);break;case u.Boolean:if(null!==(F=null!==(l=null===(s=this._runtimeInstance)||void 0===s?void 0:s.boolean(e[t]))&&void 0!==l?l:null))return new Z(F,this);break;case u.Color:if(null!==(F=null!==(h=null===(c=this._runtimeInstance)||void 0===c?void 0:c.color(e[t]))&&void 0!==h?h:null))return new ei(F,this);break;case u.Trigger:if(null!==(F=null!==(f=null===(d=this._runtimeInstance)||void 0===d?void 0:d.trigger(e[t]))&&void 0!==f?f:null))return new ee(F,this);break;case u.Enum:if(null!==(F=null!==(m=null===(p=this._runtimeInstance)||void 0===p?void 0:p.enum(e[t]))&&void 0!==m?m:null))return new et(F,this);break;case u.List:if(null!==(F=null!==(b=null===(v=this._runtimeInstance)||void 0===v?void 0:v.list(e[t]))&&void 0!==b?b:null))return new en(F,this);break;case u.Image:if(null!==(F=null!==(g=null===(y=this._runtimeInstance)||void 0===y?void 0:y.image(e[t]))&&void 0!==g?g:null))return new er(F,this);break;case u.Font:if(null!==(F=null!==(_=null===(w=this._runtimeInstance)||void 0===w?void 0:w.font(e[t]))&&void 0!==_?_:null))return new ea(F,this);break;case u.Artboard:if(null!==(F=null!==(C=null===(A=this._runtimeInstance)||void 0===A?void 0:A.artboard(e[t]))&&void 0!==C?C:null))return new eo(F,this)}return null},e.prototype.internalViewModelInstance=function(t){if(this._viewModelInstances.has(t))return this._viewModelInstances.get(t);var n,i=null===(n=this._runtimeInstance)||void 0===n?void 0:n.viewModel(t);if(null!==i){var r=new e(i,this);return(0,f.createFinalization)(r,i),r.internalIncrementReferenceCount(),this._viewModelInstances.set(t,r),r}return null},e.prototype.number=function(e){return this.propertyFromPath(e,u.Number)},e.prototype.string=function(e){return this.propertyFromPath(e,u.String)},e.prototype.boolean=function(e){return this.propertyFromPath(e,u.Boolean)},e.prototype.color=function(e){return this.propertyFromPath(e,u.Color)},e.prototype.trigger=function(e){return this.propertyFromPath(e,u.Trigger)},e.prototype.enum=function(e){return this.propertyFromPath(e,u.Enum)}
1,e.prototype.list=function(e){return this.propertyFromPath(e,u.List)},e.prototype.image=function(e){return this.propertyFromPath(e,u.Image)},e.prototype.font=function(e){return this.propertyFromPath(e,u.Font)},e.prototype.artboard=function(e){return this.propertyFromPath(e,u.Artboard)},e.prototype.viewModel=function(e){var t=e.split("/"),n=t.length>1?this.viewModelFromPathSegments(t.slice(0,t.length-1),0):this;return null!=n?n.internalViewModelInstance(t[t.length-1]):null},e.prototype.internalReplaceViewModel=function(e,t){var n;if(null!==t.runtimeInstance){var i=(null===(n=this._runtimeInstance)||void 0===n?void 0:n.replaceViewModel(e,t.runtimeInstance))||!1;if(i){t.internalIncrementReferenceCount();var r=this.internalViewModelInstance(e);null!==r&&(r.removeParent(this),this._children.includes(r)&&(this._children=this._children.filter(function(e){return e!==r})),r.cleanup()),this._viewModelInstances.set(e,t),t.addParent(this)}return i}return!1},e.prototype.replaceViewModel=function(e,t){var n,i=e.split("/"),r=i.length>1?this.viewModelFromPathSegments(i.slice(0,i.length-1),0):this;return null!==(n=null==r?void 0:r.internalReplaceViewModel(i[i.length-1],t))&&void 0!==n&&n},e.prototype.incrementReferenceCount=function(){var e;this._referenceCount++,null===(e=this._runtimeInstance)||void 0===e||e.incrementReferenceCount()},e.prototype.decrementReferenceCount=function(){var e;this._referenceCount--,null===(e=this._runtimeInstance)||void 0===e||e.decrementReferenceCount()},Object.defineProperty(e.prototype,"properties",{get:function(){var e;return(null===(e=this._runtimeInstance)||void 0===e?void 0:e.getProperties().map(function(e){return v({},e)}))||[]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewModelName",{get:function(){var e,t;return null!==(t=null===(e=this._runtimeInstance)||void 0===e?void 0:e.getViewModelName())&&void 0!==t?t:""},enumerable:!1,configurable:!0}),e.prototype.internalIncrementReferenceCount=function(){this._referenceCount++},e.prototype.cleanup=function(){var e,t=this;if(this._referenceCount--,this._referenceCount<=0){this.selfUnref&&(null===(e=this._runtimeInstance)||void 0===e||e.unref()),this._runtimeInstance=null,this.clearCallbacks(),this._propertiesWithCallbacks=[],this._viewModelInstances.forEach(function(e){e.cleanup()}),this._viewModelInstances.clear();var n=g([],this._children,!0);this._children.length=0;var i=g([],this._parents,!0);this._parents.length=0,n.forEach(function(e){e.removeParent(t)}),i.forEach(function(e){e.removeFromViewModelCallbacks(t)})}},e}(),J=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(e){this._viewModelInstanceValue.value=e},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e(this.value)},t}(K=function(){function e(e,t){this.callbacks=[],this._viewModelInstanceValue=e,this._parentViewModel=t}return e.prototype.on=function(e){0===this.callbacks.length&&this._viewModelInstanceValue.clearChanges(),this.callbacks.includes(e)||(this.callbacks.push(e),this._parentViewModel.addToPropertyCallbacks(this))},e.prototype.off=function(e){e?this.callbacks=this.callbacks.filter(function(t){return t!==e}):this.callbacks.length=0,0===this.callbacks.length&&this._parentViewModel.removeFromPropertyCallbacks(this)},e.prototype.internalHandleCallback=function(e){},e.prototype.handleCallbacks=function(){var e=this;this._viewModelInstanceValue.hasChanged&&this.callbacks.forEach(function(t){e.internalHandleCallback(t)})},e.prototype.clearChanges=function(){this._viewModelInstanceValue.clearChanges()},e.prototype.clearCallbacks=function(){this.callbacks.length=0},Object.defineProperty(e.prototype,"name",{get:function(){return this._viewModelInstanceValue.name},enumerable:!1,configurable:!0}),e}()),Q=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(e){this._viewModelInstanceValue.value=e}
1,enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e(this.value)},t}(K),Z=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(e){this._viewModelInstanceValue.value=e},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e(this.value)},t}(K),ee=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),t.prototype.trigger=function(){return this._viewModelInstanceValue.trigger()},t.prototype.internalHandleCallback=function(e){e()},t}(K),et=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(e){this._viewModelInstanceValue.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"valueIndex",{get:function(){return this._viewModelInstanceValue.valueIndex},set:function(e){this._viewModelInstanceValue.valueIndex=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){return this._viewModelInstanceValue.values},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e(this.value)},t}(K),en=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),Object.defineProperty(t.prototype,"length",{get:function(){return this._viewModelInstanceValue.size},enumerable:!1,configurable:!0}),t.prototype.addInstance=function(e){null!=e.runtimeInstance&&(this._viewModelInstanceValue.addInstance(e.runtimeInstance),e.addParent(this._parentViewModel))},t.prototype.addInstanceAt=function(e,t){return!!(null!=e.runtimeInstance&&this._viewModelInstanceValue.addInstanceAt(e.runtimeInstance,t))&&(e.addParent(this._parentViewModel),!0)},t.prototype.removeInstance=function(e){null!=e.runtimeInstance&&(this._viewModelInstanceValue.removeInstance(e.runtimeInstance),e.removeParent(this._parentViewModel))},t.prototype.removeInstanceAt=function(e){this._viewModelInstanceValue.removeInstanceAt(e)},t.prototype.instanceAt=function(e){var t=this._viewModelInstanceValue.instanceAt(e);if(null!=t){var n=new q(t,this._parentViewModel);return(0,f.createFinalization)(n,t),n}return null},t.prototype.swap=function(e,t){this._viewModelInstanceValue.swap(e,t)},t.prototype.internalHandleCallback=function(e){e()},t}(K),ei=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(e){this._viewModelInstanceValue.value=e},enumerable:!1,configurable:!0}),t.prototype.rgb=function(e,t,n){this._viewModelInstanceValue.rgb(e,t,n)},t.prototype.rgba=function(e,t,n,i){this._viewModelInstanceValue.argb(i,e,t,n)},t.prototype.argb=function(e,t,n,i){this._viewModelInstanceValue.argb(e,t,n,i)},t.prototype.alpha=function(e){this._viewModelInstanceValue.alpha(e)},t.prototype.opacity=function(e){this._viewModelInstanceValue.alpha(Math.round(255*Math.max(0,Math.min(1,e))))},t.prototype.internalHandleCallback=function(e){e(this.value)},t}(K),er=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),Object.defineProperty(t.prototype,"value",{set:function(e){var t;this._viewModelInstanceValue.value(null!==(t=null==e?void 0:e.nativeImage)&&void 0!==t?t:null)},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e()},t}(K),ea=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),Object.defineProperty(t.prototype,"value",{set:function(e){var t;this._viewModelInstanceValue.value(null!==(t=null==e?void 0:e.nativeFont)&&void 0!==t?t:null)},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e()},t}(K),eo=function(e){function t(t,n){return e.call(this,t,n)||this}return m(t,e),Object.defineProperty(t.prototype,"value",{set:function(e){var t,n,i;i=e.isBindableArtboard?e:e.file.internalBindableArtboardFromArtboard(e.nativeArtboard),this._viewModelInstanceValue.value(null!==(t=null==i?void 0:i.nativeArtboard)&&void 0!==t?t:null),(null==i?void 0:i.nativeViewModel)&&this._viewModelInstanceValue.viewModelInstance(null!==(n=null==i?void 0:i.nativeViewModel)&&void 0!==n?n:null)}
1,enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e()},t}(K),es=function(e){return b(void 0,void 0,void 0,function(){var t;return y(this,function(n){switch(n.label){case 0:return[4,fetch(new Request(e))];case 1:if(!(t=n.sent()).ok)throw Error("Failed to fetch the Rive file: HTTP ".concat(t.status));return[4,t.arrayBuffer()];case 2:return[2,n.sent()]}})})},el=function(e){return"string"==typeof e?[e]:e instanceof Array?e:[]},eu={EventManager:L,TaskQueueManager:j},ec=function(e){return b(void 0,void 0,void 0,function(){var t,n;return y(this,function(i){switch(i.label){case 0:return[4,new Promise(function(t){return h.RuntimeLoader.getInstance(function(n){n.decodeAudio(e,t)})})];case 1:return t=i.sent(),n=new f.AudioWrapper(t),f.finalizationRegistry.register(n,t),[2,n]}})})},eh=function(e){return b(void 0,void 0,void 0,function(){var t,n;return y(this,function(i){switch(i.label){case 0:return[4,new Promise(function(t){return h.RuntimeLoader.getInstance(function(n){n.decodeImage(e,t)})})];case 1:return t=i.sent(),n=new f.ImageWrapper(t),f.finalizationRegistry.register(n,t),[2,n]}})})},ed=function(e){return b(void 0,void 0,void 0,function(){var t,n;return y(this,function(i){switch(i.label){case 0:return[4,new Promise(function(t){return h.RuntimeLoader.getInstance(function(n){n.decodeFont(e,t)})})];case 1:return t=i.sent(),n=new f.FontWrapper(t),f.finalizationRegistry.register(n,t),[2,n]}})})},ev})(),e.exports=t()}}]);

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.