@thorvg/lottie-player 1.0.1 → 1.0.2

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
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["lottie-player"]={})}(this,function(e){"use strict";var t="undefined"!=typeof document?document.currentScript:null;const r=globalThis,n=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),i=new WeakMap;let o=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(n&&void 0===e){const r=void 0!==t&&1===t.length;r&&(e=i.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&i.set(t,e))}return e}toString(){return this.cssText}};const s=n?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,a))(t)})(e):e,{is:l,defineProperty:u,getOwnPropertyDescriptor:c,getOwnPropertyNames:h,getOwnPropertySymbols:d,getPrototypeOf:f}=Object,p=globalThis,m=p.trustedTypes,b=m?m.emptyScript:"",y=p.reactiveElementPolyfillSupport,v=(e,t)=>e,w={toAttribute(e,t){switch(t){case Boolean:e=e?b: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}},g=(e,t)=>!l(e,t),$={attribute:!0,type:String,converter:w,reflect:!1,useDefault:!1,hasChanged:g};Symbol.metadata??=Symbol("metadata"),p.litPropertyMetadata??=new WeakMap;let _=class 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=$){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(e,r,t);void 0!==n&&u(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:a}=c(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:n,set(t){const i=n?.call(this);a?.call(this,t),this.requestUpdate(e,i,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??$}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const e=f(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(v("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(v("properties"))){const e=this.properties,t=[...h(e),...d(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(s(e))}else void 0!==e&&t.push(s(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 e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(n)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const n of t){const t=document.createElement("style"),a=r.litNonce;void 0!==a&&t.setAttribute("nonce",a),t.textContent=n.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}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)}_$ET(e,t){const r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(void 0!==n&&!0===r.reflect){const a=(void 0!==r.converter?.toAttribute?r.converter:w).toAttribute(t,r.type);this._$Em=e,null==a?this.removeAttribute(n):this.setAttribute(n,a),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),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:w;this._$Em=n;const i=a.fromAttribute(t,e.type);this[n]=i??this._$Ej?.get(n)??i,this._$Em=null}}requestUpdate(e,t,r){if(void 0!==e){const n=this.constructor,a=this[e];if(r??=n.getPropertyOptions(e),!((r.hasChanged??g)(a,t)||r.useDefault&&r.reflect&&a===this._$Ej?.get(e)&&!this.hasAttribute(n._$Eu(e,r))))return;this.C(e,t,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:n,wrapped:a},i){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,i??t??this[e]),!0!==a||void 0!==i)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),!0===n&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){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){const{wrapped:e}=r,n=this[t];!0!==e||this._$AL.has(t)||void 0===n||this.C(t,void 0,r,n)}}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._$EM()}catch(t){throw e=!1,this._$EM(),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)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[v("elementProperties")]=new Map,_[v("finalized")]=new Map,y?.({ReactiveElement:_}),(p.reactiveElementVersions??=[]).push("2.1.1");const A={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:g},x=(e=A,t,r)=>{const{kind:n,metadata:a}=r;let i=globalThis.litPropertyMetadata.get(a);if(void 0===i&&globalThis.litPropertyMetadata.set(a,i=new Map),"setter"===n&&((e=Object.create(e)).wrapped=!0),i.set(r.name,e),"accessor"===n){const{name:n}=r;return{set(r){const a=t.get.call(this);t.set.call(this,r),this.requestUpdate(n,a,e)},init(t){return void 0!==t&&this.C(n,void 0,e,t),t}}}if("setter"===n){const{name:n}=r;return function(r){const a=this[n];t.call(this,r),this.requestUpdate(n,a,e)}}throw Error("Unsupported decorator location: "+n)};function S(e){return(t,r)=>"object"==typeof r?x(e,t,r):((e,t,r)=>{const n=t.hasOwnProperty(r);return t.constructor.createProperty(r,e),n?Object.getOwnPropertyDescriptor(t,r):void 0})(e,t,r)}const C=globalThis,E=C.trustedTypes,k=E?E.createPolicy("lit-html",{createHTML:e=>e}):void 0,T="$lit$",O=`lit$${Math.random().toFixed(9).slice(2)}$`,P="?"+O,z=`<${P}>`,R=document,B=()=>R.createComment(""),D=e=>null===e||"object"!=typeof e&&"function"!=typeof e,U=Array.isArray,M="[ \t\n\f\r]",L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,F=/-->/g,N=/>/g,j=RegExp(`>|${M}(?:([^\\s"'>=/]+)(${M}*=${M}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),I=/'/g,V=/"/g,G=/^(?:script|style|textarea|title)$/i,H=(e,...t)=>({_$litType$:1,strings:e,values:t}),q=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),K=new WeakMap,Z=R.createTreeWalker(R,129);function Y(e,t){if(!U(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==k?k.createHTML(t):t}const X=(e,t)=>{const r=e.length-1,n=[];let a,i=2===t?"<svg>":3===t?"<math>":"",o=L;for(let t=0;t<r;t++){const r=e[t];let s,l,u=-1,c=0;for(;c<r.length&&(o.lastIndex=c,l=o.exec(r),null!==l);)c=o.lastIndex,o===L?"!--"===l[1]?o=F:void 0!==l[1]?o=N:void 0!==l[2]?(G.test(l[2])&&(a=RegExp("</"+l[2],"g")),o=j):void 0!==l[3]&&(o=j):o===j?">"===l[0]?(o=a??L,u=-1):void 0===l[1]?u=-2:(u=o.lastIndex-l[2].length,s=l[1],o=void 0===l[3]?j:'"'===l[3]?V:I):o===V||o===I?o=j:o===F||o===N?o=L:(o=j,a=void 0);const h=o===j&&e[t+1].startsWith("/>")?" ":"";i+=o===L?r+z:u>=0?(n.push(s),r.slice(0,u)+T+r.slice(u)+O+h):r+O+(-2===u?t:h)}return[Y(e,i+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),n]};class J{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let a=0,i=0;const o=e.length-1,s=this.parts,[l,u]=X(e,t);if(this.el=J.createElement(l,r),Z.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=Z.nextNode())&&s.length<o;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(T)){const t=u[i++],r=n.getAttribute(e).split(O),o=/([.?@])?(.*)/.exec(t);s.push({type:1,index:a,name:o[2],strings:r,ctor:"."===o[1]?ne:"?"===o[1]?ae:"@"===o[1]?ie:re}),n.removeAttribute(e)}else e.startsWith(O)&&(s.push({type:6,index:a}),n.removeAttribute(e));if(G.test(n.tagName)){const e=n.textContent.split(O),t=e.length-1;if(t>0){n.textContent=E?E.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],B()),Z.nextNode(),s.push({type:2,index:++a});n.append(e[t],B())}}}else if(8===n.nodeType)if(n.data===P)s.push({type:2,index:a});else{let e=-1;for(;-1!==(e=n.data.indexOf(O,e+1));)s.push({type:7,index:a}),e+=O.length-1}a++}}static createElement(e,t){const r=R.createElement("template");return r.innerHTML=e,r}}function Q(e,t,r=e,n){if(t===q)return t;let a=void 0!==n?r._$Co?.[n]:r._$Cl;const i=D(t)?void 0:t._$litDirective$;return a?.constructor!==i&&(a?._$AO?.(!1),void 0===i?a=void 0:(a=new i(e),a._$AT(e,r,n)),void 0!==n?(r._$Co??=[])[n]=a:r._$Cl=a),void 0!==a&&(t=Q(e,a._$AS(e,t.values),a,n)),t}class ee{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??R).importNode(t,!0);Z.currentNode=n;let a=Z.nextNode(),i=0,o=0,s=r[0];for(;void 0!==s;){if(i===s.index){let t;2===s.type?t=new te(a,a.nextSibling,this,e):1===s.type?t=new s.ctor(a,s.name,s.strings,this,e):6===s.type&&(t=new oe(a,this,e)),this._$AV.push(t),s=r[++o]}i!==s?.index&&(a=Z.nextNode(),i++)}return Z.currentNode=R,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 te{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=W,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=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),D(e)?e===W||null==e||""===e?(this._$AH!==W&&this._$AR(),this._$AH=W):e!==this._$AH&&e!==q&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>U(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!==W&&D(this._$AH)?this._$AA.nextSibling.data=e:this.T(R.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=J.createElement(Y(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{const e=new ee(n,this),r=e.u(this.options);e.p(t),this.T(r),this._$AH=e}}_$AC(e){let t=K.get(e.strings);return void 0===t&&K.set(e.strings,t=new J(e)),t}k(e){U(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,n=0;for(const a of e)n===t.length?t.push(r=new te(this.O(B()),this.O(B()),this,this.options)):r=t[n],r._$AI(a),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!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class re{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,a){this.type=1,this._$AH=W,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=a,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=W}_$AI(e,t=this,r,n){const a=this.strings;let i=!1;if(void 0===a)e=Q(this,e,t,0),i=!D(e)||e!==this._$AH&&e!==q,i&&(this._$AH=e);else{const n=e;let o,s;for(e=a[0],o=0;o<a.length-1;o++)s=Q(this,n[r+o],t,o),s===q&&(s=this._$AH[o]),i||=!D(s)||s!==this._$AH[o],s===W?e=W:e!==W&&(e+=(s??"")+a[o+1]),this._$AH[o]=s}i&&!n&&this.j(e)}j(e){e===W?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ne extends re{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===W?void 0:e}}class ae extends re{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==W)}}class ie extends re{constructor(e,t,r,n,a){super(e,t,r,n,a),this.type=5}_$AI(e,t=this){if((e=Q(this,e,t,0)??W)===q)return;const r=this._$AH,n=e===W&&r!==W||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,a=e!==W&&(r===W||n);n&&this.element.removeEventListener(this.name,this,r),a&&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 oe{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 se=C.litHtmlPolyfillSupport;se?.(J,te),(C.litHtmlVersions??=[]).push("3.3.1");const le=globalThis;class ue extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=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._$Do=((e,t,r)=>{const n=r?.renderBefore??t;let a=n._$litPart$;if(void 0===a){const e=r?.renderBefore??null;n._$litPart$=a=new te(t.insertBefore(B(),e),e,void 0,r??{})}return a._$AI(e),a})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return q}}ue._$litElement$=!0,ue.finalized=!0,le.litElementHydrateSupport?.({LitElement:ue});const ce=le.litElementPolyfillSupport;function he(e,t,r,n){var a,i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}ce?.({LitElement:ue}),(le.litElementVersions??=[]).push("4.2.1");let de=null,fe=!1;var pe=function(e){return e.JSON="json",e.LOT="lot",e.JPG="jpg",e.PNG="png",e.SVG="svg",e}({});const me=e=>new Promise(t=>setTimeout(t,e));let be="idle";class ye extends ue{src;wasmUrl;fileType="json";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=null;canvas;config;_imageData;_beginTime=Date.now();_counter=1;_timer;_observer;_observable=!1;_assetResolverCallback;_assetResolverData;async _init(){if(fe)for(;!de;)await me(100);if(de||(fe=!0,de=await async function(e={}){var r,n=e,a=!!globalThis.window,i=!!globalThis.WorkerGlobalScope,o=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;if(o){const{createRequire:e}=await Promise.resolve().then(function(){return ge});var s=e("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:t&&"SCRIPT"===t.tagName.toUpperCase()&&t.src||new URL("lottie-player.js",document.baseURI).href)}var l,u,c=(e,t)=>{throw t},h="undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:t&&"SCRIPT"===t.tagName.toUpperCase()&&t.src||new URL("lottie-player.js",document.baseURI).href,d="";if(o){var f=s("fs");h.startsWith("file:")&&(d=s("path").dirname(s("url").fileURLToPath(h))+"/"),u=e=>(e=z(e)?new URL(e):e,f.readFileSync(e)),l=async e=>(e=z(e)?new URL(e):e,f.readFileSync(e,void 0)),process.argv.slice(2),c=(e,t)=>{throw process.exitCode=e,t}}else if(a||i){try{d=new URL(".",h).href}catch{}i&&(u=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),l=async e=>{if(z(e))return 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)});var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw Error(t.status+" : "+t.url)}}var p,m,b,y,v,w,g,$,_,A,x,S,C,E,k,T=function(){}.bind(),O=function(){}.bind(),P=!1,z=e=>e.startsWith("file://"),R=!1;function B(){var e=sn.buffer;v=new Int8Array(e),g=new Int16Array(e),w=new Uint8Array(e),$=new Uint16Array(e),_=new Int32Array(e),A=new Uint32Array(e),x=new Float32Array(e),S=new Float64Array(e),C=new BigInt64Array(e),E=new BigUint64Array(e)}function D(e){throw n.onAbort?.(e),O(e="Aborted("+e+")"),P=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),y?.(e),e}class U{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var M=e=>{for(;0<e.length;)e.shift()(n)},L=[],F=[],N=()=>{var e=n.preRun.shift();F.push(e)},j=!0,I=new TextDecoder,V=(e,t,r,n)=>{if(r=t+r,n)return r;for(;e[t]&&!(t>=r);)++t;return t},G=(e,t,r)=>e?I.decode(w.subarray(e,V(w,e,t,r))):"",H=e=>{for(var t="";;){var r=w[e++];if(!r)return t;t+=String.fromCharCode(r)}},q={},W={},K={},Z=class extends Error{constructor(e){super(e),this.name="BindingError"}},Y=e=>{throw new Z(e)};function X(e,t,r={}){return function(e,t,r={}){var n=t.name;if(!e)throw new Z(`type "${n}" must have a positive integer typeid pointer`);if(W.hasOwnProperty(e)){if(r.xc)return;throw new Z(`Cannot register type '${n}' twice`)}W[e]=t,delete K[e],q.hasOwnProperty(e)&&(t=q[e],delete q[e],t.forEach(e=>e()))}(e,t,r)}var J=(e,t,r)=>{switch(t){case 1:return r?e=>v[e]:e=>w[e];case 2:return r?e=>g[e>>1]:e=>$[e>>1];case 4:return r?e=>_[e>>2]:e=>A[e>>2];case 8:return r?e=>C[e>>3]:e=>E[e>>3];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Q=e=>{throw new Z(e.za.Na.Ka.name+" instance already deleted")},ee=!1,te=()=>{},re=e=>globalThis.FinalizationRegistry?(ee=new FinalizationRegistry(e=>{--(e=e.za).count.value,0===e.count.value&&(e.Za?e.cb.qb(e.Za):e.Na.Ka.qb(e.La))}),re=e=>{var t=e.za;return t.Za&&ee.register(e,{za:t},e),e},te=e=>{ee.unregister(e)},re(e)):(re=e=>e,e);function ne(){}var ae=(e,t)=>Object.defineProperty(t,"name",{value:e}),ie={},oe=(e,t,r)=>{if(void 0===e[t].Ya){var n=e[t];e[t]=function(...n){if(!e[t].Ya.hasOwnProperty(n.length))throw new Z(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${e[t].Ya})!`);return e[t].Ya[n.length].apply(this,n)},e[t].Ya=[],e[t].Ya[n.yb]=n}},se=(e,t,r)=>{if(n.hasOwnProperty(e)){if(void 0===r||void 0!==n[e].Ya&&void 0!==n[e].Ya[r])throw new Z(`Cannot register public name '${e}' twice`);if(oe(n,e,e),n[e].Ya.hasOwnProperty(r))throw new Z(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`);n[e].Ya[r]=t}else n[e]=t,n[e].yb=r};function le(e,t,r,n,a,i,o,s){this.name=e,this.constructor=t,this.vb=r,this.qb=n,this.ab=a,this.tc=i,this.Db=o,this.qc=s,this.Dc=[]}var ue=(e,t,r)=>{for(;t!==r;){if(!t.Db)throw new Z(`Expected null or instance of ${r.name}, got an instance of ${t.name}`);e=t.Db(e),t=t.ab}return e},ce=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e};function he(e,t){if(null===t){if(this.Mb)throw new Z(`null is not a valid ${this.name}`);return 0}if(!t.za)throw new Z(`Cannot pass "${ce(t)}" as a ${this.name}`);if(!t.za.La)throw new Z(`Cannot pass deleted object as a pointer of type ${this.name}`);return ue(t.za.La,t.za.Na.Ka,this.Ka)}function de(e,t){if(null===t){if(this.Mb)throw new Z(`null is not a valid ${this.name}`);if(this.Gb){var r=this.Ec();return null!==e&&e.push(this.qb,r),r}return 0}if(!t||!t.za)throw new Z(`Cannot pass "${ce(t)}" as a ${this.name}`);if(!t.za.La)throw new Z(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Fb&&t.za.Na.Fb)throw new Z(`Cannot convert argument of type ${t.za.cb?t.za.cb.name:t.za.Na.name} to parameter type ${this.name}`);if(r=ue(t.za.La,t.za.Na.Ka,this.Ka),this.Gb){if(void 0===t.za.Za)throw new Z("Passing raw pointer to smart pointer is illegal");switch(this.Gc){case 0:if(t.za.cb!==this)throw new Z(`Cannot convert argument of type ${t.za.cb?t.za.cb.name:t.za.Na.name} to parameter type ${this.name}`);r=t.za.Za;break;case 1:r=t.za.Za;break;case 2:if(t.za.cb===this)r=t.za.Za;else{var n=t.clone();r=this.Fc(r,Ue(()=>n.delete())),null!==e&&e.push(this.qb,r)}break;default:throw new Z("Unsupporting sharing policy")}}return r}function fe(e,t){if(null===t){if(this.Mb)throw new Z(`null is not a valid ${this.name}`);return 0}if(!t.za)throw new Z(`Cannot pass "${ce(t)}" as a ${this.name}`);if(!t.za.La)throw new Z(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.za.Na.Fb)throw new Z(`Cannot convert argument of type ${t.za.Na.name} to parameter type ${this.name}`);return ue(t.za.La,t.za.Na.Ka,this.Ka)}function pe(e){return this.$a(A[e>>2])}var me=(e,t,r)=>t===r?e:void 0===r.ab||null===(e=me(e,t,r.ab))?null:r.qc(e),be={},ye=class extends Error{constructor(e){super(e),this.name="InternalError"}},ve=(e,t)=>{if(!t.Na||!t.La)throw new ye("makeClassHandle requires ptr and ptrType");if(!!t.cb!=!!t.Za)throw new ye("Both smartPtrType and smartPtr must be specified");return t.count={value:1},re(Object.create(e,{za:{value:t,writable:!0}}))};function we(e,t,r,n,a,i,o,s,l,u,c){this.name=e,this.Ka=t,this.Mb=r,this.Fb=n,this.Gb=a,this.Cc=i,this.Gc=o,this.fc=s,this.Ec=l,this.Fc=u,this.qb=c,a||void 0!==t.ab?this.eb=de:(this.eb=n?he:fe,this.fb=null)}var $e=(e,t,r)=>{if(!n.hasOwnProperty(e))throw new ye("Replacing nonexistent public symbol");void 0!==n[e].Ya&&void 0!==r?n[e].Ya[r]=t:(n[e]=t,n[e].yb=r)},_e=(e,t)=>{e=H(e);var r=ln.get(t);if("function"!=typeof r)throw new Z(`unknown function pointer with signature ${e}: ${t}`);return r};class Ae extends Error{}var xe=e=>{e=Fr(e);var t=H(e);return Nr(e),t},Se=(e,t)=>{var r=[],n={};throw t.forEach(function e(t){n[t]||W[t]||(K[t]?K[t].forEach(e):(r.push(t),n[t]=!0))}),new Ae(`${e}: `+r.map(xe).join([", "]))},Ce=(e,t,r)=>{function n(t){if((t=r(t)).length!==e.length)throw new ye("Mismatched type converter count");for(var n=0;n<e.length;++n)X(e[n],t[n])}e.forEach(e=>K[e]=t);var a=Array(t.length),i=[],o=0;for(let[e,r]of t.entries())W.hasOwnProperty(r)?a[e]=W[r]:(i.push(r),q.hasOwnProperty(r)||(q[r]=[]),q[r].push(()=>{a[e]=W[r],++o===i.length&&n(a)}));0===i.length&&n(a)},Ee=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(A[t+4*n>>2]);return r},ke=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function Te(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].fb)return!0;return!1}function Oe(e,t,r,n,a,i){var o=t.length;if(2>o)throw new Z("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==t[1]&&null!==r,l=Te(t);r=!t[0].dc;var u=t[0],c=t[1];for(n=[e,Y,n,a,ke,u.$a.bind(u),c?.eb.bind(c)],a=2;a<o;++a)n.push((u=t[a]).eb.bind(u));if(!l)for(a=s?1:2;a<t.length;++a)null!==t[a].fb&&n.push(t[a].fb);for(l=Te(t),a=t.length-2,c=[],u=["fn"],s&&u.push("thisWired"),o=0;o<a;++o)c.push(`arg${o}`),u.push(`arg${o}Wired`);c=c.join(","),u=u.join(","),c=`return function (${c}) {\n`,l&&(c+="var destructors = [];\n");var h=l?"destructors":"null",d="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(s&&(c+=`var thisWired = toClassParamWire(${h}, this);\n`),o=0;o<a;++o){var f=`toArg${o}Wire`;c+=`var arg${o}Wired = ${f}(${h}, arg${o});\n`,d.push(f)}if(c+=(r||i?"var rv = ":"")+`invoker(${u});\n`,l)c+="runDestructors(destructors);\n";else for(o=s?1:2;o<t.length;++o)i=1===o?"thisWired":"arg"+(o-2)+"Wired",null!==t[o].fb&&(c+=`${i}_dtor(${i});\n`,d.push(`${i}_dtor`));return r&&(c+="var ret = fromRetWire(rv);\nreturn ret;\n"),t=new Function(d,c+"}\n")(...n),ae(e,t)}var Pe=e=>{const t=(e=e.trim()).indexOf("(");return-1===t?e:e.slice(0,t)},ze=[],Re=[0,1,,1,null,1,!0,1,!1,1],Be=e=>{9<e&&0===--Re[e+1]&&(Re[e]=void 0,ze.push(e))},De=e=>{if(!e)throw new Z(`Cannot use deleted val. handle = ${e}`);return Re[e]},Ue=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const t=ze.pop()||Re.length;return Re[t]=e,Re[t+1]=1,t}},Me={name:"emscripten::val",$a:e=>{var t=De(e);return Be(e),t},eb:(e,t)=>Ue(t),nb:pe,fb:null},Le=(e,t)=>{switch(t){case 4:return function(e){return this.$a(x[e>>2])};case 8:return function(e){return this.$a(S[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Fe=(e,t,r,n)=>{if(!(0<n))return 0;var a=r;n=r+n-1;for(var i=0;i<e.length;++i){var o=e.codePointAt(i);if(127>=o){if(r>=n)break;t[r++]=o}else if(2047>=o){if(r+1>=n)break;t[r++]=192|o>>6,t[r++]=128|63&o}else if(65535>=o){if(r+2>=n)break;t[r++]=224|o>>12,t[r++]=128|o>>6&63,t[r++]=128|63&o}else{if(r+3>=n)break;t[r++]=240|o>>18,t[r++]=128|o>>12&63,t[r++]=128|o>>6&63,t[r++]=128|63&o,i++}}return t[r]=0,r-a},Ne=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);127>=n?t++:2047>=n?t+=2:55296<=n&&57343>=n?(t+=4,++r):t+=3}return t},je=new TextDecoder("utf-16le"),Ie=(e,t,r)=>je.decode($.subarray(e>>=1,V($,e,t/2,r))),Ve=(e,t,r)=>{if(r??=2147483647,2>r)return 0;var n=t;r=(r-=2)<2*e.length?r/2:e.length;for(var a=0;a<r;++a)g[t>>1]=e.charCodeAt(a),t+=2;return g[t>>1]=0,t-n},Ge=e=>2*e.length,He=(e,t,r)=>{var n="";e>>=2;for(var a=0;!(a>=t/4);a++){var i=A[e+a];if(!i&&!r)break;n+=String.fromCodePoint(i)}return n},qe=(e,t,r)=>{if(r??=2147483647,4>r)return 0;var n=t;r=n+r-4;for(var a=0;a<e.length;++a){var i=e.codePointAt(a);if(65535<i&&a++,_[t>>2]=i,(t+=4)+4>r)break}return _[t>>2]=0,t-n},We=e=>{for(var t=0,r=0;r<e.length;++r)65535<e.codePointAt(r)&&r++,t+=4;return t},Ke=0,Ze=[],Ye=(e,t,r)=>{var n=[];return e=e(n,r),n.length&&(A[t>>2]=Ue(n)),e},Xe={},Je=e=>{var t=Xe[e];return void 0===t?H(e):t},Qe={},et=e=>{m=e,j||0<Ke||(n.onExit?.(e),P=!0),c(e,new U(e))},tt=e=>{if(!P)try{if(e(),!(j||0<Ke))try{m=e=m,et(e)}catch(e){e instanceof U||"unwind"==e||c(1,e)}}catch(e){e instanceof U||"unwind"==e||c(1,e)}},rt=e=>{var t=Ne(e)+1,r=an(t);return Fe(e,w,r,t),r},nt=[],at=[],it=e=>{if(e)return nt[e>>>0]},ot=e=>G(A[e>>2],A[e+4>>2]),st=e=>{var t=A[e>>2];return e=A[e+4>>2],t?G(t,e):0===e?"":void 0},lt=e=>({width:A[e>>2],height:A[e+4>>2],depthOrArrayLayers:A[e+8>>2]}),ut=e=>{var t=e+8;return{texture:it(A[e>>2]),mipLevel:A[e+4>>2],origin:{x:A[t>>2],y:A[t+4>>2],z:A[t+8>>2]},aspect:Rt[A[e+20>>2]]}},ct=(e,t)=>{if(e){for(var r={},n=0;n<e;++n){var a=t+24*n;r[ot(a+4)]=S[a+16>>3]}return r}},ht=e=>e?it(e):"auto",dt=[,"clamp-to-edge","repeat","mirror-repeat"],ft=[,"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","src1","one-minus-src1","src1alpha","one-minus-src1alpha"],pt=[,"add","subtract","reverse-subtract","min","max"],mt=["binding-not-used",,"uniform","storage","read-only-storage"],bt=[,"never","less","equal","less-equal","greater","not-equal","greater-equal","always"],yt=[,"opaque","premultiplied","unpremultiplied","inherit"],vt=[,"none","front","back"],wt=[,"compatibility","core"],gt={1:"core-features-and-limits",2:"depth-clip-control",3:"depth32float-stencil8",4:"texture-compression-bc",5:"texture-compression-bc-sliced-3d",6:"texture-compression-etc2",7:"texture-compression-astc",8:"texture-compression-astc-sliced-3d",9:"timestamp-query",10:"indirect-first-instance",11:"shader-f16",12:"rg11b10ufloat-renderable",13:"bgra8unorm-storage",14:"float32-filterable",15:"float32-blendable",16:"clip-distances",17:"dual-source-blending",18:"subgroups",19:"texture-formats-tier1",20:"texture-formats-tier2",21:"primitive-index",327692:"chromium-experimental-unorm16-texture-formats",327693:"chromium-experimental-snorm16-texture-formats",327732:"chromium-experimental-multi-draw-indirect"},$t=[,"nearest","linear"],_t=[,"ccw","cw"],At=[,"uint16","uint32"],xt=[,"load","clear"],St=[,"nearest","linear"],Ct=[,"low-power","high-performance"],Et=[,"srgb","display-p3"],kt=[,"point-list","line-list","line-strip","triangle-list","triangle-strip"],Tt=["binding-not-used",,"filtering","non-filtering","comparison"],Ot=[,"keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],Pt=["binding-not-used",,"write-only","read-only","read-write"],zt=[,"store","discard"],Rt=[,"all","stencil-only","depth-only"],Bt=[,"1d","2d","3d"],Dt=[,"r8unorm","r8snorm","r8uint","r8sint","r16unorm","r16snorm","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32float","r32uint","r32sint","rg16unorm","rg16snorm","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb10a2uint","rgb10a2unorm","rg11b10ufloat","rgb9e5ufloat","rg32float","rg32uint","rg32sint","rgba16unorm","rgba16snorm","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"],Ut=["binding-not-used",,"float","unfilterable-float","depth","sint","uint"],Mt=[,"1d","2d","2d-array","cube","cube-array","3d"],Lt=[,"standard","extended"],Ft=[,"uint8","uint8x2","uint8x4","sint8","sint8x2","sint8x4","unorm8","unorm8x2","unorm8x4","snorm8","snorm8x2","snorm8x4","uint16","uint16x2","uint16x4","sint16","sint16x2","sint16x4","unorm16","unorm16x2","unorm16x4","snorm16","snorm16x2","snorm16x4","float16","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4","unorm10-10-10-2","unorm8x4-bgra"],Nt=[,"vertex","instance"],jt={undefined:1,unknown:1,destroyed:2},It=e=>-9007199254740992>e||9007199254740992<e?NaN:Number(e),Vt=(e,t)=>{for(var r=0,n=e.length-1;0<=n;n--){var a=e[n];"."===a?e.splice(n,1):".."===a?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},Gt=e=>{var t="/"===e.charAt(0),r="/"===e.slice(-1);return(e=Vt(e.split("/").filter(e=>!!e),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},Ht=e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&=t.slice(0,-1),e+t):"."},qt=e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],Wt=e=>{(Wt=(()=>{if(o){var e=s("crypto");return t=>e.randomFillSync(t)}return e=>crypto.getRandomValues(e)})())(e)},Kt=(...e)=>{for(var t="",r=!1,n=e.length-1;-1<=n&&!r;n--){if("string"!=typeof(r=0<=n?e[n]:Ur.cwd()))throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";t=r+"/"+t,r="/"===r.charAt(0)}return t=Vt(t.split("/").filter(e=>!!e),!r).join("/"),(r?"/":"")+t||"."},Zt=(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;0<=r&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=Kt(e).slice(1),t=Kt(t).slice(1),e=r(e.split("/")),t=r(t.split("/"));for(var n=Math.min(e.length,t.length),a=n,i=0;i<n;i++)if(e[i]!==t[i]){a=i;break}for(n=[],i=a;i<e.length;i++)n.push("..");return(n=n.concat(t.slice(a))).join("/")},Yt=e=>{var t=V(e,0);return I.decode(e.buffer?e.subarray(0,t):new Uint8Array(e.slice(0,t)))},Xt=[],Jt=e=>{var t=Array(Ne(e)+1);return e=Fe(e,t,0,t.length),t.length=e,t},Qt=[];function er(e,t){Qt[e]={input:[],output:[],xb:t},fr(e,tr)}var tr={open(e){var t=Qt[e.node.rdev];if(!t)throw new Ur.ya(43);e.tty=t,e.seekable=!1},close(e){e.tty.xb.fsync(e.tty)},fsync(e){e.tty.xb.fsync(e.tty)},read(e,t,r,n){if(!e.tty||!e.tty.xb.ac)throw new Ur.ya(60);for(var a=0,i=0;i<n;i++){try{var o=e.tty.xb.ac(e.tty)}catch(e){throw new Ur.ya(29)}if(void 0===o&&0===a)throw new Ur.ya(6);if(null==o)break;a++,t[r+i]=o}return a&&(e.node.atime=Date.now()),a},write(e,t,r,n){if(!e.tty||!e.tty.xb.Qb)throw new Ur.ya(60);try{for(var a=0;a<n;a++)e.tty.xb.Qb(e.tty,t[r+a])}catch(e){throw new Ur.ya(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),a}},rr={ac(){e:{if(!Xt.length){var e=null;if(o){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}0<r&&(e=t.slice(0,r).toString("utf-8"))}else globalThis.window?.prompt&&null!==(e=window.prompt("Input: "))&&(e+="\n");if(!e){e=null;break e}Xt=Jt(e)}e=Xt.shift()}return e},Qb(e,t){null===t||10===t?(T(Yt(e.output)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){0<e.output?.length&&(T(Yt(e.output)),e.output=[])},ad:()=>({Oc:25856,Qc:5,Nc:191,Pc:35387,Mc:[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]}),bd:()=>0,cd:()=>[24,80]},nr={Qb(e,t){null===t||10===t?(O(Yt(e.output)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){0<e.output?.length&&(O(Yt(e.output)),e.output=[])}},ar={kb:null,Ma:()=>ar.createNode(null,"/",16895,0),createNode(e,t,r,n){if(24576==(61440&r)||Ur.isFIFO(r))throw new Ur.ya(63);return ar.kb||(ar.kb={dir:{node:{hb:ar.Ba.hb,jb:ar.Ba.jb,lookup:ar.Ba.lookup,lb:ar.Ba.lb,rename:ar.Ba.rename,unlink:ar.Ba.unlink,rmdir:ar.Ba.rmdir,readdir:ar.Ba.readdir,symlink:ar.Ba.symlink},stream:{bb:ar.Ca.bb}},file:{node:{hb:ar.Ba.hb,jb:ar.Ba.jb},stream:{bb:ar.Ca.bb,read:ar.Ca.read,write:ar.Ca.write,wb:ar.Ca.wb,Bb:ar.Ca.Bb}},link:{node:{hb:ar.Ba.hb,jb:ar.Ba.jb,readlink:ar.Ba.readlink},stream:{}},Wb:{node:{hb:ar.Ba.hb,jb:ar.Ba.jb},stream:Ur.oc}}),pr((r=Ur.createNode(e,t,r,n)).mode)?(r.Ba=ar.kb.dir.node,r.Ca=ar.kb.dir.stream,r.Da={}):Ur.isFile(r.mode)?(r.Ba=ar.kb.file.node,r.Ca=ar.kb.file.stream,r.Oa=0,r.Da=null):40960==(61440&r.mode)?(r.Ba=ar.kb.link.node,r.Ca=ar.kb.link.stream):8192==(61440&r.mode)&&(r.Ba=ar.kb.Wb.node,r.Ca=ar.kb.Wb.stream),r.atime=r.mtime=r.ctime=Date.now(),e&&(e.Da[t]=r,e.atime=e.mtime=e.ctime=r.atime),r},$c:e=>e.Da?e.Da.subarray?e.Da.subarray(0,e.Oa):new Uint8Array(e.Da):new Uint8Array(0),Ba:{hb(e){var t={};return t.dev=8192==(61440&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,t.size=pr(e.mode)?4096:Ur.isFile(e.mode)?e.Oa:40960==(61440&e.mode)?e.link.length:0,t.atime=new Date(e.atime),t.mtime=new Date(e.mtime),t.ctime=new Date(e.ctime),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},jb(e,t){for(var r of["mode","atime","mtime","ctime"])null!=t[r]&&(e[r]=t[r]);void 0!==t.size&&e.Oa!=(t=t.size)&&(0==t?(e.Da=null,e.Oa=0):(r=e.Da,e.Da=new Uint8Array(t),r&&e.Da.set(r.subarray(0,Math.min(t,e.Oa))),e.Oa=t))},lookup(){throw ar.Jb||(ar.Jb=new Ur.ya(44),ar.Jb.stack="<generic error, no stack>"),ar.Jb},lb:(e,t,r,n)=>ar.createNode(e,t,r,n),rename(e,t,r){try{var n=mr(t,r)}catch(e){}if(n){if(pr(e.mode))for(var a in n.Da)throw new Ur.ya(55);br(n)}delete e.parent.Da[e.name],t.Da[r]=e,e.name=r,t.ctime=t.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,t){delete e.Da[t],e.ctime=e.mtime=Date.now()},rmdir(e,t){var r,n=mr(e,t);for(r in n.Da)throw new Ur.ya(55);delete e.Da[t],e.ctime=e.mtime=Date.now()},readdir:e=>[".","..",...Object.keys(e.Da)],symlink:(e,t,r)=>((e=ar.createNode(e,t,41471,0)).link=r,e),readlink(e){if(40960!=(61440&e.mode))throw new Ur.ya(28);return e.link}},Ca:{read(e,t,r,n,a){var i=e.node.Da;if(a>=e.node.Oa)return 0;if(8<(e=Math.min(e.node.Oa-a,n))&&i.subarray)t.set(i.subarray(a,a+e),r);else for(n=0;n<e;n++)t[r+n]=i[a+n];return e},write(e,t,r,n,a,i){if(t.buffer===v.buffer&&(i=!1),!n)return 0;if((e=e.node).mtime=e.ctime=Date.now(),t.subarray&&(!e.Da||e.Da.subarray)){if(i)return e.Da=t.subarray(r,r+n),e.Oa=n;if(0===e.Oa&&0===a)return e.Da=t.slice(r,r+n),e.Oa=n;if(a+n<=e.Oa)return e.Da.set(t.subarray(r,r+n),a),n}var o=e.Da?e.Da.length:0;if(o>=(i=a+n)||(i=Math.max(i,o*(1048576>o?2:1.125)>>>0),0!=o&&(i=Math.max(i,256)),o=e.Da,e.Da=new Uint8Array(i),0<e.Oa&&e.Da.set(o.subarray(0,e.Oa),0)),e.Da.subarray&&t.subarray)e.Da.set(t.subarray(r,r+n),a);else for(i=0;i<n;i++)e.Da[a+i]=t[r+i];return e.Oa=Math.max(e.Oa,a+n),n},bb(e,t,r){if(1===r?t+=e.position:2===r&&Ur.isFile(e.node.mode)&&(t+=e.node.Oa),0>t)throw new Ur.ya(28);return t},wb(e,t,r,n,a){if(!Ur.isFile(e.node.mode))throw new Ur.ya(43);if(e=e.node.Da,2&a||!e||e.buffer!==v.buffer){if(n=!0,D(),!(a=void 0))throw new Ur.ya(48);e&&((0<r||r+t<e.length)&&(e=e.subarray?e.subarray(r,r+t):Array.prototype.slice.call(e,r,r+t)),v.set(e,a))}else n=!1,a=e.byteOffset;return{La:a,Ic:n}},Bb:(e,t,r,n)=>(ar.Ca.write(e,t,0,n,r,!1),0)}},ir=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},or=0,sr=null,lr=()=>{if(or--,n.monitorRunDependencies?.(or),0==or&&sr){var e=sr;sr=null,e()}},ur=()=>{or++,n.monitorRunDependencies?.(or)},cr=[],hr=async(e,t,r,n,a,i,o,s)=>{var u=t?Kt(Gt(e+"/"+t)):e;ur();try{var c=r;"string"==typeof r&&(c=await(async e=>(e=await l(e),new Uint8Array(e)))(r)),c=await(async(e,t)=>{for(var r of("undefined"!=typeof Browser&&dr(),cr))if(r.canHandle(t))return r.handle(e,t);return e})(c,u),s?.(),i||yr(e,t,c,n,a,o)}finally{lr()}};function dr(){var e,t,r;Ur.Lb=!0,e??=n.stdin,t??=n.stdout,r??=n.stderr,e?Ur.pb("/dev","stdin",e):Ur.symlink("/dev/tty","/dev/stdin"),t?Ur.pb("/dev","stdout",null,t):Ur.symlink("/dev/tty","/dev/stdout"),r?Ur.pb("/dev","stderr",null,r):Ur.symlink("/dev/tty1","/dev/stderr"),Ur.open("/dev/stdin",0),Ur.open("/dev/stdout",1),Ur.open("/dev/stderr",1)}function fr(e,t){Ur.Zb[e]={Ca:t}}function pr(e){return 16384==(61440&e)}function mr(e,t){var r=pr(e.mode)?(r=Ar(e,"x"))?r:e.Ba.lookup?0:2:54;if(r)throw new Ur.ya(r);for(r=Ur.mb[gr(e.id,t)];r;r=r.ub)if(r.parent.id===e.id&&r.name===t)return r;return Ur.lookup(e,t)}function br(e){var t=gr(e.parent.id,e.name);if(Ur.mb[t]===e)Ur.mb[t]=e.ub;else for(t=Ur.mb[t];t;){if(t.ub===e){t.ub=e.ub;break}t=t.ub}}function yr(e,t,r,n,a,i){var o=t;if(e&&(e="string"==typeof e?e:wr(e),o=t?Gt(e+"/"+t):e),e=ir(n,a),o=Ur.create(o,e),r){if("string"==typeof r){for(t=Array(r.length),n=0,a=r.length;n<a;++n)t[n]=r.charCodeAt(n);r=t}Ur.chmod(o,146|e),t=Ur.open(o,577),Ur.write(t,r,0,r.length,0,i),Ur.close(t),Ur.chmod(o,e)}}function vr(e,t={}){if(!e)throw new Ur.ya(44);t.Eb??(t.Eb=!0),"/"===e.charAt(0)||(e=Ur.cwd()+"/"+e);var r=0;e:for(;40>r;r++){e=e.split("/").filter(e=>!!e);for(var n=Ur.root,a="/",i=0;i<e.length;i++){var o=i===e.length-1;if(o&&t.parent)break;if("."!==e[i])if(".."===e[i]){if(a=Ht(a),Ur.Nb(n)){e=a+"/"+e.slice(i+1).join("/"),r--;continue e}n=n.parent}else{a=Gt(a+"/"+e[i]);try{n=mr(n,e[i])}catch(e){if(44===e?.sb&&o&&t.Ac)return{path:a};throw e}if(!n.ib||o&&!t.Eb||(n=n.ib.root),40960==(61440&n.mode)&&(!o||t.gb)){if(!n.Ba.readlink)throw new Ur.ya(52);"/"===(n=n.Ba.readlink(n)).charAt(0)||(n=Ht(a)+"/"+n),e=n+"/"+e.slice(i+1).join("/");continue e}}}return{path:a,node:n}}throw new Ur.ya(32)}function wr(e){for(var t;;){if(Ur.Nb(e))return e=e.Ma.ec,t?"/"!==e[e.length-1]?`${e}/${t}`:e+t:e;t=t?`${e.name}/${t}`:e.name,e=e.parent}}function gr(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Ur.mb.length}function $r(e){var t=gr(e.parent.id,e.name);e.ub=Ur.mb[t],Ur.mb[t]=e}function _r(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function Ar(e,t){return Ur.bc?0:!t.includes("r")||292&e.mode?t.includes("w")&&!(146&e.mode)||t.includes("x")&&!(73&e.mode)?2:0:2}function xr(e,t){if(!pr(e.mode))return 54;try{return mr(e,t),20}catch(e){}return Ar(e,"wx")}function Sr(e,t,r){try{var n=mr(e,t)}catch(e){return e.sb}if(e=Ar(e,"wx"))return e;if(r){if(!pr(n.mode))return 54;if(Ur.Nb(n)||wr(n)===Ur.cwd())return 10}else if(pr(n.mode))return 31;return 0}function Cr(e,t){if(!e)throw new Ur.ya(t);return e}function Er(e){if(!(e=Ur.wc(e)))throw new Ur.ya(8);return e}function kr(e,t=-1){if(e=Object.assign(new Ur.lc,e),-1==t)e:{for(t=0;t<=Ur.nc;t++)if(!Ur.streams[t])break e;throw new Ur.ya(33)}return e.fd=t,Ur.streams[t]=e}function Tr(e,t,r){var n=e?.Ca.jb;e=n?e:t,n??=t.Ba.jb,Cr(n,63),n(e,r)}function Or(e){var t=[];for(e=[e];e.length;){var r=e.pop();t.push(r),e.push(...r.Ab)}return t}function Pr(e){var t={Lc:4096,Xc:4096,blocks:1e6,Kc:5e5,Jc:5e5,files:Ur.Pb,Vc:Ur.Pb-1,Yc:42,flags:2,gd:255};return e.Ba.ic&&Object.assign(t,e.Ba.ic(e.Ma.Bc.root)),t}function zr(e,t,r){return void 0===r&&(r=t,t=438),Ur.lb(e,8192|t,r)}function Rr(e,t,r,n){Tr(e,t,{mode:4095&r|-4096&t.mode,ctime:Date.now(),$b:n})}function Br(e,t,r){if(pr(t.mode))throw new Ur.ya(31);if(!Ur.isFile(t.mode))throw new Ur.ya(28);var n=Ar(t,"w");if(n)throw new Ur.ya(n);Tr(e,t,{size:r,timestamp:Date.now()})}function Dr(e){if(!(e.yc||e.zc||e.link||e.Da))if(globalThis.XMLHttpRequest)D("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.");else try{e.Da=u(e.url)}catch(e){throw new Ur.ya(29)}}var Ur={root:null,Ab:[],Zb:{},streams:[],Pb:1,mb:null,Xb:"/",Lb:!1,bc:!0,sc:null,Hb:0,hc:{},ya:class{name="ErrnoError";constructor(e){this.sb=e}},lc:class{ob={};node=null;get object(){return this.node}set object(e){this.node=e}get flags(){return this.ob.flags}set flags(e){this.ob.flags=e}get position(){return this.ob.position}set position(e){this.ob.position=e}},kc:class{Ba={};Ca={};ib=null;constructor(e,t,r,n){e||=this,this.parent=e,this.Ma=e.Ma,this.id=Ur.Pb++,this.name=t,this.mode=r,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return!(365&~this.mode)}set read(e){e?this.mode|=365:this.mode&=-366}get write(){return!(146&~this.mode)}set write(e){e?this.mode|=146:this.mode&=-147}get zc(){return pr(this.mode)}get yc(){return 8192==(61440&this.mode)}},createNode:(e,t,r,n)=>($r(e=new Ur.kc(e,t,r,n)),e),Nb:e=>e===e.parent,isFile:e=>32768==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),nc:4096,wc:e=>Ur.streams[e],Uc:(e,t=-1)=>(e=kr(e,t),e.Ca?.Tc?.(e),e),oc:{open(e){e.Ca=Ur.uc(e.node.rdev).Ca,e.Ca.open?.(e)},bb(){throw new Ur.ya(70)}},Ob:e=>e>>8,dd:e=>255&e,tb:(e,t)=>e<<8|t,uc:e=>Ur.Zb[e],jc(e,t){function r(e){return Ur.Hb--,t(e)}function n(e){if(e){if(!n.rc)return n.rc=!0,r(e)}else++o>=i.length&&r(null)}"function"==typeof e&&(t=e,e=!1),Ur.Hb++,1<Ur.Hb&&O(`warning: ${Ur.Hb} FS.syncfs operations in flight at once, probably just doing extra work`);var a,i=Or(Ur.root.Ma),o=0;for(a of i)a.type.jc?a.type.jc(a,e,n):n(null)},Ma(e,t,r){var n="/"===r;if(n&&Ur.root)throw new Ur.ya(10);if(!n&&r){var a=vr(r,{Eb:!1});if(r=a.path,(a=a.node).ib)throw new Ur.ya(10);if(!pr(a.mode))throw new Ur.ya(54)}return(e=e.Ma(t={type:e,Bc:t,ec:r,Ab:[]})).Ma=t,t.root=e,n?Ur.root=e:a&&(a.ib=t,a.Ma&&a.Ma.Ab.push(t)),e},od(e){if(!(e=vr(e,{Eb:!1})).node.ib)throw new Ur.ya(28);var t=(e=e.node).ib,r=Or(t);for([,a]of Object.entries(Ur.mb))for(;a;){var n=a.ub;r.includes(a.Ma)&&br(a);var a=n}e.ib=null,e.Ma.Ab.splice(e.Ma.Ab.indexOf(t),1)},lookup:(e,t)=>e.Ba.lookup(e,t),lb(e,t,r){var n=vr(e,{parent:!0}).node;if(!(e=qt(e)))throw new Ur.ya(28);if("."===e||".."===e)throw new Ur.ya(20);var a=xr(n,e);if(a)throw new Ur.ya(a);if(!n.Ba.lb)throw new Ur.ya(63);return n.Ba.lb(n,e,t,r)},ic:e=>Pr(vr(e,{gb:!0}).node),kd:e=>Pr(e.node),create:(e,t=438)=>Ur.lb(e,4095&t|32768,0),mkdir:(e,t=511)=>Ur.lb(e,1023&t|16384,0),ed(e,t){var r,n=e.split("/"),a="";for(r of n)if(r){(a||"/"===e.charAt(0))&&(a+="/"),a+=r;try{Ur.mkdir(a,t)}catch(e){if(20!=e.sb)throw e}}},symlink(e,t){if(!Kt(e))throw new Ur.ya(44);var r=vr(t,{parent:!0}).node;if(!r)throw new Ur.ya(44);var n=xr(r,t=qt(t));if(n)throw new Ur.ya(n);if(!r.Ba.symlink)throw new Ur.ya(63);return r.Ba.symlink(r,t,e)},rename(e,t){var r=Ht(e),n=Ht(t),a=qt(e),i=qt(t),o=vr(e,{parent:!0}),s=o.node;if(o=(o=vr(t,{parent:!0})).node,!s||!o)throw new Ur.ya(44);if(s.Ma!==o.Ma)throw new Ur.ya(75);var l=mr(s,a);if("."!==(e=Zt(e,n)).charAt(0))throw new Ur.ya(28);if("."!==(e=Zt(t,r)).charAt(0))throw new Ur.ya(55);try{var u=mr(o,i)}catch(e){}if(l!==u){if(a=Sr(s,a,t=pr(l.mode)))throw new Ur.ya(a);if(a=u?Sr(o,i,t):xr(o,i))throw new Ur.ya(a);if(!s.Ba.rename)throw new Ur.ya(63);if(l.ib||u&&u.ib)throw new Ur.ya(10);if(o!==s&&(a=Ar(s,"w")))throw new Ur.ya(a);br(l);try{s.Ba.rename(l,o,i),l.parent=o}catch(e){throw e}finally{$r(l)}}},rmdir(e){var t=vr(e,{parent:!0}).node,r=mr(t,e=qt(e)),n=Sr(t,e,!0);if(n)throw new Ur.ya(n);if(!t.Ba.rmdir)throw new Ur.ya(63);if(r.ib)throw new Ur.ya(10);t.Ba.rmdir(t,e),br(r)},readdir:e=>Cr((e=vr(e,{gb:!0}).node).Ba.readdir,54)(e),unlink(e){var t=vr(e,{parent:!0}).node;if(!t)throw new Ur.ya(44);var r=mr(t,e=qt(e)),n=Sr(t,e,!1);if(n)throw new Ur.ya(n);if(!t.Ba.unlink)throw new Ur.ya(63);if(r.ib)throw new Ur.ya(10);t.Ba.unlink(t,e),br(r)},readlink(e){if(!(e=vr(e).node))throw new Ur.ya(44);if(!e.Ba.readlink)throw new Ur.ya(28);return e.Ba.readlink(e)},stat:(e,t)=>Cr((e=vr(e,{gb:!t}).node).Ba.hb,63)(e),fstat(e){var t=Er(e);e=t.node;var r=t.Ca.hb;return t=r?t:e,r??=e.Ba.hb,Cr(r,63),r(t)},lstat:e=>Ur.stat(e,!0),chmod(e,t,r){Rr(null,e="string"==typeof e?vr(e,{gb:!r}).node:e,t,r)},lchmod(e,t){Ur.chmod(e,t,!0)},fchmod(e,t){Rr(e=Er(e),e.node,t,!1)},chown(e,t,r,n){Tr(null,e="string"==typeof e?vr(e,{gb:!n}).node:e,{timestamp:Date.now(),$b:n})},lchown(e,t,r){Ur.chown(e,t,r,!0)},fchown(e){Tr(e=Er(e),e.node,{timestamp:Date.now(),$b:!1})},truncate(e,t){if(0>t)throw new Ur.ya(28);Br(null,e="string"==typeof e?vr(e,{gb:!0}).node:e,t)},Zc(e,t){if(e=Er(e),0>t||!(2097155&e.flags))throw new Ur.ya(28);Br(e,e.node,t)},pd(e,t,r){Cr((e=vr(e,{gb:!0}).node).Ba.jb,63)(e,{atime:t,mtime:r})},open(e,t,r=438){if(""===e)throw new Ur.ya(44);if("string"==typeof t){var a={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[t];if(void 0===a)throw Error(`Unknown file open mode: ${t}`);t=a}if(r=64&t?4095&r|32768:0,"object"==typeof e)a=e;else{var i=e.endsWith("/");a=(e=vr(e,{gb:!(131072&t),Ac:!0})).node,e=e.path}var o=!1;if(64&t)if(a){if(128&t)throw new Ur.ya(20)}else{if(i)throw new Ur.ya(31);a=Ur.lb(e,511|r,0),o=!0}if(!a)throw new Ur.ya(44);if(8192==(61440&a.mode)&&(t&=-513),65536&t&&!pr(a.mode))throw new Ur.ya(54);if(!o&&(i=a?40960==(61440&a.mode)?32:pr(a.mode)&&("r"!==_r(t)||576&t)?31:Ar(a,_r(t)):44))throw new Ur.ya(i);return 512&t&&!o&&Ur.truncate(a,0),t&=-131713,(i=kr({node:a,path:wr(a),flags:t,seekable:!0,position:0,Ca:a.Ca,Hc:[],error:!1})).Ca.open&&i.Ca.open(i),o&&Ur.chmod(a,511&r),!n.logReadFiles||1&t||e in Ur.hc||(Ur.hc[e]=1),i},close(e){if(null===e.fd)throw new Ur.ya(8);e.Kb&&(e.Kb=null);try{e.Ca.close&&e.Ca.close(e)}catch(e){throw e}finally{Ur.streams[e.fd]=null}e.fd=null},bb(e,t,r){if(null===e.fd)throw new Ur.ya(8);if(!e.seekable||!e.Ca.bb)throw new Ur.ya(70);if(0!=r&&1!=r&&2!=r)throw new Ur.ya(28);return e.position=e.Ca.bb(e,t,r),e.Hc=[],e.position},read(e,t,r,n,a){if(0>n||0>a)throw new Ur.ya(28);if(null===e.fd)throw new Ur.ya(8);if(1==(2097155&e.flags))throw new Ur.ya(8);if(pr(e.node.mode))throw new Ur.ya(31);if(!e.Ca.read)throw new Ur.ya(28);var i=void 0!==a;if(i){if(!e.seekable)throw new Ur.ya(70)}else a=e.position;return t=e.Ca.read(e,t,r,n,a),i||(e.position+=t),t},write(e,t,r,n,a,i){if(0>n||0>a)throw new Ur.ya(28);if(null===e.fd)throw new Ur.ya(8);if(!(2097155&e.flags))throw new Ur.ya(8);if(pr(e.node.mode))throw new Ur.ya(31);if(!e.Ca.write)throw new Ur.ya(28);e.seekable&&1024&e.flags&&Ur.bb(e,0,2);var o=void 0!==a;if(o){if(!e.seekable)throw new Ur.ya(70)}else a=e.position;return t=e.Ca.write(e,t,r,n,a,i),o||(e.position+=t),t},wb(e,t,r,n,a){if(2&n&&!(2&a)&&2!=(2097155&e.flags))throw new Ur.ya(2);if(1==(2097155&e.flags))throw new Ur.ya(2);if(!e.Ca.wb)throw new Ur.ya(43);if(!t)throw new Ur.ya(28);return e.Ca.wb(e,t,r,n,a)},Bb:(e,t,r,n,a)=>e.Ca.Bb?e.Ca.Bb(e,t,r,n,a):0,cc(e,t,r){if(!e.Ca.cc)throw new Ur.ya(59);return e.Ca.cc(e,t,r)},readFile(e,t={}){t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding&&D(`Invalid encoding type "${t.encoding}"`);var r=Ur.open(e,t.flags);e=Ur.stat(e).size;var n=new Uint8Array(e);return Ur.read(r,n,0,e,0),"utf8"===t.encoding&&(n=Yt(n)),Ur.close(r),n},writeFile(e,t,r={}){r.flags=r.flags||577,e=Ur.open(e,r.flags,r.mode),"string"==typeof t&&(t=new Uint8Array(Jt(t))),ArrayBuffer.isView(t)?Ur.write(e,t,0,t.byteLength,void 0,r.Rc):D("Unsupported data type"),Ur.close(e)},cwd:()=>Ur.Xb,chdir(e){if(null===(e=vr(e,{gb:!0})).node)throw new Ur.ya(44);if(!pr(e.node.mode))throw new Ur.ya(54);var t=Ar(e.node,"x");if(t)throw new Ur.ya(t);Ur.Xb=e.path},jd(){for(var e of(Ur.Lb=!1,Ur.streams))e&&Ur.close(e)},Wc(e,t){try{var r=vr(e,{gb:!t});e=r.path}catch(e){}var n=!1,a=null;try{r=vr(e,{parent:!0}),qt(e),r=vr(e,{gb:!t}),n=!0,a=r.node}catch(e){}return n?a:null},pb(e,t,r,n){var a;return e=((e,t)=>Gt(e+"/"+t))("string"==typeof e?e:wr(e),t),t=ir(!!r,!!n),(a=Ur.pb).Ob??(a.Ob=64),fr(a=Ur.tb(Ur.pb.Ob++,0),{open(e){e.seekable=!1},close(){n?.buffer?.length&&n(10)},read(e,t,n,a){for(var i=0,o=0;o<a;o++){try{var s=r()}catch(e){throw new Ur.ya(29)}if(void 0===s&&0===i)throw new Ur.ya(6);if(null==s)break;i++,t[n+o]=s}return i&&(e.node.atime=Date.now()),i},write(e,t,r,a){for(var i=0;i<a;i++)try{n(t[r+i])}catch(e){throw new Ur.ya(29)}return a&&(e.node.mtime=e.node.ctime=Date.now()),i}}),zr(e,t,a)}},Mr=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0];if((()=>{let e=ne.prototype;Object.assign(e,{isAliasOf:function(e){if(!(this instanceof ne&&e instanceof ne))return!1;var t=this.za.Na.Ka,r=this.za.La;e.za=e.za;var n=e.za.Na.Ka;for(e=e.za.La;t.ab;)r=t.Db(r),t=t.ab;for(;n.ab;)e=n.Db(e),n=n.ab;return t===n&&r===e},clone:function(){if(this.za.La||Q(this),this.za.Cb)return this.za.count.value+=1,this;var e=re,t=Object,r=t.create,n=Object.getPrototypeOf(this),a=this.za;return(e=e(r.call(t,n,{za:{value:{count:a.count,zb:a.zb,Cb:a.Cb,La:a.La,Na:a.Na,Za:a.Za,cb:a.cb}}}))).za.count.value+=1,e.za.zb=!1,e},delete(){if(this.za.La||Q(this),this.za.zb&&!this.za.Cb)throw new Z("Object already scheduled for deletion");te(this);var e=this.za;--e.count.value,0===e.count.value&&(e.Za?e.cb.qb(e.Za):e.Na.Ka.qb(e.La)),this.za.Cb||(this.za.Za=void 0,this.za.La=void 0)},isDeleted:function(){return!this.za.La},deleteLater:function(){if(this.za.La||Q(this),this.za.zb&&!this.za.Cb)throw new Z("Object already scheduled for deletion");return this.za.zb=!0,this}});const t=Symbol.dispose;t&&(e[t]=e.delete)})(),Object.assign(we.prototype,{vc(e){return this.fc&&(e=this.fc(e)),e},Yb(e){this.qb?.(e)},nb:pe,$a:function(e){function t(){return ve(this.Ka.vb,this.Gb?{Na:this.Cc,La:r,cb:this,Za:e}:{Na:this,La:e})}var r=this.vc(e);if(!r)return this.Yb(e),null;var n=((e,t)=>{if(void 0===t)throw new Z("ptr should not be undefined");for(;e.ab;)t=e.Db(t),e=e.ab;return be[t]})(this.Ka,r);if(void 0!==n)return 0===n.za.count.value?(n.za.La=r,n.za.Za=e,n.clone()):(n=n.clone(),this.Yb(e),n);if(n=this.Ka.tc(r),!(n=ie[n]))return t.call(this);var a=me(r,this.Ka,(n=this.Fb?n.pc:n.pointerType).Ka);return null===a?t.call(this):ve(n.Ka.vb,this.Gb?{Na:n,La:a,cb:this,Za:e}:{Na:n,La:a})}}),Ur.Sc=(e,t,r,n,a,i,o,s,l,u)=>{hr(e,t,r,n,a,s,l,u).then(i).catch(o)},Ur.hd=hr,Ur.mb=Array(4096),Ur.Ma(ar,{},"/"),Ur.mkdir("/tmp"),Ur.mkdir("/home"),Ur.mkdir("/home/web_user"),function(){Ur.mkdir("/dev"),fr(Ur.tb(1,3),{read:()=>0,write:(e,t,r,n)=>n,bb:()=>0}),zr("/dev/null",Ur.tb(1,3)),er(Ur.tb(5,0),rr),er(Ur.tb(6,0),nr),zr("/dev/tty",Ur.tb(5,0)),zr("/dev/tty1",Ur.tb(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(Wt(e),t=e.byteLength),e[--t]);Ur.pb("/dev","random",r),Ur.pb("/dev","urandom",r),Ur.mkdir("/dev/shm"),Ur.mkdir("/dev/shm/tmp")}(),function(){Ur.mkdir("/proc");var e=Ur.mkdir("/proc/self");Ur.mkdir("/proc/self/fd"),Ur.Ma({Ma(){var t=Ur.createNode(e,"fd",16895,73);return t.Ca={bb:ar.Ca.bb},t.Ba={lookup(e,t){var r=Er(e=+t);return(e={parent:null,Ma:{ec:"fake"},Ba:{readlink:()=>r.path},id:e+1}).parent=e},readdir:()=>Array.from(Ur.streams.entries()).filter(([,e])=>e).map(([e])=>e.toString())},t}},{},"/proc/self/fd")}(),Ur.sc={MEMFS:ar},n.noExitRuntime&&(j=n.noExitRuntime),n.preloadPlugins&&(cr=n.preloadPlugins),n.print&&(T=n.print),n.printErr&&(O=n.printErr),n.wasmBinary&&(p=n.wasmBinary),n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.shift()();n.addRunDependency=ur,n.removeRunDependency=lr,n.FS_preloadFile=hr,n.FS_unlink=(...e)=>Ur.unlink(...e),n.FS_createPath=(...e)=>function(e,t){for(e="string"==typeof e?e:wr(e),t=t.split("/").reverse();t.length;){var r=t.pop();if(r){var n=Gt(e+"/"+r);try{Ur.mkdir(n)}catch(e){if(20!=e.sb)throw e}e=n}}return n}(...e),n.FS_createDevice=(...e)=>Ur.pb(...e),n.FS=Ur,n.FS_createDataFile=(...e)=>yr(...e),n.FS_createLazyFile=(...e)=>function(e,t,r,n,a){class o{Ib=!1;ob=[];Rb=void 0;Tb=0;Sb=0;get(e){if(!(e>this.length-1||0>e)){var t=e%this.chunkSize;return this.Rb(e/this.chunkSize|0)[t]}}mc(e){this.Rb=e}Ub(){var e=new XMLHttpRequest;e.open("HEAD",r,!1),e.send(null),200<=e.status&&300>e.status||304===e.status||D("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),a=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t;e=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t;var i=1048576;a||(i=n);var o=this;o.mc(e=>{var t=e*i,a=(e+1)*i-1;if(a=Math.min(a,n-1),void 0===o.ob[e]){var s=o.ob;t>a&&D("invalid range ("+t+", "+a+") or no bytes requested!"),a>n-1&&D("only "+n+" bytes available! programmer error!");var l=new XMLHttpRequest;l.open("GET",r,!1),n!==i&&l.setRequestHeader("Range","bytes="+t+"-"+a),l.responseType="arraybuffer",l.overrideMimeType&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send(null),200<=l.status&&300>l.status||304===l.status||D("Couldn't load "+r+". Status: "+l.status),t=void 0!==l.response?new Uint8Array(l.response||[]):Jt(l.responseText||""),s[e]=t}return void 0===o.ob[e]&&D("doXHR failed!"),o.ob[e]}),!e&&n||(i=n=1,i=n=this.Rb(0).length,T("LazyFiles on gzip forces download of the whole file when length is accessed")),this.Tb=n,this.Sb=i,this.Ib=!0}get length(){return this.Ib||this.Ub(),this.Tb}get chunkSize(){return this.Ib||this.Ub(),this.Sb}}if(globalThis.XMLHttpRequest){i||D("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var s=new o,l=void 0}else l=r,s=void 0;var u=function(e,t,r,n){return e="string"==typeof e?e:wr(e),t=Gt(e+"/"+t),Ur.create(t,ir(r,n))}(e,t,n,a);s?u.Da=s:l&&(u.Da=null,u.url=l),Object.defineProperties(u,{Oa:{get:function(){return this.Da.length}}}),e={};for(const[t,r]of Object.entries(u.Ca))e[t]=(...e)=>(Dr(u),r(...e));return e.read=(e,t,r,n,a)=>{if(Dr(u),a>=(e=e.node.Da).length)t=0;else{if(n=Math.min(e.length-a,n),e.slice)for(var i=0;i<n;i++)t[r+i]=e[a+i];else for(i=0;i<n;i++)t[r+i]=e.get(a+i);t=n}return t},e.wb=()=>{throw Dr(u),D(),new Ur.ya(48)},u.Ca=e,u}(...e);var Lr,Fr,Nr,jr,Ir,Vr,Gr,Hr,qr,Wr,Kr,Zr,Yr,Xr,Jr,Qr,en,tn,rn,nn,an,on,sn,ln,un,cn={b:(e,t,r,n)=>D(`Assertion failed: ${G(e)}, at: `+[t?G(t):"unknown filename",r,n?G(n):"unknown function"]),P:()=>D(""),F:(e,t,r,n,a)=>{t=H(t);let i=e=>e;if(n=0n===n){const e=8*r;i=t=>BigInt.asUintN(e,t),a=i(a)}X(e,{name:t,$a:i,eb:(e,t)=>("number"==typeof t&&(t=BigInt(t)),t),nb:J(t,r,!n),fb:null})},la:(e,t,r,n)=>{X(e,{name:t=H(t),$a:function(e){return!!e},eb:function(e,t){return t?r:n},nb:function(e){return this.$a(w[e])},fb:null})},ia:(e,t,r,n,a,i,o,s,l,u,c,h,d)=>{c=H(c),i=_e(a,i),s&&=_e(o,s),u&&=_e(l,u),d=_e(h,d);var f=(e=>{var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e})(c);se(f,function(){Se(`Cannot construct ${c} due to unbound types`,[n])}),Ce([e,t,r],n?[n]:[],t=>{if(t=t[0],n)var r=t.Ka,a=r.vb;else a=ne.prototype;t=ae(c,function(...e){if(Object.getPrototypeOf(this)!==o)throw new Z(`Use 'new' to construct ${c}`);if(void 0===h.rb)throw new Z(`${c} has no accessible constructor`);var t=h.rb[e.length];if(void 0===t)throw new Z(`Tried to invoke ctor of ${c} with invalid number of parameters (${e.length}) - expected (${Object.keys(h.rb).toString()}) parameters instead!`);return t.apply(this,e)});var o=Object.create(a,{constructor:{value:t}});t.prototype=o;var l,h=new le(c,t,o,d,r,i,s,u);return h.ab&&((l=h.ab).Vb??(l.Vb=[]),h.ab.Vb.push(h)),r=new we(c,h,!0,!1,!1),l=new we(c+"*",h,!1,!1,!1),a=new we(c+" const*",h,!1,!0,!1),ie[e]={pointerType:l,pc:a},$e(f,t),[r,l,a]})},$:(e,t,r,n,a,i)=>{var o=Ee(t,r);a=_e(n,a),Ce([],[e],e=>{var r=`constructor ${(e=e[0]).name}`;if(void 0===e.Ka.rb&&(e.Ka.rb=[]),void 0!==e.Ka.rb[t-1])throw new Z(`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.Ka.rb[t-1]=()=>{Se(`Cannot construct ${e.name} due to unbound types`,o)},Ce([],o,n=>(n.splice(1,0,null),e.Ka.rb[t-1]=Oe(r,n,null,a,i),[])),[]})},i:(e,t,r,n,a,i,o,s,l)=>{var u=Ee(r,n);t=H(t),t=Pe(t),i=_e(a,i),Ce([],[e],e=>{function n(){Se(`Cannot call ${a} due to unbound types`,u)}var a=`${(e=e[0]).name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.Ka.Dc.push(t);var c=e.Ka.vb,h=c[t];return void 0===h||void 0===h.Ya&&h.className!==e.name&&h.yb===r-2?(n.yb=r-2,n.className=e.name,c[t]=n):(oe(c,t,a),c[t].Ya[r-2]=n),Ce([],u,n=>(n=Oe(a,n,e,i,o,l),void 0===c[t].Ya?(n.yb=r-2,c[t]=n):c[t].Ya[r-2]=n,[])),[]})},ja:e=>X(e,Me),E:(e,t,r)=>{X(e,{name:t=H(t),$a:e=>e,eb:(e,t)=>t,nb:Le(t,r),fb:null})},G:(e,t,r,n,a,i,o)=>{var s=Ee(t,r);e=H(e),e=Pe(e),a=_e(n,a),se(e,function(){Se(`Cannot call ${e} due to unbound types`,s)},t-1),Ce([],s,r=>(r=[r[0],null].concat(r.slice(1)),$e(e,Oe(e,r,null,a,i,o),t-1),[]))},k:(e,t,r,n,a)=>{t=H(t);let i=e=>e;if(0===n){var o=32-8*r;i=e=>e<<o>>>o,a=i(a)}X(e,{name:t,$a:i,eb:(e,t)=>t,nb:J(t,r,0!==n),fb:null})},h:(e,t,r)=>{function n(e){return new a(v.buffer,A[e+4>>2],A[e>>2])}var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];X(e,{name:r=H(r),$a:n,nb:n},{xc:!0})},ka:(e,t)=>{X(e,{name:t=H(t),$a(e){var t=G(e+4,A[e>>2],!0);return Nr(e),t},eb(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r="string"==typeof t;if(!(r||ArrayBuffer.isView(t)&&1==t.BYTES_PER_ELEMENT))throw new Z("Cannot pass non-string to std::string");var n=r?Ne(t):t.length,a=Lr(4+n+1),i=a+4;return A[a>>2]=n,r?Fe(t,w,i,n+1):w.set(t,i),null!==e&&e.push(Nr,a),a},nb:pe,fb(e){Nr(e)}})},u:(e,t,r)=>{if(r=H(r),2===t)var n=Ie,a=Ve,i=Ge;else n=He,a=qe,i=We;X(e,{name:r,$a:e=>{var r=n(e+4,A[e>>2]*t,!0);return Nr(e),r},eb:(e,n)=>{if("string"!=typeof n)throw new Z(`Cannot pass non-string to C++ string type ${r}`);var o=i(n),s=Lr(4+o+t);return A[s>>2]=o/t,a(n,s+4,o+t),null!==e&&e.push(Nr,s),s},nb:pe,fb(e){Nr(e)}})},v:e=>{X(e,Me)},ma:(e,t)=>{X(e,{dc:!0,name:t=H(t),$a:()=>{},eb:()=>{}})},J:()=>{j=!1,Ke=0},m:(e,t,r)=>{var[n,...a]=((e,t)=>{for(var r=Array(e),n=0;n<e;++n){var a=n,i=A[t+4*n>>2],o=W[i];if(void 0===o)throw e=`parameter ${n} has unknown type ${xe(i)}`,new Z(e);r[a]=o}return r})(e,t);t=n.eb.bind(n);var i=a.map(e=>e.nb.bind(e));e--;var o={toValue:De};switch(e=i.map((e,t)=>{var r=`argFromPtr${t}`;return o[r]=e,`${r}(args${t?"+"+8*t:""})`}),r){case 0:var s="toValue(handle)";break;case 2:s="new (toValue(handle))";break;case 3:s="";break;case 1:o.getStringOrSymbol=Je,s="toValue(handle)[getStringOrSymbol(methodName)]"}return s+=`(${e})`,n.dc||(o.toReturnWire=t,o.emval_returnValue=Ye,s=`return emval_returnValue(toReturnWire, destructorsRef, ${s})`),s=`return function (handle, methodName, destructorsRef, args) {\n ${s}\n }`,r=new Function(Object.keys(o),s)(...Object.values(o)),s=`methodCaller<(${a.map(e=>e.name)}) => ${n.name}>`,(e=>{var t=Ze.length;return Ze.push(e),t})(ae(s,r))},ga:Be,na:e=>e?(e=Je(e),Ue(globalThis[e])):Ue(globalThis),o:(e,t)=>(e=De(e),t=De(t),Ue(e[t])),w:e=>{9<e&&(Re[e+1]+=1)},l:(e,t,r,n,a)=>Ze[e](t,r,n,a),oa:e=>Ue(Je(e)),H:e=>{var t=De(e);ke(t),Be(e)},K:(e,t)=>{if(Qe[e]&&(clearTimeout(Qe[e].id),delete Qe[e]),!t)return 0;var r=setTimeout(()=>{delete Qe[e],tt(()=>rn(e,performance.now()))},t);return Qe[e]={id:r,md:t},0},O:e=>{var t=w.length;if(2147483648<(e>>>=0))return!1;for(var r=1;4>=r;r*=2){var n=t*(1+.2/r);n=Math.min(n,e+100663296);e:{n=(Math.min(2147483648,65536*Math.ceil(Math.max(e,n)/65536))-sn.buffer.byteLength+65535)/65536|0;try{sn.grow(n),B();var a=1;break e}catch(e){}a=void 0}if(a)return!0}return!1},T:function(e,t,r,n,a,i){t=It(t),r=It(r),e=it(e);var o={};if(i){var s=A[i+12>>2];if(s){var l=A[i+16>>2];o.requiredFeatures=Array.from(A.subarray(l>>2,l+4*s>>2),e=>gt[e])}var u=A[i+20>>2];if(u){var c={};function h(e,t,r=!1){4294967295==(t=A[u+t>>2])||r&&0==t||(c[e]=t)}function d(e,t){4294967295==A[(t=u+t)>>2]&&4294967295==A[t+4>>2]||(c[e]=4294967296*A[t+4>>2]+A[t>>2])}h("maxTextureDimension1D",4),h("maxTextureDimension2D",8),h("maxTextureDimension3D",12),h("maxTextureArrayLayers",16),h("maxBindGroups",20),h("maxBindGroupsPlusVertexBuffers",24),h("maxDynamicUniformBuffersPerPipelineLayout",32),h("maxDynamicStorageBuffersPerPipelineLayout",36),h("maxSampledTexturesPerShaderStage",40),h("maxSamplersPerShaderStage",44),h("maxStorageBuffersPerShaderStage",48),h("maxStorageTexturesPerShaderStage",52),h("maxUniformBuffersPerShaderStage",56),h("minUniformBufferOffsetAlignment",80),h("minStorageBufferOffsetAlignment",84),d("maxUniformBufferBindingSize",64),d("maxStorageBufferBindingSize",72),h("maxVertexBuffers",88),d("maxBufferSize",96),h("maxVertexAttributes",104),h("maxVertexBufferArrayStride",108),h("maxInterStageShaderVariables",112),h("maxColorAttachments",116),h("maxColorAttachmentBytesPerSample",120),h("maxComputeWorkgroupStorageSize",124),h("maxComputeInvocationsPerWorkgroup",128),h("maxComputeWorkgroupSizeX",132),h("maxComputeWorkgroupSizeY",136),h("maxComputeWorkgroupSizeZ",140),h("maxComputeWorkgroupsPerDimension",144),h("maxImmediateSize",148,!0),o.requiredLimits=c}(s=A[i+24>>2])&&(s={label:st(s+4)},o.defaultQueue=s),o.label=st(i+4)}e.requestDevice(o).then(e=>{tt(()=>{nt[a>>>0]=e.queue,nt[n>>>0]=e,e.lost.then(t=>{tt(()=>{e.onuncapturederror=()=>{};var n=on(),a=rt(t.message);Jr(r,jt[t.reason],a),nn(n)})}),e.onuncapturederror=e=>{var t=5;e.error instanceof GPUValidationError?t=2:e.error instanceof GPUOutOfMemoryError?t=3:e.error instanceof GPUInternalError&&(t=4);var r=on();e=rt(e.error.message),tn(n,t,e),nn(r)},en(t,1,n,0)})},e=>{tt(()=>{var a=on(),i=rt(e.message);en(t,3,n,i),r&&Jr(r,4,i),nn(a)})})},V:e=>{var t=it(e),r=at[e];if(r){for(var n=0;n<r.length;++n)r[n]();delete at[e]}t.destroy()},d:e=>{delete nt[e]},S:(e,t,r)=>{var n=!!A[t+32>>2];t={label:st(t+4),usage:A[t+16>>2],size:4294967296*A[t+4+24>>2]+A[t+24>>2],mappedAtCreation:n},e=it(e);try{var a=e.createBuffer(t)}catch(e){return!1}return nt[r>>>0]=a,n&&(at[r]=[]),!0},R:(e,t,r)=>{var n=A[t>>2],a=A[n+4>>2];t={label:st(t+4),code:""},2===a&&(t.code=ot(n+8)),e=it(e).createShaderModule(t),nt[r>>>0]=e},U:e=>{(e=it(e)).onuncapturederror=null,e.destroy()},Q:function(e,t,r,n){if(t=It(t),r){var a={featureLevel:wt[A[r+4>>2]],powerPreference:Ct[A[r+8>>2]],forceFallbackAdapter:!!A[r+12>>2]};0!==(e=A[r>>2])&&(a.qd=!!A[e+8>>2])}"gpu"in navigator?navigator.gpu.requestAdapter(a).then(e=>{tt(()=>{if(e)nt[n>>>0]=e,Qr(t,1,n,0);else{var r=on(),a=rt("WebGPU not available on this browser (requestAdapter returned null)");Qr(t,3,n,a),nn(r)}})},e=>{tt(()=>{var r=on(),a=rt(e.message);Qr(t,4,n,a),nn(r)})}):(a=on(),e=rt("WebGPU not available on this browser (navigator.gpu is not available)"),Qr(t,3,n,e),nn(a))},N:function(e){try{var t=Er(e);return Ur.close(t),0}catch(e){if(void 0===Ur||"ErrnoError"!==e.name)throw e;return e.sb}},L:function(e,t,r,n){t=It(t);try{if(isNaN(t))return 61;var a=Er(e);return Ur.bb(a,t,r),C[n>>3]=BigInt(a.position),a.Kb&&0===t&&0===r&&(a.Kb=null),0}catch(e){if(void 0===Ur||"ErrnoError"!==e.name)throw e;return e.sb}},M:function(e,t,r,n){try{e:{var a=Er(e);e=t;for(var i,o=t=0;o<r;o++){var s=A[e>>2],l=A[e+4>>2];e+=8;var u=Ur.write(a,v,s,l,i);if(0>u){var c=-1;break e}if(t+=u,u<l)break;void 0!==i&&(i+=u)}c=t}return A[n>>2]=c,0}catch(e){if(void 0===Ur||"ErrnoError"!==e.name)throw e;return e.sb}},I:et,q:function(e){return BigInt(it(e).size)},s:(e,t)=>{var r=A[t>>2],n=void 0;0!==r&&(n=4294967296*A[r+12>>2]+A[r+8>>2]),r=st(t+4);for(var a=A[t+12>>2],i=A[t+16>>2],o=[],s=0;s<a;++s){var l=o,u=l.push,c=i+56*s,h=A[c+4>>2];if(0!==h){var d=_[c+8>>2];-1==d&&(d=void 0);var f=c+24;c={view:it(h),depthSlice:d,resolveTarget:it(A[c+12>>2]),clearValue:{r:S[f>>3],g:S[f+8>>3],b:S[f+16>>3],a:S[f+24>>3]},loadOp:xt[A[c+16>>2]],storeOp:zt[A[c+20>>2]]}}else c=void 0;u.call(l,c)}return a=0!==(a=A[t+20>>2])?{view:it(A[a+4>>2]),depthClearValue:x[a+16>>2],depthLoadOp:xt[A[a+8>>2]],depthStoreOp:zt[A[a+12>>2]],depthReadOnly:!!A[a+20>>2],stencilClearValue:A[a+32>>2],stencilLoadOp:xt[A[a+24>>2]],stencilStoreOp:zt[A[a+28>>2]],stencilReadOnly:!!A[a+36>>2]}:void 0,i=0!==(i=A[t+28>>2])?{querySet:it(A[i+4>>2]),beginningOfPassWriteIndex:A[i+8>>2],endOfPassWriteIndex:A[i+12>>2]}:void 0,t={label:r,colorAttachments:o,depthStencilAttachment:a,occlusionQuerySet:it(A[t+24>>2]),timestampWrites:i,maxDrawCount:n},n=it(e),e=qr(0),t=n.beginRenderPass(t),nt[e>>>0]=t,e},_:(e,t,r,n)=>{it(e).copyTextureToTexture(ut(t),ut(r),lt(n))},ba:e=>{var t=it(e);return e=Vr(0),t=t.finish(),nt[e>>>0]=t,e},p:(e,t)=>{var r=st(t+4),n=it(A[t+12>>2]),a=A[t+16>>2];t=A[t+20>>2];for(var i=[],o=0;o<a;++o){var s=i,l=s.push,u=t+40*o,c=A[u+8>>2],h=A[u+32>>2],d=A[u+36>>2],f=A[u+4>>2];c?(-1==(h=A[(h=u+24)>>2]+4294967296*_[h+4>>2])&&(h=void 0),u={binding:f,resource:{buffer:it(c),offset:4294967296*A[u+4+16>>2]+A[u+16>>2],size:h}}):u=h?{binding:f,resource:it(h)}:{binding:f,resource:it(d)},l.call(s,u)}return r={label:r,layout:n,entries:i},n=it(e),e=jr(0),r=n.createBindGroup(r),nt[e>>>0]=r,e},j:(e,t)=>{var r=st(t+4),n=A[t+12>>2];t=A[t+16>>2];for(var a=[],i=0;i<n;++i){var o=t+88*i,s=A[o+4>>2],l=A[o+8>>2],u=o+24,c=A[u+4>>2];u=c?{type:mt[c],hasDynamicOffset:!!A[u+8>>2],minBindingSize:4294967296*A[u+4+16>>2]+A[u+16>>2]}:void 0,c=(c=A[o+48+4>>2])?{type:Tt[c]}:void 0;var h=o+56,d=A[h+4>>2];h=d?{sampleType:Ut[d],viewDimension:Mt[A[h+8>>2]],multisampled:!!A[h+12>>2]}:void 0,o=(d=A[(o+=72)+4>>2])?{access:Pt[d],format:Dt[A[o+8>>2]],viewDimension:Mt[A[o+12>>2]]}:void 0,a.push.call(a,{binding:s,visibility:l,buffer:u,sampler:c,texture:h,storageTexture:o})}return r={label:r,entries:a},n=it(e),e=Ir(0),r=n.createBindGroupLayout(r),nt[e>>>0]=r,e},ca:(e,t)=>{var r;return t&&(r={label:st(t+4)}),t=it(e),e=Gr(0),r=t.createCommandEncoder(r),nt[e>>>0]=r,e},aa:(e,t)=>{for(var r=A[t+12>>2],n=A[t+16>>2],a=[],i=0;i<r;++i)a.push(it(A[n+4*i>>2]));return t={label:st(t+4),bindGroupLayouts:a},r=it(e),e=Hr(0),t=r.createPipelineLayout(t),nt[e>>>0]=t,e},f:(e,t)=>{t=(e=>{function t(e){if(e)return{operation:pt[A[e>>2]],srcFactor:ft[A[e+4>>2]],dstFactor:ft[A[e+8>>2]]}}function r(e){return{compare:bt[A[e>>2]],failOp:Ot[A[e+4>>2]],depthFailOp:Ot[A[e+8>>2]],passOp:Ot[A[e+12>>2]]}}return{label:st(e+4),layout:ht(A[e+12>>2]),vertex:function(e){if(e){var t=it(A[e+4>>2]),r=ct(A[e+16>>2],A[e+20>>2]),n=A[e+24>>2],a=A[e+28>>2];if(n){for(var i=[],o=0;o<n;++o){var s=i,l=s.push,u=a+24*o;if(u){var c=A[u+4>>2],h=A[u+16>>2];if(0===c&&0===h)var d=null;else{d=4294967296*A[u+4+8>>2]+A[u+8>>2],c=Nt[c],u=A[u+20>>2];for(var f=[],p=0;p<h;++p){var m=u+24*p;f.push.call(f,{format:Ft[A[m+4>>2]],offset:4294967296*A[m+4+8>>2]+A[m+8>>2],shaderLocation:A[m+16>>2]})}d={arrayStride:d,stepMode:c,attributes:f}}}else d=void 0;l.call(s,d)}n=i}else n=void 0;return{module:t,constants:r,buffers:n,entryPoint:st(e+8)}}}(e+16),primitive:function(e){if(e)return{topology:kt[A[e+4>>2]],stripIndexFormat:At[A[e+8>>2]],frontFace:_t[A[e+12>>2]],cullMode:vt[A[e+16>>2]],unclippedDepth:!!A[e+20>>2]}}(e+48),depthStencil:function(e){if(e)return{format:Dt[A[e+4>>2]],depthWriteEnabled:!!A[e+8>>2],depthCompare:bt[A[e+12>>2]],stencilFront:r(e+16),stencilBack:r(e+32),stencilReadMask:A[e+48>>2],stencilWriteMask:A[e+52>>2],depthBias:_[e+56>>2],depthBiasSlopeScale:x[e+60>>2],depthBiasClamp:x[e+64>>2]}}(A[e+72>>2]),multisample:function(e){if(e)return{count:A[e+4>>2],mask:A[e+8>>2],alphaToCoverageEnabled:!!A[e+12>>2]}}(e+76),fragment:function(e){if(e){for(var r=it(A[e+4>>2]),n=ct(A[e+16>>2],A[e+20>>2]),a=A[e+24>>2],i=A[e+28>>2],o=[],s=0;s<a;++s){var l=o,u=l.push,c=i+24*s,h=A[c+4>>2];if(0===h)c=void 0;else{h=Dt[h];var d=(d=A[c+8>>2])?{alpha:t(d+12),color:t(d+0)}:void 0;c={format:h,blend:d,writeMask:A[c+16>>2]}}u.call(l,c)}return{module:r,constants:n,targets:o,entryPoint:st(e+8)}}}(A[e+92>>2])}})(t);var r=it(e);return e=Wr(0),t=r.createRenderPipeline(t),nt[e>>>0]=t,e},ha:(e,t)=>{var r;return t&&(r={label:st(t+4),addressModeU:dt[A[t+12>>2]],addressModeV:dt[A[t+16>>2]],addressModeW:dt[A[t+20>>2]],magFilter:$t[A[t+24>>2]],minFilter:$t[A[t+28>>2]],mipmapFilter:St[A[t+32>>2]],lodMinClamp:x[t+36>>2],lodMaxClamp:x[t+40>>2],compare:bt[A[t+44>>2]],maxAnisotropy:$[t+48>>1]}),t=it(e),e=Kr(0),r=t.createSampler(r),nt[e>>>0]=r,e},t:(e,t)=>{var r={label:st(t+4),size:lt(t+28),mipLevelCount:A[t+44>>2],sampleCount:A[t+48>>2],dimension:Bt[A[t+24>>2]],format:Dt[A[t+40>>2]],usage:A[t+16>>2]},n=A[t+52>>2];return n&&(t=A[t+56>>2],r.viewFormats=Array.from(_.subarray(t>>2,t+4*n>>2),e=>Dt[e])),e=it(e),((e,t)=>{nt[e>>>0]=t})(n=Yr(0),e.createTexture(r)),n},Z:(e,t)=>(e=2<(e=A[A[t>>2]+8>>2])?G(e):e,(e=(Mr[e]||("undefined"!=typeof document?document.querySelector(e):null)).getContext("webgpu"))?(e.ld=st(t+4),t=Zr(0),nt[t>>>0]=e,t):0),A:(e,t,r)=>{e=it(e),t=Array.from(_.subarray(r>>2,r+4*t>>2),e=>it(e)),e.submit(t)},n:function(e,t,r,n,a){r=It(r),it(e).writeBuffer(it(t),r,w.subarray(n,n+a),0,a)},B:(e,t,r,n,a,i)=>{var o=A[a+8>>2],s=A[a+12>>2];it(e).writeTexture(ut(t),w.subarray(r,r+n),{offset:4294967296*A[a+4>>2]+A[a>>2],bytesPerRow:4294967295===o?void 0:o,rowsPerImage:4294967295===s?void 0:s},lt(i))},x:(e,t,r,n,a,i)=>{it(e).drawIndexed(t,r,n>>>0,a,i>>>0)},z:e=>{it(e).end()},a:(e,t,r,n,a)=>{e=it(e),r=it(r),0==n?e.setBindGroup(t,r):e.setBindGroup(t,r,A,a>>2,n)},y:function(e,t,r,n,a){n=It(n),a=It(a),e=it(e),t=it(t),-1==a&&(a=void 0),e.setIndexBuffer(t,At[r],n,a)},c:(e,t)=>{it(e).setPipeline(it(t))},g:(e,t,r,n,a)=>{it(e).setScissorRect(t,r,n,a)},e:(e,t)=>{it(e).setStencilReference(t>>>0)},r:function(e,t,r,n,a){n=It(n),a=It(a),e=it(e),r=it(r),-1==a&&(a=void 0),e.setVertexBuffer(t,r,n,a)},X:(e,t)=>{var r=A[t+4>>2];e=it(e);var n=[A[t+24>>2],A[t+28>>2]];if(0!==n[0]&&(e.canvas.width=n[0]),0!==n[1]&&(e.canvas.height=n[1]),r={device:it(r),format:Dt[A[t+8>>2]],usage:A[t+16>>2],alphaMode:yt[A[t+40>>2]]},n=A[t+32>>2]){var a=A[t+36>>2];r.viewFormats=Array.from(_.subarray(a>>2,a+4*n>>2),e=>Dt[e])}0!==(t=A[t>>2])&&(r.colorSpace=Et[A[t+8>>2]],r.nd={mode:Lt[A[t+12>>2]]}),e.configure(r)},W:(e,t)=>{e=it(e);try{var r=Yr(0),n=e.getCurrentTexture();nt[r>>>0]=n,A[t+4>>2]=r,_[t+8>>2]=1}catch(e){A[t+4>>2]=0,_[t+8>>2]=6}},Y:e=>{it(e).unconfigure()},ea:(e,t)=>{if(t){var r=A[t+24>>2],n=A[t+32>>2];r={label:st(t+4),format:Dt[A[t+12>>2]],dimension:Mt[A[t+16>>2]],baseMipLevel:A[t+20>>2],mipLevelCount:4294967295===r?void 0:r,baseArrayLayer:A[t+28>>2],arrayLayerCount:4294967295===n?void 0:n,aspect:Rt[A[t+36>>2]]}}return t=it(e),e=Xr(0),t=t.createView(r),nt[e>>>0]=t,e},da:e=>{it(e).destroy()},fa:e=>Dt.indexOf(it(e).format),C:e=>it(e).height,D:e=>it(e).width};return un=await async function(){function e(e){return e=un=e.exports,Lr=e.ra,Fr=e.sa,Nr=e.ta,jr=e.ua,Ir=e.va,Vr=e.wa,Gr=e.xa,Hr=e.Aa,qr=e.Ea,Wr=e.Fa,Kr=e.Ga,Zr=e.Ha,Yr=e.Ia,Xr=e.Ja,Jr=e.Pa,Qr=e.Qa,en=e.Ra,tn=e.Sa,rn=e.Ta,nn=e.Va,an=e.Wa,on=e.Xa,sn=e.pa,ln=e.Ua,B(),un}var r={a:cn};return n.instantiateWasm?new Promise(t=>{n.instantiateWasm(r,(r,n)=>{t(e(r))})}):(k??=n.locateFile?n.locateFile?n.locateFile("thorvg.wasm",d):d+"thorvg.wasm":new URL("thorvg.wasm","undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:t&&"SCRIPT"===t.tagName.toUpperCase()&&t.src||new URL("lottie-player.js",document.baseURI).href).href,e((await async function(e){var t=k;if(!p&&!z(t)&&!o)try{var r=fetch(t,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(r,e)}catch(e){O(`wasm streaming compile failed: ${e}`),O("falling back to ArrayBuffer instantiation")}return async function(e,t){try{var r=await async function(e){if(!p)try{var t=await l(e);return new Uint8Array(t)}catch{}if(e==k&&p)e=new Uint8Array(p);else{if(!u)throw"both async and sync fetching of the wasm failed";e=u(e)}return e}(e);return await WebAssembly.instantiate(r,t)}catch(e){O(`failed to asynchronously prepare wasm: ${e}`),D(e)}}(t,e)}(r)).instance))}(),function e(){function t(){if(n.calledRun=!0,!P){if(R=!0,n.noFSInit||Ur.Lb||dr(),un.qa(),Ur.bc=!1,b?.(n),n.onRuntimeInitialized?.(),n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;){var e=n.postRun.shift();L.push(e)}M(L)}}if(0<or)sr=e;else{if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)N();M(F),0<or?sr=e:n.setStatus?(n.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>n.setStatus(""),1),t()},1)):t()}}(),r=R?n:new Promise((e,t)=>{b=e,y=t}),r}({locateFile:(e,t)=>e.endsWith(".wasm")?this.wasmUrl||"https://unpkg.com/@thorvg/lottie-player@latest/dist/thorvg.wasm":t+e})),!this._timer)return;clearInterval(this._timer),this._timer=void 0;const e=this.config?.renderer||"wg";if(await(async e=>{if("wg"===e){for(;"requested"===be;)await me(100);if("initialized"!==be&&(be="requested",de))for(;;)switch(de.init()){case 0:return void(be="initialized");case 1:return void(be="failed");case 2:await me(100)}}})(e),"failed"===be)return this.currentState="error",void this.dispatchEvent(new CustomEvent("error"));this.TVG=new de.TvgLottieAnimation(e,`#${this.canvas.id}`),this.src&&this.load(this.src,this.fileType)}_viewport(){const{left:e,right:t,top:r,bottom:n}=this.getBoundingClientRect(),a=window.innerWidth,i=window.innerHeight;let o=0,s=0,l=this.canvas.width,u=this.canvas.height;e<0&&(o=Math.abs(e),l-=o),r<0&&(s=Math.abs(r),u-=s),t>a&&(l-=t-a),n>i&&(u-=n-i),this.TVG.viewport(o,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-${Date.now().toString(36)+Math.random().toString(36).substring(2)}`,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.fileType):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){if(!this.TVG)throw new Error("TVG is not initialized");if(this._assetResolverCallback&&this.TVG.setAssetResolver(this._assetResolverCallback,this._assetResolverData),!this.TVG.load(e,this.fileType,this.canvas.width,this.canvas.height))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.TVG)return;if(!1!==this.config?.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}if(this.TVG.resize(this.canvas.width,this.canvas.height),this._viewport(),!this.TVG.update())return;if("wg"===this.config?.renderer||"gl"===this.config?.renderer)return void this.TVG.render();const e=this.TVG.render(),t=new Uint8ClampedArray(e,0,e.byteLength);t.length<1||(this._imageData=new ImageData(t,this.canvas.width,this.canvas.height),this._flush())}async _update(){if(!this.TVG)return!1;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 me(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.TVG&&(this.pause(),this.currentFrame=e,this.TVG.frame(e))}async load(e,t="json"){try{await this._init();const r=await(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||"lot"===t)return n=await(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})(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")}})(e,t);this.dispatchEvent(new CustomEvent("ready")),this.fileType=t,await this._loadBytes(r)}catch(e){this.currentState="error",this.dispatchEvent(new CustomEvent("error"))}}play(){if(this.TVG&&!("json"!==this.fileType&&"lot"!==this.fileType||(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(){de&&(de.term(),de=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)}setQuality(e){this.TVG&&this.TVG.quality(e)&&"playing"!==this.currentState&&this._render()}setAssetResolver(e,t){this._assetResolverCallback=e,this._assetResolverData=t,this.TVG&&this.TVG.setAssetResolver(e,t)}getVersion(){return{THORVG_VERSION:"1.0.0"}}render(){return H`
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["lottie-player"]={})}(this,function(e){"use strict";var t="undefined"!=typeof document?document.currentScript:null;const r=globalThis,n=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),i=new WeakMap;let o=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(n&&void 0===e){const r=void 0!==t&&1===t.length;r&&(e=i.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&i.set(t,e))}return e}toString(){return this.cssText}};const s=n?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,a))(t)})(e):e,{is:l,defineProperty:u,getOwnPropertyDescriptor:c,getOwnPropertyNames:h,getOwnPropertySymbols:d,getPrototypeOf:f}=Object,p=globalThis,m=p.trustedTypes,b=m?m.emptyScript:"",y=p.reactiveElementPolyfillSupport,v=(e,t)=>e,w={toAttribute(e,t){switch(t){case Boolean:e=e?b: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}},g=(e,t)=>!l(e,t),$={attribute:!0,type:String,converter:w,reflect:!1,useDefault:!1,hasChanged:g};Symbol.metadata??=Symbol("metadata"),p.litPropertyMetadata??=new WeakMap;let _=class 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=$){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(e,r,t);void 0!==n&&u(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:a}=c(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:n,set(t){const i=n?.call(this);a?.call(this,t),this.requestUpdate(e,i,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??$}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const e=f(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(v("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(v("properties"))){const e=this.properties,t=[...h(e),...d(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(s(e))}else void 0!==e&&t.push(s(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 e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(n)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const n of t){const t=document.createElement("style"),a=r.litNonce;void 0!==a&&t.setAttribute("nonce",a),t.textContent=n.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}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)}_$ET(e,t){const r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(void 0!==n&&!0===r.reflect){const a=(void 0!==r.converter?.toAttribute?r.converter:w).toAttribute(t,r.type);this._$Em=e,null==a?this.removeAttribute(n):this.setAttribute(n,a),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),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:w;this._$Em=n;const i=a.fromAttribute(t,e.type);this[n]=i??this._$Ej?.get(n)??i,this._$Em=null}}requestUpdate(e,t,r){if(void 0!==e){const n=this.constructor,a=this[e];if(r??=n.getPropertyOptions(e),!((r.hasChanged??g)(a,t)||r.useDefault&&r.reflect&&a===this._$Ej?.get(e)&&!this.hasAttribute(n._$Eu(e,r))))return;this.C(e,t,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:n,wrapped:a},i){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,i??t??this[e]),!0!==a||void 0!==i)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),!0===n&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){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){const{wrapped:e}=r,n=this[t];!0!==e||this._$AL.has(t)||void 0===n||this.C(t,void 0,r,n)}}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._$EM()}catch(t){throw e=!1,this._$EM(),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)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[v("elementProperties")]=new Map,_[v("finalized")]=new Map,y?.({ReactiveElement:_}),(p.reactiveElementVersions??=[]).push("2.1.1");const A={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:g},x=(e=A,t,r)=>{const{kind:n,metadata:a}=r;let i=globalThis.litPropertyMetadata.get(a);if(void 0===i&&globalThis.litPropertyMetadata.set(a,i=new Map),"setter"===n&&((e=Object.create(e)).wrapped=!0),i.set(r.name,e),"accessor"===n){const{name:n}=r;return{set(r){const a=t.get.call(this);t.set.call(this,r),this.requestUpdate(n,a,e)},init(t){return void 0!==t&&this.C(n,void 0,e,t),t}}}if("setter"===n){const{name:n}=r;return function(r){const a=this[n];t.call(this,r),this.requestUpdate(n,a,e)}}throw Error("Unsupported decorator location: "+n)};function S(e){return(t,r)=>"object"==typeof r?x(e,t,r):((e,t,r)=>{const n=t.hasOwnProperty(r);return t.constructor.createProperty(r,e),n?Object.getOwnPropertyDescriptor(t,r):void 0})(e,t,r)}const C=globalThis,E=C.trustedTypes,k=E?E.createPolicy("lit-html",{createHTML:e=>e}):void 0,T="$lit$",O=`lit$${Math.random().toFixed(9).slice(2)}$`,P="?"+O,z=`<${P}>`,R=document,B=()=>R.createComment(""),D=e=>null===e||"object"!=typeof e&&"function"!=typeof e,U=Array.isArray,M="[ \t\n\f\r]",L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,F=/-->/g,N=/>/g,j=RegExp(`>|${M}(?:([^\\s"'>=/]+)(${M}*=${M}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),I=/'/g,V=/"/g,G=/^(?:script|style|textarea|title)$/i,H=(e,...t)=>({_$litType$:1,strings:e,values:t}),q=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),K=new WeakMap,Z=R.createTreeWalker(R,129);function Y(e,t){if(!U(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==k?k.createHTML(t):t}const X=(e,t)=>{const r=e.length-1,n=[];let a,i=2===t?"<svg>":3===t?"<math>":"",o=L;for(let t=0;t<r;t++){const r=e[t];let s,l,u=-1,c=0;for(;c<r.length&&(o.lastIndex=c,l=o.exec(r),null!==l);)c=o.lastIndex,o===L?"!--"===l[1]?o=F:void 0!==l[1]?o=N:void 0!==l[2]?(G.test(l[2])&&(a=RegExp("</"+l[2],"g")),o=j):void 0!==l[3]&&(o=j):o===j?">"===l[0]?(o=a??L,u=-1):void 0===l[1]?u=-2:(u=o.lastIndex-l[2].length,s=l[1],o=void 0===l[3]?j:'"'===l[3]?V:I):o===V||o===I?o=j:o===F||o===N?o=L:(o=j,a=void 0);const h=o===j&&e[t+1].startsWith("/>")?" ":"";i+=o===L?r+z:u>=0?(n.push(s),r.slice(0,u)+T+r.slice(u)+O+h):r+O+(-2===u?t:h)}return[Y(e,i+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),n]};class J{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let a=0,i=0;const o=e.length-1,s=this.parts,[l,u]=X(e,t);if(this.el=J.createElement(l,r),Z.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=Z.nextNode())&&s.length<o;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(T)){const t=u[i++],r=n.getAttribute(e).split(O),o=/([.?@])?(.*)/.exec(t);s.push({type:1,index:a,name:o[2],strings:r,ctor:"."===o[1]?ne:"?"===o[1]?ae:"@"===o[1]?ie:re}),n.removeAttribute(e)}else e.startsWith(O)&&(s.push({type:6,index:a}),n.removeAttribute(e));if(G.test(n.tagName)){const e=n.textContent.split(O),t=e.length-1;if(t>0){n.textContent=E?E.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],B()),Z.nextNode(),s.push({type:2,index:++a});n.append(e[t],B())}}}else if(8===n.nodeType)if(n.data===P)s.push({type:2,index:a});else{let e=-1;for(;-1!==(e=n.data.indexOf(O,e+1));)s.push({type:7,index:a}),e+=O.length-1}a++}}static createElement(e,t){const r=R.createElement("template");return r.innerHTML=e,r}}function Q(e,t,r=e,n){if(t===q)return t;let a=void 0!==n?r._$Co?.[n]:r._$Cl;const i=D(t)?void 0:t._$litDirective$;return a?.constructor!==i&&(a?._$AO?.(!1),void 0===i?a=void 0:(a=new i(e),a._$AT(e,r,n)),void 0!==n?(r._$Co??=[])[n]=a:r._$Cl=a),void 0!==a&&(t=Q(e,a._$AS(e,t.values),a,n)),t}class ee{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??R).importNode(t,!0);Z.currentNode=n;let a=Z.nextNode(),i=0,o=0,s=r[0];for(;void 0!==s;){if(i===s.index){let t;2===s.type?t=new te(a,a.nextSibling,this,e):1===s.type?t=new s.ctor(a,s.name,s.strings,this,e):6===s.type&&(t=new oe(a,this,e)),this._$AV.push(t),s=r[++o]}i!==s?.index&&(a=Z.nextNode(),i++)}return Z.currentNode=R,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 te{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=W,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=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),D(e)?e===W||null==e||""===e?(this._$AH!==W&&this._$AR(),this._$AH=W):e!==this._$AH&&e!==q&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>U(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!==W&&D(this._$AH)?this._$AA.nextSibling.data=e:this.T(R.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=J.createElement(Y(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{const e=new ee(n,this),r=e.u(this.options);e.p(t),this.T(r),this._$AH=e}}_$AC(e){let t=K.get(e.strings);return void 0===t&&K.set(e.strings,t=new J(e)),t}k(e){U(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,n=0;for(const a of e)n===t.length?t.push(r=new te(this.O(B()),this.O(B()),this,this.options)):r=t[n],r._$AI(a),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!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class re{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,a){this.type=1,this._$AH=W,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=a,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=W}_$AI(e,t=this,r,n){const a=this.strings;let i=!1;if(void 0===a)e=Q(this,e,t,0),i=!D(e)||e!==this._$AH&&e!==q,i&&(this._$AH=e);else{const n=e;let o,s;for(e=a[0],o=0;o<a.length-1;o++)s=Q(this,n[r+o],t,o),s===q&&(s=this._$AH[o]),i||=!D(s)||s!==this._$AH[o],s===W?e=W:e!==W&&(e+=(s??"")+a[o+1]),this._$AH[o]=s}i&&!n&&this.j(e)}j(e){e===W?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ne extends re{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===W?void 0:e}}class ae extends re{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==W)}}class ie extends re{constructor(e,t,r,n,a){super(e,t,r,n,a),this.type=5}_$AI(e,t=this){if((e=Q(this,e,t,0)??W)===q)return;const r=this._$AH,n=e===W&&r!==W||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,a=e!==W&&(r===W||n);n&&this.element.removeEventListener(this.name,this,r),a&&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 oe{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 se=C.litHtmlPolyfillSupport;se?.(J,te),(C.litHtmlVersions??=[]).push("3.3.1");const le=globalThis;class ue extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=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._$Do=((e,t,r)=>{const n=r?.renderBefore??t;let a=n._$litPart$;if(void 0===a){const e=r?.renderBefore??null;n._$litPart$=a=new te(t.insertBefore(B(),e),e,void 0,r??{})}return a._$AI(e),a})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return q}}ue._$litElement$=!0,ue.finalized=!0,le.litElementHydrateSupport?.({LitElement:ue});const ce=le.litElementPolyfillSupport;function he(e,t,r,n){var a,i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}ce?.({LitElement:ue}),(le.litElementVersions??=[]).push("4.2.1");let de=null,fe=!1;var pe=function(e){return e.JSON="json",e.LOT="lot",e.JPG="jpg",e.PNG="png",e.SVG="svg",e}({});const me=e=>new Promise(t=>setTimeout(t,e));let be="idle";class ye extends ue{src;wasmUrl;fileType="json";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=null;canvas;config;_imageData;_beginTime=Date.now();_counter=1;_timer;_observer;_observable=!1;_assetResolverCallback;_assetResolverData;async _init(){if(fe)for(;!de;)await me(100);if(de||(fe=!0,de=await async function(e={}){var r,n=e,a=!!globalThis.window,i=!!globalThis.WorkerGlobalScope,o=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;if(o){const{createRequire:e}=await Promise.resolve().then(function(){return ge});var s=e("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:t&&"SCRIPT"===t.tagName.toUpperCase()&&t.src||new URL("lottie-player.js",document.baseURI).href)}var l,u,c=(e,t)=>{throw t},h="undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:t&&"SCRIPT"===t.tagName.toUpperCase()&&t.src||new URL("lottie-player.js",document.baseURI).href,d="";if(o){var f=s("fs");h.startsWith("file:")&&(d=s("path").dirname(s("url").fileURLToPath(h))+"/"),u=e=>(e=z(e)?new URL(e):e,f.readFileSync(e)),l=async e=>(e=z(e)?new URL(e):e,f.readFileSync(e,void 0)),process.argv.slice(2),c=(e,t)=>{throw process.exitCode=e,t}}else if(a||i){try{d=new URL(".",h).href}catch{}i&&(u=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),l=async e=>{if(z(e))return 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)});var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw Error(t.status+" : "+t.url)}}var p,m,b,y,v,w,g,$,_,A,x,S,C,E,k,T=function(){}.bind(),O=function(){}.bind(),P=!1,z=e=>e.startsWith("file://"),R=!1;function B(){var e=sn.buffer;v=new Int8Array(e),g=new Int16Array(e),w=new Uint8Array(e),$=new Uint16Array(e),_=new Int32Array(e),A=new Uint32Array(e),x=new Float32Array(e),S=new Float64Array(e),C=new BigInt64Array(e),E=new BigUint64Array(e)}function D(e){throw n.onAbort?.(e),O(e="Aborted("+e+")"),P=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),y?.(e),e}class U{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var M=e=>{for(;0<e.length;)e.shift()(n)},L=[],F=[],N=()=>{var e=n.preRun.shift();F.push(e)},j=!0,I=new TextDecoder,V=(e,t,r,n)=>{if(r=t+r,n)return r;for(;e[t]&&!(t>=r);)++t;return t},G=(e,t,r)=>e?I.decode(w.subarray(e,V(w,e,t,r))):"",H=e=>{for(var t="";;){var r=w[e++];if(!r)return t;t+=String.fromCharCode(r)}},q={},W={},K={},Z=class extends Error{constructor(e){super(e),this.name="BindingError"}},Y=e=>{throw new Z(e)};function X(e,t,r={}){return function(e,t,r={}){var n=t.name;if(!e)throw new Z(`type "${n}" must have a positive integer typeid pointer`);if(W.hasOwnProperty(e)){if(r.xc)return;throw new Z(`Cannot register type '${n}' twice`)}W[e]=t,delete K[e],q.hasOwnProperty(e)&&(t=q[e],delete q[e],t.forEach(e=>e()))}(e,t,r)}var J=(e,t,r)=>{switch(t){case 1:return r?e=>v[e]:e=>w[e];case 2:return r?e=>g[e>>1]:e=>$[e>>1];case 4:return r?e=>_[e>>2]:e=>A[e>>2];case 8:return r?e=>C[e>>3]:e=>E[e>>3];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Q=e=>{throw new Z(e.za.Na.Ka.name+" instance already deleted")},ee=!1,te=()=>{},re=e=>globalThis.FinalizationRegistry?(ee=new FinalizationRegistry(e=>{--(e=e.za).count.value,0===e.count.value&&(e.Za?e.cb.qb(e.Za):e.Na.Ka.qb(e.La))}),re=e=>{var t=e.za;return t.Za&&ee.register(e,{za:t},e),e},te=e=>{ee.unregister(e)},re(e)):(re=e=>e,e);function ne(){}var ae=(e,t)=>Object.defineProperty(t,"name",{value:e}),ie={},oe=(e,t,r)=>{if(void 0===e[t].Ya){var n=e[t];e[t]=function(...n){if(!e[t].Ya.hasOwnProperty(n.length))throw new Z(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${e[t].Ya})!`);return e[t].Ya[n.length].apply(this,n)},e[t].Ya=[],e[t].Ya[n.yb]=n}},se=(e,t,r)=>{if(n.hasOwnProperty(e)){if(void 0===r||void 0!==n[e].Ya&&void 0!==n[e].Ya[r])throw new Z(`Cannot register public name '${e}' twice`);if(oe(n,e,e),n[e].Ya.hasOwnProperty(r))throw new Z(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`);n[e].Ya[r]=t}else n[e]=t,n[e].yb=r};function le(e,t,r,n,a,i,o,s){this.name=e,this.constructor=t,this.vb=r,this.qb=n,this.ab=a,this.tc=i,this.Db=o,this.qc=s,this.Dc=[]}var ue=(e,t,r)=>{for(;t!==r;){if(!t.Db)throw new Z(`Expected null or instance of ${r.name}, got an instance of ${t.name}`);e=t.Db(e),t=t.ab}return e},ce=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e};function he(e,t){if(null===t){if(this.Mb)throw new Z(`null is not a valid ${this.name}`);return 0}if(!t.za)throw new Z(`Cannot pass "${ce(t)}" as a ${this.name}`);if(!t.za.La)throw new Z(`Cannot pass deleted object as a pointer of type ${this.name}`);return ue(t.za.La,t.za.Na.Ka,this.Ka)}function de(e,t){if(null===t){if(this.Mb)throw new Z(`null is not a valid ${this.name}`);if(this.Gb){var r=this.Ec();return null!==e&&e.push(this.qb,r),r}return 0}if(!t||!t.za)throw new Z(`Cannot pass "${ce(t)}" as a ${this.name}`);if(!t.za.La)throw new Z(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Fb&&t.za.Na.Fb)throw new Z(`Cannot convert argument of type ${t.za.cb?t.za.cb.name:t.za.Na.name} to parameter type ${this.name}`);if(r=ue(t.za.La,t.za.Na.Ka,this.Ka),this.Gb){if(void 0===t.za.Za)throw new Z("Passing raw pointer to smart pointer is illegal");switch(this.Gc){case 0:if(t.za.cb!==this)throw new Z(`Cannot convert argument of type ${t.za.cb?t.za.cb.name:t.za.Na.name} to parameter type ${this.name}`);r=t.za.Za;break;case 1:r=t.za.Za;break;case 2:if(t.za.cb===this)r=t.za.Za;else{var n=t.clone();r=this.Fc(r,Ue(()=>n.delete())),null!==e&&e.push(this.qb,r)}break;default:throw new Z("Unsupporting sharing policy")}}return r}function fe(e,t){if(null===t){if(this.Mb)throw new Z(`null is not a valid ${this.name}`);return 0}if(!t.za)throw new Z(`Cannot pass "${ce(t)}" as a ${this.name}`);if(!t.za.La)throw new Z(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.za.Na.Fb)throw new Z(`Cannot convert argument of type ${t.za.Na.name} to parameter type ${this.name}`);return ue(t.za.La,t.za.Na.Ka,this.Ka)}function pe(e){return this.$a(A[e>>2])}var me=(e,t,r)=>t===r?e:void 0===r.ab||null===(e=me(e,t,r.ab))?null:r.qc(e),be={},ye=class extends Error{constructor(e){super(e),this.name="InternalError"}},ve=(e,t)=>{if(!t.Na||!t.La)throw new ye("makeClassHandle requires ptr and ptrType");if(!!t.cb!=!!t.Za)throw new ye("Both smartPtrType and smartPtr must be specified");return t.count={value:1},re(Object.create(e,{za:{value:t,writable:!0}}))};function we(e,t,r,n,a,i,o,s,l,u,c){this.name=e,this.Ka=t,this.Mb=r,this.Fb=n,this.Gb=a,this.Cc=i,this.Gc=o,this.fc=s,this.Ec=l,this.Fc=u,this.qb=c,a||void 0!==t.ab?this.eb=de:(this.eb=n?he:fe,this.fb=null)}var $e=(e,t,r)=>{if(!n.hasOwnProperty(e))throw new ye("Replacing nonexistent public symbol");void 0!==n[e].Ya&&void 0!==r?n[e].Ya[r]=t:(n[e]=t,n[e].yb=r)},_e=(e,t)=>{e=H(e);var r=ln.get(t);if("function"!=typeof r)throw new Z(`unknown function pointer with signature ${e}: ${t}`);return r};class Ae extends Error{}var xe=e=>{e=Fr(e);var t=H(e);return Nr(e),t},Se=(e,t)=>{var r=[],n={};throw t.forEach(function e(t){n[t]||W[t]||(K[t]?K[t].forEach(e):(r.push(t),n[t]=!0))}),new Ae(`${e}: `+r.map(xe).join([", "]))},Ce=(e,t,r)=>{function n(t){if((t=r(t)).length!==e.length)throw new ye("Mismatched type converter count");for(var n=0;n<e.length;++n)X(e[n],t[n])}e.forEach(e=>K[e]=t);var a=Array(t.length),i=[],o=0;for(let[e,r]of t.entries())W.hasOwnProperty(r)?a[e]=W[r]:(i.push(r),q.hasOwnProperty(r)||(q[r]=[]),q[r].push(()=>{a[e]=W[r],++o===i.length&&n(a)}));0===i.length&&n(a)},Ee=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(A[t+4*n>>2]);return r},ke=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function Te(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].fb)return!0;return!1}function Oe(e,t,r,n,a,i){var o=t.length;if(2>o)throw new Z("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==t[1]&&null!==r,l=Te(t);r=!t[0].dc;var u=t[0],c=t[1];for(n=[e,Y,n,a,ke,u.$a.bind(u),c?.eb.bind(c)],a=2;a<o;++a)n.push((u=t[a]).eb.bind(u));if(!l)for(a=s?1:2;a<t.length;++a)null!==t[a].fb&&n.push(t[a].fb);for(l=Te(t),a=t.length-2,c=[],u=["fn"],s&&u.push("thisWired"),o=0;o<a;++o)c.push(`arg${o}`),u.push(`arg${o}Wired`);c=c.join(","),u=u.join(","),c=`return function (${c}) {\n`,l&&(c+="var destructors = [];\n");var h=l?"destructors":"null",d="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(s&&(c+=`var thisWired = toClassParamWire(${h}, this);\n`),o=0;o<a;++o){var f=`toArg${o}Wire`;c+=`var arg${o}Wired = ${f}(${h}, arg${o});\n`,d.push(f)}if(c+=(r||i?"var rv = ":"")+`invoker(${u});\n`,l)c+="runDestructors(destructors);\n";else for(o=s?1:2;o<t.length;++o)i=1===o?"thisWired":"arg"+(o-2)+"Wired",null!==t[o].fb&&(c+=`${i}_dtor(${i});\n`,d.push(`${i}_dtor`));return r&&(c+="var ret = fromRetWire(rv);\nreturn ret;\n"),t=new Function(d,c+"}\n")(...n),ae(e,t)}var Pe=e=>{const t=(e=e.trim()).indexOf("(");return-1===t?e:e.slice(0,t)},ze=[],Re=[0,1,,1,null,1,!0,1,!1,1],Be=e=>{9<e&&0===--Re[e+1]&&(Re[e]=void 0,ze.push(e))},De=e=>{if(!e)throw new Z(`Cannot use deleted val. handle = ${e}`);return Re[e]},Ue=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const t=ze.pop()||Re.length;return Re[t]=e,Re[t+1]=1,t}},Me={name:"emscripten::val",$a:e=>{var t=De(e);return Be(e),t},eb:(e,t)=>Ue(t),nb:pe,fb:null},Le=(e,t)=>{switch(t){case 4:return function(e){return this.$a(x[e>>2])};case 8:return function(e){return this.$a(S[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Fe=(e,t,r,n)=>{if(!(0<n))return 0;var a=r;n=r+n-1;for(var i=0;i<e.length;++i){var o=e.codePointAt(i);if(127>=o){if(r>=n)break;t[r++]=o}else if(2047>=o){if(r+1>=n)break;t[r++]=192|o>>6,t[r++]=128|63&o}else if(65535>=o){if(r+2>=n)break;t[r++]=224|o>>12,t[r++]=128|o>>6&63,t[r++]=128|63&o}else{if(r+3>=n)break;t[r++]=240|o>>18,t[r++]=128|o>>12&63,t[r++]=128|o>>6&63,t[r++]=128|63&o,i++}}return t[r]=0,r-a},Ne=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);127>=n?t++:2047>=n?t+=2:55296<=n&&57343>=n?(t+=4,++r):t+=3}return t},je=new TextDecoder("utf-16le"),Ie=(e,t,r)=>je.decode($.subarray(e>>=1,V($,e,t/2,r))),Ve=(e,t,r)=>{if(r??=2147483647,2>r)return 0;var n=t;r=(r-=2)<2*e.length?r/2:e.length;for(var a=0;a<r;++a)g[t>>1]=e.charCodeAt(a),t+=2;return g[t>>1]=0,t-n},Ge=e=>2*e.length,He=(e,t,r)=>{var n="";e>>=2;for(var a=0;!(a>=t/4);a++){var i=A[e+a];if(!i&&!r)break;n+=String.fromCodePoint(i)}return n},qe=(e,t,r)=>{if(r??=2147483647,4>r)return 0;var n=t;r=n+r-4;for(var a=0;a<e.length;++a){var i=e.codePointAt(a);if(65535<i&&a++,_[t>>2]=i,(t+=4)+4>r)break}return _[t>>2]=0,t-n},We=e=>{for(var t=0,r=0;r<e.length;++r)65535<e.codePointAt(r)&&r++,t+=4;return t},Ke=0,Ze=[],Ye=(e,t,r)=>{var n=[];return e=e(n,r),n.length&&(A[t>>2]=Ue(n)),e},Xe={},Je=e=>{var t=Xe[e];return void 0===t?H(e):t},Qe={},et=e=>{m=e,j||0<Ke||(n.onExit?.(e),P=!0),c(e,new U(e))},tt=e=>{if(!P)try{if(e(),!(j||0<Ke))try{m=e=m,et(e)}catch(e){e instanceof U||"unwind"==e||c(1,e)}}catch(e){e instanceof U||"unwind"==e||c(1,e)}},rt=e=>{var t=Ne(e)+1,r=an(t);return Fe(e,w,r,t),r},nt=[],at=[],it=e=>{if(e)return nt[e>>>0]},ot=e=>G(A[e>>2],A[e+4>>2]),st=e=>{var t=A[e>>2];return e=A[e+4>>2],t?G(t,e):0===e?"":void 0},lt=e=>({width:A[e>>2],height:A[e+4>>2],depthOrArrayLayers:A[e+8>>2]}),ut=e=>{var t=e+8;return{texture:it(A[e>>2]),mipLevel:A[e+4>>2],origin:{x:A[t>>2],y:A[t+4>>2],z:A[t+8>>2]},aspect:Rt[A[e+20>>2]]}},ct=(e,t)=>{if(e){for(var r={},n=0;n<e;++n){var a=t+24*n;r[ot(a+4)]=S[a+16>>3]}return r}},ht=e=>e?it(e):"auto",dt=[,"clamp-to-edge","repeat","mirror-repeat"],ft=[,"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","src1","one-minus-src1","src1alpha","one-minus-src1alpha"],pt=[,"add","subtract","reverse-subtract","min","max"],mt=["binding-not-used",,"uniform","storage","read-only-storage"],bt=[,"never","less","equal","less-equal","greater","not-equal","greater-equal","always"],yt=[,"opaque","premultiplied","unpremultiplied","inherit"],vt=[,"none","front","back"],wt=[,"compatibility","core"],gt={1:"core-features-and-limits",2:"depth-clip-control",3:"depth32float-stencil8",4:"texture-compression-bc",5:"texture-compression-bc-sliced-3d",6:"texture-compression-etc2",7:"texture-compression-astc",8:"texture-compression-astc-sliced-3d",9:"timestamp-query",10:"indirect-first-instance",11:"shader-f16",12:"rg11b10ufloat-renderable",13:"bgra8unorm-storage",14:"float32-filterable",15:"float32-blendable",16:"clip-distances",17:"dual-source-blending",18:"subgroups",19:"texture-formats-tier1",20:"texture-formats-tier2",21:"primitive-index",327692:"chromium-experimental-unorm16-texture-formats",327693:"chromium-experimental-snorm16-texture-formats",327732:"chromium-experimental-multi-draw-indirect"},$t=[,"nearest","linear"],_t=[,"ccw","cw"],At=[,"uint16","uint32"],xt=[,"load","clear"],St=[,"nearest","linear"],Ct=[,"low-power","high-performance"],Et=[,"srgb","display-p3"],kt=[,"point-list","line-list","line-strip","triangle-list","triangle-strip"],Tt=["binding-not-used",,"filtering","non-filtering","comparison"],Ot=[,"keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],Pt=["binding-not-used",,"write-only","read-only","read-write"],zt=[,"store","discard"],Rt=[,"all","stencil-only","depth-only"],Bt=[,"1d","2d","3d"],Dt=[,"r8unorm","r8snorm","r8uint","r8sint","r16unorm","r16snorm","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32float","r32uint","r32sint","rg16unorm","rg16snorm","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb10a2uint","rgb10a2unorm","rg11b10ufloat","rgb9e5ufloat","rg32float","rg32uint","rg32sint","rgba16unorm","rgba16snorm","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"],Ut=["binding-not-used",,"float","unfilterable-float","depth","sint","uint"],Mt=[,"1d","2d","2d-array","cube","cube-array","3d"],Lt=[,"standard","extended"],Ft=[,"uint8","uint8x2","uint8x4","sint8","sint8x2","sint8x4","unorm8","unorm8x2","unorm8x4","snorm8","snorm8x2","snorm8x4","uint16","uint16x2","uint16x4","sint16","sint16x2","sint16x4","unorm16","unorm16x2","unorm16x4","snorm16","snorm16x2","snorm16x4","float16","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4","unorm10-10-10-2","unorm8x4-bgra"],Nt=[,"vertex","instance"],jt={undefined:1,unknown:1,destroyed:2},It=e=>-9007199254740992>e||9007199254740992<e?NaN:Number(e),Vt=(e,t)=>{for(var r=0,n=e.length-1;0<=n;n--){var a=e[n];"."===a?e.splice(n,1):".."===a?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},Gt=e=>{var t="/"===e.charAt(0),r="/"===e.slice(-1);return(e=Vt(e.split("/").filter(e=>!!e),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},Ht=e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&=t.slice(0,-1),e+t):"."},qt=e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],Wt=e=>{(Wt=(()=>{if(o){var e=s("crypto");return t=>e.randomFillSync(t)}return e=>crypto.getRandomValues(e)})())(e)},Kt=(...e)=>{for(var t="",r=!1,n=e.length-1;-1<=n&&!r;n--){if("string"!=typeof(r=0<=n?e[n]:Ur.cwd()))throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";t=r+"/"+t,r="/"===r.charAt(0)}return t=Vt(t.split("/").filter(e=>!!e),!r).join("/"),(r?"/":"")+t||"."},Zt=(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;0<=r&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=Kt(e).slice(1),t=Kt(t).slice(1),e=r(e.split("/")),t=r(t.split("/"));for(var n=Math.min(e.length,t.length),a=n,i=0;i<n;i++)if(e[i]!==t[i]){a=i;break}for(n=[],i=a;i<e.length;i++)n.push("..");return(n=n.concat(t.slice(a))).join("/")},Yt=e=>{var t=V(e,0);return I.decode(e.buffer?e.subarray(0,t):new Uint8Array(e.slice(0,t)))},Xt=[],Jt=e=>{var t=Array(Ne(e)+1);return e=Fe(e,t,0,t.length),t.length=e,t},Qt=[];function er(e,t){Qt[e]={input:[],output:[],xb:t},fr(e,tr)}var tr={open(e){var t=Qt[e.node.rdev];if(!t)throw new Ur.ya(43);e.tty=t,e.seekable=!1},close(e){e.tty.xb.fsync(e.tty)},fsync(e){e.tty.xb.fsync(e.tty)},read(e,t,r,n){if(!e.tty||!e.tty.xb.ac)throw new Ur.ya(60);for(var a=0,i=0;i<n;i++){try{var o=e.tty.xb.ac(e.tty)}catch(e){throw new Ur.ya(29)}if(void 0===o&&0===a)throw new Ur.ya(6);if(null==o)break;a++,t[r+i]=o}return a&&(e.node.atime=Date.now()),a},write(e,t,r,n){if(!e.tty||!e.tty.xb.Qb)throw new Ur.ya(60);try{for(var a=0;a<n;a++)e.tty.xb.Qb(e.tty,t[r+a])}catch(e){throw new Ur.ya(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),a}},rr={ac(){e:{if(!Xt.length){var e=null;if(o){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}0<r&&(e=t.slice(0,r).toString("utf-8"))}else globalThis.window?.prompt&&null!==(e=window.prompt("Input: "))&&(e+="\n");if(!e){e=null;break e}Xt=Jt(e)}e=Xt.shift()}return e},Qb(e,t){null===t||10===t?(T(Yt(e.output)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){0<e.output?.length&&(T(Yt(e.output)),e.output=[])},ad:()=>({Oc:25856,Qc:5,Nc:191,Pc:35387,Mc:[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]}),bd:()=>0,cd:()=>[24,80]},nr={Qb(e,t){null===t||10===t?(O(Yt(e.output)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){0<e.output?.length&&(O(Yt(e.output)),e.output=[])}},ar={kb:null,Ma:()=>ar.createNode(null,"/",16895,0),createNode(e,t,r,n){if(24576==(61440&r)||Ur.isFIFO(r))throw new Ur.ya(63);return ar.kb||(ar.kb={dir:{node:{hb:ar.Ba.hb,jb:ar.Ba.jb,lookup:ar.Ba.lookup,lb:ar.Ba.lb,rename:ar.Ba.rename,unlink:ar.Ba.unlink,rmdir:ar.Ba.rmdir,readdir:ar.Ba.readdir,symlink:ar.Ba.symlink},stream:{bb:ar.Ca.bb}},file:{node:{hb:ar.Ba.hb,jb:ar.Ba.jb},stream:{bb:ar.Ca.bb,read:ar.Ca.read,write:ar.Ca.write,wb:ar.Ca.wb,Bb:ar.Ca.Bb}},link:{node:{hb:ar.Ba.hb,jb:ar.Ba.jb,readlink:ar.Ba.readlink},stream:{}},Wb:{node:{hb:ar.Ba.hb,jb:ar.Ba.jb},stream:Ur.oc}}),pr((r=Ur.createNode(e,t,r,n)).mode)?(r.Ba=ar.kb.dir.node,r.Ca=ar.kb.dir.stream,r.Da={}):Ur.isFile(r.mode)?(r.Ba=ar.kb.file.node,r.Ca=ar.kb.file.stream,r.Oa=0,r.Da=null):40960==(61440&r.mode)?(r.Ba=ar.kb.link.node,r.Ca=ar.kb.link.stream):8192==(61440&r.mode)&&(r.Ba=ar.kb.Wb.node,r.Ca=ar.kb.Wb.stream),r.atime=r.mtime=r.ctime=Date.now(),e&&(e.Da[t]=r,e.atime=e.mtime=e.ctime=r.atime),r},$c:e=>e.Da?e.Da.subarray?e.Da.subarray(0,e.Oa):new Uint8Array(e.Da):new Uint8Array(0),Ba:{hb(e){var t={};return t.dev=8192==(61440&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,t.size=pr(e.mode)?4096:Ur.isFile(e.mode)?e.Oa:40960==(61440&e.mode)?e.link.length:0,t.atime=new Date(e.atime),t.mtime=new Date(e.mtime),t.ctime=new Date(e.ctime),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},jb(e,t){for(var r of["mode","atime","mtime","ctime"])null!=t[r]&&(e[r]=t[r]);void 0!==t.size&&e.Oa!=(t=t.size)&&(0==t?(e.Da=null,e.Oa=0):(r=e.Da,e.Da=new Uint8Array(t),r&&e.Da.set(r.subarray(0,Math.min(t,e.Oa))),e.Oa=t))},lookup(){throw ar.Jb||(ar.Jb=new Ur.ya(44),ar.Jb.stack="<generic error, no stack>"),ar.Jb},lb:(e,t,r,n)=>ar.createNode(e,t,r,n),rename(e,t,r){try{var n=mr(t,r)}catch(e){}if(n){if(pr(e.mode))for(var a in n.Da)throw new Ur.ya(55);br(n)}delete e.parent.Da[e.name],t.Da[r]=e,e.name=r,t.ctime=t.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,t){delete e.Da[t],e.ctime=e.mtime=Date.now()},rmdir(e,t){var r,n=mr(e,t);for(r in n.Da)throw new Ur.ya(55);delete e.Da[t],e.ctime=e.mtime=Date.now()},readdir:e=>[".","..",...Object.keys(e.Da)],symlink:(e,t,r)=>((e=ar.createNode(e,t,41471,0)).link=r,e),readlink(e){if(40960!=(61440&e.mode))throw new Ur.ya(28);return e.link}},Ca:{read(e,t,r,n,a){var i=e.node.Da;if(a>=e.node.Oa)return 0;if(8<(e=Math.min(e.node.Oa-a,n))&&i.subarray)t.set(i.subarray(a,a+e),r);else for(n=0;n<e;n++)t[r+n]=i[a+n];return e},write(e,t,r,n,a,i){if(t.buffer===v.buffer&&(i=!1),!n)return 0;if((e=e.node).mtime=e.ctime=Date.now(),t.subarray&&(!e.Da||e.Da.subarray)){if(i)return e.Da=t.subarray(r,r+n),e.Oa=n;if(0===e.Oa&&0===a)return e.Da=t.slice(r,r+n),e.Oa=n;if(a+n<=e.Oa)return e.Da.set(t.subarray(r,r+n),a),n}var o=e.Da?e.Da.length:0;if(o>=(i=a+n)||(i=Math.max(i,o*(1048576>o?2:1.125)>>>0),0!=o&&(i=Math.max(i,256)),o=e.Da,e.Da=new Uint8Array(i),0<e.Oa&&e.Da.set(o.subarray(0,e.Oa),0)),e.Da.subarray&&t.subarray)e.Da.set(t.subarray(r,r+n),a);else for(i=0;i<n;i++)e.Da[a+i]=t[r+i];return e.Oa=Math.max(e.Oa,a+n),n},bb(e,t,r){if(1===r?t+=e.position:2===r&&Ur.isFile(e.node.mode)&&(t+=e.node.Oa),0>t)throw new Ur.ya(28);return t},wb(e,t,r,n,a){if(!Ur.isFile(e.node.mode))throw new Ur.ya(43);if(e=e.node.Da,2&a||!e||e.buffer!==v.buffer){if(n=!0,D(),!(a=void 0))throw new Ur.ya(48);e&&((0<r||r+t<e.length)&&(e=e.subarray?e.subarray(r,r+t):Array.prototype.slice.call(e,r,r+t)),v.set(e,a))}else n=!1,a=e.byteOffset;return{La:a,Ic:n}},Bb:(e,t,r,n)=>(ar.Ca.write(e,t,0,n,r,!1),0)}},ir=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},or=0,sr=null,lr=()=>{if(or--,n.monitorRunDependencies?.(or),0==or&&sr){var e=sr;sr=null,e()}},ur=()=>{or++,n.monitorRunDependencies?.(or)},cr=[],hr=async(e,t,r,n,a,i,o,s)=>{var u=t?Kt(Gt(e+"/"+t)):e;ur();try{var c=r;"string"==typeof r&&(c=await(async e=>(e=await l(e),new Uint8Array(e)))(r)),c=await(async(e,t)=>{for(var r of("undefined"!=typeof Browser&&dr(),cr))if(r.canHandle(t))return r.handle(e,t);return e})(c,u),s?.(),i||yr(e,t,c,n,a,o)}finally{lr()}};function dr(){var e,t,r;Ur.Lb=!0,e??=n.stdin,t??=n.stdout,r??=n.stderr,e?Ur.pb("/dev","stdin",e):Ur.symlink("/dev/tty","/dev/stdin"),t?Ur.pb("/dev","stdout",null,t):Ur.symlink("/dev/tty","/dev/stdout"),r?Ur.pb("/dev","stderr",null,r):Ur.symlink("/dev/tty1","/dev/stderr"),Ur.open("/dev/stdin",0),Ur.open("/dev/stdout",1),Ur.open("/dev/stderr",1)}function fr(e,t){Ur.Zb[e]={Ca:t}}function pr(e){return 16384==(61440&e)}function mr(e,t){var r=pr(e.mode)?(r=Ar(e,"x"))?r:e.Ba.lookup?0:2:54;if(r)throw new Ur.ya(r);for(r=Ur.mb[gr(e.id,t)];r;r=r.ub)if(r.parent.id===e.id&&r.name===t)return r;return Ur.lookup(e,t)}function br(e){var t=gr(e.parent.id,e.name);if(Ur.mb[t]===e)Ur.mb[t]=e.ub;else for(t=Ur.mb[t];t;){if(t.ub===e){t.ub=e.ub;break}t=t.ub}}function yr(e,t,r,n,a,i){var o=t;if(e&&(e="string"==typeof e?e:wr(e),o=t?Gt(e+"/"+t):e),e=ir(n,a),o=Ur.create(o,e),r){if("string"==typeof r){for(t=Array(r.length),n=0,a=r.length;n<a;++n)t[n]=r.charCodeAt(n);r=t}Ur.chmod(o,146|e),t=Ur.open(o,577),Ur.write(t,r,0,r.length,0,i),Ur.close(t),Ur.chmod(o,e)}}function vr(e,t={}){if(!e)throw new Ur.ya(44);t.Eb??(t.Eb=!0),"/"===e.charAt(0)||(e=Ur.cwd()+"/"+e);var r=0;e:for(;40>r;r++){e=e.split("/").filter(e=>!!e);for(var n=Ur.root,a="/",i=0;i<e.length;i++){var o=i===e.length-1;if(o&&t.parent)break;if("."!==e[i])if(".."===e[i]){if(a=Ht(a),Ur.Nb(n)){e=a+"/"+e.slice(i+1).join("/"),r--;continue e}n=n.parent}else{a=Gt(a+"/"+e[i]);try{n=mr(n,e[i])}catch(e){if(44===e?.sb&&o&&t.Ac)return{path:a};throw e}if(!n.ib||o&&!t.Eb||(n=n.ib.root),40960==(61440&n.mode)&&(!o||t.gb)){if(!n.Ba.readlink)throw new Ur.ya(52);"/"===(n=n.Ba.readlink(n)).charAt(0)||(n=Ht(a)+"/"+n),e=n+"/"+e.slice(i+1).join("/");continue e}}}return{path:a,node:n}}throw new Ur.ya(32)}function wr(e){for(var t;;){if(Ur.Nb(e))return e=e.Ma.ec,t?"/"!==e[e.length-1]?`${e}/${t}`:e+t:e;t=t?`${e.name}/${t}`:e.name,e=e.parent}}function gr(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Ur.mb.length}function $r(e){var t=gr(e.parent.id,e.name);e.ub=Ur.mb[t],Ur.mb[t]=e}function _r(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function Ar(e,t){return Ur.bc?0:!t.includes("r")||292&e.mode?t.includes("w")&&!(146&e.mode)||t.includes("x")&&!(73&e.mode)?2:0:2}function xr(e,t){if(!pr(e.mode))return 54;try{return mr(e,t),20}catch(e){}return Ar(e,"wx")}function Sr(e,t,r){try{var n=mr(e,t)}catch(e){return e.sb}if(e=Ar(e,"wx"))return e;if(r){if(!pr(n.mode))return 54;if(Ur.Nb(n)||wr(n)===Ur.cwd())return 10}else if(pr(n.mode))return 31;return 0}function Cr(e,t){if(!e)throw new Ur.ya(t);return e}function Er(e){if(!(e=Ur.wc(e)))throw new Ur.ya(8);return e}function kr(e,t=-1){if(e=Object.assign(new Ur.lc,e),-1==t)e:{for(t=0;t<=Ur.nc;t++)if(!Ur.streams[t])break e;throw new Ur.ya(33)}return e.fd=t,Ur.streams[t]=e}function Tr(e,t,r){var n=e?.Ca.jb;e=n?e:t,n??=t.Ba.jb,Cr(n,63),n(e,r)}function Or(e){var t=[];for(e=[e];e.length;){var r=e.pop();t.push(r),e.push(...r.Ab)}return t}function Pr(e){var t={Lc:4096,Xc:4096,blocks:1e6,Kc:5e5,Jc:5e5,files:Ur.Pb,Vc:Ur.Pb-1,Yc:42,flags:2,gd:255};return e.Ba.ic&&Object.assign(t,e.Ba.ic(e.Ma.Bc.root)),t}function zr(e,t,r){return void 0===r&&(r=t,t=438),Ur.lb(e,8192|t,r)}function Rr(e,t,r,n){Tr(e,t,{mode:4095&r|-4096&t.mode,ctime:Date.now(),$b:n})}function Br(e,t,r){if(pr(t.mode))throw new Ur.ya(31);if(!Ur.isFile(t.mode))throw new Ur.ya(28);var n=Ar(t,"w");if(n)throw new Ur.ya(n);Tr(e,t,{size:r,timestamp:Date.now()})}function Dr(e){if(!(e.yc||e.zc||e.link||e.Da))if(globalThis.XMLHttpRequest)D("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.");else try{e.Da=u(e.url)}catch(e){throw new Ur.ya(29)}}var Ur={root:null,Ab:[],Zb:{},streams:[],Pb:1,mb:null,Xb:"/",Lb:!1,bc:!0,sc:null,Hb:0,hc:{},ya:class{name="ErrnoError";constructor(e){this.sb=e}},lc:class{ob={};node=null;get object(){return this.node}set object(e){this.node=e}get flags(){return this.ob.flags}set flags(e){this.ob.flags=e}get position(){return this.ob.position}set position(e){this.ob.position=e}},kc:class{Ba={};Ca={};ib=null;constructor(e,t,r,n){e||=this,this.parent=e,this.Ma=e.Ma,this.id=Ur.Pb++,this.name=t,this.mode=r,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return!(365&~this.mode)}set read(e){e?this.mode|=365:this.mode&=-366}get write(){return!(146&~this.mode)}set write(e){e?this.mode|=146:this.mode&=-147}get zc(){return pr(this.mode)}get yc(){return 8192==(61440&this.mode)}},createNode:(e,t,r,n)=>($r(e=new Ur.kc(e,t,r,n)),e),Nb:e=>e===e.parent,isFile:e=>32768==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),nc:4096,wc:e=>Ur.streams[e],Uc:(e,t=-1)=>(e=kr(e,t),e.Ca?.Tc?.(e),e),oc:{open(e){e.Ca=Ur.uc(e.node.rdev).Ca,e.Ca.open?.(e)},bb(){throw new Ur.ya(70)}},Ob:e=>e>>8,dd:e=>255&e,tb:(e,t)=>e<<8|t,uc:e=>Ur.Zb[e],jc(e,t){function r(e){return Ur.Hb--,t(e)}function n(e){if(e){if(!n.rc)return n.rc=!0,r(e)}else++o>=i.length&&r(null)}"function"==typeof e&&(t=e,e=!1),Ur.Hb++,1<Ur.Hb&&O(`warning: ${Ur.Hb} FS.syncfs operations in flight at once, probably just doing extra work`);var a,i=Or(Ur.root.Ma),o=0;for(a of i)a.type.jc?a.type.jc(a,e,n):n(null)},Ma(e,t,r){var n="/"===r;if(n&&Ur.root)throw new Ur.ya(10);if(!n&&r){var a=vr(r,{Eb:!1});if(r=a.path,(a=a.node).ib)throw new Ur.ya(10);if(!pr(a.mode))throw new Ur.ya(54)}return(e=e.Ma(t={type:e,Bc:t,ec:r,Ab:[]})).Ma=t,t.root=e,n?Ur.root=e:a&&(a.ib=t,a.Ma&&a.Ma.Ab.push(t)),e},od(e){if(!(e=vr(e,{Eb:!1})).node.ib)throw new Ur.ya(28);var t=(e=e.node).ib,r=Or(t);for([,a]of Object.entries(Ur.mb))for(;a;){var n=a.ub;r.includes(a.Ma)&&br(a);var a=n}e.ib=null,e.Ma.Ab.splice(e.Ma.Ab.indexOf(t),1)},lookup:(e,t)=>e.Ba.lookup(e,t),lb(e,t,r){var n=vr(e,{parent:!0}).node;if(!(e=qt(e)))throw new Ur.ya(28);if("."===e||".."===e)throw new Ur.ya(20);var a=xr(n,e);if(a)throw new Ur.ya(a);if(!n.Ba.lb)throw new Ur.ya(63);return n.Ba.lb(n,e,t,r)},ic:e=>Pr(vr(e,{gb:!0}).node),kd:e=>Pr(e.node),create:(e,t=438)=>Ur.lb(e,4095&t|32768,0),mkdir:(e,t=511)=>Ur.lb(e,1023&t|16384,0),ed(e,t){var r,n=e.split("/"),a="";for(r of n)if(r){(a||"/"===e.charAt(0))&&(a+="/"),a+=r;try{Ur.mkdir(a,t)}catch(e){if(20!=e.sb)throw e}}},symlink(e,t){if(!Kt(e))throw new Ur.ya(44);var r=vr(t,{parent:!0}).node;if(!r)throw new Ur.ya(44);var n=xr(r,t=qt(t));if(n)throw new Ur.ya(n);if(!r.Ba.symlink)throw new Ur.ya(63);return r.Ba.symlink(r,t,e)},rename(e,t){var r=Ht(e),n=Ht(t),a=qt(e),i=qt(t),o=vr(e,{parent:!0}),s=o.node;if(o=(o=vr(t,{parent:!0})).node,!s||!o)throw new Ur.ya(44);if(s.Ma!==o.Ma)throw new Ur.ya(75);var l=mr(s,a);if("."!==(e=Zt(e,n)).charAt(0))throw new Ur.ya(28);if("."!==(e=Zt(t,r)).charAt(0))throw new Ur.ya(55);try{var u=mr(o,i)}catch(e){}if(l!==u){if(a=Sr(s,a,t=pr(l.mode)))throw new Ur.ya(a);if(a=u?Sr(o,i,t):xr(o,i))throw new Ur.ya(a);if(!s.Ba.rename)throw new Ur.ya(63);if(l.ib||u&&u.ib)throw new Ur.ya(10);if(o!==s&&(a=Ar(s,"w")))throw new Ur.ya(a);br(l);try{s.Ba.rename(l,o,i),l.parent=o}catch(e){throw e}finally{$r(l)}}},rmdir(e){var t=vr(e,{parent:!0}).node,r=mr(t,e=qt(e)),n=Sr(t,e,!0);if(n)throw new Ur.ya(n);if(!t.Ba.rmdir)throw new Ur.ya(63);if(r.ib)throw new Ur.ya(10);t.Ba.rmdir(t,e),br(r)},readdir:e=>Cr((e=vr(e,{gb:!0}).node).Ba.readdir,54)(e),unlink(e){var t=vr(e,{parent:!0}).node;if(!t)throw new Ur.ya(44);var r=mr(t,e=qt(e)),n=Sr(t,e,!1);if(n)throw new Ur.ya(n);if(!t.Ba.unlink)throw new Ur.ya(63);if(r.ib)throw new Ur.ya(10);t.Ba.unlink(t,e),br(r)},readlink(e){if(!(e=vr(e).node))throw new Ur.ya(44);if(!e.Ba.readlink)throw new Ur.ya(28);return e.Ba.readlink(e)},stat:(e,t)=>Cr((e=vr(e,{gb:!t}).node).Ba.hb,63)(e),fstat(e){var t=Er(e);e=t.node;var r=t.Ca.hb;return t=r?t:e,r??=e.Ba.hb,Cr(r,63),r(t)},lstat:e=>Ur.stat(e,!0),chmod(e,t,r){Rr(null,e="string"==typeof e?vr(e,{gb:!r}).node:e,t,r)},lchmod(e,t){Ur.chmod(e,t,!0)},fchmod(e,t){Rr(e=Er(e),e.node,t,!1)},chown(e,t,r,n){Tr(null,e="string"==typeof e?vr(e,{gb:!n}).node:e,{timestamp:Date.now(),$b:n})},lchown(e,t,r){Ur.chown(e,t,r,!0)},fchown(e){Tr(e=Er(e),e.node,{timestamp:Date.now(),$b:!1})},truncate(e,t){if(0>t)throw new Ur.ya(28);Br(null,e="string"==typeof e?vr(e,{gb:!0}).node:e,t)},Zc(e,t){if(e=Er(e),0>t||!(2097155&e.flags))throw new Ur.ya(28);Br(e,e.node,t)},pd(e,t,r){Cr((e=vr(e,{gb:!0}).node).Ba.jb,63)(e,{atime:t,mtime:r})},open(e,t,r=438){if(""===e)throw new Ur.ya(44);if("string"==typeof t){var a={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[t];if(void 0===a)throw Error(`Unknown file open mode: ${t}`);t=a}if(r=64&t?4095&r|32768:0,"object"==typeof e)a=e;else{var i=e.endsWith("/");a=(e=vr(e,{gb:!(131072&t),Ac:!0})).node,e=e.path}var o=!1;if(64&t)if(a){if(128&t)throw new Ur.ya(20)}else{if(i)throw new Ur.ya(31);a=Ur.lb(e,511|r,0),o=!0}if(!a)throw new Ur.ya(44);if(8192==(61440&a.mode)&&(t&=-513),65536&t&&!pr(a.mode))throw new Ur.ya(54);if(!o&&(i=a?40960==(61440&a.mode)?32:pr(a.mode)&&("r"!==_r(t)||576&t)?31:Ar(a,_r(t)):44))throw new Ur.ya(i);return 512&t&&!o&&Ur.truncate(a,0),t&=-131713,(i=kr({node:a,path:wr(a),flags:t,seekable:!0,position:0,Ca:a.Ca,Hc:[],error:!1})).Ca.open&&i.Ca.open(i),o&&Ur.chmod(a,511&r),!n.logReadFiles||1&t||e in Ur.hc||(Ur.hc[e]=1),i},close(e){if(null===e.fd)throw new Ur.ya(8);e.Kb&&(e.Kb=null);try{e.Ca.close&&e.Ca.close(e)}catch(e){throw e}finally{Ur.streams[e.fd]=null}e.fd=null},bb(e,t,r){if(null===e.fd)throw new Ur.ya(8);if(!e.seekable||!e.Ca.bb)throw new Ur.ya(70);if(0!=r&&1!=r&&2!=r)throw new Ur.ya(28);return e.position=e.Ca.bb(e,t,r),e.Hc=[],e.position},read(e,t,r,n,a){if(0>n||0>a)throw new Ur.ya(28);if(null===e.fd)throw new Ur.ya(8);if(1==(2097155&e.flags))throw new Ur.ya(8);if(pr(e.node.mode))throw new Ur.ya(31);if(!e.Ca.read)throw new Ur.ya(28);var i=void 0!==a;if(i){if(!e.seekable)throw new Ur.ya(70)}else a=e.position;return t=e.Ca.read(e,t,r,n,a),i||(e.position+=t),t},write(e,t,r,n,a,i){if(0>n||0>a)throw new Ur.ya(28);if(null===e.fd)throw new Ur.ya(8);if(!(2097155&e.flags))throw new Ur.ya(8);if(pr(e.node.mode))throw new Ur.ya(31);if(!e.Ca.write)throw new Ur.ya(28);e.seekable&&1024&e.flags&&Ur.bb(e,0,2);var o=void 0!==a;if(o){if(!e.seekable)throw new Ur.ya(70)}else a=e.position;return t=e.Ca.write(e,t,r,n,a,i),o||(e.position+=t),t},wb(e,t,r,n,a){if(2&n&&!(2&a)&&2!=(2097155&e.flags))throw new Ur.ya(2);if(1==(2097155&e.flags))throw new Ur.ya(2);if(!e.Ca.wb)throw new Ur.ya(43);if(!t)throw new Ur.ya(28);return e.Ca.wb(e,t,r,n,a)},Bb:(e,t,r,n,a)=>e.Ca.Bb?e.Ca.Bb(e,t,r,n,a):0,cc(e,t,r){if(!e.Ca.cc)throw new Ur.ya(59);return e.Ca.cc(e,t,r)},readFile(e,t={}){t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding&&D(`Invalid encoding type "${t.encoding}"`);var r=Ur.open(e,t.flags);e=Ur.stat(e).size;var n=new Uint8Array(e);return Ur.read(r,n,0,e,0),"utf8"===t.encoding&&(n=Yt(n)),Ur.close(r),n},writeFile(e,t,r={}){r.flags=r.flags||577,e=Ur.open(e,r.flags,r.mode),"string"==typeof t&&(t=new Uint8Array(Jt(t))),ArrayBuffer.isView(t)?Ur.write(e,t,0,t.byteLength,void 0,r.Rc):D("Unsupported data type"),Ur.close(e)},cwd:()=>Ur.Xb,chdir(e){if(null===(e=vr(e,{gb:!0})).node)throw new Ur.ya(44);if(!pr(e.node.mode))throw new Ur.ya(54);var t=Ar(e.node,"x");if(t)throw new Ur.ya(t);Ur.Xb=e.path},jd(){for(var e of(Ur.Lb=!1,Ur.streams))e&&Ur.close(e)},Wc(e,t){try{var r=vr(e,{gb:!t});e=r.path}catch(e){}var n=!1,a=null;try{r=vr(e,{parent:!0}),qt(e),r=vr(e,{gb:!t}),n=!0,a=r.node}catch(e){}return n?a:null},pb(e,t,r,n){var a;return e=((e,t)=>Gt(e+"/"+t))("string"==typeof e?e:wr(e),t),t=ir(!!r,!!n),(a=Ur.pb).Ob??(a.Ob=64),fr(a=Ur.tb(Ur.pb.Ob++,0),{open(e){e.seekable=!1},close(){n?.buffer?.length&&n(10)},read(e,t,n,a){for(var i=0,o=0;o<a;o++){try{var s=r()}catch(e){throw new Ur.ya(29)}if(void 0===s&&0===i)throw new Ur.ya(6);if(null==s)break;i++,t[n+o]=s}return i&&(e.node.atime=Date.now()),i},write(e,t,r,a){for(var i=0;i<a;i++)try{n(t[r+i])}catch(e){throw new Ur.ya(29)}return a&&(e.node.mtime=e.node.ctime=Date.now()),i}}),zr(e,t,a)}},Mr=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0];if((()=>{let e=ne.prototype;Object.assign(e,{isAliasOf:function(e){if(!(this instanceof ne&&e instanceof ne))return!1;var t=this.za.Na.Ka,r=this.za.La;e.za=e.za;var n=e.za.Na.Ka;for(e=e.za.La;t.ab;)r=t.Db(r),t=t.ab;for(;n.ab;)e=n.Db(e),n=n.ab;return t===n&&r===e},clone:function(){if(this.za.La||Q(this),this.za.Cb)return this.za.count.value+=1,this;var e=re,t=Object,r=t.create,n=Object.getPrototypeOf(this),a=this.za;return(e=e(r.call(t,n,{za:{value:{count:a.count,zb:a.zb,Cb:a.Cb,La:a.La,Na:a.Na,Za:a.Za,cb:a.cb}}}))).za.count.value+=1,e.za.zb=!1,e},delete(){if(this.za.La||Q(this),this.za.zb&&!this.za.Cb)throw new Z("Object already scheduled for deletion");te(this);var e=this.za;--e.count.value,0===e.count.value&&(e.Za?e.cb.qb(e.Za):e.Na.Ka.qb(e.La)),this.za.Cb||(this.za.Za=void 0,this.za.La=void 0)},isDeleted:function(){return!this.za.La},deleteLater:function(){if(this.za.La||Q(this),this.za.zb&&!this.za.Cb)throw new Z("Object already scheduled for deletion");return this.za.zb=!0,this}});const t=Symbol.dispose;t&&(e[t]=e.delete)})(),Object.assign(we.prototype,{vc(e){return this.fc&&(e=this.fc(e)),e},Yb(e){this.qb?.(e)},nb:pe,$a:function(e){function t(){return ve(this.Ka.vb,this.Gb?{Na:this.Cc,La:r,cb:this,Za:e}:{Na:this,La:e})}var r=this.vc(e);if(!r)return this.Yb(e),null;var n=((e,t)=>{if(void 0===t)throw new Z("ptr should not be undefined");for(;e.ab;)t=e.Db(t),e=e.ab;return be[t]})(this.Ka,r);if(void 0!==n)return 0===n.za.count.value?(n.za.La=r,n.za.Za=e,n.clone()):(n=n.clone(),this.Yb(e),n);if(n=this.Ka.tc(r),!(n=ie[n]))return t.call(this);var a=me(r,this.Ka,(n=this.Fb?n.pc:n.pointerType).Ka);return null===a?t.call(this):ve(n.Ka.vb,this.Gb?{Na:n,La:a,cb:this,Za:e}:{Na:n,La:a})}}),Ur.Sc=(e,t,r,n,a,i,o,s,l,u)=>{hr(e,t,r,n,a,s,l,u).then(i).catch(o)},Ur.hd=hr,Ur.mb=Array(4096),Ur.Ma(ar,{},"/"),Ur.mkdir("/tmp"),Ur.mkdir("/home"),Ur.mkdir("/home/web_user"),function(){Ur.mkdir("/dev"),fr(Ur.tb(1,3),{read:()=>0,write:(e,t,r,n)=>n,bb:()=>0}),zr("/dev/null",Ur.tb(1,3)),er(Ur.tb(5,0),rr),er(Ur.tb(6,0),nr),zr("/dev/tty",Ur.tb(5,0)),zr("/dev/tty1",Ur.tb(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(Wt(e),t=e.byteLength),e[--t]);Ur.pb("/dev","random",r),Ur.pb("/dev","urandom",r),Ur.mkdir("/dev/shm"),Ur.mkdir("/dev/shm/tmp")}(),function(){Ur.mkdir("/proc");var e=Ur.mkdir("/proc/self");Ur.mkdir("/proc/self/fd"),Ur.Ma({Ma(){var t=Ur.createNode(e,"fd",16895,73);return t.Ca={bb:ar.Ca.bb},t.Ba={lookup(e,t){var r=Er(e=+t);return(e={parent:null,Ma:{ec:"fake"},Ba:{readlink:()=>r.path},id:e+1}).parent=e},readdir:()=>Array.from(Ur.streams.entries()).filter(([,e])=>e).map(([e])=>e.toString())},t}},{},"/proc/self/fd")}(),Ur.sc={MEMFS:ar},n.noExitRuntime&&(j=n.noExitRuntime),n.preloadPlugins&&(cr=n.preloadPlugins),n.print&&(T=n.print),n.printErr&&(O=n.printErr),n.wasmBinary&&(p=n.wasmBinary),n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.shift()();n.addRunDependency=ur,n.removeRunDependency=lr,n.FS_preloadFile=hr,n.FS_unlink=(...e)=>Ur.unlink(...e),n.FS_createPath=(...e)=>function(e,t){for(e="string"==typeof e?e:wr(e),t=t.split("/").reverse();t.length;){var r=t.pop();if(r){var n=Gt(e+"/"+r);try{Ur.mkdir(n)}catch(e){if(20!=e.sb)throw e}e=n}}return n}(...e),n.FS_createDevice=(...e)=>Ur.pb(...e),n.FS=Ur,n.FS_createDataFile=(...e)=>yr(...e),n.FS_createLazyFile=(...e)=>function(e,t,r,n,a){class o{Ib=!1;ob=[];Rb=void 0;Tb=0;Sb=0;get(e){if(!(e>this.length-1||0>e)){var t=e%this.chunkSize;return this.Rb(e/this.chunkSize|0)[t]}}mc(e){this.Rb=e}Ub(){var e=new XMLHttpRequest;e.open("HEAD",r,!1),e.send(null),200<=e.status&&300>e.status||304===e.status||D("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),a=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t;e=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t;var i=1048576;a||(i=n);var o=this;o.mc(e=>{var t=e*i,a=(e+1)*i-1;if(a=Math.min(a,n-1),void 0===o.ob[e]){var s=o.ob;t>a&&D("invalid range ("+t+", "+a+") or no bytes requested!"),a>n-1&&D("only "+n+" bytes available! programmer error!");var l=new XMLHttpRequest;l.open("GET",r,!1),n!==i&&l.setRequestHeader("Range","bytes="+t+"-"+a),l.responseType="arraybuffer",l.overrideMimeType&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send(null),200<=l.status&&300>l.status||304===l.status||D("Couldn't load "+r+". Status: "+l.status),t=void 0!==l.response?new Uint8Array(l.response||[]):Jt(l.responseText||""),s[e]=t}return void 0===o.ob[e]&&D("doXHR failed!"),o.ob[e]}),!e&&n||(i=n=1,i=n=this.Rb(0).length,T("LazyFiles on gzip forces download of the whole file when length is accessed")),this.Tb=n,this.Sb=i,this.Ib=!0}get length(){return this.Ib||this.Ub(),this.Tb}get chunkSize(){return this.Ib||this.Ub(),this.Sb}}if(globalThis.XMLHttpRequest){i||D("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var s=new o,l=void 0}else l=r,s=void 0;var u=function(e,t,r,n){return e="string"==typeof e?e:wr(e),t=Gt(e+"/"+t),Ur.create(t,ir(r,n))}(e,t,n,a);s?u.Da=s:l&&(u.Da=null,u.url=l),Object.defineProperties(u,{Oa:{get:function(){return this.Da.length}}}),e={};for(const[t,r]of Object.entries(u.Ca))e[t]=(...e)=>(Dr(u),r(...e));return e.read=(e,t,r,n,a)=>{if(Dr(u),a>=(e=e.node.Da).length)t=0;else{if(n=Math.min(e.length-a,n),e.slice)for(var i=0;i<n;i++)t[r+i]=e[a+i];else for(i=0;i<n;i++)t[r+i]=e.get(a+i);t=n}return t},e.wb=()=>{throw Dr(u),D(),new Ur.ya(48)},u.Ca=e,u}(...e);var Lr,Fr,Nr,jr,Ir,Vr,Gr,Hr,qr,Wr,Kr,Zr,Yr,Xr,Jr,Qr,en,tn,rn,nn,an,on,sn,ln,un,cn={b:(e,t,r,n)=>D(`Assertion failed: ${G(e)}, at: `+[t?G(t):"unknown filename",r,n?G(n):"unknown function"]),P:()=>D(""),F:(e,t,r,n,a)=>{t=H(t);let i=e=>e;if(n=0n===n){const e=8*r;i=t=>BigInt.asUintN(e,t),a=i(a)}X(e,{name:t,$a:i,eb:(e,t)=>("number"==typeof t&&(t=BigInt(t)),t),nb:J(t,r,!n),fb:null})},la:(e,t,r,n)=>{X(e,{name:t=H(t),$a:function(e){return!!e},eb:function(e,t){return t?r:n},nb:function(e){return this.$a(w[e])},fb:null})},ia:(e,t,r,n,a,i,o,s,l,u,c,h,d)=>{c=H(c),i=_e(a,i),s&&=_e(o,s),u&&=_e(l,u),d=_e(h,d);var f=(e=>{var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e})(c);se(f,function(){Se(`Cannot construct ${c} due to unbound types`,[n])}),Ce([e,t,r],n?[n]:[],t=>{if(t=t[0],n)var r=t.Ka,a=r.vb;else a=ne.prototype;t=ae(c,function(...e){if(Object.getPrototypeOf(this)!==o)throw new Z(`Use 'new' to construct ${c}`);if(void 0===h.rb)throw new Z(`${c} has no accessible constructor`);var t=h.rb[e.length];if(void 0===t)throw new Z(`Tried to invoke ctor of ${c} with invalid number of parameters (${e.length}) - expected (${Object.keys(h.rb).toString()}) parameters instead!`);return t.apply(this,e)});var o=Object.create(a,{constructor:{value:t}});t.prototype=o;var l,h=new le(c,t,o,d,r,i,s,u);return h.ab&&((l=h.ab).Vb??(l.Vb=[]),h.ab.Vb.push(h)),r=new we(c,h,!0,!1,!1),l=new we(c+"*",h,!1,!1,!1),a=new we(c+" const*",h,!1,!0,!1),ie[e]={pointerType:l,pc:a},$e(f,t),[r,l,a]})},$:(e,t,r,n,a,i)=>{var o=Ee(t,r);a=_e(n,a),Ce([],[e],e=>{var r=`constructor ${(e=e[0]).name}`;if(void 0===e.Ka.rb&&(e.Ka.rb=[]),void 0!==e.Ka.rb[t-1])throw new Z(`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.Ka.rb[t-1]=()=>{Se(`Cannot construct ${e.name} due to unbound types`,o)},Ce([],o,n=>(n.splice(1,0,null),e.Ka.rb[t-1]=Oe(r,n,null,a,i),[])),[]})},i:(e,t,r,n,a,i,o,s,l)=>{var u=Ee(r,n);t=H(t),t=Pe(t),i=_e(a,i),Ce([],[e],e=>{function n(){Se(`Cannot call ${a} due to unbound types`,u)}var a=`${(e=e[0]).name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.Ka.Dc.push(t);var c=e.Ka.vb,h=c[t];return void 0===h||void 0===h.Ya&&h.className!==e.name&&h.yb===r-2?(n.yb=r-2,n.className=e.name,c[t]=n):(oe(c,t,a),c[t].Ya[r-2]=n),Ce([],u,n=>(n=Oe(a,n,e,i,o,l),void 0===c[t].Ya?(n.yb=r-2,c[t]=n):c[t].Ya[r-2]=n,[])),[]})},ja:e=>X(e,Me),E:(e,t,r)=>{X(e,{name:t=H(t),$a:e=>e,eb:(e,t)=>t,nb:Le(t,r),fb:null})},G:(e,t,r,n,a,i,o)=>{var s=Ee(t,r);e=H(e),e=Pe(e),a=_e(n,a),se(e,function(){Se(`Cannot call ${e} due to unbound types`,s)},t-1),Ce([],s,r=>(r=[r[0],null].concat(r.slice(1)),$e(e,Oe(e,r,null,a,i,o),t-1),[]))},k:(e,t,r,n,a)=>{t=H(t);let i=e=>e;if(0===n){var o=32-8*r;i=e=>e<<o>>>o,a=i(a)}X(e,{name:t,$a:i,eb:(e,t)=>t,nb:J(t,r,0!==n),fb:null})},h:(e,t,r)=>{function n(e){return new a(v.buffer,A[e+4>>2],A[e>>2])}var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];X(e,{name:r=H(r),$a:n,nb:n},{xc:!0})},ka:(e,t)=>{X(e,{name:t=H(t),$a(e){var t=G(e+4,A[e>>2],!0);return Nr(e),t},eb(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r="string"==typeof t;if(!(r||ArrayBuffer.isView(t)&&1==t.BYTES_PER_ELEMENT))throw new Z("Cannot pass non-string to std::string");var n=r?Ne(t):t.length,a=Lr(4+n+1),i=a+4;return A[a>>2]=n,r?Fe(t,w,i,n+1):w.set(t,i),null!==e&&e.push(Nr,a),a},nb:pe,fb(e){Nr(e)}})},w:(e,t,r)=>{if(r=H(r),2===t)var n=Ie,a=Ve,i=Ge;else n=He,a=qe,i=We;X(e,{name:r,$a:e=>{var r=n(e+4,A[e>>2]*t,!0);return Nr(e),r},eb:(e,n)=>{if("string"!=typeof n)throw new Z(`Cannot pass non-string to C++ string type ${r}`);var o=i(n),s=Lr(4+o+t);return A[s>>2]=o/t,a(n,s+4,o+t),null!==e&&e.push(Nr,s),s},nb:pe,fb(e){Nr(e)}})},x:e=>{X(e,Me)},ma:(e,t)=>{X(e,{dc:!0,name:t=H(t),$a:()=>{},eb:()=>{}})},J:()=>{j=!1,Ke=0},m:(e,t,r)=>{var[n,...a]=((e,t)=>{for(var r=Array(e),n=0;n<e;++n){var a=n,i=A[t+4*n>>2],o=W[i];if(void 0===o)throw e=`parameter ${n} has unknown type ${xe(i)}`,new Z(e);r[a]=o}return r})(e,t);t=n.eb.bind(n);var i=a.map(e=>e.nb.bind(e));e--;var o={toValue:De};switch(e=i.map((e,t)=>{var r=`argFromPtr${t}`;return o[r]=e,`${r}(args${t?"+"+8*t:""})`}),r){case 0:var s="toValue(handle)";break;case 2:s="new (toValue(handle))";break;case 3:s="";break;case 1:o.getStringOrSymbol=Je,s="toValue(handle)[getStringOrSymbol(methodName)]"}return s+=`(${e})`,n.dc||(o.toReturnWire=t,o.emval_returnValue=Ye,s=`return emval_returnValue(toReturnWire, destructorsRef, ${s})`),s=`return function (handle, methodName, destructorsRef, args) {\n ${s}\n }`,r=new Function(Object.keys(o),s)(...Object.values(o)),s=`methodCaller<(${a.map(e=>e.name)}) => ${n.name}>`,(e=>{var t=Ze.length;return Ze.push(e),t})(ae(s,r))},ga:Be,na:e=>e?(e=Je(e),Ue(globalThis[e])):Ue(globalThis),o:(e,t)=>(e=De(e),t=De(t),Ue(e[t])),y:e=>{9<e&&(Re[e+1]+=1)},l:(e,t,r,n,a)=>Ze[e](t,r,n,a),oa:e=>Ue(Je(e)),H:e=>{var t=De(e);ke(t),Be(e)},K:(e,t)=>{if(Qe[e]&&(clearTimeout(Qe[e].id),delete Qe[e]),!t)return 0;var r=setTimeout(()=>{delete Qe[e],tt(()=>rn(e,performance.now()))},t);return Qe[e]={id:r,md:t},0},O:e=>{var t=w.length;if(2147483648<(e>>>=0))return!1;for(var r=1;4>=r;r*=2){var n=t*(1+.2/r);n=Math.min(n,e+100663296);e:{n=(Math.min(2147483648,65536*Math.ceil(Math.max(e,n)/65536))-sn.buffer.byteLength+65535)/65536|0;try{sn.grow(n),B();var a=1;break e}catch(e){}a=void 0}if(a)return!0}return!1},T:function(e,t,r,n,a,i){t=It(t),r=It(r),e=it(e);var o={};if(i){var s=A[i+12>>2];if(s){var l=A[i+16>>2];o.requiredFeatures=Array.from(A.subarray(l>>2,l+4*s>>2),e=>gt[e])}var u=A[i+20>>2];if(u){var c={};function h(e,t,r=!1){4294967295==(t=A[u+t>>2])||r&&0==t||(c[e]=t)}function d(e,t){4294967295==A[(t=u+t)>>2]&&4294967295==A[t+4>>2]||(c[e]=4294967296*A[t+4>>2]+A[t>>2])}h("maxTextureDimension1D",4),h("maxTextureDimension2D",8),h("maxTextureDimension3D",12),h("maxTextureArrayLayers",16),h("maxBindGroups",20),h("maxBindGroupsPlusVertexBuffers",24),h("maxDynamicUniformBuffersPerPipelineLayout",32),h("maxDynamicStorageBuffersPerPipelineLayout",36),h("maxSampledTexturesPerShaderStage",40),h("maxSamplersPerShaderStage",44),h("maxStorageBuffersPerShaderStage",48),h("maxStorageTexturesPerShaderStage",52),h("maxUniformBuffersPerShaderStage",56),h("minUniformBufferOffsetAlignment",80),h("minStorageBufferOffsetAlignment",84),d("maxUniformBufferBindingSize",64),d("maxStorageBufferBindingSize",72),h("maxVertexBuffers",88),d("maxBufferSize",96),h("maxVertexAttributes",104),h("maxVertexBufferArrayStride",108),h("maxInterStageShaderVariables",112),h("maxColorAttachments",116),h("maxColorAttachmentBytesPerSample",120),h("maxComputeWorkgroupStorageSize",124),h("maxComputeInvocationsPerWorkgroup",128),h("maxComputeWorkgroupSizeX",132),h("maxComputeWorkgroupSizeY",136),h("maxComputeWorkgroupSizeZ",140),h("maxComputeWorkgroupsPerDimension",144),h("maxImmediateSize",148,!0),o.requiredLimits=c}(s=A[i+24>>2])&&(s={label:st(s+4)},o.defaultQueue=s),o.label=st(i+4)}e.requestDevice(o).then(e=>{tt(()=>{nt[a>>>0]=e.queue,nt[n>>>0]=e,e.lost.then(t=>{tt(()=>{e.onuncapturederror=()=>{};var n=on(),a=rt(t.message);Jr(r,jt[t.reason],a),nn(n)})}),e.onuncapturederror=e=>{var t=5;e.error instanceof GPUValidationError?t=2:e.error instanceof GPUOutOfMemoryError?t=3:e.error instanceof GPUInternalError&&(t=4);var r=on();e=rt(e.error.message),tn(n,t,e),nn(r)},en(t,1,n,0)})},e=>{tt(()=>{var a=on(),i=rt(e.message);en(t,3,n,i),r&&Jr(r,4,i),nn(a)})})},V:e=>{var t=it(e),r=at[e];if(r){for(var n=0;n<r.length;++n)r[n]();delete at[e]}t.destroy()},d:e=>{delete nt[e]},S:(e,t,r)=>{var n=!!A[t+32>>2];t={label:st(t+4),usage:A[t+16>>2],size:4294967296*A[t+4+24>>2]+A[t+24>>2],mappedAtCreation:n},e=it(e);try{var a=e.createBuffer(t)}catch(e){return!1}return nt[r>>>0]=a,n&&(at[r]=[]),!0},R:(e,t,r)=>{var n=A[t>>2],a=A[n+4>>2];t={label:st(t+4),code:""},2===a&&(t.code=ot(n+8)),e=it(e).createShaderModule(t),nt[r>>>0]=e},U:e=>{(e=it(e)).onuncapturederror=null,e.destroy()},Q:function(e,t,r,n){if(t=It(t),r){var a={featureLevel:wt[A[r+4>>2]],powerPreference:Ct[A[r+8>>2]],forceFallbackAdapter:!!A[r+12>>2]};0!==(e=A[r>>2])&&(a.qd=!!A[e+8>>2])}"gpu"in navigator?navigator.gpu.requestAdapter(a).then(e=>{tt(()=>{if(e)nt[n>>>0]=e,Qr(t,1,n,0);else{var r=on(),a=rt("WebGPU not available on this browser (requestAdapter returned null)");Qr(t,3,n,a),nn(r)}})},e=>{tt(()=>{var r=on(),a=rt(e.message);Qr(t,4,n,a),nn(r)})}):(a=on(),e=rt("WebGPU not available on this browser (navigator.gpu is not available)"),Qr(t,3,n,e),nn(a))},N:function(e){try{var t=Er(e);return Ur.close(t),0}catch(e){if(void 0===Ur||"ErrnoError"!==e.name)throw e;return e.sb}},L:function(e,t,r,n){t=It(t);try{if(isNaN(t))return 61;var a=Er(e);return Ur.bb(a,t,r),C[n>>3]=BigInt(a.position),a.Kb&&0===t&&0===r&&(a.Kb=null),0}catch(e){if(void 0===Ur||"ErrnoError"!==e.name)throw e;return e.sb}},M:function(e,t,r,n){try{e:{var a=Er(e);e=t;for(var i,o=t=0;o<r;o++){var s=A[e>>2],l=A[e+4>>2];e+=8;var u=Ur.write(a,v,s,l,i);if(0>u){var c=-1;break e}if(t+=u,u<l)break;void 0!==i&&(i+=u)}c=t}return A[n>>2]=c,0}catch(e){if(void 0===Ur||"ErrnoError"!==e.name)throw e;return e.sb}},I:et,r:function(e){return BigInt(it(e).size)},u:(e,t)=>{var r=A[t>>2],n=void 0;0!==r&&(n=4294967296*A[r+12>>2]+A[r+8>>2]),r=st(t+4);for(var a=A[t+12>>2],i=A[t+16>>2],o=[],s=0;s<a;++s){var l=o,u=l.push,c=i+56*s,h=A[c+4>>2];if(0!==h){var d=_[c+8>>2];-1==d&&(d=void 0);var f=c+24;c={view:it(h),depthSlice:d,resolveTarget:it(A[c+12>>2]),clearValue:{r:S[f>>3],g:S[f+8>>3],b:S[f+16>>3],a:S[f+24>>3]},loadOp:xt[A[c+16>>2]],storeOp:zt[A[c+20>>2]]}}else c=void 0;u.call(l,c)}return a=0!==(a=A[t+20>>2])?{view:it(A[a+4>>2]),depthClearValue:x[a+16>>2],depthLoadOp:xt[A[a+8>>2]],depthStoreOp:zt[A[a+12>>2]],depthReadOnly:!!A[a+20>>2],stencilClearValue:A[a+32>>2],stencilLoadOp:xt[A[a+24>>2]],stencilStoreOp:zt[A[a+28>>2]],stencilReadOnly:!!A[a+36>>2]}:void 0,i=0!==(i=A[t+28>>2])?{querySet:it(A[i+4>>2]),beginningOfPassWriteIndex:A[i+8>>2],endOfPassWriteIndex:A[i+12>>2]}:void 0,t={label:r,colorAttachments:o,depthStencilAttachment:a,occlusionQuerySet:it(A[t+24>>2]),timestampWrites:i,maxDrawCount:n},n=it(e),e=qr(0),t=n.beginRenderPass(t),nt[e>>>0]=t,e},_:(e,t,r,n)=>{it(e).copyTextureToTexture(ut(t),ut(r),lt(n))},ba:e=>{var t=it(e);return e=Vr(0),t=t.finish(),nt[e>>>0]=t,e},q:(e,t)=>{var r=st(t+4),n=it(A[t+12>>2]),a=A[t+16>>2];t=A[t+20>>2];for(var i=[],o=0;o<a;++o){var s=i,l=s.push,u=t+40*o,c=A[u+8>>2],h=A[u+32>>2],d=A[u+36>>2],f=A[u+4>>2];c?(-1==(h=A[(h=u+24)>>2]+4294967296*_[h+4>>2])&&(h=void 0),u={binding:f,resource:{buffer:it(c),offset:4294967296*A[u+4+16>>2]+A[u+16>>2],size:h}}):u=h?{binding:f,resource:it(h)}:{binding:f,resource:it(d)},l.call(s,u)}return r={label:r,layout:n,entries:i},n=it(e),e=jr(0),r=n.createBindGroup(r),nt[e>>>0]=r,e},j:(e,t)=>{var r=st(t+4),n=A[t+12>>2];t=A[t+16>>2];for(var a=[],i=0;i<n;++i){var o=t+88*i,s=A[o+4>>2],l=A[o+8>>2],u=o+24,c=A[u+4>>2];u=c?{type:mt[c],hasDynamicOffset:!!A[u+8>>2],minBindingSize:4294967296*A[u+4+16>>2]+A[u+16>>2]}:void 0,c=(c=A[o+48+4>>2])?{type:Tt[c]}:void 0;var h=o+56,d=A[h+4>>2];h=d?{sampleType:Ut[d],viewDimension:Mt[A[h+8>>2]],multisampled:!!A[h+12>>2]}:void 0,o=(d=A[(o+=72)+4>>2])?{access:Pt[d],format:Dt[A[o+8>>2]],viewDimension:Mt[A[o+12>>2]]}:void 0,a.push.call(a,{binding:s,visibility:l,buffer:u,sampler:c,texture:h,storageTexture:o})}return r={label:r,entries:a},n=it(e),e=Ir(0),r=n.createBindGroupLayout(r),nt[e>>>0]=r,e},ca:(e,t)=>{var r;return t&&(r={label:st(t+4)}),t=it(e),e=Gr(0),r=t.createCommandEncoder(r),nt[e>>>0]=r,e},aa:(e,t)=>{for(var r=A[t+12>>2],n=A[t+16>>2],a=[],i=0;i<r;++i)a.push(it(A[n+4*i>>2]));return t={label:st(t+4),bindGroupLayouts:a},r=it(e),e=Hr(0),t=r.createPipelineLayout(t),nt[e>>>0]=t,e},f:(e,t)=>{t=(e=>{function t(e){if(e)return{operation:pt[A[e>>2]],srcFactor:ft[A[e+4>>2]],dstFactor:ft[A[e+8>>2]]}}function r(e){return{compare:bt[A[e>>2]],failOp:Ot[A[e+4>>2]],depthFailOp:Ot[A[e+8>>2]],passOp:Ot[A[e+12>>2]]}}return{label:st(e+4),layout:ht(A[e+12>>2]),vertex:function(e){if(e){var t=it(A[e+4>>2]),r=ct(A[e+16>>2],A[e+20>>2]),n=A[e+24>>2],a=A[e+28>>2];if(n){for(var i=[],o=0;o<n;++o){var s=i,l=s.push,u=a+24*o;if(u){var c=A[u+4>>2],h=A[u+16>>2];if(0===c&&0===h)var d=null;else{d=4294967296*A[u+4+8>>2]+A[u+8>>2],c=Nt[c],u=A[u+20>>2];for(var f=[],p=0;p<h;++p){var m=u+24*p;f.push.call(f,{format:Ft[A[m+4>>2]],offset:4294967296*A[m+4+8>>2]+A[m+8>>2],shaderLocation:A[m+16>>2]})}d={arrayStride:d,stepMode:c,attributes:f}}}else d=void 0;l.call(s,d)}n=i}else n=void 0;return{module:t,constants:r,buffers:n,entryPoint:st(e+8)}}}(e+16),primitive:function(e){if(e)return{topology:kt[A[e+4>>2]],stripIndexFormat:At[A[e+8>>2]],frontFace:_t[A[e+12>>2]],cullMode:vt[A[e+16>>2]],unclippedDepth:!!A[e+20>>2]}}(e+48),depthStencil:function(e){if(e)return{format:Dt[A[e+4>>2]],depthWriteEnabled:!!A[e+8>>2],depthCompare:bt[A[e+12>>2]],stencilFront:r(e+16),stencilBack:r(e+32),stencilReadMask:A[e+48>>2],stencilWriteMask:A[e+52>>2],depthBias:_[e+56>>2],depthBiasSlopeScale:x[e+60>>2],depthBiasClamp:x[e+64>>2]}}(A[e+72>>2]),multisample:function(e){if(e)return{count:A[e+4>>2],mask:A[e+8>>2],alphaToCoverageEnabled:!!A[e+12>>2]}}(e+76),fragment:function(e){if(e){for(var r=it(A[e+4>>2]),n=ct(A[e+16>>2],A[e+20>>2]),a=A[e+24>>2],i=A[e+28>>2],o=[],s=0;s<a;++s){var l=o,u=l.push,c=i+24*s,h=A[c+4>>2];if(0===h)c=void 0;else{h=Dt[h];var d=(d=A[c+8>>2])?{alpha:t(d+12),color:t(d+0)}:void 0;c={format:h,blend:d,writeMask:A[c+16>>2]}}u.call(l,c)}return{module:r,constants:n,targets:o,entryPoint:st(e+8)}}}(A[e+92>>2])}})(t);var r=it(e);return e=Wr(0),t=r.createRenderPipeline(t),nt[e>>>0]=t,e},ha:(e,t)=>{var r;return t&&(r={label:st(t+4),addressModeU:dt[A[t+12>>2]],addressModeV:dt[A[t+16>>2]],addressModeW:dt[A[t+20>>2]],magFilter:$t[A[t+24>>2]],minFilter:$t[A[t+28>>2]],mipmapFilter:St[A[t+32>>2]],lodMinClamp:x[t+36>>2],lodMaxClamp:x[t+40>>2],compare:bt[A[t+44>>2]],maxAnisotropy:$[t+48>>1]}),t=it(e),e=Kr(0),r=t.createSampler(r),nt[e>>>0]=r,e},v:(e,t)=>{var r={label:st(t+4),size:lt(t+28),mipLevelCount:A[t+44>>2],sampleCount:A[t+48>>2],dimension:Bt[A[t+24>>2]],format:Dt[A[t+40>>2]],usage:A[t+16>>2]},n=A[t+52>>2];return n&&(t=A[t+56>>2],r.viewFormats=Array.from(_.subarray(t>>2,t+4*n>>2),e=>Dt[e])),e=it(e),((e,t)=>{nt[e>>>0]=t})(n=Yr(0),e.createTexture(r)),n},Z:(e,t)=>(e=2<(e=A[A[t>>2]+8>>2])?G(e):e,(e=(Mr[e]||("undefined"!=typeof document?document.querySelector(e):null)).getContext("webgpu"))?(e.ld=st(t+4),t=Zr(0),nt[t>>>0]=e,t):0),A:(e,t,r)=>{e=it(e),t=Array.from(_.subarray(r>>2,r+4*t>>2),e=>it(e)),e.submit(t)},n:function(e,t,r,n,a){r=It(r),it(e).writeBuffer(it(t),r,w.subarray(n,n+a),0,a)},B:(e,t,r,n,a,i)=>{var o=A[a+8>>2],s=A[a+12>>2];it(e).writeTexture(ut(t),w.subarray(r,r+n),{offset:4294967296*A[a+4>>2]+A[a>>2],bytesPerRow:4294967295===o?void 0:o,rowsPerImage:4294967295===s?void 0:s},lt(i))},s:(e,t,r,n,a,i)=>{it(e).drawIndexed(t,r,n>>>0,a,i>>>0)},z:e=>{it(e).end()},a:(e,t,r,n,a)=>{e=it(e),r=it(r),0==n?e.setBindGroup(t,r):e.setBindGroup(t,r,A,a>>2,n)},t:function(e,t,r,n,a){n=It(n),a=It(a),e=it(e),t=it(t),-1==a&&(a=void 0),e.setIndexBuffer(t,At[r],n,a)},c:(e,t)=>{it(e).setPipeline(it(t))},g:(e,t,r,n,a)=>{it(e).setScissorRect(t,r,n,a)},e:(e,t)=>{it(e).setStencilReference(t>>>0)},p:function(e,t,r,n,a){n=It(n),a=It(a),e=it(e),r=it(r),-1==a&&(a=void 0),e.setVertexBuffer(t,r,n,a)},X:(e,t)=>{var r=A[t+4>>2];e=it(e);var n=[A[t+24>>2],A[t+28>>2]];if(0!==n[0]&&(e.canvas.width=n[0]),0!==n[1]&&(e.canvas.height=n[1]),r={device:it(r),format:Dt[A[t+8>>2]],usage:A[t+16>>2],alphaMode:yt[A[t+40>>2]]},n=A[t+32>>2]){var a=A[t+36>>2];r.viewFormats=Array.from(_.subarray(a>>2,a+4*n>>2),e=>Dt[e])}0!==(t=A[t>>2])&&(r.colorSpace=Et[A[t+8>>2]],r.nd={mode:Lt[A[t+12>>2]]}),e.configure(r)},W:(e,t)=>{e=it(e);try{var r=Yr(0),n=e.getCurrentTexture();nt[r>>>0]=n,A[t+4>>2]=r,_[t+8>>2]=1}catch(e){A[t+4>>2]=0,_[t+8>>2]=6}},Y:e=>{it(e).unconfigure()},ea:(e,t)=>{if(t){var r=A[t+24>>2],n=A[t+32>>2];r={label:st(t+4),format:Dt[A[t+12>>2]],dimension:Mt[A[t+16>>2]],baseMipLevel:A[t+20>>2],mipLevelCount:4294967295===r?void 0:r,baseArrayLayer:A[t+28>>2],arrayLayerCount:4294967295===n?void 0:n,aspect:Rt[A[t+36>>2]]}}return t=it(e),e=Xr(0),t=t.createView(r),nt[e>>>0]=t,e},da:e=>{it(e).destroy()},fa:e=>Dt.indexOf(it(e).format),C:e=>it(e).height,D:e=>it(e).width};return un=await async function(){function e(e){return e=un=e.exports,Lr=e.ra,Fr=e.sa,Nr=e.ta,jr=e.ua,Ir=e.va,Vr=e.wa,Gr=e.xa,Hr=e.Aa,qr=e.Ea,Wr=e.Fa,Kr=e.Ga,Zr=e.Ha,Yr=e.Ia,Xr=e.Ja,Jr=e.Pa,Qr=e.Qa,en=e.Ra,tn=e.Sa,rn=e.Ta,nn=e.Va,an=e.Wa,on=e.Xa,sn=e.pa,ln=e.Ua,B(),un}var r={a:cn};return n.instantiateWasm?new Promise(t=>{n.instantiateWasm(r,(r,n)=>{t(e(r))})}):(k??=n.locateFile?n.locateFile?n.locateFile("thorvg.wasm",d):d+"thorvg.wasm":new URL("thorvg.wasm","undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:t&&"SCRIPT"===t.tagName.toUpperCase()&&t.src||new URL("lottie-player.js",document.baseURI).href).href,e((await async function(e){var t=k;if(!p&&!z(t)&&!o)try{var r=fetch(t,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(r,e)}catch(e){O(`wasm streaming compile failed: ${e}`),O("falling back to ArrayBuffer instantiation")}return async function(e,t){try{var r=await async function(e){if(!p)try{var t=await l(e);return new Uint8Array(t)}catch{}if(e==k&&p)e=new Uint8Array(p);else{if(!u)throw"both async and sync fetching of the wasm failed";e=u(e)}return e}(e);return await WebAssembly.instantiate(r,t)}catch(e){O(`failed to asynchronously prepare wasm: ${e}`),D(e)}}(t,e)}(r)).instance))}(),function e(){function t(){if(n.calledRun=!0,!P){if(R=!0,n.noFSInit||Ur.Lb||dr(),un.qa(),Ur.bc=!1,b?.(n),n.onRuntimeInitialized?.(),n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;){var e=n.postRun.shift();L.push(e)}M(L)}}if(0<or)sr=e;else{if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)N();M(F),0<or?sr=e:n.setStatus?(n.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>n.setStatus(""),1),t()},1)):t()}}(),r=R?n:new Promise((e,t)=>{b=e,y=t}),r}({locateFile:(e,t)=>e.endsWith(".wasm")?this.wasmUrl||"https://unpkg.com/@thorvg/lottie-player@latest/dist/thorvg.wasm":t+e})),!this._timer)return;clearInterval(this._timer),this._timer=void 0;const e=this.config?.renderer||"wg";if(await(async e=>{if("wg"===e){for(;"requested"===be;)await me(100);if("initialized"!==be&&(be="requested",de))for(;;)switch(de.init()){case 0:return void(be="initialized");case 1:return void(be="failed");case 2:await me(100)}}})(e),"failed"===be)return this.currentState="error",void this.dispatchEvent(new CustomEvent("error"));this.TVG=new de.TvgLottieAnimation(e,`#${this.canvas.id}`),this.src&&this.load(this.src,this.fileType)}_viewport(){const{left:e,right:t,top:r,bottom:n}=this.getBoundingClientRect(),a=window.innerWidth,i=window.innerHeight;let o=0,s=0,l=this.canvas.width,u=this.canvas.height;e<0&&(o=Math.abs(e),l-=o),r<0&&(s=Math.abs(r),u-=s),t>a&&(l-=t-a),n>i&&(u-=n-i),this.TVG.viewport(o,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-${Date.now().toString(36)+Math.random().toString(36).substring(2)}`,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.fileType):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){if(!this.TVG)throw new Error("TVG is not initialized");if(this._assetResolverCallback&&this.TVG.setAssetResolver(this._assetResolverCallback,this._assetResolverData),!this.TVG.load(e,this.fileType,this.canvas.width,this.canvas.height))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.TVG)return;if(!1!==this.config?.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}if(this.TVG.resize(this.canvas.width,this.canvas.height),this._viewport(),!this.TVG.update())return;if("wg"===this.config?.renderer||"gl"===this.config?.renderer)return void this.TVG.render();const e=this.TVG.render(),t=new Uint8ClampedArray(e,0,e.byteLength);t.length<1||(this._imageData=new ImageData(t,this.canvas.width,this.canvas.height),this._flush())}async _update(){if(!this.TVG)return!1;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 me(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.TVG&&(this.pause(),this.currentFrame=e,this.TVG.frame(e))}async load(e,t="json"){try{await this._init();const r=await(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||"lot"===t)return n=await(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})(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")}})(e,t);this.dispatchEvent(new CustomEvent("ready")),this.fileType=t,await this._loadBytes(r)}catch(e){this.currentState="error",this.dispatchEvent(new CustomEvent("error"))}}play(){if(this.TVG&&!("json"!==this.fileType&&"lot"!==this.fileType||(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(){de&&(de.term(),de=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)}setQuality(e){this.TVG&&this.TVG.quality(e)&&"playing"!==this.currentState&&this._render()}setAssetResolver(e,t){this._assetResolverCallback=e,this._assetResolverData=t,this.TVG&&this.TVG.setAssetResolver(e,t)}getVersion(){return{THORVG_VERSION:"1.0.2"}}render(){return H`
2
2
  <canvas class="thorvg" style="width: 100%; height: 100%;" />
3
3
  `}}function ve(e,t,r,n){var a,i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}he([S({type:String})],ye.prototype,"src",void 0),he([S({type:String})],ye.prototype,"wasmUrl",void 0),he([S({type:pe})],ye.prototype,"fileType",void 0),he([S({type:Number})],ye.prototype,"speed",void 0),he([S({type:Boolean})],ye.prototype,"autoPlay",void 0),he([S({type:Number})],ye.prototype,"count",void 0),he([S({type:Boolean})],ye.prototype,"loop",void 0),he([S({type:Number})],ye.prototype,"direction",void 0),he([S()],ye.prototype,"mode",void 0),he([S()],ye.prototype,"intermission",void 0),he([S({type:Number})],ye.prototype,"totalFrame",void 0),he([S({type:Number})],ye.prototype,"currentFrame",void 0),he([S({type:Number})],ye.prototype,"currentState",void 0),he([S({type:Float32Array})],ye.prototype,"size",null);class we extends ye{set renderConfig(e){this.config={renderer:"wg",enableDevicePixelRatio:e.enableDevicePixelRatio}}get renderConfig(){return this.config||{}}}ve([S({type:Object})],we.prototype,"renderConfig",null),we=ve([(e=>(t,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)})("lottie-player")],we);var ge=Object.freeze({__proto__:null});e.LottiePresetPlayer=we});
4
4
  //# sourceMappingURL=lottie-player.js.map
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thorvg/lottie-player",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "A web lottie player using ThorVG as a renderer",
5
5
  "main": "./dist/lottie-player.cjs.js",
6
6
  "module": "./dist/lottie-player.esm.js",
@@ -89,7 +89,7 @@
89
89
  "build": "npm run clean && sh ./wasm_player_setup.sh && THORVG_VERSION=$(npm run version --silent) rollup -c --bundleConfigAsCjs",
90
90
  "build:watch": "npm run clean && sh ./wasm_player_setup.sh && THORVG_VERSION=$(npm run version --silent) rollup -c --bundleConfigAsCjs --watch",
91
91
  "clean": "rm -rf dist && mkdir dist && touch dist/index.js",
92
- "test": "web-test-runner tests/**/*.test.ts",
92
+ "test": "THORVG_VERSION=$(npm run version --silent) web-test-runner tests/**/*.test.ts",
93
93
  "lint": "eslint ./src --ext .ts,.tsx,.js",
94
94
  "lint:fix": "eslint ./src --ext .ts,.tsx,.js --fix",
95
95
  "version": "sed -n -e 4p ../../thorvg/meson.build | sed 's/..$//' | sed -r 's/.{19}//'"