@sketch-hq/sketch-web-renderer 12.0.1 → 12.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/web-renderer/index.js +1 -1
- package/out/web-renderer/ts/utils/WasmModule.d.ts +1 -1
- package/out/web-renderer/wasm/Debug/web-renderer-debug.js +2885 -4128
- package/out/web-renderer/wasm/Debug/web-renderer-debug.mjs +2886 -4126
- package/out/web-renderer/wasm/Release/web-renderer-release.js +4068 -18
- package/out/web-renderer/wasm/Release/web-renderer-release.mjs +4068 -12
- package/out/web-renderer/{web-renderer-debug-bbc5d18c.js → web-renderer-debug-6a730e1e.js} +544 -825
- package/out/web-renderer/web-renderer-debug-ed8aaadf.js +1 -0
- package/out/web-renderer/web-renderer-release-ada2c2b2.js +1 -0
- package/out/web-renderer/{web-renderer-release-60255953.js → web-renderer-release-fd3e6306.js} +480 -787
- package/package.json +4 -3
- package/out/web-renderer/index-eb861739.js +0 -4742
- package/out/web-renderer/index-edb4bfa7.js +0 -1
- package/out/web-renderer/web-renderer-debug-35622728.js +0 -1
- package/out/web-renderer/web-renderer-release-dfe0d59b.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t,{useRef as e,useLayoutEffect as n,useCallback as r,createContext as o,useContext as i,useReducer as a,useMemo as s,useEffect as u,useState as c}from"react";function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function d(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(t,e,n){return e=m(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return d(t)}(t,b()?Reflect.construct(e,n||[],m(t).constructor):e.apply(t,n))}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,E(r.key),r)}}function v(t,e,n){return e&&p(t.prototype,e),n&&p(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function g(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=L(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function m(t){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},m(t)}function y(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&C(t,e)}function b(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(b=function(){return!!t})()}function w(){w=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new F(r||[]);return o(a,"_invoke",{value:R(t,n,s)}),a}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",f="suspendedYield",p="executing",v="completed",g={};function m(){}function y(){}function b(){}var C={};c(C,a,(function(){return this}));var P=Object.getPrototypeOf,E=P&&P(P(I([])));E&&E!==n&&r.call(E,a)&&(C=E);var x=b.prototype=m.prototype=Object.create(C);function L(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function M(t,e){function n(o,i,a,s){var u=d(t[o],t,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function R(e,n,r){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=S(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var c=d(e,n,r);if("normal"===c.type){if(o=r.done?v:f,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=v,r.method="throw",r.arg=c.arg)}}}function S(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function W(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(W,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return y.prototype=b,o(x,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:y,configurable:!0}),y.displayName=c(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},L(M.prototype),c(M.prototype,s,(function(){return this})),e.AsyncIterator=M,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new M(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(x),c(x,u,"Generator"),c(x,a,(function(){return this})),c(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=I,F.prototype={constructor:F,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function C(t,e){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},C(t,e)}function P(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||L(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function x(t){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x(t)}function L(t,e){if(t){if("string"==typeof t)return l(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function M(t){var e="function"==typeof Map?new Map:void 0;return M=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(b())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&C(o,n.prototype),o}(t,arguments,m(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),C(n,t)},M(t)}var R=function(t,e){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},R(t,e)};function S(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}R(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var W=function(){return W=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},W.apply(this,arguments)};function T(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function F(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function I(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function A(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}var k=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function G(t){return t.toLowerCase().replace(/.*angle ?\((.+)\)(?: on vulkan [0-9.]+)?$/i,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"").replace(/(?:vulkan|opengl) \d+\.\d+(?:\.\d+)?(?: \((.*)\))?/,"$1")}var D="undefined"==typeof window,U=function(){if(!D){var t=window.navigator,e=t.userAgent,n=t.platform,r=t.maxTouchPoints,o=/(iphone|ipod|ipad)/i.test(e),i="iPad"===n||"MacIntel"===n&&r>0&&!window.MSStream;return{isIpad:i,isMobile:/android/i.test(e)||o||i,isSafari12:/Version\/12.+Safari/.test(e)}}}();function B(t,e,n){if(!n)return[e];var r,o=function(t){var e=t.createShader(35633),n=t.createShader(35632),r=t.createProgram();if(n&&e&&r){t.shaderSource(e,"\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n "),t.shaderSource(n,"\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n "),t.compileShader(e),t.compileShader(n),t.attachShader(r,e),t.attachShader(r,n),t.linkProgram(r),t.detachShader(r,e),t.detachShader(r,n),t.deleteShader(e),t.deleteShader(n),t.useProgram(r);var o=t.createBuffer();t.bindBuffer(34962,o),t.bufferData(34962,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);var i=t.getAttribLocation(r,"aPosition");t.vertexAttribPointer(i,3,5126,!1,0,0),t.enableVertexAttribArray(i),t.clearColor(1,1,1,1),t.clear(16384),t.viewport(0,0,1,1),t.drawArrays(4,0,3);var a=new Uint8Array(4);return t.readPixels(0,0,1,1,6408,5121,a),t.deleteProgram(r),t.deleteBuffer(o),a.join("")}}(t),i="801621810",a="8016218135",s="80162181161",u=(null==U?void 0:U.isIpad)?[["a7",s,12],["a8",a,15],["a8x",a,15],["a9",a,15],["a9x",a,15],["a10",a,15],["a10x",a,15],["a12",i,15],["a12x",i,15],["a12z",i,15],["a14",i,15],["m1",i,15]]:[["a7",s,12],["a8",a,12],["a9",a,15],["a10",a,15],["a11",i,15],["a12",i,15],["a13",i,15],["a14",i,15]];return"80162181255"===o?r=u.filter((function(t){return P(t,3)[2]>=14})):(r=u.filter((function(t){return P(t,2)[1]===o}))).length||(r=u),r.map((function(t){var e=P(t,1)[0];return"apple ".concat(e," gpu")}))}var O=function(t){function e(t){var n;return f(this,e),n=h(this,e,[t]),Object.setPrototypeOf(d(n),(this instanceof e?this.constructor:void 0).prototype),n}return y(e,M(Error)),v(e)}(),z=[],Z=[];function _(t,e){if(t===e)return 0;var n=t;t.length>e.length&&(t=e,e=n);for(var r=t.length,o=e.length;r>0&&t.charCodeAt(~-r)===e.charCodeAt(~-o);)r--,o--;for(var i,a=0;a<r&&t.charCodeAt(a)===e.charCodeAt(a);)a++;if(o-=a,0===(r-=a))return o;for(var s,u,c=0,l=0,d=0;l<r;)Z[l]=t.charCodeAt(a+l),z[l]=++l;for(;d<o;)for(i=e.charCodeAt(a+d),s=d++,c=d,l=0;l<r;l++)u=i===Z[l]?s:s+1,s=z[l],c=z[l]=s>c?u>c?c+1:u:u>s?s+1:u;return c}function j(t){return null!=t}var N,H,V=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.mobileTiers,n=void 0===e?[0,15,30,60]:e,r=t.desktopTiers,o=void 0===r?[0,15,30,60]:r,i=t.override,a=void 0===i?{}:i,s=t.glContext,u=t.failIfMajorPerformanceCaveat,c=void 0!==u&&u,l=t.benchmarksURL,d=void 0===l?"https://unpkg.com/detect-gpu@5.0.25/dist/benchmarks":l;return A(void 0,void 0,void 0,w().mark((function t(){var e,r,i,u,l,h,f,p,v,m,y,b,C,E,x,L,M,R,S,W,T,F,I,z;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e={},!D){t.next=3;break}return t.abrupt("return",{tier:0,type:"SSR"});case 3:if(r=a.isIpad,i=void 0===r?!!(null==U?void 0:U.isIpad):r,u=a.isMobile,l=void 0===u?!!(null==U?void 0:U.isMobile):u,h=a.screenSize,f=void 0===h?window.screen:h,p=a.loadBenchmarks,v=void 0===p?function(t){return A(void 0,void 0,void 0,w().mark((function e(){var n;return w().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(d,"/").concat(t)).then((function(t){return t.json()}));case 2:if(n=e.sent,!(parseInt(n.shift().split(".")[0],10)<4)){e.next=5;break}throw new O("Detect GPU benchmark data is out of date. Please update to version 4x");case 5:return e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)})))}:p,m=a.renderer,y=function(t,e,n,r,o){return{device:o,fps:r,gpu:n,isMobile:l,tier:t,type:e}},C="",!m){t.next=11;break}m=G(m),b=[m],t.next=18;break;case 11:if(E=s||function(t){var e={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:arguments.length>1&&void 0!==arguments[1]&&arguments[1],powerPreference:"high-performance",stencil:!1};t&&delete e.powerPreference;var n=window.document.createElement("canvas"),r=n.getContext("webgl",e)||n.getContext("experimental-webgl",e);return null!=r?r:void 0}(null==U?void 0:U.isSafari12,c),E){t.next=14;break}return t.abrupt("return",y(0,"WEBGL_UNSUPPORTED"));case 14:if((x=E.getExtension("WEBGL_debug_renderer_info"))&&(m=E.getParameter(x.UNMASKED_RENDERER_WEBGL)),m){t.next=17;break}return t.abrupt("return",y(1,"FALLBACK"));case 17:C=m,m=G(m),b=function(t,e,n){return"apple gpu"===e?B(t,e,n):[e]}(E,m,l);case 18:return t.next=20,Promise.all(b.map((function(t){var n;return A(this,void 0,void 0,w().mark((function r(){var o,a,s,u,c,d,h,p,m,y,b,C,E,x,L,M,R,S,W,T,F,I,A,k,G,D,U,B;return w().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(o=function(t){for(var e=0,n=l?["adreno","apple","mali-t","mali","nvidia","powervr","samsung"]:["intel","apple","amd","radeon","nvidia","geforce"];e<n.length;e++){var r=n[e];if(t.includes(r))return r}}(t)){r.next=3;break}return r.abrupt("return");case 3:return a="".concat(l?"m":"d","-").concat(o).concat(i?"-ipad":"",".json"),s=e[a]=null!==(n=e[a])&&void 0!==n?n:v(a),r.prev=4,r.next=7,s;case 7:u=r.sent,r.next=15;break;case 10:if(r.prev=10,r.t0=r.catch(4),!(r.t0 instanceof O)){r.next=14;break}throw r.t0;case 14:return r.abrupt("return");case 15:if(c=function(t){var e,n=(t=t.replace(/\([^)]+\)/,"")).match(/\d+/)||t.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return null!==(e=null==n?void 0:n.join("").replace(/\W|amd/g,""))&&void 0!==e?e:""}(t),(d=u.filter((function(t){return P(t,2)[1]===c}))).length||(d=u.filter((function(e){return P(e,1)[0].includes(t)}))),0!==(h=d.length)){r.next=21;break}return r.abrupt("return");case 21:p=t.split(/[.,()\[\]/\s]/g).sort().filter((function(t,e,n){return 0===e||t!==n[e-1]})).join(" "),y=h>1?d.map((function(t){return[t,_(p,t[2])]})).sort((function(t,e){return P(t,2)[1]-P(e,2)[1]}))[0][0]:d[0],b=P(y,5),C=b[0],E=b[4],x=Number.MAX_VALUE,L=window,M=L.devicePixelRatio,R=f.width*M*f.height*M,S=g(E);try{for(S.s();!(W=S.n()).done;)T=W.value,F=P(T,2),I=F[0],A=F[1],k=I*A,(G=Math.abs(R-k))<x&&(x=G,m=T)}catch(t){S.e(t)}finally{S.f()}if(m){r.next=28;break}return r.abrupt("return");case 28:return D=P(m,4),U=D[2],B=D[3],r.abrupt("return",[x,U,C,B]);case 30:case"end":return r.stop()}}),r,null,[[4,10]])})))})));case 20:if(L=t.sent.filter(j).sort((function(t,e){var n=P(t,2),r=n[0],o=void 0===r?Number.MAX_VALUE:r,i=n[1],a=P(e,2),s=a[0],u=void 0===s?Number.MAX_VALUE:s,c=a[1];return o===u?i-c:o-u})),L.length){t.next=24;break}return M=k.find((function(t){return m.includes(t)})),t.abrupt("return",M?y(0,"BLOCKLISTED",M):y(1,"FALLBACK","".concat(m," (").concat(C,")")));case 24:if(R=P(L[0],4),S=R[1],W=R[2],T=R[3],-1!==S){t.next=27;break}return t.abrupt("return",y(0,"BLOCKLISTED",W,S,T));case 27:for(F=l?n:o,I=0,z=0;z<F.length;z++)S>=F[z]&&(I=z);return t.abrupt("return",y(I,"BENCHMARK",W,S,T));case 31:case"end":return t.stop()}}),t)})))},J=function(t){function e(n,r,o){var i=this.constructor,a=t.call(this,"(".concat(n,") ").concat(r))||this;return a.code=n,a.cause=o,a.name=e.name,Object.setPrototypeOf(a,i.prototype),a}return S(e,t),e}(Error);function K(t){return void 0!==t}!function(t){t.debug="debug",t.release="release"}(N||(N={})),function(t){t.Fit="Fit",t.FillWidth="FillWidth",t.ActualSize="ActualSize"}(H||(H={}));var Y=function(){function t(){this.listeners={}}return t.prototype.on=function(t,e){var n,r;this.listeners[t]=null!==(n=this.listeners[t])&&void 0!==n?n:new Set,null===(r=this.listeners[t])||void 0===r||r.add(e)},t.prototype.off=function(t,e){var n;null===(n=this.listeners[t])||void 0===n||n.delete(e)},t.prototype.forwardEvent=function(t,e){this.on(e,(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];t.emit.apply(t,I([e],n,!1))}))},t.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=this.listeners[t];(null==r?void 0:r.size)&&r.forEach((function(t){Promise.resolve().then((function(){t.apply(void 0,e)}))}))},t.prototype.detachAllListeners=function(){this.listeners={}},t}(),X=function(){function t(t){void 0===t&&(t=!1),this.removeListenerCallbacks=[],this.disabled=t}return t.prototype.add=function(t,e,n,r){var o=this,i=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];o.disabled||n.apply(void 0,t)};t.addEventListener(e,i,r);var a=function(){t.removeEventListener(e,i,r)};return this.removeListenerCallbacks.push(a),a},t.prototype.dispose=function(){this.removeListenerCallbacks.forEach((function(t){return t()}))},t.prototype.setDisabled=function(t){this.disabled=t},t}(),q={delayedDraw:!0,offscreenCanvas:!1,useDirtyRectsRendering:!0,safariWebGL2:!1,pageBoundariesLimit:!1,canvasLayersEvents:!1},$=function(t){return parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(t)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||!1},Q=/(iPhone|Macintosh|iPad)(.*)(Version)\/(0|[1-9]\d*)\.(0|[1-9]\d*)\.?(0|[1-9]\d*)?/,tt=function(t){if(void 0===t&&(t=window.navigator.userAgent),t.includes("Chrome/")||t.includes("Chromium/")||t.includes("Opera/")||t.includes("Firefox/"))return null;var e=t.match(Q);if(!e)return null;var n=e[1];return"Macintosh"!==n&&"iPad"!==n&&"iPhone"!==n?null:{hardware:n,version:{major:parseInt(e[4])||0,minor:parseInt(e[5])||0,patch:parseInt(e[6])||0}}};function et(t,e){var n;function r(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=setTimeout((function(){t.apply(void 0,r)}),e)}return r.cancel=function(){n&&clearTimeout(n)},r}function nt(t){var e,n,r,o,i,a=null!==(n=null===(e=t.touches)||void 0===e?void 0:e[0])&&void 0!==n?n:null===(r=t.changedTouches)||void 0===r?void 0:r[0];return{x:null!==(o=null==a?void 0:a.clientX)&&void 0!==o?o:t.clientX,y:null!==(i=null==a?void 0:a.clientY)&&void 0!==i?i:t.clientY}}function rt(t,e,n){return Math.max(e,Math.min(n,t))}function ot(t){return Boolean(window.chrome)&&t.gpu&&/amd\sradeon\s(pro|rx)\s5\d\d\d/gi.test(t.gpu)||tt()&&!q.safariWebGL2?1:"undefined"!=typeof WebGL2RenderingContext?2:1}function it(t){if(!t)return[];for(var e=[],n=0;n<t.size();n++)e.push(t.get(n));return e}function at(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function st(t){var e=W({},t);return Object.keys(e).forEach((function(t){void 0===e[t]&&delete e[t]})),e}function ut(t){return at()?{onTouchEnd:t}:{onClick:t}}var ct=function(t){return 0===(null==t?void 0:t.$$.count.value)?null:t},lt=function(t){function e(e,n){void 0===n&&(n=!1);var r=t.call(this)||this;return r.state={pinchToZoomLastDistance:0,lastGestureScale:1,isCtrlPressed:!1},r.handleGestureStart=function(t){t.preventDefault(),r.state.lastGestureScale=t.scale},r.handleGestureChange=function(t){t.preventDefault();var e=t.scale/r.state.lastGestureScale;r.state.lastGestureScale=t.scale;var n=r.getCorrectPointerPosition(t);r.emitZoomEvent(e,n)},r.handleGestureEnd=function(t){t.preventDefault()},r.updateMousePosition=function(t){r.emit("pointermove",{type:"mouse",position:r.getCorrectPointerPosition(t),button:t.button,touchesCount:0})},r.updateGlobalMousePosition=function(t){r.emit("globalpointermove",{type:"mouse",position:r.getCorrectPointerPosition(t),button:t.button,touchesCount:0})},r.handleTouchStart=function(t){t.preventDefault(),r.handleTouchPinchToZoomStart(t),r.emit("pointerdown",{type:"touch",position:r.getCorrectPointerPosition(t),button:0,touchesCount:t.touches.length})},r.handleMouseDown=function(t){t.ctrlKey||(t.preventDefault(),r.emit("pointerdown",{type:"mouse",position:r.getCorrectPointerPosition(t),button:t.button,touchesCount:0}))},r.handleTouchMove=function(t){r.handleTouchPinchToZoomChange(t),r.emit("pointermove",{type:"touch",position:r.getCorrectPointerPosition(t),button:0,touchesCount:t.touches.length})},r.handleMouseMove=function(t){r.updateMousePosition(t)},r.handleGlobalTouchMove=function(t){r.emit("globalpointermove",{type:"touch",position:r.getCorrectPointerPosition(t),button:0,touchesCount:t.touches.length})},r.handleGlobalMouseMove=function(t){r.updateGlobalMousePosition(t)},r.handleTouchPinchToZoomStart=function(t){var e;!t.touches||(null===(e=t.touches)||void 0===e?void 0:e.length)<2||(r.state.pinchToZoomLastDistance=r.calculateDistanceBetweenTouches(t.touches[0],t.touches[1]))},r.handleTouchPinchToZoomChange=function(t){var e;if(t.touches&&!((null===(e=t.touches)||void 0===e?void 0:e.length)<2)){var n=r.calculateDistanceBetweenTouches(t.touches[0],t.touches[1]),o=r.getCorrectPointerPosition(t),i=1+.004*(n-r.state.pinchToZoomLastDistance);r.state.pinchToZoomLastDistance=n,r.emitZoomEvent(i,o)}},r.handleTouchEnd=function(t){var e=r.getCorrectPointerPosition(t);r.emit("pointerup",{position:e,type:"touch",button:0,touchesCount:t.touches.length})},r.handleMouseUp=function(t){r.emit("pointerup",{type:"mouse",position:r.getCorrectPointerPosition(t),button:t.button,touchesCount:0})},r.debouncedUpdateMousePosition=et(r.updateMousePosition,40),r.debouncedUpdateGlobalMousePosition=et(r.updateGlobalMousePosition,40),r.handleMouseWheel=function(t){t.preventDefault();var e=t.ctrlKey&&!r.state.isCtrlPressed,n=t.metaKey||e||r.state.isCtrlPressed;if(r.debouncedUpdateMousePosition(t),r.debouncedUpdateGlobalMousePosition(t),n){var o=e?-1:1,i=r.getCorrectPointerPosition(t),a=1+.005*t.deltaY*o;r.emitZoomEvent(a,i)}else r.emit("wheel",{x:-t.deltaX,y:-t.deltaY},{type:"mouse",position:r.getCorrectPointerPosition(t),button:t.button,touchesCount:0})},r.target=e,r.targetBounds=e.getBoundingClientRect(),r.listenersCollector=new X(n),r.addListeners(),r.targetResizeObserver=new ResizeObserver(r.updateTargetBounds.bind(r)),r.targetResizeObserver.observe(r.target),r}return S(e,t),e.prototype.updateTargetBounds=function(){this.targetBounds=this.target.getBoundingClientRect()},e.prototype.addListeners=function(){this.addTouchEventListeners(),this.addMouseEventListeners(),this.addKeyboardEventListeners(),this.addSafariGesturesEventListeners()},e.prototype.addKeyboardEventListeners=function(){var t=this;this.listenersCollector.add(document,"keydown",(function(e){"Control"===e.key&&(t.state.isCtrlPressed=!0)})),this.listenersCollector.add(document,"keyup",(function(e){"Control"===e.key&&(t.state.isCtrlPressed=!1)})),this.listenersCollector.add(document,"contextmenu",(function(e){e.ctrlKey&&(t.state.isCtrlPressed=!1)}))},e.prototype.addMouseEventListeners=function(){this.listenersCollector.add(this.target,"mousedown",this.handleMouseDown),this.listenersCollector.add(this.target,"mousemove",this.handleMouseMove),this.listenersCollector.add(document,"mousemove",this.handleGlobalMouseMove),this.listenersCollector.add(document,"mouseup",this.handleMouseUp),this.listenersCollector.add(this.target,"wheel",this.handleMouseWheel)},e.prototype.addTouchEventListeners=function(){this.listenersCollector.add(this.target,"touchstart",this.handleTouchStart),this.listenersCollector.add(document,"touchmove",this.handleGlobalTouchMove,{passive:!0,capture:!0}),this.listenersCollector.add(this.target,"touchmove",this.handleTouchMove,{passive:!0,capture:!0}),this.listenersCollector.add(document,"touchcancel",this.handleTouchEnd),this.listenersCollector.add(document,"touchend",this.handleTouchEnd)},e.prototype.addSafariGesturesEventListeners=function(){at()||(this.listenersCollector.add(this.target,"gesturestart",this.handleGestureStart,{capture:!0}),this.listenersCollector.add(this.target,"gesturechange",this.handleGestureChange,{capture:!0}),this.listenersCollector.add(this.target,"gestureend",this.handleGestureEnd,{capture:!0}))},e.prototype.clampPointerToTargetBounds=function(t){return{x:t.x-this.targetBounds.x,y:t.y-this.targetBounds.y}},e.prototype.getCorrectPointerPosition=function(t){var e,n={x:0,y:0};if((null===(e=t.touches)||void 0===e?void 0:e.length)>1){var r=t,o=r.touches[0],i=r.touches[1];n={x:(o.clientX+i.clientX)/2,y:(o.clientY+i.clientY)/2}}else n=nt(t);return this.clampPointerToTargetBounds(n)},e.prototype.calculateDistanceBetweenTouches=function(t,e){return Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY)},e.prototype.emitZoomEvent=function(t,e){this.emit("pinchToZoom",t,e)},e.prototype.dispose=function(){this.listenersCollector.dispose(),this.targetResizeObserver.disconnect()},e.prototype.setDisable=function(t){this.listenersCollector.setDisabled(t)},e}(Y),dt=function(t){function e(e){var n=t.call(this)||this;return n.listenersCollector=new X,n.handleKeyUp=function(t){n.emit("keyUp",t.code)},n.target=e,n.addListeners(),n}return S(e,t),e.prototype.addListeners=function(){this.listenersCollector.add(this.target,"keyup",this.handleKeyUp)},e.prototype.dispose=function(){this.listenersCollector.dispose()},e}(Y),ht=function(){function t(t){this.label=t,this.startTime=performance.now(),this.startTimestamp=Date.now()}return t.prototype.measure=function(){return{duration:performance.now()-this.startTime,end:Date.now(),start:this.startTimestamp,id:this.label}},t.prototype.printMeasurement=function(){var t=this.measure().duration;if(t<1e3){var e=t.toFixed(2);return"[Performance] ".concat(this.label," -> ").concat(e," ms")}var n=(t/1e3).toFixed(2);return"[Performance] ".concat(this.label," -> ").concat(n," s")},t}();function ft(t){setTimeout((function(){t()}),0)}var pt=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.logDebug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.emit.apply(this,I(["log","debug"],t,!1))},e.prototype.logWarning=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.emit.apply(this,I(["log","warn"],t,!1))},e.prototype.logError=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.emit.apply(this,I(["log","error"],t,!1))},e}(Y)),vt=function(t,o){var i=e(t);i.current=t;var a=e((function(){}));return n((function(){var t=et((function(){i.current()}),o);return a.current=t,function(){t.cancel()}}),[o]),r((function(){return a.current()}),[])},gt=function(t){function e(e){var n,r=this;return(r=t.call(this)||this).listenersCollector=new X,r.size={width:0,height:0},r.pixelRatio=1,r.maxPixelRatio=2,r.handleCanvasResizeObserver=function(t){r.resizeCanvas(t[0].contentRect)},r.resizeCanvas=function(t){var e=t.width,n=t.height;window.requestAnimationFrame((function(){r.setSize(e,n),r.emit("resize",e,n,r.getDevicePixelRatio())}))},r.getCanvasCenterPoint=function(){var t=r.getBoundingClientRect();return{x:t.width/2+t.x,y:t.height/2+t.y}},r.container=e.container,r.canvas=e.canvas,r.maxPixelRatio=null!==(n=e.maxPixelRatio)&&void 0!==n?n:r.maxPixelRatio,r.canvasResizeObserver=new ResizeObserver(r.handleCanvasResizeObserver),r.canvasResizeObserver.observe(r.container),r.listenersCollector.add(window,"orientationchange",r.handleDeviceOrientationChange),r.setSize(r.container.clientWidth,r.container.clientHeight),r}return S(e,t),e.prototype.setSize=function(t,e){this.pixelRatio=this.getDevicePixelRatio(),this.canvas.style.width="".concat(t,"px"),this.canvas.style.height="".concat(e,"px"),this.size.width=t*this.pixelRatio,this.size.height=e*this.pixelRatio,this.canvas.width=this.size.width,this.canvas.height=this.size.height},e.prototype.handleDeviceOrientationChange=function(){this.resizeCanvas({width:this.container.clientWidth,height:this.container.clientHeight})},e.prototype.getDevicePixelRatio=function(){return rt(window.devicePixelRatio,1,this.maxPixelRatio)},e.prototype.getBoundingClientRect=function(){return this.canvas.getBoundingClientRect()},e.prototype.dispose=function(){this.detachAllListeners(),this.canvasResizeObserver.disconnect(),this.listenersCollector.dispose()},e}(Y),mt=function(){function t(t){this.settings=t}return t.prototype.isReleaseMode=function(){return this.settings.mode===N.release},t.prototype.init=function(){return T(this,void 0,void 0,(function(){var t,e,n,r,o,i=this;return F(this,(function(a){switch(a.label){case 0:return[4,this.importModule()];case 1:t=a.sent(),e=t.default,a.label=2;case 2:return a.trys.push([2,4,,5]),n=this,[4,e({FeatureFlags:this.settings.featureFlags,currentWebGLVersion:this.settings.webglVersion,bridge:this.settings.jsBridge,locateFile:function(t){return i.settings.locateFile.replace("{file}",t)}})];case 3:return n.instance=a.sent(),[3,5];case 4:throw r=a.sent(),new J("WASM_ERROR","An error occurred while trying to create the wasm module.",r);case 5:return this.pointerTypeToWASMMap={unset:this.instance.PRUserPointerTypeEnum.Unset,mouse:this.instance.PRUserPointerTypeEnum.Mouse,touch:this.instance.PRUserPointerTypeEnum.Touch},this.prCursorTypeToCSSCursorMap=((o={})[this.instance.PRCursorTypeEnum.Auto.value]="auto",o[this.instance.PRCursorTypeEnum.Default.value]="default",o[this.instance.PRCursorTypeEnum.Pointer.value]="pointer",o[this.instance.PRCursorTypeEnum.Grab.value]="grab",o[this.instance.PRCursorTypeEnum.Grabbing.value]="grabbing",o),this.prototypeResizeModeToWASMMap={Fit:this.instance.PrototypeResizeModeWasmEnum.Fit,FillWidth:this.instance.PrototypeResizeModeWasmEnum.FillWidth,ActualSize:this.instance.PrototypeResizeModeWasmEnum.ActualSize},[2]}}))}))},t.prototype.makeWebGLContext=function(t,e){var n;void 0===e&&(e={});var r=W({antialias:!1,alpha:!1,stencil:!1,depth:!1,powerPreference:"high-performance",preserveDrawingBuffer:!1,desynchronized:!0},e),o=this.instance.GL.createContext(t,r);if(!o)throw new J("WEBGL_ERROR","Unable to create WebGL context. WebGL might be unsupported, disabled, or this device is not able to run WebGL correctly.");var i=null===(n=this.instance.GL.getContext(o))||void 0===n?void 0:n.GLctx;return i&&i.getExtension("WEBGL_debug_renderer_info"),o},t.prototype.createWebGLTextureFromImage=function(t,e){var n=this.instance.GL,r=n.getContext(e);if(!r)throw new Error("Unable to retrieve emscripten WebGL context from handle");var o=r.GLctx;if(!o)throw new Error("WebGL context is null");var i=o.createTexture();o.bindTexture(o.TEXTURE_2D,i),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0);var a=n.getNewId(n.textures);return n.textures[a]=i,o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,t),o.bindTexture(o.TEXTURE_2D,null),a},t.prototype.destroyWebGLContext=function(t){var e;pt.logDebug("Destroying WebGL context");var n=null===(e=this.instance)||void 0===e?void 0:e.GL.getContext(t);if(n){this.instance.GL.deleteContext(t);var r=n.GLctx.getExtension("WEBGL_lose_context");if(r)return r.loseContext(),pt.logDebug("WebGL destroyed"),!0;pt.logError("WEBGL_lose_context not available. Not possible to destroy WebGL context manually.")}else pt.logError("WebGL context not found while trying to destroy it")},t.prototype.importModule=function(){return this.isReleaseMode()?import("./web-renderer-release-dfe0d59b.js"):import("./web-renderer-debug-35622728.js")},t.prototype.mapToCSSCursor=function(t){return this.prCursorTypeToCSSCursorMap[t.value]},t.prototype.mapToPRPointerType=function(t){var e;return null!==(e=this.pointerTypeToWASMMap[t])&&void 0!==e?e:this.instance.PRUserPointerTypeEnum.Unset},t.prototype.mapPointerInfo=function(t){return W(W({},t),{type:this.mapToPRPointerType(t.type)})},t.prototype.mapResizeMode=function(t){return this.prototypeResizeModeToWASMMap[t]},t}();function yt(t){return new Promise((function(e,n){var r=new Image;r.onload=function(){e(r)},r.onerror=function(t){n(t)},r.src=t}))}var bt,wt,Ct,Pt,Et,xt,Lt,Mt,Rt,St,Wt,Tt,Ft,It,At,kt,Gt,Dt,Ut,Bt,Ot,zt=function(){function t(t,e,n){this.canvas=t,this.container=e,this.filePath=n,this.locateFile="/{file}",this.imagesURLFormat="",this.imagesURLMap={},this.fragmentsURLFormat="",this.fragmentsURLMap={},this.backgroundColor={r:1,g:1,b:1,a:1},this.mode=N.release,this.showTilesBorders=!1,this.minimumZoomLevel=5,this.maximumZoomLevel=.01,this.preserveDrawingBuffer=!1,this.featureFlags=q,this.manualInitialization=!1,this.panBoundariesPadding=0,this.selectedArtboard=null,this.initialZoom=null,this.initialPan=null}return t.FromSettings=function(e){return Object.assign(new t(e.canvas,e.container,e.filePath),Object.fromEntries(Object.entries(e).filter((function(t){return void 0!==t[1]}))))},t}(),Zt={png:"image/png",jpg:"image/jpeg",webp:"image/webp",svg:"image/svg+xml",pdf:"application/pdf"};!function(t){t[t.None=0]="None",t[t.Scale=1]="Scale",t[t.Width=2]="Width",t[t.Height=3]="Height"}(bt||(bt={})),function(t){t[t.None=0]="None",t[t.PNG=1]="PNG",t[t.JPG=2]="JPG",t[t.TIFF=3]="TIFF",t[t.WEBP=4]="WEBP",t[t.PDF=5]="PDF",t[t.EPS=6]="EPS",t[t.SVG=7]="SVG",t[t.HEIC=8]="HEIC"}(wt||(wt={})),function(t){t[t.Color=0]="Color",t[t.Gradient=1]="Gradient",t[t.Pattern=2]="Pattern"}(Ct||(Ct={})),function(t){t[t.Fit=0]="Fit",t[t.Fill=1]="Fill",t[t.Stretch=2]="Stretch",t[t.Tile=3]="Tile"}(Pt||(Pt={})),function(t){t[t.Linear=0]="Linear",t[t.Radial=1]="Radial",t[t.Angular=2]="Angular"}(Et||(Et={})),function(t){t[t.Center=0]="Center",t[t.Inside=1]="Inside",t[t.Outside=2]="Outside"}(xt||(xt={})),function(t){t[t.Butt=0]="Butt",t[t.Round=1]="Round",t[t.Square=2]="Square"}(Lt||(Lt={})),function(t){t[t.Miter=0]="Miter",t[t.Round=1]="Round",t[t.Bevel=2]="Bevel"}(Mt||(Mt={})),function(t){t[t.Motion=0]="Motion",t[t.Zoom=1]="Zoom",t[t.Background=2]="Background",t[t.Gaussian=3]="Gaussian"}(Rt||(Rt={})),function(t){t[t.Normal=0]="Normal",t[t.DestAtop=1]="DestAtop",t[t.Clear=2]="Clear",t[t.Source=3]="Source",t[t.Darken=4]="Darken",t[t.Multiply=5]="Multiply",t[t.ColorBurn=6]="ColorBurn",t[t.Lighten=7]="Lighten",t[t.Screen=8]="Screen",t[t.ColorDodge=9]="ColorDodge",t[t.Overlay=10]="Overlay",t[t.SoftLight=11]="SoftLight",t[t.HardLight=12]="HardLight",t[t.Difference=13]="Difference",t[t.Exclusion=14]="Exclusion",t[t.Hue=15]="Hue",t[t.Saturation=16]="Saturation",t[t.Color=17]="Color",t[t.Luminosity=18]="Luminosity",t[t.PlusLighter=19]="PlusLighter",t[t.PlusDarker=20]="PlusDarker"}(St||(St={})),function(t){t[t.Artboard=0]="Artboard",t[t.SymbolMaster=1]="SymbolMaster",t[t.SymbolInstance=2]="SymbolInstance",t[t.Hotspot=3]="Hotspot",t[t.Bitmap=4]="Bitmap",t[t.Group=5]="Group",t[t.Oval=6]="Oval",t[t.Polygon=7]="Polygon",t[t.Rectangle=8]="Rectangle",t[t.ShapeGroup=9]="ShapeGroup",t[t.ShapePath=10]="ShapePath",t[t.Star=11]="Star",t[t.Text=12]="Text",t[t.Triangle=13]="Triangle",t[t.Slice=14]="Slice"}(Wt||(Wt={})),function(t){t[t.Angled=2]="Angled",t[t.InsideArc=4]="InsideArc",t[t.InsideSquare=3]="InsideSquare",t[t.Rounded=0]="Rounded",t[t.Smooth=1]="Smooth"}(Tt||(Tt={})),function(t){t[t.Lowercase=2]="Lowercase",t[t.None=0]="None",t[t.Uppercase=1]="Uppercase"}(Ft||(Ft={})),function(t){t[t.Center=1]="Center",t[t.Justified=3]="Justified",t[t.Left=0]="Left",t[t.Right=2]="Right"}(It||(It={})),function(t){t[t.Top=0]="Top",t[t.Middle=1]="Middle",t[t.Bottom=2]="Bottom"}(At||(At={})),function(t){t[t.LineThrough=2]="LineThrough",t[t.Underline=1]="Underline",t[t.None=0]="None"}(kt||(kt={})),function(t){t[t.Unset=0]="Unset",t[t.Mouse=1]="Mouse",t[t.Touch=2]="Touch"}(Gt||(Gt={})),function(t){t[t.Auto=0]="Auto",t[t.Default=1]="Default",t[t.Pointer=2]="Pointer",t[t.Grab=3]="Grab",t[t.Grabbing=4]="Grabbing"}(Dt||(Dt={})),function(t){t[t.PNG=0]="PNG",t[t.JPG=1]="JPG",t[t.WEBP=2]="WEBP",t[t.PDF=4]="PDF",t[t.SVG=3]="SVG"}(Ut||(Ut={})),function(t){t[t.Screen=0]="Screen",t[t.Overlay=1]="Overlay"}(Bt||(Bt={})),function(t){t[t.Fit=0]="Fit",t[t.FillWidth=1]="FillWidth",t[t.ActualSize=2]="ActualSize"}(Ot||(Ot={}));var _t=function(t){function e(e){var n=t.call(this)||this;return n.status={type:"IDLE"},n.disposed=!1,n.handleCanvasResize=function(t,e,r){var o;null===(o=n.pageCanvasWasm)||void 0===o||o.resize(t,e,r)},n.handleWebGLContextLost=function(){n.setStatus({type:"WEBGL_CONTEXT_LOST"})},n.handlePinchToZoomEvent=function(t,e){var r;null===(r=n.userEventsCollectorWasm)||void 0===r||r.dispatchPinchToZoomEvent(t,e.x,e.y)},n.handleWheelEvent=function(t,e){var r;n.wasmModule&&(null===(r=n.userEventsCollectorWasm)||void 0===r||r.dispatchWheelEvent(t.x,t.y,n.wasmModule.mapPointerInfo(e)))},n.handlePointerDownEvent=function(t){var e;n.wasmModule&&(null===(e=n.userEventsCollectorWasm)||void 0===e||e.dispatchPointerDownEvent(n.wasmModule.mapPointerInfo(t)))},n.handlePointerMoveEvent=function(t){var e;n.wasmModule&&(null===(e=n.userEventsCollectorWasm)||void 0===e||e.dispatchPointerMoveEvent(n.wasmModule.mapPointerInfo(t)))},n.handleGlobalPointerMoveEvent=function(t){var e;n.wasmModule&&(null===(e=n.userEventsCollectorWasm)||void 0===e||e.dispatchGlobalPointerMoveEvent(n.wasmModule.mapPointerInfo(t)))},n.handlePointerUpEvent=function(t){var e;n.wasmModule&&(null===(e=n.userEventsCollectorWasm)||void 0===e||e.dispatchPointerUpEvent(n.wasmModule.mapPointerInfo(t)))},n.settings=zt.FromSettings(e),pt.logDebug("CanvasRenderer JS constructed with settings:",n.settings),n.gestureManager=new lt(n.settings.container),n.canvasManager=new gt({container:n.settings.container,canvas:n.settings.canvas}),n.fetchWorker=new Worker(n.settings.locateFile.replace("{file}","fetch-worker.js")),n.exporterFetchWorker=new Worker(n.settings.locateFile.replace("{file}","fetch-worker.js")),n.settings.manualInitialization||n.init(),n}return S(e,t),e.prototype.addListeners=function(){this.canvasManager.on("resize",this.handleCanvasResize),this.gestureManager.on("wheel",this.handleWheelEvent),this.gestureManager.on("pointerup",this.handlePointerUpEvent),this.gestureManager.on("pointermove",this.handlePointerMoveEvent),this.gestureManager.on("globalpointermove",this.handleGlobalPointerMoveEvent),this.gestureManager.on("pointerdown",this.handlePointerDownEvent),this.gestureManager.on("pinchToZoom",this.handlePinchToZoomEvent),this.settings.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLost)},e.prototype.collectAndEmitDeviceInfo=function(){return T(this,void 0,void 0,(function(){var t;return F(this,(function(e){switch(e.label){case 0:return[4,V()];case 1:return t=e.sent(),this.deviceInfo=W(W({},t),{hardwareConcurrency:navigator.hardwareConcurrency}),this.emit("deviceInfo",this.deviceInfo),[2]}}))}))},e.prototype.detectWebGLVersion=function(){this.webglVersion=ot(this.deviceInfo),pt.logDebug("Using WebGL ".concat(this.webglVersion))},e.prototype.init=function(){return T(this,void 0,void 0,(function(){var t;return F(this,(function(e){switch(e.label){case 0:return this.traceFirstPaint=new ht("FirstPaint"),this.setStatus({type:"INITIALIZING"}),[4,this.collectAndEmitDeviceInfo()];case 1:e.sent(),this.detectWebGLVersion(),e.label=2;case 2:return e.trys.push([2,6,,7]),[4,this.initWasmModule()];case 3:return e.sent(),[4,this.initCanvasRendererWasm()];case 4:return e.sent(),[4,this.setFile(this.settings.filePath)];case 5:return e.sent(),this.settings.selectedArtboard&&this.selectArtboard(this.settings.selectedArtboard),[3,7];case 6:return t=e.sent(),[2,this.fail(t instanceof J?t:new J("ERROR","Unexpected exception initializing the web renderer",t))];case 7:return this.setInitialCameraState(),this.startRendering(),this.addListeners(),[2]}}))}))},e.prototype.setInitialCameraState=function(){var t,e,n,r=null!==this.settings.initialZoom,o=null!==this.settings.initialPan;r||o?(r&&this.setZoom(this.settings.initialZoom||1),o&&this.setPan((null===(t=this.settings.initialPan)||void 0===t?void 0:t.x)||0,(null===(e=this.settings.initialPan)||void 0===e?void 0:e.y)||0,null===(n=this.settings.initialPan)||void 0===n?void 0:n.centerPointInViewport)):this.zoomToFit()},e.prototype.startRendering=function(){var t;this.traceInitialRender=new ht("InitialRender"),this.setStatus({type:"DRAWING_FILE"}),null===(t=this.pageCanvasWasm)||void 0===t||t.startRenderLoop()},e.prototype.createJSBridge=function(){var t=this;return{logDebug:function(t){pt.logDebug("[C++] ".concat(t))},logWarning:function(t){pt.logWarning("[C++] ".concat(t))},logError:function(t){pt.logError("[C++] ".concat(t))},emitMetric:function(e,n,r,o){t.emit("metric",{id:e,start:n,end:r,duration:o})},resolveImageUrl:function(e,n){return t.settings.imagesURLMap&&t.settings.imagesURLMap[e]?t.settings.imagesURLMap[e].replace(":format",n):t.settings.imagesURLFormat?t.settings.imagesURLFormat.replace(":imageId",e).replace(":format",n):(pt.logWarning("Not able to resolve the url for the image with UUID: ".concat(e)),"")},resolveFragmentUrl:function(e){return t.settings.fragmentsURLMap&&t.settings.fragmentsURLMap[e]?t.settings.fragmentsURLMap[e]:t.settings.fragmentsURLFormat?t.settings.fragmentsURLFormat.replace(":fragmentId",e):(pt.logWarning("Not able to resolve the url for the fragment with UUID: ".concat(e)),"")},onDrawComplete:this.handleDrawComplete.bind(this),onAllImagesReady:function(){t.emit("allImagesReady")},onCameraMoveStart:function(){t.emit("cameraMoveStart")},onCameraMoveEnd:function(){t.emit("cameraMoveEnd")},onCameraZoomStart:function(){t.emit("cameraZoomStart")},onCameraZoomEnd:function(){t.emit("cameraZoomEnd")},onCameraZoomChange:function(e){t.emit("cameraZoomChange",e)},onCameraPanChange:function(){var e=t.getPan();t.emit("cameraPanChange",(null==e?void 0:e.x)||0,(null==e?void 0:e.y)||0)},onCursorChange:function(e){var n,r=null===(n=t.wasmModule)||void 0===n?void 0:n.mapToCSSCursor(e);r&&t.emit("cursorChange",r)},fetch:this.handleJSBridgeFetch.bind(this),exporterFetch:this.handleJSBridgeExporterFetch.bind(this),abortFetch:this.handleJSBridgeAbortFetch.bind(this),onLayerClick:function(e){t.emit("layerClick",e)},onLayerMouseHoverChange:function(e){t.emit("layerMouseHoverChange",e)},onSceneChange:function(){t.emit("sceneChange")},onFragmentLoad:function(e){t.emit("fragmentLoad",e)}}},e.prototype.handleJSBridgeExporterFetch=function(t,e){var n=this,r=e.clone(),o=function(e){return T(n,void 0,void 0,(function(){var n,i,a,s,u,c;return F(this,(function(l){if(!this.wasmModule)return[2];if(this.disposed)return[2];if(e.data.url!==t)return[2];switch(e.data.type){case"success":n={statusCode:200,statusText:"OK",contentType:e.data.contentType,isWebGLTexture:!1,emscriptenWebGLTextureHandle:-1,width:0,height:0,buffer:new Uint8Array(e.data.buffer)},r.exec(n);break;case"error":pt.logError("Error while fetching ".concat(t),e.data.error),r.exec({buffer:new Uint8Array(0),statusCode:null!==(a=null===(i=e.data.error)||void 0===i?void 0:i.statusCode)&&void 0!==a?a:500,statusText:null!==(u=null===(s=e.data.error)||void 0===s?void 0:s.statusText)&&void 0!==u?u:"Unknown error",contentType:null!==(c=e.data.contentType)&&void 0!==c?c:"",isWebGLTexture:!1,emscriptenWebGLTextureHandle:0,width:0,height:0})}return this.exporterFetchWorker.removeEventListener("message",o),[2]}))}))};this.exporterFetchWorker.addEventListener("message",o),this.exporterFetchWorker.postMessage({type:"fetch",url:t})},e.prototype.handleJSBridgeFetch=function(t,e){var n=this,r=e.clone(),o=function(e){return T(n,void 0,void 0,(function(){var n,i,a,s,u,c,l,d,h;return F(this,(function(f){switch(f.label){case 0:if(!this.wasmModule)return[2];if(this.disposed)return[2];if(e.data.url!==t)return[2];switch(e.data.type){case"success":return[3,1];case"error":return[3,5]}return[3,6];case 1:return n={statusCode:200,statusText:"OK",contentType:e.data.contentType,isWebGLTexture:!1,emscriptenWebGLTextureHandle:-1,width:0,height:0},/image/.test(e.data.contentType)?(i=new Blob([e.data.buffer]),[4,yt(URL.createObjectURL(i))]):[3,3];case 2:return a=f.sent(),this.wasmModule?(s=this.wasmModule.createWebGLTextureFromImage(a,this.webglCtxHandle),n.buffer=new Uint8Array(0),n.isWebGLTexture=!0,n.emscriptenWebGLTextureHandle=s,n.width=a.width,n.height=a.height,[3,4]):[2];case 3:n.buffer=new Uint8Array(e.data.buffer),f.label=4;case 4:return r.exec(n),[3,7];case 5:return pt.logError("Error while fetching ".concat(t),e.data.error),r.exec({buffer:new Uint8Array(0),statusCode:null!==(c=null===(u=e.data.error)||void 0===u?void 0:u.statusCode)&&void 0!==c?c:500,statusText:null!==(d=null===(l=e.data.error)||void 0===l?void 0:l.statusText)&&void 0!==d?d:"Unknown error",contentType:null!==(h=e.data.contentType)&&void 0!==h?h:"",isWebGLTexture:!1,emscriptenWebGLTextureHandle:0,width:0,height:0}),[3,7];case 6:return[3,7];case 7:return this.fetchWorker.removeEventListener("message",o),[2]}}))}))};this.fetchWorker.addEventListener("message",o),this.fetchWorker.postMessage({type:"fetch",url:t})},e.prototype.handleJSBridgeAbortFetch=function(t){this.fetchWorker.postMessage({type:"abort",url:t})},e.prototype.initWasmModule=function(){var t;return T(this,void 0,void 0,(function(){var e;return F(this,(function(n){switch(n.label){case 0:return this.disposed?[2]:(e=new ht("WasmModuleDownload"),this.wasmModule=new mt({mode:this.settings.mode,locateFile:this.settings.locateFile,jsBridge:this.createJSBridge(),featureFlags:this.settings.featureFlags,webglVersion:this.webglVersion}),[4,null===(t=this.wasmModule)||void 0===t?void 0:t.init()]);case 1:return n.sent(),pt.logDebug(e.printMeasurement()),this.emit("metric",e.measure()),[2]}}))}))},e.prototype.initCanvasRendererWasm=function(){return T(this,void 0,void 0,(function(){var t;return F(this,(function(e){if(this.disposed)return[2];try{if(!this.wasmModule)throw Error("WASM module not initialized");this.webglCtxHandle=this.wasmModule.makeWebGLContext(this.settings.canvas,{preserveDrawingBuffer:this.settings.preserveDrawingBuffer,majorVersion:this.webglVersion}),this.renderTarget=this.wasmModule.instance.RenderTarget.MakeWebGL(this.webglCtxHandle,this.canvasManager.size.width,this.canvasManager.size.height,this.canvasManager.pixelRatio),this.pageCanvasWasm=new this.wasmModule.instance.CanvasRendererWasm(this.renderTarget,{showTilesBorders:this.settings.showTilesBorders})}catch(t){throw new J("WASM_ERROR","An error occurred while trying to create the wasm object.",t)}if(!this.pageCanvasWasm)return[2];if(!(t=this.pageCanvasWasm.getUserEventsCollector()))throw new J("WASM_ERROR","An error occurred while trying to create the user events collector");return this.userEventsCollectorWasm=t,this.pageCanvasWasm.setBackgroundColor(this.settings.backgroundColor.r,this.settings.backgroundColor.g,this.settings.backgroundColor.b,this.settings.backgroundColor.a),this.pageCanvasWasm.setZoomLevels(this.settings.minimumZoomLevel,this.settings.maximumZoomLevel),this.pageCanvasWasm.setPanBoundariesPadding(this.settings.panBoundariesPadding),[2]}))}))},e.prototype.setIsCameraLocked=function(t){var e;null===(e=this.pageCanvasWasm)||void 0===e||e.setIsCameraLocked(t)},e.prototype.setBackgroundColor=function(t){var e;t.r===this.settings.backgroundColor.r&&t.g===this.settings.backgroundColor.g&&t.b===this.settings.backgroundColor.b&&t.a===this.settings.backgroundColor.a||(null===(e=this.pageCanvasWasm)||void 0===e||e.setBackgroundColor(t.r,t.g,t.b,t.a),this.settings.backgroundColor=t)},e.prototype.handleDrawComplete=function(){"DRAWING_FILE"===this.status.type&&(pt.logDebug(this.traceInitialRender.printMeasurement()),this.emit("metric",this.traceInitialRender.measure()),pt.logDebug(this.traceFirstPaint.printMeasurement()),this.emit("metric",this.traceFirstPaint.measure()),this.setStatus({type:"READY"}))},e.prototype.looseWebGLContext=function(){var t;(null===(t=this.wasmModule)||void 0===t?void 0:t.destroyWebGLContext(this.webglCtxHandle))||pt.logWarning("Failed to loose WebGL context"),this.webglCtxHandle=-1},e.prototype.zoomToFit=function(){var t;null===(t=this.pageCanvasWasm)||void 0===t||t.scaleDocumentToFit()},e.prototype.setFile=function(t){return T(this,void 0,void 0,(function(){var e=this;return F(this,(function(n){return this.disposed?[2]:(this.setStatus({type:"LOADING_FILE"}),[2,new Promise((function(n,r){var o;null===(o=e.pageCanvasWasm)||void 0===o||o.setFile(t,(function(t,r,o){e.setStatus({type:"FILE_READY"});var i="".concat(t,"-v").concat("12.0.1");e.emit("fileReady",i,r,o),n()}),(function(){return r(new J("FILE_ERROR","Error encountered while fetching and parsing the file"))}))}))])}))}))},e.prototype.fail=function(t){this.setStatus({type:"FAILURE",code:t.code,message:"".concat(t.toString()).concat(t.cause?"\nWrapped Error: ".concat(t.cause.toString()):"")}),pt.logError(t),t.cause&&pt.logError(t.cause)},e.prototype.setStatus=function(t){"FAILURE"!==this.status.type&&(pt.logDebug("Status transition ".concat(this.status.type," => ").concat(t.type)),this.status=t,this.emit("status",t))},e.prototype.getPRFileCachedData=function(){var t;if(!this.pageCanvasWasm)return null;if((null===(t=this.prFileHandle)||void 0===t?void 0:t.filePath)!==this.settings.filePath){var e=this.pageCanvasWasm.getPRFile();this.prFileHandle={handle:e,filePath:this.settings.filePath,artboards:it(e.getArtboards())}}return this.prFileHandle},e.prototype.getPRFile=function(){var t;return null===(t=this.getPRFileCachedData())||void 0===t?void 0:t.handle},e.prototype.releasePRFileHandle=function(){var t,e;null===(e=null===(t=this.prFileHandle)||void 0===t?void 0:t.handle)||void 0===e||e.delete(),this.prFileHandle=void 0},e.prototype.getRootNodeExtent=function(){var t,e,n;return null!==(n=null===(e=null===(t=this.getPRFile())||void 0===t?void 0:t.getRootNode())||void 0===e?void 0:e.getAbsoluteExtent())&&void 0!==n?n:null},e.prototype.getPRFileArtboards=function(){var t,e;return null!==(e=null===(t=this.getPRFileCachedData())||void 0===t?void 0:t.artboards)&&void 0!==e?e:[]},e.prototype.getArtboardAtPosition=function(t,e){if(!this.pageCanvasWasm)return null;for(var n=this.getPRFileArtboards(),r=this.pageCanvasWasm.getPan(),o=this.pageCanvasWasm.getZoom(),i=(t-r.x)/o,a=(e-r.y)/o,s=0,u=n;s<u.length;s++){var c=u[s],l=c.bounds.x+c.bounds.width,d=c.bounds.y+c.bounds.height;if(i>=c.bounds.x&&a>=c.bounds.y&&i<=l&&a<=d)return c.getNode()}return null},e.prototype.mapRelativePositionToCameraPosition=function(t,e){var n;return null===(n=this.pageCanvasWasm)||void 0===n?void 0:n.mapRelativePositionToCameraPosition(t,e)},e.prototype.getPanAtPosition=function(t,e){var n=this.getPan(),r=Math.max(this.getZoom(),Number.EPSILON),o=t/r,i=e/r;return{x:n.x-o,y:n.y-i}},e.prototype.getStatus=function(){return this.status},e.prototype.setZoom=function(t,e){var n,r=null!=e?e:this.canvasManager.getCanvasCenterPoint();null===(n=this.pageCanvasWasm)||void 0===n||n.setZoom(t,r.x,r.y)},e.prototype.getPan=function(){var t,e,n=this.getRootNodeExtent();if(!n)return{x:0,y:0};var r=null===(t=this.pageCanvasWasm)||void 0===t?void 0:t.getPan(),o=null===(e=this.pageCanvasWasm)||void 0===e?void 0:e.getZoom();return r&&o?{x:r.x/o+n.x,y:r.y/o+n.y}:{x:0,y:0}},e.prototype.getZoom=function(){var t;return(null===(t=this.pageCanvasWasm)||void 0===t?void 0:t.getZoom())||0},e.prototype.setPan=function(t,e,n){var r;void 0===n&&(n=!1);var o=this.getRootNodeExtent();if(o){var i=t,a=e,s=this.getZoom();if(n){var u=Math.max(2*s*this.canvasManager.pixelRatio,Number.EPSILON);i+=this.canvasManager.size.width/u,a+=this.canvasManager.size.height/u}var c=(i-o.x)*s,l=(a-o.y)*s;null===(r=this.pageCanvasWasm)||void 0===r||r.setPan(c,l)}},e.prototype.selectArtboard=function(t){var e;this.pageCanvasWasm&&(this.settings.selectedArtboard=t,null===(e=this.pageCanvasWasm)||void 0===e||e.selectArtboard(null!=t?t:""))},e.prototype.disposeFetchWorker=function(){this.fetchWorker.postMessage({type:"abort-all"}),this.fetchWorker.terminate()},e.prototype.exportNode=function(t,e){return T(this,void 0,void 0,(function(){var n=this;return F(this,(function(r){return[2,new Promise((function(r,o){if(n.wasmModule&&n.pageCanvasWasm){var i=e.format.toUpperCase(),a=Ut[i];if(a){var s={format:{value:a},backingScale:e.backingScale};n.pageCanvasWasm.exportNode(t,s,(function(t){if(null!==t){var n=Zt[e.format],i=new Blob([t.buffer],{type:n});r(i)}else o("Export failed")}))}else o("Unsupported export format: ".concat(e.format))}else o("Wasm module is not ready or was disposed.")}))]}))}))},e.prototype.dispose=function(){var t,e,n,r;try{this.disposeFetchWorker(),this.disposed=!0,this.detachAllListeners(),this.releasePRFileHandle(),null===(t=this.wasmModule)||void 0===t||t.destroyWebGLContext(this.webglCtxHandle),this.canvasManager.dispose(),this.gestureManager.dispose(),null===(e=this.pageCanvasWasm)||void 0===e||e.stopRenderLoop(),null===(n=this.pageCanvasWasm)||void 0===n||n.delete(),null===(r=this.renderTarget)||void 0===r||r.delete(),this.pageCanvasWasm=void 0,this.wasmModule=void 0}catch(t){this.fail(new J("ERROR","Unexpected exception while disposing the wasm object",t))}},e}(Y),jt=o(void 0),Nt=o(void 0),Ht=o(void 0),Vt=o(void 0),Jt=o(void 0),Kt=o("auto"),Yt=o(void 0),Xt=function(){var t=i(Yt);if(void 0===t)throw Error("useInternalContext must be used within a provider");return t},qt=function(t,e){switch(e.type){case"on-status":return W(W({},t),{status:e.status});case"on-zoom":return W(W({},t),{zoom:e.zoom});case"on-pan":return W(W({},t),{pan:e.pan});case"dispose":return W(W({},t),{status:{type:"DISPOSED"},zoom:null,pan:null,cursor:"auto"});case"on-camera-zoom-start":return W(W({},t),{isCameraZooming:!0});case"on-camera-zoom-end":return W(W({},t),{isCameraZooming:!1});case"on-camera-move-start":return W(W({},t),{isCameraMoving:!0});case"on-camera-move-end":return W(W({},t),{isCameraMoving:!1});case"on-cursor-change":return W(W({},t),{cursor:e.cursor});default:return t}},$t=function(n){var o=e(null),i=e(null),u=a(qt,{pan:null,zoom:null,status:{type:"IDLE"},isCameraZooming:!1,isCameraMoving:!1,cursor:"auto"}),c=u[0],l=c.status,d=c.zoom,h=c.pan,f=c.isCameraZooming,p=c.isCameraMoving,v=c.cursor,g=u[1],m=r((function(t){return g({type:"on-zoom",zoom:t})}),[]),y=r((function(t,e){return g({type:"on-pan",pan:{x:t,y:e}})}),[]),b=r((function(t){g({type:"on-status",status:t})}),[]),w=r((function(){return g({type:"on-camera-zoom-start"})}),[]),C=r((function(){return g({type:"on-camera-zoom-end"})}),[]),P=r((function(){return g({type:"on-camera-move-start"})}),[]),E=r((function(){return g({type:"on-camera-move-end"})}),[]),x=r((function(t){return g({type:"on-cursor-change",cursor:t})}),[]),L=r((function(){if(o.current){var t=o.current.getPan();g({type:"on-pan",pan:t})}}),[]),M=r((function(){var t=o.current;t&&(pt.logDebug("Provider dispose"),t.off("status",b),t.off("cameraZoomChange",m),t.off("cameraPanChange",y),t.off("cameraZoomStart",w),t.off("cameraZoomEnd",C),t.off("cameraMoveStart",P),t.off("cameraMoveEnd",E),t.off("cursorChange",x),t.off("sceneChange",L),t.dispose(),o.current=null,g({type:"dispose"}))}),[b,y,m,w,C,P,E,x,L]),R=r((function(t,e,n){if(""!==t&&e&&n&&i.current){pt.logDebug("Provider init");var r=new _t(W(W({},i.current),{filePath:t,container:n,canvas:e,manualInitialization:!0}));r.on("status",b),r.on("cameraZoomChange",m),r.on("cameraPanChange",y),r.on("cameraZoomStart",w),r.on("cameraZoomEnd",C),r.on("cameraMoveStart",P),r.on("cameraMoveEnd",E),r.on("cursorChange",x),r.on("sceneChange",L),o.current=r,r.init()}}),[b,m,y,w,C,P,E,x,L]),S=r((function(t){var e,n;pt.logDebug("Provider setSettings"),t.backgroundColor&&(null===(e=o.current)||void 0===e||e.setBackgroundColor(t.backgroundColor)),null===(n=o.current)||void 0===n||n.selectArtboard(t.selectedArtboard||null),i.current=t}),[]),T=r((function(){return o.current}),[]),F=s((function(){return{dispose:M,init:R,setSettings:S,getInstance:T,dispatch:g}}),[M,R,S,T]);return t.createElement(Yt.Provider,{value:F},t.createElement(jt.Provider,{value:l},t.createElement(Nt.Provider,{value:d},t.createElement(Jt.Provider,{value:h},t.createElement(Ht.Provider,{value:f},t.createElement(Vt.Provider,{value:p},t.createElement(Kt.Provider,{value:v},n.children)))))))},Qt=function(t,e){var n=(0,Xt().getInstance)();u((function(){return null==n||n.on(t,e),function(){null==n||n.off(t,e)}}),[t,n,e])},te=function(){var t=i(jt);if(void 0===t)throw Error("useStatus must be used within a provider");return t},ee=function(){var t=i(Nt);if(void 0===t)throw Error("useZoom must be used within a provider");return t},ne=function(){var t=i(Jt);if(void 0===t)throw Error("usePan must be used within a provider");return t},re=function(){var t=i(Kt);if(void 0===t)throw Error("useCursor must be used within a provider");return t},oe=function(){var t=i(Ht);if(void 0===status)throw Error("useIsCameraZooming must be used within a provider");return t},ie=function(){var t=i(Vt);if(void 0===status)throw Error("useIsCameraMoving must be used within a provider");return t},ae=function(){var t=(0,Xt().getInstance)(),e=te();return s((function(){return t&&"READY"===e.type?t.getPRFile():null}),[t,e])},se=function(){var t=(0,Xt().getInstance)(),e=te();return s((function(){return t&&"READY"===e.type?t.getPRFileArtboards():null}),[t,e])},ue=function(){var t,e,n,r,o=ae(),i=c(null),a=i[0],l=i[1],d=vt((function(){l((function(t){var e,n,r,i=null!==(r=null===(n=null===(e=ct(o))||void 0===e?void 0:e.getRootNode())||void 0===n?void 0:n.getAbsoluteExtent())&&void 0!==r?r:null;return(null==t?void 0:t.width)===(null==i?void 0:i.width)&&(null==t?void 0:t.height)===(null==i?void 0:i.height)&&(null==t?void 0:t.x)===(null==i?void 0:i.x)&&(null==t?void 0:t.y)===(null==i?void 0:i.y)?t:i}))}),16);Qt("sceneChange",d),u((function(){d()}),[d]);var h=null!==(t=null==a?void 0:a.x)&&void 0!==t?t:0,f=null!==(e=null==a?void 0:a.y)&&void 0!==e?e:0,p=null!==(n=null==a?void 0:a.width)&&void 0!==n?n:0,v=null!==(r=null==a?void 0:a.height)&&void 0!==r?r:0;return s((function(){return{x:h,y:f,width:p,height:v}}),[h,f,p,v])},ce=function(){var t=(0,Xt().getInstance)();return r((function(e){null==t||t.setZoom(e)}),[t])},le=function(){var t=ce(),e=ee();return r((function(){var n;"number"==typeof e&&(n=e>=1?Math.round(2*e):e>.5?1:2*e,t(n))}),[t,e])},de=function(){var t=ce(),e=ee();return r((function(){"number"==typeof e&&t(e/2)}),[t,e])},he=function(){var t=(0,Xt().getInstance)();return r((function(e){var n=e.x,r=e.y,o=e.centerPointInViewport;null==t||t.setPan(n,r,o)}),[t])},fe=function(){var t=(0,Xt().getInstance)();return r((function(){null==t||t.zoomToFit()}),[t])},pe=function(){var t=(0,Xt().getInstance)();return r((function(){null==t||t.looseWebGLContext()}),[t])},ve=function(){var t=(0,Xt().getInstance)();return r((function(e,n){return T(void 0,void 0,void 0,(function(){return F(this,(function(r){switch(r.label){case 0:return[4,null==t?void 0:t.getArtboardAtPosition(e,n)];case 1:return[2,r.sent()||null]}}))}))}),[t])},ge=function(){var t=(0,Xt().getInstance)();return r((function(e,n){return T(void 0,void 0,void 0,(function(){return F(this,(function(r){switch(r.label){case 0:return[4,null==t?void 0:t.getPanAtPosition(e,n)];case 1:return[2,r.sent()||null]}}))}))}),[t])},me=function(){var t=(0,Xt().getInstance)();return r((function(e){null==t||t.setIsCameraLocked(e)}),[t])},ye=function(){var t=(0,Xt().getInstance)();return r((function(e,n){if(!t)return null;var r=t.mapRelativePositionToCameraPosition(e,n);return null!=r?r:null}),[t])},be=function(){var t=(0,Xt().getInstance)(),e=ae();return r((function(n,r){return t&&e?t.exportNode(n,r):Promise.reject("WebRenderer instance not ready")}),[t,e])};function we(t){var n=e(t);n.current=t;var o=r((function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];n.current.apply(n,I([t],e,!1))}),[]);u((function(){return pt.on("log",o),function(){pt.off("log",o)}}),[o])}var Ce={position:"relative",width:"100%",height:"100%",touchAction:"manipulation"},Pe={position:"absolute",top:0,left:0},Ee=function(n){var o=n.filePath,i=n.locateFile,a=n.imagesURLFormat,l=n.imagesURLMap,d=n.fragmentsURLFormat,h=n.fragmentsURLMap,f=n.backgroundColor,p=n.mode,v=n.showTilesBorders,g=n.minimumZoomLevel,m=n.maximumZoomLevel,y=n.preserveDrawingBuffer,b=n.panBoundariesPadding,w=n.initialPan,C=n.initialZoom,P=n.children,E=n.containerProps,x=n.canvasProps,L=n.featureFlags,M=n.selectedArtboard,R=e(null),S=e(null),T=c(!1),F=T[0],I=T[1],A=r((function(){return I(!0)}),[]),k=Xt(),G=k.dispose,D=k.init,U=k.setSettings,B=re(),O=te();Qt("allImagesReady",A),u((function(){return pt.logDebug("CanvasRenderer mounted"),function(){return pt.logDebug("CanvasRenderer unmounted")}}),[]),u((function(){U({locateFile:i,imagesURLFormat:a,imagesURLMap:l,fragmentsURLFormat:d,fragmentsURLMap:h,backgroundColor:f,mode:p,showTilesBorders:v,minimumZoomLevel:g,maximumZoomLevel:m,preserveDrawingBuffer:y,panBoundariesPadding:b,initialPan:w,initialZoom:C,featureFlags:L,selectedArtboard:M})}),[U,i,a,l,d,h,f,p,v,g,m,y,b,w,C,L,M]),u((function(){if(o)return D(o,R.current,S.current),function(){G()}}),[G,D,o]);var z=s((function(){var t;return null!==(t=n.cursor)&&void 0!==t?t:B}),[n.cursor,B]),Z=s((function(){return W(W({},Ce),{cursor:z})}),[z]);return t.createElement("div",W({},E,{ref:S,style:Z}),o&&t.createElement("canvas",W({},x,{key:o,ref:R,"data-sketchweb-all-images-ready":F,"data-testid":"sketchweb-canvas","data-sketchweb-status":"sketchweb-status-".concat((null==O?void 0:O.type.toLowerCase())||"null"),style:Pe})),"READY"===(null==O?void 0:O.type)&&P)},xe=function(){function t(t,e,n,r){this.prototypeStructure=t,this.startArtboardUUID=e,this.canvas=n,this.container=r,this.locateFile="/{file}",this.imagesURLFormat="",this.imagesURLMap={},this.fragmentsURLFormat="",this.fragmentsURLMap={},this.backgroundColor={r:0,g:0,b:0,a:1},this.mode=N.release,this.showTilesBorders=!1,this.minimumZoomLevel=5,this.maximumZoomLevel=.01,this.preserveDrawingBuffer=!1,this.featureFlags=q,this.manualInitialization=!1,this.highlightHotspots=!0,this.resizeMode=H.Fit,this.assetsManagerLimits={maxDepthForBackgroundRequests:1,maxArtboardsForBackgroundRequests:5,maxInitialLoadingDepth:2,maxInitialArtboardToLoad:10},this.disableInteraction=!1}return t.FromSettings=function(e){return Object.assign(new t(e.prototypeStructure,e.startArtboardUUID,e.canvas,e.container),Object.fromEntries(Object.entries(e).filter((function(t){return void 0!==t[1]}))))},t}(),Le=function(t){function e(e){var n=t.call(this)||this;return n.status={type:"IDLE"},n.disposed=!1,n.handleCanvasResize=function(t,e,r){var o;null===(o=n.playerWasm)||void 0===o||o.resize(t,e,r)},n.handleWebGLContextLost=function(){n.setStatus({type:"WEBGL_CONTEXT_LOST"})},n.handlePinchToZoomEvent=function(t,e){var r;null===(r=n.userEventsCollectorWasm)||void 0===r||r.dispatchPinchToZoomEvent(t,e.x,e.y)},n.handleWheelEvent=function(t,e){var r;n.wasmModule&&n.userEventsCollectorWasm.dispatchWheelEvent(t.x,t.y,null===(r=n.wasmModule)||void 0===r?void 0:r.mapPointerInfo(e))},n.handlePointerDownEvent=function(t){var e;n.wasmModule&&n.userEventsCollectorWasm.dispatchPointerDownEvent(null===(e=n.wasmModule)||void 0===e?void 0:e.mapPointerInfo(t))},n.handlePointerMoveEvent=function(t){var e;n.wasmModule&&n.userEventsCollectorWasm.dispatchPointerMoveEvent(null===(e=n.wasmModule)||void 0===e?void 0:e.mapPointerInfo(t))},n.handleGlobalPointerMoveEvent=function(t){var e;n.wasmModule&&n.userEventsCollectorWasm.dispatchGlobalPointerMoveEvent(null===(e=n.wasmModule)||void 0===e?void 0:e.mapPointerInfo(t))},n.handlePointerUpEvent=function(t){var e;n.wasmModule&&n.userEventsCollectorWasm.dispatchPointerUpEvent(null===(e=n.wasmModule)||void 0===e?void 0:e.mapPointerInfo(t))},n.restartPrototype=function(t){var e;null===(e=n.playerWasm)||void 0===e||e.restartPrototype(t)},n.navigateToFirstFlow=function(){var t;null===(t=n.playerWasm)||void 0===t||t.navigateToFirstFlow()},n.goBack=function(){var t;null===(t=n.playerWasm)||void 0===t||t.goBack()},n.goForwards=function(){var t;null===(t=n.playerWasm)||void 0===t||t.goForwards()},n.setResizeMode=function(t){var e;if(n.wasmModule){var r=n.wasmModule.mapResizeMode(t);null===(e=n.playerWasm)||void 0===e||e.setResizeMode(r)}},n.getScreen=function(t){var e;void 0===t&&(t=!0);var r=null===(e=n.playerWasm)||void 0===e?void 0:e.getJSScreen(t);return r?{layers:it(r.layers)}:{layers:[]}},n.settings=xe.FromSettings(e),pt.logDebug("PrototypeRenderer JS constructed with settings:",n.settings),n.gestureManager=new lt(n.settings.container,n.settings.disableInteraction),n.canvasManager=new gt({container:n.settings.container,canvas:n.settings.canvas,maxPixelRatio:3}),n.fetchWorker=new Worker(n.settings.locateFile.replace("{file}","fetch-worker.js")),n.settings.manualInitialization||n.init(),n}return S(e,t),e.prototype.addListeners=function(){this.canvasManager.on("resize",this.handleCanvasResize),this.gestureManager.on("wheel",this.handleWheelEvent),this.gestureManager.on("pointerup",this.handlePointerUpEvent),this.gestureManager.on("pointermove",this.handlePointerMoveEvent),this.gestureManager.on("globalpointermove",this.handleGlobalPointerMoveEvent),this.gestureManager.on("pointerdown",this.handlePointerDownEvent),this.gestureManager.on("pinchToZoom",this.handlePinchToZoomEvent),this.settings.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLost)},e.prototype.collectAndEmitDeviceInfo=function(){return T(this,void 0,void 0,(function(){var t;return F(this,(function(e){switch(e.label){case 0:return[4,V()];case 1:return t=e.sent(),this.deviceInfo=W(W({},t),{hardwareConcurrency:navigator.hardwareConcurrency}),this.emit("deviceInfo",this.deviceInfo),[2]}}))}))},e.prototype.detectWebGLVersion=function(){this.webglVersion=ot(this.deviceInfo),pt.logDebug("Using WebGL ".concat(this.webglVersion))},e.prototype.init=function(){return T(this,void 0,void 0,(function(){var t;return F(this,(function(e){switch(e.label){case 0:return this.traceFirstPaint=new ht("FirstPaint"),this.setStatus({type:"INITIALIZING"}),[4,this.collectAndEmitDeviceInfo()];case 1:e.sent(),this.detectWebGLVersion(),e.label=2;case 2:return e.trys.push([2,6,,7]),[4,this.initWasmModule()];case 3:return e.sent(),[4,this.initPlayerWasm()];case 4:return e.sent(),[4,this.startDownload()];case 5:return e.sent(),[3,7];case 6:return t=e.sent(),[2,this.fail(t instanceof J?t:new J("ERROR","Unexpected exception initializing the web renderer",t))];case 7:return this.startRendering(),this.addListeners(),[2]}}))}))},e.prototype.initWasmModule=function(){var t;return T(this,void 0,void 0,(function(){var e;return F(this,(function(n){switch(n.label){case 0:return this.disposed?[2]:(e=new ht("WasmModuleDownload"),this.wasmModule=new mt({mode:this.settings.mode,locateFile:this.settings.locateFile,jsBridge:this.createJSBridge(),featureFlags:this.settings.featureFlags,webglVersion:this.webglVersion}),[4,null===(t=this.wasmModule)||void 0===t?void 0:t.init()]);case 1:return n.sent(),e.printMeasurement(),this.emit("metric",e.measure()),[2]}}))}))},e.prototype.startDownload=function(){var t=this;return this.setStatus({type:"LOADING_FILE"}),new Promise((function(e){var n;null===(n=t.playerWasm)||void 0===n||n.startDownload((function(){e()}))}))},e.prototype.startRendering=function(){var t;this.traceInitialRender=new ht("InitialRender"),this.setStatus({type:"DRAWING_FILE"}),null===(t=this.playerWasm)||void 0===t||t.startRenderLoop()},e.prototype.createJSBridge=function(){var t=this;return{logDebug:function(t){pt.logDebug("[C++] ".concat(t))},logWarning:function(t){pt.logWarning("[C++] ".concat(t))},logError:function(t){pt.logError("[C++] ".concat(t))},emitMetric:function(e,n,r,o){t.emit("metric",{id:e,start:n,end:r,duration:o})},resolveImageUrl:function(e,n){return t.settings.imagesURLMap&&t.settings.imagesURLMap[e]?t.settings.imagesURLMap[e].replace(":format",n):t.settings.imagesURLFormat?t.settings.imagesURLFormat.replace(":imageId",e).replace(":format",n):(pt.logWarning("Not able to resolve the url for the image with UUID: ".concat(e)),"")},resolveFragmentUrl:function(e){return t.settings.fragmentsURLMap&&t.settings.fragmentsURLMap[e]?t.settings.fragmentsURLMap[e]:t.settings.fragmentsURLFormat?t.settings.fragmentsURLFormat.replace(":fragmentId",e):(pt.logWarning("Not able to resolve the url for the fragment with UUID: ".concat(e)),"")},onDrawComplete:this.handleDrawComplete.bind(this),onAllImagesReady:function(){t.emit("allImagesReady")},onCameraMoveStart:function(){t.emit("cameraMoveStart")},onCameraMoveEnd:function(){t.emit("cameraMoveEnd")},onCameraZoomStart:function(){t.emit("cameraZoomStart")},onCameraZoomEnd:function(){t.emit("cameraZoomEnd")},onCameraZoomChange:function(e){t.emit("cameraZoomChange",e)},onCameraPanChange:function(e,n){t.emit("cameraPanChange",e,n)},onCursorChange:function(e){var n,r=null===(n=t.wasmModule)||void 0===n?void 0:n.mapToCSSCursor(e);r&&t.emit("cursorChange",r)},onPrototypeStateWillChange:function(e,n,r){t.emit("prototypeStateWillChange",{currentArtboardId:e,canGoBack:n,canGoForwards:r})},onPrototypeStateChange:function(e,n,r){t.emit("prototypeStateChange",{currentArtboardId:e,canGoBack:n,canGoForwards:r})},fetch:this.handleJSBridgeFetch.bind(this),abortFetch:this.handleJSBridgeAbortFetch.bind(this),onPrototypeUnhandledPointerUp:function(){t.emit("prototypeUnhandledPointerUp")},onSceneChange:function(){t.emit("sceneChange")}}},e.prototype.handleJSBridgeFetch=function(t,e){var n=this,r=e.clone(),o=function(e){return T(n,void 0,void 0,(function(){var n,i,a,s,u,c,l,d,h;return F(this,(function(f){switch(f.label){case 0:if(this.disposed||!this.wasmModule)return[2];if(e.data.url!==t)return[2];switch(e.data.type){case"success":return[3,1];case"error":return[3,5]}return[3,6];case 1:return n={statusCode:200,statusText:"OK",contentType:e.data.contentType,isWebGLTexture:!1,emscriptenWebGLTextureHandle:-1,width:0,height:0},/image/.test(e.data.contentType)?(i=new Blob([e.data.buffer]),[4,yt(URL.createObjectURL(i))]):[3,3];case 2:return a=f.sent(),this.wasmModule?(s=this.wasmModule.createWebGLTextureFromImage(a,this.webglCtxHandle),n.buffer=new Uint8Array(0),n.isWebGLTexture=!0,n.emscriptenWebGLTextureHandle=s,n.width=a.width,n.height=a.height,[3,4]):[2];case 3:n.buffer=new Uint8Array(e.data.buffer),f.label=4;case 4:return r.exec(n),[3,7];case 5:return pt.logError("Error while fetching ".concat(t),e.data.error),r.exec({buffer:new Uint8Array(0),statusCode:null!==(c=null===(u=e.data.error)||void 0===u?void 0:u.statusCode)&&void 0!==c?c:500,statusText:null!==(d=null===(l=e.data.error)||void 0===l?void 0:l.statusText)&&void 0!==d?d:"Unknown error",contentType:null!==(h=e.data.contentType)&&void 0!==h?h:"",isWebGLTexture:!1,emscriptenWebGLTextureHandle:-1,width:0,height:0}),[3,7];case 6:return[3,7];case 7:return this.fetchWorker.removeEventListener("message",o),[2]}}))}))};this.fetchWorker.addEventListener("message",o),this.fetchWorker.postMessage({type:"fetch",url:t})},e.prototype.handleJSBridgeAbortFetch=function(t){this.fetchWorker.postMessage({type:"abort",url:t})},e.prototype.initPlayerWasm=function(){var t,e;return T(this,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,l,d,h,f,p,v,g,m,y,b,w,C,P;return F(this,(function(E){try{if(!this.wasmModule)throw Error("WASM module not initialized");for(this.webglCtxHandle=this.wasmModule.makeWebGLContext(this.settings.canvas,{preserveDrawingBuffer:this.settings.preserveDrawingBuffer,majorVersion:this.webglVersion}),n=this.wasmModule.instance,r=n.RenderTarget,o=n.PrototypeRendererWasm,i=n.PrototypeStructureArtboardVector,a=n.PrototypeStructureFlowVector,s=n.PrototypeStructureAssetVector,u=n.PrototypeStructureFlowTypeEnum,this.renderTarget=r.MakeWebGL(this.webglCtxHandle,this.canvasManager.size.width,this.canvasManager.size.height,this.canvasManager.pixelRatio),c={artboards:new i},l={Overlay:u.Overlay,Screen:u.Screen},d=0,h=this.settings.prototypeStructure.artboards;d<h.length;d++){for(f=h[d],p=new a,v=0,g=null!==(t=f.flows)&&void 0!==t?t:[];v<g.length;v++)m=g[v],p.push_back(W(W({},m),{type:l[m.type]}));for(y=new s,b=0,w=null!==(e=f.assets)&&void 0!==e?e:[];b<w.length;b++)C=w[b],y.push_back(C);c.artboards.push_back(W(W({},f),{flows:p,assets:y}))}this.playerWasm=new o(this.renderTarget,{showTilesBorders:this.settings.showTilesBorders},this.settings.startArtboardUUID,c,this.settings.highlightHotspots,this.settings.assetsManagerLimits)}catch(t){throw new J("WASM_ERROR","An error occurred while trying to create the PrototypeRenderer WASM object.",t)}if(!(P=this.playerWasm.getUserEventsCollector()))throw new J("WASM_ERROR","An error occurred while trying to create the user events collector");return this.userEventsCollectorWasm=P,this.playerWasm.setBackgroundColor(this.settings.backgroundColor.r,this.settings.backgroundColor.g,this.settings.backgroundColor.b,this.settings.backgroundColor.a),this.playerWasm.setZoomLevels(this.settings.minimumZoomLevel,this.settings.maximumZoomLevel),this.setResizeMode(this.settings.resizeMode),[2]}))}))},e.prototype.setIsCameraLocked=function(t){var e;null===(e=this.playerWasm)||void 0===e||e.setIsCameraLocked(t)},e.prototype.setBackgroundColor=function(t){var e;t.r===this.settings.backgroundColor.r&&t.g===this.settings.backgroundColor.g&&t.b===this.settings.backgroundColor.b&&t.a===this.settings.backgroundColor.a||(null===(e=this.playerWasm)||void 0===e||e.setBackgroundColor(t.r,t.g,t.b,t.a),this.settings.backgroundColor=t)},e.prototype.handleDrawComplete=function(){"DRAWING_FILE"===this.status.type&&(this.traceInitialRender.printMeasurement(),this.emit("metric",this.traceInitialRender.measure()),this.traceFirstPaint.printMeasurement(),this.emit("metric",this.traceFirstPaint.measure()),this.setStatus({type:"READY"}))},e.prototype.looseWebGLContext=function(){var t;null===(t=this.wasmModule)||void 0===t||t.destroyWebGLContext(this.webglCtxHandle),this.webglCtxHandle=-1},e.prototype.fail=function(t){this.setStatus({type:"FAILURE",code:t.code,message:"".concat(t.toString()).concat(t.cause?"\nWrapped Error: ".concat(t.cause.toString()):"")}),pt.logError(t),t.cause&&pt.logError(t.cause)},e.prototype.setStatus=function(t){"FAILURE"!==this.status.type&&(pt.logDebug("Status transition ".concat(this.status.type," => ").concat(t.type)),this.status=t,this.emit("status",t))},e.prototype.getStatus=function(){return this.status},e.prototype.getArtboardAtPosition=function(t,e){var n=this.playerWasm;if(!n)return null;for(var r=n.getJSScreen(!1),o=n.getPan(),i=n.getZoom(),a=(t-o.x)/i,s=(e-o.y)/i,u=r.layers.size()-1;u>=0;u-=1){var c=r.layers.get(u);if(c&&"artboard"===c.type){var l=c.bounds.x+c.bounds.width,d=c.bounds.y+c.bounds.height;if(a>=c.bounds.x&&s>=c.bounds.y&&a<=l&&s<=d)return c.getNode()}}return null},e.prototype.disposeFetchWorker=function(){this.fetchWorker.postMessage({type:"abort-all"}),this.fetchWorker.terminate()},e.prototype.dispose=function(){var t,e,n;try{this.disposeFetchWorker(),this.detachAllListeners(),null===(t=this.wasmModule)||void 0===t||t.destroyWebGLContext(this.webglCtxHandle),this.canvasManager.dispose(),this.gestureManager.dispose(),null===(e=this.playerWasm)||void 0===e||e.stopRenderLoop(),null===(n=this.playerWasm)||void 0===n||n.delete(),this.renderTarget.delete(),this.playerWasm=void 0,this.wasmModule=void 0,this.disposed=!0}catch(t){this.fail(new J("ERROR","Unexpected exception while disposing the WebRendererWasm object",t))}},e.prototype.mapRelativePositionToCameraPosition=function(t,e){var n=this.playerWasm;return n?n.mapRelativePositionToCameraPosition(t,e):null},e.prototype.updateHighlightHotspotsSetting=function(t){var e=this.playerWasm;if(!e)return null;e.updateHighlightHotspotsSetting(t)},e}(Y),Me=o(void 0),Re=o("auto"),Se=o(void 0),We=o(void 0),Te=o(void 0),Fe=o(void 0),Ie=function(){var t=i(Fe);if(void 0===t)throw Error("useInternalContext must be used within a provider");return t},Ae=function(t,e){switch(e.type){case"on-status":return W(W({},t),{status:e.status});case"dispose":return W(W({},t),{status:{type:"DISPOSED"},cursor:"auto"});case"on-cursor-change":return W(W({},t),{cursor:e.cursor});case"on-prototype-state-will-change":return W(W({},t),{prototypeState:W(W({},t.prototypeState),{isChanging:!0})});case"on-prototype-state-change":return W(W({},t),{prototypeState:W(W(W({},t.prototypeState),e.prototypeState),{isChanging:!1})});case"on-zoom":return W(W({},t),{zoom:e.zoom});case"on-pan":return W(W({},t),{pan:{x:e.pan.x,y:e.pan.y}});default:return t}},ke=function(n){var o=e(null),i=e(null),u=a(Ae,{status:{type:"IDLE"},cursor:"auto",prototypeState:{currentArtboardId:"",canGoBack:!1,canGoForwards:!1,isChanging:!1},zoom:1,pan:{x:0,y:0}}),c=u[0],l=c.status,d=c.cursor,h=c.prototypeState,f=c.zoom,p=c.pan,v=u[1],g=r((function(t){v({type:"on-status",status:t})}),[]),m=r((function(t){return v({type:"on-zoom",zoom:t})}),[]),y=r((function(t,e){return v({type:"on-pan",pan:{x:t,y:e}})}),[]),b=r((function(t){return v({type:"on-cursor-change",cursor:t})}),[]),w=r((function(){return v({type:"on-prototype-state-will-change"})}),[]),C=r((function(t){return v({type:"on-prototype-state-change",prototypeState:t})}),[]),P=r((function(){var t=o.current;t&&(pt.logDebug("Provider dispose"),t.off("status",g),t.off("cursorChange",b),t.off("prototypeStateWillChange",w),t.off("prototypeStateChange",C),t.off("cameraZoomChange",m),t.off("cameraPanChange",y),t.dispose(),o.current=null,v({type:"dispose"}))}),[g,b,w,C,y,m]),E=r((function(t,e){if(t&&e&&i.current){pt.logDebug("Provider init");var n=new Le(W(W({},i.current),{container:e,canvas:t,manualInitialization:!0}));n.on("status",g),n.on("cursorChange",b),n.on("prototypeStateWillChange",w),n.on("prototypeStateChange",C),n.on("cameraZoomChange",m),n.on("cameraPanChange",y),o.current=n,n.init()}}),[g,b,w,C,y,m]),x=r((function(t){var e,n,r,a,s,u,c,l;pt.logDebug("Provider setSettings"),t.backgroundColor&&t.backgroundColor!=(null===(e=i.current)||void 0===e?void 0:e.backgroundColor)&&(null===(n=o.current)||void 0===n||n.setBackgroundColor(t.backgroundColor)),(null===(r=i.current)||void 0===r?void 0:r.resizeMode)!=t.resizeMode&&(null===(a=o.current)||void 0===a||a.setResizeMode(t.resizeMode||H.Fit)),void 0!==t.highlightHotspots&&(null===(s=i.current)||void 0===s?void 0:s.highlightHotspots)!==t.highlightHotspots&&(null===(u=o.current)||void 0===u||u.updateHighlightHotspotsSetting(t.highlightHotspots)),t.disableInteraction!==(null===(c=i.current)||void 0===c?void 0:c.disableInteraction)&&(null===(l=o.current)||void 0===l||l.gestureManager.setDisable(t.disableInteraction||!1)),i.current=t}),[]),L=r((function(){return o.current}),[]),M=s((function(){return{dispose:P,init:E,setSettings:x,getInstance:L,dispatch:v}}),[P,E,x,L]);return t.createElement(Fe.Provider,{value:M},t.createElement(Me.Provider,{value:l},t.createElement(Re.Provider,{value:d},t.createElement(Se.Provider,{value:h},t.createElement(We.Provider,{value:f},t.createElement(Te.Provider,{value:p},n.children))))))},Ge=function(){var t=(0,Ie().getInstance)();return r((function(e){null==t||t.restartPrototype(e)}),[t])},De=function(){var t=(0,Ie().getInstance)();return r((function(){null==t||t.navigateToFirstFlow()}),[t])},Ue=function(){var t=(0,Ie().getInstance)();return r((function(){null==t||t.goBack()}),[t])},Be=function(){var t=(0,Ie().getInstance)();return r((function(){null==t||t.goForwards()}),[t])},Oe=function(){var t=(0,Ie().getInstance)();return r((function(e,n){return T(void 0,void 0,void 0,(function(){return F(this,(function(r){return[2,null==t?void 0:t.getArtboardAtPosition(e,n)]}))}))}),[t])},ze=function(){var t=(0,Ie().getInstance)();return r((function(e,n){if(!t)return null;var r=t.mapRelativePositionToCameraPosition(e,n);return null!=r?r:null}),[t])},Ze=function(){var t=i(Me);if(void 0===t)throw Error("usePrototypeStatus must be used within a provider");return t},_e=function(){var t=i(Re);if(void 0===t)throw Error("usePrototypeCursor must be used within a provider");return t},je=function(){var t=i(Se);if(void 0===t)throw Error("usePrototypeState must be used within a provider");return t},Ne=function(){var t=i(We);if(void 0===t)throw Error("usePrototypeZoom must be used within a provider");return t},He=function(){var t=i(Te);if(void 0===t)throw Error("usePrototypePan must be used within a provider");return t},Ve=function(t,e){var n=(0,Ie().getInstance)();u((function(){return null==n||n.on(t,e),function(){null==n||n.off(t,e)}}),[t,n,e])};function Je(){var t=(0,Ie().getInstance)();return r((function(e){return void 0===e&&(e=!0),null==t?void 0:t.getScreen(e)}),[t])}var Ke={position:"relative",width:"100%",height:"100%",touchAction:"manipulation"},Ye={position:"absolute",top:0,left:0},Xe=function(n){var r=n.locateFile,o=n.imagesURLFormat,i=n.imagesURLMap,a=n.backgroundColor,c=n.mode,l=n.showTilesBorders,d=n.minimumZoomLevel,h=n.maximumZoomLevel,f=n.preserveDrawingBuffer,p=n.children,v=n.containerProps,g=n.canvasProps,m=n.featureFlags,y=n.startArtboardUUID,b=n.prototypeStructure,w=n.fragmentsURLFormat,C=n.fragmentsURLMap,P=n.highlightHotspots,E=n.resizeMode,x=n.assetsManagerLimits,L=n.cursor,M=n.disableInteraction,R=e(null),S=e(null),T=Ie(),F=T.dispose,I=T.init,A=T.setSettings,k=Ze(),G=_e(),D=("function"==typeof L?L(G):L)||G;u((function(){return pt.logDebug("PrototypeRenderer mounted"),function(){return pt.logDebug("PrototypeRenderer unmounted")}}),[]),u((function(){A({locateFile:r,imagesURLFormat:o,imagesURLMap:i,backgroundColor:a,mode:c,showTilesBorders:l,minimumZoomLevel:d,maximumZoomLevel:h,preserveDrawingBuffer:f,featureFlags:m,startArtboardUUID:y,prototypeStructure:b,fragmentsURLFormat:w,fragmentsURLMap:C,highlightHotspots:P,resizeMode:E,assetsManagerLimits:x,disableInteraction:M})}),[A,r,o,i,a,c,l,d,h,f,m,y,P,E,w,C,b,x,M]),u((function(){return I(R.current,S.current),function(){F()}}),[F,I]);var U=s((function(){return W(W({},Ke),{cursor:D})}),[D]);return t.createElement("div",W({},v,{ref:S,style:U}),t.createElement("canvas",W({},g,{ref:R,"data-testid":"prototype-canvas","data-prototype-status":"prototype-status-".concat((null==k?void 0:k.type.toLowerCase())||"null"),style:Ye})),"READY"===(null==k?void 0:k.type)&&p)},qe={position:"absolute",inset:0,pointerEvents:"none"};function $e(e){var n=e.visualize,o=void 0!==n&&n,i=Je(),a=c((function(){return i()||null})),u=a[0],l=a[1],d=r((function(){l(i()||null)}),[i]);Ve("sceneChange",d);var h=s((function(){return W(W({},qe),{opacity:o?1:0})}),[o]);return u?t.createElement("div",{style:h},u.layers.map((function(e,n){return t.createElement(Qe,{key:"".concat(n,"/").concat(e.id),bounds:e.bounds,id:e.id,name:e.name,type:e.type})}))):null}function Qe(e){var n=e.bounds,r=e.name,o=e.id,i=e.type,a=Ne(),u=He()||{x:0,y:0},c=u.x,l=u.y,d=s((function(){return W({position:"absolute",left:c/window.devicePixelRatio+n.x*a,top:l/window.devicePixelRatio+n.y*a,width:n.width*a,height:n.height*a,backgroundColor:"rgba(0, 255, 255, 0.2)",border:"2px dotted white"},"hotspot"===i?{cursor:"pointer",pointerEvents:"auto"}:{})}),[n.x,n.y,n.width,n.height,c,l,a,i]);return t.createElement("div",{style:d,"data-testid":"".concat(i,"-").concat(tn(r),"-").concat(o),"data-entity-name":r,"data-entity-id":o,"data-entity-bounds-x":n.x,"data-entity-bounds-y":n.x,"data-entity-bounds-width":n.width,"data-entity-bounds-height":n.height})}function tn(t){var e,n;return null!==(n=null===(e=t.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))||void 0===e?void 0:e.join("-").toLowerCase())&&void 0!==n?n:""}export{He as $,re as A,oe as B,_t as C,ie as D,ae as E,se as F,ue as G,Qt as H,we as I,qt as J,Le as K,ke as L,Xe as M,Ge as N,De as O,Jt as P,Ue as Q,Be as R,jt as S,Oe as T,ze as U,Ze as V,_e as W,je as X,Ne as Y,Nt as Z,y as _,v as a,Ve as a0,Je as a1,$e as a2,J as a3,N as a4,K as a5,H as a6,Y as a7,lt as a8,dt as a9,St as aA,Wt as aB,Tt as aC,Ft as aD,It as aE,At as aF,kt as aG,Gt as aH,Dt as aI,Ut as aJ,Bt as aK,Ot as aL,X as aa,ht as ab,q as ac,et as ad,nt as ae,rt as af,ot as ag,it as ah,at as ai,st as aj,ut as ak,ct as al,ft as am,$ as an,tt as ao,pt as ap,vt as aq,bt as ar,wt as as,Ct as at,Pt as au,Et as av,xt as aw,Lt as ax,Mt as ay,Rt as az,x as b,M as c,f as d,h as e,g as f,P as g,$t as h,Ee as i,Ht as j,Vt as k,Kt as l,le as m,de as n,he as o,fe as p,pe as q,ve as r,ge as s,me as t,ce as u,ye as v,be as w,te as x,ee as y,ne as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as e,_ as t,a as r,c as n,d as a,e as o,f as i,g as c}from"./index-edb4bfa7.js";import"react";var s,u,l=(u="undefined"!=typeof document?null===(s=document.currentScript)||void 0===s?void 0:s.src:void 0,function(){var s,l,f,d=this,m=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},g=Object.assign({},m),v=new Promise((function(e,t){l=e,f=t}));if(["_malloc","_free","_memory","___indirect_function_table","onRuntimeInitialized"].forEach((function(e){Object.getOwnPropertyDescriptor(v,e)||Object.defineProperty(v,e,{get:function(){return j("You are getting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")},set:function(){return j("You are setting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})})),g.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var p=Object.assign({},g),h="";if("undefined"!=typeof document&&document.currentScript&&(h=document.currentScript.src),u&&(h=u),h=h.startsWith("blob:")?"":h.substr(0,h.replace(/[?#].*/,"").lastIndexOf("/")+1),"object"!=("undefined"==typeof window?"undefined":e(window))&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var y,b,_=g.print||console.log.bind(console),w=g.printErr||console.error.bind(console);Object.assign(g,p),p=null,ee("ENVIRONMENT"),ee("GL_MAX_TEXTURE_IMAGE_UNITS"),ee("SDL_canPlayWithWebAudio"),ee("SDL_numSimultaneouslyQueuedBuffers"),ee("INITIAL_MEMORY"),ee("arguments"),ee("canvas"),ee("doNotCaptureKeyboard"),ee("dynamicLibraries"),ee("elementPointerLock"),ee("extraStackTrace"),ee("forcedAspectRatio"),ee("keyboardListeningElement"),ee("freePreloadedMediaOnUse"),ee("loadSplitModule"),ee("logReadFiles"),ee("mem"),ee("monitorRunDependencies"),ee("noInitialRun"),ee("onCustomMessage"),ee("onExit"),ee("onFree"),ee("onFullScreen"),ee("onMalloc"),ee("onRealloc"),ee("onRuntimeInitialized"),ee("postMainLoop"),ee("postRun"),ee("preInit"),ee("preMainLoop"),ee("preRun"),ee("preinitializedWebGLContext"),ee("preloadPlugins"),ee("quit"),ee("setStatus"),ee("statusMessage"),ee("stderr"),ee("stdin"),ee("stdout"),ee("thisProgram"),ee("wasm"),ee("wasmBinary"),ee("websocket"),ee("fetchSettings"),Q("arguments","arguments_"),Q("thisProgram","thisProgram"),Q("quit","quit_"),D(void 0===g.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),D(void 0===g.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),D(void 0===g.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),D(void 0===g.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),D(void 0===g.read,"Module.read option was removed (modify read_ in JS)"),D(void 0===g.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),D(void 0===g.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),D(void 0===g.setWindowTitle,"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),D(void 0===g.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Q("asm","wasmExports"),Q("read","read_"),Q("readAsync","readAsync"),Q("readBinary","readBinary"),Q("setWindowTitle","setWindowTitle"),D(!0,"worker environment detected but not enabled at build time. Add `worker` to `-sENVIRONMENT` to enable."),D(!0,"node environment detected but not enabled at build time. Add `node` to `-sENVIRONMENT` to enable."),D(!0,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable."),Q("wasmBinary","wasmBinary"),"object"!=("undefined"==typeof WebAssembly?"undefined":e(WebAssembly))&&w("no native wasm support detected");var T,E,x,S,C,P,A,F,I,L,k=!1;function D(e,t){e||j("Assertion failed"+(t?": "+t:""))}function M(){var e=b.buffer;T=new Int8Array(e),x=new Int16Array(e),E=new Uint8Array(e),S=new Uint16Array(e),C=new Int32Array(e),P=new Uint32Array(e),A=new Float32Array(e),L=new Float64Array(e),F=new BigInt64Array(e),I=new BigUint64Array(e)}function O(){if(!k){var e=Wr();0==e&&(e+=4);var t=P[e>>2],r=P[e+4>>2];34821223==t&&2310721022==r||j("Stack overflow! Stack cookie has been overwritten at ".concat(ce(e),", expected hex dwords 0x89BACDFE and 0x2135467, but received ").concat(ce(r)," ").concat(ce(t))),1668509029!=P[0]&&j("Runtime error: The application has corrupted its heap memory area (address zero)!")}}D(!g.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),D("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),D(!g.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),D(!g.INITIAL_MEMORY,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var U=[],B=[],W=[],R=!1;D(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),D(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),D(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),D(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var N=0,G=null,$=null,V={};function j(e){var t;null===(t=g.onAbort)||void 0===t||t.call(g,e),w(e="Aborted("+e+")"),k=!0;var r=new WebAssembly.RuntimeError(e);throw f(r),r}var H={error:function(){j("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM")},init:function(){H.error()},createDataFile:function(){H.error()},createPreloadedFile:function(){H.error()},createLazyFile:function(){H.error()},open:function(){H.error()},mkdev:function(){H.error()},registerDevice:function(){H.error()},analyzePath:function(){H.error()},ErrnoError:function(){H.error()}};g.FS_createDataFile=H.createDataFile,g.FS_createPreloadedFile=H.createPreloadedFile;var Y,z=function(e){return e.startsWith("data:application/octet-stream;base64,")},J=function(e){return e.startsWith("file://")};function X(e,t){return function(){D(R,"native function `".concat(e,"` called before runtime initialization"));var r=Lr[e];return D(r,"exported native function `".concat(e,"` not found")),D(arguments.length<=t,"native function `".concat(e,"` called with ").concat(arguments.length," args but expects ").concat(t)),r.apply(void 0,arguments)}}function q(){var e,t="web-renderer-debug.wasm";return z(t)?t:(e=t,g.locateFile?g.locateFile(e,h):h+e)}function Z(e){if(e==Y&&y)return new Uint8Array(y);throw"both async and sync fetching of the wasm failed"}function K(e,t,r){return function(e){return"function"==typeof fetch?fetch(e,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '".concat(e,"'");return t.arrayBuffer()})).catch((function(){return Z(e)})):Promise.resolve().then((function(){return Z(e)}))}(e).then((function(e){return WebAssembly.instantiate(e,t)})).then(r,(function(e){w("failed to asynchronously prepare wasm: ".concat(e)),J(Y)&&w("warning: Loading from a file URI (".concat(Y,") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing")),j(e)}))}function Q(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];Object.getOwnPropertyDescriptor(g,e)||Object.defineProperty(g,e,{configurable:!0,get:function(){var n=r?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":"";j("`Module.".concat(e,"` has been replaced by `").concat(t,"`")+n)}})}function ee(e){Object.getOwnPropertyDescriptor(g,e)&&j("`Module.".concat(e,"` was supplied but `").concat(e,"` not included in INCOMING_MODULE_JS_API"))}function te(e){return"FS_createPath"===e||"FS_createDataFile"===e||"FS_createPreloadedFile"===e||"FS_unlink"===e||"addRunDependency"===e||"FS_createLazyFile"===e||"FS_createDevice"===e||"removeRunDependency"===e}function re(e,t){"undefined"!=typeof globalThis&&Object.defineProperty(globalThis,e,{configurable:!0,get:function(){le("`".concat(e,"` is not longer defined by emscripten. ").concat(t))}})}function ne(e){Object.getOwnPropertyDescriptor(g,e)||Object.defineProperty(g,e,{configurable:!0,get:function(){var t="'".concat(e,"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)");te(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),j(t)}})}function ae(e){this.name="ExitStatus",this.message="Program terminated with exit(".concat(e,")"),this.status=e}re("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),re("asm","Please use wasmExports instead");var oe=function(e){for(;e.length>0;)e.shift()(g)},ie=g.noExitRuntime||!0,ce=function(e){return D("number"==typeof e),"0x"+(e>>>=0).toString(16).padStart(8,"0")},se=function(e){return Rr(e)},ue=function(){return Nr()},le=function(e){le.shown||(le.shown={}),le.shown[e]||(le.shown[e]=1,w(e))},fe="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,de=function(e,t,r){for(var n=t+r,a=t;e[a]&&!(a>=n);)++a;if(a-t>16&&e.buffer&&fe)return fe.decode(e.subarray(t,a));for(var o="";t<a;){var i=e[t++];if(128&i){var c=63&e[t++];if(192!=(224&i)){var s=63&e[t++];if(224==(240&i)?i=(15&i)<<12|c<<6|s:(240!=(248&i)&&le("Invalid UTF-8 leading byte "+ce(i)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),i=(7&i)<<18|c<<12|s<<6|63&e[t++]),i<65536)o+=String.fromCharCode(i);else{var u=i-65536;o+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else o+=String.fromCharCode((31&i)<<6|c)}else o+=String.fromCharCode(i)}return o},me=function(t,r){return D("number"==typeof t,"UTF8ToString expects a number (got ".concat(e(t),")")),t?de(E,t,r):""},ge={},ve=function(e){for(;e.length;){var t=e.pop();e.pop()(t)}};function pe(e){return this.fromWireType(P[e>>2])}var he,ye,be,_e={},we={},Te={},Ee=function(e){throw new he(e)},xe=function(e,t,r){function n(t){var n=r(t);n.length!==e.length&&Ee("Mismatched type converter count");for(var a=0;a<e.length;++a)Ae(e[a],n[a])}e.forEach((function(e){Te[e]=t}));var a=new Array(t.length),o=[],i=0;t.forEach((function(e,t){we.hasOwnProperty(e)?a[t]=we[e]:(o.push(e),_e.hasOwnProperty(e)||(_e[e]=[]),_e[e].push((function(){a[t]=we[e],++i===o.length&&n(a)})))})),0===o.length&&n(a)},Se=function(t){if(null===t)return"null";var r=e(t);return"object"===r||"array"===r||"function"===r?t.toString():""+t},Ce=function(e){for(var t="",r=e;E[r];)t+=ye[E[r++]];return t},Pe=function(e){throw new be(e)};function Ae(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.name;if(e||Pe('type "'.concat(n,'" must have a positive integer typeid pointer')),we.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;Pe("Cannot register type '".concat(n,"' twice"))}if(we[e]=t,delete Te[e],_e.hasOwnProperty(e)){var a=_e[e];delete _e[e],a.forEach((function(e){return e()}))}}(e,t,r)}var Fe,Ie=function(e,t,r){switch(t){case 1:return r?function(e){return T[e]}:function(e){return E[e]};case 2:return r?function(e){return x[e>>1]}:function(e){return S[e>>1]};case 4:return r?function(e){return C[e>>2]}:function(e){return P[e>>2]};case 8:return r?function(e){return F[e>>3]}:function(e){return I[e>>3]};default:throw new TypeError("invalid integer width (".concat(t,"): ").concat(e))}},Le=8,ke=function(e){Pe(e.$$.ptrType.registeredClass.name+" instance already deleted")},De=!1,Me=function(e){},Oe=function(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)},Ue=function(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=Ue(e,t,r.baseClass);return null===n?null:r.downcast(n)},Be={},We=function(){return Object.keys(Ve).length},Re=function(){var e=[];for(var t in Ve)Ve.hasOwnProperty(t)&&e.push(Ve[t]);return e},Ne=[],Ge=function(){for(;Ne.length;){var e=Ne.pop();e.$$.deleteScheduled=!1,e.delete()}},$e=function(e){Fe=e,Ne.length&&Fe&&Fe(Ge)},Ve={},je=function(e,t){return t=function(e,t){for(void 0===t&&Pe("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),Ve[t]},He=function(e,t){return t.ptrType&&t.ptr||Ee("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Ee("Both smartPtrType and smartPtr must be specified"),t.count={value:1},ze(Object.create(e,{$$:{value:t,writable:!0}}))};function Ye(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=je(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 a(){return this.isSmartPointer?He(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):He(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o,i=this.registeredClass.getActualType(t),c=Be[i];if(!c)return a.call(this);o=this.isConst?c.constPointerType:c.pointerType;var s=Ue(t,this.registeredClass,o.registeredClass);return null===s?a.call(this):this.isSmartPointer?He(o.registeredClass.instancePrototype,{ptrType:o,ptr:s,smartPtrType:this,smartPtr:e}):He(o.registeredClass.instancePrototype,{ptrType:o,ptr:s})}var ze=function(e){return"undefined"==typeof FinalizationRegistry?(ze=function(e){return e},e):(De=new FinalizationRegistry((function(e){console.warn(e.leakWarning.stack.replace(/^Error: /,"")),Oe(e.$$)})),ze=function(e){var t=e.$$;if(t.smartPtr){var r={$$:t},n=t.ptrType.registeredClass;r.leakWarning=new Error("Embind found a leaked C++ instance ".concat(n.name," <").concat(ce(t.ptr),">.\n")+"We'll free it automatically in this case, but this functionality is not reliable across various environments.\nMake sure to invoke .delete() manually once you're done with the instance instead.\nOriginally allocated"),"captureStackTrace"in Error&&Error.captureStackTrace(r.leakWarning,Ye),De.register(e,r,e)}return e},Me=function(e){return De.unregister(e)},ze(e))};function Je(){}var Xe=function(e,t){return Object.defineProperty(t,"name",{value:e})},qe=function(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return e[t].overloadTable.hasOwnProperty(a.length)||Pe("Function '".concat(r,"' called with an invalid number of arguments (").concat(a.length,") - expects one of (").concat(e[t].overloadTable,")!")),e[t].overloadTable[a.length].apply(this,a)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},Ze=function(e,t,r){g.hasOwnProperty(e)?((void 0===r||void 0!==g[e].overloadTable&&void 0!==g[e].overloadTable[r])&&Pe("Cannot register public name '".concat(e,"' twice")),qe(g,e,e),g.hasOwnProperty(r)&&Pe("Cannot register multiple overloads of a function with the same number of arguments (".concat(r,")!")),g[e].overloadTable[r]=t):(g[e]=t,void 0!==r&&(g[e].numArguments=r))};function Ke(e,t,r,n,a,o,i,c){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=i,this.downcast=c,this.pureVirtualFunctions=[]}var Qe=function(e,t,r){for(;t!==r;)t.upcast||Pe("Expected null or instance of ".concat(r.name,", got an instance of ").concat(t.name)),e=t.upcast(e),t=t.baseClass;return e};function et(e,t){if(null===t)return this.isReference&&Pe("null is not a valid ".concat(this.name)),0;t.$$||Pe('Cannot pass "'.concat(Se(t),'" as a ').concat(this.name)),t.$$.ptr||Pe("Cannot pass deleted object as a pointer of type ".concat(this.name));var r=t.$$.ptrType.registeredClass;return Qe(t.$$.ptr,r,this.registeredClass)}function tt(e,t){var r;if(null===t)return this.isReference&&Pe("null is not a valid ".concat(this.name)),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t&&t.$$||Pe('Cannot pass "'.concat(Se(t),'" as a ').concat(this.name)),t.$$.ptr||Pe("Cannot pass deleted object as a pointer of type ".concat(this.name)),!this.isConst&&t.$$.ptrType.isConst&&Pe("Cannot convert argument of type ".concat(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name," to parameter type ").concat(this.name));var n=t.$$.ptrType.registeredClass;if(r=Qe(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&Pe("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:Pe("Cannot convert argument of type ".concat(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name," to parameter type ").concat(this.name));break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var a=t.clone();r=this.rawShare(r,Tt.toHandle((function(){return a.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:Pe("Unsupporting sharing policy")}return r}function rt(e,t){if(null===t)return this.isReference&&Pe("null is not a valid ".concat(this.name)),0;t.$$||Pe('Cannot pass "'.concat(Se(t),'" as a ').concat(this.name)),t.$$.ptr||Pe("Cannot pass deleted object as a pointer of type ".concat(this.name)),t.$$.ptrType.isConst&&Pe("Cannot convert argument of type ".concat(t.$$.ptrType.name," to parameter type ").concat(this.name));var r=t.$$.ptrType.registeredClass;return Qe(t.$$.ptr,r,this.registeredClass)}function nt(e,t,r,n,a,o,i,c,s,u,l){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=i,this.rawGetPointee=c,this.rawConstructor=s,this.rawShare=u,this.rawDestructor=l,a||void 0!==t.baseClass?this.toWireType=tt:n?(this.toWireType=et,this.destructorFunction=null):(this.toWireType=rt,this.destructorFunction=null)}var at,ot,it=[],ct=function(e){var t=it[e];return t||(e>=it.length&&(it.length=e+1),it[e]=t=at.get(e)),D(at.get(e)==t,"JavaScript-side Wasm function table mirror is out of date!"),t},st=function(e,t){e=Ce(e);var r=ct(t);return"function"!=typeof r&&Pe("unknown function pointer with signature ".concat(e,": ").concat(t)),r},ut=function(e){var t=kr(e),r=Ce(t);return Mr(t),r},lt=function(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||we[t]||(Te[t]?Te[t].forEach(e):(r.push(t),n[t]=!0))})),new ot("".concat(e,": ")+r.map(ut).join([", "]))};function ft(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].destructorFunction)return!0;return!1}function dt(t,r){if(!(t instanceof Function))throw new TypeError("new_ called with constructor type ".concat(e(t)," which is not a function"));var n=Xe(t.name||"unknownFunctionName",(function(){}));n.prototype=t.prototype;var a=new n,o=t.apply(a,r);return o instanceof Object?o:a}function mt(e,t,r,n,a,o){var i=t.length;i<2&&Pe("argTypes array size mismatch! Must at least get return value and 'this' types!"),D(!o,"Async bindings are only supported with JSPI.");for(var s=null!==t[1]&&null!==r,u=ft(t),l="void"!==t[0].name,f=[e,Pe,n,a,ve,t[0],t[1]],d=0;d<i-2;++d)f.push(t[d+2]);if(!u)for(d=s?1:2;d<t.length;++d)null!==t[d].destructorFunction&&f.push(t[d].destructorFunction);var m=function(e,t,r,n){for(var a=ft(e),o=e.length,i="",c="",s=0;s<o-2;++s)i+=(0!==s?", ":"")+"arg"+s,c+=(0!==s?", ":"")+"arg"+s+"Wired";var u="\n return function (".concat(i,") {\n if (arguments.length !== ").concat(o-2,") {\n throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ").concat(o-2,"');\n }");a&&(u+="var destructors = [];\n");var l=a?"destructors":"null",f=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];for(t&&(u+="var thisWired = classParam['toWireType']("+l+", this);\n"),s=0;s<o-2;++s)u+="var arg"+s+"Wired = argType"+s+"['toWireType']("+l+", arg"+s+");\n",f.push("argType"+s);if(t&&(c="thisWired"+(c.length>0?", ":"")+c),u+=(r||n?"var rv = ":"")+"invoker(fn"+(c.length>0?", ":"")+c+");\n",a)u+="runDestructors(destructors);\n";else for(s=t?1:2;s<e.length;++s){var d=1===s?"thisWired":"arg"+(s-2)+"Wired";null!==e[s].destructorFunction&&(u+="".concat(d,"_dtor(").concat(d,");\n"),f.push("".concat(d,"_dtor")))}return r&&(u+="var ret = retType['fromWireType'](rv);\nreturn ret;\n"),u+="}\n",[f,u="if (arguments.length !== ".concat(f.length,'){ throw new Error(humanName + "Expected ').concat(f.length,' closure arguments " + arguments.length + " given."); }\n').concat(u)]}(t,s,l,o),g=c(m,2),v=g[0],p=g[1];v.push(p);var h=dt(Function,v).apply(void 0,f);return Xe(e,h)}var gt,vt=function(e,t){for(var r=[],n=0;n<e;n++)r.push(P[t+4*n>>2]);return r},pt=function(e){var t=(e=e.trim()).indexOf("(");return-1!==t?(D(")"==e[e.length-1],"Parentheses for argument names should match."),e.substr(0,t)):e},ht=function(e,t,r){return e instanceof Object||Pe("".concat(r,' with invalid "this": ').concat(e)),e instanceof t.registeredClass.constructor||Pe("".concat(r,' incompatible with "this" of type ').concat(e.constructor.name)),e.$$.ptr||Pe("cannot call emscripten binding method ".concat(r," on deleted object")),Qe(e.$$.ptr,e.$$.ptrType.registeredClass,t.registeredClass)},yt=[],bt=[],_t=function(e){e>9&&0==--bt[e+1]&&(D(void 0!==bt[e],"Decref for unallocated handle."),bt[e]=void 0,yt.push(e))},wt=function(){return bt.length/2-5-yt.length},Tt={toValue:function(e){return e||Pe("Cannot use deleted val. handle = "+e),D(2===e||void 0!==bt[e]&&e%2==0,"invalid handle: ".concat(e)),bt[e]},toHandle:function(e){switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:var t=yt.pop()||bt.length;return bt[t]=e,bt[t+1]=1,t}}},Et={name:"emscripten::val",fromWireType:function(e){var t=Tt.toValue(e);return _t(e),t},toWireType:function(e,t){return Tt.toHandle(t)},argPackAdvance:Le,readValueFromPointer:pe,destructorFunction:null},xt=function(e){return Ae(e,Et)},St=function(e,t,r){switch(t){case 1:return r?function(e){return this.fromWireType(T[e])}:function(e){return this.fromWireType(E[e])};case 2:return r?function(e){return this.fromWireType(x[e>>1])}:function(e){return this.fromWireType(S[e>>1])};case 4:return r?function(e){return this.fromWireType(C[e>>2])}:function(e){return this.fromWireType(P[e>>2])};default:throw new TypeError("invalid integer width (".concat(t,"): ").concat(e))}},Ct=function(e,t){var r=we[e];return void 0===r&&Pe("".concat(t," has unknown type ").concat(ut(e))),r},Pt=function(e,t){switch(t){case 4:return function(e){return this.fromWireType(A[e>>2])};case 8:return function(e){return this.fromWireType(L[e>>3])};default:throw new TypeError("invalid float width (".concat(t,"): ").concat(e))}},At=function(t,r,n,a){if(D("string"==typeof t,"stringToUTF8Array expects a string (got ".concat(e(t),")")),!(a>0))return 0;for(var o=n,i=n+a-1,c=0;c<t.length;++c){var s=t.charCodeAt(c);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++c)),s<=127){if(n>=i)break;r[n++]=s}else if(s<=2047){if(n+1>=i)break;r[n++]=192|s>>6,r[n++]=128|63&s}else if(s<=65535){if(n+2>=i)break;r[n++]=224|s>>12,r[n++]=128|s>>6&63,r[n++]=128|63&s}else{if(n+3>=i)break;s>1114111&&le("Invalid Unicode code point "+ce(s)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),r[n++]=240|s>>18,r[n++]=128|s>>12&63,r[n++]=128|s>>6&63,r[n++]=128|63&s}}return r[n]=0,n-o},Ft=function(e,t,r){return D("number"==typeof r,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),At(e,E,t,r)},It=function(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},Lt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,kt=function(e,t){D(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var r=e,n=r>>1,a=n+t/2;!(n>=a)&&S[n];)++n;if((r=n<<1)-e>32&&Lt)return Lt.decode(E.subarray(e,r));for(var o="",i=0;!(i>=t/2);++i){var c=x[e+2*i>>1];if(0==c)break;o+=String.fromCharCode(c)}return o},Dt=function(e,t,r){var n;if(D(t%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),D("number"==typeof r,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),null!==(n=r)&&void 0!==n||(r=2147483647),r<2)return 0;for(var a=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var c=e.charCodeAt(i);x[t>>1]=c,t+=2}return x[t>>1]=0,t-a},Mt=function(e){return 2*e.length},Ot=function(e,t){D(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var r=0,n="";!(r>=t/4);){var a=C[e+4*r>>2];if(0==a)break;if(++r,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|1023&o)}else n+=String.fromCharCode(a)}return n},Ut=function(e,t,r){var n;if(D(t%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),D("number"==typeof r,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),null!==(n=r)&&void 0!==n||(r=2147483647),r<4)return 0;for(var a=t,o=a+r-4,i=0;i<e.length;++i){var c=e.charCodeAt(i);if(c>=55296&&c<=57343&&(c=65536+((1023&c)<<10)|1023&e.charCodeAt(++i)),C[t>>2]=c,(t+=4)+4>o)break}return C[t>>2]=0,t-a},Bt=function(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},Wt=function(e,t,r){var n=[],a=e.toWireType(n,r);return n.length&&(P[t>>2]=Tt.toHandle(n)),a},Rt=[],Nt={},Gt=function(e){var t=Nt[e];return void 0===t?Ce(e):t},$t=function(){return"object"==("undefined"==typeof globalThis?"undefined":e(globalThis))?globalThis:Function("return this")()};gt=function(){return performance.now()};var Vt,jt,Ht,Yt,zt=function(e){var t=b.buffer,r=(e-t.byteLength+65535)/65536;try{return b.grow(r),M(),1}catch(r){w("growMemory: Attempted to grow heap from ".concat(t.byteLength," bytes to ").concat(e," bytes, but got error: ").concat(r))}},Jt=function(e){var t=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_disjoint_timer_query","EXT_frag_depth","EXT_shader_texture_lod","EXT_sRGB","OES_element_index_uint","OES_fbo_render_mipmap","OES_standard_derivatives","OES_texture_float","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_depth_texture","WEBGL_draw_buffers","EXT_color_buffer_float","EXT_conservative_depth","EXT_disjoint_timer_query_webgl2","EXT_texture_norm16","NV_shader_noperspective_interpolation","WEBGL_clip_cull_distance","EXT_color_buffer_half_float","EXT_depth_clamp","EXT_float_blend","EXT_texture_compression_bptc","EXT_texture_compression_rgtc","EXT_texture_filter_anisotropic","KHR_parallel_shader_compile","OES_texture_float_linear","WEBGL_blend_func_extended","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_debug_renderer_info","WEBGL_debug_shaders","WEBGL_lose_context","WEBGL_multi_draw"];return(e.getSupportedExtensions()||[]).filter((function(e){return t.includes(e)}))},Xt={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){Xt.lastError||(Xt.lastError=e)},getNewId:function(e){for(var t=Xt.counter++,r=e.length;r<t;r++)e[r]=null;return t},genObject:function(e,t,r,n){for(var a=0;a<e;a++){var o=Yt[r](),i=o&&Xt.getNewId(n);o?(o.name=i,n[i]=o):Xt.recordError(1282),C[t+4*a>>2]=i}},getSource:function(e,t,r,n){for(var a="",o=0;o<t;++o){var i=n?P[n+4*o>>2]:void 0;a+=me(P[r+4*o>>2],i)}return a},createContext:function(e,t){e.getContextSafariWebGL2Fixed||(e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=function(t,r){var n=e.getContextSafariWebGL2Fixed(t,r);return"webgl"==t==n instanceof WebGLRenderingContext?n:null});var r=t.majorVersion>1?e.getContext("webgl2",t):e.getContext("webgl",t);return r?Xt.registerContext(r,t):0},registerContext:function(e,t){var r=Xt.getNewId(Xt.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),Xt.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&Xt.initExtensions(n),r},makeContextCurrent:function(e){var t;return Xt.currentContext=Xt.contexts[e],g.ctx=Yt=null===(t=Xt.currentContext)||void 0===t?void 0:t.GLctx,!(e&&!Yt)},getContext:function(e){return Xt.contexts[e]},deleteContext:function(t){Xt.currentContext===Xt.contexts[t]&&(Xt.currentContext=null),"object"==("undefined"==typeof JSEvents?"undefined":e(JSEvents))&&JSEvents.removeAllHandlersOnTarget(Xt.contexts[t].GLctx.canvas),Xt.contexts[t]&&Xt.contexts[t].GLctx.canvas&&(Xt.contexts[t].GLctx.canvas.GLctxObject=void 0),Xt.contexts[t]=null},initExtensions:function(e){if(e||(e=Xt.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t,r=e.GLctx;!function(e){var t=e.getExtension("ANGLE_instanced_arrays");t&&(e.vertexAttribDivisor=function(e,r){return t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,n,a){return t.drawArraysInstancedANGLE(e,r,n,a)},e.drawElementsInstanced=function(e,r,n,a,o){return t.drawElementsInstancedANGLE(e,r,n,a,o)})}(r),function(e){var t=e.getExtension("OES_vertex_array_object");t&&(e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){return t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){return t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)})}(r),function(e){var t=e.getExtension("WEBGL_draw_buffers");t&&(e.drawBuffers=function(e,r){return t.drawBuffersWEBGL(e,r)})}(r),(t=r).dibvbi=t.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"),function(e){e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance")}(r),e.version>=2&&(r.disjointTimerQueryExt=r.getExtension("EXT_disjoint_timer_query_webgl2")),(e.version<2||!r.disjointTimerQueryExt)&&(r.disjointTimerQueryExt=r.getExtension("EXT_disjoint_timer_query")),function(e){e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw")}(r),Jt(r).forEach((function(e){e.includes("lose_context")||e.includes("debug")||r.getExtension(e)}))}}},qt={},Zt=function(){if(!Zt.strings){var t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==("undefined"==typeof navigator?"undefined":e(navigator))&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:"./this.program"};for(var r in qt)void 0===qt[r]?delete t[r]:t[r]=qt[r];var n=[];for(var r in t)n.push("".concat(r,"=").concat(t[r]));Zt.strings=n}return Zt.strings},Kt=function(){return ie||!1},Qt=function(e,t){if(function(){var e=_,t=w,r=!1;_=w=function(e){r=!0};try{rr()}catch(e){}_=e,w=t,r&&(le("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc."),le("(this may also be due to not including full filesystem support - try building with -sFORCE_FILESYSTEM)"))}(),Kt()&&!t){var r="program exited (with status: ".concat(e,"), but keepRuntimeAlive() is set (counter=").concat(0,") due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)");f(r),w(r)}var n;n=e,Kt()||(k=!0),function(e,t){throw t}(0,new ae(n))},er=[null,[],[]],tr=function(e,t){var r=er[e];D(r),0===t||10===t?((1===e?_:w)(de(r,0)),r.length=0):r.push(t)},rr=function(){Or(0),er[1].length&&tr(1,10),er[2].length&&tr(2,10)},nr=function(e){Yt.bindVertexArray(Xt.vaos[e])},ar=nr,or=function(e,t){for(var r=0;r<e;r++){var n=C[t+4*r>>2];Yt.deleteVertexArray(Xt.vaos[n]),Xt.vaos[n]=null}},ir=or,cr=[],sr=function(e,t,r,n){Yt.drawElements(e,t,r,n)},ur=function(e,t){Xt.genObject(e,t,"createVertexArray",Xt.vaos)},lr=ur,fr=function(e,t){P[e>>2]=t;var r=P[e>>2];P[e+4>>2]=(t-r)/4294967296;var n=t>=0?function(e){return P[e>>2]+4294967296*P[e+4>>2]}(e):function(e){return P[e>>2]+4294967296*C[e+4>>2]}(e),a=e>>2;n!=t&&le("writeI53ToI64() out of range: serialized JS Number ".concat(t," to Wasm heap as bytes lo=").concat(ce(P[a]),", hi=").concat(ce(P[a+1]),", which deserializes back to ").concat(n," instead!"))},dr=function(){var e=Jt(Yt);return e=e.concat(e.map((function(e){return"GL_"+e})))},mr=function(t,r,n){if(r){var a=void 0;switch(t){case 36346:a=1;break;case 36344:return void(0!=n&&1!=n&&Xt.recordError(1280));case 34814:case 36345:a=0;break;case 34466:var o=Yt.getParameter(34467);a=o?o.length:0;break;case 33309:if(Xt.currentContext.version<2)return void Xt.recordError(1282);a=dr().length;break;case 33307:case 33308:if(Xt.currentContext.version<2)return void Xt.recordError(1280);a=33307==t?3:0}if(void 0===a){var i=Yt.getParameter(t);switch(e(i)){case"number":a=i;break;case"boolean":a=i?1:0;break;case"string":return void Xt.recordError(1280);case"object":if(null===i)switch(t){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:a=0;break;default:return void Xt.recordError(1280)}else{if(i instanceof Float32Array||i instanceof Uint32Array||i instanceof Int32Array||i instanceof Array){for(var c=0;c<i.length;++c)switch(n){case 0:C[r+4*c>>2]=i[c];break;case 2:A[r+4*c>>2]=i[c];break;case 4:T[r+c]=i[c]?1:0}return}try{a=0|i.name}catch(e){return Xt.recordError(1280),void w("GL_INVALID_ENUM in glGet".concat(n,"v: Unknown object returned from WebGL getParameter(").concat(t,")! (error: ").concat(e,")"))}}break;default:return Xt.recordError(1280),void w("GL_INVALID_ENUM in glGet".concat(n,"v: Native code calling glGet").concat(n,"v(").concat(t,") and it returns ").concat(i," of type ").concat(e(i),"!"))}}switch(n){case 1:fr(r,a);break;case 0:C[r>>2]=a;break;case 2:A[r>>2]=a;break;case 4:T[r]=a?1:0}}else Xt.recordError(1281)},gr=function(e){var t=It(e)+1,r=Dr(t);return r&&Ft(e,r,t),r},vr=function(e){return"]"==e.slice(-1)&&e.lastIndexOf("[")},pr=function(e){return 0==(e-=5120)?T:1==e?E:2==e?x:4==e?C:6==e?A:5==e||28922==e||28520==e||30779==e||30782==e?P:S},hr=function(e,t){return e>>>31-Math.clz32(t.BYTES_PER_ELEMENT)},yr=function(e,t,r,n,a,o){var i=pr(e),c=function(e){return{5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1}(t)*i.BYTES_PER_ELEMENT,s=function(e,t,r,n){var a;return t*(e*r+(a=n)-1&-a)}(r,n,c,Xt.unpackAlignment);return i.subarray(hr(a,i),hr(a+s,i))},br=function(e){var t=Yt.currentProgram;if(t){var r=t.uniformLocsById[e];return"number"==typeof r&&(t.uniformLocsById[e]=r=Yt.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?"[".concat(r,"]"):""))),r}Xt.recordError(1282)},_r=[],wr=[],Tr=function(e){return e%4==0&&(e%100!=0||e%400==0)},Er=[31,29,31,30,31,30,31,31,30,31,30,31],xr=[31,28,31,30,31,30,31,31,30,31,30,31],Sr=function(e,t,r,n){var a=P[n+40>>2],o={tm_sec:C[n>>2],tm_min:C[n+4>>2],tm_hour:C[n+8>>2],tm_mday:C[n+12>>2],tm_mon:C[n+16>>2],tm_year:C[n+20>>2],tm_wday:C[n+24>>2],tm_yday:C[n+28>>2],tm_isdst:C[n+32>>2],tm_gmtoff:C[n+36>>2],tm_zone:a?me(a):""},i=me(r),c={"%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 s in c)i=i.replace(new RegExp(s,"g"),c[s]);var u=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function f(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function d(e,t){return f(e,t,"0")}function m(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 g(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 v(e){var t=function(e,t){for(var r=new Date(e.getTime());t>0;){var n=Tr(r.getFullYear()),a=r.getMonth(),o=(n?Er:xr)[a];if(!(t>o-r.getDate()))return r.setDate(r.getDate()+t),r;t-=o-r.getDate()+1,r.setDate(1),a<11?r.setMonth(a+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),a=g(r),o=g(n);return m(a,t)<=0?m(o,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var p={"%a":function(e){return u[e.tm_wday].substring(0,3)},"%A":function(e){return u[e.tm_wday]},"%b":function(e){return l[e.tm_mon].substring(0,3)},"%B":function(e){return l[e.tm_mon]},"%C":function(e){return d((e.tm_year+1900)/100|0,2)},"%d":function(e){return d(e.tm_mday,2)},"%e":function(e){return f(e.tm_mday,2," ")},"%g":function(e){return v(e).toString().substring(2)},"%G":v,"%H":function(e){return d(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),d(t,2)},"%j":function(e){return d(e.tm_mday+function(e,t){for(var r=0,n=0;n<=t;r+=e[n++]);return r}(Tr(e.tm_year+1900)?Er:xr,e.tm_mon-1),3)},"%m":function(e){return d(e.tm_mon+1,2)},"%M":function(e){return d(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return d(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=e.tm_yday+7-e.tm_wday;return d(Math.floor(t/7),2)},"%V":function(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 d(t,2)},"%w":function(e){return e.tm_wday},"%W":function(e){var t=e.tm_yday+7-(e.tm_wday+6)%7;return d(Math.floor(t/7),2)},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(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":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var s in i=i.replace(/%%/g,"\0\0"),p)i.includes(s)&&(i=i.replace(new RegExp(s,"g"),p[s](o)));i=i.replace(/\0\0/g,"%");var h,y,b,_,w,E,x,S,A=(h=i,y=!1,_=b>0?b:It(h)+1,w=new Array(_),E=At(h,w,0,w.length),y&&(w.length=E),w);return A.length>t?0:(S=e,D((x=A).length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),T.set(x,S),A.length-1)};he=g.InternalError=function(e){function n(e){var t;return a(this,n),(t=o(this,n,[e])).name="InternalError",t}return t(n,e),r(n)}(n(Error)),function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);ye=e}(),be=g.BindingError=function(e){function n(e){var t;return a(this,n),(t=o(this,n,[e])).name="BindingError",t}return t(n,e),r(n)}(n(Error)),Object.assign(Je.prototype,{isAliasOf:function(e){if(!(this instanceof Je))return!1;if(!(e instanceof Je))return!1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,a=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return t===n&&r===a},clone:function(){if(this.$$.ptr||ke(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=ze(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:function(){this.$$.ptr||ke(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Pe("Object already scheduled for deletion"),Me(this),Oe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted:function(){return!this.$$.ptr},deleteLater:function(){return this.$$.ptr||ke(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Pe("Object already scheduled for deletion"),Ne.push(this),1===Ne.length&&Fe&&Fe(Ge),this.$$.deleteScheduled=!0,this}}),g.getInheritedInstanceCount=We,g.getLiveInheritedInstances=Re,g.flushPendingDeletes=Ge,g.setDelayFunction=$e,Object.assign(nt.prototype,{getPointee:function(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor:function(e){var t;null===(t=this.rawDestructor)||void 0===t||t.call(this,e)},argPackAdvance:Le,readValueFromPointer:pe,fromWireType:Ye}),ot=g.UnboundTypeError=(Vt=Error,(Ht=Xe(jt="UnboundTypeError",(function(e){this.name=jt,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(Vt.prototype),Ht.prototype.constructor=Ht,Ht.prototype.toString=function(){return void 0===this.message?this.name:"".concat(this.name,": ").concat(this.message)},Ht),bt.push(0,1,void 0,1,null,1,!0,1,!1,1),D(10===bt.length),g.count_emval_handles=wt;for(var Cr=0;Cr<32;++Cr)cr.push(new Array(Cr));var Pr=new Float32Array(288);for(Cr=0;Cr<288;++Cr)_r[Cr]=Pr.subarray(0,Cr);var Ar=new Int32Array(288);for(Cr=0;Cr<288;++Cr)wr[Cr]=Ar.subarray(0,Cr);var Fr,Ir={__assert_fail:function(e,t,r,n){j("Assertion failed: ".concat(me(e),", at: ")+[t?me(t):"unknown filename",r,n?me(n):"unknown function"])},_abort_js:function(){j("native code called abort()")},_embind_finalize_value_object:function(e){var t=ge[e];delete ge[e];var r=t.rawConstructor,n=t.rawDestructor,a=t.fields,o=a.map((function(e){return e.getterReturnType})).concat(a.map((function(e){return e.setterArgumentType})));xe([e],o,(function(e){var o={};return a.forEach((function(t,r){var n=t.fieldName,i=e[r],c=t.getter,s=t.getterContext,u=e[r+a.length],l=t.setter,f=t.setterContext;o[n]={read:function(e){return i.fromWireType(c(s,e))},write:function(e,t){var r=[];l(f,e,u.toWireType(r,t)),ve(r)}}})),[{name:t.name,fromWireType:function(e){var t={};for(var r in o)t[r]=o[r].read(e);return n(e),t},toWireType:function(e,t){for(var a in o)if(!(a in t))throw new TypeError('Missing field: "'.concat(a,'"'));var i=r();for(a in o)o[a].write(i,t[a]);return null!==e&&e.push(n,i),i},argPackAdvance:Le,readValueFromPointer:pe,destructorFunction:n}]}))},_embind_register_bigint:function(e,t,r,n,a){var o=-1!=(t=Ce(t)).indexOf("u");o&&(a=(1n<<64n)-1n),Ae(e,{name:t,fromWireType:function(e){return e},toWireType:function(e,r){if("bigint"!=typeof r&&"number"!=typeof r)throw new TypeError('Cannot convert "'.concat(Se(r),'" to ').concat(this.name));if("number"==typeof r&&(r=BigInt(r)),r<n||r>a)throw new TypeError('Passing a number "'.concat(Se(r),'" from JS side to C/C++ side to an argument of type "').concat(t,'", which is outside the valid range [').concat(n,", ").concat(a,"]!"));return r},argPackAdvance:Le,readValueFromPointer:Ie(t,r,!o),destructorFunction:null})},_embind_register_bool:function(e,t,r,n){Ae(e,{name:t=Ce(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:n},argPackAdvance:Le,readValueFromPointer:function(e){return this.fromWireType(E[e])},destructorFunction:null})},_embind_register_class:function(e,t,r,n,a,o,i,c,s,u,l,f,d){l=Ce(l),o=st(a,o),c&&(c=st(i,c)),u&&(u=st(s,u)),d=st(f,d);var m=function(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?"_".concat(e):e}(l);Ze(m,(function(){lt("Cannot construct ".concat(l," due to unbound types"),[n])})),xe([e,t,r],n?[n]:[],(function(t){var r,a;t=t[0],a=n?(r=t.registeredClass).instancePrototype:Je.prototype;var i=Xe(l,(function(){if(Object.getPrototypeOf(this)!==s)throw new be("Use 'new' to construct "+l);if(void 0===p.constructor_body)throw new be(l+" has no accessible constructor");for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=p.constructor_body[t.length];if(void 0===n)throw new be("Tried to invoke ctor of ".concat(l," with invalid number of parameters (").concat(t.length,") - expected (").concat(Object.keys(p.constructor_body).toString(),") parameters instead!"));return n.apply(this,t)})),s=Object.create(a,{constructor:{value:i}});i.prototype=s;var f,v,p=new Ke(l,i,s,d,r,o,c,u);p.baseClass&&(null!==(v=(f=p.baseClass).__derivedClasses)&&void 0!==v||(f.__derivedClasses=[]),p.baseClass.__derivedClasses.push(p));var h=new nt(l,p,!0,!1,!1),y=new nt(l+"*",p,!1,!1,!1),b=new nt(l+" const*",p,!1,!0,!1);return Be[e]={pointerType:y,constPointerType:b},function(e,t,r){g.hasOwnProperty(e)||Ee("Replacing nonexistent public symbol"),void 0!==g[e].overloadTable&&void 0!==r?g[e].overloadTable[r]=t:(g[e]=t,g[e].argCount=r)}(m,i),[h,y,b]}))},_embind_register_class_class_function:function(e,t,r,n,a,o,c,s){var u=vt(r,n);t=Ce(t),t=pt(t),o=st(a,o),xe([],[e],(function(e){e=e[0];var n="".concat(e.name,".").concat(t);function a(){lt("Cannot call ".concat(n," due to unbound types"),u)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var l=e.registeredClass.constructor;return void 0===l[t]?(a.argCount=r-1,l[t]=a):(qe(l,t,n),l[t].overloadTable[r-1]=a),xe([],u,(function(a){var u=[a[0],null].concat(a.slice(1)),f=mt(n,u,null,o,c,s);if(void 0===l[t].overloadTable?(f.argCount=r-1,l[t]=f):l[t].overloadTable[r-1]=f,e.registeredClass.__derivedClasses){var d,m=i(e.registeredClass.__derivedClasses);try{for(m.s();!(d=m.n()).done;){var g=d.value;g.constructor.hasOwnProperty(t)||(g.constructor[t]=f)}}catch(e){m.e(e)}finally{m.f()}}return[]})),[]}))},_embind_register_class_constructor:function(e,t,r,n,a,o){D(t>0);var i=vt(t,r);a=st(n,a),xe([],[e],(function(e){e=e[0];var r="constructor ".concat(e.name);if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new be("Cannot register multiple constructors with identical number of parameters (".concat(t-1,") for class '").concat(e.name,"'! Overload resolution is currently only performed using the parameter count, not actual type info!"));return e.registeredClass.constructor_body[t-1]=function(){lt("Cannot construct ".concat(e.name," due to unbound types"),i)},xe([],i,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=mt(r,n,null,a,o),[]})),[]}))},_embind_register_class_function:function(e,t,r,n,a,o,i,c,s){var u=vt(r,n);t=Ce(t),t=pt(t),o=st(a,o),xe([],[e],(function(e){e=e[0];var n="".concat(e.name,".").concat(t);function a(){lt("Cannot call ".concat(n," due to unbound types"),u)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),c&&e.registeredClass.pureVirtualFunctions.push(t);var l=e.registeredClass.instancePrototype,f=l[t];return void 0===f||void 0===f.overloadTable&&f.className!==e.name&&f.argCount===r-2?(a.argCount=r-2,a.className=e.name,l[t]=a):(qe(l,t,n),l[t].overloadTable[r-2]=a),xe([],u,(function(a){var c=mt(n,a,e,o,i,s);return void 0===l[t].overloadTable?(c.argCount=r-2,l[t]=c):l[t].overloadTable[r-2]=c,[]})),[]}))},_embind_register_class_property:function(e,t,r,n,a,o,i,c,s,u){t=Ce(t),a=st(n,a),xe([],[e],(function(e){e=e[0];var n="".concat(e.name,".").concat(t),l={get:function(){lt("Cannot access ".concat(n," due to unbound types"),[r,i])},enumerable:!0,configurable:!0};return l.set=s?function(){return lt("Cannot access ".concat(n," due to unbound types"),[r,i])}:function(e){return Pe(n+" is a read-only property")},Object.defineProperty(e.registeredClass.instancePrototype,t,l),xe([],s?[r,i]:[r],(function(r){var i=r[0],l={get:function(){var t=ht(this,e,n+" getter");return i.fromWireType(a(o,t))},enumerable:!0};if(s){s=st(c,s);var f=r[1];l.set=function(t){var r=ht(this,e,n+" setter"),a=[];s(u,r,f.toWireType(a,t)),ve(a)}}return Object.defineProperty(e.registeredClass.instancePrototype,t,l),[]})),[]}))},_embind_register_emval:xt,_embind_register_enum:function(e,t,r,n){function a(){}t=Ce(t),a.values={},Ae(e,{name:t,constructor:a,fromWireType:function(e){return this.constructor.values[e]},toWireType:function(e,t){return t.value},argPackAdvance:Le,readValueFromPointer:St(t,r,n),destructorFunction:null}),Ze(t,a)},_embind_register_enum_value:function(e,t,r){var n=Ct(e,"enum");t=Ce(t);var a=n.constructor,o=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:Xe("".concat(n.name,"_").concat(t),(function(){}))}});a.values[r]=o,a[t]=o},_embind_register_float:function(e,t,r){Ae(e,{name:t=Ce(t),fromWireType:function(e){return e},toWireType:function(e,t){if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError("Cannot convert ".concat(Se(t)," to ").concat(d.name));return t},argPackAdvance:Le,readValueFromPointer:Pt(t,r),destructorFunction:null})},_embind_register_integer:function(e,t,r,n,a){t=Ce(t),-1===a&&(a=4294967295);var o=function(e){return e};if(0===n){var i=32-8*r;o=function(e){return e<<i>>>i}}var c=t.includes("unsigned"),s=function(e,r){if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError('Cannot convert "'.concat(Se(e),'" to ').concat(r));if(e<n||e>a)throw new TypeError('Passing a number "'.concat(Se(e),'" from JS side to C/C++ side to an argument of type "').concat(t,'", which is outside the valid range [').concat(n,", ").concat(a,"]!"))};Ae(e,{name:t,fromWireType:o,toWireType:c?function(e,t){return s(t,this.name),t>>>0}:function(e,t){return s(t,this.name),t},argPackAdvance:Le,readValueFromPointer:Ie(t,r,0!==n),destructorFunction:null})},_embind_register_memory_view:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function a(e){var t=P[e>>2],r=P[e+4>>2];return new n(T.buffer,r,t)}Ae(e,{name:r=Ce(r),fromWireType:a,argPackAdvance:Le,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},_embind_register_optional:function(e,t){xt(e)},_embind_register_smart_ptr:function(e,t,r,n,a,o,i,c,s,u,l,f){r=Ce(r),o=st(a,o),c=st(i,c),u=st(s,u),f=st(l,f),xe([e],[t],(function(e){return e=e[0],[new nt(r,e.registeredClass,!1,!1,!0,e,n,o,c,u,f)]}))},_embind_register_std_string:function(e,t){var r="std::string"===(t=Ce(t));Ae(e,{name:t,fromWireType:function(e){var t,n=P[e>>2],a=e+4;if(r)for(var o=a,i=0;i<=n;++i){var c=a+i;if(i==n||0==E[c]){var s=me(o,c-o);void 0===t?t=s:(t+=String.fromCharCode(0),t+=s),o=c+1}}else{var u=new Array(n);for(i=0;i<n;++i)u[i]=String.fromCharCode(E[a+i]);t=u.join("")}return Mr(e),t},toWireType:function(e,t){var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var a="string"==typeof t;a||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||Pe("Cannot pass non-string to std::string"),n=r&&a?It(t):t.length;var o=Dr(4+n+1),i=o+4;if(P[o>>2]=n,r&&a)Ft(t,i,n+1);else if(a)for(var c=0;c<n;++c){var s=t.charCodeAt(c);s>255&&(Mr(i),Pe("String has UTF-16 code units that do not fit in 8 bits")),E[i+c]=s}else for(c=0;c<n;++c)E[i+c]=t[c];return null!==e&&e.push(Mr,o),o},argPackAdvance:Le,readValueFromPointer:pe,destructorFunction:function(e){Mr(e)}})},_embind_register_std_wstring:function(e,t,r){var n,a,o,i;r=Ce(r),2===t?(n=kt,a=Dt,i=Mt,o=function(e){return S[e>>1]}):4===t&&(n=Ot,a=Ut,i=Bt,o=function(e){return P[e>>2]}),Ae(e,{name:r,fromWireType:function(e){for(var r,a=P[e>>2],i=e+4,c=0;c<=a;++c){var s=e+4+c*t;if(c==a||0==o(s)){var u=n(i,s-i);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),i=s+t}}return Mr(e),r},toWireType:function(e,n){"string"!=typeof n&&Pe("Cannot pass non-string to C++ string type ".concat(r));var o=i(n),c=Dr(4+o+t);return P[c>>2]=o/t,a(n,c+4,o+t),null!==e&&e.push(Mr,c),c},argPackAdvance:Le,readValueFromPointer:pe,destructorFunction:function(e){Mr(e)}})},_embind_register_value_object:function(e,t,r,n,a,o){ge[e]={name:Ce(t),rawConstructor:st(r,n),rawDestructor:st(a,o),fields:[]}},_embind_register_value_object_field:function(e,t,r,n,a,o,i,c,s,u){ge[e].fields.push({fieldName:Ce(t),getterReturnType:r,getter:st(n,a),getterContext:o,setterArgumentType:i,setter:st(c,s),setterContext:u})},_embind_register_void:function(e,t){Ae(e,{isVoid:!0,name:t=Ce(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},_emscripten_get_now_is_monotonic:function(){return 1},_emscripten_throw_longjmp:function(){throw 1/0},_emval_as:function(e,t,r){return e=Tt.toValue(e),t=Ct(t,"emval::as"),Wt(t,r,e)},_emval_call:function(e,t,r,n){return(e=Rt[e])(null,t=Tt.toValue(t),r,n)},_emval_call_method:function(e,t,r,n,a){return(e=Rt[e])(t=Tt.toValue(t),t[r=Gt(r)],n,a)},_emval_decref:_t,_emval_get_global:function(e){return 0===e?Tt.toHandle($t()):(e=Gt(e),Tt.toHandle($t()[e]))},_emval_get_method_caller:function(e,t,r){var n=function(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=Ct(P[t+4*n>>2],"parameter "+n);return r}(e,t),a=n.shift();e--;var o="return function (obj, func, destructorsRef, args) {\n",i=0,c=[];0===r&&c.push("obj");for(var s=["retType"],u=[a],l=0;l<e;++l)c.push("arg"+l),s.push("argType"+l),u.push(n[l]),o+=" var arg".concat(l," = argType").concat(l,".readValueFromPointer(args").concat(i?"+"+i:"",");\n"),i+=n[l].argPackAdvance;o+=" var rv = ".concat(1===r?"new func":"func.call","(").concat(c.join(", "),");\n"),a.isVoid||(s.push("emval_returnValue"),u.push(Wt),o+=" return emval_returnValue(retType, destructorsRef, rv);\n"),o+="};\n",s.push(o);var f,d,m=dt(Function,s).apply(void 0,u),g="methodCaller<(".concat(n.map((function(e){return e.name})).join(", "),") => ").concat(a.name,">");return f=Xe(g,m),d=Rt.length,Rt.push(f),d},_emval_get_module_property:function(e){return e=Gt(e),Tt.toHandle(g[e])},_emval_get_property:function(e,t){return e=Tt.toValue(e),t=Tt.toValue(t),Tt.toHandle(e[t])},_emval_incref:function(e){e>9&&(bt[e+1]+=1)},_emval_new_array:function(){return Tt.toHandle([])},_emval_new_cstring:function(e){return Tt.toHandle(Gt(e))},_emval_run_destructors:function(e){var t=Tt.toValue(e);ve(t),_t(e)},_emval_take_value:function(e,t){var r=(e=Ct(e,"_emval_take_value")).readValueFromPointer(t);return Tt.toHandle(r)},_gmtime_js:function(e,t){var r;e=(r=e)<-9007199254740992||r>9007199254740992?NaN:Number(r);var n=new Date(1e3*e);C[t>>2]=n.getUTCSeconds(),C[t+4>>2]=n.getUTCMinutes(),C[t+8>>2]=n.getUTCHours(),C[t+12>>2]=n.getUTCDate(),C[t+16>>2]=n.getUTCMonth(),C[t+20>>2]=n.getUTCFullYear()-1900,C[t+24>>2]=n.getUTCDay();var a=Date.UTC(n.getUTCFullYear(),0,1,0,0,0,0),o=(n.getTime()-a)/864e5|0;C[t+28>>2]=o},_tzset_js:function(e,t,r,n){var a=(new Date).getFullYear(),o=new Date(a,0,1),i=new Date(a,6,1),c=o.getTimezoneOffset(),s=i.getTimezoneOffset(),u=Math.max(c,s);P[e>>2]=60*u,C[t>>2]=Number(c!=s);var l=function(e){return e.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1]},f=l(o),d=l(i);D(f),D(d),D(It(f)<=16,"timezone name truncated to fit in TZNAME_MAX (".concat(f,")")),D(It(d)<=16,"timezone name truncated to fit in TZNAME_MAX (".concat(d,")")),s<c?(Ft(f,r,17),Ft(d,n,17)):(Ft(f,n,17),Ft(d,r,17))},emscripten_cancel_animation_frame:function(e){return cancelAnimationFrame(e)},emscripten_date_now:function(){return Date.now()},emscripten_get_now:gt,emscripten_request_animation_frame:function(e,t){return requestAnimationFrame((function(r){return ct(e)(r,t)}))},emscripten_resize_heap:function(e){var t=E.length;D((e>>>=0)>t);var r=2147483648;if(e>r)return w("Cannot enlarge memory, requested ".concat(e," bytes, but the limit is ").concat(r," bytes!")),!1;for(var n,a,o=1;o<=4;o*=2){var i=t*(1+.2/o);i=Math.min(i,e+100663296);var c=Math.min(r,(n=Math.max(e,i))+((a=65536)-n%a)%a);if(zt(c))return!0}return w("Failed to grow the heap from ".concat(t," bytes to ").concat(c," bytes, not enough memory!")),!1},emscripten_webgl_make_context_current:function(e){return Xt.makeContextCurrent(e)?0:-5},environ_get:function(e,t){var r=0;return Zt().forEach((function(n,a){var o=t+r;P[e+4*a>>2]=o,function(e,t){for(var r=0;r<e.length;++r)D(e.charCodeAt(r)===(255&e.charCodeAt(r))),T[t++]=e.charCodeAt(r);T[t]=0}(n,o),r+=n.length+1})),0},environ_sizes_get:function(e,t){var r=Zt();P[e>>2]=r.length;var n=0;return r.forEach((function(e){return n+=e.length+1})),P[t>>2]=n,0},exit:Qt,fd_close:function(e){j("fd_close called without SYSCALLS_REQUIRE_FILESYSTEM")},fd_seek:function(e,t,r,n){return 70},fd_write:function(e,t,r,n){for(var a=0,o=0;o<r;o++){var i=P[t>>2],c=P[t+4>>2];t+=8;for(var s=0;s<c;s++)tr(e,E[i+s]);a+=c}return P[n>>2]=a,0},glActiveTexture:function(e){return Yt.activeTexture(e)},glAttachShader:function(e,t){Yt.attachShader(Xt.programs[e],Xt.shaders[t])},glBindAttribLocation:function(e,t,r){Yt.bindAttribLocation(Xt.programs[e],t,me(r))},glBindBuffer:function(e,t){35051==e?Yt.currentPixelPackBufferBinding=t:35052==e&&(Yt.currentPixelUnpackBufferBinding=t),Yt.bindBuffer(e,Xt.buffers[t])},glBindFramebuffer:function(e,t){Yt.bindFramebuffer(e,Xt.framebuffers[t])},glBindRenderbuffer:function(e,t){Yt.bindRenderbuffer(e,Xt.renderbuffers[t])},glBindSampler:function(e,t){Yt.bindSampler(e,Xt.samplers[t])},glBindTexture:function(e,t){Yt.bindTexture(e,Xt.textures[t])},glBindVertexArray:nr,glBindVertexArrayOES:ar,glBlendColor:function(e,t,r,n){return Yt.blendColor(e,t,r,n)},glBlendEquation:function(e){return Yt.blendEquation(e)},glBlendFunc:function(e,t){return Yt.blendFunc(e,t)},glBlitFramebuffer:function(e,t,r,n,a,o,i,c,s,u){return Yt.blitFramebuffer(e,t,r,n,a,o,i,c,s,u)},glBufferData:function(e,t,r,n){Xt.currentContext.version>=2?r&&t?Yt.bufferData(e,E,n,r,t):Yt.bufferData(e,t,n):Yt.bufferData(e,r?E.subarray(r,r+t):t,n)},glBufferSubData:function(e,t,r,n){Xt.currentContext.version>=2?r&&Yt.bufferSubData(e,t,E,n,r):Yt.bufferSubData(e,t,E.subarray(n,n+r))},glCheckFramebufferStatus:function(e){return Yt.checkFramebufferStatus(e)},glClear:function(e){return Yt.clear(e)},glClearColor:function(e,t,r,n){return Yt.clearColor(e,t,r,n)},glClearStencil:function(e){return Yt.clearStencil(e)},glClientWaitSync:function(e,t,r){return r=Number(r),Yt.clientWaitSync(Xt.syncs[e],t,r)},glColorMask:function(e,t,r,n){Yt.colorMask(!!e,!!t,!!r,!!n)},glCompileShader:function(e){Yt.compileShader(Xt.shaders[e])},glCompressedTexImage2D:function(e,t,r,n,a,o,i,c){if(Xt.currentContext.version>=2)return Yt.currentPixelUnpackBufferBinding||!i?void Yt.compressedTexImage2D(e,t,r,n,a,o,i,c):void Yt.compressedTexImage2D(e,t,r,n,a,o,E,c,i);Yt.compressedTexImage2D(e,t,r,n,a,o,c?E.subarray(c,c+i):null)},glCompressedTexSubImage2D:function(e,t,r,n,a,o,i,c,s){if(Xt.currentContext.version>=2)return Yt.currentPixelUnpackBufferBinding||!c?void Yt.compressedTexSubImage2D(e,t,r,n,a,o,i,c,s):void Yt.compressedTexSubImage2D(e,t,r,n,a,o,i,E,s,c);Yt.compressedTexSubImage2D(e,t,r,n,a,o,i,s?E.subarray(s,s+c):null)},glCopyBufferSubData:function(e,t,r,n,a){return Yt.copyBufferSubData(e,t,r,n,a)},glCopyTexSubImage2D:function(e,t,r,n,a,o,i,c){return Yt.copyTexSubImage2D(e,t,r,n,a,o,i,c)},glCreateProgram:function(){var e=Xt.getNewId(Xt.programs),t=Yt.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,Xt.programs[e]=t,e},glCreateShader:function(e){var t=Xt.getNewId(Xt.shaders);return Xt.shaders[t]=Yt.createShader(e),t},glCullFace:function(e){return Yt.cullFace(e)},glDeleteBuffers:function(e,t){for(var r=0;r<e;r++){var n=C[t+4*r>>2],a=Xt.buffers[n];a&&(Yt.deleteBuffer(a),a.name=0,Xt.buffers[n]=null,n==Yt.currentPixelPackBufferBinding&&(Yt.currentPixelPackBufferBinding=0),n==Yt.currentPixelUnpackBufferBinding&&(Yt.currentPixelUnpackBufferBinding=0))}},glDeleteFramebuffers:function(e,t){for(var r=0;r<e;++r){var n=C[t+4*r>>2],a=Xt.framebuffers[n];a&&(Yt.deleteFramebuffer(a),a.name=0,Xt.framebuffers[n]=null)}},glDeleteProgram:function(e){if(e){var t=Xt.programs[e];t?(Yt.deleteProgram(t),t.name=0,Xt.programs[e]=null):Xt.recordError(1281)}},glDeleteRenderbuffers:function(e,t){for(var r=0;r<e;r++){var n=C[t+4*r>>2],a=Xt.renderbuffers[n];a&&(Yt.deleteRenderbuffer(a),a.name=0,Xt.renderbuffers[n]=null)}},glDeleteSamplers:function(e,t){for(var r=0;r<e;r++){var n=C[t+4*r>>2],a=Xt.samplers[n];a&&(Yt.deleteSampler(a),a.name=0,Xt.samplers[n]=null)}},glDeleteShader:function(e){if(e){var t=Xt.shaders[e];t?(Yt.deleteShader(t),Xt.shaders[e]=null):Xt.recordError(1281)}},glDeleteSync:function(e){if(e){var t=Xt.syncs[e];t?(Yt.deleteSync(t),t.name=0,Xt.syncs[e]=null):Xt.recordError(1281)}},glDeleteTextures:function(e,t){for(var r=0;r<e;r++){var n=C[t+4*r>>2],a=Xt.textures[n];a&&(Yt.deleteTexture(a),a.name=0,Xt.textures[n]=null)}},glDeleteVertexArrays:or,glDeleteVertexArraysOES:ir,glDepthMask:function(e){Yt.depthMask(!!e)},glDisable:function(e){return Yt.disable(e)},glDisableVertexAttribArray:function(e){Yt.disableVertexAttribArray(e)},glDrawArrays:function(e,t,r){Yt.drawArrays(e,t,r)},glDrawArraysInstanced:function(e,t,r,n){Yt.drawArraysInstanced(e,t,r,n)},glDrawArraysInstancedBaseInstanceWEBGL:function(e,t,r,n,a){Yt.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,t,r,n,a)},glDrawBuffers:function(e,t){for(var r=cr[e],n=0;n<e;n++)r[n]=C[t+4*n>>2];Yt.drawBuffers(r)},glDrawElements:sr,glDrawElementsInstanced:function(e,t,r,n,a){Yt.drawElementsInstanced(e,t,r,n,a)},glDrawElementsInstancedBaseVertexBaseInstanceWEBGL:function(e,t,r,n,a,o,i){Yt.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,t,r,n,a,o,i)},glDrawRangeElements:function(e,t,r,n,a,o){sr(e,n,a,o)},glEnable:function(e){return Yt.enable(e)},glEnableVertexAttribArray:function(e){Yt.enableVertexAttribArray(e)},glFenceSync:function(e,t){var r=Yt.fenceSync(e,t);if(r){var n=Xt.getNewId(Xt.syncs);return r.name=n,Xt.syncs[n]=r,n}return 0},glFinish:function(){return Yt.finish()},glFlush:function(){return Yt.flush()},glFramebufferRenderbuffer:function(e,t,r,n){Yt.framebufferRenderbuffer(e,t,r,Xt.renderbuffers[n])},glFramebufferTexture2D:function(e,t,r,n,a){Yt.framebufferTexture2D(e,t,r,Xt.textures[n],a)},glFrontFace:function(e){return Yt.frontFace(e)},glGenBuffers:function(e,t){Xt.genObject(e,t,"createBuffer",Xt.buffers)},glGenFramebuffers:function(e,t){Xt.genObject(e,t,"createFramebuffer",Xt.framebuffers)},glGenRenderbuffers:function(e,t){Xt.genObject(e,t,"createRenderbuffer",Xt.renderbuffers)},glGenSamplers:function(e,t){Xt.genObject(e,t,"createSampler",Xt.samplers)},glGenTextures:function(e,t){Xt.genObject(e,t,"createTexture",Xt.textures)},glGenVertexArrays:ur,glGenVertexArraysOES:lr,glGenerateMipmap:function(e){return Yt.generateMipmap(e)},glGetBufferParameteriv:function(e,t,r){r?C[r>>2]=Yt.getBufferParameter(e,t):Xt.recordError(1281)},glGetError:function(){var e=Yt.getError()||Xt.lastError;return Xt.lastError=0,e},glGetFloatv:function(e,t){return mr(e,t,2)},glGetFramebufferAttachmentParameteriv:function(e,t,r,n){var a=Yt.getFramebufferAttachmentParameter(e,t,r);(a instanceof WebGLRenderbuffer||a instanceof WebGLTexture)&&(a=0|a.name),C[n>>2]=a},glGetIntegerv:function(e,t){return mr(e,t,0)},glGetProgramInfoLog:function(e,t,r,n){var a=Yt.getProgramInfoLog(Xt.programs[e]);null===a&&(a="(unknown error)");var o=t>0&&n?Ft(a,n,t):0;r&&(C[r>>2]=o)},glGetProgramiv:function(e,t,r){if(r)if(e>=Xt.counter)Xt.recordError(1281);else if(e=Xt.programs[e],35716==t){var n=Yt.getProgramInfoLog(e);null===n&&(n="(unknown error)"),C[r>>2]=n.length+1}else if(35719==t){if(!e.maxUniformLength)for(var a=0;a<Yt.getProgramParameter(e,35718);++a)e.maxUniformLength=Math.max(e.maxUniformLength,Yt.getActiveUniform(e,a).name.length+1);C[r>>2]=e.maxUniformLength}else if(35722==t){if(!e.maxAttributeLength)for(a=0;a<Yt.getProgramParameter(e,35721);++a)e.maxAttributeLength=Math.max(e.maxAttributeLength,Yt.getActiveAttrib(e,a).name.length+1);C[r>>2]=e.maxAttributeLength}else if(35381==t){if(!e.maxUniformBlockNameLength)for(a=0;a<Yt.getProgramParameter(e,35382);++a)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,Yt.getActiveUniformBlockName(e,a).length+1);C[r>>2]=e.maxUniformBlockNameLength}else C[r>>2]=Yt.getProgramParameter(e,t);else Xt.recordError(1281)},glGetRenderbufferParameteriv:function(e,t,r){r?C[r>>2]=Yt.getRenderbufferParameter(e,t):Xt.recordError(1281)},glGetShaderInfoLog:function(e,t,r,n){var a=Yt.getShaderInfoLog(Xt.shaders[e]);null===a&&(a="(unknown error)");var o=t>0&&n?Ft(a,n,t):0;r&&(C[r>>2]=o)},glGetShaderPrecisionFormat:function(e,t,r,n){var a=Yt.getShaderPrecisionFormat(e,t);C[r>>2]=a.rangeMin,C[r+4>>2]=a.rangeMax,C[n>>2]=a.precision},glGetShaderiv:function(e,t,r){if(r)if(35716==t){var n=Yt.getShaderInfoLog(Xt.shaders[e]);null===n&&(n="(unknown error)");var a=n?n.length+1:0;C[r>>2]=a}else if(35720==t){var o=Yt.getShaderSource(Xt.shaders[e]),i=o?o.length+1:0;C[r>>2]=i}else C[r>>2]=Yt.getShaderParameter(Xt.shaders[e],t);else Xt.recordError(1281)},glGetString:function(e){var t=Xt.stringCache[e];if(!t){switch(e){case 7939:t=gr(dr().join(" "));break;case 7936:case 7937:case 37445:case 37446:var r=Yt.getParameter(e);r||Xt.recordError(1280),t=r?gr(r):0;break;case 7938:var n=Yt.getParameter(7938);n=Xt.currentContext.version>=2?"OpenGL ES 3.0 (".concat(n,")"):"OpenGL ES 2.0 (".concat(n,")"),t=gr(n);break;case 35724:var a=Yt.getParameter(35724),o=a.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==o&&(3==o[1].length&&(o[1]=o[1]+"0"),a="OpenGL ES GLSL ES ".concat(o[1]," (").concat(a,")")),t=gr(a);break;default:Xt.recordError(1280)}Xt.stringCache[e]=t}return t},glGetStringi:function(e,t){if(Xt.currentContext.version<2)return Xt.recordError(1282),0;var r=Xt.stringiCache[e];if(r)return t<0||t>=r.length?(Xt.recordError(1281),0):r[t];if(7939===e){var n=dr().map(gr);return r=Xt.stringiCache[e]=n,t<0||t>=r.length?(Xt.recordError(1281),0):r[t]}return Xt.recordError(1280),0},glGetUniformLocation:function(e,t){if(t=me(t),e=Xt.programs[e]){!function(e){var t,r,n=e.uniformLocsById,a=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},t=0;t<Yt.getProgramParameter(e,35718);++t){var o=Yt.getActiveUniform(e,t),i=o.name,c=o.size,s=vr(i),u=s>0?i.slice(0,s):i,l=e.uniformIdCounter;for(e.uniformIdCounter+=c,a[u]=[c,l],r=0;r<c;++r)n[l]=r,e.uniformArrayNamesById[l++]=u}}(e);var r=e.uniformLocsById,n=0,a=t,o=vr(t);o>0&&(c=t.slice(o+1),n=parseInt(c)>>>0,a=t.slice(0,o));var i=e.uniformSizeAndIdsByName[a];if(i&&n<i[0]&&(r[n+=i[1]]=r[n]||Yt.getUniformLocation(e,t)))return n}else Xt.recordError(1281);var c;return-1},glInvalidateFramebuffer:function(e,t,r){for(var n=cr[t],a=0;a<t;a++)n[a]=C[r+4*a>>2];Yt.invalidateFramebuffer(e,n)},glInvalidateSubFramebuffer:function(e,t,r,n,a,o,i){for(var c=cr[t],s=0;s<t;s++)c[s]=C[r+4*s>>2];Yt.invalidateSubFramebuffer(e,c,n,a,o,i)},glIsSync:function(e){return Yt.isSync(Xt.syncs[e])},glIsTexture:function(e){var t=Xt.textures[e];return t?Yt.isTexture(t):0},glLineWidth:function(e){return Yt.lineWidth(e)},glLinkProgram:function(e){e=Xt.programs[e],Yt.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},glMultiDrawArraysInstancedBaseInstanceWEBGL:function(e,t,r,n,a,o){Yt.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,C,t>>2,C,r>>2,C,n>>2,P,a>>2,o)},glMultiDrawElementsInstancedBaseVertexBaseInstanceWEBGL:function(e,t,r,n,a,o,i,c){Yt.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,C,t>>2,r,C,n>>2,C,a>>2,C,o>>2,P,i>>2,c)},glPixelStorei:function(e,t){3317==e&&(Xt.unpackAlignment=t),Yt.pixelStorei(e,t)},glReadBuffer:function(e){return Yt.readBuffer(e)},glReadPixels:function(e,t,r,n,a,o,i){if(Xt.currentContext.version>=2){if(Yt.currentPixelPackBufferBinding)return void Yt.readPixels(e,t,r,n,a,o,i);var c=pr(o),s=hr(i,c);Yt.readPixels(e,t,r,n,a,o,c,s)}else{var u=yr(o,a,r,n,i);u?Yt.readPixels(e,t,r,n,a,o,u):Xt.recordError(1280)}},glRenderbufferStorage:function(e,t,r,n){return Yt.renderbufferStorage(e,t,r,n)},glRenderbufferStorageMultisample:function(e,t,r,n,a){return Yt.renderbufferStorageMultisample(e,t,r,n,a)},glSamplerParameterf:function(e,t,r){Yt.samplerParameterf(Xt.samplers[e],t,r)},glSamplerParameteri:function(e,t,r){Yt.samplerParameteri(Xt.samplers[e],t,r)},glSamplerParameteriv:function(e,t,r){var n=C[r>>2];Yt.samplerParameteri(Xt.samplers[e],t,n)},glScissor:function(e,t,r,n){return Yt.scissor(e,t,r,n)},glShaderSource:function(e,t,r,n){var a=Xt.getSource(e,t,r,n);Yt.shaderSource(Xt.shaders[e],a)},glStencilFunc:function(e,t,r){return Yt.stencilFunc(e,t,r)},glStencilFuncSeparate:function(e,t,r,n){return Yt.stencilFuncSeparate(e,t,r,n)},glStencilMask:function(e){return Yt.stencilMask(e)},glStencilMaskSeparate:function(e,t){return Yt.stencilMaskSeparate(e,t)},glStencilOp:function(e,t,r){return Yt.stencilOp(e,t,r)},glStencilOpSeparate:function(e,t,r,n){return Yt.stencilOpSeparate(e,t,r,n)},glTexImage2D:function(e,t,r,n,a,o,i,c,s){if(Xt.currentContext.version>=2){if(Yt.currentPixelUnpackBufferBinding)return void Yt.texImage2D(e,t,r,n,a,o,i,c,s);if(s){var u=pr(c),l=hr(s,u);return void Yt.texImage2D(e,t,r,n,a,o,i,c,u,l)}}var f=s?yr(c,i,n,a,s):null;Yt.texImage2D(e,t,r,n,a,o,i,c,f)},glTexParameterf:function(e,t,r){return Yt.texParameterf(e,t,r)},glTexParameterfv:function(e,t,r){var n=A[r>>2];Yt.texParameterf(e,t,n)},glTexParameteri:function(e,t,r){return Yt.texParameteri(e,t,r)},glTexParameteriv:function(e,t,r){var n=C[r>>2];Yt.texParameteri(e,t,n)},glTexStorage2D:function(e,t,r,n,a){return Yt.texStorage2D(e,t,r,n,a)},glTexSubImage2D:function(e,t,r,n,a,o,i,c,s){if(Xt.currentContext.version>=2){if(Yt.currentPixelUnpackBufferBinding)return void Yt.texSubImage2D(e,t,r,n,a,o,i,c,s);if(s){var u=pr(c);return void Yt.texSubImage2D(e,t,r,n,a,o,i,c,u,hr(s,u))}}var l=s?yr(c,i,a,o,s):null;Yt.texSubImage2D(e,t,r,n,a,o,i,c,l)},glUniform1f:function(e,t){Yt.uniform1f(br(e),t)},glUniform1fv:function(e,t,r){if(Xt.currentContext.version>=2)t&&Yt.uniform1fv(br(e),A,r>>2,t);else{if(t<=288)for(var n=_r[t],a=0;a<t;++a)n[a]=A[r+4*a>>2];else n=A.subarray(r>>2,r+4*t>>2);Yt.uniform1fv(br(e),n)}},glUniform1i:function(e,t){Yt.uniform1i(br(e),t)},glUniform1iv:function(e,t,r){if(Xt.currentContext.version>=2)t&&Yt.uniform1iv(br(e),C,r>>2,t);else{if(t<=288)for(var n=wr[t],a=0;a<t;++a)n[a]=C[r+4*a>>2];else n=C.subarray(r>>2,r+4*t>>2);Yt.uniform1iv(br(e),n)}},glUniform2f:function(e,t,r){Yt.uniform2f(br(e),t,r)},glUniform2fv:function(e,t,r){if(Xt.currentContext.version>=2)t&&Yt.uniform2fv(br(e),A,r>>2,2*t);else{if(t<=144)for(var n=_r[2*t],a=0;a<2*t;a+=2)n[a]=A[r+4*a>>2],n[a+1]=A[r+(4*a+4)>>2];else n=A.subarray(r>>2,r+8*t>>2);Yt.uniform2fv(br(e),n)}},glUniform2i:function(e,t,r){Yt.uniform2i(br(e),t,r)},glUniform2iv:function(e,t,r){if(Xt.currentContext.version>=2)t&&Yt.uniform2iv(br(e),C,r>>2,2*t);else{if(t<=144)for(var n=wr[2*t],a=0;a<2*t;a+=2)n[a]=C[r+4*a>>2],n[a+1]=C[r+(4*a+4)>>2];else n=C.subarray(r>>2,r+8*t>>2);Yt.uniform2iv(br(e),n)}},glUniform3f:function(e,t,r,n){Yt.uniform3f(br(e),t,r,n)},glUniform3fv:function(e,t,r){if(Xt.currentContext.version>=2)t&&Yt.uniform3fv(br(e),A,r>>2,3*t);else{if(t<=96)for(var n=_r[3*t],a=0;a<3*t;a+=3)n[a]=A[r+4*a>>2],n[a+1]=A[r+(4*a+4)>>2],n[a+2]=A[r+(4*a+8)>>2];else n=A.subarray(r>>2,r+12*t>>2);Yt.uniform3fv(br(e),n)}},glUniform3i:function(e,t,r,n){Yt.uniform3i(br(e),t,r,n)},glUniform3iv:function(e,t,r){if(Xt.currentContext.version>=2)t&&Yt.uniform3iv(br(e),C,r>>2,3*t);else{if(t<=96)for(var n=wr[3*t],a=0;a<3*t;a+=3)n[a]=C[r+4*a>>2],n[a+1]=C[r+(4*a+4)>>2],n[a+2]=C[r+(4*a+8)>>2];else n=C.subarray(r>>2,r+12*t>>2);Yt.uniform3iv(br(e),n)}},glUniform4f:function(e,t,r,n,a){Yt.uniform4f(br(e),t,r,n,a)},glUniform4fv:function(e,t,r){if(Xt.currentContext.version>=2)t&&Yt.uniform4fv(br(e),A,r>>2,4*t);else{if(t<=72){var n=_r[4*t],a=A;r>>=2;for(var o=0;o<4*t;o+=4){var i=r+o;n[o]=a[i],n[o+1]=a[i+1],n[o+2]=a[i+2],n[o+3]=a[i+3]}}else n=A.subarray(r>>2,r+16*t>>2);Yt.uniform4fv(br(e),n)}},glUniform4i:function(e,t,r,n,a){Yt.uniform4i(br(e),t,r,n,a)},glUniform4iv:function(e,t,r){if(Xt.currentContext.version>=2)t&&Yt.uniform4iv(br(e),C,r>>2,4*t);else{if(t<=72)for(var n=wr[4*t],a=0;a<4*t;a+=4)n[a]=C[r+4*a>>2],n[a+1]=C[r+(4*a+4)>>2],n[a+2]=C[r+(4*a+8)>>2],n[a+3]=C[r+(4*a+12)>>2];else n=C.subarray(r>>2,r+16*t>>2);Yt.uniform4iv(br(e),n)}},glUniformMatrix2fv:function(e,t,r,n){if(Xt.currentContext.version>=2)t&&Yt.uniformMatrix2fv(br(e),!!r,A,n>>2,4*t);else{if(t<=72)for(var a=_r[4*t],o=0;o<4*t;o+=4)a[o]=A[n+4*o>>2],a[o+1]=A[n+(4*o+4)>>2],a[o+2]=A[n+(4*o+8)>>2],a[o+3]=A[n+(4*o+12)>>2];else a=A.subarray(n>>2,n+16*t>>2);Yt.uniformMatrix2fv(br(e),!!r,a)}},glUniformMatrix3fv:function(e,t,r,n){if(Xt.currentContext.version>=2)t&&Yt.uniformMatrix3fv(br(e),!!r,A,n>>2,9*t);else{if(t<=32)for(var a=_r[9*t],o=0;o<9*t;o+=9)a[o]=A[n+4*o>>2],a[o+1]=A[n+(4*o+4)>>2],a[o+2]=A[n+(4*o+8)>>2],a[o+3]=A[n+(4*o+12)>>2],a[o+4]=A[n+(4*o+16)>>2],a[o+5]=A[n+(4*o+20)>>2],a[o+6]=A[n+(4*o+24)>>2],a[o+7]=A[n+(4*o+28)>>2],a[o+8]=A[n+(4*o+32)>>2];else a=A.subarray(n>>2,n+36*t>>2);Yt.uniformMatrix3fv(br(e),!!r,a)}},glUniformMatrix4fv:function(e,t,r,n){if(Xt.currentContext.version>=2)t&&Yt.uniformMatrix4fv(br(e),!!r,A,n>>2,16*t);else{if(t<=18){var a=_r[16*t],o=A;n>>=2;for(var i=0;i<16*t;i+=16){var c=n+i;a[i]=o[c],a[i+1]=o[c+1],a[i+2]=o[c+2],a[i+3]=o[c+3],a[i+4]=o[c+4],a[i+5]=o[c+5],a[i+6]=o[c+6],a[i+7]=o[c+7],a[i+8]=o[c+8],a[i+9]=o[c+9],a[i+10]=o[c+10],a[i+11]=o[c+11],a[i+12]=o[c+12],a[i+13]=o[c+13],a[i+14]=o[c+14],a[i+15]=o[c+15]}}else a=A.subarray(n>>2,n+64*t>>2);Yt.uniformMatrix4fv(br(e),!!r,a)}},glUseProgram:function(e){e=Xt.programs[e],Yt.useProgram(e),Yt.currentProgram=e},glVertexAttrib1f:function(e,t){return Yt.vertexAttrib1f(e,t)},glVertexAttrib2fv:function(e,t){Yt.vertexAttrib2f(e,A[t>>2],A[t+4>>2])},glVertexAttrib3fv:function(e,t){Yt.vertexAttrib3f(e,A[t>>2],A[t+4>>2],A[t+8>>2])},glVertexAttrib4fv:function(e,t){Yt.vertexAttrib4f(e,A[t>>2],A[t+4>>2],A[t+8>>2],A[t+12>>2])},glVertexAttribDivisor:function(e,t){Yt.vertexAttribDivisor(e,t)},glVertexAttribIPointer:function(e,t,r,n,a){Yt.vertexAttribIPointer(e,t,r,n,a)},glVertexAttribPointer:function(e,t,r,n,a,o){Yt.vertexAttribPointer(e,t,r,!!n,a,o)},glViewport:function(e,t,r,n){return Yt.viewport(e,t,r,n)},glWaitSync:function(e,t,r){r=Number(r),Yt.waitSync(Xt.syncs[e],t,r)},invoke_ii:function(e,t){var r=ue();try{return ct(e)(t)}catch(e){if(se(r),e!==e+0)throw e;Ur(1,0)}},invoke_iii:function(e,t,r){var n=ue();try{return ct(e)(t,r)}catch(e){if(se(n),e!==e+0)throw e;Ur(1,0)}},invoke_iiii:function(e,t,r,n){var a=ue();try{return ct(e)(t,r,n)}catch(e){if(se(a),e!==e+0)throw e;Ur(1,0)}},invoke_iiiii:function(e,t,r,n,a){var o=ue();try{return ct(e)(t,r,n,a)}catch(e){if(se(o),e!==e+0)throw e;Ur(1,0)}},invoke_iiiiii:function(e,t,r,n,a,o){var i=ue();try{return ct(e)(t,r,n,a,o)}catch(e){if(se(i),e!==e+0)throw e;Ur(1,0)}},invoke_iiiiiii:function(e,t,r,n,a,o,i){var c=ue();try{return ct(e)(t,r,n,a,o,i)}catch(e){if(se(c),e!==e+0)throw e;Ur(1,0)}},invoke_v:function(e){var t=ue();try{ct(e)()}catch(e){if(se(t),e!==e+0)throw e;Ur(1,0)}},invoke_vi:function(e,t){var r=ue();try{ct(e)(t)}catch(e){if(se(r),e!==e+0)throw e;Ur(1,0)}},invoke_vii:function(e,t,r){var n=ue();try{ct(e)(t,r)}catch(e){if(se(n),e!==e+0)throw e;Ur(1,0)}},invoke_viii:function(e,t,r,n){var a=ue();try{ct(e)(t,r,n)}catch(e){if(se(a),e!==e+0)throw e;Ur(1,0)}},invoke_viiii:function(e,t,r,n,a){var o=ue();try{ct(e)(t,r,n,a)}catch(e){if(se(o),e!==e+0)throw e;Ur(1,0)}},invoke_viiiii:function(e,t,r,n,a,o){var i=ue();try{ct(e)(t,r,n,a,o)}catch(e){if(se(i),e!==e+0)throw e;Ur(1,0)}},invoke_viiiiii:function(e,t,r,n,a,o,i){var c=ue();try{ct(e)(t,r,n,a,o,i)}catch(e){if(se(c),e!==e+0)throw e;Ur(1,0)}},invoke_viiiiiiiii:function(e,t,r,n,a,o,i,c,s,u){var l=ue();try{ct(e)(t,r,n,a,o,i,c,s,u)}catch(e){if(se(l),e!==e+0)throw e;Ur(1,0)}},strftime_l:function(e,t,r,n,a){return Sr(e,t,r,n)}},Lr=function(){var e,t={env:Ir,wasi_snapshot_preview1:Ir};function r(e,t){var r;return Lr=e.exports,D(b=Lr.memory,"memory not found in wasm exports"),M(),D(at=Lr.__indirect_function_table,"table not found in wasm exports"),r=Lr.__wasm_call_ctors,B.unshift(r),function(e){if(N--,e?(D(V[e]),delete V[e]):w("warning: run dependency removed without ID"),0==N&&(null!==G&&(clearInterval(G),G=null),$)){var t=$;$=null,t()}}("wasm-instantiate"),Lr}N++,(e="wasm-instantiate")?(D(!V[e]),V[e]=1,null===G&&"undefined"!=typeof setInterval&&(G=setInterval((function(){if(k)return clearInterval(G),void(G=null);var e=!1;for(var t in V)e||(e=!0,w("still waiting on run dependencies:")),w("dependency: ".concat(t));e&&w("(end of list)")}),1e4))):w("warning: run dependency added without ID");var n,a,o,i,c=g;if(g.instantiateWasm)try{return g.instantiateWasm(t,r)}catch(e){w("Module.instantiateWasm callback failed with error: ".concat(e)),f(e)}return Y||(Y=q()),(n=y,a=Y,o=t,i=function(e){D(g===c,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),c=null,r(e.instance)},n||"function"!=typeof WebAssembly.instantiateStreaming||z(a)||"function"!=typeof fetch?K(a,o,i):fetch(a,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,o).then(i,(function(e){return w("wasm streaming compile failed: ".concat(e)),w("falling back to ArrayBuffer instantiation"),K(a,o,i)}))}))).catch(f),{}}(),kr=X("__getTypeName",1),Dr=g._malloc=X("malloc",1),Mr=g._free=X("free",1),Or=X("fflush",1),Ur=X("setThrew",2),Br=function(){return(Br=Lr.emscripten_stack_init)()},Wr=function(){return(Wr=Lr.emscripten_stack_get_end)()},Rr=function(e){return(Rr=Lr._emscripten_stack_restore)(e)},Nr=function(){return(Nr=Lr.emscripten_stack_get_current)()};function Gr(){var e;Br(),D(0==(3&(e=Wr()))),0==e&&(e+=4),P[e>>2]=34821223,P[e+4>>2]=2310721022,P[0]=1668509029}function $r(){N>0||(Gr(),oe(U),N>0||(Fr||(Fr=!0,g.calledRun=!0,k||(D(!R),R=!0,O(),oe(B),l(g),D(!g._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),O(),oe(W))),O()))}g.GL=Xt,["writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","stackAlloc","getTempRet0","setTempRet0","zeroMemory","ydayFromDate","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","initRandomFill","randomFill","emscriptenLog","readEmAsmArgs","listenOnce","autoResumeAudioContext","getDynCaller","dynCall","handleException","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","HandleAllocator","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","stringToUTF8OnStack","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","getCallstack","convertPCtoSourceLocation","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","safeSetTimeout","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","Browser_asyncPrepareDataCounter","setMainLoop","getSocketFromFD","getSocketAddress","emscriptenWebGLGetUniform","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","emscriptenWebGLGetIndexed","getFunctionArgsName","createJsInvokerSignature","registerInheritedInstance","unregisterInheritedInstance","writeGLArray","registerWebGlEventCallback","fetchDeleteCachedData","fetchLoadCachedData","fetchCacheData","fetchXHR"].forEach((function(e){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get:function(){var t="`".concat(e,"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line"),r=e;r.startsWith("_")||(r="$"+e),t+=" (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='".concat(r,"')"),te(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),le(t)}}),ne(e)})),["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createLazyFile","FS_createLink","FS_createDevice","FS_readFile","out","err","callMain","abort","wasmMemory","wasmExports","HEAPF32","HEAPF64","HEAP_DATA_VIEW","HEAP8","HEAPU8","HEAP16","HEAPU16","HEAP32","HEAPU32","HEAP64","HEAPU64","writeStackCookie","checkStackCookie","writeI53ToI64","readI53FromI64","readI53FromU64","MAX_INT53","MIN_INT53","bigintToI53Checked","stackSave","stackRestore","ptrToString","exitJS","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","arraySum","addDays","ERRNO_CODES","ERRNO_MESSAGES","DNS","Protocols","Sockets","timers","warnOnce","readEmAsmArgsArray","jstoi_q","jstoi_s","getExecutableName","keepRuntimeAlive","wasmTable","noExitRuntime","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToNewUTF8","writeArrayToMemory","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","UNWIND_CACHE","ExitStatus","getEnvStrings","flush_NO_FILESYSTEM","promiseMap","Browser","getPreloadedImageData__data","wget","SYSCALLS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","heapObjectForWebGLType","toTypedArrayIndex","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","webgl_enable_WEBGL_draw_instanced_base_vertex_base_instance","webgl_enable_WEBGL_multi_draw_instanced_base_vertex_base_instance","InternalError","BindingError","throwInternalError","throwBindingError","registeredTypes","awaitingDependencies","typeDependencies","tupleRegistrations","structRegistrations","sharedRegisterType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","getFunctionName","heap32VectorToArray","requireRegisteredType","usesDestructorStack","createJsInvoker","UnboundTypeError","PureVirtualError","GenericWireTypeSize","EmValType","init_embind","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredPointers","registerType","integerReadValueFromPointer","enumReadValueFromPointer","floatReadValueFromPointer","readPointer","runDestructors","newFunc","craftInvokerFunction","embind__requireFunction","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","throwInstanceAlreadyDeleted","deletionQueue","flushPendingDeletes","delayFunction","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_freelist","emval_handles","emval_symbols","init_emval","count_emval_handles","getStringOrSymbol","Emval","emval_get_global","emval_returnValue","emval_lookupTypes","emval_methodCallers","emval_addMethodCaller","reflectConstruct","Fetch"].forEach(ne),$=function e(){Fr||$r(),Fr||($=e)},$r(),s=v;for(var Vr=function(){var e=Hr[jr];e in m||Object.defineProperty(m,e,{configurable:!0,get:function(){j("Access to module property ('".concat(e,"') is no longer possible via the module constructor argument; Instead, use the result of the module constructor."))}})},jr=0,Hr=Object.keys(g);jr<Hr.length;jr++)Vr();return s});"object"===("undefined"==typeof exports?"undefined":e(exports))&&"object"===("undefined"==typeof module?"undefined":e(module))?module.exports=l:"function"==typeof define&&define.amd&&define([],(function(){return l}));
|