@thorvg/lottie-player 1.0.0-pre.2 → 1.0.0-pre.3

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.
@@ -1,4 +1,4 @@
1
- const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),n=new WeakMap;let o=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const r=this.t;if(t&&void 0===e){const t=void 0!==r&&1===r.length;t&&(e=n.get(r)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&n.set(r,e))}return e}toString(){return this.cssText}};const a=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return(e=>new o("string"==typeof e?e:e+"",void 0,r))(t)})(e):e,{is:i,defineProperty:s,getOwnPropertyDescriptor:l,getOwnPropertyNames:u,getOwnPropertySymbols:c,getPrototypeOf:d}=Object,h=globalThis,m=h.trustedTypes,p=m?m.emptyScript:"",f=h.reactiveElementPolyfillSupport,g=(e,t)=>e,v={toAttribute(e,t){switch(t){case Boolean:e=e?p:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(e){r=null}}return r}},y=(e,t)=>!i(e,t),w={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),h.litPropertyMetadata??=new WeakMap;class b extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=w){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(e,r,t);void 0!==n&&s(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:o}=l(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return n?.call(this)},set(t){const a=n?.call(this);o.call(this,t),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??w}static _$Ei(){if(this.hasOwnProperty(g("elementProperties")))return;const e=d(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(g("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(g("properties"))){const e=this.properties,t=[...u(e),...c(e)];for(const r of t)this.createProperty(r,e[r])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,r]of t)this.elementProperties.set(e,r)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const r=this._$Eu(e,t);void 0!==r&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const e of r)t.unshift(a(e))}else void 0!==e&&t.push(a(e));return t}static _$Eu(e,t){const r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((r,n)=>{if(t)r.adoptedStyleSheets=n.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const t of n){const n=document.createElement("style"),o=e.litNonce;void 0!==o&&n.setAttribute("nonce",o),n.textContent=t.cssText,r.appendChild(n)}})(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EC(e,t){const r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(void 0!==n&&!0===r.reflect){const o=(void 0!==r.converter?.toAttribute?r.converter:v).toAttribute(t,r.type);this._$Em=e,null==o?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(e,t){const r=this.constructor,n=r._$Eh.get(e);if(void 0!==n&&this._$Em!==n){const e=r.getPropertyOptions(n),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:v;this._$Em=n,this[n]=o.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,r){if(void 0!==e){if(r??=this.constructor.getPropertyOptions(e),!(r.hasChanged??y)(this[e],t))return;this.P(e,t,r)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,r){this._$AL.has(e)||this._$AL.set(e,t),!0===r.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,r]of e)!0!==r.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],r)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[g("elementProperties")]=new Map,b[g("finalized")]=new Map,f?.({ReactiveElement:b}),(h.reactiveElementVersions??=[]).push("2.0.4");const _=globalThis,E=_.trustedTypes,S=E?E.createPolicy("lit-html",{createHTML:e=>e}):void 0,$="$lit$",C=`lit$${Math.random().toFixed(9).slice(2)}$`,P="?"+C,x=`<${P}>`,k=document,T=()=>k.createComment(""),A=e=>null===e||"object"!=typeof e&&"function"!=typeof e,D=Array.isArray,F="[ \t\n\f\r]",B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,M=/-->/g,R=/>/g,O=RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),U=/'/g,L=/"/g,j=/^(?:script|style|textarea|title)$/i,z=(e=>(t,...r)=>({_$litType$:e,strings:t,values:r}))(1),N=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),V=new WeakMap,W=k.createTreeWalker(k,129);function G(e,t){if(!D(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==S?S.createHTML(t):t}class H{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let o=0,a=0;const i=e.length-1,s=this.parts,[l,u]=((e,t)=>{const r=e.length-1,n=[];let o,a=2===t?"<svg>":3===t?"<math>":"",i=B;for(let t=0;t<r;t++){const r=e[t];let s,l,u=-1,c=0;for(;c<r.length&&(i.lastIndex=c,l=i.exec(r),null!==l);)c=i.lastIndex,i===B?"!--"===l[1]?i=M:void 0!==l[1]?i=R:void 0!==l[2]?(j.test(l[2])&&(o=RegExp("</"+l[2],"g")),i=O):void 0!==l[3]&&(i=O):i===O?">"===l[0]?(i=o??B,u=-1):void 0===l[1]?u=-2:(u=i.lastIndex-l[2].length,s=l[1],i=void 0===l[3]?O:'"'===l[3]?L:U):i===L||i===U?i=O:i===M||i===R?i=B:(i=O,o=void 0);const d=i===O&&e[t+1].startsWith("/>")?" ":"";a+=i===B?r+x:u>=0?(n.push(s),r.slice(0,u)+$+r.slice(u)+C+d):r+C+(-2===u?t:d)}return[G(e,a+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),n]})(e,t);if(this.el=H.createElement(l,r),W.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=W.nextNode())&&s.length<i;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith($)){const t=u[a++],r=n.getAttribute(e).split(C),i=/([.?@])?(.*)/.exec(t);s.push({type:1,index:o,name:i[2],strings:r,ctor:"."===i[1]?K:"?"===i[1]?Z:"@"===i[1]?Y:J}),n.removeAttribute(e)}else e.startsWith(C)&&(s.push({type:6,index:o}),n.removeAttribute(e));if(j.test(n.tagName)){const e=n.textContent.split(C),t=e.length-1;if(t>0){n.textContent=E?E.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],T()),W.nextNode(),s.push({type:2,index:++o});n.append(e[t],T())}}}else if(8===n.nodeType)if(n.data===P)s.push({type:2,index:o});else{let e=-1;for(;-1!==(e=n.data.indexOf(C,e+1));)s.push({type:7,index:o}),e+=C.length-1}o++}}static createElement(e,t){const r=k.createElement("template");return r.innerHTML=e,r}}function q(e,t,r=e,n){if(t===N)return t;let o=void 0!==n?r.o?.[n]:r.l;const a=A(t)?void 0:t._$litDirective$;return o?.constructor!==a&&(o?._$AO?.(!1),void 0===a?o=void 0:(o=new a(e),o._$AT(e,r,n)),void 0!==n?(r.o??=[])[n]=o:r.l=o),void 0!==o&&(t=q(e,o._$AS(e,t.values),o,n)),t}class Q{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:r}=this._$AD,n=(e?.creationScope??k).importNode(t,!0);W.currentNode=n;let o=W.nextNode(),a=0,i=0,s=r[0];for(;void 0!==s;){if(a===s.index){let t;2===s.type?t=new X(o,o.nextSibling,this,e):1===s.type?t=new s.ctor(o,s.name,s.strings,this,e):6===s.type&&(t=new ee(o,this,e)),this._$AV.push(t),s=r[++i]}a!==s?.index&&(o=W.nextNode(),a++)}return W.currentNode=k,n}p(e){let t=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}class X{get _$AU(){return this._$AM?._$AU??this.v}constructor(e,t,r,n){this.type=2,this._$AH=I,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this.v=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=q(this,e,t),A(e)?e===I||null==e||""===e?(this._$AH!==I&&this._$AR(),this._$AH=I):e!==this._$AH&&e!==N&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>D(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==I&&A(this._$AH)?this._$AA.nextSibling.data=e:this.T(k.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:r}=e,n="number"==typeof r?this._$AC(e):(void 0===r.el&&(r.el=H.createElement(G(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{const e=new Q(n,this),r=e.u(this.options);e.p(t),this.T(r),this._$AH=e}}_$AC(e){let t=V.get(e.strings);return void 0===t&&V.set(e.strings,t=new H(e)),t}k(e){D(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,n=0;for(const o of e)n===t.length?t.push(r=new X(this.O(T()),this.O(T()),this,this.options)):r=t[n],r._$AI(o),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this.v=e,this._$AP?.(e))}}class J{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,o){this.type=1,this._$AH=I,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=o,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=I}_$AI(e,t=this,r,n){const o=this.strings;let a=!1;if(void 0===o)e=q(this,e,t,0),a=!A(e)||e!==this._$AH&&e!==N,a&&(this._$AH=e);else{const n=e;let i,s;for(e=o[0],i=0;i<o.length-1;i++)s=q(this,n[r+i],t,i),s===N&&(s=this._$AH[i]),a||=!A(s)||s!==this._$AH[i],s===I?e=I:e!==I&&(e+=(s??"")+o[i+1]),this._$AH[i]=s}a&&!n&&this.j(e)}j(e){e===I?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class K extends J{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===I?void 0:e}}class Z extends J{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==I)}}class Y extends J{constructor(e,t,r,n,o){super(e,t,r,n,o),this.type=5}_$AI(e,t=this){if((e=q(this,e,t,0)??I)===N)return;const r=this._$AH,n=e===I&&r!==I||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==I&&(r===I||n);n&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class ee{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){q(this,e)}}const te=_.litHtmlPolyfillSupport;te?.(H,X),(_.litHtmlVersions??=[]).push("3.2.0");class re extends b{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=((e,t,r)=>{const n=r?.renderBefore??t;let o=n._$litPart$;if(void 0===o){const e=r?.renderBefore??null;n._$litPart$=o=new X(t.insertBefore(T(),e),e,void 0,r??{})}return o._$AI(e),o})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return N}}re._$litElement$=!0,re.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:re});const ne=globalThis.litElementPolyfillSupport;ne?.({LitElement:re}),(globalThis.litElementVersions??=[]).push("4.1.0");const oe={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y},ae=(e=oe,t,r)=>{const{kind:n,metadata:o}=r;let a=globalThis.litPropertyMetadata.get(o);if(void 0===a&&globalThis.litPropertyMetadata.set(o,a=new Map),a.set(r.name,e),"accessor"===n){const{name:n}=r;return{set(r){const o=t.get.call(this);t.set.call(this,r),this.requestUpdate(n,o,e)},init(t){return void 0!==t&&this.P(n,void 0,e),t}}}if("setter"===n){const{name:n}=r;return function(r){const o=this[n];t.call(this,r),this.requestUpdate(n,o,e)}}throw Error("Unsupported decorator location: "+n)};function ie(e){return(t,r)=>"object"==typeof r?ae(e,t,r):((e,t,r)=>{const n=t.hasOwnProperty(r);return t.constructor.createProperty(r,n?{...e,wrapped:!0}:e),n?Object.getOwnPropertyDescriptor(t,r):void 0})(e,t,r)}for(var se,le=[],ue=0;ue<256;++ue)le.push((ue+256).toString(16).slice(1));var ce=new Uint8Array(16);function de(){if(!se&&!(se="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return se(ce)}var he={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function me(e,t,r){if(he.randomUUID&&!t&&!e)return he.randomUUID();var n=(e=e||{}).random||(e.rng||de)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e,t=0){return(le[e[t+0]]+le[e[t+1]]+le[e[t+2]]+le[e[t+3]]+"-"+le[e[t+4]]+le[e[t+5]]+"-"+le[e[t+6]]+le[e[t+7]]+"-"+le[e[t+8]]+le[e[t+9]]+"-"+le[e[t+10]]+le[e[t+11]]+le[e[t+12]]+le[e[t+13]]+le[e[t+14]]+le[e[t+15]]).toLowerCase()}(n)}var pe,fe=(pe=import.meta.url,async function(e={}){var t,r,n=e,o=new Promise(((e,n)=>{t=e,r=n})),a="object"==typeof window,i="function"==typeof importScripts,s="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(s){const{createRequire:e}=await Promise.resolve().then((function(){return Fe}));var l=e(import.meta.url)}var u,c,d=Object.assign({},n),h="./this.program",m=(e,t)=>{throw t},p="";if(s){var f=l("fs"),g=l("path");p=l("url").fileURLToPath(new URL("./",import.meta.url)),c=e=>(e=W(e)?new URL(e):g.normalize(e),f.readFileSync(e)),u=(e,t=!0)=>(e=W(e)?new URL(e):g.normalize(e),new Promise(((r,n)=>{f.readFile(e,t?void 0:"utf8",((e,o)=>{e?n(e):r(t?o.buffer:o)}))}))),!n.thisProgram&&process.argv.length>1&&(h=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),m=(e,t)=>{throw process.exitCode=e,t}}else(a||i)&&(i?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),pe&&(p=pe),p=p.startsWith("blob:")?"":p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1),i&&(c=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),u=e=>W(e)?new Promise(((t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r(n.status)},n.onerror=r,n.send(null)})):fetch(e,{credentials:"same-origin"}).then((e=>e.ok?e.arrayBuffer():Promise.reject(new Error(e.status+" : "+e.url)))));var v=n.print||console.log.bind(console),y=n.printErr||console.error.bind(console);Object.assign(n,d),d=null,n.arguments&&n.arguments,n.thisProgram&&(h=n.thisProgram);var w,b,_,E,S,$,C,P,x,k,T=n.wasmBinary,A=!1;function D(){var e=w.buffer;n.HEAP8=_=new Int8Array(e),n.HEAP16=S=new Int16Array(e),n.HEAPU8=E=new Uint8Array(e),n.HEAPU16=$=new Uint16Array(e),n.HEAP32=C=new Int32Array(e),n.HEAPU32=P=new Uint32Array(e),n.HEAPF32=x=new Float32Array(e),n.HEAPF64=k=new Float64Array(e)}var F=[],B=[],M=[],R=0,O=null;function U(e){R++,n.monitorRunDependencies?.(R)}function L(e){if(R--,n.monitorRunDependencies?.(R),0==R&&O){var t=O;O=null,t()}}function j(e){n.onAbort?.(e),y(e="Aborted("+e+")"),A=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw r(t),t}var z,N,I,V=e=>e.startsWith("data:application/octet-stream;base64,"),W=e=>e.startsWith("file://");function G(){if(n.locateFile){var e="thorvg-wasm.wasm";return V(e)?e:(t=e,n.locateFile?n.locateFile(t,p):p+t)}var t;return new URL("thorvg-wasm.wasm",import.meta.url).href}function H(e){if(e==z&&T)return new Uint8Array(T);if(c)return c(e);throw"both async and sync fetching of the wasm failed"}function q(e,t,r){return function(e){return T?Promise.resolve().then((()=>H(e))):u(e).then((e=>new Uint8Array(e)),(()=>H(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then(r,(e=>{y(`failed to asynchronously prepare wasm: ${e}`),j(e)}))}function Q(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var X=e=>{for(;e.length>0;)e.shift()(n)},J=n.noExitRuntime||!0,K=e=>pr(e),Z=()=>gr(),Y="undefined"!=typeof TextDecoder?new TextDecoder:void 0,ee=(e,t,r)=>{for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&Y)return Y.decode(e.subarray(t,o));for(var a="";t<o;){var i=e[t++];if(128&i){var s=63&e[t++];if(192!=(224&i)){var l=63&e[t++];if((i=224==(240&i)?(15&i)<<12|s<<6|l:(7&i)<<18|s<<12|l<<6|63&e[t++])<65536)a+=String.fromCharCode(i);else{var u=i-65536;a+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},te=(e,t)=>e?ee(E,e,t):"";function re(){var e=C[+Se.varargs>>2];return Se.varargs+=4,e}var ne=re,oe={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=oe.isAbs(e),r="/"===e.substr(-1);return e=oe.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"),e||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=oe.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=oe.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:(...e)=>oe.normalize(e.join("/")),join2:(e,t)=>oe.normalize(e+"/"+t)},ae=e=>(ae=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(s)try{var e=l("crypto");if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch(e){}j("initRandomDevice")})())(e),ie={resolve:(...e)=>{for(var t="",r=!1,n=e.length-1;n>=-1&&!r;n--){var o=n>=0?e[n]:Ee.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";t=o+"/"+t,r=oe.isAbs(o)}return t=oe.normalizeArray(t.split("/").filter((e=>!!e)),!r).join("/"),(r?"/":"")+t||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=ie.resolve(e).substr(1),t=ie.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var l=[];for(s=i;s<n.length;s++)l.push("..");return(l=l.concat(o.slice(i))).join("/")}},se=[],le=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},ue=(e,t,r,n)=>{if(!(n>0))return 0;for(var o=r,a=r+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(r>=a)break;t[r++]=s}else if(s<=2047){if(r+1>=a)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=a)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=a)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o};function ce(e,t,r){var n=le(e)+1,o=new Array(n),a=ue(e,o,0,o.length);return o.length=a,o}var de,he,me,fe={ttys:[],init(){},shutdown(){},register(e,t){fe.ttys[e]={input:[],output:[],ops:t},Ee.registerDevice(e,fe.stream_ops)},stream_ops:{open(e){var t=fe.ttys[e.node.rdev];if(!t)throw new Ee.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new Ee.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Ee.ErrnoError(29)}if(void 0===s&&0===a)throw new Ee.ErrnoError(6);if(null==s)break;a++,t[r+i]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new Ee.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,t[r+a])}catch(e){throw new Ee.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!se.length){var e=null;if(s){var t=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=f.readSync(n,t,0,256)}catch(e){if(!e.toString().includes("EOF"))throw e;r=0}r>0&&(e=t.slice(0,r).toString("utf-8"))}else"undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(e=window.prompt("Input: "))&&(e+="\n");if(!e)return null;se=ce(e)}return se.shift()})(),put_char(e,t){null===t||10===t?(v(ee(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(v(ee(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[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]}),ioctl_tcsets:(e,t,r)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(y(ee(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(y(ee(e.output,0)),e.output=[])}}},ge=e=>{j()},ve={ops_table:null,mount:e=>ve.createNode(null,"/",16895,0),createNode(e,t,r,n){if(Ee.isBlkdev(r)||Ee.isFIFO(r))throw new Ee.ErrnoError(63);ve.ops_table||={dir:{node:{getattr:ve.node_ops.getattr,setattr:ve.node_ops.setattr,lookup:ve.node_ops.lookup,mknod:ve.node_ops.mknod,rename:ve.node_ops.rename,unlink:ve.node_ops.unlink,rmdir:ve.node_ops.rmdir,readdir:ve.node_ops.readdir,symlink:ve.node_ops.symlink},stream:{llseek:ve.stream_ops.llseek}},file:{node:{getattr:ve.node_ops.getattr,setattr:ve.node_ops.setattr},stream:{llseek:ve.stream_ops.llseek,read:ve.stream_ops.read,write:ve.stream_ops.write,allocate:ve.stream_ops.allocate,mmap:ve.stream_ops.mmap,msync:ve.stream_ops.msync}},link:{node:{getattr:ve.node_ops.getattr,setattr:ve.node_ops.setattr,readlink:ve.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ve.node_ops.getattr,setattr:ve.node_ops.setattr},stream:Ee.chrdev_stream_ops}};var o=Ee.createNode(e,t,r,n);return Ee.isDir(o.mode)?(o.node_ops=ve.ops_table.dir.node,o.stream_ops=ve.ops_table.dir.stream,o.contents={}):Ee.isFile(o.mode)?(o.node_ops=ve.ops_table.file.node,o.stream_ops=ve.ops_table.file.stream,o.usedBytes=0,o.contents=null):Ee.isLink(o.mode)?(o.node_ops=ve.ops_table.link.node,o.stream_ops=ve.ops_table.link.stream):Ee.isChrdev(o.mode)&&(o.node_ops=ve.ops_table.chrdev.node,o.stream_ops=ve.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=Ee.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Ee.isDir(e.mode)?t.size=4096:Ee.isFile(e.mode)?t.size=e.usedBytes:Ee.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&ve.resizeFileStorage(e,t.size)},lookup(e,t){throw Ee.genericErrors[44]},mknod:(e,t,r,n)=>ve.createNode(e,t,r,n),rename(e,t,r){if(Ee.isDir(e.mode)){var n;try{n=Ee.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Ee.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=Ee.lookupNode(e,t);for(var n in r.contents)throw new Ee.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r of Object.keys(e.contents))t.push(r);return t},symlink(e,t,r){var n=ve.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!Ee.isLink(e.mode))throw new Ee.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)t.set(a.subarray(o,o+i),r);else for(var s=0;s<i;s++)t[r+s]=a[o+s];return i},write(e,t,r,n,o,a){if(t.buffer===_.buffer&&(a=!1),!n)return 0;var i=e.node;if(i.timestamp=Date.now(),t.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=t.subarray(r,r+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=t.slice(r,r+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(t.subarray(r,r+n),o),n}if(ve.expandFileStorage(i,o+n),i.contents.subarray&&t.subarray)i.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=t[r+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&Ee.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Ee.ErrnoError(28);return n},allocate(e,t,r){ve.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,n,o){if(!Ee.isFile(e.node.mode))throw new Ee.ErrnoError(43);var a,i,s=e.node.contents;if(2&o||!s||s.buffer!==_.buffer){if(i=!0,!(a=ge()))throw new Ee.ErrnoError(48);s&&((r>0||r+t<s.length)&&(s=s.subarray?s.subarray(r,r+t):Array.prototype.slice.call(s,r,r+t)),_.set(s,a))}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(e,t,r,n,o)=>(ve.stream_ops.write(e,t,0,n,r,!1),0)}},ye=(e,t,r,n,o,a)=>{Ee.createDataFile(e,t,r,n,o,a)},we=n.preloadPlugins||[],be=(e,t,r,n,o,a,i,s,l,c)=>{var d=t?ie.resolve(oe.join2(e,t)):e;function h(r){function u(r){c?.(),s||ye(e,t,r,n,o,l),a?.(),L()}((e,t,r,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return we.forEach((a=>{o||a.canHandle(t)&&(a.handle(e,t,r,n),o=!0)})),o})(r,d,u,(()=>{i?.(),L()}))||u(r)}U(),"string"==typeof r?((e,t,r)=>{var n=`al ${e}`;u(e).then((e=>{t(new Uint8Array(e)),n&&L()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),n&&U()})(r,h,i):h(r)},_e=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},Ee={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Ee.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return Ee.isDir(this.mode)}get isDevice(){return Ee.isChrdev(this.mode)}},lookupPath(e,t={}){if(!(e=ie.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Ee.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=Ee.root,o="/",a=0;a<r.length;a++){var i=a===r.length-1;if(i&&t.parent)break;if(n=Ee.lookupNode(n,r[a]),o=oe.join2(o,r[a]),Ee.isMountpoint(n)&&(!i||i&&t.follow_mount)&&(n=n.mounted.root),!i||t.follow)for(var s=0;Ee.isLink(n.mode);){var l=Ee.readlink(o);if(o=ie.resolve(oe.dirname(o),l),n=Ee.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Ee.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var t;;){if(Ee.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Ee.nameTable.length},hashAddNode(e){var t=Ee.hashName(e.parent.id,e.name);e.name_next=Ee.nameTable[t],Ee.nameTable[t]=e},hashRemoveNode(e){var t=Ee.hashName(e.parent.id,e.name);if(Ee.nameTable[t]===e)Ee.nameTable[t]=e.name_next;else for(var r=Ee.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=Ee.mayLookup(e);if(r)throw new Ee.ErrnoError(r);for(var n=Ee.hashName(e.id,t),o=Ee.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===t)return o}return Ee.lookup(e,t)},createNode(e,t,r,n){var o=new Ee.FSNode(e,t,r,n);return Ee.hashAddNode(o),o},destroyNode(e){Ee.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>Ee.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup(e){if(!Ee.isDir(e.mode))return 54;var t=Ee.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{return Ee.lookupNode(e,t),20}catch(e){}return Ee.nodePermissions(e,"wx")},mayDelete(e,t,r){var n;try{n=Ee.lookupNode(e,t)}catch(e){return e.errno}var o=Ee.nodePermissions(e,"wx");if(o)return o;if(r){if(!Ee.isDir(n.mode))return 54;if(Ee.isRoot(n)||Ee.getPath(n)===Ee.cwd())return 10}else if(Ee.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Ee.isLink(e.mode)?32:Ee.isDir(e.mode)&&("r"!==Ee.flagsToPermissionString(t)||512&t)?31:Ee.nodePermissions(e,Ee.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=Ee.MAX_OPEN_FDS;e++)if(!Ee.streams[e])return e;throw new Ee.ErrnoError(33)},getStreamChecked(e){var t=Ee.getStream(e);if(!t)throw new Ee.ErrnoError(8);return t},getStream:e=>Ee.streams[e],createStream:(e,t=-1)=>(e=Object.assign(new Ee.FSStream,e),-1==t&&(t=Ee.nextfd()),e.fd=t,Ee.streams[t]=e,e),closeStream(e){Ee.streams[e]=null},dupStream(e,t=-1){var r=Ee.createStream(e,t);return r.stream_ops?.dup?.(r),r},chrdev_stream_ops:{open(e){var t=Ee.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new Ee.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){Ee.devices[e]={stream_ops:t}},getDevice:e=>Ee.devices[e],getMounts(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push(...n.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),Ee.syncFSRequests++,Ee.syncFSRequests>1&&y(`warning: ${Ee.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Ee.getMounts(Ee.root.mount),n=0;function o(e){return Ee.syncFSRequests--,t(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((t=>{if(!t.type.syncfs)return a(null);t.type.syncfs(t,e,a)}))},mount(e,t,r){var n,o="/"===r,a=!r;if(o&&Ee.root)throw new Ee.ErrnoError(10);if(!o&&!a){var i=Ee.lookupPath(r,{follow_mount:!1});if(r=i.path,n=i.node,Ee.isMountpoint(n))throw new Ee.ErrnoError(10);if(!Ee.isDir(n.mode))throw new Ee.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,o?Ee.root=l:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),l},unmount(e){var t=Ee.lookupPath(e,{follow_mount:!1});if(!Ee.isMountpoint(t.node))throw new Ee.ErrnoError(28);var r=t.node,n=r.mounted,o=Ee.getMounts(n);Object.keys(Ee.nameTable).forEach((e=>{for(var t=Ee.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Ee.destroyNode(t),t=r}})),r.mounted=null;var a=r.mount.mounts.indexOf(n);r.mount.mounts.splice(a,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,r){var n=Ee.lookupPath(e,{parent:!0}).node,o=oe.basename(e);if(!o||"."===o||".."===o)throw new Ee.ErrnoError(28);var a=Ee.mayCreate(n,o);if(a)throw new Ee.ErrnoError(a);if(!n.node_ops.mknod)throw new Ee.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Ee.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Ee.mknod(e,t,0)),mkdirTree(e,t){for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{Ee.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,Ee.mknod(e,t,r)),symlink(e,t){if(!ie.resolve(e))throw new Ee.ErrnoError(44);var r=Ee.lookupPath(t,{parent:!0}).node;if(!r)throw new Ee.ErrnoError(44);var n=oe.basename(t),o=Ee.mayCreate(r,n);if(o)throw new Ee.ErrnoError(o);if(!r.node_ops.symlink)throw new Ee.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename(e,t){var r,n,o=oe.dirname(e),a=oe.dirname(t),i=oe.basename(e),s=oe.basename(t);if(r=Ee.lookupPath(e,{parent:!0}).node,n=Ee.lookupPath(t,{parent:!0}).node,!r||!n)throw new Ee.ErrnoError(44);if(r.mount!==n.mount)throw new Ee.ErrnoError(75);var l,u=Ee.lookupNode(r,i),c=ie.relative(e,a);if("."!==c.charAt(0))throw new Ee.ErrnoError(28);if("."!==(c=ie.relative(t,o)).charAt(0))throw new Ee.ErrnoError(55);try{l=Ee.lookupNode(n,s)}catch(e){}if(u!==l){var d=Ee.isDir(u.mode),h=Ee.mayDelete(r,i,d);if(h)throw new Ee.ErrnoError(h);if(h=l?Ee.mayDelete(n,s,d):Ee.mayCreate(n,s))throw new Ee.ErrnoError(h);if(!r.node_ops.rename)throw new Ee.ErrnoError(63);if(Ee.isMountpoint(u)||l&&Ee.isMountpoint(l))throw new Ee.ErrnoError(10);if(n!==r&&(h=Ee.nodePermissions(r,"w")))throw new Ee.ErrnoError(h);Ee.hashRemoveNode(u);try{r.node_ops.rename(u,n,s),u.parent=n}catch(e){throw e}finally{Ee.hashAddNode(u)}}},rmdir(e){var t=Ee.lookupPath(e,{parent:!0}).node,r=oe.basename(e),n=Ee.lookupNode(t,r),o=Ee.mayDelete(t,r,!0);if(o)throw new Ee.ErrnoError(o);if(!t.node_ops.rmdir)throw new Ee.ErrnoError(63);if(Ee.isMountpoint(n))throw new Ee.ErrnoError(10);t.node_ops.rmdir(t,r),Ee.destroyNode(n)},readdir(e){var t=Ee.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Ee.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=Ee.lookupPath(e,{parent:!0}).node;if(!t)throw new Ee.ErrnoError(44);var r=oe.basename(e),n=Ee.lookupNode(t,r),o=Ee.mayDelete(t,r,!1);if(o)throw new Ee.ErrnoError(o);if(!t.node_ops.unlink)throw new Ee.ErrnoError(63);if(Ee.isMountpoint(n))throw new Ee.ErrnoError(10);t.node_ops.unlink(t,r),Ee.destroyNode(n)},readlink(e){var t=Ee.lookupPath(e).node;if(!t)throw new Ee.ErrnoError(44);if(!t.node_ops.readlink)throw new Ee.ErrnoError(28);return ie.resolve(Ee.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var r=Ee.lookupPath(e,{follow:!t}).node;if(!r)throw new Ee.ErrnoError(44);if(!r.node_ops.getattr)throw new Ee.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Ee.stat(e,!0),chmod(e,t,r){var n;if(!(n="string"==typeof e?Ee.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Ee.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod(e,t){Ee.chmod(e,t,!0)},fchmod(e,t){var r=Ee.getStreamChecked(e);Ee.chmod(r.node,t)},chown(e,t,r,n){var o;if(!(o="string"==typeof e?Ee.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Ee.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,t,r){Ee.chown(e,t,r,!0)},fchown(e,t,r){var n=Ee.getStreamChecked(e);Ee.chown(n.node,t,r)},truncate(e,t){if(t<0)throw new Ee.ErrnoError(28);var r;if(!(r="string"==typeof e?Ee.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Ee.ErrnoError(63);if(Ee.isDir(r.mode))throw new Ee.ErrnoError(31);if(!Ee.isFile(r.mode))throw new Ee.ErrnoError(28);var n=Ee.nodePermissions(r,"w");if(n)throw new Ee.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=Ee.getStreamChecked(e);if(!(2097155&r.flags))throw new Ee.ErrnoError(28);Ee.truncate(r.node,t)},utime(e,t,r){var n=Ee.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open(e,t,r){if(""===e)throw new Ee.ErrnoError(44);var o;if(r=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&(r=void 0===r?438:r)|32768:0,"object"==typeof e)o=e;else{e=oe.normalize(e);try{o=Ee.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var a=!1;if(64&t)if(o){if(128&t)throw new Ee.ErrnoError(20)}else o=Ee.mknod(e,r,0),a=!0;if(!o)throw new Ee.ErrnoError(44);if(Ee.isChrdev(o.mode)&&(t&=-513),65536&t&&!Ee.isDir(o.mode))throw new Ee.ErrnoError(54);if(!a){var i=Ee.mayOpen(o,t);if(i)throw new Ee.ErrnoError(i)}512&t&&!a&&Ee.truncate(o,0),t&=-131713;var s=Ee.createStream({node:o,path:Ee.getPath(o),flags:t,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!n.logReadFiles||1&t||(Ee.readFiles||(Ee.readFiles={}),e in Ee.readFiles||(Ee.readFiles[e]=1)),s},close(e){if(Ee.isClosed(e))throw new Ee.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Ee.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,r){if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Ee.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Ee.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,n,o){if(n<0||o<0)throw new Ee.ErrnoError(28);if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(1==(2097155&e.flags))throw new Ee.ErrnoError(8);if(Ee.isDir(e.node.mode))throw new Ee.ErrnoError(31);if(!e.stream_ops.read)throw new Ee.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new Ee.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,t,r,n,o);return a||(e.position+=i),i},write(e,t,r,n,o,a){if(n<0||o<0)throw new Ee.ErrnoError(28);if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(!(2097155&e.flags))throw new Ee.ErrnoError(8);if(Ee.isDir(e.node.mode))throw new Ee.ErrnoError(31);if(!e.stream_ops.write)throw new Ee.ErrnoError(28);e.seekable&&1024&e.flags&&Ee.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new Ee.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,a);return i||(e.position+=s),s},allocate(e,t,r){if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(t<0||r<=0)throw new Ee.ErrnoError(28);if(!(2097155&e.flags))throw new Ee.ErrnoError(8);if(!Ee.isFile(e.node.mode)&&!Ee.isDir(e.node.mode))throw new Ee.ErrnoError(43);if(!e.stream_ops.allocate)throw new Ee.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,n,o){if(2&n&&!(2&o)&&2!=(2097155&e.flags))throw new Ee.ErrnoError(2);if(1==(2097155&e.flags))throw new Ee.ErrnoError(2);if(!e.stream_ops.mmap)throw new Ee.ErrnoError(43);if(!t)throw new Ee.ErrnoError(28);return e.stream_ops.mmap(e,t,r,n,o)},msync:(e,t,r,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new Ee.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var r,n=Ee.open(e,t.flags),o=Ee.stat(e).size,a=new Uint8Array(o);return Ee.read(n,a,0,o,0),"utf8"===t.encoding?r=ee(a,0):"binary"===t.encoding&&(r=a),Ee.close(n),r},writeFile(e,t,r={}){r.flags=r.flags||577;var n=Ee.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(le(t)+1),a=ue(t,o,0,o.length);Ee.write(n,o,0,a,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Ee.write(n,t,0,t.byteLength,void 0,r.canOwn)}Ee.close(n)},cwd:()=>Ee.currentPath,chdir(e){var t=Ee.lookupPath(e,{follow:!0});if(null===t.node)throw new Ee.ErrnoError(44);if(!Ee.isDir(t.node.mode))throw new Ee.ErrnoError(54);var r=Ee.nodePermissions(t.node,"x");if(r)throw new Ee.ErrnoError(r);Ee.currentPath=t.path},createDefaultDirectories(){Ee.mkdir("/tmp"),Ee.mkdir("/home"),Ee.mkdir("/home/web_user")},createDefaultDevices(){Ee.mkdir("/dev"),Ee.registerDevice(Ee.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),Ee.mkdev("/dev/null",Ee.makedev(1,3)),fe.register(Ee.makedev(5,0),fe.default_tty_ops),fe.register(Ee.makedev(6,0),fe.default_tty1_ops),Ee.mkdev("/dev/tty",Ee.makedev(5,0)),Ee.mkdev("/dev/tty1",Ee.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=ae(e).byteLength),e[--t]);Ee.createDevice("/dev","random",r),Ee.createDevice("/dev","urandom",r),Ee.mkdir("/dev/shm"),Ee.mkdir("/dev/shm/tmp")},createSpecialDirectories(){Ee.mkdir("/proc");var e=Ee.mkdir("/proc/self");Ee.mkdir("/proc/self/fd"),Ee.mount({mount(){var t=Ee.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var r=+t,n=Ee.getStreamChecked(r),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams(e,t,r){e?Ee.createDevice("/dev","stdin",e):Ee.symlink("/dev/tty","/dev/stdin"),t?Ee.createDevice("/dev","stdout",null,t):Ee.symlink("/dev/tty","/dev/stdout"),r?Ee.createDevice("/dev","stderr",null,r):Ee.symlink("/dev/tty1","/dev/stderr"),Ee.open("/dev/stdin",0),Ee.open("/dev/stdout",1),Ee.open("/dev/stderr",1)},staticInit(){[44].forEach((e=>{Ee.genericErrors[e]=new Ee.ErrnoError(e),Ee.genericErrors[e].stack="<generic error, no stack>"})),Ee.nameTable=new Array(4096),Ee.mount(ve,{},"/"),Ee.createDefaultDirectories(),Ee.createDefaultDevices(),Ee.createSpecialDirectories(),Ee.filesystems={MEMFS:ve}},init(e,t,r){Ee.initialized=!0,e??=n.stdin,t??=n.stdout,r??=n.stderr,Ee.createStandardStreams(e,t,r)},quit(){Ee.initialized=!1;for(var e=0;e<Ee.streams.length;e++){var t=Ee.streams[e];t&&Ee.close(t)}},findObject(e,t){var r=Ee.analyzePath(e,t);return r.exists?r.object:null},analyzePath(e,t){try{e=(n=Ee.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Ee.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=oe.basename(e),n=Ee.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath(e,t,r,n){e="string"==typeof e?e:Ee.getPath(e);for(var o=t.split("/").reverse();o.length;){var a=o.pop();if(a){var i=oe.join2(e,a);try{Ee.mkdir(i)}catch(e){}e=i}}return i},createFile(e,t,r,n,o){var a=oe.join2("string"==typeof e?e:Ee.getPath(e),t),i=_e(n,o);return Ee.create(a,i)},createDataFile(e,t,r,n,o,a){var i=t;e&&(e="string"==typeof e?e:Ee.getPath(e),i=t?oe.join2(e,t):e);var s=_e(n,o),l=Ee.create(i,s);if(r){if("string"==typeof r){for(var u=new Array(r.length),c=0,d=r.length;c<d;++c)u[c]=r.charCodeAt(c);r=u}Ee.chmod(l,146|s);var h=Ee.open(l,577);Ee.write(h,r,0,r.length,0,a),Ee.close(h),Ee.chmod(l,s)}},createDevice(e,t,r,n){var o=oe.join2("string"==typeof e?e:Ee.getPath(e),t),a=_e(!!r,!!n);Ee.createDevice.major||(Ee.createDevice.major=64);var i=Ee.makedev(Ee.createDevice.major++,0);return Ee.registerDevice(i,{open(e){e.seekable=!1},close(e){n?.buffer?.length&&n(10)},read(e,t,n,o,a){for(var i=0,s=0;s<o;s++){var l;try{l=r()}catch(e){throw new Ee.ErrnoError(29)}if(void 0===l&&0===i)throw new Ee.ErrnoError(6);if(null==l)break;i++,t[n+s]=l}return i&&(e.node.timestamp=Date.now()),i},write(e,t,r,o,a){for(var i=0;i<o;i++)try{n(t[r+i])}catch(e){throw new Ee.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),Ee.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{e.contents=c(e.url),e.usedBytes=e.contents.length}catch(e){throw new Ee.ErrnoError(29)}},createLazyFile(e,t,r,n,o){class a{constructor(){this.lengthKnown=!1,this.chunks=[]}get(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}}setDataGetter(e){this.getter=e}cacheLength(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,i=1048576;o||(i=n);var s=this;s.setDataGetter((e=>{var t=e*i,o=(e+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ce(o.responseText||"")})(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,v("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if("undefined"!=typeof XMLHttpRequest){if(!i)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s={isDevice:!1,contents:new a}}else s={isDevice:!1,url:r};var l=Ee.createFile(e,t,s,n,o);s.contents?l.contents=s.contents:s.url&&(l.contents=null,l.url=s.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var u={};function c(e,t,r,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)t[r+s]=a[o+s];else for(s=0;s<i;s++)t[r+s]=a.get(o+s);return i}return Object.keys(l.stream_ops).forEach((e=>{var t=l.stream_ops[e];u[e]=(...e)=>(Ee.forceLoadFile(l),t(...e))})),u.read=(e,t,r,n,o)=>(Ee.forceLoadFile(l),c(e,t,r,n,o)),u.mmap=(e,t,r,n,o)=>{Ee.forceLoadFile(l);var a=ge();if(!a)throw new Ee.ErrnoError(48);return c(e,_,a,t,r),{ptr:a,allocated:!0}},l.stream_ops=u,l}},Se={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(oe.isAbs(t))return t;var n;if(n=-100===e?Ee.cwd():Se.getStreamFromFD(e).path,0==t.length){if(!r)throw new Ee.ErrnoError(44);return n}return oe.join2(n,t)},doStat(e,t,r){var n=e(t);C[r>>2]=n.dev,C[r+4>>2]=n.mode,P[r+8>>2]=n.nlink,C[r+12>>2]=n.uid,C[r+16>>2]=n.gid,C[r+20>>2]=n.rdev,I=[n.size>>>0,(N=n.size,+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],C[r+24>>2]=I[0],C[r+28>>2]=I[1],C[r+32>>2]=4096,C[r+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return I=[Math.floor(o/1e3)>>>0,(N=Math.floor(o/1e3),+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],C[r+40>>2]=I[0],C[r+44>>2]=I[1],P[r+48>>2]=o%1e3*1e3*1e3,I=[Math.floor(a/1e3)>>>0,(N=Math.floor(a/1e3),+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],C[r+56>>2]=I[0],C[r+60>>2]=I[1],P[r+64>>2]=a%1e3*1e3*1e3,I=[Math.floor(i/1e3)>>>0,(N=Math.floor(i/1e3),+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],C[r+72>>2]=I[0],C[r+76>>2]=I[1],P[r+80>>2]=i%1e3*1e3*1e3,I=[n.ino>>>0,(N=n.ino,+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],C[r+88>>2]=I[0],C[r+92>>2]=I[1],0},doMsync(e,t,r,n,o){if(!Ee.isFile(t.node.mode))throw new Ee.ErrnoError(43);if(2&n)return 0;var a=E.slice(e,e+r);Ee.msync(t,a,o,r,n)},getStreamFromFD:e=>Ee.getStreamChecked(e),varargs:void 0,getStr:e=>te(e)},$e=e=>{for(var t="",r=e;E[r];)t+=de[E[r++]];return t},Ce={},Pe={},xe={},ke=e=>{throw new he(e)},Te=e=>{throw new me(e)},Ae=(e,t,r)=>{function n(t){var n=r(t);n.length!==e.length&&Te("Mismatched type converter count");for(var o=0;o<e.length;++o)De(e[o],n[o])}e.forEach((e=>xe[e]=t));var o=new Array(t.length),a=[],i=0;t.forEach(((e,t)=>{Pe.hasOwnProperty(e)?o[t]=Pe[e]:(a.push(e),Ce.hasOwnProperty(e)||(Ce[e]=[]),Ce[e].push((()=>{o[t]=Pe[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)};function De(e,t,r={}){return function(e,t,r={}){var n=t.name;if(e||ke(`type "${n}" must have a positive integer typeid pointer`),Pe.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;ke(`Cannot register type '${n}' twice`)}if(Pe[e]=t,delete xe[e],Ce.hasOwnProperty(e)){var o=Ce[e];delete Ce[e],o.forEach((e=>e()))}}(e,t,r)}var Be,Me=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Re=e=>{ke(e.$$.ptrType.registeredClass.name+" instance already deleted")},Oe=!1,Ue=e=>{},Le=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},je=(e,t,r)=>{if(t===r)return e;if(void 0===r.baseClass)return null;var n=je(e,t,r.baseClass);return null===n?null:r.downcast(n)},ze={},Ne=()=>Object.keys(He).length,Ie=()=>{var e=[];for(var t in He)He.hasOwnProperty(t)&&e.push(He[t]);return e},Ve=[],We=()=>{for(;Ve.length;){var e=Ve.pop();e.$$.deleteScheduled=!1,e.delete()}},Ge=e=>{Be=e,Ve.length&&Be&&Be(We)},He={},qe=(e,t)=>(t=((e,t)=>{for(void 0===t&&ke("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),He[t]),Qe=(e,t)=>(t.ptrType&&t.ptr||Te("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Te("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Je(Object.create(e,{$$:{value:t,writable:!0}})));function Xe(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=qe(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?Qe(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Qe(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,i=this.registeredClass.getActualType(t),s=ze[i];if(!s)return o.call(this);a=this.isConst?s.constPointerType:s.pointerType;var l=je(t,this.registeredClass,a.registeredClass);return null===l?o.call(this):this.isSmartPointer?Qe(a.registeredClass.instancePrototype,{ptrType:a,ptr:l,smartPtrType:this,smartPtr:e}):Qe(a.registeredClass.instancePrototype,{ptrType:a,ptr:l})}var Je=e=>"undefined"==typeof FinalizationRegistry?(Je=e=>e,e):(Oe=new FinalizationRegistry((e=>{Le(e.$$)})),Je=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Oe.register(e,r,e)}return e},Ue=e=>Oe.unregister(e),Je(e));function Ke(){}var Ze=(e,t)=>Object.defineProperty(t,"name",{value:e}),Ye=(e,t,r)=>{if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(...n){return e[t].overloadTable.hasOwnProperty(n.length)||ke(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[n.length].apply(this,n)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},et=(e,t,r)=>{n.hasOwnProperty(e)?((void 0===r||void 0!==n[e].overloadTable&&void 0!==n[e].overloadTable[r])&&ke(`Cannot register public name '${e}' twice`),Ye(n,e,e),n.hasOwnProperty(r)&&ke(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),n[e].overloadTable[r]=t):(n[e]=t,void 0!==r&&(n[e].numArguments=r))};function tt(e,t,r,n,o,a,i,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var rt=(e,t,r)=>{for(;t!==r;)t.upcast||ke(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function nt(e,t){if(null===t)return this.isReference&&ke(`null is not a valid ${this.name}`),0;t.$$||ke(`Cannot pass "${Bt(t)}" as a ${this.name}`),t.$$.ptr||ke(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return rt(t.$$.ptr,r,this.registeredClass)}function ot(e,t){var r;if(null===t)return this.isReference&&ke(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t&&t.$$||ke(`Cannot pass "${Bt(t)}" as a ${this.name}`),t.$$.ptr||ke(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&ke(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=rt(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&ke("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:ke(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,Dt.toHandle((()=>o.delete()))),null!==e&&e.push(this.rawDestructor,r)}break;default:ke("Unsupporting sharing policy")}return r}function at(e,t){if(null===t)return this.isReference&&ke(`null is not a valid ${this.name}`),0;t.$$||ke(`Cannot pass "${Bt(t)}" as a ${this.name}`),t.$$.ptr||ke(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&ke(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return rt(t.$$.ptr,r,this.registeredClass)}function it(e){return this.fromWireType(P[e>>2])}function st(e,t,r,n,o,a,i,s,l,u,c){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=u,this.rawDestructor=c,o||void 0!==t.baseClass?this.toWireType=ot:n?(this.toWireType=nt,this.destructorFunction=null):(this.toWireType=at,this.destructorFunction=null)}var lt,ut=(e,t,r)=>{n.hasOwnProperty(e)||Te("Replacing nonexistent public symbol"),void 0!==n[e].overloadTable&&void 0!==r?n[e].overloadTable[r]=t:(n[e]=t,n[e].argCount=r)},ct=(e,t,r=[])=>{var o=((e,t,r)=>(e=e.replace(/p/g,"i"),(0,n["dynCall_"+e])(t,...r)))(e,t,r);return o},dt=(e,t)=>{e=$e(e);var r,n,o=(r=e,n=t,(...e)=>ct(r,n,e));return"function"!=typeof o&&ke(`unknown function pointer with signature ${e}: ${t}`),o},ht=e=>{var t=cr(e),r=$e(t);return lr(t),r},mt=(e,t)=>{var r=[],n={};throw t.forEach((function e(t){n[t]||Pe[t]||(xe[t]?xe[t].forEach(e):(r.push(t),n[t]=!0))})),new lt(`${e}: `+r.map(ht).join([", "]))},pt=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(P[t+4*n>>2]);return r},ft=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function gt(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].destructorFunction)return!0;return!1}var vt=e=>{try{return e()}catch(e){j(e)}},yt=e=>{if(e instanceof Q||"unwind"==e)return b;m(1,e)},wt=0,bt=()=>J||wt>0,_t=e=>{b=e,bt()||(n.onExit?.(e),A=!0),m(e,new Q(e))},Et=(e,t)=>{b=e,_t(e)},St=e=>{if(!A)try{e(),(()=>{if(!bt())try{Et(b)}catch(e){yt(e)}})()}catch(e){yt(e)}},$t={instrumentWasmImports(e){var t=/^(invoke_.*|__asyncjs__.*)$/;for(let[r,n]of Object.entries(e))"function"==typeof n&&(n.isAsync||t.test(r))},instrumentWasmExports(e){var t={};for(let[r,n]of Object.entries(e))t[r]="function"==typeof n?(...e)=>{$t.exportCallStack.push(r);try{return n(...e)}finally{A||($t.exportCallStack.pop(),$t.maybeStopUnwind())}}:n;return t},State:{Normal:0,Unwinding:1,Rewinding:2,Disabled:3},state:0,StackSize:4096,currData:null,handleSleepReturnValue:0,exportCallStack:[],callStackNameToId:{},callStackIdToName:{},callStackId:0,asyncPromiseHandlers:null,sleepCallbacks:[],getCallStackId(e){var t=$t.callStackNameToId[e];return void 0===t&&(t=$t.callStackId++,$t.callStackNameToId[e]=t,$t.callStackIdToName[t]=e),t},maybeStopUnwind(){$t.currData&&$t.state===$t.State.Unwinding&&0===$t.exportCallStack.length&&($t.state=$t.State.Normal,vt(kr),"undefined"!=typeof Fibers&&Fibers.trampoline())},whenDone:()=>new Promise(((e,t)=>{$t.asyncPromiseHandlers={resolve:e,reject:t}})),allocateData(){var e=ur(12+$t.StackSize);return $t.setDataHeader(e,e+12,$t.StackSize),$t.setDataRewindFunc(e),e},setDataHeader(e,t,r){P[e>>2]=t,P[e+4>>2]=t+r},setDataRewindFunc(e){var t=$t.exportCallStack[0],r=$t.getCallStackId(t);C[e+8>>2]=r},getDataRewindFuncName(e){var t=C[e+8>>2];return $t.callStackIdToName[t]},getDataRewindFunc:e=>sr[e],doRewind(e){var t=$t.getDataRewindFuncName(e);return $t.getDataRewindFunc(t)()},handleSleep(e){if(!A){if($t.state===$t.State.Normal){var t=!1,r=!1;e(((e=0)=>{if(!A&&($t.handleSleepReturnValue=e,t=!0,r)){$t.state=$t.State.Rewinding,vt((()=>Tr($t.currData))),"undefined"!=typeof Browser&&Browser.mainLoop.func&&Browser.mainLoop.resume();var n,o=!1;try{n=$t.doRewind($t.currData)}catch(e){n=e,o=!0}var a=!1;if(!$t.currData){var i=$t.asyncPromiseHandlers;i&&($t.asyncPromiseHandlers=null,(o?i.reject:i.resolve)(n),a=!0)}if(o&&!a)throw n}})),r=!0,t||($t.state=$t.State.Unwinding,$t.currData=$t.allocateData(),"undefined"!=typeof Browser&&Browser.mainLoop.func&&Browser.mainLoop.pause(),vt((()=>xr($t.currData))))}else $t.state===$t.State.Rewinding?($t.state=$t.State.Normal,vt(Ar),lr($t.currData),$t.currData=null,$t.sleepCallbacks.forEach(St)):j(`invalid state: ${$t.state}`);return $t.handleSleepReturnValue}},handleAsync:e=>$t.handleSleep((t=>{e().then(t)}))};function Ct(e,t,r,n,o,a){var i=t.length;i<2&&ke("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==t[1]&&null!==r,l=gt(t),u="void"!==t[0].name,c=[e,ke,n,o,ft,t[0],t[1]],d=0;d<i-2;++d)c.push(t[d+2]);if(c.push($t),!l)for(d=s?1:2;d<t.length;++d)null!==t[d].destructorFunction&&c.push(t[d].destructorFunction);let[h,m]=function(e,t,r,n){var o=gt(e),a=e.length-2,i=[],s=["fn"];t&&s.push("thisWired");for(var l=0;l<a;++l)i.push(`arg${l}`),s.push(`arg${l}Wired`);i=i.join(","),s=s.join(",");var u=`\n return function (${i}) {\n if (arguments.length !== ${a}) {\n throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${a}');\n }`;o&&(u+="var destructors = [];\n");var c=o?"destructors":"null",d=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];for(t&&(u+=`var thisWired = classParam['toWireType'](${c}, this);\n`),l=0;l<a;++l)u+=`var arg${l}Wired = argType${l}['toWireType'](${c}, arg${l});\n`,d.push(`argType${l}`);u+=(r||n?"var rv = ":"")+`invoker(${s});\n`;var h=r?"rv":"";if(d.push("Asyncify"),u+=`function onDone(${h}) {\n`,o)u+="runDestructors(destructors);\n";else for(l=t?1:2;l<e.length;++l){var m=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==e[l].destructorFunction&&(u+=`${m}_dtor(${m});\n`,d.push(`${m}_dtor`))}return r&&(u+="var ret = retType['fromWireType'](rv);\nreturn ret;\n"),u+="}\n",u+=`return Asyncify.currData ? Asyncify.whenDone().then(onDone) : onDone(${h});\n`,[d,u+="}\n"]}(t,s,u,a);h.push(m);var p=function(e,t){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var r=Ze(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,o=e.apply(n,t);return o instanceof Object?o:n}(Function,h)(...c);return Ze(e,p)}var Pt,xt=e=>{const t=(e=e.trim()).indexOf("(");return-1!==t?e.substr(0,t):e},kt=[],Tt=[],At=()=>Tt.length/2-5-kt.length,Dt={toValue:e=>(e||ke("Cannot use deleted val. handle = "+e),Tt[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const t=kt.pop()||Tt.length;return Tt[t]=e,Tt[t+1]=1,t}}}},Ft={name:"emscripten::val",fromWireType:e=>{var t=Dt.toValue(e);return(e=>{e>9&&0==--Tt[e+1]&&(Tt[e]=void 0,kt.push(e))})(e),t},toWireType:(e,t)=>Dt.toHandle(t),argPackAdvance:8,readValueFromPointer:it,destructorFunction:null},Bt=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},Mt=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(x[e>>2])};case 8:return function(e){return this.fromWireType(k[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Rt=(e,t,r)=>{switch(t){case 1:return r?e=>_[e]:e=>E[e];case 2:return r?e=>S[e>>1]:e=>$[e>>1];case 4:return r?e=>C[e>>2]:e=>P[e>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Ot=(e,t,r)=>ue(e,E,t,r),Ut="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Lt=(e,t)=>{for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&$[n];)++n;if((r=n<<1)-e>32&&Ut)return Ut.decode(E.subarray(e,r));for(var a="",i=0;!(i>=t/2);++i){var s=S[e+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},jt=(e,t,r)=>{if(r??=2147483647,r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,a=0;a<o;++a){var i=e.charCodeAt(a);S[t>>1]=i,t+=2}return S[t>>1]=0,t-n},zt=e=>2*e.length,Nt=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var o=C[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},It=(e,t,r)=>{if(r??=2147483647,r<4)return 0;for(var n=t,o=n+r-4,a=0;a<e.length;++a){var i=e.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),C[t>>2]=i,(t+=4)+4>o)break}return C[t>>2]=0,t-n},Vt=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t},Wt={};Pt=()=>performance.now();var Gt=e=>{var t=(e-w.buffer.byteLength+65535)/65536;try{return w.grow(t),D(),1}catch(e){}},Ht=e=>$t.handleSleep((t=>{return r=t,setTimeout((()=>{St(r)}),e);var r}));Ht.isAsync=!0;var qt,Qt,Xt,Jt={},Kt=()=>{if(!Kt.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:h||"./this.program"};for(var t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);Kt.strings=r}return Kt.strings},Zt=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN,Yt=e=>{var t=le(e)+1,r=fr(t);return Ot(e,r,t),r},er={errorCallback:(e,t,r,n)=>{var o=Z(),a=Yt(r);$r(e,t,a,n),K(o)},initManagers:()=>{function e(){this.objects={},this.nextId=1,this.create=function(e,t={}){var r=this.nextId++;return t.refcount=1,t.object=e,this.objects[r]=t,r},this.get=function(e){if(e)return this.objects[e].object},this.reference=function(e){this.objects[e].refcount++},this.release=function(e){var t=this.objects[e];t.refcount--,t.refcount<=0&&delete this.objects[e]}}er.mgrDevice||(er.mgrSurface=er.mgrSurface||new e,er.mgrSwapChain=er.mgrSwapChain||new e,er.mgrAdapter=er.mgrAdapter||new e,er.mgrDevice=er.mgrDevice||new e,er.mgrQueue=er.mgrQueue||new e,er.mgrCommandBuffer=er.mgrCommandBuffer||new e,er.mgrCommandEncoder=er.mgrCommandEncoder||new e,er.mgrRenderPassEncoder=er.mgrRenderPassEncoder||new e,er.mgrComputePassEncoder=er.mgrComputePassEncoder||new e,er.mgrBindGroup=er.mgrBindGroup||new e,er.mgrBuffer=er.mgrBuffer||new e,er.mgrSampler=er.mgrSampler||new e,er.mgrTexture=er.mgrTexture||new e,er.mgrTextureView=er.mgrTextureView||new e,er.mgrQuerySet=er.mgrQuerySet||new e,er.mgrBindGroupLayout=er.mgrBindGroupLayout||new e,er.mgrPipelineLayout=er.mgrPipelineLayout||new e,er.mgrRenderPipeline=er.mgrRenderPipeline||new e,er.mgrComputePipeline=er.mgrComputePipeline||new e,er.mgrShaderModule=er.mgrShaderModule||new e,er.mgrRenderBundleEncoder=er.mgrRenderBundleEncoder||new e,er.mgrRenderBundle=er.mgrRenderBundle||new e)},makeColor:e=>({r:k[e>>3],g:k[e+8>>3],b:k[e+16>>3],a:k[e+24>>3]}),makeExtent3D:e=>({width:P[e>>2],height:P[e+4>>2],depthOrArrayLayers:P[e+8>>2]}),makeOrigin3D:e=>({x:P[e>>2],y:P[e+4>>2],z:P[e+8>>2]}),makeImageCopyTexture:e=>({texture:er.mgrTexture.get(P[e+4>>2]),mipLevel:P[e+8>>2],origin:er.makeOrigin3D(e+12),aspect:er.TextureAspect[P[e+24>>2]]}),makeTextureDataLayout:e=>{var t=P[e+16>>2],r=P[e+20>>2];return{offset:4294967296*P[e+4+8>>2]+P[e+8>>2],bytesPerRow:4294967295===t?void 0:t,rowsPerImage:4294967295===r?void 0:r}},makeImageCopyBuffer:e=>{var t=e+8,r=er.makeTextureDataLayout(t);return r.buffer=er.mgrBuffer.get(P[e+32>>2]),r},makePipelineConstants:(e,t)=>{if(e){for(var r={},n=0;n<e;++n){var o=t+16*n;r[te(P[o+4>>2])]=k[o+8>>3]}return r}},makePipelineLayout:e=>e?er.mgrPipelineLayout.get(e):"auto",makeProgrammableStageDescriptor:e=>{if(e){var t={module:er.mgrShaderModule.get(P[e+4>>2]),constants:er.makePipelineConstants(P[e+12>>2],P[e+16>>2])},r=P[e+8>>2];return r&&(t.entryPoint=te(r)),t}},fillLimitStruct:(e,t)=>{var r=t+8;function n(t,n){var o=e[t];C[r+n>>2]=o}function o(t,n){var o=e[t];I=[o>>>0,(N=o,+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],C[r+n>>2]=I[0],C[r+(n+4)>>2]=I[1]}n("maxTextureDimension1D",0),n("maxTextureDimension2D",4),n("maxTextureDimension3D",8),n("maxTextureArrayLayers",12),n("maxBindGroups",16),n("maxBindGroupsPlusVertexBuffers",20),n("maxBindingsPerBindGroup",24),n("maxDynamicUniformBuffersPerPipelineLayout",28),n("maxDynamicStorageBuffersPerPipelineLayout",32),n("maxSampledTexturesPerShaderStage",36),n("maxSamplersPerShaderStage",40),n("maxStorageBuffersPerShaderStage",44),n("maxStorageTexturesPerShaderStage",48),n("maxUniformBuffersPerShaderStage",52),n("minUniformBufferOffsetAlignment",72),n("minStorageBufferOffsetAlignment",76),o("maxUniformBufferBindingSize",56),o("maxStorageBufferBindingSize",64),n("maxVertexBuffers",80),o("maxBufferSize",88),n("maxVertexAttributes",96),n("maxVertexBufferArrayStride",100),n("maxInterStageShaderComponents",104),n("maxInterStageShaderVariables",108),n("maxColorAttachments",112),n("maxColorAttachmentBytesPerSample",116),n("maxComputeWorkgroupStorageSize",120),n("maxComputeInvocationsPerWorkgroup",124),n("maxComputeWorkgroupSizeX",128),n("maxComputeWorkgroupSizeY",132),n("maxComputeWorkgroupSizeZ",136),n("maxComputeWorkgroupsPerDimension",140)},Int_BufferMapState:{unmapped:1,pending:2,mapped:3},Int_CompilationMessageType:{error:0,warning:1,info:2},Int_DeviceLostReason:{undefined:1,unknown:1,destroyed:2},Int_PreferredFormat:{rgba8unorm:18,bgra8unorm:23},WGSLFeatureName:[,"readonly_and_readwrite_storage_textures","packed_4x8_integer_dot_product","unrestricted_pointer_parameters","pointer_composite_access"],AddressMode:[,"clamp-to-edge","repeat","mirror-repeat"],AlphaMode:[,"opaque","premultiplied"],BlendFactor:[,"zero","one","src","one-minus-src","src-alpha","one-minus-src-alpha","dst","one-minus-dst","dst-alpha","one-minus-dst-alpha","src-alpha-saturated","constant","one-minus-constant"],BlendOperation:[,"add","subtract","reverse-subtract","min","max"],BufferBindingType:[,"uniform","storage","read-only-storage"],BufferMapState:{1:"unmapped",2:"pending",3:"mapped"},CompareFunction:[,"never","less","equal","less-equal","greater","not-equal","greater-equal","always"],CompilationInfoRequestStatus:["success","error","device-lost","unknown"],CullMode:[,"none","front","back"],ErrorFilter:{1:"validation",2:"out-of-memory",3:"internal"},FeatureName:[,"depth-clip-control","depth32float-stencil8","timestamp-query","texture-compression-bc","texture-compression-etc2","texture-compression-astc","indirect-first-instance","shader-f16","rg11b10ufloat-renderable","bgra8unorm-storage","float32-filterable"],FilterMode:[,"nearest","linear"],FrontFace:[,"ccw","cw"],IndexFormat:[,"uint16","uint32"],LoadOp:[,"clear","load"],MipmapFilterMode:[,"nearest","linear"],PowerPreference:[,"low-power","high-performance"],PrimitiveTopology:[,"point-list","line-list","line-strip","triangle-list","triangle-strip"],QueryType:{1:"occlusion",2:"timestamp"},SamplerBindingType:[,"filtering","non-filtering","comparison"],StencilOperation:[,"keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],StorageTextureAccess:[,"write-only","read-only","read-write"],StoreOp:[,"store","discard"],TextureAspect:[,"all","stencil-only","depth-only"],TextureDimension:[,"1d","2d","3d"],TextureFormat:[,"r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32float","r32uint","r32sint","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb10a2uint","rgb10a2unorm","rg11b10ufloat","rgb9e5ufloat","rg32float","rg32uint","rg32sint","rgba16uint","rgba16sint","rgba16float","rgba32float","rgba32uint","rgba32sint","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb","etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm","astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"],TextureSampleType:[,"float","unfilterable-float","depth","sint","uint"],TextureViewDimension:[,"1d","2d","2d-array","cube","cube-array","3d"],VertexFormat:[,"uint8x2","uint8x4","sint8x2","sint8x4","unorm8x2","unorm8x4","snorm8x2","snorm8x4","uint16x2","uint16x4","sint16x2","sint16x4","unorm16x2","unorm16x4","snorm16x2","snorm16x4","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4","unorm10-10-10-2"],VertexStepMode:[,"vertex-buffer-not-used","vertex","instance"],FeatureNameString2Enum:{undefined:"0","depth-clip-control":"1","depth32float-stencil8":"2","timestamp-query":"3","texture-compression-bc":"4","texture-compression-etc2":"5","texture-compression-astc":"6","indirect-first-instance":"7","shader-f16":"8","rg11b10ufloat-renderable":"9","bgra8unorm-storage":"10","float32-filterable":"11"}},tr=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],rr=e=>{var t;return e=(t=e)>2?te(t):t,tr[e]||("undefined"!=typeof document?document.querySelector(e):void 0)},nr=Ee.createPath,or=Ee.createLazyFile,ar=Ee.createDevice;Ee.createPreloadedFile=be,Ee.staticInit(),n.FS_createPath=Ee.createPath,n.FS_createDataFile=Ee.createDataFile,n.FS_createPreloadedFile=Ee.createPreloadedFile,n.FS_unlink=Ee.unlink,n.FS_createLazyFile=Ee.createLazyFile,n.FS_createDevice=Ee.createDevice,(()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);de=e})(),he=n.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},me=n.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(Ke.prototype,{isAliasOf(e){if(!(this instanceof Ke))return!1;if(!(e instanceof Ke))return!1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o},clone(){if(this.$$.ptr||Re(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Je(Object.create(Object.getPrototypeOf(this),{$$:{value:Me(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||Re(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ke("Object already scheduled for deletion"),Ue(this),Le(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Re(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ke("Object already scheduled for deletion"),Ve.push(this),1===Ve.length&&Be&&Be(We),this.$$.deleteScheduled=!0,this}}),n.getInheritedInstanceCount=Ne,n.getLiveInheritedInstances=Ie,n.flushPendingDeletes=We,n.setDelayFunction=Ge,Object.assign(st.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:8,readValueFromPointer:it,fromWireType:Xe}),lt=n.UnboundTypeError=(qt=Error,(Xt=Ze(Qt="UnboundTypeError",(function(e){this.name=Qt,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(qt.prototype),Xt.prototype.constructor=Xt,Xt.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},Xt),Tt.push(0,1,void 0,1,null,1,!0,1,!1,1),n.count_emval_handles=At,er.initManagers();var ir={b:(e,t,r,n)=>{j(`Assertion failed: ${te(e)}, at: `+[t?te(t):"unknown filename",r,n?te(n):"unknown function"])},O:function(e,t,r){Se.varargs=r;try{var n=Se.getStreamFromFD(e);switch(t){case 0:if((o=re())<0)return-28;for(;Ee.streams[o];)o++;return Ee.dupStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=re();return n.flags|=o,0;case 12:return o=ne(),S[o+0>>1]=2,0}return-28}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},va:function(e,t,r){Se.varargs=r;try{var n=Se.getStreamFromFD(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=ne();C[a>>2]=o.c_iflag||0,C[a+4>>2]=o.c_oflag||0,C[a+8>>2]=o.c_cflag||0,C[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)_[a+i+17]=o.c_cc[i]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=ne();var s=C[a>>2],l=C[a+4>>2],u=C[a+8>>2],c=C[a+12>>2],d=[];for(i=0;i<32;i++)d.push(_[a+i+17]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:s,c_oflag:l,c_cflag:u,c_lflag:c,c_cc:d})}return 0;case 21519:return n.tty?(a=ne(),C[a>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return a=ne(),Ee.ioctl(n,t,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var h=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=ne(),S[a>>1]=h[0],S[a+2>>1]=h[1]}return 0;default:return-28}}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},wa:function(e,t,r,n){Se.varargs=n;try{t=Se.getStr(t),t=Se.calculateAt(e,t);var o=n?re():0;return Ee.open(t,r,o).fd}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},xa:()=>{j("")},ea:(e,t,r,n,o)=>{},Aa:(e,t,r,n)=>{De(e,{name:t=$e(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(E[e])},destructorFunction:null})},Ea:(e,t,r,n,o,a,i,s,l,u,c,d,h)=>{c=$e(c),a=dt(o,a),s&&=dt(i,s),u&&=dt(l,u),h=dt(d,h);var m=(e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e})(c);et(m,(function(){mt(`Cannot construct ${c} due to unbound types`,[n])})),Ae([e,t,r],n?[n]:[],(t=>{var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:Ke.prototype;var i=Ze(c,(function(...e){if(Object.getPrototypeOf(this)!==l)throw new he("Use 'new' to construct "+c);if(void 0===d.constructor_body)throw new he(c+" has no accessible constructor");var t=d.constructor_body[e.length];if(void 0===t)throw new he(`Tried to invoke ctor of ${c} with invalid number of parameters (${e.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return t.apply(this,e)})),l=Object.create(o,{constructor:{value:i}});i.prototype=l;var d=new tt(c,i,l,h,r,a,s,u);d.baseClass&&(d.baseClass.__derivedClasses??=[],d.baseClass.__derivedClasses.push(d));var p=new st(c,d,!0,!1,!1),f=new st(c+"*",d,!1,!1,!1),g=new st(c+" const*",d,!1,!0,!1);return ze[e]={pointerType:f,constPointerType:g},ut(m,i),[p,f,g]}))},Da:(e,t,r,n,o,a)=>{var i=pt(t,r);o=dt(n,o),Ae([],[e],(e=>{var r=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new he(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{mt(`Cannot construct ${e.name} due to unbound types`,i)},Ae([],i,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Ct(r,n,null,o,a),[]))),[]}))},q:(e,t,r,n,o,a,i,s,l)=>{var u=pt(r,n);t=$e(t),t=xt(t),a=dt(o,a),Ae([],[e],(e=>{var n=`${(e=e[0]).name}.${t}`;function o(){mt(`Cannot call ${n} due to unbound types`,u)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,d=c[t];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===r-2?(o.argCount=r-2,o.className=e.name,c[t]=o):(Ye(c,t,n),c[t].overloadTable[r-2]=o),Ae([],u,(o=>{var s=Ct(n,o,e,a,i,l);return void 0===c[t].overloadTable?(s.argCount=r-2,c[t]=s):c[t].overloadTable[r-2]=s,[]})),[]}))},za:e=>De(e,Ft),P:(e,t,r)=>{De(e,{name:t=$e(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:8,readValueFromPointer:Mt(t,r),destructorFunction:null})},S:(e,t,r,n,o,a,i)=>{var s=pt(t,r);e=$e(e),e=xt(e),o=dt(n,o),et(e,(function(){mt(`Cannot call ${e} due to unbound types`,s)}),t-1),Ae([],s,(r=>{var n=[r[0],null].concat(r.slice(1));return ut(e,Ct(e,n,null,o,a,i),t-1),[]}))},v:(e,t,r,n,o)=>{t=$e(t);var a=e=>e;if(0===n){var i=32-8*r;a=e=>e<<i>>>i}var s=t.includes("unsigned");De(e,{name:t,fromWireType:a,toWireType:s?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:Rt(t,r,0!==n),destructorFunction:null})},h:(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function o(e){var t=P[e>>2],r=P[e+4>>2];return new n(_.buffer,r,t)}De(e,{name:r=$e(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Q:(e,t)=>{var r="std::string"===(t=$e(t));De(e,{name:t,fromWireType(e){var t,n=P[e>>2],o=e+4;if(r)for(var a=o,i=0;i<=n;++i){var s=o+i;if(i==n||0==E[s]){var l=te(a,s-a);void 0===t?t=l:(t+=String.fromCharCode(0),t+=l),a=s+1}}else{var u=new Array(n);for(i=0;i<n;++i)u[i]=String.fromCharCode(E[o+i]);t=u.join("")}return lr(e),t},toWireType(e,t){var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var o="string"==typeof t;o||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||ke("Cannot pass non-string to std::string"),n=r&&o?le(t):t.length;var a=ur(4+n+1),i=a+4;if(P[a>>2]=n,r&&o)Ot(t,i,n+1);else if(o)for(var s=0;s<n;++s){var l=t.charCodeAt(s);l>255&&(lr(i),ke("String has UTF-16 code units that do not fit in 8 bits")),E[i+s]=l}else for(s=0;s<n;++s)E[i+s]=t[s];return null!==e&&e.push(lr,a),a},argPackAdvance:8,readValueFromPointer:it,destructorFunction(e){lr(e)}})},J:(e,t,r)=>{var n,o,a,i;r=$e(r),2===t?(n=Lt,o=jt,i=zt,a=e=>$[e>>1]):4===t&&(n=Nt,o=It,i=Vt,a=e=>P[e>>2]),De(e,{name:r,fromWireType:e=>{for(var r,o=P[e>>2],i=e+4,s=0;s<=o;++s){var l=e+4+s*t;if(s==o||0==a(l)){var u=n(i,l-i);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),i=l+t}}return lr(e),r},toWireType:(e,n)=>{"string"!=typeof n&&ke(`Cannot pass non-string to C++ string type ${r}`);var a=i(n),s=ur(4+a+t);return P[s>>2]=a/t,o(n,s+4,a+t),null!==e&&e.push(lr,s),s},argPackAdvance:8,readValueFromPointer:it,destructorFunction(e){lr(e)}})},Ba:(e,t)=>{De(e,{isVoid:!0,name:t=$e(t),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,t)=>{}})},sa:(e,t,r)=>E.copyWithin(e,t,t+r),la:()=>{J=!1,wt=0},ja:()=>{throw 1/0},A:(e,t)=>{var r,n,o;n="_emval_take_value",void 0===(o=Pe[r=e])&&ke(`${n} has unknown type ${ht(r)}`);var a=(e=o).readValueFromPointer(t);return Dt.toHandle(a)},ma:(e,t)=>{if(Wt[e]&&(clearTimeout(Wt[e].id),delete Wt[e]),!t)return 0;var r=setTimeout((()=>{delete Wt[e],St((()=>dr(e,Pt())))}),t);return Wt[e]={id:r,timeout_ms:t},0},na:(e,t,r,n)=>{var o=(new Date).getFullYear(),a=new Date(o,0,1),i=new Date(o,6,1),s=a.getTimezoneOffset(),l=i.getTimezoneOffset(),u=Math.max(s,l);P[e>>2]=60*u,C[t>>2]=Number(s!=l);var c=e=>{var t=e>=0?"-":"+",r=Math.abs(e);return`UTC${t}${String(Math.floor(r/60)).padStart(2,"0")}${String(r%60).padStart(2,"0")}`},d=c(s),h=c(l);l<s?(Ot(d,r,17),Ot(h,n,17)):(Ot(d,n,17),Ot(h,r,17))},ra:e=>{var t,r,n=E.length,o=2147483648;if((e>>>=0)>o)return!1;for(var a=1;a<=4;a*=2){var i=n*(1+.2/a);i=Math.min(i,e+100663296);var s=Math.min(o,(t=Math.max(e,i),r=65536,Math.ceil(t/r)*r));if(Gt(s))return!0}return!1},T:Ht,oa:(e,t)=>{var r=0;return Kt().forEach(((n,o)=>{var a=t+r;P[e+4*o>>2]=a,((e,t)=>{for(var r=0;r<e.length;++r)_[t++]=e.charCodeAt(r);_[t]=0})(n,a),r+=n.length+1})),0},pa:(e,t)=>{var r=Kt();P[e>>2]=r.length;var n=0;return r.forEach((e=>n+=e.length+1)),P[t>>2]=n,0},N:function(e){try{var t=Se.getStreamFromFD(e);return Ee.close(t),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},ua:function(e,t,r,n){try{var o=((e,t,r,n)=>{for(var o=0,a=0;a<r;a++){var i=P[t>>2],s=P[t+4>>2];t+=8;var l=Ee.read(e,_,i,s,n);if(l<0)return-1;if(o+=l,l<s)break}return o})(Se.getStreamFromFD(e),t,r);return P[n>>2]=o,0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},Va:function(e,t,r,n,o){var a=Zt(t,r);try{if(isNaN(a))return 61;var i=Se.getStreamFromFD(e);return Ee.llseek(i,a,n),I=[i.position>>>0,(N=i.position,+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],C[o>>2]=I[0],C[o+4>>2]=I[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},ta:function(e,t,r,n){try{var o=((e,t,r,n)=>{for(var o=0,a=0;a<r;a++){var i=P[t>>2],s=P[t+4>>2];t+=8;var l=Ee.write(e,_,i,s,n);if(l<0)return-1;if(o+=l,l<s)break}return o})(Se.getStreamFromFD(e),t,r);return P[n>>2]=o,0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},n:function(e,t){var r=Z();try{return yr(e,t)}catch(e){if(K(r),e!==e+0)throw e;hr(1,0)}},g:function(e,t,r){var n=Z();try{return Sr(e,t,r)}catch(e){if(K(n),e!==e+0)throw e;hr(1,0)}},e:function(e,t,r,n){var o=Z();try{return vr(e,t,r,n)}catch(e){if(K(o),e!==e+0)throw e;hr(1,0)}},D:function(e,t,r,n,o,a){var i=Z();try{return Er(e,t,r,n,o,a)}catch(e){if(K(i),e!==e+0)throw e;hr(1,0)}},a:function(e,t){var r=Z();try{wr(e,t)}catch(e){if(K(r),e!==e+0)throw e;hr(1,0)}},c:function(e,t,r){var n=Z();try{br(e,t,r)}catch(e){if(K(n),e!==e+0)throw e;hr(1,0)}},f:function(e,t,r,n){var o=Z();try{$r(e,t,r,n)}catch(e){if(K(o),e!==e+0)throw e;hr(1,0)}},z:function(e,t,r,n,o){var a=Z();try{Cr(e,t,r,n,o)}catch(e){if(K(a),e!==e+0)throw e;hr(1,0)}},Ua:function(e,t,r,n,o,a){var i=Z();try{_r(e,t,r,n,o,a)}catch(e){if(K(i),e!==e+0)throw e;hr(1,0)}},ka:_t,V:(e,t)=>{var r=er.mgrAdapter.get(e);if(0!==t){var n=0;r.features.forEach((e=>{var r=er.FeatureNameString2Enum[e];C[t+n>>2]=r,n+=4}))}return r.features.size},$:e=>er.mgrAdapter.release(e),U:(e,t,r,n)=>{var o=er.mgrAdapter.get(e),a={};if(t){var i=P[t+8>>2];if(i){var s=P[t+12>>2];a.requiredFeatures=Array.from(C.subarray(s>>2,s+4*i>>2),(e=>er.FeatureName[e]))}var l=P[t+16>>2];if(l){var u=l+8,c={};function g(e,t){var r=P[u+t>>2];4294967295!=r&&(c[e]=r)}function v(e,t){var r=u+t,n=P[r>>2],o=P[r+4>>2];4294967295==n&&4294967295==o||(c[e]=4294967296*P[r+4>>2]+P[r>>2])}g("maxTextureDimension1D",0),g("maxTextureDimension2D",4),g("maxTextureDimension3D",8),g("maxTextureArrayLayers",12),g("maxBindGroups",16),g("maxBindGroupsPlusVertexBuffers",20),g("maxDynamicUniformBuffersPerPipelineLayout",28),g("maxDynamicStorageBuffersPerPipelineLayout",32),g("maxSampledTexturesPerShaderStage",36),g("maxSamplersPerShaderStage",40),g("maxStorageBuffersPerShaderStage",44),g("maxStorageTexturesPerShaderStage",48),g("maxUniformBuffersPerShaderStage",52),g("minUniformBufferOffsetAlignment",72),g("minStorageBufferOffsetAlignment",76),v("maxUniformBufferBindingSize",56),v("maxStorageBufferBindingSize",64),g("maxVertexBuffers",80),v("maxBufferSize",88),g("maxVertexAttributes",96),g("maxVertexBufferArrayStride",100),g("maxInterStageShaderComponents",104),g("maxInterStageShaderVariables",108),g("maxColorAttachments",112),g("maxColorAttachmentBytesPerSample",116),g("maxComputeWorkgroupStorageSize",120),g("maxComputeInvocationsPerWorkgroup",124),g("maxComputeWorkgroupSizeX",128),g("maxComputeWorkgroupSizeY",132),g("maxComputeWorkgroupSizeZ",136),g("maxComputeWorkgroupsPerDimension",140),a.requiredLimits=c}var d=P[t+20>>2];if(d){var h={};(m=P[d+4>>2])&&(h.label=te(m)),a.defaultQueue=h}var m,p=P[t+28>>2],f=P[t+32>>2];(m=P[t+4>>2])&&(a.label=te(m))}o.requestDevice(a).then((e=>{St((()=>{var t={queueId:er.mgrQueue.create(e.queue)},o=er.mgrDevice.create(e,t);p&&e.lost.then((e=>{St((()=>er.errorCallback(p,er.Int_DeviceLostReason[e.reason],e.message,f)))})),Cr(r,0,o,0,n)}))}),(function(e){St((()=>{var t=Z(),o=Yt(e.message);Cr(r,1,0,o,n),K(t)}))}))},w:e=>er.mgrBindGroupLayout.release(e),t:e=>er.mgrBindGroup.release(e),Qa:e=>{var t=er.mgrBuffer.objects[e];if(t.onUnmap){for(var r=0;r<t.onUnmap.length;++r)t.onUnmap[r]();t.onUnmap=void 0}er.mgrBuffer.get(e).destroy()},ia:function(e){var t,r=er.mgrBuffer.get(e).size;return N=r,t=+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0,mr(t),r>>>0},Pa:e=>er.mgrBuffer.release(e),Y:e=>er.mgrCommandBuffer.release(e),Na:(e,t)=>{var r;if(t){r={label:void 0,timestampWrites:function(e){if(0!==e)return{querySet:er.mgrQuerySet.get(P[e>>2]),beginningOfPassWriteIndex:P[e+4>>2],endOfPassWriteIndex:P[e+8>>2]}}(P[t+8>>2])};var n=P[t+4>>2];n&&(r.label=te(n))}var o=er.mgrCommandEncoder.get(e);return er.mgrComputePassEncoder.create(o.beginComputePass(r))},da:(e,t)=>{function r(e){var t=P[e+4>>2];if(0!==t){var r=C[e+8>>2];-1==r&&(r=void 0);var n=P[e+16>>2],o=P[e+20>>2],a=er.makeColor(e+24);return{view:er.mgrTextureView.get(t),depthSlice:r,resolveTarget:er.mgrTextureView.get(P[e+12>>2]),clearValue:a,loadOp:er.LoadOp[n],storeOp:er.StoreOp[o]}}}function n(e,t){for(var n=[],o=0;o<e;++o)n.push(r(t+56*o));return n}function o(e){if(0!==e)return{view:er.mgrTextureView.get(P[e>>2]),depthClearValue:x[e+12>>2],depthLoadOp:er.LoadOp[P[e+4>>2]],depthStoreOp:er.StoreOp[P[e+8>>2]],depthReadOnly:!!P[e+16>>2],stencilClearValue:P[e+28>>2],stencilLoadOp:er.LoadOp[P[e+20>>2]],stencilStoreOp:er.StoreOp[P[e+24>>2]],stencilReadOnly:!!P[e+32>>2]}}function a(e){if(0!==e)return{querySet:er.mgrQuerySet.get(P[e>>2]),beginningOfPassWriteIndex:P[e+4>>2],endOfPassWriteIndex:P[e+8>>2]}}var i=function(e){var t=P[e>>2],r=void 0;if(0!==t){P[t+4>>2];var i=t;r=4294967296*P[i+4+8>>2]+P[i+8>>2]}var s={label:void 0,colorAttachments:n(P[e+8>>2],P[e+12>>2]),depthStencilAttachment:o(P[e+16>>2]),occlusionQuerySet:er.mgrQuerySet.get(P[e+20>>2]),timestampWrites:a(P[e+24>>2]),maxDrawCount:r},l=P[e+4>>2];return l&&(s.label=te(l)),s}(t),s=er.mgrCommandEncoder.get(e);return er.mgrRenderPassEncoder.create(s.beginRenderPass(i))},B:(e,t,r,n)=>{var o=er.mgrCommandEncoder.get(e),a=er.makeExtent3D(n);o.copyTextureToTexture(er.makeImageCopyTexture(t),er.makeImageCopyTexture(r),a)},Z:(e,t)=>{var r=er.mgrCommandEncoder.get(e);return er.mgrCommandBuffer.create(r.finish())},X:e=>er.mgrCommandEncoder.release(e),La:(e,t,r,n)=>{er.mgrComputePassEncoder.get(e).dispatchWorkgroups(t,r,n)},Ka:e=>{er.mgrComputePassEncoder.get(e).end()},L:(e,t,r,n,o)=>{var a=er.mgrComputePassEncoder.get(e),i=er.mgrBindGroup.get(r);if(0==n)a.setBindGroup(t,i);else{for(var s=[],l=0;l<n;l++,o+=4)s.push(P[o>>2]);a.setBindGroup(t,i,s)}},Ma:(e,t)=>{var r=er.mgrComputePassEncoder.get(e),n=er.mgrComputePipeline.get(t);r.setPipeline(n)},Ia:e=>er.mgrComputePipeline.release(e),x:(e,t)=>{function r(e){var t,r=P[e+8>>2],n=P[e+32>>2],o=P[e+36>>2],a=P[e+4>>2];if(r){var i=P[(t=e+24)>>2]+4294967296*C[t+4>>2];return-1==i&&(i=void 0),{binding:a,resource:{buffer:er.mgrBuffer.get(r),offset:4294967296*P[e+4+16>>2]+P[e+16>>2],size:i}}}return n?{binding:a,resource:er.mgrSampler.get(n)}:{binding:a,resource:er.mgrTextureView.get(o)}}var n={label:void 0,layout:er.mgrBindGroupLayout.get(P[t+8>>2]),entries:function(e,t){for(var n=[],o=0;o<e;++o)n.push(r(t+40*o));return n}(P[t+12>>2],P[t+16>>2])},o=P[t+4>>2];o&&(n.label=te(o));var a=er.mgrDevice.get(e);return er.mgrBindGroup.create(a.createBindGroup(n))},u:(e,t)=>{function r(e){var t=P[e+4>>2];if(t)return{type:er.BufferBindingType[t],hasDynamicOffset:!!P[e+8>>2],minBindingSize:4294967296*P[e+4+16>>2]+P[e+16>>2]}}function n(e){var t=P[e+4>>2];if(t)return{type:er.SamplerBindingType[t]}}function o(e){var t=P[e+4>>2];if(t)return{sampleType:er.TextureSampleType[t],viewDimension:er.TextureViewDimension[P[e+8>>2]],multisampled:!!P[e+12>>2]}}function a(e){var t=P[e+4>>2];if(t)return{access:er.StorageTextureAccess[t],format:er.TextureFormat[P[e+8>>2]],viewDimension:er.TextureViewDimension[P[e+12>>2]]}}var i={entries:function(e,t){for(var i,s=[],l=0;l<e;++l)s.push({binding:P[(i=t+80*l)+4>>2],visibility:P[i+8>>2],buffer:r(i+16),sampler:n(i+40),texture:o(i+48),storageTexture:a(i+64)});return s}(P[t+8>>2],P[t+12>>2])},s=P[t+4>>2];s&&(i.label=te(s));var l=er.mgrDevice.get(e);return er.mgrBindGroupLayout.create(l.createBindGroupLayout(i))},F:(e,t)=>{var r=!!P[t+24>>2],n={label:void 0,usage:P[t+8>>2],size:4294967296*P[t+4+16>>2]+P[t+16>>2],mappedAtCreation:r},o=P[t+4>>2];o&&(n.label=te(o));var a=er.mgrDevice.get(e),i={},s=er.mgrBuffer.create(a.createBuffer(n),i);return r&&(i.mapMode=2,i.onUnmap=[]),s},_:(e,t)=>{var r;if(t){r={label:void 0};var n=P[t+4>>2];n&&(r.label=te(n))}var o=er.mgrDevice.get(e);return er.mgrCommandEncoder.create(o.createCommandEncoder(r))},Ja:(e,t)=>{var r=(e=>{var t={label:void 0,layout:er.makePipelineLayout(P[e+8>>2]),compute:er.makeProgrammableStageDescriptor(e+12)},r=P[e+4>>2];return r&&(t.label=te(r)),t})(t),n=er.mgrDevice.get(e);return er.mgrComputePipeline.create(n.createComputePipeline(r))},r:(e,t)=>{for(var r=P[t+8>>2],n=P[t+12>>2],o=[],a=0;a<r;++a)o.push(er.mgrBindGroupLayout.get(P[n+4*a>>2]));var i={label:void 0,bindGroupLayouts:o},s=P[t+4>>2];s&&(i.label=te(s));var l=er.mgrDevice.get(e);return er.mgrPipelineLayout.create(l.createPipelineLayout(i))},j:(e,t)=>{var r=(e=>{function t(e){if(e)return{operation:er.BlendOperation[P[e>>2]],srcFactor:er.BlendFactor[P[e+4>>2]],dstFactor:er.BlendFactor[P[e+8>>2]]}}function r(e){if(e)return{alpha:t(e+12),color:t(e+0)}}function n(e,t){for(var n,o,a=[],i=0;i<e;++i)a.push((o=void 0,0===(o=P[(n=t+16*i)+4>>2])?void 0:{format:er.TextureFormat[o],blend:r(P[n+8>>2]),writeMask:P[n+12>>2]}));return a}function o(e){return{compare:er.CompareFunction[P[e>>2]],failOp:er.StencilOperation[P[e+4>>2]],depthFailOp:er.StencilOperation[P[e+8>>2]],passOp:er.StencilOperation[P[e+12>>2]]}}function a(e,t){for(var r,n=[],o=0;o<e;++o)n.push((r=t+24*o,{format:er.VertexFormat[P[r>>2]],offset:4294967296*P[r+4+8>>2]+P[r+8>>2],shaderLocation:P[r+16>>2]}));return n}function i(e){if(e){var t=P[e+8>>2];return 1===t?null:{arrayStride:4294967296*P[e+4>>2]+P[e>>2],stepMode:er.VertexStepMode[t],attributes:a(P[e+12>>2],P[e+16>>2])}}}function s(e,t){if(e){for(var r=[],n=0;n<e;++n)r.push(i(t+24*n));return r}}var l={label:void 0,layout:er.makePipelineLayout(P[e+8>>2]),vertex:function(e){if(e){var t={module:er.mgrShaderModule.get(P[e+4>>2]),constants:er.makePipelineConstants(P[e+12>>2],P[e+16>>2]),buffers:s(P[e+20>>2],P[e+24>>2])},r=P[e+8>>2];return r&&(t.entryPoint=te(r)),t}}(e+12),primitive:function(e){if(e){var t=P[e>>2],r=t?P[t+4>>2]:0;return{topology:er.PrimitiveTopology[P[e+4>>2]],stripIndexFormat:er.IndexFormat[P[e+8>>2]],frontFace:er.FrontFace[P[e+12>>2]],cullMode:er.CullMode[P[e+16>>2]],unclippedDepth:7===r&&!!P[t+8>>2]}}}(e+40),depthStencil:function(e){if(e)return{format:er.TextureFormat[P[e+4>>2]],depthWriteEnabled:!!P[e+8>>2],depthCompare:er.CompareFunction[P[e+12>>2]],stencilFront:o(e+16),stencilBack:o(e+32),stencilReadMask:P[e+48>>2],stencilWriteMask:P[e+52>>2],depthBias:C[e+56>>2],depthBiasSlopeScale:x[e+60>>2],depthBiasClamp:x[e+64>>2]}}(P[e+60>>2]),multisample:function(e){if(e)return{count:P[e+4>>2],mask:P[e+8>>2],alphaToCoverageEnabled:!!P[e+12>>2]}}(e+64),fragment:function(e){if(e){var t={module:er.mgrShaderModule.get(P[e+4>>2]),constants:er.makePipelineConstants(P[e+12>>2],P[e+16>>2]),targets:n(P[e+20>>2],P[e+24>>2])},r=P[e+8>>2];return r&&(t.entryPoint=te(r)),t}}(P[e+80>>2])},u=P[e+4>>2];return u&&(l.label=te(u)),l})(t),n=er.mgrDevice.get(e);return er.mgrRenderPipeline.create(n.createRenderPipeline(r))},E:(e,t)=>{var r;if(t){r={label:void 0,addressModeU:er.AddressMode[P[t+8>>2]],addressModeV:er.AddressMode[P[t+12>>2]],addressModeW:er.AddressMode[P[t+16>>2]],magFilter:er.FilterMode[P[t+20>>2]],minFilter:er.FilterMode[P[t+24>>2]],mipmapFilter:er.MipmapFilterMode[P[t+28>>2]],lodMinClamp:x[t+32>>2],lodMaxClamp:x[t+36>>2],compare:er.CompareFunction[P[t+40>>2]]};var n=P[t+4>>2];n&&(r.label=te(n))}var o=er.mgrDevice.get(e);return er.mgrSampler.create(o.createSampler(r))},o:(e,t)=>{var r=P[t>>2],n=P[r+4>>2],o={label:void 0,code:""},a=P[t+4>>2];switch(a&&(o.label=te(a)),n){case 5:var i=P[r+8>>2],s=P[r+12>>2]>>2;o.code=P.subarray(s,s+i);break;case 6:var l=P[r+8>>2];l&&(o.code=te(l))}var u=er.mgrDevice.get(e);return er.mgrShaderModule.create(u.createShaderModule(o))},H:(e,t)=>{var r={label:void 0,size:er.makeExtent3D(t+16),mipLevelCount:P[t+32>>2],sampleCount:P[t+36>>2],dimension:er.TextureDimension[P[t+12>>2]],format:er.TextureFormat[P[t+28>>2]],usage:P[t+8>>2]},n=P[t+4>>2];n&&(r.label=te(n));var o=P[t+40>>2];if(o){var a=P[t+44>>2];r.viewFormats=Array.from(C.subarray(a>>2,a+4*o>>2),(function(e){return er.TextureFormat[e]}))}var i=er.mgrDevice.get(e);return er.mgrTexture.create(i.createTexture(r))},Ha:e=>{var t=er.mgrDevice.objects[e].queueId;return er.mgrQueue.reference(t),t},aa:e=>er.mgrDevice.release(e),Ca:(e,t)=>{var r=P[t>>2],n=P[r+8>>2],o=rr(n).getContext("webgpu");if(!o)return 0;var a=P[t+4>>2];return a&&(o.surfaceLabelWebGPU=te(a)),er.mgrSurface.create(o)},W:(e,t,r,n)=>{var o;if(t&&(o={powerPreference:er.PowerPreference[P[t+8>>2]],forceFallbackAdapter:!!P[t+16>>2]}),!("gpu"in navigator)){var a=Z(),i=Yt("WebGPU not available on this browser (navigator.gpu is not available)");return Cr(r,1,0,i,n),void K(a)}navigator.gpu.requestAdapter(o).then((e=>{St((()=>{if(e)((e,t,n,o)=>{Cr(r,0,t,0,o)})(0,er.mgrAdapter.create(e),0,n);else{var t=Z();((e,t,n,o)=>{Cr(r,1,0,n,o)})(0,0,Yt("WebGPU not available on this system (requestAdapter returned null)"),n),K(t)}}))}),(e=>{St((()=>{var t=Z();((e,t,n,o)=>{Cr(r,2,0,n,o)})(0,0,Yt(e.message),n),K(t)}))}))},p:e=>er.mgrPipelineLayout.release(e),Oa:e=>er.mgrQueue.release(e),C:(e,t,r)=>{var n=er.mgrQueue.get(e),o=Array.from(C.subarray(r>>2,r+4*t>>2),(e=>er.mgrCommandBuffer.get(e)));n.submit(o)},ha:function(e,t,r,n,o,a){var i=Zt(r,n),s=er.mgrQueue.get(e),l=er.mgrBuffer.get(t),u=E.subarray(o,o+a);s.writeBuffer(l,i,u,0,a)},I:(e,t,r,n,o,a)=>{var i=er.mgrQueue.get(e),s=er.makeImageCopyTexture(t),l=er.makeTextureDataLayout(o),u=er.makeExtent3D(a),c=E.subarray(r,r+n);i.writeTexture(s,c,l,u)},K:(e,t,r,n,o,a)=>{er.mgrRenderPassEncoder.get(e).drawIndexed(t,r,n,o,a)},ca:e=>{er.mgrRenderPassEncoder.get(e).end()},ba:e=>er.mgrRenderPassEncoder.release(e),d:(e,t,r,n,o)=>{var a=er.mgrRenderPassEncoder.get(e),i=er.mgrBindGroup.get(r);if(0==n)a.setBindGroup(t,i);else{for(var s=[],l=0;l<n;l++,o+=4)s.push(P[o>>2]);a.setBindGroup(t,i,s)}},fa:function(e,t,r,n,o,a,i){var s=Zt(n,o),l=Zt(a,i),u=er.mgrRenderPassEncoder.get(e),c=er.mgrBuffer.get(t);-1==l&&(l=void 0),u.setIndexBuffer(c,er.IndexFormat[r],s,l)},k:(e,t)=>{var r=er.mgrRenderPassEncoder.get(e),n=er.mgrRenderPipeline.get(t);r.setPipeline(n)},s:(e,t,r,n,o)=>{er.mgrRenderPassEncoder.get(e).setScissorRect(t,r,n,o)},l:(e,t)=>{er.mgrRenderPassEncoder.get(e).setStencilReference(t)},ga:function(e,t,r,n,o,a,i){var s=Zt(n,o),l=Zt(a,i),u=er.mgrRenderPassEncoder.get(e),c=er.mgrBuffer.get(r);-1==l&&(l=void 0),u.setVertexBuffer(t,c,s,l)},i:e=>er.mgrRenderPipeline.release(e),G:e=>er.mgrSampler.release(e),m:e=>er.mgrShaderModule.release(e),Fa:(e,t)=>{var r=P[t+4>>2],n=er.mgrSurface.get(e),o=[P[t+28>>2],P[t+32>>2]];0!==o[0]&&(n.canvas.width=o[0]),0!==o[1]&&(n.canvas.height=o[1]);var a={device:er.mgrDevice.get(r),format:er.TextureFormat[P[t+8>>2]],usage:P[t+12>>2],alphaMode:er.AlphaMode[P[t+24>>2]]};n.configure(a)},Ga:(e,t)=>{var r=er.mgrSurface.get(e);try{var n=er.mgrTexture.create(r.getCurrentTexture());P[t>>2]=n,C[t+4>>2]=0,C[t+8>>2]=0}catch(e){P[t>>2]=0,C[t+4>>2]=0,C[t+8>>2]=5}},R:e=>er.mgrSurface.release(e),Sa:(e,t)=>{var r;if(t){var n=P[t+20>>2],o=P[t+28>>2];r={format:er.TextureFormat[P[t+8>>2]],dimension:er.TextureViewDimension[P[t+12>>2]],baseMipLevel:P[t+16>>2],mipLevelCount:4294967295===n?void 0:n,baseArrayLayer:P[t+24>>2],arrayLayerCount:4294967295===o?void 0:o,aspect:er.TextureAspect[P[t+32>>2]]};var a=P[t+4>>2];a&&(r.label=te(a))}var i=er.mgrTexture.get(e);return er.mgrTextureView.create(i.createView(r))},Ra:e=>er.mgrTexture.get(e).destroy(),Ta:e=>{var t=er.mgrTexture.get(e);return er.TextureFormat.indexOf(t.format)},qa:e=>er.mgrTexture.get(e).height,ya:e=>er.mgrTexture.get(e).width,M:e=>er.mgrTexture.release(e),y:e=>er.mgrTextureView.release(e)},sr=function(){var e,t,o,a,i={a:ir};function l(e,t){var r;return sr=e.exports,sr=$t.instrumentWasmExports(sr),w=sr.Wa,D(),sr.$a,r=sr.Xa,B.unshift(r),L(),sr}if(U(),n.instantiateWasm)try{return n.instantiateWasm(i,l)}catch(e){y(`Module.instantiateWasm callback failed with error: ${e}`),r(e)}return z||(z=G()),(e=T,t=z,o=i,a=function(e){l(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||V(t)||W(t)||s||"function"!=typeof fetch?q(t,o,a):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,o).then(a,(function(e){return y(`wasm streaming compile failed: ${e}`),y("falling back to ArrayBuffer instantiation"),q(t,o,a)}))))).catch(r),{}}(),lr=e=>(lr=sr.Ya)(e),ur=e=>(ur=sr.Za)(e),cr=e=>(cr=sr._a)(e),dr=(e,t)=>(dr=sr.ab)(e,t),hr=(e,t)=>(hr=sr.bb)(e,t),mr=e=>(mr=sr.cb)(e),pr=e=>(pr=sr.db)(e),fr=e=>(fr=sr.eb)(e),gr=()=>(gr=sr.fb)(),vr=n.dynCall_iiii=(e,t,r,o)=>(vr=n.dynCall_iiii=sr.gb)(e,t,r,o),yr=n.dynCall_ii=(e,t)=>(yr=n.dynCall_ii=sr.hb)(e,t);n.dynCall_iiiii=(e,t,r,o,a)=>(n.dynCall_iiiii=sr.ib)(e,t,r,o,a),n.dynCall_iiiiiffiii=(e,t,r,o,a,i,s,l,u,c)=>(n.dynCall_iiiiiffiii=sr.jb)(e,t,r,o,a,i,s,l,u,c),n.dynCall_fii=(e,t,r)=>(n.dynCall_fii=sr.kb)(e,t,r);var wr=n.dynCall_vi=(e,t)=>(wr=n.dynCall_vi=sr.lb)(e,t),br=n.dynCall_vii=(e,t,r)=>(br=n.dynCall_vii=sr.mb)(e,t,r),_r=n.dynCall_viiij=(e,t,r,o,a,i)=>(_r=n.dynCall_viiij=sr.nb)(e,t,r,o,a,i),Er=n.dynCall_iiiiii=(e,t,r,o,a,i)=>(Er=n.dynCall_iiiiii=sr.ob)(e,t,r,o,a,i),Sr=n.dynCall_iii=(e,t,r)=>(Sr=n.dynCall_iii=sr.pb)(e,t,r),$r=n.dynCall_viii=(e,t,r,o)=>($r=n.dynCall_viii=sr.qb)(e,t,r,o),Cr=n.dynCall_viiii=(e,t,r,o,a)=>(Cr=n.dynCall_viiii=sr.rb)(e,t,r,o,a);n.dynCall_viiiii=(e,t,r,o,a,i)=>(n.dynCall_viiiii=sr.sb)(e,t,r,o,a,i),n.dynCall_viiiiii=(e,t,r,o,a,i,s)=>(n.dynCall_viiiiii=sr.tb)(e,t,r,o,a,i,s),n.dynCall_v=e=>(n.dynCall_v=sr.ub)(e),n.dynCall_fi=(e,t)=>(n.dynCall_fi=sr.vb)(e,t),n.dynCall_iiiiiii=(e,t,r,o,a,i,s)=>(n.dynCall_iiiiiii=sr.wb)(e,t,r,o,a,i,s),n.dynCall_iiiiiiii=(e,t,r,o,a,i,s,l)=>(n.dynCall_iiiiiiii=sr.xb)(e,t,r,o,a,i,s,l),n.dynCall_iif=(e,t,r)=>(n.dynCall_iif=sr.yb)(e,t,r),n.dynCall_iiif=(e,t,r,o)=>(n.dynCall_iiif=sr.zb)(e,t,r,o),n.dynCall_iiffff=(e,t,r,o,a,i)=>(n.dynCall_iiffff=sr.Ab)(e,t,r,o,a,i),n.dynCall_iiiffff=(e,t,r,o,a,i,s)=>(n.dynCall_iiiffff=sr.Bb)(e,t,r,o,a,i,s),n.dynCall_jiji=(e,t,r,o,a)=>(n.dynCall_jiji=sr.Cb)(e,t,r,o,a),n.dynCall_iiiiiiiii=(e,t,r,o,a,i,s,l,u)=>(n.dynCall_iiiiiiiii=sr.Db)(e,t,r,o,a,i,s,l,u),n.dynCall_iiiff=(e,t,r,o,a)=>(n.dynCall_iiiff=sr.Eb)(e,t,r,o,a),n.dynCall_iiifi=(e,t,r,o,a)=>(n.dynCall_iiifi=sr.Fb)(e,t,r,o,a),n.dynCall_viijii=(e,t,r,o,a,i,s)=>(n.dynCall_viijii=sr.Gb)(e,t,r,o,a,i,s),n.dynCall_iiiiij=(e,t,r,o,a,i,s)=>(n.dynCall_iiiiij=sr.Hb)(e,t,r,o,a,i,s),n.dynCall_iiiiid=(e,t,r,o,a,i)=>(n.dynCall_iiiiid=sr.Ib)(e,t,r,o,a,i),n.dynCall_iiiiijj=(e,t,r,o,a,i,s,l,u)=>(n.dynCall_iiiiijj=sr.Jb)(e,t,r,o,a,i,s,l,u),n.dynCall_iiiiiijj=(e,t,r,o,a,i,s,l,u,c)=>(n.dynCall_iiiiiijj=sr.Kb)(e,t,r,o,a,i,s,l,u,c);var Pr,xr=e=>(xr=sr.Lb)(e),kr=()=>(kr=sr.Mb)(),Tr=e=>(Tr=sr.Nb)(e),Ar=()=>(Ar=sr.Ob)();function Dr(){function e(){Pr||(Pr=!0,n.calledRun=!0,A||(n.noFSInit||Ee.initialized||Ee.init(),Ee.ignorePermissions=!1,X(B),t(n),n.onRuntimeInitialized?.(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)e=n.postRun.shift(),M.unshift(e);var e;X(M)}()))}R>0||(function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)e=n.preRun.shift(),F.unshift(e);var e;X(F)}(),R>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((()=>{setTimeout((()=>n.setStatus("")),1),e()}),1)):e()))}if(n.addRunDependency=U,n.removeRunDependency=L,n.FS_createPreloadedFile=be,n.FS_unlink=e=>Ee.unlink(e),n.FS_createPath=nr,n.FS_createDevice=ar,n.FS=Ee,n.FS_createDataFile=ye,n.FS_createLazyFile=or,O=function e(){Pr||Dr(),Pr||(O=e)},n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return Dr(),o});const ge="1.0.0";function ve(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i}let ye;var we,be,_e,Ee,Se,$e,Ce;(async()=>{ye=await fe({locateFile:(e,t)=>e.endsWith(".wasm")?"https://unpkg.com/@thorvg/lottie-player@latest/dist/thorvg-wasm.wasm":t+e})})(),function(e){e.SW="sw",e.WG="wg"}(we||(we={})),function(e){e.IDLE="idle",e.REQUESTED="requested",e.INITIALIZED="initialized"}(be||(be={})),function(e){e.GIF="gif",e.TVG="tvg",e.PNG="png"}(_e||(_e={})),function(e){e.JSON="json",e.JPG="jpg",e.PNG="png",e.SVG="svg",e.TVG="tvg"}(Ee||(Ee={})),function(e){e.Destroyed="destroyed",e.Error="error",e.Loading="loading",e.Paused="paused",e.Playing="playing",e.Stopped="stopped",e.Frozen="frozen"}(Se||(Se={})),function(e){e.Bounce="bounce",e.Normal="normal"}($e||($e={})),function(e){e.Complete="complete",e.Destroyed="destroyed",e.Error="error",e.Frame="frame",e.Freeze="freeze",e.Load="load",e.Loop="loop",e.Pause="pause",e.Play="play",e.Ready="ready",e.Stop="stop"}(Ce||(Ce={}));const Pe=async e=>{try{e=JSON.parse(e)}catch(t){const r=await(async e=>{if("string"!=typeof e)throw new Error("The url value must be a string");try{const t=new URL(e),r=await fetch(t.toString());return await r.json()}catch(e){throw new Error("An error occurred while trying to load the Lottie file from URL")}})(e);e=JSON.stringify(r)}return e},xe=async(e,t)=>{const r=new TextEncoder;let n=e;switch(typeof n){case"object":return n instanceof ArrayBuffer?new Uint8Array(n):(n=JSON.stringify(n),r.encode(n));case"string":if("json"===t)return n=await Pe(n),r.encode(n);const e=await(async e=>(await fetch(e)).arrayBuffer())(n);return new Uint8Array(e);default:throw new Error("Invalid src type")}},ke=e=>new Promise((t=>setTimeout(t,e))),Te=(e,t)=>{const r=document.createElement("a");r.setAttribute("href",URL.createObjectURL(t)),r.setAttribute("download",e),document.body.appendChild(r),r.click(),document.body.removeChild(r)};let Ae="idle";class De extends re{src;mimeType="json";renderConfig;speed=1;autoPlay=!1;count;loop=!1;direction=1;mode="normal";intermission=1;totalFrame=0;currentFrame=0;currentState="loading";get size(){return Float32Array.from(this._TVG?.size()||[0,0])}_TVG;_canvas;_imageData;_beginTime=Date.now();_counter=1;_timer;_observer;_observable=!1;async _init(){if(!ye)return;if(!this._timer)return;clearInterval(this._timer),this._timer=void 0;const e=this.renderConfig?.renderer||"sw";await(async e=>{if("sw"!==e){for(;"requested"===Ae;)await ke(100);"initialized"!==Ae&&(Ae="requested",await ye.init(),Ae="initialized")}})(e),this._TVG=new ye.TvgLottieAnimation(e,`#${this._canvas.id}`),this.src&&this.load(this.src,this.mimeType)}_viewport(){const{left:e,right:t,top:r,bottom:n}=this.getBoundingClientRect(),o=window.innerWidth,a=window.innerHeight;let i=0,s=0,l=this._canvas.width,u=this._canvas.height;e<0&&(i=Math.abs(e),l-=i),r<0&&(s=Math.abs(r),u-=s),t>o&&(l-=t-o),n>a&&(u-=n-a),this._TVG.viewport(i,s,l,u)}_observerCallback(e){const t=e[0],r=t.target;r._observable=t.isIntersecting,t.isIntersecting?"frozen"===r.currentState&&r.play():"playing"===r.currentState&&(r.freeze(),r.dispatchEvent(new CustomEvent("freeze")))}firstUpdated(e){this._canvas=this.querySelector(".thorvg"),this._canvas.id=`thorvg-${me().replaceAll("-","").substring(0,6)}`,this._canvas.width=this._canvas.offsetWidth,this._canvas.height=this._canvas.offsetHeight,this._observer=new IntersectionObserver(this._observerCallback),this._observer.observe(this),this._TVG?this.src&&this.load(this.src,this.mimeType):this._timer=setInterval(this._init.bind(this),100)}createRenderRoot(){return this.style.display="block",this}async _animLoop(){this._TVG&&await this._update()&&(this._render(),window.requestAnimationFrame(this._animLoop.bind(this)))}_loadBytes(e,t=""){if(!this._TVG.load(e,this.mimeType,this._canvas.width,this._canvas.height,t))throw new Error("Unable to load an image. Error: ",this._TVG.error());this._render(),this.dispatchEvent(new CustomEvent("load")),this.autoPlay&&this.play()}_flush(){this._canvas.getContext("2d").putImageData(this._imageData,0,0)}_render(){if(this.renderConfig?.enableDevicePixelRatio){const e=1+.75*(window.devicePixelRatio-1),{width:t,height:r}=this._canvas.getBoundingClientRect();this._canvas.width=t*e,this._canvas.height=r*e}this._TVG.resize(this._canvas.width,this._canvas.height),this._viewport();if(!this._TVG.update())return;if("wg"===this.renderConfig?.renderer)return void this._TVG.render();const e=this._TVG.render(),t=new Uint8ClampedArray(e.buffer,e.byteOffset,e.byteLength);t.length<1||(this._imageData=new ImageData(t,this._canvas.width,this._canvas.height),this._flush())}async _update(){if("playing"!==this.currentState)return!1;const e=this._TVG.duration(),t=Date.now()/1e3;if(this.currentFrame=(t-this._beginTime)/e*this.totalFrame*this.speed,-1===this.direction&&(this.currentFrame=this.totalFrame-this.currentFrame),1===this.direction&&this.currentFrame>=this.totalFrame||-1===this.direction&&this.currentFrame<=0){const e=this.count?"bounce"===this.mode?2*this.count:this.count:0;if(this.loop||e&&this._counter<e)return"bounce"===this.mode&&(this.direction=1===this.direction?-1:1,this.currentFrame=1===this.direction?0:this.totalFrame),this.count&&(this._counter+=1),await ke(this.intermission),this.play(),!0;this.dispatchEvent(new CustomEvent("complete")),this.currentState="stopped"}return this.dispatchEvent(new CustomEvent("frame",{detail:{frame:this.currentFrame}})),this._TVG.frame(this.currentFrame)}_frame(e){this.pause(),this.currentFrame=e,this._TVG.frame(e)}async load(e,t="json"){try{await this._init();const r=await xe(e,t);this.dispatchEvent(new CustomEvent("ready")),this.mimeType=t,await this._loadBytes(r)}catch(e){this.currentState="error",this.dispatchEvent(new CustomEvent("error"))}}play(){if("json"===this.mimeType&&(this.totalFrame=this._TVG.totalFrame(),!(this.totalFrame<1)&&(this._beginTime=Date.now()/1e3,"playing"!==this.currentState)))return this._observable?(this.currentState="playing",void window.requestAnimationFrame(this._animLoop.bind(this))):void(this.currentState="frozen")}pause(){this.currentState="paused",this.dispatchEvent(new CustomEvent("pause"))}stop(){this.currentState="stopped",this.currentFrame=0,this._counter=1,this.seek(0),this.dispatchEvent(new CustomEvent("stop"))}freeze(){this.currentState="frozen",this.dispatchEvent(new CustomEvent("freeze"))}async seek(e){this._frame(e),await this._update(),this._render()}resize(e,t){this._canvas.width=e,this._canvas.height=t,"playing"!==this.currentState&&this._render()}destroy(){this._TVG&&(this._TVG.delete(),this._TVG=null,this.currentState="destroyed",this._observer&&(this._observer.disconnect(),this._observer=void 0),this.dispatchEvent(new CustomEvent("destroyed")),this.remove())}term(){ye.term(),ye=null}setLooping(e){this._TVG&&(this.loop=e)}setDirection(e){this._TVG&&(this.direction=e)}setSpeed(e){this._TVG&&(this.speed=e)}setBgColor(e){this._TVG&&(this._canvas.style.backgroundColor=e)}save(e){if(!this._TVG)return;const t=`output.${e}`;if("png"===e)return void this._canvas.toBlob((e=>{e&&Te("output.png",e)}),"image/png");if(!this._TVG.save(e))throw new Error("Unable to save. Error: ",this._TVG.error());const r=ye.FS.readFile(t);if("gif"===e&&r.length<6)throw new Error("Unable to save the GIF data. The generated file size is invalid.");if("tvg"===e&&r.length<33)throw new Error("Unable to save the TVG data. The generated file size is invalid.");const n=new Blob([r],{type:"application/octet-stream"});Te(t,n)}getVersion(){return{THORVG_VERSION:ge}}render(){return z`
1
+ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),n=new WeakMap;let o=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const r=this.t;if(t&&void 0===e){const t=void 0!==r&&1===r.length;t&&(e=n.get(r)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&n.set(r,e))}return e}toString(){return this.cssText}};const a=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return(e=>new o("string"==typeof e?e:e+"",void 0,r))(t)})(e):e,{is:i,defineProperty:s,getOwnPropertyDescriptor:l,getOwnPropertyNames:u,getOwnPropertySymbols:c,getPrototypeOf:d}=Object,h=globalThis,m=h.trustedTypes,p=m?m.emptyScript:"",f=h.reactiveElementPolyfillSupport,g=(e,t)=>e,v={toAttribute(e,t){switch(t){case Boolean:e=e?p:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(e){r=null}}return r}},y=(e,t)=>!i(e,t),w={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),h.litPropertyMetadata??=new WeakMap;class b extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=w){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(e,r,t);void 0!==n&&s(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:o}=l(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return n?.call(this)},set(t){const a=n?.call(this);o.call(this,t),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??w}static _$Ei(){if(this.hasOwnProperty(g("elementProperties")))return;const e=d(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(g("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(g("properties"))){const e=this.properties,t=[...u(e),...c(e)];for(const r of t)this.createProperty(r,e[r])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,r]of t)this.elementProperties.set(e,r)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const r=this._$Eu(e,t);void 0!==r&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const e of r)t.unshift(a(e))}else void 0!==e&&t.push(a(e));return t}static _$Eu(e,t){const r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((r,n)=>{if(t)r.adoptedStyleSheets=n.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const t of n){const n=document.createElement("style"),o=e.litNonce;void 0!==o&&n.setAttribute("nonce",o),n.textContent=t.cssText,r.appendChild(n)}})(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EC(e,t){const r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(void 0!==n&&!0===r.reflect){const o=(void 0!==r.converter?.toAttribute?r.converter:v).toAttribute(t,r.type);this._$Em=e,null==o?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(e,t){const r=this.constructor,n=r._$Eh.get(e);if(void 0!==n&&this._$Em!==n){const e=r.getPropertyOptions(n),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:v;this._$Em=n,this[n]=o.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,r){if(void 0!==e){if(r??=this.constructor.getPropertyOptions(e),!(r.hasChanged??y)(this[e],t))return;this.P(e,t,r)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,r){this._$AL.has(e)||this._$AL.set(e,t),!0===r.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,r]of e)!0!==r.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],r)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[g("elementProperties")]=new Map,b[g("finalized")]=new Map,f?.({ReactiveElement:b}),(h.reactiveElementVersions??=[]).push("2.0.4");const _=globalThis,E=_.trustedTypes,S=E?E.createPolicy("lit-html",{createHTML:e=>e}):void 0,$="$lit$",C=`lit$${Math.random().toFixed(9).slice(2)}$`,x="?"+C,P=`<${x}>`,k=document,T=()=>k.createComment(""),A=e=>null===e||"object"!=typeof e&&"function"!=typeof e,D=Array.isArray,F="[ \t\n\f\r]",B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,R=/-->/g,M=/>/g,O=RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),U=/'/g,L=/"/g,j=/^(?:script|style|textarea|title)$/i,z=(e=>(t,...r)=>({_$litType$:e,strings:t,values:r}))(1),N=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),V=new WeakMap,W=k.createTreeWalker(k,129);function H(e,t){if(!D(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==S?S.createHTML(t):t}class G{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let o=0,a=0;const i=e.length-1,s=this.parts,[l,u]=((e,t)=>{const r=e.length-1,n=[];let o,a=2===t?"<svg>":3===t?"<math>":"",i=B;for(let t=0;t<r;t++){const r=e[t];let s,l,u=-1,c=0;for(;c<r.length&&(i.lastIndex=c,l=i.exec(r),null!==l);)c=i.lastIndex,i===B?"!--"===l[1]?i=R:void 0!==l[1]?i=M:void 0!==l[2]?(j.test(l[2])&&(o=RegExp("</"+l[2],"g")),i=O):void 0!==l[3]&&(i=O):i===O?">"===l[0]?(i=o??B,u=-1):void 0===l[1]?u=-2:(u=i.lastIndex-l[2].length,s=l[1],i=void 0===l[3]?O:'"'===l[3]?L:U):i===L||i===U?i=O:i===R||i===M?i=B:(i=O,o=void 0);const d=i===O&&e[t+1].startsWith("/>")?" ":"";a+=i===B?r+P:u>=0?(n.push(s),r.slice(0,u)+$+r.slice(u)+C+d):r+C+(-2===u?t:d)}return[H(e,a+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),n]})(e,t);if(this.el=G.createElement(l,r),W.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=W.nextNode())&&s.length<i;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith($)){const t=u[a++],r=n.getAttribute(e).split(C),i=/([.?@])?(.*)/.exec(t);s.push({type:1,index:o,name:i[2],strings:r,ctor:"."===i[1]?K:"?"===i[1]?Z:"@"===i[1]?Y:J}),n.removeAttribute(e)}else e.startsWith(C)&&(s.push({type:6,index:o}),n.removeAttribute(e));if(j.test(n.tagName)){const e=n.textContent.split(C),t=e.length-1;if(t>0){n.textContent=E?E.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],T()),W.nextNode(),s.push({type:2,index:++o});n.append(e[t],T())}}}else if(8===n.nodeType)if(n.data===x)s.push({type:2,index:o});else{let e=-1;for(;-1!==(e=n.data.indexOf(C,e+1));)s.push({type:7,index:o}),e+=C.length-1}o++}}static createElement(e,t){const r=k.createElement("template");return r.innerHTML=e,r}}function q(e,t,r=e,n){if(t===N)return t;let o=void 0!==n?r.o?.[n]:r.l;const a=A(t)?void 0:t._$litDirective$;return o?.constructor!==a&&(o?._$AO?.(!1),void 0===a?o=void 0:(o=new a(e),o._$AT(e,r,n)),void 0!==n?(r.o??=[])[n]=o:r.l=o),void 0!==o&&(t=q(e,o._$AS(e,t.values),o,n)),t}class Q{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:r}=this._$AD,n=(e?.creationScope??k).importNode(t,!0);W.currentNode=n;let o=W.nextNode(),a=0,i=0,s=r[0];for(;void 0!==s;){if(a===s.index){let t;2===s.type?t=new X(o,o.nextSibling,this,e):1===s.type?t=new s.ctor(o,s.name,s.strings,this,e):6===s.type&&(t=new ee(o,this,e)),this._$AV.push(t),s=r[++i]}a!==s?.index&&(o=W.nextNode(),a++)}return W.currentNode=k,n}p(e){let t=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}class X{get _$AU(){return this._$AM?._$AU??this.v}constructor(e,t,r,n){this.type=2,this._$AH=I,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this.v=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=q(this,e,t),A(e)?e===I||null==e||""===e?(this._$AH!==I&&this._$AR(),this._$AH=I):e!==this._$AH&&e!==N&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>D(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==I&&A(this._$AH)?this._$AA.nextSibling.data=e:this.T(k.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:r}=e,n="number"==typeof r?this._$AC(e):(void 0===r.el&&(r.el=G.createElement(H(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{const e=new Q(n,this),r=e.u(this.options);e.p(t),this.T(r),this._$AH=e}}_$AC(e){let t=V.get(e.strings);return void 0===t&&V.set(e.strings,t=new G(e)),t}k(e){D(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,n=0;for(const o of e)n===t.length?t.push(r=new X(this.O(T()),this.O(T()),this,this.options)):r=t[n],r._$AI(o),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this.v=e,this._$AP?.(e))}}class J{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,o){this.type=1,this._$AH=I,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=o,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=I}_$AI(e,t=this,r,n){const o=this.strings;let a=!1;if(void 0===o)e=q(this,e,t,0),a=!A(e)||e!==this._$AH&&e!==N,a&&(this._$AH=e);else{const n=e;let i,s;for(e=o[0],i=0;i<o.length-1;i++)s=q(this,n[r+i],t,i),s===N&&(s=this._$AH[i]),a||=!A(s)||s!==this._$AH[i],s===I?e=I:e!==I&&(e+=(s??"")+o[i+1]),this._$AH[i]=s}a&&!n&&this.j(e)}j(e){e===I?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class K extends J{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===I?void 0:e}}class Z extends J{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==I)}}class Y extends J{constructor(e,t,r,n,o){super(e,t,r,n,o),this.type=5}_$AI(e,t=this){if((e=q(this,e,t,0)??I)===N)return;const r=this._$AH,n=e===I&&r!==I||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==I&&(r===I||n);n&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class ee{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){q(this,e)}}const te=_.litHtmlPolyfillSupport;te?.(G,X),(_.litHtmlVersions??=[]).push("3.2.0");class re extends b{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=((e,t,r)=>{const n=r?.renderBefore??t;let o=n._$litPart$;if(void 0===o){const e=r?.renderBefore??null;n._$litPart$=o=new X(t.insertBefore(T(),e),e,void 0,r??{})}return o._$AI(e),o})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return N}}re._$litElement$=!0,re.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:re});const ne=globalThis.litElementPolyfillSupport;ne?.({LitElement:re}),(globalThis.litElementVersions??=[]).push("4.1.0");const oe={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y},ae=(e=oe,t,r)=>{const{kind:n,metadata:o}=r;let a=globalThis.litPropertyMetadata.get(o);if(void 0===a&&globalThis.litPropertyMetadata.set(o,a=new Map),a.set(r.name,e),"accessor"===n){const{name:n}=r;return{set(r){const o=t.get.call(this);t.set.call(this,r),this.requestUpdate(n,o,e)},init(t){return void 0!==t&&this.P(n,void 0,e),t}}}if("setter"===n){const{name:n}=r;return function(r){const o=this[n];t.call(this,r),this.requestUpdate(n,o,e)}}throw Error("Unsupported decorator location: "+n)};function ie(e){return(t,r)=>"object"==typeof r?ae(e,t,r):((e,t,r)=>{const n=t.hasOwnProperty(r);return t.constructor.createProperty(r,n?{...e,wrapped:!0}:e),n?Object.getOwnPropertyDescriptor(t,r):void 0})(e,t,r)}for(var se,le=[],ue=0;ue<256;++ue)le.push((ue+256).toString(16).slice(1));var ce=new Uint8Array(16);function de(){if(!se&&!(se="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return se(ce)}var he={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function me(e,t,r){if(he.randomUUID&&!t&&!e)return he.randomUUID();var n=(e=e||{}).random||(e.rng||de)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e,t=0){return(le[e[t+0]]+le[e[t+1]]+le[e[t+2]]+le[e[t+3]]+"-"+le[e[t+4]]+le[e[t+5]]+"-"+le[e[t+6]]+le[e[t+7]]+"-"+le[e[t+8]]+le[e[t+9]]+"-"+le[e[t+10]]+le[e[t+11]]+le[e[t+12]]+le[e[t+13]]+le[e[t+14]]+le[e[t+15]]).toLowerCase()}(n)}var pe,fe=(pe=import.meta.url,async function(e={}){var t,r,n=e,o=new Promise(((e,n)=>{t=e,r=n})),a="object"==typeof window,i="function"==typeof importScripts,s="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(s){const{createRequire:e}=await Promise.resolve().then((function(){return Fe}));var l=e(import.meta.url)}var u,c,d=Object.assign({},n),h="./this.program",m=(e,t)=>{throw t},p="";if(s){var f=l("fs"),g=l("path");p=l("url").fileURLToPath(new URL("./",import.meta.url)),c=e=>(e=W(e)?new URL(e):g.normalize(e),f.readFileSync(e)),u=(e,t=!0)=>(e=W(e)?new URL(e):g.normalize(e),new Promise(((r,n)=>{f.readFile(e,t?void 0:"utf8",((e,o)=>{e?n(e):r(t?o.buffer:o)}))}))),!n.thisProgram&&process.argv.length>1&&(h=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),m=(e,t)=>{throw process.exitCode=e,t}}else(a||i)&&(i?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),pe&&(p=pe),p=p.startsWith("blob:")?"":p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1),i&&(c=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),u=e=>W(e)?new Promise(((t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r(n.status)},n.onerror=r,n.send(null)})):fetch(e,{credentials:"same-origin"}).then((e=>e.ok?e.arrayBuffer():Promise.reject(new Error(e.status+" : "+e.url)))));var v=n.print||console.log.bind(console),y=n.printErr||console.error.bind(console);Object.assign(n,d),d=null,n.arguments&&n.arguments,n.thisProgram&&(h=n.thisProgram);var w,b,_,E,S,$,C,x,P,k,T=n.wasmBinary,A=!1;function D(){var e=w.buffer;n.HEAP8=_=new Int8Array(e),n.HEAP16=S=new Int16Array(e),n.HEAPU8=E=new Uint8Array(e),n.HEAPU16=$=new Uint16Array(e),n.HEAP32=C=new Int32Array(e),n.HEAPU32=x=new Uint32Array(e),n.HEAPF32=P=new Float32Array(e),n.HEAPF64=k=new Float64Array(e)}var F=[],B=[],R=[],M=0,O=null;function U(e){M++,n.monitorRunDependencies?.(M)}function L(e){if(M--,n.monitorRunDependencies?.(M),0==M&&O){var t=O;O=null,t()}}function j(e){n.onAbort?.(e),y(e="Aborted("+e+")"),A=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw r(t),t}var z,N,I,V=e=>e.startsWith("data:application/octet-stream;base64,"),W=e=>e.startsWith("file://");function H(){if(n.locateFile){var e="thorvg-wasm.wasm";return V(e)?e:(t=e,n.locateFile?n.locateFile(t,p):p+t)}var t;return new URL("thorvg-wasm.wasm",import.meta.url).href}function G(e){if(e==z&&T)return new Uint8Array(T);if(c)return c(e);throw"both async and sync fetching of the wasm failed"}function q(e,t,r){return function(e){return T?Promise.resolve().then((()=>G(e))):u(e).then((e=>new Uint8Array(e)),(()=>G(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then(r,(e=>{y(`failed to asynchronously prepare wasm: ${e}`),j(e)}))}function Q(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var X=e=>{for(;e.length>0;)e.shift()(n)},J=n.noExitRuntime||!0,K=e=>pr(e),Z=()=>gr(),Y="undefined"!=typeof TextDecoder?new TextDecoder:void 0,ee=(e,t,r)=>{for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&Y)return Y.decode(e.subarray(t,o));for(var a="";t<o;){var i=e[t++];if(128&i){var s=63&e[t++];if(192!=(224&i)){var l=63&e[t++];if((i=224==(240&i)?(15&i)<<12|s<<6|l:(7&i)<<18|s<<12|l<<6|63&e[t++])<65536)a+=String.fromCharCode(i);else{var u=i-65536;a+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},te=(e,t)=>e?ee(E,e,t):"";function re(){var e=C[+Se.varargs>>2];return Se.varargs+=4,e}var ne=re,oe={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=oe.isAbs(e),r="/"===e.substr(-1);return e=oe.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"),e||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=oe.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=oe.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:(...e)=>oe.normalize(e.join("/")),join2:(e,t)=>oe.normalize(e+"/"+t)},ae=e=>(ae=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(s)try{var e=l("crypto");if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch(e){}j("initRandomDevice")})())(e),ie={resolve:(...e)=>{for(var t="",r=!1,n=e.length-1;n>=-1&&!r;n--){var o=n>=0?e[n]:Ee.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";t=o+"/"+t,r=oe.isAbs(o)}return t=oe.normalizeArray(t.split("/").filter((e=>!!e)),!r).join("/"),(r?"/":"")+t||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=ie.resolve(e).substr(1),t=ie.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var l=[];for(s=i;s<n.length;s++)l.push("..");return(l=l.concat(o.slice(i))).join("/")}},se=[],le=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},ue=(e,t,r,n)=>{if(!(n>0))return 0;for(var o=r,a=r+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(r>=a)break;t[r++]=s}else if(s<=2047){if(r+1>=a)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=a)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=a)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o};function ce(e,t,r){var n=le(e)+1,o=new Array(n),a=ue(e,o,0,o.length);return o.length=a,o}var de,he,me,fe={ttys:[],init(){},shutdown(){},register(e,t){fe.ttys[e]={input:[],output:[],ops:t},Ee.registerDevice(e,fe.stream_ops)},stream_ops:{open(e){var t=fe.ttys[e.node.rdev];if(!t)throw new Ee.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new Ee.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Ee.ErrnoError(29)}if(void 0===s&&0===a)throw new Ee.ErrnoError(6);if(null==s)break;a++,t[r+i]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new Ee.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,t[r+a])}catch(e){throw new Ee.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!se.length){var e=null;if(s){var t=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=f.readSync(n,t,0,256)}catch(e){if(!e.toString().includes("EOF"))throw e;r=0}r>0&&(e=t.slice(0,r).toString("utf-8"))}else"undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(e=window.prompt("Input: "))&&(e+="\n");if(!e)return null;se=ce(e)}return se.shift()})(),put_char(e,t){null===t||10===t?(v(ee(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(v(ee(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[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]}),ioctl_tcsets:(e,t,r)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(y(ee(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(y(ee(e.output,0)),e.output=[])}}},ge=e=>{j()},ve={ops_table:null,mount:e=>ve.createNode(null,"/",16895,0),createNode(e,t,r,n){if(Ee.isBlkdev(r)||Ee.isFIFO(r))throw new Ee.ErrnoError(63);ve.ops_table||={dir:{node:{getattr:ve.node_ops.getattr,setattr:ve.node_ops.setattr,lookup:ve.node_ops.lookup,mknod:ve.node_ops.mknod,rename:ve.node_ops.rename,unlink:ve.node_ops.unlink,rmdir:ve.node_ops.rmdir,readdir:ve.node_ops.readdir,symlink:ve.node_ops.symlink},stream:{llseek:ve.stream_ops.llseek}},file:{node:{getattr:ve.node_ops.getattr,setattr:ve.node_ops.setattr},stream:{llseek:ve.stream_ops.llseek,read:ve.stream_ops.read,write:ve.stream_ops.write,allocate:ve.stream_ops.allocate,mmap:ve.stream_ops.mmap,msync:ve.stream_ops.msync}},link:{node:{getattr:ve.node_ops.getattr,setattr:ve.node_ops.setattr,readlink:ve.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ve.node_ops.getattr,setattr:ve.node_ops.setattr},stream:Ee.chrdev_stream_ops}};var o=Ee.createNode(e,t,r,n);return Ee.isDir(o.mode)?(o.node_ops=ve.ops_table.dir.node,o.stream_ops=ve.ops_table.dir.stream,o.contents={}):Ee.isFile(o.mode)?(o.node_ops=ve.ops_table.file.node,o.stream_ops=ve.ops_table.file.stream,o.usedBytes=0,o.contents=null):Ee.isLink(o.mode)?(o.node_ops=ve.ops_table.link.node,o.stream_ops=ve.ops_table.link.stream):Ee.isChrdev(o.mode)&&(o.node_ops=ve.ops_table.chrdev.node,o.stream_ops=ve.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=Ee.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Ee.isDir(e.mode)?t.size=4096:Ee.isFile(e.mode)?t.size=e.usedBytes:Ee.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&ve.resizeFileStorage(e,t.size)},lookup(e,t){throw Ee.genericErrors[44]},mknod:(e,t,r,n)=>ve.createNode(e,t,r,n),rename(e,t,r){if(Ee.isDir(e.mode)){var n;try{n=Ee.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Ee.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=Ee.lookupNode(e,t);for(var n in r.contents)throw new Ee.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r of Object.keys(e.contents))t.push(r);return t},symlink(e,t,r){var n=ve.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!Ee.isLink(e.mode))throw new Ee.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)t.set(a.subarray(o,o+i),r);else for(var s=0;s<i;s++)t[r+s]=a[o+s];return i},write(e,t,r,n,o,a){if(t.buffer===_.buffer&&(a=!1),!n)return 0;var i=e.node;if(i.timestamp=Date.now(),t.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=t.subarray(r,r+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=t.slice(r,r+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(t.subarray(r,r+n),o),n}if(ve.expandFileStorage(i,o+n),i.contents.subarray&&t.subarray)i.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=t[r+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&Ee.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Ee.ErrnoError(28);return n},allocate(e,t,r){ve.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,n,o){if(!Ee.isFile(e.node.mode))throw new Ee.ErrnoError(43);var a,i,s=e.node.contents;if(2&o||!s||s.buffer!==_.buffer){if(i=!0,!(a=ge()))throw new Ee.ErrnoError(48);s&&((r>0||r+t<s.length)&&(s=s.subarray?s.subarray(r,r+t):Array.prototype.slice.call(s,r,r+t)),_.set(s,a))}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(e,t,r,n,o)=>(ve.stream_ops.write(e,t,0,n,r,!1),0)}},ye=(e,t,r,n,o,a)=>{Ee.createDataFile(e,t,r,n,o,a)},we=n.preloadPlugins||[],be=(e,t,r,n,o,a,i,s,l,c)=>{var d=t?ie.resolve(oe.join2(e,t)):e;function h(r){function u(r){c?.(),s||ye(e,t,r,n,o,l),a?.(),L()}((e,t,r,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return we.forEach((a=>{o||a.canHandle(t)&&(a.handle(e,t,r,n),o=!0)})),o})(r,d,u,(()=>{i?.(),L()}))||u(r)}U(),"string"==typeof r?((e,t,r)=>{var n=`al ${e}`;u(e).then((e=>{t(new Uint8Array(e)),n&&L()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),n&&U()})(r,h,i):h(r)},_e=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},Ee={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Ee.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return Ee.isDir(this.mode)}get isDevice(){return Ee.isChrdev(this.mode)}},lookupPath(e,t={}){if(!(e=ie.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Ee.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=Ee.root,o="/",a=0;a<r.length;a++){var i=a===r.length-1;if(i&&t.parent)break;if(n=Ee.lookupNode(n,r[a]),o=oe.join2(o,r[a]),Ee.isMountpoint(n)&&(!i||i&&t.follow_mount)&&(n=n.mounted.root),!i||t.follow)for(var s=0;Ee.isLink(n.mode);){var l=Ee.readlink(o);if(o=ie.resolve(oe.dirname(o),l),n=Ee.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Ee.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var t;;){if(Ee.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Ee.nameTable.length},hashAddNode(e){var t=Ee.hashName(e.parent.id,e.name);e.name_next=Ee.nameTable[t],Ee.nameTable[t]=e},hashRemoveNode(e){var t=Ee.hashName(e.parent.id,e.name);if(Ee.nameTable[t]===e)Ee.nameTable[t]=e.name_next;else for(var r=Ee.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=Ee.mayLookup(e);if(r)throw new Ee.ErrnoError(r);for(var n=Ee.hashName(e.id,t),o=Ee.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===t)return o}return Ee.lookup(e,t)},createNode(e,t,r,n){var o=new Ee.FSNode(e,t,r,n);return Ee.hashAddNode(o),o},destroyNode(e){Ee.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>Ee.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup(e){if(!Ee.isDir(e.mode))return 54;var t=Ee.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{return Ee.lookupNode(e,t),20}catch(e){}return Ee.nodePermissions(e,"wx")},mayDelete(e,t,r){var n;try{n=Ee.lookupNode(e,t)}catch(e){return e.errno}var o=Ee.nodePermissions(e,"wx");if(o)return o;if(r){if(!Ee.isDir(n.mode))return 54;if(Ee.isRoot(n)||Ee.getPath(n)===Ee.cwd())return 10}else if(Ee.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Ee.isLink(e.mode)?32:Ee.isDir(e.mode)&&("r"!==Ee.flagsToPermissionString(t)||512&t)?31:Ee.nodePermissions(e,Ee.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=Ee.MAX_OPEN_FDS;e++)if(!Ee.streams[e])return e;throw new Ee.ErrnoError(33)},getStreamChecked(e){var t=Ee.getStream(e);if(!t)throw new Ee.ErrnoError(8);return t},getStream:e=>Ee.streams[e],createStream:(e,t=-1)=>(e=Object.assign(new Ee.FSStream,e),-1==t&&(t=Ee.nextfd()),e.fd=t,Ee.streams[t]=e,e),closeStream(e){Ee.streams[e]=null},dupStream(e,t=-1){var r=Ee.createStream(e,t);return r.stream_ops?.dup?.(r),r},chrdev_stream_ops:{open(e){var t=Ee.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new Ee.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){Ee.devices[e]={stream_ops:t}},getDevice:e=>Ee.devices[e],getMounts(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push(...n.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),Ee.syncFSRequests++,Ee.syncFSRequests>1&&y(`warning: ${Ee.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Ee.getMounts(Ee.root.mount),n=0;function o(e){return Ee.syncFSRequests--,t(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((t=>{if(!t.type.syncfs)return a(null);t.type.syncfs(t,e,a)}))},mount(e,t,r){var n,o="/"===r,a=!r;if(o&&Ee.root)throw new Ee.ErrnoError(10);if(!o&&!a){var i=Ee.lookupPath(r,{follow_mount:!1});if(r=i.path,n=i.node,Ee.isMountpoint(n))throw new Ee.ErrnoError(10);if(!Ee.isDir(n.mode))throw new Ee.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,o?Ee.root=l:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),l},unmount(e){var t=Ee.lookupPath(e,{follow_mount:!1});if(!Ee.isMountpoint(t.node))throw new Ee.ErrnoError(28);var r=t.node,n=r.mounted,o=Ee.getMounts(n);Object.keys(Ee.nameTable).forEach((e=>{for(var t=Ee.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Ee.destroyNode(t),t=r}})),r.mounted=null;var a=r.mount.mounts.indexOf(n);r.mount.mounts.splice(a,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,r){var n=Ee.lookupPath(e,{parent:!0}).node,o=oe.basename(e);if(!o||"."===o||".."===o)throw new Ee.ErrnoError(28);var a=Ee.mayCreate(n,o);if(a)throw new Ee.ErrnoError(a);if(!n.node_ops.mknod)throw new Ee.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Ee.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Ee.mknod(e,t,0)),mkdirTree(e,t){for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{Ee.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,Ee.mknod(e,t,r)),symlink(e,t){if(!ie.resolve(e))throw new Ee.ErrnoError(44);var r=Ee.lookupPath(t,{parent:!0}).node;if(!r)throw new Ee.ErrnoError(44);var n=oe.basename(t),o=Ee.mayCreate(r,n);if(o)throw new Ee.ErrnoError(o);if(!r.node_ops.symlink)throw new Ee.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename(e,t){var r,n,o=oe.dirname(e),a=oe.dirname(t),i=oe.basename(e),s=oe.basename(t);if(r=Ee.lookupPath(e,{parent:!0}).node,n=Ee.lookupPath(t,{parent:!0}).node,!r||!n)throw new Ee.ErrnoError(44);if(r.mount!==n.mount)throw new Ee.ErrnoError(75);var l,u=Ee.lookupNode(r,i),c=ie.relative(e,a);if("."!==c.charAt(0))throw new Ee.ErrnoError(28);if("."!==(c=ie.relative(t,o)).charAt(0))throw new Ee.ErrnoError(55);try{l=Ee.lookupNode(n,s)}catch(e){}if(u!==l){var d=Ee.isDir(u.mode),h=Ee.mayDelete(r,i,d);if(h)throw new Ee.ErrnoError(h);if(h=l?Ee.mayDelete(n,s,d):Ee.mayCreate(n,s))throw new Ee.ErrnoError(h);if(!r.node_ops.rename)throw new Ee.ErrnoError(63);if(Ee.isMountpoint(u)||l&&Ee.isMountpoint(l))throw new Ee.ErrnoError(10);if(n!==r&&(h=Ee.nodePermissions(r,"w")))throw new Ee.ErrnoError(h);Ee.hashRemoveNode(u);try{r.node_ops.rename(u,n,s),u.parent=n}catch(e){throw e}finally{Ee.hashAddNode(u)}}},rmdir(e){var t=Ee.lookupPath(e,{parent:!0}).node,r=oe.basename(e),n=Ee.lookupNode(t,r),o=Ee.mayDelete(t,r,!0);if(o)throw new Ee.ErrnoError(o);if(!t.node_ops.rmdir)throw new Ee.ErrnoError(63);if(Ee.isMountpoint(n))throw new Ee.ErrnoError(10);t.node_ops.rmdir(t,r),Ee.destroyNode(n)},readdir(e){var t=Ee.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Ee.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=Ee.lookupPath(e,{parent:!0}).node;if(!t)throw new Ee.ErrnoError(44);var r=oe.basename(e),n=Ee.lookupNode(t,r),o=Ee.mayDelete(t,r,!1);if(o)throw new Ee.ErrnoError(o);if(!t.node_ops.unlink)throw new Ee.ErrnoError(63);if(Ee.isMountpoint(n))throw new Ee.ErrnoError(10);t.node_ops.unlink(t,r),Ee.destroyNode(n)},readlink(e){var t=Ee.lookupPath(e).node;if(!t)throw new Ee.ErrnoError(44);if(!t.node_ops.readlink)throw new Ee.ErrnoError(28);return ie.resolve(Ee.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var r=Ee.lookupPath(e,{follow:!t}).node;if(!r)throw new Ee.ErrnoError(44);if(!r.node_ops.getattr)throw new Ee.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Ee.stat(e,!0),chmod(e,t,r){var n;if(!(n="string"==typeof e?Ee.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Ee.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod(e,t){Ee.chmod(e,t,!0)},fchmod(e,t){var r=Ee.getStreamChecked(e);Ee.chmod(r.node,t)},chown(e,t,r,n){var o;if(!(o="string"==typeof e?Ee.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Ee.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,t,r){Ee.chown(e,t,r,!0)},fchown(e,t,r){var n=Ee.getStreamChecked(e);Ee.chown(n.node,t,r)},truncate(e,t){if(t<0)throw new Ee.ErrnoError(28);var r;if(!(r="string"==typeof e?Ee.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Ee.ErrnoError(63);if(Ee.isDir(r.mode))throw new Ee.ErrnoError(31);if(!Ee.isFile(r.mode))throw new Ee.ErrnoError(28);var n=Ee.nodePermissions(r,"w");if(n)throw new Ee.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=Ee.getStreamChecked(e);if(!(2097155&r.flags))throw new Ee.ErrnoError(28);Ee.truncate(r.node,t)},utime(e,t,r){var n=Ee.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open(e,t,r){if(""===e)throw new Ee.ErrnoError(44);var o;if(r=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&(r=void 0===r?438:r)|32768:0,"object"==typeof e)o=e;else{e=oe.normalize(e);try{o=Ee.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var a=!1;if(64&t)if(o){if(128&t)throw new Ee.ErrnoError(20)}else o=Ee.mknod(e,r,0),a=!0;if(!o)throw new Ee.ErrnoError(44);if(Ee.isChrdev(o.mode)&&(t&=-513),65536&t&&!Ee.isDir(o.mode))throw new Ee.ErrnoError(54);if(!a){var i=Ee.mayOpen(o,t);if(i)throw new Ee.ErrnoError(i)}512&t&&!a&&Ee.truncate(o,0),t&=-131713;var s=Ee.createStream({node:o,path:Ee.getPath(o),flags:t,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!n.logReadFiles||1&t||(Ee.readFiles||(Ee.readFiles={}),e in Ee.readFiles||(Ee.readFiles[e]=1)),s},close(e){if(Ee.isClosed(e))throw new Ee.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Ee.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,r){if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Ee.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Ee.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,n,o){if(n<0||o<0)throw new Ee.ErrnoError(28);if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(1==(2097155&e.flags))throw new Ee.ErrnoError(8);if(Ee.isDir(e.node.mode))throw new Ee.ErrnoError(31);if(!e.stream_ops.read)throw new Ee.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new Ee.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,t,r,n,o);return a||(e.position+=i),i},write(e,t,r,n,o,a){if(n<0||o<0)throw new Ee.ErrnoError(28);if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(!(2097155&e.flags))throw new Ee.ErrnoError(8);if(Ee.isDir(e.node.mode))throw new Ee.ErrnoError(31);if(!e.stream_ops.write)throw new Ee.ErrnoError(28);e.seekable&&1024&e.flags&&Ee.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new Ee.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,a);return i||(e.position+=s),s},allocate(e,t,r){if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(t<0||r<=0)throw new Ee.ErrnoError(28);if(!(2097155&e.flags))throw new Ee.ErrnoError(8);if(!Ee.isFile(e.node.mode)&&!Ee.isDir(e.node.mode))throw new Ee.ErrnoError(43);if(!e.stream_ops.allocate)throw new Ee.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,n,o){if(2&n&&!(2&o)&&2!=(2097155&e.flags))throw new Ee.ErrnoError(2);if(1==(2097155&e.flags))throw new Ee.ErrnoError(2);if(!e.stream_ops.mmap)throw new Ee.ErrnoError(43);if(!t)throw new Ee.ErrnoError(28);return e.stream_ops.mmap(e,t,r,n,o)},msync:(e,t,r,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new Ee.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var r,n=Ee.open(e,t.flags),o=Ee.stat(e).size,a=new Uint8Array(o);return Ee.read(n,a,0,o,0),"utf8"===t.encoding?r=ee(a,0):"binary"===t.encoding&&(r=a),Ee.close(n),r},writeFile(e,t,r={}){r.flags=r.flags||577;var n=Ee.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(le(t)+1),a=ue(t,o,0,o.length);Ee.write(n,o,0,a,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Ee.write(n,t,0,t.byteLength,void 0,r.canOwn)}Ee.close(n)},cwd:()=>Ee.currentPath,chdir(e){var t=Ee.lookupPath(e,{follow:!0});if(null===t.node)throw new Ee.ErrnoError(44);if(!Ee.isDir(t.node.mode))throw new Ee.ErrnoError(54);var r=Ee.nodePermissions(t.node,"x");if(r)throw new Ee.ErrnoError(r);Ee.currentPath=t.path},createDefaultDirectories(){Ee.mkdir("/tmp"),Ee.mkdir("/home"),Ee.mkdir("/home/web_user")},createDefaultDevices(){Ee.mkdir("/dev"),Ee.registerDevice(Ee.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),Ee.mkdev("/dev/null",Ee.makedev(1,3)),fe.register(Ee.makedev(5,0),fe.default_tty_ops),fe.register(Ee.makedev(6,0),fe.default_tty1_ops),Ee.mkdev("/dev/tty",Ee.makedev(5,0)),Ee.mkdev("/dev/tty1",Ee.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=ae(e).byteLength),e[--t]);Ee.createDevice("/dev","random",r),Ee.createDevice("/dev","urandom",r),Ee.mkdir("/dev/shm"),Ee.mkdir("/dev/shm/tmp")},createSpecialDirectories(){Ee.mkdir("/proc");var e=Ee.mkdir("/proc/self");Ee.mkdir("/proc/self/fd"),Ee.mount({mount(){var t=Ee.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var r=+t,n=Ee.getStreamChecked(r),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams(e,t,r){e?Ee.createDevice("/dev","stdin",e):Ee.symlink("/dev/tty","/dev/stdin"),t?Ee.createDevice("/dev","stdout",null,t):Ee.symlink("/dev/tty","/dev/stdout"),r?Ee.createDevice("/dev","stderr",null,r):Ee.symlink("/dev/tty1","/dev/stderr"),Ee.open("/dev/stdin",0),Ee.open("/dev/stdout",1),Ee.open("/dev/stderr",1)},staticInit(){[44].forEach((e=>{Ee.genericErrors[e]=new Ee.ErrnoError(e),Ee.genericErrors[e].stack="<generic error, no stack>"})),Ee.nameTable=new Array(4096),Ee.mount(ve,{},"/"),Ee.createDefaultDirectories(),Ee.createDefaultDevices(),Ee.createSpecialDirectories(),Ee.filesystems={MEMFS:ve}},init(e,t,r){Ee.initialized=!0,e??=n.stdin,t??=n.stdout,r??=n.stderr,Ee.createStandardStreams(e,t,r)},quit(){Ee.initialized=!1;for(var e=0;e<Ee.streams.length;e++){var t=Ee.streams[e];t&&Ee.close(t)}},findObject(e,t){var r=Ee.analyzePath(e,t);return r.exists?r.object:null},analyzePath(e,t){try{e=(n=Ee.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Ee.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=oe.basename(e),n=Ee.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath(e,t,r,n){e="string"==typeof e?e:Ee.getPath(e);for(var o=t.split("/").reverse();o.length;){var a=o.pop();if(a){var i=oe.join2(e,a);try{Ee.mkdir(i)}catch(e){}e=i}}return i},createFile(e,t,r,n,o){var a=oe.join2("string"==typeof e?e:Ee.getPath(e),t),i=_e(n,o);return Ee.create(a,i)},createDataFile(e,t,r,n,o,a){var i=t;e&&(e="string"==typeof e?e:Ee.getPath(e),i=t?oe.join2(e,t):e);var s=_e(n,o),l=Ee.create(i,s);if(r){if("string"==typeof r){for(var u=new Array(r.length),c=0,d=r.length;c<d;++c)u[c]=r.charCodeAt(c);r=u}Ee.chmod(l,146|s);var h=Ee.open(l,577);Ee.write(h,r,0,r.length,0,a),Ee.close(h),Ee.chmod(l,s)}},createDevice(e,t,r,n){var o=oe.join2("string"==typeof e?e:Ee.getPath(e),t),a=_e(!!r,!!n);Ee.createDevice.major||(Ee.createDevice.major=64);var i=Ee.makedev(Ee.createDevice.major++,0);return Ee.registerDevice(i,{open(e){e.seekable=!1},close(e){n?.buffer?.length&&n(10)},read(e,t,n,o,a){for(var i=0,s=0;s<o;s++){var l;try{l=r()}catch(e){throw new Ee.ErrnoError(29)}if(void 0===l&&0===i)throw new Ee.ErrnoError(6);if(null==l)break;i++,t[n+s]=l}return i&&(e.node.timestamp=Date.now()),i},write(e,t,r,o,a){for(var i=0;i<o;i++)try{n(t[r+i])}catch(e){throw new Ee.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),Ee.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{e.contents=c(e.url),e.usedBytes=e.contents.length}catch(e){throw new Ee.ErrnoError(29)}},createLazyFile(e,t,r,n,o){class a{constructor(){this.lengthKnown=!1,this.chunks=[]}get(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}}setDataGetter(e){this.getter=e}cacheLength(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,i=1048576;o||(i=n);var s=this;s.setDataGetter((e=>{var t=e*i,o=(e+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ce(o.responseText||"")})(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,v("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if("undefined"!=typeof XMLHttpRequest){if(!i)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s={isDevice:!1,contents:new a}}else s={isDevice:!1,url:r};var l=Ee.createFile(e,t,s,n,o);s.contents?l.contents=s.contents:s.url&&(l.contents=null,l.url=s.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var u={};function c(e,t,r,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)t[r+s]=a[o+s];else for(s=0;s<i;s++)t[r+s]=a.get(o+s);return i}return Object.keys(l.stream_ops).forEach((e=>{var t=l.stream_ops[e];u[e]=(...e)=>(Ee.forceLoadFile(l),t(...e))})),u.read=(e,t,r,n,o)=>(Ee.forceLoadFile(l),c(e,t,r,n,o)),u.mmap=(e,t,r,n,o)=>{Ee.forceLoadFile(l);var a=ge();if(!a)throw new Ee.ErrnoError(48);return c(e,_,a,t,r),{ptr:a,allocated:!0}},l.stream_ops=u,l}},Se={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(oe.isAbs(t))return t;var n;if(n=-100===e?Ee.cwd():Se.getStreamFromFD(e).path,0==t.length){if(!r)throw new Ee.ErrnoError(44);return n}return oe.join2(n,t)},doStat(e,t,r){var n=e(t);C[r>>2]=n.dev,C[r+4>>2]=n.mode,x[r+8>>2]=n.nlink,C[r+12>>2]=n.uid,C[r+16>>2]=n.gid,C[r+20>>2]=n.rdev,I=[n.size>>>0,(N=n.size,+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],C[r+24>>2]=I[0],C[r+28>>2]=I[1],C[r+32>>2]=4096,C[r+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return I=[Math.floor(o/1e3)>>>0,(N=Math.floor(o/1e3),+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],C[r+40>>2]=I[0],C[r+44>>2]=I[1],x[r+48>>2]=o%1e3*1e3*1e3,I=[Math.floor(a/1e3)>>>0,(N=Math.floor(a/1e3),+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],C[r+56>>2]=I[0],C[r+60>>2]=I[1],x[r+64>>2]=a%1e3*1e3*1e3,I=[Math.floor(i/1e3)>>>0,(N=Math.floor(i/1e3),+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],C[r+72>>2]=I[0],C[r+76>>2]=I[1],x[r+80>>2]=i%1e3*1e3*1e3,I=[n.ino>>>0,(N=n.ino,+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],C[r+88>>2]=I[0],C[r+92>>2]=I[1],0},doMsync(e,t,r,n,o){if(!Ee.isFile(t.node.mode))throw new Ee.ErrnoError(43);if(2&n)return 0;var a=E.slice(e,e+r);Ee.msync(t,a,o,r,n)},getStreamFromFD:e=>Ee.getStreamChecked(e),varargs:void 0,getStr:e=>te(e)},$e=e=>{for(var t="",r=e;E[r];)t+=de[E[r++]];return t},Ce={},xe={},Pe={},ke=e=>{throw new he(e)},Te=e=>{throw new me(e)},Ae=(e,t,r)=>{function n(t){var n=r(t);n.length!==e.length&&Te("Mismatched type converter count");for(var o=0;o<e.length;++o)De(e[o],n[o])}e.forEach((e=>Pe[e]=t));var o=new Array(t.length),a=[],i=0;t.forEach(((e,t)=>{xe.hasOwnProperty(e)?o[t]=xe[e]:(a.push(e),Ce.hasOwnProperty(e)||(Ce[e]=[]),Ce[e].push((()=>{o[t]=xe[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)};function De(e,t,r={}){return function(e,t,r={}){var n=t.name;if(e||ke(`type "${n}" must have a positive integer typeid pointer`),xe.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;ke(`Cannot register type '${n}' twice`)}if(xe[e]=t,delete Pe[e],Ce.hasOwnProperty(e)){var o=Ce[e];delete Ce[e],o.forEach((e=>e()))}}(e,t,r)}var Be,Re=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Me=e=>{ke(e.$$.ptrType.registeredClass.name+" instance already deleted")},Oe=!1,Ue=e=>{},Le=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},je=(e,t,r)=>{if(t===r)return e;if(void 0===r.baseClass)return null;var n=je(e,t,r.baseClass);return null===n?null:r.downcast(n)},ze={},Ne=()=>Object.keys(Ge).length,Ie=()=>{var e=[];for(var t in Ge)Ge.hasOwnProperty(t)&&e.push(Ge[t]);return e},Ve=[],We=()=>{for(;Ve.length;){var e=Ve.pop();e.$$.deleteScheduled=!1,e.delete()}},He=e=>{Be=e,Ve.length&&Be&&Be(We)},Ge={},qe=(e,t)=>(t=((e,t)=>{for(void 0===t&&ke("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),Ge[t]),Qe=(e,t)=>(t.ptrType&&t.ptr||Te("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Te("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Je(Object.create(e,{$$:{value:t,writable:!0}})));function Xe(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=qe(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?Qe(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Qe(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,i=this.registeredClass.getActualType(t),s=ze[i];if(!s)return o.call(this);a=this.isConst?s.constPointerType:s.pointerType;var l=je(t,this.registeredClass,a.registeredClass);return null===l?o.call(this):this.isSmartPointer?Qe(a.registeredClass.instancePrototype,{ptrType:a,ptr:l,smartPtrType:this,smartPtr:e}):Qe(a.registeredClass.instancePrototype,{ptrType:a,ptr:l})}var Je=e=>"undefined"==typeof FinalizationRegistry?(Je=e=>e,e):(Oe=new FinalizationRegistry((e=>{Le(e.$$)})),Je=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Oe.register(e,r,e)}return e},Ue=e=>Oe.unregister(e),Je(e));function Ke(){}var Ze=(e,t)=>Object.defineProperty(t,"name",{value:e}),Ye=(e,t,r)=>{if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(...n){return e[t].overloadTable.hasOwnProperty(n.length)||ke(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[n.length].apply(this,n)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},et=(e,t,r)=>{n.hasOwnProperty(e)?((void 0===r||void 0!==n[e].overloadTable&&void 0!==n[e].overloadTable[r])&&ke(`Cannot register public name '${e}' twice`),Ye(n,e,e),n.hasOwnProperty(r)&&ke(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),n[e].overloadTable[r]=t):(n[e]=t,void 0!==r&&(n[e].numArguments=r))};function tt(e,t,r,n,o,a,i,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var rt=(e,t,r)=>{for(;t!==r;)t.upcast||ke(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function nt(e,t){if(null===t)return this.isReference&&ke(`null is not a valid ${this.name}`),0;t.$$||ke(`Cannot pass "${Bt(t)}" as a ${this.name}`),t.$$.ptr||ke(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return rt(t.$$.ptr,r,this.registeredClass)}function ot(e,t){var r;if(null===t)return this.isReference&&ke(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t&&t.$$||ke(`Cannot pass "${Bt(t)}" as a ${this.name}`),t.$$.ptr||ke(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&ke(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=rt(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&ke("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:ke(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,Dt.toHandle((()=>o.delete()))),null!==e&&e.push(this.rawDestructor,r)}break;default:ke("Unsupporting sharing policy")}return r}function at(e,t){if(null===t)return this.isReference&&ke(`null is not a valid ${this.name}`),0;t.$$||ke(`Cannot pass "${Bt(t)}" as a ${this.name}`),t.$$.ptr||ke(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&ke(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return rt(t.$$.ptr,r,this.registeredClass)}function it(e){return this.fromWireType(x[e>>2])}function st(e,t,r,n,o,a,i,s,l,u,c){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=u,this.rawDestructor=c,o||void 0!==t.baseClass?this.toWireType=ot:n?(this.toWireType=nt,this.destructorFunction=null):(this.toWireType=at,this.destructorFunction=null)}var lt,ut=(e,t,r)=>{n.hasOwnProperty(e)||Te("Replacing nonexistent public symbol"),void 0!==n[e].overloadTable&&void 0!==r?n[e].overloadTable[r]=t:(n[e]=t,n[e].argCount=r)},ct=(e,t,r=[])=>{var o=((e,t,r)=>(e=e.replace(/p/g,"i"),(0,n["dynCall_"+e])(t,...r)))(e,t,r);return o},dt=(e,t)=>{e=$e(e);var r,n,o=(r=e,n=t,(...e)=>ct(r,n,e));return"function"!=typeof o&&ke(`unknown function pointer with signature ${e}: ${t}`),o},ht=e=>{var t=cr(e),r=$e(t);return lr(t),r},mt=(e,t)=>{var r=[],n={};throw t.forEach((function e(t){n[t]||xe[t]||(Pe[t]?Pe[t].forEach(e):(r.push(t),n[t]=!0))})),new lt(`${e}: `+r.map(ht).join([", "]))},pt=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(x[t+4*n>>2]);return r},ft=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function gt(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].destructorFunction)return!0;return!1}var vt=e=>{try{return e()}catch(e){j(e)}},yt=e=>{if(e instanceof Q||"unwind"==e)return b;m(1,e)},wt=0,bt=()=>J||wt>0,_t=e=>{b=e,bt()||(n.onExit?.(e),A=!0),m(e,new Q(e))},Et=(e,t)=>{b=e,_t(e)},St=e=>{if(!A)try{e(),(()=>{if(!bt())try{Et(b)}catch(e){yt(e)}})()}catch(e){yt(e)}},$t={instrumentWasmImports(e){var t=/^(invoke_.*|__asyncjs__.*)$/;for(let[r,n]of Object.entries(e))"function"==typeof n&&(n.isAsync||t.test(r))},instrumentWasmExports(e){var t={};for(let[r,n]of Object.entries(e))t[r]="function"==typeof n?(...e)=>{$t.exportCallStack.push(r);try{return n(...e)}finally{A||($t.exportCallStack.pop(),$t.maybeStopUnwind())}}:n;return t},State:{Normal:0,Unwinding:1,Rewinding:2,Disabled:3},state:0,StackSize:4096,currData:null,handleSleepReturnValue:0,exportCallStack:[],callStackNameToId:{},callStackIdToName:{},callStackId:0,asyncPromiseHandlers:null,sleepCallbacks:[],getCallStackId(e){var t=$t.callStackNameToId[e];return void 0===t&&(t=$t.callStackId++,$t.callStackNameToId[e]=t,$t.callStackIdToName[t]=e),t},maybeStopUnwind(){$t.currData&&$t.state===$t.State.Unwinding&&0===$t.exportCallStack.length&&($t.state=$t.State.Normal,vt(kr),"undefined"!=typeof Fibers&&Fibers.trampoline())},whenDone:()=>new Promise(((e,t)=>{$t.asyncPromiseHandlers={resolve:e,reject:t}})),allocateData(){var e=ur(12+$t.StackSize);return $t.setDataHeader(e,e+12,$t.StackSize),$t.setDataRewindFunc(e),e},setDataHeader(e,t,r){x[e>>2]=t,x[e+4>>2]=t+r},setDataRewindFunc(e){var t=$t.exportCallStack[0],r=$t.getCallStackId(t);C[e+8>>2]=r},getDataRewindFuncName(e){var t=C[e+8>>2];return $t.callStackIdToName[t]},getDataRewindFunc:e=>sr[e],doRewind(e){var t=$t.getDataRewindFuncName(e);return $t.getDataRewindFunc(t)()},handleSleep(e){if(!A){if($t.state===$t.State.Normal){var t=!1,r=!1;e(((e=0)=>{if(!A&&($t.handleSleepReturnValue=e,t=!0,r)){$t.state=$t.State.Rewinding,vt((()=>Tr($t.currData))),"undefined"!=typeof Browser&&Browser.mainLoop.func&&Browser.mainLoop.resume();var n,o=!1;try{n=$t.doRewind($t.currData)}catch(e){n=e,o=!0}var a=!1;if(!$t.currData){var i=$t.asyncPromiseHandlers;i&&($t.asyncPromiseHandlers=null,(o?i.reject:i.resolve)(n),a=!0)}if(o&&!a)throw n}})),r=!0,t||($t.state=$t.State.Unwinding,$t.currData=$t.allocateData(),"undefined"!=typeof Browser&&Browser.mainLoop.func&&Browser.mainLoop.pause(),vt((()=>Pr($t.currData))))}else $t.state===$t.State.Rewinding?($t.state=$t.State.Normal,vt(Ar),lr($t.currData),$t.currData=null,$t.sleepCallbacks.forEach(St)):j(`invalid state: ${$t.state}`);return $t.handleSleepReturnValue}},handleAsync:e=>$t.handleSleep((t=>{e().then(t)}))};function Ct(e,t,r,n,o,a){var i=t.length;i<2&&ke("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==t[1]&&null!==r,l=gt(t),u="void"!==t[0].name,c=[e,ke,n,o,ft,t[0],t[1]],d=0;d<i-2;++d)c.push(t[d+2]);if(c.push($t),!l)for(d=s?1:2;d<t.length;++d)null!==t[d].destructorFunction&&c.push(t[d].destructorFunction);let[h,m]=function(e,t,r,n){var o=gt(e),a=e.length-2,i=[],s=["fn"];t&&s.push("thisWired");for(var l=0;l<a;++l)i.push(`arg${l}`),s.push(`arg${l}Wired`);i=i.join(","),s=s.join(",");var u=`\n return function (${i}) {\n if (arguments.length !== ${a}) {\n throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${a}');\n }`;o&&(u+="var destructors = [];\n");var c=o?"destructors":"null",d=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];for(t&&(u+=`var thisWired = classParam['toWireType'](${c}, this);\n`),l=0;l<a;++l)u+=`var arg${l}Wired = argType${l}['toWireType'](${c}, arg${l});\n`,d.push(`argType${l}`);u+=(r||n?"var rv = ":"")+`invoker(${s});\n`;var h=r?"rv":"";if(d.push("Asyncify"),u+=`function onDone(${h}) {\n`,o)u+="runDestructors(destructors);\n";else for(l=t?1:2;l<e.length;++l){var m=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==e[l].destructorFunction&&(u+=`${m}_dtor(${m});\n`,d.push(`${m}_dtor`))}return r&&(u+="var ret = retType['fromWireType'](rv);\nreturn ret;\n"),u+="}\n",u+=`return Asyncify.currData ? Asyncify.whenDone().then(onDone) : onDone(${h});\n`,[d,u+="}\n"]}(t,s,u,a);h.push(m);var p=function(e,t){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var r=Ze(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,o=e.apply(n,t);return o instanceof Object?o:n}(Function,h)(...c);return Ze(e,p)}var xt,Pt=e=>{const t=(e=e.trim()).indexOf("(");return-1!==t?e.substr(0,t):e},kt=[],Tt=[],At=()=>Tt.length/2-5-kt.length,Dt={toValue:e=>(e||ke("Cannot use deleted val. handle = "+e),Tt[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const t=kt.pop()||Tt.length;return Tt[t]=e,Tt[t+1]=1,t}}}},Ft={name:"emscripten::val",fromWireType:e=>{var t=Dt.toValue(e);return(e=>{e>9&&0==--Tt[e+1]&&(Tt[e]=void 0,kt.push(e))})(e),t},toWireType:(e,t)=>Dt.toHandle(t),argPackAdvance:8,readValueFromPointer:it,destructorFunction:null},Bt=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},Rt=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(P[e>>2])};case 8:return function(e){return this.fromWireType(k[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Mt=(e,t,r)=>{switch(t){case 1:return r?e=>_[e]:e=>E[e];case 2:return r?e=>S[e>>1]:e=>$[e>>1];case 4:return r?e=>C[e>>2]:e=>x[e>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Ot=(e,t,r)=>ue(e,E,t,r),Ut="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Lt=(e,t)=>{for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&$[n];)++n;if((r=n<<1)-e>32&&Ut)return Ut.decode(E.subarray(e,r));for(var a="",i=0;!(i>=t/2);++i){var s=S[e+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},jt=(e,t,r)=>{if(r??=2147483647,r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,a=0;a<o;++a){var i=e.charCodeAt(a);S[t>>1]=i,t+=2}return S[t>>1]=0,t-n},zt=e=>2*e.length,Nt=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var o=C[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},It=(e,t,r)=>{if(r??=2147483647,r<4)return 0;for(var n=t,o=n+r-4,a=0;a<e.length;++a){var i=e.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),C[t>>2]=i,(t+=4)+4>o)break}return C[t>>2]=0,t-n},Vt=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t},Wt={};xt=()=>performance.now();var Ht=e=>{var t=(e-w.buffer.byteLength+65535)/65536;try{return w.grow(t),D(),1}catch(e){}},Gt=e=>$t.handleSleep((t=>{return r=t,setTimeout((()=>{St(r)}),e);var r}));Gt.isAsync=!0;var qt,Qt,Xt,Jt={},Kt=()=>{if(!Kt.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:h||"./this.program"};for(var t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);Kt.strings=r}return Kt.strings},Zt=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN,Yt=e=>{var t=le(e)+1,r=fr(t);return Ot(e,r,t),r},er={errorCallback:(e,t,r,n)=>{var o=Z(),a=Yt(r);$r(e,t,a,n),K(o)},initManagers:()=>{function e(){this.objects={},this.nextId=1,this.create=function(e,t={}){var r=this.nextId++;return t.refcount=1,t.object=e,this.objects[r]=t,r},this.get=function(e){if(e)return this.objects[e].object},this.reference=function(e){this.objects[e].refcount++},this.release=function(e){var t=this.objects[e];t.refcount--,t.refcount<=0&&delete this.objects[e]}}er.mgrDevice||(er.mgrSurface=er.mgrSurface||new e,er.mgrSwapChain=er.mgrSwapChain||new e,er.mgrAdapter=er.mgrAdapter||new e,er.mgrDevice=er.mgrDevice||new e,er.mgrQueue=er.mgrQueue||new e,er.mgrCommandBuffer=er.mgrCommandBuffer||new e,er.mgrCommandEncoder=er.mgrCommandEncoder||new e,er.mgrRenderPassEncoder=er.mgrRenderPassEncoder||new e,er.mgrComputePassEncoder=er.mgrComputePassEncoder||new e,er.mgrBindGroup=er.mgrBindGroup||new e,er.mgrBuffer=er.mgrBuffer||new e,er.mgrSampler=er.mgrSampler||new e,er.mgrTexture=er.mgrTexture||new e,er.mgrTextureView=er.mgrTextureView||new e,er.mgrQuerySet=er.mgrQuerySet||new e,er.mgrBindGroupLayout=er.mgrBindGroupLayout||new e,er.mgrPipelineLayout=er.mgrPipelineLayout||new e,er.mgrRenderPipeline=er.mgrRenderPipeline||new e,er.mgrComputePipeline=er.mgrComputePipeline||new e,er.mgrShaderModule=er.mgrShaderModule||new e,er.mgrRenderBundleEncoder=er.mgrRenderBundleEncoder||new e,er.mgrRenderBundle=er.mgrRenderBundle||new e)},makeColor:e=>({r:k[e>>3],g:k[e+8>>3],b:k[e+16>>3],a:k[e+24>>3]}),makeExtent3D:e=>({width:x[e>>2],height:x[e+4>>2],depthOrArrayLayers:x[e+8>>2]}),makeOrigin3D:e=>({x:x[e>>2],y:x[e+4>>2],z:x[e+8>>2]}),makeImageCopyTexture:e=>({texture:er.mgrTexture.get(x[e+4>>2]),mipLevel:x[e+8>>2],origin:er.makeOrigin3D(e+12),aspect:er.TextureAspect[x[e+24>>2]]}),makeTextureDataLayout:e=>{var t=x[e+16>>2],r=x[e+20>>2];return{offset:4294967296*x[e+4+8>>2]+x[e+8>>2],bytesPerRow:4294967295===t?void 0:t,rowsPerImage:4294967295===r?void 0:r}},makeImageCopyBuffer:e=>{var t=e+8,r=er.makeTextureDataLayout(t);return r.buffer=er.mgrBuffer.get(x[e+32>>2]),r},makePipelineConstants:(e,t)=>{if(e){for(var r={},n=0;n<e;++n){var o=t+16*n;r[te(x[o+4>>2])]=k[o+8>>3]}return r}},makePipelineLayout:e=>e?er.mgrPipelineLayout.get(e):"auto",makeProgrammableStageDescriptor:e=>{if(e){var t={module:er.mgrShaderModule.get(x[e+4>>2]),constants:er.makePipelineConstants(x[e+12>>2],x[e+16>>2])},r=x[e+8>>2];return r&&(t.entryPoint=te(r)),t}},fillLimitStruct:(e,t)=>{var r=t+8;function n(t,n){var o=e[t];C[r+n>>2]=o}function o(t,n){var o=e[t];I=[o>>>0,(N=o,+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],C[r+n>>2]=I[0],C[r+(n+4)>>2]=I[1]}n("maxTextureDimension1D",0),n("maxTextureDimension2D",4),n("maxTextureDimension3D",8),n("maxTextureArrayLayers",12),n("maxBindGroups",16),n("maxBindGroupsPlusVertexBuffers",20),n("maxBindingsPerBindGroup",24),n("maxDynamicUniformBuffersPerPipelineLayout",28),n("maxDynamicStorageBuffersPerPipelineLayout",32),n("maxSampledTexturesPerShaderStage",36),n("maxSamplersPerShaderStage",40),n("maxStorageBuffersPerShaderStage",44),n("maxStorageTexturesPerShaderStage",48),n("maxUniformBuffersPerShaderStage",52),n("minUniformBufferOffsetAlignment",72),n("minStorageBufferOffsetAlignment",76),o("maxUniformBufferBindingSize",56),o("maxStorageBufferBindingSize",64),n("maxVertexBuffers",80),o("maxBufferSize",88),n("maxVertexAttributes",96),n("maxVertexBufferArrayStride",100),n("maxInterStageShaderComponents",104),n("maxInterStageShaderVariables",108),n("maxColorAttachments",112),n("maxColorAttachmentBytesPerSample",116),n("maxComputeWorkgroupStorageSize",120),n("maxComputeInvocationsPerWorkgroup",124),n("maxComputeWorkgroupSizeX",128),n("maxComputeWorkgroupSizeY",132),n("maxComputeWorkgroupSizeZ",136),n("maxComputeWorkgroupsPerDimension",140)},Int_BufferMapState:{unmapped:1,pending:2,mapped:3},Int_CompilationMessageType:{error:0,warning:1,info:2},Int_DeviceLostReason:{undefined:1,unknown:1,destroyed:2},Int_PreferredFormat:{rgba8unorm:18,bgra8unorm:23},WGSLFeatureName:[,"readonly_and_readwrite_storage_textures","packed_4x8_integer_dot_product","unrestricted_pointer_parameters","pointer_composite_access"],AddressMode:[,"clamp-to-edge","repeat","mirror-repeat"],AlphaMode:[,"opaque","premultiplied"],BlendFactor:[,"zero","one","src","one-minus-src","src-alpha","one-minus-src-alpha","dst","one-minus-dst","dst-alpha","one-minus-dst-alpha","src-alpha-saturated","constant","one-minus-constant"],BlendOperation:[,"add","subtract","reverse-subtract","min","max"],BufferBindingType:[,"uniform","storage","read-only-storage"],BufferMapState:{1:"unmapped",2:"pending",3:"mapped"},CompareFunction:[,"never","less","equal","less-equal","greater","not-equal","greater-equal","always"],CompilationInfoRequestStatus:["success","error","device-lost","unknown"],CullMode:[,"none","front","back"],ErrorFilter:{1:"validation",2:"out-of-memory",3:"internal"},FeatureName:[,"depth-clip-control","depth32float-stencil8","timestamp-query","texture-compression-bc","texture-compression-etc2","texture-compression-astc","indirect-first-instance","shader-f16","rg11b10ufloat-renderable","bgra8unorm-storage","float32-filterable"],FilterMode:[,"nearest","linear"],FrontFace:[,"ccw","cw"],IndexFormat:[,"uint16","uint32"],LoadOp:[,"clear","load"],MipmapFilterMode:[,"nearest","linear"],PowerPreference:[,"low-power","high-performance"],PrimitiveTopology:[,"point-list","line-list","line-strip","triangle-list","triangle-strip"],QueryType:{1:"occlusion",2:"timestamp"},SamplerBindingType:[,"filtering","non-filtering","comparison"],StencilOperation:[,"keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],StorageTextureAccess:[,"write-only","read-only","read-write"],StoreOp:[,"store","discard"],TextureAspect:[,"all","stencil-only","depth-only"],TextureDimension:[,"1d","2d","3d"],TextureFormat:[,"r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32float","r32uint","r32sint","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb10a2uint","rgb10a2unorm","rg11b10ufloat","rgb9e5ufloat","rg32float","rg32uint","rg32sint","rgba16uint","rgba16sint","rgba16float","rgba32float","rgba32uint","rgba32sint","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb","etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm","astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"],TextureSampleType:[,"float","unfilterable-float","depth","sint","uint"],TextureViewDimension:[,"1d","2d","2d-array","cube","cube-array","3d"],VertexFormat:[,"uint8x2","uint8x4","sint8x2","sint8x4","unorm8x2","unorm8x4","snorm8x2","snorm8x4","uint16x2","uint16x4","sint16x2","sint16x4","unorm16x2","unorm16x4","snorm16x2","snorm16x4","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4","unorm10-10-10-2"],VertexStepMode:[,"vertex-buffer-not-used","vertex","instance"],FeatureNameString2Enum:{undefined:"0","depth-clip-control":"1","depth32float-stencil8":"2","timestamp-query":"3","texture-compression-bc":"4","texture-compression-etc2":"5","texture-compression-astc":"6","indirect-first-instance":"7","shader-f16":"8","rg11b10ufloat-renderable":"9","bgra8unorm-storage":"10","float32-filterable":"11"}},tr=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],rr=e=>{var t;return e=(t=e)>2?te(t):t,tr[e]||("undefined"!=typeof document?document.querySelector(e):void 0)},nr=Ee.createPath,or=Ee.createLazyFile,ar=Ee.createDevice;Ee.createPreloadedFile=be,Ee.staticInit(),n.FS_createPath=Ee.createPath,n.FS_createDataFile=Ee.createDataFile,n.FS_createPreloadedFile=Ee.createPreloadedFile,n.FS_unlink=Ee.unlink,n.FS_createLazyFile=Ee.createLazyFile,n.FS_createDevice=Ee.createDevice,(()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);de=e})(),he=n.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},me=n.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(Ke.prototype,{isAliasOf(e){if(!(this instanceof Ke))return!1;if(!(e instanceof Ke))return!1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o},clone(){if(this.$$.ptr||Me(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Je(Object.create(Object.getPrototypeOf(this),{$$:{value:Re(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||Me(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ke("Object already scheduled for deletion"),Ue(this),Le(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Me(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ke("Object already scheduled for deletion"),Ve.push(this),1===Ve.length&&Be&&Be(We),this.$$.deleteScheduled=!0,this}}),n.getInheritedInstanceCount=Ne,n.getLiveInheritedInstances=Ie,n.flushPendingDeletes=We,n.setDelayFunction=He,Object.assign(st.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:8,readValueFromPointer:it,fromWireType:Xe}),lt=n.UnboundTypeError=(qt=Error,(Xt=Ze(Qt="UnboundTypeError",(function(e){this.name=Qt,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(qt.prototype),Xt.prototype.constructor=Xt,Xt.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},Xt),Tt.push(0,1,void 0,1,null,1,!0,1,!1,1),n.count_emval_handles=At,er.initManagers();var ir={b:(e,t,r,n)=>{j(`Assertion failed: ${te(e)}, at: `+[t?te(t):"unknown filename",r,n?te(n):"unknown function"])},N:function(e,t,r){Se.varargs=r;try{var n=Se.getStreamFromFD(e);switch(t){case 0:if((o=re())<0)return-28;for(;Ee.streams[o];)o++;return Ee.dupStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=re();return n.flags|=o,0;case 12:return o=ne(),S[o+0>>1]=2,0}return-28}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},xa:function(e,t,r){Se.varargs=r;try{var n=Se.getStreamFromFD(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=ne();C[a>>2]=o.c_iflag||0,C[a+4>>2]=o.c_oflag||0,C[a+8>>2]=o.c_cflag||0,C[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)_[a+i+17]=o.c_cc[i]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=ne();var s=C[a>>2],l=C[a+4>>2],u=C[a+8>>2],c=C[a+12>>2],d=[];for(i=0;i<32;i++)d.push(_[a+i+17]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:s,c_oflag:l,c_cflag:u,c_lflag:c,c_cc:d})}return 0;case 21519:return n.tty?(a=ne(),C[a>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return a=ne(),Ee.ioctl(n,t,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var h=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=ne(),S[a>>1]=h[0],S[a+2>>1]=h[1]}return 0;default:return-28}}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},ya:function(e,t,r,n){Se.varargs=n;try{t=Se.getStr(t),t=Se.calculateAt(e,t);var o=n?re():0;return Ee.open(t,r,o).fd}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},za:()=>{j("")},fa:(e,t,r,n,o)=>{},Ba:(e,t,r,n)=>{De(e,{name:t=$e(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(E[e])},destructorFunction:null})},Fa:(e,t,r,n,o,a,i,s,l,u,c,d,h)=>{c=$e(c),a=dt(o,a),s&&=dt(i,s),u&&=dt(l,u),h=dt(d,h);var m=(e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e})(c);et(m,(function(){mt(`Cannot construct ${c} due to unbound types`,[n])})),Ae([e,t,r],n?[n]:[],(t=>{var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:Ke.prototype;var i=Ze(c,(function(...e){if(Object.getPrototypeOf(this)!==l)throw new he("Use 'new' to construct "+c);if(void 0===d.constructor_body)throw new he(c+" has no accessible constructor");var t=d.constructor_body[e.length];if(void 0===t)throw new he(`Tried to invoke ctor of ${c} with invalid number of parameters (${e.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return t.apply(this,e)})),l=Object.create(o,{constructor:{value:i}});i.prototype=l;var d=new tt(c,i,l,h,r,a,s,u);d.baseClass&&(d.baseClass.__derivedClasses??=[],d.baseClass.__derivedClasses.push(d));var p=new st(c,d,!0,!1,!1),f=new st(c+"*",d,!1,!1,!1),g=new st(c+" const*",d,!1,!0,!1);return ze[e]={pointerType:f,constPointerType:g},ut(m,i),[p,f,g]}))},Ea:(e,t,r,n,o,a)=>{var i=pt(t,r);o=dt(n,o),Ae([],[e],(e=>{var r=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new he(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{mt(`Cannot construct ${e.name} due to unbound types`,i)},Ae([],i,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Ct(r,n,null,o,a),[]))),[]}))},q:(e,t,r,n,o,a,i,s,l)=>{var u=pt(r,n);t=$e(t),t=Pt(t),a=dt(o,a),Ae([],[e],(e=>{var n=`${(e=e[0]).name}.${t}`;function o(){mt(`Cannot call ${n} due to unbound types`,u)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,d=c[t];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===r-2?(o.argCount=r-2,o.className=e.name,c[t]=o):(Ye(c,t,n),c[t].overloadTable[r-2]=o),Ae([],u,(o=>{var s=Ct(n,o,e,a,i,l);return void 0===c[t].overloadTable?(s.argCount=r-2,c[t]=s):c[t].overloadTable[r-2]=s,[]})),[]}))},Aa:e=>De(e,Ft),O:(e,t,r)=>{De(e,{name:t=$e(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:8,readValueFromPointer:Rt(t,r),destructorFunction:null})},R:(e,t,r,n,o,a,i)=>{var s=pt(t,r);e=$e(e),e=Pt(e),o=dt(n,o),et(e,(function(){mt(`Cannot call ${e} due to unbound types`,s)}),t-1),Ae([],s,(r=>{var n=[r[0],null].concat(r.slice(1));return ut(e,Ct(e,n,null,o,a,i),t-1),[]}))},v:(e,t,r,n,o)=>{t=$e(t);var a=e=>e;if(0===n){var i=32-8*r;a=e=>e<<i>>>i}var s=t.includes("unsigned");De(e,{name:t,fromWireType:a,toWireType:s?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:Mt(t,r,0!==n),destructorFunction:null})},l:(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function o(e){var t=x[e>>2],r=x[e+4>>2];return new n(_.buffer,r,t)}De(e,{name:r=$e(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},P:(e,t)=>{var r="std::string"===(t=$e(t));De(e,{name:t,fromWireType(e){var t,n=x[e>>2],o=e+4;if(r)for(var a=o,i=0;i<=n;++i){var s=o+i;if(i==n||0==E[s]){var l=te(a,s-a);void 0===t?t=l:(t+=String.fromCharCode(0),t+=l),a=s+1}}else{var u=new Array(n);for(i=0;i<n;++i)u[i]=String.fromCharCode(E[o+i]);t=u.join("")}return lr(e),t},toWireType(e,t){var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var o="string"==typeof t;o||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||ke("Cannot pass non-string to std::string"),n=r&&o?le(t):t.length;var a=ur(4+n+1),i=a+4;if(x[a>>2]=n,r&&o)Ot(t,i,n+1);else if(o)for(var s=0;s<n;++s){var l=t.charCodeAt(s);l>255&&(lr(i),ke("String has UTF-16 code units that do not fit in 8 bits")),E[i+s]=l}else for(s=0;s<n;++s)E[i+s]=t[s];return null!==e&&e.push(lr,a),a},argPackAdvance:8,readValueFromPointer:it,destructorFunction(e){lr(e)}})},J:(e,t,r)=>{var n,o,a,i;r=$e(r),2===t?(n=Lt,o=jt,i=zt,a=e=>$[e>>1]):4===t&&(n=Nt,o=It,i=Vt,a=e=>x[e>>2]),De(e,{name:r,fromWireType:e=>{for(var r,o=x[e>>2],i=e+4,s=0;s<=o;++s){var l=e+4+s*t;if(s==o||0==a(l)){var u=n(i,l-i);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),i=l+t}}return lr(e),r},toWireType:(e,n)=>{"string"!=typeof n&&ke(`Cannot pass non-string to C++ string type ${r}`);var a=i(n),s=ur(4+a+t);return x[s>>2]=a/t,o(n,s+4,a+t),null!==e&&e.push(lr,s),s},argPackAdvance:8,readValueFromPointer:it,destructorFunction(e){lr(e)}})},Ca:(e,t)=>{De(e,{isVoid:!0,name:t=$e(t),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,t)=>{}})},ta:(e,t,r)=>E.copyWithin(e,t,t+r),na:()=>{J=!1,wt=0},la:()=>{throw 1/0},B:(e,t)=>{var r,n,o;n="_emval_take_value",void 0===(o=xe[r=e])&&ke(`${n} has unknown type ${ht(r)}`);var a=(e=o).readValueFromPointer(t);return Dt.toHandle(a)},oa:(e,t)=>{if(Wt[e]&&(clearTimeout(Wt[e].id),delete Wt[e]),!t)return 0;var r=setTimeout((()=>{delete Wt[e],St((()=>dr(e,xt())))}),t);return Wt[e]={id:r,timeout_ms:t},0},pa:(e,t,r,n)=>{var o=(new Date).getFullYear(),a=new Date(o,0,1),i=new Date(o,6,1),s=a.getTimezoneOffset(),l=i.getTimezoneOffset(),u=Math.max(s,l);x[e>>2]=60*u,C[t>>2]=Number(s!=l);var c=e=>{var t=e>=0?"-":"+",r=Math.abs(e);return`UTC${t}${String(Math.floor(r/60)).padStart(2,"0")}${String(r%60).padStart(2,"0")}`},d=c(s),h=c(l);l<s?(Ot(d,r,17),Ot(h,n,17)):(Ot(d,n,17),Ot(h,r,17))},sa:e=>{var t,r,n=E.length,o=2147483648;if((e>>>=0)>o)return!1;for(var a=1;a<=4;a*=2){var i=n*(1+.2/a);i=Math.min(i,e+100663296);var s=Math.min(o,(t=Math.max(e,i),r=65536,Math.ceil(t/r)*r));if(Ht(s))return!0}return!1},S:Gt,qa:(e,t)=>{var r=0;return Kt().forEach(((n,o)=>{var a=t+r;x[e+4*o>>2]=a,((e,t)=>{for(var r=0;r<e.length;++r)_[t++]=e.charCodeAt(r);_[t]=0})(n,a),r+=n.length+1})),0},ra:(e,t)=>{var r=Kt();x[e>>2]=r.length;var n=0;return r.forEach((e=>n+=e.length+1)),x[t>>2]=n,0},M:function(e){try{var t=Se.getStreamFromFD(e);return Ee.close(t),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},wa:function(e,t,r,n){try{var o=((e,t,r,n)=>{for(var o=0,a=0;a<r;a++){var i=x[t>>2],s=x[t+4>>2];t+=8;var l=Ee.read(e,_,i,s,n);if(l<0)return-1;if(o+=l,l<s)break}return o})(Se.getStreamFromFD(e),t,r);return x[n>>2]=o,0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},ea:function(e,t,r,n,o){var a=Zt(t,r);try{if(isNaN(a))return 61;var i=Se.getStreamFromFD(e);return Ee.llseek(i,a,n),I=[i.position>>>0,(N=i.position,+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],C[o>>2]=I[0],C[o+4>>2]=I[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},va:function(e,t,r,n){try{var o=((e,t,r,n)=>{for(var o=0,a=0;a<r;a++){var i=x[t>>2],s=x[t+4>>2];t+=8;var l=Ee.write(e,_,i,s,n);if(l<0)return-1;if(o+=l,l<s)break}return o})(Se.getStreamFromFD(e),t,r);return x[n>>2]=o,0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},m:function(e,t){var r=Z();try{return yr(e,t)}catch(e){if(K(r),e!==e+0)throw e;hr(1,0)}},g:function(e,t,r){var n=Z();try{return Sr(e,t,r)}catch(e){if(K(n),e!==e+0)throw e;hr(1,0)}},e:function(e,t,r,n){var o=Z();try{return vr(e,t,r,n)}catch(e){if(K(o),e!==e+0)throw e;hr(1,0)}},D:function(e,t,r,n,o,a){var i=Z();try{return Er(e,t,r,n,o,a)}catch(e){if(K(i),e!==e+0)throw e;hr(1,0)}},a:function(e,t){var r=Z();try{wr(e,t)}catch(e){if(K(r),e!==e+0)throw e;hr(1,0)}},c:function(e,t,r){var n=Z();try{br(e,t,r)}catch(e){if(K(n),e!==e+0)throw e;hr(1,0)}},f:function(e,t,r,n){var o=Z();try{$r(e,t,r,n)}catch(e){if(K(o),e!==e+0)throw e;hr(1,0)}},A:function(e,t,r,n,o){var a=Z();try{Cr(e,t,r,n,o)}catch(e){if(K(a),e!==e+0)throw e;hr(1,0)}},da:function(e,t,r,n,o,a){var i=Z();try{_r(e,t,r,n,o,a)}catch(e){if(K(i),e!==e+0)throw e;hr(1,0)}},ma:_t,U:(e,t)=>{var r=er.mgrAdapter.get(e);if(0!==t){var n=0;r.features.forEach((e=>{var r=er.FeatureNameString2Enum[e];C[t+n>>2]=r,n+=4}))}return r.features.size},_:e=>er.mgrAdapter.release(e),T:(e,t,r,n)=>{var o=er.mgrAdapter.get(e),a={};if(t){var i=x[t+8>>2];if(i){var s=x[t+12>>2];a.requiredFeatures=Array.from(C.subarray(s>>2,s+4*i>>2),(e=>er.FeatureName[e]))}var l=x[t+16>>2];if(l){var u=l+8,c={};function g(e,t){var r=x[u+t>>2];4294967295!=r&&(c[e]=r)}function v(e,t){var r=u+t,n=x[r>>2],o=x[r+4>>2];4294967295==n&&4294967295==o||(c[e]=4294967296*x[r+4>>2]+x[r>>2])}g("maxTextureDimension1D",0),g("maxTextureDimension2D",4),g("maxTextureDimension3D",8),g("maxTextureArrayLayers",12),g("maxBindGroups",16),g("maxBindGroupsPlusVertexBuffers",20),g("maxDynamicUniformBuffersPerPipelineLayout",28),g("maxDynamicStorageBuffersPerPipelineLayout",32),g("maxSampledTexturesPerShaderStage",36),g("maxSamplersPerShaderStage",40),g("maxStorageBuffersPerShaderStage",44),g("maxStorageTexturesPerShaderStage",48),g("maxUniformBuffersPerShaderStage",52),g("minUniformBufferOffsetAlignment",72),g("minStorageBufferOffsetAlignment",76),v("maxUniformBufferBindingSize",56),v("maxStorageBufferBindingSize",64),g("maxVertexBuffers",80),v("maxBufferSize",88),g("maxVertexAttributes",96),g("maxVertexBufferArrayStride",100),g("maxInterStageShaderComponents",104),g("maxInterStageShaderVariables",108),g("maxColorAttachments",112),g("maxColorAttachmentBytesPerSample",116),g("maxComputeWorkgroupStorageSize",120),g("maxComputeInvocationsPerWorkgroup",124),g("maxComputeWorkgroupSizeX",128),g("maxComputeWorkgroupSizeY",132),g("maxComputeWorkgroupSizeZ",136),g("maxComputeWorkgroupsPerDimension",140),a.requiredLimits=c}var d=x[t+20>>2];if(d){var h={};(m=x[d+4>>2])&&(h.label=te(m)),a.defaultQueue=h}var m,p=x[t+28>>2],f=x[t+32>>2];(m=x[t+4>>2])&&(a.label=te(m))}o.requestDevice(a).then((e=>{St((()=>{var t={queueId:er.mgrQueue.create(e.queue)},o=er.mgrDevice.create(e,t);p&&e.lost.then((e=>{St((()=>er.errorCallback(p,er.Int_DeviceLostReason[e.reason],e.message,f)))})),Cr(r,0,o,0,n)}))}),(function(e){St((()=>{var t=Z(),o=Yt(e.message);Cr(r,1,0,o,n),K(t)}))}))},w:e=>er.mgrBindGroupLayout.release(e),t:e=>er.mgrBindGroup.release(e),La:e=>{var t=er.mgrBuffer.objects[e];if(t.onUnmap){for(var r=0;r<t.onUnmap.length;++r)t.onUnmap[r]();t.onUnmap=void 0}er.mgrBuffer.get(e).destroy()},ja:function(e){var t,r=er.mgrBuffer.get(e).size;return N=r,t=+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0,mr(t),r>>>0},Ka:e=>er.mgrBuffer.release(e),X:e=>er.mgrCommandBuffer.release(e),ca:(e,t)=>{function r(e){var t=x[e+4>>2];if(0!==t){var r=C[e+8>>2];-1==r&&(r=void 0);var n=x[e+16>>2],o=x[e+20>>2],a=er.makeColor(e+24);return{view:er.mgrTextureView.get(t),depthSlice:r,resolveTarget:er.mgrTextureView.get(x[e+12>>2]),clearValue:a,loadOp:er.LoadOp[n],storeOp:er.StoreOp[o]}}}function n(e,t){for(var n=[],o=0;o<e;++o)n.push(r(t+56*o));return n}function o(e){if(0!==e)return{view:er.mgrTextureView.get(x[e>>2]),depthClearValue:P[e+12>>2],depthLoadOp:er.LoadOp[x[e+4>>2]],depthStoreOp:er.StoreOp[x[e+8>>2]],depthReadOnly:!!x[e+16>>2],stencilClearValue:x[e+28>>2],stencilLoadOp:er.LoadOp[x[e+20>>2]],stencilStoreOp:er.StoreOp[x[e+24>>2]],stencilReadOnly:!!x[e+32>>2]}}function a(e){if(0!==e)return{querySet:er.mgrQuerySet.get(x[e>>2]),beginningOfPassWriteIndex:x[e+4>>2],endOfPassWriteIndex:x[e+8>>2]}}var i=function(e){var t=x[e>>2],r=void 0;if(0!==t){x[t+4>>2];var i=t;r=4294967296*x[i+4+8>>2]+x[i+8>>2]}var s={label:void 0,colorAttachments:n(x[e+8>>2],x[e+12>>2]),depthStencilAttachment:o(x[e+16>>2]),occlusionQuerySet:er.mgrQuerySet.get(x[e+20>>2]),timestampWrites:a(x[e+24>>2]),maxDrawCount:r},l=x[e+4>>2];return l&&(s.label=te(l)),s}(t),s=er.mgrCommandEncoder.get(e);return er.mgrRenderPassEncoder.create(s.beginRenderPass(i))},F:(e,t,r,n)=>{var o=er.mgrCommandEncoder.get(e),a=er.makeExtent3D(n);o.copyTextureToTexture(er.makeImageCopyTexture(t),er.makeImageCopyTexture(r),a)},Y:(e,t)=>{var r=er.mgrCommandEncoder.get(e);return er.mgrCommandBuffer.create(r.finish())},W:e=>er.mgrCommandEncoder.release(e),y:(e,t)=>{function r(e){var t,r=x[e+8>>2],n=x[e+32>>2],o=x[e+36>>2],a=x[e+4>>2];if(r){var i=x[(t=e+24)>>2]+4294967296*C[t+4>>2];return-1==i&&(i=void 0),{binding:a,resource:{buffer:er.mgrBuffer.get(r),offset:4294967296*x[e+4+16>>2]+x[e+16>>2],size:i}}}return n?{binding:a,resource:er.mgrSampler.get(n)}:{binding:a,resource:er.mgrTextureView.get(o)}}var n={label:void 0,layout:er.mgrBindGroupLayout.get(x[t+8>>2]),entries:function(e,t){for(var n=[],o=0;o<e;++o)n.push(r(t+40*o));return n}(x[t+12>>2],x[t+16>>2])},o=x[t+4>>2];o&&(n.label=te(o));var a=er.mgrDevice.get(e);return er.mgrBindGroup.create(a.createBindGroup(n))},u:(e,t)=>{function r(e){var t=x[e+4>>2];if(t)return{type:er.BufferBindingType[t],hasDynamicOffset:!!x[e+8>>2],minBindingSize:4294967296*x[e+4+16>>2]+x[e+16>>2]}}function n(e){var t=x[e+4>>2];if(t)return{type:er.SamplerBindingType[t]}}function o(e){var t=x[e+4>>2];if(t)return{sampleType:er.TextureSampleType[t],viewDimension:er.TextureViewDimension[x[e+8>>2]],multisampled:!!x[e+12>>2]}}function a(e){var t=x[e+4>>2];if(t)return{access:er.StorageTextureAccess[t],format:er.TextureFormat[x[e+8>>2]],viewDimension:er.TextureViewDimension[x[e+12>>2]]}}var i={entries:function(e,t){for(var i,s=[],l=0;l<e;++l)s.push({binding:x[(i=t+80*l)+4>>2],visibility:x[i+8>>2],buffer:r(i+16),sampler:n(i+40),texture:o(i+48),storageTexture:a(i+64)});return s}(x[t+8>>2],x[t+12>>2])},s=x[t+4>>2];s&&(i.label=te(s));var l=er.mgrDevice.get(e);return er.mgrBindGroupLayout.create(l.createBindGroupLayout(i))},G:(e,t)=>{var r=!!x[t+24>>2],n={label:void 0,usage:x[t+8>>2],size:4294967296*x[t+4+16>>2]+x[t+16>>2],mappedAtCreation:r},o=x[t+4>>2];o&&(n.label=te(o));var a=er.mgrDevice.get(e),i={},s=er.mgrBuffer.create(a.createBuffer(n),i);return r&&(i.mapMode=2,i.onUnmap=[]),s},Z:(e,t)=>{var r;if(t){r={label:void 0};var n=x[t+4>>2];n&&(r.label=te(n))}var o=er.mgrDevice.get(e);return er.mgrCommandEncoder.create(o.createCommandEncoder(r))},s:(e,t)=>{for(var r=x[t+8>>2],n=x[t+12>>2],o=[],a=0;a<r;++a)o.push(er.mgrBindGroupLayout.get(x[n+4*a>>2]));var i={label:void 0,bindGroupLayouts:o},s=x[t+4>>2];s&&(i.label=te(s));var l=er.mgrDevice.get(e);return er.mgrPipelineLayout.create(l.createPipelineLayout(i))},k:(e,t)=>{var r=(e=>{function t(e){if(e)return{operation:er.BlendOperation[x[e>>2]],srcFactor:er.BlendFactor[x[e+4>>2]],dstFactor:er.BlendFactor[x[e+8>>2]]}}function r(e){if(e)return{alpha:t(e+12),color:t(e+0)}}function n(e,t){for(var n,o,a=[],i=0;i<e;++i)a.push((o=void 0,0===(o=x[(n=t+16*i)+4>>2])?void 0:{format:er.TextureFormat[o],blend:r(x[n+8>>2]),writeMask:x[n+12>>2]}));return a}function o(e){return{compare:er.CompareFunction[x[e>>2]],failOp:er.StencilOperation[x[e+4>>2]],depthFailOp:er.StencilOperation[x[e+8>>2]],passOp:er.StencilOperation[x[e+12>>2]]}}function a(e,t){for(var r,n=[],o=0;o<e;++o)n.push((r=t+24*o,{format:er.VertexFormat[x[r>>2]],offset:4294967296*x[r+4+8>>2]+x[r+8>>2],shaderLocation:x[r+16>>2]}));return n}function i(e){if(e){var t=x[e+8>>2];return 1===t?null:{arrayStride:4294967296*x[e+4>>2]+x[e>>2],stepMode:er.VertexStepMode[t],attributes:a(x[e+12>>2],x[e+16>>2])}}}function s(e,t){if(e){for(var r=[],n=0;n<e;++n)r.push(i(t+24*n));return r}}var l={label:void 0,layout:er.makePipelineLayout(x[e+8>>2]),vertex:function(e){if(e){var t={module:er.mgrShaderModule.get(x[e+4>>2]),constants:er.makePipelineConstants(x[e+12>>2],x[e+16>>2]),buffers:s(x[e+20>>2],x[e+24>>2])},r=x[e+8>>2];return r&&(t.entryPoint=te(r)),t}}(e+12),primitive:function(e){if(e){var t=x[e>>2],r=t?x[t+4>>2]:0;return{topology:er.PrimitiveTopology[x[e+4>>2]],stripIndexFormat:er.IndexFormat[x[e+8>>2]],frontFace:er.FrontFace[x[e+12>>2]],cullMode:er.CullMode[x[e+16>>2]],unclippedDepth:7===r&&!!x[t+8>>2]}}}(e+40),depthStencil:function(e){if(e)return{format:er.TextureFormat[x[e+4>>2]],depthWriteEnabled:!!x[e+8>>2],depthCompare:er.CompareFunction[x[e+12>>2]],stencilFront:o(e+16),stencilBack:o(e+32),stencilReadMask:x[e+48>>2],stencilWriteMask:x[e+52>>2],depthBias:C[e+56>>2],depthBiasSlopeScale:P[e+60>>2],depthBiasClamp:P[e+64>>2]}}(x[e+60>>2]),multisample:function(e){if(e)return{count:x[e+4>>2],mask:x[e+8>>2],alphaToCoverageEnabled:!!x[e+12>>2]}}(e+64),fragment:function(e){if(e){var t={module:er.mgrShaderModule.get(x[e+4>>2]),constants:er.makePipelineConstants(x[e+12>>2],x[e+16>>2]),targets:n(x[e+20>>2],x[e+24>>2])},r=x[e+8>>2];return r&&(t.entryPoint=te(r)),t}}(x[e+80>>2])},u=x[e+4>>2];return u&&(l.label=te(u)),l})(t),n=er.mgrDevice.get(e);return er.mgrRenderPipeline.create(n.createRenderPipeline(r))},E:(e,t)=>{var r;if(t){r={label:void 0,addressModeU:er.AddressMode[x[t+8>>2]],addressModeV:er.AddressMode[x[t+12>>2]],addressModeW:er.AddressMode[x[t+16>>2]],magFilter:er.FilterMode[x[t+20>>2]],minFilter:er.FilterMode[x[t+24>>2]],mipmapFilter:er.MipmapFilterMode[x[t+28>>2]],lodMinClamp:P[t+32>>2],lodMaxClamp:P[t+36>>2],compare:er.CompareFunction[x[t+40>>2]]};var n=x[t+4>>2];n&&(r.label=te(n))}var o=er.mgrDevice.get(e);return er.mgrSampler.create(o.createSampler(r))},o:(e,t)=>{var r=x[t>>2],n=x[r+4>>2],o={label:void 0,code:""},a=x[t+4>>2];switch(a&&(o.label=te(a)),n){case 5:var i=x[r+8>>2],s=x[r+12>>2]>>2;o.code=x.subarray(s,s+i);break;case 6:var l=x[r+8>>2];l&&(o.code=te(l))}var u=er.mgrDevice.get(e);return er.mgrShaderModule.create(u.createShaderModule(o))},z:(e,t)=>{var r={label:void 0,size:er.makeExtent3D(t+16),mipLevelCount:x[t+32>>2],sampleCount:x[t+36>>2],dimension:er.TextureDimension[x[t+12>>2]],format:er.TextureFormat[x[t+28>>2]],usage:x[t+8>>2]},n=x[t+4>>2];n&&(r.label=te(n));var o=x[t+40>>2];if(o){var a=x[t+44>>2];r.viewFormats=Array.from(C.subarray(a>>2,a+4*o>>2),(function(e){return er.TextureFormat[e]}))}var i=er.mgrDevice.get(e);return er.mgrTexture.create(i.createTexture(r))},Ga:e=>{var t=er.mgrDevice.objects[e].queueId;return er.mgrQueue.reference(t),t},$:e=>er.mgrDevice.release(e),Da:(e,t)=>{var r=x[t>>2],n=x[r+8>>2],o=rr(n).getContext("webgpu");if(!o)return 0;var a=x[t+4>>2];return a&&(o.surfaceLabelWebGPU=te(a)),er.mgrSurface.create(o)},V:(e,t,r,n)=>{var o;if(t&&(o={powerPreference:er.PowerPreference[x[t+8>>2]],forceFallbackAdapter:!!x[t+16>>2]}),!("gpu"in navigator)){var a=Z(),i=Yt("WebGPU not available on this browser (navigator.gpu is not available)");return Cr(r,1,0,i,n),void K(a)}navigator.gpu.requestAdapter(o).then((e=>{St((()=>{if(e)((e,t,n,o)=>{Cr(r,0,t,0,o)})(0,er.mgrAdapter.create(e),0,n);else{var t=Z();((e,t,n,o)=>{Cr(r,1,0,n,o)})(0,0,Yt("WebGPU not available on this system (requestAdapter returned null)"),n),K(t)}}))}),(e=>{St((()=>{var t=Z();((e,t,n,o)=>{Cr(r,2,0,n,o)})(0,0,Yt(e.message),n),K(t)}))}))},r:e=>er.mgrPipelineLayout.release(e),Ja:e=>er.mgrQueue.release(e),C:(e,t,r)=>{var n=er.mgrQueue.get(e),o=Array.from(C.subarray(r>>2,r+4*t>>2),(e=>er.mgrCommandBuffer.get(e)));n.submit(o)},ia:function(e,t,r,n,o,a){var i=Zt(r,n),s=er.mgrQueue.get(e),l=er.mgrBuffer.get(t),u=E.subarray(o,o+a);s.writeBuffer(l,i,u,0,a)},I:(e,t,r,n,o,a)=>{var i=er.mgrQueue.get(e),s=er.makeImageCopyTexture(t),l=er.makeTextureDataLayout(o),u=er.makeExtent3D(a),c=E.subarray(r,r+n);i.writeTexture(s,c,l,u)},K:(e,t,r,n,o,a)=>{er.mgrRenderPassEncoder.get(e).drawIndexed(t,r,n,o,a)},ba:e=>{er.mgrRenderPassEncoder.get(e).end()},aa:e=>er.mgrRenderPassEncoder.release(e),d:(e,t,r,n,o)=>{var a=er.mgrRenderPassEncoder.get(e),i=er.mgrBindGroup.get(r);if(0==n)a.setBindGroup(t,i);else{for(var s=[],l=0;l<n;l++,o+=4)s.push(x[o>>2]);a.setBindGroup(t,i,s)}},ga:function(e,t,r,n,o,a,i){var s=Zt(n,o),l=Zt(a,i),u=er.mgrRenderPassEncoder.get(e),c=er.mgrBuffer.get(t);-1==l&&(l=void 0),u.setIndexBuffer(c,er.IndexFormat[r],s,l)},h:(e,t)=>{var r=er.mgrRenderPassEncoder.get(e),n=er.mgrRenderPipeline.get(t);r.setPipeline(n)},p:(e,t,r,n,o)=>{er.mgrRenderPassEncoder.get(e).setScissorRect(t,r,n,o)},i:(e,t)=>{er.mgrRenderPassEncoder.get(e).setStencilReference(t)},ha:function(e,t,r,n,o,a,i){var s=Zt(n,o),l=Zt(a,i),u=er.mgrRenderPassEncoder.get(e),c=er.mgrBuffer.get(r);-1==l&&(l=void 0),u.setVertexBuffer(t,c,s,l)},j:e=>er.mgrRenderPipeline.release(e),H:e=>er.mgrSampler.release(e),n:e=>er.mgrShaderModule.release(e),Ha:(e,t)=>{var r=x[t+4>>2],n=er.mgrSurface.get(e),o=[x[t+28>>2],x[t+32>>2]];0!==o[0]&&(n.canvas.width=o[0]),0!==o[1]&&(n.canvas.height=o[1]);var a={device:er.mgrDevice.get(r),format:er.TextureFormat[x[t+8>>2]],usage:x[t+12>>2],alphaMode:er.AlphaMode[x[t+24>>2]]};n.configure(a)},Ia:(e,t)=>{var r=er.mgrSurface.get(e);try{var n=er.mgrTexture.create(r.getCurrentTexture());x[t>>2]=n,C[t+4>>2]=0,C[t+8>>2]=0}catch(e){x[t>>2]=0,C[t+4>>2]=0,C[t+8>>2]=5}},Q:e=>er.mgrSurface.release(e),Na:(e,t)=>{var r;if(t){var n=x[t+20>>2],o=x[t+28>>2];r={format:er.TextureFormat[x[t+8>>2]],dimension:er.TextureViewDimension[x[t+12>>2]],baseMipLevel:x[t+16>>2],mipLevelCount:4294967295===n?void 0:n,baseArrayLayer:x[t+24>>2],arrayLayerCount:4294967295===o?void 0:o,aspect:er.TextureAspect[x[t+32>>2]]};var a=x[t+4>>2];a&&(r.label=te(a))}var i=er.mgrTexture.get(e);return er.mgrTextureView.create(i.createView(r))},Ma:e=>er.mgrTexture.get(e).destroy(),Oa:e=>{var t=er.mgrTexture.get(e);return er.TextureFormat.indexOf(t.format)},ka:e=>er.mgrTexture.get(e).height,ua:e=>er.mgrTexture.get(e).width,L:e=>er.mgrTexture.release(e),x:e=>er.mgrTextureView.release(e)},sr=function(){var e,t,o,a,i={a:ir};function l(e,t){var r;return sr=e.exports,sr=$t.instrumentWasmExports(sr),w=sr.Pa,D(),sr.Ua,r=sr.Qa,B.unshift(r),L(),sr}if(U(),n.instantiateWasm)try{return n.instantiateWasm(i,l)}catch(e){y(`Module.instantiateWasm callback failed with error: ${e}`),r(e)}return z||(z=H()),(e=T,t=z,o=i,a=function(e){l(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||V(t)||W(t)||s||"function"!=typeof fetch?q(t,o,a):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,o).then(a,(function(e){return y(`wasm streaming compile failed: ${e}`),y("falling back to ArrayBuffer instantiation"),q(t,o,a)}))))).catch(r),{}}(),lr=e=>(lr=sr.Ra)(e),ur=e=>(ur=sr.Sa)(e),cr=e=>(cr=sr.Ta)(e),dr=(e,t)=>(dr=sr.Va)(e,t),hr=(e,t)=>(hr=sr.Wa)(e,t),mr=e=>(mr=sr.Xa)(e),pr=e=>(pr=sr.Ya)(e),fr=e=>(fr=sr.Za)(e),gr=()=>(gr=sr._a)(),vr=n.dynCall_iiii=(e,t,r,o)=>(vr=n.dynCall_iiii=sr.$a)(e,t,r,o),yr=n.dynCall_ii=(e,t)=>(yr=n.dynCall_ii=sr.ab)(e,t);n.dynCall_iiiii=(e,t,r,o,a)=>(n.dynCall_iiiii=sr.bb)(e,t,r,o,a),n.dynCall_iiiiiffiii=(e,t,r,o,a,i,s,l,u,c)=>(n.dynCall_iiiiiffiii=sr.cb)(e,t,r,o,a,i,s,l,u,c),n.dynCall_fii=(e,t,r)=>(n.dynCall_fii=sr.db)(e,t,r);var wr=n.dynCall_vi=(e,t)=>(wr=n.dynCall_vi=sr.eb)(e,t),br=n.dynCall_vii=(e,t,r)=>(br=n.dynCall_vii=sr.fb)(e,t,r),_r=n.dynCall_viiij=(e,t,r,o,a,i)=>(_r=n.dynCall_viiij=sr.gb)(e,t,r,o,a,i),Er=n.dynCall_iiiiii=(e,t,r,o,a,i)=>(Er=n.dynCall_iiiiii=sr.hb)(e,t,r,o,a,i),Sr=n.dynCall_iii=(e,t,r)=>(Sr=n.dynCall_iii=sr.ib)(e,t,r),$r=n.dynCall_viii=(e,t,r,o)=>($r=n.dynCall_viii=sr.jb)(e,t,r,o),Cr=n.dynCall_viiii=(e,t,r,o,a)=>(Cr=n.dynCall_viiii=sr.kb)(e,t,r,o,a);n.dynCall_viiiii=(e,t,r,o,a,i)=>(n.dynCall_viiiii=sr.lb)(e,t,r,o,a,i),n.dynCall_viiiiii=(e,t,r,o,a,i,s)=>(n.dynCall_viiiiii=sr.mb)(e,t,r,o,a,i,s),n.dynCall_v=e=>(n.dynCall_v=sr.nb)(e),n.dynCall_fi=(e,t)=>(n.dynCall_fi=sr.ob)(e,t),n.dynCall_iiiiiii=(e,t,r,o,a,i,s)=>(n.dynCall_iiiiiii=sr.pb)(e,t,r,o,a,i,s),n.dynCall_iiiiiiii=(e,t,r,o,a,i,s,l)=>(n.dynCall_iiiiiiii=sr.qb)(e,t,r,o,a,i,s,l),n.dynCall_iif=(e,t,r)=>(n.dynCall_iif=sr.rb)(e,t,r),n.dynCall_iiif=(e,t,r,o)=>(n.dynCall_iiif=sr.sb)(e,t,r,o),n.dynCall_iiffff=(e,t,r,o,a,i)=>(n.dynCall_iiffff=sr.tb)(e,t,r,o,a,i),n.dynCall_iiiffff=(e,t,r,o,a,i,s)=>(n.dynCall_iiiffff=sr.ub)(e,t,r,o,a,i,s),n.dynCall_jiji=(e,t,r,o,a)=>(n.dynCall_jiji=sr.vb)(e,t,r,o,a),n.dynCall_iiiiiiiii=(e,t,r,o,a,i,s,l,u)=>(n.dynCall_iiiiiiiii=sr.wb)(e,t,r,o,a,i,s,l,u),n.dynCall_iiiff=(e,t,r,o,a)=>(n.dynCall_iiiff=sr.xb)(e,t,r,o,a),n.dynCall_iiifi=(e,t,r,o,a)=>(n.dynCall_iiifi=sr.yb)(e,t,r,o,a),n.dynCall_viijii=(e,t,r,o,a,i,s)=>(n.dynCall_viijii=sr.zb)(e,t,r,o,a,i,s),n.dynCall_iiiiij=(e,t,r,o,a,i,s)=>(n.dynCall_iiiiij=sr.Ab)(e,t,r,o,a,i,s),n.dynCall_iiiiid=(e,t,r,o,a,i)=>(n.dynCall_iiiiid=sr.Bb)(e,t,r,o,a,i),n.dynCall_iiiiijj=(e,t,r,o,a,i,s,l,u)=>(n.dynCall_iiiiijj=sr.Cb)(e,t,r,o,a,i,s,l,u),n.dynCall_iiiiiijj=(e,t,r,o,a,i,s,l,u,c)=>(n.dynCall_iiiiiijj=sr.Db)(e,t,r,o,a,i,s,l,u,c);var xr,Pr=e=>(Pr=sr.Eb)(e),kr=()=>(kr=sr.Fb)(),Tr=e=>(Tr=sr.Gb)(e),Ar=()=>(Ar=sr.Hb)();function Dr(){function e(){xr||(xr=!0,n.calledRun=!0,A||(n.noFSInit||Ee.initialized||Ee.init(),Ee.ignorePermissions=!1,X(B),t(n),n.onRuntimeInitialized?.(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)e=n.postRun.shift(),R.unshift(e);var e;X(R)}()))}M>0||(function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)e=n.preRun.shift(),F.unshift(e);var e;X(F)}(),M>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((()=>{setTimeout((()=>n.setStatus("")),1),e()}),1)):e()))}if(n.addRunDependency=U,n.removeRunDependency=L,n.FS_createPreloadedFile=be,n.FS_unlink=e=>Ee.unlink(e),n.FS_createPath=nr,n.FS_createDevice=ar,n.FS=Ee,n.FS_createDataFile=ye,n.FS_createLazyFile=or,O=function e(){xr||Dr(),xr||(O=e)},n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return Dr(),o});const ge="1.0.0";function ve(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i}let ye;var we,be,_e,Ee,Se,$e,Ce;(async()=>{ye=await fe({locateFile:(e,t)=>e.endsWith(".wasm")?"https://unpkg.com/@thorvg/lottie-player@latest/dist/thorvg-wasm.wasm":t+e})})(),function(e){e.SW="sw",e.WG="wg"}(we||(we={})),function(e){e.IDLE="idle",e.REQUESTED="requested",e.INITIALIZED="initialized"}(be||(be={})),function(e){e.GIF="gif",e.TVG="tvg",e.PNG="png"}(_e||(_e={})),function(e){e.JSON="json",e.JPG="jpg",e.PNG="png",e.SVG="svg",e.TVG="tvg"}(Ee||(Ee={})),function(e){e.Destroyed="destroyed",e.Error="error",e.Loading="loading",e.Paused="paused",e.Playing="playing",e.Stopped="stopped",e.Frozen="frozen"}(Se||(Se={})),function(e){e.Bounce="bounce",e.Normal="normal"}($e||($e={})),function(e){e.Complete="complete",e.Destroyed="destroyed",e.Error="error",e.Frame="frame",e.Freeze="freeze",e.Load="load",e.Loop="loop",e.Pause="pause",e.Play="play",e.Ready="ready",e.Stop="stop"}(Ce||(Ce={}));const xe=async e=>{try{e=JSON.parse(e)}catch(t){const r=await(async e=>{if("string"!=typeof e)throw new Error("The url value must be a string");try{const t=new URL(e),r=await fetch(t.toString());return await r.json()}catch(e){throw new Error("An error occurred while trying to load the Lottie file from URL")}})(e);e=JSON.stringify(r)}return e},Pe=async(e,t)=>{const r=new TextEncoder;let n=e;switch(typeof n){case"object":return n instanceof ArrayBuffer?new Uint8Array(n):(n=JSON.stringify(n),r.encode(n));case"string":if("json"===t)return n=await xe(n),r.encode(n);const e=await(async e=>(await fetch(e)).arrayBuffer())(n);return new Uint8Array(e);default:throw new Error("Invalid src type")}},ke=e=>new Promise((t=>setTimeout(t,e))),Te=(e,t)=>{const r=document.createElement("a");r.setAttribute("href",URL.createObjectURL(t)),r.setAttribute("download",e),document.body.appendChild(r),r.click(),document.body.removeChild(r)};let Ae="idle";class De extends re{src;mimeType="json";renderConfig;speed=1;autoPlay=!1;count;loop=!1;direction=1;mode="normal";intermission=1;totalFrame=0;currentFrame=0;currentState="loading";get size(){return Float32Array.from(this._TVG?.size()||[0,0])}_TVG;_canvas;_imageData;_beginTime=Date.now();_counter=1;_timer;_observer;_observable=!1;async _init(){if(!ye)return;if(!this._timer)return;clearInterval(this._timer),this._timer=void 0;const e=this.renderConfig?.renderer||"sw";await(async e=>{if("sw"!==e){for(;"requested"===Ae;)await ke(100);"initialized"!==Ae&&(Ae="requested",await ye.init(),Ae="initialized")}})(e),this._TVG=new ye.TvgLottieAnimation(e,`#${this._canvas.id}`),this.src&&this.load(this.src,this.mimeType)}_viewport(){const{left:e,right:t,top:r,bottom:n}=this.getBoundingClientRect(),o=window.innerWidth,a=window.innerHeight;let i=0,s=0,l=this._canvas.width,u=this._canvas.height;e<0&&(i=Math.abs(e),l-=i),r<0&&(s=Math.abs(r),u-=s),t>o&&(l-=t-o),n>a&&(u-=n-a),this._TVG.viewport(i,s,l,u)}_observerCallback(e){const t=e[0],r=t.target;r._observable=t.isIntersecting,t.isIntersecting?"frozen"===r.currentState&&r.play():"playing"===r.currentState&&(r.freeze(),r.dispatchEvent(new CustomEvent("freeze")))}firstUpdated(e){this._canvas=this.querySelector(".thorvg"),this._canvas.id=`thorvg-${me().replaceAll("-","").substring(0,6)}`,this._canvas.width=this._canvas.offsetWidth,this._canvas.height=this._canvas.offsetHeight,this._observer=new IntersectionObserver(this._observerCallback),this._observer.observe(this),this._TVG?this.src&&this.load(this.src,this.mimeType):this._timer=setInterval(this._init.bind(this),100)}createRenderRoot(){return this.style.display="block",this}async _animLoop(){this._TVG&&await this._update()&&(this._render(),window.requestAnimationFrame(this._animLoop.bind(this)))}_loadBytes(e,t=""){if(!this._TVG.load(e,this.mimeType,this._canvas.width,this._canvas.height,t))throw new Error("Unable to load an image. Error: ",this._TVG.error());this._render(),this.dispatchEvent(new CustomEvent("load")),this.autoPlay&&this.play()}_flush(){this._canvas.getContext("2d").putImageData(this._imageData,0,0)}_render(){if(this.renderConfig?.enableDevicePixelRatio){const e=1+.75*(window.devicePixelRatio-1),{width:t,height:r}=this._canvas.getBoundingClientRect();this._canvas.width=t*e,this._canvas.height=r*e}this._TVG.resize(this._canvas.width,this._canvas.height),this._viewport();if(!this._TVG.update())return;if("wg"===this.renderConfig?.renderer)return void this._TVG.render();const e=this._TVG.render(),t=new Uint8ClampedArray(e.buffer,e.byteOffset,e.byteLength);t.length<1||(this._imageData=new ImageData(t,this._canvas.width,this._canvas.height),this._flush())}async _update(){if("playing"!==this.currentState)return!1;const e=this._TVG.duration(),t=Date.now()/1e3;if(this.currentFrame=(t-this._beginTime)/e*this.totalFrame*this.speed,-1===this.direction&&(this.currentFrame=this.totalFrame-this.currentFrame),1===this.direction&&this.currentFrame>=this.totalFrame||-1===this.direction&&this.currentFrame<=0){const e=this.count?"bounce"===this.mode?2*this.count:this.count:0;if(this.loop||e&&this._counter<e)return"bounce"===this.mode&&(this.direction=1===this.direction?-1:1,this.currentFrame=1===this.direction?0:this.totalFrame),this.count&&(this._counter+=1),await ke(this.intermission),this.play(),!0;this.dispatchEvent(new CustomEvent("complete")),this.currentState="stopped"}return this.dispatchEvent(new CustomEvent("frame",{detail:{frame:this.currentFrame}})),this._TVG.frame(this.currentFrame)}_frame(e){this.pause(),this.currentFrame=e,this._TVG.frame(e)}async load(e,t="json"){try{await this._init();const r=await Pe(e,t);this.dispatchEvent(new CustomEvent("ready")),this.mimeType=t,await this._loadBytes(r)}catch(e){this.currentState="error",this.dispatchEvent(new CustomEvent("error"))}}play(){if("json"===this.mimeType&&(this.totalFrame=this._TVG.totalFrame(),!(this.totalFrame<1)&&(this._beginTime=Date.now()/1e3,"playing"!==this.currentState)))return this._observable?(this.currentState="playing",void window.requestAnimationFrame(this._animLoop.bind(this))):void(this.currentState="frozen")}pause(){this.currentState="paused",this.dispatchEvent(new CustomEvent("pause"))}stop(){this.currentState="stopped",this.currentFrame=0,this._counter=1,this.seek(0),this.dispatchEvent(new CustomEvent("stop"))}freeze(){this.currentState="frozen",this.dispatchEvent(new CustomEvent("freeze"))}async seek(e){this._frame(e),await this._update(),this._render()}resize(e,t){this._canvas.width=e,this._canvas.height=t,"playing"!==this.currentState&&this._render()}destroy(){this._TVG&&(this._TVG.delete(),this._TVG=null,this.currentState="destroyed",this._observer&&(this._observer.disconnect(),this._observer=void 0),this.dispatchEvent(new CustomEvent("destroyed")),this.remove())}term(){ye.term(),ye=null}setLooping(e){this._TVG&&(this.loop=e)}setDirection(e){this._TVG&&(this.direction=e)}setSpeed(e){this._TVG&&(this.speed=e)}setBgColor(e){this._TVG&&(this._canvas.style.backgroundColor=e)}save(e){if(!this._TVG)return;const t=`output.${e}`;if("png"===e)return void this._canvas.toBlob((e=>{e&&Te("output.png",e)}),"image/png");if(!this._TVG.save(e))throw new Error("Unable to save. Error: ",this._TVG.error());const r=ye.FS.readFile(t);if("gif"===e&&r.length<6)throw new Error("Unable to save the GIF data. The generated file size is invalid.");if("tvg"===e&&r.length<33)throw new Error("Unable to save the TVG data. The generated file size is invalid.");const n=new Blob([r],{type:"application/octet-stream"});Te(t,n)}getVersion(){return{THORVG_VERSION:ge}}render(){return z`
2
2
  <canvas class="thorvg" style="width: 100%; height: 100%;" />
3
3
  `}}ve([ie({type:String})],De.prototype,"src",void 0),ve([ie({type:Ee})],De.prototype,"mimeType",void 0),ve([ie({type:Object})],De.prototype,"renderConfig",void 0),ve([ie({type:Number})],De.prototype,"speed",void 0),ve([ie({type:Boolean})],De.prototype,"autoPlay",void 0),ve([ie({type:Number})],De.prototype,"count",void 0),ve([ie({type:Boolean})],De.prototype,"loop",void 0),ve([ie({type:Number})],De.prototype,"direction",void 0),ve([ie()],De.prototype,"mode",void 0),ve([ie()],De.prototype,"intermission",void 0),ve([ie({type:Number})],De.prototype,"totalFrame",void 0),ve([ie({type:Number})],De.prototype,"currentFrame",void 0),ve([ie({type:Number})],De.prototype,"currentState",void 0),ve([ie({type:Float32Array})],De.prototype,"size",null),De=ve([(e=>(t,r)=>{void 0!==r?r.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)})("lottie-player")],De);var Fe=Object.freeze({__proto__:null});export{_e as ExportableType,be as InitStatus,De as LottiePlayer,Ee as MimeType,$e as PlayMode,Ce as PlayerEvent,Se as PlayerState,we as Renderer};
4
4
  //# sourceMappingURL=lottie-player.esm.js.map