@thorvg/lottie-player 1.0.2 → 1.0.4

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 (51) hide show
  1. package/dist/gl/lottie-player.cjs.js +2 -2
  2. package/dist/gl/lottie-player.cjs.js.map +1 -1
  3. package/dist/gl/lottie-player.esm.js +2 -2
  4. package/dist/gl/lottie-player.esm.js.map +1 -1
  5. package/dist/gl/lottie-player.js +2 -2
  6. package/dist/gl/lottie-player.js.map +1 -1
  7. package/dist/gl/thorvg.wasm +0 -0
  8. package/dist/gl-lite/lottie-player.cjs.js +2 -2
  9. package/dist/gl-lite/lottie-player.cjs.js.map +1 -1
  10. package/dist/gl-lite/lottie-player.esm.js +2 -2
  11. package/dist/gl-lite/lottie-player.esm.js.map +1 -1
  12. package/dist/gl-lite/lottie-player.js +2 -2
  13. package/dist/gl-lite/lottie-player.js.map +1 -1
  14. package/dist/gl-lite/thorvg.wasm +0 -0
  15. package/dist/lottie-player.cjs.js +2 -2
  16. package/dist/lottie-player.cjs.js.map +1 -1
  17. package/dist/lottie-player.d.ts +5 -0
  18. package/dist/lottie-player.esm.js +2 -2
  19. package/dist/lottie-player.esm.js.map +1 -1
  20. package/dist/lottie-player.js +2 -2
  21. package/dist/lottie-player.js.map +1 -1
  22. package/dist/sw/lottie-player.cjs.js +2 -2
  23. package/dist/sw/lottie-player.cjs.js.map +1 -1
  24. package/dist/sw/lottie-player.esm.js +2 -2
  25. package/dist/sw/lottie-player.esm.js.map +1 -1
  26. package/dist/sw/lottie-player.js +2 -2
  27. package/dist/sw/lottie-player.js.map +1 -1
  28. package/dist/sw/thorvg.wasm +0 -0
  29. package/dist/sw-lite/lottie-player.cjs.js +2 -2
  30. package/dist/sw-lite/lottie-player.cjs.js.map +1 -1
  31. package/dist/sw-lite/lottie-player.esm.js +2 -2
  32. package/dist/sw-lite/lottie-player.esm.js.map +1 -1
  33. package/dist/sw-lite/lottie-player.js +2 -2
  34. package/dist/sw-lite/lottie-player.js.map +1 -1
  35. package/dist/sw-lite/thorvg.wasm +0 -0
  36. package/dist/thorvg.wasm +0 -0
  37. package/dist/wg/lottie-player.cjs.js +2 -2
  38. package/dist/wg/lottie-player.cjs.js.map +1 -1
  39. package/dist/wg/lottie-player.esm.js +2 -2
  40. package/dist/wg/lottie-player.esm.js.map +1 -1
  41. package/dist/wg/lottie-player.js +2 -2
  42. package/dist/wg/lottie-player.js.map +1 -1
  43. package/dist/wg/thorvg.wasm +0 -0
  44. package/dist/wg-lite/lottie-player.cjs.js +2 -2
  45. package/dist/wg-lite/lottie-player.cjs.js.map +1 -1
  46. package/dist/wg-lite/lottie-player.esm.js +2 -2
  47. package/dist/wg-lite/lottie-player.esm.js.map +1 -1
  48. package/dist/wg-lite/lottie-player.js +2 -2
  49. package/dist/wg-lite/lottie-player.js.map +1 -1
  50. package/dist/wg-lite/thorvg.wasm +0 -0
  51. package/package.json +1 -1
@@ -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=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:o,defineProperty:s,getOwnPropertyDescriptor:c,getOwnPropertyNames:d,getOwnPropertySymbols:l,getPrototypeOf:u}=Object,h=globalThis,f=h.trustedTypes,p=f?f.emptyScript:"",m=h.reactiveElementPolyfillSupport,v=(e,t)=>e,g={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}},w=(e,t)=>!o(e,t),y={attribute:!0,type:String,converter:g,reflect:!1,useDefault:!1,hasChanged:w};Symbol.metadata??=Symbol("metadata"),h.litPropertyMetadata??=new WeakMap;let b=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&&s(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:i}=c(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:n,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)??y}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const e=u(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=[...d(e),...l(e)];for(const r of t)this.createProperty(r,e[r])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,r]of t)this.elementProperties.set(e,r)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const r=this._$Eu(e,t);void 0!==r&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const e of r)t.unshift(a(e))}else void 0!==e&&t.push(a(e));return t}static _$Eu(e,t){const r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((r,n)=>{if(t)r.adoptedStyleSheets=n.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const t of n){const n=document.createElement("style"),i=e.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)}})(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$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:g).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:g;this._$Em=n;const a=i.fromAttribute(t,e.type);this[n]=a??this._$Ej?.get(n)??a,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??w)(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},a){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||void 0!==a)||(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){}};b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[v("elementProperties")]=new Map,b[v("finalized")]=new Map,m?.({ReactiveElement:b}),(h.reactiveElementVersions??=[]).push("2.1.1");const _={attribute:!0,type:String,converter:g,reflect:!1,hasChanged:w},$=(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),"setter"===n&&((e=Object.create(e)).wrapped=!0),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.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?$(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 A=globalThis,x=A.trustedTypes,S=x?x.createPolicy("lit-html",{createHTML:e=>e}):void 0,k="$lit$",T=`lit$${Math.random().toFixed(9).slice(2)}$`,P="?"+T,C=`<${P}>`,O=document,R=()=>O.createComment(""),B=e=>null===e||"object"!=typeof e&&"function"!=typeof e,L=Array.isArray,U="[ \t\n\f\r]",F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,M=/-->/g,D=/>/g,G=RegExp(`>|${U}(?:([^\\s"'>=/]+)(${U}*=${U}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),I=/'/g,N=/"/g,V=/^(?:script|style|textarea|title)$/i,j=(e,...t)=>({_$litType$:1,strings:e,values:t}),z=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),q=new WeakMap,H=O.createTreeWalker(O,129);function X(e,t){if(!L(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==S?S.createHTML(t):t}const J=(e,t)=>{const r=e.length-1,n=[];let i,a=2===t?"<svg>":3===t?"<math>":"",o=F;for(let t=0;t<r;t++){const r=e[t];let s,c,d=-1,l=0;for(;l<r.length&&(o.lastIndex=l,c=o.exec(r),null!==c);)l=o.lastIndex,o===F?"!--"===c[1]?o=M:void 0!==c[1]?o=D:void 0!==c[2]?(V.test(c[2])&&(i=RegExp("</"+c[2],"g")),o=G):void 0!==c[3]&&(o=G):o===G?">"===c[0]?(o=i??F,d=-1):void 0===c[1]?d=-2:(d=o.lastIndex-c[2].length,s=c[1],o=void 0===c[3]?G:'"'===c[3]?N:I):o===N||o===I?o=G:o===M||o===D?o=F:(o=G,i=void 0);const u=o===G&&e[t+1].startsWith("/>")?" ":"";a+=o===F?r+C:d>=0?(n.push(s),r.slice(0,d)+k+r.slice(d)+T+u):r+T+(-2===d?t:u)}return[X(e,a+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),n]};class K{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let i=0,a=0;const o=e.length-1,s=this.parts,[c,d]=J(e,t);if(this.el=K.createElement(c,r),H.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=H.nextNode())&&s.length<o;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(k)){const t=d[a++],r=n.getAttribute(e).split(T),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(T)&&(s.push({type:6,index:i}),n.removeAttribute(e));if(V.test(n.tagName)){const e=n.textContent.split(T),t=e.length-1;if(t>0){n.textContent=x?x.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],R()),H.nextNode(),s.push({type:2,index:++i});n.append(e[t],R())}}}else if(8===n.nodeType)if(n.data===P)s.push({type:2,index:i});else{let e=-1;for(;-1!==(e=n.data.indexOf(T,e+1));)s.push({type:7,index:i}),e+=T.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===z)return t;let i=void 0!==n?r._$Co?.[n]:r._$Cl;const a=B(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._$Co??=[])[n]=i:r._$Cl=i),void 0!==i&&(t=Q(e,i._$AS(e,t.values),i,n)),t}class Y{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);H.currentNode=n;let i=H.nextNode(),a=0,o=0,s=r[0];for(;void 0!==s;){if(a===s.index){let t;2===s.type?t=new Z(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=H.nextNode(),a++)}return H.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 Z{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=W,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Q(this,e,t),B(e)?e===W||null==e||""===e?(this._$AH!==W&&this._$AR(),this._$AH=W):e!==this._$AH&&e!==z&&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!==W&&B(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=K.createElement(X(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{const e=new Y(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 K(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 Z(this.O(R()),this.O(R()),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 ee{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,i){this.type=1,this._$AH=W,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=W}_$AI(e,t=this,r,n){const i=this.strings;let a=!1;if(void 0===i)e=Q(this,e,t,0),a=!B(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=Q(this,n[r+o],t,o),s===z&&(s=this._$AH[o]),a||=!B(s)||s!==this._$AH[o],s===W?e=W:e!==W&&(e+=(s??"")+i[o+1]),this._$AH[o]=s}a&&!n&&this.j(e)}j(e){e===W?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===W?void 0:e}}class re extends ee{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==W)}}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=Q(this,e,t,0)??W)===z)return;const r=this._$AH,n=e===W&&r!==W||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,i=e!==W&&(r===W||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){Q(this,e)}}const ae=A.litHtmlPolyfillSupport;ae?.(K,Z),(A.litHtmlVersions??=[]).push("3.3.1");const oe=globalThis;class se extends b{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 Z(t.insertBefore(R(),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 z}}se._$litElement$=!0,se.finalized=!0,oe.litElementHydrateSupport?.({LitElement:se});const ce=oe.litElementPolyfillSupport;function de(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}ce?.({LitElement:se}),(oe.litElementVersions??=[]).push("4.2.1");let le=null,ue=!1;var he=function(e){return e.SW="sw",e.WG="wg",e.GL="gl",e}({}),fe=function(e){return e.JSON="json",e.LOT="lot",e.JPG="jpg",e.PNG="png",e.SVG="svg",e}({});const pe=async(e,t)=>{const r=new TextEncoder;let n=e;switch(typeof n){case"object":return n instanceof ArrayBuffer?new Uint8Array(n):(n=JSON.stringify(n),r.encode(n));case"string":if("json"===t||"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")}},me=e=>new Promise(t=>setTimeout(t,e));let ve="idle";class ge extends se{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(ue)for(;!le;)await me(100);if(le||(ue=!0,le=await async function(e={}){var t,r=e,n=!!globalThis.window,i=!!globalThis.WorkerGlobalScope,a=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;if(a){const{createRequire:e}=await Promise.resolve().then(function(){return _e});var o=e(import.meta.url)}var s,c,d=(e,t)=>{throw t},l=import.meta.url,u="";if(a){var h=o("fs");l.startsWith("file:")&&(u=o("path").dirname(o("url").fileURLToPath(l))+"/"),c=e=>(e=O(e)?new URL(e):e,h.readFileSync(e)),s=async e=>(e=O(e)?new URL(e):e,h.readFileSync(e,void 0)),process.argv.slice(2),d=(e,t)=>{throw process.exitCode=e,t}}else if(n||i){try{u=new URL(".",l).href}catch{}i&&(c=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),s=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,g,w,y,b,_,$,E,A,x,S,k,T=function(){}.bind(),P=function(){}.bind(),C=!1,O=e=>e.startsWith("file://"),R=!1;function B(){var e=Mn.buffer;g=new Int8Array(e),y=new Int16Array(e),w=new Uint8Array(e),b=new Uint16Array(e),_=new Int32Array(e),$=new Uint32Array(e),E=new Float32Array(e),A=new Float64Array(e),x=new BigInt64Array(e),S=new BigUint64Array(e)}function L(e){throw r.onAbort?.(e),P(e="Aborted("+e+")"),C=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),v?.(e),e}class U{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var F=e=>{for(;0<e.length;)e.shift()(r)},M=[],D=[],G=()=>{var e=r.preRun.shift();D.push(e)},I=!0,N=new TextDecoder,V=(e,t,r,n)=>{if(r=t+r,n)return r;for(;e[t]&&!(t>=r);)++t;return t},j=(e,t,r)=>e?N.decode(w.subarray(e,V(w,e,t,r))):"",z=()=>{var e=_[+Ve>>2];return Ve+=4,e},W=(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},q=e=>{var t="/"===e.charAt(0),r="/"===e.slice(-1);return(e=W(e.split("/").filter(e=>!!e),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},H=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):"."},X=e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],J=e=>{(J=(()=>{if(a){var e=o("crypto");return t=>e.randomFillSync(t)}return e=>crypto.getRandomValues(e)})())(e)},K=(...e)=>{for(var t="",r=!1,n=e.length-1;-1<=n&&!r;n--){if("string"!=typeof(r=0<=n?e[n]:Ne.cwd()))throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";t=r+"/"+t,r="/"===r.charAt(0)}return t=W(t.split("/").filter(e=>!!e),!r).join("/"),(r?"/":"")+t||"."},Q=(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=K(e).slice(1),t=K(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("/")},Y=e=>{var t=V(e,0);return N.decode(e.buffer?e.subarray(0,t):new Uint8Array(e.slice(0,t)))},Z=[],ee=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},te=(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.codePointAt(a);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,a++}}return t[r]=0,r-i},re=e=>{var t=Array(ee(e)+1);return e=te(e,t,0,t.length),t.length=e,t},ne=[];function ie(e,t){ne[e]={input:[],output:[],Vc:t},ge(e,ae)}var ae={open(e){var t=ne[e.node.rdev];if(!t)throw new Ne.cc(43);e.tty=t,e.seekable=!1},close(e){e.tty.Vc.fsync(e.tty)},fsync(e){e.tty.Vc.fsync(e.tty)},read(e,t,r,n){if(!e.tty||!e.tty.Vc.$d)throw new Ne.cc(60);for(var i=0,a=0;a<n;a++){try{var o=e.tty.Vc.$d(e.tty)}catch(e){throw new Ne.cc(29)}if(void 0===o&&0===i)throw new Ne.cc(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.Vc.Pd)throw new Ne.cc(60);try{for(var i=0;i<n;i++)e.tty.Vc.Pd(e.tty,t[r+i])}catch(e){throw new Ne.cc(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),i}},oe={$d(){e:{if(!Z.length){var e=null;if(a){var t=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=h.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}Z=re(e)}e=Z.shift()}return e},Pd(e,t){null===t||10===t?(T(Y(e.output)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){0<e.output?.length&&(T(Y(e.output)),e.output=[])},Ge:()=>({$e:25856,bf:5,Ze:191,af:35387,Ye:[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]}),He:()=>0,Ie:()=>[24,80]},se={Pd(e,t){null===t||10===t?(P(Y(e.output)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){0<e.output?.length&&(P(Y(e.output)),e.output=[])}},ce={Sc:null,rc:()=>ce.createNode(null,"/",16895,0),createNode(e,t,r,n){if(24576==(61440&r)||Ne.isFIFO(r))throw new Ne.cc(63);return ce.Sc||(ce.Sc={dir:{node:{Pc:ce.fc.Pc,Rc:ce.fc.Rc,lookup:ce.fc.lookup,Tc:ce.fc.Tc,rename:ce.fc.rename,unlink:ce.fc.unlink,rmdir:ce.fc.rmdir,readdir:ce.fc.readdir,symlink:ce.fc.symlink},stream:{Ic:ce.hc.Ic}},file:{node:{Pc:ce.fc.Pc,Rc:ce.fc.Rc},stream:{Ic:ce.hc.Ic,read:ce.hc.read,write:ce.hc.write,gd:ce.hc.gd,od:ce.hc.od}},link:{node:{Pc:ce.fc.Pc,Rc:ce.fc.Rc,readlink:ce.fc.readlink},stream:{}},Sd:{node:{Pc:ce.fc.Pc,Rc:ce.fc.Rc},stream:Ne.te}}),we((r=Ne.createNode(e,t,r,n)).mode)?(r.fc=ce.Sc.dir.node,r.hc=ce.Sc.dir.stream,r.oc={}):Ne.isFile(r.mode)?(r.fc=ce.Sc.file.node,r.hc=ce.Sc.file.stream,r.Dc=0,r.oc=null):40960==(61440&r.mode)?(r.fc=ce.Sc.link.node,r.hc=ce.Sc.link.stream):8192==(61440&r.mode)&&(r.fc=ce.Sc.Sd.node,r.hc=ce.Sc.Sd.stream),r.atime=r.mtime=r.ctime=Date.now(),e&&(e.oc[t]=r,e.atime=e.mtime=e.ctime=r.atime),r},pf:e=>e.oc?e.oc.subarray?e.oc.subarray(0,e.Dc):new Uint8Array(e.oc):new Uint8Array(0),fc:{Pc(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=we(e.mode)?4096:Ne.isFile(e.mode)?e.Dc: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},Rc(e,t){for(var r of["mode","atime","mtime","ctime"])null!=t[r]&&(e[r]=t[r]);void 0!==t.size&&e.Dc!=(t=t.size)&&(0==t?(e.oc=null,e.Dc=0):(r=e.oc,e.oc=new Uint8Array(t),r&&e.oc.set(r.subarray(0,Math.min(t,e.Dc))),e.Dc=t))},lookup(){throw ce.Fd||(ce.Fd=new Ne.cc(44),ce.Fd.stack="<generic error, no stack>"),ce.Fd},Tc:(e,t,r,n)=>ce.createNode(e,t,r,n),rename(e,t,r){try{var n=ye(t,r)}catch(e){}if(n){if(we(e.mode))for(var i in n.oc)throw new Ne.cc(55);be(n)}delete e.parent.oc[e.name],t.oc[r]=e,e.name=r,t.ctime=t.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,t){delete e.oc[t],e.ctime=e.mtime=Date.now()},rmdir(e,t){var r,n=ye(e,t);for(r in n.oc)throw new Ne.cc(55);delete e.oc[t],e.ctime=e.mtime=Date.now()},readdir:e=>[".","..",...Object.keys(e.oc)],symlink:(e,t,r)=>((e=ce.createNode(e,t,41471,0)).link=r,e),readlink(e){if(40960!=(61440&e.mode))throw new Ne.cc(28);return e.link}},hc:{read(e,t,r,n,i){var a=e.node.oc;if(i>=e.node.Dc)return 0;if(8<(e=Math.min(e.node.Dc-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.oc||e.oc.subarray)){if(a)return e.oc=t.subarray(r,r+n),e.Dc=n;if(0===e.Dc&&0===i)return e.oc=t.slice(r,r+n),e.Dc=n;if(i+n<=e.Dc)return e.oc.set(t.subarray(r,r+n),i),n}var o=e.oc?e.oc.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.oc,e.oc=new Uint8Array(a),0<e.Dc&&e.oc.set(o.subarray(0,e.Dc),0)),e.oc.subarray&&t.subarray)e.oc.set(t.subarray(r,r+n),i);else for(a=0;a<n;a++)e.oc[i+a]=t[r+a];return e.Dc=Math.max(e.Dc,i+n),n},Ic(e,t,r){if(1===r?t+=e.position:2===r&&Ne.isFile(e.node.mode)&&(t+=e.node.Dc),0>t)throw new Ne.cc(28);return t},gd(e,t,r,n,i){if(!Ne.isFile(e.node.mode))throw new Ne.cc(43);if(e=e.node.oc,2&i||!e||e.buffer!==g.buffer){if(n=!0,L(),!(i=void 0))throw new Ne.cc(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{pc:i,Ue:n}},od:(e,t,r,n)=>(ce.hc.write(e,t,0,n,r,!1),0)}},de=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},le=0,ue=null,he=()=>{if(le--,r.monitorRunDependencies?.(le),0==le&&ue){var e=ue;ue=null,e()}},fe=()=>{le++,r.monitorRunDependencies?.(le)},pe=[],me=async(e,t,r,n,i,a,o,c)=>{var d=t?K(q(e+"/"+t)):e;fe();try{var l=r;"string"==typeof r&&(l=await(async e=>(e=await s(e),new Uint8Array(e)))(r)),l=await(async(e,t)=>{for(var r of("undefined"!=typeof Browser&&ve(),pe))if(r.canHandle(t))return r.handle(e,t);return e})(l,d),c?.(),a||$e(e,t,l,n,i,o)}finally{he()}};function ve(){var e,t,n;Ne.Id=!0,e??=r.stdin,t??=r.stdout,n??=r.stderr,e?Ne.Xc("/dev","stdin",e):Ne.symlink("/dev/tty","/dev/stdin"),t?Ne.Xc("/dev","stdout",null,t):Ne.symlink("/dev/tty","/dev/stdout"),n?Ne.Xc("/dev","stderr",null,n):Ne.symlink("/dev/tty1","/dev/stderr"),Ne.open("/dev/stdin",0),Ne.open("/dev/stdout",1),Ne.open("/dev/stderr",1)}function ge(e,t){Ne.Wd[e]={hc:t}}function we(e){return 16384==(61440&e)}function ye(e,t){var r=we(e.mode)?(r=Te(e,"x"))?r:e.fc.lookup?0:2:54;if(r)throw new Ne.cc(r);for(r=Ne.Uc[xe(e.id,t)];r;r=r.bd)if(r.parent.id===e.id&&r.name===t)return r;return Ne.lookup(e,t)}function be(e){var t=xe(e.parent.id,e.name);if(Ne.Uc[t]===e)Ne.Uc[t]=e.bd;else for(t=Ne.Uc[t];t;){if(t.bd===e){t.bd=e.bd;break}t=t.bd}}function $e(e,t,r,n,i,a){var o=t;if(e&&(e="string"==typeof e?e:Ae(e),o=t?q(e+"/"+t):e),e=de(n,i),o=Ne.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}Ne.chmod(o,146|e),t=Ne.open(o,577),Ne.write(t,r,0,r.length,0,a),Ne.close(t),Ne.chmod(o,e)}}function Ee(e,t={}){if(!e)throw new Ne.cc(44);t.vd??(t.vd=!0),"/"===e.charAt(0)||(e=Ne.cwd()+"/"+e);var r=0;e:for(;40>r;r++){e=e.split("/").filter(e=>!!e);for(var n=Ne.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]){if(i=H(i),Ne.Ld(n)){e=i+"/"+e.slice(a+1).join("/"),r--;continue e}n=n.parent}else{i=q(i+"/"+e[a]);try{n=ye(n,e[a])}catch(e){if(44===e?.Nc&&o&&t.Le)return{path:i};throw e}if(!n.Qc||o&&!t.vd||(n=n.Qc.root),40960==(61440&n.mode)&&(!o||t.Oc)){if(!n.fc.readlink)throw new Ne.cc(52);"/"===(n=n.fc.readlink(n)).charAt(0)||(n=H(i)+"/"+n),e=n+"/"+e.slice(a+1).join("/");continue e}}}return{path:i,node:n}}throw new Ne.cc(32)}function Ae(e){for(var t;;){if(Ne.Ld(e))return e=e.rc.ee,t?"/"!==e[e.length-1]?`${e}/${t}`:e+t:e;t=t?`${e.name}/${t}`:e.name,e=e.parent}}function xe(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Ne.Uc.length}function Se(e){var t=xe(e.parent.id,e.name);e.bd=Ne.Uc[t],Ne.Uc[t]=e}function ke(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function Te(e,t){return Ne.be?0:!t.includes("r")||292&e.mode?t.includes("w")&&!(146&e.mode)||t.includes("x")&&!(73&e.mode)?2:0:2}function Pe(e,t){if(!we(e.mode))return 54;try{return ye(e,t),20}catch(e){}return Te(e,"wx")}function Ce(e,t,r){try{var n=ye(e,t)}catch(e){return e.Nc}if(e=Te(e,"wx"))return e;if(r){if(!we(n.mode))return 54;if(Ne.Ld(n)||Ae(n)===Ne.cwd())return 10}else if(we(n.mode))return 31;return 0}function Oe(e,t){if(!e)throw new Ne.cc(t);return e}function Re(e){if(!(e=Ne.De(e)))throw new Ne.cc(8);return e}function Be(e,t=-1){if(e=Object.assign(new Ne.qe,e),-1==t)e:{for(t=0;t<=Ne.se;t++)if(!Ne.streams[t])break e;throw new Ne.cc(33)}return e.fd=t,Ne.streams[t]=e}function Le(e,t,r){var n=e?.hc.Rc;e=n?e:t,n??=t.fc.Rc,Oe(n,63),n(e,r)}function Ue(e){var t=[];for(e=[e];e.length;){var r=e.pop();t.push(r),e.push(...r.nd)}return t}function Fe(e){var t={Xe:4096,lf:4096,blocks:1e6,We:5e5,Ve:5e5,files:Ne.Od,jf:Ne.Od-1,mf:42,flags:2,vf:255};return e.fc.ke&&Object.assign(t,e.fc.ke(e.rc.Me.root)),t}function Me(e,t,r){return void 0===r&&(r=t,t=438),Ne.Tc(e,8192|t,r)}function De(e,t,r,n){Le(e,t,{mode:4095&r|-4096&t.mode,ctime:Date.now(),Yd:n})}function Ge(e,t,r){if(we(t.mode))throw new Ne.cc(31);if(!Ne.isFile(t.mode))throw new Ne.cc(28);var n=Te(t,"w");if(n)throw new Ne.cc(n);Le(e,t,{size:r,timestamp:Date.now()})}function Ie(e){if(!(e.Je||e.Ke||e.link||e.oc))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.oc=c(e.url)}catch(e){throw new Ne.cc(29)}}var Ne={root:null,nd:[],Wd:{},streams:[],Od:1,Uc:null,Td:"/",Id:!1,be:!0,ze:null,Bd:0,je:{},cc:class{name="ErrnoError";constructor(e){this.Nc=e}},qe:class{Jc={};node=null;get object(){return this.node}set object(e){this.node=e}get flags(){return this.Jc.flags}set flags(e){this.Jc.flags=e}get position(){return this.Jc.position}set position(e){this.Jc.position=e}},pe:class{fc={};hc={};Qc=null;constructor(e,t,r,n){e||=this,this.parent=e,this.rc=e.rc,this.id=Ne.Od++,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 Ke(){return we(this.mode)}get Je(){return 8192==(61440&this.mode)}},createNode:(e,t,r,n)=>(Se(e=new Ne.pe(e,t,r,n)),e),Ld:e=>e===e.parent,isFile:e=>32768==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),se:4096,De:e=>Ne.streams[e],te:{open(e){e.hc=Ne.Be(e.node.rdev).hc,e.hc.open?.(e)},Ic(){throw new Ne.cc(70)}},Md:e=>e>>8,rf:e=>255&e,ad:(e,t)=>e<<8|t,Be:e=>Ne.Wd[e],le(e,t){function r(e){return Ne.Bd--,t(e)}function n(e){if(e){if(!n.xe)return n.xe=!0,r(e)}else++o>=a.length&&r(null)}"function"==typeof e&&(t=e,e=!1),Ne.Bd++,1<Ne.Bd&&P(`warning: ${Ne.Bd} FS.syncfs operations in flight at once, probably just doing extra work`);var i,a=Ue(Ne.root.rc),o=0;for(i of a)i.type.le?i.type.le(i,e,n):n(null)},rc(e,t,r){var n="/"===r;if(n&&Ne.root)throw new Ne.cc(10);if(!n&&r){var i=Ee(r,{vd:!1});if(r=i.path,(i=i.node).Qc)throw new Ne.cc(10);if(!we(i.mode))throw new Ne.cc(54)}return(e=e.rc(t={type:e,Me:t,ee:r,nd:[]})).rc=t,t.root=e,n?Ne.root=e:i&&(i.Qc=t,i.rc&&i.rc.nd.push(t)),e},Gf(e){if(!(e=Ee(e,{vd:!1})).node.Qc)throw new Ne.cc(28);var t=(e=e.node).Qc,r=Ue(t);for([,i]of Object.entries(Ne.Uc))for(;i;){var n=i.bd;r.includes(i.rc)&&be(i);var i=n}e.Qc=null,e.rc.nd.splice(e.rc.nd.indexOf(t),1)},lookup:(e,t)=>e.fc.lookup(e,t),Tc(e,t,r){var n=Ee(e,{parent:!0}).node;if(!(e=X(e)))throw new Ne.cc(28);if("."===e||".."===e)throw new Ne.cc(20);var i=Pe(n,e);if(i)throw new Ne.cc(i);if(!n.fc.Tc)throw new Ne.cc(63);return n.fc.Tc(n,e,t,r)},ke:e=>Fe(Ee(e,{Oc:!0}).node),Cf:e=>Fe(e.node),create:(e,t=438)=>Ne.Tc(e,4095&t|32768,0),mkdir:(e,t=511)=>Ne.Tc(e,1023&t|16384,0),tf(e,t){var r,n=e.split("/"),i="";for(r of n)if(r){(i||"/"===e.charAt(0))&&(i+="/"),i+=r;try{Ne.mkdir(i,t)}catch(e){if(20!=e.Nc)throw e}}},symlink(e,t){if(!K(e))throw new Ne.cc(44);var r=Ee(t,{parent:!0}).node;if(!r)throw new Ne.cc(44);var n=Pe(r,t=X(t));if(n)throw new Ne.cc(n);if(!r.fc.symlink)throw new Ne.cc(63);return r.fc.symlink(r,t,e)},rename(e,t){var r=H(e),n=H(t),i=X(e),a=X(t),o=Ee(e,{parent:!0}),s=o.node;if(o=(o=Ee(t,{parent:!0})).node,!s||!o)throw new Ne.cc(44);if(s.rc!==o.rc)throw new Ne.cc(75);var c=ye(s,i);if("."!==(e=Q(e,n)).charAt(0))throw new Ne.cc(28);if("."!==(e=Q(t,r)).charAt(0))throw new Ne.cc(55);try{var d=ye(o,a)}catch(e){}if(c!==d){if(i=Ce(s,i,t=we(c.mode)))throw new Ne.cc(i);if(i=d?Ce(o,a,t):Pe(o,a))throw new Ne.cc(i);if(!s.fc.rename)throw new Ne.cc(63);if(c.Qc||d&&d.Qc)throw new Ne.cc(10);if(o!==s&&(i=Te(s,"w")))throw new Ne.cc(i);be(c);try{s.fc.rename(c,o,a),c.parent=o}catch(e){throw e}finally{Se(c)}}},rmdir(e){var t=Ee(e,{parent:!0}).node,r=ye(t,e=X(e)),n=Ce(t,e,!0);if(n)throw new Ne.cc(n);if(!t.fc.rmdir)throw new Ne.cc(63);if(r.Qc)throw new Ne.cc(10);t.fc.rmdir(t,e),be(r)},readdir:e=>Oe((e=Ee(e,{Oc:!0}).node).fc.readdir,54)(e),unlink(e){var t=Ee(e,{parent:!0}).node;if(!t)throw new Ne.cc(44);var r=ye(t,e=X(e)),n=Ce(t,e,!1);if(n)throw new Ne.cc(n);if(!t.fc.unlink)throw new Ne.cc(63);if(r.Qc)throw new Ne.cc(10);t.fc.unlink(t,e),be(r)},readlink(e){if(!(e=Ee(e).node))throw new Ne.cc(44);if(!e.fc.readlink)throw new Ne.cc(28);return e.fc.readlink(e)},stat:(e,t)=>Oe((e=Ee(e,{Oc:!t}).node).fc.Pc,63)(e),fstat(e){var t=Re(e);e=t.node;var r=t.hc.Pc;return t=r?t:e,r??=e.fc.Pc,Oe(r,63),r(t)},lstat:e=>Ne.stat(e,!0),chmod(e,t,r){De(null,e="string"==typeof e?Ee(e,{Oc:!r}).node:e,t,r)},lchmod(e,t){Ne.chmod(e,t,!0)},fchmod(e,t){De(e=Re(e),e.node,t,!1)},chown(e,t,r,n){Le(null,e="string"==typeof e?Ee(e,{Oc:!n}).node:e,{timestamp:Date.now(),Yd:n})},lchown(e,t,r){Ne.chown(e,t,r,!0)},fchown(e){Le(e=Re(e),e.node,{timestamp:Date.now(),Yd:!1})},truncate(e,t){if(0>t)throw new Ne.cc(28);Ge(null,e="string"==typeof e?Ee(e,{Oc:!0}).node:e,t)},nf(e,t){if(e=Re(e),0>t||!(2097155&e.flags))throw new Ne.cc(28);Ge(e,e.node,t)},Hf(e,t,r){Oe((e=Ee(e,{Oc:!0}).node).fc.Rc,63)(e,{atime:t,mtime:r})},open(e,t,n=438){if(""===e)throw new Ne.cc(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(n=64&t?4095&n|32768:0,"object"==typeof e)i=e;else{var a=e.endsWith("/");i=(e=Ee(e,{Oc:!(131072&t),Le:!0})).node,e=e.path}var o=!1;if(64&t)if(i){if(128&t)throw new Ne.cc(20)}else{if(a)throw new Ne.cc(31);i=Ne.Tc(e,511|n,0),o=!0}if(!i)throw new Ne.cc(44);if(8192==(61440&i.mode)&&(t&=-513),65536&t&&!we(i.mode))throw new Ne.cc(54);if(!o&&(a=i?40960==(61440&i.mode)?32:we(i.mode)&&("r"!==ke(t)||576&t)?31:Te(i,ke(t)):44))throw new Ne.cc(a);return 512&t&&!o&&Ne.truncate(i,0),t&=-131713,(a=Be({node:i,path:Ae(i),flags:t,seekable:!0,position:0,hc:i.hc,Te:[],error:!1})).hc.open&&a.hc.open(a),o&&Ne.chmod(i,511&n),!r.logReadFiles||1&t||e in Ne.je||(Ne.je[e]=1),a},close(e){if(null===e.fd)throw new Ne.cc(8);e.Hd&&(e.Hd=null);try{e.hc.close&&e.hc.close(e)}catch(e){throw e}finally{Ne.streams[e.fd]=null}e.fd=null},Ic(e,t,r){if(null===e.fd)throw new Ne.cc(8);if(!e.seekable||!e.hc.Ic)throw new Ne.cc(70);if(0!=r&&1!=r&&2!=r)throw new Ne.cc(28);return e.position=e.hc.Ic(e,t,r),e.Te=[],e.position},read(e,t,r,n,i){if(0>n||0>i)throw new Ne.cc(28);if(null===e.fd)throw new Ne.cc(8);if(1==(2097155&e.flags))throw new Ne.cc(8);if(we(e.node.mode))throw new Ne.cc(31);if(!e.hc.read)throw new Ne.cc(28);var a=void 0!==i;if(a){if(!e.seekable)throw new Ne.cc(70)}else i=e.position;return t=e.hc.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 Ne.cc(28);if(null===e.fd)throw new Ne.cc(8);if(!(2097155&e.flags))throw new Ne.cc(8);if(we(e.node.mode))throw new Ne.cc(31);if(!e.hc.write)throw new Ne.cc(28);e.seekable&&1024&e.flags&&Ne.Ic(e,0,2);var o=void 0!==i;if(o){if(!e.seekable)throw new Ne.cc(70)}else i=e.position;return t=e.hc.write(e,t,r,n,i,a),o||(e.position+=t),t},gd(e,t,r,n,i){if(2&n&&!(2&i)&&2!=(2097155&e.flags))throw new Ne.cc(2);if(1==(2097155&e.flags))throw new Ne.cc(2);if(!e.hc.gd)throw new Ne.cc(43);if(!t)throw new Ne.cc(28);return e.hc.gd(e,t,r,n,i)},od:(e,t,r,n,i)=>e.hc.od?e.hc.od(e,t,r,n,i):0,Jd(e,t,r){if(!e.hc.Jd)throw new Ne.cc(59);return e.hc.Jd(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=Ne.open(e,t.flags);e=Ne.stat(e).size;var n=new Uint8Array(e);return Ne.read(r,n,0,e,0),"utf8"===t.encoding&&(n=Y(n)),Ne.close(r),n},writeFile(e,t,r={}){r.flags=r.flags||577,e=Ne.open(e,r.flags,r.mode),"string"==typeof t&&(t=new Uint8Array(re(t))),ArrayBuffer.isView(t)?Ne.write(e,t,0,t.byteLength,void 0,r.cf):L("Unsupported data type"),Ne.close(e)},cwd:()=>Ne.Td,chdir(e){if(null===(e=Ee(e,{Oc:!0})).node)throw new Ne.cc(44);if(!we(e.node.mode))throw new Ne.cc(54);var t=Te(e.node,"x");if(t)throw new Ne.cc(t);Ne.Td=e.path},zf(){for(var e of(Ne.Id=!1,Ne.streams))e&&Ne.close(e)},kf(e,t){try{var r=Ee(e,{Oc:!t});e=r.path}catch(e){}var n=!1,i=null;try{r=Ee(e,{parent:!0}),X(e),r=Ee(e,{Oc:!t}),n=!0,i=r.node}catch(e){}return n?i:null},Xc(e,t,r,n){var i;return e=((e,t)=>q(e+"/"+t))("string"==typeof e?e:Ae(e),t),t=de(!!r,!!n),(i=Ne.Xc).Md??(i.Md=64),ge(i=Ne.ad(Ne.Xc.Md++,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 Ne.cc(29)}if(void 0===s&&0===a)throw new Ne.cc(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 Ne.cc(29)}return i&&(e.node.mtime=e.node.ctime=Date.now()),a}}),Me(e,t,i)}},Ve=void 0,je=e=>{for(var t="";;){var r=w[e++];if(!r)return t;t+=String.fromCharCode(r)}},ze={},We={},qe={},He=class extends Error{constructor(e){super(e),this.name="BindingError"}},Xe=e=>{throw new He(e)};function Je(e,t,r={}){return function(e,t,r={}){var n=t.name;if(!e)throw new He(`type "${n}" must have a positive integer typeid pointer`);if(We.hasOwnProperty(e)){if(r.Ee)return;throw new He(`Cannot register type '${n}' twice`)}We[e]=t,delete qe[e],ze.hasOwnProperty(e)&&(t=ze[e],delete ze[e],t.forEach(e=>e()))}(e,t,r)}var Ke=(e,t,r)=>{switch(t){case 1:return r?e=>g[e]:e=>w[e];case 2:return r?e=>y[e>>1]:e=>b[e>>1];case 4:return r?e=>_[e>>2]:e=>$[e>>2];case 8:return r?e=>x[e>>3]:e=>S[e>>3];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Qe=e=>{throw new He(e.dc.sc.qc.name+" instance already deleted")},Ye=!1,Ze=()=>{},et=e=>globalThis.FinalizationRegistry?(Ye=new FinalizationRegistry(e=>{--(e=e.dc).count.value,0===e.count.value&&(e.Fc?e.Kc.Yc(e.Fc):e.sc.qc.Yc(e.pc))}),et=e=>{var t=e.dc;return t.Fc&&Ye.register(e,{dc:t},e),e},Ze=e=>{Ye.unregister(e)},et(e)):(et=e=>e,e);function tt(){}var rt=(e,t)=>Object.defineProperty(t,"name",{value:e}),nt={},it=(e,t,r)=>{if(void 0===e[t].Ec){var n=e[t];e[t]=function(...n){if(!e[t].Ec.hasOwnProperty(n.length))throw new He(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${e[t].Ec})!`);return e[t].Ec[n.length].apply(this,n)},e[t].Ec=[],e[t].Ec[n.kd]=n}},at=(e,t,n)=>{if(r.hasOwnProperty(e)){if(void 0===n||void 0!==r[e].Ec&&void 0!==r[e].Ec[n])throw new He(`Cannot register public name '${e}' twice`);if(it(r,e,e),r[e].Ec.hasOwnProperty(n))throw new He(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`);r[e].Ec[n]=t}else r[e]=t,r[e].kd=n};function ot(e,t,r,n,i,a,o,s){this.name=e,this.constructor=t,this.ed=r,this.Yc=n,this.Hc=i,this.Ae=a,this.sd=o,this.we=s,this.Oe=[]}var st=(e,t,r)=>{for(;t!==r;){if(!t.sd)throw new He(`Expected null or instance of ${r.name}, got an instance of ${t.name}`);e=t.sd(e),t=t.Hc}return e},ct=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e};function dt(e,t){if(null===t){if(this.Kd)throw new He(`null is not a valid ${this.name}`);return 0}if(!t.dc)throw new He(`Cannot pass "${ct(t)}" as a ${this.name}`);if(!t.dc.pc)throw new He(`Cannot pass deleted object as a pointer of type ${this.name}`);return st(t.dc.pc,t.dc.sc.qc,this.qc)}function lt(e,t){if(null===t){if(this.Kd)throw new He(`null is not a valid ${this.name}`);if(this.xd){var r=this.Qe();return null!==e&&e.push(this.Yc,r),r}return 0}if(!t||!t.dc)throw new He(`Cannot pass "${ct(t)}" as a ${this.name}`);if(!t.dc.pc)throw new He(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.wd&&t.dc.sc.wd)throw new He(`Cannot convert argument of type ${t.dc.Kc?t.dc.Kc.name:t.dc.sc.name} to parameter type ${this.name}`);if(r=st(t.dc.pc,t.dc.sc.qc,this.qc),this.xd){if(void 0===t.dc.Fc)throw new He("Passing raw pointer to smart pointer is illegal");switch(this.Se){case 0:if(t.dc.Kc!==this)throw new He(`Cannot convert argument of type ${t.dc.Kc?t.dc.Kc.name:t.dc.sc.name} to parameter type ${this.name}`);r=t.dc.Fc;break;case 1:r=t.dc.Fc;break;case 2:if(t.dc.Kc===this)r=t.dc.Fc;else{var n=t.clone();r=this.Re(r,Mt(()=>n.delete())),null!==e&&e.push(this.Yc,r)}break;default:throw new He("Unsupporting sharing policy")}}return r}function ut(e,t){if(null===t){if(this.Kd)throw new He(`null is not a valid ${this.name}`);return 0}if(!t.dc)throw new He(`Cannot pass "${ct(t)}" as a ${this.name}`);if(!t.dc.pc)throw new He(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.dc.sc.wd)throw new He(`Cannot convert argument of type ${t.dc.sc.name} to parameter type ${this.name}`);return st(t.dc.pc,t.dc.sc.qc,this.qc)}function ht(e){return this.Gc($[e>>2])}var ft=(e,t,r)=>t===r?e:void 0===r.Hc||null===(e=ft(e,t,r.Hc))?null:r.we(e),pt={},mt=class extends Error{constructor(e){super(e),this.name="InternalError"}},vt=(e,t)=>{if(!t.sc||!t.pc)throw new mt("makeClassHandle requires ptr and ptrType");if(!!t.Kc!=!!t.Fc)throw new mt("Both smartPtrType and smartPtr must be specified");return t.count={value:1},et(Object.create(e,{dc:{value:t,writable:!0}}))};function gt(e,t,r,n,i,a,o,s,c,d,l){this.name=e,this.qc=t,this.Kd=r,this.wd=n,this.xd=i,this.Ne=a,this.Se=o,this.ie=s,this.Qe=c,this.Re=d,this.Yc=l,i||void 0!==t.Hc?this.Lc=lt:(this.Lc=n?dt:ut,this.Mc=null)}var wt=(e,t,n)=>{if(!r.hasOwnProperty(e))throw new mt("Replacing nonexistent public symbol");void 0!==r[e].Ec&&void 0!==n?r[e].Ec[n]=t:(r[e]=t,r[e].kd=n)},yt=(e,t)=>{e=je(e);var r=Dn.get(t);if("function"!=typeof r)throw new He(`unknown function pointer with signature ${e}: ${t}`);return r};class bt extends Error{}var _t=e=>{e=vn(e);var t=je(e);return pn(e),t},$t=(e,t)=>{var r=[],n={};throw t.forEach(function e(t){n[t]||We[t]||(qe[t]?qe[t].forEach(e):(r.push(t),n[t]=!0))}),new bt(`${e}: `+r.map(_t).join([", "]))},Et=(e,t,r)=>{function n(t){if((t=r(t)).length!==e.length)throw new mt("Mismatched type converter count");for(var n=0;n<e.length;++n)Je(e[n],t[n])}e.forEach(e=>qe[e]=t);var i=Array(t.length),a=[],o=0;for(let[e,r]of t.entries())We.hasOwnProperty(r)?i[e]=We[r]:(a.push(r),ze.hasOwnProperty(r)||(ze[r]=[]),ze[r].push(()=>{i[e]=We[r],++o===a.length&&n(i)}));0===a.length&&n(i)},At=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push($[t+4*n>>2]);return r},xt=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function St(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].Mc)return!0;return!1}function kt(e,t,r,n,i,a){var o=t.length;if(2>o)throw new He("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==t[1]&&null!==r,c=St(t);r=!t[0].ce;var d=t[0],l=t[1];for(n=[e,Xe,n,i,xt,d.Gc.bind(d),l?.Lc.bind(l)],i=2;i<o;++i)n.push((d=t[i]).Lc.bind(d));if(!c)for(i=s?1:2;i<t.length;++i)null!==t[i].Mc&&n.push(t[i].Mc);for(c=St(t),i=t.length-2,l=[],d=["fn"],s&&d.push("thisWired"),o=0;o<i;++o)l.push(`arg${o}`),d.push(`arg${o}Wired`);l=l.join(","),d=d.join(","),l=`return function (${l}) {\n`,c&&(l+="var destructors = [];\n");var u=c?"destructors":"null",h="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(s&&(l+=`var thisWired = toClassParamWire(${u}, this);\n`),o=0;o<i;++o){var f=`toArg${o}Wire`;l+=`var arg${o}Wired = ${f}(${u}, arg${o});\n`,h.push(f)}if(l+=(r||a?"var rv = ":"")+`invoker(${d});\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].Mc&&(l+=`${a}_dtor(${a});\n`,h.push(`${a}_dtor`));return r&&(l+="var ret = fromRetWire(rv);\nreturn ret;\n"),t=new Function(h,l+"}\n")(...n),rt(e,t)}var Tt,Pt,Ct,Ot,Rt=e=>{const t=(e=e.trim()).indexOf("(");return-1===t?e:e.slice(0,t)},Bt=[],Lt=[0,1,,1,null,1,!0,1,!1,1],Ut=e=>{9<e&&0===--Lt[e+1]&&(Lt[e]=void 0,Bt.push(e))},Ft=e=>{if(!e)throw new He(`Cannot use deleted val. handle = ${e}`);return Lt[e]},Mt=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const t=Bt.pop()||Lt.length;return Lt[t]=e,Lt[t+1]=1,t}},Dt={name:"emscripten::val",Gc:e=>{var t=Ft(e);return Ut(e),t},Lc:(e,t)=>Mt(t),Wc:ht,Mc:null},Gt=(e,t)=>{switch(t){case 4:return function(e){return this.Gc(E[e>>2])};case 8:return function(e){return this.Gc(A[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},It=new TextDecoder("utf-16le"),Nt=(e,t,r)=>It.decode(b.subarray(e>>=1,V(b,e,t/2,r))),Vt=(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},jt=e=>2*e.length,zt=(e,t,r)=>{var n="";e>>=2;for(var i=0;!(i>=t/4);i++){var a=$[e+i];if(!a&&!r)break;n+=String.fromCodePoint(a)}return n},Wt=(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.codePointAt(i);if(65535<a&&i++,_[t>>2]=a,(t+=4)+4>r)break}return _[t>>2]=0,t-n},qt=e=>{for(var t=0,r=0;r<e.length;++r)65535<e.codePointAt(r)&&r++,t+=4;return t},Ht=0,Xt=[],Jt=(e,t,r)=>{var n=[];return e=e(n,r),n.length&&($[t>>2]=Mt(n)),e},Kt={},Qt=e=>{var t=Kt[e];return void 0===t?je(e):t},Yt={},Zt=e=>{p=e,I||0<Ht||(r.onExit?.(e),C=!0),d(e,new U(e))},er=e=>{if(!C)try{if(e(),!(I||0<Ht))try{p=e=p,Zt(e)}catch(e){e instanceof U||"unwind"==e||d(1,e)}}catch(e){e instanceof U||"unwind"==e||d(1,e)}},tr=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))},rr=1,nr=[],ir=[],ar=[],or=[],sr=[],cr=[],dr=[],lr=[],ur=[1,1,2,2,4,4,4,2,3,4,8],hr=e=>{for(var t=rr++,r=e.length;r<t;r++)e[r]=null;for(;e[t];)t=rr++;return t},fr=(e,t,r,n)=>{for(var i=0;i<e;i++){var a=Tt[r](),o=a&&hr(n);a?(a.name=o,n[o]=a):Pt||=1282,_[t+4*i>>2]=o}},pr=["default","low-power","high-performance"],mr=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],vr=e=>(e=2<e?j(e):e,mr[e]||("undefined"!=typeof document?document.querySelector(e):null)),gr=e=>{var t=ee(e)+1,r=Un(t);return te(e,w,r,t),r},wr=[],yr=[],br=e=>{if(e)return wr[e>>>0]},_r=e=>j($[e>>2],$[e+4>>2]),$r=e=>{var t=$[e>>2];return e=$[e+4>>2],t?j(t,e):0===e?"":void 0},Er=e=>({width:$[e>>2],height:$[e+4>>2],depthOrArrayLayers:$[e+8>>2]}),Ar=e=>{var t=e+8;return{texture:br($[e>>2]),mipLevel:$[e+4>>2],origin:{x:$[t>>2],y:$[t+4>>2],z:$[t+8>>2]},aspect:Xr[$[e+20>>2]]}},xr=(e,t)=>{if(e){for(var r={},n=0;n<e;++n){var i=t+24*n;r[_r(i+4)]=A[i+16>>3]}return r}},Sr=e=>e?br(e):"auto",kr=[,"clamp-to-edge","repeat","mirror-repeat"],Tr=[,"zero","one","src","one-minus-src","src-alpha","one-minus-src-alpha","dst","one-minus-dst","dst-alpha","one-minus-dst-alpha","src-alpha-saturated","constant","one-minus-constant","src1","one-minus-src1","src1alpha","one-minus-src1alpha"],Pr=[,"add","subtract","reverse-subtract","min","max"],Cr=["binding-not-used",,"uniform","storage","read-only-storage"],Or=[,"never","less","equal","less-equal","greater","not-equal","greater-equal","always"],Rr=[,"opaque","premultiplied","unpremultiplied","inherit"],Br=[,"none","front","back"],Lr=[,"compatibility","core"],Ur={1:"core-features-and-limits",2:"depth-clip-control",3:"depth32float-stencil8",4:"texture-compression-bc",5:"texture-compression-bc-sliced-3d",6:"texture-compression-etc2",7:"texture-compression-astc",8:"texture-compression-astc-sliced-3d",9:"timestamp-query",10:"indirect-first-instance",11:"shader-f16",12:"rg11b10ufloat-renderable",13:"bgra8unorm-storage",14:"float32-filterable",15:"float32-blendable",16:"clip-distances",17:"dual-source-blending",18:"subgroups",19:"texture-formats-tier1",20:"texture-formats-tier2",21:"primitive-index",327692:"chromium-experimental-unorm16-texture-formats",327693:"chromium-experimental-snorm16-texture-formats",327732:"chromium-experimental-multi-draw-indirect"},Fr=[,"nearest","linear"],Mr=[,"ccw","cw"],Dr=[,"uint16","uint32"],Gr=[,"load","clear"],Ir=[,"nearest","linear"],Nr=[,"low-power","high-performance"],Vr=[,"srgb","display-p3"],jr=[,"point-list","line-list","line-strip","triangle-list","triangle-strip"],zr=["binding-not-used",,"filtering","non-filtering","comparison"],Wr=[,"keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],qr=["binding-not-used",,"write-only","read-only","read-write"],Hr=[,"store","discard"],Xr=[,"all","stencil-only","depth-only"],Jr=[,"1d","2d","3d"],Kr=[,"r8unorm","r8snorm","r8uint","r8sint","r16unorm","r16snorm","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32float","r32uint","r32sint","rg16unorm","rg16snorm","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb10a2uint","rgb10a2unorm","rg11b10ufloat","rgb9e5ufloat","rg32float","rg32uint","rg32sint","rgba16unorm","rgba16snorm","rgba16uint","rgba16sint","rgba16float","rgba32float","rgba32uint","rgba32sint","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb","etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm","astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"],Qr=["binding-not-used",,"float","unfilterable-float","depth","sint","uint"],Yr=[,"1d","2d","2d-array","cube","cube-array","3d"],Zr=[,"standard","extended"],en=[,"uint8","uint8x2","uint8x4","sint8","sint8x2","sint8x4","unorm8","unorm8x2","unorm8x4","snorm8","snorm8x2","snorm8x4","uint16","uint16x2","uint16x4","sint16","sint16x2","sint16x4","unorm16","unorm16x2","unorm16x4","snorm16","snorm16x2","snorm16x4","float16","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4","unorm10-10-10-2","unorm8x4-bgra"],tn=[,"vertex","instance"],rn={undefined:1,unknown:1,destroyed:2},nn=e=>-9007199254740992>e||9007199254740992<e?NaN:Number(e),an=e=>"]"==e.slice(-1)&&e.lastIndexOf("["),on=[],sn=e=>0==(e-=5120)?g:1==e?w:2==e?y:4==e?_:6==e?E:5==e||28922==e||28520==e||30779==e||30782==e?$:b,cn=e=>{var t=Tt.ve;if(t){var r=t.rd[e];return"number"==typeof r&&(t.rd[e]=r=Tt.getUniformLocation(t,t.me[e]+(0<r?`[${r}]`:""))),r}Pt||=1282},dn=[],ln=[];Ne.df=(e,t,r,n,i,a,o,s,c,d)=>{me(e,t,r,n,i,s,c,d).then(a).catch(o)},Ne.xf=me,Ne.Uc=Array(4096),Ne.rc(ce,{},"/"),Ne.mkdir("/tmp"),Ne.mkdir("/home"),Ne.mkdir("/home/web_user"),function(){Ne.mkdir("/dev"),ge(Ne.ad(1,3),{read:()=>0,write:(e,t,r,n)=>n,Ic:()=>0}),Me("/dev/null",Ne.ad(1,3)),ie(Ne.ad(5,0),oe),ie(Ne.ad(6,0),se),Me("/dev/tty",Ne.ad(5,0)),Me("/dev/tty1",Ne.ad(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(J(e),t=e.byteLength),e[--t]);Ne.Xc("/dev","random",r),Ne.Xc("/dev","urandom",r),Ne.mkdir("/dev/shm"),Ne.mkdir("/dev/shm/tmp")}(),function(){Ne.mkdir("/proc");var e=Ne.mkdir("/proc/self");Ne.mkdir("/proc/self/fd"),Ne.rc({rc(){var t=Ne.createNode(e,"fd",16895,73);return t.hc={Ic:ce.hc.Ic},t.fc={lookup(e,t){var r=Re(e=+t);return(e={parent:null,rc:{ee:"fake"},fc:{readlink:()=>r.path},id:e+1}).parent=e},readdir:()=>Array.from(Ne.streams.entries()).filter(([,e])=>e).map(([e])=>e.toString())},t}},{},"/proc/self/fd")}(),Ne.ze={MEMFS:ce},(()=>{let e=tt.prototype;Object.assign(e,{isAliasOf:function(e){if(!(this instanceof tt&&e instanceof tt))return!1;var t=this.dc.sc.qc,r=this.dc.pc;e.dc=e.dc;var n=e.dc.sc.qc;for(e=e.dc.pc;t.Hc;)r=t.sd(r),t=t.Hc;for(;n.Hc;)e=n.sd(e),n=n.Hc;return t===n&&r===e},clone:function(){if(this.dc.pc||Qe(this),this.dc.pd)return this.dc.count.value+=1,this;var e=et,t=Object,r=t.create,n=Object.getPrototypeOf(this),i=this.dc;return(e=e(r.call(t,n,{dc:{value:{count:i.count,md:i.md,pd:i.pd,pc:i.pc,sc:i.sc,Fc:i.Fc,Kc:i.Kc}}}))).dc.count.value+=1,e.dc.md=!1,e},delete(){if(this.dc.pc||Qe(this),this.dc.md&&!this.dc.pd)throw new He("Object already scheduled for deletion");Ze(this);var e=this.dc;--e.count.value,0===e.count.value&&(e.Fc?e.Kc.Yc(e.Fc):e.sc.qc.Yc(e.pc)),this.dc.pd||(this.dc.Fc=void 0,this.dc.pc=void 0)},isDeleted:function(){return!this.dc.pc},deleteLater:function(){if(this.dc.pc||Qe(this),this.dc.md&&!this.dc.pd)throw new He("Object already scheduled for deletion");return this.dc.md=!0,this}});const t=Symbol.dispose;t&&(e[t]=e.delete)})(),Object.assign(gt.prototype,{Ce(e){return this.ie&&(e=this.ie(e)),e},Vd(e){this.Yc?.(e)},Wc:ht,Gc:function(e){function t(){return vt(this.qc.ed,this.xd?{sc:this.Ne,pc:r,Kc:this,Fc:e}:{sc:this,pc:e})}var r=this.Ce(e);if(!r)return this.Vd(e),null;var n=((e,t)=>{if(void 0===t)throw new He("ptr should not be undefined");for(;e.Hc;)t=e.sd(t),e=e.Hc;return pt[t]})(this.qc,r);if(void 0!==n)return 0===n.dc.count.value?(n.dc.pc=r,n.dc.Fc=e,n.clone()):(n=n.clone(),this.Vd(e),n);if(n=this.qc.Ae(r),!(n=nt[n]))return t.call(this);var i=ft(r,this.qc,(n=this.wd?n.ue:n.pointerType).qc);return null===i?t.call(this):vt(n.qc.ed,this.xd?{sc:n,pc:i,Kc:this,Fc:e}:{sc:n,pc:i})}}),"undefined"!=typeof MainLoop&&MainLoop.wf.push(()=>{if(Ct){var e=Ct.jd;for(Ct.jd=Ct.qd,Ct.qd=e,e=Ct.Zc,Ct.Zc=Ct.Cd,Ct.Cd=e,e=0;21>=e;++e)Ct.Zc[e]=0}});for(let e=0;32>e;++e)on.push(Array(e));for(var un=new Int32Array(288),hn=0;288>=hn;++hn)dn[hn]=un.subarray(0,hn);var fn=new Float32Array(288);for(hn=0;288>=hn;++hn)ln[hn]=fn.subarray(0,hn);if(r.noExitRuntime&&(I=r.noExitRuntime),r.preloadPlugins&&(pe=r.preloadPlugins),r.print&&(T=r.print),r.printErr&&(P=r.printErr),r.wasmBinary&&(f=r.wasmBinary),r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.shift()();r.addRunDependency=fe,r.removeRunDependency=he,r.FS_preloadFile=me,r.FS_unlink=(...e)=>Ne.unlink(...e),r.FS_createPath=(...e)=>function(e,t){for(e="string"==typeof e?e:Ae(e),t=t.split("/").reverse();t.length;){var r=t.pop();if(r){var n=q(e+"/"+r);try{Ne.mkdir(n)}catch(e){if(20!=e.Nc)throw e}e=n}}return n}(...e),r.FS_createDevice=(...e)=>Ne.Xc(...e),r.FS=Ne,r.FS_createDataFile=(...e)=>$e(...e),r.FS_createLazyFile=(...e)=>function(e,t,r,n,a){class o{Gd=!1;Jc=[];Ed=void 0;ge=0;ae=0;get(e){if(!(e>this.length-1||0>e)){var t=e%this.chunkSize;return this.Ed(e/this.chunkSize|0)[t]}}Pe(e){this.Ed=e}he(){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 a=1048576;i||(a=n);var o=this;o.Pe(e=>{var t=e*a,i=(e+1)*a-1;if(i=Math.min(i,n-1),void 0===o.Jc[e]){var s=o.Jc;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!==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||L("Couldn't load "+r+". Status: "+c.status),t=void 0!==c.response?new Uint8Array(c.response||[]):re(c.responseText||""),s[e]=t}return void 0===o.Jc[e]&&L("doXHR failed!"),o.Jc[e]}),!e&&n||(a=n=1,a=n=this.Ed(0).length,T("LazyFiles on gzip forces download of the whole file when length is accessed")),this.ge=n,this.ae=a,this.Gd=!0}get length(){return this.Gd||this.he(),this.ge}get chunkSize(){return this.Gd||this.he(),this.ae}}if(globalThis.XMLHttpRequest){i||L("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var s=new o,c=void 0}else c=r,s=void 0;var d=function(e,t,r,n){return e="string"==typeof e?e:Ae(e),t=q(e+"/"+t),Ne.create(t,de(r,n))}(e,t,n,a);s?d.oc=s:c&&(d.oc=null,d.url=c),Object.defineProperties(d,{Dc:{get:function(){return this.oc.length}}}),e={};for(const[t,r]of Object.entries(d.hc))e[t]=(...e)=>(Ie(d),r(...e));return e.read=(e,t,r,n,i)=>{if(Ie(d),i>=(e=e.node.oc).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},e.gd=()=>{throw Ie(d),L(),new Ne.cc(48)},d.hc=e,d}(...e);var pn,mn,vn,gn,wn,yn,bn,_n,$n,En,An,xn,Sn,kn,Tn,Pn,Cn,On,Rn,Bn,Ln,Un,Fn,Mn,Dn,Gn,In={a:(e,t,r,n)=>L(`Assertion failed: ${j(e)}, at: `+[t?j(t):"unknown filename",r,n?j(n):"unknown function"]),wa:function(e,t,r){Ve=r;try{var n=Re(e);switch(t){case 0:var i=z();if(0>i)break;for(;Ne.streams[i];)i++;return function(e,t=-1){return e=Be(e,t),e.hc?.ff?.(e),e}(n,i).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:return i=z(),n.flags|=i,0;case 12:return i=z(),y[i+0>>1]=2,0}return-28}catch(e){if(void 0===Ne||"ErrnoError"!==e.name)throw e;return-e.Nc}},Ab:function(e,t,r){Ve=r;try{var n=Re(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.Vc.Ge){e=[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var i=z();_[i>>2]=25856,_[i+4>>2]=5,_[i+8>>2]=191,_[i+12>>2]=35387;for(var a=0;32>a;a++)g[i+a+17]=e[a]||0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.Vc.He)for(i=z(),e=[],a=0;32>a;a++)e.push(g[i+a+17]);return 0;case 21519:return n.tty?(i=z(),_[i>>2]=0):-59;case 21520:return n.tty?-28:-59;case 21537:case 21531:return i=z(),Ne.Jd(n,t,i);case 21523:return n.tty?(n.tty.Vc.Ie&&(a=[24,80],i=z(),y[i>>1]=a[0],y[i+2>>1]=a[1]),0):-59;default:return-28}}catch(e){if(void 0===Ne||"ErrnoError"!==e.name)throw e;return-e.Nc}},Bb:function(e,t,r,n){Ve=n;try{var i=t=j(t);if("/"===i.charAt(0))t=i;else{var a=-100===e?Ne.cwd():Re(e).path;if(0==i.length)throw new Ne.cc(44);t=a+"/"+i}var o=n?z():0;return Ne.open(t,r,o).fd}catch(e){if(void 0===Ne||"ErrnoError"!==e.name)throw e;return-e.Nc}},Cb:()=>L(""),sa:(e,t,r,n,i)=>{t=je(t);let a=e=>e;if(n=0n===n){const e=8*r;a=t=>BigInt.asUintN(e,t),i=a(i)}Je(e,{name:t,Gc:a,Lc:(e,t)=>("number"==typeof t&&(t=BigInt(t)),t),Wc:Ke(t,r,!n),Mc:null})},ob:(e,t,r,n)=>{Je(e,{name:t=je(t),Gc:function(e){return!!e},Lc:function(e,t){return t?r:n},Wc:function(e){return this.Gc(w[e])},Mc:null})},mb:(e,t,r,n,i,a,o,s,c,d,l,u,h)=>{l=je(l),a=yt(i,a),s&&=yt(o,s),d&&=yt(c,d),h=yt(u,h);var f=(e=>{var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e})(l);at(f,function(){$t(`Cannot construct ${l} due to unbound types`,[n])}),Et([e,t,r],n?[n]:[],t=>{if(t=t[0],n)var r=t.qc,i=r.ed;else i=tt.prototype;t=rt(l,function(...e){if(Object.getPrototypeOf(this)!==o)throw new He(`Use 'new' to construct ${l}`);if(void 0===u.$c)throw new He(`${l} has no accessible constructor`);var t=u.$c[e.length];if(void 0===t)throw new He(`Tried to invoke ctor of ${l} with invalid number of parameters (${e.length}) - expected (${Object.keys(u.$c).toString()}) parameters instead!`);return t.apply(this,e)});var o=Object.create(i,{constructor:{value:t}});t.prototype=o;var c,u=new ot(l,t,o,h,r,a,s,d);return u.Hc&&((c=u.Hc).Rd??(c.Rd=[]),u.Hc.Rd.push(u)),r=new gt(l,u,!0,!1,!1),c=new gt(l+"*",u,!1,!1,!1),i=new gt(l+" const*",u,!1,!0,!1),nt[e]={pointerType:c,ue:i},wt(f,t),[r,c,i]})},cb:(e,t,r,n,i,a)=>{var o=At(t,r);i=yt(n,i),Et([],[e],e=>{var r=`constructor ${(e=e[0]).name}`;if(void 0===e.qc.$c&&(e.qc.$c=[]),void 0!==e.qc.$c[t-1])throw new He(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.qc.$c[t-1]=()=>{$t(`Cannot construct ${e.name} due to unbound types`,o)},Et([],o,n=>(n.splice(1,0,null),e.qc.$c[t-1]=kt(r,n,null,i,a),[])),[]})},t:(e,t,r,n,i,a,o,s,c)=>{var d=At(r,n);t=je(t),t=Rt(t),a=yt(i,a),Et([],[e],e=>{function n(){$t(`Cannot call ${i} due to unbound types`,d)}var i=`${(e=e[0]).name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.qc.Oe.push(t);var l=e.qc.ed,u=l[t];return void 0===u||void 0===u.Ec&&u.className!==e.name&&u.kd===r-2?(n.kd=r-2,n.className=e.name,l[t]=n):(it(l,t,i),l[t].Ec[r-2]=n),Et([],d,n=>(n=kt(i,n,e,a,o,c),void 0===l[t].Ec?(n.kd=r-2,l[t]=n):l[t].Ec[r-2]=n,[])),[]})},lb:e=>Je(e,Dt),ra:(e,t,r)=>{Je(e,{name:t=je(t),Gc:e=>e,Lc:(e,t)=>t,Wc:Gt(t,r),Mc:null})},Da:(e,t,r,n,i,a,o)=>{var s=At(t,r);e=je(e),e=Rt(e),i=yt(n,i),at(e,function(){$t(`Cannot call ${e} due to unbound types`,s)},t-1),Et([],s,r=>(r=[r[0],null].concat(r.slice(1)),wt(e,kt(e,r,null,i,a,o),t-1),[]))},z:(e,t,r,n,i)=>{t=je(t);let a=e=>e;if(0===n){var o=32-8*r;a=e=>e<<o>>>o,i=a(i)}Je(e,{name:t,Gc:a,Lc:(e,t)=>t,Wc:Ke(t,r,0!==n),Mc:null})},o:(e,t,r)=>{function n(e){return new i(g.buffer,$[e+4>>2],$[e>>2])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];Je(e,{name:r=je(r),Gc:n,Wc:n},{Ee:!0})},nb:(e,t)=>{Je(e,{name:t=je(t),Gc(e){var t=j(e+4,$[e>>2],!0);return pn(e),t},Lc(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 He("Cannot pass non-string to std::string");var n=r?ee(t):t.length,i=mn(4+n+1),a=i+4;return $[i>>2]=n,r?te(t,w,a,n+1):w.set(t,a),null!==e&&e.push(pn,i),i},Wc:ht,Mc(e){pn(e)}})},W:(e,t,r)=>{if(r=je(r),2===t)var n=Nt,i=Vt,a=jt;else n=zt,i=Wt,a=qt;Je(e,{name:r,Gc:e=>{var r=n(e+4,$[e>>2]*t,!0);return pn(e),r},Lc:(e,n)=>{if("string"!=typeof n)throw new He(`Cannot pass non-string to C++ string type ${r}`);var o=a(n),s=mn(4+o+t);return $[s>>2]=o/t,i(n,s+4,o+t),null!==e&&e.push(pn,s),s},Wc:ht,Mc(e){pn(e)}})},$:e=>{Je(e,Dt)},pb:(e,t)=>{Je(e,{ce:!0,name:t=je(t),Gc:()=>{},Lc:()=>{}})},tb:()=>{I=!1,Ht=0},rb:()=>{throw 1/0},C:(e,t,r)=>{var[n,...i]=((e,t)=>{for(var r=Array(e),n=0;n<e;++n){var i=n,a=$[t+4*n>>2],o=We[a];if(void 0===o)throw e=`parameter ${n} has unknown type ${_t(a)}`,new He(e);r[i]=o}return r})(e,t);t=n.Lc.bind(n);var a=i.map(e=>e.Wc.bind(e));e--;var o={toValue:Ft};switch(e=a.map((e,t)=>{var r=`argFromPtr${t}`;return o[r]=e,`${r}(args${t?"+"+8*t:""})`}),r){case 0:var s="toValue(handle)";break;case 2:s="new (toValue(handle))";break;case 3:s="";break;case 1:o.getStringOrSymbol=Qt,s="toValue(handle)[getStringOrSymbol(methodName)]"}return s+=`(${e})`,n.ce||(o.toReturnWire=t,o.emval_returnValue=Jt,s=`return emval_returnValue(toReturnWire, destructorsRef, ${s})`),s=`return function (handle, methodName, destructorsRef, args) {\n ${s}\n }`,r=new Function(Object.keys(o),s)(...Object.values(o)),s=`methodCaller<(${i.map(e=>e.name)}) => ${n.name}>`,(e=>{var t=Xt.length;return Xt.push(e),t})(rt(s,r))},jb:Ut,qb:e=>e?(e=Qt(e),Mt(globalThis[e])):Mt(globalThis),H:(e,t)=>(e=Ft(e),t=Ft(t),Mt(e[t])),ba:e=>{9<e&&(Lt[e+1]+=1)},A:(e,t,r,n,i)=>Xt[e](t,r,n,i),xb:e=>Mt(Qt(e)),Ua:e=>{var t=Ft(e);xt(t),Ut(e)},ub:(e,t)=>{if(Yt[e]&&(clearTimeout(Yt[e].id),delete Yt[e]),!t)return 0;var r=setTimeout(()=>{delete Yt[e],er(()=>Rn(e,performance.now()))},t);return Yt[e]={id:r,Ef:t},0},vb:e=>{var t=w.length;if(2147483648<(e>>>=0))return!1;for(var r=1;4>=r;r*=2){var n=t*(1+.2/r);n=Math.min(n,e+100663296);e:{n=(Math.min(2147483648,65536*Math.ceil(Math.max(e,n)/65536))-Mn.buffer.byteLength+65535)/65536|0;try{Mn.grow(n),B();var i=1;break e}catch(e){}i=void 0}if(i)return!0}return!1},Ub:(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:pr[_[r+2]],failIfMajorPerformanceCaveat:!!g[t+12],de:_[r+4],sf:_[r+5],Zd:g[t+24],ye:g[t+25],yf:_[r+7],Bf:g[t+32]},!(e=vr(e))||t.ye?0:((e,t)=>{e.Jc||(e.Jc=e.getContext,e.getContext=function(t,r){return"webgl"==t==(r=e.Jc(t,r))instanceof WebGLRenderingContext?r:null});var r=e.getContext(1<t.de?"webgl2":"webgl",t);return r?((e,t)=>{var r=hr(lr),n={handle:r,attributes:t,version:t.de,cd:e};if(e.canvas&&(e.canvas.re=n),lr[r]=n,(void 0===t.Zd||t.Zd)&&((e=n)||(e=Ct),!e.Fe))for(var i of(e.Fe=!0,(t=e.cd).uf=t.getExtension("WEBGL_multi_draw"),t.hf=t.getExtension("EXT_polygon_offset_clamp"),t.gf=t.getExtension("EXT_clip_control"),t.If=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.ef=t.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"),t.qf=t.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"),2<=e.version&&(t.Xd=t.getExtension("EXT_disjoint_timer_query_webgl2")),(2>e.version||!t.Xd)&&(t.Xd=t.getExtension("EXT_disjoint_timer_query")),tr(t)))i.includes("lose_context")||i.includes("debug")||t.getExtension(i);for(n.Nd=n.cd.getParameter(34921),n.dd=[],i=0;i<n.Nd;i++)n.dd[i]={enabled:!1,td:!1,size:0,type:0,fe:0,stride:0,pc:0,oe:null};for(n.Zc=[],n.Cd=[],n.Zc.length=n.Cd.length=22,n.jd=[],n.qd=[],n.jd.length=n.qd.length=22,n.hd=[],n.hd.length=22,i=0;21>=i;++i){n.hd[i]=null,n.Zc[i]=n.Cd[i]=0,n.jd[i]=[],n.qd[i]=[],(e=n.jd[i]).length=(t=n.qd[i]).length=64;for(var a=0;64>a;++a)e[a]=t[a]=null}return r})(r,t):0})(e,t)},Ja:e=>{Ct==e&&(Ct=0),Ct===lr[e]&&(Ct=null),"object"==typeof JSEvents&&JSEvents.Af(lr[e].cd.canvas),lr[e]?.cd.canvas&&(lr[e].cd.canvas.re=void 0),lr[e]=null},kb:()=>Ct?Ct.handle:0,za:e=>(Ct=lr[e],r.ctx=Tt=Ct?.cd,!e||Tt?0:-5),Gb:function(e,t,r,n,i,a){t=nn(t),r=nn(r),e=br(e);var o={};if(a){var s=$[a+12>>2];if(s){var c=$[a+16>>2];o.requiredFeatures=Array.from($.subarray(c>>2,c+4*s>>2),e=>Ur[e])}var d=$[a+20>>2];if(d){var l={};function u(e,t,r=!1){4294967295==(t=$[d+t>>2])||r&&0==t||(l[e]=t)}function h(e,t){4294967295==$[(t=d+t)>>2]&&4294967295==$[t+4>>2]||(l[e]=4294967296*$[t+4>>2]+$[t>>2])}u("maxTextureDimension1D",4),u("maxTextureDimension2D",8),u("maxTextureDimension3D",12),u("maxTextureArrayLayers",16),u("maxBindGroups",20),u("maxBindGroupsPlusVertexBuffers",24),u("maxDynamicUniformBuffersPerPipelineLayout",32),u("maxDynamicStorageBuffersPerPipelineLayout",36),u("maxSampledTexturesPerShaderStage",40),u("maxSamplersPerShaderStage",44),u("maxStorageBuffersPerShaderStage",48),u("maxStorageTexturesPerShaderStage",52),u("maxUniformBuffersPerShaderStage",56),u("minUniformBufferOffsetAlignment",80),u("minStorageBufferOffsetAlignment",84),h("maxUniformBufferBindingSize",64),h("maxStorageBufferBindingSize",72),u("maxVertexBuffers",88),h("maxBufferSize",96),u("maxVertexAttributes",104),u("maxVertexBufferArrayStride",108),u("maxInterStageShaderVariables",112),u("maxColorAttachments",116),u("maxColorAttachmentBytesPerSample",120),u("maxComputeWorkgroupStorageSize",124),u("maxComputeInvocationsPerWorkgroup",128),u("maxComputeWorkgroupSizeX",132),u("maxComputeWorkgroupSizeY",136),u("maxComputeWorkgroupSizeZ",140),u("maxComputeWorkgroupsPerDimension",144),u("maxImmediateSize",148,!0),o.requiredLimits=l}(s=$[a+24>>2])&&(s={label:$r(s+4)},o.defaultQueue=s),o.label=$r(a+4)}e.requestDevice(o).then(e=>{er(()=>{wr[i>>>0]=e.queue,wr[n>>>0]=e,e.lost.then(t=>{er(()=>{e.onuncapturederror=()=>{};var n=Fn(),i=gr(t.message);Tn(r,rn[t.reason],i),Ln(n)})}),e.onuncapturederror=e=>{var t=5;e.error instanceof GPUValidationError?t=2:e.error instanceof GPUOutOfMemoryError?t=3:e.error instanceof GPUInternalError&&(t=4);var r=Fn();e=gr(e.error.message),On(n,t,e),Ln(r)},Cn(t,1,n,0)})},e=>{er(()=>{var i=Fn(),a=gr(e.message);Cn(t,3,n,a),r&&Tn(r,4,a),Ln(i)})})},Ib:e=>{var t=br(e),r=yr[e];if(r){for(var n=0;n<r.length;++n)r[n]();delete yr[e]}t.destroy()},h:e=>{delete wr[e]},Fb:(e,t,r)=>{var n=!!$[t+32>>2];t={label:$r(t+4),usage:$[t+16>>2],size:4294967296*$[t+4+24>>2]+$[t+24>>2],mappedAtCreation:n},e=br(e);try{var i=e.createBuffer(t)}catch(e){return!1}return wr[r>>>0]=i,n&&(yr[r]=[]),!0},Eb:(e,t,r)=>{var n=$[t>>2],i=$[n+4>>2];t={label:$r(t+4),code:""},2===i&&(t.code=_r(n+8)),e=br(e).createShaderModule(t),wr[r>>>0]=e},Hb:e=>{(e=br(e)).onuncapturederror=null,e.destroy()},Db:function(e,t,r,n){if(t=nn(t),r){var i={featureLevel:Lr[$[r+4>>2]],powerPreference:Nr[$[r+8>>2]],forceFallbackAdapter:!!$[r+12>>2]};0!==(e=$[r>>2])&&(i.Jf=!!$[e+8>>2])}"gpu"in navigator?navigator.gpu.requestAdapter(i).then(e=>{er(()=>{if(e)wr[n>>>0]=e,Pn(t,1,n,0);else{var r=Fn(),i=gr("WebGPU not available on this browser (requestAdapter returned null)");Pn(t,3,n,i),Ln(r)}})},e=>{er(()=>{var r=Fn(),i=gr(e.message);Pn(t,4,n,i),Ln(r)})}):(i=Fn(),e=gr("WebGPU not available on this browser (navigator.gpu is not available)"),Pn(t,3,n,e),Ln(i))},va:function(e){try{var t=Re(e);return Ne.close(t),0}catch(e){if(void 0===Ne||"ErrnoError"!==e.name)throw e;return e.Nc}},zb:function(e,t,r,n){try{e:{var i=Re(e);e=t;for(var a,o=t=0;o<r;o++){var s=$[e>>2],c=$[e+4>>2];e+=8;var d=Ne.read(i,g,s,c,a);if(0>d){var l=-1;break e}if(t+=d,d<c)break;void 0!==a&&(a+=d)}l=t}return $[n>>2]=l,0}catch(e){if(void 0===Ne||"ErrnoError"!==e.name)throw e;return e.Nc}},wb:function(e,t,r,n){t=nn(t);try{if(isNaN(t))return 61;var i=Re(e);return Ne.Ic(i,t,r),x[n>>3]=BigInt(i.position),i.Hd&&0===t&&0===r&&(i.Hd=null),0}catch(e){if(void 0===Ne||"ErrnoError"!==e.name)throw e;return e.Nc}},yb:function(e,t,r,n){try{e:{var i=Re(e);e=t;for(var a,o=t=0;o<r;o++){var s=$[e>>2],c=$[e+4>>2];e+=8;var d=Ne.write(i,g,s,c,a);if(0>d){var l=-1;break e}if(t+=d,d<c)break;void 0!==a&&(a+=d)}l=t}return $[n>>2]=l,0}catch(e){if(void 0===Ne||"ErrnoError"!==e.name)throw e;return e.Nc}},Qa:e=>Tt.activeTexture(e),na:(e,t)=>{Tt.attachShader(ir[e],cr[t])},q:(e,t)=>{if(t&&!nr[t]){var r=Tt.createBuffer();r.name=t,nr[t]=r}34962==e?Tt.ud=t:34963==e&&(Tt.ld=t),35051==e?Tt.Ud=t:35052==e&&(Tt.Dd=t),Tt.bindBuffer(e,nr[t])},Oa:(e,t,r,n,i)=>{Tt.bindBufferRange(e,t,nr[r],n,i)},f:(e,t)=>{Tt.bindFramebuffer(e,ar[t])},U:(e,t)=>{Tt.bindRenderbuffer(e,or[t])},L:(e,t)=>{Tt.bindTexture(e,sr[t])},pa:e=>{Tt.bindVertexArray(dr[e]),e=Tt.getParameter(34965),Tt.ld=e?0|e.name:0},D:(e,t)=>Tt.blendFunc(e,t),x:(e,t,r,n,i,a,o,s,c,d)=>Tt.blitFramebuffer(e,t,r,n,i,a,o,s,c,d),V:(e,t,r,n)=>{2<=Ct.version?r&&t?Tt.bufferData(e,w,n,r,t):Tt.bufferData(e,t,n):Tt.bufferData(e,r?w.subarray(r,r+t):t,n)},S:e=>Tt.clear(e),T:(e,t,r,n)=>Tt.clearColor(e,t,r,n),La:e=>Tt.clearDepth(e),Ma:e=>Tt.clearStencil(e),E:(e,t,r,n)=>{Tt.colorMask(!!e,!!t,!!r,!!n)},Ga:e=>{Tt.compileShader(cr[e])},eb:()=>{var e=hr(ir),t=Tt.createProgram();return t.name=e,t.Ad=t.yd=t.zd=0,t.Qd=1,ir[e]=t,e},Ia:e=>{var t=hr(cr);return cr[t]=Tt.createShader(e),t},_a:e=>Tt.cullFace(e),hb:(e,t)=>{for(var r=0;r<e;r++){var n=_[t+4*r>>2],i=nr[n];i&&(Tt.deleteBuffer(i),i.name=0,nr[n]=null,n==Tt.ud&&(Tt.ud=0),n==Tt.ld&&(Tt.ld=0),n==Tt.Ud&&(Tt.Ud=0),n==Tt.Dd&&(Tt.Dd=0))}},ea:(e,t)=>{for(var r=0;r<e;++r){var n=_[t+4*r>>2],i=ar[n];i&&(Tt.deleteFramebuffer(i),i.name=0,ar[n]=null)}},la:e=>{if(e){var t=ir[e];t?(Tt.deleteProgram(t),t.name=0,ir[e]=null):Pt||=1281}},da:(e,t)=>{for(var r=0;r<e;r++){var n=_[t+4*r>>2],i=or[n];i&&(Tt.deleteRenderbuffer(i),i.name=0,or[n]=null)}},R:e=>{if(e){var t=cr[e];t?(Tt.deleteShader(t),cr[e]=null):Pt||=1281}},qa:(e,t)=>{for(var r=0;r<e;r++){var n=_[t+4*r>>2],i=sr[n];i&&(Tt.deleteTexture(i),i.name=0,sr[n]=null)}},fb:(e,t)=>{for(var r=0;r<e;r++){var n=_[t+4*r>>2];Tt.deleteVertexArray(dr[n]),dr[n]=null}},Ya:e=>Tt.depthFunc(e),O:e=>{Tt.depthMask(!!e)},y:e=>Tt.disable(e),ca:e=>{Ct.dd[e].enabled=!1,Tt.disableVertexAttribArray(e)},Na:(e,t,r,n)=>{var i=0;if(!Tt.ld){var a=1*ur[r-5120]*t,o=(e=>{e=32-Math.clz32(0===e?0:e-1);var t=Ct.hd[e];return t||(t=Tt.getParameter(34965),Ct.hd[e]=Tt.createBuffer(),Tt.bindBuffer(34963,Ct.hd[e]),Tt.bufferData(34963,1<<e,35048),Tt.bindBuffer(34963,t),Ct.hd[e])})(a);if(Tt.bindBuffer(34963,o),Tt.bufferSubData(34963,0,w.subarray(n,n+a)),0<t)for(o=0;o<Ct.Nd;++o)if((a=Ct.dd[o]).td&&a.enabled){switch(r){case 5121:i=Uint8Array;break;case 5123:i=Uint16Array;break;case 5125:i=Uint32Array;break;default:return void(Pt||=1282)}i=new i(w.buffer,n,t).reduce((e,t)=>Math.max(e,t))+1;break}n=0}(e=>{Ot=!1;for(var t=0;t<Ct.Nd;++t){var r=Ct.dd[t];if(r.td&&r.enabled){Ot=!0;var n=r.size,i=r.type,a=r.stride;n=0<a?e*a:n*ur[i-5120]*e,i=32-Math.clz32(0===n?0:n-1),a=Ct.jd[i];var o=Ct.Zc[i];Ct.Zc[i]=Ct.Zc[i]+1&63;var s=a[o];s?i=s:(s=Tt.getParameter(34964),a[o]=Tt.createBuffer(),Tt.bindBuffer(34962,a[o]),Tt.bufferData(34962,1<<i,35048),Tt.bindBuffer(34962,s),i=a[o]),Tt.bindBuffer(34962,i),Tt.bufferSubData(34962,0,w.subarray(r.pc,r.pc+n)),r.oe.call(Tt,t,r.size,r.type,r.fe,r.stride,0)}}})(i),Tt.drawElements(e,t,r,n),Ot&&Tt.bindBuffer(34962,nr[Tt.ud]),Tt.ld||Tt.bindBuffer(34963,null)},u:e=>Tt.enable(e),Sa:e=>{Ct.dd[e].enabled=!0,Tt.enableVertexAttribArray(e)},fa:(e,t,r,n)=>{Tt.framebufferRenderbuffer(e,t,r,or[n])},Xa:(e,t,r,n,i)=>{Tt.framebufferTexture2D(e,t,r,sr[n],i)},Za:e=>Tt.frontFace(e),ib:(e,t)=>{fr(e,t,"createBuffer",nr)},ia:(e,t)=>{fr(e,t,"createFramebuffer",ar)},ha:(e,t)=>{fr(e,t,"createRenderbuffer",or)},ka:(e,t)=>{fr(e,t,"createTexture",sr)},gb:(e,t)=>{fr(e,t,"createVertexArray",dr)},oa:(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=Tt.getParameter(34467);r=n?n.length:0;break;case 33309:if(2>Ct.version)return void(Pt||=1282);r=(()=>{var e=tr(Tt);return e.concat(e.map(e=>"GL_"+e))})().length;break;case 33307:case 33308:if(2>Ct.version)return void(Pt||=1280);r=33307==e?3:0}if(void 0===r)switch(n=Tt.getParameter(e),typeof n){case"number":r=n;break;case"boolean":r=n?1:0;break;case"string":return void(Pt||=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(Pt||=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 Pt||=1280,void P(`GL_INVALID_ENUM in glGet0v: Unknown object returned from WebGL getParameter(${e})! (error: ${t})`)}}break;default:return Pt||=1280,void P(`GL_INVALID_ENUM in glGet0v: Native code calling glGet0v(${e}) and it returns ${n} of type ${typeof n}!`)}_[t>>2]=r}else Pt||=1281})(e,t),bb:(e,t,r,n)=>{null===(e=Tt.getProgramInfoLog(ir[e]))&&(e="(unknown error)"),t=0<t&&n?te(e,w,n,t):0,r&&(_[r>>2]=t)},ma:(e,t,r)=>{if(r)if(e>=rr)Pt||=1281;else if(e=ir[e],35716==t)null===(e=Tt.getProgramInfoLog(e))&&(e="(unknown error)"),_[r>>2]=e.length+1;else if(35719==t){if(!e.Ad){var n=Tt.getProgramParameter(e,35718);for(t=0;t<n;++t)e.Ad=Math.max(e.Ad,Tt.getActiveUniform(e,t).name.length+1)}_[r>>2]=e.Ad}else if(35722==t){if(!e.yd)for(n=Tt.getProgramParameter(e,35721),t=0;t<n;++t)e.yd=Math.max(e.yd,Tt.getActiveAttrib(e,t).name.length+1);_[r>>2]=e.yd}else if(35381==t){if(!e.zd)for(n=Tt.getProgramParameter(e,35382),t=0;t<n;++t)e.zd=Math.max(e.zd,Tt.getActiveUniformBlockName(e,t).length+1);_[r>>2]=e.zd}else _[r>>2]=Tt.getProgramParameter(e,t);else Pt||=1281},Fa:(e,t,r,n)=>{null===(e=Tt.getShaderInfoLog(cr[e]))&&(e="(unknown error)"),t=0<t&&n?te(e,w,n,t):0,r&&(_[r>>2]=t)},aa:(e,t,r)=>{r?35716==t?(null===(e=Tt.getShaderInfoLog(cr[e]))&&(e="(unknown error)"),_[r>>2]=e?e.length+1:0):35720==t?(e=Tt.getShaderSource(cr[e]),_[r>>2]=e?e.length+1:0):_[r>>2]=Tt.getShaderParameter(cr[e],t):Pt||=1281},p:(e,t)=>Tt.getUniformBlockIndex(ir[e],j(t)),n:(e,t)=>{if(t=j(t),e=ir[e]){var r,n=e,i=n.rd,a=n.ne;if(!i){n.rd=i={},n.me={};var o=Tt.getProgramParameter(n,35718);for(r=0;r<o;++r){var s=Tt.getActiveUniform(n,r),c=s.name;s=s.size;var d=an(c);d=0<d?c.slice(0,d):c;var l=n.Qd;for(n.Qd+=s,a[d]=[s,l],c=0;c<s;++c)i[l]=c,n.me[l++]=d}}if(n=e.rd,i=0,a=t,0<(r=an(t))&&(i=parseInt(t.slice(r+1))>>>0,a=t.slice(0,r)),(a=e.ne[a])&&i<a[0]&&(n[i+=a[1]]=n[i]||Tt.getUniformLocation(e,t)))return i}else Pt||=1281;return-1},Ka:(e,t,r)=>{for(var n=on[t],i=0;i<t;i++)n[i]=_[r+4*i>>2];Tt.invalidateFramebuffer(e,n)},db:e=>{Tt.linkProgram(e=ir[e]),e.rd=0,e.ne={}},ga:(e,t,r,n,i)=>Tt.renderbufferStorageMultisample(e,t,r,n,i),r:(e,t,r,n)=>Tt.scissor(e,t,r,n),Ha:(e,t,r,n)=>{for(var i="",a=0;a<t;++a)i+=j($[r+4*a>>2],n?$[n+4*a>>2]:void 0);Tt.shaderSource(cr[e],i)},Q:(e,t,r)=>Tt.stencilFunc(e,t,r),G:(e,t,r,n)=>Tt.stencilFuncSeparate(e,t,r,n),P:(e,t,r)=>Tt.stencilOp(e,t,r),F:(e,t,r,n)=>Tt.stencilOpSeparate(e,t,r,n),ja:(e,t,r,n,i,a,o,s,c)=>{if(2<=Ct.version){if(Tt.Dd)return void Tt.texImage2D(e,t,r,n,i,a,o,s,c);if(c){var d=sn(s);return c>>>=31-Math.clz32(d.BYTES_PER_ELEMENT),void Tt.texImage2D(e,t,r,n,i,a,o,s,d,c)}}if(c){d=sn(s);var l=i*(n*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[o-6402]||1)*d.BYTES_PER_ELEMENT+4-1&-4);c=d.subarray(c>>>31-Math.clz32(d.BYTES_PER_ELEMENT),c+l>>>31-Math.clz32(d.BYTES_PER_ELEMENT))}else c=null;Tt.texImage2D(e,t,r,n,i,a,o,s,c)},B:(e,t,r)=>Tt.texParameteri(e,t,r),Wa:(e,t)=>{Tt.uniform1f(cn(e),t)},$a:(e,t,r)=>{if(2<=Ct.version)t&&Tt.uniform1iv(cn(e),_,r>>2,t);else{if(288>=t)for(var n=dn[t],i=0;i<t;++i)n[i]=_[r+4*i>>2];else n=_.subarray(r>>2,r+4*t>>2);Tt.uniform1iv(cn(e),n)}},Pa:(e,t,r)=>{Tt.uniformBlockBinding(e=ir[e],t,r)},Va:(e,t,r,n)=>{if(2<=Ct.version)t&&Tt.uniformMatrix3fv(cn(e),!!r,E,n>>2,9*t);else{if(32>=t)for(var i=ln[t*=9],a=0;a<t;a+=9)i[a]=E[n+4*a>>2],i[a+1]=E[n+(4*a+4)>>2],i[a+2]=E[n+(4*a+8)>>2],i[a+3]=E[n+(4*a+12)>>2],i[a+4]=E[n+(4*a+16)>>2],i[a+5]=E[n+(4*a+20)>>2],i[a+6]=E[n+(4*a+24)>>2],i[a+7]=E[n+(4*a+28)>>2],i[a+8]=E[n+(4*a+32)>>2];else i=E.subarray(n>>2,n+36*t>>2);Tt.uniformMatrix3fv(cn(e),!!r,i)}},ab:e=>{Tt.useProgram(e=ir[e]),Tt.ve=e},Ta:(e,t,r,n,i)=>Tt.vertexAttrib4f(e,t,r,n,i),Ra:(e,t,r,n,i,a)=>{var o=Ct.dd[e];Tt.ud?(o.td=!1,Tt.vertexAttribPointer(e,t,r,!!n,i,a)):(o.size=t,o.type=r,o.fe=n,o.stride=i,o.pc=a,o.td=!0,o.oe=function(e,t,r,n,i,a){this.vertexAttribPointer(e,t,r,n,i,a)})},s:(e,t,r,n)=>Tt.viewport(e,t,r,n),v:function(e,t){var r=Fn();try{return Dn.get(e)(t)}catch(e){if(Ln(r),e!==e+0)throw e;Bn(1,0)}},j:function(e,t,r){var n=Fn();try{return Dn.get(e)(t,r)}catch(e){if(Ln(n),e!==e+0)throw e;Bn(1,0)}},g:function(e,t,r,n){var i=Fn();try{return Dn.get(e)(t,r,n)}catch(e){if(Ln(i),e!==e+0)throw e;Bn(1,0)}},ua:function(e,t,r,n,i,a){var o=Fn();try{return Dn.get(e)(t,r,n,i,a)}catch(e){if(Ln(o),e!==e+0)throw e;Bn(1,0)}},ta:function(e){var t=Fn();try{Dn.get(e)()}catch(e){if(Ln(t),e!==e+0)throw e;Bn(1,0)}},b:function(e,t){var r=Fn();try{Dn.get(e)(t)}catch(e){if(Ln(r),e!==e+0)throw e;Bn(1,0)}},c:function(e,t,r){var n=Fn();try{Dn.get(e)(t,r)}catch(e){if(Ln(n),e!==e+0)throw e;Bn(1,0)}},m:function(e,t,r,n){var i=Fn();try{Dn.get(e)(t,r,n)}catch(e){if(Ln(i),e!==e+0)throw e;Bn(1,0)}},I:function(e,t,r,n,i){var a=Fn();try{Dn.get(e)(t,r,n,i)}catch(e){if(Ln(a),e!==e+0)throw e;Bn(1,0)}},sb:Zt,N:function(e){return BigInt(br(e).size)},Z:(e,t)=>{var r=$[t>>2],n=void 0;0!==r&&(n=4294967296*$[r+12>>2]+$[r+8>>2]),r=$r(t+4);for(var i=$[t+12>>2],a=$[t+16>>2],o=[],s=0;s<i;++s){var c=o,d=c.push,l=a+56*s,u=$[l+4>>2];if(0!==u){var h=_[l+8>>2];-1==h&&(h=void 0);var f=l+24;f={r:A[f>>3],g:A[f+8>>3],b:A[f+16>>3],a:A[f+24>>3]},l={view:br(u),depthSlice:h,resolveTarget:br($[l+12>>2]),clearValue:f,loadOp:Gr[$[l+16>>2]],storeOp:Hr[$[l+20>>2]]}}else l=void 0;d.call(c,l)}return i=0!==(i=$[t+20>>2])?{view:br($[i+4>>2]),depthClearValue:E[i+16>>2],depthLoadOp:Gr[$[i+8>>2]],depthStoreOp:Hr[$[i+12>>2]],depthReadOnly:!!$[i+20>>2],stencilClearValue:$[i+32>>2],stencilLoadOp:Gr[$[i+24>>2]],stencilStoreOp:Hr[$[i+28>>2]],stencilReadOnly:!!$[i+36>>2]}:void 0,a=0!==(a=$[t+28>>2])?{querySet:br($[a+4>>2]),beginningOfPassWriteIndex:$[a+8>>2],endOfPassWriteIndex:$[a+12>>2]}:void 0,t={label:r,colorAttachments:o,depthStencilAttachment:i,occlusionQuerySet:br($[t+24>>2]),timestampWrites:a,maxDrawCount:n},n=br(e),e=$n(0),t=n.beginRenderPass(t),wr[e>>>0]=t,e},Nb:(e,t,r,n)=>{br(e).copyTextureToTexture(Ar(t),Ar(r),Er(n))},Pb:e=>{var t=br(e);return e=yn(0),t=t.finish(),wr[e>>>0]=t,e},K:(e,t)=>{var r=$r(t+4),n=br($[t+12>>2]),i=$[t+16>>2];t=$[t+20>>2];for(var a=[],o=0;o<i;++o){var s=a,c=s.push,d=t+40*o,l=$[d+8>>2],u=$[d+32>>2],h=$[d+36>>2],f=$[d+4>>2];l?(-1==(u=$[(u=d+24)>>2]+4294967296*_[u+4>>2])&&(u=void 0),d={binding:f,resource:{buffer:br(l),offset:4294967296*$[d+4+16>>2]+$[d+16>>2],size:u}}):d=u?{binding:f,resource:br(u)}:{binding:f,resource:br(h)},c.call(s,d)}return r={label:r,layout:n,entries:a},n=br(e),e=gn(0),r=n.createBindGroup(r),wr[e>>>0]=r,e},w:(e,t)=>{var r=$r(t+4),n=$[t+12>>2];t=$[t+16>>2];for(var i=[],a=0;a<n;++a){var o=t+88*a,s=$[o+4>>2],c=$[o+8>>2],d=o+24,l=$[d+4>>2];d=l?{type:Cr[l],hasDynamicOffset:!!$[d+8>>2],minBindingSize:4294967296*$[d+4+16>>2]+$[d+16>>2]}:void 0,l=(l=$[o+48+4>>2])?{type:zr[l]}:void 0;var u=o+56,h=$[u+4>>2];u=h?{sampleType:Qr[h],viewDimension:Yr[$[u+8>>2]],multisampled:!!$[u+12>>2]}:void 0,o=(h=$[(o+=72)+4>>2])?{access:qr[h],format:Kr[$[o+8>>2]],viewDimension:Yr[$[o+12>>2]]}:void 0,i.push.call(i,{binding:s,visibility:c,buffer:d,sampler:l,texture:u,storageTexture:o})}return r={label:r,entries:i},n=br(e),e=wn(0),r=n.createBindGroupLayout(r),wr[e>>>0]=r,e},Qb:(e,t)=>{var r;return t&&(r={label:$r(t+4)}),t=br(e),e=bn(0),r=t.createCommandEncoder(r),wr[e>>>0]=r,e},Ob:(e,t)=>{for(var r=$[t+12>>2],n=$[t+16>>2],i=[],a=0;a<r;++a)i.push(br($[n+4*a>>2]));return t={label:$r(t+4),bindGroupLayouts:i},r=br(e),e=_n(0),t=r.createPipelineLayout(t),wr[e>>>0]=t,e},k:(e,t)=>{t=(e=>{function t(e){if(e)return{operation:Pr[$[e>>2]],srcFactor:Tr[$[e+4>>2]],dstFactor:Tr[$[e+8>>2]]}}function r(e){return{compare:Or[$[e>>2]],failOp:Wr[$[e+4>>2]],depthFailOp:Wr[$[e+8>>2]],passOp:Wr[$[e+12>>2]]}}return{label:$r(e+4),layout:Sr($[e+12>>2]),vertex:function(e){if(e){var t=br($[e+4>>2]),r=xr($[e+16>>2],$[e+20>>2]),n=$[e+24>>2],i=$[e+28>>2];if(n){for(var a=[],o=0;o<n;++o){var s=a,c=s.push,d=i+24*o;if(d){var l=$[d+4>>2],u=$[d+16>>2];if(0===l&&0===u)var h=null;else{h=4294967296*$[d+4+8>>2]+$[d+8>>2],l=tn[l],d=$[d+20>>2];for(var f=[],p=0;p<u;++p){var m=d+24*p;f.push.call(f,m={format:en[$[m+4>>2]],offset:4294967296*$[m+4+8>>2]+$[m+8>>2],shaderLocation:$[m+16>>2]})}h={arrayStride:h,stepMode:l,attributes:f}}}else h=void 0;c.call(s,h)}n=a}else n=void 0;return{module:t,constants:r,buffers:n,entryPoint:$r(e+8)}}}(e+16),primitive:function(e){if(e)return{topology:jr[$[e+4>>2]],stripIndexFormat:Dr[$[e+8>>2]],frontFace:Mr[$[e+12>>2]],cullMode:Br[$[e+16>>2]],unclippedDepth:!!$[e+20>>2]}}(e+48),depthStencil:function(e){if(e)return{format:Kr[$[e+4>>2]],depthWriteEnabled:!!$[e+8>>2],depthCompare:Or[$[e+12>>2]],stencilFront:r(e+16),stencilBack:r(e+32),stencilReadMask:$[e+48>>2],stencilWriteMask:$[e+52>>2],depthBias:_[e+56>>2],depthBiasSlopeScale:E[e+60>>2],depthBiasClamp:E[e+64>>2]}}($[e+72>>2]),multisample:function(e){if(e)return{count:$[e+4>>2],mask:$[e+8>>2],alphaToCoverageEnabled:!!$[e+12>>2]}}(e+76),fragment:function(e){if(e){for(var r=br($[e+4>>2]),n=xr($[e+16>>2],$[e+20>>2]),i=$[e+24>>2],a=$[e+28>>2],o=[],s=0;s<i;++s){var c=o,d=c.push,l=a+24*s,u=$[l+4>>2];if(0===u)l=void 0;else{u=Kr[u];var h=(h=$[l+8>>2])?{alpha:t(h+12),color:t(h+0)}:void 0;l={format:u,blend:h,writeMask:$[l+16>>2]}}d.call(c,l)}return{module:r,constants:n,targets:o,entryPoint:$r(e+8)}}}($[e+92>>2])}})(t);var r=br(e);return e=En(0),t=r.createRenderPipeline(t),wr[e>>>0]=t,e},Ea:(e,t)=>{var r;return t&&(r={label:$r(t+4),addressModeU:kr[$[t+12>>2]],addressModeV:kr[$[t+16>>2]],addressModeW:kr[$[t+20>>2]],magFilter:Fr[$[t+24>>2]],minFilter:Fr[$[t+28>>2]],mipmapFilter:Ir[$[t+32>>2]],lodMinClamp:E[t+36>>2],lodMaxClamp:E[t+40>>2],compare:Or[$[t+44>>2]],maxAnisotropy:b[t+48>>1]}),t=br(e),e=An(0),r=t.createSampler(r),wr[e>>>0]=r,e},_:(e,t)=>{var r={label:$r(t+4),size:Er(t+28),mipLevelCount:$[t+44>>2],sampleCount:$[t+48>>2],dimension:Jr[$[t+24>>2]],format:Kr[$[t+40>>2]],usage:$[t+16>>2]},n=$[t+52>>2];return n&&(t=$[t+56>>2],r.viewFormats=Array.from(_.subarray(t>>2,t+4*n>>2),e=>Kr[e])),e=br(e),((e,t)=>{wr[e>>>0]=t})(n=Sn(0),e.createTexture(r)),n},Mb:(e,t)=>(e=vr($[$[t>>2]+8>>2]).getContext("webgpu"))?(e.Df=$r(t+4),t=xn(0),wr[t>>>0]=e,t):0,ya:(e,t,r)=>{e=br(e),t=Array.from(_.subarray(r>>2,r+4*t>>2),e=>br(e)),e.submit(t)},J:function(e,t,r,n,i){r=nn(r),br(e).writeBuffer(br(t),r,w.subarray(n,n+i),0,i)},Aa:(e,t,r,n,i,a)=>{var o=$[i+8>>2],s=$[i+12>>2];br(e).writeTexture(Ar(t),w.subarray(r,r+n),{offset:4294967296*$[i+4>>2]+$[i>>2],bytesPerRow:4294967295===o?void 0:o,rowsPerImage:4294967295===s?void 0:s},Er(a))},X:(e,t,r,n,i,a)=>{br(e).drawIndexed(t,r,n>>>0,i,a>>>0)},xa:e=>{br(e).end()},d:(e,t,r,n,i)=>{e=br(e),r=br(r),0==n?e.setBindGroup(t,r):e.setBindGroup(t,r,$,i>>2,n)},Y:function(e,t,r,n,i){n=nn(n),i=nn(i),e=br(e),t=br(t),-1==i&&(i=void 0),e.setIndexBuffer(t,Dr[r],n,i)},e:(e,t)=>{br(e).setPipeline(br(t))},l:(e,t,r,n,i)=>{br(e).setScissorRect(t,r,n,i)},i:(e,t)=>{br(e).setStencilReference(t>>>0)},M:function(e,t,r,n,i){n=nn(n),i=nn(i),e=br(e),r=br(r),-1==i&&(i=void 0),e.setVertexBuffer(t,r,n,i)},Kb:(e,t)=>{var r=$[t+4>>2];e=br(e);var n=[$[t+24>>2],$[t+28>>2]];if(0!==n[0]&&(e.canvas.width=n[0]),0!==n[1]&&(e.canvas.height=n[1]),r={device:br(r),format:Kr[$[t+8>>2]],usage:$[t+16>>2],alphaMode:Rr[$[t+40>>2]]},n=$[t+32>>2]){var i=$[t+36>>2];r.viewFormats=Array.from(_.subarray(i>>2,i+4*n>>2),e=>Kr[e])}0!==(t=$[t>>2])&&(r.colorSpace=Vr[$[t+8>>2]],r.Ff={mode:Zr[$[t+12>>2]]}),e.configure(r)},Jb:(e,t)=>{e=br(e);try{var r=Sn(0),n=e.getCurrentTexture();wr[r>>>0]=n,$[t+4>>2]=r,_[t+8>>2]=1}catch(e){$[t+4>>2]=0,_[t+8>>2]=6}},Lb:e=>{br(e).unconfigure()},Sb:(e,t)=>{if(t){var r=$[t+24>>2],n=$[t+32>>2];r={label:$r(t+4),format:Kr[$[t+12>>2]],dimension:Yr[$[t+16>>2]],baseMipLevel:$[t+20>>2],mipLevelCount:4294967295===r?void 0:r,baseArrayLayer:$[t+28>>2],arrayLayerCount:4294967295===n?void 0:n,aspect:Xr[$[t+36>>2]]}}return t=br(e),e=kn(0),t=t.createView(r),wr[e>>>0]=t,e},Rb:e=>{br(e).destroy()},Tb:e=>Kr.indexOf(br(e).format),Ba:e=>br(e).height,Ca:e=>br(e).width};return Gn=await async function(){function e(e){return e=Gn=e.exports,pn=e.Xb,mn=e.Yb,vn=e.Zb,gn=e._b,wn=e.$b,yn=e.ac,bn=e.bc,_n=e.ec,$n=e.ic,En=e.jc,An=e.kc,xn=e.lc,Sn=e.mc,kn=e.nc,Tn=e.tc,Pn=e.uc,Cn=e.vc,On=e.wc,Rn=e.yc,Bn=e.zc,Ln=e.Ac,Un=e.Bc,Fn=e.Cc,Mn=e.Vb,Dn=e.xc,B(),Gn}var t={a:In};return r.instantiateWasm?new Promise(n=>{r.instantiateWasm(t,(t,r)=>{n(e(t))})}):(k??=r.locateFile?r.locateFile?r.locateFile("thorvg.wasm",u):u+"thorvg.wasm":new URL("thorvg.wasm",import.meta.url).href,e((await async function(e){var t=k;if(!f&&!O(t)&&!a)try{var r=fetch(t,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(r,e)}catch(e){P(`wasm streaming compile failed: ${e}`),P("falling back to ArrayBuffer instantiation")}return async function(e,t){try{var r=await async function(e){if(!f)try{var t=await s(e);return new Uint8Array(t)}catch{}if(e==k&&f)e=new Uint8Array(f);else{if(!c)throw"both async and sync fetching of the wasm failed";e=c(e)}return e}(e);return await WebAssembly.instantiate(r,t)}catch(e){P(`failed to asynchronously prepare wasm: ${e}`),L(e)}}(t,e)}(t)).instance))}(),function e(){function t(){if(r.calledRun=!0,!C){if(R=!0,r.noFSInit||Ne.Id||ve(),Gn.Wb(),Ne.be=!1,m?.(r),r.onRuntimeInitialized?.(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var e=r.postRun.shift();M.push(e)}F(M)}}if(0<le)ue=e;else{if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)G();F(D),0<le?ue=e:r.setStatus?(r.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>r.setStatus(""),1),t()},1)):t()}}(),t=R?r:new Promise((e,t)=>{m=e,v=t}),t}({locateFile:(e,t)=>e.endsWith(".wasm")?this.wasmUrl||"https://unpkg.com/@thorvg/lottie-player@latest/dist/thorvg.wasm":t+e})),!this._timer)return;clearInterval(this._timer),this._timer=void 0;const e=this.config?.renderer||"sw";if(await(async e=>{if("wg"===e){for(;"requested"===ve;)await me(100);if("initialized"!==ve&&(ve="requested",le))for(;;)switch(le.init()){case 0:return void(ve="initialized");case 1:return void(ve="failed");case 2:await me(100)}}})(e),"failed"===ve)return this.currentState="error",void this.dispatchEvent(new CustomEvent("error"));this.TVG=new le.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,d=this.canvas.height;e<0&&(o=Math.abs(e),c-=o),r<0&&(s=Math.abs(r),d-=s),t>i&&(c-=t-i),n>a&&(d-=n-a),this.TVG.viewport(o,s,c,d)}_observerCallback(e){const t=e[0],r=t.target;r._observable=t.isIntersecting,t.isIntersecting?"frozen"===r.currentState&&r.play():"playing"===r.currentState&&(r.freeze(),r.dispatchEvent(new CustomEvent("freeze")))}firstUpdated(e){this.canvas=this.querySelector(".thorvg"),this.canvas.id=`thorvg-${Date.now().toString(36)+Math.random().toString(36).substring(2)}`,this.canvas.width=this.canvas.offsetWidth,this.canvas.height=this.canvas.offsetHeight,this._observer=new IntersectionObserver(this._observerCallback),this._observer.observe(this),this.TVG?this.src&&this.load(this.src,this.fileType):this._timer=setInterval(this._init.bind(this),100)}createRenderRoot(){return this.style.display="block",this}async _animLoop(){this.TVG&&await this._update()&&(this._render(),window.requestAnimationFrame(this._animLoop.bind(this)))}_loadBytes(e){if(!this.TVG)throw new Error("TVG is not initialized");if(this._assetResolverCallback&&this.TVG.setAssetResolver(this._assetResolverCallback,this._assetResolverData),!this.TVG.load(e,this.fileType,this.canvas.width,this.canvas.height))throw new Error(`Unable to load an image. Error: ${this.TVG.error()}`);this._render(),this.dispatchEvent(new CustomEvent("load")),this.autoPlay&&this.play()}_flush(){this.canvas.getContext("2d").putImageData(this._imageData,0,0)}_render(){if(!this.TVG)return;if(!1!==this.config?.enableDevicePixelRatio){const e=1+.75*(window.devicePixelRatio-1),{width:t,height:r}=this.canvas.getBoundingClientRect();this.canvas.width=t*e,this.canvas.height=r*e}if(this.TVG.resize(this.canvas.width,this.canvas.height),this._viewport(),!this.TVG.update())return;if("wg"===this.config?.renderer||"gl"===this.config?.renderer)return void this.TVG.render();const e=this.TVG.render(),t=new Uint8ClampedArray(e,0,e.byteLength);t.length<1||(this._imageData=new ImageData(t,this.canvas.width,this.canvas.height),this._flush())}async _update(){if(!this.TVG)return!1;if("playing"!==this.currentState)return!1;const e=this.TVG.duration(),t=Date.now()/1e3;if(this.currentFrame=(t-this._beginTime)/e*this.totalFrame*this.speed,-1===this.direction&&(this.currentFrame=this.totalFrame-this.currentFrame),1===this.direction&&this.currentFrame>=this.totalFrame||-1===this.direction&&this.currentFrame<=0){const e=this.count?"bounce"===this.mode?2*this.count:this.count:0;if(this.loop||e&&this._counter<e)return"bounce"===this.mode&&(this.direction=1===this.direction?-1:1,this.currentFrame=1===this.direction?0:this.totalFrame),this.count&&(this._counter+=1),await me(this.intermission),this.play(),!0;this.dispatchEvent(new CustomEvent("complete")),this.currentState="stopped"}return this.dispatchEvent(new CustomEvent("frame",{detail:{frame:this.currentFrame}})),this.TVG.frame(this.currentFrame)}_frame(e){this.TVG&&(this.pause(),this.currentFrame=e,this.TVG.frame(e))}async load(e,t="json"){try{await this._init();const r=await pe(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(){le&&(le.term(),le=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 j`
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=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:o,defineProperty:s,getOwnPropertyDescriptor:c,getOwnPropertyNames:d,getOwnPropertySymbols:l,getPrototypeOf:u}=Object,h=globalThis,f=h.trustedTypes,p=f?f.emptyScript:"",m=h.reactiveElementPolyfillSupport,v=(e,t)=>e,g={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}},w=(e,t)=>!o(e,t),y={attribute:!0,type:String,converter:g,reflect:!1,useDefault:!1,hasChanged:w};Symbol.metadata??=Symbol("metadata"),h.litPropertyMetadata??=new WeakMap;let b=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&&s(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:i}=c(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:n,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)??y}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const e=u(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=[...d(e),...l(e)];for(const r of t)this.createProperty(r,e[r])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,r]of t)this.elementProperties.set(e,r)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const r=this._$Eu(e,t);void 0!==r&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const e of r)t.unshift(a(e))}else void 0!==e&&t.push(a(e));return t}static _$Eu(e,t){const r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((r,n)=>{if(t)r.adoptedStyleSheets=n.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const t of n){const n=document.createElement("style"),i=e.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)}})(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$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:g).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:g;this._$Em=n;const a=i.fromAttribute(t,e.type);this[n]=a??this._$Ej?.get(n)??a,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??w)(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},a){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||void 0!==a)||(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){}};b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[v("elementProperties")]=new Map,b[v("finalized")]=new Map,m?.({ReactiveElement:b}),(h.reactiveElementVersions??=[]).push("2.1.1");const _={attribute:!0,type:String,converter:g,reflect:!1,hasChanged:w},$=(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),"setter"===n&&((e=Object.create(e)).wrapped=!0),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.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?$(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 x=globalThis,A=x.trustedTypes,S=A?A.createPolicy("lit-html",{createHTML:e=>e}):void 0,k="$lit$",T=`lit$${Math.random().toFixed(9).slice(2)}$`,P="?"+T,C=`<${P}>`,O=document,R=()=>O.createComment(""),B=e=>null===e||"object"!=typeof e&&"function"!=typeof e,L=Array.isArray,U="[ \t\n\f\r]",F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,M=/>/g,G=RegExp(`>|${U}(?:([^\\s"'>=/]+)(${U}*=${U}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),I=/'/g,N=/"/g,V=/^(?:script|style|textarea|title)$/i,j=(e,...t)=>({_$litType$:1,strings:e,values:t}),z=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),q=new WeakMap,H=O.createTreeWalker(O,129);function X(e,t){if(!L(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==S?S.createHTML(t):t}const J=(e,t)=>{const r=e.length-1,n=[];let i,a=2===t?"<svg>":3===t?"<math>":"",o=F;for(let t=0;t<r;t++){const r=e[t];let s,c,d=-1,l=0;for(;l<r.length&&(o.lastIndex=l,c=o.exec(r),null!==c);)l=o.lastIndex,o===F?"!--"===c[1]?o=D:void 0!==c[1]?o=M:void 0!==c[2]?(V.test(c[2])&&(i=RegExp("</"+c[2],"g")),o=G):void 0!==c[3]&&(o=G):o===G?">"===c[0]?(o=i??F,d=-1):void 0===c[1]?d=-2:(d=o.lastIndex-c[2].length,s=c[1],o=void 0===c[3]?G:'"'===c[3]?N:I):o===N||o===I?o=G:o===D||o===M?o=F:(o=G,i=void 0);const u=o===G&&e[t+1].startsWith("/>")?" ":"";a+=o===F?r+C:d>=0?(n.push(s),r.slice(0,d)+k+r.slice(d)+T+u):r+T+(-2===d?t:u)}return[X(e,a+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),n]};class K{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let i=0,a=0;const o=e.length-1,s=this.parts,[c,d]=J(e,t);if(this.el=K.createElement(c,r),H.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=H.nextNode())&&s.length<o;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(k)){const t=d[a++],r=n.getAttribute(e).split(T),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(T)&&(s.push({type:6,index:i}),n.removeAttribute(e));if(V.test(n.tagName)){const e=n.textContent.split(T),t=e.length-1;if(t>0){n.textContent=A?A.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],R()),H.nextNode(),s.push({type:2,index:++i});n.append(e[t],R())}}}else if(8===n.nodeType)if(n.data===P)s.push({type:2,index:i});else{let e=-1;for(;-1!==(e=n.data.indexOf(T,e+1));)s.push({type:7,index:i}),e+=T.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===z)return t;let i=void 0!==n?r._$Co?.[n]:r._$Cl;const a=B(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._$Co??=[])[n]=i:r._$Cl=i),void 0!==i&&(t=Q(e,i._$AS(e,t.values),i,n)),t}class Y{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);H.currentNode=n;let i=H.nextNode(),a=0,o=0,s=r[0];for(;void 0!==s;){if(a===s.index){let t;2===s.type?t=new Z(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=H.nextNode(),a++)}return H.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 Z{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=W,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Q(this,e,t),B(e)?e===W||null==e||""===e?(this._$AH!==W&&this._$AR(),this._$AH=W):e!==this._$AH&&e!==z&&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!==W&&B(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=K.createElement(X(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{const e=new Y(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 K(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 Z(this.O(R()),this.O(R()),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 ee{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,i){this.type=1,this._$AH=W,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=W}_$AI(e,t=this,r,n){const i=this.strings;let a=!1;if(void 0===i)e=Q(this,e,t,0),a=!B(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=Q(this,n[r+o],t,o),s===z&&(s=this._$AH[o]),a||=!B(s)||s!==this._$AH[o],s===W?e=W:e!==W&&(e+=(s??"")+i[o+1]),this._$AH[o]=s}a&&!n&&this.j(e)}j(e){e===W?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===W?void 0:e}}class re extends ee{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==W)}}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=Q(this,e,t,0)??W)===z)return;const r=this._$AH,n=e===W&&r!==W||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,i=e!==W&&(r===W||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){Q(this,e)}}const ae=x.litHtmlPolyfillSupport;ae?.(K,Z),(x.litHtmlVersions??=[]).push("3.3.1");const oe=globalThis;class se extends b{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 Z(t.insertBefore(R(),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 z}}se._$litElement$=!0,se.finalized=!0,oe.litElementHydrateSupport?.({LitElement:se});const ce=oe.litElementPolyfillSupport;function de(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}ce?.({LitElement:se}),(oe.litElementVersions??=[]).push("4.2.1");let le=null,ue=!1;var he=function(e){return e.SW="sw",e.WG="wg",e.GL="gl",e}({}),fe=function(e){return e.JSON="json",e.LOT="lot",e.JPG="jpg",e.PNG="png",e.SVG="svg",e}({});const pe=async(e,t)=>{const r=new TextEncoder;let n=e;switch(typeof n){case"object":return n instanceof ArrayBuffer?new Uint8Array(n):(n=JSON.stringify(n),r.encode(n));case"string":if("json"===t||"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")}},me=e=>new Promise(t=>setTimeout(t,e));let ve="idle";class ge extends se{src;wasmUrl;fileType="json";speed=1;autoPlay=!1;count;loop=!1;direction=1;mode="normal";intermission=1;totalFrame=0;currentFrame=0;currentState="loading";get size(){return Float32Array.from(this.TVG?.size()||[0,0])}get dpr(){return!1===this.config?.enableDevicePixelRatio?1:1+.75*(window.devicePixelRatio-1)}TVG=null;canvas;config;_imageData;_beginTime=Date.now();_counter=1;_timer;_observer;_observable=!1;_assetResolverCallback;_assetResolverData;async _init(){if(ue)for(;!le;)await me(100);if(le||(ue=!0,le=await async function(e={}){var t,r=e,n=!!globalThis.window,i=!!globalThis.WorkerGlobalScope,a=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;if(a){const{createRequire:e}=await Promise.resolve().then(function(){return _e});var o=e(import.meta.url)}var s,c,d=(e,t)=>{throw t},l=import.meta.url,u="";if(a){var h=o("fs");l.startsWith("file:")&&(u=o("path").dirname(o("url").fileURLToPath(l))+"/"),c=e=>(e=O(e)?new URL(e):e,h.readFileSync(e)),s=async e=>(e=O(e)?new URL(e):e,h.readFileSync(e,void 0)),process.argv.slice(2),d=(e,t)=>{throw process.exitCode=e,t}}else if(n||i){try{u=new URL(".",l).href}catch{}i&&(c=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),s=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,g,w,y,b,_,$,E,x,A,S,k,T=function(){}.bind(),P=function(){}.bind(),C=!1,O=e=>e.startsWith("file://"),R=!1;function B(){var e=Dn.buffer;g=new Int8Array(e),y=new Int16Array(e),w=new Uint8Array(e),b=new Uint16Array(e),_=new Int32Array(e),$=new Uint32Array(e),E=new Float32Array(e),x=new Float64Array(e),A=new BigInt64Array(e),S=new BigUint64Array(e)}function L(e){throw r.onAbort?.(e),P(e="Aborted("+e+")"),C=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),v?.(e),e}class U{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var F=e=>{for(;0<e.length;)e.shift()(r)},D=[],M=[],G=()=>{var e=r.preRun.shift();M.push(e)},I=!0,N=new TextDecoder,V=(e,t,r,n)=>{if(r=t+r,n)return r;for(;e[t]&&!(t>=r);)++t;return t},j=(e,t,r)=>e?N.decode(w.subarray(e,V(w,e,t,r))):"",z=()=>{var e=_[+Ve>>2];return Ve+=4,e},W=(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},q=e=>{var t="/"===e.charAt(0),r="/"===e.slice(-1);return(e=W(e.split("/").filter(e=>!!e),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},H=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):"."},X=e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],J=e=>{(J=(()=>{if(a){var e=o("crypto");return t=>e.randomFillSync(t)}return e=>crypto.getRandomValues(e)})())(e)},K=(...e)=>{for(var t="",r=!1,n=e.length-1;-1<=n&&!r;n--){if("string"!=typeof(r=0<=n?e[n]:Ne.cwd()))throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";t=r+"/"+t,r="/"===r.charAt(0)}return t=W(t.split("/").filter(e=>!!e),!r).join("/"),(r?"/":"")+t||"."},Q=(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=K(e).slice(1),t=K(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("/")},Y=e=>{var t=V(e,0);return N.decode(e.buffer?e.subarray(0,t):new Uint8Array(e.slice(0,t)))},Z=[],ee=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},te=(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.codePointAt(a);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,a++}}return t[r]=0,r-i},re=e=>{var t=Array(ee(e)+1);return e=te(e,t,0,t.length),t.length=e,t},ne=[];function ie(e,t){ne[e]={input:[],output:[],Vc:t},ge(e,ae)}var ae={open(e){var t=ne[e.node.rdev];if(!t)throw new Ne.cc(43);e.tty=t,e.seekable=!1},close(e){e.tty.Vc.fsync(e.tty)},fsync(e){e.tty.Vc.fsync(e.tty)},read(e,t,r,n){if(!e.tty||!e.tty.Vc.$d)throw new Ne.cc(60);for(var i=0,a=0;a<n;a++){try{var o=e.tty.Vc.$d(e.tty)}catch(e){throw new Ne.cc(29)}if(void 0===o&&0===i)throw new Ne.cc(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.Vc.Pd)throw new Ne.cc(60);try{for(var i=0;i<n;i++)e.tty.Vc.Pd(e.tty,t[r+i])}catch(e){throw new Ne.cc(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),i}},oe={$d(){e:{if(!Z.length){var e=null;if(a){var t=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=h.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}Z=re(e)}e=Z.shift()}return e},Pd(e,t){null===t||10===t?(T(Y(e.output)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){0<e.output?.length&&(T(Y(e.output)),e.output=[])},Ge:()=>({$e:25856,bf:5,Ze:191,af:35387,Ye:[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]}),He:()=>0,Ie:()=>[24,80]},se={Pd(e,t){null===t||10===t?(P(Y(e.output)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){0<e.output?.length&&(P(Y(e.output)),e.output=[])}},ce={Sc:null,rc:()=>ce.createNode(null,"/",16895,0),createNode(e,t,r,n){if(24576==(61440&r)||Ne.isFIFO(r))throw new Ne.cc(63);return ce.Sc||(ce.Sc={dir:{node:{Pc:ce.fc.Pc,Rc:ce.fc.Rc,lookup:ce.fc.lookup,Tc:ce.fc.Tc,rename:ce.fc.rename,unlink:ce.fc.unlink,rmdir:ce.fc.rmdir,readdir:ce.fc.readdir,symlink:ce.fc.symlink},stream:{Ic:ce.hc.Ic}},file:{node:{Pc:ce.fc.Pc,Rc:ce.fc.Rc},stream:{Ic:ce.hc.Ic,read:ce.hc.read,write:ce.hc.write,gd:ce.hc.gd,od:ce.hc.od}},link:{node:{Pc:ce.fc.Pc,Rc:ce.fc.Rc,readlink:ce.fc.readlink},stream:{}},Sd:{node:{Pc:ce.fc.Pc,Rc:ce.fc.Rc},stream:Ne.te}}),we((r=Ne.createNode(e,t,r,n)).mode)?(r.fc=ce.Sc.dir.node,r.hc=ce.Sc.dir.stream,r.oc={}):Ne.isFile(r.mode)?(r.fc=ce.Sc.file.node,r.hc=ce.Sc.file.stream,r.Dc=0,r.oc=null):40960==(61440&r.mode)?(r.fc=ce.Sc.link.node,r.hc=ce.Sc.link.stream):8192==(61440&r.mode)&&(r.fc=ce.Sc.Sd.node,r.hc=ce.Sc.Sd.stream),r.atime=r.mtime=r.ctime=Date.now(),e&&(e.oc[t]=r,e.atime=e.mtime=e.ctime=r.atime),r},pf:e=>e.oc?e.oc.subarray?e.oc.subarray(0,e.Dc):new Uint8Array(e.oc):new Uint8Array(0),fc:{Pc(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=we(e.mode)?4096:Ne.isFile(e.mode)?e.Dc: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},Rc(e,t){for(var r of["mode","atime","mtime","ctime"])null!=t[r]&&(e[r]=t[r]);void 0!==t.size&&e.Dc!=(t=t.size)&&(0==t?(e.oc=null,e.Dc=0):(r=e.oc,e.oc=new Uint8Array(t),r&&e.oc.set(r.subarray(0,Math.min(t,e.Dc))),e.Dc=t))},lookup(){throw ce.Fd||(ce.Fd=new Ne.cc(44),ce.Fd.stack="<generic error, no stack>"),ce.Fd},Tc:(e,t,r,n)=>ce.createNode(e,t,r,n),rename(e,t,r){try{var n=ye(t,r)}catch(e){}if(n){if(we(e.mode))for(var i in n.oc)throw new Ne.cc(55);be(n)}delete e.parent.oc[e.name],t.oc[r]=e,e.name=r,t.ctime=t.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,t){delete e.oc[t],e.ctime=e.mtime=Date.now()},rmdir(e,t){var r,n=ye(e,t);for(r in n.oc)throw new Ne.cc(55);delete e.oc[t],e.ctime=e.mtime=Date.now()},readdir:e=>[".","..",...Object.keys(e.oc)],symlink:(e,t,r)=>((e=ce.createNode(e,t,41471,0)).link=r,e),readlink(e){if(40960!=(61440&e.mode))throw new Ne.cc(28);return e.link}},hc:{read(e,t,r,n,i){var a=e.node.oc;if(i>=e.node.Dc)return 0;if(8<(e=Math.min(e.node.Dc-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.oc||e.oc.subarray)){if(a)return e.oc=t.subarray(r,r+n),e.Dc=n;if(0===e.Dc&&0===i)return e.oc=t.slice(r,r+n),e.Dc=n;if(i+n<=e.Dc)return e.oc.set(t.subarray(r,r+n),i),n}var o=e.oc?e.oc.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.oc,e.oc=new Uint8Array(a),0<e.Dc&&e.oc.set(o.subarray(0,e.Dc),0)),e.oc.subarray&&t.subarray)e.oc.set(t.subarray(r,r+n),i);else for(a=0;a<n;a++)e.oc[i+a]=t[r+a];return e.Dc=Math.max(e.Dc,i+n),n},Ic(e,t,r){if(1===r?t+=e.position:2===r&&Ne.isFile(e.node.mode)&&(t+=e.node.Dc),0>t)throw new Ne.cc(28);return t},gd(e,t,r,n,i){if(!Ne.isFile(e.node.mode))throw new Ne.cc(43);if(e=e.node.oc,2&i||!e||e.buffer!==g.buffer){if(n=!0,L(),!(i=void 0))throw new Ne.cc(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{pc:i,Ue:n}},od:(e,t,r,n)=>(ce.hc.write(e,t,0,n,r,!1),0)}},de=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},le=0,ue=null,he=()=>{if(le--,r.monitorRunDependencies?.(le),0==le&&ue){var e=ue;ue=null,e()}},fe=()=>{le++,r.monitorRunDependencies?.(le)},pe=[],me=async(e,t,r,n,i,a,o,c)=>{var d=t?K(q(e+"/"+t)):e;fe();try{var l=r;"string"==typeof r&&(l=await(async e=>(e=await s(e),new Uint8Array(e)))(r)),l=await(async(e,t)=>{for(var r of("undefined"!=typeof Browser&&ve(),pe))if(r.canHandle(t))return r.handle(e,t);return e})(l,d),c?.(),a||$e(e,t,l,n,i,o)}finally{he()}};function ve(){var e,t,n;Ne.Id=!0,e??=r.stdin,t??=r.stdout,n??=r.stderr,e?Ne.Xc("/dev","stdin",e):Ne.symlink("/dev/tty","/dev/stdin"),t?Ne.Xc("/dev","stdout",null,t):Ne.symlink("/dev/tty","/dev/stdout"),n?Ne.Xc("/dev","stderr",null,n):Ne.symlink("/dev/tty1","/dev/stderr"),Ne.open("/dev/stdin",0),Ne.open("/dev/stdout",1),Ne.open("/dev/stderr",1)}function ge(e,t){Ne.Wd[e]={hc:t}}function we(e){return 16384==(61440&e)}function ye(e,t){var r=we(e.mode)?(r=Te(e,"x"))?r:e.fc.lookup?0:2:54;if(r)throw new Ne.cc(r);for(r=Ne.Uc[Ae(e.id,t)];r;r=r.bd)if(r.parent.id===e.id&&r.name===t)return r;return Ne.lookup(e,t)}function be(e){var t=Ae(e.parent.id,e.name);if(Ne.Uc[t]===e)Ne.Uc[t]=e.bd;else for(t=Ne.Uc[t];t;){if(t.bd===e){t.bd=e.bd;break}t=t.bd}}function $e(e,t,r,n,i,a){var o=t;if(e&&(e="string"==typeof e?e:xe(e),o=t?q(e+"/"+t):e),e=de(n,i),o=Ne.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}Ne.chmod(o,146|e),t=Ne.open(o,577),Ne.write(t,r,0,r.length,0,a),Ne.close(t),Ne.chmod(o,e)}}function Ee(e,t={}){if(!e)throw new Ne.cc(44);t.vd??(t.vd=!0),"/"===e.charAt(0)||(e=Ne.cwd()+"/"+e);var r=0;e:for(;40>r;r++){e=e.split("/").filter(e=>!!e);for(var n=Ne.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]){if(i=H(i),Ne.Ld(n)){e=i+"/"+e.slice(a+1).join("/"),r--;continue e}n=n.parent}else{i=q(i+"/"+e[a]);try{n=ye(n,e[a])}catch(e){if(44===e?.Nc&&o&&t.Le)return{path:i};throw e}if(!n.Qc||o&&!t.vd||(n=n.Qc.root),40960==(61440&n.mode)&&(!o||t.Oc)){if(!n.fc.readlink)throw new Ne.cc(52);"/"===(n=n.fc.readlink(n)).charAt(0)||(n=H(i)+"/"+n),e=n+"/"+e.slice(a+1).join("/");continue e}}}return{path:i,node:n}}throw new Ne.cc(32)}function xe(e){for(var t;;){if(Ne.Ld(e))return e=e.rc.ee,t?"/"!==e[e.length-1]?`${e}/${t}`:e+t:e;t=t?`${e.name}/${t}`:e.name,e=e.parent}}function Ae(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Ne.Uc.length}function Se(e){var t=Ae(e.parent.id,e.name);e.bd=Ne.Uc[t],Ne.Uc[t]=e}function ke(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function Te(e,t){return Ne.be?0:!t.includes("r")||292&e.mode?t.includes("w")&&!(146&e.mode)||t.includes("x")&&!(73&e.mode)?2:0:2}function Pe(e,t){if(!we(e.mode))return 54;try{return ye(e,t),20}catch(e){}return Te(e,"wx")}function Ce(e,t,r){try{var n=ye(e,t)}catch(e){return e.Nc}if(e=Te(e,"wx"))return e;if(r){if(!we(n.mode))return 54;if(Ne.Ld(n)||xe(n)===Ne.cwd())return 10}else if(we(n.mode))return 31;return 0}function Oe(e,t){if(!e)throw new Ne.cc(t);return e}function Re(e){if(!(e=Ne.De(e)))throw new Ne.cc(8);return e}function Be(e,t=-1){if(e=Object.assign(new Ne.qe,e),-1==t)e:{for(t=0;t<=Ne.se;t++)if(!Ne.streams[t])break e;throw new Ne.cc(33)}return e.fd=t,Ne.streams[t]=e}function Le(e,t,r){var n=e?.hc.Rc;e=n?e:t,n??=t.fc.Rc,Oe(n,63),n(e,r)}function Ue(e){var t=[];for(e=[e];e.length;){var r=e.pop();t.push(r),e.push(...r.nd)}return t}function Fe(e){var t={Xe:4096,lf:4096,blocks:1e6,We:5e5,Ve:5e5,files:Ne.Od,jf:Ne.Od-1,mf:42,flags:2,vf:255};return e.fc.ke&&Object.assign(t,e.fc.ke(e.rc.Me.root)),t}function De(e,t,r){return void 0===r&&(r=t,t=438),Ne.Tc(e,8192|t,r)}function Me(e,t,r,n){Le(e,t,{mode:4095&r|-4096&t.mode,ctime:Date.now(),Yd:n})}function Ge(e,t,r){if(we(t.mode))throw new Ne.cc(31);if(!Ne.isFile(t.mode))throw new Ne.cc(28);var n=Te(t,"w");if(n)throw new Ne.cc(n);Le(e,t,{size:r,timestamp:Date.now()})}function Ie(e){if(!(e.Je||e.Ke||e.link||e.oc))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.oc=c(e.url)}catch(e){throw new Ne.cc(29)}}var Ne={root:null,nd:[],Wd:{},streams:[],Od:1,Uc:null,Td:"/",Id:!1,be:!0,ze:null,Bd:0,je:{},cc:class{name="ErrnoError";constructor(e){this.Nc=e}},qe:class{Jc={};node=null;get object(){return this.node}set object(e){this.node=e}get flags(){return this.Jc.flags}set flags(e){this.Jc.flags=e}get position(){return this.Jc.position}set position(e){this.Jc.position=e}},pe:class{fc={};hc={};Qc=null;constructor(e,t,r,n){e||=this,this.parent=e,this.rc=e.rc,this.id=Ne.Od++,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 Ke(){return we(this.mode)}get Je(){return 8192==(61440&this.mode)}},createNode:(e,t,r,n)=>(Se(e=new Ne.pe(e,t,r,n)),e),Ld:e=>e===e.parent,isFile:e=>32768==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),se:4096,De:e=>Ne.streams[e],te:{open(e){e.hc=Ne.Be(e.node.rdev).hc,e.hc.open?.(e)},Ic(){throw new Ne.cc(70)}},Md:e=>e>>8,rf:e=>255&e,ad:(e,t)=>e<<8|t,Be:e=>Ne.Wd[e],le(e,t){function r(e){return Ne.Bd--,t(e)}function n(e){if(e){if(!n.xe)return n.xe=!0,r(e)}else++o>=a.length&&r(null)}"function"==typeof e&&(t=e,e=!1),Ne.Bd++,1<Ne.Bd&&P(`warning: ${Ne.Bd} FS.syncfs operations in flight at once, probably just doing extra work`);var i,a=Ue(Ne.root.rc),o=0;for(i of a)i.type.le?i.type.le(i,e,n):n(null)},rc(e,t,r){var n="/"===r;if(n&&Ne.root)throw new Ne.cc(10);if(!n&&r){var i=Ee(r,{vd:!1});if(r=i.path,(i=i.node).Qc)throw new Ne.cc(10);if(!we(i.mode))throw new Ne.cc(54)}return(e=e.rc(t={type:e,Me:t,ee:r,nd:[]})).rc=t,t.root=e,n?Ne.root=e:i&&(i.Qc=t,i.rc&&i.rc.nd.push(t)),e},Gf(e){if(!(e=Ee(e,{vd:!1})).node.Qc)throw new Ne.cc(28);var t=(e=e.node).Qc,r=Ue(t);for([,i]of Object.entries(Ne.Uc))for(;i;){var n=i.bd;r.includes(i.rc)&&be(i);var i=n}e.Qc=null,e.rc.nd.splice(e.rc.nd.indexOf(t),1)},lookup:(e,t)=>e.fc.lookup(e,t),Tc(e,t,r){var n=Ee(e,{parent:!0}).node;if(!(e=X(e)))throw new Ne.cc(28);if("."===e||".."===e)throw new Ne.cc(20);var i=Pe(n,e);if(i)throw new Ne.cc(i);if(!n.fc.Tc)throw new Ne.cc(63);return n.fc.Tc(n,e,t,r)},ke:e=>Fe(Ee(e,{Oc:!0}).node),Cf:e=>Fe(e.node),create:(e,t=438)=>Ne.Tc(e,4095&t|32768,0),mkdir:(e,t=511)=>Ne.Tc(e,1023&t|16384,0),tf(e,t){var r,n=e.split("/"),i="";for(r of n)if(r){(i||"/"===e.charAt(0))&&(i+="/"),i+=r;try{Ne.mkdir(i,t)}catch(e){if(20!=e.Nc)throw e}}},symlink(e,t){if(!K(e))throw new Ne.cc(44);var r=Ee(t,{parent:!0}).node;if(!r)throw new Ne.cc(44);var n=Pe(r,t=X(t));if(n)throw new Ne.cc(n);if(!r.fc.symlink)throw new Ne.cc(63);return r.fc.symlink(r,t,e)},rename(e,t){var r=H(e),n=H(t),i=X(e),a=X(t),o=Ee(e,{parent:!0}),s=o.node;if(o=(o=Ee(t,{parent:!0})).node,!s||!o)throw new Ne.cc(44);if(s.rc!==o.rc)throw new Ne.cc(75);var c=ye(s,i);if("."!==(e=Q(e,n)).charAt(0))throw new Ne.cc(28);if("."!==(e=Q(t,r)).charAt(0))throw new Ne.cc(55);try{var d=ye(o,a)}catch(e){}if(c!==d){if(i=Ce(s,i,t=we(c.mode)))throw new Ne.cc(i);if(i=d?Ce(o,a,t):Pe(o,a))throw new Ne.cc(i);if(!s.fc.rename)throw new Ne.cc(63);if(c.Qc||d&&d.Qc)throw new Ne.cc(10);if(o!==s&&(i=Te(s,"w")))throw new Ne.cc(i);be(c);try{s.fc.rename(c,o,a),c.parent=o}catch(e){throw e}finally{Se(c)}}},rmdir(e){var t=Ee(e,{parent:!0}).node,r=ye(t,e=X(e)),n=Ce(t,e,!0);if(n)throw new Ne.cc(n);if(!t.fc.rmdir)throw new Ne.cc(63);if(r.Qc)throw new Ne.cc(10);t.fc.rmdir(t,e),be(r)},readdir:e=>Oe((e=Ee(e,{Oc:!0}).node).fc.readdir,54)(e),unlink(e){var t=Ee(e,{parent:!0}).node;if(!t)throw new Ne.cc(44);var r=ye(t,e=X(e)),n=Ce(t,e,!1);if(n)throw new Ne.cc(n);if(!t.fc.unlink)throw new Ne.cc(63);if(r.Qc)throw new Ne.cc(10);t.fc.unlink(t,e),be(r)},readlink(e){if(!(e=Ee(e).node))throw new Ne.cc(44);if(!e.fc.readlink)throw new Ne.cc(28);return e.fc.readlink(e)},stat:(e,t)=>Oe((e=Ee(e,{Oc:!t}).node).fc.Pc,63)(e),fstat(e){var t=Re(e);e=t.node;var r=t.hc.Pc;return t=r?t:e,r??=e.fc.Pc,Oe(r,63),r(t)},lstat:e=>Ne.stat(e,!0),chmod(e,t,r){Me(null,e="string"==typeof e?Ee(e,{Oc:!r}).node:e,t,r)},lchmod(e,t){Ne.chmod(e,t,!0)},fchmod(e,t){Me(e=Re(e),e.node,t,!1)},chown(e,t,r,n){Le(null,e="string"==typeof e?Ee(e,{Oc:!n}).node:e,{timestamp:Date.now(),Yd:n})},lchown(e,t,r){Ne.chown(e,t,r,!0)},fchown(e){Le(e=Re(e),e.node,{timestamp:Date.now(),Yd:!1})},truncate(e,t){if(0>t)throw new Ne.cc(28);Ge(null,e="string"==typeof e?Ee(e,{Oc:!0}).node:e,t)},nf(e,t){if(e=Re(e),0>t||!(2097155&e.flags))throw new Ne.cc(28);Ge(e,e.node,t)},Hf(e,t,r){Oe((e=Ee(e,{Oc:!0}).node).fc.Rc,63)(e,{atime:t,mtime:r})},open(e,t,n=438){if(""===e)throw new Ne.cc(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(n=64&t?4095&n|32768:0,"object"==typeof e)i=e;else{var a=e.endsWith("/");i=(e=Ee(e,{Oc:!(131072&t),Le:!0})).node,e=e.path}var o=!1;if(64&t)if(i){if(128&t)throw new Ne.cc(20)}else{if(a)throw new Ne.cc(31);i=Ne.Tc(e,511|n,0),o=!0}if(!i)throw new Ne.cc(44);if(8192==(61440&i.mode)&&(t&=-513),65536&t&&!we(i.mode))throw new Ne.cc(54);if(!o&&(a=i?40960==(61440&i.mode)?32:we(i.mode)&&("r"!==ke(t)||576&t)?31:Te(i,ke(t)):44))throw new Ne.cc(a);return 512&t&&!o&&Ne.truncate(i,0),t&=-131713,(a=Be({node:i,path:xe(i),flags:t,seekable:!0,position:0,hc:i.hc,Te:[],error:!1})).hc.open&&a.hc.open(a),o&&Ne.chmod(i,511&n),!r.logReadFiles||1&t||e in Ne.je||(Ne.je[e]=1),a},close(e){if(null===e.fd)throw new Ne.cc(8);e.Hd&&(e.Hd=null);try{e.hc.close&&e.hc.close(e)}catch(e){throw e}finally{Ne.streams[e.fd]=null}e.fd=null},Ic(e,t,r){if(null===e.fd)throw new Ne.cc(8);if(!e.seekable||!e.hc.Ic)throw new Ne.cc(70);if(0!=r&&1!=r&&2!=r)throw new Ne.cc(28);return e.position=e.hc.Ic(e,t,r),e.Te=[],e.position},read(e,t,r,n,i){if(0>n||0>i)throw new Ne.cc(28);if(null===e.fd)throw new Ne.cc(8);if(1==(2097155&e.flags))throw new Ne.cc(8);if(we(e.node.mode))throw new Ne.cc(31);if(!e.hc.read)throw new Ne.cc(28);var a=void 0!==i;if(a){if(!e.seekable)throw new Ne.cc(70)}else i=e.position;return t=e.hc.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 Ne.cc(28);if(null===e.fd)throw new Ne.cc(8);if(!(2097155&e.flags))throw new Ne.cc(8);if(we(e.node.mode))throw new Ne.cc(31);if(!e.hc.write)throw new Ne.cc(28);e.seekable&&1024&e.flags&&Ne.Ic(e,0,2);var o=void 0!==i;if(o){if(!e.seekable)throw new Ne.cc(70)}else i=e.position;return t=e.hc.write(e,t,r,n,i,a),o||(e.position+=t),t},gd(e,t,r,n,i){if(2&n&&!(2&i)&&2!=(2097155&e.flags))throw new Ne.cc(2);if(1==(2097155&e.flags))throw new Ne.cc(2);if(!e.hc.gd)throw new Ne.cc(43);if(!t)throw new Ne.cc(28);return e.hc.gd(e,t,r,n,i)},od:(e,t,r,n,i)=>e.hc.od?e.hc.od(e,t,r,n,i):0,Jd(e,t,r){if(!e.hc.Jd)throw new Ne.cc(59);return e.hc.Jd(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=Ne.open(e,t.flags);e=Ne.stat(e).size;var n=new Uint8Array(e);return Ne.read(r,n,0,e,0),"utf8"===t.encoding&&(n=Y(n)),Ne.close(r),n},writeFile(e,t,r={}){r.flags=r.flags||577,e=Ne.open(e,r.flags,r.mode),"string"==typeof t&&(t=new Uint8Array(re(t))),ArrayBuffer.isView(t)?Ne.write(e,t,0,t.byteLength,void 0,r.cf):L("Unsupported data type"),Ne.close(e)},cwd:()=>Ne.Td,chdir(e){if(null===(e=Ee(e,{Oc:!0})).node)throw new Ne.cc(44);if(!we(e.node.mode))throw new Ne.cc(54);var t=Te(e.node,"x");if(t)throw new Ne.cc(t);Ne.Td=e.path},zf(){for(var e of(Ne.Id=!1,Ne.streams))e&&Ne.close(e)},kf(e,t){try{var r=Ee(e,{Oc:!t});e=r.path}catch(e){}var n=!1,i=null;try{r=Ee(e,{parent:!0}),X(e),r=Ee(e,{Oc:!t}),n=!0,i=r.node}catch(e){}return n?i:null},Xc(e,t,r,n){var i;return e=((e,t)=>q(e+"/"+t))("string"==typeof e?e:xe(e),t),t=de(!!r,!!n),(i=Ne.Xc).Md??(i.Md=64),ge(i=Ne.ad(Ne.Xc.Md++,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 Ne.cc(29)}if(void 0===s&&0===a)throw new Ne.cc(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 Ne.cc(29)}return i&&(e.node.mtime=e.node.ctime=Date.now()),a}}),De(e,t,i)}},Ve=void 0,je=e=>{for(var t="";;){var r=w[e++];if(!r)return t;t+=String.fromCharCode(r)}},ze={},We={},qe={},He=class extends Error{constructor(e){super(e),this.name="BindingError"}},Xe=e=>{throw new He(e)};function Je(e,t,r={}){return function(e,t,r={}){var n=t.name;if(!e)throw new He(`type "${n}" must have a positive integer typeid pointer`);if(We.hasOwnProperty(e)){if(r.Ee)return;throw new He(`Cannot register type '${n}' twice`)}We[e]=t,delete qe[e],ze.hasOwnProperty(e)&&(t=ze[e],delete ze[e],t.forEach(e=>e()))}(e,t,r)}var Ke=(e,t,r)=>{switch(t){case 1:return r?e=>g[e]:e=>w[e];case 2:return r?e=>y[e>>1]:e=>b[e>>1];case 4:return r?e=>_[e>>2]:e=>$[e>>2];case 8:return r?e=>A[e>>3]:e=>S[e>>3];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Qe=e=>{throw new He(e.dc.sc.qc.name+" instance already deleted")},Ye=!1,Ze=()=>{},et=e=>globalThis.FinalizationRegistry?(Ye=new FinalizationRegistry(e=>{--(e=e.dc).count.value,0===e.count.value&&(e.Fc?e.Kc.Yc(e.Fc):e.sc.qc.Yc(e.pc))}),et=e=>{var t=e.dc;return t.Fc&&Ye.register(e,{dc:t},e),e},Ze=e=>{Ye.unregister(e)},et(e)):(et=e=>e,e);function tt(){}var rt=(e,t)=>Object.defineProperty(t,"name",{value:e}),nt={},it=(e,t,r)=>{if(void 0===e[t].Ec){var n=e[t];e[t]=function(...n){if(!e[t].Ec.hasOwnProperty(n.length))throw new He(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${e[t].Ec})!`);return e[t].Ec[n.length].apply(this,n)},e[t].Ec=[],e[t].Ec[n.kd]=n}},at=(e,t,n)=>{if(r.hasOwnProperty(e)){if(void 0===n||void 0!==r[e].Ec&&void 0!==r[e].Ec[n])throw new He(`Cannot register public name '${e}' twice`);if(it(r,e,e),r[e].Ec.hasOwnProperty(n))throw new He(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`);r[e].Ec[n]=t}else r[e]=t,r[e].kd=n};function ot(e,t,r,n,i,a,o,s){this.name=e,this.constructor=t,this.ed=r,this.Yc=n,this.Hc=i,this.Ae=a,this.sd=o,this.we=s,this.Oe=[]}var st=(e,t,r)=>{for(;t!==r;){if(!t.sd)throw new He(`Expected null or instance of ${r.name}, got an instance of ${t.name}`);e=t.sd(e),t=t.Hc}return e},ct=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e};function dt(e,t){if(null===t){if(this.Kd)throw new He(`null is not a valid ${this.name}`);return 0}if(!t.dc)throw new He(`Cannot pass "${ct(t)}" as a ${this.name}`);if(!t.dc.pc)throw new He(`Cannot pass deleted object as a pointer of type ${this.name}`);return st(t.dc.pc,t.dc.sc.qc,this.qc)}function lt(e,t){if(null===t){if(this.Kd)throw new He(`null is not a valid ${this.name}`);if(this.xd){var r=this.Qe();return null!==e&&e.push(this.Yc,r),r}return 0}if(!t||!t.dc)throw new He(`Cannot pass "${ct(t)}" as a ${this.name}`);if(!t.dc.pc)throw new He(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.wd&&t.dc.sc.wd)throw new He(`Cannot convert argument of type ${t.dc.Kc?t.dc.Kc.name:t.dc.sc.name} to parameter type ${this.name}`);if(r=st(t.dc.pc,t.dc.sc.qc,this.qc),this.xd){if(void 0===t.dc.Fc)throw new He("Passing raw pointer to smart pointer is illegal");switch(this.Se){case 0:if(t.dc.Kc!==this)throw new He(`Cannot convert argument of type ${t.dc.Kc?t.dc.Kc.name:t.dc.sc.name} to parameter type ${this.name}`);r=t.dc.Fc;break;case 1:r=t.dc.Fc;break;case 2:if(t.dc.Kc===this)r=t.dc.Fc;else{var n=t.clone();r=this.Re(r,Dt(()=>n.delete())),null!==e&&e.push(this.Yc,r)}break;default:throw new He("Unsupporting sharing policy")}}return r}function ut(e,t){if(null===t){if(this.Kd)throw new He(`null is not a valid ${this.name}`);return 0}if(!t.dc)throw new He(`Cannot pass "${ct(t)}" as a ${this.name}`);if(!t.dc.pc)throw new He(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.dc.sc.wd)throw new He(`Cannot convert argument of type ${t.dc.sc.name} to parameter type ${this.name}`);return st(t.dc.pc,t.dc.sc.qc,this.qc)}function ht(e){return this.Gc($[e>>2])}var ft=(e,t,r)=>t===r?e:void 0===r.Hc||null===(e=ft(e,t,r.Hc))?null:r.we(e),pt={},mt=class extends Error{constructor(e){super(e),this.name="InternalError"}},vt=(e,t)=>{if(!t.sc||!t.pc)throw new mt("makeClassHandle requires ptr and ptrType");if(!!t.Kc!=!!t.Fc)throw new mt("Both smartPtrType and smartPtr must be specified");return t.count={value:1},et(Object.create(e,{dc:{value:t,writable:!0}}))};function gt(e,t,r,n,i,a,o,s,c,d,l){this.name=e,this.qc=t,this.Kd=r,this.wd=n,this.xd=i,this.Ne=a,this.Se=o,this.ie=s,this.Qe=c,this.Re=d,this.Yc=l,i||void 0!==t.Hc?this.Lc=lt:(this.Lc=n?dt:ut,this.Mc=null)}var wt=(e,t,n)=>{if(!r.hasOwnProperty(e))throw new mt("Replacing nonexistent public symbol");void 0!==r[e].Ec&&void 0!==n?r[e].Ec[n]=t:(r[e]=t,r[e].kd=n)},yt=(e,t)=>{e=je(e);var r=Mn.get(t);if("function"!=typeof r)throw new He(`unknown function pointer with signature ${e}: ${t}`);return r};class bt extends Error{}var _t=e=>{e=vn(e);var t=je(e);return pn(e),t},$t=(e,t)=>{var r=[],n={};throw t.forEach(function e(t){n[t]||We[t]||(qe[t]?qe[t].forEach(e):(r.push(t),n[t]=!0))}),new bt(`${e}: `+r.map(_t).join([", "]))},Et=(e,t,r)=>{function n(t){if((t=r(t)).length!==e.length)throw new mt("Mismatched type converter count");for(var n=0;n<e.length;++n)Je(e[n],t[n])}e.forEach(e=>qe[e]=t);var i=Array(t.length),a=[],o=0;for(let[e,r]of t.entries())We.hasOwnProperty(r)?i[e]=We[r]:(a.push(r),ze.hasOwnProperty(r)||(ze[r]=[]),ze[r].push(()=>{i[e]=We[r],++o===a.length&&n(i)}));0===a.length&&n(i)},xt=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push($[t+4*n>>2]);return r},At=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function St(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].Mc)return!0;return!1}function kt(e,t,r,n,i,a){var o=t.length;if(2>o)throw new He("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==t[1]&&null!==r,c=St(t);r=!t[0].ce;var d=t[0],l=t[1];for(n=[e,Xe,n,i,At,d.Gc.bind(d),l?.Lc.bind(l)],i=2;i<o;++i)n.push((d=t[i]).Lc.bind(d));if(!c)for(i=s?1:2;i<t.length;++i)null!==t[i].Mc&&n.push(t[i].Mc);for(c=St(t),i=t.length-2,l=[],d=["fn"],s&&d.push("thisWired"),o=0;o<i;++o)l.push(`arg${o}`),d.push(`arg${o}Wired`);l=l.join(","),d=d.join(","),l=`return function (${l}) {\n`,c&&(l+="var destructors = [];\n");var u=c?"destructors":"null",h="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(s&&(l+=`var thisWired = toClassParamWire(${u}, this);\n`),o=0;o<i;++o){var f=`toArg${o}Wire`;l+=`var arg${o}Wired = ${f}(${u}, arg${o});\n`,h.push(f)}if(l+=(r||a?"var rv = ":"")+`invoker(${d});\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].Mc&&(l+=`${a}_dtor(${a});\n`,h.push(`${a}_dtor`));return r&&(l+="var ret = fromRetWire(rv);\nreturn ret;\n"),t=new Function(h,l+"}\n")(...n),rt(e,t)}var Tt,Pt,Ct,Ot,Rt=e=>{const t=(e=e.trim()).indexOf("(");return-1===t?e:e.slice(0,t)},Bt=[],Lt=[0,1,,1,null,1,!0,1,!1,1],Ut=e=>{9<e&&0===--Lt[e+1]&&(Lt[e]=void 0,Bt.push(e))},Ft=e=>{if(!e)throw new He(`Cannot use deleted val. handle = ${e}`);return Lt[e]},Dt=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const t=Bt.pop()||Lt.length;return Lt[t]=e,Lt[t+1]=1,t}},Mt={name:"emscripten::val",Gc:e=>{var t=Ft(e);return Ut(e),t},Lc:(e,t)=>Dt(t),Wc:ht,Mc:null},Gt=(e,t)=>{switch(t){case 4:return function(e){return this.Gc(E[e>>2])};case 8:return function(e){return this.Gc(x[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},It=new TextDecoder("utf-16le"),Nt=(e,t,r)=>It.decode(b.subarray(e>>=1,V(b,e,t/2,r))),Vt=(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},jt=e=>2*e.length,zt=(e,t,r)=>{var n="";e>>=2;for(var i=0;!(i>=t/4);i++){var a=$[e+i];if(!a&&!r)break;n+=String.fromCodePoint(a)}return n},Wt=(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.codePointAt(i);if(65535<a&&i++,_[t>>2]=a,(t+=4)+4>r)break}return _[t>>2]=0,t-n},qt=e=>{for(var t=0,r=0;r<e.length;++r)65535<e.codePointAt(r)&&r++,t+=4;return t},Ht=0,Xt=[],Jt=(e,t,r)=>{var n=[];return e=e(n,r),n.length&&($[t>>2]=Dt(n)),e},Kt={},Qt=e=>{var t=Kt[e];return void 0===t?je(e):t},Yt={},Zt=e=>{p=e,I||0<Ht||(r.onExit?.(e),C=!0),d(e,new U(e))},er=e=>{if(!C)try{if(e(),!(I||0<Ht))try{p=e=p,Zt(e)}catch(e){e instanceof U||"unwind"==e||d(1,e)}}catch(e){e instanceof U||"unwind"==e||d(1,e)}},tr=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))},rr=1,nr=[],ir=[],ar=[],or=[],sr=[],cr=[],dr=[],lr=[],ur=[1,1,2,2,4,4,4,2,3,4,8],hr=e=>{for(var t=rr++,r=e.length;r<t;r++)e[r]=null;for(;e[t];)t=rr++;return t},fr=(e,t,r,n)=>{for(var i=0;i<e;i++){var a=Tt[r](),o=a&&hr(n);a?(a.name=o,n[o]=a):Pt||=1282,_[t+4*i>>2]=o}},pr=["default","low-power","high-performance"],mr=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],vr=e=>(e=2<e?j(e):e,mr[e]||("undefined"!=typeof document?document.querySelector(e):null)),gr=e=>{var t=ee(e)+1,r=Un(t);return te(e,w,r,t),r},wr=[],yr=[],br=e=>{if(e)return wr[e>>>0]},_r=e=>j($[e>>2],$[e+4>>2]),$r=e=>{var t=$[e>>2];return e=$[e+4>>2],t?j(t,e):0===e?"":void 0},Er=e=>({width:$[e>>2],height:$[e+4>>2],depthOrArrayLayers:$[e+8>>2]}),xr=e=>{var t=e+8;return{texture:br($[e>>2]),mipLevel:$[e+4>>2],origin:{x:$[t>>2],y:$[t+4>>2],z:$[t+8>>2]},aspect:Xr[$[e+20>>2]]}},Ar=(e,t)=>{if(e){for(var r={},n=0;n<e;++n){var i=t+24*n;r[_r(i+4)]=x[i+16>>3]}return r}},Sr=e=>e?br(e):"auto",kr=[,"clamp-to-edge","repeat","mirror-repeat"],Tr=[,"zero","one","src","one-minus-src","src-alpha","one-minus-src-alpha","dst","one-minus-dst","dst-alpha","one-minus-dst-alpha","src-alpha-saturated","constant","one-minus-constant","src1","one-minus-src1","src1alpha","one-minus-src1alpha"],Pr=[,"add","subtract","reverse-subtract","min","max"],Cr=["binding-not-used",,"uniform","storage","read-only-storage"],Or=[,"never","less","equal","less-equal","greater","not-equal","greater-equal","always"],Rr=[,"opaque","premultiplied","unpremultiplied","inherit"],Br=[,"none","front","back"],Lr=[,"compatibility","core"],Ur={1:"core-features-and-limits",2:"depth-clip-control",3:"depth32float-stencil8",4:"texture-compression-bc",5:"texture-compression-bc-sliced-3d",6:"texture-compression-etc2",7:"texture-compression-astc",8:"texture-compression-astc-sliced-3d",9:"timestamp-query",10:"indirect-first-instance",11:"shader-f16",12:"rg11b10ufloat-renderable",13:"bgra8unorm-storage",14:"float32-filterable",15:"float32-blendable",16:"clip-distances",17:"dual-source-blending",18:"subgroups",19:"texture-formats-tier1",20:"texture-formats-tier2",21:"primitive-index",327692:"chromium-experimental-unorm16-texture-formats",327693:"chromium-experimental-snorm16-texture-formats",327732:"chromium-experimental-multi-draw-indirect"},Fr=[,"nearest","linear"],Dr=[,"ccw","cw"],Mr=[,"uint16","uint32"],Gr=[,"load","clear"],Ir=[,"nearest","linear"],Nr=[,"low-power","high-performance"],Vr=[,"srgb","display-p3"],jr=[,"point-list","line-list","line-strip","triangle-list","triangle-strip"],zr=["binding-not-used",,"filtering","non-filtering","comparison"],Wr=[,"keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],qr=["binding-not-used",,"write-only","read-only","read-write"],Hr=[,"store","discard"],Xr=[,"all","stencil-only","depth-only"],Jr=[,"1d","2d","3d"],Kr=[,"r8unorm","r8snorm","r8uint","r8sint","r16unorm","r16snorm","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32float","r32uint","r32sint","rg16unorm","rg16snorm","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb10a2uint","rgb10a2unorm","rg11b10ufloat","rgb9e5ufloat","rg32float","rg32uint","rg32sint","rgba16unorm","rgba16snorm","rgba16uint","rgba16sint","rgba16float","rgba32float","rgba32uint","rgba32sint","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb","etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm","astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"],Qr=["binding-not-used",,"float","unfilterable-float","depth","sint","uint"],Yr=[,"1d","2d","2d-array","cube","cube-array","3d"],Zr=[,"standard","extended"],en=[,"uint8","uint8x2","uint8x4","sint8","sint8x2","sint8x4","unorm8","unorm8x2","unorm8x4","snorm8","snorm8x2","snorm8x4","uint16","uint16x2","uint16x4","sint16","sint16x2","sint16x4","unorm16","unorm16x2","unorm16x4","snorm16","snorm16x2","snorm16x4","float16","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4","unorm10-10-10-2","unorm8x4-bgra"],tn=[,"vertex","instance"],rn={undefined:1,unknown:1,destroyed:2},nn=e=>-9007199254740992>e||9007199254740992<e?NaN:Number(e),an=e=>"]"==e.slice(-1)&&e.lastIndexOf("["),on=[],sn=e=>0==(e-=5120)?g:1==e?w:2==e?y:4==e?_:6==e?E:5==e||28922==e||28520==e||30779==e||30782==e?$:b,cn=e=>{var t=Tt.ve;if(t){var r=t.rd[e];return"number"==typeof r&&(t.rd[e]=r=Tt.getUniformLocation(t,t.me[e]+(0<r?`[${r}]`:""))),r}Pt||=1282},dn=[],ln=[];Ne.df=(e,t,r,n,i,a,o,s,c,d)=>{me(e,t,r,n,i,s,c,d).then(a).catch(o)},Ne.xf=me,Ne.Uc=Array(4096),Ne.rc(ce,{},"/"),Ne.mkdir("/tmp"),Ne.mkdir("/home"),Ne.mkdir("/home/web_user"),function(){Ne.mkdir("/dev"),ge(Ne.ad(1,3),{read:()=>0,write:(e,t,r,n)=>n,Ic:()=>0}),De("/dev/null",Ne.ad(1,3)),ie(Ne.ad(5,0),oe),ie(Ne.ad(6,0),se),De("/dev/tty",Ne.ad(5,0)),De("/dev/tty1",Ne.ad(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(J(e),t=e.byteLength),e[--t]);Ne.Xc("/dev","random",r),Ne.Xc("/dev","urandom",r),Ne.mkdir("/dev/shm"),Ne.mkdir("/dev/shm/tmp")}(),function(){Ne.mkdir("/proc");var e=Ne.mkdir("/proc/self");Ne.mkdir("/proc/self/fd"),Ne.rc({rc(){var t=Ne.createNode(e,"fd",16895,73);return t.hc={Ic:ce.hc.Ic},t.fc={lookup(e,t){var r=Re(e=+t);return(e={parent:null,rc:{ee:"fake"},fc:{readlink:()=>r.path},id:e+1}).parent=e},readdir:()=>Array.from(Ne.streams.entries()).filter(([,e])=>e).map(([e])=>e.toString())},t}},{},"/proc/self/fd")}(),Ne.ze={MEMFS:ce},(()=>{let e=tt.prototype;Object.assign(e,{isAliasOf:function(e){if(!(this instanceof tt&&e instanceof tt))return!1;var t=this.dc.sc.qc,r=this.dc.pc;e.dc=e.dc;var n=e.dc.sc.qc;for(e=e.dc.pc;t.Hc;)r=t.sd(r),t=t.Hc;for(;n.Hc;)e=n.sd(e),n=n.Hc;return t===n&&r===e},clone:function(){if(this.dc.pc||Qe(this),this.dc.pd)return this.dc.count.value+=1,this;var e=et,t=Object,r=t.create,n=Object.getPrototypeOf(this),i=this.dc;return(e=e(r.call(t,n,{dc:{value:{count:i.count,md:i.md,pd:i.pd,pc:i.pc,sc:i.sc,Fc:i.Fc,Kc:i.Kc}}}))).dc.count.value+=1,e.dc.md=!1,e},delete(){if(this.dc.pc||Qe(this),this.dc.md&&!this.dc.pd)throw new He("Object already scheduled for deletion");Ze(this);var e=this.dc;--e.count.value,0===e.count.value&&(e.Fc?e.Kc.Yc(e.Fc):e.sc.qc.Yc(e.pc)),this.dc.pd||(this.dc.Fc=void 0,this.dc.pc=void 0)},isDeleted:function(){return!this.dc.pc},deleteLater:function(){if(this.dc.pc||Qe(this),this.dc.md&&!this.dc.pd)throw new He("Object already scheduled for deletion");return this.dc.md=!0,this}});const t=Symbol.dispose;t&&(e[t]=e.delete)})(),Object.assign(gt.prototype,{Ce(e){return this.ie&&(e=this.ie(e)),e},Vd(e){this.Yc?.(e)},Wc:ht,Gc:function(e){function t(){return vt(this.qc.ed,this.xd?{sc:this.Ne,pc:r,Kc:this,Fc:e}:{sc:this,pc:e})}var r=this.Ce(e);if(!r)return this.Vd(e),null;var n=((e,t)=>{if(void 0===t)throw new He("ptr should not be undefined");for(;e.Hc;)t=e.sd(t),e=e.Hc;return pt[t]})(this.qc,r);if(void 0!==n)return 0===n.dc.count.value?(n.dc.pc=r,n.dc.Fc=e,n.clone()):(n=n.clone(),this.Vd(e),n);if(n=this.qc.Ae(r),!(n=nt[n]))return t.call(this);var i=ft(r,this.qc,(n=this.wd?n.ue:n.pointerType).qc);return null===i?t.call(this):vt(n.qc.ed,this.xd?{sc:n,pc:i,Kc:this,Fc:e}:{sc:n,pc:i})}}),"undefined"!=typeof MainLoop&&MainLoop.wf.push(()=>{if(Ct){var e=Ct.jd;for(Ct.jd=Ct.qd,Ct.qd=e,e=Ct.Zc,Ct.Zc=Ct.Cd,Ct.Cd=e,e=0;21>=e;++e)Ct.Zc[e]=0}});for(let e=0;32>e;++e)on.push(Array(e));for(var un=new Int32Array(288),hn=0;288>=hn;++hn)dn[hn]=un.subarray(0,hn);var fn=new Float32Array(288);for(hn=0;288>=hn;++hn)ln[hn]=fn.subarray(0,hn);if(r.noExitRuntime&&(I=r.noExitRuntime),r.preloadPlugins&&(pe=r.preloadPlugins),r.print&&(T=r.print),r.printErr&&(P=r.printErr),r.wasmBinary&&(f=r.wasmBinary),r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.shift()();r.addRunDependency=fe,r.removeRunDependency=he,r.FS_preloadFile=me,r.FS_unlink=(...e)=>Ne.unlink(...e),r.FS_createPath=(...e)=>function(e,t){for(e="string"==typeof e?e:xe(e),t=t.split("/").reverse();t.length;){var r=t.pop();if(r){var n=q(e+"/"+r);try{Ne.mkdir(n)}catch(e){if(20!=e.Nc)throw e}e=n}}return n}(...e),r.FS_createDevice=(...e)=>Ne.Xc(...e),r.FS=Ne,r.FS_createDataFile=(...e)=>$e(...e),r.FS_createLazyFile=(...e)=>function(e,t,r,n,a){class o{Gd=!1;Jc=[];Ed=void 0;ge=0;ae=0;get(e){if(!(e>this.length-1||0>e)){var t=e%this.chunkSize;return this.Ed(e/this.chunkSize|0)[t]}}Pe(e){this.Ed=e}he(){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 a=1048576;i||(a=n);var o=this;o.Pe(e=>{var t=e*a,i=(e+1)*a-1;if(i=Math.min(i,n-1),void 0===o.Jc[e]){var s=o.Jc;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!==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||L("Couldn't load "+r+". Status: "+c.status),t=void 0!==c.response?new Uint8Array(c.response||[]):re(c.responseText||""),s[e]=t}return void 0===o.Jc[e]&&L("doXHR failed!"),o.Jc[e]}),!e&&n||(a=n=1,a=n=this.Ed(0).length,T("LazyFiles on gzip forces download of the whole file when length is accessed")),this.ge=n,this.ae=a,this.Gd=!0}get length(){return this.Gd||this.he(),this.ge}get chunkSize(){return this.Gd||this.he(),this.ae}}if(globalThis.XMLHttpRequest){i||L("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var s=new o,c=void 0}else c=r,s=void 0;var d=function(e,t,r,n){return e="string"==typeof e?e:xe(e),t=q(e+"/"+t),Ne.create(t,de(r,n))}(e,t,n,a);s?d.oc=s:c&&(d.oc=null,d.url=c),Object.defineProperties(d,{Dc:{get:function(){return this.oc.length}}}),e={};for(const[t,r]of Object.entries(d.hc))e[t]=(...e)=>(Ie(d),r(...e));return e.read=(e,t,r,n,i)=>{if(Ie(d),i>=(e=e.node.oc).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},e.gd=()=>{throw Ie(d),L(),new Ne.cc(48)},d.hc=e,d}(...e);var pn,mn,vn,gn,wn,yn,bn,_n,$n,En,xn,An,Sn,kn,Tn,Pn,Cn,On,Rn,Bn,Ln,Un,Fn,Dn,Mn,Gn,In={a:(e,t,r,n)=>L(`Assertion failed: ${j(e)}, at: `+[t?j(t):"unknown filename",r,n?j(n):"unknown function"]),wa:function(e,t,r){Ve=r;try{var n=Re(e);switch(t){case 0:var i=z();if(0>i)break;for(;Ne.streams[i];)i++;return function(e,t=-1){return e=Be(e,t),e.hc?.ff?.(e),e}(n,i).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:return i=z(),n.flags|=i,0;case 12:return i=z(),y[i+0>>1]=2,0}return-28}catch(e){if(void 0===Ne||"ErrnoError"!==e.name)throw e;return-e.Nc}},Ab:function(e,t,r){Ve=r;try{var n=Re(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.Vc.Ge){e=[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var i=z();_[i>>2]=25856,_[i+4>>2]=5,_[i+8>>2]=191,_[i+12>>2]=35387;for(var a=0;32>a;a++)g[i+a+17]=e[a]||0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.Vc.He)for(i=z(),e=[],a=0;32>a;a++)e.push(g[i+a+17]);return 0;case 21519:return n.tty?(i=z(),_[i>>2]=0):-59;case 21520:return n.tty?-28:-59;case 21537:case 21531:return i=z(),Ne.Jd(n,t,i);case 21523:return n.tty?(n.tty.Vc.Ie&&(a=[24,80],i=z(),y[i>>1]=a[0],y[i+2>>1]=a[1]),0):-59;default:return-28}}catch(e){if(void 0===Ne||"ErrnoError"!==e.name)throw e;return-e.Nc}},Bb:function(e,t,r,n){Ve=n;try{var i=t=j(t);if("/"===i.charAt(0))t=i;else{var a=-100===e?Ne.cwd():Re(e).path;if(0==i.length)throw new Ne.cc(44);t=a+"/"+i}var o=n?z():0;return Ne.open(t,r,o).fd}catch(e){if(void 0===Ne||"ErrnoError"!==e.name)throw e;return-e.Nc}},Cb:()=>L(""),sa:(e,t,r,n,i)=>{t=je(t);let a=e=>e;if(n=0n===n){const e=8*r;a=t=>BigInt.asUintN(e,t),i=a(i)}Je(e,{name:t,Gc:a,Lc:(e,t)=>("number"==typeof t&&(t=BigInt(t)),t),Wc:Ke(t,r,!n),Mc:null})},ob:(e,t,r,n)=>{Je(e,{name:t=je(t),Gc:function(e){return!!e},Lc:function(e,t){return t?r:n},Wc:function(e){return this.Gc(w[e])},Mc:null})},mb:(e,t,r,n,i,a,o,s,c,d,l,u,h)=>{l=je(l),a=yt(i,a),s&&=yt(o,s),d&&=yt(c,d),h=yt(u,h);var f=(e=>{var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e})(l);at(f,function(){$t(`Cannot construct ${l} due to unbound types`,[n])}),Et([e,t,r],n?[n]:[],t=>{if(t=t[0],n)var r=t.qc,i=r.ed;else i=tt.prototype;t=rt(l,function(...e){if(Object.getPrototypeOf(this)!==o)throw new He(`Use 'new' to construct ${l}`);if(void 0===u.$c)throw new He(`${l} has no accessible constructor`);var t=u.$c[e.length];if(void 0===t)throw new He(`Tried to invoke ctor of ${l} with invalid number of parameters (${e.length}) - expected (${Object.keys(u.$c).toString()}) parameters instead!`);return t.apply(this,e)});var o=Object.create(i,{constructor:{value:t}});t.prototype=o;var c,u=new ot(l,t,o,h,r,a,s,d);return u.Hc&&((c=u.Hc).Rd??(c.Rd=[]),u.Hc.Rd.push(u)),r=new gt(l,u,!0,!1,!1),c=new gt(l+"*",u,!1,!1,!1),i=new gt(l+" const*",u,!1,!0,!1),nt[e]={pointerType:c,ue:i},wt(f,t),[r,c,i]})},cb:(e,t,r,n,i,a)=>{var o=xt(t,r);i=yt(n,i),Et([],[e],e=>{var r=`constructor ${(e=e[0]).name}`;if(void 0===e.qc.$c&&(e.qc.$c=[]),void 0!==e.qc.$c[t-1])throw new He(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.qc.$c[t-1]=()=>{$t(`Cannot construct ${e.name} due to unbound types`,o)},Et([],o,n=>(n.splice(1,0,null),e.qc.$c[t-1]=kt(r,n,null,i,a),[])),[]})},t:(e,t,r,n,i,a,o,s,c)=>{var d=xt(r,n);t=je(t),t=Rt(t),a=yt(i,a),Et([],[e],e=>{function n(){$t(`Cannot call ${i} due to unbound types`,d)}var i=`${(e=e[0]).name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.qc.Oe.push(t);var l=e.qc.ed,u=l[t];return void 0===u||void 0===u.Ec&&u.className!==e.name&&u.kd===r-2?(n.kd=r-2,n.className=e.name,l[t]=n):(it(l,t,i),l[t].Ec[r-2]=n),Et([],d,n=>(n=kt(i,n,e,a,o,c),void 0===l[t].Ec?(n.kd=r-2,l[t]=n):l[t].Ec[r-2]=n,[])),[]})},lb:e=>Je(e,Mt),ra:(e,t,r)=>{Je(e,{name:t=je(t),Gc:e=>e,Lc:(e,t)=>t,Wc:Gt(t,r),Mc:null})},Da:(e,t,r,n,i,a,o)=>{var s=xt(t,r);e=je(e),e=Rt(e),i=yt(n,i),at(e,function(){$t(`Cannot call ${e} due to unbound types`,s)},t-1),Et([],s,r=>(r=[r[0],null].concat(r.slice(1)),wt(e,kt(e,r,null,i,a,o),t-1),[]))},z:(e,t,r,n,i)=>{t=je(t);let a=e=>e;if(0===n){var o=32-8*r;a=e=>e<<o>>>o,i=a(i)}Je(e,{name:t,Gc:a,Lc:(e,t)=>t,Wc:Ke(t,r,0!==n),Mc:null})},o:(e,t,r)=>{function n(e){return new i(g.buffer,$[e+4>>2],$[e>>2])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];Je(e,{name:r=je(r),Gc:n,Wc:n},{Ee:!0})},nb:(e,t)=>{Je(e,{name:t=je(t),Gc(e){var t=j(e+4,$[e>>2],!0);return pn(e),t},Lc(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 He("Cannot pass non-string to std::string");var n=r?ee(t):t.length,i=mn(4+n+1),a=i+4;return $[i>>2]=n,r?te(t,w,a,n+1):w.set(t,a),null!==e&&e.push(pn,i),i},Wc:ht,Mc(e){pn(e)}})},X:(e,t,r)=>{if(r=je(r),2===t)var n=Nt,i=Vt,a=jt;else n=zt,i=Wt,a=qt;Je(e,{name:r,Gc:e=>{var r=n(e+4,$[e>>2]*t,!0);return pn(e),r},Lc:(e,n)=>{if("string"!=typeof n)throw new He(`Cannot pass non-string to C++ string type ${r}`);var o=a(n),s=mn(4+o+t);return $[s>>2]=o/t,i(n,s+4,o+t),null!==e&&e.push(pn,s),s},Wc:ht,Mc(e){pn(e)}})},aa:e=>{Je(e,Mt)},pb:(e,t)=>{Je(e,{ce:!0,name:t=je(t),Gc:()=>{},Lc:()=>{}})},tb:()=>{I=!1,Ht=0},rb:()=>{throw 1/0},C:(e,t,r)=>{var[n,...i]=((e,t)=>{for(var r=Array(e),n=0;n<e;++n){var i=n,a=$[t+4*n>>2],o=We[a];if(void 0===o)throw e=`parameter ${n} has unknown type ${_t(a)}`,new He(e);r[i]=o}return r})(e,t);t=n.Lc.bind(n);var a=i.map(e=>e.Wc.bind(e));e--;var o={toValue:Ft};switch(e=a.map((e,t)=>{var r=`argFromPtr${t}`;return o[r]=e,`${r}(args${t?"+"+8*t:""})`}),r){case 0:var s="toValue(handle)";break;case 2:s="new (toValue(handle))";break;case 3:s="";break;case 1:o.getStringOrSymbol=Qt,s="toValue(handle)[getStringOrSymbol(methodName)]"}return s+=`(${e})`,n.ce||(o.toReturnWire=t,o.emval_returnValue=Jt,s=`return emval_returnValue(toReturnWire, destructorsRef, ${s})`),s=`return function (handle, methodName, destructorsRef, args) {\n ${s}\n }`,r=new Function(Object.keys(o),s)(...Object.values(o)),s=`methodCaller<(${i.map(e=>e.name)}) => ${n.name}>`,(e=>{var t=Xt.length;return Xt.push(e),t})(rt(s,r))},jb:Ut,qb:e=>e?(e=Qt(e),Dt(globalThis[e])):Dt(globalThis),H:(e,t)=>(e=Ft(e),t=Ft(t),Dt(e[t])),ca:e=>{9<e&&(Lt[e+1]+=1)},A:(e,t,r,n,i)=>Xt[e](t,r,n,i),xb:e=>Dt(Qt(e)),Ua:e=>{var t=Ft(e);At(t),Ut(e)},ub:(e,t)=>{if(Yt[e]&&(clearTimeout(Yt[e].id),delete Yt[e]),!t)return 0;var r=setTimeout(()=>{delete Yt[e],er(()=>Rn(e,performance.now()))},t);return Yt[e]={id:r,Ef:t},0},vb:e=>{var t=w.length;if(2147483648<(e>>>=0))return!1;for(var r=1;4>=r;r*=2){var n=t*(1+.2/r);n=Math.min(n,e+100663296);e:{n=(Math.min(2147483648,65536*Math.ceil(Math.max(e,n)/65536))-Dn.buffer.byteLength+65535)/65536|0;try{Dn.grow(n),B();var i=1;break e}catch(e){}i=void 0}if(i)return!0}return!1},Ub:(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:pr[_[r+2]],failIfMajorPerformanceCaveat:!!g[t+12],de:_[r+4],sf:_[r+5],Zd:g[t+24],ye:g[t+25],yf:_[r+7],Bf:g[t+32]},!(e=vr(e))||t.ye?0:((e,t)=>{e.Jc||(e.Jc=e.getContext,e.getContext=function(t,r){return"webgl"==t==(r=e.Jc(t,r))instanceof WebGLRenderingContext?r:null});var r=e.getContext(1<t.de?"webgl2":"webgl",t);return r?((e,t)=>{var r=hr(lr),n={handle:r,attributes:t,version:t.de,cd:e};if(e.canvas&&(e.canvas.re=n),lr[r]=n,(void 0===t.Zd||t.Zd)&&((e=n)||(e=Ct),!e.Fe))for(var i of(e.Fe=!0,(t=e.cd).uf=t.getExtension("WEBGL_multi_draw"),t.hf=t.getExtension("EXT_polygon_offset_clamp"),t.gf=t.getExtension("EXT_clip_control"),t.If=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.ef=t.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"),t.qf=t.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"),2<=e.version&&(t.Xd=t.getExtension("EXT_disjoint_timer_query_webgl2")),(2>e.version||!t.Xd)&&(t.Xd=t.getExtension("EXT_disjoint_timer_query")),tr(t)))i.includes("lose_context")||i.includes("debug")||t.getExtension(i);for(n.Nd=n.cd.getParameter(34921),n.dd=[],i=0;i<n.Nd;i++)n.dd[i]={enabled:!1,td:!1,size:0,type:0,fe:0,stride:0,pc:0,oe:null};for(n.Zc=[],n.Cd=[],n.Zc.length=n.Cd.length=22,n.jd=[],n.qd=[],n.jd.length=n.qd.length=22,n.hd=[],n.hd.length=22,i=0;21>=i;++i){n.hd[i]=null,n.Zc[i]=n.Cd[i]=0,n.jd[i]=[],n.qd[i]=[],(e=n.jd[i]).length=(t=n.qd[i]).length=64;for(var a=0;64>a;++a)e[a]=t[a]=null}return r})(r,t):0})(e,t)},Ja:e=>{Ct==e&&(Ct=0),Ct===lr[e]&&(Ct=null),"object"==typeof JSEvents&&JSEvents.Af(lr[e].cd.canvas),lr[e]?.cd.canvas&&(lr[e].cd.canvas.re=void 0),lr[e]=null},kb:()=>Ct?Ct.handle:0,za:e=>(Ct=lr[e],r.ctx=Tt=Ct?.cd,!e||Tt?0:-5),Gb:function(e,t,r,n,i,a){t=nn(t),r=nn(r),e=br(e);var o={};if(a){var s=$[a+12>>2];if(s){var c=$[a+16>>2];o.requiredFeatures=Array.from($.subarray(c>>2,c+4*s>>2),e=>Ur[e])}var d=$[a+20>>2];if(d){var l={};function u(e,t,r=!1){4294967295==(t=$[d+t>>2])||r&&0==t||(l[e]=t)}function h(e,t){4294967295==$[(t=d+t)>>2]&&4294967295==$[t+4>>2]||(l[e]=4294967296*$[t+4>>2]+$[t>>2])}u("maxTextureDimension1D",4),u("maxTextureDimension2D",8),u("maxTextureDimension3D",12),u("maxTextureArrayLayers",16),u("maxBindGroups",20),u("maxBindGroupsPlusVertexBuffers",24),u("maxDynamicUniformBuffersPerPipelineLayout",32),u("maxDynamicStorageBuffersPerPipelineLayout",36),u("maxSampledTexturesPerShaderStage",40),u("maxSamplersPerShaderStage",44),u("maxStorageBuffersPerShaderStage",48),u("maxStorageTexturesPerShaderStage",52),u("maxUniformBuffersPerShaderStage",56),u("minUniformBufferOffsetAlignment",80),u("minStorageBufferOffsetAlignment",84),h("maxUniformBufferBindingSize",64),h("maxStorageBufferBindingSize",72),u("maxVertexBuffers",88),h("maxBufferSize",96),u("maxVertexAttributes",104),u("maxVertexBufferArrayStride",108),u("maxInterStageShaderVariables",112),u("maxColorAttachments",116),u("maxColorAttachmentBytesPerSample",120),u("maxComputeWorkgroupStorageSize",124),u("maxComputeInvocationsPerWorkgroup",128),u("maxComputeWorkgroupSizeX",132),u("maxComputeWorkgroupSizeY",136),u("maxComputeWorkgroupSizeZ",140),u("maxComputeWorkgroupsPerDimension",144),u("maxImmediateSize",148,!0),o.requiredLimits=l}(s=$[a+24>>2])&&(s={label:$r(s+4)},o.defaultQueue=s),o.label=$r(a+4)}e.requestDevice(o).then(e=>{er(()=>{wr[i>>>0]=e.queue,wr[n>>>0]=e,e.lost.then(t=>{er(()=>{e.onuncapturederror=()=>{};var n=Fn(),i=gr(t.message);Tn(r,rn[t.reason],i),Ln(n)})}),e.onuncapturederror=e=>{var t=5;e.error instanceof GPUValidationError?t=2:e.error instanceof GPUOutOfMemoryError?t=3:e.error instanceof GPUInternalError&&(t=4);var r=Fn();e=gr(e.error.message),On(n,t,e),Ln(r)},Cn(t,1,n,0)})},e=>{er(()=>{var i=Fn(),a=gr(e.message);Cn(t,3,n,a),r&&Tn(r,4,a),Ln(i)})})},Ib:e=>{var t=br(e),r=yr[e];if(r){for(var n=0;n<r.length;++n)r[n]();delete yr[e]}t.destroy()},h:e=>{delete wr[e]},Fb:(e,t,r)=>{var n=!!$[t+32>>2];t={label:$r(t+4),usage:$[t+16>>2],size:4294967296*$[t+4+24>>2]+$[t+24>>2],mappedAtCreation:n},e=br(e);try{var i=e.createBuffer(t)}catch(e){return!1}return wr[r>>>0]=i,n&&(yr[r]=[]),!0},Eb:(e,t,r)=>{var n=$[t>>2],i=$[n+4>>2];t={label:$r(t+4),code:""},2===i&&(t.code=_r(n+8)),e=br(e).createShaderModule(t),wr[r>>>0]=e},Hb:e=>{(e=br(e)).onuncapturederror=null,e.destroy()},Db:function(e,t,r,n){if(t=nn(t),r){var i={featureLevel:Lr[$[r+4>>2]],powerPreference:Nr[$[r+8>>2]],forceFallbackAdapter:!!$[r+12>>2]};0!==(e=$[r>>2])&&(i.Jf=!!$[e+8>>2])}"gpu"in navigator?navigator.gpu.requestAdapter(i).then(e=>{er(()=>{if(e)wr[n>>>0]=e,Pn(t,1,n,0);else{var r=Fn(),i=gr("WebGPU not available on this browser (requestAdapter returned null)");Pn(t,3,n,i),Ln(r)}})},e=>{er(()=>{var r=Fn(),i=gr(e.message);Pn(t,4,n,i),Ln(r)})}):(i=Fn(),e=gr("WebGPU not available on this browser (navigator.gpu is not available)"),Pn(t,3,n,e),Ln(i))},va:function(e){try{var t=Re(e);return Ne.close(t),0}catch(e){if(void 0===Ne||"ErrnoError"!==e.name)throw e;return e.Nc}},zb:function(e,t,r,n){try{e:{var i=Re(e);e=t;for(var a,o=t=0;o<r;o++){var s=$[e>>2],c=$[e+4>>2];e+=8;var d=Ne.read(i,g,s,c,a);if(0>d){var l=-1;break e}if(t+=d,d<c)break;void 0!==a&&(a+=d)}l=t}return $[n>>2]=l,0}catch(e){if(void 0===Ne||"ErrnoError"!==e.name)throw e;return e.Nc}},wb:function(e,t,r,n){t=nn(t);try{if(isNaN(t))return 61;var i=Re(e);return Ne.Ic(i,t,r),A[n>>3]=BigInt(i.position),i.Hd&&0===t&&0===r&&(i.Hd=null),0}catch(e){if(void 0===Ne||"ErrnoError"!==e.name)throw e;return e.Nc}},yb:function(e,t,r,n){try{e:{var i=Re(e);e=t;for(var a,o=t=0;o<r;o++){var s=$[e>>2],c=$[e+4>>2];e+=8;var d=Ne.write(i,g,s,c,a);if(0>d){var l=-1;break e}if(t+=d,d<c)break;void 0!==a&&(a+=d)}l=t}return $[n>>2]=l,0}catch(e){if(void 0===Ne||"ErrnoError"!==e.name)throw e;return e.Nc}},Qa:e=>Tt.activeTexture(e),oa:(e,t)=>{Tt.attachShader(ir[e],cr[t])},q:(e,t)=>{if(t&&!nr[t]){var r=Tt.createBuffer();r.name=t,nr[t]=r}34962==e?Tt.ud=t:34963==e&&(Tt.ld=t),35051==e?Tt.Ud=t:35052==e&&(Tt.Dd=t),Tt.bindBuffer(e,nr[t])},Oa:(e,t,r,n,i)=>{Tt.bindBufferRange(e,t,nr[r],n,i)},f:(e,t)=>{Tt.bindFramebuffer(e,ar[t])},U:(e,t)=>{Tt.bindRenderbuffer(e,or[t])},L:(e,t)=>{Tt.bindTexture(e,sr[t])},qa:e=>{Tt.bindVertexArray(dr[e]),e=Tt.getParameter(34965),Tt.ld=e?0|e.name:0},B:(e,t)=>Tt.blendFunc(e,t),x:(e,t,r,n,i,a,o,s,c,d)=>Tt.blitFramebuffer(e,t,r,n,i,a,o,s,c,d),V:(e,t,r,n)=>{2<=Ct.version?r&&t?Tt.bufferData(e,w,n,r,t):Tt.bufferData(e,t,n):Tt.bufferData(e,r?w.subarray(r,r+t):t,n)},S:e=>Tt.clear(e),T:(e,t,r,n)=>Tt.clearColor(e,t,r,n),La:e=>Tt.clearDepth(e),Ma:e=>Tt.clearStencil(e),E:(e,t,r,n)=>{Tt.colorMask(!!e,!!t,!!r,!!n)},Ga:e=>{Tt.compileShader(cr[e])},eb:()=>{var e=hr(ir),t=Tt.createProgram();return t.name=e,t.Ad=t.yd=t.zd=0,t.Qd=1,ir[e]=t,e},Ia:e=>{var t=hr(cr);return cr[t]=Tt.createShader(e),t},_a:e=>Tt.cullFace(e),hb:(e,t)=>{for(var r=0;r<e;r++){var n=_[t+4*r>>2],i=nr[n];i&&(Tt.deleteBuffer(i),i.name=0,nr[n]=null,n==Tt.ud&&(Tt.ud=0),n==Tt.ld&&(Tt.ld=0),n==Tt.Ud&&(Tt.Ud=0),n==Tt.Dd&&(Tt.Dd=0))}},fa:(e,t)=>{for(var r=0;r<e;++r){var n=_[t+4*r>>2],i=ar[n];i&&(Tt.deleteFramebuffer(i),i.name=0,ar[n]=null)}},ma:e=>{if(e){var t=ir[e];t?(Tt.deleteProgram(t),t.name=0,ir[e]=null):Pt||=1281}},ea:(e,t)=>{for(var r=0;r<e;r++){var n=_[t+4*r>>2],i=or[n];i&&(Tt.deleteRenderbuffer(i),i.name=0,or[n]=null)}},R:e=>{if(e){var t=cr[e];t?(Tt.deleteShader(t),cr[e]=null):Pt||=1281}},W:(e,t)=>{for(var r=0;r<e;r++){var n=_[t+4*r>>2],i=sr[n];i&&(Tt.deleteTexture(i),i.name=0,sr[n]=null)}},fb:(e,t)=>{for(var r=0;r<e;r++){var n=_[t+4*r>>2];Tt.deleteVertexArray(dr[n]),dr[n]=null}},Ya:e=>Tt.depthFunc(e),O:e=>{Tt.depthMask(!!e)},y:e=>Tt.disable(e),da:e=>{Ct.dd[e].enabled=!1,Tt.disableVertexAttribArray(e)},Na:(e,t,r,n)=>{var i=0;if(!Tt.ld){var a=1*ur[r-5120]*t,o=(e=>{e=32-Math.clz32(0===e?0:e-1);var t=Ct.hd[e];return t||(t=Tt.getParameter(34965),Ct.hd[e]=Tt.createBuffer(),Tt.bindBuffer(34963,Ct.hd[e]),Tt.bufferData(34963,1<<e,35048),Tt.bindBuffer(34963,t),Ct.hd[e])})(a);if(Tt.bindBuffer(34963,o),Tt.bufferSubData(34963,0,w.subarray(n,n+a)),0<t)for(o=0;o<Ct.Nd;++o)if((a=Ct.dd[o]).td&&a.enabled){switch(r){case 5121:i=Uint8Array;break;case 5123:i=Uint16Array;break;case 5125:i=Uint32Array;break;default:return void(Pt||=1282)}i=new i(w.buffer,n,t).reduce((e,t)=>Math.max(e,t))+1;break}n=0}(e=>{Ot=!1;for(var t=0;t<Ct.Nd;++t){var r=Ct.dd[t];if(r.td&&r.enabled){Ot=!0;var n=r.size,i=r.type,a=r.stride;n=0<a?e*a:n*ur[i-5120]*e,i=32-Math.clz32(0===n?0:n-1),a=Ct.jd[i];var o=Ct.Zc[i];Ct.Zc[i]=Ct.Zc[i]+1&63;var s=a[o];s?i=s:(s=Tt.getParameter(34964),a[o]=Tt.createBuffer(),Tt.bindBuffer(34962,a[o]),Tt.bufferData(34962,1<<i,35048),Tt.bindBuffer(34962,s),i=a[o]),Tt.bindBuffer(34962,i),Tt.bufferSubData(34962,0,w.subarray(r.pc,r.pc+n)),r.oe.call(Tt,t,r.size,r.type,r.fe,r.stride,0)}}})(i),Tt.drawElements(e,t,r,n),Ot&&Tt.bindBuffer(34962,nr[Tt.ud]),Tt.ld||Tt.bindBuffer(34963,null)},u:e=>Tt.enable(e),Sa:e=>{Ct.dd[e].enabled=!0,Tt.enableVertexAttribArray(e)},ga:(e,t,r,n)=>{Tt.framebufferRenderbuffer(e,t,r,or[n])},Xa:(e,t,r,n,i)=>{Tt.framebufferTexture2D(e,t,r,sr[n],i)},Za:e=>Tt.frontFace(e),ib:(e,t)=>{fr(e,t,"createBuffer",nr)},ja:(e,t)=>{fr(e,t,"createFramebuffer",ar)},ia:(e,t)=>{fr(e,t,"createRenderbuffer",or)},ka:(e,t)=>{fr(e,t,"createTexture",sr)},gb:(e,t)=>{fr(e,t,"createVertexArray",dr)},pa:(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=Tt.getParameter(34467);r=n?n.length:0;break;case 33309:if(2>Ct.version)return void(Pt||=1282);r=(()=>{var e=tr(Tt);return e.concat(e.map(e=>"GL_"+e))})().length;break;case 33307:case 33308:if(2>Ct.version)return void(Pt||=1280);r=33307==e?3:0}if(void 0===r)switch(n=Tt.getParameter(e),typeof n){case"number":r=n;break;case"boolean":r=n?1:0;break;case"string":return void(Pt||=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(Pt||=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 Pt||=1280,void P(`GL_INVALID_ENUM in glGet0v: Unknown object returned from WebGL getParameter(${e})! (error: ${t})`)}}break;default:return Pt||=1280,void P(`GL_INVALID_ENUM in glGet0v: Native code calling glGet0v(${e}) and it returns ${n} of type ${typeof n}!`)}_[t>>2]=r}else Pt||=1281})(e,t),bb:(e,t,r,n)=>{null===(e=Tt.getProgramInfoLog(ir[e]))&&(e="(unknown error)"),t=0<t&&n?te(e,w,n,t):0,r&&(_[r>>2]=t)},na:(e,t,r)=>{if(r)if(e>=rr)Pt||=1281;else if(e=ir[e],35716==t)null===(e=Tt.getProgramInfoLog(e))&&(e="(unknown error)"),_[r>>2]=e.length+1;else if(35719==t){if(!e.Ad){var n=Tt.getProgramParameter(e,35718);for(t=0;t<n;++t)e.Ad=Math.max(e.Ad,Tt.getActiveUniform(e,t).name.length+1)}_[r>>2]=e.Ad}else if(35722==t){if(!e.yd)for(n=Tt.getProgramParameter(e,35721),t=0;t<n;++t)e.yd=Math.max(e.yd,Tt.getActiveAttrib(e,t).name.length+1);_[r>>2]=e.yd}else if(35381==t){if(!e.zd)for(n=Tt.getProgramParameter(e,35382),t=0;t<n;++t)e.zd=Math.max(e.zd,Tt.getActiveUniformBlockName(e,t).length+1);_[r>>2]=e.zd}else _[r>>2]=Tt.getProgramParameter(e,t);else Pt||=1281},Fa:(e,t,r,n)=>{null===(e=Tt.getShaderInfoLog(cr[e]))&&(e="(unknown error)"),t=0<t&&n?te(e,w,n,t):0,r&&(_[r>>2]=t)},ba:(e,t,r)=>{r?35716==t?(null===(e=Tt.getShaderInfoLog(cr[e]))&&(e="(unknown error)"),_[r>>2]=e?e.length+1:0):35720==t?(e=Tt.getShaderSource(cr[e]),_[r>>2]=e?e.length+1:0):_[r>>2]=Tt.getShaderParameter(cr[e],t):Pt||=1281},p:(e,t)=>Tt.getUniformBlockIndex(ir[e],j(t)),n:(e,t)=>{if(t=j(t),e=ir[e]){var r,n=e,i=n.rd,a=n.ne;if(!i){n.rd=i={},n.me={};var o=Tt.getProgramParameter(n,35718);for(r=0;r<o;++r){var s=Tt.getActiveUniform(n,r),c=s.name;s=s.size;var d=an(c);d=0<d?c.slice(0,d):c;var l=n.Qd;for(n.Qd+=s,a[d]=[s,l],c=0;c<s;++c)i[l]=c,n.me[l++]=d}}if(n=e.rd,i=0,a=t,0<(r=an(t))&&(i=parseInt(t.slice(r+1))>>>0,a=t.slice(0,r)),(a=e.ne[a])&&i<a[0]&&(n[i+=a[1]]=n[i]||Tt.getUniformLocation(e,t)))return i}else Pt||=1281;return-1},Ka:(e,t,r)=>{for(var n=on[t],i=0;i<t;i++)n[i]=_[r+4*i>>2];Tt.invalidateFramebuffer(e,n)},db:e=>{Tt.linkProgram(e=ir[e]),e.rd=0,e.ne={}},ha:(e,t,r,n,i)=>Tt.renderbufferStorageMultisample(e,t,r,n,i),r:(e,t,r,n)=>Tt.scissor(e,t,r,n),Ha:(e,t,r,n)=>{for(var i="",a=0;a<t;++a)i+=j($[r+4*a>>2],n?$[n+4*a>>2]:void 0);Tt.shaderSource(cr[e],i)},Q:(e,t,r)=>Tt.stencilFunc(e,t,r),G:(e,t,r,n)=>Tt.stencilFuncSeparate(e,t,r,n),P:(e,t,r)=>Tt.stencilOp(e,t,r),F:(e,t,r,n)=>Tt.stencilOpSeparate(e,t,r,n),la:(e,t,r,n,i,a,o,s,c)=>{if(2<=Ct.version){if(Tt.Dd)return void Tt.texImage2D(e,t,r,n,i,a,o,s,c);if(c){var d=sn(s);return c>>>=31-Math.clz32(d.BYTES_PER_ELEMENT),void Tt.texImage2D(e,t,r,n,i,a,o,s,d,c)}}if(c){d=sn(s);var l=i*(n*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[o-6402]||1)*d.BYTES_PER_ELEMENT+4-1&-4);c=d.subarray(c>>>31-Math.clz32(d.BYTES_PER_ELEMENT),c+l>>>31-Math.clz32(d.BYTES_PER_ELEMENT))}else c=null;Tt.texImage2D(e,t,r,n,i,a,o,s,c)},D:(e,t,r)=>Tt.texParameteri(e,t,r),Wa:(e,t)=>{Tt.uniform1f(cn(e),t)},$a:(e,t,r)=>{if(2<=Ct.version)t&&Tt.uniform1iv(cn(e),_,r>>2,t);else{if(288>=t)for(var n=dn[t],i=0;i<t;++i)n[i]=_[r+4*i>>2];else n=_.subarray(r>>2,r+4*t>>2);Tt.uniform1iv(cn(e),n)}},Pa:(e,t,r)=>{Tt.uniformBlockBinding(e=ir[e],t,r)},Va:(e,t,r,n)=>{if(2<=Ct.version)t&&Tt.uniformMatrix3fv(cn(e),!!r,E,n>>2,9*t);else{if(32>=t)for(var i=ln[t*=9],a=0;a<t;a+=9)i[a]=E[n+4*a>>2],i[a+1]=E[n+(4*a+4)>>2],i[a+2]=E[n+(4*a+8)>>2],i[a+3]=E[n+(4*a+12)>>2],i[a+4]=E[n+(4*a+16)>>2],i[a+5]=E[n+(4*a+20)>>2],i[a+6]=E[n+(4*a+24)>>2],i[a+7]=E[n+(4*a+28)>>2],i[a+8]=E[n+(4*a+32)>>2];else i=E.subarray(n>>2,n+36*t>>2);Tt.uniformMatrix3fv(cn(e),!!r,i)}},ab:e=>{Tt.useProgram(e=ir[e]),Tt.ve=e},Ta:(e,t,r,n,i)=>Tt.vertexAttrib4f(e,t,r,n,i),Ra:(e,t,r,n,i,a)=>{var o=Ct.dd[e];Tt.ud?(o.td=!1,Tt.vertexAttribPointer(e,t,r,!!n,i,a)):(o.size=t,o.type=r,o.fe=n,o.stride=i,o.pc=a,o.td=!0,o.oe=function(e,t,r,n,i,a){this.vertexAttribPointer(e,t,r,n,i,a)})},s:(e,t,r,n)=>Tt.viewport(e,t,r,n),v:function(e,t){var r=Fn();try{return Mn.get(e)(t)}catch(e){if(Ln(r),e!==e+0)throw e;Bn(1,0)}},j:function(e,t,r){var n=Fn();try{return Mn.get(e)(t,r)}catch(e){if(Ln(n),e!==e+0)throw e;Bn(1,0)}},g:function(e,t,r,n){var i=Fn();try{return Mn.get(e)(t,r,n)}catch(e){if(Ln(i),e!==e+0)throw e;Bn(1,0)}},ua:function(e,t,r,n,i,a){var o=Fn();try{return Mn.get(e)(t,r,n,i,a)}catch(e){if(Ln(o),e!==e+0)throw e;Bn(1,0)}},ta:function(e){var t=Fn();try{Mn.get(e)()}catch(e){if(Ln(t),e!==e+0)throw e;Bn(1,0)}},b:function(e,t){var r=Fn();try{Mn.get(e)(t)}catch(e){if(Ln(r),e!==e+0)throw e;Bn(1,0)}},c:function(e,t,r){var n=Fn();try{Mn.get(e)(t,r)}catch(e){if(Ln(n),e!==e+0)throw e;Bn(1,0)}},m:function(e,t,r,n){var i=Fn();try{Mn.get(e)(t,r,n)}catch(e){if(Ln(i),e!==e+0)throw e;Bn(1,0)}},I:function(e,t,r,n,i){var a=Fn();try{Mn.get(e)(t,r,n,i)}catch(e){if(Ln(a),e!==e+0)throw e;Bn(1,0)}},sb:Zt,N:function(e){return BigInt(br(e).size)},_:(e,t)=>{var r=$[t>>2],n=void 0;0!==r&&(n=4294967296*$[r+12>>2]+$[r+8>>2]),r=$r(t+4);for(var i=$[t+12>>2],a=$[t+16>>2],o=[],s=0;s<i;++s){var c=o,d=c.push,l=a+56*s,u=$[l+4>>2];if(0!==u){var h=_[l+8>>2];-1==h&&(h=void 0);var f=l+24;f={r:x[f>>3],g:x[f+8>>3],b:x[f+16>>3],a:x[f+24>>3]},l={view:br(u),depthSlice:h,resolveTarget:br($[l+12>>2]),clearValue:f,loadOp:Gr[$[l+16>>2]],storeOp:Hr[$[l+20>>2]]}}else l=void 0;d.call(c,l)}return i=0!==(i=$[t+20>>2])?{view:br($[i+4>>2]),depthClearValue:E[i+16>>2],depthLoadOp:Gr[$[i+8>>2]],depthStoreOp:Hr[$[i+12>>2]],depthReadOnly:!!$[i+20>>2],stencilClearValue:$[i+32>>2],stencilLoadOp:Gr[$[i+24>>2]],stencilStoreOp:Hr[$[i+28>>2]],stencilReadOnly:!!$[i+36>>2]}:void 0,a=0!==(a=$[t+28>>2])?{querySet:br($[a+4>>2]),beginningOfPassWriteIndex:$[a+8>>2],endOfPassWriteIndex:$[a+12>>2]}:void 0,t={label:r,colorAttachments:o,depthStencilAttachment:i,occlusionQuerySet:br($[t+24>>2]),timestampWrites:a,maxDrawCount:n},n=br(e),e=$n(0),t=n.beginRenderPass(t),wr[e>>>0]=t,e},Nb:(e,t,r,n)=>{br(e).copyTextureToTexture(xr(t),xr(r),Er(n))},Pb:e=>{var t=br(e);return e=yn(0),t=t.finish(),wr[e>>>0]=t,e},K:(e,t)=>{var r=$r(t+4),n=br($[t+12>>2]),i=$[t+16>>2];t=$[t+20>>2];for(var a=[],o=0;o<i;++o){var s=a,c=s.push,d=t+40*o,l=$[d+8>>2],u=$[d+32>>2],h=$[d+36>>2],f=$[d+4>>2];l?(-1==(u=$[(u=d+24)>>2]+4294967296*_[u+4>>2])&&(u=void 0),d={binding:f,resource:{buffer:br(l),offset:4294967296*$[d+4+16>>2]+$[d+16>>2],size:u}}):d=u?{binding:f,resource:br(u)}:{binding:f,resource:br(h)},c.call(s,d)}return r={label:r,layout:n,entries:a},n=br(e),e=gn(0),r=n.createBindGroup(r),wr[e>>>0]=r,e},w:(e,t)=>{var r=$r(t+4),n=$[t+12>>2];t=$[t+16>>2];for(var i=[],a=0;a<n;++a){var o=t+88*a,s=$[o+4>>2],c=$[o+8>>2],d=o+24,l=$[d+4>>2];d=l?{type:Cr[l],hasDynamicOffset:!!$[d+8>>2],minBindingSize:4294967296*$[d+4+16>>2]+$[d+16>>2]}:void 0,l=(l=$[o+48+4>>2])?{type:zr[l]}:void 0;var u=o+56,h=$[u+4>>2];u=h?{sampleType:Qr[h],viewDimension:Yr[$[u+8>>2]],multisampled:!!$[u+12>>2]}:void 0,o=(h=$[(o+=72)+4>>2])?{access:qr[h],format:Kr[$[o+8>>2]],viewDimension:Yr[$[o+12>>2]]}:void 0,i.push.call(i,{binding:s,visibility:c,buffer:d,sampler:l,texture:u,storageTexture:o})}return r={label:r,entries:i},n=br(e),e=wn(0),r=n.createBindGroupLayout(r),wr[e>>>0]=r,e},Qb:(e,t)=>{var r;return t&&(r={label:$r(t+4)}),t=br(e),e=bn(0),r=t.createCommandEncoder(r),wr[e>>>0]=r,e},Ob:(e,t)=>{for(var r=$[t+12>>2],n=$[t+16>>2],i=[],a=0;a<r;++a)i.push(br($[n+4*a>>2]));return t={label:$r(t+4),bindGroupLayouts:i},r=br(e),e=_n(0),t=r.createPipelineLayout(t),wr[e>>>0]=t,e},k:(e,t)=>{t=(e=>{function t(e){if(e)return{operation:Pr[$[e>>2]],srcFactor:Tr[$[e+4>>2]],dstFactor:Tr[$[e+8>>2]]}}function r(e){return{compare:Or[$[e>>2]],failOp:Wr[$[e+4>>2]],depthFailOp:Wr[$[e+8>>2]],passOp:Wr[$[e+12>>2]]}}return{label:$r(e+4),layout:Sr($[e+12>>2]),vertex:function(e){if(e){var t=br($[e+4>>2]),r=Ar($[e+16>>2],$[e+20>>2]),n=$[e+24>>2],i=$[e+28>>2];if(n){for(var a=[],o=0;o<n;++o){var s=a,c=s.push,d=i+24*o;if(d){var l=$[d+4>>2],u=$[d+16>>2];if(0===l&&0===u)var h=null;else{h=4294967296*$[d+4+8>>2]+$[d+8>>2],l=tn[l],d=$[d+20>>2];for(var f=[],p=0;p<u;++p){var m=d+24*p;f.push.call(f,m={format:en[$[m+4>>2]],offset:4294967296*$[m+4+8>>2]+$[m+8>>2],shaderLocation:$[m+16>>2]})}h={arrayStride:h,stepMode:l,attributes:f}}}else h=void 0;c.call(s,h)}n=a}else n=void 0;return{module:t,constants:r,buffers:n,entryPoint:$r(e+8)}}}(e+16),primitive:function(e){if(e)return{topology:jr[$[e+4>>2]],stripIndexFormat:Mr[$[e+8>>2]],frontFace:Dr[$[e+12>>2]],cullMode:Br[$[e+16>>2]],unclippedDepth:!!$[e+20>>2]}}(e+48),depthStencil:function(e){if(e)return{format:Kr[$[e+4>>2]],depthWriteEnabled:!!$[e+8>>2],depthCompare:Or[$[e+12>>2]],stencilFront:r(e+16),stencilBack:r(e+32),stencilReadMask:$[e+48>>2],stencilWriteMask:$[e+52>>2],depthBias:_[e+56>>2],depthBiasSlopeScale:E[e+60>>2],depthBiasClamp:E[e+64>>2]}}($[e+72>>2]),multisample:function(e){if(e)return{count:$[e+4>>2],mask:$[e+8>>2],alphaToCoverageEnabled:!!$[e+12>>2]}}(e+76),fragment:function(e){if(e){for(var r=br($[e+4>>2]),n=Ar($[e+16>>2],$[e+20>>2]),i=$[e+24>>2],a=$[e+28>>2],o=[],s=0;s<i;++s){var c=o,d=c.push,l=a+24*s,u=$[l+4>>2];if(0===u)l=void 0;else{u=Kr[u];var h=(h=$[l+8>>2])?{alpha:t(h+12),color:t(h+0)}:void 0;l={format:u,blend:h,writeMask:$[l+16>>2]}}d.call(c,l)}return{module:r,constants:n,targets:o,entryPoint:$r(e+8)}}}($[e+92>>2])}})(t);var r=br(e);return e=En(0),t=r.createRenderPipeline(t),wr[e>>>0]=t,e},Ea:(e,t)=>{var r;return t&&(r={label:$r(t+4),addressModeU:kr[$[t+12>>2]],addressModeV:kr[$[t+16>>2]],addressModeW:kr[$[t+20>>2]],magFilter:Fr[$[t+24>>2]],minFilter:Fr[$[t+28>>2]],mipmapFilter:Ir[$[t+32>>2]],lodMinClamp:E[t+36>>2],lodMaxClamp:E[t+40>>2],compare:Or[$[t+44>>2]],maxAnisotropy:b[t+48>>1]}),t=br(e),e=xn(0),r=t.createSampler(r),wr[e>>>0]=r,e},$:(e,t)=>{var r={label:$r(t+4),size:Er(t+28),mipLevelCount:$[t+44>>2],sampleCount:$[t+48>>2],dimension:Jr[$[t+24>>2]],format:Kr[$[t+40>>2]],usage:$[t+16>>2]},n=$[t+52>>2];return n&&(t=$[t+56>>2],r.viewFormats=Array.from(_.subarray(t>>2,t+4*n>>2),e=>Kr[e])),e=br(e),((e,t)=>{wr[e>>>0]=t})(n=Sn(0),e.createTexture(r)),n},Mb:(e,t)=>(e=vr($[$[t>>2]+8>>2]).getContext("webgpu"))?(e.Df=$r(t+4),t=An(0),wr[t>>>0]=e,t):0,ya:(e,t,r)=>{e=br(e),t=Array.from(_.subarray(r>>2,r+4*t>>2),e=>br(e)),e.submit(t)},J:function(e,t,r,n,i){r=nn(r),br(e).writeBuffer(br(t),r,w.subarray(n,n+i),0,i)},Aa:(e,t,r,n,i,a)=>{var o=$[i+8>>2],s=$[i+12>>2];br(e).writeTexture(xr(t),w.subarray(r,r+n),{offset:4294967296*$[i+4>>2]+$[i>>2],bytesPerRow:4294967295===o?void 0:o,rowsPerImage:4294967295===s?void 0:s},Er(a))},Y:(e,t,r,n,i,a)=>{br(e).drawIndexed(t,r,n>>>0,i,a>>>0)},xa:e=>{br(e).end()},d:(e,t,r,n,i)=>{e=br(e),r=br(r),0==n?e.setBindGroup(t,r):e.setBindGroup(t,r,$,i>>2,n)},Z:function(e,t,r,n,i){n=nn(n),i=nn(i),e=br(e),t=br(t),-1==i&&(i=void 0),e.setIndexBuffer(t,Mr[r],n,i)},e:(e,t)=>{br(e).setPipeline(br(t))},l:(e,t,r,n,i)=>{br(e).setScissorRect(t,r,n,i)},i:(e,t)=>{br(e).setStencilReference(t>>>0)},M:function(e,t,r,n,i){n=nn(n),i=nn(i),e=br(e),r=br(r),-1==i&&(i=void 0),e.setVertexBuffer(t,r,n,i)},Kb:(e,t)=>{var r=$[t+4>>2];e=br(e);var n=[$[t+24>>2],$[t+28>>2]];if(0!==n[0]&&(e.canvas.width=n[0]),0!==n[1]&&(e.canvas.height=n[1]),r={device:br(r),format:Kr[$[t+8>>2]],usage:$[t+16>>2],alphaMode:Rr[$[t+40>>2]]},n=$[t+32>>2]){var i=$[t+36>>2];r.viewFormats=Array.from(_.subarray(i>>2,i+4*n>>2),e=>Kr[e])}0!==(t=$[t>>2])&&(r.colorSpace=Vr[$[t+8>>2]],r.Ff={mode:Zr[$[t+12>>2]]}),e.configure(r)},Jb:(e,t)=>{e=br(e);try{var r=Sn(0),n=e.getCurrentTexture();wr[r>>>0]=n,$[t+4>>2]=r,_[t+8>>2]=1}catch(e){$[t+4>>2]=0,_[t+8>>2]=6}},Lb:e=>{br(e).unconfigure()},Sb:(e,t)=>{if(t){var r=$[t+24>>2],n=$[t+32>>2];r={label:$r(t+4),format:Kr[$[t+12>>2]],dimension:Yr[$[t+16>>2]],baseMipLevel:$[t+20>>2],mipLevelCount:4294967295===r?void 0:r,baseArrayLayer:$[t+28>>2],arrayLayerCount:4294967295===n?void 0:n,aspect:Xr[$[t+36>>2]]}}return t=br(e),e=kn(0),t=t.createView(r),wr[e>>>0]=t,e},Rb:e=>{br(e).destroy()},Tb:e=>Kr.indexOf(br(e).format),Ba:e=>br(e).height,Ca:e=>br(e).width};return Gn=await async function(){function e(e){return e=Gn=e.exports,pn=e.Xb,mn=e.Yb,vn=e.Zb,gn=e._b,wn=e.$b,yn=e.ac,bn=e.bc,_n=e.ec,$n=e.ic,En=e.jc,xn=e.kc,An=e.lc,Sn=e.mc,kn=e.nc,Tn=e.tc,Pn=e.uc,Cn=e.vc,On=e.wc,Rn=e.yc,Bn=e.zc,Ln=e.Ac,Un=e.Bc,Fn=e.Cc,Dn=e.Vb,Mn=e.xc,B(),Gn}var t={a:In};return r.instantiateWasm?new Promise(n=>{r.instantiateWasm(t,(t,r)=>{n(e(t))})}):(k??=r.locateFile?r.locateFile?r.locateFile("thorvg.wasm",u):u+"thorvg.wasm":new URL("thorvg.wasm",import.meta.url).href,e((await async function(e){var t=k;if(!f&&!O(t)&&!a)try{var r=fetch(t,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(r,e)}catch(e){P(`wasm streaming compile failed: ${e}`),P("falling back to ArrayBuffer instantiation")}return async function(e,t){try{var r=await async function(e){if(!f)try{var t=await s(e);return new Uint8Array(t)}catch{}if(e==k&&f)e=new Uint8Array(f);else{if(!c)throw"both async and sync fetching of the wasm failed";e=c(e)}return e}(e);return await WebAssembly.instantiate(r,t)}catch(e){P(`failed to asynchronously prepare wasm: ${e}`),L(e)}}(t,e)}(t)).instance))}(),function e(){function t(){if(r.calledRun=!0,!C){if(R=!0,r.noFSInit||Ne.Id||ve(),Gn.Wb(),Ne.be=!1,m?.(r),r.onRuntimeInitialized?.(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var e=r.postRun.shift();D.push(e)}F(D)}}if(0<le)ue=e;else{if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)G();F(M),0<le?ue=e:r.setStatus?(r.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>r.setStatus(""),1),t()},1)):t()}}(),t=R?r:new Promise((e,t)=>{m=e,v=t}),t}({locateFile:(e,t)=>e.endsWith(".wasm")?this.wasmUrl||"https://unpkg.com/@thorvg/lottie-player@latest/dist/thorvg.wasm":t+e})),!this._timer)return;clearInterval(this._timer),this._timer=void 0;const e=this.config?.renderer||"sw";if(await(async e=>{if("wg"===e){for(;"requested"===ve;)await me(100);if("initialized"!==ve&&(ve="requested",le))for(;;)switch(le.init()){case 0:return void(ve="initialized");case 1:return void(ve="failed");case 2:await me(100)}}})(e),"failed"===ve)return this.currentState="error",void this.dispatchEvent(new CustomEvent("error"));this.TVG=new le.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,d=this.canvas.height;e<0&&(o=Math.abs(e),c-=o),r<0&&(s=Math.abs(r),d-=s),t>i&&(c-=t-i),n>a&&(d-=n-a),this.TVG.viewport(o,s,c,d)}_observerCallback(e){const t=e[0],r=t.target;r._observable=t.isIntersecting,t.isIntersecting?"frozen"===r.currentState&&r.play():"playing"===r.currentState&&(r.freeze(),r.dispatchEvent(new CustomEvent("freeze")))}firstUpdated(e){this.canvas=this.querySelector(".thorvg"),this.canvas.id=`thorvg-${Date.now().toString(36)+Math.random().toString(36).substring(2)}`,this.canvas.width=this.canvas.offsetWidth,this.canvas.height=this.canvas.offsetHeight,this._observer=new IntersectionObserver(this._observerCallback),this._observer.observe(this),this.TVG?this.src&&this.load(this.src,this.fileType):this._timer=setInterval(this._init.bind(this),100)}createRenderRoot(){return this.style.display="block",this}async _animLoop(){this.TVG&&await this._update()&&(this._render(),window.requestAnimationFrame(this._animLoop.bind(this)))}_loadBytes(e){if(!this.TVG)throw new Error("TVG is not initialized");if(this._assetResolverCallback&&this.TVG.setAssetResolver(this._assetResolverCallback,this._assetResolverData),!this.TVG.load(e,this.fileType,this.canvas.width,this.canvas.height))throw new Error(`Unable to load an image. Error: ${this.TVG.error()}`);this._render(),this.dispatchEvent(new CustomEvent("load")),this.autoPlay&&this.play()}_flush(){this.canvas.getContext("2d").putImageData(this._imageData,0,0)}_render(){if(!this.TVG)return;if(!1!==this.config?.enableDevicePixelRatio){const e=1+.75*(window.devicePixelRatio-1),{width:t,height:r}=this.canvas.getBoundingClientRect();this.canvas.width=t*e,this.canvas.height=r*e}if(this.TVG.resize(this.canvas.width,this.canvas.height),this._viewport(),!this.TVG.update())return;if("wg"===this.config?.renderer||"gl"===this.config?.renderer)return void this.TVG.render();const e=this.TVG.render(),t=new Uint8ClampedArray(e,0,e.byteLength);t.length<1||(this._imageData=new ImageData(t,this.canvas.width,this.canvas.height),this._flush())}async _update(){if(!this.TVG)return!1;if("playing"!==this.currentState)return!1;const e=this.TVG.duration(),t=Date.now()/1e3;if(this.currentFrame=(t-this._beginTime)/e*this.totalFrame*this.speed,-1===this.direction&&(this.currentFrame=this.totalFrame-this.currentFrame),1===this.direction&&this.currentFrame>=this.totalFrame||-1===this.direction&&this.currentFrame<=0){const e=this.count?"bounce"===this.mode?2*this.count:this.count:0;if(this.loop||e&&this._counter<e)return"bounce"===this.mode&&(this.direction=1===this.direction?-1:1,this.currentFrame=1===this.direction?0:this.totalFrame),this.count&&(this._counter+=1),await me(this.intermission),this.play(),!0;this.dispatchEvent(new CustomEvent("complete")),this.currentState="stopped"}return this.dispatchEvent(new CustomEvent("frame",{detail:{frame:this.currentFrame}})),this.TVG.frame(this.currentFrame)}_frame(e){this.TVG&&(this.pause(),this.currentFrame=e,this.TVG.frame(e))}async load(e,t="json"){try{this.currentState="loading",await this._init();const r=await pe(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(){le&&(le.term(),le=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.4"}}render(){return j`
2
2
  <canvas class="thorvg" style="width: 100%; height: 100%;" />
3
- `}}function we(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}de([E({type:String})],ge.prototype,"src",void 0),de([E({type:String})],ge.prototype,"wasmUrl",void 0),de([E({type:fe})],ge.prototype,"fileType",void 0),de([E({type:Number})],ge.prototype,"speed",void 0),de([E({type:Boolean})],ge.prototype,"autoPlay",void 0),de([E({type:Number})],ge.prototype,"count",void 0),de([E({type:Boolean})],ge.prototype,"loop",void 0),de([E({type:Number})],ge.prototype,"direction",void 0),de([E()],ge.prototype,"mode",void 0),de([E()],ge.prototype,"intermission",void 0),de([E({type:Number})],ge.prototype,"totalFrame",void 0),de([E({type:Number})],ge.prototype,"currentFrame",void 0),de([E({type:Number})],ge.prototype,"currentState",void 0),de([E({type:Float32Array})],ge.prototype,"size",null);const ye=(e,t)=>{const r=document.createElement("a");r.setAttribute("href",URL.createObjectURL(t)),r.setAttribute("download",e),document.body.appendChild(r),r.click(),document.body.removeChild(r)};class be extends ge{set renderConfig(e){this.config=e}get renderConfig(){return this.config||{}}save2png(){this.TVG&&this.canvas.toBlob(e=>{e&&ye("output.png",e)},"image/png")}async save2gif(e){if(!le)throw new Error("Unable to save. Module is not initialized.");const t=new le.TvgLottieAnimation(he.SW,`#${this.canvas.id}`),r=await pe(e,fe.JSON);if(!t.save(r,"gif")){const e=t.error();throw t.delete(),new Error(`Unable to save. Error: ${e}`)}const n=le.FS.readFile("output.gif");if(n.length<6)throw t.delete(),new Error("Unable to save the GIF data. The generated file size is invalid.");const i=new Blob([n],{type:"application/octet-stream"});ye("output.gif",i),t.delete()}}we([E({type:Object})],be.prototype,"renderConfig",null),be=we([(e=>(t,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)})("lottie-player")],be);var _e=Object.freeze({__proto__:null});export{be as LottiePlayer};
3
+ `}}function we(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}de([E({type:String})],ge.prototype,"src",void 0),de([E({type:String})],ge.prototype,"wasmUrl",void 0),de([E({type:fe})],ge.prototype,"fileType",void 0),de([E({type:Number})],ge.prototype,"speed",void 0),de([E({type:Boolean})],ge.prototype,"autoPlay",void 0),de([E({type:Number})],ge.prototype,"count",void 0),de([E({type:Boolean})],ge.prototype,"loop",void 0),de([E({type:Number})],ge.prototype,"direction",void 0),de([E()],ge.prototype,"mode",void 0),de([E()],ge.prototype,"intermission",void 0),de([E({type:Number})],ge.prototype,"totalFrame",void 0),de([E({type:Number})],ge.prototype,"currentFrame",void 0),de([E({type:Number})],ge.prototype,"currentState",void 0),de([E({type:Float32Array})],ge.prototype,"size",null),de([E({type:Number})],ge.prototype,"dpr",null);const ye=(e,t)=>{const r=document.createElement("a");r.setAttribute("href",URL.createObjectURL(t)),r.setAttribute("download",e),document.body.appendChild(r),r.click(),document.body.removeChild(r)};class be extends ge{set renderConfig(e){this.config=e}get renderConfig(){return this.config||{}}save2png(){this.TVG&&this.canvas.toBlob(e=>{e&&ye("output.png",e)},"image/png")}async save2gif(e){if(!le)throw new Error("Unable to save. Module is not initialized.");const t=new le.TvgLottieAnimation(he.SW,`#${this.canvas.id}`),r=await pe(e,fe.JSON);if(!t.save(r,"gif")){const e=t.error();throw t.delete(),new Error(`Unable to save. Error: ${e}`)}const n=le.FS.readFile("output.gif");if(n.length<6)throw t.delete(),new Error("Unable to save the GIF data. The generated file size is invalid.");const i=new Blob([n],{type:"application/octet-stream"});ye("output.gif",i),t.delete()}}we([E({type:Object})],be.prototype,"renderConfig",null),be=we([(e=>(t,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)})("lottie-player")],be);var _e=Object.freeze({__proto__:null});export{be as LottiePlayer};
4
4
  //# sourceMappingURL=lottie-player.esm.js.map