@cesdk/cesdk-js 1.45.0 → 1.202502.25-nightly

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,a=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),s=e=>{throw TypeError(e)},u=(e,r,n)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,c=(e,r)=>t(e,"name",{value:r,configurable:!0}),l=(e,t)=>function(){return t||(0,e[n(e)[0]])((t={exports:{}}).exports,t),t.exports},d=t=>[,,,e(t?.[a("metadata")]??null)],f=["class","method","getter","setter","accessor","field","value","get","set"],h=e=>void 0!==e&&"function"!=typeof e?s("Function expected"):e,p=(e,t,r,n,o)=>({kind:f[e],name:t,metadata:n,addInitializer:e=>r._?s("Already initialized"):o.push(h(e||null))}),m=(e,t)=>u(t,a("metadata"),e[3]),g=(e,t,r,n)=>{for(var o=0,i=e[t>>1],a=i&&i.length;o<a;o++)1&t?i[o].call(r):n=i[o].call(r,n);return n},y=(e,n,o,i,a,u)=>{var l,d,g,y,v,b=7&n,S=!!(8&n),C=!!(16&n),x=b>3?e.length+1:b?S?1:2:0,A=f[b+5],T=b>3&&(e[x-1]=[]),F=e[x]||(e[x]=[]),P=b&&(!C&&!S&&(a=a.prototype),b<5&&(b>3||!C)&&r(b<4?a:{get[o](){return E(this,u)},set[o](e){return k(this,u,e)}},o));b?C&&b<4&&c(u,(b>2?"set ":b>1?"get ":"")+o):c(a,o);for(var B=i.length-1;B>=0;B--)y=p(b,o,g={},e[3],F),b&&(y.static=S,y.private=C,v=y.access={has:C?e=>w(a,e):e=>o in e},3^b&&(v.get=C?e=>(1^b?E:_)(e,a,4^b?u:P.get):e=>e[o]),b>2&&(v.set=C?(e,t)=>k(e,a,t,4^b?u:P.set):(e,t)=>e[o]=t)),d=(0,i[B])(b?b<4?C?u:P[A]:b>4?void 0:{get:P.get,set:P.set}:a,y),g._=1,4^b||void 0===d?h(d)&&(b>4?T.unshift(d):b?C?u=d:P[A]=d:a=d):"object"!=typeof d||null===d?s("Object expected"):(h(l=d.get)&&(P.get=l),h(l=d.set)&&(P.set=l),h(l=d.init)&&T.unshift(l));return b||m(e,a),P&&t(a,o,P),C?4^b?u:P:a},v=(e,t,r)=>u(e,"symbol"!=typeof t?t+"":t,r),b=(e,t,r)=>t.has(e)||s("Cannot "+r),w=(e,t)=>Object(t)!==t?s('Cannot use the "in" operator on this value'):e.has(t),E=(e,t,r)=>(b(e,t,"read from private field"),r?r.call(e):t.get(e)),S=(e,t,r)=>t.has(e)?s("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),k=(e,t,r,n)=>(b(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),_=(e,t,r)=>(b(e,t,"access private method"),r),C=l({"../../node_modules/base64-js/index.js"(e){e.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},e.toByteArray=function(e){var t,r,i=a(e),s=i[0],u=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,u)),l=0,d=u>0?s-4:s;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},e.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,u=0,c=n-o;u<c;u+=a)i.push(s(e,u,u+a>c?c:u+a));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};var t,r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(t=0,64;t<64;++t)r[t]=i[t],n[i.charCodeAt(t)]=t;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function s(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63}}),x=l({"../../node_modules/ieee754/index.js"(e){e.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,d=r?o-1:0,f=r?-1:1,h=e[t+d];for(d+=f,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+d],d+=f,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},e.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,d=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[r+h]=255&s,h+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*m}}}),A=l({"../../node_modules/buffer/index.js"(e){var t=C(),r=x(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},e.INSPECT_MAX_BYTES=50;var o=2147483647;function i(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|h(e,t),n=i(r),o=n.write(e,t);o!==r&&(n=n.slice(0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(N(e,Uint8Array)){var t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(N(e,SharedArrayBuffer)||e&&N(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,r);var o=function(e){if(a.isBuffer(e)){var t=0|f(e.length),r=i(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||H(e.length)?i(0):l(e);if("Buffer"===e.type&&Array.isArray(e.data))return l(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),i(e<0?0:0|f(e))}function l(e){for(var t=e.length<0?0:0|f(e.length),r=i(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,a.prototype),n}function f(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function h(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||N(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(o)return n?-1:$(e).length;t=(""+t).toLowerCase(),o=!0}}function p(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return F(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),H(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,o){var i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*a}else-1!==l&&(i-=i-l),l=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){for(var d=!0,f=0;f<u;f++)if(c(e,i+f)!==c(t,f)){d=!1;break}if(d)return i}return-1}function v(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=t.length;n>i/2&&(n=i/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(H(s))return a;e[r+a]=s}return a}function b(e,t,r,n){return q($(t,e.length-r),e,r,n)}function w(e,t,r,n){return q(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return q(U(t),e,r,n)}function S(e,t,r,n){return q(function(e,t){for(var r,n,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function k(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function _(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i,a,s,u,c=e[o],l=null,d=c>239?4:c>223?3:c>191?2:1;if(o+d<=r)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=d}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}e.kMaxLength=o,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return s(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?i(e):void 0!==t?"string"==typeof r?i(e).fill(t,r):i(e).fill(t):i(e)}(e,t,r)},a.allocUnsafe=function(e){return c(e)},a.allocUnsafeSlow=function(e){return c(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(N(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),N(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=a.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var i=e[r];if(N(i,Uint8Array))o+i.length>n.length?a.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!a.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},a.byteLength=h,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?_(this,0,e):p.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,o){if(N(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),u=Math.min(i,s),c=this.slice(n,o),l=e.slice(t,r),d=0;d<u;++d)if(c[d]!==l[d]){i=c[d],s=l[d];break}return i<s?-1:s<i?1:0},a.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return b(this,e,t,r);case"ascii":case"latin1":case"binary":return w(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function T(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function F(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function P(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=V[e[i]];return o}function B(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function D(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,o,i){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function R(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,t,n,o,i){return t=+t,n>>>=0,i||R(e,0,n,4),r.write(e,t,n,o,23,4),n+4}function I(e,t,n,o,i){return t=+t,n>>>=0,i||R(e,0,n,8),r.write(e,t,n,o,52,8),n+8}a.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},a.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||D(e,4,this.length),r.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),r.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),r.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),r.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||L(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||L(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);L(this,e,t,r,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);L(this,e,t,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return I(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return I(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var s=a.isBuffer(e)?e:a.from(e,n),u=s.length;if(0===u)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%u]}return this};var O=/[^+/0-9A-Za-z-_]/g;function $(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function U(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function N(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function H(e){return e!=e}var V=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)t[n+o]=e[r]+e[o];return t}()}}),T=l({"../../esbuild/polyfill.noop.js"(){}}),F=l({"../../_builds/cesdk/wasm32-unknown-emscripten/Release/cesdk.js"(e,t){var r,n=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(r||=__filename),function(e={}){var t,n,o,i,a,s,u=e;u.ready=new Promise(((e,r)=>{t=e,n=r})),u.expectedDataFileDownloads||(u.expectedDataFileDownloads=0),u.expectedDataFileDownloads++,u.ENVIRONMENT_IS_PTHREAD||u.$ww||function(e){"object"==typeof window?window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/"):"undefined"==typeof process&&"undefined"!=typeof location&&encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/");var t="cesdk.data";"function"!=typeof u.locateFilePackage||u.locateFile||(u.locateFile=u.locateFilePackage,C("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var r=u.locateFile?u.locateFile(t,""):t,n=e.remote_package_size,o=null,i=u.getPreloadedPackage?u.getPreloadedPackage(r,n):null;function a(){function t(e,t){if(!e)throw t+(new Error).stack}function r(e,t,r){this.start=e,this.end=t,this.audio=r}u.FS_createPath("/","ly.img.cesdk",!0,!0),u.FS_createPath("/ly.img.cesdk","fonts",!0,!0),u.FS_createPath("/ly.img.cesdk","icons",!0,!0),u.FS_createPath("/ly.img.cesdk","icu",!0,!0),u.FS_createPath("/ly.img.cesdk","presets",!0,!0),u.FS_createPath("/ly.img.cesdk","shaders",!0,!0),u.FS_createPath("/ly.img.cesdk/shaders","common",!0,!0),r.prototype={requests:{},open:function(e,t){this.name=t,this.requests[t]=this,u.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var e=this.byteArray.subarray(this.start,this.end);this.finish(e)},finish:function(e){u.FS_createDataFile(this.name,null,e,!0,!0,!0),u.removeRunDependency(`fp ${this.name}`),this.requests[this.name]=null}};for(var n=e.files,a=0;a<n.length;++a)new r(n[a].start,n[a].end,n[a].audio||0).open("GET",n[a].filename);function s(n){t(n,"Loading data file failed."),t(n.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var o=new Uint8Array(n);r.prototype.byteArray=o;for(var i=e.files,a=0;a<i.length;++a)r.prototype.requests[i[a].filename].onload();u.removeRunDependency("datafile_cesdk.data")}u.addRunDependency("datafile_cesdk.data"),u.preloadResults||(u.preloadResults={}),u.preloadResults["cesdk.data"]={fromCache:!1},i?(s(i),i=null):o=s}i||function(e,t,r,n){if("object"!=typeof process||"object"!=typeof process.versions||"string"!=typeof process.versions.node){var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onprogress=function(r){var n=e,i=t;if(r.total&&(i=r.total),r.loaded){o.addedTotal?u.dataFileDownloads[n].loaded=r.loaded:(o.addedTotal=!0,u.dataFileDownloads||(u.dataFileDownloads={}),u.dataFileDownloads[n]={loaded:r.loaded,total:i});var a=0,s=0,c=0;for(var l in u.dataFileDownloads){var d=u.dataFileDownloads[l];a+=d.total,s+=d.loaded,c++}a=Math.ceil(a*u.expectedDataFileDownloads/c),u.setStatus&&u.setStatus(`Downloading data... (${s}/${a})`)}else u.dataFileDownloads||u.setStatus&&u.setStatus("Downloading data...")},o.onerror=function(t){throw new Error("NetworkError for: "+e)},o.onload=function(e){if(!(200==o.status||304==o.status||206==o.status||0==o.status&&o.response))throw new Error(o.statusText+" : "+o.responseURL);var t=o.response;r(t)},o.send(null)}else T().readFile(e,(function(e,t){e?n(e):r(t.buffer)}))}(r,n,(function(e){o?(o(e),o=null):i=e}),(function(e){console.error("package error:",e)})),u.calledRun?a():(u.preRun||(u.preRun=[]),u.preRun.push(a))}({files:[{filename:"/ly.img.cesdk/fonts/imgly_font_inter_semibold.otf",start:0,end:270760},{filename:"/ly.img.cesdk/icons/ErrorAudio.svg",start:270760,end:271672},{filename:"/ly.img.cesdk/icons/ErrorConnection.svg",start:271672,end:272620},{filename:"/ly.img.cesdk/icons/ErrorVideo.svg",start:272620,end:273473},{filename:"/ly.img.cesdk/icons/Move.svg",start:273473,end:274413},{filename:"/ly.img.cesdk/icons/RotateIndicator.svg",start:274413,end:275394},{filename:"/ly.img.cesdk/icu/icudt74l.dat",start:275394,end:810498},{filename:"/ly.img.cesdk/presets/.keep",start:810498,end:810498},{filename:"/ly.img.cesdk/shaders/adjustments.sksl",start:810498,end:814387},{filename:"/ly.img.cesdk/shaders/black_and_white_color_mixer.sksl",start:814387,end:820704},{filename:"/ly.img.cesdk/shaders/common/ubq_adjustments.sksl",start:820704,end:825295},{filename:"/ly.img.cesdk/shaders/common/ubq_color_conversions.sksl",start:825295,end:835280},{filename:"/ly.img.cesdk/shaders/common/ubq_constants.sksl",start:835280,end:835770},{filename:"/ly.img.cesdk/shaders/common/ubq_hue_constants.sksl",start:835770,end:838937},{filename:"/ly.img.cesdk/shaders/common/ubq_noise.sksl",start:838937,end:841575},{filename:"/ly.img.cesdk/shaders/cross_cut.sksl",start:841575,end:842522},{filename:"/ly.img.cesdk/shaders/dot_pattern.sksl",start:842522,end:843600},{filename:"/ly.img.cesdk/shaders/duotone_filter.sksl",start:843600,end:844564},{filename:"/ly.img.cesdk/shaders/extrude_blur.sksl",start:844564,end:846681},{filename:"/ly.img.cesdk/shaders/glow.sksl",start:846681,end:847648},{filename:"/ly.img.cesdk/shaders/half_tone.sksl",start:847648,end:848142},{filename:"/ly.img.cesdk/shaders/hsp_selective_adjustments.sksl",start:848142,end:861742},{filename:"/ly.img.cesdk/shaders/linocut.sksl",start:861742,end:862527},{filename:"/ly.img.cesdk/shaders/liquid.sksl",start:862527,end:863009},{filename:"/ly.img.cesdk/shaders/lut_filter.sksl",start:863009,end:865872},{filename:"/ly.img.cesdk/shaders/mask_color.sksl",start:865872,end:866377},{filename:"/ly.img.cesdk/shaders/mirror.sksl",start:866377,end:866831},{filename:"/ly.img.cesdk/shaders/outliner.sksl",start:866831,end:868468},{filename:"/ly.img.cesdk/shaders/pixelize.sksl",start:868468,end:868768},{filename:"/ly.img.cesdk/shaders/placeholder_overlay_lines.sksl",start:868768,end:869456},{filename:"/ly.img.cesdk/shaders/posterize.sksl",start:869456,end:869668},{filename:"/ly.img.cesdk/shaders/radial_pixel.sksl",start:869668,end:870231},{filename:"/ly.img.cesdk/shaders/recolor.sksl",start:870231,end:872432},{filename:"/ly.img.cesdk/shaders/sharpie.sksl",start:872432,end:874737},{filename:"/ly.img.cesdk/shaders/shifter.sksl",start:874737,end:875421},{filename:"/ly.img.cesdk/shaders/tiltshift.sksl",start:875421,end:876003},{filename:"/ly.img.cesdk/shaders/tv_glitch.sksl",start:876003,end:876721},{filename:"/ly.img.cesdk/shaders/vignette.sksl",start:876721,end:877093}],remote_package_size:877093}),"object"==typeof window&&"object"==typeof window.performance?u.performance=performance:"object"==typeof global&&"object"==typeof global.perf_hooks&&"object"==typeof global.perf_hooks.performance?u.performance=global.perf_hooks.performance:u.performance={mark:function(){},measure:function(){}},(i=o||(o={}))[i.PENDING=0]="PENDING",i[i.FINISHED=1]="FINISHED",i[i.ALLOCATED=2]="ALLOCATED",i[i.ERROR=3]="ERROR",(s=a||(a={}))[s.GET=0]="GET",s[s.POST=1]="POST";class FetchProcess{constructor(e,t){this.state=o.PENDING,this.totalBytes=0,this.receivedLength=0,this.handle=e,this.uri=t,this.abortController=new AbortController,this.abortSignal=this.abortController.signal}async readChunks(e){let t=0;const r=[],n=e=>{r.push(e),t+=e.length,this.receivedLength=t};if(null==e);else if("getReader"in e){const t=e.getReader();for(;;){const{done:e,value:r}=await t.read();if(e)break;if(this.abortSignal.aborted)throw await t.cancel(),t.releaseLock(),new Error(this.abortSignal.reason);n(r)}t.releaseLock()}else{const t=()=>e.destroy(new Error(this.abortSignal.reason));this.abortSignal.addEventListener("abort",t,{once:!0});try{await new Promise(((t,r)=>{e.on("data",n),e.on("end",(()=>t())),e.on("error",(e=>r(e)))}))}finally{this.abortSignal.removeEventListener("abort",t)}}const o=new Uint8Array(t);let i=0;for(const e of r)o.set(e,i),i+=e.length;return this.finish(o)}abort(){this.isPending()&&this.abortController.abort("Fetch aborted")}isPending(){return this.state===o.PENDING}isError(){return this.state===o.ERROR}isFinished(){return this.state===o.FINISHED}isAllocated(){return this.state===o.ALLOCATED}allocate(){if(this.isAllocated())return this;if(this.isFinished()){const e=this.result.length,t=u._malloc(e);u.HEAPU8.set(this.result,t);const r=Object.assign(Object.assign({},this),{state:o.ALLOCATED,resultAddress:t,resultLength:e});return Object.assign(this,r),r}return null}finish(e){const t=Object.assign(Object.assign({},this),{state:o.FINISHED,result:e,totalBytes:e.length});return Object.assign(this,t)}fail(e){const t=Object.assign(Object.assign({},this),{state:o.ERROR,error:e});return Object.assign(this,t)}}u.emscripten_ubq_asyncFetchManager=new class AsyncFetchManager{constructor(){this._nextHandle=0,this._nextHeaderHandle=0,this._processes=new Map,this._headers=new Map,this._fetchImpl=null}_fetch(e,t){return this._fetchImpl?this._fetchImpl(e,t):fetch(e,t)}setFetch(e){this._fetchImpl=e}getProcess(e){return this._processes.get(e)}deleteProcess(e){const t=this._processes.get(e);return(null==t?void 0:t.isPending())&&t.abort(),this._processes.delete(e)}clear(){for(const e of this._processes.values())e.isPending()&&e.abort();this._processes.clear(),this._headers.clear()}fetch(e,t,r,n,o,i,a,s,c){const l=u.UTF8ToString(t,r),d=this._nextHandle++,f=new FetchProcess(d,l);return this._processes.set(d,f),l.match(/^file:/)?this._fetchFile(f).catch((e=>{f.fail(e)})):this._fetchRemote(f,e,n,o,i,a,s,c).catch((e=>{f.fail(e)})),f}async _fetchFile(e){if("undefined"!=typeof window)throw new Error("File URLs supported only in Node.JS");const t=T(),{fileURLToPath:r}=T(),n=t.createReadStream(r(e.uri));return e.readChunks(n)}async _fetchRemote(e,t,r,n,o,i,s,c){const l=u.UTF8ToString(s,c),d=this.getHeaders(r,n),f=t===a.POST?new Uint8Array(new Uint8Array(u.HEAPU8.buffer,o,i)):void 0,h=await this._fetch(e.uri,{method:a[t],headers:d,body:f,mode:"cors",credentials:l,signal:e.abortSignal});if(h.status>=200&&h.status<=209){let t=0;return h.headers.has("Content-Length")&&(t=+h.headers.get("Content-Length")),e.totalBytes=t,e.readChunks(h.body)}return e.fail(h.statusText)}getHeaders(e,t){const r={};for(let n=0;n<t;n++){const t=u.getValue(e+4*n,"i32"),o=this._headers.get(t);r[o.key]=o.value}return r}createHeader(e,t,r,n){const o=u.UTF8ToString(e,t),i=u.UTF8ToString(r,n),a=this._nextHeaderHandle++;return this._headers.set(a,{key:o,value:i}),a}deleteHeader(e){return this._headers.delete(e)}},u.emscripten_ubq_codec_videoDecoders=new Map,u.emscripten_ubq_codec_audioDecoders=new Map,u.emscripten_ubq_codec_videoEncoders=new Map,u.emscripten_ubq_codec_audioEncoders=new Map,u.emscripten_ubq_codec_videoDecoderNextHandle=1,u.emscripten_ubq_codec_audioDecoderNextHandle=1,u.emscripten_ubq_codec_videoEncoderNextHandle=1,u.emscripten_ubq_codec_audioEncoderNextHandle=1,u.emscripten_ubq_codec_createNativeResult=function(e){const t=u._malloc(8),r=u.HEAPU32.subarray(t/4,t/4+2);if(r[0]=e.handle?e.handle:e.code?e.code:0,e.error){const t=(new TextEncoder).encode(e.error),n=u._malloc(t.length+1),o=u.HEAPU8.subarray(n,n+t.length+1);for(let e=0;e<t.length;e++)o[e]=t[e];o[t.length]=0,r[1]=n}else r[1]=0;return t},u.emscripten_ubq_codec_createVideoDecoder=function(e,t){const r=new VideoDecoder({output:n=>{const o=r.textures;let i=!1;if((r.shouldDropFrames||r.decodedFrames<r.requestedFrame||r.decodeQueueSize>=o.length)&&(i=!0),!i){var a=u.ctx;const e=r.decodedFrames%o.length,t=a.getParameter(a.TEXTURE_BINDING_2D);a.bindTexture(a.TEXTURE_2D,o[e]),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,n),a.bindTexture(a.TEXTURE_2D,t)}n.close(),r.decodedFrames++,u.emscripten_ubq_codec_onOutputDecodedVideoFrame(e,r.decodedFrames,i,t)},error:e=>{r.unexpectedError=e,console.error(e)}});return r.decodedFrames=0,r.requestedFrame=0,r.shouldDropFrames=!1,r},u.emscripten_ubq_codec_createAudioDecoder=function(e,t,r){const n=new AudioDecoder({output:o=>{if(n.flushing)return void o.close();const i=u.HEAPF32.subarray(e/4,e/4+r),a=u.HEAPF32.subarray(t/4,t/4+r),s=1===o.numberOfChannels?0:1;if("f32-planar"===o.format){let e=n.writtenFrames%r;if(e+o.numberOfFrames<=r)o.copyTo(i.subarray(e),{planeIndex:0,frameCount:o.numberOfFrames}),o.copyTo(a.subarray(e),{planeIndex:s,frameCount:o.numberOfFrames});else{const t=r-e;o.copyTo(i.subarray(e),{planeIndex:0,frameCount:t}),o.copyTo(a.subarray(e),{planeIndex:s,frameCount:t}),o.copyTo(i,{planeIndex:0,frameOffset:t}),o.copyTo(a,{planeIndex:s,frameOffset:t})}n.writtenFrames+=o.numberOfFrames}else if("s16-planar"===o.format)if(1===o.numberOfChannels){const e=new Int16Array(o.numberOfFrames);o.copyTo(e,{planeIndex:0});for(let t=0;t<o.numberOfFrames;t++){const o=e[t]/32768;let s=n.writtenFrames%r;i[s]=o,a[s]=o,n.writtenFrames++}}else{const e=new Int16Array(o.numberOfFrames),t=new Int16Array(o.numberOfFrames);o.copyTo(e,{planeIndex:0}),o.copyTo(t,{planeIndex:1});for(let s=0;s<o.numberOfFrames;s++){let o=n.writtenFrames%r;i[o]=e[s]/32768,a[o]=t[s]/32768,n.writtenFrames++}}else if("s16"===o.format){const e=new Int16Array(o.numberOfFrames*o.numberOfChannels);if(o.copyTo(e,{planeIndex:0}),1===o.numberOfChannels)for(let t=0;t<o.numberOfFrames;t++){const o=e[t]/32768;let s=n.writtenFrames%r;i[s]=o,a[s]=o,n.writtenFrames++}else for(let t=0;t<o.numberOfFrames;t++){let s=n.writtenFrames%r;i[s]=e[t*o.numberOfChannels+0]/32768,a[s]=e[t*o.numberOfChannels+1]/32768,n.writtenFrames++}}else console.error("Unsupported audio format:",o.format);o.close()},error:e=>{n.unexpectedError=e,console.error(e)}});return n.writtenFrames=0,n},u.emscripten_ubq_settings_forceWebGL1=!1;var c,l,d,f=Object.assign({},u),h=[],p="./this.program",m=(e,t)=>{throw t},g="object"==typeof window,y="function"==typeof importScripts,v="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,b="";if(v){var w=T(),E=T();b=y?E.dirname(b)+"/":__dirname+"/",c=(e,t)=>(e=te(e)?new URL(e):E.normalize(e),w.readFileSync(e,t?void 0:"utf8")),d=e=>{var t=c(e,!0);return t.buffer||(t=new Uint8Array(t)),t},l=(e,t,r,n=!0)=>{e=te(e)?new URL(e):E.normalize(e),w.readFile(e,n?void 0:"utf8",((e,o)=>{e?r(e):t(n?o.buffer:o)}))},!u.thisProgram&&process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),h=process.argv.slice(2),m=(e,t)=>{throw process.exitCode=e,t}}else(g||y)&&(y?b=self.location.href:"undefined"!=typeof document&&document.currentScript&&(b=document.currentScript.src),r&&(b=r),b=b.startsWith("blob:")?"":b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1),c=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},y&&(d=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),l=(e,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.onerror=r,n.send(null)});var S,k,_=u.print||console.log.bind(console),C=u.printErr||console.error.bind(console);Object.assign(u,f),f=null,u.arguments&&(h=u.arguments),u.thisProgram&&(p=u.thisProgram),u.quit&&(m=u.quit),u.wasmBinary&&(S=u.wasmBinary),"object"!=typeof WebAssembly&&Q("no native wasm support detected");var x,A,F,P,B,D,L,R,M,I,O,$=!1;function U(e,t){e||Q(t)}function q(){var e=k.buffer;u.HEAP8=A=new Int8Array(e),u.HEAP16=P=new Int16Array(e),u.HEAPU8=F=new Uint8Array(e),u.HEAPU16=B=new Uint16Array(e),u.HEAP32=D=new Int32Array(e),u.HEAPU32=L=new Uint32Array(e),u.HEAPF32=R=new Float32Array(e),u.HEAPF64=O=new Float64Array(e),u.HEAP64=M=new BigInt64Array(e),u.HEAPU64=I=new BigUint64Array(e)}var N=u.INITIAL_MEMORY||16777216;k=u.wasmMemory?u.wasmMemory:new WebAssembly.Memory({initial:N/65536,maximum:32768}),q(),N=k.buffer.byteLength;var H=[],V=[],W=[],G=[],j=0,z=null,X=null;function Y(e){j++,u.monitorRunDependencies?.(j)}function K(e){if(j--,u.monitorRunDependencies?.(j),0==j&&(null!==z&&(clearInterval(z),z=null),X)){var t=X;X=null,t()}}function Q(e){u.onAbort?.(e),C(e="Aborted("+e+")"),$=!0,x=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}var Z,J,ee=e=>e.startsWith("data:application/octet-stream;base64,"),te=e=>e.startsWith("file://");function re(e){if(e==Z&&S)return new Uint8Array(S);if(d)return d(e);throw"both async and sync fetching of the wasm failed"}function ne(e,t,r){return function(e){return S||!g&&!y||"function"!=typeof fetch?Promise.resolve().then((()=>re(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw`failed to load wasm binary file at '${e}'`;return t.arrayBuffer()})).catch((()=>re(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{C(`failed to asynchronously prepare wasm: ${e}`),Q(e)}))}ee(Z="cesdk.wasm")||(J=Z,Z=u.locateFile?u.locateFile(J,b):b+J);var oe={2555828:(e,t,r,n,o)=>"undefined"==typeof window||void 0===(window.AudioContext||window.webkitAudioContext)?0:(void 0===window.miniaudio&&(window.miniaudio={referenceCount:0},window.miniaudio.device_type={},window.miniaudio.device_type.playback=e,window.miniaudio.device_type.capture=t,window.miniaudio.device_type.duplex=r,window.miniaudio.device_state={},window.miniaudio.device_state.stopped=n,window.miniaudio.device_state.started=o,miniaudio.devices=[],miniaudio.track_device=function(e){for(var t=0;t<miniaudio.devices.length;++t)if(null==miniaudio.devices[t])return miniaudio.devices[t]=e,t;return miniaudio.devices.push(e),miniaudio.devices.length-1},miniaudio.untrack_device_by_index=function(e){for(miniaudio.devices[e]=null;miniaudio.devices.length>0&&null==miniaudio.devices[miniaudio.devices.length-1];)miniaudio.devices.pop()},miniaudio.untrack_device=function(e){for(var t=0;t<miniaudio.devices.length;++t)if(miniaudio.devices[t]==e)return miniaudio.untrack_device_by_index(t)},miniaudio.get_device_by_index=function(e){return miniaudio.devices[e]},miniaudio.unlock_event_types=function(){return["touchstart","touchend","click"]}(),miniaudio.unlock=function(){for(var e=0;e<miniaudio.devices.length;++e){var t=miniaudio.devices[e];null!=t&&null!=t.webaudio&&2===t.state&&t.webaudio.resume()}miniaudio.unlock_event_types.map((function(e){document.removeEventListener(e,miniaudio.unlock,!0)}))},miniaudio.unlock_event_types.map((function(e){document.addEventListener(e,miniaudio.unlock,!0)}))),window.miniaudio.referenceCount+=1,1),2557818:()=>{void 0!==window.miniaudio&&(window.miniaudio.referenceCount-=1,0===window.miniaudio.referenceCount&&delete window.miniaudio)},2557982:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,2558086:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},2558257:(e,t,r,n,o,i)=>{var a=e,s=t,c=r,l=n,d=o,f=i;if(void 0===window.miniaudio)return-1;var h={},p={};a==window.miniaudio.device_type.playback&&(p.sampleRate=c),h.webaudio=new(window.AudioContext||window.webkitAudioContext)(p),h.webaudio.suspend(),h.state=window.miniaudio.device_state.stopped;var m=0,g=s;return a!=window.miniaudio.device_type.playback&&(m=s),h.scriptNode=h.webaudio.createScriptProcessor(l,m,g),h.scriptNode.onaudioprocess=function(e){if(null!=h.intermediaryBufferView&&0!=h.intermediaryBufferView.length||(h.intermediaryBufferView=new Float32Array(u.HEAPF32.buffer,d,l*s)),a==miniaudio.device_type.capture||a==miniaudio.device_type.duplex){for(var t=0;t<s;t+=1)for(var r=e.inputBuffer.getChannelData(t),n=h.intermediaryBufferView,o=0;o<l;o+=1)n[o*s+t]=r[o];Du(f,l,d)}if(a==miniaudio.device_type.playback||a==miniaudio.device_type.duplex)for(Lu(f,l,d),t=0;t<e.outputBuffer.numberOfChannels;++t){var i=e.outputBuffer.getChannelData(t);for(n=h.intermediaryBufferView,o=0;o<l;o+=1)i[o]=n[o*s+t]}else for(t=0;t<e.outputBuffer.numberOfChannels;++t)e.outputBuffer.getChannelData(t).fill(0)},a!=miniaudio.device_type.capture&&a!=miniaudio.device_type.duplex||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(e){h.streamNode=h.webaudio.createMediaStreamSource(e),h.streamNode.connect(h.scriptNode),h.scriptNode.connect(h.webaudio.destination)})).catch((function(e){console.log("Failed to get user media: "+e)})),a==miniaudio.device_type.playback&&h.scriptNode.connect(h.webaudio.destination),miniaudio.track_device(h)},2561040:e=>miniaudio.get_device_by_index(e).webaudio.sampleRate,2561106:e=>{var t=miniaudio.get_device_by_index(e);void 0!==t.scriptNode&&(t.scriptNode.onaudioprocess=function(e){},t.scriptNode.disconnect(),t.scriptNode=void 0),void 0!==t.streamNode&&(t.streamNode.disconnect(),t.streamNode=void 0),t.webaudio.close(),t.webaudio=void 0},2561471:e=>{miniaudio.untrack_device_by_index(e)},2561514:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.resume(),t.state=miniaudio.device_state.started},2561639:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.suspend(),t.state=miniaudio.device_state.stopped},2561765:()=>!!globalThis.ubq_browserTabHidden};function ie(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var ae=e=>{for(;e.length>0;)e.shift()(u)},se=u.noExitRuntime||!0,ue=[],ce=0;class ExceptionInfo{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){L[this.ptr+4>>2]=e}get_type(){return L[this.ptr+4>>2]}set_destructor(e){L[this.ptr+8>>2]=e}get_destructor(){return L[this.ptr+8>>2]}set_caught(e){e=e?1:0,A[this.ptr+12>>0]=e}get_caught(){return 0!=A[this.ptr+12>>0]}set_rethrown(e){e=e?1:0,A[this.ptr+13>>0]=e}get_rethrown(){return 0!=A[this.ptr+13>>0]}init(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)}set_adjusted_ptr(e){L[this.ptr+16>>2]=e}get_adjusted_ptr(){return L[this.ptr+16>>2]}get_exception_ptr(){if(Wu(this.get_type()))return L[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var le=e=>{var t=ce;if(!t)return Ru(0),0;var r=new ExceptionInfo(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Ru(0),t;for(var o in e){var i=e[o];if(0===i||i===n)break;var a=r.ptr+16;if(Vu(i,n,a))return Ru(i),t}return Ru(n),t},de={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=de.isAbs(e),r="/"===e.substr(-1);return(e=de.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=de.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=de.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return de.normalize(e.join("/"))},join2:(e,t)=>de.normalize(e+"/"+t)},fe=e=>(fe=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(v)try{var e=T();if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch(e){}Q("initRandomDevice")})())(e),he={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Ce.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=de.isAbs(n)}return(t?"/":"")+(e=de.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=he.resolve(e).substr(1),t=he.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},pe="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,me=(e,t,r)=>{for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&pe)return pe.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i},ge=[],ye=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},ve=(e,t,r,n)=>{if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o};function be(e,t,r){var n=r>0?r:ye(e)+1,o=new Array(n),i=ve(e,o,0,o.length);return t&&(o.length=i),o}var we={ttys:[],init(){},shutdown(){},register(e,t){we.ttys[e]={input:[],output:[],ops:t},Ce.registerDevice(e,we.stream_ops)},stream_ops:{open(e){var t=we.ttys[e.node.rdev];if(!t)throw new Ce.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new Ce.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Ce.ErrnoError(29)}if(void 0===s&&0===i)throw new Ce.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new Ce.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new Ce.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:e=>(()=>{if(!ge.length){var e=null;if(v){var t=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=w.readSync(n,t)}catch(e){if(!e.toString().includes("EOF"))throw e;r=0}e=r>0?t.slice(0,r).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;ge=be(e,!0)}return ge.shift()})(),put_char(e,t){null===t||10===t?(_(me(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(_(me(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,t,r)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(C(me(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(C(me(e.output,0)),e.output=[])}}},Ee=e=>{e=((e,t)=>Math.ceil(e/t)*t)(e,65536);var t=Iu(65536,e);return t?((e,t)=>(F.fill(0,e,e+t),e))(t,e):0},Se={ops_table:null,mount:e=>Se.createNode(null,"/",16895,0),createNode(e,t,r,n){if(Ce.isBlkdev(r)||Ce.isFIFO(r))throw new Ce.ErrnoError(63);Se.ops_table||={dir:{node:{getattr:Se.node_ops.getattr,setattr:Se.node_ops.setattr,lookup:Se.node_ops.lookup,mknod:Se.node_ops.mknod,rename:Se.node_ops.rename,unlink:Se.node_ops.unlink,rmdir:Se.node_ops.rmdir,readdir:Se.node_ops.readdir,symlink:Se.node_ops.symlink},stream:{llseek:Se.stream_ops.llseek}},file:{node:{getattr:Se.node_ops.getattr,setattr:Se.node_ops.setattr},stream:{llseek:Se.stream_ops.llseek,read:Se.stream_ops.read,write:Se.stream_ops.write,allocate:Se.stream_ops.allocate,mmap:Se.stream_ops.mmap,msync:Se.stream_ops.msync}},link:{node:{getattr:Se.node_ops.getattr,setattr:Se.node_ops.setattr,readlink:Se.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Se.node_ops.getattr,setattr:Se.node_ops.setattr},stream:Ce.chrdev_stream_ops}};var o=Ce.createNode(e,t,r,n);return Ce.isDir(o.mode)?(o.node_ops=Se.ops_table.dir.node,o.stream_ops=Se.ops_table.dir.stream,o.contents={}):Ce.isFile(o.mode)?(o.node_ops=Se.ops_table.file.node,o.stream_ops=Se.ops_table.file.stream,o.usedBytes=0,o.contents=null):Ce.isLink(o.mode)?(o.node_ops=Se.ops_table.link.node,o.stream_ops=Se.ops_table.link.stream):Ce.isChrdev(o.mode)&&(o.node_ops=Se.ops_table.chrdev.node,o.stream_ops=Se.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=Ce.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Ce.isDir(e.mode)?t.size=4096:Ce.isFile(e.mode)?t.size=e.usedBytes:Ce.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&Se.resizeFileStorage(e,t.size)},lookup(e,t){throw Ce.genericErrors[44]},mknod:(e,t,r,n)=>Se.createNode(e,t,r,n),rename(e,t,r){if(Ce.isDir(e.mode)){var n;try{n=Ce.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Ce.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=Ce.lookupNode(e,t);for(var n in r.contents)throw new Ce.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r of Object.keys(e.contents))t.push(r);return t},symlink(e,t,r){var n=Se.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!Ce.isLink(e.mode))throw new Ce.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(a>8&&i.subarray)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write(e,t,r,n,o,i){if(t.buffer===A.buffer&&(i=!1),!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(Se.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&Ce.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Ce.ErrnoError(28);return n},allocate(e,t,r){Se.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,n,o){if(!Ce.isFile(e.node.mode))throw new Ce.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||s.buffer!==A.buffer){if((r>0||r+t<s.length)&&(s=s.subarray?s.subarray(r,r+t):Array.prototype.slice.call(s,r,r+t)),a=!0,!(i=Ee(t)))throw new Ce.ErrnoError(48);A.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:(e,t,r,n,o)=>(Se.stream_ops.write(e,t,0,n,r,!1),0)}},ke=u.preloadPlugins||[],_e=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},Ce={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,t={}){if(!(e=he.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Ce.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=Ce.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=Ce.lookupNode(n,r[i]),o=de.join2(o,r[i]),Ce.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;Ce.isLink(n.mode);){var u=Ce.readlink(o);if(o=he.resolve(de.dirname(o),u),n=Ce.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Ce.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var t;;){if(Ce.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Ce.nameTable.length},hashAddNode(e){var t=Ce.hashName(e.parent.id,e.name);e.name_next=Ce.nameTable[t],Ce.nameTable[t]=e},hashRemoveNode(e){var t=Ce.hashName(e.parent.id,e.name);if(Ce.nameTable[t]===e)Ce.nameTable[t]=e.name_next;else for(var r=Ce.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=Ce.mayLookup(e);if(r)throw new Ce.ErrnoError(r);for(var n=Ce.hashName(e.id,t),o=Ce.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return Ce.lookup(e,t)},createNode(e,t,r,n){var o=new Ce.FSNode(e,t,r,n);return Ce.hashAddNode(o),o},destroyNode(e){Ce.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>Ce.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup(e){if(!Ce.isDir(e.mode))return 54;var t=Ce.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{return Ce.lookupNode(e,t),20}catch(e){}return Ce.nodePermissions(e,"wx")},mayDelete(e,t,r){var n;try{n=Ce.lookupNode(e,t)}catch(e){return e.errno}var o=Ce.nodePermissions(e,"wx");if(o)return o;if(r){if(!Ce.isDir(n.mode))return 54;if(Ce.isRoot(n)||Ce.getPath(n)===Ce.cwd())return 10}else if(Ce.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Ce.isLink(e.mode)?32:Ce.isDir(e.mode)&&("r"!==Ce.flagsToPermissionString(t)||512&t)?31:Ce.nodePermissions(e,Ce.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=Ce.MAX_OPEN_FDS;e++)if(!Ce.streams[e])return e;throw new Ce.ErrnoError(33)},getStreamChecked(e){var t=Ce.getStream(e);if(!t)throw new Ce.ErrnoError(8);return t},getStream:e=>Ce.streams[e],createStream:(e,t=-1)=>(Ce.FSStream||(Ce.FSStream=function(){this.shared={}},Ce.FSStream.prototype={},Object.defineProperties(Ce.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new Ce.FSStream,e),-1==t&&(t=Ce.nextfd()),e.fd=t,Ce.streams[t]=e,e),closeStream(e){Ce.streams[e]=null},chrdev_stream_ops:{open(e){var t=Ce.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new Ce.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){Ce.devices[e]={stream_ops:t}},getDevice:e=>Ce.devices[e],getMounts(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),Ce.syncFSRequests++,Ce.syncFSRequests>1&&C(`warning: ${Ce.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Ce.getMounts(Ce.root.mount),n=0;function o(e){return Ce.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount(e,t,r){var n,o="/"===r,i=!r;if(o&&Ce.root)throw new Ce.ErrnoError(10);if(!o&&!i){var a=Ce.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,Ce.isMountpoint(n))throw new Ce.ErrnoError(10);if(!Ce.isDir(n.mode))throw new Ce.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?Ce.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(e){var t=Ce.lookupPath(e,{follow_mount:!1});if(!Ce.isMountpoint(t.node))throw new Ce.ErrnoError(28);var r=t.node,n=r.mounted,o=Ce.getMounts(n);Object.keys(Ce.nameTable).forEach((e=>{for(var t=Ce.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Ce.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,r){var n=Ce.lookupPath(e,{parent:!0}).node,o=de.basename(e);if(!o||"."===o||".."===o)throw new Ce.ErrnoError(28);var i=Ce.mayCreate(n,o);if(i)throw new Ce.ErrnoError(i);if(!n.node_ops.mknod)throw new Ce.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Ce.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Ce.mknod(e,t,0)),mkdirTree(e,t){for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{Ce.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,Ce.mknod(e,t,r)),symlink(e,t){if(!he.resolve(e))throw new Ce.ErrnoError(44);var r=Ce.lookupPath(t,{parent:!0}).node;if(!r)throw new Ce.ErrnoError(44);var n=de.basename(t),o=Ce.mayCreate(r,n);if(o)throw new Ce.ErrnoError(o);if(!r.node_ops.symlink)throw new Ce.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename(e,t){var r,n,o=de.dirname(e),i=de.dirname(t),a=de.basename(e),s=de.basename(t);if(r=Ce.lookupPath(e,{parent:!0}).node,n=Ce.lookupPath(t,{parent:!0}).node,!r||!n)throw new Ce.ErrnoError(44);if(r.mount!==n.mount)throw new Ce.ErrnoError(75);var u,c=Ce.lookupNode(r,a),l=he.relative(e,i);if("."!==l.charAt(0))throw new Ce.ErrnoError(28);if("."!==(l=he.relative(t,o)).charAt(0))throw new Ce.ErrnoError(55);try{u=Ce.lookupNode(n,s)}catch(e){}if(c!==u){var d=Ce.isDir(c.mode),f=Ce.mayDelete(r,a,d);if(f)throw new Ce.ErrnoError(f);if(f=u?Ce.mayDelete(n,s,d):Ce.mayCreate(n,s))throw new Ce.ErrnoError(f);if(!r.node_ops.rename)throw new Ce.ErrnoError(63);if(Ce.isMountpoint(c)||u&&Ce.isMountpoint(u))throw new Ce.ErrnoError(10);if(n!==r&&(f=Ce.nodePermissions(r,"w")))throw new Ce.ErrnoError(f);Ce.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{Ce.hashAddNode(c)}}},rmdir(e){var t=Ce.lookupPath(e,{parent:!0}).node,r=de.basename(e),n=Ce.lookupNode(t,r),o=Ce.mayDelete(t,r,!0);if(o)throw new Ce.ErrnoError(o);if(!t.node_ops.rmdir)throw new Ce.ErrnoError(63);if(Ce.isMountpoint(n))throw new Ce.ErrnoError(10);t.node_ops.rmdir(t,r),Ce.destroyNode(n)},readdir(e){var t=Ce.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Ce.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=Ce.lookupPath(e,{parent:!0}).node;if(!t)throw new Ce.ErrnoError(44);var r=de.basename(e),n=Ce.lookupNode(t,r),o=Ce.mayDelete(t,r,!1);if(o)throw new Ce.ErrnoError(o);if(!t.node_ops.unlink)throw new Ce.ErrnoError(63);if(Ce.isMountpoint(n))throw new Ce.ErrnoError(10);t.node_ops.unlink(t,r),Ce.destroyNode(n)},readlink(e){var t=Ce.lookupPath(e).node;if(!t)throw new Ce.ErrnoError(44);if(!t.node_ops.readlink)throw new Ce.ErrnoError(28);return he.resolve(Ce.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var r=Ce.lookupPath(e,{follow:!t}).node;if(!r)throw new Ce.ErrnoError(44);if(!r.node_ops.getattr)throw new Ce.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Ce.stat(e,!0),chmod(e,t,r){var n;if(!(n="string"==typeof e?Ce.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Ce.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod(e,t){Ce.chmod(e,t,!0)},fchmod(e,t){var r=Ce.getStreamChecked(e);Ce.chmod(r.node,t)},chown(e,t,r,n){var o;if(!(o="string"==typeof e?Ce.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Ce.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,t,r){Ce.chown(e,t,r,!0)},fchown(e,t,r){var n=Ce.getStreamChecked(e);Ce.chown(n.node,t,r)},truncate(e,t){if(t<0)throw new Ce.ErrnoError(28);var r;if(!(r="string"==typeof e?Ce.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Ce.ErrnoError(63);if(Ce.isDir(r.mode))throw new Ce.ErrnoError(31);if(!Ce.isFile(r.mode))throw new Ce.ErrnoError(28);var n=Ce.nodePermissions(r,"w");if(n)throw new Ce.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=Ce.getStreamChecked(e);if(0==(2097155&r.flags))throw new Ce.ErrnoError(28);Ce.truncate(r.node,t)},utime(e,t,r){var n=Ce.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open(e,t,r){if(""===e)throw new Ce.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=de.normalize(e);try{n=Ce.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new Ce.ErrnoError(20)}else n=Ce.mknod(e,r,0),o=!0;if(!n)throw new Ce.ErrnoError(44);if(Ce.isChrdev(n.mode)&&(t&=-513),65536&t&&!Ce.isDir(n.mode))throw new Ce.ErrnoError(54);if(!o){var i=Ce.mayOpen(n,t);if(i)throw new Ce.ErrnoError(i)}512&t&&!o&&Ce.truncate(n,0),t&=-131713;var a=Ce.createStream({node:n,path:Ce.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!u.logReadFiles||1&t||(Ce.readFiles||(Ce.readFiles={}),e in Ce.readFiles||(Ce.readFiles[e]=1)),a},close(e){if(Ce.isClosed(e))throw new Ce.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Ce.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,r){if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Ce.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Ce.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,n,o){if(n<0||o<0)throw new Ce.ErrnoError(28);if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(1==(2097155&e.flags))throw new Ce.ErrnoError(8);if(Ce.isDir(e.node.mode))throw new Ce.ErrnoError(31);if(!e.stream_ops.read)throw new Ce.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new Ce.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write(e,t,r,n,o,i){if(n<0||o<0)throw new Ce.ErrnoError(28);if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(0==(2097155&e.flags))throw new Ce.ErrnoError(8);if(Ce.isDir(e.node.mode))throw new Ce.ErrnoError(31);if(!e.stream_ops.write)throw new Ce.ErrnoError(28);e.seekable&&1024&e.flags&&Ce.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new Ce.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,i);return a||(e.position+=s),s},allocate(e,t,r){if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(t<0||r<=0)throw new Ce.ErrnoError(28);if(0==(2097155&e.flags))throw new Ce.ErrnoError(8);if(!Ce.isFile(e.node.mode)&&!Ce.isDir(e.node.mode))throw new Ce.ErrnoError(43);if(!e.stream_ops.allocate)throw new Ce.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new Ce.ErrnoError(2);if(1==(2097155&e.flags))throw new Ce.ErrnoError(2);if(!e.stream_ops.mmap)throw new Ce.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},msync:(e,t,r,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,munmap:e=>0,ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new Ce.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var r,n=Ce.open(e,t.flags),o=Ce.stat(e).size,i=new Uint8Array(o);return Ce.read(n,i,0,o,0),"utf8"===t.encoding?r=me(i,0):"binary"===t.encoding&&(r=i),Ce.close(n),r},writeFile(e,t,r={}){r.flags=r.flags||577;var n=Ce.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(ye(t)+1),i=ve(t,o,0,o.length);Ce.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Ce.write(n,t,0,t.byteLength,void 0,r.canOwn)}Ce.close(n)},cwd:()=>Ce.currentPath,chdir(e){var t=Ce.lookupPath(e,{follow:!0});if(null===t.node)throw new Ce.ErrnoError(44);if(!Ce.isDir(t.node.mode))throw new Ce.ErrnoError(54);var r=Ce.nodePermissions(t.node,"x");if(r)throw new Ce.ErrnoError(r);Ce.currentPath=t.path},createDefaultDirectories(){Ce.mkdir("/tmp"),Ce.mkdir("/home"),Ce.mkdir("/home/web_user")},createDefaultDevices(){Ce.mkdir("/dev"),Ce.registerDevice(Ce.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),Ce.mkdev("/dev/null",Ce.makedev(1,3)),we.register(Ce.makedev(5,0),we.default_tty_ops),we.register(Ce.makedev(6,0),we.default_tty1_ops),Ce.mkdev("/dev/tty",Ce.makedev(5,0)),Ce.mkdev("/dev/tty1",Ce.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=fe(e).byteLength),e[--t]);Ce.createDevice("/dev","random",r),Ce.createDevice("/dev","urandom",r),Ce.mkdir("/dev/shm"),Ce.mkdir("/dev/shm/tmp")},createSpecialDirectories(){Ce.mkdir("/proc");var e=Ce.mkdir("/proc/self");Ce.mkdir("/proc/self/fd"),Ce.mount({mount(){var t=Ce.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var r=+t,n=Ce.getStreamChecked(r),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams(){u.stdin?Ce.createDevice("/dev","stdin",u.stdin):Ce.symlink("/dev/tty","/dev/stdin"),u.stdout?Ce.createDevice("/dev","stdout",null,u.stdout):Ce.symlink("/dev/tty","/dev/stdout"),u.stderr?Ce.createDevice("/dev","stderr",null,u.stderr):Ce.symlink("/dev/tty1","/dev/stderr"),Ce.open("/dev/stdin",0),Ce.open("/dev/stdout",1),Ce.open("/dev/stderr",1)},staticInit(){[44].forEach((e=>{Ce.genericErrors[e]=new Ce.ErrnoError(e),Ce.genericErrors[e].stack="<generic error, no stack>"})),Ce.nameTable=new Array(4096),Ce.mount(Se,{},"/"),Ce.createDefaultDirectories(),Ce.createDefaultDevices(),Ce.createSpecialDirectories(),Ce.filesystems={MEMFS:Se}},init(e,t,r){Ce.init.initialized=!0,u.stdin=e||u.stdin,u.stdout=t||u.stdout,u.stderr=r||u.stderr,Ce.createStandardStreams()},quit(){Ce.init.initialized=!1;for(var e=0;e<Ce.streams.length;e++){var t=Ce.streams[e];t&&Ce.close(t)}},findObject(e,t){var r=Ce.analyzePath(e,t);return r.exists?r.object:null},analyzePath(e,t){try{e=(n=Ce.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Ce.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=de.basename(e),n=Ce.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath(e,t,r,n){e="string"==typeof e?e:Ce.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=de.join2(e,i);try{Ce.mkdir(a)}catch(e){}e=a}}return a},createFile(e,t,r,n,o){var i=de.join2("string"==typeof e?e:Ce.getPath(e),t),a=_e(n,o);return Ce.create(i,a)},createDataFile(e,t,r,n,o,i){var a=t;e&&(e="string"==typeof e?e:Ce.getPath(e),a=t?de.join2(e,t):e);var s=_e(n,o),u=Ce.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,d=r.length;l<d;++l)c[l]=r.charCodeAt(l);r=c}Ce.chmod(u,146|s);var f=Ce.open(u,577);Ce.write(f,r,0,r.length,0,i),Ce.close(f),Ce.chmod(u,s)}},createDevice(e,t,r,n){var o=de.join2("string"==typeof e?e:Ce.getPath(e),t),i=_e(!!r,!!n);Ce.createDevice.major||(Ce.createDevice.major=64);var a=Ce.makedev(Ce.createDevice.major++,0);return Ce.registerDevice(a,{open(e){e.seekable=!1},close(e){n?.buffer?.length&&n(10)},read(e,t,n,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new Ce.ErrnoError(29)}if(void 0===u&&0===a)throw new Ce.ErrnoError(6);if(null==u)break;a++,t[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write(e,t,r,o,i){for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new Ce.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),Ce.mkdev(o,i,a)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!c)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=be(c(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Ce.ErrnoError(29)}},createLazyFile(e,t,r,n,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var s=this;s.setDataGetter((e=>{var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):be(o.responseText||"",!0)})(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,_("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!y)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var u=Ce.createFile(e,t,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function l(e,t,r,n,o){var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)t[r+s]=i[o+s];else for(s=0;s<a;s++)t[r+s]=i.get(o+s);return a}return Object.keys(u.stream_ops).forEach((e=>{var t=u.stream_ops[e];c[e]=function(){return Ce.forceLoadFile(u),t.apply(null,arguments)}})),c.read=(e,t,r,n,o)=>(Ce.forceLoadFile(u),l(e,t,r,n,o)),c.mmap=(e,t,r,n,o)=>{Ce.forceLoadFile(u);var i=Ee(t);if(!i)throw new Ce.ErrnoError(48);return l(e,A,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=c,u}},xe=(e,t)=>e?me(F,e,t):"",Ae={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(de.isAbs(t))return t;var n;if(n=-100===e?Ce.cwd():Ae.getStreamFromFD(e).path,0==t.length){if(!r)throw new Ce.ErrnoError(44);return n}return de.join2(n,t)},doStat(e,t,r){var n=e(t);D[r>>2]=n.dev,D[r+4>>2]=n.mode,L[r+8>>2]=n.nlink,D[r+12>>2]=n.uid,D[r+16>>2]=n.gid,D[r+20>>2]=n.rdev,M[r+24>>3]=BigInt(n.size),D[r+32>>2]=4096,D[r+36>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),a=n.ctime.getTime();return M[r+40>>3]=BigInt(Math.floor(o/1e3)),L[r+48>>2]=o%1e3*1e3,M[r+56>>3]=BigInt(Math.floor(i/1e3)),L[r+64>>2]=i%1e3*1e3,M[r+72>>3]=BigInt(Math.floor(a/1e3)),L[r+80>>2]=a%1e3*1e3,M[r+88>>3]=BigInt(n.ino),0},doMsync(e,t,r,n,o){if(!Ce.isFile(t.node.mode))throw new Ce.ErrnoError(43);if(2&n)return 0;var i=F.slice(e,e+r);Ce.msync(t,i,o,r,n)},varargs:void 0,get(){var e=D[+Ae.varargs>>2];return Ae.varargs+=4,e},getp:()=>Ae.get(),getStr:e=>xe(e),getStreamFromFD:e=>Ce.getStreamChecked(e)},Te={},Fe=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function Pe(e){return this.fromWireType(D[e>>2])}var Be,De,Le,Re={},Me={},Ie={},Oe=e=>{throw new Be(e)},$e=(e,t,r)=>{function n(t){var n=r(t);n.length!==e.length&&Oe("Mismatched type converter count");for(var o=0;o<e.length;++o)Ve(e[o],n[o])}e.forEach((function(e){Ie[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach(((e,t)=>{Me.hasOwnProperty(e)?o[t]=Me[e]:(i.push(e),Re.hasOwnProperty(e)||(Re[e]=[]),Re[e].push((()=>{o[t]=Me[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)},Ue={},qe=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},Ne=e=>{for(var t="",r=e;F[r];)t+=De[F[r++]];return t},He=e=>{throw new Le(e)};function Ve(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,r={}){var n=t.name;if(e||He(`type "${n}" must have a positive integer typeid pointer`),Me.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;He(`Cannot register type '${n}' twice`)}if(Me[e]=t,delete Ie[e],Re.hasOwnProperty(e)){var o=Re[e];delete Re[e],o.forEach((e=>e()))}}(e,t,r)}var We,Ge=(e,t,r)=>{switch(t){case 1:return r?e=>A[e>>0]:e=>F[e>>0];case 2:return r?e=>P[e>>1]:e=>B[e>>1];case 4:return r?e=>D[e>>2]:e=>L[e>>2];case 8:return r?e=>M[e>>3]:e=>I[e>>3];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},je=8,ze=e=>{He(e.$$.ptrType.registeredClass.name+" instance already deleted")},Xe=!1,Ye=e=>{},Ke=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Qe=(e,t,r)=>{if(t===r)return e;if(void 0===r.baseClass)return null;var n=Qe(e,t,r.baseClass);return null===n?null:r.downcast(n)},Ze={},Je=()=>Object.keys(ot).length,et=()=>{var e=[];for(var t in ot)ot.hasOwnProperty(t)&&e.push(ot[t]);return e},tt=[],rt=()=>{for(;tt.length;){var e=tt.pop();e.$$.deleteScheduled=!1,e.delete()}},nt=e=>{We=e,tt.length&&We&&We(rt)},ot={},it=(e,t)=>(t=((e,t)=>{for(void 0===t&&He("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),ot[t]),at=(e,t)=>(t.ptrType&&t.ptr||Oe("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Oe("Both smartPtrType and smartPtr must be specified"),t.count={value:1},ut(Object.create(e,{$$:{value:t,writable:!0}})));function st(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=it(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?at(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):at(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=Ze[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=Qe(t,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?at(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):at(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}var ut=e=>"undefined"==typeof FinalizationRegistry?(ut=e=>e,e):(Xe=new FinalizationRegistry((e=>{Ke(e.$$)})),Ye=e=>Xe.unregister(e),(ut=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Xe.register(e,r,e)}return e})(e));function ct(){}var lt=(e,t)=>Object.defineProperty(t,"name",{value:e}),dt=(e,t,r)=>{if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||He(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},ft=(e,t,r)=>{u.hasOwnProperty(e)?((void 0===r||void 0!==u[e].overloadTable&&void 0!==u[e].overloadTable[r])&&He(`Cannot register public name '${e}' twice`),dt(u,e,e),u.hasOwnProperty(r)&&He(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),u[e].overloadTable[r]=t):(u[e]=t,void 0!==r&&(u[e].numArguments=r))};function ht(e,t,r,n,o,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}var pt=(e,t,r)=>{for(;t!==r;)t.upcast||He(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function mt(e,t){if(null===t)return this.isReference&&He(`null is not a valid ${this.name}`),0;t.$$||He(`Cannot pass "${qe(t)}" as a ${this.name}`),t.$$.ptr||He(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return pt(t.$$.ptr,r,this.registeredClass)}function gt(e,t){var r;if(null===t)return this.isReference&&He(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t&&t.$$||He(`Cannot pass "${qe(t)}" as a ${this.name}`),t.$$.ptr||He(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&He(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=pt(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&He("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:He(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,Mt.toHandle((()=>o.delete()))),null!==e&&e.push(this.rawDestructor,r)}break;default:He("Unsupporting sharing policy")}return r}function yt(e,t){if(null===t)return this.isReference&&He(`null is not a valid ${this.name}`),0;t.$$||He(`Cannot pass "${qe(t)}" as a ${this.name}`),t.$$.ptr||He(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&He(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return pt(t.$$.ptr,r,this.registeredClass)}function vt(e){return this.fromWireType(L[e>>2])}function bt(e,t,r,n,o,i,a,s,u,c,l){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,o||void 0!==t.baseClass?this.toWireType=gt:n?(this.toWireType=mt,this.destructorFunction=null):(this.toWireType=yt,this.destructorFunction=null)}var wt,Et,St=(e,t,r)=>{u.hasOwnProperty(e)||Oe("Replacing nonexistant public symbol"),void 0!==u[e].overloadTable&&void 0!==r?u[e].overloadTable[r]=t:(u[e]=t,u[e].argCount=r)},kt=[],_t=e=>{var t=kt[e];return t||(e>=kt.length&&(kt.length=e+1),kt[e]=t=wt.get(e)),t},Ct=(e,t)=>{e=Ne(e);var r=_t(t);return"function"!=typeof r&&He(`unknown function pointer with signature ${e}: ${t}`),r},xt=e=>{var t=Mu(e),r=Ne(t);return Bu(t),r},At=(e,t)=>{var r=[],n={};throw t.forEach((function e(t){n[t]||Me[t]||(Ie[t]?Ie[t].forEach(e):(r.push(t),n[t]=!0))})),new Et(`${e}: `+r.map(xt).join([", "]))},Tt=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(L[t+4*n>>2]);return r};function Ft(e,t,r,n,o,i){var a=t.length;a<2&&He("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==t[1]&&null!==r,u=function(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].destructorFunction)return!0;return!1}(t),c="void"!==t[0].name,l=a-2,d=new Array(l),f=[],h=[];return lt(e,(function(){var r;arguments.length!==l&&He(`function ${e} called with ${arguments.length} arguments, expected ${l}`),h.length=0,f.length=s?2:1,f[0]=o,s&&(r=t[1].toWireType(h,this),f[1]=r);for(var i=0;i<l;++i)d[i]=t[i+2].toWireType(h,arguments[i]),f.push(d[i]);return function(e){if(u)Fe(h);else for(var n=s?1:2;n<t.length;n++){var o=1===n?r:d[n-2];null!==t[n].destructorFunction&&t[n].destructorFunction(o)}if(c)return t[0].fromWireType(e)}(n.apply(null,f))}))}var Pt,Bt=e=>{const t=(e=e.trim()).indexOf("(");return-1!==t?e.substr(0,t):e},Dt=new class HandleAllocator{constructor(){this.allocated=[void 0],this.freelist=[]}get(e){return this.allocated[e]}has(e){return void 0!==this.allocated[e]}allocate(e){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=e,t}free(e){this.allocated[e]=void 0,this.freelist.push(e)}},Lt=e=>{e>=Dt.reserved&&0==--Dt.get(e).refcount&&Dt.free(e)},Rt=()=>{for(var e=0,t=Dt.reserved;t<Dt.allocated.length;++t)void 0!==Dt.allocated[t]&&++e;return e},Mt={toValue:e=>(e||He("Cannot use deleted val. handle = "+e),Dt.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return Dt.allocate({refcount:1,value:e})}}},It={name:"emscripten::val",fromWireType:e=>{var t=Mt.toValue(e);return Lt(e),t},toWireType:(e,t)=>Mt.toHandle(t),argPackAdvance:je,readValueFromPointer:Pe,destructorFunction:null},Ot=(e,t,r)=>{switch(t){case 1:return r?function(e){return this.fromWireType(A[e>>0])}:function(e){return this.fromWireType(F[e>>0])};case 2:return r?function(e){return this.fromWireType(P[e>>1])}:function(e){return this.fromWireType(B[e>>1])};case 4:return r?function(e){return this.fromWireType(D[e>>2])}:function(e){return this.fromWireType(L[e>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},$t=(e,t)=>{var r=Me[e];return void 0===r&&He(t+" has unknown type "+xt(e)),r},Ut=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(R[e>>2])};case 8:return function(e){return this.fromWireType(O[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},qt=(e,t,r)=>ve(e,F,t,r),Nt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Ht=(e,t)=>{for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&B[n];)++n;if((r=n<<1)-e>32&&Nt)return Nt.decode(F.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=P[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i},Vt=(e,t,r)=>{if(r??=2147483647,r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);P[t>>1]=a,t+=2}return P[t>>1]=0,t-n},Wt=e=>2*e.length,Gt=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var o=D[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n},jt=(e,t,r)=>{if(r??=2147483647,r<4)return 0;for(var n=t,o=n+r-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),D[t>>2]=a,(t+=4)+4>o)break}return D[t>>2]=0,t-n},zt=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t},Xt=(e,t,r)=>{var n=[],o=e.toWireType(n,r);return n.length&&(L[t>>2]=Mt.toHandle(n)),o},Yt=[],Kt={},Qt=e=>{var t=Kt[e];return void 0===t?Ne(e):t},Zt=()=>{if("object"==typeof globalThis)return globalThis;function e(e){e.$$$embind_global$$$=e;var t="object"==typeof $$$embind_global$$$&&e.$$$embind_global$$$==e;return t||delete e.$$$embind_global$$$,t}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof global&&e(global)?$$$embind_global$$$=global:"object"==typeof self&&e(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")},Jt=Reflect.construct,er=e=>e<-9007199254740992||e>9007199254740992?NaN:Number(e),tr=e=>e%4==0&&(e%100!=0||e%400==0),rr=[0,31,60,91,121,152,182,213,244,274,305,335],nr=[0,31,59,90,120,151,181,212,243,273,304,334],or=e=>(tr(e.getFullYear())?rr:nr)[e.getMonth()]+e.getDate()-1,ir=e=>{var t=ye(e)+1,r=Fu(t);return r&&qt(e,r,t),r},ar=(e,t)=>{if(hr.mainLoop.timingMode=e,hr.mainLoop.timingValue=t,!hr.mainLoop.func)return 1;if(hr.mainLoop.running||(hr.mainLoop.running=!0),0==e)hr.mainLoop.scheduler=function(){var e=0|Math.max(0,hr.mainLoop.tickStartTime+t-Pt());setTimeout(hr.mainLoop.runner,e)},hr.mainLoop.method="timeout";else if(1==e)hr.mainLoop.scheduler=function(){hr.requestAnimationFrame(hr.mainLoop.runner)},hr.mainLoop.method="rAF";else if(2==e){if(void 0===hr.setImmediate)if("undefined"==typeof setImmediate){var r=[],n="setimmediate";addEventListener("message",(e=>{e.data!==n&&e.data.target!==n||(e.stopPropagation(),r.shift()())}),!0),hr.setImmediate=function(e){r.push(e),y?(void 0===u.setImmediates&&(u.setImmediates=[]),u.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}else hr.setImmediate=setImmediate;hr.mainLoop.scheduler=function(){hr.setImmediate(hr.mainLoop.runner)},hr.mainLoop.method="immediate"}return 0};Pt=()=>performance.now();var sr=e=>{if(e instanceof ie||"unwind"==e)return x;m(1,e)},ur=()=>se||!1,cr=(e,t)=>{var r;x=e,x=r=e,ur()||(u.onExit?.(r),$=!0),m(r,new ie(r))},lr=cr,dr=e=>{if(!$)try{e(),(()=>{if(!ur())try{lr(x)}catch(e){sr(e)}})()}catch(e){sr(e)}},fr=(e,t)=>setTimeout((()=>{dr(e)}),t),hr={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause(){hr.mainLoop.scheduler=null,hr.mainLoop.currentlyRunningMainloop++},resume(){hr.mainLoop.currentlyRunningMainloop++;var e=hr.mainLoop.timingMode,t=hr.mainLoop.timingValue,r=hr.mainLoop.func;hr.mainLoop.func=null,((e,t,r,n,o)=>{U(!hr.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),hr.mainLoop.func=e,hr.mainLoop.arg=n;var i=hr.mainLoop.currentlyRunningMainloop;function a(){return!(i<hr.mainLoop.currentlyRunningMainloop)}if(hr.mainLoop.running=!1,hr.mainLoop.runner=function(){if(!$)if(hr.mainLoop.queue.length>0){Date.now();var t=hr.mainLoop.queue.shift();if(t.func(t.arg),hr.mainLoop.remainingBlockers){var r=hr.mainLoop.remainingBlockers,n=r%1==0?r-1:Math.floor(r);t.counted?hr.mainLoop.remainingBlockers=n:(n+=.5,hr.mainLoop.remainingBlockers=(8*r+n)/9)}if(hr.mainLoop.updateStatus(),!a())return;setTimeout(hr.mainLoop.runner,0)}else a()&&(hr.mainLoop.currentFrameNumber=hr.mainLoop.currentFrameNumber+1|0,1==hr.mainLoop.timingMode&&hr.mainLoop.timingValue>1&&hr.mainLoop.currentFrameNumber%hr.mainLoop.timingValue!=0?hr.mainLoop.scheduler():(0==hr.mainLoop.timingMode&&(hr.mainLoop.tickStartTime=Pt()),hr.mainLoop.runIter(e),a()&&("object"==typeof SDL&&SDL.audio?.queueNewAudioData?.(),hr.mainLoop.scheduler())))},o||(t&&t>0?ar(0,1e3/t):ar(1,1),hr.mainLoop.scheduler()),r)throw"unwind"})(r,0,!1,hr.mainLoop.arg,!0),ar(e,t),hr.mainLoop.scheduler()},updateStatus(){if(u.setStatus){var e=u.statusMessage||"Please wait...",t=hr.mainLoop.remainingBlockers,r=hr.mainLoop.expectedBlockers;t?t<r?u.setStatus(e+" ("+(r-t)+"/"+r+")"):u.setStatus(e):u.setStatus("")}},runIter(e){if(!$){if(u.preMainLoop&&!1===u.preMainLoop())return;dr(e),u.postMainLoop?.()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init(){if(!hr.initted){hr.initted=!0;var e={canHandle:function(e){return!u.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,n){var o=new Blob([e],{type:hr.getMimetype(t)});o.size!==e.length&&(o=new Blob([new Uint8Array(e).buffer],{type:hr.getMimetype(t)}));var i=URL.createObjectURL(o),a=new Image;a.onload=()=>{U(a.complete,`Image ${t} could not be decoded`);var n=document.createElement("canvas");n.width=a.width,n.height=a.height,n.getContext("2d").drawImage(a,0,0),Eu[t]=n,URL.revokeObjectURL(i),r?.(e)},a.onerror=e=>{C(`Image ${i} could not be decoded`),n?.()},a.src=i}};ke.push(e);var t={canHandle:function(e){return!u.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,t,r,n){var o=!1;function i(n){o||(o=!0,Su[t]=n,r?.(e))}var a=new Blob([e],{type:hr.getMimetype(t)}),s=URL.createObjectURL(a),u=new Audio;u.addEventListener("canplaythrough",(()=>i(u)),!1),u.onerror=function(r){o||(C(`warning: browser could not fully decode audio ${t}, trying slower base64 approach`),u.src="data:audio/x-"+t.substr(-3)+";base64,"+function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="",n=0,o=0,i=0;i<e.length;i++)for(n=n<<8|e[i],o+=8;o>=6;){var a=n>>o-6&63;o-=6,r+=t[a]}return 2==o?(r+=t[(3&n)<<4],r+="=="):4==o&&(r+=t[(15&n)<<2],r+="="),r}(e),i(u))},u.src=s,fr((()=>{i(u)}),1e4)}};ke.push(t);var r=u.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||(()=>{}),r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||(()=>{}),r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("mspointerlockchange",n,!1),u.elementPointerLock&&r.addEventListener("click",(e=>{!hr.pointerLock&&u.canvas.requestPointerLock&&(u.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){hr.pointerLock=document.pointerLockElement===u.canvas||document.mozPointerLockElement===u.canvas||document.webkitPointerLockElement===u.canvas||document.msPointerLockElement===u.canvas}},createContext(e,t,r,n){if(t&&u.ctx&&e==u.canvas)return u.ctx;var o,i;if(t){var a={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(n)for(var s in n)a[s]=n[s];void 0!==mr&&(i=mr.createContext(e,a))&&(o=mr.getContext(i).GLctx)}else o=e.getContext("2d");return o?(r&&(t||U(void 0===wu,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),u.ctx=o,t&&mr.makeContextCurrent(i),u.useWebGL=t,hr.moduleContextCreatedCallbacks.forEach((e=>e())),hr.init()),o):null},destroyContext(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen(e,t){hr.lockPointer=e,hr.resizeCanvas=t,void 0===hr.lockPointer&&(hr.lockPointer=!0),void 0===hr.resizeCanvas&&(hr.resizeCanvas=!1);var r=u.canvas;function n(){hr.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=hr.exitFullscreen,hr.lockPointer&&r.requestPointerLock(),hr.isFullscreen=!0,hr.resizeCanvas?hr.setFullscreenCanvasSize():hr.updateCanvasDimensions(r)):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),hr.resizeCanvas?hr.setWindowedCanvasSize():hr.updateCanvasDimensions(r)),u.onFullScreen?.(hr.isFullscreen),u.onFullscreen?.(hr.isFullscreen)}hr.fullscreenHandlersInstalled||(hr.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var o=document.createElement("div");r.parentNode.insertBefore(o,r),o.appendChild(r),o.requestFullscreen=o.requestFullscreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullscreen?()=>o.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(o.webkitRequestFullScreen?()=>o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null),o.requestFullscreen()},exitFullscreen:()=>!!hr.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{})).apply(document,[]),!0),nextRAF:0,fakeRequestAnimationFrame(e){var t=Date.now();if(0===hr.nextRAF)hr.nextRAF=t+1e3/60;else for(;t+2>=hr.nextRAF;)hr.nextRAF+=1e3/60;var r=Math.max(hr.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame(e){"function"!=typeof requestAnimationFrame?(0,hr.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:(e,t)=>fr(e,t),safeRequestAnimationFrame:e=>hr.requestAnimationFrame((()=>{dr(e)})),getMimetype:e=>({jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]),getUserMedia(e){window.getUserMedia||=navigator.getUserMedia||navigator.mozGetUserMedia,window.getUserMedia(e)},getMovementX:e=>e.movementX||e.mozMovementX||e.webkitMovementX||0,getMovementY:e=>e.movementY||e.mozMovementY||e.webkitMovementY||0,getMouseWheelDelta(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail/3;break;case"mousewheel":t=e.wheelDelta/120;break;case"wheel":switch(t=e.deltaY,e.deltaMode){case 0:t/=100;break;case 1:t/=3;break;case 2:t*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseCoords(e,t){var r=u.canvas.getBoundingClientRect(),n=u.canvas.width,o=u.canvas.height,i=void 0!==window.scrollX?window.scrollX:window.pageXOffset,a=void 0!==window.scrollY?window.scrollY:window.pageYOffset,s=e-(i+r.left),c=t-(a+r.top);return{x:s*=n/r.width,y:c*=o/r.height}},setMouseCoords(e,t){const{x:r,y:n}=hr.calculateMouseCoords(e,t);hr.mouseMovementX=r-hr.mouseX,hr.mouseMovementY=n-hr.mouseY,hr.mouseX=r,hr.mouseY=n},calculateMouseEvent(e){if(hr.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?hr.mouseMovementX=hr.mouseMovementY=0:(hr.mouseMovementX=hr.getMovementX(e),hr.mouseMovementY=hr.getMovementY(e)),"undefined"!=typeof SDL?(hr.mouseX=SDL.mouseX+hr.mouseMovementX,hr.mouseY=SDL.mouseY+hr.mouseMovementY):(hr.mouseX+=hr.mouseMovementX,hr.mouseY+=hr.mouseMovementY);else{if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var t=e.touch;if(void 0===t)return;var r=hr.calculateMouseCoords(t.pageX,t.pageY);if("touchstart"===e.type)hr.lastTouches[t.identifier]=r,hr.touches[t.identifier]=r;else if("touchend"===e.type||"touchmove"===e.type){var n=hr.touches[t.identifier];n||=r,hr.lastTouches[t.identifier]=n,hr.touches[t.identifier]=r}return}hr.setMouseCoords(e.pageX,e.pageY)}},resizeListeners:[],updateResizeListeners(){var e=u.canvas;hr.resizeListeners.forEach((t=>t(e.width,e.height)))},setCanvasSize(e,t,r){var n=u.canvas;hr.updateCanvasDimensions(n,e,t),r||hr.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if("undefined"!=typeof SDL){var e=L[SDL.screen>>2];e|=8388608,D[SDL.screen>>2]=e}hr.updateCanvasDimensions(u.canvas),hr.updateResizeListeners()},setWindowedCanvasSize(){if("undefined"!=typeof SDL){var e=L[SDL.screen>>2];e&=-8388609,D[SDL.screen>>2]=e}hr.updateCanvasDimensions(u.canvas),hr.updateResizeListeners()},updateCanvasDimensions(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var n=t,o=r;if(u.forcedAspectRatio&&u.forcedAspectRatio>0&&(n/o<u.forcedAspectRatio?n=Math.round(o*u.forcedAspectRatio):o=Math.round(n/u.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var i=Math.min(screen.width/n,screen.height/o);n=Math.round(n*i),o=Math.round(o*i)}hr.resizeCanvas?(e.width!=n&&(e.width=n),e.height!=o&&(e.height=o),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),void 0!==e.style&&(n!=t||o!=r?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",o+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}},pr={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode(e){pr.errorCode=e},chooseConfig(e,t,r,n,o){if(62e3!=e)return pr.setErrorCode(12296),0;if(t)for(;;){var i=D[t>>2];if(12321==i){var a=D[t+4>>2];pr.contextAttributes.alpha=a>0}else if(12325==i){var s=D[t+4>>2];pr.contextAttributes.depth=s>0}else if(12326==i){var u=D[t+4>>2];pr.contextAttributes.stencil=u>0}else if(12337==i){var c=D[t+4>>2];pr.contextAttributes.antialias=c>0}else if(12338==i)c=D[t+4>>2],pr.contextAttributes.antialias=1==c;else if(12544==i){var l=D[t+4>>2];pr.contextAttributes.lowLatency=12547!=l}else if(12344==i)break;t+=8}return r&&n||o?(o&&(D[o>>2]=1),r&&n>0&&(L[r>>2]=62002),pr.setErrorCode(12288),1):(pr.setErrorCode(12300),0)}},mr={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){mr.lastError||(mr.lastError=e)},getNewId:e=>{for(var t=mr.counter++,r=e.length;r<t;r++)e[r]=null;return t},getSource:(e,t,r,n)=>{for(var o="",i=0;i<t;++i){var a=n?L[n+4*i>>2]:void 0;o+=xe(L[r+4*i>>2],a)}return o},createContext:(e,t)=>{if(!e.getContextSafariWebGL2Fixed){let t=function(t,r){var n=e.getContextSafariWebGL2Fixed(t,r);return"webgl"==t==n instanceof WebGLRenderingContext?n:null};e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=t}var r=t.majorVersion>1?e.getContext("webgl2",t):e.getContext("webgl",t);return r?mr.registerContext(r,t):0},registerContext:(e,t)=>{var r=mr.getNewId(mr.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),mr.contexts[r]=n,r},makeContextCurrent:e=>(mr.currentContext=mr.contexts[e],u.ctx=wu=mr.currentContext?.GLctx,!(e&&!wu)),getContext:e=>mr.contexts[e],deleteContext:e=>{mr.currentContext===mr.contexts[e]&&(mr.currentContext=null),"object"==typeof ou&&ou.removeAllHandlersOnTarget(mr.contexts[e].GLctx.canvas),mr.contexts[e]&&mr.contexts[e].GLctx.canvas&&(mr.contexts[e].GLctx.canvas.GLctxObject=void 0),mr.contexts[e]=null}},gr=[],yr=(e,t,r)=>{var n=((e,t)=>{var r;for(gr.length=0;r=F[e++];){var n=105!=r;t+=(n&=112!=r)&&t%8?4:0,gr.push(112==r?L[t>>2]:106==r?M[t>>3]:105==r?D[t>>2]:O[t>>3]),t+=n?8:4}return gr})(t,r);return oe[e].apply(null,n)},vr=function(e){wu.activeTexture(e)},br=(e,t)=>{wu.attachShader(mr.programs[e],mr.shaders[t])},wr=(e,t)=>{wu.beginQuery(e,mr.queries[t])},Er=(e,t)=>{wu.disjointTimerQueryExt.beginQueryEXT(e,mr.queries[t])},Sr=function(e){wu.beginTransformFeedback(e)},kr=(e,t,r)=>{wu.bindAttribLocation(mr.programs[e],t,xe(r))},_r=(e,t)=>{35051==e?wu.currentPixelPackBufferBinding=t:35052==e&&(wu.currentPixelUnpackBufferBinding=t),wu.bindBuffer(e,mr.buffers[t])},Cr=(e,t,r)=>{wu.bindBufferBase(e,t,mr.buffers[r])},xr=(e,t,r,n,o)=>{wu.bindBufferRange(e,t,mr.buffers[r],n,o)},Ar=(e,t)=>{wu.bindFramebuffer(e,mr.framebuffers[t])},Tr=(e,t)=>{wu.bindRenderbuffer(e,mr.renderbuffers[t])},Fr=(e,t)=>{wu.bindSampler(e,mr.samplers[t])},Pr=(e,t)=>{wu.bindTexture(e,mr.textures[t])},Br=(e,t)=>{wu.bindTransformFeedback(e,mr.transformFeedbacks[t])},Dr=e=>{wu.bindVertexArray(mr.vaos[e])},Lr=Dr,Rr=Dr,Mr=function(e,t,r,n){wu.blendColor(e,t,r,n)},Ir=function(e){wu.blendEquation(e)},Or=function(e,t){wu.blendEquationSeparate(e,t)},$r=function(e,t){wu.blendFunc(e,t)},Ur=function(e,t,r,n){wu.blendFuncSeparate(e,t,r,n)},qr=function(e,t,r,n,o,i,a,s,u,c){wu.blitFramebuffer(e,t,r,n,o,i,a,s,u,c)},Nr=(e,t,r,n)=>{mr.currentContext.version>=2?r&&t?wu.bufferData(e,F,n,r,t):wu.bufferData(e,t,n):wu.bufferData(e,r?F.subarray(r,r+t):t,n)},Hr=(e,t,r,n)=>{mr.currentContext.version>=2?r&&wu.bufferSubData(e,t,F,n,r):wu.bufferSubData(e,t,F.subarray(n,n+r))},Vr=function(e){return wu.checkFramebufferStatus(e)},Wr=function(e){wu.clear(e)},Gr=function(e,t,r,n){wu.clearBufferfi(e,t,r,n)},jr=(e,t,r)=>{wu.clearBufferfv(e,t,R,r>>2)},zr=(e,t,r)=>{wu.clearBufferiv(e,t,D,r>>2)},Xr=(e,t,r)=>{wu.clearBufferuiv(e,t,L,r>>2)},Yr=function(e,t,r,n){wu.clearColor(e,t,r,n)},Kr=function(e){wu.clearDepth(e)},Qr=function(e){wu.clearStencil(e)},Zr=(e,t,r)=>(r=Number(r),wu.clientWaitSync(mr.syncs[e],t,r)),Jr=(e,t,r,n)=>{wu.colorMask(!!e,!!t,!!r,!!n)},en=e=>{wu.compileShader(mr.shaders[e])},tn=(e,t,r,n,o,i,a,s)=>{mr.currentContext.version>=2?wu.currentPixelUnpackBufferBinding||!a?wu.compressedTexImage2D(e,t,r,n,o,i,a,s):wu.compressedTexImage2D(e,t,r,n,o,i,F,s,a):wu.compressedTexImage2D(e,t,r,n,o,i,s?F.subarray(s,s+a):null)},rn=(e,t,r,n,o,i,a,s,u)=>{wu.currentPixelUnpackBufferBinding?wu.compressedTexImage3D(e,t,r,n,o,i,a,s,u):wu.compressedTexImage3D(e,t,r,n,o,i,a,F,u,s)},nn=(e,t,r,n,o,i,a,s,u)=>{mr.currentContext.version>=2?wu.currentPixelUnpackBufferBinding||!s?wu.compressedTexSubImage2D(e,t,r,n,o,i,a,s,u):wu.compressedTexSubImage2D(e,t,r,n,o,i,a,F,u,s):wu.compressedTexSubImage2D(e,t,r,n,o,i,a,u?F.subarray(u,u+s):null)},on=(e,t,r,n,o,i,a,s,u,c,l)=>{wu.currentPixelUnpackBufferBinding?wu.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,c,l):wu.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,F,l,c)},an=function(e,t,r,n,o){wu.copyBufferSubData(e,t,r,n,o)},sn=function(e,t,r,n,o,i,a,s){wu.copyTexImage2D(e,t,r,n,o,i,a,s)},un=function(e,t,r,n,o,i,a,s){wu.copyTexSubImage2D(e,t,r,n,o,i,a,s)},cn=function(e,t,r,n,o,i,a,s,u){wu.copyTexSubImage3D(e,t,r,n,o,i,a,s,u)},ln=()=>{var e=mr.getNewId(mr.programs),t=wu.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,mr.programs[e]=t,e},dn=e=>{var t=mr.getNewId(mr.shaders);return mr.shaders[t]=wu.createShader(e),t},fn=function(e){wu.cullFace(e)},hn=(e,t)=>{for(var r=0;r<e;r++){var n=D[t+4*r>>2],o=mr.buffers[n];o&&(wu.deleteBuffer(o),o.name=0,mr.buffers[n]=null,n==wu.currentPixelPackBufferBinding&&(wu.currentPixelPackBufferBinding=0),n==wu.currentPixelUnpackBufferBinding&&(wu.currentPixelUnpackBufferBinding=0))}},pn=(e,t)=>{for(var r=0;r<e;++r){var n=D[t+4*r>>2],o=mr.framebuffers[n];o&&(wu.deleteFramebuffer(o),o.name=0,mr.framebuffers[n]=null)}},mn=e=>{if(e){var t=mr.programs[e];t?(wu.deleteProgram(t),t.name=0,mr.programs[e]=null):mr.recordError(1281)}},gn=(e,t)=>{for(var r=0;r<e;r++){var n=D[t+4*r>>2],o=mr.queries[n];o&&(wu.deleteQuery(o),mr.queries[n]=null)}},yn=(e,t)=>{for(var r=0;r<e;r++){var n=D[t+4*r>>2],o=mr.queries[n];o&&(wu.disjointTimerQueryExt.deleteQueryEXT(o),mr.queries[n]=null)}},vn=(e,t)=>{for(var r=0;r<e;r++){var n=D[t+4*r>>2],o=mr.renderbuffers[n];o&&(wu.deleteRenderbuffer(o),o.name=0,mr.renderbuffers[n]=null)}},bn=(e,t)=>{for(var r=0;r<e;r++){var n=D[t+4*r>>2],o=mr.samplers[n];o&&(wu.deleteSampler(o),o.name=0,mr.samplers[n]=null)}},wn=e=>{if(e){var t=mr.shaders[e];t?(wu.deleteShader(t),mr.shaders[e]=null):mr.recordError(1281)}},En=e=>{if(e){var t=mr.syncs[e];t?(wu.deleteSync(t),t.name=0,mr.syncs[e]=null):mr.recordError(1281)}},Sn=(e,t)=>{for(var r=0;r<e;r++){var n=D[t+4*r>>2],o=mr.textures[n];o&&(wu.deleteTexture(o),o.name=0,mr.textures[n]=null)}},kn=(e,t)=>{for(var r=0;r<e;r++){var n=D[t+4*r>>2],o=mr.transformFeedbacks[n];o&&(wu.deleteTransformFeedback(o),o.name=0,mr.transformFeedbacks[n]=null)}},_n=(e,t)=>{for(var r=0;r<e;r++){var n=D[t+4*r>>2];wu.deleteVertexArray(mr.vaos[n]),mr.vaos[n]=null}},Cn=_n,xn=_n,An=function(e){wu.depthFunc(e)},Tn=e=>{wu.depthMask(!!e)},Fn=function(e,t){wu.depthRange(e,t)},Pn=(e,t)=>{wu.detachShader(mr.programs[e],mr.shaders[t])},Bn=function(e){wu.disable(e)},Dn=e=>{wu.disableVertexAttribArray(e)},Ln=(e,t,r)=>{wu.drawArrays(e,t,r)},Rn=(e,t,r,n)=>{wu.drawArraysInstanced(e,t,r,n)},Mn=Rn,In=Rn,On=Rn,$n=(e,t,r,n,o)=>{wu.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,t,r,n,o)},Un=Rn,qn=Rn,Nn=[],Hn=(e,t)=>{for(var r=Nn[e],n=0;n<e;n++)r[n]=D[t+4*n>>2];wu.drawBuffers(r)},Vn=Hn,Wn=Hn,Gn=Hn,jn=(e,t,r,n)=>{wu.drawElements(e,t,r,n)},zn=jn,Xn=(e,t,r,n,o)=>{wu.drawElementsInstanced(e,t,r,n,o)},Yn=Xn,Kn=Xn,Qn=Xn,Zn=(e,t,r,n,o,i,a)=>{wu.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,t,r,n,o,i,a)},Jn=Xn,eo=Xn,to=(e,t,r,n,o,i)=>{jn(e,n,o,i)},ro=function(e){wu.enable(e)},no=e=>{wu.enableVertexAttribArray(e)},oo=function(e){wu.endQuery(e)},io=e=>{wu.disjointTimerQueryExt.endQueryEXT(e)},ao=function(){wu.endTransformFeedback()},so=(e,t)=>{var r=wu.fenceSync(e,t);if(r){var n=mr.getNewId(mr.syncs);return r.name=n,mr.syncs[n]=r,n}return 0},uo=function(){wu.finish()},co=function(){wu.flush()},lo=(e,t,r,n)=>{wu.framebufferRenderbuffer(e,t,r,mr.renderbuffers[n])},fo=(e,t,r,n,o)=>{wu.framebufferTexture2D(e,t,r,mr.textures[n],o)},ho=(e,t,r,n,o)=>{wu.framebufferTextureLayer(e,t,mr.textures[r],n,o)},po=function(e){wu.frontFace(e)},mo=(e,t,r,n)=>{for(var o=0;o<e;o++){var i=wu[r](),a=i&&mr.getNewId(n);i?(i.name=a,n[a]=i):mr.recordError(1282),D[t+4*o>>2]=a}},go=(e,t)=>{mo(e,t,"createBuffer",mr.buffers)},yo=(e,t)=>{mo(e,t,"createFramebuffer",mr.framebuffers)},vo=(e,t)=>{mo(e,t,"createQuery",mr.queries)},bo=(e,t)=>{for(var r=0;r<e;r++){var n=wu.disjointTimerQueryExt.createQueryEXT();if(!n){for(mr.recordError(1282);r<e;)D[t+4*r++>>2]=0;return}var o=mr.getNewId(mr.queries);n.name=o,mr.queries[o]=n,D[t+4*r>>2]=o}},wo=(e,t)=>{mo(e,t,"createRenderbuffer",mr.renderbuffers)},Eo=(e,t)=>{mo(e,t,"createSampler",mr.samplers)},So=(e,t)=>{mo(e,t,"createTexture",mr.textures)},ko=(e,t)=>{mo(e,t,"createTransformFeedback",mr.transformFeedbacks)};function _o(e,t){mo(e,t,"createVertexArray",mr.vaos)}var Co,xo,Ao,To=_o,Fo=_o,Po=function(e){wu.generateMipmap(e)},Bo=(e,t,r,n,o,i,a,s)=>{t=mr.programs[t];var u=wu[e](t,r);if(u){var c=s&&qt(u.name,s,n);o&&(D[o>>2]=c),i&&(D[i>>2]=u.size),a&&(D[a>>2]=u.type)}},Do=(e,t,r,n,o,i,a)=>{Bo("getActiveAttrib",e,t,r,n,o,i,a)},Lo=(e,t,r,n,o,i,a)=>{Bo("getActiveUniform",e,t,r,n,o,i,a)},Ro=(e,t,r,n,o)=>{e=mr.programs[e];var i=wu.getActiveUniformBlockName(e,t);if(i)if(o&&r>0){var a=qt(i,o,r);n&&(D[n>>2]=a)}else n&&(D[n>>2]=0)},Mo=(e,t,r,n)=>{if(n)if(e=mr.programs[e],35393!=r){var o=wu.getActiveUniformBlockParameter(e,t,r);if(null!==o)if(35395==r)for(var i=0;i<o.length;i++)D[n+4*i>>2]=o[i];else D[n>>2]=o}else{var a=wu.getActiveUniformBlockName(e,t);D[n>>2]=a.length+1}else mr.recordError(1281)},Io=(e,t,r,n,o)=>{if(o)if(t>0&&0==r)mr.recordError(1281);else{e=mr.programs[e];for(var i=[],a=0;a<t;a++)i.push(D[r+4*a>>2]);var s=wu.getActiveUniforms(e,i,n);if(s){var u=s.length;for(a=0;a<u;a++)D[o+4*a>>2]=s[a]}}else mr.recordError(1281)},Oo=(e,t,r,n)=>{var o=wu.getAttachedShaders(mr.programs[e]),i=o.length;i>t&&(i=t),D[r>>2]=i;for(var a=0;a<i;++a){var s=mr.shaders.indexOf(o[a]);D[n+4*a>>2]=s}},$o=(e,t)=>wu.getAttribLocation(mr.programs[e],xe(t)),Uo=(e,t)=>{L[e>>2]=t;var r=L[e>>2];L[e+4>>2]=(t-r)/4294967296},qo=function(){var e,t=(e=["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_disjoint_timer_query_webgl2","EXT_texture_norm16","WEBGL_clip_cull_distance","EXT_color_buffer_half_float","EXT_float_blend","EXT_texture_compression_bptc","EXT_texture_compression_rgtc","EXT_texture_filter_anisotropic","KHR_parallel_shader_compile","OES_texture_float_linear","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_debug_renderer_info","WEBGL_debug_shaders","WEBGL_lose_context","WEBGL_multi_draw"],(wu.getSupportedExtensions()||[]).filter((t=>e.includes(t))));return t=t.concat(t.map((e=>"GL_"+e)))},No=(e,t,r)=>{if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=r&&1!=r&&mr.recordError(1280));case 34814:case 36345:n=0;break;case 34466:var o=wu.getParameter(34467);n=o?o.length:0;break;case 33309:if(mr.currentContext.version<2)return void mr.recordError(1282);n=qo().length;break;case 33307:case 33308:if(mr.currentContext.version<2)return void mr.recordError(1280);n=33307==e?3:0}if(void 0===n){var i=wu.getParameter(e);switch(typeof i){case"number":n=i;break;case"boolean":n=i?1:0;break;case"string":return void mr.recordError(1280);case"object":if(null===i)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:n=0;break;default:return void mr.recordError(1280)}else{if(i instanceof Float32Array||i instanceof Uint32Array||i instanceof Int32Array||i instanceof Array){for(var a=0;a<i.length;++a)switch(r){case 0:D[t+4*a>>2]=i[a];break;case 2:R[t+4*a>>2]=i[a];break;case 4:A[t+a>>0]=i[a]?1:0}return}try{n=0|i.name}catch(t){return mr.recordError(1280),void C(`GL_INVALID_ENUM in glGet${r}v: Unknown object returned from WebGL getParameter(${e})! (error: ${t})`)}}break;default:return mr.recordError(1280),void C(`GL_INVALID_ENUM in glGet${r}v: Native code calling glGet${r}v(${e}) and it returns ${i} of type ${typeof i}!`)}}switch(r){case 1:Uo(t,n);break;case 0:D[t>>2]=n;break;case 2:R[t>>2]=n;break;case 4:A[t>>0]=n?1:0}}else mr.recordError(1281)},Ho=(e,t)=>No(e,t,4),Vo=(e,t,r)=>{r?Uo(r,wu.getBufferParameter(e,t)):mr.recordError(1281)},Wo=(e,t,r)=>{r?D[r>>2]=wu.getBufferParameter(e,t):mr.recordError(1281)},Go=()=>{var e=wu.getError()||mr.lastError;return mr.lastError=0,e},jo=(e,t)=>No(e,t,2),zo=(e,t)=>wu.getFragDataLocation(mr.programs[e],xe(t)),Xo=(e,t,r,n)=>{var o=wu.getFramebufferAttachmentParameter(e,t,r);(o instanceof WebGLRenderbuffer||o instanceof WebGLTexture)&&(o=0|o.name),D[n>>2]=o},Yo=(e,t,r,n)=>{if(r){var o,i=wu.getIndexedParameter(e,t);switch(typeof i){case"boolean":o=i?1:0;break;case"number":o=i;break;case"object":if(null===i)switch(e){case 35983:case 35368:o=0;break;default:return void mr.recordError(1280)}else{if(!(i instanceof WebGLBuffer))return void mr.recordError(1280);o=0|i.name}break;default:return void mr.recordError(1280)}switch(n){case 1:Uo(r,o);break;case 0:D[r>>2]=o;break;case 2:R[r>>2]=o;break;case 4:A[r>>0]=o?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+n}}else mr.recordError(1281)},Ko=(e,t,r)=>Yo(e,t,r,1),Qo=(e,t)=>{No(e,t,1)},Zo=(e,t,r)=>Yo(e,t,r,0),Jo=(e,t)=>No(e,t,0),ei=(e,t,r,n,o)=>{if(n<0)mr.recordError(1281);else if(o){var i=wu.getInternalformatParameter(e,t,r);if(null!==i)for(var a=0;a<i.length&&a<n;++a)D[o+4*a>>2]=i[a]}else mr.recordError(1281)},ti=(e,t,r,n,o)=>{mr.recordError(1282)},ri=(e,t,r,n)=>{var o=wu.getProgramInfoLog(mr.programs[e]);null===o&&(o="(unknown error)");var i=t>0&&n?qt(o,n,t):0;r&&(D[r>>2]=i)},ni=(e,t,r)=>{if(r)if(e>=mr.counter)mr.recordError(1281);else if(e=mr.programs[e],35716==t){var n=wu.getProgramInfoLog(e);null===n&&(n="(unknown error)"),D[r>>2]=n.length+1}else if(35719==t){if(!e.maxUniformLength)for(var o=0;o<wu.getProgramParameter(e,35718);++o)e.maxUniformLength=Math.max(e.maxUniformLength,wu.getActiveUniform(e,o).name.length+1);D[r>>2]=e.maxUniformLength}else if(35722==t){if(!e.maxAttributeLength)for(o=0;o<wu.getProgramParameter(e,35721);++o)e.maxAttributeLength=Math.max(e.maxAttributeLength,wu.getActiveAttrib(e,o).name.length+1);D[r>>2]=e.maxAttributeLength}else if(35381==t){if(!e.maxUniformBlockNameLength)for(o=0;o<wu.getProgramParameter(e,35382);++o)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,wu.getActiveUniformBlockName(e,o).length+1);D[r>>2]=e.maxUniformBlockNameLength}else D[r>>2]=wu.getProgramParameter(e,t);else mr.recordError(1281)},oi=(e,t,r)=>{if(r){var n,o=mr.queries[e];n=mr.currentContext.version<2?wu.disjointTimerQueryExt.getQueryObjectEXT(o,t):wu.getQueryParameter(o,t),Uo(r,"boolean"==typeof n?n?1:0:n)}else mr.recordError(1281)},ii=oi,ai=(e,t,r)=>{if(r){var n,o=mr.queries[e],i=wu.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof i?i?1:0:i,D[r>>2]=n}else mr.recordError(1281)},si=ai,ui=oi,ci=(e,t,r)=>{if(r){var n,o=mr.queries[e],i=wu.getQueryParameter(o,t);n="boolean"==typeof i?i?1:0:i,D[r>>2]=n}else mr.recordError(1281)},li=ai,di=(e,t,r)=>{r?D[r>>2]=wu.getQuery(e,t):mr.recordError(1281)},fi=(e,t,r)=>{r?D[r>>2]=wu.disjointTimerQueryExt.getQueryEXT(e,t):mr.recordError(1281)},hi=(e,t,r)=>{r?D[r>>2]=wu.getRenderbufferParameter(e,t):mr.recordError(1281)},pi=(e,t,r)=>{r?R[r>>2]=wu.getSamplerParameter(mr.samplers[e],t):mr.recordError(1281)},mi=(e,t,r)=>{r?D[r>>2]=wu.getSamplerParameter(mr.samplers[e],t):mr.recordError(1281)},gi=(e,t,r,n)=>{var o=wu.getShaderInfoLog(mr.shaders[e]);null===o&&(o="(unknown error)");var i=t>0&&n?qt(o,n,t):0;r&&(D[r>>2]=i)},yi=(e,t,r,n)=>{var o=wu.getShaderPrecisionFormat(e,t);D[r>>2]=o.rangeMin,D[r+4>>2]=o.rangeMax,D[n>>2]=o.precision},vi=(e,t,r,n)=>{var o=wu.getShaderSource(mr.shaders[e]);if(o){var i=t>0&&n?qt(o,n,t):0;r&&(D[r>>2]=i)}},bi=(e,t,r)=>{if(r)if(35716==t){var n=wu.getShaderInfoLog(mr.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;D[r>>2]=o}else if(35720==t){var i=wu.getShaderSource(mr.shaders[e]),a=i?i.length+1:0;D[r>>2]=a}else D[r>>2]=wu.getShaderParameter(mr.shaders[e],t);else mr.recordError(1281)},wi=e=>{var t=mr.stringCache[e];if(!t){switch(e){case 7939:t=ir(qo().join(" "));break;case 7936:case 7937:case 37445:case 37446:var r=wu.getParameter(e);r||mr.recordError(1280),t=r?ir(r):0;break;case 7938:var n=wu.getParameter(7938);n=mr.currentContext.version>=2?`OpenGL ES 3.0 (${n})`:`OpenGL ES 2.0 (${n})`,t=ir(n);break;case 35724:var o=wu.getParameter(35724),i=o.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==i&&(3==i[1].length&&(i[1]=i[1]+"0"),o=`OpenGL ES GLSL ES ${i[1]} (${o})`),t=ir(o);break;default:mr.recordError(1280)}mr.stringCache[e]=t}return t},Ei=(e,t)=>{if(mr.currentContext.version<2)return mr.recordError(1282),0;var r=mr.stringiCache[e];if(r)return t<0||t>=r.length?(mr.recordError(1281),0):r[t];if(7939===e){var n=qo().map(ir);return r=mr.stringiCache[e]=n,t<0||t>=r.length?(mr.recordError(1281),0):r[t]}return mr.recordError(1280),0},Si=(e,t,r,n,o)=>{if(r<0)mr.recordError(1281);else if(o){var i=wu.getSyncParameter(mr.syncs[e],t);null!==i&&(D[o>>2]=i,n&&(D[n>>2]=1))}else mr.recordError(1281)},ki=(e,t,r)=>{r?R[r>>2]=wu.getTexParameter(e,t):mr.recordError(1281)},_i=(e,t,r)=>{r?D[r>>2]=wu.getTexParameter(e,t):mr.recordError(1281)},Ci=(e,t,r,n,o,i,a)=>{e=mr.programs[e];var s=wu.getTransformFeedbackVarying(e,t);if(s){if(a&&r>0){var u=qt(s.name,a,r);n&&(D[n>>2]=u)}else n&&(D[n>>2]=0);o&&(D[o>>2]=s.size),i&&(D[i>>2]=s.type)}},xi=(e,t)=>wu.getUniformBlockIndex(mr.programs[e],xe(t)),Ai=(e,t,r,n)=>{if(n)if(t>0&&(0==r||0==n))mr.recordError(1281);else{e=mr.programs[e];for(var o=[],i=0;i<t;i++)o.push(xe(D[r+4*i>>2]));var a=wu.getUniformIndices(e,o);if(a){var s=a.length;for(i=0;i<s;i++)D[n+4*i>>2]=a[i]}}else mr.recordError(1281)},Ti=e=>"]"==e.slice(-1)&&e.lastIndexOf("["),Fi=e=>{var t,r,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},t=0;t<wu.getProgramParameter(e,35718);++t){var i=wu.getActiveUniform(e,t),a=i.name,s=i.size,u=Ti(a),c=u>0?a.slice(0,u):a,l=e.uniformIdCounter;for(e.uniformIdCounter+=s,o[c]=[s,l],r=0;r<s;++r)n[l]=r,e.uniformArrayNamesById[l++]=c}},Pi=(e,t)=>{if(t=xe(t),e=mr.programs[e]){Fi(e);var r=e.uniformLocsById,n=0,o=t,i=Ti(t);i>0&&(s=t.slice(i+1),n=parseInt(s)>>>0,o=t.slice(0,i));var a=e.uniformSizeAndIdsByName[o];if(a&&n<a[0]&&(r[n+=a[1]]=r[n]||wu.getUniformLocation(e,t)))return n}else mr.recordError(1281);var s;return-1},Bi=e=>{var t=wu.currentProgram;if(t){var r=t.uniformLocsById[e];return"number"==typeof r&&(t.uniformLocsById[e]=r=wu.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?`[${r}]`:""))),r}mr.recordError(1282)},Di=(e,t,r,n)=>{if(r){e=mr.programs[e],Fi(e);var o=wu.getUniform(e,Bi(t));if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:D[r>>2]=o;break;case 2:R[r>>2]=o}else for(var i=0;i<o.length;i++)switch(n){case 0:D[r+4*i>>2]=o[i];break;case 2:R[r+4*i>>2]=o[i]}}else mr.recordError(1281)},Li=(e,t,r)=>{Di(e,t,r,2)},Ri=(e,t,r)=>{Di(e,t,r,0)},Mi=(e,t,r)=>Di(e,t,r,0),Ii=(e,t,r,n)=>{if(r){var o=wu.getVertexAttrib(e,t);if(34975==t)D[r>>2]=o&&o.name;else if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:D[r>>2]=o;break;case 2:R[r>>2]=o;break;case 5:D[r>>2]=Math.fround(o)}else for(var i=0;i<o.length;i++)switch(n){case 0:D[r+4*i>>2]=o[i];break;case 2:R[r+4*i>>2]=o[i];break;case 5:D[r+4*i>>2]=Math.fround(o[i])}}else mr.recordError(1281)},Oi=(e,t,r)=>{Ii(e,t,r,0)},$i=Oi,Ui=Oi,qi=(e,t,r)=>{r?D[r>>2]=wu.getVertexAttribOffset(e,t):mr.recordError(1281)},Ni=(e,t,r)=>{Ii(e,t,r,2)},Hi=(e,t,r)=>{Ii(e,t,r,5)},Vi=function(e,t){wu.hint(e,t)},Wi=(e,t,r)=>{for(var n=Nn[t],o=0;o<t;o++)n[o]=D[r+4*o>>2];wu.invalidateFramebuffer(e,n)},Gi=(e,t,r,n,o,i,a)=>{for(var s=Nn[t],u=0;u<t;u++)s[u]=D[r+4*u>>2];wu.invalidateSubFramebuffer(e,s,n,o,i,a)},ji=e=>{var t=mr.buffers[e];return t?wu.isBuffer(t):0},zi=function(e){return wu.isEnabled(e)},Xi=e=>{var t=mr.framebuffers[e];return t?wu.isFramebuffer(t):0},Yi=e=>(e=mr.programs[e])?wu.isProgram(e):0,Ki=e=>{var t=mr.queries[e];return t?wu.isQuery(t):0},Qi=e=>{var t=mr.queries[e];return t?wu.disjointTimerQueryExt.isQueryEXT(t):0},Zi=e=>{var t=mr.renderbuffers[e];return t?wu.isRenderbuffer(t):0},Ji=e=>{var t=mr.samplers[e];return t?wu.isSampler(t):0},ea=e=>{var t=mr.shaders[e];return t?wu.isShader(t):0},ta=e=>wu.isSync(mr.syncs[e]),ra=e=>{var t=mr.textures[e];return t?wu.isTexture(t):0},na=e=>wu.isTransformFeedback(mr.transformFeedbacks[e]),oa=e=>{var t=mr.vaos[e];return t?wu.isVertexArray(t):0},ia=oa,aa=oa,sa=function(e){wu.lineWidth(e)},ua=e=>{e=mr.programs[e],wu.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},ca=(e,t,r,n,o,i)=>{wu.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,D,t>>2,D,r>>2,D,n>>2,L,o>>2,i)},la=(e,t,r,n,o,i,a,s)=>{wu.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,D,t>>2,r,D,n>>2,D,o>>2,D,i>>2,L,a>>2,s)},da=function(){wu.pauseTransformFeedback()},fa=(e,t)=>{3317==e&&(mr.unpackAlignment=t),wu.pixelStorei(e,t)},ha=function(e,t){wu.polygonOffset(e,t)},pa=(e,t,r,n)=>{mr.recordError(1280)},ma=(e,t,r)=>{mr.recordError(1280)},ga=(e,t)=>{wu.disjointTimerQueryExt.queryCounterEXT(mr.queries[e],t)},ya=function(e){wu.readBuffer(e)},va=e=>0==(e-=5120)?A:1==e?F:2==e?P:4==e?D:6==e?R:5==e||28922==e||28520==e||30779==e||30782==e?L:B,ba=e=>31-Math.clz32(e.BYTES_PER_ELEMENT),wa=(e,t,r,n,o,i)=>{var a=va(e),s=ba(a),u=1<<s,c=(e=>({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1))(t)*u,l=((e,t,r,n)=>{var o;return t*(e*r+(o=n)-1&-o)})(r,n,c,mr.unpackAlignment);return a.subarray(o>>s,o+l>>s)},Ea=(e,t,r,n,o,i,a)=>{if(mr.currentContext.version>=2)if(wu.currentPixelPackBufferBinding)wu.readPixels(e,t,r,n,o,i,a);else{var s=va(i);wu.readPixels(e,t,r,n,o,i,s,a>>ba(s))}else{var u=wa(i,o,r,n,a);u?wu.readPixels(e,t,r,n,o,i,u):mr.recordError(1280)}},Sa=()=>{},ka=function(e,t,r,n){wu.renderbufferStorage(e,t,r,n)},_a=function(e,t,r,n,o){wu.renderbufferStorageMultisample(e,t,r,n,o)},Ca=function(){wu.resumeTransformFeedback()},xa=(e,t)=>{wu.sampleCoverage(e,!!t)},Aa=(e,t,r)=>{wu.samplerParameterf(mr.samplers[e],t,r)},Ta=(e,t,r)=>{var n=R[r>>2];wu.samplerParameterf(mr.samplers[e],t,n)},Fa=(e,t,r)=>{wu.samplerParameteri(mr.samplers[e],t,r)},Pa=(e,t,r)=>{var n=D[r>>2];wu.samplerParameteri(mr.samplers[e],t,n)},Ba=function(e,t,r,n){wu.scissor(e,t,r,n)},Da=(e,t,r,n,o)=>{mr.recordError(1280)},La=(e,t,r,n)=>{var o=mr.getSource(e,t,r,n);if(mr.currentContext.version>=2&&o.includes("#version 100")){var i="";(o=(o=o.replace(/#extension GL_OES_standard_derivatives : enable/g,"")).replace(/#extension GL_EXT_shader_texture_lod : enable/g,"")).includes("gl_FragColor")&&(i+="out mediump vec4 GL_FragColor;\n",o=o.replace(/gl_FragColor/g,"GL_FragColor")),o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=o.includes("attribute")?(o=o.replace(/attribute/g,"in")).replace(/varying/g,"out"):o.replace(/varying/g,"in")).replace(/textureCubeLodEXT/g,"textureCubeLod")).replace(/texture2DLodEXT/g,"texture2DLod")).replace(/texture2DProjLodEXT/g,"texture2DProjLod")).replace(/texture2DGradEXT/g,"texture2DGrad")).replace(/texture2DProjGradEXT/g,"texture2DProjGrad")).replace(/textureCubeGradEXT/g,"textureCubeGrad")).replace(/textureCube/g,"texture")).replace(/texture1D/g,"texture")).replace(/texture2D/g,"texture")).replace(/texture3D/g,"texture")).replace(/#version 100/g,"#version 300 es\n"+i)}wu.shaderSource(mr.shaders[e],o)},Ra=function(e,t,r){wu.stencilFunc(e,t,r)},Ma=function(e,t,r,n){wu.stencilFuncSeparate(e,t,r,n)},Ia=function(e){wu.stencilMask(e)},Oa=function(e,t){wu.stencilMaskSeparate(e,t)},$a=function(e,t,r){wu.stencilOp(e,t,r)},Ua=function(e,t,r,n){wu.stencilOpSeparate(e,t,r,n)},qa=(e,t,r,n,o,i,a,s,u)=>{if(mr.currentContext.version>=2&&(6402==a&&6402==r&&5125==s&&(r=33190),36193==s&&(s=5131,6408==a&&6408==r&&(r=34842)),34041==r&&(r=35056)),mr.currentContext.version>=2)if(wu.currentPixelUnpackBufferBinding)wu.texImage2D(e,t,r,n,o,i,a,s,u);else if(u){var c=va(s);wu.texImage2D(e,t,r,n,o,i,a,s,c,u>>ba(c))}else wu.texImage2D(e,t,r,n,o,i,a,s,null);else wu.texImage2D(e,t,r,n,o,i,a,s,u?wa(s,a,n,o,u):null)},Na=(e,t,r,n,o,i,a,s,u,c)=>{if(wu.currentPixelUnpackBufferBinding)wu.texImage3D(e,t,r,n,o,i,a,s,u,c);else if(c){var l=va(u);wu.texImage3D(e,t,r,n,o,i,a,s,u,l,c>>ba(l))}else wu.texImage3D(e,t,r,n,o,i,a,s,u,null)},Ha=function(e,t,r){wu.texParameterf(e,t,r)},Va=(e,t,r)=>{var n=R[r>>2];wu.texParameterf(e,t,n)},Wa=function(e,t,r){wu.texParameteri(e,t,r)},Ga=(e,t,r)=>{var n=D[r>>2];wu.texParameteri(e,t,n)},ja=function(e,t,r,n,o){wu.texStorage2D(e,t,r,n,o)},za=function(e,t,r,n,o,i){wu.texStorage3D(e,t,r,n,o,i)},Xa=(e,t,r,n,o,i,a,s,u)=>{if(mr.currentContext.version>=2&&36193==s&&(s=5131),mr.currentContext.version>=2)if(wu.currentPixelUnpackBufferBinding)wu.texSubImage2D(e,t,r,n,o,i,a,s,u);else if(u){var c=va(s);wu.texSubImage2D(e,t,r,n,o,i,a,s,c,u>>ba(c))}else wu.texSubImage2D(e,t,r,n,o,i,a,s,null);else{var l=null;u&&(l=wa(s,a,o,i,u)),wu.texSubImage2D(e,t,r,n,o,i,a,s,l)}},Ya=(e,t,r,n,o,i,a,s,u,c,l)=>{if(wu.currentPixelUnpackBufferBinding)wu.texSubImage3D(e,t,r,n,o,i,a,s,u,c,l);else if(l){var d=va(c);wu.texSubImage3D(e,t,r,n,o,i,a,s,u,c,d,l>>ba(d))}else wu.texSubImage3D(e,t,r,n,o,i,a,s,u,c,null)},Ka=(e,t,r,n)=>{e=mr.programs[e];for(var o=[],i=0;i<t;i++)o.push(xe(D[r+4*i>>2]));wu.transformFeedbackVaryings(e,o,n)},Qa=(e,t)=>{wu.uniform1f(Bi(e),t)},Za=[],Ja=(e,t,r)=>{if(mr.currentContext.version>=2)t&&wu.uniform1fv(Bi(e),R,r>>2,t);else{if(t<=288)for(var n=Za[t-1],o=0;o<t;++o)n[o]=R[r+4*o>>2];else n=R.subarray(r>>2,r+4*t>>2);wu.uniform1fv(Bi(e),n)}},es=(e,t)=>{wu.uniform1i(Bi(e),t)},ts=[],rs=(e,t,r)=>{if(mr.currentContext.version>=2)t&&wu.uniform1iv(Bi(e),D,r>>2,t);else{if(t<=288)for(var n=ts[t-1],o=0;o<t;++o)n[o]=D[r+4*o>>2];else n=D.subarray(r>>2,r+4*t>>2);wu.uniform1iv(Bi(e),n)}},ns=(e,t)=>{wu.uniform1ui(Bi(e),t)},os=(e,t,r)=>{t&&wu.uniform1uiv(Bi(e),L,r>>2,t)},is=(e,t,r)=>{wu.uniform2f(Bi(e),t,r)},as=(e,t,r)=>{if(mr.currentContext.version>=2)t&&wu.uniform2fv(Bi(e),R,r>>2,2*t);else{if(t<=144)for(var n=Za[2*t-1],o=0;o<2*t;o+=2)n[o]=R[r+4*o>>2],n[o+1]=R[r+(4*o+4)>>2];else n=R.subarray(r>>2,r+8*t>>2);wu.uniform2fv(Bi(e),n)}},ss=(e,t,r)=>{wu.uniform2i(Bi(e),t,r)},us=(e,t,r)=>{if(mr.currentContext.version>=2)t&&wu.uniform2iv(Bi(e),D,r>>2,2*t);else{if(t<=144)for(var n=ts[2*t-1],o=0;o<2*t;o+=2)n[o]=D[r+4*o>>2],n[o+1]=D[r+(4*o+4)>>2];else n=D.subarray(r>>2,r+8*t>>2);wu.uniform2iv(Bi(e),n)}},cs=(e,t,r)=>{wu.uniform2ui(Bi(e),t,r)},ls=(e,t,r)=>{t&&wu.uniform2uiv(Bi(e),L,r>>2,2*t)},ds=(e,t,r,n)=>{wu.uniform3f(Bi(e),t,r,n)},fs=(e,t,r)=>{if(mr.currentContext.version>=2)t&&wu.uniform3fv(Bi(e),R,r>>2,3*t);else{if(t<=96)for(var n=Za[3*t-1],o=0;o<3*t;o+=3)n[o]=R[r+4*o>>2],n[o+1]=R[r+(4*o+4)>>2],n[o+2]=R[r+(4*o+8)>>2];else n=R.subarray(r>>2,r+12*t>>2);wu.uniform3fv(Bi(e),n)}},hs=(e,t,r,n)=>{wu.uniform3i(Bi(e),t,r,n)},ps=(e,t,r)=>{if(mr.currentContext.version>=2)t&&wu.uniform3iv(Bi(e),D,r>>2,3*t);else{if(t<=96)for(var n=ts[3*t-1],o=0;o<3*t;o+=3)n[o]=D[r+4*o>>2],n[o+1]=D[r+(4*o+4)>>2],n[o+2]=D[r+(4*o+8)>>2];else n=D.subarray(r>>2,r+12*t>>2);wu.uniform3iv(Bi(e),n)}},ms=(e,t,r,n)=>{wu.uniform3ui(Bi(e),t,r,n)},gs=(e,t,r)=>{t&&wu.uniform3uiv(Bi(e),L,r>>2,3*t)},ys=(e,t,r,n,o)=>{wu.uniform4f(Bi(e),t,r,n,o)},vs=(e,t,r)=>{if(mr.currentContext.version>=2)t&&wu.uniform4fv(Bi(e),R,r>>2,4*t);else{if(t<=72){var n=Za[4*t-1],o=R;r>>=2;for(var i=0;i<4*t;i+=4){var a=r+i;n[i]=o[a],n[i+1]=o[a+1],n[i+2]=o[a+2],n[i+3]=o[a+3]}}else n=R.subarray(r>>2,r+16*t>>2);wu.uniform4fv(Bi(e),n)}},bs=(e,t,r,n,o)=>{wu.uniform4i(Bi(e),t,r,n,o)},ws=(e,t,r)=>{if(mr.currentContext.version>=2)t&&wu.uniform4iv(Bi(e),D,r>>2,4*t);else{if(t<=72)for(var n=ts[4*t-1],o=0;o<4*t;o+=4)n[o]=D[r+4*o>>2],n[o+1]=D[r+(4*o+4)>>2],n[o+2]=D[r+(4*o+8)>>2],n[o+3]=D[r+(4*o+12)>>2];else n=D.subarray(r>>2,r+16*t>>2);wu.uniform4iv(Bi(e),n)}},Es=(e,t,r,n,o)=>{wu.uniform4ui(Bi(e),t,r,n,o)},Ss=(e,t,r)=>{t&&wu.uniform4uiv(Bi(e),L,r>>2,4*t)},ks=(e,t,r)=>{e=mr.programs[e],wu.uniformBlockBinding(e,t,r)},_s=(e,t,r,n)=>{if(mr.currentContext.version>=2)t&&wu.uniformMatrix2fv(Bi(e),!!r,R,n>>2,4*t);else{if(t<=72)for(var o=Za[4*t-1],i=0;i<4*t;i+=4)o[i]=R[n+4*i>>2],o[i+1]=R[n+(4*i+4)>>2],o[i+2]=R[n+(4*i+8)>>2],o[i+3]=R[n+(4*i+12)>>2];else o=R.subarray(n>>2,n+16*t>>2);wu.uniformMatrix2fv(Bi(e),!!r,o)}},Cs=(e,t,r,n)=>{t&&wu.uniformMatrix2x3fv(Bi(e),!!r,R,n>>2,6*t)},xs=(e,t,r,n)=>{t&&wu.uniformMatrix2x4fv(Bi(e),!!r,R,n>>2,8*t)},As=(e,t,r,n)=>{if(mr.currentContext.version>=2)t&&wu.uniformMatrix3fv(Bi(e),!!r,R,n>>2,9*t);else{if(t<=32)for(var o=Za[9*t-1],i=0;i<9*t;i+=9)o[i]=R[n+4*i>>2],o[i+1]=R[n+(4*i+4)>>2],o[i+2]=R[n+(4*i+8)>>2],o[i+3]=R[n+(4*i+12)>>2],o[i+4]=R[n+(4*i+16)>>2],o[i+5]=R[n+(4*i+20)>>2],o[i+6]=R[n+(4*i+24)>>2],o[i+7]=R[n+(4*i+28)>>2],o[i+8]=R[n+(4*i+32)>>2];else o=R.subarray(n>>2,n+36*t>>2);wu.uniformMatrix3fv(Bi(e),!!r,o)}},Ts=(e,t,r,n)=>{t&&wu.uniformMatrix3x2fv(Bi(e),!!r,R,n>>2,6*t)},Fs=(e,t,r,n)=>{t&&wu.uniformMatrix3x4fv(Bi(e),!!r,R,n>>2,12*t)},Ps=(e,t,r,n)=>{if(mr.currentContext.version>=2)t&&wu.uniformMatrix4fv(Bi(e),!!r,R,n>>2,16*t);else{if(t<=18){var o=Za[16*t-1],i=R;n>>=2;for(var a=0;a<16*t;a+=16){var s=n+a;o[a]=i[s],o[a+1]=i[s+1],o[a+2]=i[s+2],o[a+3]=i[s+3],o[a+4]=i[s+4],o[a+5]=i[s+5],o[a+6]=i[s+6],o[a+7]=i[s+7],o[a+8]=i[s+8],o[a+9]=i[s+9],o[a+10]=i[s+10],o[a+11]=i[s+11],o[a+12]=i[s+12],o[a+13]=i[s+13],o[a+14]=i[s+14],o[a+15]=i[s+15]}}else o=R.subarray(n>>2,n+64*t>>2);wu.uniformMatrix4fv(Bi(e),!!r,o)}},Bs=(e,t,r,n)=>{t&&wu.uniformMatrix4x2fv(Bi(e),!!r,R,n>>2,8*t)},Ds=(e,t,r,n)=>{t&&wu.uniformMatrix4x3fv(Bi(e),!!r,R,n>>2,12*t)},Ls=e=>{e=mr.programs[e],wu.useProgram(e),wu.currentProgram=e},Rs=e=>{wu.validateProgram(mr.programs[e])},Ms=function(e,t){wu.vertexAttrib1f(e,t)},Is=(e,t)=>{wu.vertexAttrib1f(e,R[t>>2])},Os=function(e,t,r){wu.vertexAttrib2f(e,t,r)},$s=(e,t)=>{wu.vertexAttrib2f(e,R[t>>2],R[t+4>>2])},Us=function(e,t,r,n){wu.vertexAttrib3f(e,t,r,n)},qs=(e,t)=>{wu.vertexAttrib3f(e,R[t>>2],R[t+4>>2],R[t+8>>2])},Ns=function(e,t,r,n,o){wu.vertexAttrib4f(e,t,r,n,o)},Hs=(e,t)=>{wu.vertexAttrib4f(e,R[t>>2],R[t+4>>2],R[t+8>>2],R[t+12>>2])},Vs=(e,t)=>{wu.vertexAttribDivisor(e,t)},Ws=Vs,Gs=Vs,js=Vs,zs=Vs,Xs=Vs,Ys=function(e,t,r,n,o){wu.vertexAttribI4i(e,t,r,n,o)},Ks=(e,t)=>{wu.vertexAttribI4i(e,D[t>>2],D[t+4>>2],D[t+8>>2],D[t+12>>2])},Qs=function(e,t,r,n,o){wu.vertexAttribI4ui(e,t,r,n,o)},Zs=(e,t)=>{wu.vertexAttribI4ui(e,L[t>>2],L[t+4>>2],L[t+8>>2],L[t+12>>2])},Js=(e,t,r,n,o)=>{wu.vertexAttribIPointer(e,t,r,n,o)},eu=(e,t,r,n,o,i)=>{wu.vertexAttribPointer(e,t,r,!!n,o,i)},tu=function(e,t,r,n){wu.viewport(e,t,r,n)},ru=(e,t,r)=>{r=Number(r),wu.waitSync(mr.syncs[e],t,r)},nu=e=>{var t=(e-k.buffer.byteLength+65535)/65536;try{return k.grow(t),q(),1}catch(e){}},ou={removeAllEventListeners(){for(;ou.eventHandlers.length;)ou._removeHandler(ou.eventHandlers.length-1);ou.deferredCalls=[]},inEventHandler:0,deferredCalls:[],deferCall(e,t,r){function n(e,t){if(e.length!=t.length)return!1;for(var r in e)if(e[r]!=t[r])return!1;return!0}for(var o in ou.deferredCalls){var i=ou.deferredCalls[o];if(i.targetFunction==e&&n(i.argsList,r))return}ou.deferredCalls.push({targetFunction:e,precedence:t,argsList:r}),ou.deferredCalls.sort(((e,t)=>e.precedence<t.precedence))},removeDeferredCalls(e){for(var t=0;t<ou.deferredCalls.length;++t)ou.deferredCalls[t].targetFunction==e&&(ou.deferredCalls.splice(t,1),--t)},canPerformEventHandlerRequests:()=>navigator.userActivation?navigator.userActivation.isActive:ou.inEventHandler&&ou.currentEventHandler.allowsDeferredCalls,runDeferredCalls(){if(ou.canPerformEventHandlerRequests())for(var e=0;e<ou.deferredCalls.length;++e){var t=ou.deferredCalls[e];ou.deferredCalls.splice(e,1),--e,t.targetFunction.apply(null,t.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:(e,t)=>{for(var r=0;r<ou.eventHandlers.length;++r)ou.eventHandlers[r].target!=e||t&&t!=ou.eventHandlers[r].eventTypeString||ou._removeHandler(r--)},_removeHandler(e){var t=ou.eventHandlers[e];t.target.removeEventListener(t.eventTypeString,t.eventListenerFunc,t.useCapture),ou.eventHandlers.splice(e,1)},registerOrRemoveHandler(e){if(!e.target)return-4;if(e.callbackfunc)e.eventListenerFunc=function(t){++ou.inEventHandler,ou.currentEventHandler=e,ou.runDeferredCalls(),e.handlerFunc(t),ou.runDeferredCalls(),--ou.inEventHandler},e.target.addEventListener(e.eventTypeString,e.eventListenerFunc,e.useCapture),ou.eventHandlers.push(e);else for(var t=0;t<ou.eventHandlers.length;++t)ou.eventHandlers[t].target==e.target&&ou.eventHandlers[t].eventTypeString==e.eventTypeString&&ou._removeHandler(t--);return 0},getNodeNameForTarget:e=>e?e==window?"#window":e==screen?"#screen":e?.nodeName||"":"",fullscreenEnabled:()=>document.fullscreenEnabled||document.webkitFullscreenEnabled},iu=["default","low-power","high-performance"],au=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],su=e=>{var t;return e=(t=e)>2?xe(t):t,au[e]||("undefined"!=typeof document?document.querySelector(e):void 0)},uu=(e,t)=>{var r=t>>2,n=D[r+6],o={alpha:!!D[r+0],depth:!!D[r+1],stencil:!!D[r+2],antialias:!!D[r+3],premultipliedAlpha:!!D[r+4],preserveDrawingBuffer:!!D[r+5],powerPreference:iu[n],failIfMajorPerformanceCaveat:!!D[r+7],majorVersion:D[r+8],minorVersion:D[r+9],enableExtensionsByDefault:D[r+10],explicitSwapControl:D[r+11],proxyContextToMainThread:D[r+12],renderViaOffscreenBackBuffer:D[r+13]},i=su(e);return i?o.explicitSwapControl?0:mr.createContext(i,o):0},cu={},lu=()=>{if(!lu.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(var t in cu)void 0===cu[t]?delete e[t]:e[t]=cu[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);lu.strings=r}return lu.strings},du=(e,t,r,n)=>{for(var o=0,i=0;i<r;i++){var a=L[t>>2],s=L[t+4>>2];t+=8;var u=Ce.read(e,A,a,s,n);if(u<0)return-1;if(o+=u,u<s)break;void 0!==n&&(n+=u)}return o},fu=[31,29,31,30,31,30,31,31,30,31,30,31],hu=[31,28,31,30,31,30,31,31,30,31,30,31],pu=(e,t)=>{A.set(e,t)},mu=(e,t,r,n)=>{var o=L[n+40>>2],i={tm_sec:D[n>>2],tm_min:D[n+4>>2],tm_hour:D[n+8>>2],tm_mday:D[n+12>>2],tm_mon:D[n+16>>2],tm_year:D[n+20>>2],tm_wday:D[n+24>>2],tm_yday:D[n+28>>2],tm_isdst:D[n+32>>2],tm_gmtoff:D[n+36>>2],tm_zone:o?xe(o):""},a=xe(r),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function f(e,t){return d(e,t,"0")}function h(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function p(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function m(e){var t=((e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=tr(r.getFullYear()),o=r.getMonth(),i=(n?fu:hu)[o];if(!(t>i-r.getDate()))return r.setDate(r.getDate()+t),r;t-=i-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r})(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=p(r),i=p(n);return h(o,t)<=0?h(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":e=>c[e.tm_wday].substring(0,3),"%A":e=>c[e.tm_wday],"%b":e=>l[e.tm_mon].substring(0,3),"%B":e=>l[e.tm_mon],"%C":e=>f((e.tm_year+1900)/100|0,2),"%d":e=>f(e.tm_mday,2),"%e":e=>d(e.tm_mday,2," "),"%g":e=>m(e).toString().substring(2),"%G":m,"%H":e=>f(e.tm_hour,2),"%I":e=>{var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),f(t,2)},"%j":e=>f(e.tm_mday+((e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r})(tr(e.tm_year+1900)?fu:hu,e.tm_mon-1),3),"%m":e=>f(e.tm_mon+1,2),"%M":e=>f(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>f(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var t=e.tm_yday+7-e.tm_wday;return f(Math.floor(t/7),2)},"%V":e=>{var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&tr(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&tr(e.tm_year%400-1))&&t++}return f(t,2)},"%w":e=>e.tm_wday,"%W":e=>{var t=e.tm_yday+7-(e.tm_wday+6)%7;return f(Math.floor(t/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in a=a.replace(/%%/g,"\0\0"),g)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),g[u](i)));var y=be(a=a.replace(/\0\0/g,"%"),!1);return y.length>t?0:(pu(y,e),y.length-1)},gu=e=>{var t=ye(e)+1,r=qu(t);return qt(e,r,t),r},yu=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Ce.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},vu=365,bu=146;Object.defineProperties(yu.prototype,{read:{get:function(){return(this.mode&vu)===vu},set:function(e){e?this.mode|=vu:this.mode&=-366}},write:{get:function(){return(this.mode&bu)===bu},set:function(e){e?this.mode|=bu:this.mode&=-147}},isFolder:{get:function(){return Ce.isDir(this.mode)}},isDevice:{get:function(){return Ce.isChrdev(this.mode)}}}),Ce.FSNode=yu,Ce.createPreloadedFile=(e,t,r,n,o,i,a,s,u,c)=>{var d=t?he.resolve(de.join2(e,t)):e;function f(r){function l(r){c?.(),s||((e,t,r,n,o,i)=>{Ce.createDataFile(e,t,r,n,o,i)})(e,t,r,n,o,u),i?.(),K()}((e,t,r,n)=>{void 0!==hr&&hr.init();var o=!1;return ke.forEach((i=>{o||i.canHandle(t)&&(i.handle(e,t,r,n),o=!0)})),o})(r,d,l,(()=>{a?.(),K()}))||l(r)}Y(),"string"==typeof r?((e,t,r,n)=>{var o=n?"":`al ${e}`;l(e,(e=>{t(new Uint8Array(e)),o&&K()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),o&&Y()})(r,f,a):f(r)},Ce.staticInit(),u.FS_createPath=Ce.createPath,u.FS_createDataFile=Ce.createDataFile,u.FS_createPreloadedFile=Ce.createPreloadedFile,u.FS_unlink=Ce.unlink,u.FS_createLazyFile=Ce.createLazyFile,u.FS_createDevice=Ce.createDevice,Be=u.InternalError=class InternalError extends Error{constructor(e){super(e),this.name="InternalError"}},(()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);De=e})(),Le=u.BindingError=class BindingError extends Error{constructor(e){super(e),this.name="BindingError"}},Object.assign(ct.prototype,{isAliasOf(e){if(!(this instanceof ct))return!1;if(!(e instanceof ct))return!1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o},clone(){if(this.$$.ptr||ze(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=ut(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||ze(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&He("Object already scheduled for deletion"),Ye(this),Ke(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||ze(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&He("Object already scheduled for deletion"),tt.push(this),1===tt.length&&We&&We(rt),this.$$.deleteScheduled=!0,this}}),u.getInheritedInstanceCount=Je,u.getLiveInheritedInstances=et,u.flushPendingDeletes=rt,u.setDelayFunction=nt,Object.assign(bt.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:je,readValueFromPointer:vt,fromWireType:st}),Et=u.UnboundTypeError=(Co=Error,(Ao=lt(xo="UnboundTypeError",(function(e){this.name=xo,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(Co.prototype),Ao.prototype.constructor=Ao,Ao.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},Ao),Dt.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Object.assign(Dt,{reserved:Dt.allocated.length}),u.count_emval_handles=Rt,u.requestFullscreen=hr.requestFullscreen,u.requestAnimationFrame=hr.requestAnimationFrame,u.setCanvasSize=hr.setCanvasSize,u.pauseMainLoop=hr.mainLoop.pause,u.resumeMainLoop=hr.mainLoop.resume,u.getUserMedia=hr.getUserMedia,u.createContext=hr.createContext;for(var wu,Eu={},Su={},ku=0;ku<32;++ku)Nn.push(new Array(ku));var _u=new Float32Array(288);for(ku=0;ku<288;++ku)Za[ku]=_u.subarray(0,ku+1);var Cu=new Int32Array(288);for(ku=0;ku<288;++ku)ts[ku]=Cu.subarray(0,ku+1);var xu,Au={Va:e=>{var t=new ExceptionInfo(e);return t.get_caught()||t.set_caught(!0),t.set_rethrown(!1),ue.push(t),Hu(t.excPtr),t.get_exception_ptr()},Ua:()=>{Ou(0,0);var e=ue.pop();Nu(e.excPtr),ce=0},o:()=>le([]),da:e=>le([e]),l:(e,t,r)=>{throw new ExceptionInfo(e).init(t,r),ce=e},O:e=>{throw ce||(ce=e),ce},Ob:function(e,t){try{return e=Ae.getStr(e),Ce.chmod(e,t),0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},Pb:function(e,t){try{return Ce.fchmod(e,t),0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},ka:function(e,t,r){Ae.varargs=r;try{var n=Ae.getStreamFromFD(e);switch(t){case 0:if((o=Ae.get())<0)return-28;for(;Ce.streams[o];)o++;return Ce.createStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=Ae.get();return n.flags|=o,0;case 12:return o=Ae.getp(),P[o+0>>1]=2,0}return-28}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},Mb:function(e,t){try{var r=Ae.getStreamFromFD(e);return Ae.doStat(Ce.stat,r.path,t)}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},Sb:function(e,t,r){Ae.varargs=r;try{var n=Ae.getStreamFromFD(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),i=Ae.getp();D[i>>2]=o.c_iflag||0,D[i+4>>2]=o.c_oflag||0,D[i+8>>2]=o.c_cflag||0,D[i+12>>2]=o.c_lflag||0;for(var a=0;a<32;a++)A[i+a+17>>0]=o.c_cc[a]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){i=Ae.getp();var s=D[i>>2],u=D[i+4>>2],c=D[i+8>>2],l=D[i+12>>2],d=[];for(a=0;a<32;a++)d.push(A[i+a+17>>0]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:s,c_oflag:u,c_cflag:c,c_lflag:l,c_cc:d})}return 0;case 21519:return n.tty?(i=Ae.getp(),D[i>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return i=Ae.getp(),Ce.ioctl(n,t,i);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var f=n.tty.ops.ioctl_tiocgwinsz(n.tty);i=Ae.getp(),P[i>>1]=f[0],P[i+2>>1]=f[1]}return 0;default:return-28}}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},Kb:function(e,t){try{return e=Ae.getStr(e),Ae.doStat(Ce.lstat,e,t)}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},Jb:function(e,t,r,n){try{t=Ae.getStr(t);var o=256&n,i=4096&n;return n&=-6401,t=Ae.calculateAt(e,t,i),Ae.doStat(o?Ce.lstat:Ce.stat,t,r)}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},ya:function(e,t,r,n){Ae.varargs=n;try{t=Ae.getStr(t),t=Ae.calculateAt(e,t);var o=n?Ae.get():0;return Ce.open(t,r,o).fd}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},xb:function(e,t,r,n){try{return t=Ae.getStr(t),n=Ae.getStr(n),t=Ae.calculateAt(e,t),n=Ae.calculateAt(r,n),Ce.rename(t,n),0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},yb:function(e){try{return e=Ae.getStr(e),Ce.rmdir(e),0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},Lb:function(e,t){try{return e=Ae.getStr(e),Ae.doStat(Ce.stat,e,t)}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},zb:function(e,t,r){try{return t=Ae.getStr(t),t=Ae.calculateAt(e,t),0===r?Ce.unlink(t):512===r?Ce.rmdir(t):Q("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},Fa:e=>{var t=Te[e];delete Te[e];var r=t.elements,n=r.length,o=r.map((e=>e.getterReturnType)).concat(r.map((e=>e.setterArgumentType))),i=t.rawConstructor,a=t.rawDestructor;$e([e],o,(function(e){return r.forEach(((t,r)=>{var o=e[r],i=t.getter,a=t.getterContext,s=e[r+n],u=t.setter,c=t.setterContext;t.read=e=>o.fromWireType(i(a,e)),t.write=(e,t)=>{var r=[];u(c,e,s.toWireType(r,t)),Fe(r)}})),[{name:t.name,fromWireType:e=>{for(var t=new Array(n),o=0;o<n;++o)t[o]=r[o].read(e);return a(e),t},toWireType:(e,o)=>{if(n!==o.length)throw new TypeError(`Incorrect number of tuple elements for ${t.name}: expected=${n}, actual=${o.length}`);for(var s=i(),u=0;u<n;++u)r[u].write(s,o[u]);return null!==e&&e.push(a,s),s},argPackAdvance:je,readValueFromPointer:Pe,destructorFunction:a}]}))},A:e=>{var t=Ue[e];delete Ue[e];var r=t.rawConstructor,n=t.rawDestructor,o=t.fields,i=o.map((e=>e.getterReturnType)).concat(o.map((e=>e.setterArgumentType)));$e([e],i,(e=>{var i={};return o.forEach(((t,r)=>{var n=t.fieldName,a=e[r],s=t.getter,u=t.getterContext,c=e[r+o.length],l=t.setter,d=t.setterContext;i[n]={read:e=>a.fromWireType(s(u,e)),write:(e,t)=>{var r=[];l(d,e,c.toWireType(r,t)),Fe(r)}}})),[{name:t.name,fromWireType:e=>{var t={};for(var r in i)t[r]=i[r].read(e);return n(e),t},toWireType:(e,t)=>{for(var o in i)if(!(o in t))throw new TypeError(`Missing field: "${o}"`);var a=r();for(o in i)i[o].write(a,t[o]);return null!==e&&e.push(n,a),a},argPackAdvance:je,readValueFromPointer:Pe,destructorFunction:n}]}))},Ia:(e,t,r,n,o)=>{var i=-1!=(t=Ne(t)).indexOf("u");Ve(e,{name:t,fromWireType:e=>e,toWireType:function(e,t){if("bigint"!=typeof t&&"number"!=typeof t)throw new TypeError(`Cannot convert "${qe(t)}" to ${this.name}`);return"number"==typeof t&&(t=BigInt(t)),t},argPackAdvance:je,readValueFromPointer:Ge(t,r,!i),destructorFunction:null})},xe:(e,t,r,n)=>{Ve(e,{name:t=Ne(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:n},argPackAdvance:je,readValueFromPointer:function(e){return this.fromWireType(F[e])},destructorFunction:null})},u:(e,t,r,n,o,i,a,s,u,c,l,d,f)=>{l=Ne(l),i=Ct(o,i),s&&=Ct(a,s),c&&=Ct(u,c),f=Ct(d,f);var h=(e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e})(l);ft(h,(function(){At(`Cannot construct ${l} due to unbound types`,[n])})),$e([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:ct.prototype;var a=lt(l,(function(){if(Object.getPrototypeOf(this)!==u)throw new Le("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new Le(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new Le(`Tried to invoke ctor of ${l} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),u=Object.create(o,{constructor:{value:a}});a.prototype=u;var d=new ht(l,a,u,f,r,i,s,c);d.baseClass&&(d.baseClass.__derivedClasses??=[],d.baseClass.__derivedClasses.push(d));var p=new bt(l,d,!0,!1,!1),m=new bt(l+"*",d,!1,!1,!1),g=new bt(l+" const*",d,!1,!0,!1);return Ze[e]={pointerType:m,constPointerType:g},St(h,a),[p,m,g]}))},x:(e,t,r,n,o,i)=>{var a=Tt(t,r);o=Ct(n,o),$e([],[e],(function(e){var r=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new Le(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{At(`Cannot construct ${e.name} due to unbound types`,a)},$e([],a,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Ft(r,n,null,o,i),[]))),[]}))},d:(e,t,r,n,o,i,a,s,u)=>{var c=Tt(r,n);t=Ne(t),t=Bt(t),i=Ct(o,i),$e([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function o(){At(`Cannot call ${n} due to unbound types`,c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var u=e.registeredClass.instancePrototype,l=u[t];return void 0===l||void 0===l.overloadTable&&l.className!==e.name&&l.argCount===r-2?(o.argCount=r-2,o.className=e.name,u[t]=o):(dt(u,t,n),u[t].overloadTable[r-2]=o),$e([],c,(function(o){var s=Ft(n,o,e,i,a);return void 0===u[t].overloadTable?(s.argCount=r-2,u[t]=s):u[t].overloadTable[r-2]=s,[]})),[]}))},ve:e=>Ve(e,It),ca:(e,t,r,n)=>{function o(){}t=Ne(t),o.values={},Ve(e,{name:t,constructor:o,fromWireType:function(e){return this.constructor.values[e]},toWireType:(e,t)=>t.value,argPackAdvance:je,readValueFromPointer:Ot(t,r,n),destructorFunction:null}),ft(t,o)},I:(e,t,r)=>{var n=$t(e,"enum");t=Ne(t);var o=n.constructor,i=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:lt(`${n.name}_${t}`,(function(){}))}});o.values[r]=i,o[t]=i},Ha:(e,t,r)=>{Ve(e,{name:t=Ne(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:je,readValueFromPointer:Ut(t,r),destructorFunction:null})},L:(e,t,r,n,o,i,a)=>{var s=Tt(t,r);e=Ne(e),e=Bt(e),o=Ct(n,o),ft(e,(function(){At(`Cannot call ${e} due to unbound types`,s)}),t-1),$e([],s,(function(r){var n=[r[0],null].concat(r.slice(1));return St(e,Ft(e,n,null,o,i),t-1),[]}))},Q:(e,t,r,n,o)=>{t=Ne(t),-1===o&&(o=4294967295);var i=e=>e;if(0===n){var a=32-8*r;i=e=>e<<a>>>a}var s=t.includes("unsigned");Ve(e,{name:t,fromWireType:i,toWireType:s?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:je,readValueFromPointer:Ge(t,r,0!==n),destructorFunction:null})},E:(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function o(e){var t=L[e>>2],r=L[e+4>>2];return new n(A.buffer,r,t)}Ve(e,{name:r=Ne(r),fromWireType:o,argPackAdvance:je,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},pf:(e,t,r,n,o,i,a,s,u,c,l,d)=>{r=Ne(r),i=Ct(o,i),s=Ct(a,s),c=Ct(u,c),d=Ct(l,d),$e([e],[t],(function(e){return e=e[0],[new bt(r,e.registeredClass,!1,!1,!0,e,n,i,s,c,d)]}))},Ja:(e,t)=>{var r="std::string"===(t=Ne(t));Ve(e,{name:t,fromWireType(e){var t,n=L[e>>2],o=e+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==F[s]){var u=xe(i,s-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=s+1}}else{var c=new Array(n);for(a=0;a<n;++a)c[a]=String.fromCharCode(F[o+a]);t=c.join("")}return Bu(e),t},toWireType(e,t){var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var o="string"==typeof t;o||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||He("Cannot pass non-string to std::string"),n=r&&o?ye(t):t.length;var i=Fu(4+n+1),a=i+4;if(L[i>>2]=n,r&&o)qt(t,a,n+1);else if(o)for(var s=0;s<n;++s){var u=t.charCodeAt(s);u>255&&(Bu(a),He("String has UTF-16 code units that do not fit in 8 bits")),F[a+s]=u}else for(s=0;s<n;++s)F[a+s]=t[s];return null!==e&&e.push(Bu,i),i},argPackAdvance:je,readValueFromPointer:vt,destructorFunction(e){Bu(e)}})},ma:(e,t,r)=>{var n,o,i,a,s;r=Ne(r),2===t?(n=Ht,o=Vt,a=Wt,i=()=>B,s=1):4===t&&(n=Gt,o=jt,a=zt,i=()=>L,s=2),Ve(e,{name:r,fromWireType:e=>{for(var r,o=L[e>>2],a=i(),u=e+4,c=0;c<=o;++c){var l=e+4+c*t;if(c==o||0==a[l>>s]){var d=n(u,l-u);void 0===r?r=d:(r+=String.fromCharCode(0),r+=d),u=l+t}}return Bu(e),r},toWireType:(e,n)=>{"string"!=typeof n&&He(`Cannot pass non-string to C++ string type ${r}`);var i=a(n),u=Fu(4+i+t);return L[u>>2]=i>>s,o(n,u+4,i+t),null!==e&&e.push(Bu,u),u},argPackAdvance:je,readValueFromPointer:Pe,destructorFunction(e){Bu(e)}})},Ga:(e,t,r,n,o,i)=>{Te[e]={name:Ne(t),rawConstructor:Ct(r,n),rawDestructor:Ct(o,i),elements:[]}},P:(e,t,r,n,o,i,a,s,u)=>{Te[e].elements.push({getterReturnType:t,getter:Ct(r,n),getterContext:o,setterArgumentType:i,setter:Ct(a,s),setterContext:u})},B:(e,t,r,n,o,i)=>{Ue[e]={name:Ne(t),rawConstructor:Ct(r,n),rawDestructor:Ct(o,i),fields:[]}},m:(e,t,r,n,o,i,a,s,u,c)=>{Ue[e].fields.push({fieldName:Ne(t),getterReturnType:r,getter:Ct(n,o),getterContext:i,setterArgumentType:a,setter:Ct(s,u),setterContext:c})},ye:(e,t)=>{Ve(e,{isVoid:!0,name:t=Ne(t),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,t)=>{}})},Rb:()=>1,rb:()=>{throw 1/0},j:(e,t,r)=>(e=Mt.toValue(e),t=$t(t,"emval::as"),Xt(t,r,e)),w:(e,t,r,n)=>(e=Yt[e])(null,t=Mt.toValue(t),r,n),J:(e,t,r,n,o)=>(e=Yt[e])(t=Mt.toValue(t),t[r=Qt(r)],n,o),c:Lt,we:(e,t)=>(e=Mt.toValue(e))==(t=Mt.toValue(t)),K:e=>0===e?Mt.toHandle(Zt()):(e=Qt(e),Mt.toHandle(Zt()[e])),s:(e,t,r)=>{var n=((e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=$t(L[t+4*n>>2],"parameter "+n);return r})(e,t),o=n.shift();e--;var i,a,s=new Array(e),u=`methodCaller<(${n.map((e=>e.name)).join(", ")}) => ${o.name}>`;return i=lt(u,((t,i,a,u)=>{for(var c=0,l=0;l<e;++l)s[l]=n[l].readValueFromPointer(u+c),c+=n[l].argPackAdvance;var d=1===r?Jt(i,s):i.apply(t,s);return Xt(o,a,d)})),a=Yt.length,Yt.push(i),a},h:(e,t)=>(e=Mt.toValue(e),t=Mt.toValue(t),Mt.toHandle(e[t])),e:e=>{e>4&&(Dt.get(e).refcount+=1)},W:(e,t)=>(e=Mt.toValue(e))instanceof(t=Mt.toValue(t)),pa:e=>"number"==typeof(e=Mt.toValue(e)),M:e=>"string"==typeof(e=Mt.toValue(e)),Pa:()=>Mt.toHandle([]),f:e=>Mt.toHandle(Qt(e)),y:()=>Mt.toHandle({}),i:e=>{var t=Mt.toValue(e);Fe(t),Lt(e)},k:(e,t,r)=>{e=Mt.toValue(e),t=Mt.toValue(t),r=Mt.toValue(r),e[t]=r},g:(e,t)=>{var r=(e=$t(e,"_emval_take_value")).readValueFromPointer(t);return Mt.toHandle(r)},Af:e=>{throw e=Mt.toValue(e)},Dd:e=>(e=Mt.toValue(e),Mt.toHandle(typeof e)),Db:function(e,t){e=er(e);var r=new Date(1e3*e);D[t>>2]=r.getUTCSeconds(),D[t+4>>2]=r.getUTCMinutes(),D[t+8>>2]=r.getUTCHours(),D[t+12>>2]=r.getUTCDate(),D[t+16>>2]=r.getUTCMonth(),D[t+20>>2]=r.getUTCFullYear()-1900,D[t+24>>2]=r.getUTCDay();var n=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),o=(r.getTime()-n)/864e5|0;D[t+28>>2]=o},Eb:function(e,t){e=er(e);var r=new Date(1e3*e);D[t>>2]=r.getSeconds(),D[t+4>>2]=r.getMinutes(),D[t+8>>2]=r.getHours(),D[t+12>>2]=r.getDate(),D[t+16>>2]=r.getMonth(),D[t+20>>2]=r.getFullYear()-1900,D[t+24>>2]=r.getDay();var n=0|or(r);D[t+28>>2]=n,D[t+36>>2]=-60*r.getTimezoneOffset();var o=new Date(r.getFullYear(),0,1),i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),s=0|(i!=a&&r.getTimezoneOffset()==Math.min(a,i));D[t+32>>2]=s},Fb:function(e){var t=(()=>{var t=new Date(D[e+20>>2]+1900,D[e+16>>2],D[e+12>>2],D[e+8>>2],D[e+4>>2],D[e>>2],0),r=D[e+32>>2],n=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),s=Math.min(a,i);if(r<0)D[e+32>>2]=Number(i!=a&&s==n);else if(r>0!=(s==n)){var u=Math.max(a,i),c=r>0?s:u;t.setTime(t.getTime()+6e4*(c-n))}D[e+24>>2]=t.getDay();var l=0|or(t);D[e+28>>2]=l,D[e>>2]=t.getSeconds(),D[e+4>>2]=t.getMinutes(),D[e+8>>2]=t.getHours(),D[e+12>>2]=t.getDate(),D[e+16>>2]=t.getMonth(),D[e+20>>2]=t.getYear();var d=t.getTime();return isNaN(d)?-1:d/1e3})();return BigInt(t)},Bb:function(e,t,r,n,o,i,a){o=er(o);try{if(isNaN(o))return 61;var s=Ae.getStreamFromFD(n),u=Ce.mmap(s,e,o,t,r),c=u.ptr;return D[i>>2]=u.allocated,L[a>>2]=c,0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},Cb:function(e,t,r,n,o,i){i=er(i);try{if(isNaN(i))return 61;var a=Ae.getStreamFromFD(o);2&r&&Ae.doMsync(e,a,t,n,i),Ce.munmap(a)}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},ub:(e,t,r)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),i=new Date(n,6,1),a=o.getTimezoneOffset(),s=i.getTimezoneOffset(),u=Math.max(a,s);function c(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}L[e>>2]=60*u,D[t>>2]=Number(a!=s);var l=c(o),d=c(i),f=ir(l),h=ir(d);s<a?(L[r>>2]=f,L[r+4>>2]=h):(L[r>>2]=h,L[r+4>>2]=f)},b:()=>{Q("")},Be:function(e){var t=xe(e);localStorage.removeItem(t)},xa:(e,t,r,n,o)=>pr.chooseConfig(e,t,r,n,o),Ba:(e,t,r,n)=>{if(62e3!=e)return pr.setErrorCode(12296),0;for(var o=1;;){var i=D[n>>2];if(12440!=i){if(12344==i)break;return pr.setErrorCode(12292),0}o=D[n+4>>2],n+=8}return o<2||o>3?(pr.setErrorCode(12293),0):(pr.contextAttributes.majorVersion=o-1,pr.contextAttributes.minorVersion=0,pr.context=mr.createContext(u.canvas,pr.contextAttributes),0!=pr.context?(pr.setErrorCode(12288),mr.makeContextCurrent(pr.context),u.useWebGL=!0,hr.moduleContextCreatedCallbacks.forEach((function(e){e()})),mr.makeContextCurrent(null),62004):(pr.setErrorCode(12297),0))},kb:(e,t,r,n)=>62e3!=e?(pr.setErrorCode(12296),0):62002!=t?(pr.setErrorCode(12293),0):(pr.setErrorCode(12288),62006),Da:(e,t)=>62e3!=e?(pr.setErrorCode(12296),0):62004!=t?(pr.setErrorCode(12294),0):(mr.deleteContext(pr.context),pr.setErrorCode(12288),pr.currentContext==t&&(pr.currentContext=0),1),la:(e,t)=>62e3!=e?(pr.setErrorCode(12296),0):62006!=t?(pr.setErrorCode(12301),1):(pr.currentReadSurface==t&&(pr.currentReadSurface=0),pr.currentDrawSurface==t&&(pr.currentDrawSurface=0),pr.setErrorCode(12288),1),T:(e,t,r,n)=>{if(62e3!=e)return pr.setErrorCode(12296),0;if(62002!=t)return pr.setErrorCode(12293),0;if(!n)return pr.setErrorCode(12300),0;switch(pr.setErrorCode(12288),r){case 12320:return D[n>>2]=pr.contextAttributes.alpha?32:24,1;case 12321:return D[n>>2]=pr.contextAttributes.alpha?8:0,1;case 12322:case 12323:case 12324:return D[n>>2]=8,1;case 12325:return D[n>>2]=pr.contextAttributes.depth?24:0,1;case 12326:return D[n>>2]=pr.contextAttributes.stencil?8:0,1;case 12327:case 12335:case 12340:return D[n>>2]=12344,1;case 12328:return D[n>>2]=62002,1;case 12329:case 12333:case 12334:case 12345:case 12346:case 12347:case 12349:case 12350:case 12354:return D[n>>2]=0,1;case 12330:case 12332:return D[n>>2]=4096,1;case 12331:return D[n>>2]=16777216,1;case 12337:return D[n>>2]=pr.contextAttributes.antialias?4:0,1;case 12338:return D[n>>2]=pr.contextAttributes.antialias?1:0,1;case 12339:case 12352:return D[n>>2]=4,1;case 12341:case 12342:case 12343:return D[n>>2]=-1,1;case 12348:return D[n>>2]=1,1;case 12351:return D[n>>2]=12430,1;default:return pr.setErrorCode(12292),0}},lc:e=>(pr.setErrorCode(12288),0!=e&&1!=e?0:62e3),Ca:()=>pr.errorCode,ac:(e,t,r)=>62e3!=e?(pr.setErrorCode(12296),0):(t&&(D[t>>2]=1),r&&(D[r>>2]=4),pr.defaultDisplayInitialized=!0,pr.setErrorCode(12288),1),aa:(e,t,r,n)=>62e3!=e?(pr.setErrorCode(12296),0):0!=n&&62004!=n?(pr.setErrorCode(12294),0):0!=r&&62006!=r||0!=t&&62006!=t?(pr.setErrorCode(12301),0):(mr.makeContextCurrent(n?pr.context:null),pr.currentContext=n,pr.currentDrawSurface=t,pr.currentReadSurface=r,pr.setErrorCode(12288),1),ha:(e,t)=>{if(62e3!=e)return pr.setErrorCode(12296),0;if(pr.setErrorCode(12288),pr.stringCache[t])return pr.stringCache[t];var r;switch(t){case 12371:r=ir("Emscripten");break;case 12372:r=ir("1.4 Emscripten EGL");break;case 12373:r=ir("");break;case 12429:r=ir("OpenGL_ES");break;default:return pr.setErrorCode(12300),0}return pr.stringCache[t]=r,r},Ea:(e,t)=>{if(pr.defaultDisplayInitialized)if(u.ctx){if(!u.ctx.isContextLost())return pr.setErrorCode(12288),1;pr.setErrorCode(12302)}else pr.setErrorCode(12290);else pr.setErrorCode(12289);return 0},Qc:e=>62e3!=e?(pr.setErrorCode(12296),0):(pr.currentContext=0,pr.currentReadSurface=0,pr.currentDrawSurface=0,pr.defaultDisplayInitialized=!1,pr.setErrorCode(12288),1),H:(e,t,r)=>yr(e,t,r),Ke:e=>{console.error(xe(e))},Le:e=>{console.log(xe(e))},sa:e=>{console.warn(xe(e))},ia:()=>Date.now(),Ae:function(){},vb:()=>2147483648,Qb:Pt,hg:vr,ig:br,fd:wr,re:Er,Uc:Sr,jg:kr,kg:_r,Rc:Cr,Sc:xr,hf:Ar,jf:Tr,Te:Fr,lg:Pr,ec:Br,Gf:Lr,If:Rr,mg:Mr,ng:Ir,ee:Or,og:$r,de:Ur,bf:qr,pg:Nr,qg:Hr,kf:Vr,rg:Wr,uc:Gr,vc:jr,xc:zr,wc:Xr,sg:Yr,ce:Kr,tg:Qr,Ra:Zr,ug:Jr,vg:en,wg:tn,kd:rn,xg:nn,jd:on,$e:an,be:sn,yg:un,ld:cn,zg:ln,Ag:dn,Bg:fn,Cg:hn,lf:pn,Dg:mn,hd:gn,te:yn,mf:vn,Ue:bn,Eg:wn,af:En,Fg:Sn,dc:kn,Hf:Cn,Jf:xn,ae:An,Gg:Tn,$d:Fn,_d:Pn,Hg:Bn,Ig:Dn,Jg:Ln,Ef:Mn,he:In,sd:On,Bf:$n,td:Un,Tb:qn,yf:Vn,od:Wn,ie:Gn,Kg:zn,Ff:Yn,ge:Kn,pd:Qn,Cf:Zn,qd:Jn,rd:eo,sf:to,Lg:ro,Mg:no,ed:oo,qe:io,Tc:ao,Ze:so,Ng:uo,Og:co,nf:lo,of:fo,Xc:ho,Pg:po,Qg:go,qf:yo,id:vo,ue:bo,rf:wo,Ve:Eo,Rg:So,cc:ko,Df:To,Kf:Fo,df:Po,Zd:Do,Yd:Lo,pc:Ro,qc:Mo,sc:Io,Xd:Oo,Wd:$o,Vd:Ho,jc:Vo,Sg:Wo,Tg:Go,Ug:jo,Gc:zo,ef:Xo,kc:Ko,nc:Qo,Vc:Zo,th:Jo,Vb:ei,Zb:ti,Vg:ri,Wg:ni,le:ii,ne:si,ke:ui,cd:ci,me:li,dd:di,oe:fi,ff:hi,fc:pi,gc:mi,Xg:gi,Qe:yi,Ud:vi,Yg:bi,Qa:wi,uh:Ei,mc:Si,Td:ki,Sd:_i,Oc:Ci,rc:xi,tc:Ai,Zg:Pi,Rd:Li,Qd:Ri,Hc:Mi,Nc:$i,Mc:Ui,Nd:qi,Pd:Ni,Od:Hi,Md:Vi,Re:Wi,Se:Gi,Ld:ji,Kd:zi,Jd:Xi,Id:Yi,gd:Ki,se:Qi,Hd:Zi,ic:Ji,Gd:ea,_e:ta,_g:ra,bc:na,Wc:ia,je:aa,$g:sa,ah:ua,wf:ca,xf:la,$b:da,bh:fa,Fd:ha,Yb:pa,Xb:ma,pe:ga,zf:ya,ch:Ea,Ed:Sa,gf:ka,cf:_a,_b:Ca,Cd:xa,We:Aa,hc:Ta,Xe:Fa,Ye:Pa,dh:Ba,Bd:Da,eh:La,fh:Ra,gh:Ma,hh:Ia,ih:Oa,jh:$a,kh:Ua,lh:qa,nd:Na,mh:Ha,nh:Va,oh:Wa,ph:Ga,tf:ja,Wb:za,qh:Xa,md:Ya,Pc:Ka,rh:Qa,sh:Ja,dg:es,eg:rs,Fc:ns,Bc:os,fg:is,gg:as,cg:ss,bg:us,Ec:cs,Ac:ls,ag:ds,$f:fs,_f:hs,Zf:ps,Dc:ms,zc:gs,Yf:ys,Xf:vs,Lf:bs,Mf:ws,Cc:Es,yc:Ss,oc:ks,Nf:_s,bd:Cs,$c:xs,Of:As,ad:Ts,Zc:Fs,Pf:Ps,_c:Bs,Yc:Ds,Qf:Ls,Ad:Rs,Rf:Ms,zd:Is,yd:Os,Sf:$s,xd:Us,Tf:qs,wd:Ns,Uf:Hs,uf:Ws,fe:Gs,ud:js,vd:zs,Ub:Xs,Lc:Ys,Jc:Ks,Kc:Qs,Ic:Zs,vf:Js,Vf:eu,Wf:tu,Sa:ru,wb:e=>{var t=F.length,r=2147483648;if((e>>>=0)>r)return!1;for(var n,o,i=1;i<=4;i*=2){var a=t*(1+.2/i);a=Math.min(a,e+100663296);var s=Math.min(r,(n=Math.max(e,a))+((o=65536)-n%o)%o);if(nu(s))return!0}return!1},gb:function(e,t,r,n,o,i,a,s,c){const l=u.UTF8ToString(e,e+t),d=u.HEAPU8.subarray(o,o+i),f=u.emscripten_ubq_codec_audioDecoderNextHandle++,h={codec:l,sampleRate:r,numberOfChannels:n,description:d};try{const e=u.emscripten_ubq_codec_createAudioDecoder(a,s,c);AudioDecoder.isConfigSupported(h).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(h),u.emscripten_ubq_codec_audioDecoders.set(f,{audioDecoder:e,decoderConfig:h,leftBufferPtr:a,rightBufferPtr:s,bufferLength:c})}catch(e){return u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:f})},ab:function(e,t,r,n,o,i){const a=u.UTF8ToString(e,e+t),s=u.emscripten_ubq_codec_audioEncoderNextHandle++,c={codec:a,sampleRate:r,numberOfChannels:n,bitrate:o};try{const e=new AudioEncoder({output:e=>{const t=u._malloc(e.byteLength),r=u.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),u.emscripten_ubq_codec_onOutputEncodedAudioChunk(s,t,e.byteLength,i),u._free(t)},error:e=>{u.emscripten_ubq_codec_audioEncoders.get(s).frameIndex>1&&console.error(e)}});e.configure(c),u.emscripten_ubq_codec_audioEncoders.set(s,{audioEncoder:e,audioEncoderConfig:c,frameIndex:0})}catch(e){return e+=' Requested codec: "'+a+'"',e+="; sample rate: "+r,e+="; channels: "+n,e+="; bit rate: "+o,u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:s})},jb:function(e,t,r,n,o,i,a){const s=u.UTF8ToString(e,e+t),c=u.HEAPU8.subarray(o,o+i),l=u.emscripten_ubq_codec_videoDecoderNextHandle++,d={codec:s,codedWidth:r,codedHeight:n,description:c,optimizeForLatency:!0};try{const e=u.emscripten_ubq_codec_createVideoDecoder(l,a);VideoDecoder.isConfigSupported(d).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(d),u.emscripten_ubq_codec_videoDecoders.set(l,{videoDecoder:e,decoderConfig:d,codecServicePtr:a})}catch(e){return u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:l})},db:function(e,t,r,n,o,i,a){const s=u.UTF8ToString(e,e+t),c=u.emscripten_ubq_codec_videoEncoderNextHandle++,l=u.specialHTMLTargets["!canvas"];l.width=r,l.height=n;const d={codec:s,width:r,height:n,avc:{format:"annexb"},framerate:o};i>0&&(d.bitrate=i);try{const e=new VideoEncoder({output:e=>{const t=u._malloc(e.byteLength),r=u.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),u.emscripten_ubq_codec_onOutputEncodedVideoChunk(c,t,e.byteLength,a),u._free(t)},error:e=>console.error(e)});VideoEncoder.isConfigSupported(d).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(d),u.emscripten_ubq_codec_videoEncoders.set(c,{videoEncoder:e,encoderConfig:d,groupOfPictures:150,frameIndex:0})}catch(e){return e+=' Requested codec: "'+s+'"',e+="; resolution: "+r+"x"+n,u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:c})},Wa:function(e,t,r,n,o,i){const a=u.emscripten_ubq_codec_audioDecoders.get(e);if(a.audioDecoder.unexpectedError)return u.emscripten_ubq_codec_createNativeResult({code:2,error:a.audioDecoder.unexpectedError});"closed"===a.audioDecoder.state&&(a.audioDecoder=u.emscripten_ubq_codec_createAudioDecoder(a.leftBufferPtr,a.rightBufferPtr,a.bufferLength),a.audioDecoder.configure(a.decoderConfig));const s=a.audioDecoder,c=u.HEAPU8.subarray(o,o+i),l=new EncodedAudioChunk({type:t?"key":"delta",timestamp:r,duration:n,data:c});try{s.decode(l)}catch(e){return s.configUnsupported?u.emscripten_ubq_codec_createNativeResult({code:2,error:e}):u.emscripten_ubq_codec_createNativeResult({code:1,error:e})}return u.emscripten_ubq_codec_createNativeResult({code:0})},Xa:function(e,t,r,n,o,i){const a=u.emscripten_ubq_codec_videoDecoders.get(e);if(a.videoDecoder.unexpectedError)return u.emscripten_ubq_codec_createNativeResult({code:2,error:a.videoDecoder.unexpectedError});if("closed"===a.videoDecoder.state){const t=a.videoDecoder.textures;return a.videoDecoder=u.emscripten_ubq_codec_createVideoDecoder(e,a.codecServicePtr),a.videoDecoder.textures=t,a.videoDecoder.configure(a.decoderConfig),u.emscripten_ubq_codec_createNativeResult({code:1,error:"VideoDecoder was closed"})}const s=a.videoDecoder,c=u.HEAPU8.subarray(o,o+i),l=new EncodedVideoChunk({type:t?"key":"delta",timestamp:r,duration:n,data:c});try{s.decode(l)}catch(e){return s.configUnsupported?u.emscripten_ubq_codec_createNativeResult({code:2,error:e}):u.emscripten_ubq_codec_createNativeResult({code:1,error:e})}return u.emscripten_ubq_codec_createNativeResult({code:0})},S:function(e){if(u.emscripten_ubq_codec_audioDecoders.has(e)){const t=u.emscripten_ubq_codec_audioDecoders.get(e);"closed"!==t.audioDecoder.state&&t.audioDecoder.close(),u.emscripten_ubq_codec_audioDecoders.delete(e)}},ea:function(e){const t=u.emscripten_ubq_codec_audioEncoders.get(e);"closed"!==t.audioEncoder.state&&t.audioEncoder.close(),u.emscripten_ubq_codec_audioEncoders.delete(e)},ga:function(e){if(u.emscripten_ubq_codec_videoDecoders.has(e)){const t=u.emscripten_ubq_codec_videoDecoders.get(e);"closed"!==t.videoDecoder.state&&t.videoDecoder.close(),u.emscripten_ubq_codec_videoDecoders.delete(e)}},fa:function(e){const t=u.emscripten_ubq_codec_videoEncoders.get(e);"closed"!==t.videoEncoder.state&&t.videoEncoder.close(),u.emscripten_ubq_codec_videoEncoders.delete(e)},$a:function(e,t,r){const n=1e6,o=u.emscripten_ubq_codec_audioEncoders.get(e),i=o.audioEncoderConfig.sampleRate,a=o.audioEncoderConfig.numberOfChannels,s=r/a,c=Math.round(n*(o.frameIndex*s/i)),l=Math.round(n*(s/i)),d=u.HEAPF32.subarray(t/4,t/4+r),f=new AudioData({format:"f32",sampleRate:i,numberOfFrames:s,numberOfChannels:a,duration:l,timestamp:c,data:d});o.audioEncoder.encode(f),o.frameIndex++,f.close()},cb:function(e,t,r){const n=1e6,o=u.emscripten_ubq_codec_videoEncoders.get(e),i=Math.round(n*(o.frameIndex/o.encoderConfig.framerate)),a=o.frameIndex%o.groupOfPictures==0,s=Math.round(n/o.encoderConfig.framerate),c=u.specialHTMLTargets["!canvas"],l=new VideoFrame(c,{timestamp:i,duration:s});o.videoEncoder.encode(l,{keyFrame:a}),l.close(),o.frameIndex++},_a:async function(e,t){const r=u.emscripten_ubq_codec_audioEncoders.get(e);try{await r.audioEncoder.flush()}catch{if(r.frameIndex>1)throw new Error("AudioEncoder.flush() failed")}u.emscripten_ubq_codec_onFinalizedAudioEncoding(e,t)},bb:async function(e,t){const r=u.emscripten_ubq_codec_videoEncoders.get(e);await r.videoEncoder.flush(),u.emscripten_ubq_codec_onFinalizedVideoEncoding(e,t)},fb:async function(e,t){const r=u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder;r.flushing=!0;try{await r.flush()}catch{}r.flushing=!1,r.writtenFrames=t},Y:async function(e,t,r){const n=u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder;n.shouldDropFrames=r,n.flushing=!0;try{await n.flush()}catch{}n.flushing=!1,n.shouldDropFrames=!1,n.decodedFrames=t},ua:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.decodeQueueSize},va:function(e){return u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.decodedFrames},X:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.writtenFrames},eb:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.flushing},ib:function(e){return u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.flushing},Z:function(){return"undefined"!=typeof VideoFrame&&"undefined"!=typeof VideoDecoder&&"undefined"!=typeof VideoEncoder&&"undefined"!=typeof AudioDecoder&&"undefined"!=typeof AudioEncoder},Ya:function(e,t,r,n,o,i,a){const s=u.emscripten_ubq_codec_videoDecoders.get(e),c=u.UTF8ToString(t,t+r),l=u.HEAPU8.subarray(i,i+a);s.videoDecoder.configure({codec:c,codedWidth:n,codedHeight:o,description:l})},hb:function(e,t){u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.requestedFrame=t},Za:function(e,t,r){const n=u.emscripten_ubq_codec_videoDecoders.get(e),o=u.HEAPU32.subarray(t/4,t/4+r);n.videoDecoder.textures=[];for(let e=0;e<r;e++)n.videoDecoder.textures[e]=mr.textures[o[e]]},Fe:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return!!(null==t?void 0:t.allocate())},ra:function(){u.emscripten_ubq_asyncFetchManager.clear()},qa:function(e,t,r,n){return u.emscripten_ubq_asyncFetchManager.createHeader(e,t,r,n)},Ie:function(e){u.emscripten_ubq_asyncFetchManager.deleteHeader(e)},Je:function(e,t,r,n,o,i,a,s,c){return u.emscripten_ubq_asyncFetchManager.fetch(e,t,r,n,o,i,a,s,c).handle},ba:function(e){return u.emscripten_ubq_asyncFetchManager.deleteProcess(e)},He:function(e){var t,r;return null!==(r=null===(t=u.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.receivedLength)&&void 0!==r?r:0},Ee:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultAddress:-1},De:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultLength:-1},oa:function(e){var t,r;return null!==(r=null===(t=u.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.state)&&void 0!==r?r:-1},Ge:function(e){var t,r;return null!==(r=null===(t=u.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.totalBytes)&&void 0!==r?r:0},lb:function(){return!!u.emscripten_ubq_settings_forceWebGL1},wa:uu,_:e=>{mr.currentContext==e&&(mr.currentContext=0),mr.deleteContext(e)},sb:e=>(e=>{var t=e.getExtension("OES_vertex_array_object");if(t)return e.createVertexArray=()=>t.createVertexArrayOES(),e.deleteVertexArray=e=>t.deleteVertexArrayOES(e),e.bindVertexArray=e=>t.bindVertexArrayOES(e),e.isVertexArray=e=>t.isVertexArrayOES(e),1})(mr.contexts[e].GLctx),ob:e=>(e=>{var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=(e,r)=>t.drawBuffersWEBGL(e,r),1})(mr.contexts[e].GLctx),nb:e=>(e=>!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw")))(mr.contexts[e].GLctx),$:(e,t)=>{var r=mr.getContext(e),n=xe(t);return n.startsWith("GL_")&&(n=n.substr(3)),!!r.GLctx.getExtension(n)},mb:(e,t)=>{if(!t)return-5;if(!(e=mr.contexts[e]))return-3;var r=e.GLctx;if(!r)return-3;r=r.getContextAttributes(),D[t>>2]=r.alpha,D[t+4>>2]=r.depth,D[t+8>>2]=r.stencil,D[t+12>>2]=r.antialias,D[t+16>>2]=r.premultipliedAlpha,D[t+20>>2]=r.preserveDrawingBuffer;var n=r.powerPreference&&iu.indexOf(r.powerPreference);return D[t+24>>2]=n,D[t+28>>2]=r.failIfMajorPerformanceCaveat,D[t+32>>2]=e.version,D[t+36>>2]=0,0},Nb:e=>mr.makeContextCurrent(e)?0:-5,Hb:(e,t)=>{var r=0;return lu().forEach(((n,o)=>{var i=t+r;L[e+4*o>>2]=i,((e,t)=>{for(var r=0;r<e.length;++r)A[t++>>0]=e.charCodeAt(r);A[t>>0]=0})(n,i),r+=n.length+1})),0},Ib:(e,t)=>{var r=lu();L[e>>2]=r.length;var n=0;return r.forEach((e=>n+=e.length+1)),L[t>>2]=n,0},Ma:lr,ja:function(e){try{var t=Ae.getStreamFromFD(e);return Ce.close(t),0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},tb:function(e,t){try{var r=Ae.getStreamFromFD(e),n=r.tty?2:Ce.isDir(r.mode)?3:Ce.isLink(r.mode)?7:4;return A[t>>0]=n,P[t+2>>1]=0,M[t+8>>3]=BigInt(0),M[t+16>>3]=BigInt(0),0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},Ab:function(e,t,r,n,o){n=er(n);try{if(isNaN(n))return 61;var i=Ae.getStreamFromFD(e),a=du(i,t,r,n);return L[o>>2]=a,0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},Aa:function(e,t,r,n){try{var o=Ae.getStreamFromFD(e),i=du(o,t,r);return L[n>>2]=i,0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},Gb:function(e,t,r,n){t=er(t);try{if(isNaN(t))return 61;var o=Ae.getStreamFromFD(e);return Ce.llseek(o,t,r),M[n>>3]=BigInt(o.position),o.getdents&&0===t&&0===r&&(o.getdents=null),0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},za:function(e,t,r,n){try{var o=((e,t,r,n)=>{for(var o=0,i=0;i<r;i++){var a=L[t>>2],s=L[t+4>>2];t+=8;var u=Ce.write(e,A,a,s,n);if(u<0)return-1;o+=u,void 0!==n&&(n+=u)}return o})(Ae.getStreamFromFD(e),t,r);return L[n>>2]=o,0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},Ce:function(e){var t=xe(e),r=localStorage.getItem(t);return null==r?null:ir(r)},ze:function(){return"undefined"!=typeof window?ir(window.location.hostname):ir("")},pb:(e,t)=>(fe(F.subarray(e,e+t)),0),z:function(e,t,r){var n=$u();try{return _t(e)(t,r)}catch(e){if(Uu(n),e!==e+0)throw e;Ou(1,0)}},N:function(e,t){var r=$u();try{return _t(e)(t)}catch(e){if(Uu(r),e!==e+0)throw e;Ou(1,0)}},G:function(e,t,r){var n=$u();try{return _t(e)(t,r)}catch(e){if(Uu(n),e!==e+0)throw e;Ou(1,0)}},n:function(e,t,r,n){var o=$u();try{return _t(e)(t,r,n)}catch(e){if(Uu(o),e!==e+0)throw e;Ou(1,0)}},wh:function(e){var t=$u();try{return _t(e)()}catch(e){if(Uu(t),e!==e+0)throw e;Ou(1,0)}},Ta:function(e,t,r){var n=$u();try{return _t(e)(t,r)}catch(e){if(Uu(n),e!==e+0)throw e;Ou(1,0)}},r:function(e,t){var r=$u();try{return _t(e)(t)}catch(e){if(Uu(r),e!==e+0)throw e;Ou(1,0)}},V:function(e,t,r,n,o,i,a,s,u,c,l,d,f,h,p,m){var g=$u();try{return _t(e)(t,r,n,o,i,a,s,u,c,l,d,f,h,p,m)}catch(e){if(Uu(g),e!==e+0)throw e;Ou(1,0)}},q:function(e,t,r){var n=$u();try{return _t(e)(t,r)}catch(e){if(Uu(n),e!==e+0)throw e;Ou(1,0)}},t:function(e,t,r,n){var o=$u();try{return _t(e)(t,r,n)}catch(e){if(Uu(o),e!==e+0)throw e;Ou(1,0)}},U:function(e,t,r,n,o){var i=$u();try{return _t(e)(t,r,n,o)}catch(e){if(Uu(i),e!==e+0)throw e;Ou(1,0)}},Pe:function(e,t,r,n,o,i){var a=$u();try{return _t(e)(t,r,n,o,i)}catch(e){if(Uu(a),e!==e+0)throw e;Ou(1,0)}},Oa:function(e,t,r,n,o,i,a){var s=$u();try{return _t(e)(t,r,n,o,i,a)}catch(e){if(Uu(s),e!==e+0)throw e;Ou(1,0)}},Na:function(e,t,r,n,o,i,a,s,u,c){var l=$u();try{return _t(e)(t,r,n,o,i,a,s,u,c)}catch(e){if(Uu(l),e!==e+0)throw e;Ou(1,0)}},R:function(e){var t=$u();try{_t(e)()}catch(e){if(Uu(t),e!==e+0)throw e;Ou(1,0)}},v:function(e,t){var r=$u();try{_t(e)(t)}catch(e){if(Uu(r),e!==e+0)throw e;Ou(1,0)}},C:function(e,t,r,n){var o=$u();try{_t(e)(t,r,n)}catch(e){if(Uu(o),e!==e+0)throw e;Ou(1,0)}},F:function(e,t,r){var n=$u();try{_t(e)(t,r)}catch(e){if(Uu(n),e!==e+0)throw e;Ou(1,0)}},p:function(e,t,r,n){var o=$u();try{_t(e)(t,r,n)}catch(e){if(Uu(o),e!==e+0)throw e;Ou(1,0)}},D:function(e,t,r,n,o){var i=$u();try{_t(e)(t,r,n,o)}catch(e){if(Uu(i),e!==e+0)throw e;Ou(1,0)}},Oe:function(e,t,r,n,o,i){var a=$u();try{_t(e)(t,r,n,o,i)}catch(e){if(Uu(a),e!==e+0)throw e;Ou(1,0)}},Me:function(e,t,r,n,o,i,a){var s=$u();try{_t(e)(t,r,n,o,i,a)}catch(e){if(Uu(s),e!==e+0)throw e;Ou(1,0)}},vh:function(e,t,r,n,o,i,a,s){var u=$u();try{_t(e)(t,r,n,o,i,a,s)}catch(e){if(Uu(u),e!==e+0)throw e;Ou(1,0)}},Ne:function(e,t,r,n,o,i,a,s,u,c){var l=$u();try{_t(e)(t,r,n,o,i,a,s,u,c)}catch(e){if(Uu(l),e!==e+0)throw e;Ou(1,0)}},na:function(){return"undefined"!=typeof localStorage},Ka:function(){return"undefined"!=typeof process&&process.versions&&process.versions.node?1:0},ta:function(e,t){const r=Mt.toValue(t),n=u.ctx;n.bindTexture(n.TEXTURE_2D,mr.textures[e]),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r)},a:k,La:function(e,t){var r=xe(e),n=xe(t);localStorage.setItem(r,n)},qb:(e,t,r,n,o)=>mu(e,t,r,n)},Tu=function(){var e,t,r,o,i={a:Au};function a(e,t){var r;return Tu=e.exports,wt=Tu.Bh,r=Tu.xh,V.unshift(r),K(),Tu}if(Y(),u.instantiateWasm)try{return u.instantiateWasm(i,a)}catch(e){C(`Module.instantiateWasm callback failed with error: ${e}`),n(e)}return(e=S,t=Z,r=i,o=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||ee(t)||v||"function"!=typeof fetch?ne(t,r,o):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(o,(function(e){return C(`wasm streaming compile failed: ${e}`),C("falling back to ArrayBuffer instantiation"),ne(t,r,o)}))))).catch(n),{}}(),Fu=u._malloc=e=>(Fu=u._malloc=Tu.yh)(e),Pu=u._main=(e,t)=>(Pu=u._main=Tu.zh)(e,t),Bu=u._free=e=>(Bu=u._free=Tu.Ah)(e),Du=(u._ma_malloc_emscripten=(e,t)=>(u._ma_malloc_emscripten=Tu.Ch)(e,t),u._ma_free_emscripten=(e,t)=>(u._ma_free_emscripten=Tu.Dh)(e,t),u._ma_device_process_pcm_frames_capture__webaudio=(e,t,r)=>(Du=u._ma_device_process_pcm_frames_capture__webaudio=Tu.Eh)(e,t,r)),Lu=u._ma_device_process_pcm_frames_playback__webaudio=(e,t,r)=>(Lu=u._ma_device_process_pcm_frames_playback__webaudio=Tu.Fh)(e,t,r),Ru=e=>(Ru=Tu.Gh)(e),Mu=e=>(Mu=Tu.Hh)(e),Iu=(e,t)=>(Iu=Tu.Ih)(e,t),Ou=(e,t)=>(Ou=Tu.Jh)(e,t),$u=()=>($u=Tu.Kh)(),Uu=e=>(Uu=Tu.Lh)(e),qu=e=>(qu=Tu.Mh)(e),Nu=e=>(Nu=Tu.Nh)(e),Hu=e=>(Hu=Tu.Oh)(e),Vu=(e,t,r)=>(Vu=Tu.Ph)(e,t,r),Wu=e=>(Wu=Tu.Qh)(e);function Gu(e=h){function r(){xu||(xu=!0,u.calledRun=!0,$||(u.noFSInit||Ce.init.initialized||Ce.init(),Ce.ignorePermissions=!1,we.init(),ae(V),ae(W),t(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),ju&&function(e=[]){var t=Pu;e.unshift(p);var r=e.length,n=qu(4*(r+1)),o=n;e.forEach((e=>{L[o>>2]=gu(e),o+=4})),L[o>>2]=0;try{var i=t(r,n);return cr(i,!0),i}catch(e){return sr(e)}}(e),function(){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;)e=u.postRun.shift(),G.unshift(e);var e;ae(G)}()))}j>0||(function(){if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)e=u.preRun.shift(),H.unshift(e);var e;ae(H)}(),j>0||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),r()}),1)):r()))}if(u.___start_em_js=2561811,u.___stop_em_js=2562750,u.addRunDependency=Y,u.removeRunDependency=K,u.FS_createPath=Ce.createPath,u.FS_createLazyFile=Ce.createLazyFile,u.FS_createDevice=Ce.createDevice,u.ccall=(e,t,r,n,o)=>{var i={string:e=>{var t=0;return null!=e&&0!==e&&(t=gu(e)),t},array:e=>{var t=qu(e.length);return pu(e,t),t}},a=(e=>u["_"+e])(e),s=[],c=0;if(n)for(var l=0;l<n.length;l++){var d=i[r[l]];d?(0===c&&(c=$u()),s[l]=d(n[l])):s[l]=n[l]}var f,h=a.apply(null,s);return f=h,0!==c&&Uu(c),h=function(e){return"string"===t?xe(e):"boolean"===t?Boolean(e):e}(f),h},u.getValue=function(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return A[e>>0];case"i16":return P[e>>1];case"i32":return D[e>>2];case"i64":return M[e>>3];case"float":return R[e>>2];case"double":return O[e>>3];case"*":return L[e>>2];default:Q(`invalid type for getValue: ${t}`)}},u.UTF8ToString=xe,u.specialHTMLTargets=au,u.FS_createPreloadedFile=Ce.createPreloadedFile,u.FS_createDataFile=Ce.createDataFile,u.FS_unlink=Ce.unlink,X=function e(){xu||Gu(),xu||(X=e)},u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();var ju=!0;return u.noInitialRun&&(ju=!1),Gu(),e.ready});"object"==typeof e&&"object"==typeof t?t.exports=n:"function"==typeof define&&define.amd&&define([],(()=>n))}});var P=Symbol("NO_VALUE");var B=(e=>(e.Png="image/png",e.Jpeg="image/jpeg",e.WebP="image/webp",e.Tga="image/x-tga",e.Wav="audio/wav",e.Mp4="video/mp4",e.QuickTime="video/quicktime",e.Binary="application/octet-stream",e.Pdf="application/pdf",e.Zip="application/zip",e))(B||{}),D=B,L=class extends TypeError{constructor(e,t){let r;const{message:n,...o}=e,{path:i}=e;super(0===i.length?n:"At path: "+i.join(".")+" -- "+n),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>{var n;return null!=(n=r)?n:r=[e,...t()]}}};function R(e){return"object"==typeof e&&null!=e}function M(e){return"string"==typeof e?JSON.stringify(e):""+e}function I(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:o,branch:i}=t,{type:a}=r,{refinement:s,message:u="Expected a value of type `"+a+"`"+(s?" with refinement `"+s+"`":"")+", but received: `"+M(n)+"`"}=e;return{value:n,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:u}}function*O(e,t,r,n){var o;R(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const o of e){const e=I(o,t,r,n);e&&(yield e)}}function*$(e,t,r={}){const{path:n=[],branch:o=[e],coerce:i=!1,mask:a=!1}=r,s={path:n,branch:o};if(i&&(e=t.coercer(e,s),a&&"type"!==t.type&&R(t.schema)&&R(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let u=!0;for(const r of t.validator(e,s))u=!1,yield[r,void 0];for(let[r,c,l]of t.entries(e,s)){const t=$(c,l,{path:void 0===r?n:[...n,r],branch:void 0===r?o:[...o,c],coerce:i,mask:a});for(const n of t)n[0]?(u=!1,yield[n[0],void 0]):i&&(c=n[1],void 0===r?e=c:e instanceof Map?e.set(r,c):e instanceof Set?e.add(c):R(e)&&(e[r]=c))}if(u)for(const r of t.refiner(e,s))u=!1,yield[r,void 0];u&&(yield[void 0,e])}var U=class{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:t,schema:r,validator:n,refiner:o,coercer:i=(e=>e),entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=i,this.validator=n?(e,t)=>O(n(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>O(o(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=q(e,t);if(r[0])throw r[0]}(e,this)}create(e){return function(e,t){const r=q(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}(e,this)}is(e){return function(e,t){const r=q(e,t);return!r[0]}(e,this)}mask(e){return function(e,t){const r=q(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return q(e,this,t)}};function q(e,t,r={}){const n=$(e,t,r),o=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);if(o[0]){return[new L(o[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]}return[void 0,o[1]]}function N(e,t){return new U({type:e,schema:null,validator:t})}function H(e){return new U({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+M(e)})}function V(){return N("boolean",(e=>"boolean"==typeof e))}function W(){return N("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||"Expected an integer, but received: "+M(e)))}function G(){return N("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+M(e)))}function j(e){const t=e?Object.keys(e):[],r=N("never",(()=>!1));return new U({type:"object",schema:e||null,*entries(n){if(e&&R(n)){const o=new Set(Object.keys(n));for(const r of t)o.delete(r),yield[r,n[r],e[r]];for(const e of o)yield[e,n[e],r]}},validator:e=>R(e)||"Expected an object, but received: "+M(e),coercer:e=>R(e)?{...e}:e})}function z(){return N("string",(e=>"string"==typeof e||"Expected a string, but received: "+M(e)))}function X(e,t,r={}){const{exclusive:n}=r;return Q(e,"max",(r=>n?r<t:r<=t||"Expected a "+e.type+" less than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function Y(e,t,r={}){const{exclusive:n}=r;return Q(e,"min",(r=>n?r>t:r>=t||"Expected a "+e.type+" greater than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function K(e){return Q(e,"nonempty",(t=>{const r=function(e){return e instanceof Map||e instanceof Set?e.size:e.length}(t);return r>0||"Expected a nonempty "+e.type+" but received an empty one"}))}function Q(e,t,r){return new U({...e,*refiner(n,o){yield*e.refiner(n,o);const i=O(r(n,o),o,e,n);for(const e of i)yield{...e,refinement:t}}})}function Z(e,t,r){const[n]=q(t,r);if(n)throw n.message=`Error in argument '${e}': ${n.message}`,n}function J(){const e=/image\/(png|jpeg|webp|x-tga)|audio\/(wav)|video\/(mp4|quicktime)|application\/octet-stream|application\/pdf/;return N("MimeType",(t=>!("string"!=typeof t||!e.test(t))||{message:`expected one of "image/png", "image/jpeg", "image/webp", "image/x-tga", "video/mp4", "video/quicktime", "application/pdf" or "application/octet-stream", but got "${t}"`}))}function ee(){const e=["Free","VerticalStack","HorizontalStack","DepthStack"];return N("SceneLayout",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}var te,re=Symbol("PROXY");function ne(e,t){Object.defineProperty(e,re,{value:{type:"getter"},writable:!1})}function oe(e,t){Object.defineProperty(e,re,{value:{type:"setter"},writable:!1})}function ie(e){if(e.isValid()){const t=e.value();return e.delete(),t}{const t=e.error(),r=t.publicMessage();throw t.delete(),e.delete(),new Error(r)}}function ae(e){return new Promise(((t,r)=>{e((e=>{try{const r=ie(e);t(r)}catch(e){r(e)}}))}))}(e=>{let t;var r;(r=t=e.ColorSpace||(e.ColorSpace={}))[r.sRGB=0]="sRGB",r[r.CMYK=1]="CMYK",r[r.SpotColor=2]="SpotColor",e.toColor=function(e){switch(e.colorSpace){case 0:return{r:e.components.x,g:e.components.y,b:e.components.z,a:e.components.w};case 2:return{name:e.spotColorName,tint:e.tint,externalReference:e.externalReference};case 1:return{c:e.components.x,m:e.components.y,y:e.components.z,k:e.components.w,tint:e.tint};default:throw new Error("Unknown color space!")}},e.fromColor=function(e){if(function(e){return"r"in e&&"a"in e&&void 0!==e.r&&void 0!==e.a}(e))return{colorSpace:0,components:{x:e.r,y:e.g,z:e.b,w:e.a},spotColorName:"",tint:1,externalReference:""};if(function(e){return"c"in e&&"m"in e&&"y"in e&&"k"in e&&void 0!==e.c&&void 0!==e.m&&void 0!==e.y&&void 0!==e.k}(e))return{colorSpace:1,components:{x:e.c,y:e.m,z:e.y,w:e.k},spotColorName:"",tint:e.tint,externalReference:""};if(function(e){return"name"in e&&void 0!==e.name}(e))return{colorSpace:2,components:{x:0,y:0,z:0,w:0},spotColorName:e.name,tint:e.tint,externalReference:e.externalReference};throw new Error("Unknown color space!")}})(te||(te={}));var se,ue,ce,le,de,fe,he,pe,me,ge,ye,ve,be,we,Ee,Se,ke,_e,Ce,xe,Ae,Te,Fe,Pe,Be,De,Le,Re,Me,Ie,Oe,$e,Ue,qe,Ne,He,Ve,We,Ge,je,ze,Xe,Ye,Ke,Qe,Ze,Je,et,tt,rt,nt,ot,it,at,st,ut,ct,lt,dt,ft,ht,pt,mt,gt,yt,vt,bt,wt,Et,St,kt,_t,Ct,xt,At,Tt,Ft,Pt,Bt,Dt,Lt,Rt,Mt,It,Ot,$t,Ut,qt,Nt,Ht,Vt,Wt,Gt,jt,zt,Xt,Yt,Kt,Qt,Zt,Jt,er,tr,rr,nr,or,ir,ar,sr,ur,cr,lr,dr,fr,hr,pr,mr,gr,yr,vr,br,wr,Er,Sr,kr,_r,Cr,xr,Ar,Tr,Fr,Pr,Br,Dr,Lr,Rr,Mr,Ir,Or,$r,Ur,qr,Nr,Hr,Vr,Wr,Gr,jr,zr,Xr,Yr,Kr,Qr,Zr,Jr,en,tn,rn,nn,on,an,sn,un,cn,ln,dn,fn,hn,pn,mn,gn,yn,vn,bn,wn,En,Sn,kn,_n,Cn,xn,An,Tn,Fn,Pn,Bn,Dn,Ln,Rn,Mn,In,On,$n,Un,qn,Nn,Hn,Vn,Wn,Gn,jn,zn,Xn,Yn,Kn,Qn,Zn,Jn,eo,to,ro,no,oo,io,ao,so,uo,co,lo,fo,ho,po,mo,go,yo,vo,bo,wo,Eo,So,ko,_o,Co,xo,Ao,To,Fo,Po,Bo,Do,Lo,Ro,Mo,Io,Oo,$o,Uo,qo,No,Ho,Vo,Wo,Go,jo,zo,Xo,Yo,Ko,Qo,Zo,Jo,ei,ti,ri,ni,oi,ii,ai,si,ui,ci,li,di,fi,hi,pi,mi,gi,yi,vi,bi,wi,Ei,Si,ki,_i,Ci,xi,Ai,Ti,Fi,Pi,Bi,Di,Li,Ri,Mi,Ii,Oi,$i,Ui,qi,Ni,Hi,Vi,Wi,Gi,ji,zi,Xi,Yi,Ki,Qi,Zi,Ji,ea,ta,ra,na,oa,ia,aa,sa,ua,ca,la,da,fa,ha,pa="undefined"!=typeof Blob?Blob:(()=>{try{return A().Blob}catch(e){return function(){throw new Error("Could not find Blob constructor and failed to require('buffer').Blob")}}})(),ma=(e,t=!0)=>{const r=[];for(let t=0;t<e.size();t+=1)r.push(e.get(t));return t&&e.delete(),r};da=[oe],la=[oe],ca=[oe],ua=[oe],sa=[ne],aa=[ne],ia=[oe],oa=[oe],na=[oe],ra=[ne],ta=[ne],ea=[ne],Ji=[oe],Zi=[oe],Qi=[oe],Ki=[oe],Yi=[ne],Xi=[oe],zi=[oe],ji=[ne],Gi=[ne],Wi=[ne],Vi=[ne],Hi=[ne],Ni=[ne],qi=[ne],Ui=[oe],$i=[ne],Oi=[ne],Ii=[ne],Mi=[oe],Ri=[ne],Li=[oe],Di=[ne],Bi=[oe],Pi=[ne],Fi=[oe],Ti=[ne],Ai=[ne],xi=[ne],Ci=[ne],_i=[oe],ki=[oe],Si=[oe],Ei=[oe],wi=[oe],bi=[oe],vi=[ne],yi=[ne],gi=[oe],mi=[oe],pi=[oe],hi=[oe],fi=[ne],di=[oe],li=[ne],ci=[ne],ui=[oe],si=[oe],ai=[ne],ii=[ne],oi=[ne],ni=[ne],ri=[ne],ti=[ne],ei=[oe],Jo=[oe],Zo=[oe],Qo=[oe],Ko=[ne],Yo=[ne],Xo=[ne],zo=[ne],jo=[oe],Go=[ne],Wo=[oe],Vo=[oe],Ho=[ne],No=[ne],qo=[ne],Uo=[oe],$o=[oe],Oo=[ne],Io=[ne],Mo=[ne],Ro=[ne],Lo=[ne],Do=[ne],Bo=[oe],Po=[oe],Fo=[ne],To=[oe],Ao=[oe],xo=[oe],Co=[oe],_o=[oe],ko=[oe],So=[ne],Eo=[ne],wo=[ne],bo=[ne],vo=[ne],yo=[oe],go=[ne],mo=[oe],po=[ne],ho=[oe],fo=[ne],lo=[oe],co=[ne],uo=[oe],so=[ne],ao=[oe],io=[ne],oo=[oe],no=[ne],ro=[oe],to=[ne],eo=[ne],Jn=[oe],Zn=[ne],Qn=[ne],Kn=[oe],Yn=[oe],Xn=[oe],zn=[oe],jn=[ne],Gn=[ne],Wn=[ne],Vn=[oe],Hn=[oe],Nn=[oe],qn=[oe],Un=[oe],$n=[oe],On=[oe],In=[ne],Mn=[ne],Rn=[ne],Ln=[ne],Dn=[ne],Bn=[ne],Pn=[oe],Fn=[oe],Tn=[oe],An=[ne],xn=[ne],Cn=[oe],_n=[ne],kn=[ne],Sn=[ne],En=[oe],wn=[ne],bn=[ne],vn=[ne],yn=[oe],gn=[oe],mn=[ne],pn=[oe],hn=[ne],fn=[oe],dn=[ne],ln=[ne],cn=[ne],un=[oe],sn=[oe],an=[oe],on=[ne],nn=[oe],rn=[ne],tn=[oe],en=[ne],Jr=[ne],Zr=[oe],Qr=[ne],Kr=[oe],Yr=[ne],Xr=[ne],zr=[ne],jr=[oe],Gr=[ne],Wr=[oe],Vr=[ne],Hr=[ne],Nr=[ne],qr=[oe],Ur=[ne],$r=[oe],Or=[oe],Ir=[ne],Mr=[ne],Rr=[oe],Lr=[ne],Dr=[oe],Br=[ne],Pr=[oe],Fr=[ne],Tr=[oe],Ar=[ne],xr=[ne],Cr=[ne],_r=[oe],kr=[ne],Sr=[oe],Er=[oe],wr=[ne],br=[ne],vr=[oe],yr=[ne],gr=[oe],mr=[ne],pr=[oe],hr=[ne],fr=[oe],dr=[ne],lr=[oe],cr=[ne],ur=[oe],sr=[oe],ar=[oe],ir=[oe],or=[oe],nr=[oe],rr=[ne],tr=[oe],er=[ne],Jt=[oe],Zt=[ne],Qt=[oe],Kt=[ne],Yt=[ne],Xt=[oe],zt=[ne],jt=[ne],Gt=[oe],Wt=[oe],Vt=[oe],Ht=[oe],Nt=[ne],qt=[ne],Ut=[ne],$t=[ne],Ot=[ne],It=[ne],Mt=[ne],Rt=[ne],Lt=[oe],Dt=[ne],Bt=[oe],Pt=[oe],Ft=[ne],Tt=[oe],At=[ne],xt=[ne],Ct=[ne],_t=[oe],kt=[ne],St=[ne],Et=[ne],wt=[oe],bt=[ne],vt=[oe],yt=[ne],gt=[oe],mt=[ne],pt=[ne],ht=[ne],ft=[oe],dt=[oe],lt=[ne],ct=[ne],ut=[ne],st=[ne],at=[oe],it=[ne],ot=[oe],nt=[ne],rt=[ne],tt=[oe],et=[ne],Je=[ne],Ze=[oe],Qe=[ne],Ke=[ne],Ye=[ne],Xe=[oe],ze=[ne],je=[oe],Ge=[ne],We=[ne],Ve=[oe],He=[ne],Ne=[ne],qe=[ne],Ue=[oe],$e=[ne],Oe=[ne],Ie=[oe],Me=[ne],Re=[ne],Le=[ne],De=[oe],Be=[ne],Pe=[oe],Fe=[ne],Te=[oe],Ae=[ne],xe=[oe],Ce=[ne],_e=[ne],ke=[ne],Se=[ne],Ee=[ne],we=[ne],be=[ne],ve=[oe],ye=[ne],ge=[oe],me=[oe],pe=[oe],he=[ne],fe=[ne],de=[ne],le=[oe],ce=[ne],ue=[oe],se=[oe];var BlockAPI=class{constructor(e){g(ha,5,this),S(this,fa),v(this,"onSelectionChanged",(e=>{const t=E(this,fa).subscribeToSelectionChange(e);return()=>{E(this,fa).isDeleted()||ie(E(this,fa).unsubscribe(t))}})),v(this,"onClicked",(e=>{const t=E(this,fa).subscribeToBlockClicked(e);return()=>{E(this,fa).isDeleted()||ie(E(this,fa).unsubscribe(t))}})),v(this,"onStateChanged",((e,t)=>{Z("ids",e,H(W()));const r=E(this,fa).subscribeToBlockState(e,(e=>{try{t(ma(e,!0))}catch(e){console.error(e)}}));return()=>{E(this,fa).isDeleted()||ie(E(this,fa).unsubscribe(r))}})),k(this,fa,e)}async export(e,t=D.Png,r={}){Z("handle",e,G()),Z("mimeType",t,J()),Z("options",r,j());const n=null!=r.targetWidth&&null!=r.targetHeight,o=r.jpegQuality??.9,i=r.webpQuality??1,a=r.pngCompressionLevel??5;return Z("jpegQuality",o,Y(X(G(),1),0,{exclusive:!0})),Z("webpQuality",i,Y(X(G(),1),0,{exclusive:!0})),Z("pngCompressionLevel",a,Y(X(W(),9),0)),null==r.targetWidth&&null==r.targetHeight||(Z("targetWidth",r.targetWidth,G()),Z("targetHeight",r.targetHeight,G())),new Promise(((s,u)=>{E(this,fa).exportToBuffer(e,t,(e=>{"error"in e?u(e.error):s(new pa([e],{type:t}))}),{pngCompressionLevel:a,jpegQuality:o,webpQuality:i,useTargetSize:n,targetWidth:r.targetWidth??0,targetHeight:r.targetHeight??0,exportPdfWithHighCompatibility:r.exportPdfWithHighCompatibility??!0,exportPdfWithUnderlayer:r.exportPdfWithUnderlayer??!1,underlayerSpotColorName:r.underlayerSpotColorName??"",underlayerOffset:r.underlayerOffset??0})}))}async exportWithColorMask(e,t=D.Png,r,n,o,i={}){Z("handle",e,G()),Z("mimeType",t,J()),Z("options",i,j());const a=null!=i.targetWidth&&null!=i.targetHeight,s=i.jpegQuality??.9,u=i.webpQuality??1,c=i.pngCompressionLevel??5;return Z("jpegQuality",s,Y(X(G(),1),0,{exclusive:!0})),Z("webpQuality",u,Y(X(G(),1),0,{exclusive:!0})),Z("pngCompressionLevel",c,Y(X(W(),9),0)),null==i.targetWidth&&null==i.targetHeight||(Z("targetWidth",i.targetWidth,G()),Z("targetHeight",i.targetHeight,G())),new Promise(((l,d)=>{E(this,fa).exportWithColorMaskToBuffer(e,t,r,n,o,((e,r)=>{if("error"in e)d(e.error);else if("error"in r)d(r.error);else{const n=new pa([e],{type:t}),o=new pa([r],{type:t});l([n,o])}}),{pngCompressionLevel:c,jpegQuality:s,webpQuality:u,useTargetSize:a,targetWidth:i.targetWidth??0,targetHeight:i.targetHeight??0,exportPdfWithHighCompatibility:i.exportPdfWithHighCompatibility??!0,exportPdfWithUnderlayer:i.exportPdfWithUnderlayer??!1,underlayerSpotColorName:i.underlayerSpotColorName??"",underlayerOffset:i.underlayerOffset??0})}))}async exportVideo(e,t=D.Mp4,r,n){throw new Error("Method not implemented. An implementation is available on the BlockAPI at engine.block or cesdk.engine.block")}async unstable_exportAudio(e,t=D.Wav,r,n){return Z("handle",e,G()),Z("mimeType",t,J()),Z("options",n,j()),new Promise(((o,i)=>{E(this,fa).unstable_exportAudioToBuffer(e,n.timeOffset??0,n.duration??0,t,r,(e=>{"error"in e?i(e.error):o(new pa([e],{type:t}))}),{sampleRate:n.sampleRate??48e3,numberOfChannels:n.numberOfChannels??2})}))}async loadFromString(e){return Z("content",e,z()),ae((t=>E(this,fa).loadBlocksFromString(e,t))).then((e=>ma(e)))}loadFromArchiveURL(e){return Z("url",e,z()),ae((t=>E(this,fa).loadBlocksFromArchiveURL(e,t))).then((e=>ma(e)))}async saveToString(e,t=["buffer","http","https"]){return Z("blocks",e,H(G())),ae((r=>E(this,fa).saveBlocksToString(e,r,t)))}async saveToArchive(e){return Z("blocks",e,H(G())),new Promise(((t,r)=>{E(this,fa).saveBlocksToArchive(e,(e=>{"error"in e?r(e.error):t(new pa([e],{type:D.Zip}))}))}))}create(e){return Z("type",e,z()),ie(E(this,fa).create(e))}createFill(e){return Z("type",e,z()),ie(E(this,fa).createFill(e))}getType(e){return Z("id",e,W()),ie(E(this,fa).getType(e))}getKind(e){return Z("id",e,W()),ie(E(this,fa).getKind(e))}setKind(e,t){Z("id",e,W()),ie(E(this,fa).setKind(e,t))}select(e){return Z("id",e,W()),ie(E(this,fa).select(e))}setSelected(e,t){return Z("id",e,W()),Z("selected",t,V()),ie(E(this,fa).setSelected(e,t))}isSelected(e){return Z("id",e,W()),ie(E(this,fa).isSelected(e))}findAllSelected(){return ma(E(this,fa).findAllSelected())}isGroupable(e){return Z("ids",e,H(G())),ie(E(this,fa).isGroupable(e))}group(e){return Z("ids",e,K(H(G()))),ie(E(this,fa).group(e))}ungroup(e){return Z("id",e,G()),ie(E(this,fa).ungroup(e))}enterGroup(e){return Z("id",e,G()),ie(E(this,fa).enterGroup(e))}exitGroup(e){return Z("id",e,G()),ie(E(this,fa).exitGroup(e))}isCombinable(e){return Z("ids",e,H(G())),ie(E(this,fa).isCombinable(e))}combine(e,t){return Z("ids",e,H(G())),Z("op",t,z()),ie(E(this,fa).combine(e,t))}setName(e,t){return Z("id",e,W()),Z("name",t,z()),ie(E(this,fa).setName(e,t))}getName(e){return Z("id",e,W()),ie(E(this,fa).getName(e))}getUUID(e){return Z("id",e,W()),ie(E(this,fa).getUUID(e))}findByName(e){Z("name",e,z());const t=E(this,fa).findByName(e);return ma(t)}findByType(e){Z("type",e,z());const t=ie(E(this,fa).findByType(e));return ma(t)}findByKind(e){Z("kind",e,z());const t=ie(E(this,fa).findByKind(e));return ma(t)}findAll(){return ma(E(this,fa).findAll())}findAllPlaceholders(){return ma(E(this,fa).findAllPlaceholders())}createShape(e){return Z("type",e,z()),ie(E(this,fa).createShape(e))}hasShape(e){return Z("id",e,W()),ie(E(this,fa).hasShape(e))}supportsShape(e){return Z("id",e,W()),ie(E(this,fa).supportsShape(e))}getShape(e){return Z("id",e,W()),ie(E(this,fa).getShape(e))}setShape(e,t){return Z("id",e,W()),Z("shape",t,W()),ie(E(this,fa).setShape(e,t))}isVisible(e){return Z("id",e,W()),ie(E(this,fa).isVisible(e))}setVisible(e,t){return Z("id",e,W()),Z("visible",t,V()),ie(E(this,fa).setVisible(e,t))}isClipped(e){return Z("id",e,W()),ie(E(this,fa).isClipped(e))}setClipped(e,t){return Z("id",e,W()),Z("clipped",t,V()),ie(E(this,fa).setClipped(e,t))}isTransformLocked(e){return Z("id",e,W()),ie(E(this,fa).isTransformLocked(e))}setTransformLocked(e,t){return Z("id",e,W()),Z("locked",t,V()),ie(E(this,fa).setTransformLocked(e,t))}getPositionX(e){return Z("id",e,W()),ie(E(this,fa).getPositionX(e))}getPositionXMode(e){return Z("id",e,W()),ie(E(this,fa).getPositionXMode(e))}getPositionY(e){return Z("id",e,W()),ie(E(this,fa).getPositionY(e))}getPositionYMode(e){return Z("id",e,W()),ie(E(this,fa).getPositionYMode(e))}setPositionX(e,t){return Z("id",e,W()),Z("value",t,G()),ie(E(this,fa).setPositionX(e,t))}setPositionXMode(e,t){return Z("id",e,W()),ie(E(this,fa).setPositionXMode(e,t))}setPositionY(e,t){return Z("id",e,W()),Z("value",t,G()),ie(E(this,fa).setPositionY(e,t))}setPositionYMode(e,t){return Z("id",e,W()),ie(E(this,fa).setPositionYMode(e,t))}setAlwaysOnTop(e,t){return Z("id",e,W()),Z("enabled",t,V()),ie(E(this,fa).setAlwaysOnTop(e,t))}setAlwaysOnBottom(e,t){return Z("id",e,W()),Z("enabled",t,V()),ie(E(this,fa).setAlwaysOnBottom(e,t))}isAlwaysOnTop(e){return Z("id",e,W()),ie(E(this,fa).isAlwaysOnTop(e))}isAlwaysOnBottom(e){return Z("id",e,W()),ie(E(this,fa).isAlwaysOnBottom(e))}bringToFront(e){return Z("id",e,G()),ie(E(this,fa).bringToFront(e))}sendToBack(e){return Z("id",e,G()),ie(E(this,fa).sendToBack(e))}bringForward(e){return Z("id",e,G()),ie(E(this,fa).bringForward(e))}sendBackward(e){return Z("id",e,G()),ie(E(this,fa).sendBackward(e))}getRotation(e){return Z("id",e,W()),ie(E(this,fa).getRotation(e))}setRotation(e,t){return Z("id",e,W()),Z("radians",t,G()),ie(E(this,fa).setRotation(e,t))}getFlipHorizontal(e){return Z("id",e,W()),ie(E(this,fa).getFlip(e)).horizontal}getFlipVertical(e){return Z("id",e,W()),ie(E(this,fa).getFlip(e)).vertical}setFlipHorizontal(e,t){return Z("id",e,W()),Z("flip",t,V()),ie(E(this,fa).setFlipHorizontal(e,t))}setFlipVertical(e,t){return Z("id",e,W()),Z("flip",t,V()),ie(E(this,fa).setFlipVertical(e,t))}hasContentFillMode(e){return Z("id",e,W()),ie(E(this,fa).hasContentFillMode(e))}supportsContentFillMode(e){return Z("id",e,W()),ie(E(this,fa).supportsContentFillMode(e))}getWidth(e){return Z("id",e,W()),ie(E(this,fa).getWidth(e))}getWidthMode(e){return Z("id",e,W()),ie(E(this,fa).getWidthMode(e))}getHeight(e){return Z("id",e,W()),ie(E(this,fa).getHeight(e))}getHeightMode(e){return Z("id",e,W()),ie(E(this,fa).getHeightMode(e))}setWidth(e,t,r){return Z("id",e,W()),Z("value",t,G()),Z("maintainCrop",r??!1,V()),ie(E(this,fa).setWidth(e,t,r??!1))}setWidthMode(e,t){return Z("id",e,W()),ie(E(this,fa).setWidthMode(e,t))}setHeight(e,t,r){return Z("id",e,W()),Z("value",t,G()),Z("maintainCrop",r??!1,V()),ie(E(this,fa).setHeight(e,t,r??!1))}setHeightMode(e,t){return Z("id",e,W()),ie(E(this,fa).setHeightMode(e,t))}getFrameX(e){return Z("id",e,W()),ie(E(this,fa).getLastFrameX(e))}getFrameY(e){return Z("id",e,W()),ie(E(this,fa).getLastFrameY(e))}getFrameWidth(e){return Z("id",e,W()),ie(E(this,fa).getLastFrameWidth(e))}getFrameHeight(e){return Z("id",e,W()),ie(E(this,fa).getLastFrameHeight(e))}setContentFillMode(e,t){return Z("id",e,W()),ie(E(this,fa).setContentFillMode(e,t))}getContentFillMode(e){return Z("id",e,W()),ie(E(this,fa).getContentFillMode(e))}duplicate(e){return Z("id",e,W()),ie(E(this,fa).duplicate(e))}destroy(e){return Z("id",e,W()),ie(E(this,fa).destroy(e))}isValid(e){return Z("id",e,W()),E(this,fa).isValid(e)}getParent(e){return Z("id",e,W()),ie(E(this,fa).hasParent(e))?ie(E(this,fa).getParent(e)):null}getChildren(e){Z("id",e,W());const t=ie(E(this,fa).getChildren(e));return ma(t)}insertChild(e,t,r){return Z("parent",e,G()),Z("child",t,G()),Z("index",r,Y(G(),0)),ie(E(this,fa).insertChild(e,t,r))}appendChild(e,t){return Z("parent",e,G()),Z("child",t,G()),ie(E(this,fa).appendChild(e,t))}referencesAnyVariables(e){return Z("id",e,W()),ie(E(this,fa).referencesAnyVariables(e))}getGlobalBoundingBoxX(e){return Z("id",e,W()),ie(E(this,fa).getGlobalBoundingBoxX(e))}getGlobalBoundingBoxY(e){return Z("id",e,W()),ie(E(this,fa).getGlobalBoundingBoxY(e))}getGlobalBoundingBoxWidth(e){return Z("id",e,W()),ie(E(this,fa).getGlobalBoundingBoxWidth(e))}getGlobalBoundingBoxHeight(e){return Z("id",e,W()),ie(E(this,fa).getGlobalBoundingBoxHeight(e))}getScreenSpaceBoundingBoxXYWH(e){return Z("ids",e,H(G())),ie(E(this,fa).getScreenSpaceBoundingBoxXYWH(e))}alignHorizontally(e,t){return Z("ids",e,K(H(G()))),ie(E(this,fa).alignHorizontally(e,t))}alignVertically(e,t){return Z("ids",e,K(H(G()))),ie(E(this,fa).alignVertically(e,t))}isAlignable(e){return Z("ids",e,H(G())),ie(E(this,fa).isAlignable(e))}distributeHorizontally(e){return Z("ids",e,K(H(G()))),ie(E(this,fa).distributeHorizontally(e))}distributeVertically(e){return Z("ids",e,K(H(G()))),ie(E(this,fa).distributeVertically(e))}isDistributable(e){return Z("ids",e,H(G())),ie(E(this,fa).isDistributable(e))}fillParent(e){return Z("id",e,W()),ie(E(this,fa).fillParent(e))}resizeContentAware(e,t,r){return Z("ids",e,H(G())),Z("width",t,G()),Z("height",r,G()),ie(E(this,fa).resizeContentAware(e,t,r))}scale(e,t,r=0,n=0){return Z("id",e,W()),ie(E(this,fa).scale(e,t,r,n))}findAllProperties(e){return Z("id",e,W()),ma(ie(E(this,fa).findAllProperties(e)))}isPropertyReadable(e){return Z("property",e,z()),E(this,fa).isPropertyReadable(e)}isPropertyWritable(e){return Z("property",e,z()),E(this,fa).isPropertyWritable(e)}getPropertyType(e){Z("property",e,z());return ie(E(this,fa).getPropertyType(e))}getEnumValues(e){return Z("enumProperty",e,z()),ma(ie(E(this,fa).getEnumValues(e)))}setBool(e,t,r){return Z("id",e,W()),Z("property",t,z()),Z("value",r,V()),ie(E(this,fa).setBool(e,t,r))}getBool(e,t){return Z("id",e,W()),Z("property",t,z()),ie(E(this,fa).getBool(e,t))}setInt(e,t,r){return Z("id",e,W()),Z("property",t,z()),Z("value",r,W()),ie(E(this,fa).setInt(e,t,r))}getInt(e,t){return Z("id",e,W()),Z("property",t,z()),ie(E(this,fa).getInt(e,t))}setFloat(e,t,r){return Z("id",e,W()),Z("property",t,z()),Z("value",r,G()),ie(E(this,fa).setFloat(e,t,r))}getFloat(e,t){return Z("id",e,W()),Z("property",t,z()),ie(E(this,fa).getFloat(e,t))}setDouble(e,t,r){return Z("id",e,W()),Z("property",t,z()),Z("value",r,G()),ie(E(this,fa).setDouble(e,t,r))}getDouble(e,t){return Z("id",e,W()),Z("property",t,z()),ie(E(this,fa).getDouble(e,t))}setString(e,t,r){return Z("id",e,W()),Z("property",t,z()),Z("value",r,z()),ie(E(this,fa).setString(e,t,r))}getString(e,t){return Z("id",e,W()),Z("property",t,z()),ie(E(this,fa).getString(e,t))}setColor(e,t,r){return Z("id",e,W()),Z("property",t,z()),ie(E(this,fa).setColor(e,t,te.fromColor(r)))}getColor(e,t){return Z("id",e,W()),Z("property",t,z()),te.toColor(ie(E(this,fa).getColor(e,t)))}setColorRGBA(e,t,r,n,o,i=1){return Z("id",e,W()),Z("property",t,z()),Z("r",r,G()),Z("g",n,G()),Z("b",o,G()),Z("a",i,G()),ie(E(this,fa).setColorRGBA(e,t,r,n,o,i))}getColorRGBA(e,t){return Z("id",e,W()),Z("property",t,z()),ie(E(this,fa).getColorRGBA(e,t))}setColorSpot(e,t,r,n=1){return Z("id",e,W()),Z("property",t,z()),Z("name",r,z()),Z("tint",n,G()),ie(E(this,fa).setColorSpot(e,t,r,n))}getColorSpotName(e,t){return Z("id",e,W()),Z("property",t,z()),ie(E(this,fa).getColorSpotName(e,t))}getColorSpotTint(e,t){return Z("id",e,W()),Z("property",t,z()),ie(E(this,fa).getColorSpotTint(e,t))}setGradientColorStops(e,t,r){Z("id",e,W()),Z("property",t,z());const n=r.map((e=>({color:te.fromColor(e.color),stop:e.stop})));return ie(E(this,fa).setGradientColorStops(e,t,n))}getGradientColorStops(e,t){Z("id",e,W()),Z("property",t,z());const r=ie(E(this,fa).getGradientColorStops(e,t));return ma(r).map((e=>({color:te.toColor(e.color),stop:e.stop})))}getSourceSet(e,t){return Z("id",e,W()),Z("property",t,z()),ma(ie(E(this,fa).getSourceSet(e,t)))}setSourceSet(e,t,r){Z("id",e,W()),Z("property",t,z()),Z("sourceSet",r,H(j({uri:z(),width:G(),height:G()}))),ie(E(this,fa).setSourceSet(e,t,r))}addImageFileURIToSourceSet(e,t,r){return Z("id",e,W()),Z("property",t,z()),Z("uri",r,z()),ae((n=>E(this,fa).addImageFileURIToSourceSet(e,t,r,n)))}addVideoFileURIToSourceSet(e,t,r){return Z("id",e,W()),Z("property",t,z()),Z("uri",r,z()),ae((n=>E(this,fa).addVideoFileURIToSourceSet(e,t,r,n)))}setEnum(e,t,r){return Z("id",e,W()),Z("property",t,z()),Z("value",r,z()),ie(E(this,fa).setEnum(e,t,r))}getEnum(e,t){return Z("id",e,W()),Z("property",t,z()),ie(E(this,fa).getEnum(e,t))}hasCrop(e){return Z("id",e,W()),ie(E(this,fa).hasCrop(e))}supportsCrop(e){return Z("id",e,W()),ie(E(this,fa).supportsCrop(e))}setCropScaleX(e,t){return Z("id",e,W()),Z("scaleX",t,G()),ie(E(this,fa).setCropScaleX(e,t))}setCropScaleY(e,t){return Z("id",e,W()),Z("scaleY",t,G()),ie(E(this,fa).setCropScaleY(e,t))}setCropRotation(e,t){return Z("id",e,W()),Z("rotation",t,G()),ie(E(this,fa).setCropRotation(e,t))}setCropScaleRatio(e,t){return Z("id",e,W()),Z("scaleRatio",t,G()),ie(E(this,fa).setCropScaleRatio(e,t))}setCropTranslationX(e,t){return Z("id",e,W()),Z("translationX",t,G()),ie(E(this,fa).setCropTranslationX(e,t))}setCropTranslationY(e,t){return Z("id",e,W()),Z("translationY",t,G()),ie(E(this,fa).setCropTranslationY(e,t))}resetCrop(e){return Z("id",e,W()),ie(E(this,fa).resetCrop(e))}getCropScaleX(e){return Z("id",e,W()),ie(E(this,fa).getCropScaleX(e))}getCropScaleY(e){return Z("id",e,W()),ie(E(this,fa).getCropScaleY(e))}getCropRotation(e){return Z("id",e,W()),ie(E(this,fa).getCropRotation(e))}getCropScaleRatio(e){return Z("id",e,W()),ie(E(this,fa).getCropScaleRatio(e))}getCropTranslationX(e){return Z("id",e,W()),ie(E(this,fa).getCropTranslationX(e))}getCropTranslationY(e){return Z("id",e,W()),ie(E(this,fa).getCropTranslationY(e))}adjustCropToFillFrame(e,t){return Z("id",e,W()),Z("minScaleRatio",t,G()),ie(E(this,fa).adjustCropToFillFrame(e,t))}flipCropHorizontal(e){return Z("id",e,W()),ie(E(this,fa).flipCropHorizontal(e))}flipCropVertical(e){return Z("id",e,W()),ie(E(this,fa).flipCropVertical(e))}hasOpacity(e){return Z("id",e,W()),ie(E(this,fa).hasOpacity(e))}supportsOpacity(e){return Z("id",e,W()),ie(E(this,fa).supportsOpacity(e))}setOpacity(e,t){return Z("id",e,W()),Z("opacity",t,G()),ie(E(this,fa).setOpacity(e,t))}getOpacity(e){return Z("id",e,W()),ie(E(this,fa).getOpacity(e))}hasBlendMode(e){return Z("id",e,W()),ie(E(this,fa).hasBlendMode(e))}supportsBlendMode(e){return Z("id",e,W()),ie(E(this,fa).supportsBlendMode(e))}setBlendMode(e,t){return Z("id",e,W()),Z("blendMode",t,z()),ie(E(this,fa).setBlendMode(e,t))}getBlendMode(e){return Z("id",e,W()),ie(E(this,fa).getBlendMode(e))}hasFillColor(e){return Z("id",e,W()),ie(E(this,fa).hasFillColor(e))}isIncludedInExport(e){return Z("id",e,W()),ie(E(this,fa).isIncludedInExport(e))}setIncludedInExport(e,t){return Z("id",e,W()),Z("enabled",t,V()),ie(E(this,fa).setIncludedInExport(e,t))}setFillColorRGBA(e,t,r,n,o=1){return Z("id",e,W()),Z("r",t,G()),Z("g",r,G()),Z("b",n,G()),Z("a",o,G()),ie(E(this,fa).setFillColorRGBA(e,t,r,n,o))}getFillColorRGBA(e){return Z("id",e,W()),ie(E(this,fa).getFillColorRGBA(e))}setFillColorEnabled(e,t){return Z("id",e,W()),Z("enabled",t,V()),ie(E(this,fa).setFillColorEnabled(e,t))}isFillColorEnabled(e){return Z("id",e,W()),ie(E(this,fa).isFillColorEnabled(e))}createEffect(e){return Z("type",e,z()),ie(E(this,fa).createEffect(e))}hasEffects(e){return Z("id",e,W()),ie(E(this,fa).hasEffects(e))}supportsEffects(e){return Z("id",e,W()),ie(E(this,fa).supportsEffects(e))}getEffects(e){Z("id",e,W());const t=ie(E(this,fa).getEffects(e));return ma(t)}insertEffect(e,t,r){Z("id",e,W()),Z("effectId",t,W()),Z("index",r,Y(W(),0)),ie(E(this,fa).insertEffect(e,t,r))}appendEffect(e,t){Z("id",e,W()),Z("effectId",t,W()),ie(E(this,fa).appendEffect(e,t))}removeEffect(e,t){Z("id",e,W()),Z("index",t,Y(W(),0)),ie(E(this,fa).removeEffect(e,t))}hasEffectEnabled(e){return Z("effectId",e,W()),ie(E(this,fa).hasEffectEnabled(e))}setEffectEnabled(e,t){Z("effectId",e,W()),Z("enabled",t,V()),ie(E(this,fa).setEffectEnabled(e,t))}isEffectEnabled(e){return Z("effectId",e,W()),ie(E(this,fa).isEffectEnabled(e))}createBlur(e){return Z("type",e,z()),ie(E(this,fa).createBlur(e))}hasBlur(e){return Z("id",e,W()),ie(E(this,fa).hasBlur(e))}supportsBlur(e){return Z("id",e,W()),ie(E(this,fa).supportsBlur(e))}setBlur(e,t){Z("id",e,W()),Z("blurId",t,W()),ie(E(this,fa).setBlur(e,t))}getBlur(e){return Z("id",e,W()),ie(E(this,fa).getBlur(e))}setBlurEnabled(e,t){Z("id",e,W()),Z("enabled",t,V()),ie(E(this,fa).setBlurEnabled(e,t))}isBlurEnabled(e){return Z("id",e,W()),ie(E(this,fa).isBlurEnabled(e))}hasBackgroundColor(e){return Z("id",e,W()),ie(E(this,fa).hasBackgroundColor(e))}supportsBackgroundColor(e){return Z("id",e,W()),ie(E(this,fa).supportsBackgroundColor(e))}setBackgroundColorRGBA(e,t,r,n,o=1){return Z("id",e,W()),Z("r",t,G()),Z("g",r,G()),Z("b",n,G()),Z("a",o,G()),ie(E(this,fa).setBackgroundColorRGBA(e,t,r,n,o))}getBackgroundColorRGBA(e){return Z("id",e,W()),ie(E(this,fa).getBackgroundColorRGBA(e))}setBackgroundColorEnabled(e,t){return Z("id",e,W()),Z("enabled",t,V()),ie(E(this,fa).setBackgroundColorEnabled(e,t))}isBackgroundColorEnabled(e){return Z("id",e,W()),ie(E(this,fa).isBackgroundColorEnabled(e))}hasStroke(e){return Z("id",e,W()),ie(E(this,fa).hasStroke(e))}supportsStroke(e){return Z("id",e,W()),ie(E(this,fa).supportsStroke(e))}setStrokeEnabled(e,t){return Z("id",e,W()),Z("enabled",t,V()),ie(E(this,fa).setStrokeEnabled(e,t))}isStrokeEnabled(e){return Z("id",e,W()),ie(E(this,fa).isStrokeEnabled(e))}setStrokeColorRGBA(e,t,r,n,o=1){return Z("id",e,W()),Z("r",t,G()),Z("g",r,G()),Z("b",n,G()),Z("a",o,G()),ie(E(this,fa).setStrokeColorRGBA(e,t,r,n,o))}setStrokeColor(e,t){return Z("id",e,W()),ie(E(this,fa).setStrokeColor(e,te.fromColor(t)))}getStrokeColorRGBA(e){return Z("id",e,W()),ie(E(this,fa).getStrokeColorRGBA(e))}getStrokeColor(e){return Z("id",e,W()),te.toColor(ie(E(this,fa).getStrokeColor(e)))}setStrokeWidth(e,t){return Z("id",e,W()),Z("width",t,G()),ie(E(this,fa).setStrokeWidth(e,t))}getStrokeWidth(e){return Z("id",e,W()),ie(E(this,fa).getStrokeWidth(e))}setStrokeStyle(e,t){return Z("id",e,W()),ie(E(this,fa).setStrokeStyle(e,t))}getStrokeStyle(e){Z("id",e,W());return ie(E(this,fa).getStrokeStyle(e))}setStrokePosition(e,t){return Z("id",e,W()),ie(E(this,fa).setStrokePosition(e,t))}getStrokePosition(e){Z("id",e,W());return ie(E(this,fa).getStrokePosition(e))}setStrokeCornerGeometry(e,t){return Z("id",e,W()),ie(E(this,fa).setStrokeCornerGeometry(e,t))}getStrokeCornerGeometry(e){Z("id",e,W());return ie(E(this,fa).getStrokeCornerGeometry(e))}hasDropShadow(e){return Z("id",e,W()),ie(E(this,fa).hasDropShadow(e))}supportsDropShadow(e){return Z("id",e,W()),ie(E(this,fa).supportsDropShadow(e))}setDropShadowEnabled(e,t){return Z("id",e,W()),Z("enabled",t,V()),ie(E(this,fa).setDropShadowEnabled(e,t))}isDropShadowEnabled(e){return Z("id",e,W()),ie(E(this,fa).isDropShadowEnabled(e))}setDropShadowColorRGBA(e,t,r,n,o=1){return Z("id",e,W()),Z("r",t,G()),Z("g",r,G()),Z("b",n,G()),Z("a",o,G()),ie(E(this,fa).setDropShadowColorRGBA(e,t,r,n,o))}setDropShadowColor(e,t){return Z("id",e,W()),ie(E(this,fa).setDropShadowColor(e,te.fromColor(t)))}getDropShadowColorRGBA(e){return Z("id",e,W()),ie(E(this,fa).getDropShadowColorRGBA(e))}getDropShadowColor(e){return Z("id",e,W()),te.toColor(ie(E(this,fa).getDropShadowColor(e)))}setDropShadowOffsetX(e,t){return Z("id",e,W()),Z("offsetX",t,G()),ie(E(this,fa).setDropShadowOffsetX(e,t))}getDropShadowOffsetX(e){return Z("id",e,W()),ie(E(this,fa).getDropShadowOffsetX(e))}setDropShadowOffsetY(e,t){return Z("id",e,W()),Z("offsetY",t,G()),ie(E(this,fa).setDropShadowOffsetY(e,t))}getDropShadowOffsetY(e){return Z("id",e,W()),ie(E(this,fa).getDropShadowOffsetY(e))}setDropShadowBlurRadiusX(e,t){return Z("id",e,W()),Z("blurRadiusX",t,G()),ie(E(this,fa).setDropShadowBlurRadiusX(e,t))}getDropShadowBlurRadiusX(e){return Z("id",e,W()),ie(E(this,fa).getDropShadowBlurRadiusX(e))}setDropShadowBlurRadiusY(e,t){return Z("id",e,W()),Z("blurRadiusY",t,G()),ie(E(this,fa).setDropShadowBlurRadiusY(e,t))}getDropShadowBlurRadiusY(e){return Z("id",e,W()),ie(E(this,fa).getDropShadowBlurRadiusY(e))}setDropShadowClip(e,t){return Z("id",e,W()),ie(E(this,fa).setDropShadowClip(e,t))}getDropShadowClip(e){return Z("id",e,W()),ie(E(this,fa).getDropShadowClip(e))}createCutoutFromBlocks(e,t=2,r=4,n=!0){return Z("ids",e,H(W())),Z("vectorizeDistanceThreshold",t,G()),Z("maxSmoothingDistance",r,G()),Z("useExistingShapeInformation",n,V()),ie(E(this,fa).createCutoutFromBlocks(e,t,r,n))}createCutoutFromPath(e){return Z("path",e,z()),ie(E(this,fa).createCutoutFromPath(e))}createCutoutFromOperation(e,t){return Z("ids",e,H(W())),Z("op",t,function(){const e=["Difference","Intersection","Union","XOR"];return N("CutoutOperation",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),ie(E(this,fa).createCutoutFromOperation(e,t))}replaceText(e,t,r=-1,n=-1){Z("id",e,W()),Z("text",t,z()),Z("from",r,W()),Z("to",n,W()),ie(E(this,fa).replaceText(e,t,r,n))}removeText(e,t=-1,r=-1){Z("id",e,W()),Z("from",t,W()),Z("to",r,W()),ie(E(this,fa).removeText(e,t,r))}setTextColor(e,t,r=-1,n=-1){Z("id",e,W()),Z("from",r,W()),Z("to",n,W()),ie(E(this,fa).setTextColor(e,te.fromColor(t),r,n))}getTextColors(e,t=-1,r=-1){Z("id",e,W()),Z("from",t,W()),Z("to",r,W());const n=E(this,fa).getTextColors(e,t,r);return ma(ie(n)).map((e=>te.toColor(e)))}setTextFontWeight(e,t,r=-1,n=-1){Z("id",e,W()),Z("from",r,W()),Z("to",n,W()),ie(E(this,fa).setTextFontWeight(e,t,r,n))}getTextFontWeights(e,t=-1,r=-1){return Z("id",e,W()),Z("from",t,W()),Z("to",r,W()),ma(ie(E(this,fa).getTextFontWeights(e,t,r)))}setTextFontSize(e,t,r=-1,n=-1){Z("id",e,W()),Z("from",r,W()),Z("to",n,W()),ie(E(this,fa).setTextFontSize(e,t,r,n))}getTextFontSizes(e,t=-1,r=-1){return Z("id",e,W()),Z("from",t,W()),Z("to",r,W()),ma(ie(E(this,fa).getTextFontSizes(e,t,r)))}setTextFontStyle(e,t,r=-1,n=-1){Z("id",e,W()),Z("from",r,W()),Z("to",n,W()),ie(E(this,fa).setTextFontStyle(e,t,r,n))}getTextFontStyles(e,t=-1,r=-1){return Z("id",e,W()),Z("from",t,W()),Z("to",r,W()),ma(ie(E(this,fa).getTextFontStyles(e,t,r)))}getTextCases(e,t=-1,r=-1){return Z("id",e,W()),Z("from",t,W()),Z("to",r,W()),ma(ie(E(this,fa).getTextCases(e,t,r)))}setTextCase(e,t,r=-1,n=-1){Z("id",e,W()),Z("textCase",t,z()),Z("from",r,W()),Z("to",n,W()),ie(E(this,fa).setTextCase(e,t,r,n))}canToggleBoldFont(e,t=-1,r=-1){return Z("id",e,W()),Z("from",t,W()),Z("to",r,W()),ie(E(this,fa).canToggleBoldFont(e,t,r))}canToggleItalicFont(e,t=-1,r=-1){return Z("id",e,W()),Z("from",t,W()),Z("to",r,W()),ie(E(this,fa).canToggleItalicFont(e,t,r))}toggleBoldFont(e,t=-1,r=-1){Z("id",e,W()),Z("from",t,W()),Z("to",r,W()),ie(E(this,fa).toggleBoldFont(e,t,r))}toggleItalicFont(e,t=-1,r=-1){Z("id",e,W()),Z("from",t,W()),Z("to",r,W()),ie(E(this,fa).toggleItalicFont(e,t,r))}setFont(e,t,r){Z("block",e,W()),Z("fontFileUri",t,z()),ie(E(this,fa).setFont(e,t,r))}setTypeface(e,t,r=-1,n=-1){Z("block",e,W()),Z("from",r,W()),Z("to",n,W()),ie(E(this,fa).setTypeface(e,t,r,n))}getTypeface(e){return Z("block",e,W()),ie(E(this,fa).getTypeface(e))}getTypefaces(e,t=-1,r=-1){return Z("block",e,W()),Z("from",t,W()),Z("to",r,W()),ma(ie(E(this,fa).getTypefaces(e,t,r)))}getTextCursorRange(){return ie(E(this,fa).getTextCursorRange())}getTextVisibleLineCount(e){return Z("id",e,W()),ie(E(this,fa).getTextVisibleLineCount(e))}getTextVisibleLineGlobalBoundingBoxXYWH(e,t){return Z("id",e,W()),Z("lineIndex",t,W()),ie(E(this,fa).getTextVisibleLineGlobalBoundingBoxXYWH(e,t))}hasFill(e){return Z("id",e,W()),ie(E(this,fa).hasFill(e))}supportsFill(e){return Z("id",e,W()),ie(E(this,fa).supportsFill(e))}isFillEnabled(e){return Z("id",e,W()),ie(E(this,fa).isFillEnabled(e))}setFillEnabled(e,t){return Z("id",e,W()),ie(E(this,fa).setFillEnabled(e,t))}getFill(e){return Z("id",e,W()),ie(E(this,fa).getFill(e))}setFill(e,t){return Z("id",e,W()),Z("fill",t,W()),ie(E(this,fa).setFill(e,t))}setFillSolidColor(e,t,r,n,o=1){Z("id",e,W()),ie(E(this,fa).setFillSolidColor(e,t,r,n,o))}getFillSolidColor(e){return Z("id",e,W()),ie(E(this,fa).getFillSolidColor(e))}setPlaceholderEnabled(e,t){Z("id",e,W()),Z("enabled",t,V()),ie(E(this,fa).setPlaceholderEnabled(e,t))}isPlaceholderEnabled(e){return Z("id",e,W()),ie(E(this,fa).isPlaceholderEnabled(e))}hasPlaceholderBehavior(e){return Z("id",e,W()),ie(E(this,fa).hasPlaceholderBehavior(e))}supportsPlaceholderBehavior(e){return Z("id",e,W()),ie(E(this,fa).supportsPlaceholderBehavior(e))}setPlaceholderBehaviorEnabled(e,t){Z("id",e,W()),ie(E(this,fa).setPlaceholderBehaviorEnabled(e,t))}isPlaceholderBehaviorEnabled(e){return Z("id",e,W()),ie(E(this,fa).isPlaceholderBehaviorEnabled(e))}hasPlaceholderControls(e){return Z("id",e,W()),ie(E(this,fa).hasPlaceholderControls(e))}supportsPlaceholderControls(e){return Z("id",e,W()),ie(E(this,fa).supportsPlaceholderControls(e))}setPlaceholderControlsOverlayEnabled(e,t){return Z("id",e,W()),Z("enabled",t,V()),ie(E(this,fa).setPlaceholderControlsOverlayEnabled(e,t))}isPlaceholderControlsOverlayEnabled(e){return Z("id",e,W()),ie(E(this,fa).isPlaceholderControlsOverlayEnabled(e))}setPlaceholderControlsButtonEnabled(e,t){return Z("id",e,W()),Z("enabled",t,V()),ie(E(this,fa).setPlaceholderControlsButtonEnabled(e,t))}isPlaceholderControlsButtonEnabled(e){return Z("id",e,W()),ie(E(this,fa).isPlaceholderControlsButtonEnabled(e))}setMetadata(e,t,r){Z("id",e,W()),Z("key",t,z()),Z("value",r,z()),ie(E(this,fa).setMetadata(e,t,r))}getMetadata(e,t){return Z("id",e,W()),Z("key",t,z()),ie(E(this,fa).getMetadata(e,t))}hasMetadata(e,t){return Z("id",e,W()),Z("key",t,z()),ie(E(this,fa).hasMetadata(e,t))}findAllMetadata(e){return Z("id",e,W()),ma(ie(E(this,fa).findAllMetadata(e)))}removeMetadata(e,t){Z("id",e,W()),Z("key",t,z()),ie(E(this,fa).removeMetadata(e,t))}setScopeEnabled(e,t,r){Z("id",e,W()),Z("key",t,z()),Z("enabled",r,V()),ie(E(this,fa).setScopeEnabled(e,t,r))}isScopeEnabled(e,t){return Z("id",e,W()),Z("key",t,z()),ie(E(this,fa).isScopeEnabled(e,t))}isAllowedByScope(e,t){return Z("id",e,W()),Z("key",t,z()),ie(E(this,fa).isAllowedByScope(e,t))}hasDuration(e){return Z("id",e,W()),ie(E(this,fa).hasDuration(e))}supportsDuration(e){return Z("id",e,W()),ie(E(this,fa).supportsDuration(e))}setDuration(e,t){return Z("id",e,W()),Z("duration",t,G()),ie(E(this,fa).setDuration(e,t))}getDuration(e){return Z("id",e,W()),ie(E(this,fa).getDuration(e))}setPageDurationSource(e,t){return Z("page",e,W()),Z("id",t,W()),ie(E(this,fa).setPageDurationSource(e,t))}isPageDurationSource(e){return Z("id",e,W()),ie(E(this,fa).isPageDurationSource(e))}supportsPageDurationSource(e,t){return Z("page",e,W()),Z("id",t,W()),ie(E(this,fa).supportsPageDurationSource(e,t))}removePageDurationSource(e){Z("id",e,W()),ie(E(this,fa).removePageDurationSource(e))}hasTimeOffset(e){return Z("id",e,W()),ie(E(this,fa).hasTimeOffset(e))}supportsTimeOffset(e){return Z("id",e,W()),ie(E(this,fa).supportsTimeOffset(e))}setTimeOffset(e,t){return Z("id",e,W()),Z("offset",t,G()),ie(E(this,fa).setTimeOffset(e,t))}getTimeOffset(e){return Z("id",e,W()),ie(E(this,fa).getTimeOffset(e))}hasTrim(e){return Z("id",e,W()),ie(E(this,fa).hasTrim(e))}supportsTrim(e){return Z("id",e,W()),ie(E(this,fa).supportsTrim(e))}setTrimOffset(e,t){return Z("id",e,W()),Z("offset",t,G()),ie(E(this,fa).setTrimOffset(e,t))}getTrimOffset(e){return Z("id",e,W()),ie(E(this,fa).getTrimOffset(e))}setTrimLength(e,t){return Z("id",e,W()),Z("length",t,G()),ie(E(this,fa).setTrimLength(e,t))}getTrimLength(e){return Z("id",e,W()),ie(E(this,fa).getTrimLength(e))}getTotalSceneDuration(e){return Z("scene",e,W()),ie(E(this,fa).getTotalSceneDuration(e))}setPlaying(e,t){return Z("id",e,W()),Z("enabled",t,V()),ie(E(this,fa).setPlaying(e,t))}isPlaying(e){return Z("id",e,W()),ie(E(this,fa).isPlaying(e))}hasPlaybackTime(e){return Z("id",e,W()),ie(E(this,fa).hasPlaybackTime(e))}supportsPlaybackTime(e){return Z("id",e,W()),ie(E(this,fa).supportsPlaybackTime(e))}setPlaybackTime(e,t){return Z("id",e,W()),Z("time",t,G()),ie(E(this,fa).setPlaybackTime(e,t))}getPlaybackTime(e){return Z("id",e,W()),ie(E(this,fa).getPlaybackTime(e))}isVisibleAtCurrentPlaybackTime(e){return Z("id",e,W()),ie(E(this,fa).isVisibleAtCurrentPlaybackTime(e))}setSoloPlaybackEnabled(e,t){return Z("id",e,W()),Z("enabled",t,V()),ie(E(this,fa).setSoloPlaybackEnabled(e,t))}isSoloPlaybackEnabled(e){return Z("id",e,W()),ie(E(this,fa).isSoloPlaybackEnabled(e))}hasPlaybackControl(e){return Z("id",e,W()),ie(E(this,fa).hasPlaybackControl(e))}supportsPlaybackControl(e){return Z("id",e,W()),ie(E(this,fa).supportsPlaybackControl(e))}setLooping(e,t){Z("id",e,W()),Z("looping",t,V()),ie(E(this,fa).setLooping(e,t))}isLooping(e){return Z("id",e,W()),ie(E(this,fa).isLooping(e))}setMuted(e,t){Z("id",e,W()),Z("muted",t,V()),ie(E(this,fa).setMuted(e,t))}isMuted(e){return Z("id",e,W()),ie(E(this,fa).isMuted(e))}setVolume(e,t){Z("id",e,W()),Z("volume",t,G()),ie(E(this,fa).setVolume(e,t))}getVolume(e){return Z("id",e,W()),ie(E(this,fa).getVolume(e))}async forceLoadAVResource(e){return Z("id",e,W()),ae((t=>E(this,fa).forceLoadAVResource(e,t)))}unstable_isAVResourceLoaded(e){return Z("id",e,W()),ie(E(this,fa).unstable_isAVResourceLoaded(e))}getAVResourceTotalDuration(e){return Z("id",e,W()),ie(E(this,fa).getAVResourceTotalDuration(e))}getVideoWidth(e){return Z("id",e,W()),ie(E(this,fa).getVideoWidth(e))}getVideoHeight(e){return Z("id",e,W()),ie(E(this,fa).getVideoHeight(e))}generateVideoThumbnailSequence(e,t,r,n,o,i){Z("id",e,W()),Z("thumbnailHeight",t,W()),Z("timeBegin",r,G()),Z("timeEnd",n,G()),Z("numberOfFrames",o,W());const a=E(this,fa).generateVideoThumbnailSequence(e,t,r,n,o,(e=>{"error"in e?i(0,new Error(e.error)):i(e.frameIndex,new ImageData(new Uint8ClampedArray(e.imageData),e.width,e.height))}));return()=>{E(this,fa).cancelVideoThumbnailSequenceGeneration(a)}}generateAudioThumbnailSequence(e,t,r,n,o,i,a){Z("id",e,W()),Z("samplesPerChunk",t,W()),Z("timeBegin",r,G()),Z("timeEnd",n,G()),Z("numberOfSamples",o,W()),Z("numberOfChannels",i,W());const s=E(this,fa).generateAudioThumbnailSequence(e,t,r,n,o,i,(e=>{"error"in e?a(0,new Error(e.error)):a(e.chunkIndex,e.sampleData)}));return()=>{E(this,fa).cancelAudioThumbnailSequenceGeneration(s)}}async getVideoFillThumbnail(e,t){return Z("id",e,W()),Z("thumbnailHeight",t,W()),new Promise(((r,n)=>{E(this,fa).getVideoFillThumbnail(e,t,(e=>{"error"in e?n(e.error):r(new pa([e],{type:"image/jpeg"}))}))}))}async getVideoFillThumbnailAtlas(e,t,r,n){return Z("id",e,W()),Z("numberOfColumns",t,W()),Z("numberOfRows",r,W()),Z("thumbnailHeight",n,W()),new Promise(((o,i)=>{E(this,fa).getVideoFillThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new pa([e],{type:"image/jpeg"}))}))}))}async getPageThumbnailAtlas(e,t,r,n){return Z("id",e,W()),Z("numberOfColumns",t,W()),Z("numberOfRows",r,W()),new Promise(((o,i)=>{E(this,fa).getPageThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new pa([e],{type:"image/jpeg"}))}))}))}createAnimation(e){return Z("type",e,z()),ie(E(this,fa).createAnimation(e))}supportsAnimation(e){return Z("id",e,W()),ie(E(this,fa).supportsAnimation(e))}setInAnimation(e,t){Z("id",e,W()),Z("animation",t,W()),ie(E(this,fa).setInAnimation(e,t))}setLoopAnimation(e,t){Z("id",e,W()),Z("animation",t,W()),ie(E(this,fa).setLoopAnimation(e,t))}setOutAnimation(e,t){Z("id",e,W()),Z("animation",t,W()),ie(E(this,fa).setOutAnimation(e,t))}getInAnimation(e){return Z("id",e,W()),ie(E(this,fa).getInAnimation(e))}getLoopAnimation(e){return Z("id",e,W()),ie(E(this,fa).getLoopAnimation(e))}getOutAnimation(e){return Z("id",e,W()),ie(E(this,fa).getOutAnimation(e))}setNativePixelBuffer(e,t){Z("id",e,W()),t instanceof HTMLVideoElement&&(t.width=t.videoWidth,t.height=t.videoHeight),ie(E(this,fa).setNativePixelBuffer(e,t))}getState(e){return Z("id",e,W()),ie(E(this,fa).getState(e))}setState(e,t){Z("id",e,W()),ie(E(this,fa).setState(e,t))}async forceLoadResources(e){return Z("ids",e,H(W())),ae((t=>E(this,fa).forceLoadResources(e,t)))}};ha=d(null),fa=new WeakMap,y(ha,1,"loadFromString",da,BlockAPI),y(ha,1,"loadFromArchiveURL",la,BlockAPI),y(ha,1,"create",ca,BlockAPI),y(ha,1,"createFill",ua,BlockAPI),y(ha,1,"getType",sa,BlockAPI),y(ha,1,"getKind",aa,BlockAPI),y(ha,1,"setKind",ia,BlockAPI),y(ha,1,"select",oa,BlockAPI),y(ha,1,"setSelected",na,BlockAPI),y(ha,1,"isSelected",ra,BlockAPI),y(ha,1,"findAllSelected",ta,BlockAPI),y(ha,1,"isGroupable",ea,BlockAPI),y(ha,1,"group",Ji,BlockAPI),y(ha,1,"ungroup",Zi,BlockAPI),y(ha,1,"enterGroup",Qi,BlockAPI),y(ha,1,"exitGroup",Ki,BlockAPI),y(ha,1,"isCombinable",Yi,BlockAPI),y(ha,1,"combine",Xi,BlockAPI),y(ha,1,"setName",zi,BlockAPI),y(ha,1,"getName",ji,BlockAPI),y(ha,1,"getUUID",Gi,BlockAPI),y(ha,1,"findByName",Wi,BlockAPI),y(ha,1,"findByType",Vi,BlockAPI),y(ha,1,"findByKind",Hi,BlockAPI),y(ha,1,"findAll",Ni,BlockAPI),y(ha,1,"findAllPlaceholders",qi,BlockAPI),y(ha,1,"createShape",Ui,BlockAPI),y(ha,1,"hasShape",$i,BlockAPI),y(ha,1,"supportsShape",Oi,BlockAPI),y(ha,1,"getShape",Ii,BlockAPI),y(ha,1,"setShape",Mi,BlockAPI),y(ha,1,"isVisible",Ri,BlockAPI),y(ha,1,"setVisible",Li,BlockAPI),y(ha,1,"isClipped",Di,BlockAPI),y(ha,1,"setClipped",Bi,BlockAPI),y(ha,1,"isTransformLocked",Pi,BlockAPI),y(ha,1,"setTransformLocked",Fi,BlockAPI),y(ha,1,"getPositionX",Ti,BlockAPI),y(ha,1,"getPositionXMode",Ai,BlockAPI),y(ha,1,"getPositionY",xi,BlockAPI),y(ha,1,"getPositionYMode",Ci,BlockAPI),y(ha,1,"setPositionX",_i,BlockAPI),y(ha,1,"setPositionXMode",ki,BlockAPI),y(ha,1,"setPositionY",Si,BlockAPI),y(ha,1,"setPositionYMode",Ei,BlockAPI),y(ha,1,"setAlwaysOnTop",wi,BlockAPI),y(ha,1,"setAlwaysOnBottom",bi,BlockAPI),y(ha,1,"isAlwaysOnTop",vi,BlockAPI),y(ha,1,"isAlwaysOnBottom",yi,BlockAPI),y(ha,1,"bringToFront",gi,BlockAPI),y(ha,1,"sendToBack",mi,BlockAPI),y(ha,1,"bringForward",pi,BlockAPI),y(ha,1,"sendBackward",hi,BlockAPI),y(ha,1,"getRotation",fi,BlockAPI),y(ha,1,"setRotation",di,BlockAPI),y(ha,1,"getFlipHorizontal",li,BlockAPI),y(ha,1,"getFlipVertical",ci,BlockAPI),y(ha,1,"setFlipHorizontal",ui,BlockAPI),y(ha,1,"setFlipVertical",si,BlockAPI),y(ha,1,"hasContentFillMode",ai,BlockAPI),y(ha,1,"supportsContentFillMode",ii,BlockAPI),y(ha,1,"getWidth",oi,BlockAPI),y(ha,1,"getWidthMode",ni,BlockAPI),y(ha,1,"getHeight",ri,BlockAPI),y(ha,1,"getHeightMode",ti,BlockAPI),y(ha,1,"setWidth",ei,BlockAPI),y(ha,1,"setWidthMode",Jo,BlockAPI),y(ha,1,"setHeight",Zo,BlockAPI),y(ha,1,"setHeightMode",Qo,BlockAPI),y(ha,1,"getFrameX",Ko,BlockAPI),y(ha,1,"getFrameY",Yo,BlockAPI),y(ha,1,"getFrameWidth",Xo,BlockAPI),y(ha,1,"getFrameHeight",zo,BlockAPI),y(ha,1,"setContentFillMode",jo,BlockAPI),y(ha,1,"getContentFillMode",Go,BlockAPI),y(ha,1,"duplicate",Wo,BlockAPI),y(ha,1,"destroy",Vo,BlockAPI),y(ha,1,"isValid",Ho,BlockAPI),y(ha,1,"getParent",No,BlockAPI),y(ha,1,"getChildren",qo,BlockAPI),y(ha,1,"insertChild",Uo,BlockAPI),y(ha,1,"appendChild",$o,BlockAPI),y(ha,1,"referencesAnyVariables",Oo,BlockAPI),y(ha,1,"getGlobalBoundingBoxX",Io,BlockAPI),y(ha,1,"getGlobalBoundingBoxY",Mo,BlockAPI),y(ha,1,"getGlobalBoundingBoxWidth",Ro,BlockAPI),y(ha,1,"getGlobalBoundingBoxHeight",Lo,BlockAPI),y(ha,1,"getScreenSpaceBoundingBoxXYWH",Do,BlockAPI),y(ha,1,"alignHorizontally",Bo,BlockAPI),y(ha,1,"alignVertically",Po,BlockAPI),y(ha,1,"isAlignable",Fo,BlockAPI),y(ha,1,"distributeHorizontally",To,BlockAPI),y(ha,1,"distributeVertically",Ao,BlockAPI),y(ha,1,"isDistributable",xo,BlockAPI),y(ha,1,"fillParent",Co,BlockAPI),y(ha,1,"resizeContentAware",_o,BlockAPI),y(ha,1,"scale",ko,BlockAPI),y(ha,1,"findAllProperties",So,BlockAPI),y(ha,1,"isPropertyReadable",Eo,BlockAPI),y(ha,1,"isPropertyWritable",wo,BlockAPI),y(ha,1,"getPropertyType",bo,BlockAPI),y(ha,1,"getEnumValues",vo,BlockAPI),y(ha,1,"setBool",yo,BlockAPI),y(ha,1,"getBool",go,BlockAPI),y(ha,1,"setInt",mo,BlockAPI),y(ha,1,"getInt",po,BlockAPI),y(ha,1,"setFloat",ho,BlockAPI),y(ha,1,"getFloat",fo,BlockAPI),y(ha,1,"setDouble",lo,BlockAPI),y(ha,1,"getDouble",co,BlockAPI),y(ha,1,"setString",uo,BlockAPI),y(ha,1,"getString",so,BlockAPI),y(ha,1,"setColor",ao,BlockAPI),y(ha,1,"getColor",io,BlockAPI),y(ha,1,"setColorRGBA",oo,BlockAPI),y(ha,1,"getColorRGBA",no,BlockAPI),y(ha,1,"setColorSpot",ro,BlockAPI),y(ha,1,"getColorSpotName",to,BlockAPI),y(ha,1,"getColorSpotTint",eo,BlockAPI),y(ha,1,"setGradientColorStops",Jn,BlockAPI),y(ha,1,"getGradientColorStops",Zn,BlockAPI),y(ha,1,"getSourceSet",Qn,BlockAPI),y(ha,1,"setSourceSet",Kn,BlockAPI),y(ha,1,"addImageFileURIToSourceSet",Yn,BlockAPI),y(ha,1,"addVideoFileURIToSourceSet",Xn,BlockAPI),y(ha,1,"setEnum",zn,BlockAPI),y(ha,1,"getEnum",jn,BlockAPI),y(ha,1,"hasCrop",Gn,BlockAPI),y(ha,1,"supportsCrop",Wn,BlockAPI),y(ha,1,"setCropScaleX",Vn,BlockAPI),y(ha,1,"setCropScaleY",Hn,BlockAPI),y(ha,1,"setCropRotation",Nn,BlockAPI),y(ha,1,"setCropScaleRatio",qn,BlockAPI),y(ha,1,"setCropTranslationX",Un,BlockAPI),y(ha,1,"setCropTranslationY",$n,BlockAPI),y(ha,1,"resetCrop",On,BlockAPI),y(ha,1,"getCropScaleX",In,BlockAPI),y(ha,1,"getCropScaleY",Mn,BlockAPI),y(ha,1,"getCropRotation",Rn,BlockAPI),y(ha,1,"getCropScaleRatio",Ln,BlockAPI),y(ha,1,"getCropTranslationX",Dn,BlockAPI),y(ha,1,"getCropTranslationY",Bn,BlockAPI),y(ha,1,"adjustCropToFillFrame",Pn,BlockAPI),y(ha,1,"flipCropHorizontal",Fn,BlockAPI),y(ha,1,"flipCropVertical",Tn,BlockAPI),y(ha,1,"hasOpacity",An,BlockAPI),y(ha,1,"supportsOpacity",xn,BlockAPI),y(ha,1,"setOpacity",Cn,BlockAPI),y(ha,1,"getOpacity",_n,BlockAPI),y(ha,1,"hasBlendMode",kn,BlockAPI),y(ha,1,"supportsBlendMode",Sn,BlockAPI),y(ha,1,"setBlendMode",En,BlockAPI),y(ha,1,"getBlendMode",wn,BlockAPI),y(ha,1,"hasFillColor",bn,BlockAPI),y(ha,1,"isIncludedInExport",vn,BlockAPI),y(ha,1,"setIncludedInExport",yn,BlockAPI),y(ha,1,"setFillColorRGBA",gn,BlockAPI),y(ha,1,"getFillColorRGBA",mn,BlockAPI),y(ha,1,"setFillColorEnabled",pn,BlockAPI),y(ha,1,"isFillColorEnabled",hn,BlockAPI),y(ha,1,"createEffect",fn,BlockAPI),y(ha,1,"hasEffects",dn,BlockAPI),y(ha,1,"supportsEffects",ln,BlockAPI),y(ha,1,"getEffects",cn,BlockAPI),y(ha,1,"insertEffect",un,BlockAPI),y(ha,1,"appendEffect",sn,BlockAPI),y(ha,1,"removeEffect",an,BlockAPI),y(ha,1,"hasEffectEnabled",on,BlockAPI),y(ha,1,"setEffectEnabled",nn,BlockAPI),y(ha,1,"isEffectEnabled",rn,BlockAPI),y(ha,1,"createBlur",tn,BlockAPI),y(ha,1,"hasBlur",en,BlockAPI),y(ha,1,"supportsBlur",Jr,BlockAPI),y(ha,1,"setBlur",Zr,BlockAPI),y(ha,1,"getBlur",Qr,BlockAPI),y(ha,1,"setBlurEnabled",Kr,BlockAPI),y(ha,1,"isBlurEnabled",Yr,BlockAPI),y(ha,1,"hasBackgroundColor",Xr,BlockAPI),y(ha,1,"supportsBackgroundColor",zr,BlockAPI),y(ha,1,"setBackgroundColorRGBA",jr,BlockAPI),y(ha,1,"getBackgroundColorRGBA",Gr,BlockAPI),y(ha,1,"setBackgroundColorEnabled",Wr,BlockAPI),y(ha,1,"isBackgroundColorEnabled",Vr,BlockAPI),y(ha,1,"hasStroke",Hr,BlockAPI),y(ha,1,"supportsStroke",Nr,BlockAPI),y(ha,1,"setStrokeEnabled",qr,BlockAPI),y(ha,1,"isStrokeEnabled",Ur,BlockAPI),y(ha,1,"setStrokeColorRGBA",$r,BlockAPI),y(ha,1,"setStrokeColor",Or,BlockAPI),y(ha,1,"getStrokeColorRGBA",Ir,BlockAPI),y(ha,1,"getStrokeColor",Mr,BlockAPI),y(ha,1,"setStrokeWidth",Rr,BlockAPI),y(ha,1,"getStrokeWidth",Lr,BlockAPI),y(ha,1,"setStrokeStyle",Dr,BlockAPI),y(ha,1,"getStrokeStyle",Br,BlockAPI),y(ha,1,"setStrokePosition",Pr,BlockAPI),y(ha,1,"getStrokePosition",Fr,BlockAPI),y(ha,1,"setStrokeCornerGeometry",Tr,BlockAPI),y(ha,1,"getStrokeCornerGeometry",Ar,BlockAPI),y(ha,1,"hasDropShadow",xr,BlockAPI),y(ha,1,"supportsDropShadow",Cr,BlockAPI),y(ha,1,"setDropShadowEnabled",_r,BlockAPI),y(ha,1,"isDropShadowEnabled",kr,BlockAPI),y(ha,1,"setDropShadowColorRGBA",Sr,BlockAPI),y(ha,1,"setDropShadowColor",Er,BlockAPI),y(ha,1,"getDropShadowColorRGBA",wr,BlockAPI),y(ha,1,"getDropShadowColor",br,BlockAPI),y(ha,1,"setDropShadowOffsetX",vr,BlockAPI),y(ha,1,"getDropShadowOffsetX",yr,BlockAPI),y(ha,1,"setDropShadowOffsetY",gr,BlockAPI),y(ha,1,"getDropShadowOffsetY",mr,BlockAPI),y(ha,1,"setDropShadowBlurRadiusX",pr,BlockAPI),y(ha,1,"getDropShadowBlurRadiusX",hr,BlockAPI),y(ha,1,"setDropShadowBlurRadiusY",fr,BlockAPI),y(ha,1,"getDropShadowBlurRadiusY",dr,BlockAPI),y(ha,1,"setDropShadowClip",lr,BlockAPI),y(ha,1,"getDropShadowClip",cr,BlockAPI),y(ha,1,"createCutoutFromBlocks",ur,BlockAPI),y(ha,1,"createCutoutFromPath",sr,BlockAPI),y(ha,1,"createCutoutFromOperation",ar,BlockAPI),y(ha,1,"replaceText",ir,BlockAPI),y(ha,1,"removeText",or,BlockAPI),y(ha,1,"setTextColor",nr,BlockAPI),y(ha,1,"getTextColors",rr,BlockAPI),y(ha,1,"setTextFontWeight",tr,BlockAPI),y(ha,1,"getTextFontWeights",er,BlockAPI),y(ha,1,"setTextFontSize",Jt,BlockAPI),y(ha,1,"getTextFontSizes",Zt,BlockAPI),y(ha,1,"setTextFontStyle",Qt,BlockAPI),y(ha,1,"getTextFontStyles",Kt,BlockAPI),y(ha,1,"getTextCases",Yt,BlockAPI),y(ha,1,"setTextCase",Xt,BlockAPI),y(ha,1,"canToggleBoldFont",zt,BlockAPI),y(ha,1,"canToggleItalicFont",jt,BlockAPI),y(ha,1,"toggleBoldFont",Gt,BlockAPI),y(ha,1,"toggleItalicFont",Wt,BlockAPI),y(ha,1,"setFont",Vt,BlockAPI),y(ha,1,"setTypeface",Ht,BlockAPI),y(ha,1,"getTypeface",Nt,BlockAPI),y(ha,1,"getTypefaces",qt,BlockAPI),y(ha,1,"getTextCursorRange",Ut,BlockAPI),y(ha,1,"getTextVisibleLineCount",$t,BlockAPI),y(ha,1,"getTextVisibleLineGlobalBoundingBoxXYWH",Ot,BlockAPI),y(ha,1,"hasFill",It,BlockAPI),y(ha,1,"supportsFill",Mt,BlockAPI),y(ha,1,"isFillEnabled",Rt,BlockAPI),y(ha,1,"setFillEnabled",Lt,BlockAPI),y(ha,1,"getFill",Dt,BlockAPI),y(ha,1,"setFill",Bt,BlockAPI),y(ha,1,"setFillSolidColor",Pt,BlockAPI),y(ha,1,"getFillSolidColor",Ft,BlockAPI),y(ha,1,"setPlaceholderEnabled",Tt,BlockAPI),y(ha,1,"isPlaceholderEnabled",At,BlockAPI),y(ha,1,"hasPlaceholderBehavior",xt,BlockAPI),y(ha,1,"supportsPlaceholderBehavior",Ct,BlockAPI),y(ha,1,"setPlaceholderBehaviorEnabled",_t,BlockAPI),y(ha,1,"isPlaceholderBehaviorEnabled",kt,BlockAPI),y(ha,1,"hasPlaceholderControls",St,BlockAPI),y(ha,1,"supportsPlaceholderControls",Et,BlockAPI),y(ha,1,"setPlaceholderControlsOverlayEnabled",wt,BlockAPI),y(ha,1,"isPlaceholderControlsOverlayEnabled",bt,BlockAPI),y(ha,1,"setPlaceholderControlsButtonEnabled",vt,BlockAPI),y(ha,1,"isPlaceholderControlsButtonEnabled",yt,BlockAPI),y(ha,1,"setMetadata",gt,BlockAPI),y(ha,1,"getMetadata",mt,BlockAPI),y(ha,1,"hasMetadata",pt,BlockAPI),y(ha,1,"findAllMetadata",ht,BlockAPI),y(ha,1,"removeMetadata",ft,BlockAPI),y(ha,1,"setScopeEnabled",dt,BlockAPI),y(ha,1,"isScopeEnabled",lt,BlockAPI),y(ha,1,"isAllowedByScope",ct,BlockAPI),y(ha,1,"hasDuration",ut,BlockAPI),y(ha,1,"supportsDuration",st,BlockAPI),y(ha,1,"setDuration",at,BlockAPI),y(ha,1,"getDuration",it,BlockAPI),y(ha,1,"setPageDurationSource",ot,BlockAPI),y(ha,1,"isPageDurationSource",nt,BlockAPI),y(ha,1,"supportsPageDurationSource",rt,BlockAPI),y(ha,1,"removePageDurationSource",tt,BlockAPI),y(ha,1,"hasTimeOffset",et,BlockAPI),y(ha,1,"supportsTimeOffset",Je,BlockAPI),y(ha,1,"setTimeOffset",Ze,BlockAPI),y(ha,1,"getTimeOffset",Qe,BlockAPI),y(ha,1,"hasTrim",Ke,BlockAPI),y(ha,1,"supportsTrim",Ye,BlockAPI),y(ha,1,"setTrimOffset",Xe,BlockAPI),y(ha,1,"getTrimOffset",ze,BlockAPI),y(ha,1,"setTrimLength",je,BlockAPI),y(ha,1,"getTrimLength",Ge,BlockAPI),y(ha,1,"getTotalSceneDuration",We,BlockAPI),y(ha,1,"setPlaying",Ve,BlockAPI),y(ha,1,"isPlaying",He,BlockAPI),y(ha,1,"hasPlaybackTime",Ne,BlockAPI),y(ha,1,"supportsPlaybackTime",qe,BlockAPI),y(ha,1,"setPlaybackTime",Ue,BlockAPI),y(ha,1,"getPlaybackTime",$e,BlockAPI),y(ha,1,"isVisibleAtCurrentPlaybackTime",Oe,BlockAPI),y(ha,1,"setSoloPlaybackEnabled",Ie,BlockAPI),y(ha,1,"isSoloPlaybackEnabled",Me,BlockAPI),y(ha,1,"hasPlaybackControl",Re,BlockAPI),y(ha,1,"supportsPlaybackControl",Le,BlockAPI),y(ha,1,"setLooping",De,BlockAPI),y(ha,1,"isLooping",Be,BlockAPI),y(ha,1,"setMuted",Pe,BlockAPI),y(ha,1,"isMuted",Fe,BlockAPI),y(ha,1,"setVolume",Te,BlockAPI),y(ha,1,"getVolume",Ae,BlockAPI),y(ha,1,"forceLoadAVResource",xe,BlockAPI),y(ha,1,"unstable_isAVResourceLoaded",Ce,BlockAPI),y(ha,1,"getAVResourceTotalDuration",_e,BlockAPI),y(ha,1,"getVideoWidth",ke,BlockAPI),y(ha,1,"getVideoHeight",Se,BlockAPI),y(ha,1,"getVideoFillThumbnail",Ee,BlockAPI),y(ha,1,"getVideoFillThumbnailAtlas",we,BlockAPI),y(ha,1,"getPageThumbnailAtlas",be,BlockAPI),y(ha,1,"createAnimation",ve,BlockAPI),y(ha,1,"supportsAnimation",ye,BlockAPI),y(ha,1,"setInAnimation",ge,BlockAPI),y(ha,1,"setLoopAnimation",me,BlockAPI),y(ha,1,"setOutAnimation",pe,BlockAPI),y(ha,1,"getInAnimation",he,BlockAPI),y(ha,1,"getLoopAnimation",fe,BlockAPI),y(ha,1,"getOutAnimation",de,BlockAPI),y(ha,1,"setNativePixelBuffer",le,BlockAPI),y(ha,1,"getState",ce,BlockAPI),y(ha,1,"setState",ue,BlockAPI),y(ha,1,"forceLoadResources",se,BlockAPI),m(ha,BlockAPI);var ga,ya,va,ba,wa,Ea,Sa,ka,_a,Ca,xa,Aa,Ta,Fa,Pa,Ba,Da,La,Ra,Ma,Ia,Oa,$a,Ua,qa,Na,Ha,Va,Wa,Ga,ja,za,Xa,Ya,Ka,Qa,Za,Ja,es,ts,rs,ns,os,is,as,ss,us,cs,ls,ds,fs,hs,ps,ms,gs,ys,vs,bs,ws=new WeakMap;ys=[oe],gs=[oe],ms=[oe],ps=[ne],hs=[ne],fs=[oe],ds=[oe],ls=[ne],cs=[ne],us=[ne],ss=[ne],as=[ne],is=[ne],os=[oe],ns=[oe],rs=[oe],ts=[ne],es=[oe],Ja=[oe],Za=[oe],Qa=[ne],Ka=[ne],Ya=[oe],Xa=[ne],za=[oe],ja=[ne],Ga=[oe],Wa=[ne],Va=[oe],Ha=[ne],Na=[oe],qa=[ne],Ua=[oe],$a=[ne],Oa=[oe],Ia=[ne],Ma=[oe],Ra=[ne],La=[ne],Da=[ne],Ba=[ne],Pa=[ne],Fa=[oe],Ta=[ne],Aa=[ne],xa=[oe],Ca=[ne],_a=[ne],ka=[ne],Sa=[ne],Ea=[oe],wa=[oe],ba=[oe],va=[oe],ya=[oe],ga=[ne];var Es,Ss,ks,_s,Cs,xs,As,Ts,Fs,Ps,Bs,Ds,Ls,Rs,Ms,Is,Os,$s,Us,qs,Ns,Hs,Vs,Ws,Gs,EditorAPI=class{constructor(e){g(bs,5,this),S(this,vs),v(this,"onStateChanged",(e=>{const t=E(this,vs).subscribeToEditorState(e);return()=>{E(this,vs).isDeleted()||ie(E(this,vs).unsubscribe(t))}})),v(this,"onHistoryUpdated",(e=>{const t=E(this,vs).subscribeToHistory(e);return()=>{E(this,vs).isDeleted()||E(this,vs).unsubscribe(t)}})),v(this,"onSettingsChanged",(e=>{const t=E(this,vs).subscribeToSettings(e);return()=>{E(this,vs).isDeleted()||ie(E(this,vs).unsubscribe(t))}})),v(this,"onRoleChanged",(e=>{const t=E(this,vs).subscribeToRoleChange(e);return()=>{E(this,vs).isDeleted()||ie(E(this,vs).unsubscribe(t))}})),k(this,vs,e)}unlockWithLicense(e){ie(E(this,vs).unlockWithLicense(e))}startTracking(e,t){E(this,vs).startTracking(e,t,"")}setTrackingMetadata(e){E(this,vs).setTrackingMetadata(e)}getTrackingMetadata(){return ie(E(this,vs).getTrackingMetadata())}getActiveLicense(){return ie(E(this,vs).getActiveLicense())}_update(){E(this,vs).update()}setEditMode(e){Z("keypath",e,z()),E(this,vs).setEditMode(e)}getEditMode(){return E(this,vs).getEditMode()}unstable_isInteractionHappening(){return ie(E(this,vs).unstable_isInteractionHappening())}getCursorType(){return E(this,vs).getCursorType()}getCursorRotation(){return E(this,vs).getCursorRotation()}getTextCursorPositionInScreenSpaceX(){return E(this,vs).getTextCursorPositionInScreenSpaceX()}getTextCursorPositionInScreenSpaceY(){return E(this,vs).getTextCursorPositionInScreenSpaceY()}createHistory(){return E(this,vs).createHistory()}destroyHistory(e){ie(E(this,vs).destroyHistory(e))}setActiveHistory(e){ie(E(this,vs).setActiveHistory(e))}getActiveHistory(){return E(this,vs).getActiveHistory()}addUndoStep(){ie(E(this,vs).addUndoStep())}undo(){ie(E(this,vs).undo())}redo(){ie(E(this,vs).redo())}canUndo(){return ie(E(this,vs).canUndo())}canRedo(){return ie(E(this,vs).canRedo())}setSettingBool(e,t){return Z("keypath",e,z()),Z("value",t,V()),ie(E(this,vs).setSettingBool(e,t))}getSettingBool(e){return Z("keypath",e,z()),ie(E(this,vs).getSettingBool(e))}setSettingInt(e,t){return Z("keypath",e,z()),Z("value",t,W()),ie(E(this,vs).setSettingInt(e,t))}getSettingInt(e){return Z("keypath",e,z()),ie(E(this,vs).getSettingInt(e))}setSettingFloat(e,t){return Z("keypath",e,z()),Z("value",t,G()),ie(E(this,vs).setSettingFloat(e,t))}getSettingFloat(e){return Z("keypath",e,z()),ie(E(this,vs).getSettingFloat(e))}setSettingString(e,t){return Z("keypath",e,z()),Z("value",t,z()),ie(E(this,vs).setSettingString(e,t))}getSettingString(e){return Z("keypath",e,z()),ie(E(this,vs).getSettingString(e))}setSettingColor(e,t){return Z("keypath",e,z()),ie(E(this,vs).setSettingColor(e,te.fromColor(t)))}getSettingColor(e){return Z("keypath",e,z()),te.toColor(ie(E(this,vs).getSettingColor(e)))}setSettingColorRGBA(e,t,r,n,o=1){return Z("keypath",e,z()),Z("r",t,G()),Z("g",r,G()),Z("b",n,G()),Z("a",o,G()),ie(E(this,vs).setSettingColorRGBA(e,t,r,n,o))}getSettingColorRGBA(e){return Z("keypath",e,z()),ie(E(this,vs).getSettingColorRGBA(e))}setSettingEnum(e,t){return Z("keypath",e,z()),Z("value",t,z()),ie(E(this,vs).setSettingEnum(e,t))}getSettingEnum(e){return Z("keypath",e,z()),ie(E(this,vs).getSettingEnum(e))}getSettingEnumOptions(e){return Z("keypath",e,z()),ma(ie(E(this,vs).getSettingEnumOptions(e)))}setRole(e){return ie(E(this,vs).setRole(e))}getRole(){return ie(E(this,vs).getRole())}findAllSettings(){return ma(E(this,vs).findAllSettings())}getSettingType(e){Z("keypath",e,z());return ie(E(this,vs).getSettingType(e))}getAvailableMemory(){return ie(E(this,vs).getAvailableMemory())}getUsedMemory(){return ie(E(this,vs).getUsedMemory())}getMaxExportSize(){return ie(E(this,vs).getMaxExportSize())}setURIResolver(e){ws.set(E(this,vs),e);return ie(E(this,vs).setURIResolver((t=>e(t,this.defaultURIResolver.bind(this)))))}unstable_getURIResolver(){return ws.get(E(this,vs))??null}defaultURIResolver(e){return E(this,vs).defaultURIResolver(e)}getAbsoluteURI(e){return ie(E(this,vs).getAbsoluteURI(e))}findAllScopes(){return ma(E(this,vs).findAllScopes())}setGlobalScope(e,t){Z("key",e,z()),Z("value",t,z()),ie(E(this,vs).setGlobalScope(e,t))}getGlobalScope(e){return Z("key",e,z()),ie(E(this,vs).getGlobalScope(e))}findAllSpotColors(){return ma(E(this,vs).findAllSpotColors())}getSpotColorRGBA(e){return Z("name",e,z()),E(this,vs).getSpotColorRGB(e)}getSpotColorCMYK(e){return Z("name",e,z()),E(this,vs).getSpotColorCMYK(e)}setSpotColorRGB(e,t,r,n){return Z("name",e,z()),Z("r",t,G()),Z("g",r,G()),Z("b",n,G()),E(this,vs).setSpotColorRGB(e,t,r,n)}setSpotColorCMYK(e,t,r,n,o){return Z("name",e,z()),Z("c",t,G()),Z("m",r,G()),Z("y",n,G()),Z("k",o,G()),E(this,vs).setSpotColorCMYK(e,t,r,n,o)}removeSpotColor(e){return Z("name",e,z()),ie(E(this,vs).removeSpotColor(e))}setSpotColorForCutoutType(e,t){return Z("type",e,z()),Z("color",t,z()),ie(E(this,vs).setSpotColorForCutoutType(e,t))}getSpotColorForCutoutType(e){return Z("type",e,z()),ie(E(this,vs).getSpotColorForCutoutType(e))}convertColorToColorSpace(e,t){return Z("colorSpace",t,z()),te.toColor(ie(E(this,vs).convertColorToColorSpace(te.fromColor(e),t)))}createBuffer(){return E(this,vs).createBuffer()}destroyBuffer(e){ie(E(this,vs).destroyBuffer(e))}setBufferData(e,t,r){Z("offset",t,W()),ie(E(this,vs).setBufferData(e,t,r))}getBufferData(e,t,r){Z("offset",t,W()),Z("length",r,W());const n=E(this,vs).getBufferData(e,t,r);if("error"in n)throw new Error(n.error);return n}setBufferLength(e,t){Z("length",t,W()),ie(E(this,vs).setBufferLength(e,t))}getBufferLength(e){return ie(E(this,vs).getBufferLength(e))}cloneBuffers(){return ma(ie(E(this,vs).cloneBuffers()))}restoreBuffers(e){ie(E(this,vs).restoreBuffers(e))}getMimeType(e){return Z("uri",e,z()),ae((t=>E(this,vs).getMimeType(e,t)))}findAllTransientResources(){return ma(ie(E(this,vs).findAllTransientResources()))}getResourceData(e,t,r){Z("uri",e,z()),Z("chunkSize",t,W()),ie(E(this,vs).getResourceData(e,t,r))}relocateResource(e,t){Z("currentUrl",e,z()),Z("relocatedUrl",t,z()),ie(E(this,vs).relocateResource(e,t))}};bs=d(null),vs=new WeakMap,y(bs,1,"unlockWithLicense",ys,EditorAPI),y(bs,1,"startTracking",gs,EditorAPI),y(bs,1,"setTrackingMetadata",ms,EditorAPI),y(bs,1,"getTrackingMetadata",ps,EditorAPI),y(bs,1,"getActiveLicense",hs,EditorAPI),y(bs,1,"_update",fs,EditorAPI),y(bs,1,"setEditMode",ds,EditorAPI),y(bs,1,"getEditMode",ls,EditorAPI),y(bs,1,"unstable_isInteractionHappening",cs,EditorAPI),y(bs,1,"getCursorType",us,EditorAPI),y(bs,1,"getCursorRotation",ss,EditorAPI),y(bs,1,"getTextCursorPositionInScreenSpaceX",as,EditorAPI),y(bs,1,"getTextCursorPositionInScreenSpaceY",is,EditorAPI),y(bs,1,"createHistory",os,EditorAPI),y(bs,1,"destroyHistory",ns,EditorAPI),y(bs,1,"setActiveHistory",rs,EditorAPI),y(bs,1,"getActiveHistory",ts,EditorAPI),y(bs,1,"addUndoStep",es,EditorAPI),y(bs,1,"undo",Ja,EditorAPI),y(bs,1,"redo",Za,EditorAPI),y(bs,1,"canUndo",Qa,EditorAPI),y(bs,1,"canRedo",Ka,EditorAPI),y(bs,1,"setSettingBool",Ya,EditorAPI),y(bs,1,"getSettingBool",Xa,EditorAPI),y(bs,1,"setSettingInt",za,EditorAPI),y(bs,1,"getSettingInt",ja,EditorAPI),y(bs,1,"setSettingFloat",Ga,EditorAPI),y(bs,1,"getSettingFloat",Wa,EditorAPI),y(bs,1,"setSettingString",Va,EditorAPI),y(bs,1,"getSettingString",Ha,EditorAPI),y(bs,1,"setSettingColor",Na,EditorAPI),y(bs,1,"getSettingColor",qa,EditorAPI),y(bs,1,"setSettingColorRGBA",Ua,EditorAPI),y(bs,1,"getSettingColorRGBA",$a,EditorAPI),y(bs,1,"setSettingEnum",Oa,EditorAPI),y(bs,1,"getSettingEnum",Ia,EditorAPI),y(bs,1,"setRole",Ma,EditorAPI),y(bs,1,"getRole",Ra,EditorAPI),y(bs,1,"findAllSettings",La,EditorAPI),y(bs,1,"getAvailableMemory",Da,EditorAPI),y(bs,1,"getUsedMemory",Ba,EditorAPI),y(bs,1,"getMaxExportSize",Pa,EditorAPI),y(bs,1,"setURIResolver",Fa,EditorAPI),y(bs,1,"unstable_getURIResolver",Ta,EditorAPI),y(bs,1,"findAllScopes",Aa,EditorAPI),y(bs,1,"setGlobalScope",xa,EditorAPI),y(bs,1,"getGlobalScope",Ca,EditorAPI),y(bs,1,"findAllSpotColors",_a,EditorAPI),y(bs,1,"getSpotColorRGBA",ka,EditorAPI),y(bs,1,"getSpotColorCMYK",Sa,EditorAPI),y(bs,1,"setSpotColorRGB",Ea,EditorAPI),y(bs,1,"setSpotColorCMYK",wa,EditorAPI),y(bs,1,"removeSpotColor",ba,EditorAPI),y(bs,1,"setSpotColorForCutoutType",va,EditorAPI),y(bs,1,"getSpotColorForCutoutType",ya,EditorAPI),y(bs,1,"convertColorToColorSpace",ga,EditorAPI),m(bs,EditorAPI),Vs=[oe],Hs=[oe],Ns=[oe],qs=[oe],Us=[oe],$s=[oe],Os=[oe],Is=[ne],Ms=[oe],Rs=[oe],Ls=[ne],Ds=[oe],Bs=[ne],Ps=[ne],Fs=[ne],Ts=[ne],As=[ne],xs=[oe],Cs=[ne],_s=[oe],ks=[oe],Ss=[oe],Es=[ne];var SceneAPI=class{constructor(e){g(Gs,5,this),S(this,Ws),v(this,"onZoomLevelChanged",(e=>{const t=E(this,Ws).subscribeToZoomLevel(e);return()=>{E(this,Ws).isDeleted()||ie(E(this,Ws).unsubscribe(t))}})),v(this,"onActiveChanged",(e=>{const t=E(this,Ws).subscribeToActiveSceneChange(e);return()=>{E(this,Ws).isDeleted()||ie(E(this,Ws).unsubscribe(t))}})),k(this,Ws,e)}async loadFromString(e){return Z("sceneContent",e,z()),ae((t=>E(this,Ws).loadSceneFromString(e,t)))}async loadFromURL(e){return Z("url",e,z()),ae((t=>E(this,Ws).loadSceneFromURL(e,t)))}async loadFromArchiveURL(e){return Z("url",e,z()),ae((t=>E(this,Ws).loadSceneFromArchiveURL(e,t)))}async saveToString(e=["blob","bundle","file","http","https"]){const t=this.get();if(null==t)throw new Error("No scene available.");return ae((r=>{E(this,Ws).saveSceneToString(t,r,e)}))}async saveToArchive(){return new Promise(((e,t)=>{const r=this.get();null==r?t(new Error("No scene available.")):E(this,Ws).saveSceneToArchive(r,(r=>{"error"in r?t(r.error):e(new pa([r],{type:D.Zip}))}))}))}create(e="Free"){Z("sceneLayout",e,ee());return ie(E(this,Ws).createScene(e))}createVideo(){return ie(E(this,Ws).createVideoScene())}createFromImage(e,t=300,r=1,n="Free",o=0,i=!1){return Z("url",e,z()),Z("dpi",t,Y(G(),0)),Z("pixelScaleFactor",r,Y(G(),0)),Z("sceneLayout",n,ee()),ae((a=>E(this,Ws).createSceneFromImage(e,t,r,n,o,i,a)))}createFromVideo(e){return Z("url",e,z()),ae((t=>E(this,Ws).createSceneFromVideo(e,t)))}get(){const e=ie(E(this,Ws).findByType("scene")),t=ma(e);return t.length>0?t[0]:null}async applyTemplateFromString(e){return Z("content",e,z()),ae((t=>E(this,Ws).applyTemplateFromString(e,t)))}async applyTemplateFromURL(e){return Z("url",e,z()),ae((t=>E(this,Ws).applyTemplateFromURL(e,t)))}getMode(){const e=this.get();return ie(E(this,Ws).getSceneMode(e))}setDesignUnit(e){Z("designUnit",e,function(){const e=["Pixel","Millimeter","Inch"];return N("DesignUnit",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}());const t=this.get();ie(E(this,Ws).setDesignUnit(t,e))}getDesignUnit(){const e=this.get();return ie(E(this,Ws).getDesignUnit(e))}getPages(){return ma(ie(E(this,Ws).getPages()))}getCurrentPage(){const e=this.get();if(null==e)return null;const t=E(this,Ws).getCurrentPage(e);return t.isValid()?ie(t):null}findNearestToViewPortCenterByType(e){Z("type",e,z());const t=this.get();if(null==t)return[];const r=ie(E(this,Ws).findNearestToViewPortCenterByType(t,e));return ma(r)}findNearestToViewPortCenterByKind(e){Z("kind",e,z());const t=this.get();if(null==t)return[];const r=ie(E(this,Ws).findNearestToViewPortCenterByKind(t,e));return ma(r)}setZoomLevel(e=1){const t=this.get();Z("zoomLevel",e,Y(G(),0)),E(this,Ws).setZoomLevel(t,e)}getZoomLevel(){const e=this.get();return ie(E(this,Ws).getZoomLevel(e))}async zoomToBlock(e,t=0,r=0,n=0,o=0){return Z("id",e,W()),ae((i=>E(this,Ws).zoomToBlock(e,t,r,n,o,i)))}enableZoomAutoFit(e,t,r=0,n=0,o=0,i=0){return Z("id",e,W()),Z("axis",t,function(){const e=["Horizontal","Vertical","Both"];return N("ZoomAutoFitAxis",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),"Horizontal"===t?(Z("paddingBefore",r,G()),Z("paddingAfter",n,G()),ie(E(this,Ws).enableZoomAutoFit(e,t,r,0,n,0))):"Vertical"===t?(Z("paddingBefore",r,G()),Z("paddingAfter",n,G()),ie(E(this,Ws).enableZoomAutoFit(e,t,0,r,0,n))):(Z("paddingLeft",r,G()),Z("paddingTop",n,G()),Z("paddingRight",o,G()),Z("paddingBottom",i,G()),ie(E(this,Ws).enableZoomAutoFit(e,t,r,n,o,i)))}disableZoomAutoFit(e){return Z("blockOrScene",e,W()),ie(E(this,Ws).disableZoomAutoFit(e))}isZoomAutoFitEnabled(e){return Z("blockOrScene",e,W()),ie(E(this,Ws).isZoomAutoFitEnabled(e))}unstable_enableCameraPositionClamping(e,t=0,r=0,n=0,o=0,i=0,a=0,s=0,u=0){return Z("ids",e,H(G())),Z("paddingLeft",t,G()),Z("paddingTop",r,G()),Z("paddingRight",n,G()),Z("paddingBottom",o,G()),Z("scaledPaddingLeft",t,G()),Z("scaledPaddingTop",r,G()),Z("scaledPaddingRight",n,G()),Z("scaledPaddingBottom",o,G()),ie(E(this,Ws).unstable_enableCameraPositionClamping(e,t,r,n,o,i,a,s,u))}unstable_disableCameraPositionClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return ie(E(this,Ws).unstable_disableCameraPositionClamping(e))}unstable_isCameraPositionClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return ie(E(this,Ws).unstable_isCameraPositionClampingEnabled(e))}unstable_enableCameraZoomClamping(e,t=-1,r=-1,n=0,o=0,i=0,a=0){return Z("ids",e,H(G())),Z("minZoomLimit",t,G()),Z("maxZoomLimit",r,G()),Z("paddingLeft",n,G()),Z("paddingTop",o,G()),Z("paddingRight",i,G()),Z("paddingBottom",a,G()),ie(E(this,Ws).unstable_enableCameraZoomClamping(e,t,r,n,o,i,a))}unstable_disableCameraZoomClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return ie(E(this,Ws).unstable_disableCameraZoomClamping(e))}unstable_isCameraZoomClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return ie(E(this,Ws).unstable_isCameraZoomClampingEnabled(e))}};Gs=d(null),Ws=new WeakMap,y(Gs,1,"loadFromString",Vs,SceneAPI),y(Gs,1,"loadFromURL",Hs,SceneAPI),y(Gs,1,"loadFromArchiveURL",Ns,SceneAPI),y(Gs,1,"create",qs,SceneAPI),y(Gs,1,"createVideo",Us,SceneAPI),y(Gs,1,"createFromImage",$s,SceneAPI),y(Gs,1,"createFromVideo",Os,SceneAPI),y(Gs,1,"get",Is,SceneAPI),y(Gs,1,"applyTemplateFromString",Ms,SceneAPI),y(Gs,1,"applyTemplateFromURL",Rs,SceneAPI),y(Gs,1,"getMode",Ls,SceneAPI),y(Gs,1,"setDesignUnit",Ds,SceneAPI),y(Gs,1,"getDesignUnit",Bs,SceneAPI),y(Gs,1,"getPages",Ps,SceneAPI),y(Gs,1,"getCurrentPage",Fs,SceneAPI),y(Gs,1,"findNearestToViewPortCenterByType",Ts,SceneAPI),y(Gs,1,"findNearestToViewPortCenterByKind",As,SceneAPI),y(Gs,1,"setZoomLevel",xs,SceneAPI),y(Gs,1,"getZoomLevel",Cs,SceneAPI),y(Gs,1,"zoomToBlock",_s,SceneAPI),y(Gs,1,"enableZoomAutoFit",ks,SceneAPI),y(Gs,1,"disableZoomAutoFit",Ss,SceneAPI),y(Gs,1,"isZoomAutoFitEnabled",Es,SceneAPI),m(Gs,SceneAPI);var js=new WeakMap,zs={assets:[],total:0,currentPage:0,nextPage:void 0},AssetAPI=class{#e;constructor(e){this.#e=e}#t=new Set;#r=new Set;unstable_registerApplyAssetMiddleware(e){return this.#t.add(e),()=>{this.#t.delete(e)}}unstable_registerApplyAssetToBlockMiddleware(e){return this.#r.add(e),()=>{this.#r.delete(e)}}addSource(e){const t=e.getSupportedMimeTypes?.bind(e),r=e.getGroups?.bind(e),n=e.applyAsset?.bind(e),o=e.applyAssetToBlock?.bind(e),i=e.addAsset?.bind(e),a=e.removeAsset?.bind(e),s=e.credits,u=e.license;ie(this.#e.addAssetSource(e.id,(async(t,r)=>{try{const n={...t,sortKey:t.sortKey,sortingOrder:t.sortingOrder,sortActiveFirst:t.sortActiveFirst,tags:ma(t.tags),groups:ma(t.groups),excludeGroups:ma(t.excludeGroups)},o=await e.findAssets(n);if(o){const t={...o,assets:o.assets.map((t=>Xs(t,e.id)))};r.invoke(t)}else r.invoke(zs)}catch(e){r.invoke(e.message??"Unknown error in user-defined `findAssets`")}}),r?async e=>{try{const t=await r();e.invoke(t)}catch(t){e.invoke(t.message??"Unknown error in user-defined `getGroups`")}}:null,s?()=>({name:s.name,url:s.url??""}):null,u?()=>({name:u.name,url:u.url??""}):null,t?()=>t()??[]:null,n?async(e,t)=>{try{const r=await n(this.#n(e));t.invoke(r)}catch(e){t.invoke(e.message??"Unknown error in user-defined `applyAsset`")}}:null,o?async(e,t,r)=>{try{await o(this.#n(e),t),r.invoke({})}catch(e){r.invoke(e.message??"Unknown error in user-defined `applyAssetToBlock`")}}:null,i?async e=>{i(e)}:null,a?async e=>{a(e)}:null)),this.#o(e.id,e)}addLocalSource(e,t,r,n){ie(this.#e.addLocalAssetSource(e,t??[],r?async(e,t)=>{try{const n=await r(this.#n(e));t.invoke(n)}catch(e){t.invoke(e.message??"Unknown error in user-defined `applyAsset`")}}:null,n?async(e,t,r)=>{try{await n(this.#n(e),t),r.invoke({})}catch(e){r.invoke(e.message??"Unknown error in user-defined `applyAssetToBlock`")}}:null))}removeSource(e){ie(this.#e.removeAssetSource(e)),this.#i(e)}findAllSources(){return ma(this.#e.findAllAssetSources())}findAssets(e,t){return new Promise(((r,n)=>{let o=t?.tags??[];Array.isArray(o)||(o=[o]);const i={perPage:t?.perPage??0,page:t?.page??0,query:t?.query??"",tags:o,groups:t?.groups??[],excludeGroups:t?.excludeGroups??[],locale:t?.locale??"",sortingOrder:t?.sortingOrder??"None",sortKey:t?.sortKey??"",sortActiveFirst:t?.sortActiveFirst??!1};this.#e.findAssetSourceAssets(e,i,(e=>{try{const t=ie(e);r({...t,nextPage:-1===t.nextPage?void 0:t.nextPage})}catch(e){n(e)}}))}))}#n(e){const t={...e};return 0===t.groups?.length&&delete t.groups,t.locale||delete t.locale,t.label||delete t.label,0===t.tags?.length&&delete t.tags,t.credits?.name||t.credits?.url?t.credits.url||delete t.credits.url:delete t.credits,t.license?.name||t.license?.url?t.license.url||delete t.license.url:delete t.license,t.utm?.source||t.utm?.medium?(t.utm.source||delete t.utm.source,t.utm.medium||delete t.utm.medium):delete t.utm,t}async getGroups(e){return ae((t=>this.#e.getAssetSourceGroups(e,t))).then((e=>ma(e)))}getSupportedMimeTypes(e){return ma(ie(this.#e.getAssetSourceSupportedMimeTypes(e)))}getCredits(e){const t=ie(this.#e.getAssetSourceCredits(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}getLicense(e){const t=ie(this.#e.getAssetSourceLicense(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}canManageAssets(e){return!!js.get(this.#e)?.get(e)?.canManageAssets}addAssetToSource(e,t){ie(this.#e.addAssetToSource(e,t))}removeAssetFromSource(e,t){ie(this.#e.removeAssetFromSource(e,t))}#o(e,t){js.has(this.#e)||js.set(this.#e,new Map),t.canManageAssets&&console.warn(`\nDEPRECATION WARNING:\n\n'canManageAssets' flag was found for asset source with the id '${e}'.\n\nThis flag is deprecated and will be removed in the next version. If you have used it to control if an upload buttons is rendered in the asset library, use the 'canAdd' options on an asset library entry. See documentation here: https://img.ly/docs/cesdk/ui/guides/customize-asset-library/`),js.get(this.#e).set(e,{canManageAssets:t.canManageAssets})}#i(e){js.get(this.#e)?.delete(e)}async apply(e,t){const r=(e,t)=>new Promise(((r,n)=>{this.#e.applyAssetSourceAsset(e,Xs(t,e),(e=>{try{const t=ie(e);this.#e.isValid(t)?r(t):r(void 0)}catch(e){n(e)}}))}));if(this.#t.size>0){return Array.from(this.#t).reduce(((e,t)=>(r,n)=>t(r,n,e)),r)(e,t)}return r(e,t)}async applyToBlock(e,t,r){const n=(e,t,r)=>ae((n=>this.#e.applyAssetSourceAssetToBlock(e,Xs(t,e),r,n)));if(this.#r.size>0){return Array.from(this.#r).reduce(((e,t)=>(r,n,o)=>t(r,n,o,e)),n)(e,t,r)}return n(e,t,r)}async unstable_applyProperty(e,t,r){return ae((n=>this.#e.unstable_applyAssetSourceProperty(e,Xs(t,e),r,n)))}async defaultApplyAsset(e){return new Promise(((t,r)=>{this.#e.defaultApplyAsset(Xs(e,""),(e=>{try{const r=ie(e);this.#e.isValid(r)?t(r):t(void 0)}catch(e){r(e)}}))}))}async defaultApplyAssetToBlock(e,t){return ae((r=>this.#e.defaultApplyAssetToBlock(Xs(e,""),t,r)))}onAssetSourceAdded=e=>{const t=this.#e.subscribeToAssetSourceAdded(e);return()=>{this.#e.isDeleted()||ie(this.#e.unsubscribe(t))}};onAssetSourceRemoved=e=>{const t=this.#e.subscribeToAssetSourceRemoved(e);return()=>{this.#e.isDeleted()||ie(this.#e.unsubscribe(t))}};onAssetSourceUpdated=e=>{const t=this.#e.subscribeToAssetSourceUpdated(e);return()=>{this.#e.isDeleted()||ie(this.#e.unsubscribe(t))}};assetSourceContentsChanged(e){ie(this.#e.assetSourceContentsChanged(e))}dispose(){js.delete(this.#e)}};function Xs(e,t){return"context"in e&&e.context.sourceId===t&&"active"in e?e:{...e,active:e.active??!1,context:{sourceId:t}}}var Ys,Ks,Qs,Zs,Js=(e=>(e[e.Information=0]="Information",e[e.Warning=1]="Warning",e[e.Error=2]="Error",e))(Js||{}),eu=(e=>(e[e.Free=0]="Free",e[e.VerticalStack=1]="VerticalStack",e[e.HorizontalStack=2]="HorizontalStack",e[e.DepthStack=3]="DepthStack",e))(eu||{});Qs=[ne],Ks=[ne],Ys=[ne];var tu,ru,nu,ou,iu,au,su=class{constructor(e){g(Zs,5,this),v(this,"ubique"),v(this,"notificationStream",(e=>{const t=this.ubique.addEventCallback("NotificationEvent",(t=>e({type:Js[t.type],i18n:t.i18n})));return()=>{t.dispose(),t.delete()}})),v(this,"designElementLifecycleStream",(e=>t=>{const r=this.ubique.addEventCallback(e,t);return()=>{r.dispose(),r.delete()}})),v(this,"historyStream",(e=>{const t=this.ubique.addEventCallback("HistoryUpdatedEvent",e);return()=>{t.dispose(),t.delete()}})),this.ubique=e.getInternalAPI()}dispose(){this.ubique.delete()}setErrorCallback(e,t){this.ubique.setErrorCallback(e,t)}getSelectedText(){return ie(this.ubique.getSelectedText())}hasComponent(e,t){return ie(this.ubique.hasComponent(e,t))}getValue(e,t,r){return ie(this.ubique.getValue(e,t,r))}execute(e,t){let r;const n=new Promise(((n,o)=>{r=this.ubique.ubqExecute(e,t,(e=>{try{const t=ie(e);n(t)}catch(e){o(e)}}))}));return ie(r),n}sendKey(e){return this.execute("ubq/inputs/keyboardkey",function(e){const t={key:255,characters:e.key,shiftIsHeld:e.shiftKey,commandIsHeld:e.metaKey||e.ctrlKey,optionIsHeld:e.altKey,timestamp:Date.now()};switch(e.key.toUpperCase()){case"0":t.key=0;break;case"1":t.key=1;break;case"2":t.key=2;break;case"3":t.key=3;break;case"4":t.key=4;break;case"5":t.key=5;break;case"6":t.key=6;break;case"7":t.key=7;break;case"8":t.key=8;break;case"9":t.key=9;break;case"A":t.key=10;break;case"B":t.key=11;break;case"C":t.key=12;break;case"D":t.key=13;break;case"E":t.key=14;break;case"F":t.key=15;break;case"G":t.key=16;break;case"H":t.key=17;break;case"I":t.key=18;break;case"J":t.key=19;break;case"K":t.key=20;break;case"L":t.key=21;break;case"M":t.key=22;break;case"N":t.key=23;break;case"O":t.key=24;break;case"P":t.key=25;break;case"Q":t.key=26;break;case"R":t.key=27;break;case"S":t.key=28;break;case"T":t.key=29;break;case"U":t.key=30;break;case"V":t.key=31;break;case"W":t.key=32;break;case"X":t.key=33;break;case"Y":t.key=34;break;case"Z":t.key=35;break;case" ":t.key=42;break;case"ESCAPE":t.key=43,t.characters="";break;case"BACKSPACE":t.key=40,t.characters="";break;case"DELETE":t.key=44,t.characters="";break;case"ENTER":t.key=41,t.characters=t.shiftIsHeld?"\u2028":"\n";break;case"CONTROL":t.key=45,t.characters="";break;case"ALT":t.key=46,t.characters="";break;case"SHIFT":t.key=47,t.characters="";break;case"ARROWLEFT":t.key=36,t.characters="";break;case"ARROWRIGHT":t.key=37,t.characters="";break;case"ARROWUP":t.key=38,t.characters="";break;case"ARROWDOWN":t.key=39,t.characters="";break;case"DEAD":t.key=255,t.characters=""}return t}(e))}changeSceneLayout(e,t,r,n){return this.execute("ubq/scene/changeLayout",[e,eu[t],r,n])}};y(Zs=d(null),1,"getSelectedText",Qs,su),y(Zs,1,"hasComponent",Ks,su),y(Zs,1,"getValue",Ys,su),m(Zs,su),ou=[ne],nu=[oe],ru=[ne],tu=[oe];var VariableAPI=class{constructor(e){g(au,5,this),S(this,iu),k(this,iu,e)}findAll(){return ma(E(this,iu).findAllVariables())}setString(e,t){return Z("key",e,z()),Z("value",t,z()),ie(E(this,iu).setVariableString(e,t))}getString(e){return Z("key",e,z()),ie(E(this,iu).getVariableString(e))}remove(e){return Z("key",e,z()),ie(E(this,iu).removeVariable(e))}};au=d(null),iu=new WeakMap,y(au,1,"findAll",ou,VariableAPI),y(au,1,"setString",nu,VariableAPI),y(au,1,"getString",ru,VariableAPI),y(au,1,"remove",tu,VariableAPI),m(au,VariableAPI);var uu=!1;var cu="https://api.img.ly/activate";var lu,du,fu,hu=(lu=F(),fu=null!=lu?e(o(lu)):{},((e,o,a,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let u of n(o))i.call(e,u)||u===a||t(e,u,{get:()=>o[u],enumerable:!(s=r(o,u))||s.enumerable});return e})(!du&&lu&&lu.__esModule?fu:t(fu,"default",{value:lu,enumerable:!0}),lu)),pu="../../cesdk-v1.45.0-XHZXX7DG.data",mu="../../cesdk-v1.45.0-WHMIY2P7.wasm",gu=hu.default,yu=!("undefined"==typeof window||!window.document||!window.document.createElement)&&navigator&&navigator.userAgent||"",vu=(yu.indexOf("Edge"),yu.match(/msie|trident/i),/\b(iPad|iPhone|iPod)\b/.test(yu)&&/WebKit/.test(yu)&&!/Edge/.test(yu)&&("undefined"==typeof window||!("MSStream"in window))),bu=(e,t)=>{if(null!=t){return[t,e.split("/").pop()].join("")}return new URL(e,window.location.origin)};function wu(){try{return new WebAssembly.Memory({initial:Eu(vu?512:32),maximum:Eu(2048)})}catch(e){return new WebAssembly.Memory({initial:Eu(32),maximum:Eu(2048)})}}function Eu(e){return 1024*e*1024/65536}async function Su(e,t){const{core:r}=t,n=t.logger,o=bu(mu,r.baseURL).toString(),i=bu(pu,r.baseURL).toString(),a=/electron/i.test(navigator.userAgent),s=function(e,t=fetch){if(!e.license)throw new Error("Missing license key in config");return e.license.length<128?t(cu,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:e.license,userId:e.userId})}).then((e=>{if(e.ok)return e.json();throw new Error("Unfortunately we are experiencing a server down time and your License key cannot be validated. We're already working on a fix and will restore service soon. Should services not restore within the hour, kindly get in touch with our support team.")})).then((e=>{if("valid"===e.status)return e.license;throw"expired"===e.status?new Error("Thanks for using IMG.LY for creative editing. Please note that your license file or commercial use is expired. Please get in touch with our sales team to discuss extension of your commercial license."):new Error("The License Key (API Key) you are using to access the IMG.LY SDK is invalid. Please ensure that you are using the license key tied to your subscription and get in touch with our support team.")})):Promise.resolve(e.license)}(t),u=a?await fetch(i,{credentials:"same-origin"}).then((e=>e.arrayBuffer())).then((e=>function(t,r){if(t!==i)return null;if(r===e.byteLength)return e;throw new Error(`Attempt to get preloaded package of unknown name or size: ${t} ${r}`)})):void 0;return new Promise(((r,a)=>{const c={getPreloadedPackage:u,locateFile:(e,t)=>e.endsWith(".wasm")?o:e.endsWith(".data")?i:t+e,print:e=>{e&&"undefined"!==e&&n(e,"Info")},printErr:e=>{e&&"undefined"!==e&&n(e,"Error")},logReadFiles:!1,printWithColors:!0,wasmMemory:wu()};gu(c).then((async n=>{n.specialHTMLTargets["!canvas"]=e;n.emscripten_ubq_settings_forceWebGL1=vu||!!t?.forceWebGL1;const o=ie(n.createEngine("!canvas",t.audioOutput??"auto"));!function(e,t){if(!t)throw new Error("Missing license key");ie(e.unlockWithLicense(t))}(o,await s),function(e,t){const r=new EditorAPI(e),n=new AssetAPI(e);if(r.setRole(t.role??"Creator"),uu){const t=new su(e);t.execute("cesdk/getVersionInfo").then((e=>console.debug(e))),t.execute("cesdk/getCapabilitiesInfo").then((e=>console.debug(e))),t.dispose()}r.setSettingString("basePath",t.baseURL),r.setSettingBool("showBuildVersion",uu||!1),t.featureFlags?.preventScrolling&&(r.setSettingBool("touch/singlePointPanning",!1),r.setSettingBool("touch/dragStartCanSelect",!1)),n.addLocalSource("ly.img.text"),function(){uu&&(r.setSettingBool("features/hspSelectiveAdjustmentsEnabled",!1),r.setSettingBool("features/templatingEnabled",!0));const e=!!t.featureFlags?.singlePageMode;r.setSettingBool("features/singlePageModeEnabled",e),r.setSettingBool("features/effectsEnabled",!0)}(),function(){const t=new VariableAPI(e);(uu||"undefined"!=typeof window&&window.Cypress)&&(t.setString("company_name","img.ly"),t.setString("first_name","Charly"),t.setString("last_name","Williams"),t.setString("address","742 Evergreen Terrace"),t.setString("city","Springfield"))}(),r.startTracking(t.license,t.userId??"")}(o,t),r(o)})).catch(a)}))}globalThis.ubq_browserTabHidden=!0;var ku,_u,Cu={value:()=>"undefined"==typeof document||"visible"===document.visibilityState,subscribe(e){if("undefined"==typeof document)return()=>{};{const t=()=>{e("visible"===document.visibilityState)};return document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}}}};if((_u=ku||(ku={})).start=function(e){return{...e,msg:"exportVideo"}},_u.abort=function(){return{msg:"exportVideoAbort"}},_u.finished=function(e){return{...e,msg:"exportVideoFinished"}},_u.error=function(e){return{...e,msg:"exportVideoError"}},_u.progress=function(e){return{...e,msg:"exportVideoProgress"}},_u.log=function(e){return{...e,msg:"exportLog"}},"undefined"!=typeof WorkerGlobalScope){const e=function(e){let t=P;const r=function(e,t){const r=new Set;function n(n){return r.add(n),e?.(((e,...t)=>{n(e);for(const e of t)n(e)})),()=>{r.delete(n),t?.()}}return n.emit=function(e,...t){for(const n of r){n(e);for(const e of t)n(e)}},n.handlers=r,n}();return{subscribe:r,value:()=>(t===P&&(t=e()),t),update(e){t=e,r.emit(t)}}}((()=>!0)),t=new AbortController;self.onmessage=async({data:r})=>{const n=(e,t)=>{self.postMessage(ku.log({logLevel:t,message:e}))};"setVisibility"===r.msg?e.update(r.visible):"exportVideo"===r.msg?async function(e,t,r,n,o,i){let a,s,u=0,c=null;const l=i.visibility??Cu,d=i.inactivityTimeout,f=l.subscribe((()=>{null!==c&&(c=Date.now()),globalThis.ubq_browserTabHidden=!l.value()}));let h=null;function p(){clearTimeout(s),f(),h?.()}try{let f=function(){!0===l.value()&&null!==c&&Date.now()-c>d?a(new Error("Video export timed out due to inactivity.")):(u<10&&g.update(),s=setTimeout(f,1))};const m=new OffscreenCanvas(64,64),g=await Su(m,{...e,audioOutput:"none"}),y=new SceneAPI(g),v=new BlockAPI(g),b=new EditorAPI(g);if(h=()=>{g.delete()},function(e,t){for(const[r,n]of t)switch(e.getSettingType(r)){case"Bool":e.setSettingBool(r,n);break;case"Int":e.setSettingInt(r,n);break;case"Float":e.setSettingFloat(r,n);break;case"String":e.setSettingString(r,n);break;case"Color":e.setSettingColor(r,n);break;case"Enum":{const t=r,o=n;e.setSettingEnum(t,o)}}}(b,t),o?.trackingMetadata&&b.setTrackingMetadata(o.trackingMetadata),o?.uriResolver){let e=function(e,r){try{return t(e,r)}catch(t){return console.warn(`Error during execution of URI resolver: ${t}.\nMake sure the url resolver function does not reference any external variables. Falling back to default URI resolver.`),r(e)}};const t=(0,eval)(`'use strict';(${o.uriResolver})`);b.setURIResolver(e)}if(o?.scopes)for(const[e,t]of Object.entries(o.scopes))b.setGlobalScope(e,t);o?.buffers&&b.restoreBuffers(o.buffers);const w=await y.loadFromString(r),E=n.block?v.getDuration(n.block):v.getTotalSceneDuration(y.get());f();const S=await new Promise(((t,r)=>{a=r,e.abortSignal?.addEventListener("abort",(()=>{r(new Error("AbortSignal received"))})),g.exportVideoToBuffer(n.block??w,n.timeOffset??0,n.duration??E,D.Mp4,((e,t,r)=>{u=e-t,c=Date.now(),i?.onProgress?.(e,t,r)}),(e=>{"error"in e?r(e.error):t(e)}),{h264Profile:n.h264Profile??77,h264Level:n.h264Level??52,framerate:n.framerate??30,videoBitrate:n.videoBitrate??0,audioBitrate:n.audioBitrate??0,useTargetSize:void 0!==n.width&&void 0!==n.height,targetWidth:n.width??0,targetHeight:n.height??0})})),k=new Uint8Array(S.byteLength);return k.set(S),p(),k}catch(e){throw p(),e}}({...r.config,logger:n,abortSignal:t.signal},r.engineSettings,r.sceneString,r.exportOptions,r.workerOptions,{onProgress:(e,t,r)=>{self.postMessage(ku.progress({renderedFrames:e,encodedFrames:t,totalFrames:r}))},visibility:e,inactivityTimeout:r.inactivityTimeout}).then((e=>{self.postMessage(ku.finished({data:e,mimeType:D.Mp4}))}),(e=>{self.postMessage(ku.error({error:e}))})):"exportVideoAbort"===r.msg&&t.abort()}}
2
- /*! Bundled license information:
3
-
4
- ieee754/index.js:
5
- (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
6
-
7
- buffer/index.js:
8
- (*!
9
- * The buffer module from node.js, for the browser.
10
- *
11
- * @author Feross Aboukhadijeh <https://feross.org>
12
- * @license MIT
13
- *)
14
- */