@thorvg/lottie-player
Version:
A web lottie player using ThorVG as a renderer
1 lines • 83.9 kB
JavaScript
"use strict";var t="undefined"!=typeof document?document.currentScript:null;const e=globalThis,r=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),i=new WeakMap;let a=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(r&&void 0===t){const r=void 0!==e&&1===e.length;r&&(t=i.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&i.set(e,t))}return t}toString(){return this.cssText}};const o=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,n))(e)})(t):t,{is:s,defineProperty:l,getOwnPropertyDescriptor:c,getOwnPropertyNames:u,getOwnPropertySymbols:h,getPrototypeOf:d}=Object,f=globalThis,p=f.trustedTypes,m=p?p.emptyScript:"",b=f.reactiveElementPolyfillSupport,v=(t,e)=>t,w={toAttribute(t,e){switch(e){case Boolean:t=t?m:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},g=(t,e)=>!s(t,e),y={attribute:!0,type:String,converter:w,reflect:!1,useDefault:!1,hasChanged:g};Symbol.metadata??=Symbol("metadata"),f.litPropertyMetadata??=new WeakMap;let $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=y){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(t,r,e);void 0!==n&&l(this.prototype,t,n)}}static getPropertyDescriptor(t,e,r){const{get:n,set:i}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:n,set(e){const a=n?.call(this);i?.call(this,e),this.requestUpdate(t,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const t=d(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(v("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(v("properties"))){const t=this.properties,e=[...u(t),...h(t)];for(const r of e)this.createProperty(r,t[r])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,r]of e)this.elementProperties.set(t,r)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const r=this._$Eu(t,e);void 0!==r&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(o(t))}else void 0!==t&&e.push(o(t));return e}static _$Eu(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.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(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,n)=>{if(r)t.adoptedStyleSheets=n.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const r of n){const n=document.createElement("style"),i=e.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){const r=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,r);if(void 0!==n&&!0===r.reflect){const i=(void 0!==r.converter?.toAttribute?r.converter:w).toAttribute(e,r.type);this._$Em=t,null==i?this.removeAttribute(n):this.setAttribute(n,i),this._$Em=null}}_$AK(t,e){const r=this.constructor,n=r._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=r.getPropertyOptions(n),i="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:w;this._$Em=n;const a=i.fromAttribute(e,t.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(t,e,r,n=!1,i){if(void 0!==t){const a=this.constructor;if(!1===n&&(i=this[t]),r??=a.getPropertyOptions(t),!((r.hasChanged??g)(i,e)||r.useDefault&&r.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(a._$Eu(t,r))))return;this.C(t,e,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:n,wrapped:i},a){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,a??e??this[t]),!0!==i||void 0!==a)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),!0===n&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,r]of t){const{wrapped:t}=r,n=this[e];!0!==t||this._$AL.has(e)||void 0===n||this.C(e,void 0,r,n)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[v("elementProperties")]=new Map,$[v("finalized")]=new Map,b?.({ReactiveElement:$}),(f.reactiveElementVersions??=[]).push("2.1.2");const _={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:g},A=(t=_,e,r)=>{const{kind:n,metadata:i}=r;let a=globalThis.litPropertyMetadata.get(i);if(void 0===a&&globalThis.litPropertyMetadata.set(i,a=new Map),"setter"===n&&((t=Object.create(t)).wrapped=!0),a.set(r.name,t),"accessor"===n){const{name:n}=r;return{set(r){const i=e.get.call(this);e.set.call(this,r),this.requestUpdate(n,i,t,!0,r)},init(e){return void 0!==e&&this.C(n,void 0,t,e),e}}}if("setter"===n){const{name:n}=r;return function(r){const i=this[n];e.call(this,r),this.requestUpdate(n,i,t,!0,r)}}throw Error("Unsupported decorator location: "+n)};function x(t){return(e,r)=>"object"==typeof r?A(t,e,r):((t,e,r)=>{const n=e.hasOwnProperty(r);return e.constructor.createProperty(r,t),n?Object.getOwnPropertyDescriptor(e,r):void 0})(t,e,r)}const S=globalThis,k=t=>t,E=S.trustedTypes,I=E?E.createPolicy("lit-html",{createHTML:t=>t}):void 0,C="$lit$",T=`lit$${Math.random().toFixed(9).slice(2)}$`,P="?"+T,U=`<${P}>`,R=document,M=()=>R.createComment(""),L=t=>null===t||"object"!=typeof t&&"function"!=typeof t,O=Array.isArray,N="[ \t\n\f\r]",F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,V=/>/g,D=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,z=/"/g,J=/^(?:script|style|textarea|title)$/i,W=(t,...e)=>({_$litType$:1,strings:t,values:e}),G=Symbol.for("lit-noChange"),H=Symbol.for("lit-nothing"),q=new WeakMap,X=R.createTreeWalker(R,129);function Y(t,e){if(!O(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==I?I.createHTML(e):e}const K=(t,e)=>{const r=t.length-1,n=[];let i,a=2===e?"<svg>":3===e?"<math>":"",o=F;for(let e=0;e<r;e++){const r=t[e];let s,l,c=-1,u=0;for(;u<r.length&&(o.lastIndex=u,l=o.exec(r),null!==l);)u=o.lastIndex,o===F?"!--"===l[1]?o=j:void 0!==l[1]?o=V:void 0!==l[2]?(J.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=D):void 0!==l[3]&&(o=D):o===D?">"===l[0]?(o=i??F,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,s=l[1],o=void 0===l[3]?D:'"'===l[3]?z:B):o===z||o===B?o=D:o===j||o===V?o=F:(o=D,i=void 0);const h=o===D&&t[e+1].startsWith("/>")?" ":"";a+=o===F?r+U:c>=0?(n.push(s),r.slice(0,c)+C+r.slice(c)+T+h):r+T+(-2===c?e:h)}return[Y(t,a+(t[r]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class Q{constructor({strings:t,_$litType$:e},r){let n;this.parts=[];let i=0,a=0;const o=t.length-1,s=this.parts,[l,c]=K(t,e);if(this.el=Q.createElement(l,r),X.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=X.nextNode())&&s.length<o;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(C)){const e=c[a++],r=n.getAttribute(t).split(T),o=/([.?@])?(.*)/.exec(e);s.push({type:1,index:i,name:o[2],strings:r,ctor:"."===o[1]?nt:"?"===o[1]?it:"@"===o[1]?at:rt}),n.removeAttribute(t)}else t.startsWith(T)&&(s.push({type:6,index:i}),n.removeAttribute(t));if(J.test(n.tagName)){const t=n.textContent.split(T),e=t.length-1;if(e>0){n.textContent=E?E.emptyScript:"";for(let r=0;r<e;r++)n.append(t[r],M()),X.nextNode(),s.push({type:2,index:++i});n.append(t[e],M())}}}else if(8===n.nodeType)if(n.data===P)s.push({type:2,index:i});else{let t=-1;for(;-1!==(t=n.data.indexOf(T,t+1));)s.push({type:7,index:i}),t+=T.length-1}i++}}static createElement(t,e){const r=R.createElement("template");return r.innerHTML=t,r}}function Z(t,e,r=t,n){if(e===G)return e;let i=void 0!==n?r._$Co?.[n]:r._$Cl;const a=L(e)?void 0:e._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),void 0===a?i=void 0:(i=new a(t),i._$AT(t,r,n)),void 0!==n?(r._$Co??=[])[n]=i:r._$Cl=i),void 0!==i&&(e=Z(t,i._$AS(t,e.values),i,n)),e}class tt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,n=(t?.creationScope??R).importNode(e,!0);X.currentNode=n;let i=X.nextNode(),a=0,o=0,s=r[0];for(;void 0!==s;){if(a===s.index){let e;2===s.type?e=new et(i,i.nextSibling,this,t):1===s.type?e=new s.ctor(i,s.name,s.strings,this,t):6===s.type&&(e=new ot(i,this,t)),this._$AV.push(e),s=r[++o]}a!==s?.index&&(i=X.nextNode(),a++)}return X.currentNode=R,n}p(t){let e=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class et{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,n){this.type=2,this._$AH=H,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Z(this,t,e),L(t)?t===H||null==t||""===t?(this._$AH!==H&&this._$AR(),this._$AH=H):t!==this._$AH&&t!==G&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>O(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==H&&L(this._$AH)?this._$AA.nextSibling.data=t:this.T(R.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:r}=t,n="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=Q.createElement(Y(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new tt(n,this),r=t.u(this.options);t.p(e),this.T(r),this._$AH=t}}_$AC(t){let e=q.get(t.strings);return void 0===e&&q.set(t.strings,e=new Q(t)),e}k(t){O(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,n=0;for(const i of t)n===e.length?e.push(r=new et(this.O(M()),this.O(M()),this,this.options)):r=e[n],r._$AI(i),n++;n<e.length&&(this._$AR(r&&r._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=k(t).nextSibling;k(t).remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class rt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,n,i){this.type=1,this._$AH=H,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=i,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=H}_$AI(t,e=this,r,n){const i=this.strings;let a=!1;if(void 0===i)t=Z(this,t,e,0),a=!L(t)||t!==this._$AH&&t!==G,a&&(this._$AH=t);else{const n=t;let o,s;for(t=i[0],o=0;o<i.length-1;o++)s=Z(this,n[r+o],e,o),s===G&&(s=this._$AH[o]),a||=!L(s)||s!==this._$AH[o],s===H?t=H:t!==H&&(t+=(s??"")+i[o+1]),this._$AH[o]=s}a&&!n&&this.j(t)}j(t){t===H?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class nt extends rt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===H?void 0:t}}class it extends rt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==H)}}class at extends rt{constructor(t,e,r,n,i){super(t,e,r,n,i),this.type=5}_$AI(t,e=this){if((t=Z(this,t,e,0)??H)===G)return;const r=this._$AH,n=t===H&&r!==H||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,i=t!==H&&(r===H||n);n&&this.element.removeEventListener(this.name,this,r),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class ot{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){Z(this,t)}}const st=S.litHtmlPolyfillSupport;st?.(Q,et),(S.litHtmlVersions??=[]).push("3.3.2");const lt=globalThis;class ct extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,r)=>{const n=r?.renderBefore??e;let i=n._$litPart$;if(void 0===i){const t=r?.renderBefore??null;n._$litPart$=i=new et(e.insertBefore(M(),t),t,void 0,r??{})}return i._$AI(t),i})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return G}}ct._$litElement$=!0,ct.finalized=!0,lt.litElementHydrateSupport?.({LitElement:ct});const ut=lt.litElementPolyfillSupport;function ht(t,e,r,n){var i,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(a<3?i(o):a>3?i(e,r,o):i(e,r))||o);return a>3&&o&&Object.defineProperty(e,r,o),o}ut?.({LitElement:ct}),(lt.litElementVersions??=[]).push("4.2.2");let dt=null,ft=!1;var pt=function(t){return t.JSON="json",t.LOT="lot",t.JPG="jpg",t.PNG="png",t.SVG="svg",t}({});const mt=t=>new Promise(e=>setTimeout(e,t));let bt="idle";class vt extends ct{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])}get dpr(){return!1===this.config?.enableDevicePixelRatio?1:1+.75*(window.devicePixelRatio-1)}TVG=null;canvas;config;_imageData;_beginTime=Date.now();_counter=1;_timer;_observer;_observable=!1;_assetResolverCallback;_assetResolverData;async _init(){if(ft)for(;!dt;)await mt(100);if(dt||(ft=!0,dt=await async function(e={}){var r,n=e,i=!!globalThis.window,a=!!globalThis.WorkerGlobalScope,o=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;if(o){const{createRequire:e}=await Promise.resolve().then(function(){return yt});var s=e("undefined"==typeof document?require("url").pathToFileURL(__filename).href:t&&"SCRIPT"===t.tagName.toUpperCase()&&t.src||new URL("lottie-player.cjs.js",document.baseURI).href)}var l,c,u=(t,e)=>{throw e},h="undefined"==typeof document?require("url").pathToFileURL(__filename).href:t&&"SCRIPT"===t.tagName.toUpperCase()&&t.src||new URL("lottie-player.cjs.js",document.baseURI).href,d="";if(o){var f=s("fs");h.startsWith("file:")&&(d=s("path").dirname(s("url").fileURLToPath(h))+"/"),c=t=>(t=U(t)?new URL(t):t,f.readFileSync(t)),l=async t=>(t=U(t)?new URL(t):t,f.readFileSync(t,void 0)),process.argv.slice(2),u=(t,e)=>{throw process.exitCode=t,e}}else if(i||a){try{d=new URL(".",h).href}catch{}a&&(c=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),l=async t=>{if(U(t))return new Promise((e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r(n.status)},n.onerror=r,n.send(null)});var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw Error(e.status+" : "+e.url)}}var p,m,b,v,w,g,y,$,_,A,x,S,k,E,I,C=function(){}.bind(),T=function(){}.bind(),P=!1,U=t=>t.startsWith("file://"),R=!1;function M(){var t=ln.buffer;w=new Int8Array(t),y=new Int16Array(t),g=new Uint8Array(t),$=new Uint16Array(t),_=new Int32Array(t),A=new Uint32Array(t),x=new Float32Array(t),S=new Float64Array(t),k=new BigInt64Array(t),E=new BigUint64Array(t)}function L(t){throw n.onAbort?.(t),T(t="Aborted("+t+")"),P=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),v?.(t),t}class O{name="ExitStatus";constructor(t){this.message=`Program terminated with exit(${t})`,this.status=t}}var N=t=>{for(;0<t.length;)t.shift()(n)},F=[],j=[],V=()=>{var t=n.preRun.shift();j.push(t)},D=!0,B=new TextDecoder,z=(t,e,r,n)=>{if(r=e+r,n)return r;for(;t[e]&&!(e>=r);)++e;return e},J=(t,e,r)=>t?B.decode(g.subarray(t,z(g,t,e,r))):"",W=t=>{for(var e="";;){var r=g[t++];if(!r)return e;e+=String.fromCharCode(r)}},G={},H={},q={},X=class extends Error{constructor(t){super(t),this.name="BindingError"}},Y=t=>{throw new X(t)};function K(t,e,r={}){return function(t,e,r={}){var n=e.name;if(!t)throw new X(`type "${n}" must have a positive integer typeid pointer`);if(H.hasOwnProperty(t)){if(r.Gc)return;throw new X(`Cannot register type '${n}' twice`)}H[t]=e,delete q[t],G.hasOwnProperty(t)&&(e=G[t],delete G[t],e.forEach(t=>t()))}(t,e,r)}var Q=(t,e,r)=>{switch(e){case 1:return r?t=>w[t]:t=>g[t];case 2:return r?t=>y[t>>1]:t=>$[t>>1];case 4:return r?t=>_[t>>2]:t=>A[t>>2];case 8:return r?t=>k[t>>3]:t=>E[t>>3];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Z=t=>{throw new X(t.Ja.Xa.Ua.name+" instance already deleted")},tt=!1,et=()=>{},rt=t=>globalThis.FinalizationRegistry?(tt=new FinalizationRegistry(t=>{--(t=t.Ja).count.value,0===t.count.value&&(t.ib?t.mb.zb(t.ib):t.Xa.Ua.zb(t.Va))}),rt=t=>{var e=t.Ja;return e.ib&&tt.register(t,{Ja:e},t),t},et=t=>{tt.unregister(t)},rt(t)):(rt=t=>t,t);function nt(){}var it=(t,e)=>Object.defineProperty(e,"name",{value:t}),at={},ot=(t,e,r)=>{if(void 0===t[e].hb){var n=t[e];t[e]=function(...n){if(!t[e].hb.hasOwnProperty(n.length))throw new X(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${t[e].hb})!`);return t[e].hb[n.length].apply(this,n)},t[e].hb=[],t[e].hb[n.Hb]=n}},st=(t,e,r)=>{if(n.hasOwnProperty(t)){if(void 0===r||void 0!==n[t].hb&&void 0!==n[t].hb[r])throw new X(`Cannot register public name '${t}' twice`);if(ot(n,t,t),n[t].hb.hasOwnProperty(r))throw new X(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`);n[t].hb[r]=e}else n[t]=e,n[t].Hb=r};function lt(t,e,r,n,i,a,o,s){this.name=t,this.constructor=e,this.Eb=r,this.zb=n,this.kb=i,this.Cc=a,this.Mb=o,this.zc=s,this.Mc=[]}var ct=(t,e,r)=>{for(;e!==r;){if(!e.Mb)throw new X(`Expected null or instance of ${r.name}, got an instance of ${e.name}`);t=e.Mb(t),e=e.kb}return t},ut=t=>{if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t};function ht(t,e){if(null===e){if(this.Wb)throw new X(`null is not a valid ${this.name}`);return 0}if(!e.Ja)throw new X(`Cannot pass "${ut(e)}" as a ${this.name}`);if(!e.Ja.Va)throw new X(`Cannot pass deleted object as a pointer of type ${this.name}`);return ct(e.Ja.Va,e.Ja.Xa.Ua,this.Ua)}function dt(t,e){if(null===e){if(this.Wb)throw new X(`null is not a valid ${this.name}`);if(this.Pb){var r=this.Nc();return null!==t&&t.push(this.zb,r),r}return 0}if(!e||!e.Ja)throw new X(`Cannot pass "${ut(e)}" as a ${this.name}`);if(!e.Ja.Va)throw new X(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Ob&&e.Ja.Xa.Ob)throw new X(`Cannot convert argument of type ${e.Ja.mb?e.Ja.mb.name:e.Ja.Xa.name} to parameter type ${this.name}`);if(r=ct(e.Ja.Va,e.Ja.Xa.Ua,this.Ua),this.Pb){if(void 0===e.Ja.ib)throw new X("Passing raw pointer to smart pointer is illegal");switch(this.Pc){case 0:if(e.Ja.mb!==this)throw new X(`Cannot convert argument of type ${e.Ja.mb?e.Ja.mb.name:e.Ja.Xa.name} to parameter type ${this.name}`);r=e.Ja.ib;break;case 1:r=e.Ja.ib;break;case 2:if(e.Ja.mb===this)r=e.Ja.ib;else{var n=e.clone();r=this.Oc(r,Ot(()=>n.delete())),null!==t&&t.push(this.zb,r)}break;default:throw new X("Unsupporting sharing policy")}}return r}function ft(t,e){if(null===e){if(this.Wb)throw new X(`null is not a valid ${this.name}`);return 0}if(!e.Ja)throw new X(`Cannot pass "${ut(e)}" as a ${this.name}`);if(!e.Ja.Va)throw new X(`Cannot pass deleted object as a pointer of type ${this.name}`);if(e.Ja.Xa.Ob)throw new X(`Cannot convert argument of type ${e.Ja.Xa.name} to parameter type ${this.name}`);return ct(e.Ja.Va,e.Ja.Xa.Ua,this.Ua)}function pt(t){return this.jb(A[t>>2])}var mt=(t,e,r)=>e===r?t:void 0===r.kb||null===(t=mt(t,e,r.kb))?null:r.zc(t),bt={},vt=class extends Error{constructor(t){super(t),this.name="InternalError"}},wt=(t,e)=>{if(!e.Xa||!e.Va)throw new vt("makeClassHandle requires ptr and ptrType");if(!!e.mb!=!!e.ib)throw new vt("Both smartPtrType and smartPtr must be specified");return e.count={value:1},rt(Object.create(t,{Ja:{value:e,writable:!0}}))};function gt(t,e,r,n,i,a,o,s,l,c,u){this.name=t,this.Ua=e,this.Wb=r,this.Ob=n,this.Pb=i,this.Lc=a,this.Pc=o,this.pc=s,this.Nc=l,this.Oc=c,this.zb=u,i||void 0!==e.kb?this.nb=dt:(this.nb=n?ht:ft,this.ob=null)}var $t=(t,e,r)=>{if(!n.hasOwnProperty(t))throw new vt("Replacing nonexistent public symbol");void 0!==n[t].hb&&void 0!==r?n[t].hb[r]=e:(n[t]=e,n[t].Hb=r)},_t=(t,e)=>{t=W(t);var r=cn.get(e);if("function"!=typeof r)throw new X(`unknown function pointer with signature ${t}: ${e}`);return r};class At extends Error{}var xt=t=>{t=Vr(t);var e=W(t);return Fr(t),e},St=(t,e)=>{var r=[],n={};throw e.forEach(function t(e){n[e]||H[e]||(q[e]?q[e].forEach(t):(r.push(e),n[e]=!0))}),new At(`${t}: `+r.map(xt).join([", "]))},kt=(t,e,r)=>{function n(e){if((e=r(e)).length!==t.length)throw new vt("Mismatched type converter count");for(var n=0;n<t.length;++n)K(t[n],e[n])}t.forEach(t=>q[t]=e);var i=Array(e.length),a=[],o=0;for(let[t,r]of e.entries())H.hasOwnProperty(r)?i[t]=H[r]:(a.push(r),G.hasOwnProperty(r)||(G[r]=[]),G[r].push(()=>{i[t]=H[r],++o===a.length&&n(i)}));0===a.length&&n(i)},Et=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(A[e+4*n>>2]);return r},It=t=>{for(;t.length;){var e=t.pop();t.pop()(e)}};function Ct(t){for(var e=1;e<t.length;++e)if(null!==t[e]&&void 0===t[e].ob)return!0;return!1}function Tt(t,e,r,n,i,a){var o=e.length;if(2>o)throw new X("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==e[1]&&null!==r,l=Ct(e);r=!e[0].nc;var c=e[0],u=e[1];for(n=[t,Y,n,i,It,c.jb.bind(c),u?.nb.bind(u)],i=2;i<o;++i)n.push((c=e[i]).nb.bind(c));if(!l)for(i=s?1:2;i<e.length;++i)null!==e[i].ob&&n.push(e[i].ob);for(l=Ct(e),i=e.length-2,u=[],c=["fn"],s&&c.push("thisWired"),o=0;o<i;++o)u.push(`arg${o}`),c.push(`arg${o}Wired`);u=u.join(","),c=c.join(","),u=`return function (${u}) {\n`,l&&(u+="var destructors = [];\n");var h=l?"destructors":"null",d="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(s&&(u+=`var thisWired = toClassParamWire(${h}, this);\n`),o=0;o<i;++o){var f=`toArg${o}Wire`;u+=`var arg${o}Wired = ${f}(${h}, arg${o});\n`,d.push(f)}if(u+=(r||a?"var rv = ":"")+`invoker(${c});\n`,l)u+="runDestructors(destructors);\n";else for(o=s?1:2;o<e.length;++o)a=1===o?"thisWired":"arg"+(o-2)+"Wired",null!==e[o].ob&&(u+=`${a}_dtor(${a});\n`,d.push(`${a}_dtor`));return r&&(u+="var ret = fromRetWire(rv);\nreturn ret;\n"),e=new Function(d,u+"}\n")(...n),it(t,e)}var Pt=t=>{const e=(t=t.trim()).indexOf("(");return-1===e?t:t.slice(0,e)},Ut=[],Rt=[0,1,,1,null,1,!0,1,!1,1],Mt=t=>{9<t&&0===--Rt[t+1]&&(Rt[t]=void 0,Ut.push(t))},Lt=t=>{if(!t)throw new X(`Cannot use deleted val. handle = ${t}`);return Rt[t]},Ot=t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const e=Ut.pop()||Rt.length;return Rt[e]=t,Rt[e+1]=1,e}},Nt={name:"emscripten::val",jb:t=>{var e=Lt(t);return Mt(t),e},nb:(t,e)=>Ot(e),xb:pt,ob:null},Ft=(t,e)=>{switch(e){case 4:return function(t){return this.jb(x[t>>2])};case 8:return function(t){return this.jb(S[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},jt=(t,e,r,n)=>{if(!(0<n))return 0;var i=r;n=r+n-1;for(var a=0;a<t.length;++a){var o=t.codePointAt(a);if(127>=o){if(r>=n)break;e[r++]=o}else if(2047>=o){if(r+1>=n)break;e[r++]=192|o>>6,e[r++]=128|63&o}else if(65535>=o){if(r+2>=n)break;e[r++]=224|o>>12,e[r++]=128|o>>6&63,e[r++]=128|63&o}else{if(r+3>=n)break;e[r++]=240|o>>18,e[r++]=128|o>>12&63,e[r++]=128|o>>6&63,e[r++]=128|63&o,a++}}return e[r]=0,r-i},Vt=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);127>=n?e++:2047>=n?e+=2:55296<=n&&57343>=n?(e+=4,++r):e+=3}return e},Dt=new TextDecoder("utf-16le"),Bt=(t,e,r)=>Dt.decode($.subarray(t>>=1,z($,t,e/2,r))),zt=(t,e,r)=>{if(r??=2147483647,2>r)return 0;var n=e;r=(r-=2)<2*t.length?r/2:t.length;for(var i=0;i<r;++i)y[e>>1]=t.charCodeAt(i),e+=2;return y[e>>1]=0,e-n},Jt=t=>2*t.length,Wt=(t,e,r)=>{var n="";t>>=2;for(var i=0;!(i>=e/4);i++){var a=A[t+i];if(!a&&!r)break;n+=String.fromCodePoint(a)}return n},Gt=(t,e,r)=>{if(r??=2147483647,4>r)return 0;var n=e;r=n+r-4;for(var i=0;i<t.length;++i){var a=t.codePointAt(i);if(65535<a&&i++,_[e>>2]=a,(e+=4)+4>r)break}return _[e>>2]=0,e-n},Ht=t=>{for(var e=0,r=0;r<t.length;++r)65535<t.codePointAt(r)&&r++,e+=4;return e},qt=0,Xt=[],Yt=(t,e,r)=>{var n=[];return t=t(n,r),n.length&&(A[e>>2]=Ot(n)),t},Kt={},Qt=t=>{var e=Kt[t];return void 0===e?W(t):e},Zt={},te=t=>{m=t,D||0<qt||(n.onExit?.(t),P=!0),u(t,new O(t))},ee=t=>{if(!P)try{if(t(),!(D||0<qt))try{m=t=m,te(t)}catch(t){t instanceof O||"unwind"==t||u(1,t)}}catch(t){t instanceof O||"unwind"==t||u(1,t)}},re=t=>{var e=Vt(t)+1,r=on(e);return jt(t,g,r,e),r},ne=[],ie=[],ae=t=>{if(t)return ne[t>>>0]},oe=t=>J(A[t>>2],A[t+4>>2]),se=t=>{var e=A[t>>2];return t=A[t+4>>2],e?J(e,t):0===t?"":void 0},le=t=>({width:A[t>>2],height:A[t+4>>2],depthOrArrayLayers:A[t+8>>2]}),ce=t=>{var e=t+8;return{texture:ae(A[t>>2]),mipLevel:A[t+4>>2],origin:{x:A[e>>2],y:A[e+4>>2],z:A[e+8>>2]},aspect:Re[A[t+20>>2]]}},ue=(t,e)=>{if(t){for(var r={},n=0;n<t;++n){var i=e+24*n;r[oe(i+4)]=S[i+16>>3]}return r}},he=t=>t?ae(t):"auto",de=[,"clamp-to-edge","repeat","mirror-repeat"],fe=[,"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"],pe=[,"add","subtract","reverse-subtract","min","max"],me=["binding-not-used",,"uniform","storage","read-only-storage"],be=[,"never","less","equal","less-equal","greater","not-equal","greater-equal","always"],ve=[,"opaque","premultiplied","unpremultiplied","inherit"],we=[,"none","front","back"],ge=[,"compatibility","core"],ye={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"},$e=[,"nearest","linear"],_e=[,"ccw","cw"],Ae=[,"uint16","uint32"],xe=[,"load","clear"],Se=[,"nearest","linear"],ke=[,"low-power","high-performance"],Ee=[,"srgb","display-p3"],Ie=[,"point-list","line-list","line-strip","triangle-list","triangle-strip"],Ce=["binding-not-used",,"filtering","non-filtering","comparison"],Te=[,"keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],Pe=["binding-not-used",,"write-only","read-only","read-write"],Ue=[,"store","discard"],Re=[,"all","stencil-only","depth-only"],Me=[,"1d","2d","3d"],Le=[,"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"],Oe=["binding-not-used",,"float","unfilterable-float","depth","sint","uint"],Ne=[,"1d","2d","2d-array","cube","cube-array","3d"],Fe=[,"standard","extended"],je=[,"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"],Ve=[,"vertex","instance"],De={undefined:1,unknown:1,destroyed:2},Be=t=>-9007199254740992>t||9007199254740992<t?NaN:Number(t),ze=(t,e)=>{for(var r=0,n=t.length-1;0<=n;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},Je=t=>{var e="/"===t.charAt(0),r="/"===t.slice(-1);return(t=ze(t.split("/").filter(t=>!!t),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},We=t=>{var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);return t=e[0],e=e[1],t||e?(e&&=e.slice(0,-1),t+e):"."},Ge=t=>t&&t.match(/([^\/]+|\/)\/*$/)[1],He=t=>{(He=(()=>{if(o){var t=s("crypto");return e=>t.randomFillSync(e)}return t=>crypto.getRandomValues(t)})())(t)},qe=(...t)=>{for(var e="",r=!1,n=t.length-1;-1<=n&&!r;n--){if("string"!=typeof(r=0<=n?t[n]:Or.cwd()))throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,r="/"===r.charAt(0)}return e=ze(e.split("/").filter(t=>!!t),!r).join("/"),(r?"/":"")+e||"."},Xe=(t,e)=>{function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;0<=r&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=qe(t).slice(1),e=qe(e).slice(1),t=r(t.split("/")),e=r(e.split("/"));for(var n=Math.min(t.length,e.length),i=n,a=0;a<n;a++)if(t[a]!==e[a]){i=a;break}for(n=[],a=i;a<t.length;a++)n.push("..");return(n=n.concat(e.slice(i))).join("/")},Ye=t=>{var e=z(t,0);return B.decode(t.buffer?t.subarray(0,e):new Uint8Array(t.slice(0,e)))},Ke=[],Qe=t=>{var e=Array(Vt(t)+1);return t=jt(t,e,0,e.length),e.length=t,e},Ze=[];function tr(t,e){Ze[t]={input:[],output:[],Gb:e},fr(t,er)}var er={open(t){var e=Ze[t.node.rdev];if(!e)throw new Or.Ia(43);t.tty=e,t.seekable=!1},close(t){t.tty.Gb.fsync(t.tty)},fsync(t){t.tty.Gb.fsync(t.tty)},read(t,e,r,n){if(!t.tty||!t.tty.Gb.kc)throw new Or.Ia(60);for(var i=0,a=0;a<n;a++){try{var o=t.tty.Gb.kc(t.tty)}catch(t){throw new Or.Ia(29)}if(void 0===o&&0===i)throw new Or.Ia(6);if(null==o)break;i++,e[r+a]=o}return i&&(t.node.atime=Date.now()),i},write(t,e,r,n){if(!t.tty||!t.tty.Gb.$b)throw new Or.Ia(60);try{for(var i=0;i<n;i++)t.tty.Gb.$b(t.tty,e[r+i])}catch(t){throw new Or.Ia(29)}return n&&(t.node.mtime=t.node.ctime=Date.now()),i}},rr={kc(){t:{if(!Ke.length){var t=null;if(o){var e=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=f.readSync(n,e,0,256)}catch(t){if(!t.toString().includes("EOF"))throw t;r=0}0<r&&(t=e.slice(0,r).toString("utf-8"))}else globalThis.window?.prompt&&null!==(t=window.prompt("Input: "))&&(t+="\n");if(!t){t=null;break t}Ke=Qe(t)}t=Ke.shift()}return t},$b(t,e){null===e||10===e?(C(Ye(t.output)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){0<t.output?.length&&(C(Ye(t.output)),t.output=[])},ld:()=>({Xc:25856,Zc:5,Wc:191,Yc:35387,Vc:[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]}),md:()=>0,nd:()=>[24,80]},nr={$b(t,e){null===e||10===e?(T(Ye(t.output)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){0<t.output?.length&&(T(Ye(t.output)),t.output=[])}},ir={tb:null,Wa:()=>ir.createNode(null,"/",16895,0),createNode(t,e,r,n){if(24576==(61440&r)||Or.isFIFO(r))throw new Or.Ia(63);return ir.tb||(ir.tb={dir:{node:{qb:ir.La.qb,sb:ir.La.sb,lookup:ir.La.lookup,vb:ir.La.vb,rename:ir.La.rename,unlink:ir.La.unlink,rmdir:ir.La.rmdir,readdir:ir.La.readdir,symlink:ir.La.symlink},stream:{lb:ir.Ma.lb}},file:{node:{qb:ir.La.qb,sb:ir.La.sb},stream:{lb:ir.Ma.lb,read:ir.Ma.read,write:ir.Ma.write,Fb:ir.Ma.Fb,Kb:ir.Ma.Kb}},link:{node:{qb:ir.La.qb,sb:ir.La.sb,readlink:ir.La.readlink},stream:{}},ec:{node:{qb:ir.La.qb,sb:ir.La.sb},stream:Or.xc}}),pr((r=Or.createNode(t,e,r,n)).mode)?(r.La=ir.tb.dir.node,r.Ma=ir.tb.dir.stream,r.Na={}):Or.isFile(r.mode)?(r.La=ir.tb.file.node,r.Ma=ir.tb.file.stream,r.Ya=0,r.Na=null):40960==(61440&r.mode)?(r.La=ir.tb.link.node,r.Ma=ir.tb.link.stream):8192==(61440&r.mode)&&(r.La=ir.tb.ec.node,r.Ma=ir.tb.ec.stream),r.atime=r.mtime=r.ctime=Date.now(),t&&(t.Na[e]=r,t.atime=t.mtime=t.ctime=r.atime),r},kd:t=>t.Na?t.Na.subarray?t.Na.subarray(0,t.Ya):new Uint8Array(t.Na):new Uint8Array(0),La:{qb(t){var e={};return e.dev=8192==(61440&t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,e.size=pr(t.mode)?4096:Or.isFile(t.mode)?t.Ya:40960==(61440&t.mode)?t.link.length:0,e.atime=new Date(t.atime),e.mtime=new Date(t.mtime),e.ctime=new Date(t.ctime),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},sb(t,e){for(var r of["mode","atime","mtime","ctime"])null!=e[r]&&(t[r]=e[r]);void 0!==e.size&&t.Ya!=(e=e.size)&&(0==e?(t.Na=null,t.Ya=0):(r=t.Na,t.Na=new Uint8Array(e),r&&t.Na.set(r.subarray(0,Math.min(e,t.Ya))),t.Ya=e))},lookup(){throw ir.Tb||(ir.Tb=new Or.Ia(44),ir.Tb.stack="<generic error, no stack>"),ir.Tb},vb:(t,e,r,n)=>ir.createNode(t,e,r,n),rename(t,e,r){try{var n=mr(e,r)}catch(t){}if(n){if(pr(t.mode))for(var i in n.Na)throw new Or.Ia(55);br(n)}delete t.parent.Na[t.name],e.Na[r]=t,t.name=r,e.ctime=e.mtime=t.parent.ctime=t.parent.mtime=Date.now()},unlink(t,e){delete t.Na[e],t.ctime=t.mtime=Date.now()},rmdir(t,e){var r,n=mr(t,e);for(r in n.Na)throw new Or.Ia(55);delete t.Na[e],t.ctime=t.mtime=Date.now()},readdir:t=>[".","..",...Object.keys(t.Na)],symlink:(t,e,r)=>((t=ir.createNode(t,e,41471,0)).link=r,t),readlink(t){if(40960!=(61440&t.mode))throw new Or.Ia(28);return t.link}},Ma:{read(t,e,r,n,i){var a=t.node.Na;if(i>=t.node.Ya)return 0;if(8<(t=Math.min(t.node.Ya-i,n))&&a.subarray)e.set(a.subarray(i,i+t),r);else for(n=0;n<t;n++)e[r+n]=a[i+n];return t},write(t,e,r,n,i,a){if(e.buffer===w.buffer&&(a=!1),!n)return 0;if((t=t.node).mtime=t.ctime=Date.now(),e.subarray&&(!t.Na||t.Na.subarray)){if(a)return t.Na=e.subarray(r,r+n),t.Ya=n;if(0===t.Ya&&0===i)return t.Na=e.slice(r,r+n),t.Ya=n;if(i+n<=t.Ya)return t.Na.set(e.subarray(r,r+n),i),n}var o=t.Na?t.Na.length:0;if(o>=(a=i+n)||(a=Math.max(a,o*(1048576>o?2:1.125)>>>0),0!=o&&(a=Math.max(a,256)),o=t.Na,t.Na=new Uint8Array(a),0<t.Ya&&t.Na.set(o.subarray(0,t.Ya),0)),t.Na.subarray&&e.subarray)t.Na.set(e.subarray(r,r+n),i);else for(a=0;a<n;a++)t.Na[i+a]=e[r+a];return t.Ya=Math.max(t.Ya,i+n),n},lb(t,e,r){if(1===r?e+=t.position:2===r&&Or.isFile(t.node.mode)&&(e+=t.node.Ya),0>e)throw new Or.Ia(28);return e},Fb(t,e,r,n,i){if(!Or.isFile(t.node.mode))throw new Or.Ia(43);if(t=t.node.Na,2&i||!t||t.buffer!==w.buffer){if(n=!0,L(),!(i=void 0))throw new Or.Ia(48);t&&((0<r||r+e<t.length)&&(t=t.subarray?t.subarray(r,r+e):Array.prototype.slice.call(t,r,r+e)),w.set(t,i))}else n=!1,i=t.byteOffset;return{Va:i,Rc:n}},Kb:(t,e,r,n)=>(ir.Ma.write(t,e,0,n,r,!1),0)}},ar=(t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r},or=0,sr=null,lr=()=>{if(or--,n.monitorRunDependencies?.(or),0==or&&sr){var t=sr;sr=null,t()}},cr=()=>{or++,n.monitorRunDependencies?.(or)},ur=[],hr=async(t,e,r,n,i,a,o,s)=>{var c=e?qe(Je(t+"/"+e)):t;cr();try{var u=r;"string"==typeof r&&(u=await(async t=>(t=await l(t),new Uint8Array(t)))(r)),u=await(async(t,e)=>{for(var r of("undefined"!=typeof Browser&&dr(),ur))if(r.canHandle(e))return r.handle(t,e);return t})(u,c),s?.(),a||vr(t,e,u,n,i,o)}finally{lr()}};function dr(){var t,e,r;Or.Vb=!0,t??=n.stdin,e??=n.stdout,r??=n.stderr,t?Or.yb("/dev","stdin",t):Or.symlink("/dev/tty","/dev/stdin"),e?Or.yb("/dev","stdout",null,e):Or.symlink("/dev/tty","/dev/stdout"),r?Or.yb("/dev","stderr",null,r):Or.symlink("/dev/tty1","/dev/stderr"),Or.open("/dev/stdin",0),Or.open("/dev/stdout",1),Or.open("/dev/stderr",1)}function fr(t,e){Or.ic[t]={Ma:e}}function pr(t){return 16384==(61440&t)}function mr(t,e){var r=pr(t.mode)?(r=Ar(t,"x"))?r:t.La.lookup?0:2:54;if(r)throw new Or.Ia(r);for(r=Or.wb[yr(t.id,e)];r;r=r.Db)if(r.parent.id===t.id&&r.name===e)return r;return Or.lookup(t,e)}function br(t){var e=yr(t.parent.id,t.name);if(Or.wb[e]===t)Or.wb[e]=t.Db;else for(e=Or.wb[e];e;){if(e.Db===t){e.Db=t.Db;break}e=e.Db}}function vr(t,e,r,n,i,a){var o=e;if(t&&(t="string"==typeof t?t:gr(t),o=e?Je(t+"/"+e):t),t=ar(n,i),o=Or.create(o,t),r){if("string"==typeof r){for(e=Array(r.length),n=0,i=r.length;n<i;++n)e[n]=r.charCodeAt(n);r=e}Or.chmod(o,146|t),e=Or.open(o,577),Or.write(e,r,0,r.length,0,a),Or.close(e),Or.chmod(o,t)}}function wr(t,e={}){if(!t)throw new Or.Ia(44);e.Nb??(e.Nb=!0),"/"===t.charAt(0)||(t=Or.cwd()+"/"+t);var r=0;t:for(;40>r;r++){t=t.split("/").filter(t=>!!t);for(var n=Or.root,i="/",a=0;a<t.length;a++){var o=a===t.length-1;if(o&&e.parent)break;if("."!==t[a])if(".."===t[a]){if(i=We(i),Or.Xb(n)){t=i+"/"+t.slice(a+1).join("/"),r--;continue t}n=n.parent}else{i=Je(i+"/"+t[a]);try{n=mr(n,t[a])}catch(t){if(44===t?.Bb&&o&&e.Jc)return{path:i};throw t}if(!n.rb||o&&!e.Nb||(n=n.rb.root),40960==(61440&n.mode)&&(!o||e.pb)){if(!n.La.readlink)throw new Or.Ia(52);"/"===(n=n.La.readlink(n)).charAt(0)||(n=We(i)+"/"+n),t=n+"/"+t.slice(a+1).join("/");continue t}}}return{path:i,node:n}}throw new Or.Ia(32)}function gr(t){for(var e;;){if(Or.Xb(t))return t=t.Wa.oc,e?"/"!==t[t.length-1]?`${t}/${e}`:t+e:t;e=e?`${t.name}/${e}`:t.name,t=t.parent}}function yr(t,e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%Or.wb.length}function $r(t){var e=yr(t.parent.id,t.name);t.Db=Or.wb[e],Or.wb[e]=t}function _r(t){var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e}function Ar(t,e){return Or.lc?0:!e.includes("r")||292&t.mode?e.includes("w")&&!(146&t.mode)||e.includes("x")&&!(73&t.mode)?2:0:2}function xr(t,e){if(!pr(t.mode))return 54;try{return mr(t,e),20}catch(t){}return Ar(t,"wx")}function Sr(t,e,r){try{var n=mr(t,e)}catch(t){return t.Bb}if(t=Ar(t,"wx"))return t;if(r){if(!pr(n.mode))return 54;if(Or.Xb(n)||gr(n)===Or.cwd())return 10}else if(pr(n.mode))return 31;return 0}function kr(t,e){if(!t)throw new Or.Ia(e);return t}function Er(t){if(!(t=Or.Fc(t)))throw new Or.Ia(8);return t}function Ir(t,e=-1){if(t=Object.assign(new Or.uc,t),-1==e)t:{for(e=0;e<=Or.vc;e++)if(!Or.streams[e])break t;throw new Or.Ia(33)}return t.fd=e,Or.streams[e]=t}function Cr(t,e,r){var n=t?.Ma.sb;t=n?t:e,n??=e.La.sb,kr(n,63),n(t,r)}function Tr(t){var e=[];for(t=[t];t.length;){var r=t.pop();e.push(r),t.push(...r.Jb)}return e}function Pr(t){var e={Uc:4096,gd:4096,blocks:1e6,Tc:5e5,Sc:5e5,files:Or.Zb,dd:Or.Zb-1,hd:42,flags:2,qd:255};return t.La.rc&&Object.assign(e,t.La.rc(t.Wa.Kc.root)),e}function Ur(t,e,r){return void 0===r&&(r=e,e=438),Or.vb(t,8192|e,r)}function Rr(t,e,r,n){Cr(t,e,{mode:4095&r|-4096&e.mode,ctime:Date.now(),jc:n})}function Mr(t,e,r){if(pr(e.mode))throw new Or.Ia(31);if(!Or.isFile(e.mode))throw new Or.Ia(28);var n=Ar(e,"w");if(n)throw new Or.Ia(n);Cr(t,e,{size:r,timestamp:Date.now()})}function Lr(t){if(!(t.Hc||t.Ic||t.link||t.Na))if(globalThis.XMLHttpRequest)L("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{t.Na=c(t.url)}catch(t){throw new Or.Ia(29)}}var Or={root:null,Jb:[],ic:{},streams:[],Zb:1,wb:null,fc:"/",Vb:!1,lc:!0,Bc:null,Qb:0,qc:{},Ia:class{name="ErrnoError";constructor(t){this.Bb=t}},uc:class{ub={};node=null;get object(){return this.node}set object(t){this.node=t}get flags(){return this.ub.flags}set flags(t){this.ub.flags=t}get position(){return this.ub.position}set position(t){this.ub.position=t}},tc:class{La={};Ma={};rb=null;constructor(t,e,r,n){t||=this,this.parent=t,this.Wa=t.Wa,this.id=Or.Zb++,this.name=e,this.mode=r,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return!(365&~this.mode)}set read(t){t?this.mode|=365:this.mode&=-366}get write(){return!(146&~this.mode)}set write(t){t?this.mode|=146:this.mode&=-147}get Ic(){return pr(this.mode)}get Hc(){return 8192==(61440&this.mode)}},createNode:(t,e,r,n)=>($r(t=new Or.tc(t,e,r,n)),t),Xb:t=>t===t.parent,isFile:t=>32768==(61440&t),isFIFO:t=>4096==(61440&t),isSocket:t=>!(49152&~t),vc:4096,Fc:t=>Or.streams[t],cd:(t,e=-1)=>(t=Ir(t,e),t.Ma?.bd?.(t),t),xc:{open(t){t.Ma=Or.Dc(t.node.rdev).Ma,t.Ma.open?.(t)},lb(){throw new Or.Ia(70)}},Yb:t=>t>>8,od:t=>255&t,Cb:(t,e)=>t<<8|e,Dc:t=>Or.ic[t],sc(t,e){function r(t){return Or.Qb--,e(t)}function n(t){if(t){if(!n.Ac)return n.Ac=!0,r(t)}else++o>=a.length&&r(null)}"function"==typeof t&&(e=t,t=!1),Or.Qb++,1<Or.Qb&&T(`warning: ${Or.Qb} FS.syncfs operations in flight at once, probably just doing extra work`);var i,a=Tr(Or.root.Wa),o=0;for(i of a)i.type.sc?i.type.sc(i,t,n):n(null)},Wa(t,e,r){var n="/"===r;if(n&&Or.root)throw new Or.Ia(10);if(!n&&r){var i=wr(r,{Nb:!1});if(r=i.path,(i=i.node).rb)throw new Or.Ia(10);if(!pr(i.mode))throw new Or.Ia(54)}return(t=t.Wa(e={type:t,Kc:e,oc:r,Jb:[]})).Wa=e,e.root=t,n?Or.root=t:i&&(i.rb=e,i.Wa&&i.Wa.Jb.push(e)),t},xd(t){if(!(t=wr(t,{Nb:!1})).node.rb)throw new Or.Ia(28);var e=(t=t.node).rb,r=Tr(e);for([,i]of Object.entries(Or.wb))for(;i;){var n=i.Db;r.includes(i.Wa)&&br(i);var i=n}t.rb=null,t.Wa.Jb.splice(t.Wa.Jb.indexOf(e),1)},lookup:(t,e)=>t.La.lookup(t,e),vb(t,e,r){var n=wr(t,{parent:!0}).node;if(!(t=Ge(t)))throw new Or.Ia(28);if("."===t||".."===t)throw new Or.Ia(20);var i=xr(n,t);if(i)throw new Or.Ia(i);if(!n.La.vb)throw new Or.Ia(63);return n.La.vb(n,t,e,r)},rc:t=>Pr(wr(t,{pb:!0}).node),td:t=>Pr(t.node),create:(t,e=438)=>Or.vb(t,4095&e|32768,0),mkdir:(t,e=511)=>Or.vb(t,1023&e|16384,0),pd(t,e){var r,n=t.split("/"),i="";for(r of n)if(r){(i||"/"===t.charAt(0))&&(i+="/"),i+=r;try{Or.mkdir(i,e)}catch(t){if(20!=t.Bb)throw t}}},symlink(t,e){if(!qe(t))throw new Or.Ia(44);var r=wr(e,{parent:!0}).node;if(!r)throw new Or.Ia(44);var n=xr(r,e=Ge(e));if(n)throw new Or.Ia(n);if(!r.La.symlink)throw new Or.Ia(63);return r.La.symlink(r,e,t)},rename(t,e){var r=We(t),n=We(e),i=Ge(t),a=Ge(e),o=wr(t,{parent:!0}),s=o.node;if(o=(o=wr(e,{parent:!0})).node,!s||!o)throw new Or.Ia(44);if(s.Wa!==o.Wa)throw new Or.Ia(75);var l=mr(s,i);if("."!==(t=Xe(t,n)).charAt(0))throw new Or.Ia(28);if("."!==(t=Xe(e,r)).charAt(0))throw new Or.Ia(55);try{var c=mr(o,a)}catch(t){}if(l!==c){if(i=Sr(s,i,e=pr(l.mode)))throw new Or.Ia(i);if(i=c?Sr(o,a,e):xr(o,a))throw new Or.Ia(i);if(!s.La.rename)throw new Or.Ia(63);if(l.rb||c&&c.rb)throw new Or.Ia(10);if(o!==s&&(i=Ar(s,"w")))throw new Or.Ia(i);br(l);try{s.La.rename(l,o,a),l.parent=o}catch(t){throw t}finally{$r(l)}}},rmdir(t){var e=wr(t,{parent:!0}).node,r=mr(e,t=Ge(t)),n=Sr(e,t,!0);if(n)throw new Or.Ia(n);if(!e.La.rmdir)throw new Or.Ia(63);if(r.rb)throw new Or.Ia(10);e.La.rmdir(e,t),br(r)},readdir:t=>kr((t=wr(t,{pb:!0}).node).La.readdir,54)(t),unlink(t){var e=wr(t,{parent:!0}).node;if(!e)throw new Or.Ia(44);var r=mr(e,t=Ge(t)),n=Sr(e,t,!1);if(n)throw new Or.Ia(n);if(!e.La.unlink)throw new Or.Ia(63);if(r.rb)throw new Or.Ia(10);e.La.unlink(e,t),br(r)},readlink(t){if(!(t=wr(t).node))throw new Or.Ia(44);if(!t.La.readlink)throw new Or.Ia(28);return t.La.readlink(t)},stat:(t,e)=>kr((t=wr(t,{pb:!e}).node).La.qb,63)(t),fstat(t){var e=Er(t);t=e.node;var r=e.Ma.qb;return e=r?e:t,r??=t.La.qb,kr(r,63),r(e)},lstat:t=>Or.stat(t,!0),chmod(t,e,r){Rr(null,t="string"==typeof t?wr(t,{pb:!r}).node:t,e,r)},lchmod(t,e){Or.chmod(t,e,!0)},fchmod(t,e){Rr(t=Er(t),t.node,e,!1)},chown(t,e,r,n){Cr(null,t="string"==typeof t?wr(t,{pb:!n}).node:t,{timestamp:Date.now(),jc:n})},lchown(t,e,r){Or.chown(t,e,r,!0)},fchown(t){Cr(t=Er(t),t.node,{timestamp:Date.now(),jc:!1})},truncate(t,e){if(0>e)throw new Or.Ia(28);Mr(null,t="string"==typeof t?wr(t,{pb:!0}).node:t,e)},jd(t,e){if(t=Er(t),0>e||!(2097155&t.flags))throw new Or.Ia(28);Mr(t,t.node,e)},yd(t,e,r){kr((t=wr(t,{pb:!0}).node).La.sb,63)(t,{atime:e,mtime:r})},open(t,e,r=438){if(""===t)throw new Or.Ia(44);if("string"==typeof e){var i={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===i)throw Error(`Unknown file open mode: ${e}`);e=i}if(r=64&e?4095&r|32768:0,"object"==typeof t)i=t;else{var a=t.endsWith("/");i=(t=wr(t,{pb:!(131072&e),Jc:!0})).node,t=t.path}var o=!1;if(64&e)if(i){if(128&e)throw new Or.Ia(20)}else{if(a)throw new Or.Ia(31);i=Or.vb(t,511|r,0),o=!0}if(!i)throw new Or.Ia(44);if(8192==(61440&i.mode)&&(e&=-513),65536&e&&!pr(i.mode))throw new Or.Ia(54);if(!o&&(a=i?40960==(61440&i.mode)?32:pr(i.mode)&&("r"!==_r(e)||576&e)?31:Ar(i,_r(e)):44))throw new Or.Ia(a);return 512&e&&!o&&Or.truncate(i,0),e&=-131713,(a=Ir({node:i,path:gr(i),flags:e,seekable:!0,position:0,Ma:i.Ma,Qc:[],error:!1})).Ma.open&&a.Ma.open(a),o&&Or.chmod(i,511&r),!n.logReadFiles||1&e||t in Or.qc||(Or.qc[t]=1),a},close(t){if(null===t.fd)throw new Or.Ia(8);t.Ub&&(t.Ub=null);try{t.Ma.close&&t.Ma.close(t)}catch(t){throw t}finally{Or.streams[t.fd]=null}t.fd=null},lb(t,e,r){if(null===t.fd)throw new Or.Ia(8);if(!t.seekable||!t.Ma.lb)throw new Or.Ia(70);if(0!=r&&1!=r&&2!=r)throw new Or.Ia(28);return t.position=t.Ma.lb(t,e,r),t.Qc=[],t.position},read(t,e,r,n,i){if(0>n||0>i)throw new Or.Ia(28);if(null===t.fd)throw new Or.Ia(8);if(1==(2097155&t.flags))throw new Or.Ia(8);if(pr(t.node.mode))throw new Or.Ia(31);if(!t.Ma.read)throw new Or.Ia(28);var a=void 0!==i;if(a){if(!t.seekable)throw new Or.Ia(70)}else i=t.position;return e=t.Ma.read(t,e,r,n,i),a||(t.position+=e),e},write(t,e,r,n,i,a){if(0>n||0>i)throw new Or.Ia(28);if(null===t.fd)throw new Or.Ia(8);if(!(2097155&t.flags))throw new Or.Ia(8);if(pr(t.node.mode))throw new Or.Ia(31);if(!t.Ma.write)throw new Or.Ia(28);t.seekable&&1024&t.flags&&Or.lb(t,0,2);var o=void 0!==i;if(o){if(!t.seekable)throw new Or.Ia(70)}else i=t.position;return e=t.Ma.write(t,e,r,n,i,a),o||(t.position+=e),e},Fb(t,e,r,n,i){if(2&n&&!(2&i)&&2!=(2097155&t.flags))throw new Or.Ia(2);if(1==(2097155&t.flags))throw new Or.Ia(2);if(!t.Ma.Fb)throw new Or.Ia(43);if(!e)throw new Or.Ia(28);return t.Ma.Fb(t,e,r,n,i)},Kb:(t,e,r,n,i)=>t.Ma.Kb?t.Ma.Kb(t,e,r,n,i):0,mc(t,e,r){if(!t.Ma.mc)throw new Or.Ia(59);return t.Ma.mc(t,e,r)},readFile(t,e={}){e.flags=e.flags||0,e.encoding=e.encoding||"binary"