PageSourceSearch

https://card.discover.com/web/activation/home/static/js/957.cc8d94e3fab1be8b0f45.js

js discover.com collected 2026-09-24 08:29:04 UTC 166,522 bytes, 1 lines download raw bytes

1(globalThis.webpackChunk_cardissuer_activation_org_card_activation_app=globalThis.webpackChunk_cardissuer_activation_org_card_activation_app||[]).push([[957],{64052(e){var t;t=()=>(()=>{"use strict";var e=[,(e,t,n)=>{n.r(t),n.d(t,{Animation:()=>r.Animation});var r=n(2)},(e,t,n)=>{n.r(t),n.d(t,{Animation:()=>r});var r=function(){function e(e,t,n,r){this.animation=e,this.artboard=t,this.playing=r,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 r=n(4),i=n(5),a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},a.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"),r.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 r={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},i=e.wasmFallbackURL,a=null!==i&&t.toLowerCase()===i.toLowerCase();if(null===i||a){var o=a?"the configured WASM URL or its fallback (".concat(i,")"):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(r.type),"- Message: ".concat(r.message),"- WebAssembly-specific error: ".concat(r.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");e.notifyError(new Error(s))}else e.wasmBinary=null,e.setWasmUrl(i),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){(t instanceof ArrayBuffer||null===t)&&(e.wasmBinary=t)},e.getWasmBinary=function(){return e.wasmBinary},e.isLoading=!1,e.callBackQueue=[],e.wasmURL="https://unpkg.com/".concat(i.name,"@").concat(i.version,"/rive.wasm"),e.wasmFallbackURL="https://cdn.jsdelivr.net/npm/".concat(i.name,"@").concat(i.version,"/rive_fallback.wasm"),e.wasmBinary=null,e.errorCallbackQueue=[],e.enablePerfMarks=!1,e}()},(e,t,n)=>{var r;n.r(t),n.d(t,{default:()=>i});const i=(r="undefined"!=typeof document?document.currentScript?.src:void 0,function(e={}){var t,n,i=e,a=new Promise((e,r)=>{t=e,n=r}),o="object"==typeof window,s="function"==typeof importScripts;function u(){function e(e){const a=r;n=t=0,r=new Map,a.forEach(t=>{try{t(e)}catch(e){}}),this.gb(),i&&i.Hb()}let t=0,n=0,r=new Map,i=null,a=null;this.requestAnimationFrame=function(i){t||=requestAnimationFrame(e.bind(this));const a=++n;return r.set(a,i),a},this.cancelAnimationFrame=function(e){r.delete(e),t&&0==r.size&&(cancelAnimationFrame(t),t=0)},this.Fb=function(e){a&&(document.body.remove(a),a=null),e||(a=document.createElement("div"),a.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)),i=new function(){let t=0,n=0;this.Hb=function(){var r=performance.now();n?(++t,1e3<(r-=n)&&(e(1e3*t/r),t=n=0)):(n=r,t=0)}}},this.Cb=function(){a&&(document.body.remove(a),a=null),i=null},this.gb=function(){}}function l(e){const t=new Map;let n=-1/0;this.push=function(r){return r=r+((1<<e)-1)>>e,t.has(r)&&clearTimeout(t.get(r)),t.set(r,setTimeout(function(){t.delete(r),0==t.length?n=-1/0:r==n&&(n=Math.max(...t.ke
1ys()))},1e3)),n=Math.max(r,n),n<<e}}const c=i.onRuntimeInitialized;i.onRuntimeInitialized=function(){c&&c();let e=i.decodeAudio;i.decodeAudio=function(t,n){n(t=e(t))};let t=i.decodeFont;i.decodeFont=function(e,n){n(e=t(e))};let n=i.setFallbackFontCb;i.setFallbackFontCallback="function"==typeof n?function(e){n(e)}:function(){};const r=i.FileAssetLoader;i.ptrToAsset=e=>{let t=i.ptrToFileAsset(e);return t.isImage?i.ptrToImageAsset(e):t.isFont?i.ptrToFontAsset(e):t.isAudio?i.ptrToAudioAsset(e):t},i.CustomFileAssetLoader=r.extend("CustomFileAssetLoader",{__construct:function({loadContents:e}){this.__parent.__construct.call(this),this.ub=e},loadContents:function(e,t){return e=i.ptrToAsset(e),this.ub(e,t)}}),i.CDNFileAssetLoader=r.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(e){let t=i.ptrToAsset(e);return""!==(e=t.cdnUuid)&&(n=t.cdnBaseUrl+"/"+e,(r=new XMLHttpRequest).responseType="arraybuffer",r.onreadystatechange=function(){4==r.readyState&&200==r.status&&(e=>{t.decode(new Uint8Array(e.response))})(r)},r.open("GET",n,!0),r.send(null),!0);var n,r}}),i.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=i.computeAlignment;i.computeAlignment=function(e,t,n,r,i=1){return a.call(this,e,t,n,r,i)}};const d="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),h=new function(){function e(){if(!t){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};let s;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(s=e.getContext("webgl",o),n=1,!s)return!1}else if(s=e.getContext("webgl2",o))n=2;else{if(!(s=e.getContext("webgl",o)))return!1;n=1}function l(e,t,n){if(t=s.createShader(t),s.shaderSource(t,n),s.compileShader(t),0<((n=s.getShaderInfoLog(t))||"").length)throw n;s.attachShader(e,t)}if(s=new Proxy(s,{get:(e,t)=>e.isContextLost()?(u||(u=!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;u||(u=!0)}}),r=Math.min(s.getParameter(s.MAX_RENDERBUFFER_SIZE),s.getParameter(s.MAX_TEXTURE_SIZE)),l(e=s.createProgram(),s.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                }"),l(e,s.FRAGMENT_SHADER,"precision highp float;\n                uniform sampler2D image;\n                varying vec2 st;\n                void main() {\n                    gl_FragColor = texture2D(image, st);\n                }"),s.bindAttribLocation(e,0,"vertex"),s.bindAttribLocation(e,1,"uv"),s.linkProgram(e),0<((o=s.getProgramInfoLog(e))||"").trim().length)throw o;i=s.getUniformLocation(e,"mat"),a=s.getUniformLocation(e,"translate"),s.useProgram(e),s.bindBuffer(s.ARRAY_BUFFER,s.createBuffer()),s.enableVertexAttribArray(0),s.enableVertexAttribArray(1),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,s.createBuffer()),s.uniform1i(s.getUniformLocation(e,"image"),0),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t=s}return!0}let t=null,n=0,r=0,i=null,a=null,o=0,s=0,u=!1;e(),this.Tb=function(){return e(),r},this.Bb=function(e){t.deleteTexture&&t.deleteTexture(e)},this.Ab=function(r){if(!e())return null;const i=t.createTexture();return i?(t.bindTexture(t.TEXTURE_2D,i),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r),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),i):null};const c=new l(8),d=new l(8),h=new l(10),f=new l(10);this.Eb=function(n,r,u,l,p){if(e()){var v=c.push(n),m=d.push(r);if(t.canvas){for(var b of(t.canvas.width==v&&t.canvas.height==m||(t.canvas.width=v,t.canvas.height=m),t.viewport(0,m-r,n,r),t.disable(t.SCISSOR_TEST),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.enable(t.SCISSOR_TEST),u.sort((e,t)=>
1t.nb-e.nb),v=h.push(l),o!=v&&(t.bufferData(t.ARRAY_BUFFER,8*v,t.DYNAMIC_DRAW),o=v),v=0,u))t.bufferSubData(t.ARRAY_BUFFER,v,b.La),v+=4*b.La.length;for(var g of u)t.bufferSubData(t.ARRAY_BUFFER,v,g.rb),v+=4*g.rb.length;for(var y of(v=f.push(p),s!=v&&(t.bufferData(t.ELEMENT_ARRAY_BUFFER,2*v,t.DYNAMIC_DRAW),s=v),b=0,u))t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,b,y.indices),b+=2*y.indices.length;y=0,g=!0,v=b=0;for(const e of u){e.image.Da!=y&&(t.bindTexture(t.TEXTURE_2D,e.image.Ca||null),y=e.image.Da),e.Yb?(t.scissor(e.Ra,m-e.Sa-e.ab,e.kc,e.ab),g=!0):g&&(t.scissor(0,m-r,n,r),g=!1),u=2/n;const o=-2/r;t.uniform4f(i,e.da[0]*u*e.ua,e.da[1]*o*e.va,e.da[2]*u*e.ua,e.da[3]*o*e.va),t.uniform2f(a,e.da[4]*u*e.ua+u*(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,v),t.vertexAttribPointer(1,2,t.FLOAT,!1,0,v+4*l),t.drawElements(t.TRIANGLES,e.indices.length,t.UNSIGNED_SHORT,b),v+=4*e.La.length,b+=2*e.indices.length}}}},this.canvas=function(){return e()&&t.canvas}},f=i.onRuntimeInitialized;i.onRuntimeInitialized=function(){function e(e){switch(e){case p.srcOver:return"source-over";case p.screen:return"screen";case p.overlay:return"overlay";case p.darken:return"darken";case p.lighten:return"lighten";case p.colorDodge:return"color-dodge";case p.colorBurn:return"color-burn";case p.hardLight:return"hard-light";case p.softLight:return"soft-light";case p.difference:return"difference";case p.exclusion:return"exclusion";case p.multiply:return"multiply";case p.hue:return"hue";case p.saturation:return"saturation";case p.color:return"color";case p.luminosity:return"luminosity"}}function t(e){return"rgba("+((16711680&e)>>>16)+","+((65280&e)>>>8)+","+((255&e)>>>0)+","+((4278190080&e)>>>24)/255+")"}function n(){0<M.length&&(h.Eb(A.drawWidth(),A.drawHeight(),M,P,I),M=[],I=P=0,A.reset(512,512));for(const e of C){for(const t of e.G)t();e.G=[]}C.clear()}f&&f();var r=i.RenderPaintStyle;const a=i.RenderPath,o=i.RenderPaint,s=i.Renderer,l=i.StrokeCap,c=i.StrokeJoin,p=i.BlendMode,v=r.fill,m=r.stroke,b=i.FillRule.evenOdd;let g=1;var y=i.RenderImage.extend("CanvasRenderImage",{__construct:function({ha:e,sa:t}={}){this.__parent.__construct.call(this),this.Da=g,g=g+1&2147483647||1,this.ha=e,this.sa=t},__destruct:function(){this.Ca&&(h.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=h.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,r,i,a,o){var s=this.R,u=s.addPath;e=e.R;const l=new DOMMatrix;l.a=t,l.b=n,l.c=r,l.d=i,l.e=a,l.f=o,u.call(s,e,l)},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,r,i,a){this.R.bezierCurveTo(e,t,n,r,i,a)},close:function(){this.R.closePath()}}),_=o.extend("CanvasRenderPaint",{color:function(e){this.Pa=t(e)},thickness:function(e){this.xb=e},join:function(e){switch(e){case c.miter:this.Ba="miter";break;case c.round:this.Ba="round";break;case c.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(t){this.sb=e(t)},clearGradient:function(){this.fa=null},linearGradient:function(e,t,n,r){this.fa={ob:e,pb:t,Va:n,Wa:r,Ja:[]}},radialGradient:function(e,t,n,r){this.fa={ob:e,pb:t,Va:n,Wa:r,Ja:[],Sb:!0}},addStop:function(e,t){this.fa.Ja.push({color:e,stop:t})},completeGradient:function(){},draw:function(e,n,r,i){let a=this.wb;var o=this.Pa,s=this.fa;const u=e.globalCompositeOperation,l=e.globalAlpha;if(e.globalCompositeOperation=this.sb,e.globalAlpha=i,null!=s){o=s.ob;const n=s.pb,r=s.Va;var c=s.Wa;i=s.Ja,s.Sb?(s=r-o,c-=n,o=e.createRadialGradient(o,n,0,o,n,Math.sqrt(s*s+c*c))):o=e.createLinearGradient(o,n,r,c);for(let e=0,n=i.length;e<n;e++)s=i[e],o.addColorStop(s.stop,t(s.color));this.Pa=o,this.fa=null}switch(a){case m:e.strokeStyle=o,e.lineWidth=this.xb,e.lineCap=this.Aa,e.lineJoin=this.Ba,e.stroke(n);break;case v:e.fillStyle=o,e.fill(n,r)}e.globalCompositeOperation=u,e.globalAlpha=l}});const C=new Set;let A=null,M=[],P=0,I=0;
1var E=i.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=[]},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(){const 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,r,i,a){const 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]*r,o[s+1]*n+o[s+3]*r,o[s]*i+o[s+2]*a+o[s+4],o[s+1]*i+o[s+3]*a+o[s+5]),this.G.push(this.A.transform.bind(this.A,e,t,n,r,i,a))},rotate:function(e){const 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===b?"evenodd":"nonzero",Math.max(0,this.D[this.D.length-1])))},_drawRiveImage:function(t,n,r,i){var a=t.tb;if(a){var o=this.A,s=e(r),u=Math.max(0,i*this.D[this.D.length-1]);this.G.push(function(){o.globalCompositeOperation=s,o.globalAlpha=u,o.drawImage(a,0,0),o.globalAlpha=1})}},_getMatrix:function(e){const t=this.P,n=t.length-6;for(let r=0;6>r;++r)e[r]=t[n+r]},_drawImageMesh:function(t,r,a,o,s,u,l,c,d,f,p,v,m,b){let g,y,w;try{g=i.HEAPF32.slice(s>>2,(s>>2)+u),y=i.HEAPF32.slice(l>>2,(l>>2)+c),w=i.HEAPU16.slice(d>>1,(d>>1)+f)}catch(e){return}r=this.A.canvas.width,s=this.A.canvas.height,l=m-p,c=b-v,p=Math.max(p,0),v=Math.max(v,0),m=Math.min(m,r),b=Math.min(b,s);const _=m-p,E=b-v;if(!(0>=_||0>=E)){m=_<l||E<c,r=b=1;var R=Math.ceil(_*b),F=Math.ceil(E*r);s=h.Tb(),R>s&&(b*=s/R,R=s),F>s&&(r*=s/F,F=s),A||(A=new i.DynamicRectanizer(s),A.reset(512,512)),0>(s=A.addRect(R,F))&&(n(),C.add(this),s=A.addRect(R,F));var k=65535&s,T=s>>16;M.push({da:this.P.slice(this.P.length-6),image:t,Ra:k,Sa:T,Ub:p,Vb:v,kc:R,ab:F,ua:b,va:r,La:g,rb:y,indices:w,Yb:m,nb:t.Da<<1|(m?1:0)}),P+=u,I+=f;var L=this.A,O=e(a),S=Math.max(0,o*this.D[this.D.length-1]);this.G.push(function(){L.save(),L.resetTransform(),L.globalCompositeOperation=O,L.globalAlpha=S;const e=h.canvas();e&&L.drawImage(e,k,T,R,F,p,v,_,E),L.restore()})}},_clipPath:function(e){this.G.push(this.A.clip.bind(this.A,e.R,e.Na===b?"evenodd":"nonzero"))},clear:function(){C.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)}});i.makeRenderer=function(e){const t=new E(e),n=t.A;return new Proxy(t,{get(e,r){if("function"==typeof e[r])return function(...t){return e[r].apply(e,t)};if("function"==typeof n[r]){if(-1<d.indexOf(r))throw Error("RiveException: Method call to '"+r+"()' 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[r].bind(n,...e))}}return e[r]},set(e,r,i){if(r in n)return t.G.push(()=>{n[r]=i}),!0}})},i.decodeImage=function(e,t){new y({ha:t}).decode(e)},i.renderFactory={makeRenderPaint:function(){return new _},makeRenderPath:function(){return new w},makeRenderImage:function(){let e=F;return new y({sa:()=>{e.total++},ha:()=>{if(e.loaded++,e.loaded===e.total){const t=e.ready;t&&(t(),e.ready=null)}}})}};let R=i.load,F=null;i.load=function(e,t,n=!0){const r=new i.FallbackFileAssetLoader;return void 0!==t&&r.addLoader(t),n&&(t=new i.CDNFileAssetLoader,r.addLoader(t)),new Promise(function(t){let n=null;F={total:0,loaded:0,ready:function(){t(n)}},n=R(e,r),0==F.total&&t(n)})};let k=i.RendererWrapper.prototype.align;i.RendererWrapper.prototype.align=function(e,t,n,r,i=1){k.call(this,e,t,n,r,i)},r=new u,i.requestAnimationFrame=r.requestAnimationFrame.bind(r),i.cancelAnimationFrame=r.cancelAnimationFrame.bind(r),i.enableFPSCounter=r.Fb.bind(r),i.disableFPSCounter=r.Cb,r.gb=n,i.resolveAnimationFrame=n,i.cleanup=function(){A&&A.delete()}};var p,v,m=Object.assign({},i),b="./this.program",g="";(o||s)&&(s?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),r&&(g=r),g=g.startsWith("blob:")?"":g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1),s&&(v=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),p=(e,t,n)=>{if(z(e)){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.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 y,w=i.print||function(){}.bind(),_=i.printErr||function(){}.bind();Object.assign(i,m),m=null,i.thisProgram&&(b=i.thisProgram),i.wasmBinary&&(y=i.wasmBinary);var C,A,M,P,I,E,R,F,k,T=!1;function L(){var e=C.buffer;i.HEAP8=A=new Int8Array(e),i.HEAP16=P=new Int16Array(e),i.HEAPU8=M=new Uint8Array(e),i.HEAPU16=I=new Uint16Array(e),i.HEAP32=E=new Int32Array(e),i.HEAPU32=R=new Uint32Array(e),i.HEAPF32=F=new Float32Array(e),i.HEAPF64=k=new Float64Array(e)}var O=[],S=[],x=[];function j(){var e=i.preRun.shift();O.unshift(e)}var V=0,D=null,B=null;function W(e){throw i.onAbort?.(e),_(e="Aborted("+e+")"),T=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),n(e),e}var U,N=e=>e.startsWith("data:application/octet-stream;base64,"),z=e=>e.startsWith("file://");function H(e){if(e==U&&y)return new Uint8Array(y);if(v)return v(e);throw"both async and sync fetching of the wasm failed"}function $(e,t,n){return function(e){return y?Promise.resolve().then(()=>H(e)):new Promise((t,n)=>{p(e,e=>
1t(new Uint8Array(e)),()=>{try{t(H(e))}catch(e){n(e)}})})}(e).then(e=>WebAssembly.instantiate(e,t)).then(n,e=>{_(`failed to asynchronously prepare wasm: ${e}`),W(e)})}var Y,X,G={486221:(e,t,n,r,i)=>{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=r,window.miniaudio.device_state.started=i;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&&null==a.devices[a.devices.length-1];)a.devices.pop()},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(()=>{On(t.hb)},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},488399:()=>{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)},488703:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,488807:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},488978:(e,t,n,r,i,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(r,n,t),o.W.onaudioprocess=function(n){if(null!=o.na&&0!=o.na.length||(o.na=new Float32Array(F.buffer,i,r*t)),e==window.miniaudio.device_type.capture||e==window.miniaudio.device_type.duplex){for(var s=0;s<t;s+=1)for(var u=n.inputBuffer.getChannelData(s),l=o.na,c=0;c<r;c+=1)l[c*t+s]=u[c];xn(a,r,i)}if(e==window.miniaudio.device_type.playback||e==window.miniaudio.device_type.duplex)for(jn(a,r,i),s=0;s<n.outputBuffer.numberOfChannels;++s)for(u=n.outputBuffer.getChannelData(s),l=o.na,c=0;c<r;c+=1)u[c]=l[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){}),e==window.miniaudio.device_type.playback&&o.W.connect(o.I.destination),o.hb=a,window.miniaudio.track_device(o)},491855:e=>window.miniaudio.get_device_by_index(e).I.sampleRate,491928: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},492328:e=>{window.miniaudio.untrack_device_by_index(e)},492378:e=>{(e=window.miniaudio.get_device_by_index(e)).I.resume(),e.state=window.miniaudio.device_state.started},492517:e=>{(e=window.miniaudio.get_device_by_index(e)).I.suspend(),e.state=window.miniaudio.device_state.stopped}},q=e=>{for(;0<e.length;)e.shift()(i)};function K(){var e=E[+tt>>2];return tt+=4,e}var J=(e,t)=>{for(var n=0,r=e.length-1;0<=r;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},Q=e=>{var t="/"===e.charAt(0),n="/"===e.substr(-1);return(e=J(e.split("/").filter(e=>!!e),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},Z=e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&=t.substr(0,t.length-1),e+t):"."},ee=e=>{if("/"===e)return"/";var t=(e=(e=Q(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},te=e=>(te=(()=>
1{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);W("initRandomDevice")})())(e),ne=(...e)=>{for(var t="",n=!1,r=e.length-1;-1<=r&&!n;r--){if("string"!=typeof(n=0<=r?e[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,n="/"===n.charAt(0)}return(n?"/":"")+(t=J(t.split("/").filter(e=>!!e),!n).join("/"))||"."},re="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,ie=(e,t,n)=>{var r=t+n;for(n=t;e[n]&&!(n>=r);)++n;if(16<n-t&&e.buffer&&re)return re.decode(e.subarray(t,n));for(r="";t<n;){var i=e[t++];if(128&i){var a=63&e[t++];if(192==(224&i))r+=String.fromCharCode((31&i)<<6|a);else{var o=63&e[t++];65536>(i=224==(240&i)?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&e[t++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r},ae=[],oe=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);127>=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t},se=(e,t,n,r)=>{if(!(0<r))return 0;var i=n;r=n+r-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>=r)break;t[n++]=o}else{if(2047>=o){if(n+1>=r)break;t[n++]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;t[n++]=224|o>>12}else{if(n+3>=r)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-i};function ue(e,t){var n=Array(oe(e)+1);return e=se(e,n,0,n.length),t&&(n.length=e),n}var le=[];function ce(e,t){le[e]={input:[],F:[],T:t},De(e,de)}var de={open(e){var t=le[e.node.ta];if(!t)throw new Ce(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,r){if(!e.o||!e.o.T.$a)throw new Ce(60);for(var i=0,a=0;a<r;a++){try{var o=e.o.T.$a(e.o)}catch(e){throw new Ce(29)}if(void 0===o&&0===i)throw new Ce(6);if(null==o)break;i++,t[n+a]=o}return i&&(e.node.timestamp=Date.now()),i},write(e,t,n,r){if(!e.o||!e.o.T.Ga)throw new Ce(60);try{for(var i=0;i<r;i++)e.o.T.Ga(e.o,t[n+i])}catch(e){throw new Ce(29)}return r&&(e.node.timestamp=Date.now()),i}},he={$a(){e:{if(!ae.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(e=window.prompt("Input: "))&&(e+="\n"),!e){e=null;break e}ae=ue(e,!0)}e=ae.shift()}return e},Ga(e,t){null===t||10===t?(w(ie(e.F,0)),e.F=[]):0!=t&&e.F.push(t)},la(e){e.F&&0<e.F.length&&(w(ie(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]},fe={Ga(e,t){null===t||10===t?(_(ie(e.F,0)),e.F=[]):0!=t&&e.F.push(t)},la(e){e.F&&0<e.F.length&&(_(ie(e.F,0)),e.F=[])}};function pe(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 ve={L:null,S:()=>ve.createNode(null,"/",16895,0),createNode(e,t,n,r){if(24576==(61440&n)||4096==(61440&n))throw new Ce(63);return ve.L||(ve.L={dir:{node:{V:ve.i.V,N:ve.i.N,ga:ve.i.ga,qa:ve.i.qa,lb:ve.i.lb,qb:ve.i.qb,mb:ve.i.mb,kb:ve.i.kb,xa:ve.i.xa},stream:{Z:ve.l.Z}},file:{node:{V:ve.i.V,N:ve.i.N},stream:{Z:ve.l.Z,read:ve.l.read,write:ve.l.write,Qa:ve.l.Qa,cb:ve.l.cb,fb:ve.l.fb}},link:{node:{V:ve.i.V,N:ve.i.N,ia:ve.i.ia},stream:{}},Ta:{node:{V:ve.i.V,N:ve.i.N},stream:Ve}}),16384==(61440&(n=ke(e,t,n,r)).mode)?(n.i=ve.L.dir.node,n.l=ve.L.dir.stream,n.j={}):32768==(61440&n.mode)?(n.i=ve.L.file.node,n.l=ve.L.file.stream,n.u=0,n.j=null):40960==(61440&n.mode)?(n.i=ve.L.link.node,n.l=ve.L.link.stream):8192==(61440&n.mode)&&(n.i=ve.L.Ta.node,n.l=ve.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 Ae[44]},qa:(e,t,n,r)=>ve.createNode(e,t,n,r),lb(e,t,n){if(16384==(61440&e.mode)){try{var r=Fe(t,n)}catch(e){}if(r)for(var i in r.j)throw new Ce(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,r=Fe(e,t);for(n in r.j)throw new Ce(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=ve.createNode(e,t,41471,0)).link=n,e),ia(e){if(40960!=(61440&e.mode))throw new Ce(28);return e.link}},l:{read(e,t,n,r,i){var a=e.node.j;if(i>=e.node.u)return 0;if(8<(e=Math.min(e.node.u-i,r))&&a.subarray)t.set(a.subarray(i,i+e),n);else for(r=0;r<e;r++)t[n+r]=a[i+r];return e},write(e,t,n,r,i,a){if(t.buffer===A.buffer&&(a=!1),!r)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+r),e.u=r;if(0===e.u&&0===i)return e.j=t.slice(n,n+r),e.u=r;if(i+r<=e.u)return e.j.set(t.subarray(n,n+r),i),r}if(pe(e,i+r),e.j.subarray&&t.subarray)e.j.set(t.subarray(n,n+r),i);else for(a=0;a<r;a++)e.j[i+a]=t[n+a];return e.u=Math.max(e.u,i+r),r},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 Ce(28);return t},Qa(e,t,n){pe(e.node,t+n),e.node.u=Math.max(e.node.u,t+n)},cb(e,t,n,r,i){if(32768!=(61440&e.node.mode))throw new Ce(43);if(e=e.node.j,2&i||e.buffer!==A.buffer){if((0<n||n+t<e.length)&&(e=e.subarray?e.subarray(n,n+t):Array.prototype.slice.call(e,n,n+t)),n=!0,W(),!(t=void 0))throw new Ce(48);A.set(e,t)}else n=!1,t=e.byteOffset;return{m:t,pc:n}},fb:(e,t,n,r)=>(ve.l.write(e,t,0,r,n,!1),0)}},me=null,be={},ge=[],ye=1,we=null,_e=!0,Ce=class{constructor(e){this.name="ErrnoError",this.Y=e}},Ae={},Me=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}},Pe=class{constructor(e,t,n,r){e||=this,this.parent=e,this.S=e.S,this.ra=null,this.id=ye++,this.name=t,this.mode=n,this.i={},this.l={},this.ta=r}get read(){return!(365&~this.mode)}set read(e){e?this.mode|=365:this.mode&=-366}get write(){return!(146&~this.mode)}set write(e){e?this.mode|=146:this.mode&=-147}};function Ie(e,t={}){if(!(e=ne(e)))return{path:"",node:null};if(8<(t=Object.assign({Za:!0,Ia:0},t)).Ia)throw new Ce(32);e=e.split("/").filter(e=>!!e);for(var n=me,r="/",i=0;i<e.length;i++){var a=i===e.length-1;if(a&&t.parent)break;if(n=Fe(n,e[i]),r=Q(r+"/"+e[i]),n.ra&&(!a||a&&t.Za)&&(n=n.ra.root),!a||t.Ya)for(a=0;40960==(61440&n.mode);)if(n=He(r),n=Ie(r=ne(Z(r),n),{Ia:t.Ia+1}).node,40<a++)throw new Ce(32)}return{path:r,node:n}}function Ee(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 Re(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>0)%we.length}function Fe(e,t){var n=16384==(61440&e.mode)?(n=Le(e,"x"))?n:e.i.ga?0:2:54;if(n)throw new Ce(n);for(n=we[Re(e.id,t)];n;n=n.Xb){var r=n.name;if(n.parent.id===e.id&&r===t)return n}return e.i.ga(e,t)}function ke(e,t,n,r){return t=Re((e=new Pe(e,t,n,r)).parent.id,e.name),e.Xb=we[t],we[t]=e}function Te(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function Le(e,t){return _e?0:!t.includes("r")||292&e.mode?t.includes("w")&&!(146&e.mode)||t.includes("x")&&!(73&e.mode)?2:0:2}function Oe(e,t){try{return Fe(e,t),20}catch(e){}return Le(e,"wx")}function Se(e){if(!(e=ge[e]))throw new Ce(8);return e}function xe(e,t=-1){if(e=Object.assign(new Me,e),-1==t)e:{for(t=0;4096>=t;t++)if(!ge[t])break e;throw new Ce(33)}return e.U=t,ge[t]=e}var je,Ve={open(e){e.l=be[e.node.ta].l,e.l.open?.(e)},Z(){throw new Ce(70)}};function De(e,t){be[e]={l:t}}function Be(e,t){var n="/"===t;if(n&&me)throw new Ce(10);if(!n&&t){var r=Ie(t,{Za:!1});if(t=r.path,(r=r.node).ra)throw new Ce(10);if(16384!=(61440&r.mode))throw new Ce(54)}t={type:e,Ic:{},eb:t,Wb:[]},(e=e.S(t)).S=t,t.root=e,n?me=e:r&&(r.ra=t,r.S&&r.S.Wb.push(t))}function We(e,t,n){var r=Ie(e,{parent:!0}).node;if(!(e=ee(e))||"."===e||".."===e)throw new Ce(28);var i=Oe(r,e);if(i)throw new Ce(i);if(!r.i.qa)throw new Ce(63);return r.i.qa(r,e,t,n)}function Ue(e){return We(e,16895,0)}function Ne(e,t,n){void 0===n&&(n=t,t=438),We(e,8192|t,n)}function ze(e,t){if(!ne(e))throw new Ce(44);var n=Ie(t,{parent:!0}).node;if(!n)throw new Ce(44);var r=Oe(n,t=ee(t));if(r)throw new Ce(r);if(!n.i.xa)throw new Ce(63);n.i.xa(n,t,e)}function He(e){if(!(e=Ie(e).node))throw new Ce(44);if(!e.i.ia)throw new Ce(28);return ne(Ee(e.parent),e.i.ia(e))}function $e(e,t,n){if(""===e)throw new Ce(44);if("string"==typeof t){var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[t];if(void 0===r)throw Error(`Unknown file open mode: ${t}`);t=r}if(n=64&t?4095&(void 0===n?438:n)|32768:0,"object"==typeof e)var a=e;else{e=Q(e);try{a=Ie(e,{Ya:!(131072&t)}).node}catch(e){}}if(r=!1,64&t)if(a){if(128&t)throw new Ce(20)}else a=We(e,n,0),r=!0;if(!a)throw new Ce(44);if(8192==(61440&a.mode)&&(t&=-513),65536&t&&16384!=(61440&a.mode))throw new Ce(54);if(!r&&(n=a?40960==(61440&a.mode)?32:16384==(61440&a.mode)&&("r"!==Te(t)||512&t)?31:Le(a,Te(t)):44))throw new Ce(n);
1if(512&t&&!r){if(!(n="string"==typeof(n=a)?Ie(n,{Ya:!0}).node:n).i.N)throw new Ce(63);if(16384==(61440&n.mode))throw new Ce(31);if(32768!=(61440&n.mode))throw new Ce(28);if(r=Le(n,"w"))throw new Ce(r);n.i.N(n,{size:0,timestamp:Date.now()})}return t&=-131713,(a=xe({node:a,path:Ee(a),flags:t,seekable:!0,position:0,l:a.l,jc:[],error:!1})).l.open&&a.l.open(a),!i.logReadFiles||1&t||(qe||={},e in qe||(qe[e]=1)),a}function Ye(e,t,n){if(null===e.U)throw new Ce(8);if(!e.seekable||!e.l.Z)throw new Ce(70);if(0!=n&&1!=n&&2!=n)throw new Ce(28);e.position=e.l.Z(e,t,n),e.jc=[]}function Xe(e,t,n){e=Q("/dev/"+e);var r=((e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n})(!!t,!!n);Ge||=64;var i=Ge++<<8;De(i,{open(e){e.seekable=!1},close(){n?.buffer?.length&&n(10)},read(e,n,r,i){for(var a=0,o=0;o<i;o++){try{var s=t()}catch(e){throw new Ce(29)}if(void 0===s&&0===a)throw new Ce(6);if(null==s)break;a++,n[r+o]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,t,r,i){for(var a=0;a<i;a++)try{n(t[r+a])}catch(e){throw new Ce(29)}return i&&(e.node.timestamp=Date.now()),a}}),Ne(e,r,i)}var Ge,qe,Ke,Je,Qe,Ze,et,tt=void 0,nt=(e,t)=>Object.defineProperty(t,"name",{value:e}),rt=[],it=[],at=e=>{if(!e)throw new Ke("Cannot use deleted val. handle = "+e);return it[e]},ot=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const t=rt.pop()||it.length;return it[t]=e,it[t+1]=1,t}},st=e=>{var t=Error,n=nt(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},ut=e=>{for(var t="";M[e];)t+=Qe[M[e++]];return t},lt=[],ct=()=>{for(;lt.length;){var e=lt.pop();e.g.ca=!1,e.delete()}},dt={},ht=(e,t)=>{if(void 0===t)throw new Ke("ptr should not be undefined");for(;e.B;)t=e.ja(t),e=e.B;return t},ft={},pt=e=>{e=Ln(e);var t=ut(e);return kn(e),t},vt=(e,t)=>{var n=ft[e];if(void 0===n)throw e=`${t} has unknown type ${pt(e)}`,new Ke(e);return n},mt=()=>{},bt=!1,gt=(e,t,n)=>t===n?e:void 0===n.B||null===(e=gt(e,t,n.B))?null:n.Db(e),yt={},wt=(e,t)=>{if(!t.s||!t.m)throw new et("makeClassHandle requires ptr and ptrType");if(!!t.H!=!!t.C)throw new et("Both smartPtrType and smartPtr must be specified");return t.count={value:1},_t(Object.create(e,{g:{value:t,writable:!0}}))},_t=e=>"undefined"==typeof FinalizationRegistry?(_t=e=>e,e):(bt=new FinalizationRegistry(e=>{--(e=e.g).count.value,0===e.count.value&&(e.C?e.H.M(e.C):e.s.h.M(e.m))}),mt=e=>{bt.unregister(e)},(_t=e=>{var t=e.g;return t.C&&bt.register(e,{g:t},e),e})(e)),Ct={},At=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function Mt(e){return this.fromWireType(R[e>>2])}var Pt={},It={}
1,Et=(e,t,n)=>{function r(t){if((t=n(t)).length!==e.length)throw new et("Mismatched type converter count");for(var r=0;r<e.length;++r)Rt(e[r],t[r])}e.forEach(function(e){It[e]=t});var i=Array(t.length),a=[],o=0;t.forEach((e,t)=>{ft.hasOwnProperty(e)?i[t]=ft[e]:(a.push(e),Pt.hasOwnProperty(e)||(Pt[e]=[]),Pt[e].push(()=>{i[t]=ft[e],++o===a.length&&r(i)}))}),0===a.length&&r(i)};function Rt(e,t,n={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,n={}){var r=t.name;if(!e)throw new Ke(`type "${r}" must have a positive integer typeid pointer`);if(ft.hasOwnProperty(e)){if(n.Nb)return;throw new Ke(`Cannot register type '${r}' twice`)}ft[e]=t,delete It[e],Pt.hasOwnProperty(e)&&(t=Pt[e],delete Pt[e],t.forEach(e=>e()))}(e,t,n)}var Ft=e=>{throw new Ke(e.g.s.h.name+" instance already deleted")};function kt(){}var Tt=(e,t,n)=>{if(void 0===e[t].v){var r=e[t];e[t]=function(...r){if(!e[t].v.hasOwnProperty(r.length))throw new Ke(`Function '${n}' called with an invalid number of arguments (${r.length}) - expects one of (${e[t].v})!`);return e[t].v[r.length].apply(this,r)},e[t].v=[],e[t].v[r.ba]=r}},Lt=(e,t,n)=>{if(i.hasOwnProperty(e)){if(void 0===n||void 0!==i[e].v&&void 0!==i[e].v[n])throw new Ke(`Cannot register public name '${e}' twice`);if(Tt(i,e,e),i.hasOwnProperty(n))throw new Ke(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`);i[e].v[n]=t}else i[e]=t,void 0!==n&&(i[e].Hc=n)};function Ot(e,t,n,r,i,a,o,s){this.name=e,this.constructor=t,this.K=n,this.M=r,this.B=i,this.Ib=a,this.ja=o,this.Db=s,this.ib=[]}var St=(e,t,n)=>{for(;t!==n;){if(!t.ja)throw new Ke(`Expected null or instance of ${n.name}, got an instance of ${t.name}`);e=t.ja(e),t=t.B}return e};function xt(e,t){if(null===t){if(this.Fa)throw new Ke(`null is not a valid ${this.name}`);return 0}if(!t.g)throw new Ke(`Cannot pass "${tn(t)}" as a ${this.name}`);if(!t.g.m)throw new Ke(`Cannot pass deleted object as a pointer of type ${this.name}`);return St(t.g.m,t.g.s.h,this.h)}function jt(e,t){if(null===t){if(this.Fa)throw new Ke(`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 Ke(`Cannot pass "${tn(t)}" as a ${this.name}`);if(!t.g.m)throw new Ke(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.oa&&t.g.s.oa)throw new Ke(`Cannot convert argument of type ${t.g.H?t.g.H.name:t.g.s.name} to parameter type ${this.name}`);if(n=St(t.g.m,t.g.s.h,this.h),this.pa){if(void 0===t.g.C)throw new Ke("Passing raw pointer to smart pointer is illegal");switch(this.dc){case 0:if(t.g.H!==this)throw new Ke(`Cannot convert argument of type ${t.g.H?t.g.H.name:t.g.s.name} to parameter type ${this.name}`);n=t.g.C;break;case 1:n=t.g.C;break;case 2:if(t.g.H===this)n=t.g.C;else{var r=t.clone();n=this.$b(n,ot(()=>r.delete())),null!==e&&e.push(this.M,n)}break;default:throw new Ke("Unsupporting sharing policy")}}return n}function Vt(e,t){if(null===t){if(this.Fa)throw new Ke(`null is not a valid ${this.name}`);return 0}if(!t.g)throw new Ke(`Cannot pass "${tn(t)}" as a ${this.name}`);if(!t.g.m)throw new Ke(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.g.s.oa)throw new Ke(`Cannot convert argument of type ${t.g.s.name} to parameter type ${this.name}`);return St(t.g.m,t.g.s.h,this.h)}function Dt(e,t,n,r,i,a,o,s,u,l,c){this.name=e,this.h=t,this.Fa=n,this.oa=r,this.pa=i,this.Zb=a,this.dc=o,this.jb=s,this.Ha=u,this.$b=l,this.M=c,i||void 0!==t.B?this.toWireType=jt:(this.toWireType=r?xt:Vt,this.J=null)}var Bt,Wt,Ut=(e,t,n)=>{if(!i.hasOwnProperty(e))throw new et("Replacing nonexistent public symbol");void 0!==i[e].v&&void 0!==n?i[e].v[n]=t:(i[e]=t,i[e].ba=n)},Nt=[],zt=e=>{var t=Nt[e];return t||(e>=Nt.length&&(Nt.length=e+1),Nt[e]=t=Bt.get(e)),t},Ht=(e,t)=>(...n)=>((e,t,n=[])=>(e.includes("j")?(e=e.replace(/p/g,"i"),t=(0,i["dynCall_"+e])(t,...n)):t=zt(t)(...n),t))(e,t,n),$t=(e,t)=>{var n=(e=ut(e)).includes("j")?Ht(e,t):zt(t);if("function"!=typeof n)throw new Ke(`unknown function pointer with signature ${e}: ${t}`);return n},Yt=(e,t)=>{var n=[],r={};throw t.forEach(function e(t){r[t]||ft[t]||(It[t]?It[t].forEach(e):(n.push(t),r[t]=!0))}),new Wt(`${e}: `+n.map(pt).join([", "]))};function Xt(e,t,n,r,i){var a=t.length;if(2>a)throw new Ke("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),u="void"!==t[0].name,l=a-2,c=Array(l),d=[],h=[];return nt(e,function(...n){if(n.length!==l)throw new Ke(`function ${e} called with ${n.length} arguments, expected ${l}`);if(h.length=0,d.length=o?2:1,d[0]=i,o){var a=t[1].toWireType(h,this);d[1]=a}for(var f=0;f<l;++f)c[f]=t[f+2].toWireType(h,n[f]),d.push(c[f]);if(n=r(...d),s)At(h);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 a=u?t[0].fromWireType(n):void 0})}var Gt,qt=(e,t)=>{for(var n=[],r=0;r<e;r++)n.push(R[t+4*r>>2]);return n},Kt=e=>{const t=(e=e.trim()).indexOf("(");return-1!==t?e.substr(0,t):e},Jt=(e,t,n)=>{if(!(e instanceof Object))throw new Ke(`${n}
1 with invalid "this": ${e}`);if(!(e instanceof t.h.constructor))throw new Ke(`${n} incompatible with "this" of type ${e.constructor.name}`);if(!e.g.m)throw new Ke(`cannot call emscripten binding method ${n} on deleted object`);return St(e.g.m,e.g.s.h,t.h)},Qt=e=>{9<e&&0===--it[e+1]&&(it[e]=void 0,rt.push(e))},Zt={name:"emscripten::val",fromWireType:e=>{var t=at(e);return Qt(e),t},toWireType:(e,t)=>ot(t),argPackAdvance:8,readValueFromPointer:Mt,J:null},en=(e,t,n)=>{switch(t){case 1:return n?function(e){return this.fromWireType(A[e])}:function(e){return this.fromWireType(M[e])};case 2:return n?function(e){return this.fromWireType(P[e>>1])}:function(e){return this.fromWireType(I[e>>1])};case 4:return n?function(e){return this.fromWireType(E[e>>2])}:function(e){return this.fromWireType(R[e>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},tn=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},nn=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(F[e>>2])};case 8:return function(e){return this.fromWireType(k[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},rn=(e,t,n)=>{switch(t){case 1:return n?e=>A[e]:e=>M[e];case 2:return n?e=>P[e>>1]:e=>I[e>>1];case 4:return n?e=>E[e>>2]:e=>R[e>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},an="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,on=(e,t)=>{for(var n=e>>1,r=n+t/2;!(n>=r)&&I[n];)++n;if(32<(n<<=1)-e&&an)return an.decode(M.subarray(e,n));for(n="",r=0;!(r>=t/2);++r){var i=P[e+2*r>>1];if(0==i)break;n+=String.fromCharCode(i)}return n},sn=(e,t,n)=>{if(n??=2147483647,2>n)return 0;var r=t;n=(n-=2)<2*e.length?n/2:e.length;for(var i=0;i<n;++i)P[t>>1]=e.charCodeAt(i),t+=2;return P[t>>1]=0,t-r},un=e=>2*e.length,ln=(e,t)=>{for(var n=0,r="";!(n>=t/4);){var i=E[e+4*n>>2];if(0==i)break;++n,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}return r},cn=(e,t,n)=>{if(n??=2147483647,4>n)return 0;var r=t;n=r+n-4;for(var i=0;i<e.length;++i){var a=e.charCodeAt(i);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),E[t>>2]=a,(t+=4)+4>n)break}return E[t>>2]=0,t-r},dn=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);55296<=r&&57343>=r&&++n,t+=4}return t},hn=(e,t,n)=>{var r=[];return e=e.toWireType(r,n),r.length&&(R[t>>2]=ot(r)),e},fn=[],pn={},vn=e=>{var t=pn[e];return void 0===t?ut(e):t},mn=Reflect.construct,bn=e=>0==e%4&&(0!=e%100||0==e%400),gn=[0,31,60,91,121,152,182,213,244,274,305,335],yn=[0,31,59,90,120,151,181,212,243,273,304,334],wn=[],_n={},Cn=()=>{if(!Gt){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",_:b||"./this.program"};for(e in _n)void 0===_n[e]?delete t[e]:t[e]=_n[e];var n=[];for(e in t)n.push(`${e}=${t[e]}`);Gt=n}return Gt},An=[31,29,31,30,31,30,31,31,30,31,30,31],Mn=[31,28,31,30,31,30,31,31,30,31,30,31],Pn=(e,t,n,r)=>{function i(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 i(e,t,"0")}function o(e,t){function n(e){return 0>e?-1:0<e?1:0}var r;return 0===(r=n(e.getFullYear()-t.getFullYear()))&&0===(r=n(e.getMonth()-t.getMonth()))&&(r=n(e.getDate()-t.getDate())),r}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 u(e){var t=e.$;for(e=new Date(new Date(e.aa+1900,0,1).getTime());0<t;){var n=e.getMonth(),r=(bn(e.getFullYear())?An:Mn)[n];if(!(t>r-e.getDate())){e.setDate(e.getDate()+t);break}t-=r-e.getDate()+1,e.setDate(1),11>n?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}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 l=R[r+40>>2];for(var c in r={hc:E[r>>2],fc:E[r+4>>2],ya:E[r+8>>2],Ka:E[r+12>>2],za:E[r+16>>2],aa:E[r+20>>2],O:E[r+24>>2],$:E[r+28>>2],Kc:E[r+32>>2],ec:E[r+36>>2],ic:l&&l?ie(M,l):""},n=n?ie(M,n):"",l={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(c,"g"),l[c]);var d="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),h="January February March April May June July August September October November December".split(" ");for(c in l={"%a":e=>d[e.O].substring(0,3),"%A":e=>d[e.O],"%b":e=>h[e.za].substring(0,3),"%B":e=>h[e.za],"%C":e=>a((e.aa+1900)/100|0,2),"%d":e=>a(e.Ka,2),"%e":e=>i(e.Ka,2," "),"%g":e=>u(e).toString().substring(2),"%G":u,"%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+=(bn(e.aa+1900)?An:Mn)[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":()=>"\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&&bn(e.aa)||(t=1));else{t=52;var n=(e.O+7-e.$-1)%7;(4==n||5==n&&bn(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 e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":e=>e.ic,"%%":()=>"%"},n=n.replace(/%%/g,"\0\0"),l)n.includes(c)&&(n=n.replace(new RegExp(c,"g"),l[c](r)));return(c=ue(n=n.replace(/\0\0/g,"%"),!1)).length>t?0:(A.set(c,e),c.length-1)};
1[44].forEach(e=>{Ae[e]=new Ce(e),Ae[e].stack="<generic error, no stack>"}),we=Array(4096),Be(ve,"/"),Ue("/tmp"),Ue("/home"),Ue("/home/web_user"),function(){Ue("/dev"),De(259,{read:()=>0,write:(e,t,n,r)=>r}),Ne("/dev/null",259),ce(1280,he),ce(1536,fe),Ne("/dev/tty",1280),Ne("/dev/tty1",1536);var e=new Uint8Array(1024),t=0,n=()=>(0===t&&(t=te(e).byteLength),e[--t]);Xe("random",n),Xe("urandom",n),Ue("/dev/shm"),Ue("/dev/shm/tmp")}(),function(){Ue("/proc");var e=Ue("/proc/self");Ue("/proc/self/fd"),Be({S(){var t=ke(e,"fd",16895,73);return t.i={ga(e,t){var n=Se(+t);return(e={parent:null,S:{eb:"fake"},i:{ia:()=>n.path}}).parent=e}},t}},"/proc/self/fd")}(),Ke=i.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},it.push(0,1,void 0,1,null,1,!0,1,!1,1),i.count_emval_handles=()=>it.length/2-5-rt.length,Je=i.PureVirtualError=st("PureVirtualError");for(var In=Array(256),En=0;256>En;++En)In[En]=String.fromCharCode(En);Qe=In,i.getInheritedInstanceCount=()=>Object.keys(dt).length,i.getLiveInheritedInstances=()=>{var e,t=[];for(e in dt)dt.hasOwnProperty(e)&&t.push(dt[e]);return t},i.flushPendingDeletes=ct,i.setDelayFunction=e=>{Ze=e,lt.length&&Ze&&Ze(ct)},et=i.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(kt.prototype,{isAliasOf:function(e){if(!(this instanceof kt&&e instanceof kt))return!1;var t=this.g.s.h,n=this.g.m;e.g=e.g;var r=e.g.s.h;for(e=e.g.m;t.B;)n=t.ja(n),t=t.B;for(;r.B;)e=r.ja(e),r=r.B;return t===r&&n===e},clone:function(){if(this.g.m||Ft(this),this.g.ea)return this.g.count.value+=1,this;var e=_t,t=Object,n=t.create,r=Object.getPrototypeOf(this),i=this.g;return(e=e(n.call(t,r,{g:{value:{count:i.count,ca:i.ca,ea:i.ea,m:i.m,s:i.s,C:i.C,H:i.H}}}))).g.count.value+=1,e.g.ca=!1,e},delete(){if(this.g.m||Ft(this),this.g.ca&&!this.g.ea)throw new Ke("Object already scheduled for deletion");mt(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||Ft(this),this.g.ca&&!this.g.ea)throw new Ke("Object already scheduled for deletion");return lt.push(this),1===lt.length&&Ze&&Ze(ct),this.g.ca=!0,this}}),Object.assign(Dt.prototype,{Jb(e){return this.jb&&(e=this.jb(e)),e},Ua(e){this.M?.(e)},argPackAdvance:8,readValueFromPointer:Mt,fromWireType:function(e){function t(){return this.pa?wt(this.h.K,{s:this.Zb,m:n,H:this,C:e}):wt(this.h.K,{s:this,m:e})}var n=this.Jb(e);if(!n)return this.Ua(e),null;var r=((e,t)=>(t=ht(e,t),dt[t]))(this.h,n);if(void 0!==r)return 0===r.g.count.value?(r.g.m=n,r.g.C=e,r.clone()):(r=r.clone(),this.Ua(e),r);if(r=this.h.Ib(n),!(r=yt[r]))return t.call(this);r=this.oa?r.zb:r.pointerType;var i=gt(n,this.h,r.h);return null===i?t.call(this):this.pa?wt(r.h.K,{s:r,m:i,H:this,C:e}):wt(r.h.K,{s:r,m:i})}}),Wt=i.UnboundTypeError=st("UnboundTypeError");var Rn={__syscall_fcntl64:function(e,t,n){tt=n;try{var r=Se(e);switch(t){case 0:var i=K();if(0>i)break;for(;ge[i];)i++;return function(e,t=-1){return e=xe(e,t),e.l?.zc?.(e),e}(r,i).U;case 1:case 2:case 13:case 14:return 0;case 3:return r.flags;case 4:return i=K(),r.flags|=i,0;case 12:return i=K(),P[i+0>>1]=2,0}return-28}catch(e){if("ErrnoError"!==e.name)throw e;return-e.Y}},__syscall_ioctl:function(e,t,n){tt=n;try{var r=Se(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return r.o?0:-59;case 21505:if(!r.o)return-59;if(r.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 i=K();E[i>>2]=25856,E[i+4>>2]=5,E[i+8>>2]=191,E[i+12>>2]=35387;for(var a=0;32>a;a++)A[i+a+17]=e[a]||0}return 0;case 21506:case 21507:case 21508:if(!r.o)return-59;if(r.o.T.Qb)for(i=K(),e=[],a=0;32>a;a++)e.push(A[i+a+17]);return 0;case 21519:return r.o?(i=K(),E[i>>2]=0):-59;case 21520:return r.o?-28:-59;case 21531:if(i=K(),!r.l.Ob)throw new Ce(59);return r.l.Ob(r,t,i);case 21523:return r.o?(r.o.T.Rb&&(a=[24,80],i=K(),P[i>>1]=a[0],P[i+2>>1]=a[1]),0):-59;default:return-28}}catch(e){if("ErrnoError"!==e.name)throw e;return-e.Y}}
1,__syscall_openat:function(e,t,n,r){tt=r;try{var i=t=t?ie(M,t):"";if("/"===i.charAt(0))t=i;else{var a=-100===e?"/":Se(e).path;if(0==i.length)throw new Ce(44);t=Q(a+"/"+i)}return $e(t,n,r?K():0).U}catch(e){if("ErrnoError"!==e.name)throw e;return-e.Y}},_abort_js:()=>{W("")},_embind_create_inheriting_constructor:(e,t,n)=>{e=ut(e),t=vt(t,"wrapper"),n=at(n);var r=t.h,i=r.K,a=r.B.K,o=r.B.constructor;return e=nt(e,function(...e){r.B.ib.forEach(function(e){if(this[e]===a[e])throw new Je(`Pure virtual function ${e} must be implemented in JavaScript`)}.bind(this)),Object.defineProperty(this,"__parent",{value:i}),this.__construct(...e)}),i.__construct=function(...e){if(this===i)throw new Ke("Pass correct 'this' to __construct");e=o.implement(this,...e),mt(e);var t=e.g;if(e.notifyOnDestruction(),t.ea=!0,Object.defineProperties(this,{g:{value:t}}),_t(this),e=t.m,e=ht(r,e),dt.hasOwnProperty(e))throw new Ke(`Tried to register registered instance: ${e}`);dt[e]=this},i.__destruct=function(){if(this===i)throw new Ke("Pass correct 'this' to __destruct");mt(this);var e=this.g.m;if(e=ht(r,e),!dt.hasOwnProperty(e))throw new Ke(`Tried to unregister unregistered instance: ${e}`);delete dt[e]},e.prototype=Object.create(i),Object.assign(e.prototype,n),ot(e)},_embind_finalize_value_object:e=>{var t=Ct[e];delete Ct[e];var n=t.Ha,r=t.M,i=t.Xa,a=i.map(e=>e.Mb).concat(i.map(e=>e.bc));Et([e],a,e=>{var a={};return i.forEach((t,n)=>{var r=e[n],o=t.Kb,s=t.Lb,u=e[n+i.length],l=t.ac,c=t.cc;a[t.Gb]={read:e=>r.fromWireType(o(s,e)),write:(e,t)=>{var n=[];l(c,e,u.toWireType(n,t)),At(n)}}}),[{name:t.name,fromWireType:e=>{var t,n={};for(t in a)n[t]=a[t].read(e);return r(e),n},toWireType:(e,t)=>{for(var i in a)if(!(i in t))throw new TypeError(`Missing field: "${i}"`);var o=n();for(i in a)a[i].write(o,t[i]);return null!==e&&e.push(r,o),o},argPackAdvance:8,readValueFromPointer:Mt,J:r}]})},_embind_register_bigint:()=>{},_embind_register_bool:(e,t,n,r)=>{Rt(e,{name:t=ut(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(M[e])},J:null})},_embind_register_class:(e,t,n,r,i,a,o,s,u,l,c,d,h)=>{c=ut(c),a=$t(i,a),s&&=$t(o,s),l&&=$t(u,l),h=$t(d,h);var f=(e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e})(c);Lt(f,function(){Yt(`Cannot construct ${c} due to unbound types`,[r])}),Et([e,t,n],r?[r]:[],t=>{if(t=t[0],r)var n=t.h,i=n.K;else i=kt.prototype;t=nt(c,function(...e){if(Object.getPrototypeOf(this)!==o)throw new Ke("Use 'new' to construct "+c);if(void 0===d.X)throw new Ke(c+" has no accessible constructor");var t=d.X[e.length];if(void 0===t)throw new Ke(`Tried to invoke ctor of ${c} with invalid number of parameters (${e.length}) - expected (${Object.keys(d.X).toString()}) parameters instead!`);return t.apply(this,e)});var o=Object.create(i,{constructor:{value:t}});t.prototype=o;var u,d=new Ot(c,t,o,h,n,a,s,l);return d.B&&((u=d.B).ka??(u.ka=[]),d.B.ka.push(d)),n=new Dt(c,d,!0,!1,!1),u=new Dt(c+"*",d,!1,!1,!1),i=new Dt(c+" const*",d,!1,!0,!1),yt[e]={pointerType:u,zb:i},Ut(f,t),[n,u,i]})},_embind_register_class_class_function:(e,t,n,r,i,a,o)=>{var s=qt(n,r);t=ut(t),t=Kt(t),a=$t(i,a),Et([],[e],e=>{function r(){Yt(`Cannot call ${i} due to unbound types`,s)}var i=`${(e=e[0]).name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var u=e.h.constructor;return void 0===u[t]?(r.ba=n-1,u[t]=r):(Tt(u,t,i),u[t].v[n-1]=r),Et([],s,r=>{if(r=Xt(i,[r[0],null].concat(r.slice(1)),null,a,o),void 0===u[t].v?(r.ba=n-1,u[t]=r):u[t].v[n-1]=r,e.h.ka)for(const n of e.h.ka)n.constructor.hasOwnProperty(t)||(n.constructor[t]=r);return[]}),[]})},_embind_register_class_class_property:(e,t,n,r,i,a,o,s)=>{t=ut(t),a=$t(i,a),Et([],[e],e=>{var i=`${(e=e[0]).name}.${t}`,u={get(){Yt(`Cannot access ${i} due to unbound types`,[n])},enumerable:!0,configurable:!0};return u.set=s?()=>{Yt(`Cannot access ${i} due to unbound types`,[n])}:()=>{throw new Ke(`${i} is a read-only property`)},Object.defineProperty(e.h.constructor,t,u),Et([],[n],n=>{n=n[0];var i={get:()=>n.fromWireType(a(r)),enumerable:!0};return s&&(s=$t(o,s),i.set=e=>{var t=[];s(r,n.toWireType(t,e)),At(t)}),Object.defineProperty(e.h.constructor,t,i),[]}),[]})},_embind_register_class_constructor:(e,t,n,r,i,a)=>{var o=qt(t,n);i=$t(r,i),Et([],[e],e=>{var n=`constructor ${(e=e[0]).name}`;if(void 0===e.h.X&&(e.h.X=[]),void 0!==e.h.X[t-1])throw new Ke(`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]=()=>{Yt(`Cannot construct ${e.name} due to unbound types`,o)},Et([],o,r=>(r.splice(1,0,null),e.h.X[t-1]=Xt(n,r,null,i,a),[])),[]})},_embind_register_class_function:(e,t,n,r,i,a,o,s)=>{var u=qt(n,r);t=ut(t),t=Kt(t),a=$t(i,a),Et([],[e],e=>{function r(){Yt(`Cannot call ${i} due to unbound types`,u)}var i=`${(e=e[0]).name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.h.ib.push(t);var l=e.h.K,c=l[t];return void 0===c||void 0===c.v&&c.className!==e.name&&c.ba===n-2?(r.ba=n-2,r.className=e.n
1ame,l[t]=r):(Tt(l,t,i),l[t].v[n-2]=r),Et([],u,r=>(r=Xt(i,r,e,a,o),void 0===l[t].v?(r.ba=n-2,l[t]=r):l[t].v[n-2]=r,[])),[]})},_embind_register_class_property:(e,t,n,r,i,a,o,s,u,l)=>{t=ut(t),i=$t(r,i),Et([],[e],e=>{var r=`${(e=e[0]).name}.${t}`,c={get(){Yt(`Cannot access ${r} due to unbound types`,[n,o])},enumerable:!0,configurable:!0};return c.set=u?()=>Yt(`Cannot access ${r} due to unbound types`,[n,o]):()=>{throw new Ke(r+" is a read-only property")},Object.defineProperty(e.h.K,t,c),Et([],u?[n,o]:[n],n=>{var o=n[0],c={get(){var t=Jt(this,e,r+" getter");return o.fromWireType(i(a,t))},enumerable:!0};if(u){u=$t(s,u);var d=n[1];c.set=function(t){var n=Jt(this,e,r+" setter"),i=[];u(l,n,d.toWireType(i,t)),At(i)}}return Object.defineProperty(e.h.K,t,c),[]}),[]})},_embind_register_emval:e=>Rt(e,Zt),_embind_register_enum:(e,t,n,r)=>{function i(){}t=ut(t),i.values={},Rt(e,{name:t,constructor:i,fromWireType:function(e){return this.constructor.values[e]},toWireType:(e,t)=>t.value,argPackAdvance:8,readValueFromPointer:en(t,n,r),J:null}),Lt(t,i)},_embind_register_enum_value:(e,t,n)=>{var r=vt(e,"enum");t=ut(t),e=r.constructor,r=Object.create(r.constructor.prototype,{value:{value:n},constructor:{value:nt(`${r.name}_${t}`,function(){})}}),e.values[n]=r,e[t]=r},_embind_register_float:(e,t,n)=>{Rt(e,{name:t=ut(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:8,readValueFromPointer:nn(t,n),J:null})},_embind_register_function:(e,t,n,r,i,a)=>{var o=qt(t,n);e=ut(e),e=Kt(e),i=$t(r,i),Lt(e,function(){Yt(`Cannot call ${e} due to unbound types`,o)},t-1),Et([],o,n=>(Ut(e,Xt(e,[n[0],null].concat(n.slice(1)),null,i,a),t-1),[]))},_embind_register_integer:(e,t,n,r,i)=>{if(t=ut(t),-1===i&&(i=4294967295),i=e=>e,0===r){var a=32-8*n;i=e=>e<<a>>>a}var o=t.includes("unsigned")?function(e,t){return t>>>0}:function(e,t){return t};Rt(e,{name:t,fromWireType:i,toWireType:o,argPackAdvance:8,readValueFromPointer:rn(t,n,0!==r),J:null})},_embind_register_memory_view:(e,t,n)=>{function r(e){return new i(A.buffer,R[e+4>>2],R[e>>2])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];Rt(e,{name:n=ut(n),fromWireType:r,argPackAdvance:8,readValueFromPointer:r},{Nb:!0})},_embind_register_std_string:(e,t)=>{var n="std::string"===(t=ut(t));Rt(e,{name:t,fromWireType:function(e){var t=R[e>>2],r=e+4;if(n)for(var i=r,a=0;a<=t;++a){var o=r+a;if(a==t||0==M[o]){if(i=i?ie(M,i,o-i):"",void 0===s)var s=i;else s+=String.fromCharCode(0),s+=i;i=o+1}}else{for(s=Array(t),a=0;a<t;++a)s[a]=String.fromCharCode(M[r+a]);s=s.join("")}return kn(e),s},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r="string"==typeof t;if(!(r||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array))throw new Ke("Cannot pass non-string to std::string");var i=n&&r?oe(t):t.length,a=Tn(4+i+1),o=a+4;if(R[a>>2]=i,n&&r)se(t,M,o,i+1);else if(r)for(r=0;r<i;++r){var s=t.charCodeAt(r);if(255<s)throw kn(o),new Ke("String has UTF-16 code units that do not fit in 8 bits");M[o+r]=s}else for(r=0;r<i;++r)M[o+r]=t[r];return null!==e&&e.push(kn,a),a},argPackAdvance:8,readValueFromPointer:Mt,J(e){kn(e)}})},_embind_register_std_wstring:(e,t,n)=>{if(n=ut(n),2===t)var r=on,i=sn,a=un,o=e=>I[e>>1];else 4===t&&(r=ln,i=cn,a=dn,o=e=>R[e>>2]);Rt(e,{name:n,fromWireType:e=>{for(var n,i=R[e>>2],a=e+4,s=0;s<=i;++s){var u=e+4+s*t;s!=i&&0!=o(u)||(a=r(a,u-a),void 0===n?n=a:(n+=String.fromCharCode(0),n+=a),a=u+t)}return kn(e),n},toWireType:(e,r)=>{if("string"!=typeof r)throw new Ke(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=Tn(4+o+t);return R[s>>2]=o/t,i(r,s+4,o+t),null!==e&&e.push(kn,s),s},argPackAdvance:8,readValueFromPointer:Mt,J(e){kn(e)}})},_embind_register_value_object:(e,t,n,r,i,a)=>{Ct[e]={name:ut(t),Ha:$t(n,r),M:$t(i,a),Xa:[]}},_embind_register_value_object_field:(e,t,n,r,i,a,o,s,u,l)=>{Ct[e].Xa.push({Gb:ut(t),Mb:n,Kb:$t(r,i),Lb:a,bc:o,ac:$t(s,u),cc:l})},_embind_register_void:(e,t)=>{Rt(e,{Dc:!0,name:t=ut(t),argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}})},_emscripten_get_now_is_monotonic:()=>1,_emscripten_memcpy_js:(e,t,n)=>M.copyWithin(e,t,t+n),_emscripten_throw_longjmp:()=>{throw 1/0},_emval_as:(e,t,n)=>(e=at(e),t=vt(t,"emval::as"),hn(t,n,e)),_emval_call:(e,t,n,r)=>
1(e=fn[e])(null,t=at(t),n,r),_emval_call_method:(e,t,n,r,i)=>(e=fn[e])(t=at(t),t[n=vn(n)],r,i),_emval_decref:Qt,_emval_get_method_caller:(e,t,n)=>{var r=((e,t)=>{for(var n=Array(e),r=0;r<e;++r)n[r]=vt(R[t+4*r>>2],"parameter "+r);return n})(e,t),i=r.shift();e--;var a=Array(e);return t=`methodCaller<(${r.map(e=>e.name).join(", ")}) => ${i.name}>`,(e=>{var t=fn.length;return fn.push(e),t})(nt(t,(t,o,s,u)=>{for(var l=0,c=0;c<e;++c)a[c]=r[c].readValueFromPointer(u+l),l+=r[c].argPackAdvance;return t=1===n?mn(o,a):o.apply(t,a),hn(i,s,t)}))},_emval_get_module_property:e=>(e=vn(e),ot(i[e])),_emval_get_property:(e,t)=>(e=at(e),t=at(t),ot(e[t])),_emval_incref:e=>{9<e&&(it[e+1]+=1)},_emval_new_array:()=>ot([]),_emval_new_cstring:e=>ot(vn(e)),_emval_new_object:()=>ot({}),_emval_run_destructors:e=>{var t=at(e);At(t),Qt(e)},_emval_set_property:(e,t,n)=>{e=at(e),t=at(t),n=at(n),e[t]=n},_emval_take_value:(e,t)=>(e=(e=vt(e,"_emval_take_value")).readValueFromPointer(t),ot(e)),_gmtime_js:function(e,t,n){e=new Date(1e3*(t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN)),E[n>>2]=e.getUTCSeconds(),E[n+4>>2]=e.getUTCMinutes(),E[n+8>>2]=e.getUTCHours(),E[n+12>>2]=e.getUTCDate(),E[n+16>>2]=e.getUTCMonth(),E[n+20>>2]=e.getUTCFullYear()-1900,E[n+24>>2]=e.getUTCDay(),E[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)),E[n>>2]=e.getSeconds(),E[n+4>>2]=e.getMinutes(),E[n+8>>2]=e.getHours(),E[n+12>>2]=e.getDate(),E[n+16>>2]=e.getMonth(),E[n+20>>2]=e.getFullYear()-1900,E[n+24>>2]=e.getDay(),E[n+28>>2]=(bn(e.getFullYear())?gn:yn)[e.getMonth()]+e.getDate()-1|0,E[n+36>>2]=-60*e.getTimezoneOffset(),t=new Date(e.getFullYear(),6,1).getTimezoneOffset();var r=new Date(e.getFullYear(),0,1).getTimezoneOffset();E[n+32>>2]=0|(t!=r&&e.getTimezoneOffset()==Math.min(r,t))},_tzset_js:(e,t,n,r)=>{var i=(new Date).getFullYear(),a=new Date(i,0,1),o=new Date(i,6,1);i=a.getTimezoneOffset();var s=o.getTimezoneOffset();R[e>>2]=60*Math.max(i,s),E[t>>2]=Number(i!=s),a=(e=e=>e.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1])(a),o=e(o),s<i?(se(a,M,n,17),se(o,M,r,17)):(se(a,M,r,17),se(o,M,n,17))},emscripten_asm_const_int:(e,t,n)=>{wn.length=0;for(var r;r=M[t++];){var i=105!=r;n+=(i&=112!=r)&&n%8?4:0,wn.push(112==r?R[n>>2]:105==r?E[n>>2]:k[n>>3]),n+=i?8:4}return G[e](...wn)},emscripten_date_now:()=>Date.now(),emscripten_get_now:()=>performance.now(),emscripten_resize_heap:e=>{var t=M.length;if(2147483648<(e>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);var i=Math;r=Math.max(e,r);e:{i=(i.min.call(i,2147483648,r+(65536-r%65536)%65536)-C.buffer.byteLength+65535)/65536;try{C.grow(i),L();var a=1;break e}catch(e){}a=void 0}if(a)return!0}return!1},environ_get:(e,t)=>{var n=0;return Cn().forEach((r,i)=>{var a=t+n;for(i=R[e+4*i>>2]=a,a=0;a<r.length;++a)A[i++]=r.charCodeAt(a);A[i]=0,n+=r.length+1}),0},environ_sizes_get:(e,t)=>{var n=Cn();R[e>>2]=n.length;var r=0;return n.forEach(e=>r+=e.length+1),R[t>>2]=r,0},fd_close:function(e){try{var t=Se(e);if(null===t.U)throw new Ce(8);t.Ea&&(t.Ea=null);try{t.l.close&&t.l.close(t)}catch(e){throw e}finally{ge[t.U]=null}return t.U=null,0}catch(e){if("ErrnoError"!==e.name)throw e;return e.Y}},fd_read:function(e,t,n,r){try{e:{var i=Se(e);e=t;for(var a,o=t=0;o<n;o++){var s=R[e>>2],u=R[e+4>>2];e+=8;var l=i,c=a,d=A;if(0>u||0>c)throw new Ce(28);if(null===l.U)throw new Ce(8);if(1==(2097155&l.flags))throw new Ce(8);if(16384==(61440&l.node.mode))throw new Ce(31);if(!l.l.read)throw new Ce(28);var h=void 0!==c;if(h){if(!l.seekable)throw new Ce(70)}else c=l.position;var f=l.l.read(l,d,s,u,c);h||(l.position+=f);var p=f;if(0>p){var v=-1;break e}if(t+=p,p<u)break;void 0!==a&&(a+=p)}v=t}return R[r>>2]=v,0}catch(e){if("ErrnoError"!==e.name)throw e;return e.Y}},fd_seek:function(e,t,n,r,i){t=n+2097152>>>0<4194305-!!t?(t>>>0)+4294967296*n:NaN;try{if(isNaN(t))return 61;var a=Se(e);return Ye(a,t,r),X=[a.position>>>0,(Y=a.position,1<=+Math.abs(Y)?0<Y?+Math.floor(Y/4294967296)>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],E[i>>2]=X[0],E[i+4>>2]=X[1],a.Ea&&0===t&&0===r&&(a.Ea=null),0}catch(e){if("ErrnoError"!==e.name)throw e;return e.Y}},fd_write:function(e,t,n,r){try{e:{var i=Se(e);e=t;for(var a,o=t=0;o<n;o++){var s=R[e>>2],u=R[e+4>>2];e+=8;var l=i,c=s,d=u,h=a,f=A;if(0>d||0>h)throw new Ce(28);if(null===l.U)throw new Ce(8);
1if(!(2097155&l.flags))throw new Ce(8);if(16384==(61440&l.node.mode))throw new Ce(31);if(!l.l.write)throw new Ce(28);l.seekable&&1024&l.flags&&Ye(l,0,2);var p=void 0!==h;if(p){if(!l.seekable)throw new Ce(70)}else h=l.position;var v=l.l.write(l,f,c,d,h,void 0);p||(l.position+=v);var m=v;if(0>m){var b=-1;break e}t+=m,void 0!==a&&(a+=m)}b=t}return R[r>>2]=b,0}catch(e){if("ErrnoError"!==e.name)throw e;return e.Y}},invoke_vii:function(e,t,n){var r=Bn();try{zt(e)(t,n)}catch(e){if(Dn(r),e!==e+0)throw e;Vn(1,0)}},isWindowsBrowser:function(){return-1<navigator.platform.indexOf("Win")},strftime:Pn,strftime_l:(e,t,n,r)=>Pn(e,t,n,r),wasm_start_image_decode:function(e,t,n){t=i.HEAP8.subarray(t,t+n),(n=new Uint8Array(n)).set(t),createImageBitmap(new Blob([n])).then(function(t){var n=new OffscreenCanvas(t.width,t.height).getContext("2d");n.drawImage(t,0,0);var r=(n=n.getImageData(0,0,t.width,t.height)).data.length,a=i.vb(r);i.lc.set(n.data,a),i.nc(e,t.width,t.height,a,r)}).catch(function(t){t=t.message||"decode failed";var n=i.Ec(t)+1,r=i.vb(n);i.Jc(t,r,n),i.oc(e,r),i.mc(r)})}},Fn=function(){function e(e){return Fn=e.exports,C=Fn.memory,L(),Bt=Fn.__indirect_function_table,S.unshift(Fn.__wasm_call_ctors),V--,i.monitorRunDependencies?.(V),0==V&&(null!==D&&(clearInterval(D),D=null),B&&(e=B,B=null,e())),Fn}var t={env:Rn,wasi_snapshot_preview1:Rn};if(V++,i.monitorRunDependencies?.(V),i.instantiateWasm)try{return i.instantiateWasm(t,e)}catch(e){_(`Module.instantiateWasm callback failed with error: ${e}`),n(e)}return U||=N("canvas_advanced.wasm")?"canvas_advanced.wasm":i.locateFile?i.locateFile("canvas_advanced.wasm",g):g+"canvas_advanced.wasm",function(e,t){var n=U;return y||"function"!=typeof WebAssembly.instantiateStreaming||N(n)||z(n)||"function"!=typeof fetch?$(n,e,t):fetch(n,{credentials:"same-origin"}).then(r=>WebAssembly.instantiateStreaming(r,e).then(t,function(r){return _(`wasm streaming compile failed: ${r}`),_("falling back to ArrayBuffer instantiation"),$(n,e,t)}))}(t,function(t){e(t.instance)}).catch(n),{}}(),kn=e=>(kn=Fn.free)(e),Tn=e=>(Tn=Fn.malloc)(e),Ln=e=>(Ln=Fn.__getTypeName)(e);i._wasm_image_decode_complete=(e,t,n,r,a)=>(i._wasm_image_decode_complete=Fn.wasm_image_decode_complete)(e,t,n,r,a),i._wasm_image_decode_error=(e,t)=>(i._wasm_image_decode_error=Fn.wasm_image_decode_error)(e,t);var On=i._ma_device__on_notification_unlocked=e=>(On=i._ma_device__on_notification_unlocked=Fn.ma_device__on_notification_unlocked)(e);i._ma_malloc_emscripten=(e,t)=>(i._ma_malloc_emscripten=Fn.ma_malloc_emscripten)(e,t),i._ma_free_emscripten=(e,t)=>(i._ma_free_emscripten=Fn.ma_free_emscripten)(e,t);var Sn,xn=i._ma_device_process_pcm_frames_capture__webaudio=(e,t,n)=>(xn=i._ma_device_process_pcm_frames_capture__webaudio=Fn.ma_device_process_pcm_frames_capture__webaudio)(e,t,n),jn=i._ma_device_process_pcm_frames_playback__webaudio=(e,t,n)=>(jn=i._ma_device_process_pcm_frames_playback__webaudio=Fn.ma_device_process_pcm_frames_playback__webaudio)(e,t,n),Vn=(e,t)=>(Vn=Fn.setThrew)(e,t),Dn=e=>(Dn=Fn._emscripten_stack_restore)(e),Bn=()=>(Bn=Fn.emscripten_stack_get_current)();function Wn(){function e(){if(!Sn&&(Sn=!0,i.calledRun=!0,!T)){if(i.noFSInit||je||(je=!0,i.stdin=i.stdin,i.stdout=i.stdout,i.stderr=i.stderr,i.stdin?Xe("stdin",i.stdin):ze("/dev/tty","/dev/stdin"),i.stdout?Xe("stdout",null,i.stdout):ze("/dev/tty","/dev/stdout"),i.stderr?Xe("stderr",null,i.stderr):ze("/dev/tty1","/dev/stderr"),$e("/dev/stdin",0),$e("/dev/stdout",1),$e("/dev/stderr",1)),_e=!1,q(S),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;){var e=i.postRun.shift();x.unshift(e)}q(x)}}if(!(0<V)){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)j();q(O),0<V||(i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),e()},1)):e())}}if(i.dynCall_iiji=(e,t,n,r,a)=>(i.dynCall_iiji=Fn.dynCall_iiji)(e,t,n,r,a),i.dynCall_jiji=(e,t,n,r,a)=>(i.dynCall_jiji=Fn.dynCall_jiji)(e,t,n,r,a),i.dynCall_iiiji=(e,t,n,r,a,o)=>(i.dynCall_iiiji=Fn.dynCall_iiiji)(e,t,n,r,a,o),i.dynCall_iij=(e,t,n,r)=>(i.dynCall_iij=Fn.dynCall_iij)(e,t,n,r),i.dynCall_jii=(e,t,n)=>
1(i.dynCall_jii=Fn.dynCall_jii)(e,t,n),i.dynCall_viijii=(e,t,n,r,a,o,s)=>(i.dynCall_viijii=Fn.dynCall_viijii)(e,t,n,r,a,o,s),i.dynCall_iiiiij=(e,t,n,r,a,o,s)=>(i.dynCall_iiiiij=Fn.dynCall_iiiiij)(e,t,n,r,a,o,s),i.dynCall_iiiiijj=(e,t,n,r,a,o,s,u,l)=>(i.dynCall_iiiiijj=Fn.dynCall_iiiiijj)(e,t,n,r,a,o,s,u,l),i.dynCall_iiiiiijj=(e,t,n,r,a,o,s,u,l,c)=>(i.dynCall_iiiiiijj=Fn.dynCall_iiiiiijj)(e,t,n,r,a,o,s,u,l,c),B=function e(){Sn||Wn(),Sn||(B=e)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);0<i.preInit.length;)i.preInit.pop()();return Wn(),a})},e=>{e.exports=JSON.parse('{"name":"@rive-app/canvas","version":"2.38.5","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"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}')},(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:()=>i.FocusSessionState,FontAssetWrapper:()=>o.FontAssetWrapper,FontWrapper:()=>o.FontWrapper,ImageAssetWrapper:()=>o.ImageAssetWrapper,ImageWrapper:()=>o.ImageWrapper,KeyboardInteractions:()=>i.KeyboardInteractions,RiveFont:()=>s.RiveFont,createFinalization:()=>o.createFinalization,finalizationRegistry:()=>o.finalizationRegistry,registerTouchInteractions:()=>r.registerTouchInteractions,sanitizeUrl:()=>a.sanitizeUrl});var r=n(7),i=n(8),a=n(9),o=n(10),s=n(11)},(e,t,n)=>{n.r(t),n.d(t,{registerTouchInteractions:()=>i});var r=function(e,t,n,r){var i,a=e;return(null===(i=a.changedTouches)||void 0===i?void 0:i.length)?(!t&&["touchstart","touchmove"].includes(e.type)&&e.preventDefault(),function(e,t,n){var r,i=[];if(t)for(var a=0;a<e.length;a++){var o=e[a];i.push({clientX:o.clientX,clientY:o.clientY,identifier:o.identifier})}else{var s=null!==n?null!==(r=Array.from(e).find(function(e){return e.identifier===n}))&&void 0!==r?r:null:e[0];s&&i.push({clientX:s.clientX,clientY:s.clientY,identifier:s.identifier})}return i}(a.changedTouches,n,r)):[{clientX:e.clientX,clientY:e.clientY,identifier:0}]},i=function(e){var t=e.canvas,n=e.artboard,i=e.stateMachines,a=void 0===i?[]:i,o=e.renderer,s=e.rive,u=e.fit,l=e.alignment,c=e.isTouchScrollEnabled,d=void 0!==c&&c,h=e.dispatchPointerExit,f=void 0===h||h,p=e.enableMultiTouch,v=void 0!==p&&p,m=e.layoutScaleFactor,b=void 0===m?1:m,g=e.advanceAndDrain;if(!(t&&a.length&&o&&s&&n&&"undefined"!=typeof window))return null;var y=null,w=!1,_=null,C=function(){_=null},A=function(e){var t;if(w&&e instanceof MouseEvent)"mouseup"==e.type&&(w=!1);else{w=d&&"touchend"===e.type&&"touchstart"===y,y=e.type;var i=e.currentTarget.getBoundingClientRect();if(!v&&"touchstart"===e.type&&null===_){var o=null===(t=e.changedTouches)||void 0===t?void 0:t[0];o&&(_=o.identifier)}var c=r(e,d,v,v?null:_),h=s.computeAlignment(u,l,{minX:0,minY:0,maxX:i.width,maxY:i.height},n.bounds,b),p=new s.Mat2D;switch(h.invert(p),c.forEach(function(e){var t=e.clientX,n=e.clientY;if(t||n){var r=t-i.left,a=n-i.top,o=new s.Vec2D(r,a),u=s.mapXY(p,o),l=u.x(),c=u.y();e.transformedX=l,e.transformedY=c,u.delete(),o.delete()}}),p.delete(),h.delete(),e.type){case"mouseout":for(var m=function(e){f?c.forEach(function(t){e.pointerExit(t.transformedX,t.transformedY,t.identifier)}):c.forEach(function(t){e.pointerMove(t.transformedX,t.transformedY,t.identifier)})},C=0,A=a;C<A.length;C++)m(A[C]);break;case"touchmove":case"mouseover":case"mousemove":for(var M=function(e){c.forEac
1h(function(t){e.pointerMove(t.transformedX,t.transformedY,t.identifier)})},P=0,I=a;P<I.length;P++)M(I[P]);break;case"touchstart":case"mousedown":for(var E=function(e){c.forEach(function(t){e.pointerDown(t.transformedX,t.transformedY,t.identifier)})},R=0,F=a;R<F.length;R++)E(F[R]);g(0);break;case"touchend":for(var k=function(e){c.forEach(function(t){e.pointerUp(t.transformedX,t.transformedY,t.identifier),e.pointerExit(t.transformedX,t.transformedY,t.identifier)})},T=0,L=a;T<L.length;T++)k(L[T]);g(0),!v&&c.some(function(e){return e.identifier===_})&&(_=null);break;case"mouseup":for(var O=function(e){c.forEach(function(t){e.pointerUp(t.transformedX,t.transformedY,t.identifier)})},S=0,x=a;S<x.length;S++)O(x[S]);g(0)}}}.bind(void 0);return t.addEventListener("mouseover",A),t.addEventListener("mouseout",A),t.addEventListener("mousemove",A),t.addEventListener("mousedown",A),t.addEventListener("mouseup",A),t.addEventListener("touchmove",A,{passive:d}),t.addEventListener("touchstart",A,{passive:d}),t.addEventListener("touchend",A),t.addEventListener("touchcancel",C),function(){t.removeEventListener("mouseover",A),t.removeEventListener("mouseout",A),t.removeEventListener("mousemove",A),t.removeEventListener("mousedown",A),t.removeEventListener("mouseup",A),t.removeEventListener("touchmove",A),t.removeEventListener("touchstart",A),t.removeEventListener("touchend",A),t.removeEventListener("touchcancel",C)}}},(e,t,n)=>{var r;n.r(t),n.d(t,{FocusSessionState:()=>r,KeyboardInteractions:()=>i}),function(e){e.NotFocused="notFocused",e.EntryPending="entryPending",e.RiveFocused="riveFocused"}(r||(r={}));var i=function(){function e(e){var t=e.canvas,n=e.stateMachine,i=e.hasFocusNodes,a=this;this.focusSessionState=r.NotFocused,this.onCanvasFocus=function(e){a.hasFocusNodes&&(a.mainSm.focusState().hasFocus||(a.focusSessionState=r.EntryPending,a.isKeyboardDrivenFocus()&&(a.cameFromBeforeCanvas(e.relatedTarget)?a.mainSm.focusNext():a.mainSm.focusPrevious())&&(a.focusSessionState=r.RiveFocused)))},this.onCanvasBlur=function(e){a.focusSessionState=r.NotFocused},this.onKeyDown=function(e){a.focusSessionState!==r.NotFocused&&"Tab"===e.code&&a.hasFocusNodes&&((e.shiftKey?a.mainSm.focusPrevious():a.mainSm.focusNext())?(a.focusSessionState=r.RiveFocused,e.preventDefault()):a.focusSessionState=r.NotFocused)},this.canvas=t,this.mainSm=n,this.hasFocusNodes=i,t.addEventListener("focus",this.onCanvasFocus),t.addEventListener("blur",this.onCanvasBlur),t.addEventListener("keydown",this.onKeyDown)}return e.prototype.setFocusSessionState=function(e){this.focusSessionState=e},e.prototype.notifyRiveFocused=function(){this.focusSessionState=r.RiveFocused},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(){this.canvas.removeEventListener("focus",this.onCanvasFocus),this.canvas.removeEventListener("blur",this.onCanvasBlur),this.canvas.removeEventListener("keydown",this.onKeyDown)},e}()},(e,t,n)=>{n.r(t),n.d(t,{BLANK_URL:()=>l,sanitizeUrl:()=>c});var r=/^([^\w]*)(javascript|data|vbscript)/im,i=/&#(\w+)(^\w|;)?/g,a=/&(newline|tab);/gi,o=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,s=/^.+(:|&colon;)/gim,u=[".","/"],l="about:blank";function c(e){if(!e)return l;var t,n=(t=e,t.replace(o,"").replace(i,function(e,t){return String.fromCharCode(t)})).replace(a,"").replace(o,"").trim();if(!n)return l;if(function(e){return u.indexOf(e[0])>-1}(n))return n;var c=n.match(s);if(!c)return n;var d=c[0];return r.test(d)?l:n}},(e,t,n)=>{n.r(t),n.d(t,{AudioAssetWrapper:()=>p,AudioWrapper:()=>l,CustomFileAssetLoaderWrapper:()=>d,FileAssetWrapper:()=>h,FileFinalizer:()=>a,FontAssetWrapper:()=>v,FontWrapper:()=>c,ImageAssetWrapper:()=>f,ImageWrapper:()=>u,createFinalization:()=>g,finalizationRegistry:()=>b});var r,i=(r=function(e,t){return r=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])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(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}(),u=function(e){function t(t){var n=e.call(this)||this;return n._nativeImage=t,n}return i(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),l=function(e){function t(t){var n=e.call(this)||this;return n._nativeAudio=t,n}return i(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 i(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),d=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 v(e)}return this._assetLoaderCallback(n,t)},e}(),h=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 i(t,e),t.prototype.setRenderImage=function(e){this._nativeFileAsset.setRenderImage(e.nativeImage)},t}(h),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.setAudioSource=function(e){this._nativeFileAsset.setAudioSource(e.nativeAudio)},t}(h),v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.setFont=function(e){this._nativeFileAsset.setFont(e.nativeFont)},t}(h),m=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:m)(function(e){null==e||e.unref()}),g=function(e,t){var n=new o(t);b.register(e,n)}},(e,t,n)=>{n.r(t),n.d(t,{RiveFont:()=>i});var r=n(3),i=function(){function e(){}return e.setFallbackFontCallback=function(t){e._fallbackFontCallback=null!=t?t:null,e._wireFallbackProc()},e._fontToPtr=function(e){var t;if(null==e)return null;var n=e.nativeFont,r=null===(t=null==n?void 0:n.ptr)||void 0===t?void 0:t.call(n);return null!=r?r:null},e._getFallbackPtr=function(t,n){return n<0||n>=t.length?null:e._fontToPtr(t[n])},e._wireFallbackProc=function(){r.RuntimeLoader.getInstance(function(t){var n=e._fallbackFontCallback;n?t.setFallbackFontCallback(function(t,r,i){var a=n(t,i);return a?Array.isArray(a)?e._getFallbackPtr(a,r):0===r?e._fontToPtr(a):null:null}):t.setFallbackFontCallback(null)})},e._fallbackFontCallback=null,e}()}],t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}
1),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{n.r(r),n.d(r,{Alignment:()=>i,DataEnum:()=>B,DataType:()=>F,DrawOptimizationOptions:()=>a,EventType:()=>y,Fit:()=>t,Layout:()=>m,LoopType:()=>w,Rive:()=>j,RiveEventType:()=>b,RiveFile:()=>x,RiveFont:()=>u.RiveFont,RuntimeLoader:()=>s.RuntimeLoader,StateMachineInput:()=>g,StateMachineInputType:()=>v,Testing:()=>Z,ViewModel:()=>D,ViewModelInstance:()=>W,ViewModelInstanceArtboard:()=>K,ViewModelInstanceAssetImage:()=>q,ViewModelInstanceBoolean:()=>H,ViewModelInstanceColor:()=>G,ViewModelInstanceEnum:()=>Y,ViewModelInstanceList:()=>X,ViewModelInstanceNumber:()=>z,ViewModelInstanceString:()=>N,ViewModelInstanceTrigger:()=>$,ViewModelInstanceValue:()=>U,decodeAudio:()=>ee,decodeFont:()=>ne,decodeImage:()=>te});var e,t,i,a,o=n(1),s=n(3),u=n(6),l=(e=function(t,n){return e=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,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),c=function(){return c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},c.apply(this,arguments)},d=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})},h=function(e,t){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[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(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},f=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isHandledError=!0,t}return l(t,e),t}(Error);!function(e){e.Cover="cover",e.Contain="contain",e.Fill="fill",e.FitWidth="fitWidth",e.FitHeight="fitHeight",e.None="none",e.ScaleDown="scaleDown",e.Layout="layout"}(t||(t={})),function(e){e.Center="center",e.TopLeft="topLeft",e.TopCenter="topCenter",e.TopRight="topRight",e.CenterLeft="centerLeft",e.CenterRight="centerRight",e.BottomLeft="bottomLeft",e.BottomCenter="bottomCenter",e.BottomRight="bottomRight"}(i||(i={})),function(e){e.AlwaysDraw="alwaysDraw",e.DrawOnChanged="drawOnChanged"}(a||(a={}));var v,m=function(){function e(e){var n,r,a,o,s,u,l;this.fit=null!==(n=null==e?void 0:e.fit)&&void 0!==n?n:t.Contain,this.alignment=null!==(r=null==e?void 0:e.alignment)&&void 0!==r?r:i.Center,this.layoutScaleFactor=null!==(a=null==e?void 0:e.layoutScaleFactor)&&void 0!==a?a:1,this.minX=null!==(o=null==e?void 0:e.minX)&&void 0!==o?o:0,this.minY=null!==(s=null==e?void 0:e.minY)&&void 0!==s?s:0,this.maxX=null!==(u=null==e?void 0:e.maxX)&&void 0!==u?u:0,this.maxY=null!==(l=null==e?void 0:e.maxY)&&void 0!==l?l:0}return e.new=function(t){return new e({fit:t.fit,alignment:t.alignment,minX:t.minX,minY:t.minY,maxX:t.maxX,maxY:t.maxY})},e.prototype.copyWith=function(t){var n=t.fit,r=t.alignment,i=t.layoutScaleFactor,a=t.minX,o=t.minY,s=t.maxX,u=t.maxY;return new e({fit:null!=n?n:this.fit,alignment:null!=r?r:this.alignment,layoutScaleFactor:null!=i?i:this.layoutScaleFactor,minX:null!=a?a:this.minX,minY:null!=o?o:this.minY,maxX:null!=s?s:this.maxX,maxY:null!=u?u:this.maxY})},e.prototype.runtimeFit=function(e){return this.cachedRuntimeFit?this.cachedRuntimeFit:(n=this.fit===t.Cover?e.Fit.cover:this.fit===t.Contain?e.Fit.contain:this.fit===t.Fill?e.Fit.fill:this.fit===t.FitWidth?e.Fit.fitWidth:this.fit===t.FitHeight?e.Fit.fitHeight:this.fit===t.ScaleDown?e.Fit.scaleDown:this.fit===t.Layout?e.Fit.layout:e.Fit.none,this.cachedRuntimeFit=n,n);var n},e.prototype.runtimeAlignment=function(e){return this.cachedRuntimeAlignment?this.cachedRuntimeAlignment:(t=this.alignment===i.TopLeft?e.Alignment.topLeft:this.alignment===i.TopCenter?e.Alignment.topCenter:this.alignment===i.TopRight?e.Alignment.topRight:this.alignment===i.CenterLeft?e.Alignment.centerLeft:this.alignment===i.CenterRight?e.Alignment.centerRight:this.alignment===i.BottomLeft?e.Alignment.bottomLeft:this.alignment===i.BottomCenter?e.Alignment.bottomCenter:this.alignment===i.BottomRight?e.Alignment.bottomRight:e.Alignment.center,this.cachedRuntimeAlignment=t,t);var t},e}();!function(e){e[e.Number=56]="Number",e[e.Trigger=58]="Trigger",e[e.Boolean=59]="Boolean"}(v||(v={}));var b,g=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===v.Trigger&&this.runtimeInput.fire()},e.prototype.delete=function(){this.runtimeInput=null},e}();!function(e){e[e.General=128]="General",e[e.OpenUrl=131]="OpenUrl"}(b||(b={}));var y,w,_=function(e){this.isBindableArtboard=!1,this.isBindableArtboard=e},C=function(e){function t(t,n){var r=e.call(this,!1)||this;return r.nativeArtboard=t,r.file=n,r}return l(t,e),t}(_),A=function(e){function t(t){var n=e.call(this,!0)||this;return n.selfUnref=!1,n.nativeArtboard=t,n}return l(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}(_),M=function(){function e(e,t,n,r){this.stateMachine=e,this.playing=n,this.artboard=r,this.inputs=[],this.instance=new t.StateMachineInstance(e,r),this.initInputs(t),this.hasFocusNodes=this.instance.hasFocusNodes()}return 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.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 g(v.Boolean,e.asBool()):e.type===t.SMIInput.number?new g(v.Number,e.asNumber()):e.type===t.SMIInput.trigger?new g(v.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}(),P=function(){function e(e,t,n,r,i){void 0===r&&(r=[]),void 0===i&&(i=[]),this.runtime=e,this.artboard=t,this.eventManager=n,this.animations=r,this.stateMachines=i}return e.prototype.add=function(e,t,n){if(void 0===n&&(n=!0),0===(e=Q(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}),i=this.stateMachines.map(function(e){return e.name}),a=0;a<e.length;a++){var s=r.indexOf(e[a]),u=i.indexOf(e[a]);if(s>=0||u>=0)s>=0?this.animations[s].playing=t:this.stateMachines[u].playing=t;else{var l=this.artboard.animationByName(e[a]);if(l){var c=new o.Animation(l,this.artboard,this.runtime,t);c.advance(0),c.apply(1),this.animations.push(c)}else{var d=this.artboard.stateMachineByName(e[a]);if(d){var h=new M(d,this.runtime,t,this.artboard);this.stateMachines.push(h)}}}}return n&&(t?this.eventManager.fire({type:y.Play,data:this.playing}):this.eventManager.fire({type:y.Pause,data:this.paused})),t?this.playing:this.paused},e.prototype.initLinearAnimations=function(e,t,n){void 0===n&&(n=!1);for(var r=this.animations.map(function(e){return e.name}),i=0;i<e.length;i++){var a=r.indexOf(e[i]);if(a>=0)this.animations[a].playing=t;else{var s=this.artboard.animationByName(e[i]);if(s){var u=new o.Animation(s,this.artboard,this.runtime,t);u.advance(0),u.apply(1),this.animations.push(u)}else if(n){var l="State Machine with name ".concat(e[i]," not found");throw new p(l)}}}},e.prototype.initStateMachines=function(e,t){for(var n=this.stateMachines.map(function(e){return e.name}),r=0;r<e.length;r++){var i=n.indexOf(e[r]);if(i>=0)this.stateMachines[i].playing=t;else{var a=this.artboard.stateMachineByName(e[r]);if(a){var o=new M(a,this.runtime,t,this.artboard);this.stateMachines.push(o)}else 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,n=[];if(0===(e=Q(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 r=this.animations.filter(function(t){return e.includes(t.name)});r.forEach(function(e){e.cleanup(),t.animations.splice(t.animations.indexOf(e),1)});var i=this.stateMachines.filter(function(t){return e.includes(t.name)});i.forEach(function(e){e.cleanup(),t.stateMachines.splice(t.stateMachines.indexOf(e),1)}),n=r.map(function(e){return e.name}).concat(i.map(function(e){return e.name}))}return this.eventManager.fire({type:y.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){var n;return void 0===t&&(t=!0),0===this.animations.length&&0===this.stateMachines.length&&(this.artboard.animationCount()>0?this.add([n=this.artboard.animationByIndex(0).name],e,t):this.artboard.stateMachineCount()>0&&this.add([n=this.artboard.stateMachineByIndex(0).name],e,t)),n},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:y.Loop,data:{animation:n.name,type:w.Loop}}),n.loopCount=0):2===n.loopValue&&n.loopCount>1&&(this.eventManager.fire({type:y.Loop,data:{animation:n.name,type:w.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 r=n[t];e.push.apply(e,r.statesChanged)}e.length>0&&this.eventManager.fire({type:y.StateChange,data:e})},e.prototype.handleAdvancing=function(e){this.eventManager.fire({type:y.Advance,data:e})},e}();!function(e){e.Load="load",e.LoadError="loaderror",e.Play="play",e.Pause="pause",e.Stop="stop",e.Loop="loop",e.Draw="draw",e.Advance="advance",e.StateChange="statechange",e.RiveEvent="riveevent",e.AudioStatusChange="audiostatuschange"}(y||(y={})),function(e){e.OneShot="oneshot",e.Loop="loop",e.PingPong="pingpong"}(w||(w={}));var I,E=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}(),R=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}();!function(e){e[e.AVAILABLE=0]="AVAILABLE",e[e.UNAVAILABLE=1]="UNAVAILABLE"}(I||(I={}));var F,k=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._started=!1,t._enabled=!1,t._status=I.UNAVAILABLE,t}return l(t,e),t.prototype.delay=function(e){return d(this,void 0,void 0,function(){return h(this,function(t){return[2,new Promise(function(t){return setTimeout(t,e)})]})})},t.prototype.timeout=function(){return d(this,void 0,void 0,function(){return h(this,function(e){return[2,new Promise(function(e,t){return setTimeout(t,50)})]})})},t.prototype.reportToListeners=function(){this.fire({type:y.AudioStatusChange}),this.removeAll()},t.prototype.enableAudio=function(){return d(this,void 0,void 0,function(){return h(this,function(e){return this._enabled||(this._enabled=!0,this._status=I.AVAILABLE,this.reportToListeners()),[2]})})},t.prototype.testAudio=function(){return d(this,void 0,void 0,function(){return h(this,function(e){switch(e.label){case 0:if(this._status!==I.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 d(this,void 0,void 0,function(){return h(this,function(e){switch(e.label){case 0:return this._started?[3,5]:(this._started=!0,"undefined"!=typeof window?[3,1]:(this.enableAudio(),[3,5]));case 1:this._audioContext=new AudioContext,this.listenForUserAction(),e.label=2;case 2:return this._status!==I.UNAVAILABLE?[3,5]:[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 d(e,void 0,void 0,function(){return h(this,function(e){return this.enableAudio(),[2]})})},{once:!0})},t.prototype.establishAudio=function(){return d(this,void 0,void 0,function(){return h(this,function(e){return this._establishAudio(),[2]})})},Object.defineProperty(t.prototype,"systemVolume",{get:function(){return this._status===I.UNAVAILABLE?(this.testAudio(),0):1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),t}(E),T=new k,L=function(){function e(){}return e.prototype.observe=function(){},e.prototype.unobserve=function(){},e.prototype.disconnect=function(){},e}(),O=globalThis.ResizeObserver||L,S=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 O(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}()),x=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&&(s.RuntimeLoader.enablePerfMarks=!0),this.eventManager=new E,e.onLoad&&this.on(y.Load,e.onLoad),e.onLoadError&&this.on(y.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 d(this,void 0,void 0,function(){var t,n,r,i,a,o;return h(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,J(this.src)];case 2:return t.buffer=s.sent(),[3,4];case 3:if((n=s.sent())instanceof Error)throw n;
1throw new p(e.fileLoadErrorMessage);case 4:return this.destroyed?[2]:(this.assetLoader&&(i=new u.CustomFileAssetLoaderWrapper(this.runtime,this.assetLoader),r=i.assetLoader),this.enablePerfMarks&&performance.mark("rive:file-load:start"),a=this,[4,this.runtime.load(new Uint8Array(this.buffer),r,this.enableRiveAssetCDN)]);case 5:return a.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 u.FileFinalizer(this.file),u.finalizationRegistry.register(this,o),this.destroyed?(this.releaseFile(),[2]):(null!==this.file?this.eventManager.fire({type:y.Load,data:this}):this.fireLoadError(e.fileLoadErrorMessage),[2])}})})},e.prototype.loadRiveFileBytes=function(){return d(this,void 0,void 0,function(){var e;return h(this,function(t){return this.enablePerfMarks&&performance.mark("rive:fetch-riv:start"),e=this.src?J(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 d(this,void 0,void 0,function(){var e;return h(this,function(t){return this.enablePerfMarks&&performance.mark("rive:await-wasm:start"),e=s.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 d(this,void 0,void 0,function(){var t,n,r,i;return h(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:return t=a.sent(),n=t[0],r=t[1],this.destroyed?[2]:(this.buffer=n,this.runtime=r,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 i=a.sent(),this.fireLoadError(i instanceof Error?i.message:e.fileLoadErrorMessage),[3,5];case 5:return[2]}})})},e.prototype.fireLoadError=function(e){throw this.eventManager.fire({type:y.LoadError,data:e}),new p(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 A(e);return(0,u.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 C(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 D(t):null},e.missingErrorMessage="Rive source file or data buffer required",e.fileLoadErrorMessage="The file failed to load",e}(),j=function(){function e(e){var t,n,r,i=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._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._dataEnums=null,this._tabIndex=null,this._prevHasFocus=!1,this._focusOptions={allowFocusInterrupt:!1},this.drawOptimization=a.DrawOnChanged,this.enablePerfMarks=!1,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=!1,this.onCanvasResize=function(e){var t=i._hasZeroSize!==e;i._hasZeroSize=e,e?i._layout.maxX&&i._layout.maxY||i.resizeToCanvas():t&&i.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=S.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 m,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!==(n=e.drawingOptions)&&void 0!==n?n:this.drawOptimization,this.enableRiveAssetCDN=void 0===e.enableRiveAssetCDN||e.enableRiveAssetCDN,this.enablePerfMarks=!!e.enablePerfMarks,this.enablePerfMarks&&(s.RuntimeLoader.enablePerfMarks=!0),this._focusOptions=null!==(r=e.focu
1sOptions)&&void 0!==r?r:this._focusOptions,this.eventManager=new E,e.onLoad&&this.on(y.Load,e.onLoad),e.onLoadError&&this.on(y.LoadError,e.onLoadError),e.onPlay&&this.on(y.Play,e.onPlay),e.onPause&&this.on(y.Pause,e.onPause),e.onStop&&this.on(y.Stop,e.onStop),e.onLoop&&this.on(y.Loop,e.onLoop),e.onStateChange&&this.on(y.StateChange,e.onStateChange),e.onAdvance&&this.on(y.Advance,e.onAdvance),e.onload&&!e.onLoad&&this.on(y.Load,e.onload),e.onloaderror&&!e.onLoadError&&this.on(y.LoadError,e.onloaderror),e.onplay&&!e.onPlay&&this.on(y.Play,e.onplay),e.onpause&&!e.onPause&&this.on(y.Pause,e.onpause),e.onstop&&!e.onStop&&this.on(y.Stop,e.onstop),e.onloop&&!e.onLoop&&this.on(y.Loop,e.onloop),e.onstatechange&&!e.onStateChange&&this.on(y.StateChange,e.onstatechange),e.assetLoader&&(this.assetLoader=e.assetLoader),this.taskQueue=new R(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})}return Object.defineProperty(e.prototype,"viewModelCount",{get:function(){return this.file.viewModelCount()},enumerable:!1,configurable:!0}),e.new=function(t){return new e(t)},e.prototype.onSystemAudioChanged=function(){this.volume=this._volume},e.prototype.init=function(t){var n=this,r=t.src,i=t.buffer,a=t.riveFile,o=t.animations,u=t.stateMachines,l=t.artboard,c=t.autoplay,d=void 0!==c&&c,h=t.useOffscreenRenderer,f=void 0!==h&&h,v=t.autoBind,m=void 0!==v&&v,b=t.tabIndex;if(!this.destroyed){if(this.src=r,this.buffer=i,this.riveFile=a,this._tabIndex=null!=b?b:null,!this.src&&!this.buffer&&!this.riveFile)throw new p(e.missingErrorMessage);var g=Q(o),w=Q(u);this.loaded=!1,this.readyForPlaying=!1,s.RuntimeLoader.awaitInstance().then(function(e){if(!n.destroyed){n.runtime=e,n.removeRiveListeners(),n.deleteRiveRenderer(),n.enablePerfMarks&&performance.mark("rive:make-renderer:start");try{if(n.renderer=n.runtime.makeRenderer(n.canvas,f),!n.renderer)throw new Error("Renderer is null, cannot render Rive on the canvas.")}catch(e){throw new p("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(l,g,w,d,m).then(function(e){if(e)return n.setupRiveListeners()}).catch(function(e){})}}).catch(function(e){n.eventManager.fire({type:y.LoadError,data:e.message})})}},e.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}),r=n.filter(function(e){return t.runtime.hasListeners(e.instance)}).map(function(e){return e.instance}),i=this.isTouchScrollEnabled,a=this.dispatchPointerExit,o=this.enableMultiTouch;e&&"isTouchScrollEnabled"in e&&(i=e.isTouchScrollEnabled),this.eventCleanup=(0,u.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:r,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:i,dispatchPointerExit:a,enableMultiTouch:o,layoutScaleFactor:this._layout.layoutScaleFactor,advanceAndDrain:this.advanceAndReportChanges.bind(this)});var s=n.filter(function(e){return e.hasFocusNodes});if(s.length){var l=this.canvas.tabIndex;(-1===l||isNaN(l))&&(this.canvas.tabIndex=null!==this._tabIndex?this._tabIndex:0),"undefined"!=typeof window&&(this._keyboardInteractions=new u.KeyboardInteractions({canvas:this.canvas,stateMachine:s[0].instance,hasFocusNodes:!0}))}}},e.prototype.cleanupKeyboardInteractions=function(){this._keyboardInteractions&&(this._keyboardInteractions.cleanup(),this._keyboardInteractions=null)},e.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null),this.cleanupKeyboardInteractions()},e.prototype.initializeAudio=function(){var e,t=this;T.status==I.UNAVAILABLE&&(this.file.hasAudio||(null===(e=this.artboard)||void 0===e?void 0:e.hasAudio)&&null===this._audioEventListener)&&(this._audioEventListener={type:y.AudioStatusChange,callback:function(){return t.onSystemAudioChanged()}},T.add(this._audioEventListener),T.establishAudio())},e.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)},e.prototype.initData=function(e,t,n,r,i){return d(this,void 0,void 0,function(){var a,o,s,u;return h(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),null!=this.riveFile?[3,2]:(a=new x({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader,enablePerfMarks:this.enablePerfMarks}),this.riveFile=a,[4,a.init()]);case 1:if(l.sent(),this.destroyed)return a.destroyIfUnused(),[2,!1];l.label=2;case 2:this.file=this.riveFile.getInstance(),this.initArtboard(e,t,n,r,i),this.initArtboardSize(),this.initializeAudio();try{this.loaded=!0,this.eventManager.fire({type:y.Load,data:null!==(u=this.src)&&void 0!==u?u:"buffer"})}catch(e){}return this.animator.advanceIfPaused(),this.readyForPlaying=!0,this.taskQueue.process(),this.drawFrame(),[2,!0];case 3:return o=l.sent(),s=(c=o)&&c.isHandledError?c.message:"Problem loading file; may be corrupt!",this.eventManager.fire({type:y.LoadError,data:s}),[2,Promise.reject(s)];case 4:return[2]}var c})})},e.prototype.initArtboard=function(e,t,n,r,i){if(this.file){var a,o=e?this.file.artboardByName(e):this.file.defaultArtboard();if(!o)throw new p("Invalid artboard name or no default artboard");if(this.artboard=o,o.volume=this._volume*T.systemVolume,this.animator=new P(this.runtime,this.artboard,this.eventManager),t.length>0||n.length>0?(a=t.concat(n),this.animator.initLinearAnimations(t,r),this.animator.initStateMachines(n,r)):a=[this.animator.atLeastOne(r,!1)],this.taskQueue.add({event:{type:r?y.Play:y.Pause,data:a}}),i){var s=this.file.defaultArtboardViewModel(o);if(null!==s){var l=s.defaultInstance();if(null!==l){var c=new W(l,null);(0,u.createFinalization)(c,c.runtimeInstance),this.bindViewModelInstance(c)}}}}},e.prototype.drawFrame=function(){var e,t;(null===(e=null===document||void 0===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()},e.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},e.prototype.pollFocusState=function(){if(this._keyboardInteractions){var e=this.animator.stateMachines.find(function(e){return e.playing&&e.hasFocusNodes});if(e){if(this.canvas instanceof HTMLCanvasElement){if(e.focusState().hasFocus)return this._keyboardInteractions.notifyRiveFocused(),void(this._prevHasFocus||(this.canvas!==document.activeElement&&this._focusOptions.allowFocusInterrupt&&this.canvas.focus(),this._prevHasFocus=!0));this._prevHasFocus=!1,this._keyboardInteractions.focusSessionState===u.FocusSessionState.RiveFocused&&this._keyboardInteractions.setFocusSessionState(u.FocusSessionState.NotFocused)}}else this._prevHasFocus=!1}else this._prevHasFocus=!1},e.prototype.advanceAndReportChanges=function(e){for(var t,n=0,r=this.animator.animations.filter(function(e){return e.playing||e.needsScrub}).sort(function(e){return e.needsScrub?-1:1});n<r.length;n++){var i=r[n];i.advance(e),i.instance.didLoop&&(i.loopCount+=1),i.apply(1)}for(var a=this.animator.stateMachines.filter(function(e){return e.playing}),o=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1,s=0,l=a;s<l.length;s++){var c=l[s],d=c.reportedEventCount();if(d)for(var h=0;h<d;h++){var f=c.reportedEventAt(h);if(f)if(f.type===b.OpenUrl){if(this.eventManager.fire({type:y.RiveEvent,data:f}),this.automaticallyHandleEvents){var p=document.createElement("a"),v=f,m=v.url,g=v.target,w=(0,u.sanitizeUrl)(m);m&&p.setAttribute("href",w),g&&p.setAttribute("target",g),w&&w!==u.BLANK_URL&&p.click()}}else this.eventManager.fire({type:y.RiveEvent,data:f})}o>=0&&performance.mark("rive:sm-advance:start:f".concat(o)),c.advanceAndApply(e),o>=0&&(performance.mark("rive:sm-advance:end:f".concat(o)),performance.measure("rive:sm-advance:f".concat(o),"rive:sm-advance:start:f".concat(o),"rive:sm-advance:end:f".concat(o)))}0==this.animator.stateMachines.length&&this.artboard.advance(e),this.animator.handleLooping(),this.animator.handleStateChanges(),this.animator.handleAdvancing(e),this.pollFocusState(),null===(t=this._viewModelInstance)||void 0===t||t.handleCallbacks()},e.prototype.draw=function(e,t){this.frameRequestId=null;var n=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 i=(e-this.lastRenderTime)/1e3;this.lastRenderTime=e,this.advanceAndReportChanges(i);var o=this.renderer;this._hasZeroSize||(this.drawOptimization==a.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(
1),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-n);this.frameTimes[0]<=s-1e3;)this.frameTimes.shift(),this.durations.shift();this.animator.isPlaying?this.scheduleRendering():(this.animator.isPaused||this.animator.isStopped)&&(this.lastRenderTime=0)},e.prototype.alignRenderer=function(){var e=this,t=e.renderer,n=e.runtime,r=e._layout,i=e.artboard;t.align(r.runtimeFit(n),r.runtimeAlignment(n),{minX:r.minX,minY:r.minY,maxX:r.maxX,maxY:r.maxY},i.bounds,this._devicePixelRatioUsed*r.layoutScaleFactor)},Object.defineProperty(e.prototype,"fps",{get:function(){return this.durations.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.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}),e.prototype.cleanup=function(){var e,t,n,r;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&&S.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&&(T.remove(this._audioEventListener),this._audioEventListener=null),this._pageVisibilityHandler&&(document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),null===(r=this._viewModelInstance)||void 0===r||r.cleanup(),this._viewModelInstance=null,this._dataEnums=null},e.prototype.deleteRiveRenderer=function(){var e;null===(e=this.renderer)||void 0===e||e.delete(),this.renderer=null},e.prototype.cleanupInstances=function(){null!==this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.stop(),this.artboard&&(this.artboard.delete(),this.artboard=null)},e.prototype.retrieveTextRun=function(e){if(e&&this.artboard){var t=this.artboard.textRun(e);if(t)return t}},e.prototype.getTextRunValue=function(e){var t=this.retrieveTextRun(e);return t?t.text:void 0},e.prototype.setTextRunValue=function(e,t){var n=this.retrieveTextRun(e);n&&(n.text=t)},e.prototype.play=function(e,t){var n=this;e=Q(e),this.readyForPlaying?(this.animator.play(e),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.setupRiveListeners(),this.startRendering()):this.taskQueue.add({action:function(){return n.play(e,t)}})},e.prototype.pause=function(e){var t=this;e=Q(e),this.readyForPlaying?(this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.animator.pause(e)):this.taskQueue.add({action:function(){return t.pause(e)}})},e.prototype.scrub=function(e,t){var n=this;e=Q(e),this.readyForPlaying?(this.animator.scrub(e,t||0),this.drawFrame()):this.taskQueue.add({action:function(){return n.scrub(e,t)}})},e.prototype.stop=function(e){var t=this;e=Q(e),this.readyForPlaying?(this.animator&&this.animator.stop(e),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions()):this.taskQueue.add({action:function(){return t.stop(e)}})},e.prototype.reset=function(e){var t,n,r=null==e?void 0:e.artboard,i=Q(null==e?void 0:e.animations),a=Q(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(r,i,a,o,s),this.taskQueue.process()},e.prototype.load=function(e){this.file=null,this.stop(),this.init(e)},Object.defineProperty(e.prototype,"layout",{get:function(){return this._layout},set:function(e){this._layout=e,e.maxX&&e.maxY||this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame()},enumerable:!1,configurable:!0}),e.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height})},e.prototype.resizeDrawingSurfaceToCanvas=function(e){if(this.canvas instanceof HTMLCanvasElement&&window){var n=this.canvas.getBoundingClientRect(),r=n.width,i=n.height,a=e||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=a,this.canvas.width=a*r,this.canvas.height=a*i,this._needsRedraw=!0,this.resizeToCanvas(),this.drawFrame(),this.layout.fit===t.Layout){var o=this._layout.layoutScaleFactor;this.artboard.width=r/o,this.artboard.height=i/o}}},Object.defineProperty(e.prototype,"source",{get:function(){return this.src}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:!1,configurable:!0}),Object.defineProperty(e.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(e.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}),e.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}},e.prototype.retrieveInputAtPath=function(e,t){if(e&&this.artboard){var n=this.artboard.inputByPath(e,t);if(n)return n}},e.prototype.setBooleanStateAtPath=function(e,t,n){var r=this.retrieveInputAtPath(e,n);r&&r.type===v.Boolean&&(r.asBool().value=t)},e.prototype.setNumberStateAtPath=function(e,t,n){var r=this.retrieveInputAtPath(e,n);r&&r.type===v.Number&&(r.asNumber().value=t)},e.prototype.fireStateAtPath=function(e,t){var n=this.retrieveInputAtPath(e,t);n&&n.type===v.Trigger&&n.asTrigger().fire()},e.prototype.retrieveTextAtPath=function(e,t){if(e&&t&&this.artboard){var n=this.artboard.textByPath(e,t);if(n)return n}},e.prototype.getTextRunValueAtPath=function(e,t){var n=this.retrieveTextAtPath(e,t);if(n)return n.text},e.prototype.setTextRunValueAtPath=function(e,t,n){var r=this.retrieveTextAtPath(e,n);r&&(r.text=t)},Object.defineProperty(e.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(e.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(e.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(e.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(e.prototype,"isPlaying",{get:function(){return this.animator.isPlaying},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isPaused",{get:function(){return this.animator.isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(e.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(e.prototype,"bounds",{get:function(){return this.artboard?this.artboard.bounds:void 0},enumerable:!1,configurable:!0}),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.unsubscribe=function(e,t){this.off(e,t)},e.prototype.removeAllRiveEventListeners=function(e){this.eventManager.removeAll(e)},e.prototype.unsubscribeAll=function(e){this.removeAllRiveEventListeners(e)},e.prototype.stopRendering=function(){this._explicitlyStoppedRendering=!0,this.loaded&&this.frameRequestId&&(this.runtime.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null)},e.prototype.startRendering=function(){this._explicitlyStoppedRendering=!1,this.drawFrame()},e.prototype.scheduleRendering=function(){this.loaded&&this.artboard&&!this.frameRequestId&&(this.runtime.requestAnimationFrame?this.frameRequestId=this.runtime.requestAnimationFrame(this._boundDraw):this.frameRequestId=requestAnimationFrame(this._boundDraw))},e.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()},e.prototype.enableFPSCounter=function(e){this.runtime.enableFPSCounter(e)},e.prototype.disableFPSCounter=function(){this.runtime.disableFPSCounter()},Object.defineProperty(e.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),r={name:n.name,animations:[],stateMachines:[]},i=0;i<n.animationCount();i++){var a=n.animationByIndex(i);r.animations.push(a.name)}for(var o=0;o<n.stateMachineCount();
1o++){for(var s=n.stateMachineByIndex(o),u=s.name,l=new this.runtime.StateMachineInstance(s,n),c=[],d=0;d<l.inputCount();d++){var h=l.input(d);c.push({name:h.name,type:h.type})}r.stateMachines.push({name:u,inputs:c})}e.artboards.push(r)}return e}},enumerable:!1,configurable:!0}),Object.defineProperty(e.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*T.systemVolume)},enumerable:!1,configurable:!0}),Object.defineProperty(e.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(e.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}),e.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(e.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(e){this._devicePixelRatioUsed=e},enumerable:!1,configurable:!0}),e.prototype.bindViewModelInstance=function(e){var t;this.artboard&&!this.destroyed&&e&&e.runtimeInstance&&(e.internalIncrementReferenceCount(),null===(t=this._viewModelInstance)||void 0===t||t.cleanup(),this._viewModelInstance=e,this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(t){return t.bindViewModelInstance(e)}):this.artboard.bindViewModelInstance(e.runtimeInstance))},Object.defineProperty(e.prototype,"viewModelInstance",{get:function(){return this._viewModelInstance},enumerable:!1,configurable:!0}),e.prototype.viewModelByIndex=function(e){var t=this.file.viewModelByIndex(e);return null!==t?new D(t):null},e.prototype.viewModelByName=function(e){var t;return null===(t=this.riveFile)||void 0===t?void 0:t.viewModelByName(e)},e.prototype.enums=function(){if(null===this._dataEnums){var e=this.file.enums();this._dataEnums=e.map(function(e){return new B(e)})}return this._dataEnums},e.prototype.defaultViewModel=function(){if(this.artboard){var e=this.file.defaultArtboardViewModel(this.artboard);if(e)return new D(e)}return null},e.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},e.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},e.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},e.prototype.clearFocus=function(){this.animator.stateMachines.filter(function(e){return e.playing&&e.hasFocusNodes}).forEach(function(e){return e.clearFocus()})},e.missingErrorMessage="Rive source file or data buffer required",e.cleanupErrorMessage="Attempt to use file after calling cleanup.",e}();!function(e){e.none="none",e.string="string",e.number="number",e.boolean="boolean",e.color="color",e.list="list",e.enumType="enumType",e.trigger="trigger",e.viewModel="viewModel",e.integer="integer",e.listIndex="listIndex",e.image="image",e.artboard="artboard"}(F||(F={}));var V,D=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 W(t,null);return(0,u.createFinalization)(n,t),n}return null},e.prototype.instanceByName=function(e){var t=this._viewModel.instanceByName(e);
1if(null!==t){var n=new W(t,null);return(0,u.createFinalization)(n,t),n}return null},e.prototype.defaultInstance=function(){var e=this._viewModel.defaultInstance();if(null!==e){var t=new W(e,null);return(0,u.createFinalization)(t,e),t}return null},e.prototype.instance=function(){var e=this._viewModel.instance();if(null!==e){var t=new W(e,null);return(0,u.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}(),B=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}();!function(e){e.Number="number",e.String="string",e.Boolean="boolean",e.Color="color",e.Trigger="trigger",e.Enum="enum",e.List="list",e.Image="image",e.Artboard="artboard"}(V||(V={}));var W=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){var r,i,a,o,s,u,l,c,d,h,f,p,v,m,b,g,y,w;if(t<e.length-1){var _=this.internalViewModelInstance(e[t]);return null!==_?_.propertyFromPathSegments(e,t+1,n):null}var C=null;switch(n){case V.Number:if(null!==(C=null!==(i=null===(r=this._runtimeInstance)||void 0===r?void 0:r.number(e[t]))&&void 0!==i?i:null))return new z(C,this);break;case V.String:if(null!==(C=null!==(o=null===(a=this._runtimeInstance)||void 0===a?void 0:a.string(e[t]))&&void 0!==o?o:null))return new N(C,this);break;case V.Boolean:if(null!==(C=null!==(u=null===(s=this._runtimeInstance)||void 0===s?void 0:s.boolean(e[t]))&&void 0!==u?u:null))return new H(C,this);break;case V.Color:if(null!==(C=null!==(c=null===(l=this._runtimeInstance)||void 0===l?void 0:l.color(e[t]))&&void 0!==c?c:null))return new G(C,this);break;case V.Trigger:if(null!==(C=null!==(h=null===(d=this._runtimeInstance)||void 0===d?void 0:d.trigger(e[t]))&&void 0!==h?h:null))return new $(C,this);break;case V.Enum:if(null!==(C=null!==(p=null===(f=this._runtimeInstance)||void 0===f?void 0:f.enum(e[t]))&&void 0!==p?p:null))return new Y(C,this);break;case V.List:if(null!==(C=null!==(m=null===(v=this._runtimeInstance)||void 0===v?void 0:v.list(e[t]))&&void 0!==m?m:null))return new X(C,this);break;case V.Image:if(null!==(C=null!==(g=null===(b=this._runtimeInstance)||void 0===b?void 0:b.image(e[t]))&&void 0!==g?g:null))return new q(C,this);break;case V.Artboard:if(null!==(C=null!==(w=null===(y=this._runtimeInstance)||void 0===y?void 0:y.artboard(e[t]))&&void 0!==w?w:null))return new K(C,this)}return null},e.prototype.internalViewModelInstance=function(t){var n;if(this._viewModelInstances.has(t))return this._viewModelInstances.get(t);var r=null===(n=this._runtimeInstance)||void 0===n?void 0:n.viewModel(t);if(null!==r){var i=new e(r,this);return(0,u.createFinalization)(i,r),i.internalIncrementReferenceCount(),this._viewModelInstances.set(t,i),i}return null},e.prototype.number=function(e){return this.propertyFromPath(e,V.Number)},e.prototype.string=function(e){return this.propertyFromPath(e,V.String)},e.prototype.boolean=function(e){return this.propertyFromPath(e,V.Boolean)},e.prototype.color=function(e){return this.propertyFromPath(e,V.Color)},e.prototype.trigger=function(e){return this.propertyFromPath(e,V.Trigger)},e.prototype.enum=function(e){return this.propertyFromPath(e,V.Enum)},e.prototype.list=function(e){return this.propertyFromPath(e,V.List)},e.prototype.image=function(e){return this.propertyFromPath(e,V.Image)},e.prototype.artboard=function(e){return this.propertyFromPath(e,V.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 r=(null===(n=this._runtimeInstance)||void 0===n?void 0:n.replaceViewModel(e,t.runtimeInstance))||!1;if(r){t.internalIncrementReferenceCount();var i=this.internalViewModelInstance(e);null!==i&&(i.removeParent(this),this._children.includes(i)&&(this._children=this._children.filter(function(e){return e!==i})),i.cleanup()),this._viewModelInstances.set(e,t),t.addParent(this)}return r}return!1},e.prototype.replaceViewModel=function(e,t){var n,r=e.split("/"),i=r.length>1?this.viewModelFromPathSegments(r.slice(0,r.length-1),0):this;return null!==(n=null==i?void 0:i.internalReplaceViewModel(r[r.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 c({},e)}))||[]}
1,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=f([],this._children,!0);this._children.length=0;var r=f([],this._parents,!0);this._parents.length=0,n.forEach(function(e){e.removeParent(t)}),r.forEach(function(e){e.removeFromViewModelCallbacks(t)})}},e}(),U=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}(),N=function(e){function t(t,n){return e.call(this,t,n)||this}return l(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}(U),z=function(e){function t(t,n){return e.call(this,t,n)||this}return l(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}(U),H=function(e){function t(t,n){return e.call(this,t,n)||this}return l(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}(U),$=function(e){function t(t,n){return e.call(this,t,n)||this}return l(t,e),t.prototype.trigger=function(){return this._viewModelInstanceValue.trigger()},t.prototype.internalHandleCallback=function(e){e()},t}(U),Y=function(e){function t(t,n){return e.call(this,t,n)||this}return l(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}(U),X=function(e){function t(t,n){return e.call(this,t,n)||this}return l(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 W(t,this._parentViewModel);return(0,u.createFinalization)(n,t),n}return null},t.prototype.swap=function(e,t){this._viewModelInstanceValue.swap(e,t)},t.prototype.internalHandleCallback=function(e){e()},t}(U),G=function(e){function t(t,n){return e.call(this,t,n)||this}return l(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.rgb=function(e,t,n){this._viewModelInstanceValue.rgb(e,t,n)},t.prototype.rgba=function(e,t,n,r){this._viewModelInstanceValue.argb(r,e,t,n)},t.prototype.argb=function(e,t,n,r){this._viewModelInstanceValue.argb(e,t,n,r)},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}(U),q=function(e){function t(t,n){return e.call(this,t,n)||this}return l(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}(U),K=function(e){function t(t,n){return e.call(this,t,n)||this}return l(t,e),Object.defineProperty(t.prototype,"value",{set:function(e){var t,n,r;r=e.isBindableArtboard?e:e.file.internalBindableArtboardFromArtboard(e.nativeArtboard),this._viewModelInstanceValue.value(null!==(t=null==r?void 0:r.nativeArtboard)&&void 0!==t?t:null),(null==r?void 0:r.nativeViewModel)&&this._viewModelInstanceValue.viewModelInstance(null!==(n=null==r?void 0:r.nativeViewModel)&&void 0!==n?n:null)},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e()},t}(U),J=function(e){return d(void 0,void 0,void 0,function(){var t,n;return h(this,function(r){switch(r.label){case 0:return t=new Request(e),[4,fetch(t)];case 1:if(!(n=r.sent()).ok)throw new Error("Failed to fetch the Rive file: HTTP ".concat(n.status));return[4,n.arrayBuffer()];case 2:return[2,r.sent()]}})})},Q=function(e){return"string"==typeof e?[e]:e instanceof Array?e:[]},Z={EventManager:E,TaskQueueManager:R},ee=function(e){return d(void 0,void 0,void 0,function(){var t,n;return h(this,function(r){switch(r.label){case 0:return[4,new Promise(function(t){return s.RuntimeLoader.getInstance(function(n){n.decodeAudio(e,t)})})];case 1:return t=r.sent(),n=new u.AudioWrapper(t),u.finalizationRegistry.register(n,t),[2,n]}})})},te=function(e){return d(void 0,void 0,void 0,function(){var t,n;return h(this,function(r){switch(r.label){case 0:return[4,new Promise(function(t){return s.RuntimeLoader.getInstance(function(n){n.decodeImage(e,t)})})];case 1:return t=r.sent(),n=new u.ImageWrapper(t),u.finalizationRegistry.register(n,t),[2,n]}})})},ne=function(e){return d(void 0,void 0,void 0,function(){var t,n;return h(this,function(r){switch(r.label){case 0:return[4,new Promise(function(t){return s.RuntimeLoader.getInstance(function(n){n.decodeFont(e,t)})})];case 1:return t=r.sent(),n=new u.FontWrapper(t),u.finalizationRegistry.register(n,t),[2,n]}})})}})(),r})(),e.exports=t()},16957(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(44914),a=n(64052);function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(i);function u(e){var t=e||l(),n=i.useState(t),r=n[0],a=n[1];return i.useEffect(function(){if("u">typeof window&&"matchMedia"in window){var t=function(){a(e||l())},n=window.matchMedia("screen and (resolution: "+r+"dppx)");return n.hasOwnProperty("addEventListener")?n.addEventListener("change",t):n.addListener(t),function(){n.hasOwnProperty("removeEventListener")?n.removeEventListener("change",t):n.removeListener(t)}}},[r,e]),r}function l(){return Math.min(Math.max(1,"u">typeof window&&"number"==typeof window.devicePixelRatio?window.devicePixelRatio:1),3)}var c=function(){function e(){}var t=e.prototype;return t.observe=function(){},t.unobserve=function(){},t.disconnect=function(){},e}();var d=globalThis.ResizeObserver||c,h=void 0!==globalThis.ResizeObserver,f=!h;function p(e,t){void 0===t&&(t=!0);var n=i.useState({width:0,height:0}),r=n[0],a=n[1];i.useEffect(function(){if("u">typeof window&&t){var e=function(){a({width:window.innerWidth,height:window.innerHeight})};return f&&(e(),window.addEventListener("resize",e)),function(){return window.removeEventListener("resize",e)}}},[]);var o=i.useRef(new d(function(e,t){var n=0;return function(){for(var r=this,i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];clearTimeout(n),n=window.setTimeout(function(){return e.apply(r,a)},t)}}(function(e){h&&a({width:e[e.length-1].contentRect.width,height:e[e.length-1].contentRect.height})},0)));return i.useEffect(function(){var n=o.current;if(t){var r=e.current;return e.current&&h&&n.observe(e.current),function(){n.disconnect(),r&&h&&n.unobserve(r)}}n.disconnect()},[e,o]),r}var v={useDevicePixelRatio:!0,fitCanvasToArtboardHeight:!1,useOffscreenRenderer:!0,shouldResizeCanvasToContainer:!0};function m(e){return Object.assign({},v,e)}function b(e){var t=e.riveLoaded,n=void 0!==t&&t,r=e.canvasElem,a=e.containerRef,o=e.options,s=e.onCanvasHasResized,l=e.artboardBounds,c=m(void 0===o?{}:o),d=i.useState({height:0,width:0}),h=d[0],f=h.height,v=h.width,b=d[1],g=i.useState({height:0,width:0}),y=g[0],w=y.height,_=y.width,C=g[1],A=i.useState(!0),M=A[0],P=A[1],I=c.fitCanvasToArtboardHeight,E=c.shouldResizeCanvasToContainer,R=c.useDevicePixelRatio,F=c.customDevicePixelRatio,k=p(a,E),T=u(F),L=null!=l?l:{},O=L.maxX,S=L.maxY,x=i.useCallback(function(){var e,t,n,r,i=null!=(e=null==(n=a.current)?void 0:n.clientWidth)?e:0,o=null!=(t=null==(r=a.current)?void 0:r.clientHeight)?t:0;return I&&l?{width:i,height:l.maxY/l.maxX*i}:{width:i,height:o}},[a,I,O,S]);i.useEffect(function(){if(E&&a.current&&n){var e=x(),t=e.width,i=e.he
1ight,o=!1;if(r){var u=t!==v||i!==f;if(c.fitCanvasToArtboardHeight&&u&&(a.current.style.height=i+"px",o=!0),c.useDevicePixelRatio){if(u||(t*T!==_||i*T!==w)){var l=T*t,d=T*i;r.width=l,r.height=d,r.style.width=t+"px",r.style.height=i+"px",C({width:l,height:d}),o=!0}}else u&&(r.width=t,r.height=i,C({width:t,height:i}),o=!0);b({width:t,height:i})}s&&(M||o)&&s&&s(),M&&P(!1)}},[r,a,k,T,x,M,P,w,_,f,v,s,E,I,R,n]),i.useEffect(function(){C({width:0,height:0})},[r])}var g=function(){function e(){}var t=e.prototype;return t.observe=function(){},t.unobserve=function(){},t.disconnect=function(){},e}(),y=globalThis.IntersectionObserver||g,w=function(){function e(){var e=this;this.elementsMap=new Map,this.onObserved=function(t){t.forEach(function(t){var n=e.elementsMap.get(t.target);n&&n(t)})},this.observer=new y(this.onObserved)}var t=e.prototype;return t.registerCallback=function(e,t){this.observer.observe(e),this.elementsMap.set(e,t)},t.removeCallback=function(e){this.observer.unobserve(e),this.elementsMap.delete(e)},e}(),_=function(){return r||(r=new w),r};function C(){return(C=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function A(e,t){if(null==e)return{};var n,r,i={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n]);return i}function M(e){var t=e.setContainerRef,n=e.setCanvasRef,r=e.className,i=void 0===r?"":r,a=e.style,o=e.children,u=A(e,["setContainerRef","setCanvasRef","className","style","children"]),l=C({width:"100%",height:"100%"},a);return s.default.createElement("div",C({ref:t,className:i},!i&&{style:l}),s.default.createElement("canvas",C({ref:n,style:{verticalAlign:"top",width:0,height:0}},u),o))}function P(e,t){void 0===t&&(t={});var n=i.useState(null),r=n[0],o=n[1],l=i.useRef(null),c=i.useRef(null),d=i.useState(null),h=d[0],f=d[1],p=!!e,v=m(t),g=u(),y=i.useCallback(function(){if(h){if(h.layout&&h.layout.fit===a.Fit.Layout&&r){var e=g*h.layout.layoutScaleFactor;h.devicePixelRatioUsed=g,h.artboardWidth=(null==r?void 0:r.width)/e,h.artboardHeight=(null==r?void 0:r.height)/e}h.startRendering(),h.resizeToCanvas()}},[h,g]);b({riveLoaded:!!h,canvasElem:r,containerRef:l,options:v,onCanvasHasResized:y,artboardBounds:null==h?void 0:h.bounds});var w=i.useCallback(function(e){null===e&&r&&(r.height=0,r.width=0),o(e)},[]);i.useEffect(function(){if(r&&e){var t,n=null!=h;if(null==h){var i=v.useOffscreenRenderer,o=e.onRiveReady,s=A(e,["onRiveReady"]);t=new a.Rive(C({useOffscreenRenderer:i},s,{canvas:r})),null!=c.current&&c.current.cleanup(),c.current=t,t.on(a.EventType.Load,function(){n=!0,o&&o(t),r?f(t):t.cleanup()})}return function(){n||null==t||t.cleanup()}}},[r,p,h]);var P=i.useCallback(function(e){l.current=e},[]),I={observe:i.useCallback(function(e,t){_().registerCallback(e,t)},[]),unobserve:i.useCallback(function(e){_().removeCallback(e)},[])},E=I.observe,R=I.unobserve;i.useEffect(function(){var e,t=!1,n=function(){if(r&&t){var e=r.getBoundingClientRect();e.width>0&&e.height>0&&e.top<(window.innerHeight||document.documentElement.clientHeight)&&e.bottom>0&&e.left<(window.innerWidth||document.documentElement.clientWidth)&&e.right>0&&(null==h||h.startRendering(),t=!1)}};return r&&!1!==v.shouldUseIntersectionObserver&&E(r,function(r){r.isIntersecting?h&&h.startRendering():h&&h.stopRendering(),t=!r.isIntersecting,clearTimeout(e),r.isIntersecting||0!==r.boundingClientRect.width||(e=setTimeout(n,10))}),function(){r&&R(r)}},[E,R,h,r,v.shouldUseIntersectionObserver]),i.useEffect(function(){return function(){h&&(h.cleanup(),f(null))}},[h,r]),i.useEffect(function(){return function(){null!=c.current&&c.current.cleanup()}},[]);var F=null==e?void 0:e.animations;i.useEffect(function(){h&&F&&(h.isPlaying?(h.stop(h.animationNames),h.play(F)):h.isPaused&&(h.stop(h.animationNames),h.pause(F)))},[F,h]);var k=i.useCallback(function(e){return s.default.createElement(M,C({setContainerRef:P,setCanvasRef:w},e))},[w,P]);return{canvas:r,container:l.current,setCanvasRef:w,setContainerRef:P,rive:h,RiveComponent:k}}function I(){return(I=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function E(e,t,n){var r=i.useState(null),a=r[0],o=r[1],s=i.useState(n.defaultValue),u=s[0],l=s[1],c=i.useState(null),d=c[0],h=c[1],f=i.useRef(null),p=i.useRef(e),v=i.useRef(n);i.useEffect(function(){v.current=n},[n]);var m=i.useCallback(function(){var e=f.current,t=p.current,n=v.current;if(!e||!t)return o(null),l(n.defaultValue),h(null),function(){};var r=n.getProperty(e,t);if(r){o(r),l(n.getValue(r)),n.getExtendedData&&h(n.getExtendedData(r));var i=function(){l(n.getValue(r)),n.getExtendedData&&h(n.getExtendedData(r)),n.onPropertyEvent&&n.onPropertyEvent()};return r.on(i),function(){r.off(i)}}return function(){}},[]);i.useEffect(function(){return f.current=t,p.current=e,m()},[t,e,m]);var b=i.useCallback(function(e){if(a&&f.current===t)try{return e(a),void(v.current.getExtendedData&&h(v.current.getExtendedData(a)))}catch(e){}if(f.current)try{var n=v.current.getProperty(f.current,p.current);n&&(o(n),e(n),v.current.getExtendedData&&h(v.current.getExtendedData(n)))}catch(e){}},[a,t]),g=I({value:u},i.useMemo(function(){return v.current.buildPropertyOperations(b)},[b]));return n.getExtendedData&&(g.extendedData=d),g}function R(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}t.default=function(e){var t=e.src,n=e.artboard,r=e.animations,i=e.stateMachines,a=e.layout,o=e.useOffscreenRenderer,u=e.shouldDisableRiveListeners,l=e.shouldResizeCanvasToContainer,c=e.automaticallyHandleEvents,d=e.children,h=function(e,t){if(null==e)return{};var n,r,i={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n]);return i}(e,["src","artboard","animations","stateMachines","layout","useOffscreenRenderer","shouldDisableRiveListeners","shouldResizeCanvasToContainer","automaticallyHandleEvents","children"]),f=P({src:t,artboard:n,animations:r,layout:a,stateMachines:i,autoplay:!0,shouldDisableRiveListeners:void 0!==u&&u,automaticallyHandleEvents:void 0!==c&&c},{useOffscreenRenderer:void 0===o||o,shouldResizeCanvasToContainer:void 0===l||l}).RiveComponent;return s.default.createElement(f,h,d)},t.useResizeCanvas=b,t.useRive=P,t.useRiveFile=function(e){var t=i.useState(null),n=t[0],r=t[1],o=i.useState("idle"),s=o[0],u=o[1];return i.useEffect(function(){var t=null;return function(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){R(a,r,i,o,s,"next",e)}function s(e){R(a,r,i,o,s,"throw",e)}o(void 0)})}}(function(){return function(e,t){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(o,"next",{value:u(0)}),s(o,"throw",{value:u(1)}),s(o,"return",{value:u(2)}),"function"==typeof Symbol&&s(o,Symbol.iterator,{value:function(){return this}}),o;function u(s){return function(u){var l=[s,u];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){a.label=l[1];break}if(6===l[0]&&a.label<i[1]){a.label=i[1],i=l;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(l);break}i[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],r=0}finally{n=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(n){try{u("loading"),(t=new a.RiveFile(e)).init(),t.on(a.EventType.Load,function(){null==t||t.getInstance(),r(t),u("success")}),t.on(a.EventType.LoadError,function(){u("failed")}),r(t)}catch(e){u("failed")}return[2]})})(),function(){null==t||t.cleanup()}},[e.src,e.buffer]),{riveFile:n,status:s}},t.useStateMachineInput=function(e,t,n,r){var o=i.useState(null),s=o[0],u=o[1];return i.useEffect(function(){var i=function(){if(e&&t&&n||u(null),e&&t&&n){var i=e.stateMachineInputs(t);if(i){var a=i.find(function(e){return e.name===n});void 0!==r&&a&&(a.value=r),u(a||null)}}else u(null)};i(),e&&e.on(a.EventType.Load,function(){i()})},[e]),s},t.useViewModel=function(e,t){var n=null!=t?t:{},r=n.name,o=n.useDefault,s=i.useState(null),u=s[0],l=s[1];return i.useEffect(function(){var t=function(){if(e){l(null!=r?(null==e.viewM
1odelByName?void 0:e.viewModelByName.call(e,r))||null:e.defaultViewModel()||null)}else l(null)};return t(),e&&e.on(a.EventType.Load,t),function(){e&&e.off(a.EventType.Load,t)}},[e,r,void 0!==o&&o]),u},t.useViewModelInstance=function(e,t){var n=null!=t?t:{},r=n.name,a=n.useDefault,o=void 0!==a&&a,s=n.useNew,u=void 0!==s&&s,l=n.rive,c=i.useState(null),d=c[0],h=c[1];return i.useEffect(function(){if(e){var t;h(t=null!=r?e.instanceByName(r)||null:o?(null==e.defaultInstance?void 0:e.defaultInstance.call(e))||null:u?(null==e.instance?void 0:e.instance.call(e))||null:(null==e.defaultInstance?void 0:e.defaultInstance.call(e))||null),l&&t&&l.viewModelInstance!==t&&l.bindViewModelInstance(t)}else h(null)},[e,r,o,u,l]),d},t.useViewModelInstanceArtboard=function(e,t){return{setValue:E(e,t,{getProperty:i.useCallback(function(e,t){return e.artboard(t)},[]),getValue:i.useCallback(function(){},[]),defaultValue:null,buildPropertyOperations:i.useCallback(function(e){return{setValue:function(t){e(function(e){e.value=t})}}},[])}).setValue}},t.useViewModelInstanceBoolean=function(e,t){var n=E(e,t,{getProperty:i.useCallback(function(e,t){return e.boolean(t)},[]),getValue:i.useCallback(function(e){return e.value},[]),defaultValue:null,buildPropertyOperations:i.useCallback(function(e){return{setValue:function(t){e(function(e){e.value=t})}}},[])});return{value:n.value,setValue:n.setValue}},t.useViewModelInstanceColor=function(e,t){var n=E(e,t,{getProperty:i.useCallback(function(e,t){return e.color(t)},[]),getValue:i.useCallback(function(e){return e.value},[]),defaultValue:null,buildPropertyOperations:i.useCallback(function(e){return{setValue:function(t){e(function(e){e.value=t})},setRgb:function(t,n,r){e(function(e){e.rgb(t,n,r)})},setRgba:function(t,n,r,i){e(function(e){e.rgba(t,n,r,i)})},setAlpha:function(t){e(function(e){e.alpha(t)})},setOpacity:function(t){e(function(e){e.opacity(t)})}}},[])});return{value:n.value,setValue:n.setValue,setRgb:n.setRgb,setRgba:n.setRgba,setAlpha:n.setAlpha,setOpacity:n.setOpacity}},t.useViewModelInstanceEnum=function(e,t){var n=E(e,t,{getProperty:i.useCallback(function(e,t){return e.enum(t)},[]),getValue:i.useCallback(function(e){return e.value},[]),defaultValue:null,getExtendedData:i.useCallback(function(e){return e.values},[]),buildPropertyOperations:i.useCallback(function(e){return{setValue:function(t){e(function(e){e.value=t})}}},[])});return{value:n.value,values:n.extendedData||[],setValue:n.setValue}},t.useViewModelInstanceImage=function(e,t){return{setValue:E(e,t,{getProperty:i.useCallback(function(e,t){return e.image(t)},[]),getValue:i.useCallback(function(){},[]),defaultValue:null,buildPropertyOperations:i.useCallback(function(e){return{setValue:function(t){e(function(e){e.value=t})}}},[])}).setValue}},t.useViewModelInstanceList=function(e,t){var n,r=i.useState(0)[1],a=E(e,t,{getProperty:i.useCallback(function(e,t){return e.list(t)},[]),getValue:i.useCallback(function(e){return e.length},[]),defaultValue:null,onPropertyEvent:function(){r(function(e){return e+1})},buildPropertyOperations:i.useCallback(function(e){return{addInstance:function(t){e(function(e){return e.addInstance(t)})},addInstanceAt:function(t,n){var r=!1;return e(function(e){r=e.addInstanceAt(t,n)}),r},removeInstance:function(t){e(function(e){return e.removeInstance(t)})},removeInstanceAt:function(t){e(function(e){return e.removeInstanceAt(t)})},getInstanceAt:function(t){var n=null;return e(function(e){n=e.instanceAt(t)}),n},swap:function(t,n){e(function(e){return e.swap(t,n)})}}},[])});return{length:null!=(n=a.value)?n:0,addInstance:a.addInstance,addInstanceAt:a.addInstanceAt,removeInstance:a.removeInstance,removeInstanceAt:a.removeInstanceAt,getInstanceAt:a.getInstanceAt,swap:a.swap}},t.useViewModelInstanceNumber=function(e,t){var n=E(e,t,{getProperty:i.useCallback(function(e,t){return e.number(t)},[]),getValue:i.useCallback(function(e){return e.value},[]),defaultValue:null,buildPropertyOperations:i.useCallback(function(e){return{setValue:function(t){e(function(e){e.value=t})}}},[])});return{value:n.value,setValue:n.setValue}},t.useViewModelInstanceString=function(e,t){var n=E(e,t,{getProperty:i.useCallback(function(e,t){return e.string(t)},[]),getValue:i.useCallback(function(e){return e.value},[]),defaultValue:null,buildPropertyOperations:i.useCallback(function(e){return{setValue:function(t){e(function(e){e.value=t})}}},[])});return{value:n.value,setValue:n.setValue}},t.useViewModelInstanceTrigger=function(e,t,n){var r=(null!=n?n:{}).onTrigger;return{trigger:E(e,t,{getProperty:i.useCallback(function(e,t){return e.trigger(t)},[]),getValue:i.useCallback(function(){},[]),defaultValue:null,onPropertyEvent:r,buildPropertyOperations:i.useCallback(function(e){return{trigger:function(){e(function(e){e.trigger()})}}},[])}).trigger}}
1,Object.keys(a).forEach(function(e){"default"===e||t.hasOwnProperty(e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})})}}]);

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.