
let Module = {};
Module["instantiateWasm"] = function(imports, successCallback) {
	let wasmbin = Krom.loadBlob("data/plugins/import_usdc.wasm");
	let module = new WebAssembly.Module(wasmbin);
	let inst = new WebAssembly.Instance(module, imports);
	successCallback(inst);
	return inst.exports;
};
Module.print = console.log;
Module.printErr = console.log;

// emscripten-generated glue
var m,g=g||("undefined"!=typeof Module?Module:{}),k={};for(m in g)g.hasOwnProperty(m)&&(k[m]=g[m]);var aa="./this.program",ba=function(e){return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(ca("object"==typeof(e=read(e,"binary"))),e)};"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print);var x,noExitRuntime,da=g.print||console.log.bind(console),t=g.printErr||console.warn.bind(console);for(m in k)k.hasOwnProperty(m)&&(g[m]=k[m]);k=null,g.thisProgram&&(aa=g.thisProgram),g.wasmBinary&&(x=g.wasmBinary),g.noExitRuntime&&(noExitRuntime=g.noExitRuntime),"object"!=typeof WebAssembly&&z("no native wasm support detected");var ea,fa=!1;function ca(e){e||z("Assertion failed: undefined")}var F,G,E,H,ha="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(e,n,t){var r=n+t;for(t=n;e[t]&&!(r<=t);)++t;if(16<t-n&&e.subarray&&ha)return ha.decode(e.subarray(n,t));for(r="";n<t;){var a,o,i=e[n++];128&i?(a=63&e[n++],192==(224&i)?r+=String.fromCharCode((31&i)<<6|a):(o=63&e[n++],(i=224==(240&i)?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&e[n++])<65536?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)))):r+=String.fromCharCode(i)}return r}function D(e){return e?B(E,e,void 0):""}function ia(e){F=e,g.HEAP8=G=new Int8Array(e),g.HEAP16=new Int16Array(e),g.HEAP32=H=new Int32Array(e),g.HEAPU8=E=new Uint8Array(e),g.HEAPU16=new Uint16Array(e),g.HEAPU32=new Uint32Array(e),g.HEAPF32=new Float32Array(e),g.HEAPF64=new Float64Array(e)}var A,ja=g.INITIAL_MEMORY||16777216;(A=g.wasmMemory?g.wasmMemory:new WebAssembly.Memory({initial:ja/65536,maximum:32768}))&&(F=A.buffer),ja=F.byteLength,ia(F);var ka=[],la=[],ma=[],na=[];function oa(){var e=g.preRun.shift();ka.unshift(e)}var pa=Math.abs,qa=Math.ceil,ra=Math.floor,sa=Math.min,I=0,ta=null,J=null;function z(e){throw g.onAbort&&g.onAbort(e),t(e),fa=!0,new WebAssembly.RuntimeError("abort("+e+"). Build with -s ASSERTIONS=1 for more info.")}function ua(){var e=K;return String.prototype.startsWith?e.startsWith("data:application/octet-stream;base64,"):0===e.indexOf("data:application/octet-stream;base64,")}g.preloadedImages={},g.preloadedAudios={};var va,L,xa,K="import_usdc.wasm";function wa(){try{if(x)return new Uint8Array(x);if(ba)return ba(K);throw"both async and sync fetching of the wasm failed"}catch(e){z(e)}}function M(e){for(;0<e.length;){var n,t=e.shift();"function"==typeof t?t(g):"number"==typeof(n=t.ua)?void 0===t.ca?ea.get(n)():ea.get(n)(t.ca):n(void 0===t.ca?null:t.ca)}}ua()||(va=K,K=g.locateFile?g.locateFile(va,""):""+va);var Aa,ya={};function za(){if(!Aa){var e,n={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:aa||"./this.program"};for(e in ya)n[e]=ya[e];var t=[];for(e in n)t.push(e+"="+n[e]);Aa=t}return Aa}function Ba(e,n){for(var t=0,r=e.length-1;0<=r;r--){var a=e[r];"."===a?e.splice(r,1):".."===a?(e.splice(r,1),t++):t&&(e.splice(r,1),t--)}if(n)for(;t;t--)e.unshift("..");return e}function N(e){var n="/"===e.charAt(0),t="/"===e.substr(-1);return(e=Ba(e.split("/").filter(function(e){return!!e}),!n).join("/"))||n||(e="."),e&&t&&(e+="/"),(n?"/":"")+e}function Ca(e){var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=n[0],n=n[1],e||n?e+(n=n&&n.substr(0,n.length-1)):"."}function Da(e){if("/"===e)return"/";var n=(e=(e=N(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===n?e:e.substr(n+1)}function Ea(){if("object"!=typeof crypto||"function"!=typeof crypto.getRandomValues)return function(){z("randomDevice")};var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}function O(){for(var e="",n=!1,t=arguments.length-1;-1<=t&&!n;t--){if("string"!=typeof(n=0<=t?arguments[t]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,n="/"===n.charAt(0)}return(n?"/":"")+(e=Ba(e.split("/").filter(function(e){return!!e}),!n).join("/"))||"."}var Fa=[];function Ga(e,n){Fa[e]={input:[],G:[],P:n},Ha(e,Ia)}var Ia={open:function(e){var n=Fa[e.node.Y];if(!n)throw new P(43);e.I=n,e.seekable=!1},close:function(e){e.I.P.flush(e.I)},flush:function(e){e.I.P.flush(e.I)},read:function(e,n,t,r){if(!e.I||!e.I.P.la)throw new P(60);for(var a=0,o=0;o<r;o++){try{var i=e.I.P.la(e.I)}catch(e){throw new P(29)}if(void 0===i&&0===a)throw new P(6);if(null==i)break;a++,n[t+o]=i}return a&&(e.node.timestamp=Date.now()),a},write:function(e,n,t,r){if(!e.I||!e.I.P.ea)throw new P(60);try{for(var a=0;a<r;a++)e.I.P.ea(e.I,n[t+a])}catch(e){throw new P(29)}return r&&(e.node.timestamp=Date.now()),a}},Ka={la:function(e){if(!e.input.length){var n=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(n=window.prompt("Input: "))&&(n+="\n"):"function"==typeof readline&&(null!==(n=readline())&&(n+="\n")),!n)return null;e.input=Ja(n,!0)}return e.input.shift()},ea:function(e,n){null===n||10===n?(da(B(e.G,0)),e.G=[]):0!=n&&e.G.push(n)},flush:function(e){e.G&&0<e.G.length&&(da(B(e.G,0)),e.G=[])}},La={ea:function(e,n){null===n||10===n?(t(B(e.G,0)),e.G=[]):0!=n&&e.G.push(n)},flush:function(e){e.G&&0<e.G.length&&(t(B(e.G,0)),e.G=[])}},Q={J:null,L:function(){return Q.createNode(null,"/",16895,0)},createNode:function(e,n,t,r){if(24576==(61440&t)||4096==(61440&t))throw new P(63);return Q.J||(Q.J={dir:{node:{M:Q.C.M,K:Q.C.K,S:Q.C.S,W:Q.C.W,qa:Q.C.qa,sa:Q.C.sa,ra:Q.C.ra,pa:Q.C.pa,Z:Q.C.Z},stream:{N:Q.D.N}},file:{node:{M:Q.C.M,K:Q.C.K},stream:{N:Q.D.N,read:Q.D.read,write:Q.D.write,ga:Q.D.ga,ma:Q.D.ma,oa:Q.D.oa}},link:{node:{M:Q.C.M,K:Q.C.K,T:Q.C.T},stream:{}},ha:{node:{M:Q.C.M,K:Q.C.K},stream:Ma}}),16384==(61440&(t=Na(e,n,t,r)).mode)?(t.C=Q.J.dir.node,t.D=Q.J.dir.stream,t.B={}):32768==(61440&t.mode)?(t.C=Q.J.file.node,t.D=Q.J.file.stream,t.F=0,t.B=null):40960==(61440&t.mode)?(t.C=Q.J.link.node,t.D=Q.J.link.stream):8192==(61440&t.mode)&&(t.C=Q.J.ha.node,t.D=Q.J.ha.stream),t.timestamp=Date.now(),e&&(e.B[n]=t),t},Ka:function(e){if(e.B&&e.B.subarray){for(var n=[],t=0;t<e.F;++t)n.push(e.B[t]);return n}return e.B},La:function(e){return e.B?e.B.subarray?e.B.subarray(0,e.F):new Uint8Array(e.B):new Uint8Array(0)},ia:function(e,n){var t=e.B?e.B.length:0;n<=t||(n=Math.max(n,t*(t<1048576?2:1.125)>>>0),0!=t&&(n=Math.max(n,256)),t=e.B,e.B=new Uint8Array(n),0<e.F&&e.B.set(t.subarray(0,e.F),0))},ya:function(e,n){if(e.F!=n)if(0==n)e.B=null,e.F=0;else{if(!e.B||e.B.subarray){var t=e.B;e.B=new Uint8Array(n),t&&e.B.set(t.subarray(0,Math.min(n,e.F)))}else if(e.B||(e.B=[]),e.B.length>n)e.B.length=n;else for(;e.B.length<n;)e.B.push(0);e.F=n}},C:{M:function(e){var n={};return n.Ja=8192==(61440&e.mode)?e.id:1,n.Na=e.id,n.mode=e.mode,n.Pa=1,n.uid=0,n.Ma=0,n.Y=e.Y,16384==(61440&e.mode)?n.size=4096:32768==(61440&e.mode)?n.size=e.F:40960==(61440&e.mode)?n.size=e.link.length:n.size=0,n.Ga=new Date(e.timestamp),n.Oa=new Date(e.timestamp),n.Ia=new Date(e.timestamp),n.ta=4096,n.Ha=Math.ceil(n.size/n.ta),n},K:function(e,n){void 0!==n.mode&&(e.mode=n.mode),void 0!==n.timestamp&&(e.timestamp=n.timestamp),void 0!==n.size&&Q.ya(e,n.size)},S:function(){throw Oa[44]},W:function(e,n,t,r){return Q.createNode(e,n,t,r)},qa:function(e,n,t){if(16384==(61440&e.mode)){try{var r=R(n,t)}catch(e){}if(r)for(var a in r.B)throw new P(55)}delete e.parent.B[e.name],e.name=t,(n.B[t]=e).parent=n},sa:function(e,n){delete e.B[n]},ra:function(e,n){var t,r=R(e,n);for(t in r.B)throw new P(55);delete e.B[n]},pa:function(e){var n,t=[".",".."];for(n in e.B)e.B.hasOwnProperty(n)&&t.push(n);return t},Z:function(e,n,t){return(e=Q.createNode(e,n,41471,0)).link=t,e},T:function(e){if(40960!=(61440&e.mode))throw new P(28);return e.link}},D:{read:function(e,n,t,r,a){var o=e.node.B;if(a>=e.node.F)return 0;if(8<(e=Math.min(e.node.F-a,r))&&o.subarray)n.set(o.subarray(a,a+e),t);else for(r=0;r<e;r++)n[t+r]=o[a+r];return e},write:function(e,n,t,r,a,o){if(n.buffer===G.buffer&&(o=!1),!r)return 0;if((e=e.node).timestamp=Date.now(),n.subarray&&(!e.B||e.B.subarray)){if(o)return e.B=n.subarray(t,t+r),e.F=r;if(0===e.F&&0===a)return e.B=n.slice(t,t+r),e.F=r;if(a+r<=e.F)return e.B.set(n.subarray(t,t+r),a),r}if(Q.ia(e,a+r),e.B.subarray&&n.subarray)e.B.set(n.subarray(t,t+r),a);else for(o=0;o<r;o++)e.B[a+o]=n[t+o];return e.F=Math.max(e.F,a+r),r},N:function(e,n,t){if(1===t?n+=e.position:2===t&&32768==(61440&e.node.mode)&&(n+=e.node.F),n<0)throw new P(28);return n},ga:function(e,n,t){Q.ia(e.node,n+t),e.node.F=Math.max(e.node.F,n+t)},ma:function(e,n,t,r,a,o){if(ca(0===n),32768!=(61440&e.node.mode))throw new P(43);if(e=e.node.B,2&o||e.buffer!==F){for((0<r||r+t<e.length)&&(e=e.subarray?e.subarray(r,r+t):Array.prototype.slice.call(e,r,r+t)),r=!0,o=16384*Math.ceil(t/16384),n=Pa(o);t<o;)G[n+t++]=0;if(!(t=n))throw new P(48);G.set(e,t)}else r=!1,t=e.byteOffset;return{Ra:t,Fa:r}},oa:function(e,n,t,r,a){if(32768!=(61440&e.node.mode))throw new P(43);return 2&a||Q.D.write(e,n,0,r,t,!1),0}}},Qa=null,Ra={},S=[],Sa=1,T=null,Ta=!0,U={},P=null,Oa={};function V(e,n){if(n=n||{},!(e=O("/",e)))return{path:"",node:null};var t={ka:!0,fa:0};for(a in t)void 0===n[a]&&(n[a]=t[a]);if(8<n.fa)throw new P(32);e=Ba(e.split("/").filter(function(e){return!!e}),!1);for(var r=Qa,t="/",a=0;a<e.length;a++){var o=a===e.length-1;if(o&&n.parent)break;if(r=R(r,e[a]),t=N(t+"/"+e[a]),r.X&&(!o||o&&n.ka)&&(r=r.X.root),!o||n.ja)for(o=0;40960==(61440&r.mode);)if(r=Ua(t),r=V(t=O(Ca(t),r),{fa:n.fa}).node,40<o++)throw new P(32)}return{path:t,node:r}}function Va(e){for(var n;;){if(e===e.parent)return e=e.L.na,n?"/"!==e[e.length-1]?e+"/"+n:e+n:e;n=n?e.name+"/"+n:e.name,e=e.parent}}function Wa(e,n){for(var t=0,r=0;r<n.length;r++)t=(t<<5)-t+n.charCodeAt(r)|0;return(e+t>>>0)%T.length}function R(e,n){var t;if(t=(t=W(e,"x"))?t:e.C.S?0:2)throw new P(t,e);for(t=T[Wa(e.id,n)];t;t=t.wa){var r=t.name;if(t.parent.id===e.id&&r===n)return t}return e.C.S(e,n)}function Na(e,n,t,r){return n=Wa((e=new Xa(e,n,t,r)).parent.id,e.name),e.wa=T[n],T[n]=e}var Ya={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Za(e){var n=["r","w","rw"][3&e];return 512&e&&(n+="w"),n}function W(e,n){return Ta||(-1===n.indexOf("r")||292&e.mode)&&(-1===n.indexOf("w")||146&e.mode)&&(-1===n.indexOf("x")||73&e.mode)?0:2}function $a(e,n){try{return R(e,n),20}catch(e){}return W(e,"wx")}function ab(){for(var e=0;e<=4096;e++)if(!S[e])return e;throw new P(33)}function bb(e){X||((X=function(){}).prototype={});var n,t=new X;for(n in e)t[n]=e[n];return e=t,t=ab(),e.O=t,S[t]=e}var lb,Ma={open:function(e){e.D=Ra[e.node.Y].D,e.D.open&&e.D.open(e)},N:function(){throw new P(70)}};function Ha(e,n){Ra[e]={D:n}}function cb(e,n){var t="/"===n,r=!n;if(t&&Qa)throw new P(10);if(!t&&!r){var a=V(n,{ka:!1});if(n=a.path,(a=a.node).X)throw new P(10);if(16384!=(61440&a.mode))throw new P(54)}n={type:e,Qa:{},na:n,va:[]},((e=e.L(n)).L=n).root=e,t?Qa=e:a&&(a.X=n,a.L&&a.L.va.push(n))}function eb(e,n,t){var r=V(e,{parent:!0}).node;if(!(e=Da(e))||"."===e||".."===e)throw new P(28);var a=$a(r,e);if(a)throw new P(a);if(!r.C.W)throw new P(63);return r.C.W(r,e,n,t)}function Y(e){eb(e,16895,0)}function fb(e,n,t){void 0===t&&(t=n,n=438),eb(e,8192|n,t)}function gb(e,n){if(!O(e))throw new P(44);var t=V(n,{parent:!0}).node;if(!t)throw new P(44);var r=$a(t,n=Da(n));if(r)throw new P(r);if(!t.C.Z)throw new P(63);t.C.Z(t,n,e)}function Ua(e){if(!(e=V(e).node))throw new P(44);if(!e.C.T)throw new P(28);return O(Va(e.parent),e.C.T(e))}function hb(n,e){if(""===n)throw new P(44);if("string"==typeof e){var r=Ya[e];if(void 0===r)throw Error("Unknown file open mode: "+e);e=r}var a=64&e?4095&(void 0===a?438:a)|32768:0;if("object"==typeof n)var o=n;else{n=N(n);try{o=V(n,{ja:!(131072&e)}).node}catch(e){}}if(r=!1,64&e)if(o){if(128&e)throw new P(20)}else o=eb(n,a,0),r=!0;if(!o)throw new P(44);if(8192==(61440&o.mode)&&(e&=-513),65536&e&&16384!=(61440&o.mode))throw new P(54);if(!r&&(a=o?40960==(61440&o.mode)?32:16384==(61440&o.mode)&&("r"!==Za(e)||512&e)?31:W(o,Za(e)):44))throw new P(a);if(512&e){var i="string"==typeof(a=o)?V(a,{ja:!0}).node:a;if(!i.C.K)throw new P(63);if(16384==(61440&i.mode))throw new P(31);if(32768!=(61440&i.mode))throw new P(28);if(a=W(i,"w"))throw new P(a);i.C.K(i,{size:0,timestamp:Date.now()})}e&=-131713,(o=bb({node:o,path:Va(o),flags:e,seekable:!0,position:0,D:o.D,Ea:[],error:!1})).D.open&&o.D.open(o),!g.logReadFiles||1&e||(n in(ib=ib||{})||(ib[n]=1,t("FS.trackingDelegate error on read file: "+n)));try{U.onOpenFile&&(o=0,1!=(2097155&e)&&(o|=1),0!=(2097155&e)&&(o|=2),U.onOpenFile(n,o))}catch(e){t("FS.trackingDelegate['onOpenFile']('"+n+"', flags) threw an exception: "+e.message)}}function jb(e,n,t){if(null===e.O)throw new P(8);if(!e.seekable||!e.D.N)throw new P(70);if(0!=t&&1!=t&&2!=t)throw new P(28);e.position=e.D.N(e,n,t),e.Ea=[]}function kb(){P||((P=function(e,n){this.node=n,this.za=function(e){this.V=e},this.za(e),this.message="FS error"}).prototype=Error(),P.prototype.constructor=P,[44].forEach(function(e){Oa[e]=new P(e),Oa[e].stack="<generic error, no stack>"}))}function mb(e,n){var t=0;return e&&(t|=365),n&&(t|=146),t}function Z(e,u,o){e=N("/dev/"+e);var n=mb(!!u,!!o);nb=nb||64;var t=nb++<<8|0;Ha(t,{open:function(e){e.seekable=!1},close:function(){o&&o.buffer&&o.buffer.length&&o(10)},read:function(e,n,t,r){for(var a=0,o=0;o<r;o++){try{var i=u()}catch(e){throw new P(29)}if(void 0===i&&0===a)throw new P(6);if(null==i)break;a++,n[t+o]=i}return a&&(e.node.timestamp=Date.now()),a},write:function(e,n,t,r){for(var a=0;a<r;a++)try{o(n[t+a])}catch(e){throw new P(29)}return r&&(e.node.timestamp=Date.now()),a}}),fb(e,n,t)}var nb,X,ib,ob={};function pb(e){if(!(e=S[e]))throw new P(8);return e}function qb(e){return 0==e%4&&(0!=e%100||0==e%400)}function rb(e,n){for(var t=0,r=0;r<=n;t+=e[r++]);return t}var sb=[31,29,31,30,31,30,31,31,30,31,30,31],tb=[31,28,31,30,31,30,31,31,30,31,30,31];function ub(e,n){for(e=new Date(e.getTime());0<n;){var t=e.getMonth(),r=(qb(e.getFullYear())?sb:tb)[t];if(!(n>r-e.getDate())){e.setDate(e.getDate()+n);break}n-=r-e.getDate()+1,e.setDate(1),t<11?e.setMonth(t+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}function vb(e,n,t,r){function a(e,n,t){for(e="number"==typeof e?e.toString():e||"";e.length<n;)e=t[0]+e;return e}function o(e,n){return a(e,n,"0")}function i(e,n){function t(e){return e<0?-1:0<e?1:0}var r;return 0===(r=t(e.getFullYear()-n.getFullYear()))&&0===(r=t(e.getMonth()-n.getMonth()))&&(r=t(e.getDate()-n.getDate())),r}function u(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 s(e){e=ub(new Date(e.H+1900,0,1),e.ba);var n=new Date(e.getFullYear()+1,0,4),t=u(new Date(e.getFullYear(),0,4)),n=u(n);return i(t,e)<=0?i(n,e)<=0?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var c=H[r+40>>2];for(var f in r={Ca:H[r>>2],Ba:H[r+4>>2],$:H[r+8>>2],U:H[r+12>>2],R:H[r+16>>2],H:H[r+20>>2],aa:H[r+24>>2],ba:H[r+28>>2],Sa:H[r+32>>2],Aa:H[r+36>>2],Da:c?D(c):""},t=D(t),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"})t=t.replace(new RegExp(f,"g"),c[f]);var l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),g="January February March April May June July August September October November December".split(" "),c={"%a":function(e){return l[e.aa].substring(0,3)},"%A":function(e){return l[e.aa]},"%b":function(e){return g[e.R].substring(0,3)},"%B":function(e){return g[e.R]},"%C":function(e){return o((e.H+1900)/100|0,2)},"%d":function(e){return o(e.U,2)},"%e":function(e){return a(e.U,2," ")},"%g":function(e){return s(e).toString().substring(2)},"%G":s,"%H":function(e){return o(e.$,2)},"%I":function(e){return 0==(e=e.$)?e=12:12<e&&(e-=12),o(e,2)},"%j":function(e){return o(e.U+rb(qb(e.H+1900)?sb:tb,e.R-1),3)},"%m":function(e){return o(e.R+1,2)},"%M":function(e){return o(e.Ba,2)},"%n":function(){return"\n"},"%p":function(e){return 0<=e.$&&e.$<12?"AM":"PM"},"%S":function(e){return o(e.Ca,2)},"%t":function(){return"\t"},"%u":function(e){return e.aa||7},"%U":function(e){var n=new Date(e.H+1900,0,1),t=0===n.getDay()?n:ub(n,7-n.getDay());return i(t,e=new Date(e.H+1900,e.R,e.U))<0?o(Math.ceil((31-t.getDate()+(rb(qb(e.getFullYear())?sb:tb,e.getMonth()-1)-31)+e.getDate())/7),2):0===i(t,n)?"01":"00"},"%V":function(e){var n=new Date(e.H+1901,0,4),t=u(new Date(e.H+1900,0,4)),n=u(n),r=ub(new Date(e.H+1900,0,1),e.ba);return i(r,t)<0?"53":i(n,r)<=0?"01":o(Math.ceil((t.getFullYear()<e.H+1900?e.ba+32-t.getDate():e.ba+1-t.getDate())/7),2)},"%w":function(e){return e.aa},"%W":function(e){var n=new Date(e.H,0,1),t=1===n.getDay()?n:ub(n,0===n.getDay()?1:7-n.getDay()+1);return i(t,e=new Date(e.H+1900,e.R,e.U))<0?o(Math.ceil((31-t.getDate()+(rb(qb(e.getFullYear())?sb:tb,e.getMonth()-1)-31)+e.getDate())/7),2):0===i(t,n)?"01":"00"},"%y":function(e){return(e.H+1900).toString().substring(2)},"%Y":function(e){return e.H+1900},"%z":function(e){var n=0<=(e=e.Aa);return e=Math.abs(e)/60,(n?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.Da},"%%":function(){return"%"}};for(f in c)0<=t.indexOf(f)&&(t=t.replace(new RegExp(f,"g"),c[f](r)));return(f=Ja(t,!1)).length>n?0:(G.set(f,e),f.length-1)}function Xa(e,n,t,r){e=e||this,this.parent=e,this.L=e.L,this.X=null,this.id=Sa++,this.name=n,this.mode=t,this.C={},this.D={},this.Y=r}function Ja(e,n){for(var t=0,r=0;r<e.length;++r){var a=e.charCodeAt(r);55296<=a&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++r)),a<=127?++t:t=a<=2047?t+2:a<=65535?t+3:t+4}var o=(t=Array(t+1)).length,r=0;if(0<o){o=(a=r)+o-1;for(var i=0;i<e.length;++i){var u=e.charCodeAt(i);if(55296<=u&&u<=57343&&(u=65536+((1023&u)<<10)|1023&e.charCodeAt(++i)),u<=127){if(o<=r)break;t[r++]=u}else{if(u<=2047){if(o<=r+1)break;t[r++]=192|u>>6}else{if(u<=65535){if(o<=r+2)break;t[r++]=224|u>>12}else{if(o<=r+3)break;t[r++]=240|u>>18,t[r++]=128|u>>12&63}t[r++]=128|u>>6&63}t[r++]=128|63&u}}t[r]=0,e=r-a}else e=0;return n&&(t.length=e),t}Object.defineProperties(Xa.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}}}),kb(),T=Array(4096),cb(Q,"/"),Y("/tmp"),Y("/home"),Y("/home/web_user"),function(){Y("/dev"),Ha(259,{read:function(){return 0},write:function(e,n,t,r){return r}}),fb("/dev/null",259),Ga(1280,Ka),Ga(1536,La),fb("/dev/tty",1280),fb("/dev/tty1",1536);var e=Ea();Z("random",e),Z("urandom",e),Y("/dev/shm"),Y("/dev/shm/tmp")}(),Y("/proc"),Y("/proc/self"),Y("/proc/self/fd"),cb({L:function(){var e=Na("/proc/self","fd",16895,73);return e.C={S:function(e,n){var t=S[+n];if(!t)throw new P(8);return(e={parent:null,L:{na:"fake"},C:{T:function(){return t.path}}}).parent=e}},e}},"/proc/self/fd"),la.push({ua:function(){wb()}});var yb={b:function(e,n,t,r){z("Assertion failed: "+D(e)+", at: "+[n?D(n):"unknown filename",t,r?D(r):"unknown function"])},c:function(){z()},m:function(e,n,t){E.copyWithin(e,n,n+t)},d:function(e){e>>>=0;var n=E.length;if(2147483648<e)return!1;for(var t=1;t<=4;t*=2){var r=n*(1+.2/t),r=Math.min(r,e+100663296);0<(r=Math.max(16777216,e,r))%65536&&(r+=65536-r%65536);e:{try{A.grow(Math.min(2147483648,r)-F.byteLength+65535>>>16),ia(A.buffer);var a=1;break e}catch(e){}a=void 0}if(a)return!0}return!1},h:function(r,a){var o=0;return za().forEach(function(e,n){var t=a+o;for(n=H[r+4*n>>2]=t,t=0;t<e.length;++t)G[n++>>0]=e.charCodeAt(t);G[n>>0]=0,o+=e.length+1}),0},i:function(e,n){var t=za();H[e>>2]=t.length;var r=0;return t.forEach(function(e){r+=e.length+1}),H[n>>2]=r,0},k:function(e){try{var n=pb(e);if(null===n.O)throw new P(8);n.da&&(n.da=null);try{n.D.close&&n.D.close(n)}catch(e){throw e}finally{S[n.O]=null}return n.O=null,0}catch(e){return void 0!==ob&&e instanceof P||z(e),e.V}},j:function(e,n,t,r){try{e:{for(var a=pb(e),o=e=0;o<t;o++){var i=H[n+(8*o+4)>>2],u=a,s=H[n+8*o>>2],c=i,f=void 0,l=G;if(c<0||f<0)throw new P(28);if(null===u.O)throw new P(8);if(1==(2097155&u.flags))throw new P(8);if(16384==(61440&u.node.mode))throw new P(31);if(!u.D.read)throw new P(28);var g=void 0!==f;if(g){if(!u.seekable)throw new P(70)}else f=u.position;var d=u.D.read(u,l,s,c,f);g||(u.position+=d);var h=d;if(h<0){var w=-1;break e}if(e+=h,h<i)break}w=e}return H[r>>2]=w,0}catch(e){return void 0!==ob&&e instanceof P||z(e),e.V}},l:function(e,n,t,r,a){try{var o=pb(e);return(e=4294967296*t+(n>>>0))<=-9007199254740992||9007199254740992<=e?-61:(jb(o,e,r),xa=[o.position>>>0,(L=o.position,1<=+pa(L)?0<L?(0|sa(+ra(L/4294967296),4294967295))>>>0:~~+qa((L-(~~L>>>0))/4294967296)>>>0:0)],H[a>>2]=xa[0],H[a+4>>2]=xa[1],o.da&&0===e&&0===r&&(o.da=null),0)}catch(e){return void 0!==ob&&e instanceof P||z(e),e.V}},e:function(e,n,r,a){try{e:{for(var o=pb(e),i=e=0;i<r;i++){var u=o,s=H[n+8*i>>2],c=H[n+(8*i+4)>>2],f=void 0,l=G;if(c<0||f<0)throw new P(28);if(null===u.O)throw new P(8);if(0==(2097155&u.flags))throw new P(8);if(16384==(61440&u.node.mode))throw new P(31);if(!u.D.write)throw new P(28);u.seekable&&1024&u.flags&&jb(u,0,2);var g=void 0!==f;if(g){if(!u.seekable)throw new P(70)}else f=u.position;var d=u.D.write(u,l,s,c,f,void 0);g||(u.position+=d);try{u.path&&U.onWriteToFile&&U.onWriteToFile(u.path)}catch(e){t("FS.trackingDelegate['onWriteToFile']('"+u.path+"') threw an exception: "+e.message)}var h=d;if(h<0){var w=-1;break e}e+=h}w=e}return H[a>>2]=w,0}catch(e){return void 0!==ob&&e instanceof P||z(e),e.V}},a:A,g:function(e,n,t,r){return vb(e,n,t,r)},f:function(e){switch(e){case 30:return 16384;case 85:return 131072;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:case 79:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return H[xb()>>2]=28,-1}};!function(){function n(e){g.asm=e.exports,ea=g.asm.n,I--,g.monitorRunDependencies&&g.monitorRunDependencies(I),0==I&&(null!==ta&&(clearInterval(ta),ta=null),J&&(e=J,J=null,e()))}function r(e){n(e.instance)}function a(e){return Promise.resolve().then(wa).then(function(e){return WebAssembly.instantiate(e,o)}).then(e,function(e){t("failed to asynchronously prepare wasm: "+e),z(e)})}var o={a:yb};if(I++,g.monitorRunDependencies&&g.monitorRunDependencies(I),g.instantiateWasm)try{return g.instantiateWasm(o,n)}catch(e){return t("Module.instantiateWasm callback failed with error: "+e)}x||"function"!=typeof WebAssembly.instantiateStreaming||ua()||"function"!=typeof fetch?a(r):fetch(K,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,o).then(r,function(e){return t("wasm streaming compile failed: "+e),t("falling back to ArrayBuffer instantiation"),a(r)})})}();var wb=g.___wasm_call_ctors=function(){return(wb=g.___wasm_call_ctors=g.asm.o).apply(null,arguments)};g.__Z4initi=function(){return(g.__Z4initi=g.asm.p).apply(null,arguments)};var Pa=g._malloc=function(){return(Pa=g._malloc=g.asm.q).apply(null,arguments)};g.__Z5parsev=function(){return(g.__Z5parsev=g.asm.r).apply(null,arguments)},g.__Z7destroyv=function(){return(g.__Z7destroyv=g.asm.s).apply(null,arguments)},g.__Z15get_index_countv=function(){return(g.__Z15get_index_countv=g.asm.t).apply(null,arguments)},g.__Z16get_vertex_countv=function(){return(g.__Z16get_vertex_countv=g.asm.u).apply(null,arguments)},g.__Z13get_scale_posv=function(){return(g.__Z13get_scale_posv=g.asm.v).apply(null,arguments)},g.__Z11get_indicesv=function(){return(g.__Z11get_indicesv=g.asm.w).apply(null,arguments)},g.__Z13get_positionsv=function(){return(g.__Z13get_positionsv=g.asm.x).apply(null,arguments)},g.__Z11get_normalsv=function(){return(g.__Z11get_normalsv=g.asm.y).apply(null,arguments)},g.__Z7get_uvsv=function(){return(g.__Z7get_uvsv=g.asm.z).apply(null,arguments)};var zb,xb=g.___errno_location=function(){return(xb=g.___errno_location=g.asm.A).apply(null,arguments)};function Bb(){function e(){if(!zb&&(zb=!0,g.calledRun=!0,!fa)){if(g.noFSInit||lb||(lb=!0,kb(),g.stdin,g.stdout,g.stderr,g.stdin?Z("stdin",g.stdin):gb("/dev/tty","/dev/stdin"),g.stdout?Z("stdout",null,g.stdout):gb("/dev/tty","/dev/stdout"),g.stderr?Z("stderr",null,g.stderr):gb("/dev/tty1","/dev/stderr"),hb("/dev/stdin","r"),hb("/dev/stdout","w"),hb("/dev/stderr","w")),M(la),Ta=!1,M(ma),g.onRuntimeInitialized&&g.onRuntimeInitialized(),g.postRun)for("function"==typeof g.postRun&&(g.postRun=[g.postRun]);g.postRun.length;){var e=g.postRun.shift();na.unshift(e)}M(na)}}if(!(0<I)){if(g.preRun)for("function"==typeof g.preRun&&(g.preRun=[g.preRun]);g.preRun.length;)oa();M(ka),0<I||(g.setStatus?(g.setStatus("Running..."),setTimeout(function(){setTimeout(function(){g.setStatus("")},1),e()},1)):e())}}if(J=function e(){zb||Bb(),zb||(J=e)},g.run=Bb,g.preInit)for("function"==typeof g.preInit&&(g.preInit=[g.preInit]);0<g.preInit.length;)g.preInit.pop()();noExitRuntime=!0,Bb();
//

// Register as ArmorPaint plugin
let import_usdc = function(path, done) {
	iron.Data.getBlob(path, function(b) {
		let buf = new Uint8Array(A.buffer, g.__Z4initi(b.bytes.length), b.bytes.length);
		for (let i = 0; i < b.bytes.length; ++i) buf[i] = b.readU8(i);
		g.__Z5parsev();
		let vertex_count = g.__Z16get_vertex_countv();
		let index_count = g.__Z15get_index_countv();
		let inda = new Uint32Array(A.buffer, g.__Z11get_indicesv(), index_count);
		let posa = new Int16Array(A.buffer, g.__Z13get_positionsv(), vertex_count * 4);
		let nora = new Int16Array(A.buffer, g.__Z11get_normalsv(), vertex_count * 2);
		let texa = new Int16Array(A.buffer, g.__Z7get_uvsv(), vertex_count * 2);
		let name = path.split("\\").pop().split("/").pop().split(".").shift();
		done({
			name: name,
			posa: posa,
			nora: nora,
			texa: texa,
			inda: inda,
			scale_pos: g.__Z13get_scale_posv(),
			scale_tex: 1.0
		});
		g.__Z7destroyv();
		iron.Data.deleteBlob(path);
	});
}

let plugin = new arm.Plugin();
let formats = arm.Path.meshFormats;
let importers = arm.Path.meshImporters;
formats.push("usdc");
importers.h["usdc"] = import_usdc;

plugin.delete = function() {
	formats.splice(formats.indexOf("usdc"), 1);
	importers.h["usdc"] = null;
};
