@thorvg/lottie-player 1.0.0-pre28 → 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.
Files changed (53) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +88 -13
  3. package/dist/gl/lottie-player.cjs.js +2 -2
  4. package/dist/gl/lottie-player.cjs.js.map +1 -1
  5. package/dist/gl/lottie-player.esm.js +2 -2
  6. package/dist/gl/lottie-player.esm.js.map +1 -1
  7. package/dist/gl/lottie-player.js +2 -2
  8. package/dist/gl/lottie-player.js.map +1 -1
  9. package/dist/gl/thorvg.wasm +0 -0
  10. package/dist/gl-lite/lottie-player.cjs.js +2 -2
  11. package/dist/gl-lite/lottie-player.cjs.js.map +1 -1
  12. package/dist/gl-lite/lottie-player.esm.js +2 -2
  13. package/dist/gl-lite/lottie-player.esm.js.map +1 -1
  14. package/dist/gl-lite/lottie-player.js +2 -2
  15. package/dist/gl-lite/lottie-player.js.map +1 -1
  16. package/dist/gl-lite/thorvg.wasm +0 -0
  17. package/dist/lottie-player.cjs.js +2 -2
  18. package/dist/lottie-player.cjs.js.map +1 -1
  19. package/dist/lottie-player.d.ts +41 -2
  20. package/dist/lottie-player.esm.js +2 -2
  21. package/dist/lottie-player.esm.js.map +1 -1
  22. package/dist/lottie-player.js +2 -2
  23. package/dist/lottie-player.js.map +1 -1
  24. package/dist/sw/lottie-player.cjs.js +2 -2
  25. package/dist/sw/lottie-player.cjs.js.map +1 -1
  26. package/dist/sw/lottie-player.esm.js +2 -2
  27. package/dist/sw/lottie-player.esm.js.map +1 -1
  28. package/dist/sw/lottie-player.js +2 -2
  29. package/dist/sw/lottie-player.js.map +1 -1
  30. package/dist/sw/thorvg.wasm +0 -0
  31. package/dist/sw-lite/lottie-player.cjs.js +2 -2
  32. package/dist/sw-lite/lottie-player.cjs.js.map +1 -1
  33. package/dist/sw-lite/lottie-player.esm.js +2 -2
  34. package/dist/sw-lite/lottie-player.esm.js.map +1 -1
  35. package/dist/sw-lite/lottie-player.js +2 -2
  36. package/dist/sw-lite/lottie-player.js.map +1 -1
  37. package/dist/sw-lite/thorvg.wasm +0 -0
  38. package/dist/thorvg.wasm +0 -0
  39. package/dist/wg/lottie-player.cjs.js +4 -0
  40. package/dist/wg/lottie-player.cjs.js.map +1 -0
  41. package/dist/wg/lottie-player.esm.js +4 -0
  42. package/dist/wg/lottie-player.esm.js.map +1 -0
  43. package/dist/wg/lottie-player.js +4 -0
  44. package/dist/wg/lottie-player.js.map +1 -0
  45. package/dist/wg/thorvg.wasm +0 -0
  46. package/dist/wg-lite/lottie-player.cjs.js +4 -0
  47. package/dist/wg-lite/lottie-player.cjs.js.map +1 -0
  48. package/dist/wg-lite/lottie-player.esm.js +4 -0
  49. package/dist/wg-lite/lottie-player.esm.js.map +1 -0
  50. package/dist/wg-lite/lottie-player.js +4 -0
  51. package/dist/wg-lite/lottie-player.js.map +1 -0
  52. package/dist/wg-lite/thorvg.wasm +0 -0
  53. package/package.json +36 -25
@@ -1,4 +1,4 @@
1
- const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),n=new WeakMap;let i=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const r=this.t;if(t&&void 0===e){const t=void 0!==r&&1===r.length;t&&(e=n.get(r)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&n.set(r,e))}return e}toString(){return this.cssText}};const a=(r,n)=>{if(t)r.adoptedStyleSheets=n.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const t of n){const n=document.createElement("style"),i=e.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)}},o=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return(e=>new i("string"==typeof e?e:e+"",void 0,r))(t)})(e):e,{is:s,defineProperty:c,getOwnPropertyDescriptor:l,getOwnPropertyNames:h,getOwnPropertySymbols:u,getPrototypeOf:d}=Object,f=globalThis,b=f.trustedTypes,p=b?b.emptyScript:"",m=f.reactiveElementPolyfillSupport,v=(e,t)=>e,w={toAttribute(e,t){switch(t){case Boolean:e=e?p:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(e){r=null}}return r}},y=(e,t)=>!s(e,t),g={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),f.litPropertyMetadata??=new WeakMap;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=g){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(e,r,t);void 0!==n&&c(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:i}=l(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return n?.call(this)},set(t){const a=n?.call(this);i.call(this,t),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??g}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const e=d(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(v("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(v("properties"))){const e=this.properties,t=[...h(e),...u(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(o(e))}else void 0!==e&&t.push(o(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 a(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)}_$EC(e,t){const r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(void 0!==n&&!0===r.reflect){const i=(void 0!==r.converter?.toAttribute?r.converter:w).toAttribute(t,r.type);this._$Em=e,null==i?this.removeAttribute(n):this.setAttribute(n,i),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),i="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:w;this._$Em=n,this[n]=i.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,r){if(void 0!==e){if(r??=this.constructor.getPropertyOptions(e),!(r.hasChanged??y)(this[e],t))return;this.P(e,t,r)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,r){this._$AL.has(e)||this._$AL.set(e,t),!0===r.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,r]of e)!0!==r.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],r)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[v("elementProperties")]=new Map,_[v("finalized")]=new Map,m?.({ReactiveElement:_}),(f.reactiveElementVersions??=[]).push("2.0.4");const $={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:y},E=(e=$,t,r)=>{const{kind:n,metadata:i}=r;let a=globalThis.litPropertyMetadata.get(i);if(void 0===a&&globalThis.litPropertyMetadata.set(i,a=new Map),a.set(r.name,e),"accessor"===n){const{name:n}=r;return{set(r){const i=t.get.call(this);t.set.call(this,r),this.requestUpdate(n,i,e)},init(t){return void 0!==t&&this.P(n,void 0,e),t}}}if("setter"===n){const{name:n}=r;return function(r){const i=this[n];t.call(this,r),this.requestUpdate(n,i,e)}}throw Error("Unsupported decorator location: "+n)};function A(e){return(t,r)=>"object"==typeof r?E(e,t,r):((e,t,r)=>{const n=t.hasOwnProperty(r);return t.constructor.createProperty(r,n?{...e,wrapped:!0}:e),n?Object.getOwnPropertyDescriptor(t,r):void 0})(e,t,r)}const S=globalThis,T=S.trustedTypes,k=T?T.createPolicy("lit-html",{createHTML:e=>e}):void 0,x="$lit$",P=`lit$${Math.random().toFixed(9).slice(2)}$`,V="?"+P,W=`<${V}>`,C=document,O=()=>C.createComment(""),F=e=>null===e||"object"!=typeof e&&"function"!=typeof e,R=Array.isArray,U="[ \t\n\f\r]",L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,j=/>/g,D=RegExp(`>|${U}(?:([^\\s"'>=/]+)(${U}*=${U}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,N=/"/g,I=/^(?:script|style|textarea|title)$/i,X=(e,...t)=>({_$litType$:1,strings:e,values:t}),z=Symbol.for("lit-noChange"),G=Symbol.for("lit-nothing"),H=new WeakMap,Y=C.createTreeWalker(C,129);function Z(e,t){if(!R(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==k?k.createHTML(t):t}class q{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let i=0,a=0;const o=e.length-1,s=this.parts,[c,l]=((e,t)=>{const r=e.length-1,n=[];let i,a=2===t?"<svg>":3===t?"<math>":"",o=L;for(let t=0;t<r;t++){const r=e[t];let s,c,l=-1,h=0;for(;h<r.length&&(o.lastIndex=h,c=o.exec(r),null!==c);)h=o.lastIndex,o===L?"!--"===c[1]?o=B:void 0!==c[1]?o=j:void 0!==c[2]?(I.test(c[2])&&(i=RegExp("</"+c[2],"g")),o=D):void 0!==c[3]&&(o=D):o===D?">"===c[0]?(o=i??L,l=-1):void 0===c[1]?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=void 0===c[3]?D:'"'===c[3]?N:M):o===N||o===M?o=D:o===B||o===j?o=L:(o=D,i=void 0);const u=o===D&&e[t+1].startsWith("/>")?" ":"";a+=o===L?r+W:l>=0?(n.push(s),r.slice(0,l)+x+r.slice(l)+P+u):r+P+(-2===l?t:u)}return[Z(e,a+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),n]})(e,t);if(this.el=q.createElement(c,r),Y.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=Y.nextNode())&&s.length<o;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(x)){const t=l[a++],r=n.getAttribute(e).split(P),o=/([.?@])?(.*)/.exec(t);s.push({type:1,index:i,name:o[2],strings:r,ctor:"."===o[1]?te:"?"===o[1]?re:"@"===o[1]?ne:ee}),n.removeAttribute(e)}else e.startsWith(P)&&(s.push({type:6,index:i}),n.removeAttribute(e));if(I.test(n.tagName)){const e=n.textContent.split(P),t=e.length-1;if(t>0){n.textContent=T?T.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],O()),Y.nextNode(),s.push({type:2,index:++i});n.append(e[t],O())}}}else if(8===n.nodeType)if(n.data===V)s.push({type:2,index:i});else{let e=-1;for(;-1!==(e=n.data.indexOf(P,e+1));)s.push({type:7,index:i}),e+=P.length-1}i++}}static createElement(e,t){const r=C.createElement("template");return r.innerHTML=e,r}}function J(e,t,r=e,n){if(t===z)return t;let i=void 0!==n?r.o?.[n]:r.l;const a=F(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),void 0===a?i=void 0:(i=new a(e),i._$AT(e,r,n)),void 0!==n?(r.o??=[])[n]=i:r.l=i),void 0!==i&&(t=J(e,i._$AS(e,t.values),i,n)),t}class K{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??C).importNode(t,!0);Y.currentNode=n;let i=Y.nextNode(),a=0,o=0,s=r[0];for(;void 0!==s;){if(a===s.index){let t;2===s.type?t=new Q(i,i.nextSibling,this,e):1===s.type?t=new s.ctor(i,s.name,s.strings,this,e):6===s.type&&(t=new ie(i,this,e)),this._$AV.push(t),s=r[++o]}a!==s?.index&&(i=Y.nextNode(),a++)}return Y.currentNode=C,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 Q{get _$AU(){return this._$AM?._$AU??this.v}constructor(e,t,r,n){this.type=2,this._$AH=G,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this.v=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=J(this,e,t),F(e)?e===G||null==e||""===e?(this._$AH!==G&&this._$AR(),this._$AH=G):e!==this._$AH&&e!==z&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>R(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!==G&&F(this._$AH)?this._$AA.nextSibling.data=e:this.T(C.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=q.createElement(Z(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{const e=new K(n,this),r=e.u(this.options);e.p(t),this.T(r),this._$AH=e}}_$AC(e){let t=H.get(e.strings);return void 0===t&&H.set(e.strings,t=new q(e)),t}k(e){R(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,n=0;for(const i of e)n===t.length?t.push(r=new Q(this.O(O()),this.O(O()),this,this.options)):r=t[n],r._$AI(i),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this.v=e,this._$AP?.(e))}}class ee{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,i){this.type=1,this._$AH=G,this._$AN=void 0,this.element=e,this.name=t,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=G}_$AI(e,t=this,r,n){const i=this.strings;let a=!1;if(void 0===i)e=J(this,e,t,0),a=!F(e)||e!==this._$AH&&e!==z,a&&(this._$AH=e);else{const n=e;let o,s;for(e=i[0],o=0;o<i.length-1;o++)s=J(this,n[r+o],t,o),s===z&&(s=this._$AH[o]),a||=!F(s)||s!==this._$AH[o],s===G?e=G:e!==G&&(e+=(s??"")+i[o+1]),this._$AH[o]=s}a&&!n&&this.j(e)}j(e){e===G?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class te extends ee{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===G?void 0:e}}class re extends ee{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==G)}}class ne extends ee{constructor(e,t,r,n,i){super(e,t,r,n,i),this.type=5}_$AI(e,t=this){if((e=J(this,e,t,0)??G)===z)return;const r=this._$AH,n=e===G&&r!==G||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,i=e!==G&&(r===G||n);n&&this.element.removeEventListener(this.name,this,r),i&&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 ie{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){J(this,e)}}const ae=S.litHtmlPolyfillSupport;ae?.(q,Q),(S.litHtmlVersions??=[]).push("3.2.0");class oe extends _{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=((e,t,r)=>{const n=r?.renderBefore??t;let i=n._$litPart$;if(void 0===i){const e=r?.renderBefore??null;n._$litPart$=i=new Q(t.insertBefore(O(),e),e,void 0,r??{})}return i._$AI(e),i})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return z}}oe._$litElement$=!0,oe.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:oe});const se=globalThis.litElementPolyfillSupport;se?.({LitElement:oe}),(globalThis.litElementVersions??=[]).push("4.1.0");var ce,le=(ce=import.meta.url,async function(e={}){var t,r,n=e,i=new Promise(((e,n)=>{t=e,r=n})),a="object"==typeof window,o="undefined"!=typeof WorkerGlobalScope,s="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&"renderer"!=process.type;if(s){const{createRequire:e}=await Promise.resolve().then((function(){return Ee}));var c=e(import.meta.url)}var l,h,u={...n},d=(e,t)=>{throw t},f="";if(s){var b=c("fs"),p=c("path");import.meta.url.startsWith("data:")||(f=p.dirname(c("url").fileURLToPath(import.meta.url))+"/"),h=e=>(e=C(e)?new URL(e):e,b.readFileSync(e)),l=async e=>(e=C(e)?new URL(e):e,b.readFileSync(e,void 0)),process.argv.slice(2),d=(e,t)=>{throw process.exitCode=e,t}}else(a||o)&&(o?f=self.location.href:"undefined"!=typeof document&&document.currentScript&&(f=document.currentScript.src),ce&&(f=ce),f=f.startsWith("blob:")?"":f.slice(0,f.replace(/[?#].*/,"").lastIndexOf("/")+1),o&&(h=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(C(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 m=n.print||void 0,v=n.printErr||void 0;Object.assign(n,u),u=null;var w,y,g,_,$,E,A,S,T,k,x,P,V=n.wasmBinary,W=!1,C=e=>e.startsWith("file://");function O(){var e=w.buffer;n.HEAP8=g=new Int8Array(e),n.HEAP16=$=new Int16Array(e),n.HEAPU8=_=new Uint8Array(e),n.HEAPU16=E=new Uint16Array(e),n.HEAP32=A=new Int32Array(e),n.HEAPU32=S=new Uint32Array(e),n.HEAPF32=T=new Float32Array(e),n.HEAPF64=P=new Float64Array(e),n.HEAP64=k=new BigInt64Array(e),n.HEAPU64=x=new BigUint64Array(e)}var F,R=0,U=null;function L(){R++,n.monitorRunDependencies?.(R)}function B(){if(R--,n.monitorRunDependencies?.(R),0==R&&U){var e=U;U=null,e()}}function j(e){throw n.onAbort?.(e),v(e="Aborted("+e+")"),W=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),r(e),e}class D{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var M,N=e=>{for(;0<e.length;)e.shift()(n)},I=[],X=[],z=()=>{var e=n.preRun.shift();X.unshift(e)},G=n.noExitRuntime||!0,H="undefined"!=typeof TextDecoder?new TextDecoder:void 0,Y=(e,t=0,r=NaN)=>{var n=t+r;for(r=t;e[r]&&!(r>=n);)++r;if(16<r-t&&e.buffer&&H)return H.decode(e.subarray(t,r));for(n="";t<r;){var i=e[t++];if(128&i){var a=63&e[t++];if(192==(224&i))n+=String.fromCharCode((31&i)<<6|a);else{var o=63&e[t++];65536>(i=224==(240&i)?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&e[t++])?n+=String.fromCharCode(i):(i-=65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else n+=String.fromCharCode(i)}return n},Z=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},q=e=>{for(var t="";_[e];)t+=M[_[e++]];return t},J={},K={},Q={},ee=n.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},te=e=>{throw new ee(e)};function re(e,t,r={}){return function(e,t,r={}){var n=t.name;if(!e)throw new ee(`type "${n}" must have a positive integer typeid pointer`);if(K.hasOwnProperty(e)){if(r.jd)return;throw new ee(`Cannot register type '${n}' twice`)}K[e]=t,delete Q[e],J.hasOwnProperty(e)&&(t=J[e],delete J[e],t.forEach((e=>e())))}(e,t,r)}var ne=(e,t,r)=>{switch(t){case 1:return r?e=>g[e]:e=>_[e];case 2:return r?e=>$[e>>1]:e=>E[e>>1];case 4:return r?e=>A[e>>2]:e=>S[e>>2];case 8:return r?e=>k[e>>3]:e=>x[e>>3];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},ie=e=>{throw new ee(e.Wa.cb.ab.name+" instance already deleted")},ae=!1,oe=()=>{},se=e=>"undefined"==typeof FinalizationRegistry?(se=e=>e,e):(ae=new FinalizationRegistry((e=>{--(e=e.Wa).count.value,0===e.count.value&&(e.gb?e.kb.vb(e.gb):e.cb.ab.vb(e.$a))})),se=e=>{var t=e.Wa;return t.gb&&ae.register(e,{Wa:t},e),e},oe=e=>{ae.unregister(e)},se(e));function le(){}var he=(e,t)=>Object.defineProperty(t,"name",{value:e}),ue={},de=(e,t,r)=>{if(void 0===e[t].fb){var n=e[t];e[t]=function(...n){if(!e[t].fb.hasOwnProperty(n.length))throw new ee(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${e[t].fb})!`);return e[t].fb[n.length].apply(this,n)},e[t].fb=[],e[t].fb[n.Hb]=n}},fe=(e,t,r)=>{if(n.hasOwnProperty(e)){if(void 0===r||void 0!==n[e].fb&&void 0!==n[e].fb[r])throw new ee(`Cannot register public name '${e}' twice`);if(de(n,e,e),n[e].fb.hasOwnProperty(r))throw new ee(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`);n[e].fb[r]=t}else n[e]=t,n[e].Hb=r};function be(e,t,r,n,i,a,o,s){this.name=e,this.constructor=t,this.Cb=r,this.vb=n,this.hb=i,this.cd=a,this.Pb=o,this.Zc=s,this.qd=[]}var pe=(e,t,r)=>{for(;t!==r;){if(!t.Pb)throw new ee(`Expected null or instance of ${r.name}, got an instance of ${t.name}`);e=t.Pb(e),t=t.hb}return e};function me(e,t){if(null===t){if(this.fc)throw new ee(`null is not a valid ${this.name}`);return 0}if(!t.Wa)throw new ee(`Cannot pass "${Z(t)}" as a ${this.name}`);if(!t.Wa.$a)throw new ee(`Cannot pass deleted object as a pointer of type ${this.name}`);return pe(t.Wa.$a,t.Wa.cb.ab,this.ab)}function ve(e,t){if(null===t){if(this.fc)throw new ee(`null is not a valid ${this.name}`);if(this.Vb){var r=this.rd();return null!==e&&e.push(this.vb,r),r}return 0}if(!t||!t.Wa)throw new ee(`Cannot pass "${Z(t)}" as a ${this.name}`);if(!t.Wa.$a)throw new ee(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Ub&&t.Wa.cb.Ub)throw new ee(`Cannot convert argument of type ${t.Wa.kb?t.Wa.kb.name:t.Wa.cb.name} to parameter type ${this.name}`);if(r=pe(t.Wa.$a,t.Wa.cb.ab,this.ab),this.Vb){if(void 0===t.Wa.gb)throw new ee("Passing raw pointer to smart pointer is illegal");switch(this.td){case 0:if(t.Wa.kb!==this)throw new ee(`Cannot convert argument of type ${t.Wa.kb?t.Wa.kb.name:t.Wa.cb.name} to parameter type ${this.name}`);r=t.Wa.gb;break;case 1:r=t.Wa.gb;break;case 2:if(t.Wa.kb===this)r=t.Wa.gb;else{var n=t.clone();r=this.sd(r,ze((()=>n.delete()))),null!==e&&e.push(this.vb,r)}break;default:throw new ee("Unsupporting sharing policy")}}return r}function we(e,t){if(null===t){if(this.fc)throw new ee(`null is not a valid ${this.name}`);return 0}if(!t.Wa)throw new ee(`Cannot pass "${Z(t)}" as a ${this.name}`);if(!t.Wa.$a)throw new ee(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.Wa.cb.Ub)throw new ee(`Cannot convert argument of type ${t.Wa.cb.name} to parameter type ${this.name}`);return pe(t.Wa.$a,t.Wa.cb.ab,this.ab)}function ye(e){return this.fromWireType(S[e>>2])}var ge=(e,t,r)=>t===r?e:void 0===r.hb||null===(e=ge(e,t,r.hb))?null:r.Zc(e),_e={},$e=n.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Ae=(e,t)=>{if(!t.cb||!t.$a)throw new $e("makeClassHandle requires ptr and ptrType");if(!!t.kb!=!!t.gb)throw new $e("Both smartPtrType and smartPtr must be specified");return t.count={value:1},se(Object.create(e,{Wa:{value:t,writable:!0}}))};function Se(e,t,r,n,i,a,o,s,c,l,h){this.name=e,this.ab=t,this.fc=r,this.Ub=n,this.Vb=i,this.pd=a,this.td=o,this.Ic=s,this.rd=c,this.sd=l,this.vb=h,i||void 0!==t.hb?this.toWireType=ve:(this.toWireType=n?me:we,this.lb=null)}var Te,ke=(e,t,r)=>{if(!n.hasOwnProperty(e))throw new $e("Replacing nonexistent public symbol");void 0!==n[e].fb&&void 0!==r?n[e].fb[r]=t:(n[e]=t,n[e].Hb=r)},xe=(e,t)=>{e=q(e);var r=Te.get(t);if("function"!=typeof r)throw new ee(`unknown function pointer with signature ${e}: ${t}`);return r};class Pe extends Error{}var Ve=e=>{e=Sr(e);var t=q(e);return Er(e),t},We=(e,t)=>{var r=[],n={};throw t.forEach((function e(t){n[t]||K[t]||(Q[t]?Q[t].forEach(e):(r.push(t),n[t]=!0))})),new Pe(`${e}: `+r.map(Ve).join([", "]))},Ce=(e,t,r)=>{function n(t){if((t=r(t)).length!==e.length)throw new $e("Mismatched type converter count");for(var n=0;n<e.length;++n)re(e[n],t[n])}e.forEach((e=>Q[e]=t));var i=Array(t.length),a=[],o=0;t.forEach(((e,t)=>{K.hasOwnProperty(e)?i[t]=K[e]:(a.push(e),J.hasOwnProperty(e)||(J[e]=[]),J[e].push((()=>{i[t]=K[e],++o===a.length&&n(i)})))})),0===a.length&&n(i)},Oe=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(S[t+4*n>>2]);return r},Fe=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function Re(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].lb)return!0;return!1}function Ue(e,t,r,n,i,a){var o=t.length;if(2>o)throw new ee("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==t[1]&&null!==r,c=Re(t);for(r="void"!==t[0].name,n=[e,te,n,i,Fe,t[0],t[1]],i=0;i<o-2;++i)n.push(t[i+2]);if(!c)for(i=s?1:2;i<t.length;++i)null!==t[i].lb&&n.push(t[i].lb);c=Re(t),i=t.length-2;var l=[],h=["fn"];for(s&&h.push("thisWired"),o=0;o<i;++o)l.push(`arg${o}`),h.push(`arg${o}Wired`);l=l.join(","),h=h.join(","),l=`return function (${l}) {\n`,c&&(l+="var destructors = [];\n");var u=c?"destructors":"null",d="humanName throwBindingError invoker fn runDestructors retType classParam".split(" ");for(s&&(l+=`var thisWired = classParam['toWireType'](${u}, this);\n`),o=0;o<i;++o)l+=`var arg${o}Wired = argType${o}['toWireType'](${u}, arg${o});\n`,d.push(`argType${o}`);if(l+=(r||a?"var rv = ":"")+`invoker(${h});\n`,c)l+="runDestructors(destructors);\n";else for(o=s?1:2;o<t.length;++o)a=1===o?"thisWired":"arg"+(o-2)+"Wired",null!==t[o].lb&&(l+=`${a}_dtor(${a});\n`,d.push(`${a}_dtor`));r&&(l+="var ret = retType['fromWireType'](rv);\nreturn ret;\n");let[f,b]=[d,l+"}\n"];return t=new Function(...f,b)(...n),he(e,t)}var Le,Be,je,De,Me=e=>{const t=(e=e.trim()).indexOf("(");return-1===t?e:e.slice(0,t)},Ne=[],Ie=[],Xe=e=>{9<e&&0==--Ie[e+1]&&(Ie[e]=void 0,Ne.push(e))},ze=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const t=Ne.pop()||Ie.length;return Ie[t]=e,Ie[t+1]=1,t}},Ge={name:"emscripten::val",fromWireType:e=>{if(!e)throw new ee(`Cannot use deleted val. handle = ${e}`);var t=Ie[e];return Xe(e),t},toWireType:(e,t)=>ze(t),sb:8,readValueFromPointer:ye,lb:null},He=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(T[e>>2])};case 8:return function(e){return this.fromWireType(P[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Ye=(e,t,r,n)=>{if(!(0<n))return 0;var i=r;n=r+n-1;for(var a=0;a<e.length;++a){var o=e.charCodeAt(a);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a)),127>=o){if(r>=n)break;t[r++]=o}else{if(2047>=o){if(r+1>=n)break;t[r++]=192|o>>6}else{if(65535>=o){if(r+2>=n)break;t[r++]=224|o>>12}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}}return t[r]=0,r-i},Ze=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},qe="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Je=(e,t)=>{for(var r=e>>1,n=r+t/2;!(r>=n)&&E[r];)++r;if(32<(r<<=1)-e&&qe)return qe.decode(_.subarray(e,r));for(r="",n=0;!(n>=t/2);++n){var i=$[e+2*n>>1];if(0==i)break;r+=String.fromCharCode(i)}return r},Ke=(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 i=0;i<r;++i)$[t>>1]=e.charCodeAt(i),t+=2;return $[t>>1]=0,t-n},Qe=e=>2*e.length,et=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var i=A[e+4*r>>2];if(0==i)break;++r,65536<=i?(i-=65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i)):n+=String.fromCharCode(i)}return n},tt=(e,t,r)=>{if(r??=2147483647,4>r)return 0;var n=t;r=n+r-4;for(var i=0;i<e.length;++i){var a=e.charCodeAt(i);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),A[t>>2]=a,(t+=4)+4>r)break}return A[t>>2]=0,t-n},rt=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);55296<=n&&57343>=n&&++r,t+=4}return t},nt=0,it={},at=e=>{y=e,G||0<nt||(n.onExit?.(e),W=!0),d(e,new D(e))},ot=e=>{var t="ANGLE_instanced_arrays EXT_blend_minmax EXT_disjoint_timer_query EXT_frag_depth EXT_shader_texture_lod EXT_sRGB OES_element_index_uint OES_fbo_render_mipmap OES_standard_derivatives OES_texture_float OES_texture_half_float OES_texture_half_float_linear OES_vertex_array_object WEBGL_color_buffer_float WEBGL_depth_texture WEBGL_draw_buffers EXT_color_buffer_float EXT_conservative_depth EXT_disjoint_timer_query_webgl2 EXT_texture_norm16 NV_shader_noperspective_interpolation WEBGL_clip_cull_distance EXT_clip_control EXT_color_buffer_half_float EXT_depth_clamp EXT_float_blend EXT_polygon_offset_clamp EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_texture_float_linear WEBGL_blend_func_extended WEBGL_compressed_texture_astc WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context WEBGL_multi_draw WEBGL_polygon_mode".split(" ");return(e.getSupportedExtensions()||[]).filter((e=>t.includes(e)))},st=1,ct=[],lt=[],ht=[],ut=[],dt=[],ft=[],bt=[],pt=[],mt=[1,1,2,2,4,4,4,2,3,4,8],vt=e=>{for(var t=st++,r=e.length;r<t;r++)e[r]=null;for(;e[t];)t=st++;return t},wt=(e,t,r,n)=>{for(var i=0;i<e;i++){var a=Le[r](),o=a&&vt(n);a?(a.name=o,n[o]=a):Be||=1282,A[t+4*i>>2]=o}},yt=["default","low-power","high-performance"],gt=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],_t=e=>"]"==e.slice(-1)&&e.lastIndexOf("["),$t=[],Et=e=>0==(e-=5120)?g:1==e?_:2==e?$:4==e?A:6==e?T:5==e||28922==e||28520==e||30779==e||30782==e?S:E,At=e=>{var t=Le.Yc;if(t){var r=t.Ob[e];return"number"==typeof r&&(t.Ob[e]=r=Le.getUniformLocation(t,t.Mc[e]+(0<r?`[${r}]`:""))),r}Be||=1282},St=[],Tt=e=>{(Tt=(()=>{if(s){var e=c("crypto");return t=>e.randomFillSync(t)}return e=>crypto.getRandomValues(e)})())(e)},kt=(e,t)=>{for(var r=0,n=e.length-1;0<=n;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},xt=e=>{var t="/"===e.charAt(0),r="/"===e.slice(-1);return(e=kt(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},Pt=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):"."},Vt=e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],Wt=(...e)=>{for(var t="",r=!1,n=e.length-1;-1<=n&&!r;n--){if("string"!=typeof(r=0<=n?e[n]:fr.cwd()))throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";t=r+"/"+t,r="/"===r.charAt(0)}return t=kt(t.split("/").filter((e=>!!e)),!r).join("/"),(r?"/":"")+t||"."},Ct=(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=Wt(e).slice(1),t=Wt(t).slice(1),e=r(e.split("/")),t=r(t.split("/"));for(var n=Math.min(e.length,t.length),i=n,a=0;a<n;a++)if(e[a]!==t[a]){i=a;break}for(n=[],a=i;a<e.length;a++)n.push("..");return(n=n.concat(t.slice(i))).join("/")},Ot=[],Ft=e=>{var t=Array(Ze(e)+1);return e=Ye(e,t,0,t.length),t.length=e,t},Rt=[];function Ut(e,t){Rt[e]={input:[],output:[],Eb:t},zt(e,Lt)}var Lt={open(e){var t=Rt[e.node.rdev];if(!t)throw new fr.Va(43);e.tty=t,e.seekable=!1},close(e){e.tty.Eb.fsync(e.tty)},fsync(e){e.tty.Eb.fsync(e.tty)},read(e,t,r,n){if(!e.tty||!e.tty.Eb.Bc)throw new fr.Va(60);for(var i=0,a=0;a<n;a++){try{var o=e.tty.Eb.Bc(e.tty)}catch(e){throw new fr.Va(29)}if(void 0===o&&0===i)throw new fr.Va(6);if(null==o)break;i++,t[r+a]=o}return i&&(e.node.atime=Date.now()),i},write(e,t,r,n){if(!e.tty||!e.tty.Eb.kc)throw new fr.Va(60);try{for(var i=0;i<n;i++)e.tty.Eb.kc(e.tty,t[r+i])}catch(e){throw new fr.Va(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),i}},Bt={Bc(){e:{if(!Ot.length){var e=null;if(s){var t=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=b.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"undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(e=window.prompt("Input: "))&&(e+="\n");if(!e){e=null;break e}Ot=Ft(e)}e=Ot.shift()}return e},kc(e,t){null===t||10===t?(m(Y(e.output)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){0<e.output?.length&&(m(Y(e.output)),e.output=[])},Pd:()=>({Bd:25856,Dd:5,Ad:191,Cd:35387,zd:[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]}),Qd:()=>0,Rd:()=>[24,80]},jt={kc(e,t){null===t||10===t?(v(Y(e.output)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){0<e.output?.length&&(v(Y(e.output)),e.output=[])}},Dt={rb:null,bb:()=>Dt.createNode(null,"/",16895,0),createNode(e,t,r,n){if(24576==(61440&r)||fr.isFIFO(r))throw new fr.Va(63);return Dt.rb||(Dt.rb={dir:{node:{nb:Dt.Xa.nb,pb:Dt.Xa.pb,lookup:Dt.Xa.lookup,ub:Dt.Xa.ub,rename:Dt.Xa.rename,unlink:Dt.Xa.unlink,rmdir:Dt.Xa.rmdir,readdir:Dt.Xa.readdir,symlink:Dt.Xa.symlink},stream:{jb:Dt.Ya.jb}},file:{node:{nb:Dt.Xa.nb,pb:Dt.Xa.pb},stream:{jb:Dt.Ya.jb,read:Dt.Ya.read,write:Dt.Ya.write,Db:Dt.Ya.Db,Lb:Dt.Ya.Lb}},link:{node:{nb:Dt.Xa.nb,pb:Dt.Xa.pb,readlink:Dt.Xa.readlink},stream:{}},qc:{node:{nb:Dt.Xa.nb,pb:Dt.Xa.pb},stream:fr.Vc}}),Gt((r=fr.createNode(e,t,r,n)).mode)?(r.Xa=Dt.rb.dir.node,r.Ya=Dt.rb.dir.stream,r.Za={}):fr.isFile(r.mode)?(r.Xa=Dt.rb.file.node,r.Ya=Dt.rb.file.stream,r.eb=0,r.Za=null):40960==(61440&r.mode)?(r.Xa=Dt.rb.link.node,r.Ya=Dt.rb.link.stream):8192==(61440&r.mode)&&(r.Xa=Dt.rb.qc.node,r.Ya=Dt.rb.qc.stream),r.atime=r.mtime=r.ctime=Date.now(),e&&(e.Za[t]=r,e.atime=e.mtime=e.ctime=r.atime),r},Od:e=>e.Za?e.Za.subarray?e.Za.subarray(0,e.eb):new Uint8Array(e.Za):new Uint8Array(0),Xa:{nb(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=Gt(e.mode)?4096:fr.isFile(e.mode)?e.eb: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},pb(e,t){for(var r of["mode","atime","mtime","ctime"])null!=t[r]&&(e[r]=t[r]);void 0!==t.size&&e.eb!=(t=t.size)&&(0==t?(e.Za=null,e.eb=0):(r=e.Za,e.Za=new Uint8Array(t),r&&e.Za.set(r.subarray(0,Math.min(t,e.eb))),e.eb=t))},lookup(){throw Dt.yc},ub:(e,t,r,n)=>Dt.createNode(e,t,r,n),rename(e,t,r){try{var n=Ht(t,r)}catch(e){}if(n){if(Gt(e.mode))for(var i in n.Za)throw new fr.Va(55);Yt(n)}delete e.parent.Za[e.name],t.Za[r]=e,e.name=r,t.ctime=t.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,t){delete e.Za[t],e.ctime=e.mtime=Date.now()},rmdir(e,t){var r,n=Ht(e,t);for(r in n.Za)throw new fr.Va(55);delete e.Za[t],e.ctime=e.mtime=Date.now()},readdir:e=>[".","..",...Object.keys(e.Za)],symlink:(e,t,r)=>((e=Dt.createNode(e,t,41471,0)).link=r,e),readlink(e){if(40960!=(61440&e.mode))throw new fr.Va(28);return e.link}},Ya:{read(e,t,r,n,i){var a=e.node.Za;if(i>=e.node.eb)return 0;if(8<(e=Math.min(e.node.eb-i,n))&&a.subarray)t.set(a.subarray(i,i+e),r);else for(n=0;n<e;n++)t[r+n]=a[i+n];return e},write(e,t,r,n,i,a){if(t.buffer===g.buffer&&(a=!1),!n)return 0;if((e=e.node).mtime=e.ctime=Date.now(),t.subarray&&(!e.Za||e.Za.subarray)){if(a)return e.Za=t.subarray(r,r+n),e.eb=n;if(0===e.eb&&0===i)return e.Za=t.slice(r,r+n),e.eb=n;if(i+n<=e.eb)return e.Za.set(t.subarray(r,r+n),i),n}var o=e.Za?e.Za.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=e.Za,e.Za=new Uint8Array(a),0<e.eb&&e.Za.set(o.subarray(0,e.eb),0)),e.Za.subarray&&t.subarray)e.Za.set(t.subarray(r,r+n),i);else for(a=0;a<n;a++)e.Za[i+a]=t[r+a];return e.eb=Math.max(e.eb,i+n),n},jb(e,t,r){if(1===r?t+=e.position:2===r&&fr.isFile(e.node.mode)&&(t+=e.node.eb),0>t)throw new fr.Va(28);return t},Db(e,t,r,n,i){if(!fr.isFile(e.node.mode))throw new fr.Va(43);if(e=e.node.Za,2&i||!e||e.buffer!==g.buffer){if(n=!0,j(),!(i=void 0))throw new fr.Va(48);e&&((0<r||r+t<e.length)&&(e=e.subarray?e.subarray(r,r+t):Array.prototype.slice.call(e,r,r+t)),g.set(e,i))}else n=!1,i=e.byteOffset;return{$a:i,vd:n}},Lb:(e,t,r,n)=>(Dt.Ya.write(e,t,0,n,r,!1),0)}},Mt=n.preloadPlugins||[],Nt=(e,t,r,n,i,a,o,s,c,h)=>{function u(r){function l(r){h?.(),s||fr.cc(e,t,r,n,i,c),a?.(),B()}((e,t,r,n)=>{"undefined"!=typeof Browser&&Xt();var i=!1;return Mt.forEach((a=>{!i&&a.canHandle(t)&&(a.handle(e,t,r,n),i=!0)})),i})(r,d,l,(()=>{o?.(),B()}))||l(r)}var d=t?Wt(xt(e+"/"+t)):e;L(),"string"==typeof r?(async e=>(e=await l(e),new Uint8Array(e)))(r).then(u,o):u(r)},It=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r};function Xt(){var e,t,r;fr.ec=!0,e??=n.stdin,t??=n.stdout,r??=n.stderr,e?fr.tb("/dev","stdin",e):fr.symlink("/dev/tty","/dev/stdin"),t?fr.tb("/dev","stdout",null,t):fr.symlink("/dev/tty","/dev/stdout"),r?fr.tb("/dev","stderr",null,r):fr.symlink("/dev/tty1","/dev/stderr"),fr.open("/dev/stdin",0),fr.open("/dev/stdout",1),fr.open("/dev/stderr",1)}function zt(e,t){fr.wc[e]={Ya:t}}function Gt(e){return 16384==(61440&e)}function Ht(e,t){var r=Gt(e.mode)?(r=er(e,"x"))?r:e.Xa.lookup?0:2:54;if(r)throw new fr.Va(r);for(r=fr.qb[Jt(e.id,t)];r;r=r.zb)if(r.parent.id===e.id&&r.name===t)return r;return fr.lookup(e,t)}function Yt(e){var t=Jt(e.parent.id,e.name);if(fr.qb[t]===e)fr.qb[t]=e.zb;else for(t=fr.qb[t];t;){if(t.zb===e){t.zb=e.zb;break}t=t.zb}}function Zt(e,t={}){if(!e)throw new fr.Va(44);t.Tb??(t.Tb=!0),"/"===e.charAt(0)||(e=fr.cwd()+"/"+e);var r=0;e:for(;40>r;r++){e=e.split("/").filter((e=>!!e));for(var n=fr.root,i="/",a=0;a<e.length;a++){var o=a===e.length-1;if(o&&t.parent)break;if("."!==e[a])if(".."===e[a])i=Pt(i),n=n.parent;else{i=xt(i+"/"+e[a]);try{n=Ht(n,e[a])}catch(e){if(44===e?.Sb&&o&&t.nd)return{path:i};throw e}if(!n.ob||o&&!t.Tb||(n=n.ob.root),40960==(61440&n.mode)&&(!o||t.mb)){if(!n.Xa.readlink)throw new fr.Va(52);"/"===(n=n.Xa.readlink(n)).charAt(0)||(n=Pt(i)+"/"+n),e=n+"/"+e.slice(a+1).join("/");continue e}}}return{path:i,node:n}}throw new fr.Va(32)}function qt(e){for(var t;;){if(fr.Ec(e))return e=e.bb.Gc,t?"/"!==e[e.length-1]?`${e}/${t}`:e+t:e;t=t?`${e.name}/${t}`:e.name,e=e.parent}}function Jt(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%fr.qb.length}function Kt(e){var t=Jt(e.parent.id,e.name);e.zb=fr.qb[t],fr.qb[t]=e}function Qt(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function er(e,t){return fr.Cc?0:!t.includes("r")||292&e.mode?t.includes("w")&&!(146&e.mode)||t.includes("x")&&!(73&e.mode)?2:0:2}function tr(e,t){if(!Gt(e.mode))return 54;try{return Ht(e,t),20}catch(e){}return er(e,"wx")}function rr(e,t,r){try{var n=Ht(e,t)}catch(e){return e.Sb}if(e=er(e,"wx"))return e;if(r){if(!Gt(n.mode))return 54;if(fr.Ec(n)||qt(n)===fr.cwd())return 10}else if(Gt(n.mode))return 31;return 0}function nr(e,t){if(!e)throw new fr.Va(t);return e}function ir(e){if(!(e=fr.gd(e)))throw new fr.Va(8);return e}function ar(e,t=-1){if(e=Object.assign(new fr.Qc,e),-1==t)e:{for(t=0;t<=fr.Sc;t++)if(!fr.streams[t])break e;throw new fr.Va(33)}return e.fd=t,fr.streams[t]=e}function or(e,t,r){var n=e?.Ya.pb;e=n?e:t,n??=t.Xa.pb,nr(n,63),n(e,r)}function sr(e){var t=[];for(e=[e];e.length;){var r=e.pop();t.push(r),e.push(...r.Kb)}return t}function cr(e){var t={yd:4096,Ld:4096,blocks:1e6,xd:5e5,wd:5e5,files:fr.jc,Jd:fr.jc-1,Md:42,flags:2,Yd:255};return e.Xa.Kc&&Object.assign(t,e.Xa.Kc(e.bb.od.root)),t}function lr(e,t,r){return void 0===r&&(r=t,t=438),fr.ub(e,8192|t,r)}function hr(e,t,r,n){or(e,t,{mode:4095&r|-4096&t.mode,ctime:Date.now(),zc:n})}function ur(e,t,r){if(Gt(t.mode))throw new fr.Va(31);if(!fr.isFile(t.mode))throw new fr.Va(28);var n=er(t,"w");if(n)throw new fr.Va(n);or(e,t,{size:r,timestamp:Date.now()})}function dr(e){if(!(e.ld||e.md||e.link||e.Za)){if("undefined"!=typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{e.Za=h(e.url),e.eb=e.Za.length}catch(e){throw new fr.Va(29)}}}for(var fr={root:null,Kb:[],wc:{},streams:[],jc:1,qb:null,tc:"/",ec:!1,Cc:!0,bd:null,Zb:0,Jc:{},Va:class{name="ErrnoError";constructor(e){this.Sb=e}},Qc:class{ib={};node=null;get object(){return this.node}set object(e){this.node=e}get flags(){return this.ib.flags}set flags(e){this.ib.flags=e}get position(){return this.ib.position}set position(e){this.ib.position=e}},Pc:class{Xa={};Ya={};ob=null;constructor(e,t,r,n){e||=this,this.parent=e,this.bb=e.bb,this.id=fr.jc++,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 md(){return Gt(this.mode)}get ld(){return 8192==(61440&this.mode)}},createNode:(e,t,r,n)=>(Kt(e=new fr.Pc(e,t,r,n)),e),Ec:e=>e===e.parent,isFile:e=>32768==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),Sc:4096,gd:e=>fr.streams[e],Gd:(e,t=-1)=>(e=ar(e,t),e.Ya?.Fd?.(e),e),Vc:{open(e){e.Ya=fr.dd(e.node.rdev).Ya,e.Ya.open?.(e)},jb(){throw new fr.Va(70)}},hc:e=>e>>8,Ud:e=>255&e,yb:(e,t)=>e<<8|t,dd:e=>fr.wc[e],Lc(e,t){function r(e){return fr.Zb--,t(e)}function n(e){if(e){if(!n.$c)return n.$c=!0,r(e)}else++a>=i.length&&r(null)}"function"==typeof e&&(t=e,e=!1),fr.Zb++,1<fr.Zb&&v(`warning: ${fr.Zb} FS.syncfs operations in flight at once, probably just doing extra work`);var i=sr(fr.root.bb),a=0;i.forEach((t=>{if(!t.type.Lc)return n(null);t.type.Lc(t,e,n)}))},bb(e,t,r){var n="/"===r;if(n&&fr.root)throw new fr.Va(10);if(!n&&r){var i=Zt(r,{Tb:!1});if(r=i.path,(i=i.node).ob)throw new fr.Va(10);if(!Gt(i.mode))throw new fr.Va(54)}return(e=e.bb(t={type:e,od:t,Gc:r,Kb:[]})).bb=t,t.root=e,n?fr.root=e:i&&(i.ob=t,i.bb&&i.bb.Kb.push(t)),e},fe(e){if(!(e=Zt(e,{Tb:!1})).node.ob)throw new fr.Va(28);var t=(e=e.node).ob,r=sr(t);Object.keys(fr.qb).forEach((e=>{for(e=fr.qb[e];e;){var t=e.zb;r.includes(e.bb)&&Yt(e),e=t}})),e.ob=null,e.bb.Kb.splice(e.bb.Kb.indexOf(t),1)},lookup:(e,t)=>e.Xa.lookup(e,t),ub(e,t,r){var n=Zt(e,{parent:!0}).node;if(!(e=Vt(e)))throw new fr.Va(28);if("."===e||".."===e)throw new fr.Va(20);var i=tr(n,e);if(i)throw new fr.Va(i);if(!n.Xa.ub)throw new fr.Va(63);return n.Xa.ub(n,e,t,r)},Kc:e=>cr(Zt(e,{mb:!0}).node),de:e=>cr(e.node),create:(e,t=438)=>fr.ub(e,4095&t|32768,0),mkdir:(e,t=511)=>fr.ub(e,1023&t|16384,0),Wd(e,t){var r,n=e.split("/"),i="";for(r of n)if(r){(i||"/"===e.charAt(0))&&(i+="/"),i+=r;try{fr.mkdir(i,t)}catch(e){if(20!=e.Sb)throw e}}},symlink(e,t){if(!Wt(e))throw new fr.Va(44);var r=Zt(t,{parent:!0}).node;if(!r)throw new fr.Va(44);var n=tr(r,t=Vt(t));if(n)throw new fr.Va(n);if(!r.Xa.symlink)throw new fr.Va(63);return r.Xa.symlink(r,t,e)},rename(e,t){var r=Pt(e),n=Pt(t),i=Vt(e),a=Vt(t),o=Zt(e,{parent:!0}),s=o.node;if(o=(o=Zt(t,{parent:!0})).node,!s||!o)throw new fr.Va(44);if(s.bb!==o.bb)throw new fr.Va(75);var c=Ht(s,i);if("."!==(e=Ct(e,n)).charAt(0))throw new fr.Va(28);if("."!==(e=Ct(t,r)).charAt(0))throw new fr.Va(55);try{var l=Ht(o,a)}catch(e){}if(c!==l){if(i=rr(s,i,t=Gt(c.mode)))throw new fr.Va(i);if(i=l?rr(o,a,t):tr(o,a))throw new fr.Va(i);if(!s.Xa.rename)throw new fr.Va(63);if(c.ob||l&&l.ob)throw new fr.Va(10);if(o!==s&&(i=er(s,"w")))throw new fr.Va(i);Yt(c);try{s.Xa.rename(c,o,a),c.parent=o}catch(e){throw e}finally{Kt(c)}}},rmdir(e){var t=Zt(e,{parent:!0}).node,r=Ht(t,e=Vt(e)),n=rr(t,e,!0);if(n)throw new fr.Va(n);if(!t.Xa.rmdir)throw new fr.Va(63);if(r.ob)throw new fr.Va(10);t.Xa.rmdir(t,e),Yt(r)},readdir:e=>nr((e=Zt(e,{mb:!0}).node).Xa.readdir,54)(e),unlink(e){var t=Zt(e,{parent:!0}).node;if(!t)throw new fr.Va(44);var r=Ht(t,e=Vt(e)),n=rr(t,e,!1);if(n)throw new fr.Va(n);if(!t.Xa.unlink)throw new fr.Va(63);if(r.ob)throw new fr.Va(10);t.Xa.unlink(t,e),Yt(r)},readlink(e){if(!(e=Zt(e).node))throw new fr.Va(44);if(!e.Xa.readlink)throw new fr.Va(28);return e.Xa.readlink(e)},stat:(e,t)=>nr((e=Zt(e,{mb:!t}).node).Xa.nb,63)(e),fstat(e){var t=ir(e);e=t.node;var r=t.Ya.nb;return t=r?t:e,r??=e.Xa.nb,nr(r,63),r(t)},lstat:e=>fr.stat(e,!0),chmod(e,t,r){hr(null,e="string"==typeof e?Zt(e,{mb:!r}).node:e,t,r)},lchmod(e,t){fr.chmod(e,t,!0)},fchmod(e,t){hr(e=ir(e),e.node,t,!1)},chown(e,t,r,n){or(null,e="string"==typeof e?Zt(e,{mb:!n}).node:e,{timestamp:Date.now(),zc:n})},lchown(e,t,r){fr.chown(e,t,r,!0)},fchown(e){or(e=ir(e),e.node,{timestamp:Date.now(),zc:!1})},truncate(e,t){if(0>t)throw new fr.Va(28);ur(null,e="string"==typeof e?Zt(e,{mb:!0}).node:e,t)},Nd(e,t){if(e=ir(e),0>t||!(2097155&e.flags))throw new fr.Va(28);ur(e,e.node,t)},ge(e,t,r){nr((e=Zt(e,{mb:!0}).node).Xa.pb,63)(e,{atime:t,mtime:r})},open(e,t,r=438){if(""===e)throw new fr.Va(44);if("string"==typeof t){var i={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[t];if(void 0===i)throw Error(`Unknown file open mode: ${t}`);t=i}if(r=64&t?4095&r|32768:0,"object"==typeof e)i=e;else{var a=e.endsWith("/");i=(e=Zt(e,{mb:!(131072&t),nd:!0})).node,e=e.path}var o=!1;if(64&t)if(i){if(128&t)throw new fr.Va(20)}else{if(a)throw new fr.Va(31);i=fr.ub(e,511|r,0),o=!0}if(!i)throw new fr.Va(44);if(8192==(61440&i.mode)&&(t&=-513),65536&t&&!Gt(i.mode))throw new fr.Va(54);if(!o&&(a=i?40960==(61440&i.mode)?32:Gt(i.mode)&&("r"!==Qt(t)||576&t)?31:er(i,Qt(t)):44))throw new fr.Va(a);return 512&t&&!o&&fr.truncate(i,0),t&=-131713,(a=ar({node:i,path:qt(i),flags:t,seekable:!0,position:0,Ya:i.Ya,ud:[],error:!1})).Ya.open&&a.Ya.open(a),o&&fr.chmod(i,511&r),!n.logReadFiles||1&t||e in fr.Jc||(fr.Jc[e]=1),a},close(e){if(null===e.fd)throw new fr.Va(8);e.hd&&(e.hd=null);try{e.Ya.close&&e.Ya.close(e)}catch(e){throw e}finally{fr.streams[e.fd]=null}e.fd=null},jb(e,t,r){if(null===e.fd)throw new fr.Va(8);if(!e.seekable||!e.Ya.jb)throw new fr.Va(70);if(0!=r&&1!=r&&2!=r)throw new fr.Va(28);return e.position=e.Ya.jb(e,t,r),e.ud=[],e.position},read(e,t,r,n,i){if(0>n||0>i)throw new fr.Va(28);if(null===e.fd)throw new fr.Va(8);if(1==(2097155&e.flags))throw new fr.Va(8);if(Gt(e.node.mode))throw new fr.Va(31);if(!e.Ya.read)throw new fr.Va(28);var a=void 0!==i;if(a){if(!e.seekable)throw new fr.Va(70)}else i=e.position;return t=e.Ya.read(e,t,r,n,i),a||(e.position+=t),t},write(e,t,r,n,i,a){if(0>n||0>i)throw new fr.Va(28);if(null===e.fd)throw new fr.Va(8);if(!(2097155&e.flags))throw new fr.Va(8);if(Gt(e.node.mode))throw new fr.Va(31);if(!e.Ya.write)throw new fr.Va(28);e.seekable&&1024&e.flags&&fr.jb(e,0,2);var o=void 0!==i;if(o){if(!e.seekable)throw new fr.Va(70)}else i=e.position;return t=e.Ya.write(e,t,r,n,i,a),o||(e.position+=t),t},Db(e,t,r,n,i){if(2&n&&!(2&i)&&2!=(2097155&e.flags))throw new fr.Va(2);if(1==(2097155&e.flags))throw new fr.Va(2);if(!e.Ya.Db)throw new fr.Va(43);if(!t)throw new fr.Va(28);return e.Ya.Db(e,t,r,n,i)},Lb:(e,t,r,n,i)=>e.Ya.Lb?e.Ya.Lb(e,t,r,n,i):0,Dc(e,t,r){if(!e.Ya.Dc)throw new fr.Va(59);return e.Ya.Dc(e,t,r)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw Error(`Invalid encoding type "${t.encoding}"`);var r,n=fr.open(e,t.flags);e=fr.stat(e).size;var i=new Uint8Array(e);return fr.read(n,i,0,e,0),"utf8"===t.encoding?r=Y(i):"binary"===t.encoding&&(r=i),fr.close(n),r},writeFile(e,t,r={}){if(r.flags=r.flags||577,e=fr.open(e,r.flags,r.mode),"string"==typeof t){var n=new Uint8Array(Ze(t)+1);t=Ye(t,n,0,n.length),fr.write(e,n,0,t,void 0,r.Uc)}else{if(!ArrayBuffer.isView(t))throw Error("Unsupported data type");fr.write(e,t,0,t.byteLength,void 0,r.Uc)}fr.close(e)},cwd:()=>fr.tc,chdir(e){if(null===(e=Zt(e,{mb:!0})).node)throw new fr.Va(44);if(!Gt(e.node.mode))throw new fr.Va(54);var t=er(e.node,"x");if(t)throw new fr.Va(t);fr.tc=e.path},ae(){for(var e of(fr.ec=!1,fr.streams))e&&fr.close(e)},Kd(e,t){try{var r=Zt(e,{mb:!t});e=r.path}catch(e){}var n=!1,i=null;try{r=Zt(e,{parent:!0}),Vt(e),r=Zt(e,{mb:!t}),n=!0,i=r.node}catch(e){}return n?i:null},sc(e,t){for(e="string"==typeof e?e:qt(e),t=t.split("/").reverse();t.length;){var r=t.pop();if(r){var n=xt(e+"/"+r);try{fr.mkdir(n)}catch(e){if(20!=e.Sb)throw e}e=n}}return n},cc(e,t,r,n,i,a){var o=t;if(e&&(e="string"==typeof e?e:qt(e),o=t?xt(e+"/"+t):e),e=It(n,i),o=fr.create(o,e),r){if("string"==typeof r){for(t=Array(r.length),n=0,i=r.length;n<i;++n)t[n]=r.charCodeAt(n);r=t}fr.chmod(o,146|e),t=fr.open(o,577),fr.write(t,r,0,r.length,0,a),fr.close(t),fr.chmod(o,e)}},tb(e,t,r,n){var i;return e=((e,t)=>xt(e+"/"+t))("string"==typeof e?e:qt(e),t),t=It(!!r,!!n),(i=fr.tb).hc??(i.hc=64),zt(i=fr.yb(fr.tb.hc++,0),{open(e){e.seekable=!1},close(){n?.buffer?.length&&n(10)},read(e,t,n,i){for(var a=0,o=0;o<i;o++){try{var s=r()}catch(e){throw new fr.Va(29)}if(void 0===s&&0===a)throw new fr.Va(6);if(null==s)break;a++,t[n+o]=s}return a&&(e.node.atime=Date.now()),a},write(e,t,r,i){for(var a=0;a<i;a++)try{n(t[r+a])}catch(e){throw new fr.Va(29)}return i&&(e.node.mtime=e.node.ctime=Date.now()),a}}),lr(e,t,i)},rc(e,t,r,n,i){class a{bc=!1;ib=[];ac=void 0;oc=0;nc=0;get(e){if(!(e>this.length-1||0>e)){var t=e%this.chunkSize;return this.ac(e/this.chunkSize|0)[t]}}Tc(e){this.ac=e}mc(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(200<=e.status&&300>e.status||304===e.status))throw Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),i=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t;e=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t;var a=1048576;i||(a=n);var o=this;o.Tc((e=>{var t=e*a,i=(e+1)*a-1;if(i=Math.min(i,n-1),void 0===o.ib[e]){var s=o.ib;if(t>i)throw Error("invalid range ("+t+", "+i+") or no bytes requested!");if(i>n-1)throw Error("only "+n+" bytes available! programmer error!");var c=new XMLHttpRequest;if(c.open("GET",r,!1),n!==a&&c.setRequestHeader("Range","bytes="+t+"-"+i),c.responseType="arraybuffer",c.overrideMimeType&&c.overrideMimeType("text/plain; charset=x-user-defined"),c.send(null),!(200<=c.status&&300>c.status||304===c.status))throw Error("Couldn't load "+r+". Status: "+c.status);t=void 0!==c.response?new Uint8Array(c.response||[]):Ft(c.responseText||""),s[e]=t}if(void 0===o.ib[e])throw Error("doXHR failed!");return o.ib[e]})),!e&&n||(a=n=1,a=n=this.ac(0).length,m("LazyFiles on gzip forces download of the whole file when length is accessed")),this.oc=n,this.nc=a,this.bc=!0}get length(){return this.bc||this.mc(),this.oc}get chunkSize(){return this.bc||this.mc(),this.nc}}if("undefined"!=typeof XMLHttpRequest){if(!o)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new a,c=void 0}else c=r,s=void 0;var l=function(e,t,r,n){return e="string"==typeof e?e:qt(e),t=xt(e+"/"+t),fr.create(t,It(r,n))}(e,t,n,i);s?l.Za=s:c&&(l.Za=null,l.url=c),Object.defineProperties(l,{eb:{get:function(){return this.Za.length}}});var h={};return Object.keys(l.Ya).forEach((e=>{var t=l.Ya[e];h[e]=(...e)=>(dr(l),t(...e))})),h.read=(e,t,r,n,i)=>{if(dr(l),i>=(e=e.node.Za).length)t=0;else{if(n=Math.min(e.length-i,n),e.slice)for(var a=0;a<n;a++)t[r+a]=e[i+a];else for(a=0;a<n;a++)t[r+a]=e.get(i+a);t=n}return t},h.Db=()=>{throw dr(l),j(),new fr.Va(48)},l.Ya=h,l}},br=fr.sc,pr=fr.rc,mr=fr.tb,vr=Array(256),wr=0;256>wr;++wr)vr[wr]=String.fromCharCode(wr);M=vr,(()=>{let e=le.prototype;Object.assign(e,{isAliasOf:function(e){if(!(this instanceof le&&e instanceof le))return!1;var t=this.Wa.cb.ab,r=this.Wa.$a;e.Wa=e.Wa;var n=e.Wa.cb.ab;for(e=e.Wa.$a;t.hb;)r=t.Pb(r),t=t.hb;for(;n.hb;)e=n.Pb(e),n=n.hb;return t===n&&r===e},clone:function(){if(this.Wa.$a||ie(this),this.Wa.Mb)return this.Wa.count.value+=1,this;var e=se,t=Object,r=t.create,n=Object.getPrototypeOf(this),i=this.Wa;return(e=e(r.call(t,n,{Wa:{value:{count:i.count,Jb:i.Jb,Mb:i.Mb,$a:i.$a,cb:i.cb,gb:i.gb,kb:i.kb}}}))).Wa.count.value+=1,e.Wa.Jb=!1,e},delete(){if(this.Wa.$a||ie(this),this.Wa.Jb&&!this.Wa.Mb)throw new ee("Object already scheduled for deletion");oe(this);var e=this.Wa;--e.count.value,0===e.count.value&&(e.gb?e.kb.vb(e.gb):e.cb.ab.vb(e.$a)),this.Wa.Mb||(this.Wa.gb=void 0,this.Wa.$a=void 0)},isDeleted:function(){return!this.Wa.$a},deleteLater:function(){if(this.Wa.$a||ie(this),this.Wa.Jb&&!this.Wa.Mb)throw new ee("Object already scheduled for deletion");return this.Wa.Jb=!0,this}});const t=Symbol.dispose;t&&(e[t]=e.delete)})(),Object.assign(Se.prototype,{ed(e){return this.Ic&&(e=this.Ic(e)),e},vc(e){this.vb?.(e)},sb:8,readValueFromPointer:ye,fromWireType:function(e){function t(){return Ae(this.ab.Cb,this.Vb?{cb:this.pd,$a:r,kb:this,gb:e}:{cb:this,$a:e})}var r=this.ed(e);if(!r)return this.vc(e),null;var n=((e,t)=>{if(void 0===t)throw new ee("ptr should not be undefined");for(;e.hb;)t=e.Pb(t),e=e.hb;return _e[t]})(this.ab,r);if(void 0!==n)return 0===n.Wa.count.value?(n.Wa.$a=r,n.Wa.gb=e,n.clone()):(n=n.clone(),this.vc(e),n);if(n=this.ab.cd(r),!(n=ue[n]))return t.call(this);var i=ge(r,this.ab,(n=this.Ub?n.Wc:n.pointerType).ab);return null===i?t.call(this):Ae(n.ab.Cb,this.Vb?{cb:n,$a:i,kb:this,gb:e}:{cb:n,$a:i})}}),Ie.push(0,1,void 0,1,null,1,!0,1,!1,1),n.count_emval_handles=()=>Ie.length/2-5-Ne.length,"undefined"!=typeof MainLoop&&MainLoop.Zd.push((()=>{if(je){var e=je.Gb;for(je.Gb=je.Nb,je.Nb=e,e=je.wb,je.wb=je.$b,je.$b=e,e=0;21>=e;++e)je.wb[e]=0}}));for(let e=0;32>e;++e)$t.push(Array(e));for(var yr=new Int32Array(288),gr=0;288>=gr;++gr)St[gr]=yr.subarray(0,gr);fr.Xc=Nt,fr.qb=Array(4096),fr.bb(Dt,{},"/"),fr.mkdir("/tmp"),fr.mkdir("/home"),fr.mkdir("/home/web_user"),function(){fr.mkdir("/dev"),zt(fr.yb(1,3),{read:()=>0,write:(e,t,r,n)=>n,jb:()=>0}),lr("/dev/null",fr.yb(1,3)),Ut(fr.yb(5,0),Bt),Ut(fr.yb(6,0),jt),lr("/dev/tty",fr.yb(5,0)),lr("/dev/tty1",fr.yb(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(Tt(e),t=e.byteLength),e[--t]);fr.tb("/dev","random",r),fr.tb("/dev","urandom",r),fr.mkdir("/dev/shm"),fr.mkdir("/dev/shm/tmp")}(),function(){fr.mkdir("/proc");var e=fr.mkdir("/proc/self");fr.mkdir("/proc/self/fd"),fr.bb({bb(){var t=fr.createNode(e,"fd",16895,73);return t.Ya={jb:Dt.Ya.jb},t.Xa={lookup(e,t){var r=ir(e=+t);return(e={parent:null,bb:{Gc:"fake"},Xa:{readlink:()=>r.path},id:e+1}).parent=e},readdir:()=>Array.from(fr.streams.entries()).filter((([,e])=>e)).map((([e])=>e.toString()))},t}},{},"/proc/self/fd")}(),fr.bd={MEMFS:Dt},n.FS_createPath=fr.sc,n.FS_createDataFile=fr.cc,n.FS_createPreloadedFile=fr.Xc,n.FS_unlink=fr.unlink,n.FS_createLazyFile=fr.rc,n.FS_createDevice=fr.tb,Dt.yc=new fr.Va(44),Dt.yc.stack="<generic error, no stack>";var _r={z:(e,t,r,n)=>j(`Assertion failed: ${e?Y(_,e):""}, at: `+[t?t?Y(_,t):"":"unknown filename",r,n?n?Y(_,n):"":"unknown function"]),aa:()=>j(""),B:(e,t,r)=>{re(e,{name:t=q(t),fromWireType:e=>e,toWireType:function(e,t){if("bigint"!=typeof t&&"number"!=typeof t)throw new TypeError(`Cannot convert "${Z(t)}" to ${this.name}`);return"number"==typeof t&&(t=BigInt(t)),t},sb:8,readValueFromPointer:ne(t,r,-1==t.indexOf("u")),lb:null})},da:(e,t,r,n)=>{re(e,{name:t=q(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:n},sb:8,readValueFromPointer:function(e){return this.fromWireType(_[e])},lb:null})},la:(e,t,r,n,i,a,o,s,c,l,h,u,d)=>{h=q(h),a=xe(i,a),s&&=xe(o,s),l&&=xe(c,l),d=xe(u,d);var f=(e=>{var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e})(h);fe(f,(function(){We(`Cannot construct ${h} due to unbound types`,[n])})),Ce([e,t,r],n?[n]:[],(t=>{if(t=t[0],n)var r=t.ab,i=r.Cb;else i=le.prototype;t=he(h,(function(...e){if(Object.getPrototypeOf(this)!==o)throw new ee(`Use 'new' to construct ${h}`);if(void 0===u.xb)throw new ee(`${h} has no accessible constructor`);var t=u.xb[e.length];if(void 0===t)throw new ee(`Tried to invoke ctor of ${h} with invalid number of parameters (${e.length}) - expected (${Object.keys(u.xb).toString()}) parameters instead!`);return t.apply(this,e)}));var o=Object.create(i,{constructor:{value:t}});t.prototype=o;var c,u=new be(h,t,o,d,r,a,s,l);return u.hb&&((c=u.hb).pc??(c.pc=[]),u.hb.pc.push(u)),r=new Se(h,u,!0,!1,!1),c=new Se(h+"*",u,!1,!1,!1),i=new Se(h+" const*",u,!1,!0,!1),ue[e]={pointerType:c,Wc:i},ke(f,t),[r,c,i]}))},ka:(e,t,r,n,i,a)=>{var o=Oe(t,r);i=xe(n,i),Ce([],[e],(e=>{var r=`constructor ${(e=e[0]).name}`;if(void 0===e.ab.xb&&(e.ab.xb=[]),void 0!==e.ab.xb[t-1])throw new ee(`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.ab.xb[t-1]=()=>{We(`Cannot construct ${e.name} due to unbound types`,o)},Ce([],o,(n=>(n.splice(1,0,null),e.ab.xb[t-1]=Ue(r,n,null,i,a),[]))),[]}))},h:(e,t,r,n,i,a,o,s,c)=>{var l=Oe(r,n);t=q(t),t=Me(t),a=xe(i,a),Ce([],[e],(e=>{function n(){We(`Cannot call ${i} due to unbound types`,l)}var i=`${(e=e[0]).name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.ab.qd.push(t);var h=e.ab.Cb,u=h[t];return void 0===u||void 0===u.fb&&u.className!==e.name&&u.Hb===r-2?(n.Hb=r-2,n.className=e.name,h[t]=n):(de(h,t,i),h[t].fb[r-2]=n),Ce([],l,(n=>(n=Ue(i,n,e,a,o,c),void 0===h[t].fb?(n.Hb=r-2,h[t]=n):h[t].fb[r-2]=n,[]))),[]}))},ba:e=>re(e,Ge),A:(e,t,r)=>{re(e,{name:t=q(t),fromWireType:e=>e,toWireType:(e,t)=>t,sb:8,readValueFromPointer:He(t,r),lb:null})},D:(e,t,r,n,i,a,o)=>{var s=Oe(t,r);e=q(e),e=Me(e),i=xe(n,i),fe(e,(function(){We(`Cannot call ${e} due to unbound types`,s)}),t-1),Ce([],s,(r=>(r=[r[0],null].concat(r.slice(1)),ke(e,Ue(e,r,null,i,a,o),t-1),[])))},k:(e,t,r,n,i)=>{if(t=q(t),-1===i&&(i=4294967295),i=e=>e,0===n){var a=32-8*r;i=e=>e<<a>>>a}var o=t.includes("unsigned")?function(e,t){return t>>>0}:function(e,t){return t};re(e,{name:t,fromWireType:i,toWireType:o,sb:8,readValueFromPointer:ne(t,r,0!==n),lb:null})},c:(e,t,r)=>{function n(e){return new i(g.buffer,S[e+4>>2],S[e>>2])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];re(e,{name:r=q(r),fromWireType:n,sb:8,readValueFromPointer:n},{jd:!0})},ca:(e,t)=>{re(e,{name:t=q(t),fromWireType:function(e){for(var t,r=S[e>>2],n=e+4,i=n,a=0;a<=r;++a){var o=n+a;a!=r&&0!=_[o]||(i=i?Y(_,i,o-i):"",void 0===t?t=i:(t+=String.fromCharCode(0),t+=i),i=o+1)}return Er(e),t},toWireType:function(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 ee("Cannot pass non-string to std::string");var n=r?Ze(t):t.length,i=Ar(4+n+1),a=i+4;return S[i>>2]=n,r?Ye(t,_,a,n+1):_.set(t,a),null!==e&&e.push(Er,i),i},sb:8,readValueFromPointer:ye,lb(e){Er(e)}})},v:(e,t,r)=>{if(r=q(r),2===t)var n=Je,i=Ke,a=Qe,o=e=>E[e>>1];else 4===t&&(n=et,i=tt,a=rt,o=e=>S[e>>2]);re(e,{name:r,fromWireType:e=>{for(var r,i=S[e>>2],a=e+4,s=0;s<=i;++s){var c=e+4+s*t;s!=i&&0!=o(c)||(a=n(a,c-a),void 0===r?r=a:(r+=String.fromCharCode(0),r+=a),a=c+t)}return Er(e),r},toWireType:(e,n)=>{if("string"!=typeof n)throw new ee(`Cannot pass non-string to C++ string type ${r}`);var o=a(n),s=Ar(4+o+t);return S[s>>2]=o/t,i(n,s+4,o+t),null!==e&&e.push(Er,s),s},sb:8,readValueFromPointer:ye,lb(e){Er(e)}})},E:e=>{re(e,Ge)},ea:(e,t)=>{re(e,{Sd:!0,name:t=q(t),sb:0,fromWireType:()=>{},toWireType:()=>{}})},Y:()=>{G=!1,nt=0},ga:Xe,ha:e=>{9<e&&(Ie[e+1]+=1)},C:(e,t)=>{var r=K[e];if(void 0===r)throw e=`_emval_take_value has unknown type ${Ve(e)}`,new ee(e);return e=(e=r).readValueFromPointer(t),ze(e)},Z:(e,t)=>{if(it[e]&&(clearTimeout(it[e].id),delete it[e]),!t)return 0;var r=setTimeout((()=>{delete it[e],(e=>{if(!W)try{if(e(),!(G||0<nt))try{y=e=y,at(e)}catch(e){e instanceof D||"unwind"==e||d(1,e)}}catch(e){e instanceof D||"unwind"==e||d(1,e)}})((()=>Tr(e,performance.now())))}),t);return it[e]={id:r,ee:t},0},_:e=>{var t=_.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))-w.buffer.byteLength+65535)/65536|0;try{w.grow(n),O();var i=1;break e}catch(e){}i=void 0}if(i)return!0}return!1},ia:(e,t)=>{var r=t>>2;return t={alpha:!!g[t+0],depth:!!g[t+1],stencil:!!g[t+2],antialias:!!g[t+3],premultipliedAlpha:!!g[t+4],preserveDrawingBuffer:!!g[t+5],powerPreference:yt[A[r+2]],failIfMajorPerformanceCaveat:!!g[t+12],Fc:A[r+4],Vd:A[r+5],Ac:g[t+24],ad:g[t+25],$d:A[r+7],ce:g[t+32]},e=2<e?e?Y(_,e):"":e,!(e=gt[e]||("undefined"!=typeof document?document.querySelector(e):null))||t.ad?0:((e,t)=>{e.ib||(e.ib=e.getContext,e.getContext=function(t,r){return"webgl"==t==(r=e.ib(t,r))instanceof WebGLRenderingContext?r:null});var r=e.getContext(1<t.Fc?"webgl2":"webgl",t);return r?((e,t)=>{var r=vt(pt),n={handle:r,attributes:t,version:t.Fc,Ab:e};for(e.canvas&&(e.canvas.Rc=n),pt[r]=n,(void 0===t.Ac||t.Ac)&&(e=>{if(e||=je,!e.kd){e.kd=!0;var t=e.Ab;t.Xd=t.getExtension("WEBGL_multi_draw"),t.Id=t.getExtension("EXT_polygon_offset_clamp"),t.Hd=t.getExtension("EXT_clip_control"),t.he=t.getExtension("WEBGL_polygon_mode"),(e=>{var t=e.getExtension("ANGLE_instanced_arrays");t&&(e.vertexAttribDivisor=(e,r)=>t.vertexAttribDivisorANGLE(e,r),e.drawArraysInstanced=(e,r,n,i)=>t.drawArraysInstancedANGLE(e,r,n,i),e.drawElementsInstanced=(e,r,n,i,a)=>t.drawElementsInstancedANGLE(e,r,n,i,a))})(t),(e=>{var t=e.getExtension("OES_vertex_array_object");t&&(e.createVertexArray=()=>t.createVertexArrayOES(),e.deleteVertexArray=e=>t.deleteVertexArrayOES(e),e.bindVertexArray=e=>t.bindVertexArrayOES(e),e.isVertexArray=e=>t.isVertexArrayOES(e))})(t),(e=>{var t=e.getExtension("WEBGL_draw_buffers");t&&(e.drawBuffers=(e,r)=>t.drawBuffersWEBGL(e,r))})(t),t.Ed=t.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"),t.Td=t.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"),2<=e.version&&(t.xc=t.getExtension("EXT_disjoint_timer_query_webgl2")),(2>e.version||!t.xc)&&(t.xc=t.getExtension("EXT_disjoint_timer_query")),ot(t).forEach((e=>{e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}})(n),n.ic=n.Ab.getParameter(34921),n.Bb=[],e=0;e<n.ic;e++)n.Bb[e]={enabled:!1,Qb:!1,size:0,type:0,Hc:0,stride:0,$a:0,Oc:null};for(n.wb=[],n.$b=[],n.wb.length=n.$b.length=22,n.Gb=[],n.Nb=[],n.Gb.length=n.Nb.length=22,n.Fb=[],n.Fb.length=22,e=0;21>=e;++e){n.Fb[e]=null,n.wb[e]=n.$b[e]=0,n.Gb[e]=[],n.Nb[e]=[];var i=n.Nb[e];(t=n.Gb[e]).length=i.length=64;for(var a=0;64>a;++a)t[a]=i[a]=null}return r})(r,t):0})(e,t)},ja:e=>{je==e&&(je=0),je===pt[e]&&(je=null),"object"==typeof JSEvents&&JSEvents.be(pt[e].Ab.canvas),pt[e]?.Ab.canvas&&(pt[e].Ab.canvas.Rc=void 0),pt[e]=null},Ia:()=>je?je.handle:0,R:e=>(je=pt[e],n.ctx=Le=je?.Ab,!e||Le?0:-5),za:e=>Le.activeTexture(e),V:(e,t)=>{Le.attachShader(lt[e],ft[t])},j:(e,t)=>{if(t&&!ct[t]){var r=Le.createBuffer();r.name=t,ct[t]=r}34962==e?Le.Rb=t:34963==e&&(Le.Ib=t),35051==e?Le.uc=t:35052==e&&(Le.dc=t),Le.bindBuffer(e,ct[t])},xa:(e,t,r,n,i)=>{Le.bindBufferRange(e,t,ct[r],n,i)},a:(e,t)=>{Le.bindFramebuffer(e,ht[t])},y:(e,t)=>{Le.bindRenderbuffer(e,ut[t])},r:(e,t)=>{Le.bindTexture(e,dt[t])},F:e=>{Le.bindVertexArray(bt[e]),e=Le.getParameter(34965),Le.Ib=e?0|e.name:0},x:e=>Le.blendEquation(e),g:(e,t)=>Le.blendFunc(e,t),l:(e,t,r,n,i,a,o,s,c,l)=>Le.blitFramebuffer(e,t,r,n,i,a,o,s,c,l),W:(e,t,r,n)=>{2<=je.version?r&&t?Le.bufferData(e,_,n,r,t):Le.bufferData(e,t,n):Le.bufferData(e,r?_.subarray(r,r+t):t,n)},H:e=>Le.clear(e),I:(e,t,r,n)=>Le.clearColor(e,t,r,n),sa:e=>Le.clearDepth(e),ta:e=>Le.clearStencil(e),o:(e,t,r,n)=>{Le.colorMask(!!e,!!t,!!r,!!n)},na:e=>{Le.compileShader(ft[e])},$:()=>{var e=vt(lt),t=Le.createProgram();return t.name=e,t.Yb=t.Wb=t.Xb=0,t.lc=1,lt[e]=t,e},pa:e=>{var t=vt(ft);return ft[t]=Le.createShader(e),t},Ha:e=>Le.cullFace(e),Da:(e,t)=>{for(var r=0;r<e;r++){var n=A[t+4*r>>2],i=ct[n];i&&(Le.deleteBuffer(i),i.name=0,ct[n]=null,n==Le.Rb&&(Le.Rb=0),n==Le.Ib&&(Le.Ib=0),n==Le.uc&&(Le.uc=0),n==Le.dc&&(Le.dc=0))}},K:(e,t)=>{for(var r=0;r<e;++r){var n=A[t+4*r>>2],i=ht[n];i&&(Le.deleteFramebuffer(i),i.name=0,ht[n]=null)}},T:e=>{if(e){var t=lt[e];t?(Le.deleteProgram(t),t.name=0,lt[e]=null):Be||=1281}},J:(e,t)=>{for(var r=0;r<e;r++){var n=A[t+4*r>>2],i=ut[n];i&&(Le.deleteRenderbuffer(i),i.name=0,ut[n]=null)}},w:e=>{if(e){var t=ft[e];t?(Le.deleteShader(t),ft[e]=null):Be||=1281}},S:(e,t)=>{for(var r=0;r<e;r++){var n=A[t+4*r>>2],i=dt[n];i&&(Le.deleteTexture(i),i.name=0,dt[n]=null)}},ra:(e,t)=>{for(var r=0;r<e;r++){var n=A[t+4*r>>2];Le.deleteVertexArray(bt[n]),bt[n]=null}},Fa:e=>Le.depthFunc(e),s:e=>{Le.depthMask(!!e)},m:e=>Le.disable(e),va:e=>{je.Bb[e].enabled=!1,Le.disableVertexAttribArray(e)},wa:(e,t,r,n)=>{var i=0;if(!Le.Ib){var a=1*mt[r-5120]*t,o=(e=>{e=32-Math.clz32(0===e?0:e-1);var t=je.Fb[e];return t||(t=Le.getParameter(34965),je.Fb[e]=Le.createBuffer(),Le.bindBuffer(34963,je.Fb[e]),Le.bufferData(34963,1<<e,35048),Le.bindBuffer(34963,t),je.Fb[e])})(a);if(Le.bindBuffer(34963,o),Le.bufferSubData(34963,0,_.subarray(n,n+a)),0<t)for(o=0;o<je.ic;++o)if((a=je.Bb[o]).Qb&&a.enabled){switch(r){case 5121:i=Uint8Array;break;case 5123:i=Uint16Array;break;case 5125:i=Uint32Array;break;default:return void(Be||=1282)}i=new i(_.buffer,n,t).reduce(((e,t)=>Math.max(e,t)))+1;break}n=0}(e=>{De=!1;for(var t=0;t<je.ic;++t){var r=je.Bb[t];if(r.Qb&&r.enabled){De=!0;var n=r.size,i=r.type,a=r.stride;n=0<a?e*a:n*mt[i-5120]*e,i=32-Math.clz32(0===n?0:n-1),a=je.Gb[i];var o=je.wb[i];je.wb[i]=je.wb[i]+1&63;var s=a[o];s?i=s:(s=Le.getParameter(34964),a[o]=Le.createBuffer(),Le.bindBuffer(34962,a[o]),Le.bufferData(34962,1<<i,35048),Le.bindBuffer(34962,s),i=a[o]),Le.bindBuffer(34962,i),Le.bufferSubData(34962,0,_.subarray(r.$a,r.$a+n)),r.Oc.call(Le,t,r.size,r.type,r.Hc,r.stride,0)}}})(i),Le.drawElements(e,t,r,n),De&&Le.bindBuffer(34962,ct[Le.Rb]),Le.Ib||Le.bindBuffer(34963,null)},f:e=>Le.enable(e),Ba:e=>{je.Bb[e].enabled=!0,Le.enableVertexAttribArray(e)},L:(e,t,r,n)=>{Le.framebufferRenderbuffer(e,t,r,ut[n])},Ea:(e,t,r,n,i)=>{Le.framebufferTexture2D(e,t,r,dt[n],i)},Ga:e=>Le.frontFace(e),Ja:(e,t)=>{wt(e,t,"createBuffer",ct)},O:(e,t)=>{wt(e,t,"createFramebuffer",ht)},N:(e,t)=>{wt(e,t,"createRenderbuffer",ut)},Q:(e,t)=>{wt(e,t,"createTexture",dt)},ua:(e,t)=>{wt(e,t,"createVertexArray",bt)},fa:(e,t)=>((e,t)=>{if(t){var r=void 0;switch(e){case 36346:r=1;break;case 36344:return;case 34814:case 36345:r=0;break;case 34466:var n=Le.getParameter(34467);r=n?n.length:0;break;case 33309:if(2>je.version)return void(Be||=1282);r=(()=>{var e=ot(Le);return e.concat(e.map((e=>"GL_"+e)))})().length;break;case 33307:case 33308:if(2>je.version)return void(Be||=1280);r=33307==e?3:0}if(void 0===r)switch(n=Le.getParameter(e),typeof n){case"number":r=n;break;case"boolean":r=n?1:0;break;case"string":return void(Be||=1280);case"object":if(null===n)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:r=0;break;default:return void(Be||=1280)}else{if(n instanceof Float32Array||n instanceof Uint32Array||n instanceof Int32Array||n instanceof Array){for(e=0;e<n.length;++e)A[t+4*e>>2]=n[e];return}try{r=0|n.name}catch(t){return Be||=1280,void v(`GL_INVALID_ENUM in glGet0v: Unknown object returned from WebGL getParameter(${e})! (error: ${t})`)}}break;default:return Be||=1280,void v(`GL_INVALID_ENUM in glGet0v: Native code calling glGet0v(${e}) and it returns ${n} of type ${typeof n}!`)}A[t>>2]=r}else Be||=1281})(e,t),Ma:(e,t,r,n)=>{null===(e=Le.getProgramInfoLog(lt[e]))&&(e="(unknown error)"),t=0<t&&n?Ye(e,_,n,t):0,r&&(A[r>>2]=t)},U:(e,t,r)=>{if(r)if(e>=st)Be||=1281;else if(e=lt[e],35716==t)null===(e=Le.getProgramInfoLog(e))&&(e="(unknown error)"),A[r>>2]=e.length+1;else if(35719==t){if(!e.Yb){var n=Le.getProgramParameter(e,35718);for(t=0;t<n;++t)e.Yb=Math.max(e.Yb,Le.getActiveUniform(e,t).name.length+1)}A[r>>2]=e.Yb}else if(35722==t){if(!e.Wb)for(n=Le.getProgramParameter(e,35721),t=0;t<n;++t)e.Wb=Math.max(e.Wb,Le.getActiveAttrib(e,t).name.length+1);A[r>>2]=e.Wb}else if(35381==t){if(!e.Xb)for(n=Le.getProgramParameter(e,35382),t=0;t<n;++t)e.Xb=Math.max(e.Xb,Le.getActiveUniformBlockName(e,t).length+1);A[r>>2]=e.Xb}else A[r>>2]=Le.getProgramParameter(e,t);else Be||=1281},ma:(e,t,r,n)=>{null===(e=Le.getShaderInfoLog(ft[e]))&&(e="(unknown error)"),t=0<t&&n?Ye(e,_,n,t):0,r&&(A[r>>2]=t)},G:(e,t,r)=>{r?35716==t?(null===(e=Le.getShaderInfoLog(ft[e]))&&(e="(unknown error)"),A[r>>2]=e?e.length+1:0):35720==t?(e=Le.getShaderSource(ft[e]),A[r>>2]=e?e.length+1:0):A[r>>2]=Le.getShaderParameter(ft[e],t):Be||=1281},b:(e,t)=>Le.getUniformBlockIndex(lt[e],t?Y(_,t):""),d:(e,t)=>{if(t=t?Y(_,t):"",e=lt[e]){var r,n=e,i=n.Ob,a=n.Nc;if(!i){n.Ob=i={},n.Mc={};var o=Le.getProgramParameter(n,35718);for(r=0;r<o;++r){var s=Le.getActiveUniform(n,r),c=s.name;s=s.size;var l=_t(c);l=0<l?c.slice(0,l):c;var h=n.lc;for(n.lc+=s,a[l]=[s,h],c=0;c<s;++c)i[h]=c,n.Mc[h++]=l}}if(n=e.Ob,i=0,a=t,0<(r=_t(t))&&(i=parseInt(t.slice(r+1))>>>0,a=t.slice(0,r)),(a=e.Nc[a])&&i<a[0]&&(n[i+=a[1]]=n[i]||Le.getUniformLocation(e,t)))return i}else Be||=1281;return-1},qa:(e,t,r)=>{for(var n=$t[t],i=0;i<t;i++)n[i]=A[r+4*i>>2];Le.invalidateFramebuffer(e,n)},Na:e=>{Le.linkProgram(e=lt[e]),e.Ob=0,e.Nc={}},M:(e,t,r,n,i)=>Le.renderbufferStorageMultisample(e,t,r,n,i),e:(e,t,r,n)=>Le.scissor(e,t,r,n),oa:(e,t,r,n)=>{for(var i="",a=0;a<t;++a){var o=(o=S[r+4*a>>2])?Y(_,o,n?S[n+4*a>>2]:void 0):"";i+=o}Le.shaderSource(ft[e],i)},u:(e,t,r)=>Le.stencilFunc(e,t,r),q:(e,t,r,n)=>Le.stencilFuncSeparate(e,t,r,n),t:(e,t,r)=>Le.stencilOp(e,t,r),p:(e,t,r,n)=>Le.stencilOpSeparate(e,t,r,n),P:(e,t,r,n,i,a,o,s,c)=>{if(2<=je.version){if(Le.dc)return void Le.texImage2D(e,t,r,n,i,a,o,s,c);if(c){var l=Et(s);return c>>>=31-Math.clz32(l.BYTES_PER_ELEMENT),void Le.texImage2D(e,t,r,n,i,a,o,s,l,c)}}if(c){l=Et(s);var h=i*(n*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[o-6402]||1)*l.BYTES_PER_ELEMENT+4-1&-4);c=l.subarray(c>>>31-Math.clz32(l.BYTES_PER_ELEMENT),c+h>>>31-Math.clz32(l.BYTES_PER_ELEMENT))}else c=null;Le.texImage2D(e,t,r,n,i,a,o,s,c)},n:(e,t,r)=>Le.texParameteri(e,t,r),Ca:(e,t)=>{Le.uniform1f(At(e),t)},Ka:(e,t,r)=>{if(2<=je.version)t&&Le.uniform1iv(At(e),A,r>>2,t);else{if(288>=t)for(var n=St[t],i=0;i<t;++i)n[i]=A[r+4*i>>2];else n=A.subarray(r>>2,r+4*t>>2);Le.uniform1iv(At(e),n)}},ya:(e,t,r)=>{Le.uniformBlockBinding(e=lt[e],t,r)},La:e=>{Le.useProgram(e=lt[e]),Le.Yc=e},Aa:(e,t,r,n,i,a)=>{var o=je.Bb[e];Le.Rb?(o.Qb=!1,Le.vertexAttribPointer(e,t,r,!!n,i,a)):(o.size=t,o.type=r,o.Hc=n,o.stride=i,o.$a=a,o.Qb=!0,o.Oc=function(e,t,r,n,i,a){this.vertexAttribPointer(e,t,r,n,i,a)})},i:(e,t,r,n)=>Le.viewport(e,t,r,n),X:at},$r=await async function(){function e(e){return w=($r=e.exports).Oa,O(),Te=$r.Ua,B(),$r}L();var t={a:_r};if(n.instantiateWasm)return new Promise((r=>{n.instantiateWasm(t,((t,n)=>{e(t),r(t.exports)}))}));F??=n.locateFile?n.locateFile?n.locateFile("thorvg.wasm",f):f+"thorvg.wasm":new URL("thorvg.wasm",import.meta.url).href;try{var i=await async function(e){var t=F;if(!V&&"function"==typeof WebAssembly.instantiateStreaming&&!C(t)&&!s)try{var r=fetch(t,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(r,e)}catch(e){v(`wasm streaming compile failed: ${e}`),v("falling back to ArrayBuffer instantiation")}return async function(e,t){try{var r=await async function(e){if(!V)try{var t=await l(e);return new Uint8Array(t)}catch{}if(e==F&&V)e=new Uint8Array(V);else{if(!h)throw"both async and sync fetching of the wasm failed";e=h(e)}return e}(e);return await WebAssembly.instantiate(r,t)}catch(e){v(`failed to asynchronously prepare wasm: ${e}`),j(e)}}(t,e)}(t);return e(i.instance)}catch(e){return r(e),Promise.reject(e)}}(),Er=$r.Qa,Ar=$r.Ra,Sr=$r.Sa,Tr=$r.Ta;if(n.addRunDependency=L,n.removeRunDependency=B,n.FS_createPreloadedFile=Nt,n.FS_unlink=e=>fr.unlink(e),n.FS_createPath=br,n.FS_createDevice=mr,n.FS=fr,n.FS_createDataFile=(e,t,r,n,i,a)=>{fr.cc(e,t,r,n,i,a)},n.FS_createLazyFile=pr,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.pop()();return function e(){function r(){if(n.calledRun=!0,!W){if(n.noFSInit||fr.ec||Xt(),$r.Pa(),fr.Cc=!1,t(n),n.onRuntimeInitialized?.(),n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;){var e=n.postRun.shift();I.unshift(e)}N(I)}}if(0<R)U=e;else{if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)z();N(X),0<R?U=e:n.setStatus?(n.setStatus("Running..."),setTimeout((()=>{setTimeout((()=>n.setStatus("")),1),r()}),1)):r()}}(),i});function he(e,t,r,n){var i,a=arguments.length,o=a<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--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o}let ue,de=!1;var fe,be,pe,me,ve,we;!function(e){e.SW="sw",e.WG="wg",e.GL="gl"}(fe||(fe={})),function(e){e.IDLE="idle",e.FAILED="failed",e.REQUESTED="requested",e.INITIALIZED="initialized"}(be||(be={})),function(e){e.JSON="json",e.LOT="lot",e.JPG="jpg",e.PNG="png",e.SVG="svg"}(pe||(pe={})),function(e){e.Destroyed="destroyed",e.Error="error",e.Loading="loading",e.Paused="paused",e.Playing="playing",e.Stopped="stopped",e.Frozen="frozen"}(me||(me={})),function(e){e.Bounce="bounce",e.Normal="normal"}(ve||(ve={})),function(e){e.Complete="complete",e.Destroyed="destroyed",e.Error="error",e.Frame="frame",e.Freeze="freeze",e.Load="load",e.Loop="loop",e.Pause="pause",e.Play="play",e.Ready="ready",e.Stop="stop"}(we||(we={}));const ye=e=>new Promise((t=>setTimeout(t,e)));let ge="idle";class _e extends oe{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;canvas;config;_imageData;_beginTime=Date.now();_counter=1;_timer;_observer;_observable=!1;async _init(){if(de)for(;!ue;)await ye(100);if(ue||(de=!0,ue=await le({locateFile:(e,t)=>e.endsWith(".wasm")?this.wasmUrl||"https://unpkg.com/@thorvg/lottie-player@latest/dist/gl-lite/thorvg.wasm":t+e})),!this._timer)return;clearInterval(this._timer),this._timer=void 0;const e=this.config?.renderer||"gl";if(await(async e=>{if("wg"===e){for(;"requested"===ge;)await ye(100);if("initialized"!==ge)for(ge="requested";;)switch(ue.init()){case 0:return void(ge="initialized");case 1:return void(ge="failed");case 2:await ye(100)}}})(e),"failed"===ge)return this.currentState="error",void this.dispatchEvent(new CustomEvent("error"));this.TVG=new ue.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(),i=window.innerWidth,a=window.innerHeight;let o=0,s=0,c=this.canvas.width,l=this.canvas.height;e<0&&(o=Math.abs(e),c-=o),r<0&&(s=Math.abs(r),l-=s),t>i&&(c-=t-i),n>a&&(l-=n-a),this.TVG.viewport(o,s,c,l)}_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.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.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.buffer,e.byteOffset,e.byteLength);t.length<1||(this._imageData=new ImageData(t,this.canvas.width,this.canvas.height),this._flush())}async _update(){if("playing"!==this.currentState)return!1;const e=this.TVG.duration(),t=Date.now()/1e3;if(this.currentFrame=(t-this._beginTime)/e*this.totalFrame*this.speed,-1===this.direction&&(this.currentFrame=this.totalFrame-this.currentFrame),1===this.direction&&this.currentFrame>=this.totalFrame||-1===this.direction&&this.currentFrame<=0){const e=this.count?"bounce"===this.mode?2*this.count:this.count:0;if(this.loop||e&&this._counter<e)return"bounce"===this.mode&&(this.direction=1===this.direction?-1:1,this.currentFrame=1===this.direction?0:this.totalFrame),this.count&&(this._counter+=1),await ye(this.intermission),this.play(),!0;this.dispatchEvent(new CustomEvent("complete")),this.currentState="stopped"}return this.dispatchEvent(new CustomEvent("frame",{detail:{frame:this.currentFrame}})),this.TVG.frame(this.currentFrame)}_frame(e){this.pause(),this.currentFrame=e,this.TVG.frame(e)}async load(e,t="json"){try{await this._init();const r=await(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(!("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(){ue.term(),ue=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)}getVersion(){return{THORVG_VERSION:"1.0.0"}}render(){return X`
1
+ "use strict";var e="undefined"!=typeof document?document.currentScript:null;const t=globalThis,r=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),i=new WeakMap;let s=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)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(r&&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 o=r?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return(e=>new s("string"==typeof e?e:e+"",void 0,n))(t)})(e):e,{is:a,defineProperty:c,getOwnPropertyDescriptor:l,getOwnPropertyNames:h,getOwnPropertySymbols:u,getPrototypeOf:d}=Object,b=globalThis,f=b.trustedTypes,p=f?f.emptyScript:"",m=b.reactiveElementPolyfillSupport,v=(e,t)=>e,w={toAttribute(e,t){switch(t){case Boolean:e=e?p:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(e){r=null}}return r}},g=(e,t)=>!a(e,t),y={attribute:!0,type:String,converter:w,reflect:!1,useDefault:!1,hasChanged:g};Symbol.metadata??=Symbol("metadata"),b.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=y){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&&c(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:i}=l(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:n,set(t){const s=n?.call(this);i?.call(this,t),this.requestUpdate(e,s,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??y}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const e=d(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(v("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(v("properties"))){const e=this.properties,t=[...h(e),...u(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(o(e))}else void 0!==e&&t.push(o(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,n)=>{if(r)e.adoptedStyleSheets=n.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const r of n){const n=document.createElement("style"),i=t.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=r.cssText,e.appendChild(n)}})(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 i=(void 0!==r.converter?.toAttribute?r.converter:w).toAttribute(t,r.type);this._$Em=e,null==i?this.removeAttribute(n):this.setAttribute(n,i),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),i="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:w;this._$Em=n;const s=i.fromAttribute(t,e.type);this[n]=s??this._$Ej?.get(n)??s,this._$Em=null}}requestUpdate(e,t,r){if(void 0!==e){const n=this.constructor,i=this[e];if(r??=n.getPropertyOptions(e),!((r.hasChanged??g)(i,t)||r.useDefault&&r.reflect&&i===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:i},s){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,s??t??this[e]),!0!==i||void 0!==s)||(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,m?.({ReactiveElement:_}),(b.reactiveElementVersions??=[]).push("2.1.1");const $={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:g},A=(e=$,t,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===n&&((e=Object.create(e)).wrapped=!0),s.set(r.name,e),"accessor"===n){const{name:n}=r;return{set(r){const i=t.get.call(this);t.set.call(this,r),this.requestUpdate(n,i,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 i=this[n];t.call(this,r),this.requestUpdate(n,i,e)}}throw Error("Unsupported decorator location: "+n)};function E(e){return(t,r)=>"object"==typeof r?A(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 S=globalThis,k=S.trustedTypes,x=k?k.createPolicy("lit-html",{createHTML:e=>e}):void 0,T="$lit$",P=`lit$${Math.random().toFixed(9).slice(2)}$`,R="?"+P,C=`<${R}>`,O=document,U=()=>O.createComment(""),j=e=>null===e||"object"!=typeof e&&"function"!=typeof e,L=Array.isArray,B="[ \t\n\f\r]",F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,M=/-->/g,D=/>/g,N=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),G=/'/g,I=/"/g,z=/^(?:script|style|textarea|title)$/i,V=(e,...t)=>({_$litType$:1,strings:e,values:t}),W=Symbol.for("lit-noChange"),H=Symbol.for("lit-nothing"),q=new WeakMap,X=O.createTreeWalker(O,129);function J(e,t){if(!L(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==x?x.createHTML(t):t}const K=(e,t)=>{const r=e.length-1,n=[];let i,s=2===t?"<svg>":3===t?"<math>":"",o=F;for(let t=0;t<r;t++){const r=e[t];let a,c,l=-1,h=0;for(;h<r.length&&(o.lastIndex=h,c=o.exec(r),null!==c);)h=o.lastIndex,o===F?"!--"===c[1]?o=M:void 0!==c[1]?o=D:void 0!==c[2]?(z.test(c[2])&&(i=RegExp("</"+c[2],"g")),o=N):void 0!==c[3]&&(o=N):o===N?">"===c[0]?(o=i??F,l=-1):void 0===c[1]?l=-2:(l=o.lastIndex-c[2].length,a=c[1],o=void 0===c[3]?N:'"'===c[3]?I:G):o===I||o===G?o=N:o===M||o===D?o=F:(o=N,i=void 0);const u=o===N&&e[t+1].startsWith("/>")?" ":"";s+=o===F?r+C:l>=0?(n.push(a),r.slice(0,l)+T+r.slice(l)+P+u):r+P+(-2===l?t:u)}return[J(e,s+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),n]};class Y{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let i=0,s=0;const o=e.length-1,a=this.parts,[c,l]=K(e,t);if(this.el=Y.createElement(c,r),X.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=X.nextNode())&&a.length<o;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(T)){const t=l[s++],r=n.getAttribute(e).split(P),o=/([.?@])?(.*)/.exec(t);a.push({type:1,index:i,name:o[2],strings:r,ctor:"."===o[1]?re:"?"===o[1]?ne:"@"===o[1]?ie:te}),n.removeAttribute(e)}else e.startsWith(P)&&(a.push({type:6,index:i}),n.removeAttribute(e));if(z.test(n.tagName)){const e=n.textContent.split(P),t=e.length-1;if(t>0){n.textContent=k?k.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],U()),X.nextNode(),a.push({type:2,index:++i});n.append(e[t],U())}}}else if(8===n.nodeType)if(n.data===R)a.push({type:2,index:i});else{let e=-1;for(;-1!==(e=n.data.indexOf(P,e+1));)a.push({type:7,index:i}),e+=P.length-1}i++}}static createElement(e,t){const r=O.createElement("template");return r.innerHTML=e,r}}function Q(e,t,r=e,n){if(t===W)return t;let i=void 0!==n?r._$Co?.[n]:r._$Cl;const s=j(t)?void 0:t._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),void 0===s?i=void 0:(i=new s(e),i._$AT(e,r,n)),void 0!==n?(r._$Co??=[])[n]=i:r._$Cl=i),void 0!==i&&(t=Q(e,i._$AS(e,t.values),i,n)),t}class Z{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??O).importNode(t,!0);X.currentNode=n;let i=X.nextNode(),s=0,o=0,a=r[0];for(;void 0!==a;){if(s===a.index){let t;2===a.type?t=new ee(i,i.nextSibling,this,e):1===a.type?t=new a.ctor(i,a.name,a.strings,this,e):6===a.type&&(t=new se(i,this,e)),this._$AV.push(t),a=r[++o]}s!==a?.index&&(i=X.nextNode(),s++)}return X.currentNode=O,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 ee{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=H,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),j(e)?e===H||null==e||""===e?(this._$AH!==H&&this._$AR(),this._$AH=H):e!==this._$AH&&e!==W&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>L(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!==H&&j(this._$AH)?this._$AA.nextSibling.data=e:this.T(O.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=Y.createElement(J(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{const e=new Z(n,this),r=e.u(this.options);e.p(t),this.T(r),this._$AH=e}}_$AC(e){let t=q.get(e.strings);return void 0===t&&q.set(e.strings,t=new Y(e)),t}k(e){L(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,n=0;for(const i of e)n===t.length?t.push(r=new ee(this.O(U()),this.O(U()),this,this.options)):r=t[n],r._$AI(i),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 te{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,i){this.type=1,this._$AH=H,this._$AN=void 0,this.element=e,this.name=t,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(e,t=this,r,n){const i=this.strings;let s=!1;if(void 0===i)e=Q(this,e,t,0),s=!j(e)||e!==this._$AH&&e!==W,s&&(this._$AH=e);else{const n=e;let o,a;for(e=i[0],o=0;o<i.length-1;o++)a=Q(this,n[r+o],t,o),a===W&&(a=this._$AH[o]),s||=!j(a)||a!==this._$AH[o],a===H?e=H:e!==H&&(e+=(a??"")+i[o+1]),this._$AH[o]=a}s&&!n&&this.j(e)}j(e){e===H?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class re extends te{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===H?void 0:e}}class ne extends te{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==H)}}class ie extends te{constructor(e,t,r,n,i){super(e,t,r,n,i),this.type=5}_$AI(e,t=this){if((e=Q(this,e,t,0)??H)===W)return;const r=this._$AH,n=e===H&&r!==H||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,i=e!==H&&(r===H||n);n&&this.element.removeEventListener(this.name,this,r),i&&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 se{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 oe=S.litHtmlPolyfillSupport;oe?.(Y,ee),(S.litHtmlVersions??=[]).push("3.3.1");const ae=globalThis;class ce 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 i=n._$litPart$;if(void 0===i){const e=r?.renderBefore??null;n._$litPart$=i=new ee(t.insertBefore(U(),e),e,void 0,r??{})}return i._$AI(e),i})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return W}}ce._$litElement$=!0,ce.finalized=!0,ae.litElementHydrateSupport?.({LitElement:ce});const le=ae.litElementPolyfillSupport;function he(e,t,r,n){var i,s=arguments.length,o=s<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 a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o}le?.({LitElement:ce}),(ae.litElementVersions??=[]).push("4.2.1");let ue=null,de=!1;var be=function(e){return e.JSON="json",e.LOT="lot",e.JPG="jpg",e.PNG="png",e.SVG="svg",e}({});const fe=e=>new Promise(t=>setTimeout(t,e));let pe="idle";class me extends ce{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(de)for(;!ue;)await fe(100);if(ue||(de=!0,ue=await async function(t={}){var r,n=t,i=!!globalThis.window,s=!!globalThis.WorkerGlobalScope,o=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;if(o){const{createRequire:t}=await Promise.resolve().then(function(){return ge});var a=t("undefined"==typeof document?require("url").pathToFileURL(__filename).href:e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("lottie-player.cjs.js",document.baseURI).href)}var c,l,h=(e,t)=>{throw t},u="undefined"==typeof document?require("url").pathToFileURL(__filename).href:e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("lottie-player.cjs.js",document.baseURI).href,d="";if(o){var b=a("fs");u.startsWith("file:")&&(d=a("path").dirname(a("url").fileURLToPath(u))+"/"),l=e=>(e=O(e)?new URL(e):e,b.readFileSync(e)),c=async e=>(e=O(e)?new URL(e):e,b.readFileSync(e,void 0)),process.argv.slice(2),h=(e,t)=>{throw process.exitCode=e,t}}else if(i||s){try{d=new URL(".",u).href}catch{}s&&(l=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),c=async e=>{if(O(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 f,p,m,v,w,g,y,_,$,A,E,S,k,x,T,P=function(){}.bind(),R=function(){}.bind(),C=!1,O=e=>e.startsWith("file://"),U=!1;function j(){var e=xr.buffer;w=new Int8Array(e),y=new Int16Array(e),g=new Uint8Array(e),_=new Uint16Array(e),$=new Int32Array(e),A=new Uint32Array(e),E=new Float32Array(e),S=new Float64Array(e),k=new BigInt64Array(e),x=new BigUint64Array(e)}function L(e){throw n.onAbort?.(e),R(e="Aborted("+e+")"),C=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),v?.(e),e}class B{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var F=e=>{for(;0<e.length;)e.shift()(n)},M=[],D=[],N=()=>{var e=n.preRun.shift();D.push(e)},G=!0,I=new TextDecoder,z=(e,t,r,n)=>{if(r=t+r,n)return r;for(;e[t]&&!(t>=r);)++t;return t},V=(e,t,r)=>e?I.decode(g.subarray(e,z(g,e,t,r))):"",W=e=>{for(var t="";;){var r=g[e++];if(!r)return t;t+=String.fromCharCode(r)}},H={},q={},X={},J=class extends Error{constructor(e){super(e),this.name="BindingError"}},K=e=>{throw new J(e)};function Y(e,t,r={}){return function(e,t,r={}){var n=t.name;if(!e)throw new J(`type "${n}" must have a positive integer typeid pointer`);if(q.hasOwnProperty(e)){if(r.od)return;throw new J(`Cannot register type '${n}' twice`)}q[e]=t,delete X[e],H.hasOwnProperty(e)&&(t=H[e],delete H[e],t.forEach(e=>e()))}(e,t,r)}var Q=(e,t,r)=>{switch(t){case 1:return r?e=>w[e]:e=>g[e];case 2:return r?e=>y[e>>1]:e=>_[e>>1];case 4:return r?e=>$[e>>2]:e=>A[e>>2];case 8:return r?e=>k[e>>3]:e=>x[e>>3];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Z=e=>{throw new J(e.eb.lb.jb.name+" instance already deleted")},ee=!1,te=()=>{},re=e=>globalThis.FinalizationRegistry?(ee=new FinalizationRegistry(e=>{--(e=e.eb).count.value,0===e.count.value&&(e.ob?e.tb.Fb(e.ob):e.lb.jb.Fb(e.ib))}),re=e=>{var t=e.eb;return t.ob&&ee.register(e,{eb:t},e),e},te=e=>{ee.unregister(e)},re(e)):(re=e=>e,e);function ne(){}var ie=(e,t)=>Object.defineProperty(t,"name",{value:e}),se={},oe=(e,t,r)=>{if(void 0===e[t].nb){var n=e[t];e[t]=function(...n){if(!e[t].nb.hasOwnProperty(n.length))throw new J(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${e[t].nb})!`);return e[t].nb[n.length].apply(this,n)},e[t].nb=[],e[t].nb[n.Sb]=n}},ae=(e,t,r)=>{if(n.hasOwnProperty(e)){if(void 0===r||void 0!==n[e].nb&&void 0!==n[e].nb[r])throw new J(`Cannot register public name '${e}' twice`);if(oe(n,e,e),n[e].nb.hasOwnProperty(r))throw new J(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`);n[e].nb[r]=t}else n[e]=t,n[e].Sb=r};function ce(e,t,r,n,i,s,o,a){this.name=e,this.constructor=t,this.Nb=r,this.Fb=n,this.qb=i,this.kd=s,this.$b=o,this.ed=a,this.wd=[]}var le=(e,t,r)=>{for(;t!==r;){if(!t.$b)throw new J(`Expected null or instance of ${r.name}, got an instance of ${t.name}`);e=t.$b(e),t=t.qb}return e},he=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e};function ue(e,t){if(null===t){if(this.rc)throw new J(`null is not a valid ${this.name}`);return 0}if(!t.eb)throw new J(`Cannot pass "${he(t)}" as a ${this.name}`);if(!t.eb.ib)throw new J(`Cannot pass deleted object as a pointer of type ${this.name}`);return le(t.eb.ib,t.eb.lb.jb,this.jb)}function de(e,t){if(null===t){if(this.rc)throw new J(`null is not a valid ${this.name}`);if(this.ec){var r=this.xd();return null!==e&&e.push(this.Fb,r),r}return 0}if(!t||!t.eb)throw new J(`Cannot pass "${he(t)}" as a ${this.name}`);if(!t.eb.ib)throw new J(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.dc&&t.eb.lb.dc)throw new J(`Cannot convert argument of type ${t.eb.tb?t.eb.tb.name:t.eb.lb.name} to parameter type ${this.name}`);if(r=le(t.eb.ib,t.eb.lb.jb,this.jb),this.ec){if(void 0===t.eb.ob)throw new J("Passing raw pointer to smart pointer is illegal");switch(this.zd){case 0:if(t.eb.tb!==this)throw new J(`Cannot convert argument of type ${t.eb.tb?t.eb.tb.name:t.eb.lb.name} to parameter type ${this.name}`);r=t.eb.ob;break;case 1:r=t.eb.ob;break;case 2:if(t.eb.tb===this)r=t.eb.ob;else{var n=t.clone();r=this.yd(r,Ne(()=>n.delete())),null!==e&&e.push(this.Fb,r)}break;default:throw new J("Unsupporting sharing policy")}}return r}function be(e,t){if(null===t){if(this.rc)throw new J(`null is not a valid ${this.name}`);return 0}if(!t.eb)throw new J(`Cannot pass "${he(t)}" as a ${this.name}`);if(!t.eb.ib)throw new J(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.eb.lb.dc)throw new J(`Cannot convert argument of type ${t.eb.lb.name} to parameter type ${this.name}`);return le(t.eb.ib,t.eb.lb.jb,this.jb)}function fe(e){return this.pb(A[e>>2])}var pe=(e,t,r)=>t===r?e:void 0===r.qb||null===(e=pe(e,t,r.qb))?null:r.ed(e),me={},ve=class extends Error{constructor(e){super(e),this.name="InternalError"}},we=(e,t)=>{if(!t.lb||!t.ib)throw new ve("makeClassHandle requires ptr and ptrType");if(!!t.tb!=!!t.ob)throw new ve("Both smartPtrType and smartPtr must be specified");return t.count={value:1},re(Object.create(e,{eb:{value:t,writable:!0}}))};function ye(e,t,r,n,i,s,o,a,c,l,h){this.name=e,this.jb=t,this.rc=r,this.dc=n,this.ec=i,this.vd=s,this.zd=o,this.Rc=a,this.xd=c,this.yd=l,this.Fb=h,i||void 0!==t.qb?this.ub=de:(this.ub=n?ue:be,this.vb=null)}var _e=(e,t,r)=>{if(!n.hasOwnProperty(e))throw new ve("Replacing nonexistent public symbol");void 0!==n[e].nb&&void 0!==r?n[e].nb[r]=t:(n[e]=t,n[e].Sb=r)},$e=(e,t)=>{e=W(e);var r=Tr.get(t);if("function"!=typeof r)throw new J(`unknown function pointer with signature ${e}: ${t}`);return r};class Ae extends Error{}var Ee=e=>{e=Er(e);var t=W(e);return Sr(e),t},Se=(e,t)=>{var r=[],n={};throw t.forEach(function e(t){n[t]||q[t]||(X[t]?X[t].forEach(e):(r.push(t),n[t]=!0))}),new Ae(`${e}: `+r.map(Ee).join([", "]))},ke=(e,t,r)=>{function n(t){if((t=r(t)).length!==e.length)throw new ve("Mismatched type converter count");for(var n=0;n<e.length;++n)Y(e[n],t[n])}e.forEach(e=>X[e]=t);var i=Array(t.length),s=[],o=0;for(let[e,r]of t.entries())q.hasOwnProperty(r)?i[e]=q[r]:(s.push(r),H.hasOwnProperty(r)||(H[r]=[]),H[r].push(()=>{i[e]=q[r],++o===s.length&&n(i)}));0===s.length&&n(i)},xe=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(A[t+4*n>>2]);return r},Te=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function Pe(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].vb)return!0;return!1}function Re(e,t,r,n,i,s){var o=t.length;if(2>o)throw new J("argTypes array size mismatch! Must at least get return value and 'this' types!");var a=null!==t[1]&&null!==r,c=Pe(t);r=!t[0].Nc;var l=t[0],h=t[1];for(n=[e,K,n,i,Te,l.pb.bind(l),h?.ub.bind(h)],i=2;i<o;++i)n.push((l=t[i]).ub.bind(l));if(!c)for(i=a?1:2;i<t.length;++i)null!==t[i].vb&&n.push(t[i].vb);for(c=Pe(t),i=t.length-2,h=[],l=["fn"],a&&l.push("thisWired"),o=0;o<i;++o)h.push(`arg${o}`),l.push(`arg${o}Wired`);h=h.join(","),l=l.join(","),h=`return function (${h}) {\n`,c&&(h+="var destructors = [];\n");var u=c?"destructors":"null",d="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(a&&(h+=`var thisWired = toClassParamWire(${u}, this);\n`),o=0;o<i;++o){var b=`toArg${o}Wire`;h+=`var arg${o}Wired = ${b}(${u}, arg${o});\n`,d.push(b)}if(h+=(r||s?"var rv = ":"")+`invoker(${l});\n`,c)h+="runDestructors(destructors);\n";else for(o=a?1:2;o<t.length;++o)s=1===o?"thisWired":"arg"+(o-2)+"Wired",null!==t[o].vb&&(h+=`${s}_dtor(${s});\n`,d.push(`${s}_dtor`));return r&&(h+="var ret = fromRetWire(rv);\nreturn ret;\n"),t=new Function(d,h+"}\n")(...n),ie(e,t)}var Ce,Oe,Ue,je,Le=e=>{const t=(e=e.trim()).indexOf("(");return-1===t?e:e.slice(0,t)},Be=[],Fe=[0,1,,1,null,1,!0,1,!1,1],Me=e=>{9<e&&0===--Fe[e+1]&&(Fe[e]=void 0,Be.push(e))},De=e=>{if(!e)throw new J(`Cannot use deleted val. handle = ${e}`);return Fe[e]},Ne=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const t=Be.pop()||Fe.length;return Fe[t]=e,Fe[t+1]=1,t}},Ge={name:"emscripten::val",pb:e=>{var t=De(e);return Me(e),t},ub:(e,t)=>Ne(t),Db:fe,vb:null},Ie=(e,t)=>{switch(t){case 4:return function(e){return this.pb(E[e>>2])};case 8:return function(e){return this.pb(S[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},ze=(e,t,r,n)=>{if(!(0<n))return 0;var i=r;n=r+n-1;for(var s=0;s<e.length;++s){var o=e.codePointAt(s);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,s++}}return t[r]=0,r-i},Ve=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},We=new TextDecoder("utf-16le"),He=(e,t,r)=>We.decode(_.subarray(e>>=1,z(_,e,t/2,r))),qe=(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 i=0;i<r;++i)y[t>>1]=e.charCodeAt(i),t+=2;return y[t>>1]=0,t-n},Xe=e=>2*e.length,Je=(e,t,r)=>{var n="";e>>=2;for(var i=0;!(i>=t/4);i++){var s=A[e+i];if(!s&&!r)break;n+=String.fromCodePoint(s)}return n},Ke=(e,t,r)=>{if(r??=2147483647,4>r)return 0;var n=t;r=n+r-4;for(var i=0;i<e.length;++i){var s=e.codePointAt(i);if(65535<s&&i++,$[t>>2]=s,(t+=4)+4>r)break}return $[t>>2]=0,t-n},Ye=e=>{for(var t=0,r=0;r<e.length;++r)65535<e.codePointAt(r)&&r++,t+=4;return t},Qe=0,Ze=[],et=(e,t,r)=>{var n=[];return e=e(n,r),n.length&&(A[t>>2]=Ne(n)),e},tt={},rt=e=>{var t=tt[e];return void 0===t?W(e):t},nt={},it=e=>{p=e,G||0<Qe||(n.onExit?.(e),C=!0),h(e,new B(e))},st=e=>{var t="ANGLE_instanced_arrays EXT_blend_minmax EXT_disjoint_timer_query EXT_frag_depth EXT_shader_texture_lod EXT_sRGB OES_element_index_uint OES_fbo_render_mipmap OES_standard_derivatives OES_texture_float OES_texture_half_float OES_texture_half_float_linear OES_vertex_array_object WEBGL_color_buffer_float WEBGL_depth_texture WEBGL_draw_buffers EXT_color_buffer_float EXT_conservative_depth EXT_disjoint_timer_query_webgl2 EXT_texture_norm16 NV_shader_noperspective_interpolation WEBGL_clip_cull_distance EXT_clip_control EXT_color_buffer_half_float EXT_depth_clamp EXT_float_blend EXT_polygon_offset_clamp EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_texture_float_linear WEBGL_blend_func_extended WEBGL_compressed_texture_astc WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context WEBGL_multi_draw WEBGL_polygon_mode".split(" ");return(e.getSupportedExtensions()||[]).filter(e=>t.includes(e))},ot=1,at=[],ct=[],lt=[],ht=[],ut=[],dt=[],bt=[],ft=[],pt=[1,1,2,2,4,4,4,2,3,4,8],mt=e=>{for(var t=ot++,r=e.length;r<t;r++)e[r]=null;for(;e[t];)t=ot++;return t},vt=(e,t,r,n)=>{for(var i=0;i<e;i++){var s=Ce[r](),o=s&&mt(n);s?(s.name=o,n[o]=s):Oe||=1282,$[t+4*i>>2]=o}},wt=["default","low-power","high-performance"],gt=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],yt=(e,t)=>{for(var r=0,n=e.length-1;0<=n;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},_t=e=>{var t="/"===e.charAt(0),r="/"===e.slice(-1);return(e=yt(e.split("/").filter(e=>!!e),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},$t=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):"."},At=e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],Et=e=>{(Et=(()=>{if(o){var e=a("crypto");return t=>e.randomFillSync(t)}return e=>crypto.getRandomValues(e)})())(e)},St=(...e)=>{for(var t="",r=!1,n=e.length-1;-1<=n&&!r;n--){if("string"!=typeof(r=0<=n?e[n]:br.cwd()))throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";t=r+"/"+t,r="/"===r.charAt(0)}return t=yt(t.split("/").filter(e=>!!e),!r).join("/"),(r?"/":"")+t||"."},kt=(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=St(e).slice(1),t=St(t).slice(1),e=r(e.split("/")),t=r(t.split("/"));for(var n=Math.min(e.length,t.length),i=n,s=0;s<n;s++)if(e[s]!==t[s]){i=s;break}for(n=[],s=i;s<e.length;s++)n.push("..");return(n=n.concat(t.slice(i))).join("/")},xt=e=>{var t=z(e,0);return I.decode(e.buffer?e.subarray(0,t):new Uint8Array(e.slice(0,t)))},Tt=[],Pt=e=>{var t=Array(Ve(e)+1);return e=ze(e,t,0,t.length),t.length=e,t},Rt=[];function Ct(e,t){Rt[e]={input:[],output:[],Pb:t},Vt(e,Ot)}var Ot={open(e){var t=Rt[e.node.rdev];if(!t)throw new br.cb(43);e.tty=t,e.seekable=!1},close(e){e.tty.Pb.fsync(e.tty)},fsync(e){e.tty.Pb.fsync(e.tty)},read(e,t,r,n){if(!e.tty||!e.tty.Pb.Ic)throw new br.cb(60);for(var i=0,s=0;s<n;s++){try{var o=e.tty.Pb.Ic(e.tty)}catch(e){throw new br.cb(29)}if(void 0===o&&0===i)throw new br.cb(6);if(null==o)break;i++,t[r+s]=o}return i&&(e.node.atime=Date.now()),i},write(e,t,r,n){if(!e.tty||!e.tty.Pb.wc)throw new br.cb(60);try{for(var i=0;i<n;i++)e.tty.Pb.wc(e.tty,t[r+i])}catch(e){throw new br.cb(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),i}},Ut={Ic(){e:{if(!Tt.length){var e=null;if(o){var t=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=b.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}Tt=Pt(e)}e=Tt.shift()}return e},wc(e,t){null===t||10===t?(P(xt(e.output)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){0<e.output?.length&&(P(xt(e.output)),e.output=[])},Xd:()=>({Hd:25856,Jd:5,Gd:191,Id:35387,Fd:[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]}),Yd:()=>0,Zd:()=>[24,80]},jt={wc(e,t){null===t||10===t?(R(xt(e.output)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){0<e.output?.length&&(R(xt(e.output)),e.output=[])}},Lt={Ab:null,kb:()=>Lt.createNode(null,"/",16895,0),createNode(e,t,r,n){if(24576==(61440&r)||br.isFIFO(r))throw new br.cb(63);return Lt.Ab||(Lt.Ab={dir:{node:{xb:Lt.fb.xb,zb:Lt.fb.zb,lookup:Lt.fb.lookup,Bb:Lt.fb.Bb,rename:Lt.fb.rename,unlink:Lt.fb.unlink,rmdir:Lt.fb.rmdir,readdir:Lt.fb.readdir,symlink:Lt.fb.symlink},stream:{rb:Lt.gb.rb}},file:{node:{xb:Lt.fb.xb,zb:Lt.fb.zb},stream:{rb:Lt.gb.rb,read:Lt.gb.read,write:Lt.gb.write,Ob:Lt.gb.Ob,Wb:Lt.gb.Wb}},link:{node:{xb:Lt.fb.xb,zb:Lt.fb.zb,readlink:Lt.fb.readlink},stream:{}},zc:{node:{xb:Lt.fb.xb,zb:Lt.fb.zb},stream:br.bd}}),Wt((r=br.createNode(e,t,r,n)).mode)?(r.fb=Lt.Ab.dir.node,r.gb=Lt.Ab.dir.stream,r.hb={}):br.isFile(r.mode)?(r.fb=Lt.Ab.file.node,r.gb=Lt.Ab.file.stream,r.mb=0,r.hb=null):40960==(61440&r.mode)?(r.fb=Lt.Ab.link.node,r.gb=Lt.Ab.link.stream):8192==(61440&r.mode)&&(r.fb=Lt.Ab.zc.node,r.gb=Lt.Ab.zc.stream),r.atime=r.mtime=r.ctime=Date.now(),e&&(e.hb[t]=r,e.atime=e.mtime=e.ctime=r.atime),r},Wd:e=>e.hb?e.hb.subarray?e.hb.subarray(0,e.mb):new Uint8Array(e.hb):new Uint8Array(0),fb:{xb(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=Wt(e.mode)?4096:br.isFile(e.mode)?e.mb: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},zb(e,t){for(var r of["mode","atime","mtime","ctime"])null!=t[r]&&(e[r]=t[r]);void 0!==t.size&&e.mb!=(t=t.size)&&(0==t?(e.hb=null,e.mb=0):(r=e.hb,e.hb=new Uint8Array(t),r&&e.hb.set(r.subarray(0,Math.min(t,e.mb))),e.mb=t))},lookup(){throw Lt.mc||(Lt.mc=new br.cb(44),Lt.mc.stack="<generic error, no stack>"),Lt.mc},Bb:(e,t,r,n)=>Lt.createNode(e,t,r,n),rename(e,t,r){try{var n=Ht(t,r)}catch(e){}if(n){if(Wt(e.mode))for(var i in n.hb)throw new br.cb(55);qt(n)}delete e.parent.hb[e.name],t.hb[r]=e,e.name=r,t.ctime=t.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,t){delete e.hb[t],e.ctime=e.mtime=Date.now()},rmdir(e,t){var r,n=Ht(e,t);for(r in n.hb)throw new br.cb(55);delete e.hb[t],e.ctime=e.mtime=Date.now()},readdir:e=>[".","..",...Object.keys(e.hb)],symlink:(e,t,r)=>((e=Lt.createNode(e,t,41471,0)).link=r,e),readlink(e){if(40960!=(61440&e.mode))throw new br.cb(28);return e.link}},gb:{read(e,t,r,n,i){var s=e.node.hb;if(i>=e.node.mb)return 0;if(8<(e=Math.min(e.node.mb-i,n))&&s.subarray)t.set(s.subarray(i,i+e),r);else for(n=0;n<e;n++)t[r+n]=s[i+n];return e},write(e,t,r,n,i,s){if(t.buffer===w.buffer&&(s=!1),!n)return 0;if((e=e.node).mtime=e.ctime=Date.now(),t.subarray&&(!e.hb||e.hb.subarray)){if(s)return e.hb=t.subarray(r,r+n),e.mb=n;if(0===e.mb&&0===i)return e.hb=t.slice(r,r+n),e.mb=n;if(i+n<=e.mb)return e.hb.set(t.subarray(r,r+n),i),n}var o=e.hb?e.hb.length:0;if(o>=(s=i+n)||(s=Math.max(s,o*(1048576>o?2:1.125)>>>0),0!=o&&(s=Math.max(s,256)),o=e.hb,e.hb=new Uint8Array(s),0<e.mb&&e.hb.set(o.subarray(0,e.mb),0)),e.hb.subarray&&t.subarray)e.hb.set(t.subarray(r,r+n),i);else for(s=0;s<n;s++)e.hb[i+s]=t[r+s];return e.mb=Math.max(e.mb,i+n),n},rb(e,t,r){if(1===r?t+=e.position:2===r&&br.isFile(e.node.mode)&&(t+=e.node.mb),0>t)throw new br.cb(28);return t},Ob(e,t,r,n,i){if(!br.isFile(e.node.mode))throw new br.cb(43);if(e=e.node.hb,2&i||!e||e.buffer!==w.buffer){if(n=!0,L(),!(i=void 0))throw new br.cb(48);e&&((0<r||r+t<e.length)&&(e=e.subarray?e.subarray(r,r+t):Array.prototype.slice.call(e,r,r+t)),w.set(e,i))}else n=!1,i=e.byteOffset;return{ib:i,Bd:n}},Wb:(e,t,r,n)=>(Lt.gb.write(e,t,0,n,r,!1),0)}},Bt=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},Ft=0,Mt=null,Dt=()=>{if(Ft--,n.monitorRunDependencies?.(Ft),0==Ft&&Mt){var e=Mt;Mt=null,e()}},Nt=()=>{Ft++,n.monitorRunDependencies?.(Ft)},Gt=[],It=async(e,t,r,n,i,s,o,a)=>{var l=t?St(_t(e+"/"+t)):e;Nt();try{var h=r;"string"==typeof r&&(h=await(async e=>(e=await c(e),new Uint8Array(e)))(r)),h=await(async(e,t)=>{for(var r of("undefined"!=typeof Browser&&zt(),Gt))if(r.canHandle(t))return r.handle(e,t);return e})(h,l),a?.(),s||Xt(e,t,h,n,i,o)}finally{Dt()}};function zt(){var e,t,r;br.qc=!0,e??=n.stdin,t??=n.stdout,r??=n.stderr,e?br.Eb("/dev","stdin",e):br.symlink("/dev/tty","/dev/stdin"),t?br.Eb("/dev","stdout",null,t):br.symlink("/dev/tty","/dev/stdout"),r?br.Eb("/dev","stderr",null,r):br.symlink("/dev/tty1","/dev/stderr"),br.open("/dev/stdin",0),br.open("/dev/stdout",1),br.open("/dev/stderr",1)}function Vt(e,t){br.Dc[e]={gb:t}}function Wt(e){return 16384==(61440&e)}function Ht(e,t){var r=Wt(e.mode)?(r=er(e,"x"))?r:e.fb.lookup?0:2:54;if(r)throw new br.cb(r);for(r=br.Cb[Yt(e.id,t)];r;r=r.Kb)if(r.parent.id===e.id&&r.name===t)return r;return br.lookup(e,t)}function qt(e){var t=Yt(e.parent.id,e.name);if(br.Cb[t]===e)br.Cb[t]=e.Kb;else for(t=br.Cb[t];t;){if(t.Kb===e){t.Kb=e.Kb;break}t=t.Kb}}function Xt(e,t,r,n,i,s){var o=t;if(e&&(e="string"==typeof e?e:Kt(e),o=t?_t(e+"/"+t):e),e=Bt(n,i),o=br.create(o,e),r){if("string"==typeof r){for(t=Array(r.length),n=0,i=r.length;n<i;++n)t[n]=r.charCodeAt(n);r=t}br.chmod(o,146|e),t=br.open(o,577),br.write(t,r,0,r.length,0,s),br.close(t),br.chmod(o,e)}}function Jt(e,t={}){if(!e)throw new br.cb(44);t.cc??(t.cc=!0),"/"===e.charAt(0)||(e=br.cwd()+"/"+e);var r=0;e:for(;40>r;r++){e=e.split("/").filter(e=>!!e);for(var n=br.root,i="/",s=0;s<e.length;s++){var o=s===e.length-1;if(o&&t.parent)break;if("."!==e[s])if(".."===e[s]){if(i=$t(i),br.sc(n)){e=i+"/"+e.slice(s+1).join("/"),r--;continue e}n=n.parent}else{i=_t(i+"/"+e[s]);try{n=Ht(n,e[s])}catch(e){if(44===e?.Ib&&o&&t.td)return{path:i};throw e}if(!n.yb||o&&!t.cc||(n=n.yb.root),40960==(61440&n.mode)&&(!o||t.wb)){if(!n.fb.readlink)throw new br.cb(52);"/"===(n=n.fb.readlink(n)).charAt(0)||(n=$t(i)+"/"+n),e=n+"/"+e.slice(s+1).join("/");continue e}}}return{path:i,node:n}}throw new br.cb(32)}function Kt(e){for(var t;;){if(br.sc(e))return e=e.kb.Pc,t?"/"!==e[e.length-1]?`${e}/${t}`:e+t:e;t=t?`${e.name}/${t}`:e.name,e=e.parent}}function Yt(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%br.Cb.length}function Qt(e){var t=Yt(e.parent.id,e.name);e.Kb=br.Cb[t],br.Cb[t]=e}function Zt(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function er(e,t){return br.Lc?0:!t.includes("r")||292&e.mode?t.includes("w")&&!(146&e.mode)||t.includes("x")&&!(73&e.mode)?2:0:2}function tr(e,t){if(!Wt(e.mode))return 54;try{return Ht(e,t),20}catch(e){}return er(e,"wx")}function rr(e,t,r){try{var n=Ht(e,t)}catch(e){return e.Ib}if(e=er(e,"wx"))return e;if(r){if(!Wt(n.mode))return 54;if(br.sc(n)||Kt(n)===br.cwd())return 10}else if(Wt(n.mode))return 31;return 0}function nr(e,t){if(!e)throw new br.cb(t);return e}function ir(e){if(!(e=br.nd(e)))throw new br.cb(8);return e}function sr(e,t=-1){if(e=Object.assign(new br.Zc,e),-1==t)e:{for(t=0;t<=br.ad;t++)if(!br.streams[t])break e;throw new br.cb(33)}return e.fd=t,br.streams[t]=e}function or(e,t,r){var n=e?.gb.zb;e=n?e:t,n??=t.fb.zb,nr(n,63),n(e,r)}function ar(e){var t=[];for(e=[e];e.length;){var r=e.pop();t.push(r),e.push(...r.Vb)}return t}function cr(e){var t={Ed:4096,Td:4096,blocks:1e6,Dd:5e5,Cd:5e5,files:br.vc,Rd:br.vc-1,Ud:42,flags:2,ee:255};return e.fb.Tc&&Object.assign(t,e.fb.Tc(e.kb.ud.root)),t}function lr(e,t,r){return void 0===r&&(r=t,t=438),br.Bb(e,8192|t,r)}function hr(e,t,r,n){or(e,t,{mode:4095&r|-4096&t.mode,ctime:Date.now(),Fc:n})}function ur(e,t,r){if(Wt(t.mode))throw new br.cb(31);if(!br.isFile(t.mode))throw new br.cb(28);var n=er(t,"w");if(n)throw new br.cb(n);or(e,t,{size:r,timestamp:Date.now()})}function dr(e){if(!(e.qd||e.rd||e.link||e.hb))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{e.hb=l(e.url)}catch(e){throw new br.cb(29)}}var br={root:null,Vb:[],Dc:{},streams:[],vc:1,Cb:null,Ac:"/",qc:!1,Lc:!0,jd:null,jc:0,Sc:{},cb:class{name="ErrnoError";constructor(e){this.Ib=e}},Zc:class{sb={};node=null;get object(){return this.node}set object(e){this.node=e}get flags(){return this.sb.flags}set flags(e){this.sb.flags=e}get position(){return this.sb.position}set position(e){this.sb.position=e}},Yc:class{fb={};gb={};yb=null;constructor(e,t,r,n){e||=this,this.parent=e,this.kb=e.kb,this.id=br.vc++,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 rd(){return Wt(this.mode)}get qd(){return 8192==(61440&this.mode)}},createNode:(e,t,r,n)=>(Qt(e=new br.Yc(e,t,r,n)),e),sc:e=>e===e.parent,isFile:e=>32768==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),ad:4096,nd:e=>br.streams[e],Od:(e,t=-1)=>(e=sr(e,t),e.gb?.Nd?.(e),e),bd:{open(e){e.gb=br.ld(e.node.rdev).gb,e.gb.open?.(e)},rb(){throw new br.cb(70)}},tc:e=>e>>8,ae:e=>255&e,Jb:(e,t)=>e<<8|t,ld:e=>br.Dc[e],Uc(e,t){function r(e){return br.jc--,t(e)}function n(e){if(e){if(!n.gd)return n.gd=!0,r(e)}else++o>=s.length&&r(null)}"function"==typeof e&&(t=e,e=!1),br.jc++,1<br.jc&&R(`warning: ${br.jc} FS.syncfs operations in flight at once, probably just doing extra work`);var i,s=ar(br.root.kb),o=0;for(i of s)i.type.Uc?i.type.Uc(i,e,n):n(null)},kb(e,t,r){var n="/"===r;if(n&&br.root)throw new br.cb(10);if(!n&&r){var i=Jt(r,{cc:!1});if(r=i.path,(i=i.node).yb)throw new br.cb(10);if(!Wt(i.mode))throw new br.cb(54)}return(e=e.kb(t={type:e,ud:t,Pc:r,Vb:[]})).kb=t,t.root=e,n?br.root=e:i&&(i.yb=t,i.kb&&i.kb.Vb.push(t)),e},ne(e){if(!(e=Jt(e,{cc:!1})).node.yb)throw new br.cb(28);var t=(e=e.node).yb,r=ar(t);for([,i]of Object.entries(br.Cb))for(;i;){var n=i.Kb;r.includes(i.kb)&&qt(i);var i=n}e.yb=null,e.kb.Vb.splice(e.kb.Vb.indexOf(t),1)},lookup:(e,t)=>e.fb.lookup(e,t),Bb(e,t,r){var n=Jt(e,{parent:!0}).node;if(!(e=At(e)))throw new br.cb(28);if("."===e||".."===e)throw new br.cb(20);var i=tr(n,e);if(i)throw new br.cb(i);if(!n.fb.Bb)throw new br.cb(63);return n.fb.Bb(n,e,t,r)},Tc:e=>cr(Jt(e,{wb:!0}).node),le:e=>cr(e.node),create:(e,t=438)=>br.Bb(e,4095&t|32768,0),mkdir:(e,t=511)=>br.Bb(e,1023&t|16384,0),ce(e,t){var r,n=e.split("/"),i="";for(r of n)if(r){(i||"/"===e.charAt(0))&&(i+="/"),i+=r;try{br.mkdir(i,t)}catch(e){if(20!=e.Ib)throw e}}},symlink(e,t){if(!St(e))throw new br.cb(44);var r=Jt(t,{parent:!0}).node;if(!r)throw new br.cb(44);var n=tr(r,t=At(t));if(n)throw new br.cb(n);if(!r.fb.symlink)throw new br.cb(63);return r.fb.symlink(r,t,e)},rename(e,t){var r=$t(e),n=$t(t),i=At(e),s=At(t),o=Jt(e,{parent:!0}),a=o.node;if(o=(o=Jt(t,{parent:!0})).node,!a||!o)throw new br.cb(44);if(a.kb!==o.kb)throw new br.cb(75);var c=Ht(a,i);if("."!==(e=kt(e,n)).charAt(0))throw new br.cb(28);if("."!==(e=kt(t,r)).charAt(0))throw new br.cb(55);try{var l=Ht(o,s)}catch(e){}if(c!==l){if(i=rr(a,i,t=Wt(c.mode)))throw new br.cb(i);if(i=l?rr(o,s,t):tr(o,s))throw new br.cb(i);if(!a.fb.rename)throw new br.cb(63);if(c.yb||l&&l.yb)throw new br.cb(10);if(o!==a&&(i=er(a,"w")))throw new br.cb(i);qt(c);try{a.fb.rename(c,o,s),c.parent=o}catch(e){throw e}finally{Qt(c)}}},rmdir(e){var t=Jt(e,{parent:!0}).node,r=Ht(t,e=At(e)),n=rr(t,e,!0);if(n)throw new br.cb(n);if(!t.fb.rmdir)throw new br.cb(63);if(r.yb)throw new br.cb(10);t.fb.rmdir(t,e),qt(r)},readdir:e=>nr((e=Jt(e,{wb:!0}).node).fb.readdir,54)(e),unlink(e){var t=Jt(e,{parent:!0}).node;if(!t)throw new br.cb(44);var r=Ht(t,e=At(e)),n=rr(t,e,!1);if(n)throw new br.cb(n);if(!t.fb.unlink)throw new br.cb(63);if(r.yb)throw new br.cb(10);t.fb.unlink(t,e),qt(r)},readlink(e){if(!(e=Jt(e).node))throw new br.cb(44);if(!e.fb.readlink)throw new br.cb(28);return e.fb.readlink(e)},stat:(e,t)=>nr((e=Jt(e,{wb:!t}).node).fb.xb,63)(e),fstat(e){var t=ir(e);e=t.node;var r=t.gb.xb;return t=r?t:e,r??=e.fb.xb,nr(r,63),r(t)},lstat:e=>br.stat(e,!0),chmod(e,t,r){hr(null,e="string"==typeof e?Jt(e,{wb:!r}).node:e,t,r)},lchmod(e,t){br.chmod(e,t,!0)},fchmod(e,t){hr(e=ir(e),e.node,t,!1)},chown(e,t,r,n){or(null,e="string"==typeof e?Jt(e,{wb:!n}).node:e,{timestamp:Date.now(),Fc:n})},lchown(e,t,r){br.chown(e,t,r,!0)},fchown(e){or(e=ir(e),e.node,{timestamp:Date.now(),Fc:!1})},truncate(e,t){if(0>t)throw new br.cb(28);ur(null,e="string"==typeof e?Jt(e,{wb:!0}).node:e,t)},Vd(e,t){if(e=ir(e),0>t||!(2097155&e.flags))throw new br.cb(28);ur(e,e.node,t)},oe(e,t,r){nr((e=Jt(e,{wb:!0}).node).fb.zb,63)(e,{atime:t,mtime:r})},open(e,t,r=438){if(""===e)throw new br.cb(44);if("string"==typeof t){var i={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[t];if(void 0===i)throw Error(`Unknown file open mode: ${t}`);t=i}if(r=64&t?4095&r|32768:0,"object"==typeof e)i=e;else{var s=e.endsWith("/");i=(e=Jt(e,{wb:!(131072&t),td:!0})).node,e=e.path}var o=!1;if(64&t)if(i){if(128&t)throw new br.cb(20)}else{if(s)throw new br.cb(31);i=br.Bb(e,511|r,0),o=!0}if(!i)throw new br.cb(44);if(8192==(61440&i.mode)&&(t&=-513),65536&t&&!Wt(i.mode))throw new br.cb(54);if(!o&&(s=i?40960==(61440&i.mode)?32:Wt(i.mode)&&("r"!==Zt(t)||576&t)?31:er(i,Zt(t)):44))throw new br.cb(s);return 512&t&&!o&&br.truncate(i,0),t&=-131713,(s=sr({node:i,path:Kt(i),flags:t,seekable:!0,position:0,gb:i.gb,Ad:[],error:!1})).gb.open&&s.gb.open(s),o&&br.chmod(i,511&r),!n.logReadFiles||1&t||e in br.Sc||(br.Sc[e]=1),s},close(e){if(null===e.fd)throw new br.cb(8);e.pc&&(e.pc=null);try{e.gb.close&&e.gb.close(e)}catch(e){throw e}finally{br.streams[e.fd]=null}e.fd=null},rb(e,t,r){if(null===e.fd)throw new br.cb(8);if(!e.seekable||!e.gb.rb)throw new br.cb(70);if(0!=r&&1!=r&&2!=r)throw new br.cb(28);return e.position=e.gb.rb(e,t,r),e.Ad=[],e.position},read(e,t,r,n,i){if(0>n||0>i)throw new br.cb(28);if(null===e.fd)throw new br.cb(8);if(1==(2097155&e.flags))throw new br.cb(8);if(Wt(e.node.mode))throw new br.cb(31);if(!e.gb.read)throw new br.cb(28);var s=void 0!==i;if(s){if(!e.seekable)throw new br.cb(70)}else i=e.position;return t=e.gb.read(e,t,r,n,i),s||(e.position+=t),t},write(e,t,r,n,i,s){if(0>n||0>i)throw new br.cb(28);if(null===e.fd)throw new br.cb(8);if(!(2097155&e.flags))throw new br.cb(8);if(Wt(e.node.mode))throw new br.cb(31);if(!e.gb.write)throw new br.cb(28);e.seekable&&1024&e.flags&&br.rb(e,0,2);var o=void 0!==i;if(o){if(!e.seekable)throw new br.cb(70)}else i=e.position;return t=e.gb.write(e,t,r,n,i,s),o||(e.position+=t),t},Ob(e,t,r,n,i){if(2&n&&!(2&i)&&2!=(2097155&e.flags))throw new br.cb(2);if(1==(2097155&e.flags))throw new br.cb(2);if(!e.gb.Ob)throw new br.cb(43);if(!t)throw new br.cb(28);return e.gb.Ob(e,t,r,n,i)},Wb:(e,t,r,n,i)=>e.gb.Wb?e.gb.Wb(e,t,r,n,i):0,Mc(e,t,r){if(!e.gb.Mc)throw new br.cb(59);return e.gb.Mc(e,t,r)},readFile(e,t={}){t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding&&L(`Invalid encoding type "${t.encoding}"`);var r=br.open(e,t.flags);e=br.stat(e).size;var n=new Uint8Array(e);return br.read(r,n,0,e,0),"utf8"===t.encoding&&(n=xt(n)),br.close(r),n},writeFile(e,t,r={}){r.flags=r.flags||577,e=br.open(e,r.flags,r.mode),"string"==typeof t&&(t=new Uint8Array(Pt(t))),ArrayBuffer.isView(t)?br.write(e,t,0,t.byteLength,void 0,r.Kd):L("Unsupported data type"),br.close(e)},cwd:()=>br.Ac,chdir(e){if(null===(e=Jt(e,{wb:!0})).node)throw new br.cb(44);if(!Wt(e.node.mode))throw new br.cb(54);var t=er(e.node,"x");if(t)throw new br.cb(t);br.Ac=e.path},ie(){for(var e of(br.qc=!1,br.streams))e&&br.close(e)},Sd(e,t){try{var r=Jt(e,{wb:!t});e=r.path}catch(e){}var n=!1,i=null;try{r=Jt(e,{parent:!0}),At(e),r=Jt(e,{wb:!t}),n=!0,i=r.node}catch(e){}return n?i:null},Eb(e,t,r,n){var i;return e=((e,t)=>_t(e+"/"+t))("string"==typeof e?e:Kt(e),t),t=Bt(!!r,!!n),(i=br.Eb).tc??(i.tc=64),Vt(i=br.Jb(br.Eb.tc++,0),{open(e){e.seekable=!1},close(){n?.buffer?.length&&n(10)},read(e,t,n,i){for(var s=0,o=0;o<i;o++){try{var a=r()}catch(e){throw new br.cb(29)}if(void 0===a&&0===s)throw new br.cb(6);if(null==a)break;s++,t[n+o]=a}return s&&(e.node.atime=Date.now()),s},write(e,t,r,i){for(var s=0;s<i;s++)try{n(t[r+s])}catch(e){throw new br.cb(29)}return i&&(e.node.mtime=e.node.ctime=Date.now()),s}}),lr(e,t,i)}},fr=e=>"]"==e.slice(-1)&&e.lastIndexOf("["),pr=[],mr=e=>0==(e-=5120)?w:1==e?g:2==e?y:4==e?$:6==e?E:5==e||28922==e||28520==e||30779==e||30782==e?A:_,vr=e=>{var t=Ce.dd;if(t){var r=t.Zb[e];return"number"==typeof r&&(t.Zb[e]=r=Ce.getUniformLocation(t,t.Vc[e]+(0<r?`[${r}]`:""))),r}Oe||=1282},wr=[],gr=[];(()=>{let e=ne.prototype;Object.assign(e,{isAliasOf:function(e){if(!(this instanceof ne&&e instanceof ne))return!1;var t=this.eb.lb.jb,r=this.eb.ib;e.eb=e.eb;var n=e.eb.lb.jb;for(e=e.eb.ib;t.qb;)r=t.$b(r),t=t.qb;for(;n.qb;)e=n.$b(e),n=n.qb;return t===n&&r===e},clone:function(){if(this.eb.ib||Z(this),this.eb.Xb)return this.eb.count.value+=1,this;var e=re,t=Object,r=t.create,n=Object.getPrototypeOf(this),i=this.eb;return(e=e(r.call(t,n,{eb:{value:{count:i.count,Ub:i.Ub,Xb:i.Xb,ib:i.ib,lb:i.lb,ob:i.ob,tb:i.tb}}}))).eb.count.value+=1,e.eb.Ub=!1,e},delete(){if(this.eb.ib||Z(this),this.eb.Ub&&!this.eb.Xb)throw new J("Object already scheduled for deletion");te(this);var e=this.eb;--e.count.value,0===e.count.value&&(e.ob?e.tb.Fb(e.ob):e.lb.jb.Fb(e.ib)),this.eb.Xb||(this.eb.ob=void 0,this.eb.ib=void 0)},isDeleted:function(){return!this.eb.ib},deleteLater:function(){if(this.eb.ib||Z(this),this.eb.Ub&&!this.eb.Xb)throw new J("Object already scheduled for deletion");return this.eb.Ub=!0,this}});const t=Symbol.dispose;t&&(e[t]=e.delete)})(),Object.assign(ye.prototype,{md(e){return this.Rc&&(e=this.Rc(e)),e},Cc(e){this.Fb?.(e)},Db:fe,pb:function(e){function t(){return we(this.jb.Nb,this.ec?{lb:this.vd,ib:r,tb:this,ob:e}:{lb:this,ib:e})}var r=this.md(e);if(!r)return this.Cc(e),null;var n=((e,t)=>{if(void 0===t)throw new J("ptr should not be undefined");for(;e.qb;)t=e.$b(t),e=e.qb;return me[t]})(this.jb,r);if(void 0!==n)return 0===n.eb.count.value?(n.eb.ib=r,n.eb.ob=e,n.clone()):(n=n.clone(),this.Cc(e),n);if(n=this.jb.kd(r),!(n=se[n]))return t.call(this);var i=pe(r,this.jb,(n=this.dc?n.cd:n.pointerType).jb);return null===i?t.call(this):we(n.jb.Nb,this.ec?{lb:n,ib:i,tb:this,ob:e}:{lb:n,ib:i})}}),"undefined"!=typeof MainLoop&&MainLoop.fe.push(()=>{if(Ue){var e=Ue.Rb;for(Ue.Rb=Ue.Yb,Ue.Yb=e,e=Ue.Gb,Ue.Gb=Ue.kc,Ue.kc=e,e=0;21>=e;++e)Ue.Gb[e]=0}}),br.Ld=(e,t,r,n,i,s,o,a,c,l)=>{It(e,t,r,n,i,a,c,l).then(s).catch(o)},br.ge=It,br.Cb=Array(4096),br.kb(Lt,{},"/"),br.mkdir("/tmp"),br.mkdir("/home"),br.mkdir("/home/web_user"),function(){br.mkdir("/dev"),Vt(br.Jb(1,3),{read:()=>0,write:(e,t,r,n)=>n,rb:()=>0}),lr("/dev/null",br.Jb(1,3)),Ct(br.Jb(5,0),Ut),Ct(br.Jb(6,0),jt),lr("/dev/tty",br.Jb(5,0)),lr("/dev/tty1",br.Jb(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(Et(e),t=e.byteLength),e[--t]);br.Eb("/dev","random",r),br.Eb("/dev","urandom",r),br.mkdir("/dev/shm"),br.mkdir("/dev/shm/tmp")}(),function(){br.mkdir("/proc");var e=br.mkdir("/proc/self");br.mkdir("/proc/self/fd"),br.kb({kb(){var t=br.createNode(e,"fd",16895,73);return t.gb={rb:Lt.gb.rb},t.fb={lookup(e,t){var r=ir(e=+t);return(e={parent:null,kb:{Pc:"fake"},fb:{readlink:()=>r.path},id:e+1}).parent=e},readdir:()=>Array.from(br.streams.entries()).filter(([,e])=>e).map(([e])=>e.toString())},t}},{},"/proc/self/fd")}(),br.jd={MEMFS:Lt};for(let e=0;32>e;++e)pr.push(Array(e));for(var yr=new Int32Array(288),_r=0;288>=_r;++_r)wr[_r]=yr.subarray(0,_r);var $r=new Float32Array(288);for(_r=0;288>=_r;++_r)gr[_r]=$r.subarray(0,_r);if(n.noExitRuntime&&(G=n.noExitRuntime),n.preloadPlugins&&(Gt=n.preloadPlugins),n.print&&(P=n.print),n.printErr&&(R=n.printErr),n.wasmBinary&&(f=n.wasmBinary),n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.shift()();n.addRunDependency=Nt,n.removeRunDependency=Dt,n.FS_preloadFile=It,n.FS_unlink=(...e)=>br.unlink(...e),n.FS_createPath=(...e)=>function(e,t){for(e="string"==typeof e?e:Kt(e),t=t.split("/").reverse();t.length;){var r=t.pop();if(r){var n=_t(e+"/"+r);try{br.mkdir(n)}catch(e){if(20!=e.Ib)throw e}e=n}}return n}(...e),n.FS_createDevice=(...e)=>br.Eb(...e),n.FS=br,n.FS_createDataFile=(...e)=>Xt(...e),n.FS_createLazyFile=(...e)=>function(e,t,r,n,i){class o{oc=!1;sb=[];nc=void 0;Jc=0;Hc=0;get(e){if(!(e>this.length-1||0>e)){var t=e%this.chunkSize;return this.nc(e/this.chunkSize|0)[t]}}sd(e){this.nc=e}Kc(){var e=new XMLHttpRequest;e.open("HEAD",r,!1),e.send(null),200<=e.status&&300>e.status||304===e.status||L("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),i=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t;e=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t;var s=1048576;i||(s=n);var o=this;o.sd(e=>{var t=e*s,i=(e+1)*s-1;if(i=Math.min(i,n-1),void 0===o.sb[e]){var a=o.sb;t>i&&L("invalid range ("+t+", "+i+") or no bytes requested!"),i>n-1&&L("only "+n+" bytes available! programmer error!");var c=new XMLHttpRequest;c.open("GET",r,!1),n!==s&&c.setRequestHeader("Range","bytes="+t+"-"+i),c.responseType="arraybuffer",c.overrideMimeType&&c.overrideMimeType("text/plain; charset=x-user-defined"),c.send(null),200<=c.status&&300>c.status||304===c.status||L("Couldn't load "+r+". Status: "+c.status),t=void 0!==c.response?new Uint8Array(c.response||[]):Pt(c.responseText||""),a[e]=t}return void 0===o.sb[e]&&L("doXHR failed!"),o.sb[e]}),!e&&n||(s=n=1,s=n=this.nc(0).length,P("LazyFiles on gzip forces download of the whole file when length is accessed")),this.Jc=n,this.Hc=s,this.oc=!0}get length(){return this.oc||this.Kc(),this.Jc}get chunkSize(){return this.oc||this.Kc(),this.Hc}}if(globalThis.XMLHttpRequest){s||L("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var a=new o,c=void 0}else c=r,a=void 0;var l=function(e,t,r,n){return e="string"==typeof e?e:Kt(e),t=_t(e+"/"+t),br.create(t,Bt(r,n))}(e,t,n,i);a?l.hb=a:c&&(l.hb=null,l.url=c),Object.defineProperties(l,{mb:{get:function(){return this.hb.length}}}),e={};for(const[t,r]of Object.entries(l.gb))e[t]=(...e)=>(dr(l),r(...e));return e.read=(e,t,r,n,i)=>{if(dr(l),i>=(e=e.node.hb).length)t=0;else{if(n=Math.min(e.length-i,n),e.slice)for(var s=0;s<n;s++)t[r+s]=e[i+s];else for(s=0;s<n;s++)t[r+s]=e.get(i+s);t=n}return t},e.Ob=()=>{throw dr(l),L(),new br.cb(48)},l.gb=e,l}(...e);var Ar,Er,Sr,kr,xr,Tr,Pr,Rr={v:(e,t,r,n)=>L(`Assertion failed: ${V(e)}, at: `+[t?V(t):"unknown filename",r,n?V(n):"unknown function"]),ca:()=>L(""),Y:(e,t,r,n,i)=>{t=W(t);let s=e=>e;if(n=0n===n){const e=8*r;s=t=>BigInt.asUintN(e,t),i=s(i)}Y(e,{name:t,pb:s,ub:(e,t)=>("number"==typeof t&&(t=BigInt(t)),t),Db:Q(t,r,!n),vb:null})},Pa:(e,t,r,n)=>{Y(e,{name:t=W(t),pb:function(e){return!!e},ub:function(e,t){return t?r:n},Db:function(e){return this.pb(g[e])},vb:null})},Na:(e,t,r,n,i,s,o,a,c,l,h,u,d)=>{h=W(h),s=$e(i,s),a&&=$e(o,a),l&&=$e(c,l),d=$e(u,d);var b=(e=>{var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e})(h);ae(b,function(){Se(`Cannot construct ${h} due to unbound types`,[n])}),ke([e,t,r],n?[n]:[],t=>{if(t=t[0],n)var r=t.jb,i=r.Nb;else i=ne.prototype;t=ie(h,function(...e){if(Object.getPrototypeOf(this)!==o)throw new J(`Use 'new' to construct ${h}`);if(void 0===u.Hb)throw new J(`${h} has no accessible constructor`);var t=u.Hb[e.length];if(void 0===t)throw new J(`Tried to invoke ctor of ${h} with invalid number of parameters (${e.length}) - expected (${Object.keys(u.Hb).toString()}) parameters instead!`);return t.apply(this,e)});var o=Object.create(i,{constructor:{value:t}});t.prototype=o;var c,u=new ce(h,t,o,d,r,s,a,l);return u.qb&&((c=u.qb).yc??(c.yc=[]),u.qb.yc.push(u)),r=new ye(h,u,!0,!1,!1),c=new ye(h+"*",u,!1,!1,!1),i=new ye(h+" const*",u,!1,!0,!1),se[e]={pointerType:c,cd:i},_e(b,t),[r,c,i]})},Da:(e,t,r,n,i,s)=>{var o=xe(t,r);i=$e(n,i),ke([],[e],e=>{var r=`constructor ${(e=e[0]).name}`;if(void 0===e.jb.Hb&&(e.jb.Hb=[]),void 0!==e.jb.Hb[t-1])throw new J(`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.jb.Hb[t-1]=()=>{Se(`Cannot construct ${e.name} due to unbound types`,o)},ke([],o,n=>(n.splice(1,0,null),e.jb.Hb[t-1]=Re(r,n,null,i,s),[])),[]})},h:(e,t,r,n,i,s,o,a,c)=>{var l=xe(r,n);t=W(t),t=Le(t),s=$e(i,s),ke([],[e],e=>{function n(){Se(`Cannot call ${i} due to unbound types`,l)}var i=`${(e=e[0]).name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),a&&e.jb.wd.push(t);var h=e.jb.Nb,u=h[t];return void 0===u||void 0===u.nb&&u.className!==e.name&&u.Sb===r-2?(n.Sb=r-2,n.className=e.name,h[t]=n):(oe(h,t,i),h[t].nb[r-2]=n),ke([],l,n=>(n=Re(i,n,e,s,o,c),void 0===h[t].nb?(n.Sb=r-2,h[t]=n):h[t].nb[r-2]=n,[])),[]})},Ma:e=>Y(e,Ge),X:(e,t,r)=>{Y(e,{name:t=W(t),pb:e=>e,ub:(e,t)=>t,Db:Ie(t,r),vb:null})},_:(e,t,r,n,i,s,o)=>{var a=xe(t,r);e=W(e),e=Le(e),i=$e(n,i),ae(e,function(){Se(`Cannot call ${e} due to unbound types`,a)},t-1),ke([],a,r=>(r=[r[0],null].concat(r.slice(1)),_e(e,Re(e,r,null,i,s,o),t-1),[]))},l:(e,t,r,n,i)=>{t=W(t);let s=e=>e;if(0===n){var o=32-8*r;s=e=>e<<o>>>o,i=s(i)}Y(e,{name:t,pb:s,ub:(e,t)=>t,Db:Q(t,r,0!==n),vb:null})},c:(e,t,r)=>{function n(e){return new i(w.buffer,A[e+4>>2],A[e>>2])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];Y(e,{name:r=W(r),pb:n,Db:n},{od:!0})},Oa:(e,t)=>{Y(e,{name:t=W(t),pb(e){var t=V(e+4,A[e>>2],!0);return Sr(e),t},ub(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 J("Cannot pass non-string to std::string");var n=r?Ve(t):t.length,i=Ar(4+n+1),s=i+4;return A[i>>2]=n,r?ze(t,g,s,n+1):g.set(t,s),null!==e&&e.push(Sr,i),i},Db:fe,vb(e){Sr(e)}})},E:(e,t,r)=>{if(r=W(r),2===t)var n=He,i=qe,s=Xe;else n=Je,i=Ke,s=Ye;Y(e,{name:r,pb:e=>{var r=n(e+4,A[e>>2]*t,!0);return Sr(e),r},ub:(e,n)=>{if("string"!=typeof n)throw new J(`Cannot pass non-string to C++ string type ${r}`);var o=s(n),a=Ar(4+o+t);return A[a>>2]=o/t,i(n,a+4,o+t),null!==e&&e.push(Sr,a),a},Db:fe,vb(e){Sr(e)}})},F:e=>{Y(e,Ge)},Qa:(e,t)=>{Y(e,{Nc:!0,name:t=W(t),pb:()=>{},ub:()=>{}})},Ua:()=>{G=!1,Qe=0},n:(e,t,r)=>{var[n,...i]=((e,t)=>{for(var r=Array(e),n=0;n<e;++n){var i=n,s=A[t+4*n>>2],o=q[s];if(void 0===o)throw e=`parameter ${n} has unknown type ${Ee(s)}`,new J(e);r[i]=o}return r})(e,t);t=n.ub.bind(n);var s=i.map(e=>e.Db.bind(e));e--;var o={toValue:De};switch(e=s.map((e,t)=>{var r=`argFromPtr${t}`;return o[r]=e,`${r}(args${t?"+"+8*t:""})`}),r){case 0:var a="toValue(handle)";break;case 2:a="new (toValue(handle))";break;case 3:a="";break;case 1:o.getStringOrSymbol=rt,a="toValue(handle)[getStringOrSymbol(methodName)]"}return a+=`(${e})`,n.Nc||(o.toReturnWire=t,o.emval_returnValue=et,a=`return emval_returnValue(toReturnWire, destructorsRef, ${a})`),a=`return function (handle, methodName, destructorsRef, args) {\n ${a}\n }`,r=new Function(Object.keys(o),a)(...Object.values(o)),a=`methodCaller<(${i.map(e=>e.name)}) => ${n.name}>`,(e=>{var t=Ze.length;return Ze.push(e),t})(ie(a,r))},Ja:Me,Ra:e=>e?(e=rt(e),Ne(globalThis[e])):Ne(globalThis),t:(e,t)=>(e=De(e),t=De(t),Ne(e[t])),Z:e=>{9<e&&(Fe[e+1]+=1)},m:(e,t,r,n,i)=>Ze[e](t,r,n,i),Sa:e=>Ne(rt(e)),Wa:e=>{var t=De(e);Te(t),Me(e)},Va:(e,t)=>{if(nt[e]&&(clearTimeout(nt[e].id),delete nt[e]),!t)return 0;var r=setTimeout(()=>{delete nt[e],(e=>{if(!C)try{if(e(),!(G||0<Qe))try{p=e=p,it(e)}catch(e){e instanceof B||"unwind"==e||h(1,e)}}catch(e){e instanceof B||"unwind"==e||h(1,e)}})(()=>kr(e,performance.now()))},t);return nt[e]={id:r,me:t},0},da:e=>{var t=g.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))-xr.buffer.byteLength+65535)/65536|0;try{xr.grow(n),j();var i=1;break e}catch(e){}i=void 0}if(i)return!0}return!1},va:(e,t)=>{var r=t>>2;return t={alpha:!!w[t+0],depth:!!w[t+1],stencil:!!w[t+2],antialias:!!w[t+3],premultipliedAlpha:!!w[t+4],preserveDrawingBuffer:!!w[t+5],powerPreference:wt[$[r+2]],failIfMajorPerformanceCaveat:!!w[t+12],Oc:$[r+4],be:$[r+5],Gc:w[t+24],hd:w[t+25],he:$[r+7],ke:w[t+32]},e=2<e?V(e):e,!(e=gt[e]||("undefined"!=typeof document?document.querySelector(e):null))||t.hd?0:((e,t)=>{e.sb||(e.sb=e.getContext,e.getContext=function(t,r){return"webgl"==t==(r=e.sb(t,r))instanceof WebGLRenderingContext?r:null});var r=e.getContext(1<t.Oc?"webgl2":"webgl",t);return r?((e,t)=>{var r=mt(ft),n={handle:r,attributes:t,version:t.Oc,Lb:e};if(e.canvas&&(e.canvas.$c=n),ft[r]=n,(void 0===t.Gc||t.Gc)&&((e=n)||(e=Ue),!e.pd))for(var i of(e.pd=!0,(t=e.Lb).de=t.getExtension("WEBGL_multi_draw"),t.Qd=t.getExtension("EXT_polygon_offset_clamp"),t.Pd=t.getExtension("EXT_clip_control"),t.pe=t.getExtension("WEBGL_polygon_mode"),(e=>{var t=e.getExtension("ANGLE_instanced_arrays");t&&(e.vertexAttribDivisor=(e,r)=>t.vertexAttribDivisorANGLE(e,r),e.drawArraysInstanced=(e,r,n,i)=>t.drawArraysInstancedANGLE(e,r,n,i),e.drawElementsInstanced=(e,r,n,i,s)=>t.drawElementsInstancedANGLE(e,r,n,i,s))})(t),(e=>{var t=e.getExtension("OES_vertex_array_object");t&&(e.createVertexArray=()=>t.createVertexArrayOES(),e.deleteVertexArray=e=>t.deleteVertexArrayOES(e),e.bindVertexArray=e=>t.bindVertexArrayOES(e),e.isVertexArray=e=>t.isVertexArrayOES(e))})(t),(e=>{var t=e.getExtension("WEBGL_draw_buffers");t&&(e.drawBuffers=(e,r)=>t.drawBuffersWEBGL(e,r))})(t),t.Md=t.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"),t.$d=t.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"),2<=e.version&&(t.Ec=t.getExtension("EXT_disjoint_timer_query_webgl2")),(2>e.version||!t.Ec)&&(t.Ec=t.getExtension("EXT_disjoint_timer_query")),st(t)))i.includes("lose_context")||i.includes("debug")||t.getExtension(i);for(n.uc=n.Lb.getParameter(34921),n.Mb=[],i=0;i<n.uc;i++)n.Mb[i]={enabled:!1,ac:!1,size:0,type:0,Qc:0,stride:0,ib:0,Xc:null};for(n.Gb=[],n.kc=[],n.Gb.length=n.kc.length=22,n.Rb=[],n.Yb=[],n.Rb.length=n.Yb.length=22,n.Qb=[],n.Qb.length=22,i=0;21>=i;++i){n.Qb[i]=null,n.Gb[i]=n.kc[i]=0,n.Rb[i]=[],n.Yb[i]=[],(e=n.Rb[i]).length=(t=n.Yb[i]).length=64;for(var s=0;64>s;++s)e[s]=t[s]=null}return r})(r,t):0})(e,t)},xa:e=>{Ue==e&&(Ue=0),Ue===ft[e]&&(Ue=null),"object"==typeof JSEvents&&JSEvents.je(ft[e].Lb.canvas),ft[e]?.Lb.canvas&&(ft[e].Lb.canvas.$c=void 0),ft[e]=null},La:()=>Ue?Ue.handle:0,H:e=>(Ue=ft[e],n.ctx=Ce=Ue?.Lb,!e||Ce?0:-5),ba:function(e){try{var t=ir(e);return br.close(t),0}catch(e){if(void 0===br||"ErrnoError"!==e.name)throw e;return e.Ib}},$:function(e,t,r,n){t=-9007199254740992>t||9007199254740992<t?NaN:Number(t);try{if(isNaN(t))return 61;var i=ir(e);return br.rb(i,t,r),k[n>>3]=BigInt(i.position),i.pc&&0===t&&0===r&&(i.pc=null),0}catch(e){if(void 0===br||"ErrnoError"!==e.name)throw e;return e.Ib}},aa:function(e,t,r,n){try{e:{var i=ir(e);e=t;for(var s,o=t=0;o<r;o++){var a=A[e>>2],c=A[e+4>>2];e+=8;var l=br.write(i,w,a,c,s);if(0>l){var h=-1;break e}if(t+=l,l<c)break;void 0!==s&&(s+=l)}h=t}return A[n>>2]=h,0}catch(e){if(void 0===br||"ErrnoError"!==e.name)throw e;return e.Ib}},oa:e=>Ce.activeTexture(e),T:(e,t)=>{Ce.attachShader(ct[e],dt[t])},e:(e,t)=>{if(t&&!at[t]){var r=Ce.createBuffer();r.name=t,at[t]=r}34962==e?Ce.bc=t:34963==e&&(Ce.Tb=t),35051==e?Ce.Bc=t:35052==e&&(Ce.lc=t),Ce.bindBuffer(e,at[t])},ma:(e,t,r,n,i)=>{Ce.bindBufferRange(e,t,at[r],n,i)},a:(e,t)=>{Ce.bindFramebuffer(e,lt[t])},C:(e,t)=>{Ce.bindRenderbuffer(e,ht[t])},u:(e,t)=>{Ce.bindTexture(e,ut[t])},V:e=>{Ce.bindVertexArray(bt[e]),e=Ce.getParameter(34965),Ce.Tb=e?0|e.name:0},p:(e,t)=>Ce.blendFunc(e,t),j:(e,t,r,n,i,s,o,a,c,l)=>Ce.blitFramebuffer(e,t,r,n,i,s,o,a,c,l),D:(e,t,r,n)=>{2<=Ue.version?r&&t?Ce.bufferData(e,g,n,r,t):Ce.bufferData(e,t,n):Ce.bufferData(e,r?g.subarray(r,r+t):t,n)},A:e=>Ce.clear(e),B:(e,t,r,n)=>Ce.clearColor(e,t,r,n),ja:e=>Ce.clearDepth(e),ka:e=>Ce.clearStencil(e),q:(e,t,r,n)=>{Ce.colorMask(!!e,!!t,!!r,!!n)},fa:e=>{Ce.compileShader(dt[e])},Fa:()=>{var e=mt(ct),t=Ce.createProgram();return t.name=e,t.ic=t.fc=t.hc=0,t.xc=1,ct[e]=t,e},ha:e=>{var t=mt(dt);return dt[t]=Ce.createShader(e),t},za:e=>Ce.cullFace(e),Ia:(e,t)=>{for(var r=0;r<e;r++){var n=$[t+4*r>>2],i=at[n];i&&(Ce.deleteBuffer(i),i.name=0,at[n]=null,n==Ce.bc&&(Ce.bc=0),n==Ce.Tb&&(Ce.Tb=0),n==Ce.Bc&&(Ce.Bc=0),n==Ce.lc&&(Ce.lc=0))}},K:(e,t)=>{for(var r=0;r<e;++r){var n=$[t+4*r>>2],i=lt[n];i&&(Ce.deleteFramebuffer(i),i.name=0,lt[n]=null)}},R:e=>{if(e){var t=ct[e];t?(Ce.deleteProgram(t),t.name=0,ct[e]=null):Oe||=1281}},J:(e,t)=>{for(var r=0;r<e;r++){var n=$[t+4*r>>2],i=ht[n];i&&(Ce.deleteRenderbuffer(i),i.name=0,ht[n]=null)}},z:e=>{if(e){var t=dt[e];t?(Ce.deleteShader(t),dt[e]=null):Oe||=1281}},W:(e,t)=>{for(var r=0;r<e;r++){var n=$[t+4*r>>2],i=ut[n];i&&(Ce.deleteTexture(i),i.name=0,ut[n]=null)}},Ga:(e,t)=>{for(var r=0;r<e;r++){var n=$[t+4*r>>2];Ce.deleteVertexArray(bt[n]),bt[n]=null}},wa:e=>Ce.depthFunc(e),w:e=>{Ce.depthMask(!!e)},k:e=>Ce.disable(e),I:e=>{Ue.Mb[e].enabled=!1,Ce.disableVertexAttribArray(e)},la:(e,t,r,n)=>{var i=0;if(!Ce.Tb){var s=1*pt[r-5120]*t,o=(e=>{e=32-Math.clz32(0===e?0:e-1);var t=Ue.Qb[e];return t||(t=Ce.getParameter(34965),Ue.Qb[e]=Ce.createBuffer(),Ce.bindBuffer(34963,Ue.Qb[e]),Ce.bufferData(34963,1<<e,35048),Ce.bindBuffer(34963,t),Ue.Qb[e])})(s);if(Ce.bindBuffer(34963,o),Ce.bufferSubData(34963,0,g.subarray(n,n+s)),0<t)for(o=0;o<Ue.uc;++o)if((s=Ue.Mb[o]).ac&&s.enabled){switch(r){case 5121:i=Uint8Array;break;case 5123:i=Uint16Array;break;case 5125:i=Uint32Array;break;default:return void(Oe||=1282)}i=new i(g.buffer,n,t).reduce((e,t)=>Math.max(e,t))+1;break}n=0}(e=>{je=!1;for(var t=0;t<Ue.uc;++t){var r=Ue.Mb[t];if(r.ac&&r.enabled){je=!0;var n=r.size,i=r.type,s=r.stride;n=0<s?e*s:n*pt[i-5120]*e,i=32-Math.clz32(0===n?0:n-1),s=Ue.Rb[i];var o=Ue.Gb[i];Ue.Gb[i]=Ue.Gb[i]+1&63;var a=s[o];a?i=a:(a=Ce.getParameter(34964),s[o]=Ce.createBuffer(),Ce.bindBuffer(34962,s[o]),Ce.bufferData(34962,1<<i,35048),Ce.bindBuffer(34962,a),i=s[o]),Ce.bindBuffer(34962,i),Ce.bufferSubData(34962,0,g.subarray(r.ib,r.ib+n)),r.Xc.call(Ce,t,r.size,r.type,r.Qc,r.stride,0)}}})(i),Ce.drawElements(e,t,r,n),je&&Ce.bindBuffer(34962,at[Ce.bc]),Ce.Tb||Ce.bindBuffer(34963,null)},i:e=>Ce.enable(e),qa:e=>{Ue.Mb[e].enabled=!0,Ce.enableVertexAttribArray(e)},L:(e,t,r,n)=>{Ce.framebufferRenderbuffer(e,t,r,ht[n])},ua:(e,t,r,n,i)=>{Ce.framebufferTexture2D(e,t,r,ut[n],i)},ya:e=>Ce.frontFace(e),Ka:(e,t)=>{vt(e,t,"createBuffer",at)},O:(e,t)=>{vt(e,t,"createFramebuffer",lt)},N:(e,t)=>{vt(e,t,"createRenderbuffer",ht)},Q:(e,t)=>{vt(e,t,"createTexture",ut)},Ha:(e,t)=>{vt(e,t,"createVertexArray",bt)},U:(e,t)=>((e,t)=>{if(t){var r=void 0;switch(e){case 36346:r=1;break;case 36344:return;case 34814:case 36345:r=0;break;case 34466:var n=Ce.getParameter(34467);r=n?n.length:0;break;case 33309:if(2>Ue.version)return void(Oe||=1282);r=(()=>{var e=st(Ce);return e.concat(e.map(e=>"GL_"+e))})().length;break;case 33307:case 33308:if(2>Ue.version)return void(Oe||=1280);r=33307==e?3:0}if(void 0===r)switch(n=Ce.getParameter(e),typeof n){case"number":r=n;break;case"boolean":r=n?1:0;break;case"string":return void(Oe||=1280);case"object":if(null===n)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:r=0;break;default:return void(Oe||=1280)}else{if(n instanceof Float32Array||n instanceof Uint32Array||n instanceof Int32Array||n instanceof Array){for(e=0;e<n.length;++e)$[t+4*e>>2]=n[e];return}try{r=0|n.name}catch(t){return Oe||=1280,void R(`GL_INVALID_ENUM in glGet0v: Unknown object returned from WebGL getParameter(${e})! (error: ${t})`)}}break;default:return Oe||=1280,void R(`GL_INVALID_ENUM in glGet0v: Native code calling glGet0v(${e}) and it returns ${n} of type ${typeof n}!`)}$[t>>2]=r}else Oe||=1281})(e,t),Ca:(e,t,r,n)=>{null===(e=Ce.getProgramInfoLog(ct[e]))&&(e="(unknown error)"),t=0<t&&n?ze(e,g,n,t):0,r&&($[r>>2]=t)},S:(e,t,r)=>{if(r)if(e>=ot)Oe||=1281;else if(e=ct[e],35716==t)null===(e=Ce.getProgramInfoLog(e))&&(e="(unknown error)"),$[r>>2]=e.length+1;else if(35719==t){if(!e.ic){var n=Ce.getProgramParameter(e,35718);for(t=0;t<n;++t)e.ic=Math.max(e.ic,Ce.getActiveUniform(e,t).name.length+1)}$[r>>2]=e.ic}else if(35722==t){if(!e.fc)for(n=Ce.getProgramParameter(e,35721),t=0;t<n;++t)e.fc=Math.max(e.fc,Ce.getActiveAttrib(e,t).name.length+1);$[r>>2]=e.fc}else if(35381==t){if(!e.hc)for(n=Ce.getProgramParameter(e,35382),t=0;t<n;++t)e.hc=Math.max(e.hc,Ce.getActiveUniformBlockName(e,t).length+1);$[r>>2]=e.hc}else $[r>>2]=Ce.getProgramParameter(e,t);else Oe||=1281},ea:(e,t,r,n)=>{null===(e=Ce.getShaderInfoLog(dt[e]))&&(e="(unknown error)"),t=0<t&&n?ze(e,g,n,t):0,r&&($[r>>2]=t)},G:(e,t,r)=>{r?35716==t?(null===(e=Ce.getShaderInfoLog(dt[e]))&&(e="(unknown error)"),$[r>>2]=e?e.length+1:0):35720==t?(e=Ce.getShaderSource(dt[e]),$[r>>2]=e?e.length+1:0):$[r>>2]=Ce.getShaderParameter(dt[e],t):Oe||=1281},d:(e,t)=>Ce.getUniformBlockIndex(ct[e],V(t)),b:(e,t)=>{if(t=V(t),e=ct[e]){var r,n=e,i=n.Zb,s=n.Wc;if(!i){n.Zb=i={},n.Vc={};var o=Ce.getProgramParameter(n,35718);for(r=0;r<o;++r){var a=Ce.getActiveUniform(n,r),c=a.name;a=a.size;var l=fr(c);l=0<l?c.slice(0,l):c;var h=n.xc;for(n.xc+=a,s[l]=[a,h],c=0;c<a;++c)i[h]=c,n.Vc[h++]=l}}if(n=e.Zb,i=0,s=t,0<(r=fr(t))&&(i=parseInt(t.slice(r+1))>>>0,s=t.slice(0,r)),(s=e.Wc[s])&&i<s[0]&&(n[i+=s[1]]=n[i]||Ce.getUniformLocation(e,t)))return i}else Oe||=1281;return-1},ia:(e,t,r)=>{for(var n=pr[t],i=0;i<t;i++)n[i]=$[r+4*i>>2];Ce.invalidateFramebuffer(e,n)},Ea:e=>{Ce.linkProgram(e=ct[e]),e.Zb=0,e.Wc={}},M:(e,t,r,n,i)=>Ce.renderbufferStorageMultisample(e,t,r,n,i),f:(e,t,r,n)=>Ce.scissor(e,t,r,n),ga:(e,t,r,n)=>{for(var i="",s=0;s<t;++s)i+=V(A[r+4*s>>2],n?A[n+4*s>>2]:void 0);Ce.shaderSource(dt[e],i)},y:(e,t,r)=>Ce.stencilFunc(e,t,r),s:(e,t,r,n)=>Ce.stencilFuncSeparate(e,t,r,n),x:(e,t,r)=>Ce.stencilOp(e,t,r),r:(e,t,r,n)=>Ce.stencilOpSeparate(e,t,r,n),P:(e,t,r,n,i,s,o,a,c)=>{if(2<=Ue.version){if(Ce.lc)return void Ce.texImage2D(e,t,r,n,i,s,o,a,c);if(c){var l=mr(a);return c>>>=31-Math.clz32(l.BYTES_PER_ELEMENT),void Ce.texImage2D(e,t,r,n,i,s,o,a,l,c)}}if(c){l=mr(a);var h=i*(n*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[o-6402]||1)*l.BYTES_PER_ELEMENT+4-1&-4);c=l.subarray(c>>>31-Math.clz32(l.BYTES_PER_ELEMENT),c+h>>>31-Math.clz32(l.BYTES_PER_ELEMENT))}else c=null;Ce.texImage2D(e,t,r,n,i,s,o,a,c)},o:(e,t,r)=>Ce.texParameteri(e,t,r),ta:(e,t)=>{Ce.uniform1f(vr(e),t)},Aa:(e,t,r)=>{if(2<=Ue.version)t&&Ce.uniform1iv(vr(e),$,r>>2,t);else{if(288>=t)for(var n=wr[t],i=0;i<t;++i)n[i]=$[r+4*i>>2];else n=$.subarray(r>>2,r+4*t>>2);Ce.uniform1iv(vr(e),n)}},na:(e,t,r)=>{Ce.uniformBlockBinding(e=ct[e],t,r)},sa:(e,t,r,n)=>{if(2<=Ue.version)t&&Ce.uniformMatrix3fv(vr(e),!!r,E,n>>2,9*t);else{if(32>=t)for(var i=gr[t*=9],s=0;s<t;s+=9)i[s]=E[n+4*s>>2],i[s+1]=E[n+(4*s+4)>>2],i[s+2]=E[n+(4*s+8)>>2],i[s+3]=E[n+(4*s+12)>>2],i[s+4]=E[n+(4*s+16)>>2],i[s+5]=E[n+(4*s+20)>>2],i[s+6]=E[n+(4*s+24)>>2],i[s+7]=E[n+(4*s+28)>>2],i[s+8]=E[n+(4*s+32)>>2];else i=E.subarray(n>>2,n+36*t>>2);Ce.uniformMatrix3fv(vr(e),!!r,i)}},Ba:e=>{Ce.useProgram(e=ct[e]),Ce.dd=e},ra:(e,t,r,n,i)=>Ce.vertexAttrib4f(e,t,r,n,i),pa:(e,t,r,n,i,s)=>{var o=Ue.Mb[e];Ce.bc?(o.ac=!1,Ce.vertexAttribPointer(e,t,r,!!n,i,s)):(o.size=t,o.type=r,o.Qc=n,o.stride=i,o.ib=s,o.ac=!0,o.Xc=function(e,t,r,n,i,s){this.vertexAttribPointer(e,t,r,n,i,s)})},g:(e,t,r,n)=>Ce.viewport(e,t,r,n),Ta:it};return Pr=await async function(){function t(e){return e=Pr=e.exports,Ar=e.Za,Er=e._a,Sr=e.$a,kr=e.ab,xr=e.Xa,Tr=e.bb,j(),Pr}var r={a:Rr};return n.instantiateWasm?new Promise(e=>{n.instantiateWasm(r,(r,n)=>{e(t(r))})}):(T??=n.locateFile?n.locateFile?n.locateFile("thorvg.wasm",d):d+"thorvg.wasm":new URL("thorvg.wasm","undefined"==typeof document?require("url").pathToFileURL(__filename).href:e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("lottie-player.cjs.js",document.baseURI).href).href,t((await async function(e){var t=T;if(!f&&!O(t)&&!o)try{var r=fetch(t,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(r,e)}catch(e){R(`wasm streaming compile failed: ${e}`),R("falling back to ArrayBuffer instantiation")}return async function(e,t){try{var r=await async function(e){if(!f)try{var t=await c(e);return new Uint8Array(t)}catch{}if(e==T&&f)e=new Uint8Array(f);else{if(!l)throw"both async and sync fetching of the wasm failed";e=l(e)}return e}(e);return await WebAssembly.instantiate(r,t)}catch(e){R(`failed to asynchronously prepare wasm: ${e}`),L(e)}}(t,e)}(r)).instance))}(),function e(){function t(){if(n.calledRun=!0,!C){if(U=!0,n.noFSInit||br.qc||zt(),Pr.Ya(),br.Lc=!1,m?.(n),n.onRuntimeInitialized?.(),n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;){var e=n.postRun.shift();M.push(e)}F(M)}}if(0<Ft)Mt=e;else{if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)N();F(D),0<Ft?Mt=e:n.setStatus?(n.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>n.setStatus(""),1),t()},1)):t()}}(),r=U?n:new Promise((e,t)=>{m=e,v=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 t=this.config?.renderer||"gl";if(await(async e=>{if("wg"===e){for(;"requested"===pe;)await fe(100);if("initialized"!==pe&&(pe="requested",ue))for(;;)switch(ue.init()){case 0:return void(pe="initialized");case 1:return void(pe="failed");case 2:await fe(100)}}})(t),"failed"===pe)return this.currentState="error",void this.dispatchEvent(new CustomEvent("error"));this.TVG=new ue.TvgLottieAnimation(t,`#${this.canvas.id}`),this.src&&this.load(this.src,this.fileType)}_viewport(){const{left:e,right:t,top:r,bottom:n}=this.getBoundingClientRect(),i=window.innerWidth,s=window.innerHeight;let o=0,a=0,c=this.canvas.width,l=this.canvas.height;e<0&&(o=Math.abs(e),c-=o),r<0&&(a=Math.abs(r),l-=a),t>i&&(c-=t-i),n>s&&(l-=n-s),this.TVG.viewport(o,a,c,l)}_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 fe(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(){ue&&(ue.term(),ue=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 V`
2
2
  <canvas class="thorvg" style="width: 100%; height: 100%;" />
3
- `}}he([A({type:String})],_e.prototype,"src",void 0),he([A({type:String})],_e.prototype,"wasmUrl",void 0),he([A({type:pe})],_e.prototype,"fileType",void 0),he([A({type:Number})],_e.prototype,"speed",void 0),he([A({type:Boolean})],_e.prototype,"autoPlay",void 0),he([A({type:Number})],_e.prototype,"count",void 0),he([A({type:Boolean})],_e.prototype,"loop",void 0),he([A({type:Number})],_e.prototype,"direction",void 0),he([A()],_e.prototype,"mode",void 0),he([A()],_e.prototype,"intermission",void 0),he([A({type:Number})],_e.prototype,"totalFrame",void 0),he([A({type:Number})],_e.prototype,"currentFrame",void 0),he([A({type:Number})],_e.prototype,"currentState",void 0),he([A({type:Float32Array})],_e.prototype,"size",null);class $e extends _e{set renderConfig(e){this.config={renderer:"gl",enableDevicePixelRatio:e.enableDevicePixelRatio}}get renderConfig(){return this.config||{}}}$e=function(e,t,r,n){var i,a=arguments.length,o=a<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--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o}([(e=>(t,r)=>{void 0!==r?r.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)})("lottie-player")],$e);var Ee=Object.freeze({__proto__:null});export{$e as LottiePresetPlayer};
3
+ `}}function ve(e,t,r,n){var i,s=arguments.length,o=s<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 a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o}he([E({type:String})],me.prototype,"src",void 0),he([E({type:String})],me.prototype,"wasmUrl",void 0),he([E({type:be})],me.prototype,"fileType",void 0),he([E({type:Number})],me.prototype,"speed",void 0),he([E({type:Boolean})],me.prototype,"autoPlay",void 0),he([E({type:Number})],me.prototype,"count",void 0),he([E({type:Boolean})],me.prototype,"loop",void 0),he([E({type:Number})],me.prototype,"direction",void 0),he([E()],me.prototype,"mode",void 0),he([E()],me.prototype,"intermission",void 0),he([E({type:Number})],me.prototype,"totalFrame",void 0),he([E({type:Number})],me.prototype,"currentFrame",void 0),he([E({type:Number})],me.prototype,"currentState",void 0),he([E({type:Float32Array})],me.prototype,"size",null);class we extends me{set renderConfig(e){this.config={renderer:"gl",enableDevicePixelRatio:e.enableDevicePixelRatio}}get renderConfig(){return this.config||{}}}ve([E({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});exports.LottiePresetPlayer=we;
4
4
  //# sourceMappingURL=lottie-player.cjs.js.map