@moonshot-ai/kimi-code 0.43.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.mjs +40378 -28041
- package/dist/search-worker.mjs +151 -8
- package/dist-web/assets/{CodeBlockNode-ClI5Zc7C.js → CodeBlockNode-BMkbTGvt.js} +3 -3
- package/dist-web/assets/Tooltip-CvCt2OpS.js +1 -0
- package/dist-web/assets/abnfDiagram-VRR7QNED-CMsWFmhV.js +1 -0
- package/dist-web/assets/arc-CXuu1fyI.js +1 -0
- package/dist-web/assets/architectureDiagram-ZJ3FMSHR-Bb_06Tis.js +36 -0
- package/dist-web/assets/{blockDiagram-677ZJIJ3-CGAoZfe5.js → blockDiagram-677ZJIJ3-dNCVszO9.js} +2 -2
- package/dist-web/assets/{c4Diagram-LMCZKHZV-DLgWFktO.js → c4Diagram-LMCZKHZV-Dsva6pwc.js} +2 -2
- package/dist-web/assets/channel-Dyw0qvA2.js +1 -0
- package/dist-web/assets/{chunk-2Q5K7J3B-D8ifWrnI.js → chunk-2Q5K7J3B-Df_GFe3n.js} +1 -1
- package/dist-web/assets/{chunk-32BRIVSS-DpG03lEd.js → chunk-32BRIVSS-BPgqH-Ub.js} +1 -1
- package/dist-web/assets/{chunk-5VM5RSS4-D5gZPx0N.js → chunk-5VM5RSS4-CUvXVaNK.js} +1 -1
- package/dist-web/assets/{chunk-EX3LRPZG-BHr3M6yM.js → chunk-EX3LRPZG-BRYxwC6w.js} +1 -1
- package/dist-web/assets/{chunk-JWPE2WC7-BxqMRrNb.js → chunk-JWPE2WC7-D24iyGyr.js} +1 -1
- package/dist-web/assets/{chunk-MOJQB5TN-DGD3Ca9J.js → chunk-MOJQB5TN-VIWv47K9.js} +3 -3
- package/dist-web/assets/{chunk-RYQCIY6F-Csv6QbcC.js → chunk-RYQCIY6F-BoueTeQN.js} +1 -1
- package/dist-web/assets/{chunk-V7JOEXUC-DpflSafv.js → chunk-V7JOEXUC-CzjVKRuS.js} +1 -1
- package/dist-web/assets/{chunk-VR4S4FIN-CHAEh_jD.js → chunk-VR4S4FIN-DN3fhyNm.js} +1 -1
- package/dist-web/assets/{chunk-XXDRQBXY-BW4XjZut.js → chunk-XXDRQBXY-DGdcv7YP.js} +1 -1
- package/dist-web/assets/classDiagram-OUVF2IWQ-CdLohFSG.js +1 -0
- package/dist-web/assets/classDiagram-v2-EOCWNBFH-CdLohFSG.js +1 -0
- package/dist-web/assets/cose-bilkent-JH36ORCC-gxrKFGCX.js +1 -0
- package/dist-web/assets/{cynefin-VYW2F7L2-DYKf_Z-v.js → cynefin-VYW2F7L2-D3UUATjS.js} +1 -1
- package/dist-web/assets/cynefinDiagram-TSTJHNR4-O0SkpuqV.js +62 -0
- package/dist-web/assets/dagre-VKFMJZFB-BBTY0HCS.js +4 -0
- package/dist-web/assets/{diagram-FQU43EPY-C1ljmLlO.js → diagram-FQU43EPY-DsY299GE.js} +3 -3
- package/dist-web/assets/diagram-G47NLZAW-nEZgArkk.js +24 -0
- package/dist-web/assets/diagram-NH7WQ7WH-BSozxDpD.js +24 -0
- package/dist-web/assets/{diagram-OA4YK3LP-JUEB_AtR.js → diagram-OA4YK3LP-wQHl6g_d.js} +4 -4
- package/dist-web/assets/diagram-WEI45ONY-Cr-V3eBB.js +41 -0
- package/dist-web/assets/ebnfDiagram-CCIWWBDH-BZW_-ozL.js +1 -0
- package/dist-web/assets/{erDiagram-Q63AITRT-DOSLOW_g.js → erDiagram-Q63AITRT-ma6YVYn1.js} +2 -2
- package/dist-web/assets/{flowDiagram-23GEKE2U-DUMMY9pi.js → flowDiagram-23GEKE2U-BMN1wm6S.js} +5 -5
- package/dist-web/assets/ganttDiagram-NO4QXBWP-ZiopqOWU.js +292 -0
- package/dist-web/assets/gitGraphDiagram-IHSO6WYX-C1RnDoR4.js +106 -0
- package/dist-web/assets/index-0m3MlJDE.js +151 -0
- package/dist-web/assets/index-B3oDj0jz.js +1428 -0
- package/dist-web/assets/{index-Brp-8WTi.js → index-BaplSJn2.js} +2 -2
- package/dist-web/assets/index-BxYISzcB.css +32 -0
- package/dist-web/assets/index-DusVyqlT.js +1033 -0
- package/dist-web/assets/{index10-DApEPd0n.js → index10-c69OEP3n.js} +1 -1
- package/dist-web/assets/{index11-DW3IQa8f.js → index11-Ckocwove.js} +1 -1
- package/dist-web/assets/{index5-COqqDMp9.js → index5-CvyQMVP4.js} +1 -1
- package/dist-web/assets/{index6-Dsp2NXNw.js → index6-BuCtox9U.js} +1 -1
- package/dist-web/assets/{index7-BRjOZjxG.js → index7-1944MZMc.js} +1 -1
- package/dist-web/assets/{index8-CrWWf7aj.js → index8-NUHwiS2h.js} +1 -1
- package/dist-web/assets/infoDiagram-FWYZ7A6U-Dvk0xdbs.js +2 -0
- package/dist-web/assets/{ishikawaDiagram-FXEZZL3T-B6KrpWbv.js → ishikawaDiagram-FXEZZL3T-DIq5ziHd.js} +4 -4
- package/dist-web/assets/{journeyDiagram-5HDEW3XC-JJbVJr8m.js → journeyDiagram-5HDEW3XC-BpYVPIMv.js} +2 -2
- package/dist-web/assets/{kanban-definition-HUTT4EX6-CeRZEVYd.js → kanban-definition-HUTT4EX6-BB6BytMt.js} +7 -7
- package/dist-web/assets/{linear-DPKx2NhO.js → linear-1b2KM_9_.js} +1 -1
- package/dist-web/assets/{mermaid.core-CgZTgv7Y.js → mermaid.core-DKNppTOJ.js} +12 -12
- package/dist-web/assets/{mindmap-definition-LN4V7U3C-Bd7aLAJp.js → mindmap-definition-LN4V7U3C-C2b0YpzO.js} +3 -3
- package/dist-web/assets/pegDiagram-2B236MQR-D6XtaX9M.js +1 -0
- package/dist-web/assets/pieDiagram-ENE6RG2P-CXk1aHpm.js +39 -0
- package/dist-web/assets/{quadrantDiagram-ABIIQ3AL-Bss2swqr.js → quadrantDiagram-ABIIQ3AL-_FP1pK7z.js} +4 -4
- package/dist-web/assets/railroadDiagram-RFXS5EU6-Dej7t1gg.js +1 -0
- package/dist-web/assets/{requirementDiagram-TGXJPOKE-BXFV4Te6.js → requirementDiagram-TGXJPOKE-BVF_sI9y.js} +3 -3
- package/dist-web/assets/sankeyDiagram-HTMAVEWB-BvrUbLRY.js +40 -0
- package/dist-web/assets/{sequenceDiagram-DBY2YBRQ-DyUTbMwM.js → sequenceDiagram-DBY2YBRQ-6chaE5cg.js} +4 -4
- package/dist-web/assets/sizeCapture-X5ZJPWSS-DvaC1t8J.js +1 -0
- package/dist-web/assets/stateDiagram-2N3HPSRC-D3xhTeeN.js +1 -0
- package/dist-web/assets/stateDiagram-v2-6OUMAXLB-C3BdpWyH.js +1 -0
- package/dist-web/assets/swimlanes-5IMT3BWC-BrUot17m.js +2 -0
- package/dist-web/assets/swimlanesDiagram-G3AALYLV-cfjcvW6J.js +8 -0
- package/dist-web/assets/{timeline-definition-FHXFAJF6-Blm9HJcK.js → timeline-definition-FHXFAJF6-waBA9ygA.js} +4 -4
- package/dist-web/assets/{vennDiagram-L72KCM5P-BhpzFpgZ.js → vennDiagram-L72KCM5P-z8BamcaO.js} +2 -2
- package/dist-web/assets/{vue.runtime.esm-bundler-BeN4Xi6a.js → vue.runtime.esm-bundler-Dcq6t2KV.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-EHGQE667-DGcHOZD9.js → wardleyDiagram-EHGQE667-B1ypaFQi.js} +2 -2
- package/dist-web/assets/{xychartDiagram-FW5EYKEG---3Lbwvl.js → xychartDiagram-FW5EYKEG-CWMxWJzt.js} +2 -2
- package/dist-web/index.html +2 -2
- package/native/darwin/prebuilds/darwin-arm64/{darwin-modifiers.node → darwin-platform.node} +0 -0
- package/native/darwin/prebuilds/darwin-x64/{darwin-modifiers.node → darwin-platform.node} +0 -0
- package/native/linux/prebuilds/linux-arm64/linux-platform-x11.node +0 -0
- package/native/linux/prebuilds/linux-x64/linux-platform-x11.node +0 -0
- package/native/win32/prebuilds/win32-arm64/win32-platform.node +0 -0
- package/native/win32/prebuilds/win32-x64/win32-platform.node +0 -0
- package/package.json +8 -7
- package/dist-web/assets/Tooltip-Dvr1al-t.js +0 -1
- package/dist-web/assets/_commonjsHelpers-CqkleIqs.js +0 -1
- package/dist-web/assets/abnfDiagram-VRR7QNED-CwBLQmjz.js +0 -1
- package/dist-web/assets/arc-CxZ33vix.js +0 -1
- package/dist-web/assets/architectureDiagram-ZJ3FMSHR-CM71RpvG.js +0 -36
- package/dist-web/assets/channel-IY5GdLm-.js +0 -1
- package/dist-web/assets/classDiagram-OUVF2IWQ-CqrT8Lg9.js +0 -1
- package/dist-web/assets/classDiagram-v2-EOCWNBFH-CqrT8Lg9.js +0 -1
- package/dist-web/assets/cose-bilkent-JH36ORCC-BdAGtrTa.js +0 -1
- package/dist-web/assets/cynefinDiagram-TSTJHNR4-BtxdUqIq.js +0 -62
- package/dist-web/assets/dagre-VKFMJZFB-4bDkTcg2.js +0 -4
- package/dist-web/assets/diagram-G47NLZAW-Dr4-bBys.js +0 -24
- package/dist-web/assets/diagram-NH7WQ7WH-Cj9RyKgp.js +0 -24
- package/dist-web/assets/diagram-WEI45ONY-t5xRZNwv.js +0 -41
- package/dist-web/assets/ebnfDiagram-CCIWWBDH-DCeAYlnS.js +0 -1
- package/dist-web/assets/ganttDiagram-NO4QXBWP-NYl4Z3R4.js +0 -292
- package/dist-web/assets/gitGraphDiagram-IHSO6WYX-EeKfrgej.js +0 -106
- package/dist-web/assets/index-7SHxad1A.js +0 -962
- package/dist-web/assets/index-CBLflN6S.js +0 -153
- package/dist-web/assets/index-CI2T7J0T.js +0 -1428
- package/dist-web/assets/index-CRa2d3RK.css +0 -32
- package/dist-web/assets/infoDiagram-FWYZ7A6U-DaH4t3R3.js +0 -2
- package/dist-web/assets/pegDiagram-2B236MQR-CX4fQesk.js +0 -1
- package/dist-web/assets/pieDiagram-ENE6RG2P-DiFeh11k.js +0 -39
- package/dist-web/assets/railroadDiagram-RFXS5EU6-Dpqal8U_.js +0 -1
- package/dist-web/assets/rive-BTwUD7iz.js +0 -1
- package/dist-web/assets/rive-CeXCFBdn.js +0 -20
- package/dist-web/assets/rive_fallback-DXpHVJvQ.js +0 -1
- package/dist-web/assets/sankeyDiagram-HTMAVEWB-BHcMCK_w.js +0 -40
- package/dist-web/assets/sizeCapture-X5ZJPWSS-KpJKp6ok.js +0 -1
- package/dist-web/assets/stateDiagram-2N3HPSRC-B9WRkRTB.js +0 -1
- package/dist-web/assets/stateDiagram-v2-6OUMAXLB-DaA_2kTJ.js +0 -1
- package/dist-web/assets/swimlanes-5IMT3BWC-C0-5MIxj.js +0 -2
- package/dist-web/assets/swimlanesDiagram-G3AALYLV-DMbj4GHb.js +0 -8
- package/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{g as vi}from"./_commonjsHelpers-CqkleIqs.js";function pi(Wt,yn){for(var Lt=0;Lt<yn.length;Lt++){const st=yn[Lt];if(typeof st!="string"&&!Array.isArray(st)){for(const Ae in st)if(Ae!=="default"&&!(Ae in Wt)){const _t=Object.getOwnPropertyDescriptor(st,Ae);_t&&Object.defineProperty(Wt,Ae,_t.get?_t:{enumerable:!0,get:()=>st[Ae]})}}}return Object.freeze(Object.defineProperty(Wt,Symbol.toStringTag,{value:"Module"}))}var gn={exports:{}},mi=gn.exports,kr;function gi(){return kr||(kr=1,(function(Wt,yn){(function(st,Ae){Wt.exports=Ae()})(mi,()=>(()=>{var Lt=[,((pe,Y,I)=>{I.r(Y),I.d(Y,{Animation:()=>N.Animation});var N=I(2)}),((pe,Y,I)=>{I.r(Y),I.d(Y,{Animation:()=>N});var N=(function(){function se(k,E,w,c){this.animation=k,this.artboard=E,this.playing=c,this.loopCount=0,this.scrubTo=null,this.instance=new w.LinearAnimationInstance(k,E)}return Object.defineProperty(se.prototype,"name",{get:function(){return this.animation.name},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"time",{get:function(){return this.instance.time},set:function(k){this.instance.time=k},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"loopValue",{get:function(){return this.animation.loopValue},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"needsScrub",{get:function(){return this.scrubTo!==null},enumerable:!1,configurable:!0}),se.prototype.advance=function(k){this.scrubTo===null?this.instance.advance(k):(this.instance.time=0,this.instance.advance(this.scrubTo),this.scrubTo=null)},se.prototype.apply=function(k){this.instance.apply(k)},se.prototype.cleanup=function(){this.instance.delete()},se})()}),((pe,Y,I)=>{I.r(Y),I.d(Y,{RuntimeLoader:()=>E});var N=I(4),se=I(5),k=function(){return k=Object.assign||function(w){for(var c,z=1,x=arguments.length;z<x;z++){c=arguments[z];for(var D in c)Object.prototype.hasOwnProperty.call(c,D)&&(w[D]=c[D])}return w},k.apply(this,arguments)},E=(function(){function w(){}return w.notifyError=function(c){var z;for(w.isLoading=!1;w.errorCallbackQueue.length>0;)(z=w.errorCallbackQueue.shift())===null||z===void 0||z(c);w.callBackQueue=[]},w.loadRuntime=function(){var c=w.wasmURL,z=w.wasmBinary;w.enablePerfMarks&&performance.mark("rive:wasm-init:start"),N.default(k({locateFile:function(){return c}},z?{wasmBinary:z}:{})).then(function(x){var D;for(w.enablePerfMarks&&(performance.mark("rive:wasm-init:end"),performance.measure("rive:wasm-init","rive:wasm-init:start","rive:wasm-init:end")),w.runtime=x,w.errorCallbackQueue=[];w.callBackQueue.length>0;)(D=w.callBackQueue.shift())===null||D===void 0||D(w.runtime)}).catch(function(x){var D={message:x?.message||"Unknown error",type:x?.name||"Error",wasmError:x instanceof WebAssembly.CompileError||x instanceof WebAssembly.RuntimeError,originalError:x};console.debug("Rive WASM load error details:",D);var ue=w.wasmFallbackURL,le=ue!==null&&c.toLowerCase()===ue.toLowerCase();if(ue!==null&&!le)console.warn("Failed to load WASM from ".concat(c," (").concat(D.message,"), trying fallback URL: ").concat(ue)),w.wasmBinary=null,w.setWasmUrl(ue),w.loadRuntime();else{var ie=le?"the configured WASM URL or its fallback (".concat(ue,")"):c,we=["Could not load Rive WASM file from ".concat(ie,"."),"Possible reasons:","- Network connection is down","- WebAssembly is not supported in this environment","- The WASM file is corrupted or incompatible",`
|
|
2
|
-
Error details:`,"- Type: ".concat(D.type),"- Message: ".concat(D.message),"- WebAssembly-specific error: ".concat(D.wasmError),`
|
|
3
|
-
To resolve, you may need to:`,"1. Check your network connection","2. Set a new WASM source via RuntimeLoader.setWasmUrl()","3. Call RuntimeLoader.awaitInstance() again"].join(`
|
|
4
|
-
`);console.error(we),w.notifyError(new Error(we))}})},w.getInstance=function(c,z){w.isLoading||(w.isLoading=!0,w.loadRuntime()),w.runtime?c(w.runtime):(w.callBackQueue.push(c),z&&w.errorCallbackQueue.push(z))},w.awaitInstance=function(){return new Promise(function(c,z){return w.getInstance(c,z)})},w.setWasmUrl=function(c){w.wasmURL=c},w.getWasmUrl=function(){return w.wasmURL},w.setWasmFallbackUrl=function(c){w.wasmFallbackURL=c},w.getWasmFallbackUrl=function(){return w.wasmFallbackURL},w.setWasmBinary=function(c){if(c instanceof ArrayBuffer||c===null){w.wasmBinary=c;return}console.error("setWasmBinary expects an ArrayBuffer or null")},w.getWasmBinary=function(){return w.wasmBinary},w.isLoading=!1,w.callBackQueue=[],w.wasmURL="https://unpkg.com/".concat(se.name,"@").concat(se.version,"/rive.wasm"),w.wasmFallbackURL="https://cdn.jsdelivr.net/npm/".concat(se.name,"@").concat(se.version,"/rive_fallback.wasm"),w.wasmBinary=null,w.errorCallbackQueue=[],w.enablePerfMarks=!1,w})()}),((pe,Y,I)=>{I.r(Y),I.d(Y,{default:()=>se});var N=(()=>{var k=typeof document<"u"?document.currentScript?.src:void 0;return(function(E={}){var w,c=E,z,x,D=new Promise((e,t)=>{z=e,x=t}),ue=typeof window=="object",le=typeof importScripts=="function";function ie(){function e(f){const h=o;r=t=0,o=new Map,h.forEach(g=>{try{g(f)}catch(m){console.error(m)}}),this.gb(),s&&s.Hb()}let t=0,r=0,o=new Map,s=null,l=null;this.requestAnimationFrame=function(f){t||=requestAnimationFrame(e.bind(this));const h=++r;return o.set(h,f),h},this.cancelAnimationFrame=function(f){o.delete(f),t&&o.size==0&&(cancelAnimationFrame(t),t=0)},this.Fb=function(f){l&&(document.body.remove(l),l=null),f||(l=document.createElement("div"),l.style.backgroundColor="black",l.style.position="fixed",l.style.right=0,l.style.top=0,l.style.color="white",l.style.padding="4px",l.innerHTML="RIVE FPS",f=function(h){l.innerHTML="RIVE FPS "+h.toFixed(1)},document.body.appendChild(l)),s=new function(){let h=0,g=0;this.Hb=function(){var m=performance.now();g?(++h,m-=g,1e3<m&&(f(1e3*h/m),h=g=0)):(g=m,h=0)}}},this.Cb=function(){l&&(document.body.remove(l),l=null),s=null},this.gb=function(){}}function we(e){console.assert(!0);const t=new Map;let r=-1/0;this.push=function(o){return o=o+((1<<e)-1)>>e,t.has(o)&&clearTimeout(t.get(o)),t.set(o,setTimeout(function(){t.delete(o),t.length==0?r=-1/0:o==r&&(r=Math.max(...t.keys()),console.assert(r<o))},1e3)),r=Math.max(o,r),r<<e}}const Fe=c.onRuntimeInitialized;c.onRuntimeInitialized=function(){Fe&&Fe();let e=c.decodeAudio;c.decodeAudio=function(l,f){l=e(l),f(l)};let t=c.decodeFont;c.decodeFont=function(l,f){l=t(l),f(l)};let r=c.setFallbackFontCb;c.setFallbackFontCallback=typeof r=="function"?function(l){r(l)}:function(){console.warn("Module.setFallbackFontCallback called, but text support is not enabled in this build.")};const o=c.FileAssetLoader;c.ptrToAsset=l=>{let f=c.ptrToFileAsset(l);return f.isImage?c.ptrToImageAsset(l):f.isFont?c.ptrToFontAsset(l):f.isAudio?c.ptrToAudioAsset(l):f},c.CustomFileAssetLoader=o.extend("CustomFileAssetLoader",{__construct:function({loadContents:l}){this.__parent.__construct.call(this),this.ub=l},loadContents:function(l,f){return l=c.ptrToAsset(l),this.ub(l,f)}}),c.CDNFileAssetLoader=o.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(l){let f=c.ptrToAsset(l);return l=f.cdnUuid,l===""?!1:((function(h,g){var m=new XMLHttpRequest;m.responseType="arraybuffer",m.onreadystatechange=function(){m.readyState==4&&m.status==200&&g(m)},m.open("GET",h,!0),m.send(null)})(f.cdnBaseUrl+"/"+l,h=>{f.decode(new Uint8Array(h.response))}),!0)}}),c.FallbackFileAssetLoader=o.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.bb=[]},addLoader:function(l){this.bb.push(l)},loadContents:function(l,f){for(let h of this.bb)if(h.loadContents(l,f))return!0;return!1}});let s=c.computeAlignment;c.computeAlignment=function(l,f,h,g,m=1){return s.call(this,l,f,h,g,m)}};const He="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),ze=new function(){function e(){if(!t){let G=function(ee,P,de){if(P=_.createShader(P),_.shaderSource(P,de),_.compileShader(P),de=_.getShaderInfoLog(P),0<(de||"").length)throw de;_.attachShader(ee,P)};var v=document.createElement("canvas"),C={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,renderViaOffscreenBackBuffer:1};let _;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(_=v.getContext("webgl",C),r=1,!_)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(_=v.getContext("webgl2",C))r=2;else if(_=v.getContext("webgl",C))r=1;else return console.log("No WebGL support. Image mesh will not be drawn."),!1;if(_=new Proxy(_,{get(ee,P){if(ee.isContextLost()){if(g||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",P),g=!0),typeof ee[P]=="function")return function(){}}else return typeof ee[P]=="function"?function(...de){return ee[P].apply(ee,de)}:ee[P]},set(ee,P,de){if(ee.isContextLost())g||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+P),g=!0);else return ee[P]=de,!0}}),o=Math.min(_.getParameter(_.MAX_RENDERBUFFER_SIZE),_.getParameter(_.MAX_TEXTURE_SIZE)),v=_.createProgram(),G(v,_.VERTEX_SHADER,`attribute vec2 vertex;
|
|
5
|
-
attribute vec2 uv;
|
|
6
|
-
uniform vec4 mat;
|
|
7
|
-
uniform vec2 translate;
|
|
8
|
-
varying vec2 st;
|
|
9
|
-
void main() {
|
|
10
|
-
st = uv;
|
|
11
|
-
gl_Position = vec4(mat2(mat) * vertex + translate, 0, 1);
|
|
12
|
-
}`),G(v,_.FRAGMENT_SHADER,`precision highp float;
|
|
13
|
-
uniform sampler2D image;
|
|
14
|
-
varying vec2 st;
|
|
15
|
-
void main() {
|
|
16
|
-
gl_FragColor = texture2D(image, st);
|
|
17
|
-
}`),_.bindAttribLocation(v,0,"vertex"),_.bindAttribLocation(v,1,"uv"),_.linkProgram(v),C=_.getProgramInfoLog(v),0<(C||"").trim().length)throw C;s=_.getUniformLocation(v,"mat"),l=_.getUniformLocation(v,"translate"),_.useProgram(v),_.bindBuffer(_.ARRAY_BUFFER,_.createBuffer()),_.enableVertexAttribArray(0),_.enableVertexAttribArray(1),_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,_.createBuffer()),_.uniform1i(_.getUniformLocation(v,"image"),0),_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t=_}return!0}let t=null,r=0,o=0,s=null,l=null,f=0,h=0,g=!1;e(),this.Tb=function(){return e(),o},this.Bb=function(v){t.deleteTexture&&t.deleteTexture(v)},this.Ab=function(v){if(!e())return null;const C=t.createTexture();return C?(t.bindTexture(t.TEXTURE_2D,C),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,v),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),r==2?(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),C):null};const m=new we(8),A=new we(8),R=new we(10),j=new we(10);this.Eb=function(v,C,_,G,ee){if(e()){var P=m.push(v),de=A.push(C);if(t.canvas){(t.canvas.width!=P||t.canvas.height!=de)&&(t.canvas.width=P,t.canvas.height=de),t.viewport(0,de-C,v,C),t.disable(t.SCISSOR_TEST),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.enable(t.SCISSOR_TEST),_.sort((re,ot)=>ot.nb-re.nb),P=R.push(G),f!=P&&(t.bufferData(t.ARRAY_BUFFER,8*P,t.DYNAMIC_DRAW),f=P),P=0;for(var Ce of _)t.bufferSubData(t.ARRAY_BUFFER,P,Ce.La),P+=4*Ce.La.length;console.assert(P==4*G);for(var Ye of _)t.bufferSubData(t.ARRAY_BUFFER,P,Ye.rb),P+=4*Ye.rb.length;console.assert(P==8*G),P=j.push(ee),h!=P&&(t.bufferData(t.ELEMENT_ARRAY_BUFFER,2*P,t.DYNAMIC_DRAW),h=P),Ce=0;for(var Rt of _)t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,Ce,Rt.indices),Ce+=2*Rt.indices.length;console.assert(Ce==2*ee),Rt=0,Ye=!0,P=Ce=0;for(const re of _){re.image.Da!=Rt&&(t.bindTexture(t.TEXTURE_2D,re.image.Ca||null),Rt=re.image.Da),re.Yb?(t.scissor(re.Ra,de-re.Sa-re.ab,re.kc,re.ab),Ye=!0):Ye&&(t.scissor(0,de-C,v,C),Ye=!1),_=2/v;const ot=-2/C;t.uniform4f(s,re.da[0]*_*re.ua,re.da[1]*ot*re.va,re.da[2]*_*re.ua,re.da[3]*ot*re.va),t.uniform2f(l,re.da[4]*_*re.ua+_*(re.Ra-re.Ub*re.ua)-1,re.da[5]*ot*re.va+ot*(re.Sa-re.Vb*re.va)+1),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,P),t.vertexAttribPointer(1,2,t.FLOAT,!1,0,P+4*G),t.drawElements(t.TRIANGLES,re.indices.length,t.UNSIGNED_SHORT,Ce),P+=4*re.La.length,Ce+=2*re.indices.length}console.assert(P==4*G),console.assert(Ce==2*ee)}}},this.canvas=function(){return e()&&t.canvas}},L=c.onRuntimeInitialized;c.onRuntimeInitialized=function(){function e(b){switch(b){case m.srcOver:return"source-over";case m.screen:return"screen";case m.overlay:return"overlay";case m.darken:return"darken";case m.lighten:return"lighten";case m.colorDodge:return"color-dodge";case m.colorBurn:return"color-burn";case m.hardLight:return"hard-light";case m.softLight:return"soft-light";case m.difference:return"difference";case m.exclusion:return"exclusion";case m.multiply:return"multiply";case m.hue:return"hue";case m.saturation:return"saturation";case m.color:return"color";case m.luminosity:return"luminosity"}}function t(b){return"rgba("+((16711680&b)>>>16)+","+((65280&b)>>>8)+","+((255&b)>>>0)+","+((4278190080&b)>>>24)/255+")"}function r(){0<de.length&&(ze.Eb(P.drawWidth(),P.drawHeight(),de,Ce,Ye),de=[],Ye=Ce=0,P.reset(512,512));for(const b of ee){for(const F of b.G)F();b.G=[]}ee.clear()}L&&L();var o=c.RenderPaintStyle;const s=c.RenderPath,l=c.RenderPaint,f=c.Renderer,h=c.StrokeCap,g=c.StrokeJoin,m=c.BlendMode,A=o.fill,R=o.stroke,j=c.FillRule.evenOdd;let v=1;var C=c.RenderImage.extend("CanvasRenderImage",{__construct:function({ha:b,sa:F}={}){this.__parent.__construct.call(this),this.Da=v,v=v+1&2147483647||1,this.ha=b,this.sa=F},__destruct:function(){this.Ca&&(ze.Bb(this.Ca),URL.revokeObjectURL(this.Oa)),this.__parent.__destruct.call(this)},decode:function(b){var F=this;F.sa&&F.sa(F);var te=new Image;F.Oa=URL.createObjectURL(new Blob([b],{type:"image/png"})),te.onload=function(){F.tb=te,F.Ca=ze.Ab(te),F.size(te.width,te.height),F.ha&&F.ha(F)},te.src=F.Oa}}),_=s.extend("CanvasRenderPath",{__construct:function(){this.__parent.__construct.call(this),this.R=new Path2D},rewind:function(){this.R=new Path2D},addPath:function(b,F,te,Q,$,q,K){var ve=this.R,xt=ve.addPath;b=b.R;const Se=new DOMMatrix;Se.a=F,Se.b=te,Se.c=Q,Se.d=$,Se.e=q,Se.f=K,xt.call(ve,b,Se)},fillRule:function(b){this.Na=b},moveTo:function(b,F){this.R.moveTo(b,F)},lineTo:function(b,F){this.R.lineTo(b,F)},cubicTo:function(b,F,te,Q,$,q){this.R.bezierCurveTo(b,F,te,Q,$,q)},close:function(){this.R.closePath()}}),G=l.extend("CanvasRenderPaint",{color:function(b){this.Pa=t(b)},thickness:function(b){this.xb=b},join:function(b){switch(b){case g.miter:this.Ba="miter";break;case g.round:this.Ba="round";break;case g.bevel:this.Ba="bevel"}},cap:function(b){switch(b){case h.butt:this.Aa="butt";break;case h.round:this.Aa="round";break;case h.square:this.Aa="square"}},style:function(b){this.wb=b},blendMode:function(b){this.sb=e(b)},clearGradient:function(){this.fa=null},linearGradient:function(b,F,te,Q){this.fa={ob:b,pb:F,Va:te,Wa:Q,Ja:[]}},radialGradient:function(b,F,te,Q){this.fa={ob:b,pb:F,Va:te,Wa:Q,Ja:[],Sb:!0}},addStop:function(b,F){this.fa.Ja.push({color:b,stop:F})},completeGradient:function(){},draw:function(b,F,te,Q){let $=this.wb;var q=this.Pa,K=this.fa;const ve=b.globalCompositeOperation,xt=b.globalAlpha;if(b.globalCompositeOperation=this.sb,b.globalAlpha=Q,K!=null){q=K.ob;const qe=K.pb,mt=K.Va;var Se=K.Wa;Q=K.Ja,K.Sb?(K=mt-q,Se-=qe,q=b.createRadialGradient(q,qe,0,q,qe,Math.sqrt(K*K+Se*Se))):q=b.createLinearGradient(q,qe,mt,Se);for(let et=0,at=Q.length;et<at;et++)K=Q[et],q.addColorStop(K.stop,t(K.color));this.Pa=q,this.fa=null}switch($){case R:b.strokeStyle=q,b.lineWidth=this.xb,b.lineCap=this.Aa,b.lineJoin=this.Ba,b.stroke(F);break;case A:b.fillStyle=q,b.fill(F,te)}b.globalCompositeOperation=ve,b.globalAlpha=xt}});const ee=new Set;let P=null,de=[],Ce=0,Ye=0;var Rt=c.CanvasRenderer=f.extend("Renderer",{__construct:function(b){this.__parent.__construct.call(this),this.P=[1,0,0,1,0,0],this.D=[1],this.A=b.getContext("2d"),this.Ma=b,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 b=this.P.length-6;if(6>b)throw"restore() called without matching save().";this.P.splice(b),this.D.pop(),this.G.push(this.A.restore.bind(this.A))},transform:function(b,F,te,Q,$,q){const K=this.P,ve=K.length-6;K.splice(ve,6,K[ve]*b+K[ve+2]*F,K[ve+1]*b+K[ve+3]*F,K[ve]*te+K[ve+2]*Q,K[ve+1]*te+K[ve+3]*Q,K[ve]*$+K[ve+2]*q+K[ve+4],K[ve+1]*$+K[ve+3]*q+K[ve+5]),this.G.push(this.A.transform.bind(this.A,b,F,te,Q,$,q))},rotate:function(b){const F=Math.sin(b);b=Math.cos(b),this.transform(b,F,-F,b,0,0)},modulateOpacity:function(b){this.D[this.D.length-1]*=b},_drawPath:function(b,F){this.G.push(F.draw.bind(F,this.A,b.R,b.Na===j?"evenodd":"nonzero",Math.max(0,this.D[this.D.length-1])))},_drawRiveImage:function(b,F,te,Q){var $=b.tb;if($){var q=this.A,K=e(te),ve=Math.max(0,Q*this.D[this.D.length-1]);this.G.push(function(){q.globalCompositeOperation=K,q.globalAlpha=ve,q.drawImage($,0,0),q.globalAlpha=1})}},_getMatrix:function(b){const F=this.P,te=F.length-6;for(let Q=0;6>Q;++Q)b[Q]=F[te+Q]},_drawImageMesh:function(b,F,te,Q,$,q,K,ve,xt,Se,qe,mt,et,at){let Fr,Ir,Pr;try{Fr=c.HEAPF32.slice($>>2,($>>2)+q),Ir=c.HEAPF32.slice(K>>2,(K>>2)+ve),Pr=c.HEAPU16.slice(xt>>1,(xt>>1)+Se)}catch{console.error("[Rive] _drawImageMesh: failed to read mesh data from WASM heap. Mesh skipped for this frame.");return}F=this.A.canvas.width,$=this.A.canvas.height,K=et-qe,ve=at-mt,qe=Math.max(qe,0),mt=Math.max(mt,0),et=Math.min(et,F),at=Math.min(at,$);const Jt=et-qe,Zt=at-mt;if(console.assert(Jt<=Math.min(K,F)),console.assert(Zt<=Math.min(ve,$)),!(0>=Jt||0>=Zt)){et=Jt<K||Zt<ve,F=at=1;var Et=Math.ceil(Jt*at),kt=Math.ceil(Zt*F);$=ze.Tb(),Et>$&&(at*=$/Et,Et=$),kt>$&&(F*=$/kt,kt=$),P||(P=new c.DynamicRectanizer($),P.reset(512,512)),$=P.addRect(Et,kt),0>$&&(r(),ee.add(this),$=P.addRect(Et,kt),console.assert(0<=$));var Rr=$&65535,Er=$>>16;de.push({da:this.P.slice(this.P.length-6),image:b,Ra:Rr,Sa:Er,Ub:qe,Vb:mt,kc:Et,ab:kt,ua:at,va:F,La:Fr,rb:Ir,indices:Pr,Yb:et,nb:b.Da<<1|(et?1:0)}),Ce+=q,Ye+=Se;var Dt=this.A,di=e(te),hi=Math.max(0,Q*this.D[this.D.length-1]);this.G.push(function(){Dt.save(),Dt.resetTransform(),Dt.globalCompositeOperation=di,Dt.globalAlpha=hi;const Vn=ze.canvas();Vn&&Dt.drawImage(Vn,Rr,Er,Et,kt,qe,mt,Jt,Zt),Dt.restore()})}},_clipPath:function(b){this.G.push(this.A.clip.bind(this.A,b.R,b.Na===j?"evenodd":"nonzero"))},clear:function(){ee.add(this),this.G.push(this.A.clearRect.bind(this.A,0,0,this.Ma.width,this.Ma.height))},flush:function(){},translate:function(b,F){this.transform(1,0,0,1,b,F)}});c.makeRenderer=function(b){const F=new Rt(b),te=F.A;return new Proxy(F,{get(Q,$){if(typeof Q[$]=="function")return function(...q){return Q[$].apply(Q,q)};if(typeof te[$]=="function"){if(-1<He.indexOf($))throw Error("RiveException: Method call to '"+$+"()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods.");return function(...q){F.G.push(te[$].bind(te,...q))}}return Q[$]},set(Q,$,q){if($ in te)return F.G.push(()=>{te[$]=q}),!0}})},c.decodeImage=function(b,F){new C({ha:F}).decode(b)},c.renderFactory={makeRenderPaint:function(){return new G},makeRenderPath:function(){return new _},makeRenderImage:function(){let b=ot;return new C({sa:()=>{b.total++},ha:()=>{if(b.loaded++,b.loaded===b.total){const F=b.ready;F&&(F(),b.ready=null)}}})}};let re=c.load,ot=null;c.load=function(b,F,te=!0){const Q=new c.FallbackFileAssetLoader;return F!==void 0&&Q.addLoader(F),te&&(F=new c.CDNFileAssetLoader,Q.addLoader(F)),new Promise(function($){let q=null;ot={total:0,loaded:0,ready:function(){$(q)}},q=re(b,Q),ot.total==0&&$(q)})};let fi=c.RendererWrapper.prototype.align;c.RendererWrapper.prototype.align=function(b,F,te,Q,$=1){fi.call(this,b,F,te,Q,$)},o=new ie,c.requestAnimationFrame=o.requestAnimationFrame.bind(o),c.cancelAnimationFrame=o.cancelAnimationFrame.bind(o),c.enableFPSCounter=o.Fb.bind(o),c.disableFPSCounter=o.Cb,o.gb=r,c.resolveAnimationFrame=r,c.cleanup=function(){P&&P.delete()}};var T=Object.assign({},c),Z="./this.program",M="",Ie,Pe;(ue||le)&&(le?M=self.location.href:typeof document<"u"&&document.currentScript&&(M=document.currentScript.src),k&&(M=k),M.startsWith("blob:")?M="":M=M.substr(0,M.replace(/[?#].*/,"").lastIndexOf("/")+1),le&&(Pe=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),Ie=(e,t,r)=>{if(yt(e)){var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=()=>{o.status==200||o.status==0&&o.response?t(o.response):r()},o.onerror=r,o.send(null)}else fetch(e,{credentials:"same-origin"}).then(s=>s.ok?s.arrayBuffer():Promise.reject(Error(s.status+" : "+s.url))).then(t,r)});var gt=c.print||console.log.bind(console),_e=c.printErr||console.error.bind(console);Object.assign(c,T),T=null,c.thisProgram&&(Z=c.thisProgram);var je;c.wasmBinary&&(je=c.wasmBinary);var Ve,At=!1,oe,ne,Re,Ue,U,J,Ge,tt;function ge(){var e=Ve.buffer;c.HEAP8=oe=new Int8Array(e),c.HEAP16=Re=new Int16Array(e),c.HEAPU8=ne=new Uint8Array(e),c.HEAPU16=Ue=new Uint16Array(e),c.HEAP32=U=new Int32Array(e),c.HEAPU32=J=new Uint32Array(e),c.HEAPF32=Ge=new Float32Array(e),c.HEAPF64=tt=new Float64Array(e)}var xe=[],Ee=[],Le=[];function Tt(){var e=c.preRun.shift();xe.unshift(e)}var De=0,Ke=null;function ut(e){throw c.onAbort?.(e),e="Aborted("+e+")",_e(e),At=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),x(e),e}var lt=e=>e.startsWith("data:application/octet-stream;base64,"),yt=e=>e.startsWith("file://"),wt;function ct(e){if(e==wt&&je)return new Uint8Array(je);if(Pe)return Pe(e);throw"both async and sync fetching of the wasm failed"}function Ct(e){return je?Promise.resolve().then(()=>ct(e)):new Promise((t,r)=>{Ie(e,o=>t(new Uint8Array(o)),()=>{try{t(ct(e))}catch(o){r(o)}})})}function Te(e,t,r){return Ct(e).then(o=>WebAssembly.instantiate(o,t)).then(r,o=>{_e(`failed to asynchronously prepare wasm: ${o}`),ut(o)})}function Mt(e,t){var r=wt;return je||typeof WebAssembly.instantiateStreaming!="function"||lt(r)||yt(r)||typeof fetch!="function"?Te(r,e,t):fetch(r,{credentials:"same-origin"}).then(o=>WebAssembly.instantiateStreaming(o,e).then(t,function(s){return _e(`wasm streaming compile failed: ${s}`),_e("falling back to ArrayBuffer instantiation"),Te(r,e,t)}))}var Je,ye,ae={486221:(e,t,r,o,s)=>{if(typeof window>"u"||(window.AudioContext||window.webkitAudioContext)===void 0)return 0;if(typeof window.miniaudio>"u"){window.miniaudio={referenceCount:0},window.miniaudio.device_type={},window.miniaudio.device_type.playback=e,window.miniaudio.device_type.capture=t,window.miniaudio.device_type.duplex=r,window.miniaudio.device_state={},window.miniaudio.device_state.stopped=o,window.miniaudio.device_state.started=s;let l=window.miniaudio;l.devices=[],l.track_device=function(f){for(var h=0;h<l.devices.length;++h)if(l.devices[h]==null)return l.devices[h]=f,h;return l.devices.push(f),l.devices.length-1},l.untrack_device_by_index=function(f){for(l.devices[f]=null;0<l.devices.length&&l.devices[l.devices.length-1]==null;)l.devices.pop()},l.untrack_device=function(f){for(var h=0;h<l.devices.length;++h)if(l.devices[h]==f)return l.untrack_device_by_index(h)},l.get_device_by_index=function(f){return l.devices[f]},l.unlock_event_types=["touchend","click"],l.unlock=function(){for(var f=0;f<l.devices.length;++f){var h=l.devices[f];h!=null&&h.I!=null&&h.state===l.device_state.started&&h.I.resume().then(()=>{yr(h.hb)},g=>{console.error("Failed to resume audiocontext",g)})}l.unlock_event_types.map(function(g){document.removeEventListener(g,l.unlock,!0)})},l.unlock_event_types.map(function(f){document.addEventListener(f,l.unlock,!0)})}return window.miniaudio.referenceCount+=1,1},488399:()=>{typeof window.miniaudio<"u"&&(window.miniaudio.unlock_event_types.map(function(e){document.removeEventListener(e,window.miniaudio.unlock,!0)}),--window.miniaudio.referenceCount,window.miniaudio.referenceCount===0&&delete window.miniaudio)},488703:()=>navigator.mediaDevices!==void 0&&navigator.mediaDevices.getUserMedia!==void 0,488807:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch{return 0}},488978:(e,t,r,o,s,l)=>{if(typeof window.miniaudio>"u")return-1;var f={},h={};return e==window.miniaudio.device_type.playback&&r!=0&&(h.sampleRate=r),f.I=new(window.AudioContext||window.webkitAudioContext)(h),f.I.suspend(),f.state=window.miniaudio.device_state.stopped,r=0,e!=window.miniaudio.device_type.playback&&(r=t),f.W=f.I.createScriptProcessor(o,r,t),f.W.onaudioprocess=function(g){if((f.na==null||f.na.length==0)&&(f.na=new Float32Array(Ge.buffer,s,o*t)),e==window.miniaudio.device_type.capture||e==window.miniaudio.device_type.duplex){for(var m=0;m<t;m+=1)for(var A=g.inputBuffer.getChannelData(m),R=f.na,j=0;j<o;j+=1)R[j*t+m]=A[j];wr(l,o,s)}if(e==window.miniaudio.device_type.playback||e==window.miniaudio.device_type.duplex)for(br(l,o,s),m=0;m<g.outputBuffer.numberOfChannels;++m)for(A=g.outputBuffer.getChannelData(m),R=f.na,j=0;j<o;j+=1)A[j]=R[j*t+m];else for(m=0;m<g.outputBuffer.numberOfChannels;++m)g.outputBuffer.getChannelData(m).fill(0)},e!=window.miniaudio.device_type.capture&&e!=window.miniaudio.device_type.duplex||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(function(g){f.wa=f.I.createMediaStreamSource(g),f.wa.connect(f.W),f.W.connect(f.I.destination)}).catch(function(g){console.log("Failed to get user media: "+g)}),e==window.miniaudio.device_type.playback&&f.W.connect(f.I.destination),f.hb=l,window.miniaudio.track_device(f)},491855:e=>window.miniaudio.get_device_by_index(e).I.sampleRate,491928:e=>{e=window.miniaudio.get_device_by_index(e),e.W!==void 0&&(e.W.onaudioprocess=function(){},e.W.disconnect(),e.W=void 0),e.wa!==void 0&&(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),e.I.resume(),e.state=window.miniaudio.device_state.started},492517:e=>{e=window.miniaudio.get_device_by_index(e),e.I.suspend(),e.state=window.miniaudio.device_state.stopped}},a=e=>{for(;0<e.length;)e.shift()(c)};function n(){var e=U[+Nt>>2];return Nt+=4,e}var i=(e,t)=>{for(var r=0,o=e.length-1;0<=o;o--){var s=e[o];s==="."?e.splice(o,1):s===".."?(e.splice(o,1),r++):r&&(e.splice(o,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},u=e=>{var t=e.charAt(0)==="/",r=e.substr(-1)==="/";return(e=i(e.split("/").filter(o=>!!o),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},d=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)},p=e=>{if(e==="/")return"/";e=u(e),e=e.replace(/\/$/,"");var t=e.lastIndexOf("/");return t===-1?e:e.substr(t+1)},y=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);ut("initRandomDevice")},S=e=>(S=y())(e),V=(...e)=>{for(var t="",r=!1,o=e.length-1;-1<=o&&!r;o--){if(r=0<=o?e[o]:"/",typeof r!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";t=r+"/"+t,r=r.charAt(0)==="/"}return t=i(t.split("/").filter(s=>!!s),!r).join("/"),(r?"/":"")+t||"."},O=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,B=(e,t,r)=>{var o=t+r;for(r=t;e[r]&&!(r>=o);)++r;if(16<r-t&&e.buffer&&O)return O.decode(e.subarray(t,r));for(o="";t<r;){var s=e[t++];if(s&128){var l=e[t++]&63;if((s&224)==192)o+=String.fromCharCode((s&31)<<6|l);else{var f=e[t++]&63;s=(s&240)==224?(s&15)<<12|l<<6|f:(s&7)<<18|l<<12|f<<6|e[t++]&63,65536>s?o+=String.fromCharCode(s):(s-=65536,o+=String.fromCharCode(55296|s>>10,56320|s&1023))}}else o+=String.fromCharCode(s)}return o},me=[],Me=e=>{for(var t=0,r=0;r<e.length;++r){var o=e.charCodeAt(r);127>=o?t++:2047>=o?t+=2:55296<=o&&57343>=o?(t+=4,++r):t+=3}return t},fe=(e,t,r,o)=>{if(!(0<o))return 0;var s=r;o=r+o-1;for(var l=0;l<e.length;++l){var f=e.charCodeAt(l);if(55296<=f&&57343>=f){var h=e.charCodeAt(++l);f=65536+((f&1023)<<10)|h&1023}if(127>=f){if(r>=o)break;t[r++]=f}else{if(2047>=f){if(r+1>=o)break;t[r++]=192|f>>6}else{if(65535>=f){if(r+2>=o)break;t[r++]=224|f>>12}else{if(r+3>=o)break;t[r++]=240|f>>18,t[r++]=128|f>>12&63}t[r++]=128|f>>6&63}t[r++]=128|f&63}}return t[r]=0,r-s};function We(e,t){var r=Array(Me(e)+1);return e=fe(e,r,0,r.length),t&&(r.length=e),r}var Be=[];function Ze(e,t){Be[e]={input:[],F:[],T:t},bn(e,nt)}var nt={open(e){var t=Be[e.node.ta];if(!t)throw new W(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,r,o){if(!e.o||!e.o.T.$a)throw new W(60);for(var s=0,l=0;l<o;l++){try{var f=e.o.T.$a(e.o)}catch{throw new W(29)}if(f===void 0&&s===0)throw new W(6);if(f==null)break;s++,t[r+l]=f}return s&&(e.node.timestamp=Date.now()),s},write(e,t,r,o){if(!e.o||!e.o.T.Ga)throw new W(60);try{for(var s=0;s<o;s++)e.o.T.Ga(e.o,t[r+s])}catch{throw new W(29)}return o&&(e.node.timestamp=Date.now()),s}},Xe={$a(){e:{if(!me.length){var e=null;if(typeof window<"u"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`
|
|
18
|
-
`)),!e){e=null;break e}me=We(e,!0)}e=me.shift()}return e},Ga(e,t){t===null||t===10?(gt(B(e.F,0)),e.F=[]):t!=0&&e.F.push(t)},la(e){e.F&&0<e.F.length&&(gt(B(e.F,0)),e.F=[])},Pb(){return{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(){return 0},Rb(){return[24,80]}},Oe={Ga(e,t){t===null||t===10?(_e(B(e.F,0)),e.F=[]):t!=0&&e.F.push(t)},la(e){e.F&&0<e.F.length&&(_e(B(e.F,0)),e.F=[])}};function Ne(e,t){var r=e.j?e.j.length:0;r>=t||(t=Math.max(t,r*(1048576>r?2:1.125)>>>0),r!=0&&(t=Math.max(t,256)),r=e.j,e.j=new Uint8Array(t),0<e.u&&e.j.set(r.subarray(0,e.u),0))}var X={L:null,S(){return X.createNode(null,"/",16895,0)},createNode(e,t,r,o){if((r&61440)===24576||(r&61440)===4096)throw new W(63);return X.L||(X.L={dir:{node:{V:X.i.V,N:X.i.N,ga:X.i.ga,qa:X.i.qa,lb:X.i.lb,qb:X.i.qb,mb:X.i.mb,kb:X.i.kb,xa:X.i.xa},stream:{Z:X.l.Z}},file:{node:{V:X.i.V,N:X.i.N},stream:{Z:X.l.Z,read:X.l.read,write:X.l.write,Qa:X.l.Qa,cb:X.l.cb,fb:X.l.fb}},link:{node:{V:X.i.V,N:X.i.N,ia:X.i.ia},stream:{}},Ta:{node:{V:X.i.V,N:X.i.N},stream:xr}}),r=Hn(e,t,r,o),(r.mode&61440)===16384?(r.i=X.L.dir.node,r.l=X.L.dir.stream,r.j={}):(r.mode&61440)===32768?(r.i=X.L.file.node,r.l=X.L.file.stream,r.u=0,r.j=null):(r.mode&61440)===40960?(r.i=X.L.link.node,r.l=X.L.link.stream):(r.mode&61440)===8192&&(r.i=X.L.Ta.node,r.l=X.L.Ta.stream),r.timestamp=Date.now(),e&&(e.j[t]=r,e.timestamp=r.timestamp),r},Ac(e){return 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=(e.mode&61440)===8192?e.id:1,t.Cc=e.id,t.mode=e.mode,t.Gc=1,t.uid=0,t.Bc=0,t.ta=e.ta,(e.mode&61440)===16384?t.size=4096:(e.mode&61440)===32768?t.size=e.u:(e.mode&61440)===40960?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(t.mode!==void 0&&(e.mode=t.mode),t.timestamp!==void 0&&(e.timestamp=t.timestamp),t.size!==void 0&&(t=t.size,e.u!=t))if(t==0)e.j=null,e.u=0;else{var r=e.j;e.j=new Uint8Array(t),r&&e.j.set(r.subarray(0,Math.min(t,e.u))),e.u=t}},ga(){throw wn[44]},qa(e,t,r,o){return X.createNode(e,t,r,o)},lb(e,t,r){if((e.mode&61440)===16384){try{var o=qt(t,r)}catch{}if(o)for(var s in o.j)throw new W(55)}delete e.parent.j[e.name],e.parent.timestamp=Date.now(),e.name=r,t.j[r]=e,t.timestamp=e.parent.timestamp},qb(e,t){delete e.j[t],e.timestamp=Date.now()},mb(e,t){var r=qt(e,t),o;for(o in r.j)throw new W(55);delete e.j[t],e.timestamp=Date.now()},kb(e){var t=[".",".."],r;for(r of Object.keys(e.j))t.push(r);return t},xa(e,t,r){return e=X.createNode(e,t,41471,0),e.link=r,e},ia(e){if((e.mode&61440)!==40960)throw new W(28);return e.link}},l:{read(e,t,r,o,s){var l=e.node.j;if(s>=e.node.u)return 0;if(e=Math.min(e.node.u-s,o),8<e&&l.subarray)t.set(l.subarray(s,s+e),r);else for(o=0;o<e;o++)t[r+o]=l[s+o];return e},write(e,t,r,o,s,l){if(t.buffer===oe.buffer&&(l=!1),!o)return 0;if(e=e.node,e.timestamp=Date.now(),t.subarray&&(!e.j||e.j.subarray)){if(l)return e.j=t.subarray(r,r+o),e.u=o;if(e.u===0&&s===0)return e.j=t.slice(r,r+o),e.u=o;if(s+o<=e.u)return e.j.set(t.subarray(r,r+o),s),o}if(Ne(e,s+o),e.j.subarray&&t.subarray)e.j.set(t.subarray(r,r+o),s);else for(l=0;l<o;l++)e.j[s+l]=t[r+l];return e.u=Math.max(e.u,s+o),o},Z(e,t,r){if(r===1?t+=e.position:r===2&&(e.node.mode&61440)===32768&&(t+=e.node.u),0>t)throw new W(28);return t},Qa(e,t,r){Ne(e.node,t+r),e.node.u=Math.max(e.node.u,t+r)},cb(e,t,r,o,s){if((e.node.mode&61440)!==32768)throw new W(43);if(e=e.node.j,s&2||e.buffer!==oe.buffer){if((0<r||r+t<e.length)&&(e.subarray?e=e.subarray(r,r+t):e=Array.prototype.slice.call(e,r,r+t)),r=!0,ut(),t=void 0,!t)throw new W(48);oe.set(e,t)}else r=!1,t=e.byteOffset;return{m:t,pc:r}},fb(e,t,r,o){return X.l.write(e,t,0,o,r,!1),0}}},Qt=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},ce=null,Un={},Bt=[],Tr=1,Vt=null,Nn=!0,W=class{constructor(e){this.name="ErrnoError",this.Y=e}},wn={},Or=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}},Sr=class{constructor(e,t,r,o){e||=this,this.parent=e,this.S=e.S,this.ra=null,this.id=Tr++,this.name=t,this.mode=r,this.i={},this.l={},this.ta=o}get read(){return(this.mode&365)===365}set read(e){e?this.mode|=365:this.mode&=-366}get write(){return(this.mode&146)===146}set write(e){e?this.mode|=146:this.mode&=-147}};function Ft(e,t={}){if(e=V(e),!e)return{path:"",node:null};if(t=Object.assign({Za:!0,Ia:0},t),8<t.Ia)throw new W(32);e=e.split("/").filter(f=>!!f);for(var r=ce,o="/",s=0;s<e.length;s++){var l=s===e.length-1;if(l&&t.parent)break;if(r=qt(r,e[s]),o=u(o+"/"+e[s]),r.ra&&(!l||l&&t.Za)&&(r=r.ra.root),!l||t.Ya){for(l=0;(r.mode&61440)===40960;)if(r=Dr(o),o=V(d(o),r),r=Ft(o,{Ia:t.Ia+1}).node,40<l++)throw new W(32)}}return{path:o,node:r}}function $n(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 Yn(e,t){for(var r=0,o=0;o<t.length;o++)r=(r<<5)-r+t.charCodeAt(o)|0;return(e+r>>>0)%Vt.length}function qt(e,t){var r=(e.mode&61440)===16384?(r=en(e,"x"))?r:e.i.ga?0:2:54;if(r)throw new W(r);for(r=Vt[Yn(e.id,t)];r;r=r.Xb){var o=r.name;if(r.parent.id===e.id&&o===t)return r}return e.i.ga(e,t)}function Hn(e,t,r,o){return e=new Sr(e,t,r,o),t=Yn(e.parent.id,e.name),e.Xb=Vt[t],Vt[t]=e}function zn(e){var t=["r","w","rw"][e&3];return e&512&&(t+="w"),t}function en(e,t){if(Nn)return 0;if(!t.includes("r")||e.mode&292){if(t.includes("w")&&!(e.mode&146)||t.includes("x")&&!(e.mode&73))return 2}else return 2;return 0}function Xn(e,t){try{return qt(e,t),20}catch{}return en(e,"wx")}function bt(e){if(e=Bt[e],!e)throw new W(8);return e}function Gn(e,t=-1){if(e=Object.assign(new Or,e),t==-1)e:{for(t=0;4096>=t;t++)if(!Bt[t])break e;throw new W(33)}return e.U=t,Bt[t]=e}function jr(e,t=-1){return e=Gn(e,t),e.l?.zc?.(e),e}var xr={open(e){e.l=Un[e.node.ta].l,e.l.open?.(e)},Z(){throw new W(70)}};function bn(e,t){Un[e]={l:t}}function Kn(e,t){var r=t==="/";if(r&&ce)throw new W(10);if(!r&&t){var o=Ft(t,{Za:!1});if(t=o.path,o=o.node,o.ra)throw new W(10);if((o.mode&61440)!==16384)throw new W(54)}t={type:e,Ic:{},eb:t,Wb:[]},e=e.S(t),e.S=t,t.root=e,r?ce=e:o&&(o.ra=t,o.S&&o.S.Wb.push(t))}function _n(e,t,r){var o=Ft(e,{parent:!0}).node;if(e=p(e),!e||e==="."||e==="..")throw new W(28);var s=Xn(o,e);if(s)throw new W(s);if(!o.i.qa)throw new W(63);return o.i.qa(o,e,t,r)}function ft(e){return _n(e,16895,0)}function tn(e,t,r){typeof r>"u"&&(r=t,t=438),_n(e,t|8192,r)}function An(e,t){if(!V(e))throw new W(44);var r=Ft(t,{parent:!0}).node;if(!r)throw new W(44);t=p(t);var o=Xn(r,t);if(o)throw new W(o);if(!r.i.xa)throw new W(63);r.i.xa(r,t,e)}function Dr(e){if(e=Ft(e).node,!e)throw new W(44);if(!e.i.ia)throw new W(28);return V($n(e.parent),e.i.ia(e))}function nn(e,t,r){if(e==="")throw new W(44);if(typeof t=="string"){var o={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[t];if(typeof o>"u")throw Error(`Unknown file open mode: ${t}`);t=o}if(r=t&64?(typeof r>"u"?438:r)&4095|32768:0,typeof e=="object")var s=e;else{e=u(e);try{s=Ft(e,{Ya:!(t&131072)}).node}catch{}}if(o=!1,t&64)if(s){if(t&128)throw new W(20)}else s=_n(e,r,0),o=!0;if(!s)throw new W(44);if((s.mode&61440)===8192&&(t&=-513),t&65536&&(s.mode&61440)!==16384)throw new W(54);if(!o&&(r=s?(s.mode&61440)===40960?32:(s.mode&61440)===16384&&(zn(t)!=="r"||t&512)?31:en(s,zn(t)):44))throw new W(r);if(t&512&&!o){if(r=s,r=typeof r=="string"?Ft(r,{Ya:!0}).node:r,!r.i.N)throw new W(63);if((r.mode&61440)===16384)throw new W(31);if((r.mode&61440)!==32768)throw new W(28);if(o=en(r,"w"))throw new W(o);r.i.N(r,{size:0,timestamp:Date.now()})}return t&=-131713,s=Gn({node:s,path:$n(s),flags:t,seekable:!0,position:0,l:s.l,jc:[],error:!1}),s.l.open&&s.l.open(s),!c.logReadFiles||t&1||(Cn||={},e in Cn||(Cn[e]=1)),s}function Jn(e,t,r){if(e.U===null)throw new W(8);if(!e.seekable||!e.l.Z)throw new W(70);if(r!=0&&r!=1&&r!=2)throw new W(28);e.position=e.l.Z(e,t,r),e.jc=[]}var Zn;function Ut(e,t,r){e=u("/dev/"+e);var o=Qt(!!t,!!r);Qn||=64;var s=Qn++<<8|0;bn(s,{open(l){l.seekable=!1},close(){r?.buffer?.length&&r(10)},read(l,f,h,g){for(var m=0,A=0;A<g;A++){try{var R=t()}catch{throw new W(29)}if(R===void 0&&m===0)throw new W(6);if(R==null)break;m++,f[h+A]=R}return m&&(l.node.timestamp=Date.now()),m},write(l,f,h,g){for(var m=0;m<g;m++)try{r(f[h+m])}catch{throw new W(29)}return g&&(l.node.timestamp=Date.now()),m}}),tn(e,o,s)}var Qn,It={},Cn,Nt=void 0,Ot=(e,t)=>Object.defineProperty(t,"name",{value:e}),Mn=[],dt=[],H,Qe=e=>{if(!e)throw new H("Cannot use deleted val. handle = "+e);return dt[e]},rt=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const t=Mn.pop()||dt.length;return dt[t]=e,dt[t+1]=1,t}},qn=e=>{var t=Error,r=Ot(e,function(o){this.name=e,this.message=o,o=Error(o).stack,o!==void 0&&(this.stack=this.toString()+`
|
|
19
|
-
`+o.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r},er,tr,be=e=>{for(var t="";ne[e];)t+=tr[ne[e++]];return t},$t=[],Fn=()=>{for(;$t.length;){var e=$t.pop();e.g.ca=!1,e.delete()}},Yt,ht={},In=(e,t)=>{if(t===void 0)throw new H("ptr should not be undefined");for(;e.B;)t=e.ja(t),e=e.B;return t},Pt={},nr=e=>{e=gr(e);var t=be(e);return pt(e),t},Ht=(e,t)=>{var r=Pt[e];if(r===void 0)throw e=`${t} has unknown type ${nr(e)}`,new H(e);return r},rn=()=>{},Pn=!1,rr=(e,t,r)=>t===r?e:r.B===void 0?null:(e=rr(e,t,r.B),e===null?null:r.Db(e)),ir={},Wr=(e,t)=>(t=In(e,t),ht[t]),zt,on=(e,t)=>{if(!t.s||!t.m)throw new zt("makeClassHandle requires ptr and ptrType");if(!!t.H!=!!t.C)throw new zt("Both smartPtrType and smartPtr must be specified");return t.count={value:1},St(Object.create(e,{g:{value:t,writable:!0}}))},St=e=>typeof FinalizationRegistry>"u"?(St=t=>t,e):(Pn=new FinalizationRegistry(t=>{t=t.g,--t.count.value,t.count.value===0&&(t.C?t.H.M(t.C):t.s.h.M(t.m))}),St=t=>{var r=t.g;return r.C&&Pn.register(t,{g:r},t),t},rn=t=>{Pn.unregister(t)},St(e)),an={},Xt=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function Gt(e){return this.fromWireType(J[e>>2])}var jt={},sn={},$e=(e,t,r)=>{function o(h){if(h=r(h),h.length!==e.length)throw new zt("Mismatched type converter count");for(var g=0;g<e.length;++g)it(e[g],h[g])}e.forEach(function(h){sn[h]=t});var s=Array(t.length),l=[],f=0;t.forEach((h,g)=>{Pt.hasOwnProperty(h)?s[g]=Pt[h]:(l.push(h),jt.hasOwnProperty(h)||(jt[h]=[]),jt[h].push(()=>{s[g]=Pt[h],++f,f===l.length&&o(s)}))}),l.length===0&&o(s)};function Br(e,t,r={}){var o=t.name;if(!e)throw new H(`type "${o}" must have a positive integer typeid pointer`);if(Pt.hasOwnProperty(e)){if(r.Nb)return;throw new H(`Cannot register type '${o}' twice`)}Pt[e]=t,delete sn[e],jt.hasOwnProperty(e)&&(t=jt[e],delete jt[e],t.forEach(s=>s()))}function it(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Br(e,t,r)}var Rn=e=>{throw new H(e.g.s.h.name+" instance already deleted")};function un(){}var En=(e,t,r)=>{if(e[t].v===void 0){var o=e[t];e[t]=function(...s){if(!e[t].v.hasOwnProperty(s.length))throw new H(`Function '${r}' called with an invalid number of arguments (${s.length}) - expects one of (${e[t].v})!`);return e[t].v[s.length].apply(this,s)},e[t].v=[],e[t].v[o.ba]=o}},kn=(e,t,r)=>{if(c.hasOwnProperty(e)){if(r===void 0||c[e].v!==void 0&&c[e].v[r]!==void 0)throw new H(`Cannot register public name '${e}' twice`);if(En(c,e,e),c.hasOwnProperty(r))throw new H(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`);c[e].v[r]=t}else c[e]=t,r!==void 0&&(c[e].Hc=r)},Vr=e=>{if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e};function Ur(e,t,r,o,s,l,f,h){this.name=e,this.constructor=t,this.K=r,this.M=o,this.B=s,this.Ib=l,this.ja=f,this.Db=h,this.ib=[]}var ln=(e,t,r)=>{for(;t!==r;){if(!t.ja)throw new H(`Expected null or instance of ${r.name}, got an instance of ${t.name}`);e=t.ja(e),t=t.B}return e};function Nr(e,t){if(t===null){if(this.Fa)throw new H(`null is not a valid ${this.name}`);return 0}if(!t.g)throw new H(`Cannot pass "${Sn(t)}" as a ${this.name}`);if(!t.g.m)throw new H(`Cannot pass deleted object as a pointer of type ${this.name}`);return ln(t.g.m,t.g.s.h,this.h)}function $r(e,t){if(t===null){if(this.Fa)throw new H(`null is not a valid ${this.name}`);if(this.pa){var r=this.Ha();return e!==null&&e.push(this.M,r),r}return 0}if(!t||!t.g)throw new H(`Cannot pass "${Sn(t)}" as a ${this.name}`);if(!t.g.m)throw new H(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.oa&&t.g.s.oa)throw new H(`Cannot convert argument of type ${t.g.H?t.g.H.name:t.g.s.name} to parameter type ${this.name}`);if(r=ln(t.g.m,t.g.s.h,this.h),this.pa){if(t.g.C===void 0)throw new H("Passing raw pointer to smart pointer is illegal");switch(this.dc){case 0:if(t.g.H===this)r=t.g.C;else throw new H(`Cannot convert argument of type ${t.g.H?t.g.H.name:t.g.s.name} to parameter type ${this.name}`);break;case 1:r=t.g.C;break;case 2:if(t.g.H===this)r=t.g.C;else{var o=t.clone();r=this.$b(r,rt(()=>o.delete())),e!==null&&e.push(this.M,r)}break;default:throw new H("Unsupporting sharing policy")}}return r}function Yr(e,t){if(t===null){if(this.Fa)throw new H(`null is not a valid ${this.name}`);return 0}if(!t.g)throw new H(`Cannot pass "${Sn(t)}" as a ${this.name}`);if(!t.g.m)throw new H(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.g.s.oa)throw new H(`Cannot convert argument of type ${t.g.s.name} to parameter type ${this.name}`);return ln(t.g.m,t.g.s.h,this.h)}function cn(e,t,r,o,s,l,f,h,g,m,A){this.name=e,this.h=t,this.Fa=r,this.oa=o,this.pa=s,this.Zb=l,this.dc=f,this.jb=h,this.Ha=g,this.$b=m,this.M=A,s||t.B!==void 0?this.toWireType=$r:(this.toWireType=o?Nr:Yr,this.J=null)}var or=(e,t,r)=>{if(!c.hasOwnProperty(e))throw new zt("Replacing nonexistent public symbol");c[e].v!==void 0&&r!==void 0?c[e].v[r]=t:(c[e]=t,c[e].ba=r)},fn=[],ar,Ln=e=>{var t=fn[e];return t||(e>=fn.length&&(fn.length=e+1),fn[e]=t=ar.get(e)),t},Hr=(e,t,r=[])=>(e.includes("j")?(e=e.replace(/p/g,"i"),t=(0,c["dynCall_"+e])(t,...r)):t=Ln(t)(...r),t),zr=(e,t)=>(...r)=>Hr(e,t,r),ke=(e,t)=>{e=be(e);var r=e.includes("j")?zr(e,t):Ln(t);if(typeof r!="function")throw new H(`unknown function pointer with signature ${e}: ${t}`);return r},sr,vt=(e,t)=>{function r(l){s[l]||Pt[l]||(sn[l]?sn[l].forEach(r):(o.push(l),s[l]=!0))}var o=[],s={};throw t.forEach(r),new sr(`${e}: `+o.map(nr).join([", "]))};function Xr(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].J===void 0)return!0;return!1}function dn(e,t,r,o,s){var l=t.length;if(2>l)throw new H("argTypes array size mismatch! Must at least get return value and 'this' types!");var f=t[1]!==null&&r!==null,h=Xr(t),g=t[0].name!=="void",m=l-2,A=Array(m),R=[],j=[];return Ot(e,function(...v){if(v.length!==m)throw new H(`function ${e} called with ${v.length} arguments, expected ${m}`);if(j.length=0,R.length=f?2:1,R[0]=s,f){var C=t[1].toWireType(j,this);R[1]=C}for(var _=0;_<m;++_)A[_]=t[_+2].toWireType(j,v[_]),R.push(A[_]);if(v=o(...R),h)Xt(j);else for(_=f?1:2;_<t.length;_++){var G=_===1?C:A[_-2];t[_].J!==null&&t[_].J(G)}return C=g?t[0].fromWireType(v):void 0,C})}var hn=(e,t)=>{for(var r=[],o=0;o<e;o++)r.push(J[t+4*o>>2]);return r},Tn=e=>{e=e.trim();const t=e.indexOf("(");return t!==-1?e.substr(0,t):e},ur=(e,t,r)=>{if(!(e instanceof Object))throw new H(`${r} with invalid "this": ${e}`);if(!(e instanceof t.h.constructor))throw new H(`${r} incompatible with "this" of type ${e.constructor.name}`);if(!e.g.m)throw new H(`cannot call emscripten binding method ${r} on deleted object`);return ln(e.g.m,e.g.s.h,t.h)},On=e=>{9<e&&--dt[e+1]===0&&(dt[e]=void 0,Mn.push(e))},Gr={name:"emscripten::val",fromWireType:e=>{var t=Qe(e);return On(e),t},toWireType:(e,t)=>rt(t),argPackAdvance:8,readValueFromPointer:Gt,J:null},Kr=(e,t,r)=>{switch(t){case 1:return r?function(o){return this.fromWireType(oe[o])}:function(o){return this.fromWireType(ne[o])};case 2:return r?function(o){return this.fromWireType(Re[o>>1])}:function(o){return this.fromWireType(Ue[o>>1])};case 4:return r?function(o){return this.fromWireType(U[o>>2])}:function(o){return this.fromWireType(J[o>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Sn=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e},Jr=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(Ge[r>>2])};case 8:return function(r){return this.fromWireType(tt[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Zr=(e,t,r)=>{switch(t){case 1:return r?o=>oe[o]:o=>ne[o];case 2:return r?o=>Re[o>>1]:o=>Ue[o>>1];case 4:return r?o=>U[o>>2]:o=>J[o>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},lr=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Qr=(e,t)=>{for(var r=e>>1,o=r+t/2;!(r>=o)&&Ue[r];)++r;if(r<<=1,32<r-e&&lr)return lr.decode(ne.subarray(e,r));for(r="",o=0;!(o>=t/2);++o){var s=Re[e+2*o>>1];if(s==0)break;r+=String.fromCharCode(s)}return r},qr=(e,t,r)=>{if(r??=2147483647,2>r)return 0;r-=2;var o=t;r=r<2*e.length?r/2:e.length;for(var s=0;s<r;++s)Re[t>>1]=e.charCodeAt(s),t+=2;return Re[t>>1]=0,t-o},ei=e=>2*e.length,ti=(e,t)=>{for(var r=0,o="";!(r>=t/4);){var s=U[e+4*r>>2];if(s==0)break;++r,65536<=s?(s-=65536,o+=String.fromCharCode(55296|s>>10,56320|s&1023)):o+=String.fromCharCode(s)}return o},ni=(e,t,r)=>{if(r??=2147483647,4>r)return 0;var o=t;r=o+r-4;for(var s=0;s<e.length;++s){var l=e.charCodeAt(s);if(55296<=l&&57343>=l){var f=e.charCodeAt(++s);l=65536+((l&1023)<<10)|f&1023}if(U[t>>2]=l,t+=4,t+4>r)break}return U[t>>2]=0,t-o},ri=e=>{for(var t=0,r=0;r<e.length;++r){var o=e.charCodeAt(r);55296<=o&&57343>=o&&++r,t+=4}return t},cr=(e,t,r)=>{var o=[];return e=e.toWireType(o,r),o.length&&(J[t>>2]=rt(o)),e},vn=[],ii={},jn=e=>{var t=ii[e];return t===void 0?be(e):t},oi=e=>{var t=vn.length;return vn.push(e),t},ai=(e,t)=>{for(var r=Array(e),o=0;o<e;++o)r[o]=Ht(J[t+4*o>>2],"parameter "+o);return r},si=Reflect.construct,Kt=e=>e%4===0&&(e%100!==0||e%400===0),ui=[0,31,60,91,121,152,182,213,244,274,305,335],li=[0,31,59,90,120,151,181,212,243,273,304,334],xn=[],Dn={},fr=()=>{if(!Wn){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:Z||"./this.program"},t;for(t in Dn)Dn[t]===void 0?delete e[t]:e[t]=Dn[t];var r=[];for(t in e)r.push(`${t}=${e[t]}`);Wn=r}return Wn},Wn,dr=[31,29,31,30,31,30,31,31,30,31,30,31],hr=[31,28,31,30,31,30,31,31,30,31,30,31],vr=(e,t,r,o)=>{function s(v,C,_){for(v=typeof v=="number"?v.toString():v||"";v.length<C;)v=_[0]+v;return v}function l(v,C){return s(v,C,"0")}function f(v,C){function _(ee){return 0>ee?-1:0<ee?1:0}var G;return(G=_(v.getFullYear()-C.getFullYear()))===0&&(G=_(v.getMonth()-C.getMonth()))===0&&(G=_(v.getDate()-C.getDate())),G}function h(v){switch(v.getDay()){case 0:return new Date(v.getFullYear()-1,11,29);case 1:return v;case 2:return new Date(v.getFullYear(),0,3);case 3:return new Date(v.getFullYear(),0,2);case 4:return new Date(v.getFullYear(),0,1);case 5:return new Date(v.getFullYear()-1,11,31);case 6:return new Date(v.getFullYear()-1,11,30)}}function g(v){var C=v.$;for(v=new Date(new Date(v.aa+1900,0,1).getTime());0<C;){var _=v.getMonth(),G=(Kt(v.getFullYear())?dr:hr)[_];if(C>G-v.getDate())C-=G-v.getDate()+1,v.setDate(1),11>_?v.setMonth(_+1):(v.setMonth(0),v.setFullYear(v.getFullYear()+1));else{v.setDate(v.getDate()+C);break}}return _=new Date(v.getFullYear()+1,0,4),C=h(new Date(v.getFullYear(),0,4)),_=h(_),0>=f(C,v)?0>=f(_,v)?v.getFullYear()+1:v.getFullYear():v.getFullYear()-1}var m=J[o+40>>2];o={hc:U[o>>2],fc:U[o+4>>2],ya:U[o+8>>2],Ka:U[o+12>>2],za:U[o+16>>2],aa:U[o+20>>2],O:U[o+24>>2],$:U[o+28>>2],Kc:U[o+32>>2],ec:U[o+36>>2],ic:m&&m?B(ne,m):""},r=r?B(ne,r):"",m={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var A in m)r=r.replace(new RegExp(A,"g"),m[A]);var R="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),j="January February March April May June July August September October November December".split(" ");m={"%a":v=>R[v.O].substring(0,3),"%A":v=>R[v.O],"%b":v=>j[v.za].substring(0,3),"%B":v=>j[v.za],"%C":v=>l((v.aa+1900)/100|0,2),"%d":v=>l(v.Ka,2),"%e":v=>s(v.Ka,2," "),"%g":v=>g(v).toString().substring(2),"%G":g,"%H":v=>l(v.ya,2),"%I":v=>(v=v.ya,v==0?v=12:12<v&&(v-=12),l(v,2)),"%j":v=>{for(var C=0,_=0;_<=v.za-1;C+=(Kt(v.aa+1900)?dr:hr)[_++]);return l(v.Ka+C,3)},"%m":v=>l(v.za+1,2),"%M":v=>l(v.fc,2),"%n":()=>`
|
|
20
|
-
`,"%p":v=>0<=v.ya&&12>v.ya?"AM":"PM","%S":v=>l(v.hc,2),"%t":()=>" ","%u":v=>v.O||7,"%U":v=>l(Math.floor((v.$+7-v.O)/7),2),"%V":v=>{var C=Math.floor((v.$+7-(v.O+6)%7)/7);if(2>=(v.O+371-v.$-2)%7&&C++,C)C==53&&(_=(v.O+371-v.$)%7,_==4||_==3&&Kt(v.aa)||(C=1));else{C=52;var _=(v.O+7-v.$-1)%7;(_==4||_==5&&Kt(v.aa%400-1))&&C++}return l(C,2)},"%w":v=>v.O,"%W":v=>l(Math.floor((v.$+7-(v.O+6)%7)/7),2),"%y":v=>(v.aa+1900).toString().substring(2),"%Y":v=>v.aa+1900,"%z":v=>{v=v.ec;var C=0<=v;return v=Math.abs(v)/60,(C?"+":"-")+("0000"+(v/60*100+v%60)).slice(-4)},"%Z":v=>v.ic,"%%":()=>"%"},r=r.replace(/%%/g,"\0\0");for(A in m)r.includes(A)&&(r=r.replace(new RegExp(A,"g"),m[A](o)));return r=r.replace(/\0\0/g,"%"),A=We(r,!1),A.length>t?0:(oe.set(A,e),A.length-1)};[44].forEach(e=>{wn[e]=new W(e),wn[e].stack="<generic error, no stack>"}),Vt=Array(4096),Kn(X,"/"),ft("/tmp"),ft("/home"),ft("/home/web_user"),(function(){ft("/dev"),bn(259,{read:()=>0,write:(o,s,l,f)=>f}),tn("/dev/null",259),Ze(1280,Xe),Ze(1536,Oe),tn("/dev/tty",1280),tn("/dev/tty1",1536);var e=new Uint8Array(1024),t=0,r=()=>(t===0&&(t=S(e).byteLength),e[--t]);Ut("random",r),Ut("urandom",r),ft("/dev/shm"),ft("/dev/shm/tmp")})(),(function(){ft("/proc");var e=ft("/proc/self");ft("/proc/self/fd"),Kn({S(){var t=Hn(e,"fd",16895,73);return t.i={ga(r,o){var s=bt(+o);return r={parent:null,S:{eb:"fake"},i:{ia:()=>s.path}},r.parent=r}},t}},"/proc/self/fd")})(),H=c.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},dt.push(0,1,void 0,1,null,1,!0,1,!1,1),c.count_emval_handles=()=>dt.length/2-5-Mn.length,er=c.PureVirtualError=qn("PureVirtualError");for(var pr=Array(256),pn=0;256>pn;++pn)pr[pn]=String.fromCharCode(pn);tr=pr,c.getInheritedInstanceCount=()=>Object.keys(ht).length,c.getLiveInheritedInstances=()=>{var e=[],t;for(t in ht)ht.hasOwnProperty(t)&&e.push(ht[t]);return e},c.flushPendingDeletes=Fn,c.setDelayFunction=e=>{Yt=e,$t.length&&Yt&&Yt(Fn)},zt=c.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(un.prototype,{isAliasOf:function(e){if(!(this instanceof un&&e instanceof un))return!1;var t=this.g.s.h,r=this.g.m;e.g=e.g;var o=e.g.s.h;for(e=e.g.m;t.B;)r=t.ja(r),t=t.B;for(;o.B;)e=o.ja(e),o=o.B;return t===o&&r===e},clone:function(){if(this.g.m||Rn(this),this.g.ea)return this.g.count.value+=1,this;var e=St,t=Object,r=t.create,o=Object.getPrototypeOf(this),s=this.g;return e=e(r.call(t,o,{g:{value:{count:s.count,ca:s.ca,ea:s.ea,m:s.m,s:s.s,C:s.C,H:s.H}}})),e.g.count.value+=1,e.g.ca=!1,e},delete(){if(this.g.m||Rn(this),this.g.ca&&!this.g.ea)throw new H("Object already scheduled for deletion");rn(this);var e=this.g;--e.count.value,e.count.value===0&&(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||Rn(this),this.g.ca&&!this.g.ea)throw new H("Object already scheduled for deletion");return $t.push(this),$t.length===1&&Yt&&Yt(Fn),this.g.ca=!0,this}}),Object.assign(cn.prototype,{Jb(e){return this.jb&&(e=this.jb(e)),e},Ua(e){this.M?.(e)},argPackAdvance:8,readValueFromPointer:Gt,fromWireType:function(e){function t(){return this.pa?on(this.h.K,{s:this.Zb,m:r,H:this,C:e}):on(this.h.K,{s:this,m:e})}var r=this.Jb(e);if(!r)return this.Ua(e),null;var o=Wr(this.h,r);if(o!==void 0)return o.g.count.value===0?(o.g.m=r,o.g.C=e,o.clone()):(o=o.clone(),this.Ua(e),o);if(o=this.h.Ib(r),o=ir[o],!o)return t.call(this);o=this.oa?o.zb:o.pointerType;var s=rr(r,this.h,o.h);return s===null?t.call(this):this.pa?on(o.h.K,{s:o,m:s,H:this,C:e}):on(o.h.K,{s:o,m:s})}}),sr=c.UnboundTypeError=qn("UnboundTypeError");var mr={__syscall_fcntl64:function(e,t,r){Nt=r;try{var o=bt(e);switch(t){case 0:var s=n();if(0>s)break;for(;Bt[s];)s++;return jr(o,s).U;case 1:case 2:return 0;case 3:return o.flags;case 4:return s=n(),o.flags|=s,0;case 12:return s=n(),Re[s+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(l){if(typeof It>"u"||l.name!=="ErrnoError")throw l;return-l.Y}},__syscall_ioctl:function(e,t,r){Nt=r;try{var o=bt(e);switch(t){case 21509:return o.o?0:-59;case 21505:if(!o.o)return-59;if(o.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 s=n();U[s>>2]=25856,U[s+4>>2]=5,U[s+8>>2]=191,U[s+12>>2]=35387;for(var l=0;32>l;l++)oe[s+l+17]=e[l]||0}return 0;case 21510:case 21511:case 21512:return o.o?0:-59;case 21506:case 21507:case 21508:if(!o.o)return-59;if(o.o.T.Qb)for(s=n(),e=[],l=0;32>l;l++)e.push(oe[s+l+17]);return 0;case 21519:return o.o?(s=n(),U[s>>2]=0):-59;case 21520:return o.o?-28:-59;case 21531:if(s=n(),!o.l.Ob)throw new W(59);return o.l.Ob(o,t,s);case 21523:return o.o?(o.o.T.Rb&&(l=[24,80],s=n(),Re[s>>1]=l[0],Re[s+2>>1]=l[1]),0):-59;case 21524:return o.o?0:-59;case 21515:return o.o?0:-59;default:return-28}}catch(f){if(typeof It>"u"||f.name!=="ErrnoError")throw f;return-f.Y}},__syscall_openat:function(e,t,r,o){Nt=o;try{t=t?B(ne,t):"";var s=t;if(s.charAt(0)==="/")t=s;else{var l=e===-100?"/":bt(e).path;if(s.length==0)throw new W(44);t=u(l+"/"+s)}var f=o?n():0;return nn(t,r,f).U}catch(h){if(typeof It>"u"||h.name!=="ErrnoError")throw h;return-h.Y}},_abort_js:()=>{ut("")},_embind_create_inheriting_constructor:(e,t,r)=>{e=be(e),t=Ht(t,"wrapper"),r=Qe(r);var o=t.h,s=o.K,l=o.B.K,f=o.B.constructor;return e=Ot(e,function(...h){o.B.ib.forEach(function(g){if(this[g]===l[g])throw new er(`Pure virtual function ${g} must be implemented in JavaScript`)}.bind(this)),Object.defineProperty(this,"__parent",{value:s}),this.__construct(...h)}),s.__construct=function(...h){if(this===s)throw new H("Pass correct 'this' to __construct");h=f.implement(this,...h),rn(h);var g=h.g;if(h.notifyOnDestruction(),g.ea=!0,Object.defineProperties(this,{g:{value:g}}),St(this),h=g.m,h=In(o,h),ht.hasOwnProperty(h))throw new H(`Tried to register registered instance: ${h}`);ht[h]=this},s.__destruct=function(){if(this===s)throw new H("Pass correct 'this' to __destruct");rn(this);var h=this.g.m;if(h=In(o,h),ht.hasOwnProperty(h))delete ht[h];else throw new H(`Tried to unregister unregistered instance: ${h}`)},e.prototype=Object.create(s),Object.assign(e.prototype,r),rt(e)},_embind_finalize_value_object:e=>{var t=an[e];delete an[e];var r=t.Ha,o=t.M,s=t.Xa,l=s.map(f=>f.Mb).concat(s.map(f=>f.bc));$e([e],l,f=>{var h={};return s.forEach((g,m)=>{var A=f[m],R=g.Kb,j=g.Lb,v=f[m+s.length],C=g.ac,_=g.cc;h[g.Gb]={read:G=>A.fromWireType(R(j,G)),write:(G,ee)=>{var P=[];C(_,G,v.toWireType(P,ee)),Xt(P)}}}),[{name:t.name,fromWireType:g=>{var m={},A;for(A in h)m[A]=h[A].read(g);return o(g),m},toWireType:(g,m)=>{for(var A in h)if(!(A in m))throw new TypeError(`Missing field: "${A}"`);var R=r();for(A in h)h[A].write(R,m[A]);return g!==null&&g.push(o,R),R},argPackAdvance:8,readValueFromPointer:Gt,J:o}]})},_embind_register_bigint:()=>{},_embind_register_bool:(e,t,r,o)=>{t=be(t),it(e,{name:t,fromWireType:function(s){return!!s},toWireType:function(s,l){return l?r:o},argPackAdvance:8,readValueFromPointer:function(s){return this.fromWireType(ne[s])},J:null})},_embind_register_class:(e,t,r,o,s,l,f,h,g,m,A,R,j)=>{A=be(A),l=ke(s,l),h&&=ke(f,h),m&&=ke(g,m),j=ke(R,j);var v=Vr(A);kn(v,function(){vt(`Cannot construct ${A} due to unbound types`,[o])}),$e([e,t,r],o?[o]:[],C=>{if(C=C[0],o)var _=C.h,G=_.K;else G=un.prototype;C=Ot(A,function(...Ce){if(Object.getPrototypeOf(this)!==ee)throw new H("Use 'new' to construct "+A);if(P.X===void 0)throw new H(A+" has no accessible constructor");var Ye=P.X[Ce.length];if(Ye===void 0)throw new H(`Tried to invoke ctor of ${A} with invalid number of parameters (${Ce.length}) - expected (${Object.keys(P.X).toString()}) parameters instead!`);return Ye.apply(this,Ce)});var ee=Object.create(G,{constructor:{value:C}});C.prototype=ee;var P=new Ur(A,C,ee,j,_,l,h,m);if(P.B){var de;(de=P.B).ka??(de.ka=[]),P.B.ka.push(P)}return _=new cn(A,P,!0,!1,!1),de=new cn(A+"*",P,!1,!1,!1),G=new cn(A+" const*",P,!1,!0,!1),ir[e]={pointerType:de,zb:G},or(v,C),[_,de,G]})},_embind_register_class_class_function:(e,t,r,o,s,l,f)=>{var h=hn(r,o);t=be(t),t=Tn(t),l=ke(s,l),$e([],[e],g=>{function m(){vt(`Cannot call ${A} due to unbound types`,h)}g=g[0];var A=`${g.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var R=g.h.constructor;return R[t]===void 0?(m.ba=r-1,R[t]=m):(En(R,t,A),R[t].v[r-1]=m),$e([],h,j=>{if(j=dn(A,[j[0],null].concat(j.slice(1)),null,l,f),R[t].v===void 0?(j.ba=r-1,R[t]=j):R[t].v[r-1]=j,g.h.ka)for(const v of g.h.ka)v.constructor.hasOwnProperty(t)||(v.constructor[t]=j);return[]}),[]})},_embind_register_class_class_property:(e,t,r,o,s,l,f,h)=>{t=be(t),l=ke(s,l),$e([],[e],g=>{g=g[0];var m=`${g.name}.${t}`,A={get(){vt(`Cannot access ${m} due to unbound types`,[r])},enumerable:!0,configurable:!0};return A.set=h?()=>{vt(`Cannot access ${m} due to unbound types`,[r])}:()=>{throw new H(`${m} is a read-only property`)},Object.defineProperty(g.h.constructor,t,A),$e([],[r],R=>{R=R[0];var j={get(){return R.fromWireType(l(o))},enumerable:!0};return h&&(h=ke(f,h),j.set=v=>{var C=[];h(o,R.toWireType(C,v)),Xt(C)}),Object.defineProperty(g.h.constructor,t,j),[]}),[]})},_embind_register_class_constructor:(e,t,r,o,s,l)=>{var f=hn(t,r);s=ke(o,s),$e([],[e],h=>{h=h[0];var g=`constructor ${h.name}`;if(h.h.X===void 0&&(h.h.X=[]),h.h.X[t-1]!==void 0)throw new H(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${h.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return h.h.X[t-1]=()=>{vt(`Cannot construct ${h.name} due to unbound types`,f)},$e([],f,m=>(m.splice(1,0,null),h.h.X[t-1]=dn(g,m,null,s,l),[])),[]})},_embind_register_class_function:(e,t,r,o,s,l,f,h)=>{var g=hn(r,o);t=be(t),t=Tn(t),l=ke(s,l),$e([],[e],m=>{function A(){vt(`Cannot call ${R} due to unbound types`,g)}m=m[0];var R=`${m.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),h&&m.h.ib.push(t);var j=m.h.K,v=j[t];return v===void 0||v.v===void 0&&v.className!==m.name&&v.ba===r-2?(A.ba=r-2,A.className=m.name,j[t]=A):(En(j,t,R),j[t].v[r-2]=A),$e([],g,C=>(C=dn(R,C,m,l,f),j[t].v===void 0?(C.ba=r-2,j[t]=C):j[t].v[r-2]=C,[])),[]})},_embind_register_class_property:(e,t,r,o,s,l,f,h,g,m)=>{t=be(t),s=ke(o,s),$e([],[e],A=>{A=A[0];var R=`${A.name}.${t}`,j={get(){vt(`Cannot access ${R} due to unbound types`,[r,f])},enumerable:!0,configurable:!0};return j.set=g?()=>vt(`Cannot access ${R} due to unbound types`,[r,f]):()=>{throw new H(R+" is a read-only property")},Object.defineProperty(A.h.K,t,j),$e([],g?[r,f]:[r],v=>{var C=v[0],_={get(){var ee=ur(this,A,R+" getter");return C.fromWireType(s(l,ee))},enumerable:!0};if(g){g=ke(h,g);var G=v[1];_.set=function(ee){var P=ur(this,A,R+" setter"),de=[];g(m,P,G.toWireType(de,ee)),Xt(de)}}return Object.defineProperty(A.h.K,t,_),[]}),[]})},_embind_register_emval:e=>it(e,Gr),_embind_register_enum:(e,t,r,o)=>{function s(){}t=be(t),s.values={},it(e,{name:t,constructor:s,fromWireType:function(l){return this.constructor.values[l]},toWireType:(l,f)=>f.value,argPackAdvance:8,readValueFromPointer:Kr(t,r,o),J:null}),kn(t,s)},_embind_register_enum_value:(e,t,r)=>{var o=Ht(e,"enum");t=be(t),e=o.constructor,o=Object.create(o.constructor.prototype,{value:{value:r},constructor:{value:Ot(`${o.name}_${t}`,function(){})}}),e.values[r]=o,e[t]=o},_embind_register_float:(e,t,r)=>{t=be(t),it(e,{name:t,fromWireType:o=>o,toWireType:(o,s)=>s,argPackAdvance:8,readValueFromPointer:Jr(t,r),J:null})},_embind_register_function:(e,t,r,o,s,l)=>{var f=hn(t,r);e=be(e),e=Tn(e),s=ke(o,s),kn(e,function(){vt(`Cannot call ${e} due to unbound types`,f)},t-1),$e([],f,h=>(or(e,dn(e,[h[0],null].concat(h.slice(1)),null,s,l),t-1),[]))},_embind_register_integer:(e,t,r,o,s)=>{if(t=be(t),s===-1&&(s=4294967295),s=h=>h,o===0){var l=32-8*r;s=h=>h<<l>>>l}var f=t.includes("unsigned")?function(h,g){return g>>>0}:function(h,g){return g};it(e,{name:t,fromWireType:s,toWireType:f,argPackAdvance:8,readValueFromPointer:Zr(t,r,o!==0),J:null})},_embind_register_memory_view:(e,t,r)=>{function o(l){return new s(oe.buffer,J[l+4>>2],J[l>>2])}var s=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];r=be(r),it(e,{name:r,fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{Nb:!0})},_embind_register_std_string:(e,t)=>{t=be(t);var r=t==="std::string";it(e,{name:t,fromWireType:function(o){var s=J[o>>2],l=o+4;if(r)for(var f=l,h=0;h<=s;++h){var g=l+h;if(h==s||ne[g]==0){if(f=f?B(ne,f,g-f):"",m===void 0)var m=f;else m+="\0",m+=f;f=g+1}}else{for(m=Array(s),h=0;h<s;++h)m[h]=String.fromCharCode(ne[l+h]);m=m.join("")}return pt(o),m},toWireType:function(o,s){s instanceof ArrayBuffer&&(s=new Uint8Array(s));var l=typeof s=="string";if(!(l||s instanceof Uint8Array||s instanceof Uint8ClampedArray||s instanceof Int8Array))throw new H("Cannot pass non-string to std::string");var f=r&&l?Me(s):s.length,h=Bn(4+f+1),g=h+4;if(J[h>>2]=f,r&&l)fe(s,ne,g,f+1);else if(l)for(l=0;l<f;++l){var m=s.charCodeAt(l);if(255<m)throw pt(g),new H("String has UTF-16 code units that do not fit in 8 bits");ne[g+l]=m}else for(l=0;l<f;++l)ne[g+l]=s[l];return o!==null&&o.push(pt,h),h},argPackAdvance:8,readValueFromPointer:Gt,J(o){pt(o)}})},_embind_register_std_wstring:(e,t,r)=>{if(r=be(r),t===2)var o=Qr,s=qr,l=ei,f=h=>Ue[h>>1];else t===4&&(o=ti,s=ni,l=ri,f=h=>J[h>>2]);it(e,{name:r,fromWireType:h=>{for(var g=J[h>>2],m,A=h+4,R=0;R<=g;++R){var j=h+4+R*t;(R==g||f(j)==0)&&(A=o(A,j-A),m===void 0?m=A:(m+="\0",m+=A),A=j+t)}return pt(h),m},toWireType:(h,g)=>{if(typeof g!="string")throw new H(`Cannot pass non-string to C++ string type ${r}`);var m=l(g),A=Bn(4+m+t);return J[A>>2]=m/t,s(g,A+4,m+t),h!==null&&h.push(pt,A),A},argPackAdvance:8,readValueFromPointer:Gt,J(h){pt(h)}})},_embind_register_value_object:(e,t,r,o,s,l)=>{an[e]={name:be(t),Ha:ke(r,o),M:ke(s,l),Xa:[]}},_embind_register_value_object_field:(e,t,r,o,s,l,f,h,g,m)=>{an[e].Xa.push({Gb:be(t),Mb:r,Kb:ke(o,s),Lb:l,bc:f,ac:ke(h,g),cc:m})},_embind_register_void:(e,t)=>{t=be(t),it(e,{Dc:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}})},_emscripten_get_now_is_monotonic:()=>1,_emscripten_memcpy_js:(e,t,r)=>ne.copyWithin(e,t,t+r),_emscripten_throw_longjmp:()=>{throw 1/0},_emval_as:(e,t,r)=>(e=Qe(e),t=Ht(t,"emval::as"),cr(t,r,e)),_emval_call:(e,t,r,o)=>(e=vn[e],t=Qe(t),e(null,t,r,o)),_emval_call_method:(e,t,r,o,s)=>(e=vn[e],t=Qe(t),r=jn(r),e(t,t[r],o,s)),_emval_decref:On,_emval_get_method_caller:(e,t,r)=>{var o=ai(e,t),s=o.shift();e--;var l=Array(e);return t=`methodCaller<(${o.map(f=>f.name).join(", ")}) => ${s.name}>`,oi(Ot(t,(f,h,g,m)=>{for(var A=0,R=0;R<e;++R)l[R]=o[R].readValueFromPointer(m+A),A+=o[R].argPackAdvance;return f=r===1?si(h,l):h.apply(f,l),cr(s,g,f)}))},_emval_get_module_property:e=>(e=jn(e),rt(c[e])),_emval_get_property:(e,t)=>(e=Qe(e),t=Qe(t),rt(e[t])),_emval_incref:e=>{9<e&&(dt[e+1]+=1)},_emval_new_array:()=>rt([]),_emval_new_cstring:e=>rt(jn(e)),_emval_new_object:()=>rt({}),_emval_run_destructors:e=>{var t=Qe(e);Xt(t),On(e)},_emval_set_property:(e,t,r)=>{e=Qe(e),t=Qe(t),r=Qe(r),e[t]=r},_emval_take_value:(e,t)=>(e=Ht(e,"_emval_take_value"),e=e.readValueFromPointer(t),rt(e)),_gmtime_js:function(e,t,r){e=new Date(1e3*(t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN)),U[r>>2]=e.getUTCSeconds(),U[r+4>>2]=e.getUTCMinutes(),U[r+8>>2]=e.getUTCHours(),U[r+12>>2]=e.getUTCDate(),U[r+16>>2]=e.getUTCMonth(),U[r+20>>2]=e.getUTCFullYear()-1900,U[r+24>>2]=e.getUTCDay(),U[r+28>>2]=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},_localtime_js:function(e,t,r){e=new Date(1e3*(t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN)),U[r>>2]=e.getSeconds(),U[r+4>>2]=e.getMinutes(),U[r+8>>2]=e.getHours(),U[r+12>>2]=e.getDate(),U[r+16>>2]=e.getMonth(),U[r+20>>2]=e.getFullYear()-1900,U[r+24>>2]=e.getDay(),U[r+28>>2]=(Kt(e.getFullYear())?ui:li)[e.getMonth()]+e.getDate()-1|0,U[r+36>>2]=-(60*e.getTimezoneOffset()),t=new Date(e.getFullYear(),6,1).getTimezoneOffset();var o=new Date(e.getFullYear(),0,1).getTimezoneOffset();U[r+32>>2]=(t!=o&&e.getTimezoneOffset()==Math.min(o,t))|0},_tzset_js:(e,t,r,o)=>{var s=new Date().getFullYear(),l=new Date(s,0,1),f=new Date(s,6,1);s=l.getTimezoneOffset();var h=f.getTimezoneOffset();J[e>>2]=60*Math.max(s,h),U[t>>2]=+(s!=h),e=g=>g.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],l=e(l),f=e(f),h<s?(fe(l,ne,r,17),fe(f,ne,o,17)):(fe(l,ne,o,17),fe(f,ne,r,17))},emscripten_asm_const_int:(e,t,r)=>{xn.length=0;for(var o;o=ne[t++];){var s=o!=105;s&=o!=112,r+=s&&r%8?4:0,xn.push(o==112?J[r>>2]:o==105?U[r>>2]:tt[r>>3]),r+=s?8:4}return ae[e](...xn)},emscripten_date_now:()=>Date.now(),emscripten_get_now:()=>performance.now(),emscripten_resize_heap:e=>{var t=ne.length;if(e>>>=0,2147483648<e)return!1;for(var r=1;4>=r;r*=2){var o=t*(1+.2/r);o=Math.min(o,e+100663296);var s=Math;o=Math.max(e,o);e:{s=(s.min.call(s,2147483648,o+(65536-o%65536)%65536)-Ve.buffer.byteLength+65535)/65536;try{Ve.grow(s),ge();var l=1;break e}catch{}l=void 0}if(l)return!0}return!1},environ_get:(e,t)=>{var r=0;return fr().forEach((o,s)=>{var l=t+r;for(s=J[e+4*s>>2]=l,l=0;l<o.length;++l)oe[s++]=o.charCodeAt(l);oe[s]=0,r+=o.length+1}),0},environ_sizes_get:(e,t)=>{var r=fr();J[e>>2]=r.length;var o=0;return r.forEach(s=>o+=s.length+1),J[t>>2]=o,0},fd_close:function(e){try{var t=bt(e);if(t.U===null)throw new W(8);t.Ea&&(t.Ea=null);try{t.l.close&&t.l.close(t)}catch(r){throw r}finally{Bt[t.U]=null}return t.U=null,0}catch(r){if(typeof It>"u"||r.name!=="ErrnoError")throw r;return r.Y}},fd_read:function(e,t,r,o){try{e:{var s=bt(e);e=t;for(var l,f=t=0;f<r;f++){var h=J[e>>2],g=J[e+4>>2];e+=8;var m=s,A=l,R=oe;if(0>g||0>A)throw new W(28);if(m.U===null)throw new W(8);if((m.flags&2097155)===1)throw new W(8);if((m.node.mode&61440)===16384)throw new W(31);if(!m.l.read)throw new W(28);var j=typeof A<"u";if(!j)A=m.position;else if(!m.seekable)throw new W(70);var v=m.l.read(m,R,h,g,A);j||(m.position+=v);var C=v;if(0>C){var _=-1;break e}if(t+=C,C<g)break;typeof l<"u"&&(l+=C)}_=t}return J[o>>2]=_,0}catch(G){if(typeof It>"u"||G.name!=="ErrnoError")throw G;return G.Y}},fd_seek:function(e,t,r,o,s){t=r+2097152>>>0<4194305-!!t?(t>>>0)+4294967296*r:NaN;try{if(isNaN(t))return 61;var l=bt(e);return Jn(l,t,o),ye=[l.position>>>0,(Je=l.position,1<=+Math.abs(Je)?0<Je?+Math.floor(Je/4294967296)>>>0:~~+Math.ceil((Je-+(~~Je>>>0))/4294967296)>>>0:0)],U[s>>2]=ye[0],U[s+4>>2]=ye[1],l.Ea&&t===0&&o===0&&(l.Ea=null),0}catch(f){if(typeof It>"u"||f.name!=="ErrnoError")throw f;return f.Y}},fd_write:function(e,t,r,o){try{e:{var s=bt(e);e=t;for(var l,f=t=0;f<r;f++){var h=J[e>>2],g=J[e+4>>2];e+=8;var m=s,A=h,R=g,j=l,v=oe;if(0>R||0>j)throw new W(28);if(m.U===null)throw new W(8);if((m.flags&2097155)===0)throw new W(8);if((m.node.mode&61440)===16384)throw new W(31);if(!m.l.write)throw new W(28);m.seekable&&m.flags&1024&&Jn(m,0,2);var C=typeof j<"u";if(!C)j=m.position;else if(!m.seekable)throw new W(70);var _=m.l.write(m,v,A,R,j,void 0);C||(m.position+=_);var G=_;if(0>G){var ee=-1;break e}t+=G,typeof l<"u"&&(l+=G)}ee=t}return J[o>>2]=ee,0}catch(P){if(typeof It>"u"||P.name!=="ErrnoError")throw P;return P.Y}},invoke_vii:ci,isWindowsBrowser:function(){return-1<navigator.platform.indexOf("Win")},strftime:vr,strftime_l:(e,t,r,o)=>vr(e,t,r,o),wasm_start_image_decode:function(e,t,r){t=c.HEAP8.subarray(t,t+r),r=new Uint8Array(r),r.set(t),createImageBitmap(new Blob([r])).then(function(o){var s=new OffscreenCanvas(o.width,o.height).getContext("2d");s.drawImage(o,0,0),s=s.getImageData(0,0,o.width,o.height);var l=s.data.length,f=c.vb(l);c.lc.set(s.data,f),c.nc(e,o.width,o.height,f,l)}).catch(function(o){o=o.message||"decode failed";var s=c.Ec(o)+1,l=c.vb(s);c.Jc(o,l,s),c.oc(e,l),c.mc(l)})}},he=(function(){function e(r){return he=r.exports,Ve=he.memory,ge(),ar=he.__indirect_function_table,Ee.unshift(he.__wasm_call_ctors),De--,c.monitorRunDependencies?.(De),De==0&&Ke&&(r=Ke,Ke=null,r()),he}var t={env:mr,wasi_snapshot_preview1:mr};if(De++,c.monitorRunDependencies?.(De),c.instantiateWasm)try{return c.instantiateWasm(t,e)}catch(r){_e(`Module.instantiateWasm callback failed with error: ${r}`),x(r)}return wt||=lt("canvas_advanced.wasm")?"canvas_advanced.wasm":c.locateFile?c.locateFile("canvas_advanced.wasm",M):M+"canvas_advanced.wasm",Mt(t,function(r){e(r.instance)}).catch(x),{}})(),pt=e=>(pt=he.free)(e),Bn=e=>(Bn=he.malloc)(e),gr=e=>(gr=he.__getTypeName)(e);c._wasm_image_decode_complete=(e,t,r,o,s)=>(c._wasm_image_decode_complete=he.wasm_image_decode_complete)(e,t,r,o,s),c._wasm_image_decode_error=(e,t)=>(c._wasm_image_decode_error=he.wasm_image_decode_error)(e,t);var yr=c._ma_device__on_notification_unlocked=e=>(yr=c._ma_device__on_notification_unlocked=he.ma_device__on_notification_unlocked)(e);c._ma_malloc_emscripten=(e,t)=>(c._ma_malloc_emscripten=he.ma_malloc_emscripten)(e,t),c._ma_free_emscripten=(e,t)=>(c._ma_free_emscripten=he.ma_free_emscripten)(e,t);var wr=c._ma_device_process_pcm_frames_capture__webaudio=(e,t,r)=>(wr=c._ma_device_process_pcm_frames_capture__webaudio=he.ma_device_process_pcm_frames_capture__webaudio)(e,t,r),br=c._ma_device_process_pcm_frames_playback__webaudio=(e,t,r)=>(br=c._ma_device_process_pcm_frames_playback__webaudio=he.ma_device_process_pcm_frames_playback__webaudio)(e,t,r),_r=(e,t)=>(_r=he.setThrew)(e,t),Ar=e=>(Ar=he._emscripten_stack_restore)(e),Cr=()=>(Cr=he.emscripten_stack_get_current)();c.dynCall_iiji=(e,t,r,o,s)=>(c.dynCall_iiji=he.dynCall_iiji)(e,t,r,o,s),c.dynCall_jiji=(e,t,r,o,s)=>(c.dynCall_jiji=he.dynCall_jiji)(e,t,r,o,s),c.dynCall_iiiji=(e,t,r,o,s,l)=>(c.dynCall_iiiji=he.dynCall_iiiji)(e,t,r,o,s,l),c.dynCall_iij=(e,t,r,o)=>(c.dynCall_iij=he.dynCall_iij)(e,t,r,o),c.dynCall_jii=(e,t,r)=>(c.dynCall_jii=he.dynCall_jii)(e,t,r),c.dynCall_viijii=(e,t,r,o,s,l,f)=>(c.dynCall_viijii=he.dynCall_viijii)(e,t,r,o,s,l,f),c.dynCall_iiiiij=(e,t,r,o,s,l,f)=>(c.dynCall_iiiiij=he.dynCall_iiiiij)(e,t,r,o,s,l,f),c.dynCall_iiiiijj=(e,t,r,o,s,l,f,h,g)=>(c.dynCall_iiiiijj=he.dynCall_iiiiijj)(e,t,r,o,s,l,f,h,g),c.dynCall_iiiiiijj=(e,t,r,o,s,l,f,h,g,m)=>(c.dynCall_iiiiiijj=he.dynCall_iiiiiijj)(e,t,r,o,s,l,f,h,g,m);function ci(e,t,r){var o=Cr();try{Ln(e)(t,r)}catch(s){if(Ar(o),s!==s+0)throw s;_r(1,0)}}var mn;Ke=function e(){mn||Mr(),mn||(Ke=e)};function Mr(){function e(){if(!mn&&(mn=!0,c.calledRun=!0,!At)){if(c.noFSInit||Zn||(Zn=!0,c.stdin=c.stdin,c.stdout=c.stdout,c.stderr=c.stderr,c.stdin?Ut("stdin",c.stdin):An("/dev/tty","/dev/stdin"),c.stdout?Ut("stdout",null,c.stdout):An("/dev/tty","/dev/stdout"),c.stderr?Ut("stderr",null,c.stderr):An("/dev/tty1","/dev/stderr"),nn("/dev/stdin",0),nn("/dev/stdout",1),nn("/dev/stderr",1)),Nn=!1,a(Ee),z(c),c.onRuntimeInitialized&&c.onRuntimeInitialized(),c.postRun)for(typeof c.postRun=="function"&&(c.postRun=[c.postRun]);c.postRun.length;){var t=c.postRun.shift();Le.unshift(t)}a(Le)}}if(!(0<De)){if(c.preRun)for(typeof c.preRun=="function"&&(c.preRun=[c.preRun]);c.preRun.length;)Tt();a(xe),0<De||(c.setStatus?(c.setStatus("Running..."),setTimeout(function(){setTimeout(function(){c.setStatus("")},1),e()},1)):e())}}if(c.preInit)for(typeof c.preInit=="function"&&(c.preInit=[c.preInit]);0<c.preInit.length;)c.preInit.pop()();return Mr(),w=D,w})})();const se=N}),(pe=>{pe.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 <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"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}}`)}),((pe,Y,I)=>{I.r(Y),I.d(Y,{AudioAssetWrapper:()=>E.AudioAssetWrapper,AudioWrapper:()=>E.AudioWrapper,BLANK_URL:()=>k.BLANK_URL,CustomFileAssetLoaderWrapper:()=>E.CustomFileAssetLoaderWrapper,FileAssetWrapper:()=>E.FileAssetWrapper,FileFinalizer:()=>E.FileFinalizer,FocusSessionState:()=>se.FocusSessionState,FontAssetWrapper:()=>E.FontAssetWrapper,FontWrapper:()=>E.FontWrapper,ImageAssetWrapper:()=>E.ImageAssetWrapper,ImageWrapper:()=>E.ImageWrapper,KeyboardInteractions:()=>se.KeyboardInteractions,RiveFont:()=>w.RiveFont,createFinalization:()=>E.createFinalization,finalizationRegistry:()=>E.finalizationRegistry,registerTouchInteractions:()=>N.registerTouchInteractions,sanitizeUrl:()=>k.sanitizeUrl});var N=I(7),se=I(8),k=I(9),E=I(10),w=I(11)}),((pe,Y,I)=>{I.r(Y),I.d(Y,{registerTouchInteractions:()=>E});var N=void 0,se=function(w,c,z){var x,D=[];if(c)for(var ue=0;ue<w.length;ue++){var le=w[ue];D.push({clientX:le.clientX,clientY:le.clientY,identifier:le.identifier})}else{var ie=z!==null?(x=Array.from(w).find(function(we){return we.identifier===z}))!==null&&x!==void 0?x:null:w[0];ie&&D.push({clientX:ie.clientX,clientY:ie.clientY,identifier:ie.identifier})}return D},k=function(w,c,z,x){var D,ue=w;return!((D=ue.changedTouches)===null||D===void 0)&&D.length?(!c&&["touchstart","touchmove"].includes(w.type)&&w.preventDefault(),se(ue.changedTouches,z,x)):[{clientX:w.clientX,clientY:w.clientY,identifier:0}]},E=function(w){var c=w.canvas,z=w.artboard,x=w.stateMachines,D=x===void 0?[]:x,ue=w.renderer,le=w.rive,ie=w.fit,we=w.alignment,Fe=w.isTouchScrollEnabled,He=Fe===void 0?!1:Fe,ze=w.dispatchPointerExit,L=ze===void 0?!0:ze,T=w.enableMultiTouch,Z=T===void 0?!1:T,M=w.layoutScaleFactor,Ie=M===void 0?1:M,Pe=w.advanceAndDrain;if(!c||!D.length||!ue||!le||!z||typeof window>"u")return null;var gt=null,_e=!1,je=null,Ve=function(ne){var Re;if(_e&&ne instanceof MouseEvent){ne.type=="mouseup"&&(_e=!1);return}_e=He&&ne.type==="touchend"&>==="touchstart",gt=ne.type;var Ue=ne.currentTarget.getBoundingClientRect();if(!Z&&ne.type==="touchstart"&&je===null){var U=(Re=ne.changedTouches)===null||Re===void 0?void 0:Re[0];U&&(je=U.identifier)}var J=k(ne,He,Z,Z?null:je),Ge=le.computeAlignment(ie,we,{minX:0,minY:0,maxX:Ue.width,maxY:Ue.height},z.bounds,Ie),tt=new le.Mat2D;switch(Ge.invert(tt),J.forEach(function(ye){var ae=ye.clientX,a=ye.clientY;if(!(!ae&&!a)){var n=ae-Ue.left,i=a-Ue.top,u=new le.Vec2D(n,i),d=le.mapXY(tt,u),p=d.x(),y=d.y();ye.transformedX=p,ye.transformedY=y,d.delete(),u.delete()}}),tt.delete(),Ge.delete(),ne.type){case"mouseout":for(var ge=function(ye){L?J.forEach(function(ae){ye.pointerExit(ae.transformedX,ae.transformedY,ae.identifier)}):J.forEach(function(ae){ye.pointerMove(ae.transformedX,ae.transformedY,ae.identifier)})},xe=0,Ee=D;xe<Ee.length;xe++){var Le=Ee[xe];ge(Le)}break;case"touchmove":case"mouseover":case"mousemove":{for(var Tt=function(ye){J.forEach(function(ae){ye.pointerMove(ae.transformedX,ae.transformedY,ae.identifier)})},De=0,Ke=D;De<Ke.length;De++){var Le=Ke[De];Tt(Le)}break}case"touchstart":case"mousedown":{for(var ut=function(ye){J.forEach(function(ae){ye.pointerDown(ae.transformedX,ae.transformedY,ae.identifier)})},lt=0,yt=D;lt<yt.length;lt++){var Le=yt[lt];ut(Le)}Pe(0);break}case"touchend":{for(var wt=function(ye){J.forEach(function(ae){ye.pointerUp(ae.transformedX,ae.transformedY,ae.identifier),ye.pointerExit(ae.transformedX,ae.transformedY,ae.identifier)})},ct=0,Ct=D;ct<Ct.length;ct++){var Le=Ct[ct];wt(Le)}Pe(0),!Z&&J.some(function(ye){return ye.identifier===je})&&(je=null);break}case"mouseup":{for(var Te=function(ye){J.forEach(function(ae){ye.pointerUp(ae.transformedX,ae.transformedY,ae.identifier)})},Mt=0,Je=D;Mt<Je.length;Mt++){var Le=Je[Mt];Te(Le)}Pe(0);break}}},At=function(){je=null},oe=Ve.bind(N);return c.addEventListener("mouseover",oe),c.addEventListener("mouseout",oe),c.addEventListener("mousemove",oe),c.addEventListener("mousedown",oe),c.addEventListener("mouseup",oe),c.addEventListener("touchmove",oe,{passive:He}),c.addEventListener("touchstart",oe,{passive:He}),c.addEventListener("touchend",oe),c.addEventListener("touchcancel",At),function(){c.removeEventListener("mouseover",oe),c.removeEventListener("mouseout",oe),c.removeEventListener("mousemove",oe),c.removeEventListener("mousedown",oe),c.removeEventListener("mouseup",oe),c.removeEventListener("touchmove",oe),c.removeEventListener("touchstart",oe),c.removeEventListener("touchend",oe),c.removeEventListener("touchcancel",At)}}}),((pe,Y,I)=>{I.r(Y),I.d(Y,{FocusSessionState:()=>N,KeyboardInteractions:()=>se});var N;(function(k){k.NotFocused="notFocused",k.EntryPending="entryPending",k.RiveFocused="riveFocused"})(N||(N={}));var se=(function(){function k(E){var w=E.canvas,c=E.stateMachine,z=E.hasFocusNodes,x=this;this.focusSessionState=N.NotFocused,this.onCanvasFocus=function(D){if(x.hasFocusNodes&&!x.mainSm.focusState().hasFocus&&(x.focusSessionState=N.EntryPending,!!x.isKeyboardDrivenFocus())){var ue=x.cameFromBeforeCanvas(D.relatedTarget);(ue?x.mainSm.focusNext():x.mainSm.focusPrevious())&&(x.focusSessionState=N.RiveFocused)}},this.onCanvasBlur=function(D){x.focusSessionState=N.NotFocused},this.onKeyDown=function(D){if(x.focusSessionState!==N.NotFocused&&D.code==="Tab"&&x.hasFocusNodes){var ue=!D.shiftKey,le=ue?x.mainSm.focusNext():x.mainSm.focusPrevious();le?(x.focusSessionState=N.RiveFocused,D.preventDefault()):x.focusSessionState=N.NotFocused}},this.canvas=w,this.mainSm=c,this.hasFocusNodes=z,w.addEventListener("focus",this.onCanvasFocus),w.addEventListener("blur",this.onCanvasBlur),w.addEventListener("keydown",this.onKeyDown)}return k.prototype.setFocusSessionState=function(E){this.focusSessionState=E},k.prototype.notifyRiveFocused=function(){this.focusSessionState=N.RiveFocused},k.prototype.isKeyboardDrivenFocus=function(){try{return this.canvas.matches(":focus-visible")}catch{return!1}},k.prototype.cameFromBeforeCanvas=function(E){if(!E)return!0;var w=this.canvas.compareDocumentPosition(E);return w&Node.DOCUMENT_POSITION_PRECEDING?!0:!(w&Node.DOCUMENT_POSITION_FOLLOWING)},k.prototype.cleanup=function(){this.canvas.removeEventListener("focus",this.onCanvasFocus),this.canvas.removeEventListener("blur",this.onCanvasBlur),this.canvas.removeEventListener("keydown",this.onKeyDown)},k})()}),((pe,Y,I)=>{I.r(Y),I.d(Y,{BLANK_URL:()=>z,sanitizeUrl:()=>ue});var N=/^([^\w]*)(javascript|data|vbscript)/im,se=/&#(\w+)(^\w|;)?/g,k=/&(newline|tab);/gi,E=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,w=/^.+(:|:)/gim,c=[".","/"],z="about:blank";function x(le){return c.indexOf(le[0])>-1}function D(le){var ie=le.replace(E,"");return ie.replace(se,function(we,Fe){return String.fromCharCode(Fe)})}function ue(le){if(!le)return z;var ie=D(le).replace(k,"").replace(E,"").trim();if(!ie)return z;if(x(ie))return ie;var we=ie.match(w);if(!we)return ie;var Fe=we[0];return N.test(Fe)?z:ie}}),((pe,Y,I)=>{I.r(Y),I.d(Y,{AudioAssetWrapper:()=>le,AudioWrapper:()=>c,CustomFileAssetLoaderWrapper:()=>x,FileAssetWrapper:()=>D,FileFinalizer:()=>se,FontAssetWrapper:()=>ie,FontWrapper:()=>z,ImageAssetWrapper:()=>ue,ImageWrapper:()=>w,createFinalization:()=>ze,finalizationRegistry:()=>He});var N=(function(){var L=function(T,Z){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,Ie){M.__proto__=Ie}||function(M,Ie){for(var Pe in Ie)Object.prototype.hasOwnProperty.call(Ie,Pe)&&(M[Pe]=Ie[Pe])},L(T,Z)};return function(T,Z){if(typeof Z!="function"&&Z!==null)throw new TypeError("Class extends value "+String(Z)+" is not a constructor or null");L(T,Z);function M(){this.constructor=T}T.prototype=Z===null?Object.create(Z):(M.prototype=Z.prototype,new M)}})(),se=(function(){function L(T){this.selfUnref=!1,this._file=T}return L.prototype.unref=function(){this._file&&this._file.unref()},L})(),k=(function(){function L(T){this._finalizableObject=T}return L.prototype.unref=function(){this._finalizableObject.unref()},L})(),E=(function(){function L(){this.selfUnref=!1}return L.prototype.unref=function(){},L})(),w=(function(L){N(T,L);function T(Z){var M=L.call(this)||this;return M._nativeImage=Z,M}return Object.defineProperty(T.prototype,"nativeImage",{get:function(){return this._nativeImage},enumerable:!1,configurable:!0}),T.prototype.unref=function(){this.selfUnref&&this._nativeImage.unref()},T})(E),c=(function(L){N(T,L);function T(Z){var M=L.call(this)||this;return M._nativeAudio=Z,M}return Object.defineProperty(T.prototype,"nativeAudio",{get:function(){return this._nativeAudio},enumerable:!1,configurable:!0}),T.prototype.unref=function(){this.selfUnref&&this._nativeAudio.unref()},T})(E),z=(function(L){N(T,L);function T(Z){var M=L.call(this)||this;return M._nativeFont=Z,M}return Object.defineProperty(T.prototype,"nativeFont",{get:function(){return this._nativeFont},enumerable:!1,configurable:!0}),T.prototype.unref=function(){this.selfUnref&&this._nativeFont.unref()},T})(E),x=(function(){function L(T,Z){this._assetLoaderCallback=Z,this.assetLoader=new T.CustomFileAssetLoader({loadContents:this.loadContents.bind(this)})}return L.prototype.loadContents=function(T,Z){var M;if(T.isImage)M=new ue(T);else if(T.isAudio)M=new le(T);else if(T.isFont)M=new ie(T);else return!1;return this._assetLoaderCallback(M,Z)},L})(),D=(function(){function L(T){this._nativeFileAsset=T}return L.prototype.decode=function(T){this._nativeFileAsset.decode(T)},Object.defineProperty(L.prototype,"name",{get:function(){return this._nativeFileAsset.name},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"fileExtension",{get:function(){return this._nativeFileAsset.fileExtension},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"uniqueFilename",{get:function(){return this._nativeFileAsset.uniqueFilename},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isAudio",{get:function(){return this._nativeFileAsset.isAudio},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isImage",{get:function(){return this._nativeFileAsset.isImage},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isFont",{get:function(){return this._nativeFileAsset.isFont},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"cdnUuid",{get:function(){return this._nativeFileAsset.cdnUuid},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"nativeFileAsset",{get:function(){return this._nativeFileAsset},enumerable:!1,configurable:!0}),L})(),ue=(function(L){N(T,L);function T(){return L!==null&&L.apply(this,arguments)||this}return T.prototype.setRenderImage=function(Z){this._nativeFileAsset.setRenderImage(Z.nativeImage)},T})(D),le=(function(L){N(T,L);function T(){return L!==null&&L.apply(this,arguments)||this}return T.prototype.setAudioSource=function(Z){this._nativeFileAsset.setAudioSource(Z.nativeAudio)},T})(D),ie=(function(L){N(T,L);function T(){return L!==null&&L.apply(this,arguments)||this}return T.prototype.setFont=function(Z){this._nativeFileAsset.setFont(Z.nativeFont)},T})(D),we=(function(){function L(T){}return L.prototype.register=function(T){T.selfUnref=!0},L.prototype.unregister=function(T){},L})(),Fe=typeof FinalizationRegistry<"u"?FinalizationRegistry:we,He=new Fe(function(L){L?.unref()}),ze=function(L,T){var Z=new k(T);He.register(L,Z)}}),((pe,Y,I)=>{I.r(Y),I.d(Y,{RiveFont:()=>se});var N=I(3),se=(function(){function k(){}return k.setFallbackFontCallback=function(E){k._fallbackFontCallback=E??null,k._wireFallbackProc()},k._fontToPtr=function(E){var w;if(E==null)return null;var c=E.nativeFont,z=(w=c?.ptr)===null||w===void 0?void 0:w.call(c);return z??null},k._getFallbackPtr=function(E,w){return w<0||w>=E.length?null:k._fontToPtr(E[w])},k._wireFallbackProc=function(){N.RuntimeLoader.getInstance(function(E){var w=k._fallbackFontCallback;w?E.setFallbackFontCallback((function(c,z,x){var D=w(c,x);return D?Array.isArray(D)?k._getFallbackPtr(D,z):z===0?k._fontToPtr(D):null:null})):E.setFallbackFontCallback(null)})},k._fallbackFontCallback=null,k})()})],st={};function Ae(pe){var Y=st[pe];if(Y!==void 0)return Y.exports;var I=st[pe]={exports:{}};return Lt[pe](I,I.exports,Ae),I.exports}Ae.d=(pe,Y)=>{for(var I in Y)Ae.o(Y,I)&&!Ae.o(pe,I)&&Object.defineProperty(pe,I,{enumerable:!0,get:Y[I]})},Ae.o=(pe,Y)=>Object.prototype.hasOwnProperty.call(pe,Y),Ae.r=pe=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(pe,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(pe,"__esModule",{value:!0})};var _t={};return(()=>{Ae.r(_t),Ae.d(_t,{Alignment:()=>D,DataEnum:()=>tt,DataType:()=>J,DrawOptimizationOptions:()=>ue,EventType:()=>M,Fit:()=>x,Layout:()=>le,LoopType:()=>Ie,Rive:()=>U,RiveEventType:()=>Fe,RiveFile:()=>Ue,RiveFont:()=>I.RiveFont,RuntimeLoader:()=>Y.RuntimeLoader,StateMachineInput:()=>we,StateMachineInputType:()=>ie,Testing:()=>Mt,ViewModel:()=>Ge,ViewModelInstance:()=>xe,ViewModelInstanceArtboard:()=>ct,ViewModelInstanceAssetImage:()=>wt,ViewModelInstanceBoolean:()=>De,ViewModelInstanceColor:()=>yt,ViewModelInstanceEnum:()=>ut,ViewModelInstanceList:()=>lt,ViewModelInstanceNumber:()=>Tt,ViewModelInstanceString:()=>Le,ViewModelInstanceTrigger:()=>Ke,ViewModelInstanceValue:()=>Ee,decodeAudio:()=>Je,decodeFont:()=>ae,decodeImage:()=>ye});var pe=Ae(1),Y=Ae(3),I=Ae(6),N=(function(){var a=function(n,i){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(u[p]=d[p])},a(n,i)};return function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");a(n,i);function u(){this.constructor=n}n.prototype=i===null?Object.create(i):(u.prototype=i.prototype,new u)}})(),se=function(){return se=Object.assign||function(a){for(var n,i=1,u=arguments.length;i<u;i++){n=arguments[i];for(var d in n)Object.prototype.hasOwnProperty.call(n,d)&&(a[d]=n[d])}return a},se.apply(this,arguments)},k=function(a,n,i,u){function d(p){return p instanceof i?p:new i(function(y){y(p)})}return new(i||(i=Promise))(function(p,y){function S(B){try{O(u.next(B))}catch(me){y(me)}}function V(B){try{O(u.throw(B))}catch(me){y(me)}}function O(B){B.done?p(B.value):d(B.value).then(S,V)}O((u=u.apply(a,n||[])).next())})},E=function(a,n){var i={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},u,d,p,y=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return y.next=S(0),y.throw=S(1),y.return=S(2),typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function S(O){return function(B){return V([O,B])}}function V(O){if(u)throw new TypeError("Generator is already executing.");for(;y&&(y=0,O[0]&&(i=0)),i;)try{if(u=1,d&&(p=O[0]&2?d.return:O[0]?d.throw||((p=d.return)&&p.call(d),0):d.next)&&!(p=p.call(d,O[1])).done)return p;switch(d=0,p&&(O=[O[0]&2,p.value]),O[0]){case 0:case 1:p=O;break;case 4:return i.label++,{value:O[1],done:!1};case 5:i.label++,d=O[1],O=[0];continue;case 7:O=i.ops.pop(),i.trys.pop();continue;default:if(p=i.trys,!(p=p.length>0&&p[p.length-1])&&(O[0]===6||O[0]===2)){i=0;continue}if(O[0]===3&&(!p||O[1]>p[0]&&O[1]<p[3])){i.label=O[1];break}if(O[0]===6&&i.label<p[1]){i.label=p[1],p=O;break}if(p&&i.label<p[2]){i.label=p[2],i.ops.push(O);break}p[2]&&i.ops.pop(),i.trys.pop();continue}O=n.call(a,i)}catch(B){O=[6,B],d=0}finally{u=p=0}if(O[0]&5)throw O[1];return{value:O[0]?O[1]:void 0,done:!0}}},w=function(a,n,i){if(i||arguments.length===2)for(var u=0,d=n.length,p;u<d;u++)(p||!(u in n))&&(p||(p=Array.prototype.slice.call(n,0,u)),p[u]=n[u]);return a.concat(p||Array.prototype.slice.call(n))},c=(function(a){N(n,a);function n(){var i=a!==null&&a.apply(this,arguments)||this;return i.isHandledError=!0,i}return n})(Error),z=function(a){return a&&a.isHandledError?a.message:"Problem loading file; may be corrupt!"},x;(function(a){a.Cover="cover",a.Contain="contain",a.Fill="fill",a.FitWidth="fitWidth",a.FitHeight="fitHeight",a.None="none",a.ScaleDown="scaleDown",a.Layout="layout"})(x||(x={}));var D;(function(a){a.Center="center",a.TopLeft="topLeft",a.TopCenter="topCenter",a.TopRight="topRight",a.CenterLeft="centerLeft",a.CenterRight="centerRight",a.BottomLeft="bottomLeft",a.BottomCenter="bottomCenter",a.BottomRight="bottomRight"})(D||(D={}));var ue;(function(a){a.AlwaysDraw="alwaysDraw",a.DrawOnChanged="drawOnChanged"})(ue||(ue={}));var le=(function(){function a(n){var i,u,d,p,y,S,V;this.fit=(i=n?.fit)!==null&&i!==void 0?i:x.Contain,this.alignment=(u=n?.alignment)!==null&&u!==void 0?u:D.Center,this.layoutScaleFactor=(d=n?.layoutScaleFactor)!==null&&d!==void 0?d:1,this.minX=(p=n?.minX)!==null&&p!==void 0?p:0,this.minY=(y=n?.minY)!==null&&y!==void 0?y:0,this.maxX=(S=n?.maxX)!==null&&S!==void 0?S:0,this.maxY=(V=n?.maxY)!==null&&V!==void 0?V:0}return a.new=function(n){var i=n.fit,u=n.alignment,d=n.minX,p=n.minY,y=n.maxX,S=n.maxY;return console.warn("This function is deprecated: please use `new Layout({})` instead"),new a({fit:i,alignment:u,minX:d,minY:p,maxX:y,maxY:S})},a.prototype.copyWith=function(n){var i=n.fit,u=n.alignment,d=n.layoutScaleFactor,p=n.minX,y=n.minY,S=n.maxX,V=n.maxY;return new a({fit:i??this.fit,alignment:u??this.alignment,layoutScaleFactor:d??this.layoutScaleFactor,minX:p??this.minX,minY:y??this.minY,maxX:S??this.maxX,maxY:V??this.maxY})},a.prototype.runtimeFit=function(n){if(this.cachedRuntimeFit)return this.cachedRuntimeFit;var i;return this.fit===x.Cover?i=n.Fit.cover:this.fit===x.Contain?i=n.Fit.contain:this.fit===x.Fill?i=n.Fit.fill:this.fit===x.FitWidth?i=n.Fit.fitWidth:this.fit===x.FitHeight?i=n.Fit.fitHeight:this.fit===x.ScaleDown?i=n.Fit.scaleDown:this.fit===x.Layout?i=n.Fit.layout:i=n.Fit.none,this.cachedRuntimeFit=i,i},a.prototype.runtimeAlignment=function(n){if(this.cachedRuntimeAlignment)return this.cachedRuntimeAlignment;var i;return this.alignment===D.TopLeft?i=n.Alignment.topLeft:this.alignment===D.TopCenter?i=n.Alignment.topCenter:this.alignment===D.TopRight?i=n.Alignment.topRight:this.alignment===D.CenterLeft?i=n.Alignment.centerLeft:this.alignment===D.CenterRight?i=n.Alignment.centerRight:this.alignment===D.BottomLeft?i=n.Alignment.bottomLeft:this.alignment===D.BottomCenter?i=n.Alignment.bottomCenter:this.alignment===D.BottomRight?i=n.Alignment.bottomRight:i=n.Alignment.center,this.cachedRuntimeAlignment=i,i},a})(),ie;(function(a){a[a.Number=56]="Number",a[a.Trigger=58]="Trigger",a[a.Boolean=59]="Boolean"})(ie||(ie={}));var we=(function(){function a(n,i){this.type=n,this.runtimeInput=i}return Object.defineProperty(a.prototype,"name",{get:function(){return this.runtimeInput.name},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"value",{get:function(){return this.runtimeInput.value},set:function(n){this.runtimeInput.value=n},enumerable:!1,configurable:!0}),a.prototype.fire=function(){this.type===ie.Trigger&&this.runtimeInput.fire()},a.prototype.delete=function(){this.runtimeInput=null},a})(),Fe;(function(a){a[a.General=128]="General",a[a.OpenUrl=131]="OpenUrl"})(Fe||(Fe={}));var He=(function(){function a(n){this.isBindableArtboard=!1,this.isBindableArtboard=n}return a})(),ze=(function(a){N(n,a);function n(i,u){var d=a.call(this,!1)||this;return d.nativeArtboard=i,d.file=u,d}return n})(He),L=(function(a){N(n,a);function n(i){var u=a.call(this,!0)||this;return u.selfUnref=!1,u.nativeArtboard=i,u}return Object.defineProperty(n.prototype,"viewModel",{set:function(i){this.nativeViewModel=i.nativeInstance},enumerable:!1,configurable:!0}),n.prototype.destroy=function(){var i;this.selfUnref&&(this.nativeArtboard.unref(),(i=this.nativeViewModel)===null||i===void 0||i.unref())},n})(He),T=(function(){function a(n,i,u,d){this.stateMachine=n,this.playing=u,this.artboard=d,this.inputs=[],this.instance=new i.StateMachineInstance(n,d),this.initInputs(i),this.hasFocusNodes=this.instance.hasFocusNodes()}return Object.defineProperty(a.prototype,"name",{get:function(){return this.stateMachine.name},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"statesChanged",{get:function(){for(var n=[],i=0;i<this.instance.stateChangedCount();i++)n.push(this.instance.stateChangedNameByIndex(i));return n},enumerable:!1,configurable:!0}),a.prototype.advance=function(n){this.instance.advance(n)},a.prototype.advanceAndApply=function(n){this.instance.advanceAndApply(n)},a.prototype.reportedEventCount=function(){return this.instance.reportedEventCount()},a.prototype.reportedEventAt=function(n){return this.instance.reportedEventAt(n)},a.prototype.initInputs=function(n){for(var i=0;i<this.instance.inputCount();i++){var u=this.instance.input(i);this.inputs.push(this.mapRuntimeInput(u,n))}},a.prototype.mapRuntimeInput=function(n,i){if(n.type===i.SMIInput.bool)return new we(ie.Boolean,n.asBool());if(n.type===i.SMIInput.number)return new we(ie.Number,n.asNumber());if(n.type===i.SMIInput.trigger)return new we(ie.Trigger,n.asTrigger())},a.prototype.cleanup=function(){this.inputs.forEach(function(n){n.delete()}),this.inputs.length=0,this.instance.delete()},a.prototype.bindViewModelInstance=function(n){n.runtimeInstance!=null&&this.instance.bindViewModelInstance(n.runtimeInstance)},a.prototype.focusState=function(){return this.instance.focusState()},a.prototype.clearFocus=function(){this.instance.clearFocus()},a})(),Z=(function(){function a(n,i,u,d,p){d===void 0&&(d=[]),p===void 0&&(p=[]),this.runtime=n,this.artboard=i,this.eventManager=u,this.animations=d,this.stateMachines=p}return a.prototype.add=function(n,i,u){if(u===void 0&&(u=!0),n=Te(n),n.length===0)this.animations.forEach(function(fe){return fe.playing=i}),this.stateMachines.forEach(function(fe){return fe.playing=i});else for(var d=this.animations.map(function(fe){return fe.name}),p=this.stateMachines.map(function(fe){return fe.name}),y=0;y<n.length;y++){var S=d.indexOf(n[y]),V=p.indexOf(n[y]);if(S>=0||V>=0)S>=0?this.animations[S].playing=i:this.stateMachines[V].playing=i;else{var O=this.artboard.animationByName(n[y]);if(O){var B=new pe.Animation(O,this.artboard,this.runtime,i);B.advance(0),B.apply(1),this.animations.push(B)}else{var me=this.artboard.stateMachineByName(n[y]);if(me){var Me=new T(me,this.runtime,i,this.artboard);this.stateMachines.push(Me)}}}}return u&&(i?this.eventManager.fire({type:M.Play,data:this.playing}):this.eventManager.fire({type:M.Pause,data:this.paused})),i?this.playing:this.paused},a.prototype.initLinearAnimations=function(n,i,u){u===void 0&&(u=!1);for(var d=this.animations.map(function(B){return B.name}),p=0;p<n.length;p++){var y=d.indexOf(n[p]);if(y>=0)this.animations[y].playing=i;else{var S=this.artboard.animationByName(n[p]);if(S){var V=new pe.Animation(S,this.artboard,this.runtime,i);V.advance(0),V.apply(1),this.animations.push(V)}else if(u){var O="State Machine with name ".concat(n[p]," not found");throw new c(O)}else console.error("Animation with name ".concat(n[p]," not found."))}}},a.prototype.initStateMachines=function(n,i){for(var u=this.stateMachines.map(function(V){return V.name}),d=0;d<n.length;d++){var p=u.indexOf(n[d]);if(p>=0)this.stateMachines[p].playing=i;else{var y=this.artboard.stateMachineByName(n[d]);if(y){var S=new T(y,this.runtime,i,this.artboard);this.stateMachines.push(S)}else console.warn("State Machine with name ".concat(n[d]," not found. Falling back to find an animation with the same name.")),this.initLinearAnimations([n[d]],i,!0)}}},a.prototype.play=function(n){return this.add(n,!0)},a.prototype.advanceIfPaused=function(){this.stateMachines.forEach(function(n){n.playing||n.advanceAndApply(0)})},a.prototype.pause=function(n){return this.add(n,!1)},a.prototype.scrub=function(n,i){var u=this.animations.filter(function(d){return n.includes(d.name)});return u.forEach(function(d){return d.scrubTo=i}),u.map(function(d){return d.name})},Object.defineProperty(a.prototype,"playing",{get:function(){return this.animations.filter(function(n){return n.playing}).map(function(n){return n.name}).concat(this.stateMachines.filter(function(n){return n.playing}).map(function(n){return n.name}))},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"paused",{get:function(){return this.animations.filter(function(n){return!n.playing}).map(function(n){return n.name}).concat(this.stateMachines.filter(function(n){return!n.playing}).map(function(n){return n.name}))},enumerable:!1,configurable:!0}),a.prototype.stop=function(n){var i=this;n=Te(n);var u=[];if(n.length===0)u=this.animations.map(function(y){return y.name}).concat(this.stateMachines.map(function(y){return y.name})),this.animations.forEach(function(y){return y.cleanup()}),this.stateMachines.forEach(function(y){return y.cleanup()}),this.animations.splice(0,this.animations.length),this.stateMachines.splice(0,this.stateMachines.length);else{var d=this.animations.filter(function(y){return n.includes(y.name)});d.forEach(function(y){y.cleanup(),i.animations.splice(i.animations.indexOf(y),1)});var p=this.stateMachines.filter(function(y){return n.includes(y.name)});p.forEach(function(y){y.cleanup(),i.stateMachines.splice(i.stateMachines.indexOf(y),1)}),u=d.map(function(y){return y.name}).concat(p.map(function(y){return y.name}))}return this.eventManager.fire({type:M.Stop,data:u}),u},Object.defineProperty(a.prototype,"isPlaying",{get:function(){return this.animations.reduce(function(n,i){return n||i.playing},!1)||this.stateMachines.reduce(function(n,i){return n||i.playing},!1)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isPaused",{get:function(){return!this.isPlaying&&(this.animations.length>0||this.stateMachines.length>0)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isStopped",{get:function(){return this.animations.length===0&&this.stateMachines.length===0},enumerable:!1,configurable:!0}),a.prototype.atLeastOne=function(n,i){i===void 0&&(i=!0);var u;return this.animations.length===0&&this.stateMachines.length===0&&(this.artboard.animationCount()>0?this.add([u=this.artboard.animationByIndex(0).name],n,i):this.artboard.stateMachineCount()>0&&this.add([u=this.artboard.stateMachineByIndex(0).name],n,i)),u},a.prototype.handleLooping=function(){for(var n=0,i=this.animations.filter(function(d){return d.playing});n<i.length;n++){var u=i[n];u.loopValue===0&&u.loopCount?(u.loopCount=0,this.stop(u.name)):u.loopValue===1&&u.loopCount?(this.eventManager.fire({type:M.Loop,data:{animation:u.name,type:Ie.Loop}}),u.loopCount=0):u.loopValue===2&&u.loopCount>1&&(this.eventManager.fire({type:M.Loop,data:{animation:u.name,type:Ie.PingPong}}),u.loopCount=0)}},a.prototype.handleStateChanges=function(){for(var n=[],i=0,u=this.stateMachines.filter(function(p){return p.playing});i<u.length;i++){var d=u[i];n.push.apply(n,d.statesChanged)}n.length>0&&this.eventManager.fire({type:M.StateChange,data:n})},a.prototype.handleAdvancing=function(n){this.eventManager.fire({type:M.Advance,data:n})},a})(),M;(function(a){a.Load="load",a.LoadError="loaderror",a.Play="play",a.Pause="pause",a.Stop="stop",a.Loop="loop",a.Draw="draw",a.Advance="advance",a.StateChange="statechange",a.RiveEvent="riveevent",a.AudioStatusChange="audiostatuschange"})(M||(M={}));var Ie;(function(a){a.OneShot="oneshot",a.Loop="loop",a.PingPong="pingpong"})(Ie||(Ie={}));var Pe=(function(){function a(n){n===void 0&&(n=[]),this.listeners=n}return a.prototype.getListeners=function(n){return this.listeners.filter(function(i){return i.type===n})},a.prototype.add=function(n){this.listeners.includes(n)||this.listeners.push(n)},a.prototype.remove=function(n){for(var i=0;i<this.listeners.length;i++){var u=this.listeners[i];if(u.type===n.type&&u.callback===n.callback){this.listeners.splice(i,1);break}}},a.prototype.removeAll=function(n){var i=this;n?this.listeners.filter(function(u){return u.type===n}).forEach(function(u){return i.remove(u)}):this.listeners.splice(0,this.listeners.length)},a.prototype.fire=function(n){var i=this.getListeners(n.type);i.forEach(function(u){return u.callback(n)})},a})(),gt=(function(){function a(n){this.eventManager=n,this.queue=[]}return a.prototype.add=function(n){this.queue.push(n)},a.prototype.process=function(){for(;this.queue.length>0;){var n=this.queue.shift();n?.action&&n.action(),n?.event&&this.eventManager.fire(n.event)}},a})(),_e;(function(a){a[a.AVAILABLE=0]="AVAILABLE",a[a.UNAVAILABLE=1]="UNAVAILABLE"})(_e||(_e={}));var je=(function(a){N(n,a);function n(){var i=a!==null&&a.apply(this,arguments)||this;return i._started=!1,i._enabled=!1,i._status=_e.UNAVAILABLE,i}return n.prototype.delay=function(i){return k(this,void 0,void 0,function(){return E(this,function(u){return[2,new Promise(function(d){return setTimeout(d,i)})]})})},n.prototype.timeout=function(){return k(this,void 0,void 0,function(){return E(this,function(i){return[2,new Promise(function(u,d){return setTimeout(d,50)})]})})},n.prototype.reportToListeners=function(){this.fire({type:M.AudioStatusChange}),this.removeAll()},n.prototype.enableAudio=function(){return k(this,void 0,void 0,function(){return E(this,function(i){return this._enabled||(this._enabled=!0,this._status=_e.AVAILABLE,this.reportToListeners()),[2]})})},n.prototype.testAudio=function(){return k(this,void 0,void 0,function(){return E(this,function(i){switch(i.label){case 0:if(!(this._status===_e.UNAVAILABLE&&this._audioContext!==null))return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Promise.race([this._audioContext.resume(),this.timeout()])];case 2:return i.sent(),this.enableAudio(),[3,4];case 3:return i.sent(),[3,4];case 4:return[2]}})})},n.prototype._establishAudio=function(){return k(this,void 0,void 0,function(){return E(this,function(i){switch(i.label){case 0:return this._started?[3,5]:(this._started=!0,typeof window>"u"?(this.enableAudio(),[3,5]):[3,1]);case 1:this._audioContext=new AudioContext,this.listenForUserAction(),i.label=2;case 2:return this._status!==_e.UNAVAILABLE?[3,5]:[4,this.testAudio()];case 3:return i.sent(),[4,this.delay(1e3)];case 4:return i.sent(),[3,2];case 5:return[2]}})})},n.prototype.listenForUserAction=function(){var i=this,u=function(){return k(i,void 0,void 0,function(){return E(this,function(d){return this.enableAudio(),[2]})})};document.addEventListener("pointerdown",u,{once:!0})},n.prototype.establishAudio=function(){return k(this,void 0,void 0,function(){return E(this,function(i){return this._establishAudio(),[2]})})},Object.defineProperty(n.prototype,"systemVolume",{get:function(){return this._status===_e.UNAVAILABLE?(this.testAudio(),0):1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),n})(Pe),Ve=new je,At=(function(){function a(){}return a.prototype.observe=function(){},a.prototype.unobserve=function(){},a.prototype.disconnect=function(){},a})(),oe=globalThis.ResizeObserver||At,ne=(function(){function a(){var n=this;this._elementsMap=new Map,this._onObservedEntry=function(i){var u=n._elementsMap.get(i.target);u!==null?u.onResize(i.target.clientWidth==0||i.target.clientHeight==0):n._resizeObserver.unobserve(i.target)},this._onObserved=function(i){i.forEach(n._onObservedEntry)},this._resizeObserver=new oe(this._onObserved)}return a.prototype.add=function(n,i){var u={onResize:i,element:n};return this._elementsMap.set(n,u),this._resizeObserver.observe(n),u},a.prototype.remove=function(n){this._resizeObserver.unobserve(n.element),this._elementsMap.delete(n.element)},a})(),Re=new ne,Ue=(function(){function a(n){this.enableRiveAssetCDN=!0,this.enablePerfMarks=!1,this.referenceCount=0,this.destroyed=!1,this.selfUnref=!1,this.bindableArtboards=[],this.src=n.src,this.buffer=n.buffer,n.assetLoader&&(this.assetLoader=n.assetLoader),this.enableRiveAssetCDN=typeof n.enableRiveAssetCDN=="boolean"?n.enableRiveAssetCDN:!0,this.enablePerfMarks=!!n.enablePerfMarks,this.enablePerfMarks&&(Y.RuntimeLoader.enablePerfMarks=!0),this.eventManager=new Pe,n.onLoad&&this.on(M.Load,n.onLoad),n.onLoadError&&this.on(M.LoadError,n.onLoadError)}return a.prototype.releaseFile=function(){var n;this.selfUnref&&((n=this.file)===null||n===void 0||n.unref()),this.file=null},a.prototype.releaseBindableArtboards=function(){this.bindableArtboards.forEach(function(n){return n.destroy()})},a.prototype.initData=function(){return k(this,void 0,void 0,function(){var n,i,u,d,p,y;return E(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]),n=this,[4,Ct(this.src)];case 2:return n.buffer=S.sent(),[3,4];case 3:throw i=S.sent(),i instanceof Error?i:new c(a.fileLoadErrorMessage);case 4:return this.destroyed?[2]:(this.assetLoader&&(d=new I.CustomFileAssetLoaderWrapper(this.runtime,this.assetLoader),u=d.assetLoader),this.enablePerfMarks&&performance.mark("rive:file-load:start"),p=this,[4,this.runtime.load(new Uint8Array(this.buffer),u,this.enableRiveAssetCDN)]);case 5:return p.file=S.sent(),this.enablePerfMarks&&(performance.mark("rive:file-load:end"),performance.measure("rive:file-load","rive:file-load:start","rive:file-load:end")),y=new I.FileFinalizer(this.file),I.finalizationRegistry.register(this,y),this.destroyed?(this.releaseFile(),[2]):(this.file!==null?this.eventManager.fire({type:M.Load,data:this}):this.fireLoadError(a.fileLoadErrorMessage),[2])}})})},a.prototype.loadRiveFileBytes=function(){return k(this,void 0,void 0,function(){var n;return E(this,function(i){return this.enablePerfMarks&&performance.mark("rive:fetch-riv:start"),n=this.src?Ct(this.src):Promise.resolve(this.buffer),this.enablePerfMarks&&this.src&&n.then(function(){performance.mark("rive:fetch-riv:end"),performance.measure("rive:fetch-riv","rive:fetch-riv:start","rive:fetch-riv:end")}),[2,n]})})},a.prototype.loadRuntime=function(){return k(this,void 0,void 0,function(){var n;return E(this,function(i){return this.enablePerfMarks&&performance.mark("rive:await-wasm:start"),n=Y.RuntimeLoader.awaitInstance(),this.enablePerfMarks&&n.then(function(){performance.mark("rive:await-wasm:end"),performance.measure("rive:await-wasm","rive:await-wasm:start","rive:await-wasm:end")}),[2,n]})})},a.prototype.init=function(){return k(this,void 0,void 0,function(){var n,i,u,d;return E(this,function(p){switch(p.label){case 0:if(!this.src&&!this.buffer)return this.fireLoadError(a.missingErrorMessage),[2];p.label=1;case 1:return p.trys.push([1,4,,5]),[4,Promise.all([this.loadRiveFileBytes(),this.loadRuntime()])];case 2:return n=p.sent(),i=n[0],u=n[1],this.destroyed?[2]:(this.buffer=i,this.runtime=u,this.enablePerfMarks&&performance.mark("rive:init-data:start"),[4,this.initData()]);case 3:return p.sent(),this.enablePerfMarks&&(performance.mark("rive:init-data:end"),performance.measure("rive:init-data","rive:init-data:start","rive:init-data:end")),[3,5];case 4:return d=p.sent(),this.fireLoadError(d instanceof Error?d.message:a.fileLoadErrorMessage),[3,5];case 5:return[2]}})})},a.prototype.fireLoadError=function(n){throw this.eventManager.fire({type:M.LoadError,data:n}),new c(n)},a.prototype.on=function(n,i){this.eventManager.add({type:n,callback:i})},a.prototype.off=function(n,i){this.eventManager.remove({type:n,callback:i})},a.prototype.cleanup=function(){this.referenceCount-=1,this.referenceCount<=0&&(this.removeAllRiveEventListeners(),this.releaseFile(),this.releaseBindableArtboards(),this.destroyed=!0)},a.prototype.removeAllRiveEventListeners=function(n){this.eventManager.removeAll(n)},a.prototype.getInstance=function(){if(this.file!==null)return this.referenceCount+=1,this.file},a.prototype.destroyIfUnused=function(){this.referenceCount<=0&&this.cleanup()},a.prototype.createBindableArtboard=function(n){if(n!=null){var i=new L(n);return(0,I.createFinalization)(i,i.nativeArtboard),this.bindableArtboards.push(i),i}return null},a.prototype.getArtboard=function(n){var i=this.file.artboardByName(n);if(i!=null)return new ze(i,this)},a.prototype.getBindableArtboard=function(n){var i=this.file.bindableArtboardByName(n);return this.createBindableArtboard(i)},a.prototype.getDefaultBindableArtboard=function(){var n=this.file.bindableArtboardDefault();return this.createBindableArtboard(n)},a.prototype.internalBindableArtboardFromArtboard=function(n){var i=this.file.internalBindableArtboardFromArtboard(n);return this.createBindableArtboard(i)},a.prototype.viewModelByName=function(n){var i=this.file.viewModelByName(n);return i!==null?new Ge(i):null},a.missingErrorMessage="Rive source file or data buffer required",a.fileLoadErrorMessage="The file failed to load",a})(),U=(function(){function a(n){var i=this,u,d,p;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=ue.DrawOnChanged,this.enablePerfMarks=!1,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=!1,this.onCanvasResize=function(y){var S=i._hasZeroSize!==y;i._hasZeroSize=y,y?(!i._layout.maxX||!i._layout.maxY)&&i.resizeToCanvas():S&&i.resizeDrawingSurfaceToCanvas()},this.frameRequestId=null,this.renderSecondTimer=0,this._boundDraw=this.draw.bind(this),typeof document<"u"&&(this._pageVisibilityHandler=this._onPageVisibilityChange.bind(this),document.addEventListener("visibilitychange",this._pageVisibilityHandler)),this.canvas=n.canvas,n.canvas.constructor===HTMLCanvasElement&&(this._observed=Re.add(this.canvas,this.onCanvasResize)),this._currentCanvasWidth=this.canvas.width,this._currentCanvasHeight=this.canvas.height,this.src=n.src,this.buffer=n.buffer,this.riveFile=n.riveFile,this.layout=(u=n.layout)!==null&&u!==void 0?u:new le,this.shouldDisableRiveListeners=!!n.shouldDisableRiveListeners,this.isTouchScrollEnabled=!!n.isTouchScrollEnabled,this.automaticallyHandleEvents=!!n.automaticallyHandleEvents,this.dispatchPointerExit=n.dispatchPointerExit===!1?n.dispatchPointerExit:this.dispatchPointerExit,this.enableMultiTouch=!!n.enableMultiTouch,this.drawOptimization=(d=n.drawingOptions)!==null&&d!==void 0?d:this.drawOptimization,this.enableRiveAssetCDN=n.enableRiveAssetCDN===void 0?!0:n.enableRiveAssetCDN,this.enablePerfMarks=!!n.enablePerfMarks,this.enablePerfMarks&&(Y.RuntimeLoader.enablePerfMarks=!0),this._focusOptions=(p=n.focusOptions)!==null&&p!==void 0?p:this._focusOptions,this.eventManager=new Pe,n.onLoad&&this.on(M.Load,n.onLoad),n.onLoadError&&this.on(M.LoadError,n.onLoadError),n.onPlay&&this.on(M.Play,n.onPlay),n.onPause&&this.on(M.Pause,n.onPause),n.onStop&&this.on(M.Stop,n.onStop),n.onLoop&&this.on(M.Loop,n.onLoop),n.onStateChange&&this.on(M.StateChange,n.onStateChange),n.onAdvance&&this.on(M.Advance,n.onAdvance),n.onload&&!n.onLoad&&this.on(M.Load,n.onload),n.onloaderror&&!n.onLoadError&&this.on(M.LoadError,n.onloaderror),n.onplay&&!n.onPlay&&this.on(M.Play,n.onplay),n.onpause&&!n.onPause&&this.on(M.Pause,n.onpause),n.onstop&&!n.onStop&&this.on(M.Stop,n.onstop),n.onloop&&!n.onLoop&&this.on(M.Loop,n.onloop),n.onstatechange&&!n.onStateChange&&this.on(M.StateChange,n.onstatechange),n.assetLoader&&(this.assetLoader=n.assetLoader),this.taskQueue=new gt(this.eventManager),this.init({src:this.src,buffer:this.buffer,riveFile:this.riveFile,autoplay:n.autoplay,autoBind:n.autoBind,animations:n.animations,stateMachines:n.stateMachines,artboard:n.artboard,useOffscreenRenderer:n.useOffscreenRenderer,tabIndex:n.tabIndex})}return Object.defineProperty(a.prototype,"viewModelCount",{get:function(){return this.file.viewModelCount()},enumerable:!1,configurable:!0}),a.new=function(n){return console.warn("This function is deprecated: please use `new Rive({})` instead"),new a(n)},a.prototype.onSystemAudioChanged=function(){this.volume=this._volume},a.prototype.init=function(n){var i=this,u=n.src,d=n.buffer,p=n.riveFile,y=n.animations,S=n.stateMachines,V=n.artboard,O=n.autoplay,B=O===void 0?!1:O,me=n.useOffscreenRenderer,Me=me===void 0?!1:me,fe=n.autoBind,We=fe===void 0?!1:fe,Be=n.tabIndex;if(!this.destroyed){if(this.src=u,this.buffer=d,this.riveFile=p,this._tabIndex=Be??null,!this.src&&!this.buffer&&!this.riveFile)throw new c(a.missingErrorMessage);var Ze=Te(y),nt=Te(S);this.loaded=!1,this.readyForPlaying=!1,Y.RuntimeLoader.awaitInstance().then(function(Xe){if(!i.destroyed){i.runtime=Xe,i.removeRiveListeners(),i.deleteRiveRenderer(),i.enablePerfMarks&&performance.mark("rive:make-renderer:start");try{if(i.renderer=i.runtime.makeRenderer(i.canvas,Me),!i.renderer)throw new Error("Renderer is null, cannot render Rive on the canvas.")}catch(Oe){throw console.error(Oe),new c("Unable to create the renderer, your environment may not support WebGL. Try the @rive-app/canvas runtime as an alternative.")}i.enablePerfMarks&&(performance.mark("rive:make-renderer:end"),performance.measure("rive:make-renderer","rive:make-renderer:start","rive:make-renderer:end")),i.canvas.width||i.canvas.height||i.resizeDrawingSurfaceToCanvas(),i.initData(V,Ze,nt,B,We).then(function(Oe){if(Oe)return i.setupRiveListeners()}).catch(function(Oe){console.error(Oe)})}}).catch(function(Xe){i.eventManager.fire({type:M.LoadError,data:Xe.message})})}},a.prototype.setupRiveListeners=function(n){var i=this;if(this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),!this.shouldDisableRiveListeners){var u=this.animator.stateMachines.filter(function(B){return B.playing}),d=u.filter(function(B){return i.runtime.hasListeners(B.instance)}).map(function(B){return B.instance}),p=this.isTouchScrollEnabled,y=this.dispatchPointerExit,S=this.enableMultiTouch;n&&"isTouchScrollEnabled"in n&&(p=n.isTouchScrollEnabled),this.eventCleanup=(0,I.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:d,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:p,dispatchPointerExit:y,enableMultiTouch:S,layoutScaleFactor:this._layout.layoutScaleFactor,advanceAndDrain:this.advanceAndReportChanges.bind(this)});var V=u.filter(function(B){return B.hasFocusNodes});if(V.length){var O=this.canvas.tabIndex;(O===-1||isNaN(O))&&(this.canvas.tabIndex=this._tabIndex!==null?this._tabIndex:0),typeof window<"u"&&(this._keyboardInteractions=new I.KeyboardInteractions({canvas:this.canvas,stateMachine:V[0].instance,hasFocusNodes:!0}))}}},a.prototype.cleanupKeyboardInteractions=function(){this._keyboardInteractions&&(this._keyboardInteractions.cleanup(),this._keyboardInteractions=null)},a.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null),this.cleanupKeyboardInteractions()},a.prototype.initializeAudio=function(){var n=this,i;Ve.status==_e.UNAVAILABLE&&(this.file.hasAudio||!((i=this.artboard)===null||i===void 0)&&i.hasAudio&&this._audioEventListener===null)&&(this._audioEventListener={type:M.AudioStatusChange,callback:function(){return n.onSystemAudioChanged()}},Ve.add(this._audioEventListener),Ve.establishAudio())},a.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)},a.prototype.initData=function(n,i,u,d,p){return k(this,void 0,void 0,function(){var y,S,V,O;return E(this,function(B){switch(B.label){case 0:return B.trys.push([0,3,,4]),this.riveFile!=null?[3,2]:(y=new Ue({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader,enablePerfMarks:this.enablePerfMarks}),this.riveFile=y,[4,y.init()]);case 1:if(B.sent(),this.destroyed)return y.destroyIfUnused(),[2,!1];B.label=2;case 2:this.file=this.riveFile.getInstance(),this.initArtboard(n,i,u,d,p),this.initArtboardSize(),this.initializeAudio();try{this.loaded=!0,this.eventManager.fire({type:M.Load,data:(O=this.src)!==null&&O!==void 0?O:"buffer"})}catch(me){console.error(me)}return this.animator.advanceIfPaused(),this.readyForPlaying=!0,this.taskQueue.process(),this.drawFrame(),[2,!0];case 3:return S=B.sent(),V=z(S),this.eventManager.fire({type:M.LoadError,data:V}),[2,Promise.reject(V)];case 4:return[2]}})})},a.prototype.initArtboard=function(n,i,u,d,p){if(this.file){var y=n?this.file.artboardByName(n):this.file.defaultArtboard();if(!y)throw new c("Invalid artboard name or no default artboard");this.artboard=y,y.volume=this._volume*Ve.systemVolume,this.animator=new Z(this.runtime,this.artboard,this.eventManager);var S;if(i.length>0||u.length>0?(S=i.concat(u),this.animator.initLinearAnimations(i,d),this.animator.initStateMachines(u,d)):S=[this.animator.atLeastOne(d,!1)],this.taskQueue.add({event:{type:d?M.Play:M.Pause,data:S}}),p){var V=this.file.defaultArtboardViewModel(y);if(V!==null){var O=V.defaultInstance();if(O!==null){var B=new xe(O,null);(0,I.createFinalization)(B,B.runtimeInstance),this.bindViewModelInstance(B)}}}}},a.prototype.drawFrame=function(){var n,i;!((n=document?.timeline)===null||n===void 0)&&n.currentTime?this.loaded&&this.artboard&&!this.frameRequestId&&(this._boundDraw(document.timeline.currentTime),(i=this.runtime)===null||i===void 0||i.resolveAnimationFrame()):this.scheduleRendering()},a.prototype._canvasSizeChanged=function(){var n=!1;return this.canvas&&(this.canvas.width!==this._currentCanvasWidth&&(this._currentCanvasWidth=this.canvas.width,n=!0),this.canvas.height!==this._currentCanvasHeight&&(this._currentCanvasHeight=this.canvas.height,n=!0)),n},a.prototype.pollFocusState=function(){if(!this._keyboardInteractions){this._prevHasFocus=!1;return}var n=this.animator.stateMachines.find(function(u){return u.playing&&u.hasFocusNodes});if(!n){this._prevHasFocus=!1;return}if(this.canvas instanceof HTMLCanvasElement){var i=n.focusState().hasFocus;if(i){this._keyboardInteractions.notifyRiveFocused(),this._prevHasFocus||(this.canvas!==document.activeElement&&this._focusOptions.allowFocusInterrupt&&this.canvas.focus(),this._prevHasFocus=!0);return}this._prevHasFocus=!1,this._keyboardInteractions.focusSessionState===I.FocusSessionState.RiveFocused&&this._keyboardInteractions.setFocusSessionState(I.FocusSessionState.NotFocused)}},a.prototype.advanceAndReportChanges=function(n){for(var i,u=this.animator.animations.filter(function(Ne){return Ne.playing||Ne.needsScrub}).sort(function(Ne){return Ne.needsScrub?-1:1}),d=0,p=u;d<p.length;d++){var y=p[d];y.advance(n),y.instance.didLoop&&(y.loopCount+=1),y.apply(1)}for(var S=this.animator.stateMachines.filter(function(Ne){return Ne.playing}),V=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1,O=0,B=S;O<B.length;O++){var me=B[O],Me=me.reportedEventCount();if(Me)for(var fe=0;fe<Me;fe++){var We=me.reportedEventAt(fe);if(We)if(We.type===Fe.OpenUrl){if(this.eventManager.fire({type:M.RiveEvent,data:We}),this.automaticallyHandleEvents){var Be=document.createElement("a"),Ze=We,nt=Ze.url,Xe=Ze.target,Oe=(0,I.sanitizeUrl)(nt);nt&&Be.setAttribute("href",Oe),Xe&&Be.setAttribute("target",Xe),Oe&&Oe!==I.BLANK_URL&&Be.click()}}else this.eventManager.fire({type:M.RiveEvent,data:We})}V>=0&&performance.mark("rive:sm-advance:start:f".concat(V)),me.advanceAndApply(n),V>=0&&(performance.mark("rive:sm-advance:end:f".concat(V)),performance.measure("rive:sm-advance:f".concat(V),"rive:sm-advance:start:f".concat(V),"rive:sm-advance:end:f".concat(V)))}this.animator.stateMachines.length==0&&this.artboard.advance(n),this.animator.handleLooping(),this.animator.handleStateChanges(),this.animator.handleAdvancing(n),this.pollFocusState(),(i=this._viewModelInstance)===null||i===void 0||i.handleCallbacks()},a.prototype.draw=function(n,i){this.frameRequestId=null;var u=performance.now(),d=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1;this.lastRenderTime||(this.lastRenderTime=n),this.renderSecondTimer+=n-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,i?.());var p=(n-this.lastRenderTime)/1e3;this.lastRenderTime=n,this.advanceAndReportChanges(p);var y=this.renderer;this._hasZeroSize||(this.drawOptimization==ue.AlwaysDraw||this.artboard.didChange()||this._needsRedraw||this._canvasSizeChanged())&&(y.clear(),y.save(),d>=0&&performance.mark("rive:align-renderer:start:f".concat(d)),this.alignRenderer(),d>=0&&(performance.mark("rive:align-renderer:end:f".concat(d)),performance.measure("rive:align-renderer:f".concat(d),"rive:align-renderer:start:f".concat(d),"rive:align-renderer:end:f".concat(d))),d>=0&&performance.mark("rive:artboard-draw:start:f".concat(d)),this.artboard.draw(y),d>=0&&(performance.mark("rive:artboard-draw:end:f".concat(d)),performance.measure("rive:artboard-draw:f".concat(d),"rive:artboard-draw:start:f".concat(d),"rive:artboard-draw:end:f".concat(d))),y.restore(),d>=0&&performance.mark("rive:renderer-flush:start:f".concat(d)),y.flush(),d>=0&&(performance.mark("rive:renderer-flush:end:f".concat(d)),performance.measure("rive:renderer-flush:f".concat(d),"rive:renderer-flush:start:f".concat(d),"rive:renderer-flush:end:f".concat(d))),this._needsRedraw=!1),this.frameCount++;var S=performance.now();for(this.frameTimes.push(S),this.durations.push(S-u);this.frameTimes[0]<=S-1e3;)this.frameTimes.shift(),this.durations.shift();this.animator.isPlaying?this.scheduleRendering():this.animator.isPaused?this.lastRenderTime=0:this.animator.isStopped&&(this.lastRenderTime=0)},a.prototype.alignRenderer=function(){var n=this,i=n.renderer,u=n.runtime,d=n._layout,p=n.artboard;i.align(d.runtimeFit(u),d.runtimeAlignment(u),{minX:d.minX,minY:d.minY,maxX:d.maxX,maxY:d.maxY},p.bounds,this._devicePixelRatioUsed*d.layoutScaleFactor)},Object.defineProperty(a.prototype,"fps",{get:function(){return this.durations.length},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"frameTime",{get:function(){return this.durations.length===0?0:(this.durations.reduce(function(n,i){return n+i},0)/this.durations.length).toFixed(4)},enumerable:!1,configurable:!0}),a.prototype.cleanup=function(){var n,i,u,d;this.destroyed=!0,this.stopRendering(),(i=(n=this.renderer)===null||n===void 0?void 0:n.bindContext)===null||i===void 0||i.call(n),this.cleanupInstances(),this._observed!==null&&Re.remove(this._observed),this.removeRiveListeners(),this.file&&((u=this.riveFile)===null||u===void 0||u.cleanup(),this.file=null),this.riveFile=null,this.deleteRiveRenderer(),this._audioEventListener!==null&&(Ve.remove(this._audioEventListener),this._audioEventListener=null),this._pageVisibilityHandler&&(document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),(d=this._viewModelInstance)===null||d===void 0||d.cleanup(),this._viewModelInstance=null,this._dataEnums=null},a.prototype.deleteRiveRenderer=function(){var n;(n=this.renderer)===null||n===void 0||n.delete(),this.renderer=null},a.prototype.cleanupInstances=function(){this.eventCleanup!==null&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.stop(),this.artboard&&(this.artboard.delete(),this.artboard=null)},a.prototype.retrieveTextRun=function(n){var i;if(!n){console.warn("No text run name provided");return}if(!this.artboard){console.warn("Tried to access text run, but the Artboard is null");return}var u=this.artboard.textRun(n);if(!u){console.warn("Could not access a text run with name '".concat(n,"' in the '").concat((i=this.artboard)===null||i===void 0?void 0:i.name,"' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime."));return}return u},a.prototype.getTextRunValue=function(n){var i=this.retrieveTextRun(n);return i?i.text:void 0},a.prototype.setTextRunValue=function(n,i){var u=this.retrieveTextRun(n);u&&(u.text=i)},a.prototype.play=function(n,i){var u=this;if(n=Te(n),!this.readyForPlaying){this.taskQueue.add({action:function(){return u.play(n,i)}});return}this.animator.play(n),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.setupRiveListeners(),this.startRendering()},a.prototype.pause=function(n){var i=this;if(n=Te(n),!this.readyForPlaying){this.taskQueue.add({action:function(){return i.pause(n)}});return}this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.animator.pause(n)},a.prototype.scrub=function(n,i){var u=this;if(n=Te(n),!this.readyForPlaying){this.taskQueue.add({action:function(){return u.scrub(n,i)}});return}this.animator.scrub(n,i||0),this.drawFrame()},a.prototype.stop=function(n){var i=this;if(n=Te(n),!this.readyForPlaying){this.taskQueue.add({action:function(){return i.stop(n)}});return}this.animator&&this.animator.stop(n),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions()},a.prototype.reset=function(n){var i,u,d=n?.artboard,p=Te(n?.animations),y=Te(n?.stateMachines),S=(i=n?.autoplay)!==null&&i!==void 0?i:!1,V=(u=n?.autoBind)!==null&&u!==void 0?u:!1;this.cleanupInstances(),this.initArtboard(d,p,y,S,V),this.taskQueue.process()},a.prototype.load=function(n){this.file=null,this.stop(),this.init(n)},Object.defineProperty(a.prototype,"layout",{get:function(){return this._layout},set:function(n){this._layout=n,(!n.maxX||!n.maxY)&&this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame()},enumerable:!1,configurable:!0}),a.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height})},a.prototype.resizeDrawingSurfaceToCanvas=function(n){if(this.canvas instanceof HTMLCanvasElement&&window){var i=this.canvas.getBoundingClientRect(),u=i.width,d=i.height,p=n||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=p,this.canvas.width=p*u,this.canvas.height=p*d,this._needsRedraw=!0,this.resizeToCanvas(),this.drawFrame(),this.layout.fit===x.Layout){var y=this._layout.layoutScaleFactor;this.artboard.width=u/y,this.artboard.height=d/y}}},Object.defineProperty(a.prototype,"source",{get:function(){return this.src},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"animationNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var n=[],i=0;i<this.artboard.animationCount();i++)n.push(this.artboard.animationByIndex(i).name);return n},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"stateMachineNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var n=[],i=0;i<this.artboard.stateMachineCount();i++)n.push(this.artboard.stateMachineByIndex(i).name);return n},enumerable:!1,configurable:!0}),a.prototype.stateMachineInputs=function(n){if(this.loaded){var i=this.animator.stateMachines.find(function(u){return u.name===n});return i?.inputs}},a.prototype.retrieveInputAtPath=function(n,i){if(!n){console.warn("No input name provided for path '".concat(i,"'"));return}if(!this.artboard){console.warn("Tried to access input: '".concat(n,"', at path: '").concat(i,"', but the Artboard is null"));return}var u=this.artboard.inputByPath(n,i);if(!u){console.warn("Could not access an input with name: '".concat(n,"', at path:'").concat(i,"'"));return}return u},a.prototype.setBooleanStateAtPath=function(n,i,u){var d=this.retrieveInputAtPath(n,u);d&&(d.type===ie.Boolean?d.asBool().value=i:console.warn("Input with name: '".concat(n,"', at path:'").concat(u,"' is not a boolean")))},a.prototype.setNumberStateAtPath=function(n,i,u){var d=this.retrieveInputAtPath(n,u);d&&(d.type===ie.Number?d.asNumber().value=i:console.warn("Input with name: '".concat(n,"', at path:'").concat(u,"' is not a number")))},a.prototype.fireStateAtPath=function(n,i){var u=this.retrieveInputAtPath(n,i);u&&(u.type===ie.Trigger?u.asTrigger().fire():console.warn("Input with name: '".concat(n,"', at path:'").concat(i,"' is not a trigger")))},a.prototype.retrieveTextAtPath=function(n,i){if(!n){console.warn("No text name provided for path '".concat(i,"'"));return}if(!i){console.warn("No path provided for text '".concat(n,"'"));return}if(!this.artboard){console.warn("Tried to access text: '".concat(n,"', at path: '").concat(i,"', but the Artboard is null"));return}var u=this.artboard.textByPath(n,i);if(!u){console.warn("Could not access text with name: '".concat(n,"', at path:'").concat(i,"'"));return}return u},a.prototype.getTextRunValueAtPath=function(n,i){var u=this.retrieveTextAtPath(n,i);if(!u){console.warn("Could not get text with name: '".concat(n,"', at path:'").concat(i,"'"));return}return u.text},a.prototype.setTextRunValueAtPath=function(n,i,u){var d=this.retrieveTextAtPath(n,u);if(!d){console.warn("Could not set text with name: '".concat(n,"', at path:'").concat(u,"'"));return}d.text=i},Object.defineProperty(a.prototype,"playingStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(n){return n.playing}).map(function(n){return n.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"playingAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(n){return n.playing}).map(function(n){return n.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"pausedAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(n){return!n.playing}).map(function(n){return n.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"pausedStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(n){return!n.playing}).map(function(n){return n.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isPlaying",{get:function(){return this.animator.isPlaying},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isPaused",{get:function(){return this.animator.isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isStopped",{get:function(){var n,i;return(i=(n=this.animator)===null||n===void 0?void 0:n.isStopped)!==null&&i!==void 0?i:!0},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"bounds",{get:function(){return this.artboard?this.artboard.bounds:void 0},enumerable:!1,configurable:!0}),a.prototype.on=function(n,i){this.eventManager.add({type:n,callback:i})},a.prototype.off=function(n,i){this.eventManager.remove({type:n,callback:i})},a.prototype.unsubscribe=function(n,i){console.warn("This function is deprecated: please use `off()` instead."),this.off(n,i)},a.prototype.removeAllRiveEventListeners=function(n){this.eventManager.removeAll(n)},a.prototype.unsubscribeAll=function(n){console.warn("This function is deprecated: please use `removeAllRiveEventListeners()` instead."),this.removeAllRiveEventListeners(n)},a.prototype.stopRendering=function(){this._explicitlyStoppedRendering=!0,this.loaded&&this.frameRequestId&&(this.runtime.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null)},a.prototype.startRendering=function(){this._explicitlyStoppedRendering=!1,this.drawFrame()},a.prototype.scheduleRendering=function(){this.loaded&&this.artboard&&!this.frameRequestId&&(this.runtime.requestAnimationFrame?this.frameRequestId=this.runtime.requestAnimationFrame(this._boundDraw):this.frameRequestId=requestAnimationFrame(this._boundDraw))},a.prototype._onPageVisibilityChange=function(){var n,i;document.hidden?(this.frameRequestId!==null&&(!((n=this.runtime)===null||n===void 0)&&n.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null),this.lastRenderTime=0):!((i=this.animator)===null||i===void 0)&&i.isPlaying&&!this._explicitlyStoppedRendering&&this.scheduleRendering()},a.prototype.enableFPSCounter=function(n){this.runtime.enableFPSCounter(n)},a.prototype.disableFPSCounter=function(){this.runtime.disableFPSCounter()},Object.defineProperty(a.prototype,"contents",{get:function(){if(this.loaded){for(var n={artboards:[]},i=0;i<this.file.artboardCount();i++){for(var u=this.file.artboardByIndex(i),d={name:u.name,animations:[],stateMachines:[]},p=0;p<u.animationCount();p++){var y=u.animationByIndex(p);d.animations.push(y.name)}for(var S=0;S<u.stateMachineCount();S++){for(var V=u.stateMachineByIndex(S),O=V.name,B=new this.runtime.StateMachineInstance(V,u),me=[],Me=0;Me<B.inputCount();Me++){var fe=B.input(Me);me.push({name:fe.name,type:fe.type})}d.stateMachines.push({name:O,inputs:me})}n.artboards.push(d)}return n}},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"volume",{get:function(){return this.artboard&&this.artboard.volume!==this._volume&&(this._volume=this.artboard.volume),this._volume},set:function(n){this._volume=n,this.artboard&&(this.artboard.volume=n*Ve.systemVolume)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"artboardWidth",{get:function(){var n;return this.artboard?this.artboard.width:(n=this._artboardWidth)!==null&&n!==void 0?n:0},set:function(n){this._artboardWidth=n,this.artboard&&(this.artboard.width=n)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"artboardHeight",{get:function(){var n;return this.artboard?this.artboard.height:(n=this._artboardHeight)!==null&&n!==void 0?n:0},set:function(n){this._artboardHeight=n,this.artboard&&(this.artboard.height=n)},enumerable:!1,configurable:!0}),a.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(a.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(n){this._devicePixelRatioUsed=n},enumerable:!1,configurable:!0}),a.prototype.bindViewModelInstance=function(n){var i;this.artboard&&!this.destroyed&&n&&n.runtimeInstance&&(n.internalIncrementReferenceCount(),(i=this._viewModelInstance)===null||i===void 0||i.cleanup(),this._viewModelInstance=n,this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(u){return u.bindViewModelInstance(n)}):this.artboard.bindViewModelInstance(n.runtimeInstance))},Object.defineProperty(a.prototype,"viewModelInstance",{get:function(){return this._viewModelInstance},enumerable:!1,configurable:!0}),a.prototype.viewModelByIndex=function(n){var i=this.file.viewModelByIndex(n);return i!==null?new Ge(i):null},a.prototype.viewModelByName=function(n){var i;return(i=this.riveFile)===null||i===void 0?void 0:i.viewModelByName(n)},a.prototype.enums=function(){if(this._dataEnums===null){var n=this.file.enums();this._dataEnums=n.map(function(i){return new tt(i)})}return this._dataEnums},a.prototype.defaultViewModel=function(){if(this.artboard){var n=this.file.defaultArtboardViewModel(this.artboard);if(n)return new Ge(n)}return null},a.prototype.getArtboard=function(n){var i,u;return(u=(i=this.riveFile)===null||i===void 0?void 0:i.getArtboard(n))!==null&&u!==void 0?u:null},a.prototype.getBindableArtboard=function(n){var i,u;return(u=(i=this.riveFile)===null||i===void 0?void 0:i.getBindableArtboard(n))!==null&&u!==void 0?u:null},a.prototype.getDefaultBindableArtboard=function(){var n,i;return(i=(n=this.riveFile)===null||n===void 0?void 0:n.getDefaultBindableArtboard())!==null&&i!==void 0?i:null},a.prototype.clearFocus=function(){var n=this.animator.stateMachines.filter(function(i){return i.playing&&i.hasFocusNodes});n.forEach(function(i){return i.clearFocus()})},a.missingErrorMessage="Rive source file or data buffer required",a.cleanupErrorMessage="Attempt to use file after calling cleanup.",a})(),J;(function(a){a.none="none",a.string="string",a.number="number",a.boolean="boolean",a.color="color",a.list="list",a.enumType="enumType",a.trigger="trigger",a.viewModel="viewModel",a.integer="integer",a.listIndex="listIndex",a.image="image",a.artboard="artboard"})(J||(J={}));var Ge=(function(){function a(n){this._viewModel=n}return Object.defineProperty(a.prototype,"instanceCount",{get:function(){return this._viewModel.instanceCount},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"name",{get:function(){return this._viewModel.name},enumerable:!1,configurable:!0}),a.prototype.instanceByIndex=function(n){var i=this._viewModel.instanceByIndex(n);if(i!==null){var u=new xe(i,null);return(0,I.createFinalization)(u,i),u}return null},a.prototype.instanceByName=function(n){var i=this._viewModel.instanceByName(n);if(i!==null){var u=new xe(i,null);return(0,I.createFinalization)(u,i),u}return null},a.prototype.defaultInstance=function(){var n=this._viewModel.defaultInstance();if(n!==null){var i=new xe(n,null);return(0,I.createFinalization)(i,n),i}return null},a.prototype.instance=function(){var n=this._viewModel.instance();if(n!==null){var i=new xe(n,null);return(0,I.createFinalization)(i,n),i}return null},Object.defineProperty(a.prototype,"properties",{get:function(){return this._viewModel.getProperties()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"instanceNames",{get:function(){return this._viewModel.getInstanceNames()},enumerable:!1,configurable:!0}),a})(),tt=(function(){function a(n){this._dataEnum=n}return Object.defineProperty(a.prototype,"name",{get:function(){return this._dataEnum.name},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"values",{get:function(){return this._dataEnum.values},enumerable:!1,configurable:!0}),a})(),ge;(function(a){a.Number="number",a.String="string",a.Boolean="boolean",a.Color="color",a.Trigger="trigger",a.Enum="enum",a.List="list",a.Image="image",a.Artboard="artboard"})(ge||(ge={}));var xe=(function(){function a(n,i){this._parents=[],this._children=[],this._viewModelInstances=new Map,this._propertiesWithCallbacks=[],this._referenceCount=0,this.selfUnref=!1,this._runtimeInstance=n,i!==null&&this._parents.push(i)}return Object.defineProperty(a.prototype,"runtimeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"nativeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),a.prototype.handleCallbacks=function(){this._propertiesWithCallbacks.length!==0&&(this._propertiesWithCallbacks.forEach(function(n){n.handleCallbacks()}),this._propertiesWithCallbacks.forEach(function(n){n.clearChanges()})),this._children.forEach(function(n){return n.handleCallbacks()})},a.prototype.addParent=function(n){this._parents.includes(n)||(this._parents.push(n),(this._propertiesWithCallbacks.length>0||this._children.length>0)&&n.addToViewModelCallbacks(this))},a.prototype.removeParent=function(n){var i=this._parents.indexOf(n);if(i!==-1){var u=this._parents[i];u.removeFromViewModelCallbacks(this),this._parents.splice(i,1)}},a.prototype.addToPropertyCallbacks=function(n){var i=this;this._propertiesWithCallbacks.includes(n)||(this._propertiesWithCallbacks.push(n),this._propertiesWithCallbacks.length>0&&this._parents.forEach(function(u){u.addToViewModelCallbacks(i)}))},a.prototype.removeFromPropertyCallbacks=function(n){var i=this;this._propertiesWithCallbacks.includes(n)&&(this._propertiesWithCallbacks=this._propertiesWithCallbacks.filter(function(u){return u!==n}),this._children.length===0&&this._propertiesWithCallbacks.length===0&&this._parents.forEach(function(u){u.removeFromViewModelCallbacks(i)}))},a.prototype.addToViewModelCallbacks=function(n){var i=this;this._children.includes(n)||(this._children.push(n),this._parents.forEach(function(u){u.addToViewModelCallbacks(i)}))},a.prototype.removeFromViewModelCallbacks=function(n){var i=this;this._children.includes(n)&&(this._children=this._children.filter(function(u){return u!==n}),this._children.length===0&&this._propertiesWithCallbacks.length===0&&this._parents.forEach(function(u){u.removeFromViewModelCallbacks(i)}))},a.prototype.clearCallbacks=function(){this._propertiesWithCallbacks.forEach(function(n){n.clearCallbacks()})},a.prototype.propertyFromPath=function(n,i){var u=n.split("/");return this.propertyFromPathSegments(u,0,i)},a.prototype.viewModelFromPathSegments=function(n,i){var u=this.internalViewModelInstance(n[i]);return u!==null?i==n.length-1?u:u.viewModelFromPathSegments(n,i++):null},a.prototype.propertyFromPathSegments=function(n,i,u){var d,p,y,S,V,O,B,me,Me,fe,We,Be,Ze,nt,Xe,Oe,Ne,X;if(i<n.length-1){var Qt=this.internalViewModelInstance(n[i]);return Qt!==null?Qt.propertyFromPathSegments(n,i+1,u):null}var ce=null;switch(u){case ge.Number:if(ce=(p=(d=this._runtimeInstance)===null||d===void 0?void 0:d.number(n[i]))!==null&&p!==void 0?p:null,ce!==null)return new Tt(ce,this);break;case ge.String:if(ce=(S=(y=this._runtimeInstance)===null||y===void 0?void 0:y.string(n[i]))!==null&&S!==void 0?S:null,ce!==null)return new Le(ce,this);break;case ge.Boolean:if(ce=(O=(V=this._runtimeInstance)===null||V===void 0?void 0:V.boolean(n[i]))!==null&&O!==void 0?O:null,ce!==null)return new De(ce,this);break;case ge.Color:if(ce=(me=(B=this._runtimeInstance)===null||B===void 0?void 0:B.color(n[i]))!==null&&me!==void 0?me:null,ce!==null)return new yt(ce,this);break;case ge.Trigger:if(ce=(fe=(Me=this._runtimeInstance)===null||Me===void 0?void 0:Me.trigger(n[i]))!==null&&fe!==void 0?fe:null,ce!==null)return new Ke(ce,this);break;case ge.Enum:if(ce=(Be=(We=this._runtimeInstance)===null||We===void 0?void 0:We.enum(n[i]))!==null&&Be!==void 0?Be:null,ce!==null)return new ut(ce,this);break;case ge.List:if(ce=(nt=(Ze=this._runtimeInstance)===null||Ze===void 0?void 0:Ze.list(n[i]))!==null&&nt!==void 0?nt:null,ce!==null)return new lt(ce,this);break;case ge.Image:if(ce=(Oe=(Xe=this._runtimeInstance)===null||Xe===void 0?void 0:Xe.image(n[i]))!==null&&Oe!==void 0?Oe:null,ce!==null)return new wt(ce,this);break;case ge.Artboard:if(ce=(X=(Ne=this._runtimeInstance)===null||Ne===void 0?void 0:Ne.artboard(n[i]))!==null&&X!==void 0?X:null,ce!==null)return new ct(ce,this);break}return null},a.prototype.internalViewModelInstance=function(n){var i;if(this._viewModelInstances.has(n))return this._viewModelInstances.get(n);var u=(i=this._runtimeInstance)===null||i===void 0?void 0:i.viewModel(n);if(u!==null){var d=new a(u,this);return(0,I.createFinalization)(d,u),d.internalIncrementReferenceCount(),this._viewModelInstances.set(n,d),d}return null},a.prototype.number=function(n){var i=this.propertyFromPath(n,ge.Number);return i},a.prototype.string=function(n){var i=this.propertyFromPath(n,ge.String);return i},a.prototype.boolean=function(n){var i=this.propertyFromPath(n,ge.Boolean);return i},a.prototype.color=function(n){var i=this.propertyFromPath(n,ge.Color);return i},a.prototype.trigger=function(n){var i=this.propertyFromPath(n,ge.Trigger);return i},a.prototype.enum=function(n){var i=this.propertyFromPath(n,ge.Enum);return i},a.prototype.list=function(n){var i=this.propertyFromPath(n,ge.List);return i},a.prototype.image=function(n){var i=this.propertyFromPath(n,ge.Image);return i},a.prototype.artboard=function(n){var i=this.propertyFromPath(n,ge.Artboard);return i},a.prototype.viewModel=function(n){var i=n.split("/"),u=i.length>1?this.viewModelFromPathSegments(i.slice(0,i.length-1),0):this;return u!=null?u.internalViewModelInstance(i[i.length-1]):null},a.prototype.internalReplaceViewModel=function(n,i){var u;if(i.runtimeInstance!==null){var d=((u=this._runtimeInstance)===null||u===void 0?void 0:u.replaceViewModel(n,i.runtimeInstance))||!1;if(d){i.internalIncrementReferenceCount();var p=this.internalViewModelInstance(n);p!==null&&(p.removeParent(this),this._children.includes(p)&&(this._children=this._children.filter(function(y){return y!==p})),p.cleanup()),this._viewModelInstances.set(n,i),i.addParent(this)}return d}return!1},a.prototype.replaceViewModel=function(n,i){var u,d=n.split("/"),p=d.length>1?this.viewModelFromPathSegments(d.slice(0,d.length-1),0):this;return(u=p?.internalReplaceViewModel(d[d.length-1],i))!==null&&u!==void 0?u:!1},a.prototype.incrementReferenceCount=function(){var n;this._referenceCount++,(n=this._runtimeInstance)===null||n===void 0||n.incrementReferenceCount()},a.prototype.decrementReferenceCount=function(){var n;this._referenceCount--,(n=this._runtimeInstance)===null||n===void 0||n.decrementReferenceCount()},Object.defineProperty(a.prototype,"properties",{get:function(){var n;return((n=this._runtimeInstance)===null||n===void 0?void 0:n.getProperties().map(function(i){return se({},i)}))||[]},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"viewModelName",{get:function(){var n,i;return(i=(n=this._runtimeInstance)===null||n===void 0?void 0:n.getViewModelName())!==null&&i!==void 0?i:""},enumerable:!1,configurable:!0}),a.prototype.internalIncrementReferenceCount=function(){this._referenceCount++},a.prototype.cleanup=function(){var n=this,i;if(this._referenceCount--,this._referenceCount<=0){this.selfUnref&&((i=this._runtimeInstance)===null||i===void 0||i.unref()),this._runtimeInstance=null,this.clearCallbacks(),this._propertiesWithCallbacks=[],this._viewModelInstances.forEach(function(p){p.cleanup()}),this._viewModelInstances.clear();var u=w([],this._children,!0);this._children.length=0;var d=w([],this._parents,!0);this._parents.length=0,u.forEach(function(p){p.removeParent(n)}),d.forEach(function(p){p.removeFromViewModelCallbacks(n)})}},a})(),Ee=(function(){function a(n,i){this.callbacks=[],this._viewModelInstanceValue=n,this._parentViewModel=i}return a.prototype.on=function(n){this.callbacks.length===0&&this._viewModelInstanceValue.clearChanges(),this.callbacks.includes(n)||(this.callbacks.push(n),this._parentViewModel.addToPropertyCallbacks(this))},a.prototype.off=function(n){n?this.callbacks=this.callbacks.filter(function(i){return i!==n}):this.callbacks.length=0,this.callbacks.length===0&&this._parentViewModel.removeFromPropertyCallbacks(this)},a.prototype.internalHandleCallback=function(n){},a.prototype.handleCallbacks=function(){var n=this;this._viewModelInstanceValue.hasChanged&&this.callbacks.forEach(function(i){n.internalHandleCallback(i)})},a.prototype.clearChanges=function(){this._viewModelInstanceValue.clearChanges()},a.prototype.clearCallbacks=function(){this.callbacks.length=0},Object.defineProperty(a.prototype,"name",{get:function(){return this._viewModelInstanceValue.name},enumerable:!1,configurable:!0}),a})(),Le=(function(a){N(n,a);function n(i,u){return a.call(this,i,u)||this}return Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(i){this._viewModelInstanceValue.value=i},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(i){i(this.value)},n})(Ee),Tt=(function(a){N(n,a);function n(i,u){return a.call(this,i,u)||this}return Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(i){this._viewModelInstanceValue.value=i},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(i){i(this.value)},n})(Ee),De=(function(a){N(n,a);function n(i,u){return a.call(this,i,u)||this}return Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(i){this._viewModelInstanceValue.value=i},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(i){i(this.value)},n})(Ee),Ke=(function(a){N(n,a);function n(i,u){return a.call(this,i,u)||this}return n.prototype.trigger=function(){return this._viewModelInstanceValue.trigger()},n.prototype.internalHandleCallback=function(i){i()},n})(Ee),ut=(function(a){N(n,a);function n(i,u){return a.call(this,i,u)||this}return Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(i){this._viewModelInstanceValue.value=i},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"valueIndex",{get:function(){return this._viewModelInstanceValue.valueIndex},set:function(i){this._viewModelInstanceValue.valueIndex=i},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this._viewModelInstanceValue.values},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(i){i(this.value)},n})(Ee),lt=(function(a){N(n,a);function n(i,u){return a.call(this,i,u)||this}return Object.defineProperty(n.prototype,"length",{get:function(){return this._viewModelInstanceValue.size},enumerable:!1,configurable:!0}),n.prototype.addInstance=function(i){i.runtimeInstance!=null&&(this._viewModelInstanceValue.addInstance(i.runtimeInstance),i.addParent(this._parentViewModel))},n.prototype.addInstanceAt=function(i,u){return i.runtimeInstance!=null&&this._viewModelInstanceValue.addInstanceAt(i.runtimeInstance,u)?(i.addParent(this._parentViewModel),!0):!1},n.prototype.removeInstance=function(i){i.runtimeInstance!=null&&(this._viewModelInstanceValue.removeInstance(i.runtimeInstance),i.removeParent(this._parentViewModel))},n.prototype.removeInstanceAt=function(i){this._viewModelInstanceValue.removeInstanceAt(i)},n.prototype.instanceAt=function(i){var u=this._viewModelInstanceValue.instanceAt(i);if(u!=null){var d=new xe(u,this._parentViewModel);return(0,I.createFinalization)(d,u),d}return null},n.prototype.swap=function(i,u){this._viewModelInstanceValue.swap(i,u)},n.prototype.internalHandleCallback=function(i){i()},n})(Ee),yt=(function(a){N(n,a);function n(i,u){return a.call(this,i,u)||this}return Object.defineProperty(n.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(i){this._viewModelInstanceValue.value=i},enumerable:!1,configurable:!0}),n.prototype.rgb=function(i,u,d){this._viewModelInstanceValue.rgb(i,u,d)},n.prototype.rgba=function(i,u,d,p){this._viewModelInstanceValue.argb(p,i,u,d)},n.prototype.argb=function(i,u,d,p){this._viewModelInstanceValue.argb(i,u,d,p)},n.prototype.alpha=function(i){this._viewModelInstanceValue.alpha(i)},n.prototype.opacity=function(i){this._viewModelInstanceValue.alpha(Math.round(Math.max(0,Math.min(1,i))*255))},n.prototype.internalHandleCallback=function(i){i(this.value)},n})(Ee),wt=(function(a){N(n,a);function n(i,u){return a.call(this,i,u)||this}return Object.defineProperty(n.prototype,"value",{set:function(i){var u;this._viewModelInstanceValue.value((u=i?.nativeImage)!==null&&u!==void 0?u:null)},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(i){i()},n})(Ee),ct=(function(a){N(n,a);function n(i,u){return a.call(this,i,u)||this}return Object.defineProperty(n.prototype,"value",{set:function(i){var u,d,p;i.isBindableArtboard?p=i:p=i.file.internalBindableArtboardFromArtboard(i.nativeArtboard),this._viewModelInstanceValue.value((u=p?.nativeArtboard)!==null&&u!==void 0?u:null),p?.nativeViewModel&&this._viewModelInstanceValue.viewModelInstance((d=p?.nativeViewModel)!==null&&d!==void 0?d:null)},enumerable:!1,configurable:!0}),n.prototype.internalHandleCallback=function(i){i()},n})(Ee),Ct=function(a){return k(void 0,void 0,void 0,function(){var n,i,u;return E(this,function(d){switch(d.label){case 0:return n=new Request(a),[4,fetch(n)];case 1:if(i=d.sent(),!i.ok)throw new Error("Failed to fetch the Rive file: HTTP ".concat(i.status));return[4,i.arrayBuffer()];case 2:return u=d.sent(),[2,u]}})})},Te=function(a){return typeof a=="string"?[a]:a instanceof Array?a:[]},Mt={EventManager:Pe,TaskQueueManager:gt},Je=function(a){return k(void 0,void 0,void 0,function(){var n,i,u;return E(this,function(d){switch(d.label){case 0:return n=new Promise(function(p){return Y.RuntimeLoader.getInstance(function(y){y.decodeAudio(a,p)})}),[4,n];case 1:return i=d.sent(),u=new I.AudioWrapper(i),I.finalizationRegistry.register(u,i),[2,u]}})})},ye=function(a){return k(void 0,void 0,void 0,function(){var n,i,u;return E(this,function(d){switch(d.label){case 0:return n=new Promise(function(p){return Y.RuntimeLoader.getInstance(function(y){y.decodeImage(a,p)})}),[4,n];case 1:return i=d.sent(),u=new I.ImageWrapper(i),I.finalizationRegistry.register(u,i),[2,u]}})})},ae=function(a){return k(void 0,void 0,void 0,function(){var n,i,u;return E(this,function(d){switch(d.label){case 0:return n=new Promise(function(p){return Y.RuntimeLoader.getInstance(function(y){y.decodeFont(a,p)})}),[4,n];case 1:return i=d.sent(),u=new I.FontWrapper(i),I.finalizationRegistry.register(u,i),[2,u]}})})}})(),_t})())})(gn)),gn.exports}var Lr=gi();const yi=vi(Lr),bi=pi({__proto__:null,default:yi},[Lr]);export{bi as r};
|