diff --git a/1390892.json b/1390892.json new file mode 100644 index 0000000..70172a7 --- /dev/null +++ b/1390892.json @@ -0,0 +1 @@ +{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","name":"Untitled","created":"2022-04-14T19:03:47.042Z","settings":{"physics":{"gravity":[0,-9.8,0]},"render":{"lightmapFilterRange":10,"tonemapping":0,"ambientBakeOcclusionContrast":0,"skybox":null,"lightmapFilterSmoothness":0.2,"gamma_correction":1,"fog_start":1,"skyboxIntensity":1,"fog_color":[0,0,0],"lightmapMode":1,"ambientBakeSpherePart":0.4,"fog":"none","lightmapMaxResolution":2048,"skyboxMip":0,"lightmapSizeMultiplier":16,"fog_end":1000,"lightmapFilterEnabled":false,"ambientBake":false,"fog_density":0.01,"exposure":1,"global_ambient":[0.2,0.2,0.2],"ambientBakeNumSamples":1,"ambientBakeOcclusionBrightness":0,"skyboxRotation":[0,0,0]}},"entities":{"9cb346f8-bc25-11ec-baee-d62e0a56bcb8":{"position":[0,1.312804937362671,-5],"scale":[1,1,1],"name":"Camera","parent":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","resource_id":"9cb346f8-bc25-11ec-baee-d62e0a56bcb8","components":{"camera":{"projection":0,"farClip":1000,"clearColorBuffer":true,"layers":[0,1,2,3,4],"priority":0,"fov":45,"clearDepthBuffer":true,"frustumCulling":true,"clearColor":[0.118,0.118,0.118,1],"enabled":true,"orthoHeight":4,"nearClip":0.1,"rect":[0,0,1,1]}},"rotation":[180,2.5444437451708134e-14,180],"tags":[],"enabled":true,"children":[]},"9cb347f2-bc25-11ec-baee-d62e0a56bcb8":{"position":[2,2,-2],"scale":[1,1,1],"name":"Light","parent":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","resource_id":"9cb347f2-bc25-11ec-baee-d62e0a56bcb8","components":{"light":{"castShadows":true,"isStatic":false,"vsmBlurSize":11,"shadowUpdateMode":2,"normalOffsetBias":0.05,"color":[1,1,1],"bakeArea":0,"numCascades":1,"outerConeAngle":45,"bakeNumSamples":1,"affectDynamic":true,"intensity":1,"bakeDir":true,"cookieAngle":0,"affectLightmapped":false,"cookieChannel":"rgb","innerConeAngle":40,"shadowBias":0.2,"bake":false,"falloffMode":0,"cookieAsset":null,"vsmBias":0.01,"layers":[0],"cookieIntensity":1,"cascadeDistribution":0.5,"cookieOffset":[0,0],"shadowResolution":1024,"cookieScale":[1,1],"enabled":false,"shape":0,"range":8,"vsmBlurMode":1,"shadowDistance":16,"type":"directional","cookieFalloff":true,"shadowType":0}},"rotation":[45,135,0],"tags":[],"enabled":true,"children":[]},"9cb34568-bc25-11ec-baee-d62e0a56bcb8":{"position":[0,0,0],"scale":[1,1,1],"name":"Root","parent":null,"resource_id":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","components":{},"rotation":[0,0,0],"tags":[],"enabled":true,"children":["9cb346f8-bc25-11ec-baee-d62e0a56bcb8","9cb347f2-bc25-11ec-baee-d62e0a56bcb8","22167d55-25a5-4148-9b6c-990202e40293","3d941a31-278b-4806-8e28-19e8040a8232"]},"22167d55-25a5-4148-9b6c-990202e40293":{"name":"Plane","tags":[],"enabled":true,"resource_id":"22167d55-25a5-4148-9b6c-990202e40293","parent":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","children":["c040964c-0b12-45a9-bf11-e4aa25d5b9db"],"position":[0,0.3006536364555359,2.9933258158338942],"rotation":[90,180,0],"scale":[1.8697205174118348,1.8697205174118348,1.8697205174118348],"components":{"render":{"enabled":false,"type":"plane","asset":null,"materialAssets":[78072855],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null},"script":{"enabled":true,"order":["mouse","touch"],"scripts":{"mouse":{"enabled":true,"attributes":{"redMaterial":null,"greenMaterial":null,"blueMaterial":null}},"touch":{"enabled":true,"attributes":{}}}}}},"c040964c-0b12-45a9-bf11-e4aa25d5b9db":{"name":"Plane","tags":[],"enabled":true,"resource_id":"c040964c-0b12-45a9-bf11-e4aa25d5b9db","parent":"22167d55-25a5-4148-9b6c-990202e40293","children":[],"position":[3.881970630640667e-23,0,-0.1994771991922929],"rotation":[0,0,0],"scale":[1,1,1],"components":{"render":{"enabled":true,"type":"plane","asset":null,"materialAssets":[78072855],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null},"script":{"enabled":true,"order":["mouse","touch"],"scripts":{"mouse":{"enabled":true,"attributes":{"redMaterial":null,"greenMaterial":null,"blueMaterial":null}},"touch":{"enabled":true,"attributes":{}}}}}},"3d941a31-278b-4806-8e28-19e8040a8232":{"enabled":true,"tags":[],"children":["559c7d7f-e35c-4349-9993-b4361a7cd124"],"position":[0,0,3.5920119637037575],"rotation":[360,90,0],"scale":[0.00801352120321123,0.003093432959569368,0.0049292920472502584],"resource_id":"3d941a31-278b-4806-8e28-19e8040a8232","name":"livingroom","components":{},"parent":"9cb34568-bc25-11ec-baee-d62e0a56bcb8","template_ent_ids":{"3d941a31-278b-4806-8e28-19e8040a8232":"992e38f0-dd22-4fe8-843f-5c80f0b4190f","559c7d7f-e35c-4349-9993-b4361a7cd124":"cf173562-138d-43de-b497-644f7ffe4239","62ccd1f3-5767-44f2-9193-ffa73fe2e9c6":"19b78e10-9bec-4619-80ff-e761bd368e6e","bcf973e8-eb88-4ab3-b280-7425854c4c40":"f637845d-7f0e-416e-a2da-27a804b90a26","7cb58f5e-9aa4-4d17-b8b2-7db4581ac210":"624e755c-e008-4e38-a4ae-e189b9e6af0e","35251334-db47-4176-8cff-515c607ee8e3":"8fd046ca-9bf2-4996-a426-d5f6f336a65b","b4933e85-8415-4d5f-a4d2-c43879b48e01":"235f5a54-087f-4b74-bcb8-e92fb0454a6f","22cd60ef-8fb8-4497-a662-5fc73472eefb":"92d77773-aa8e-4faa-a639-619c285b76f1","808a03c9-659f-4d1e-ad28-c83a3295d69c":"0e2a3a2c-7ef9-48a5-94f8-425b169eb692","67e25dc4-4a9f-49fc-b358-2cb1de96ee78":"9ea5ecb4-e90e-41e7-8464-9700435c402b","ca56ef18-a240-4297-bd58-5b04d7f9ccde":"7a7196e1-59de-4cee-831f-db20924f5a99","fa7b5cb6-00d8-4b88-9c86-cf1d018cfe9d":"03051ef6-4f3a-438e-9160-a8aea926e2d0","608f46a5-dd55-411e-81ec-29ac7adc517e":"3ce4c2c1-7a99-4730-a57c-346004bc1485","8f1aaf7e-8ab1-46fc-8a7d-ac391603dfbd":"90839ae3-cc29-477f-a88e-53fb57152250","0995bd62-11c1-40f3-b5c9-73f3df99b2d4":"04a75aae-eb81-4d94-8678-29e91bc7ff75","90a04939-5806-490e-af60-40c0e5726521":"26ac5c6d-406a-4e21-b3ce-6e451befe8e9","96379cae-b823-4135-9005-75ecd5078867":"0ca19a72-2469-4446-b3d5-d341756117d3","7de9bdec-06bb-4c2b-a5b5-9d539c247d6c":"afce77e7-aca3-481a-b7ad-35126ffafcde","225f53f4-35b9-48ab-a9ef-d045105420f4":"1dbd7266-a1ce-4993-a0c0-14bc38ef3479","e3db52ba-6801-43bb-9191-d1eed1bf9fe7":"d5b5339a-94b6-4efa-822b-9c5c7997f1e1","8540efe6-07b3-475a-b42b-3b973e9926a7":"232324a7-b6aa-4551-a098-bc9ea317773c","76a034d5-b7a7-4f67-80e6-da64d139d265":"1346743e-6c0f-4290-9590-f6e6b64494a1","42dec380-69b2-4102-8ed4-4c53347a7777":"8a26cc25-f015-4fc5-8cfc-d2366cd0ec11","41f0ea83-d79a-4305-989a-e8971adae5db":"8f969715-c24b-40d4-a640-80340cc8ddaf","17712308-3fb7-4346-9c92-28a4e9a30090":"71743733-1689-447d-b55b-ef36a1f9832f"},"template_id":78181896},"559c7d7f-e35c-4349-9993-b4361a7cd124":{"enabled":true,"tags":[],"children":["67e25dc4-4a9f-49fc-b358-2cb1de96ee78","ca56ef18-a240-4297-bd58-5b04d7f9ccde","76a034d5-b7a7-4f67-80e6-da64d139d265","41f0ea83-d79a-4305-989a-e8971adae5db"],"position":[0,0,0],"rotation":[0,0,0],"scale":[2.54,2.54,2.54],"resource_id":"559c7d7f-e35c-4349-9993-b4361a7cd124","name":"Fbx_Root","components":{},"parent":"3d941a31-278b-4806-8e28-19e8040a8232"},"67e25dc4-4a9f-49fc-b358-2cb1de96ee78":{"enabled":true,"tags":[],"children":[],"position":[129.593,0,84.7355],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"67e25dc4-4a9f-49fc-b358-2cb1de96ee78","name":"Plane01","components":{"render":{"enabled":true,"type":"asset","asset":78181884,"materialAssets":[78181754],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"559c7d7f-e35c-4349-9993-b4361a7cd124"},"41f0ea83-d79a-4305-989a-e8971adae5db":{"enabled":true,"tags":[],"children":[],"position":[151.448,178.646,280.302],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"41f0ea83-d79a-4305-989a-e8971adae5db","name":"Omni03","components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":0.2214,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}},"parent":"559c7d7f-e35c-4349-9993-b4361a7cd124"},"ca56ef18-a240-4297-bd58-5b04d7f9ccde":{"name":"C-Ext01","tags":[],"enabled":true,"resource_id":"ca56ef18-a240-4297-bd58-5b04d7f9ccde","parent":"559c7d7f-e35c-4349-9993-b4361a7cd124","children":[],"position":[385.604,0,-284.937],"rotation":[0,0,0],"scale":[1,1,1],"components":{"render":{"enabled":true,"type":"asset","asset":78181885,"materialAssets":[78181756],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}}},"76a034d5-b7a7-4f67-80e6-da64d139d265":{"name":"Omni01","tags":[],"enabled":true,"resource_id":"76a034d5-b7a7-4f67-80e6-da64d139d265","parent":"559c7d7f-e35c-4349-9993-b4361a7cd124","children":[],"position":[-68.79417803659933,150.47056222036827,84.29774646389339],"rotation":[0,0,0],"scale":[1,1,1],"components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":1.17,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}}}},"checkpoint_id":"6e6c346c-6835-4fff-8602-e4a42a28d353","id":1390892} \ No newline at end of file diff --git a/Build/Demo.data b/Build/Demo.data deleted file mode 100644 index 119f324..0000000 Binary files a/Build/Demo.data and /dev/null differ diff --git a/Build/Demo.framework.js b/Build/Demo.framework.js deleted file mode 100644 index d4d236a..0000000 --- a/Build/Demo.framework.js +++ /dev/null @@ -1,7 +0,0 @@ -function unityFramework(Module) { -var Module=typeof Module!=="undefined"?Module:{};;var stackTraceReference="(^|\\n)(\\s+at\\s+|)jsStackTrace(\\s+\\(|@)([^\\n]+):\\d+:\\d+(\\)|)(\\n|$)";var stackTraceReferenceMatch=jsStackTrace().match(new RegExp(stackTraceReference));if(stackTraceReferenceMatch)Module.stackTraceRegExp=new RegExp(stackTraceReference.replace("([^\\n]+)",stackTraceReferenceMatch[4].replace(/[\\^${}[\]().*+?|]/g,"\\$&")).replace("jsStackTrace","[^\\n]+"));var abort=(function(what){if(ABORT)return;ABORT=true;EXITSTATUS=1;if(typeof ENVIRONMENT_IS_PTHREAD!=="undefined"&&ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);if(what!==undefined){out(what);err(what);what=JSON.stringify(what)}else{what=""}var message="abort("+what+") at "+stackTrace();if(Module.abortHandler&&Module.abortHandler(message))return;throw message});if(typeof ENVIRONMENT_IS_PTHREAD==="undefined"||!ENVIRONMENT_IS_PTHREAD){Module["preRun"].push((function(){var unityFileSystemInit=Module["unityFileSystemInit"]||(function(){FS.mkdir("/idbfs");FS.mount(IDBFS,{},"/idbfs");Module.addRunDependency("JS_FileSystem_Mount");FS.syncfs(true,(function(err){if(err)console.log("IndexedDB is not available. Data will not persist in cache and PlayerPrefs will not be saved.");Module.removeRunDependency("JS_FileSystem_Mount")}))});unityFileSystemInit()}))}Module["SetFullscreen"]=(function(fullscreen){if(typeof runtimeInitialized==="undefined"||!runtimeInitialized){console.log("Runtime not initialized yet.")}else if(typeof JSEvents==="undefined"){console.log("Player not loaded yet.")}else{var tmp=JSEvents.canPerformEventHandlerRequests;JSEvents.canPerformEventHandlerRequests=(function(){return 1});Module.ccall("SetFullscreen",null,["number"],[fullscreen]);JSEvents.canPerformEventHandlerRequests=tmp}});var MediaDevices=[];if(typeof ENVIRONMENT_IS_PTHREAD==="undefined"||!ENVIRONMENT_IS_PTHREAD){Module["preRun"].push((function(){var enumerateMediaDevices=(function(){var getMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;if(!getMedia)return;function addDevice(label){label=label?label:"device #"+MediaDevices.length;var device={deviceName:label,refCount:0,video:null};MediaDevices.push(device)}if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices){if(typeof MediaStreamTrack=="undefined"||typeof MediaStreamTrack.getSources=="undefined"){console.log("Media Devices cannot be enumerated on this browser.");return}function gotSources(sourceInfos){for(var i=0;i!==sourceInfos.length;++i){var sourceInfo=sourceInfos[i];if(sourceInfo.kind==="video")addDevice(sourceInfo.label)}}MediaStreamTrack.getSources(gotSources)}navigator.mediaDevices.enumerateDevices().then((function(devices){devices.forEach((function(device){if(device.kind=="videoinput")addDevice(device.label)}))})).catch((function(err){console.log(err.name+": "+error.message)}))});enumerateMediaDevices()}))}function SendMessage(gameObject,func,param){if(param===undefined)Module.ccall("SendMessage",null,["string","string"],[gameObject,func]);else if(typeof param==="string")Module.ccall("SendMessageString",null,["string","string","string"],[gameObject,func,param]);else if(typeof param==="number")Module.ccall("SendMessageFloat",null,["string","string","number"],[gameObject,func,param]);else throw""+param+" is does not have a type which is supported by SendMessage."}Module["SendMessage"]=SendMessage;var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=(function(status,toThrow){throw toThrow});Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}else{return scriptDirectory+path}}if(ENVIRONMENT_IS_NODE){scriptDirectory=__dirname+"/";var nodeFS;var nodePath;Module["read"]=function shell_read(filename,binary){var ret;if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);ret=nodeFS["readFileSync"](filename);return binary?ret:ret.toString()};Module["readBinary"]=function readBinary(filename){var ret=Module["read"](filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/")}Module["arguments"]=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",(function(ex){if(!(ex instanceof ExitStatus)){throw ex}}));process["on"]("unhandledRejection",(function(reason,p){process["exit"](1)}));Module["quit"]=(function(status){process["exit"](status)});Module["inspect"]=(function(){return"[Emscripten Module object]"})}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){Module["read"]=function shell_read(f){return read(f)}}Module["readBinary"]=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){Module["arguments"]=scriptArgs}else if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof quit==="function"){Module["quit"]=(function(status){quit(status)})}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WEB){if(document.currentScript){scriptDirectory=document.currentScript.src}}else{scriptDirectory=self.location.href}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.split("/").slice(0,-1).join("/")+"/"}else{scriptDirectory=""}Module["read"]=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){Module["readBinary"]=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}Module["readAsync"]=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)};Module["setWindowTitle"]=(function(title){document.title=title})}else{}var out=Module["print"]||(typeof console!=="undefined"?console.log.bind(console):typeof print!=="undefined"?print:null);var err=Module["printErr"]||(typeof printErr!=="undefined"?printErr:typeof console!=="undefined"&&console.warn.bind(console)||out);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=undefined;var STACK_ALIGN=16;function staticAlloc(size){var ret=STATICTOP;STATICTOP=STATICTOP+size+15&-16;return ret}function dynamicAlloc(size){var ret=HEAP32[DYNAMICTOP_PTR>>2];var end=ret+size+15&-16;HEAP32[DYNAMICTOP_PTR>>2]=end;if(end>=TOTAL_MEMORY){var success=enlargeMemory();if(!success){HEAP32[DYNAMICTOP_PTR>>2]=ret;return 0}}return ret}function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;var ret=size=Math.ceil(size/factor)*factor;return ret}function getNativeTypeSize(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return 4}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0);return bits/8}else{return 0}}}}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var asm2wasmImports={"f64-rem":(function(x,y){return x%y}),"debugger":(function(){debugger})};var jsCallStartIndex=1;var functionPointers=new Array(0);function addFunction(func,sig){var base=0;for(var i=base;i>>0)+ +(high>>>0)*4294967296:+(low>>>0)+ +(high|0)*4294967296}function dynCall(sig,ptr,args){if(args&&args.length){return Module["dynCall_"+sig].apply(null,[ptr].concat(args))}else{return Module["dynCall_"+sig].call(null,ptr)}}var GLOBAL_BASE=1024;var ABORT=0;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}var JSfuncs={"stackSave":(function(){stackSave()}),"stackRestore":(function(){stackRestore()}),"arrayToC":(function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}),"stringToC":(function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret})};var toC={"string":JSfuncs["stringToC"],"array":JSfuncs["arrayToC"]};function ccall(ident,returnType,argTypes,args,opts){function convertReturnValue(ret){if(returnType==="string")return Pointer_stringify(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}var ALLOC_NORMAL=0;var ALLOC_STACK=1;var ALLOC_STATIC=2;var ALLOC_NONE=4;function allocate(slab,types,allocator,ptr){var zeroinit,size;if(typeof slab==="number"){zeroinit=true;size=slab}else{zeroinit=false;size=slab.length}var singleType=typeof types==="string"?types:null;var ret;if(allocator==ALLOC_NONE){ret=ptr}else{ret=[typeof _malloc==="function"?_malloc:staticAlloc,stackAlloc,staticAlloc,dynamicAlloc][allocator===undefined?ALLOC_STATIC:allocator](Math.max(size,singleType?1:types.length))}if(zeroinit){var stop;ptr=ret;assert((ret&3)==0);stop=ret+(size&~3);for(;ptr>2]=0}stop=ret+size;while(ptr>0]=0}return ret}if(singleType==="i8"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret)}else{HEAPU8.set(new Uint8Array(slab),ret)}return ret}var i=0,type,typeSize,previousType;while(i>0];hasUtf|=t;if(t==0&&!length)break;i++;if(length&&i==length)break}if(!length)length=i;var ret="";if(hasUtf<128){var MAX_CHUNK=1024;var curr;while(length>0){curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK)));ret=ret?ret+curr:curr;ptr+=MAX_CHUNK;length-=MAX_CHUNK}return ret}return UTF8ToString(ptr)}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(u8Array,idx){var endPtr=idx;while(u8Array[endPtr])++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var u0,u1,u2,u3,u4,u5;var str="";while(1){u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u3=u8Array[idx++]&63;if((u0&248)==240){u0=(u0&7)<<18|u1<<12|u2<<6|u3}else{u4=u8Array[idx++]&63;if((u0&252)==248){u0=(u0&3)<<24|u1<<18|u2<<12|u3<<6|u4}else{u5=u8Array[idx++]&63;u0=(u0&1)<<30|u1<<24|u2<<18|u3<<12|u4<<6|u5}}}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}}function UTF8ToString(ptr){return UTF8ArrayToString(HEAPU8,ptr)}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=2097151){if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=67108863){if(outIdx+4>=endIdx)break;outU8Array[outIdx++]=248|u>>24;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+5>=endIdx)break;outU8Array[outIdx++]=252|u>>30;outU8Array[outIdx++]=128|u>>24&63;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){++len}else if(u<=2047){len+=2}else if(u<=65535){len+=3}else if(u<=2097151){len+=4}else if(u<=67108863){len+=5}else{len+=6}}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function allocateUTF8(str){var size=lengthBytesUTF8(str)+1;var ret=_malloc(size);if(ret)stringToUTF8Array(str,HEAP8,ret,size);return ret}function allocateUTF8OnStack(str){var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8Array(str,HEAP8,ret,size);return ret}function demangle(func){return func}function demangleAll(text){var regex=/__Z[\w\d_]+/g;return text.replace(regex,(function(x){var y=demangle(x);return x===y?x:x+" ["+y+"]"}))}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"])js+="\n"+Module["extraStackTrace"]();return demangleAll(js)}var PAGE_SIZE=16384;var WASM_PAGE_SIZE=65536;var ASMJS_PAGE_SIZE=16777216;var MIN_TOTAL_MEMORY=16777216;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBuffer(buf){Module["buffer"]=buffer=buf}function updateGlobalBufferViews(){Module["HEAP8"]=HEAP8=new Int8Array(buffer);Module["HEAP16"]=HEAP16=new Int16Array(buffer);Module["HEAP32"]=HEAP32=new Int32Array(buffer);Module["HEAPU8"]=HEAPU8=new Uint8Array(buffer);Module["HEAPU16"]=HEAPU16=new Uint16Array(buffer);Module["HEAPU32"]=HEAPU32=new Uint32Array(buffer);Module["HEAPF32"]=HEAPF32=new Float32Array(buffer);Module["HEAPF64"]=HEAPF64=new Float64Array(buffer)}var STATIC_BASE,STATICTOP,staticSealed;var STACK_BASE,STACKTOP,STACK_MAX;var DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0;staticSealed=false;function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}if(!Module["reallocBuffer"])Module["reallocBuffer"]=(function(size){var ret;try{if(ArrayBuffer.transfer){ret=ArrayBuffer.transfer(buffer,size)}else{var oldHEAP8=HEAP8;ret=new ArrayBuffer(size);var temp=new Int8Array(ret);temp.set(oldHEAP8)}}catch(e){return false}var success=_emscripten_replace_memory(ret);if(!success)return false;return ret});function enlargeMemory(){var PAGE_MULTIPLE=Module["usingWasm"]?WASM_PAGE_SIZE:ASMJS_PAGE_SIZE;var LIMIT=2147483648-PAGE_MULTIPLE;if(HEAP32[DYNAMICTOP_PTR>>2]>LIMIT){return false}var OLD_TOTAL_MEMORY=TOTAL_MEMORY;TOTAL_MEMORY=Math.max(TOTAL_MEMORY,MIN_TOTAL_MEMORY);while(TOTAL_MEMORY>2]){if(TOTAL_MEMORY<=536870912){TOTAL_MEMORY=alignUp(2*TOTAL_MEMORY,PAGE_MULTIPLE)}else{TOTAL_MEMORY=Math.min(alignUp((3*TOTAL_MEMORY+2147483648)/4,PAGE_MULTIPLE),LIMIT)}}var replacement=Module["reallocBuffer"](TOTAL_MEMORY);if(!replacement||replacement.byteLength!=TOTAL_MEMORY){TOTAL_MEMORY=OLD_TOTAL_MEMORY;return false}updateGlobalBuffer(replacement);updateGlobalBufferViews();return true}var byteLength;try{byteLength=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get);byteLength(new ArrayBuffer(4))}catch(e){byteLength=(function(buffer){return buffer.byteLength})}var TOTAL_STACK=Module["TOTAL_STACK"]||5242880;var TOTAL_MEMORY=Module["TOTAL_MEMORY"]||33554432;if(TOTAL_MEMORY0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__);runtimeExited=true}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}function unSign(value,bits,ignore){if(value>=0){return value}return bits<=32?2*Math.abs(1<=half&&(bits<=32||value>half)){value=-2*half+value}return value}var Math_abs=Math.abs;var Math_sqrt=Math.sqrt;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_pow=Math.pow;var Math_min=Math.min;var Math_clz32=Math.clz32;var Math_trunc=Math.trunc;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}function integrateWasmJS(){var wasmTextFile="build.wast";var wasmBinaryFile="build.wasm";var asmjsCodeFile="build.temp.asm.js";if(!isDataURI(wasmTextFile)){wasmTextFile=locateFile(wasmTextFile)}if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}if(!isDataURI(asmjsCodeFile)){asmjsCodeFile=locateFile(asmjsCodeFile)}var wasmPageSize=64*1024;var info={"global":null,"env":null,"asm2wasm":asm2wasmImports,"parent":Module};var exports=null;function mergeMemory(newBuffer){var oldBuffer=Module["buffer"];if(newBuffer.byteLength>2)+length*i;var buffer=sound.buffer;var copyToChannel=buffer["copyToChannel"]||(function(source,channelNumber,startInChannel){var clipped=source.subarray(0,Math.min(source.length,this.length-(startInChannel|0)));this.getChannelData(channelNumber|0).set(clipped,startInChannel|0)});copyToChannel.apply(buffer,[HEAPF32.subarray(offs,offs+length),i,0])}var instance=WEBAudio.audioInstances.push(sound)-1;return instance}function _JS_Sound_Play(bufferInstance,channelInstance,offset,delay){_JS_Sound_Stop(channelInstance,0);if(WEBAudio.audioWebEnabled==0)return;var sound=WEBAudio.audioInstances[bufferInstance];var channel=WEBAudio.audioInstances[channelInstance];if(sound.buffer){try{channel.playBuffer(WEBAudio.audioContext.currentTime+delay,sound.buffer,offset)}catch(e){console.error("playBuffer error. Exception: "+e)}}else console.log("Trying to play sound which is not loaded.")}function _JS_Sound_ReleaseInstance(instance){WEBAudio.audioInstances[instance]=null}function _JS_Sound_ResumeIfNeeded(){if(WEBAudio.audioWebEnabled==0)return;if(WEBAudio.audioContext.state==="suspended")WEBAudio.audioContext.resume()}function _JS_Sound_Set3D(channelInstance,threeD){var channel=WEBAudio.audioInstances[channelInstance];if(channel.threeD!=threeD){channel.threeD=threeD;channel.setupPanning()}}function _JS_Sound_SetListenerOrientation(x,y,z,xUp,yUp,zUp){if(WEBAudio.audioWebEnabled==0)return;if(WEBAudio.audioContext.listener.forwardX){WEBAudio.audioContext.listener.forwardX.setValueAtTime(-x,WEBAudio.audioContext.currentTime);WEBAudio.audioContext.listener.forwardY.setValueAtTime(-y,WEBAudio.audioContext.currentTime);WEBAudio.audioContext.listener.forwardZ.setValueAtTime(-z,WEBAudio.audioContext.currentTime);WEBAudio.audioContext.listener.upX.setValueAtTime(xUp,WEBAudio.audioContext.currentTime);WEBAudio.audioContext.listener.upY.setValueAtTime(yUp,WEBAudio.audioContext.currentTime);WEBAudio.audioContext.listener.upZ.setValueAtTime(zUp,WEBAudio.audioContext.currentTime)}else{WEBAudio.audioContext.listener.setOrientation(-x,-y,-z,xUp,yUp,zUp)}}function _JS_Sound_SetListenerPosition(x,y,z){if(WEBAudio.audioWebEnabled==0)return;if(WEBAudio.audioContext.listener.positionX){WEBAudio.audioContext.listener.positionX.setValueAtTime(x,WEBAudio.audioContext.currentTime);WEBAudio.audioContext.listener.positionY.setValueAtTime(y,WEBAudio.audioContext.currentTime);WEBAudio.audioContext.listener.positionZ.setValueAtTime(z,WEBAudio.audioContext.currentTime)}else{WEBAudio.audioContext.listener.setPosition(x,y,z)}}function _JS_Sound_SetLoop(channelInstance,loop){if(WEBAudio.audioWebEnabled==0)return;WEBAudio.audioInstances[channelInstance].source.loop=loop}function _JS_Sound_SetLoopPoints(channelInstance,loopStart,loopEnd){if(WEBAudio.audioWebEnabled==0)return;var channel=WEBAudio.audioInstances[channelInstance];channel.source.loopStart=loopStart;channel.source.loopEnd=loopEnd}function _JS_Sound_SetPitch(channelInstance,v){if(WEBAudio.audioWebEnabled==0)return;try{WEBAudio.audioInstances[channelInstance].source.playbackRate.setValueAtTime(v,WEBAudio.audioContext.currentTime)}catch(e){console.error("Invalid audio pitch "+v+" specified to WebAudio backend!")}}function _JS_Sound_SetPosition(channelInstance,x,y,z){if(WEBAudio.audioWebEnabled==0)return;WEBAudio.audioInstances[channelInstance].panner.setPosition(x,y,z)}function _JS_Sound_SetVolume(channelInstance,v){if(WEBAudio.audioWebEnabled==0)return;try{WEBAudio.audioInstances[channelInstance].gain.gain.setValueAtTime(v,WEBAudio.audioContext.currentTime)}catch(e){console.error("Invalid audio volume "+v+" specified to WebAudio backend!")}}function _JS_Sound_Stop(channelInstance,delay){if(WEBAudio.audioWebEnabled==0)return;var channel=WEBAudio.audioInstances[channelInstance];if(channel.source.buffer){try{channel.source.stop(WEBAudio.audioContext.currentTime+delay)}catch(e){channel.source.disconnect()}if(delay==0){channel.source.onended=(function(){});channel.setup()}}}function _JS_SystemInfo_GetCanvasClientSize(domElementSelector,outWidth,outHeight){var selector=UTF8ToString(domElementSelector);var canvas=selector=="#canvas"?Module["canvas"]:document.querySelector(selector);HEAPF64[outWidth>>3]=canvas?canvas.clientWidth:0;HEAPF64[outHeight>>3]=canvas?canvas.clientHeight:0}function _JS_SystemInfo_GetDocumentURL(buffer,bufferSize){if(buffer)stringToUTF8(document.URL,buffer,bufferSize);return lengthBytesUTF8(document.URL)}function _JS_SystemInfo_GetGPUInfo(buffer,bufferSize){var gpuinfo=Module.SystemInfo.gpu;if(buffer)stringToUTF8(gpuinfo,buffer,bufferSize);return lengthBytesUTF8(gpuinfo)}function _JS_SystemInfo_GetMatchWebGLToCanvasSize(){return Module.matchWebGLToCanvasSize||Module.matchWebGLToCanvasSize===undefined}function _JS_SystemInfo_GetMemory(){return TOTAL_MEMORY/(1024*1024)}function _JS_SystemInfo_GetOS(buffer,bufferSize){var browser=Module.SystemInfo.os+" "+Module.SystemInfo.osVersion;if(buffer)stringToUTF8(browser,buffer,bufferSize);return lengthBytesUTF8(browser)}function _JS_SystemInfo_GetPreferredDevicePixelRatio(){return Module.devicePixelRatio||window.devicePixelRatio||1}function _JS_SystemInfo_GetScreenSize(outWidth,outHeight){HEAPF64[outWidth>>3]=Module.SystemInfo.width;HEAPF64[outHeight>>3]=Module.SystemInfo.height}function _JS_SystemInfo_HasCursorLock(){return Module.SystemInfo.hasCursorLock}function _JS_SystemInfo_HasFullscreen(){return Module.SystemInfo.hasFullscreen}function _JS_SystemInfo_HasWebGL(){return Module.SystemInfo.hasWebGL}function _JS_UNETWebSockets_HostsContainingMessagesCleanHost(hostId){for(i=0;isocket.pingTimeout){socket.socket.send(UNETWebSocketsInstances.pingDataArray);socket.lastSentTime=now}}function cancelKeepAlive(socket){if(socket.timerID){Module.clearInterval(socket.timerID);socket.timerID=0}}var socket={socket:new WebSocket(str,["unitygame"]),buffer:new Uint8Array(0),error:null,id:hostId,state:UNETWebSocketsInstances.HostStates.Created,inQueue:false,timerID:0,pingTimeout:0,lastSentTime:Date.now(),messages:[]};socket.socket.onopen=(function(){socket.state=UNETWebSocketsInstances.HostStates.Opening;_JS_UNETWebSockets_HostsContainingMessagesPush(socket);socket.timerID=Module.setInterval((function(){keepAlive(socket)}),socket.pingTimeout)});socket.socket.onmessage=(function(e){if(e.data instanceof Blob){var reader=new FileReader;reader.addEventListener("loadend",(function(){var array=new Uint8Array(reader.result);_JS_UNETWebSockets_HostsContainingMessagesPush(socket);if(array.length==1&&array[0]==255){return}socket.messages.push(array)}));reader.readAsArrayBuffer(e.data)}});socket.socket.onclose=(function(e){cancelKeepAlive(socket);if(socket.state==UNETWebSocketsInstances.HostStates.Closed){return}socket.state=UNETWebSocketsInstances.HostStates.Closing;_JS_UNETWebSockets_HostsContainingMessagesPush(socket)});socket.socket.onerror=(function(e){console.log("Error: "+e.data+" socket will be closed");socket.state=UNETWebSocketsInstances.HostStates.Closing;_JS_UNETWebSockets_HostsContainingMessagesPush(socket)});socket.pingTimeout=UNETWebSocketsInstances.hosts[socket.id].pingTimeout;UNETWebSocketsInstances.hosts[socket.id]=socket}function _JS_UNETWebSockets_SocketRecvEvntBuff(ptr,length){HEAPU8.set(UNETWebSocketsInstances.hostsContainingMessages[0].messages[0],ptr)}function _JS_UNETWebSockets_SocketRecvEvntBuffFromHost(hostId,ptr,length){HEAPU8.set(UNETWebSocketsInstances.hosts[hostId].messages[0],ptr)}function _JS_UNETWebSockets_SocketRecvEvntBuffLength(){return UNETWebSocketsInstances.hostsContainingMessages[0].messages[0].length}function _JS_UNETWebSockets_SocketRecvEvntBuffLengthFromHost(hostId){return UNETWebSocketsInstances.hosts[hostId].messages[0].length}function _JS_UNETWebSockets_SocketRecvEvntHost(){return UNETWebSocketsInstances.hostsContainingMessages[0].id}function _JS_UNETWebSockets_SocketRecvEvntType(){if(UNETWebSocketsInstances.hostsContainingMessages.length==0)return UNETWebSocketsInstances.EventTypes.Nothing;while(UNETWebSocketsInstances.hostsContainingMessages.length!=0){if(UNETWebSocketsInstances.hostsContainingMessages[0]==null)UNETWebSocketsInstances.hostsContainingMessages.shift();else if(UNETWebSocketsInstances.hostsContainingMessages[0].state==UNETWebSocketsInstances.HostStates.Closed)UNETWebSocketsInstances.hostsContainingMessages.shift();else if(UNETWebSocketsInstances.hostsContainingMessages[0].state==UNETWebSocketsInstances.HostStates.Opening)break;else if(UNETWebSocketsInstances.hostsContainingMessages[0].state==UNETWebSocketsInstances.HostStates.Closing)break;else if(UNETWebSocketsInstances.hostsContainingMessages[0].messages.length==0){UNETWebSocketsInstances.hostsContainingMessages[0].inQueue=false;UNETWebSocketsInstances.hostsContainingMessages.shift()}else break}if(UNETWebSocketsInstances.hostsContainingMessages.length==0)return UNETWebSocketsInstances.EventTypes.Nothing;else if(UNETWebSocketsInstances.hostsContainingMessages[0].state==UNETWebSocketsInstances.HostStates.Opening)return UNETWebSocketsInstances.EventTypes.ConnectEvent;else if(UNETWebSocketsInstances.hostsContainingMessages[0].state==UNETWebSocketsInstances.HostStates.Closing&&UNETWebSocketsInstances.hostsContainingMessages[0].messages.length==0)return UNETWebSocketsInstances.EventTypes.DisconnectEvent;else return UNETWebSocketsInstances.EventTypes.DataEvent}function _JS_UNETWebSockets_SocketRecvEvntTypeFromHost(hostId){var evnt=UNETWebSocketsInstances.EventTypes.Nothing;if(UNETWebSocketsInstances.hosts[hostId].state==UNETWebSocketsInstances.HostStates.Opening)evnt=UNETWebSocketsInstances.EventTypes.ConnectEvent;else if(UNETWebSocketsInstances.hosts[hostId].messages.length!=0)evnt=UNETWebSocketsInstances.EventTypes.DataEvent;else if(UNETWebSocketsInstances.hosts[hostId].state==UNETWebSocketsInstances.HostStates.Closing)evnt=UNETWebSocketsInstances.EventTypes.DisconnectEvent;return evnt}function _JS_UNETWebSockets_SocketSend(hostId,ptr,length){var socket=UNETWebSocketsInstances.hosts[hostId];if(socket==0||socket.socket.readyState!=1||socket.state!=UNETWebSocketsInstances.HostStates.Connected)return;socket.socket.send(HEAPU8.buffer.slice(ptr,ptr+length));socket.lastSentTime=Date.now()}function _JS_UNETWebSockets_SocketStop(){for(i=0;i0){var postData=HEAPU8.subarray(ptr,ptr+length);http.send(postData)}else http.send()}catch(e){console.error(e.name+": "+e.message)}}function _JS_WebRequest_SetProgressHandler(request,arg,onprogress){var http=wr.requestInstances[request];http.onprogress=function http_onprogress(e){if(onprogress){if(e.lengthComputable)dynCall("viii",onprogress,[arg,e.loaded,e.total])}}}function _JS_WebRequest_SetRequestHeader(request,header,value){var _header=Pointer_stringify(header);var _value=Pointer_stringify(value);wr.requestInstances[request].setRequestHeader(_header,_value)}function _JS_WebRequest_SetResponseHandler(request,arg,onresponse){var http=wr.requestInstances[request];http.onload=function http_onload(e){if(onresponse){var kWebRequestOK=0;var byteArray=new Uint8Array(http.response);if(byteArray.length!=0){var buffer=_malloc(byteArray.length);HEAPU8.set(byteArray,buffer);dynCall("viiiiii",onresponse,[arg,http.status,buffer,byteArray.length,0,kWebRequestOK])}else{dynCall("viiiiii",onresponse,[arg,http.status,0,0,0,kWebRequestOK])}}};function HandleError(err,code){if(onresponse){var len=lengthBytesUTF8(err)+1;var buffer=_malloc(len);stringToUTF8(err,buffer,len);dynCall("viiiiii",onresponse,[arg,http.status,0,0,buffer,code]);_free(buffer)}}http.onerror=function http_onerror(e){var kWebErrorUnknown=2;HandleError("Unknown error.",kWebErrorUnknown)};http.ontimeout=function http_onerror(e){var kWebErrorTimeout=14;HandleError("Connection timed out.",kWebErrorTimeout)};http.onabort=function http_onerror(e){var kWebErrorAborted=17;HandleError("Aborted.",kWebErrorAborted)}}function _JS_WebRequest_SetTimeout(request,timeout){wr.requestInstances[request].timeout=timeout}function ___atomic_compare_exchange_8(ptr,expected,desiredl,desiredh,weak,success_memmodel,failure_memmodel){var pl=HEAP32[ptr>>2];var ph=HEAP32[ptr+4>>2];var el=HEAP32[expected>>2];var eh=HEAP32[expected+4>>2];if(pl===el&&ph===eh){HEAP32[ptr>>2]=desiredl;HEAP32[ptr+4>>2]=desiredh;return 1}else{HEAP32[expected>>2]=pl;HEAP32[expected+4>>2]=ph;return 0}}function ___atomic_fetch_add_8(ptr,vall,valh,memmodel){var l=HEAP32[ptr>>2];var h=HEAP32[ptr+4>>2];HEAP32[ptr>>2]=_i64Add(l,h,vall,valh);HEAP32[ptr+4>>2]=getTempRet0();return(setTempRet0(h),l)|0}var ENV={};function ___buildEnvironment(environ){var MAX_ENV_VALUES=64;var TOTAL_ENV_SIZE=1024;var poolPtr;var envPtr;if(!___buildEnvironment.called){___buildEnvironment.called=true;ENV["USER"]=ENV["LOGNAME"]="web_user";ENV["PATH"]="/";ENV["PWD"]="/";ENV["HOME"]="/home/web_user";ENV["LANG"]="C.UTF-8";ENV["_"]=Module["thisProgram"];poolPtr=getMemory(TOTAL_ENV_SIZE);envPtr=getMemory(MAX_ENV_VALUES*4);HEAP32[envPtr>>2]=poolPtr;HEAP32[environ>>2]=envPtr}else{envPtr=HEAP32[environ>>2];poolPtr=HEAP32[envPtr>>2]}var strings=[];var totalSize=0;for(var key in ENV){if(typeof ENV[key]==="string"){var line=key+"="+ENV[key];strings.push(line);totalSize+=line.length}}if(totalSize>TOTAL_ENV_SIZE){throw new Error("Environment size exceeded TOTAL_ENV_SIZE!")}var ptrSize=4;for(var i=0;i>2]=poolPtr;poolPtr+=line.length+1}HEAP32[envPtr+strings.length*ptrSize>>2]=0}function ___cxa_allocate_exception(size){return _malloc(size)}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:(function(adjusted){if(!adjusted||EXCEPTIONS.infos[adjusted])return adjusted;for(var key in EXCEPTIONS.infos){var ptr=+key;var info=EXCEPTIONS.infos[ptr];if(info.adjusted===adjusted){return ptr}}return adjusted}),addRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount++}),decRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];assert(info.refcount>0);info.refcount--;if(info.refcount===0&&!info.rethrown){if(info.destructor){Module["dynCall_vi"](info.destructor,ptr)}delete EXCEPTIONS.infos[ptr];___cxa_free_exception(ptr)}}),clearRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount=0})};function ___cxa_begin_catch(ptr){var info=EXCEPTIONS.infos[ptr];if(info&&!info.caught){info.caught=true;__ZSt18uncaught_exceptionv.uncaught_exception--}if(info)info.rethrown=false;EXCEPTIONS.caught.push(ptr);EXCEPTIONS.addRef(EXCEPTIONS.deAdjust(ptr));return ptr}function ___cxa_free_exception(ptr){try{return _free(ptr)}catch(e){}}function ___cxa_end_catch(){Module["setThrew"](0);var ptr=EXCEPTIONS.caught.pop();if(ptr){EXCEPTIONS.decRef(EXCEPTIONS.deAdjust(ptr));EXCEPTIONS.last=0}}function ___cxa_find_matching_catch_2(){return ___cxa_find_matching_catch.apply(null,arguments)}function ___cxa_find_matching_catch_3(){return ___cxa_find_matching_catch.apply(null,arguments)}function ___cxa_find_matching_catch_4(){return ___cxa_find_matching_catch.apply(null,arguments)}function ___cxa_pure_virtual(){ABORT=true;throw"Pure virtual function called!"}function ___cxa_rethrow(){var ptr=EXCEPTIONS.caught.pop();ptr=EXCEPTIONS.deAdjust(ptr);if(!EXCEPTIONS.infos[ptr].rethrown){EXCEPTIONS.caught.push(ptr);EXCEPTIONS.infos[ptr].rethrown=true}EXCEPTIONS.last=ptr;throw ptr}function ___resumeException(ptr){if(!EXCEPTIONS.last){EXCEPTIONS.last=ptr}throw ptr}function ___cxa_find_matching_catch(){var thrown=EXCEPTIONS.last;if(!thrown){return(setTempRet0(0),0)|0}var info=EXCEPTIONS.infos[thrown];var throwntype=info.type;if(!throwntype){return(setTempRet0(0),thrown)|0}var typeArray=Array.prototype.slice.call(arguments);var pointer=Module["___cxa_is_pointer_type"](throwntype);if(!___cxa_find_matching_catch.buffer)___cxa_find_matching_catch.buffer=_malloc(4);HEAP32[___cxa_find_matching_catch.buffer>>2]=thrown;thrown=___cxa_find_matching_catch.buffer;for(var i=0;i>2];info.adjusted=thrown;return(setTempRet0(typeArray[i]),thrown)|0}}thrown=HEAP32[thrown>>2];return(setTempRet0(throwntype),thrown)|0}function ___cxa_throw(ptr,type,destructor){EXCEPTIONS.infos[ptr]={ptr:ptr,adjusted:ptr,type:type,destructor:destructor,refcount:0,caught:false,rethrown:false};EXCEPTIONS.last=ptr;if(!("uncaught_exception"in __ZSt18uncaught_exceptionv)){__ZSt18uncaught_exceptionv.uncaught_exception=1}else{__ZSt18uncaught_exceptionv.uncaught_exception++}throw ptr}function ___gxx_personality_v0(){}function ___lock(){}var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}function ___map_file(pathname,size){___setErrNo(ERRNO_CODES.EPERM);return-1}var ERRNO_MESSAGES={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};var PATH={splitPath:(function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)}),normalizeArray:(function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts}),normalize:(function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path}),dirname:(function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir}),basename:(function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)}),extname:(function(path){return PATH.splitPath(path)[3]}),join:(function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))}),join2:(function(l,r){return PATH.normalize(l+"/"+r)}),resolve:(function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter((function(p){return!!p})),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."}),relative:(function(from,to){from=PATH.resolve(from).substr(1);to=PATH.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()}),put_char:(function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}})},default_tty1_ops:{put_char:(function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}})}};var MEMFS={ops_table:null,mount:(function(mount){return MEMFS.createNode(null,"/",16384|511,0)}),createNode:(function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node}return node}),getFileDataAsRegularArray:(function(node){if(node.contents&&node.contents.subarray){var arr=[];for(var i=0;inode.contents.length){node.contents=MEMFS.getFileDataAsRegularArray(node);node.usedBytes=node.contents.length}if(!node.contents||node.contents.subarray){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);return}if(!node.contents&&newCapacity>0)node.contents=[];while(node.contents.lengthnewSize)node.contents.length=newSize;else while(node.contents.length=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+lengthe2.timestamp){create.push(key);total++}}));var remove=[];Object.keys(dst.entries).forEach((function(key){var e=dst.entries[key];var e2=src.entries[key];if(!e2){remove.push(key);total++}}));if(!total){return callback(null)}var completed=0;var db=src.type==="remote"?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readwrite");var store=transaction.objectStore(IDBFS.DB_STORE_NAME);function done(err){if(err){if(!done.errored){done.errored=true;return callback(err)}return}if(++completed>=total){return callback(null)}}transaction.onerror=(function(e){done(this.error);e.preventDefault()});create.sort().forEach((function(path){if(dst.type==="local"){IDBFS.loadRemoteEntry(store,path,(function(err,entry){if(err)return done(err);IDBFS.storeLocalEntry(path,entry,done)}))}else{IDBFS.loadLocalEntry(path,(function(err,entry){if(err)return done(err);IDBFS.storeRemoteEntry(store,path,entry,done)}))}}));remove.sort().reverse().forEach((function(path){if(dst.type==="local"){IDBFS.removeLocalEntry(path,done)}else{IDBFS.removeRemoteEntry(store,path,done)}}))})};var NODEFS={isWindows:false,staticInit:(function(){NODEFS.isWindows=!!process.platform.match(/^win/);var flags=process["binding"]("constants");if(flags["fs"]){flags=flags["fs"]}NODEFS.flagsForNodeMap={"1024":flags["O_APPEND"],"64":flags["O_CREAT"],"128":flags["O_EXCL"],"0":flags["O_RDONLY"],"2":flags["O_RDWR"],"4096":flags["O_SYNC"],"512":flags["O_TRUNC"],"1":flags["O_WRONLY"]}}),bufferFrom:(function(arrayBuffer){return Buffer.alloc?Buffer.from(arrayBuffer):new Buffer(arrayBuffer)}),mount:(function(mount){assert(ENVIRONMENT_IS_NODE);return NODEFS.createNode(null,"/",NODEFS.getMode(mount.opts.root),0)}),createNode:(function(parent,name,mode,dev){if(!FS.isDir(mode)&&!FS.isFile(mode)&&!FS.isLink(mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=FS.createNode(parent,name,mode);node.node_ops=NODEFS.node_ops;node.stream_ops=NODEFS.stream_ops;return node}),getMode:(function(path){var stat;try{stat=fs.lstatSync(path);if(NODEFS.isWindows){stat.mode=stat.mode|(stat.mode&292)>>2}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return stat.mode}),realPath:(function(node){var parts=[];while(node.parent!==node){parts.push(node.name);node=node.parent}parts.push(node.mount.opts.root);parts.reverse();return PATH.join.apply(null,parts)}),flagsForNode:(function(flags){flags&=~2097152;flags&=~2048;flags&=~32768;flags&=~524288;var newFlags=0;for(var k in NODEFS.flagsForNodeMap){if(flags&k){newFlags|=NODEFS.flagsForNodeMap[k];flags^=k}}if(!flags){return newFlags}else{throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}}),node_ops:{getattr:(function(node){var path=NODEFS.realPath(node);var stat;try{stat=fs.lstatSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(NODEFS.isWindows&&!stat.blksize){stat.blksize=4096}if(NODEFS.isWindows&&!stat.blocks){stat.blocks=(stat.size+stat.blksize-1)/stat.blksize|0}return{dev:stat.dev,ino:stat.ino,mode:stat.mode,nlink:stat.nlink,uid:stat.uid,gid:stat.gid,rdev:stat.rdev,size:stat.size,atime:stat.atime,mtime:stat.mtime,ctime:stat.ctime,blksize:stat.blksize,blocks:stat.blocks}}),setattr:(function(node,attr){var path=NODEFS.realPath(node);try{if(attr.mode!==undefined){fs.chmodSync(path,attr.mode);node.mode=attr.mode}if(attr.timestamp!==undefined){var date=new Date(attr.timestamp);fs.utimesSync(path,date,date)}if(attr.size!==undefined){fs.truncateSync(path,attr.size)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),lookup:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);var mode=NODEFS.getMode(path);return NODEFS.createNode(parent,name,mode)}),mknod:(function(parent,name,mode,dev){var node=NODEFS.createNode(parent,name,mode,dev);var path=NODEFS.realPath(node);try{if(FS.isDir(node.mode)){fs.mkdirSync(path,node.mode)}else{fs.writeFileSync(path,"",{mode:node.mode})}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return node}),rename:(function(oldNode,newDir,newName){var oldPath=NODEFS.realPath(oldNode);var newPath=PATH.join2(NODEFS.realPath(newDir),newName);try{fs.renameSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),unlink:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.unlinkSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),rmdir:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.rmdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readdir:(function(node){var path=NODEFS.realPath(node);try{return fs.readdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),symlink:(function(parent,newName,oldPath){var newPath=PATH.join2(NODEFS.realPath(parent),newName);try{fs.symlinkSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readlink:(function(node){var path=NODEFS.realPath(node);try{path=fs.readlinkSync(path);path=NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root),path);return path}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}})},stream_ops:{open:(function(stream){var path=NODEFS.realPath(stream.node);try{if(FS.isFile(stream.node.mode)){stream.nfd=fs.openSync(path,NODEFS.flagsForNode(stream.flags))}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),close:(function(stream){try{if(FS.isFile(stream.node.mode)&&stream.nfd){fs.closeSync(stream.nfd)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),read:(function(stream,buffer,offset,length,position){if(length===0)return 0;try{return fs.readSync(stream.nfd,NODEFS.bufferFrom(buffer.buffer),offset,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),write:(function(stream,buffer,offset,length,position){try{return fs.writeSync(stream.nfd,NODEFS.bufferFrom(buffer.buffer),offset,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){try{var stat=fs.fstatSync(stream.nfd);position+=stat.size}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};var WORKERFS={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:(function(mount){assert(ENVIRONMENT_IS_WORKER);if(!WORKERFS.reader)WORKERFS.reader=new FileReaderSync;var root=WORKERFS.createNode(null,"/",WORKERFS.DIR_MODE,0);var createdParents={};function ensureParent(path){var parts=path.split("/");var parent=root;for(var i=0;i=stream.node.size)return 0;var chunk=stream.node.contents.slice(position,position+length);var ab=WORKERFS.reader.readAsArrayBuffer(chunk);buffer.set(new Uint8Array(ab),offset);return chunk.size}),write:(function(stream,buffer,offset,length,position){throw new FS.ErrnoError(ERRNO_CODES.EIO)}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.size}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};STATICTOP+=16;STATICTOP+=16;STATICTOP+=16;var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:(function(e){if(!(e instanceof FS.ErrnoError))throw e+" : "+stackTrace();return ___setErrNo(e.errno)}),lookupPath:(function(path,opts){path=PATH.resolve(FS.cwd(),path);opts=opts||{};if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};for(var key in defaults){if(opts[key]===undefined){opts[key]=defaults[key]}}if(opts.recurse_count>8){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}var parts=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}}}}return{path:current_path,node:current}}),getPath:(function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}}),hashName:(function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length}),hashAddNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node}),hashRemoveNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}}),lookupNode:(function(parent,name){var err=FS.mayLookup(parent);if(err){throw new FS.ErrnoError(err,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)}),createNode:(function(parent,name,mode,rdev){if(!FS.FSNode){FS.FSNode=(function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev});FS.FSNode.prototype={};var readMode=292|73;var writeMode=146;Object.defineProperties(FS.FSNode.prototype,{read:{get:(function(){return(this.mode&readMode)===readMode}),set:(function(val){val?this.mode|=readMode:this.mode&=~readMode})},write:{get:(function(){return(this.mode&writeMode)===writeMode}),set:(function(val){val?this.mode|=writeMode:this.mode&=~writeMode})},isFolder:{get:(function(){return FS.isDir(this.mode)})},isDevice:{get:(function(){return FS.isChrdev(this.mode)})}})}var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node}),destroyNode:(function(node){FS.hashRemoveNode(node)}),isRoot:(function(node){return node===node.parent}),isMountpoint:(function(node){return!!node.mounted}),isFile:(function(mode){return(mode&61440)===32768}),isDir:(function(mode){return(mode&61440)===16384}),isLink:(function(mode){return(mode&61440)===40960}),isChrdev:(function(mode){return(mode&61440)===8192}),isBlkdev:(function(mode){return(mode&61440)===24576}),isFIFO:(function(mode){return(mode&61440)===4096}),isSocket:(function(mode){return(mode&49152)===49152}),flagModes:{"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},modeStringToFlags:(function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags}),flagsToPermissionString:(function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms}),nodePermissions:(function(node,perms){if(FS.ignorePermissions){return 0}if(perms.indexOf("r")!==-1&&!(node.mode&292)){return ERRNO_CODES.EACCES}else if(perms.indexOf("w")!==-1&&!(node.mode&146)){return ERRNO_CODES.EACCES}else if(perms.indexOf("x")!==-1&&!(node.mode&73)){return ERRNO_CODES.EACCES}return 0}),mayLookup:(function(dir){var err=FS.nodePermissions(dir,"x");if(err)return err;if(!dir.node_ops.lookup)return ERRNO_CODES.EACCES;return 0}),mayCreate:(function(dir,name){try{var node=FS.lookupNode(dir,name);return ERRNO_CODES.EEXIST}catch(e){}return FS.nodePermissions(dir,"wx")}),mayDelete:(function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var err=FS.nodePermissions(dir,"wx");if(err){return err}if(isdir){if(!FS.isDir(node.mode)){return ERRNO_CODES.ENOTDIR}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return ERRNO_CODES.EBUSY}}else{if(FS.isDir(node.mode)){return ERRNO_CODES.EISDIR}}return 0}),mayOpen:(function(node,flags){if(!node){return ERRNO_CODES.ENOENT}if(FS.isLink(node.mode)){return ERRNO_CODES.ELOOP}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return ERRNO_CODES.EISDIR}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))}),MAX_OPEN_FDS:4096,nextfd:(function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(ERRNO_CODES.EMFILE)}),getStream:(function(fd){return FS.streams[fd]}),createStream:(function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=(function(){});FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:(function(){return this.node}),set:(function(val){this.node=val})},isRead:{get:(function(){return(this.flags&2097155)!==1})},isWrite:{get:(function(){return(this.flags&2097155)!==0})},isAppend:{get:(function(){return this.flags&1024})}})}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream}),closeStream:(function(fd){FS.streams[fd]=null}),chrdev_stream_ops:{open:(function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}}),llseek:(function(){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)})},major:(function(dev){return dev>>8}),minor:(function(dev){return dev&255}),makedev:(function(ma,mi){return ma<<8|mi}),registerDevice:(function(dev,ops){FS.devices[dev]={stream_ops:ops}}),getDevice:(function(dev){return FS.devices[dev]}),getMounts:(function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts}),syncfs:(function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){console.log("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(err){assert(FS.syncFSRequests>0);FS.syncFSRequests--;return callback(err)}function done(err){if(err){if(!done.errored){done.errored=true;return doCallback(err)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach((function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)}))}),mount:(function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot}),unmount:(function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach((function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.indexOf(current.mount)!==-1){FS.destroyNode(current)}current=next}}));node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1)}),lookup:(function(parent,name){return parent.node_ops.lookup(parent,name)}),mknod:(function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var err=FS.mayCreate(parent,name);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return parent.node_ops.mknod(parent,name,mode,dev)}),create:(function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)}),mkdir:(function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)}),mkdirTree:(function(path,mode){var dirs=path.split("/");var d="";for(var i=0;i"}))}),staticInit:(function(){FS.ensureErrnoError();FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={"MEMFS":MEMFS,"IDBFS":IDBFS,"NODEFS":NODEFS,"WORKERFS":WORKERFS}}),init:(function(input,output,error){assert(!FS.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");FS.init.initialized=true;FS.ensureErrnoError();Module["stdin"]=input||Module["stdin"];Module["stdout"]=output||Module["stdout"];Module["stderr"]=error||Module["stderr"];FS.createStandardStreams()}),quit:(function(){FS.init.initialized=false;var fflush=Module["_fflush"];if(fflush)fflush(0);for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}});var lazyArray=this;lazyArray.setDataGetter((function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]}));if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;console.log("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._length})},chunkSize:{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize})}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:(function(){return this.contents.length})}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach((function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}return fn.apply(null,arguments)}}));stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;HEAP32[buf+36>>2]=stat.size;HEAP32[buf+40>>2]=4096;HEAP32[buf+44>>2]=stat.blocks;HEAP32[buf+48>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+52>>2]=0;HEAP32[buf+56>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ino;return 0}),doMsync:(function(addr,stream,len,flags){var buffer=new Uint8Array(HEAPU8.subarray(addr,addr+len));FS.msync(stream,buffer,0,len,flags)}),doMkdir:(function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0}),doMknod:(function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-ERRNO_CODES.EINVAL}FS.mknod(path,mode,dev);return 0}),doReadlink:(function(path,buf,bufsize){if(bufsize<=0)return-ERRNO_CODES.EINVAL;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len}),doAccess:(function(path,amode){if(amode&~7){return-ERRNO_CODES.EINVAL}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-ERRNO_CODES.EACCES}return 0}),doDup:(function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd}),doReadv:(function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret}),varargs:0,get:(function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret}),getStr:(function(){var ret=Pointer_stringify(SYSCALLS.get());return ret}),getStreamFromFD:(function(){var stream=FS.getStream(SYSCALLS.get());if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return stream}),getSocketFromFD:(function(){var socket=SOCKFS.getSocket(SYSCALLS.get());if(!socket)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return socket}),getSocketAddress:(function(allowNull){var addrp=SYSCALLS.get(),addrlen=SYSCALLS.get();if(allowNull&&addrp===0)return null;var info=__read_sockaddr(addrp,addrlen);if(info.errno)throw new FS.ErrnoError(info.errno);info.addr=DNS.lookup_addr(info.addr)||info.addr;return info}),get64:(function(){var low=SYSCALLS.get(),high=SYSCALLS.get();if(low>=0)assert(high===0);else assert(high===-1);return low}),getZero:(function(){assert(SYSCALLS.get()===0)})};function ___syscall10(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr();FS.unlink(path);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var SOCKFS={mount:(function(mount){Module["websocket"]=Module["websocket"]&&"object"===typeof Module["websocket"]?Module["websocket"]:{};Module["websocket"]._callbacks={};Module["websocket"]["on"]=(function(event,callback){if("function"===typeof callback){this._callbacks[event]=callback}return this});Module["websocket"].emit=(function(event,param){if("function"===typeof this._callbacks[event]){this._callbacks[event].call(this,param)}});return FS.createNode(null,"/",16384|511,0)}),createSocket:(function(family,type,protocol){var streaming=type==1;if(protocol){assert(streaming==(protocol==6))}var sock={family:family,type:type,protocol:protocol,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:SOCKFS.websocket_sock_ops};var name=SOCKFS.nextname();var node=FS.createNode(SOCKFS.root,name,49152,0);node.sock=sock;var stream=FS.createStream({path:name,node:node,flags:FS.modeStringToFlags("r+"),seekable:false,stream_ops:SOCKFS.stream_ops});sock.stream=stream;return sock}),getSocket:(function(fd){var stream=FS.getStream(fd);if(!stream||!FS.isSocket(stream.node.mode)){return null}return stream.node.sock}),stream_ops:{poll:(function(stream){var sock=stream.node.sock;return sock.sock_ops.poll(sock)}),ioctl:(function(stream,request,varargs){var sock=stream.node.sock;return sock.sock_ops.ioctl(sock,request,varargs)}),read:(function(stream,buffer,offset,length,position){var sock=stream.node.sock;var msg=sock.sock_ops.recvmsg(sock,length);if(!msg){return 0}buffer.set(msg.buffer,offset);return msg.buffer.length}),write:(function(stream,buffer,offset,length,position){var sock=stream.node.sock;return sock.sock_ops.sendmsg(sock,buffer,offset,length)}),close:(function(stream){var sock=stream.node.sock;sock.sock_ops.close(sock)})},nextname:(function(){if(!SOCKFS.nextname.current){SOCKFS.nextname.current=0}return"socket["+SOCKFS.nextname.current++ +"]"}),websocket_sock_ops:{createPeer:(function(sock,addr,port){var ws;if(typeof addr==="object"){ws=addr;addr=null;port=null}if(ws){if(ws._socket){addr=ws._socket.remoteAddress;port=ws._socket.remotePort}else{var result=/ws[s]?:\/\/([^:]+):(\d+)/.exec(ws.url);if(!result){throw new Error("WebSocket URL must be in the format ws(s)://address:port")}addr=result[1];port=parseInt(result[2],10)}}else{try{var runtimeConfig=Module["websocket"]&&"object"===typeof Module["websocket"];var url="ws:#".replace("#","//");if(runtimeConfig){if("string"===typeof Module["websocket"]["url"]){url=Module["websocket"]["url"]}}if(url==="ws://"||url==="wss://"){var parts=addr.split("/");url=url+parts[0]+":"+port+"/"+parts.slice(1).join("/")}var subProtocols="binary";if(runtimeConfig){if("string"===typeof Module["websocket"]["subprotocol"]){subProtocols=Module["websocket"]["subprotocol"]}}subProtocols=subProtocols.replace(/^ +| +$/g,"").split(/ *, */);var opts=ENVIRONMENT_IS_NODE?{"protocol":subProtocols.toString()}:subProtocols;if(runtimeConfig&&null===Module["websocket"]["subprotocol"]){subProtocols="null";opts=undefined}var WebSocketConstructor;if(ENVIRONMENT_IS_NODE){WebSocketConstructor=require("ws")}else if(ENVIRONMENT_IS_WEB){WebSocketConstructor=window["WebSocket"]}else{WebSocketConstructor=WebSocket}ws=new WebSocketConstructor(url,opts);ws.binaryType="arraybuffer"}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EHOSTUNREACH)}}var peer={addr:addr,port:port,socket:ws,dgram_send_queue:[]};SOCKFS.websocket_sock_ops.addPeer(sock,peer);SOCKFS.websocket_sock_ops.handlePeerEvents(sock,peer);if(sock.type===2&&typeof sock.sport!=="undefined"){peer.dgram_send_queue.push(new Uint8Array([255,255,255,255,"p".charCodeAt(0),"o".charCodeAt(0),"r".charCodeAt(0),"t".charCodeAt(0),(sock.sport&65280)>>8,sock.sport&255]))}return peer}),getPeer:(function(sock,addr,port){return sock.peers[addr+":"+port]}),addPeer:(function(sock,peer){sock.peers[peer.addr+":"+peer.port]=peer}),removePeer:(function(sock,peer){delete sock.peers[peer.addr+":"+peer.port]}),handlePeerEvents:(function(sock,peer){var first=true;var handleOpen=(function(){Module["websocket"].emit("open",sock.stream.fd);try{var queued=peer.dgram_send_queue.shift();while(queued){peer.socket.send(queued);queued=peer.dgram_send_queue.shift()}}catch(e){peer.socket.close()}});function handleMessage(data){assert(typeof data!=="string"&&data.byteLength!==undefined);if(data.byteLength==0){return}data=new Uint8Array(data);var wasfirst=first;first=false;if(wasfirst&&data.length===10&&data[0]===255&&data[1]===255&&data[2]===255&&data[3]===255&&data[4]==="p".charCodeAt(0)&&data[5]==="o".charCodeAt(0)&&data[6]==="r".charCodeAt(0)&&data[7]==="t".charCodeAt(0)){var newport=data[8]<<8|data[9];SOCKFS.websocket_sock_ops.removePeer(sock,peer);peer.port=newport;SOCKFS.websocket_sock_ops.addPeer(sock,peer);return}sock.recv_queue.push({addr:peer.addr,port:peer.port,data:data});Module["websocket"].emit("message",sock.stream.fd)}if(ENVIRONMENT_IS_NODE){peer.socket.on("open",handleOpen);peer.socket.on("message",(function(data,flags){if(!flags.binary){return}handleMessage((new Uint8Array(data)).buffer)}));peer.socket.on("close",(function(){Module["websocket"].emit("close",sock.stream.fd)}));peer.socket.on("error",(function(error){sock.error=ERRNO_CODES.ECONNREFUSED;Module["websocket"].emit("error",[sock.stream.fd,sock.error,"ECONNREFUSED: Connection refused"])}))}else{peer.socket.onopen=handleOpen;peer.socket.onclose=(function(){Module["websocket"].emit("close",sock.stream.fd)});peer.socket.onmessage=function peer_socket_onmessage(event){handleMessage(event.data)};peer.socket.onerror=(function(error){sock.error=ERRNO_CODES.ECONNREFUSED;Module["websocket"].emit("error",[sock.stream.fd,sock.error,"ECONNREFUSED: Connection refused"])})}}),poll:(function(sock){if(sock.type===1&&sock.server){return sock.pending.length?64|1:0}var mask=0;var dest=sock.type===1?SOCKFS.websocket_sock_ops.getPeer(sock,sock.daddr,sock.dport):null;if(sock.recv_queue.length||!dest||dest&&dest.socket.readyState===dest.socket.CLOSING||dest&&dest.socket.readyState===dest.socket.CLOSED){mask|=64|1}if(!dest||dest&&dest.socket.readyState===dest.socket.OPEN){mask|=4}if(dest&&dest.socket.readyState===dest.socket.CLOSING||dest&&dest.socket.readyState===dest.socket.CLOSED){mask|=16}return mask}),ioctl:(function(sock,request,arg){switch(request){case 21531:var bytes=0;if(sock.recv_queue.length){bytes=sock.recv_queue[0].data.length}HEAP32[arg>>2]=bytes;return 0;default:return ERRNO_CODES.EINVAL}}),close:(function(sock){if(sock.server){try{sock.server.close()}catch(e){}sock.server=null}var peers=Object.keys(sock.peers);for(var i=0;i>>0}function __inet_pton6_raw(str){var words;var w,offset,z;var valid6regx=/^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i;var parts=[];if(!valid6regx.test(str)){return null}if(str==="::"){return[0,0,0,0,0,0,0,0]}if(str.indexOf("::")===0){str=str.replace("::","Z:")}else{str=str.replace("::",":Z:")}if(str.indexOf(".")>0){str=str.replace(new RegExp("[.]","g"),":");words=str.split(":");words[words.length-4]=parseInt(words[words.length-4])+parseInt(words[words.length-3])*256;words[words.length-3]=parseInt(words[words.length-2])+parseInt(words[words.length-1])*256;words=words.slice(0,words.length-2)}else{words=str.split(":")}offset=0;z=0;for(w=0;w>8&255)+"."+(addr>>16&255)+"."+(addr>>24&255)}function __inet_ntop6_raw(ints){var str="";var word=0;var longest=0;var lastzero=0;var zstart=0;var len=0;var i=0;var parts=[ints[0]&65535,ints[0]>>16,ints[1]&65535,ints[1]>>16,ints[2]&65535,ints[2]>>16,ints[3]&65535,ints[3]>>16];var hasipv4=true;var v4part="";for(i=0;i<5;i++){if(parts[i]!==0){hasipv4=false;break}}if(hasipv4){v4part=__inet_ntop4_raw(parts[6]|parts[7]<<16);if(parts[5]===-1){str="::ffff:";str+=v4part;return str}if(parts[5]===0){str="::";if(v4part==="0.0.0.0")v4part="";if(v4part==="0.0.0.1")v4part="1";str+=v4part;return str}}for(word=0;word<8;word++){if(parts[word]===0){if(word-lastzero>1){len=0}lastzero=word;len++}if(len>longest){longest=len;zstart=word-longest+1}}for(word=0;word<8;word++){if(longest>1){if(parts[word]===0&&word>=zstart&&word>1];var port=_ntohs(HEAP16[sa+2>>1]);var addr;switch(family){case 2:if(salen!==16){return{errno:ERRNO_CODES.EINVAL}}addr=HEAP32[sa+4>>2];addr=__inet_ntop4_raw(addr);break;case 10:if(salen!==28){return{errno:ERRNO_CODES.EINVAL}}addr=[HEAP32[sa+8>>2],HEAP32[sa+12>>2],HEAP32[sa+16>>2],HEAP32[sa+20>>2]];addr=__inet_ntop6_raw(addr);break;default:return{errno:ERRNO_CODES.EAFNOSUPPORT}}return{family:family,addr:addr,port:port}}function __write_sockaddr(sa,family,addr,port){switch(family){case 2:addr=__inet_pton4_raw(addr);HEAP16[sa>>1]=family;HEAP32[sa+4>>2]=addr;HEAP16[sa+2>>1]=_htons(port);break;case 10:addr=__inet_pton6_raw(addr);HEAP32[sa>>2]=family;HEAP32[sa+8>>2]=addr[0];HEAP32[sa+12>>2]=addr[1];HEAP32[sa+16>>2]=addr[2];HEAP32[sa+20>>2]=addr[3];HEAP16[sa+2>>1]=_htons(port);HEAP32[sa+4>>2]=0;HEAP32[sa+24>>2]=0;break;default:return{errno:ERRNO_CODES.EAFNOSUPPORT}}return{}}function ___syscall102(which,varargs){SYSCALLS.varargs=varargs;try{var call=SYSCALLS.get(),socketvararg=SYSCALLS.get();SYSCALLS.varargs=socketvararg;switch(call){case 1:{var domain=SYSCALLS.get(),type=SYSCALLS.get(),protocol=SYSCALLS.get();var sock=SOCKFS.createSocket(domain,type,protocol);assert(sock.stream.fd<64);return sock.stream.fd};case 2:{var sock=SYSCALLS.getSocketFromFD(),info=SYSCALLS.getSocketAddress();sock.sock_ops.bind(sock,info.addr,info.port);return 0};case 3:{var sock=SYSCALLS.getSocketFromFD(),info=SYSCALLS.getSocketAddress();sock.sock_ops.connect(sock,info.addr,info.port);return 0};case 4:{var sock=SYSCALLS.getSocketFromFD(),backlog=SYSCALLS.get();sock.sock_ops.listen(sock,backlog);return 0};case 5:{var sock=SYSCALLS.getSocketFromFD(),addr=SYSCALLS.get(),addrlen=SYSCALLS.get();var newsock=sock.sock_ops.accept(sock);if(addr){var res=__write_sockaddr(addr,newsock.family,DNS.lookup_name(newsock.daddr),newsock.dport);assert(!res.errno)}return newsock.stream.fd};case 6:{var sock=SYSCALLS.getSocketFromFD(),addr=SYSCALLS.get(),addrlen=SYSCALLS.get();var res=__write_sockaddr(addr,sock.family,DNS.lookup_name(sock.saddr||"0.0.0.0"),sock.sport);assert(!res.errno);return 0};case 7:{var sock=SYSCALLS.getSocketFromFD(),addr=SYSCALLS.get(),addrlen=SYSCALLS.get();if(!sock.daddr){return-ERRNO_CODES.ENOTCONN}var res=__write_sockaddr(addr,sock.family,DNS.lookup_name(sock.daddr),sock.dport);assert(!res.errno);return 0};case 11:{var sock=SYSCALLS.getSocketFromFD(),message=SYSCALLS.get(),length=SYSCALLS.get(),flags=SYSCALLS.get(),dest=SYSCALLS.getSocketAddress(true);if(!dest){return FS.write(sock.stream,HEAP8,message,length)}else{return sock.sock_ops.sendmsg(sock,HEAP8,message,length,dest.addr,dest.port)}};case 12:{var sock=SYSCALLS.getSocketFromFD(),buf=SYSCALLS.get(),len=SYSCALLS.get(),flags=SYSCALLS.get(),addr=SYSCALLS.get(),addrlen=SYSCALLS.get();var msg=sock.sock_ops.recvmsg(sock,len);if(!msg)return 0;if(addr){var res=__write_sockaddr(addr,sock.family,DNS.lookup_name(msg.addr),msg.port);assert(!res.errno)}HEAPU8.set(msg.buffer,buf);return msg.buffer.byteLength};case 14:{return-ERRNO_CODES.ENOPROTOOPT};case 15:{var sock=SYSCALLS.getSocketFromFD(),level=SYSCALLS.get(),optname=SYSCALLS.get(),optval=SYSCALLS.get(),optlen=SYSCALLS.get();if(level===1){if(optname===4){HEAP32[optval>>2]=sock.error;HEAP32[optlen>>2]=4;sock.error=null;return 0}}return-ERRNO_CODES.ENOPROTOOPT};case 16:{var sock=SYSCALLS.getSocketFromFD(),message=SYSCALLS.get(),flags=SYSCALLS.get();var iov=HEAP32[message+8>>2];var num=HEAP32[message+12>>2];var addr,port;var name=HEAP32[message>>2];var namelen=HEAP32[message+4>>2];if(name){var info=__read_sockaddr(name,namelen);if(info.errno)return-info.errno;port=info.port;addr=DNS.lookup_addr(info.addr)||info.addr}var total=0;for(var i=0;i>2]}var view=new Uint8Array(total);var offset=0;for(var i=0;i>2];var iovlen=HEAP32[iov+(8*i+4)>>2];for(var j=0;j>0]}}return sock.sock_ops.sendmsg(sock,view,0,total,addr,port)};case 17:{var sock=SYSCALLS.getSocketFromFD(),message=SYSCALLS.get(),flags=SYSCALLS.get();var iov=HEAP32[message+8>>2];var num=HEAP32[message+12>>2];var total=0;for(var i=0;i>2]}var msg=sock.sock_ops.recvmsg(sock,total);if(!msg)return 0;var name=HEAP32[message>>2];if(name){var res=__write_sockaddr(name,sock.family,DNS.lookup_name(msg.addr),msg.port);assert(!res.errno)}var bytesRead=0;var bytesRemaining=msg.buffer.byteLength;for(var i=0;bytesRemaining>0&&i>2];var iovlen=HEAP32[iov+(8*i+4)>>2];if(!iovlen){continue}var length=Math.min(iovlen,bytesRemaining);var buf=msg.buffer.subarray(bytesRead,bytesRead+length);HEAPU8.set(buf,iovbase+bytesRead);bytesRead+=length;bytesRemaining-=length}return bytesRead};default:abort("unsupported socketcall syscall "+call)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall122(which,varargs){SYSCALLS.varargs=varargs;try{var buf=SYSCALLS.get();if(!buf)return-ERRNO_CODES.EFAULT;var layout={"sysname":0,"nodename":65,"domainname":325,"machine":260,"version":195,"release":130,"__size__":390};function copyString(element,value){var offset=layout[element];writeAsciiToMemory(value,buf+offset)}copyString("sysname","Emscripten");copyString("nodename","emscripten");copyString("release","1.0");copyString("version","#1");copyString("machine","x86-JS");return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall142(which,varargs){SYSCALLS.varargs=varargs;try{var nfds=SYSCALLS.get(),readfds=SYSCALLS.get(),writefds=SYSCALLS.get(),exceptfds=SYSCALLS.get(),timeout=SYSCALLS.get();assert(nfds<=64,"nfds must be less than or equal to 64");assert(!exceptfds,"exceptfds not supported");var total=0;var srcReadLow=readfds?HEAP32[readfds>>2]:0,srcReadHigh=readfds?HEAP32[readfds+4>>2]:0;var srcWriteLow=writefds?HEAP32[writefds>>2]:0,srcWriteHigh=writefds?HEAP32[writefds+4>>2]:0;var srcExceptLow=exceptfds?HEAP32[exceptfds>>2]:0,srcExceptHigh=exceptfds?HEAP32[exceptfds+4>>2]:0;var dstReadLow=0,dstReadHigh=0;var dstWriteLow=0,dstWriteHigh=0;var dstExceptLow=0,dstExceptHigh=0;var allLow=(readfds?HEAP32[readfds>>2]:0)|(writefds?HEAP32[writefds>>2]:0)|(exceptfds?HEAP32[exceptfds>>2]:0);var allHigh=(readfds?HEAP32[readfds+4>>2]:0)|(writefds?HEAP32[writefds+4>>2]:0)|(exceptfds?HEAP32[exceptfds+4>>2]:0);function check(fd,low,high,val){return fd<32?low&val:high&val}for(var fd=0;fd>2]=dstReadLow;HEAP32[readfds+4>>2]=dstReadHigh}if(writefds){HEAP32[writefds>>2]=dstWriteLow;HEAP32[writefds+4>>2]=dstWriteHigh}if(exceptfds){HEAP32[exceptfds>>2]=dstExceptLow;HEAP32[exceptfds+4>>2]=dstExceptHigh}return total}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall145(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doReadv(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doWritev(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall15(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),mode=SYSCALLS.get();FS.chmod(path,mode);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall168(which,varargs){SYSCALLS.varargs=varargs;try{var fds=SYSCALLS.get(),nfds=SYSCALLS.get(),timeout=SYSCALLS.get();var nonzero=0;for(var i=0;i>2];var events=HEAP16[pollfd+4>>1];var mask=32;var stream=FS.getStream(fd);if(stream){mask=SYSCALLS.DEFAULT_POLLMASK;if(stream.stream_ops.poll){mask=stream.stream_ops.poll(stream)}}mask&=events|8|16;if(mask)nonzero++;HEAP16[pollfd+6>>1]=mask}return nonzero}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall183(which,varargs){SYSCALLS.varargs=varargs;try{var buf=SYSCALLS.get(),size=SYSCALLS.get();if(size===0)return-ERRNO_CODES.EINVAL;var cwd=FS.cwd();var cwdLengthInBytes=lengthBytesUTF8(cwd);if(size0&&pos+268<=count){var id;var type;var name=stream.getdents.pop();if(name[0]==="."){id=1;type=4}else{var child=FS.lookupNode(stream.node,name);id=child.id;type=FS.isChrdev(child.mode)?2:FS.isDir(child.mode)?4:FS.isLink(child.mode)?10:8}HEAP32[dirp+pos>>2]=id;HEAP32[dirp+pos+4>>2]=stream.position;HEAP16[dirp+pos+8>>1]=268;HEAP8[dirp+pos+10>>0]=type;stringToUTF8(name,dirp+pos+11,256);pos+=268}return pos}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),cmd=SYSCALLS.get();switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-ERRNO_CODES.EINVAL}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd};case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0};case 12:case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0};case 13:case 14:case 13:case 14:return 0;case 16:case 8:return-ERRNO_CODES.EINVAL;case 9:___setErrNo(ERRNO_CODES.EINVAL);return-1;default:{return-ERRNO_CODES.EINVAL}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall268(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),size=SYSCALLS.get(),buf=SYSCALLS.get();assert(size===64);HEAP32[buf+4>>2]=4096;HEAP32[buf+40>>2]=4096;HEAP32[buf+8>>2]=1e6;HEAP32[buf+12>>2]=5e5;HEAP32[buf+16>>2]=5e5;HEAP32[buf+20>>2]=FS.nextInode;HEAP32[buf+24>>2]=1e6;HEAP32[buf+28>>2]=42;HEAP32[buf+44>>2]=2;HEAP32[buf+36>>2]=255;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall3(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get(),count=SYSCALLS.get();return FS.read(stream,HEAP8,buf,count)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall33(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),amode=SYSCALLS.get();return SYSCALLS.doAccess(path,amode)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall38(which,varargs){SYSCALLS.varargs=varargs;try{var old_path=SYSCALLS.getStr(),new_path=SYSCALLS.getStr();FS.rename(old_path,new_path);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall39(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),mode=SYSCALLS.get();return SYSCALLS.doMkdir(path,mode)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall4(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get(),count=SYSCALLS.get();return FS.write(stream,HEAP8,buf,count)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall40(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr();FS.rmdir(path);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var PIPEFS={BUCKET_BUFFER_SIZE:8192,mount:(function(mount){return FS.createNode(null,"/",16384|511,0)}),createPipe:(function(){var pipe={buckets:[]};pipe.buckets.push({buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var rName=PIPEFS.nextname();var wName=PIPEFS.nextname();var rNode=FS.createNode(PIPEFS.root,rName,4096,0);var wNode=FS.createNode(PIPEFS.root,wName,4096,0);rNode.pipe=pipe;wNode.pipe=pipe;var readableStream=FS.createStream({path:rName,node:rNode,flags:FS.modeStringToFlags("r"),seekable:false,stream_ops:PIPEFS.stream_ops});rNode.stream=readableStream;var writableStream=FS.createStream({path:wName,node:wNode,flags:FS.modeStringToFlags("w"),seekable:false,stream_ops:PIPEFS.stream_ops});wNode.stream=writableStream;return{readable_fd:readableStream.fd,writable_fd:writableStream.fd}}),stream_ops:{poll:(function(stream){var pipe=stream.node.pipe;if((stream.flags&2097155)===1){return 256|4}else{if(pipe.buckets.length>0){for(var i=0;i0){return 64|1}}}}return 0}),ioctl:(function(stream,request,varargs){return ERRNO_CODES.EINVAL}),read:(function(stream,buffer,offset,length,position){var pipe=stream.node.pipe;var currentLength=0;for(var i=0;i=dataLen){currBucket.buffer.set(data,currBucket.offset);currBucket.offset+=dataLen;return dataLen}else if(freeBytesInCurrBuffer>0){currBucket.buffer.set(data.subarray(0,freeBytesInCurrBuffer),currBucket.offset);currBucket.offset+=freeBytesInCurrBuffer;data=data.subarray(freeBytesInCurrBuffer,data.byteLength)}var numBuckets=data.byteLength/PIPEFS.BUCKET_BUFFER_SIZE|0;var remElements=data.byteLength%PIPEFS.BUCKET_BUFFER_SIZE;for(var i=0;i0){var newBucket={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:data.byteLength,roffset:0};pipe.buckets.push(newBucket);newBucket.buffer.set(data)}return dataLen}),close:(function(stream){var pipe=stream.node.pipe;pipe.buckets=null})},nextname:(function(){if(!PIPEFS.nextname.current){PIPEFS.nextname.current=0}return"pipe["+PIPEFS.nextname.current++ +"]"})};function ___syscall42(which,varargs){SYSCALLS.varargs=varargs;try{var fdPtr=SYSCALLS.get();if(fdPtr==0){throw new FS.ErrnoError(ERRNO_CODES.EFAULT)}var res=PIPEFS.createPipe();HEAP32[fdPtr>>2]=res.readable_fd;HEAP32[fdPtr+4>>2]=res.writable_fd;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),op=SYSCALLS.get();switch(op){case 21509:case 21505:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21519:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0};case 21520:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return-ERRNO_CODES.EINVAL};case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)};case 21523:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21524:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD();FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall63(which,varargs){SYSCALLS.varargs=varargs;try{var old=SYSCALLS.getStreamFromFD(),suggestFD=SYSCALLS.get();if(old.fd===suggestFD)return suggestFD;return SYSCALLS.doDup(old.path,old.flags,suggestFD)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall77(which,varargs){SYSCALLS.varargs=varargs;try{var who=SYSCALLS.get(),usage=SYSCALLS.get();_memset(usage,0,136);HEAP32[usage>>2]=1;HEAP32[usage+4>>2]=2;HEAP32[usage+8>>2]=3;HEAP32[usage+12>>2]=4;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall85(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),buf=SYSCALLS.get(),bufsize=SYSCALLS.get();return SYSCALLS.doReadlink(path,buf,bufsize)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall91(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get();var info=SYSCALLS.mappings[addr];if(!info)return 0;if(len===info.len){var stream=FS.getStream(info.fd);SYSCALLS.doMsync(addr,stream,len,info.flags);FS.munmap(stream);SYSCALLS.mappings[addr]=null;if(info.allocated){_free(info.malloc)}}return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___unlock(){}function _abort(){Module["abort"]()}function _atexit(func,arg){__ATEXIT__.unshift({func:func,arg:arg})}function _clock(){if(_clock.start===undefined)_clock.start=Date.now();return(Date.now()-_clock.start)*(1e6/1e3)|0}function _emscripten_get_now_res(){if(ENVIRONMENT_IS_NODE){return 1}else if(typeof dateNow!=="undefined"||(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&self["performance"]&&self["performance"]["now"]){return 1e3}else{return 1e3*1e3}}function _emscripten_get_now(){abort()}function _emscripten_get_now_is_monotonic(){return ENVIRONMENT_IS_NODE||typeof dateNow!=="undefined"||(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&self["performance"]&&self["performance"]["now"]}function _clock_getres(clk_id,res){var nsec;if(clk_id===0){nsec=1e3*1e3}else if(clk_id===1&&_emscripten_get_now_is_monotonic()){nsec=_emscripten_get_now_res()}else{___setErrNo(ERRNO_CODES.EINVAL);return-1}HEAP32[res>>2]=nsec/1e9|0;HEAP32[res+4>>2]=nsec;return 0}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if(clk_id===1&&_emscripten_get_now_is_monotonic()){now=_emscripten_get_now()}else{___setErrNo(ERRNO_CODES.EINVAL);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}function _difftime(time1,time0){return time1-time0}var DLFCN={error:null,errorMsg:null,loadedLibs:{},loadedLibNames:{}};function _dlclose(handle){if(!DLFCN.loadedLibs[handle]){DLFCN.errorMsg="Tried to dlclose() unopened handle: "+handle;return 1}else{var lib_record=DLFCN.loadedLibs[handle];if(--lib_record.refcount==0){if(lib_record.module.cleanups){lib_record.module.cleanups.forEach((function(cleanup){cleanup()}))}delete DLFCN.loadedLibNames[lib_record.name];delete DLFCN.loadedLibs[handle]}return 0}}function _dlopen(filename,flag){abort("To use dlopen, you need to use Emscripten's linking support, see https://github.com/kripken/emscripten/wiki/Linking");var searchpaths=[];if(filename===0){filename="__self__"}else{var strfilename=Pointer_stringify(filename);var isValidFile=(function(filename){var target=FS.findObject(filename);return target&&!target.isFolder&&!target.isDevice});if(isValidFile(strfilename)){filename=strfilename}else{if(ENV["LD_LIBRARY_PATH"]){searchpaths=ENV["LD_LIBRARY_PATH"].split(":")}for(var ident in searchpaths){var searchfile=PATH.join2(searchpaths[ident],strfilename);if(isValidFile(searchfile)){filename=searchfile;break}}}}if(DLFCN.loadedLibNames[filename]){var handle=DLFCN.loadedLibNames[filename];DLFCN.loadedLibs[handle].refcount++;return handle}var lib_module;if(filename==="__self__"){var handle=-1;lib_module=Module}else{if(Module["preloadedWasm"]!==undefined&&Module["preloadedWasm"][filename]!==undefined){lib_module=Module["preloadedWasm"][filename]}else{var target=FS.findObject(filename);if(!target||target.isFolder||target.isDevice){DLFCN.errorMsg="Could not find dynamic lib: "+filename;return 0}FS.forceLoadFile(target);try{var lib_data=FS.readFile(filename,{encoding:"binary"});if(!(lib_data instanceof Uint8Array))lib_data=new Uint8Array(lib_data);lib_module=loadWebAssemblyModule(lib_data)}catch(e){DLFCN.errorMsg="Could not evaluate dynamic lib: "+filename+"\n"+e;return 0}}var handle=1;for(var key in DLFCN.loadedLibs){if(DLFCN.loadedLibs.hasOwnProperty(key))handle++}if(flag&256){for(var ident in lib_module){if(lib_module.hasOwnProperty(ident)){if(ident[0]=="_"){Module[ident]=lib_module[ident]}}}}}DLFCN.loadedLibs[handle]={refcount:1,name:filename,module:lib_module};DLFCN.loadedLibNames[filename]=handle;return handle}function _dlsym(handle,symbol){symbol=Pointer_stringify(symbol);if(!DLFCN.loadedLibs[handle]){DLFCN.errorMsg="Tried to dlsym() from an unopened handle: "+handle;return 0}else{var lib=DLFCN.loadedLibs[handle];symbol="_"+symbol;if(!lib.module.hasOwnProperty(symbol)){DLFCN.errorMsg='Tried to lookup unknown symbol "'+symbol+'" in dynamic lib: '+lib.name;return 0}else{var result=lib.module[symbol];if(typeof result==="function"){return addFunction(result)}return result}}}function _emscripten_set_main_loop_timing(mode,value){Browser.mainLoop.timingMode=mode;Browser.mainLoop.timingValue=value;if(!Browser.mainLoop.func){return 1}if(mode==0){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setTimeout(){var timeUntilNextTick=Math.max(0,Browser.mainLoop.tickStartTime+value-_emscripten_get_now())|0;setTimeout(Browser.mainLoop.runner,timeUntilNextTick)};Browser.mainLoop.method="timeout"}else if(mode==1){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_rAF(){Browser.requestAnimationFrame(Browser.mainLoop.runner)};Browser.mainLoop.method="rAF"}else if(mode==2){if(typeof setImmediate==="undefined"){var setImmediates=[];var emscriptenMainLoopMessageId="setimmediate";function Browser_setImmediate_messageHandler(event){if(event.data===emscriptenMainLoopMessageId||event.data.target===emscriptenMainLoopMessageId){event.stopPropagation();setImmediates.shift()()}}addEventListener("message",Browser_setImmediate_messageHandler,true);setImmediate=function Browser_emulated_setImmediate(func){setImmediates.push(func);if(ENVIRONMENT_IS_WORKER){if(Module["setImmediates"]===undefined)Module["setImmediates"]=[];Module["setImmediates"].push(func);postMessage({target:emscriptenMainLoopMessageId})}else postMessage(emscriptenMainLoopMessageId,"*")}}Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setImmediate(){setImmediate(Browser.mainLoop.runner)};Browser.mainLoop.method="immediate"}return 0}function _emscripten_set_main_loop(func,fps,simulateInfiniteLoop,arg,noSetTiming){Module["noExitRuntime"]=true;assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.");Browser.mainLoop.func=func;Browser.mainLoop.arg=arg;var browserIterationFunc;if(typeof arg!=="undefined"){browserIterationFunc=(function(){Module["dynCall_vi"](func,arg)})}else{browserIterationFunc=(function(){Module["dynCall_v"](func)})}var thisMainLoopId=Browser.mainLoop.currentlyRunningMainloop;Browser.mainLoop.runner=function Browser_mainLoop_runner(){if(ABORT)return;if(Browser.mainLoop.queue.length>0){var start=Date.now();var blocker=Browser.mainLoop.queue.shift();blocker.func(blocker.arg);if(Browser.mainLoop.remainingBlockers){var remaining=Browser.mainLoop.remainingBlockers;var next=remaining%1==0?remaining-1:Math.floor(remaining);if(blocker.counted){Browser.mainLoop.remainingBlockers=next}else{next=next+.5;Browser.mainLoop.remainingBlockers=(8*remaining+next)/9}}console.log('main loop blocker "'+blocker.name+'" took '+(Date.now()-start)+" ms");Browser.mainLoop.updateStatus();if(thisMainLoopId1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0){Browser.mainLoop.scheduler();return}else if(Browser.mainLoop.timingMode==0){Browser.mainLoop.tickStartTime=_emscripten_get_now()}if(Browser.mainLoop.method==="timeout"&&Module.ctx){err("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!");Browser.mainLoop.method=""}Browser.mainLoop.runIter(browserIterationFunc);if(thisMainLoopId0)_emscripten_set_main_loop_timing(0,1e3/fps);else _emscripten_set_main_loop_timing(1,1);Browser.mainLoop.scheduler()}if(simulateInfiniteLoop){throw"SimulateInfiniteLoop"}}var Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:(function(){Browser.mainLoop.scheduler=null;Browser.mainLoop.currentlyRunningMainloop++}),resume:(function(){Browser.mainLoop.currentlyRunningMainloop++;var timingMode=Browser.mainLoop.timingMode;var timingValue=Browser.mainLoop.timingValue;var func=Browser.mainLoop.func;Browser.mainLoop.func=null;_emscripten_set_main_loop(func,0,false,Browser.mainLoop.arg,true);_emscripten_set_main_loop_timing(timingMode,timingValue);Browser.mainLoop.scheduler()}),updateStatus:(function(){if(Module["setStatus"]){var message=Module["statusMessage"]||"Please wait...";var remaining=Browser.mainLoop.remainingBlockers;var expected=Browser.mainLoop.expectedBlockers;if(remaining){if(remaining=6){var curr=leftchar>>leftbits-6&63;leftbits-=6;ret+=BASE[curr]}}if(leftbits==2){ret+=BASE[(leftchar&3)<<4];ret+=PAD+PAD}else if(leftbits==4){ret+=BASE[(leftchar&15)<<2];ret+=PAD}return ret}audio.src="data:audio/x-"+name.substr(-3)+";base64,"+encode64(byteArray);finish(audio)};audio.src=url;Browser.safeSetTimeout((function(){finish(audio)}),1e4)}else{return fail()}};Module["preloadPlugins"].push(audioPlugin);function pointerLockChange(){Browser.pointerLock=document["pointerLockElement"]===Module["canvas"]||document["mozPointerLockElement"]===Module["canvas"]||document["webkitPointerLockElement"]===Module["canvas"]||document["msPointerLockElement"]===Module["canvas"]}var canvas=Module["canvas"];if(canvas){canvas.requestPointerLock=canvas["requestPointerLock"]||canvas["mozRequestPointerLock"]||canvas["webkitRequestPointerLock"]||canvas["msRequestPointerLock"]||(function(){});canvas.exitPointerLock=document["exitPointerLock"]||document["mozExitPointerLock"]||document["webkitExitPointerLock"]||document["msExitPointerLock"]||(function(){});canvas.exitPointerLock=canvas.exitPointerLock.bind(document);document.addEventListener("pointerlockchange",pointerLockChange,false);document.addEventListener("mozpointerlockchange",pointerLockChange,false);document.addEventListener("webkitpointerlockchange",pointerLockChange,false);document.addEventListener("mspointerlockchange",pointerLockChange,false);if(Module["elementPointerLock"]){canvas.addEventListener("click",(function(ev){if(!Browser.pointerLock&&Module["canvas"].requestPointerLock){Module["canvas"].requestPointerLock();ev.preventDefault()}}),false)}}}),createContext:(function(canvas,useWebGL,setInModule,webGLContextAttributes){if(useWebGL&&Module.ctx&&canvas==Module.canvas)return Module.ctx;var ctx;var contextHandle;if(useWebGL){var contextAttributes={antialias:false,alpha:false};if(webGLContextAttributes){for(var attribute in webGLContextAttributes){contextAttributes[attribute]=webGLContextAttributes[attribute]}}contextHandle=GL.createContext(canvas,contextAttributes);if(contextHandle){ctx=GL.getContext(contextHandle).GLctx}}else{ctx=canvas.getContext("2d")}if(!ctx)return null;if(setInModule){if(!useWebGL)assert(typeof GLctx==="undefined","cannot set in module if GLctx is used, but we are a non-GL context that would replace it");Module.ctx=ctx;if(useWebGL)GL.makeContextCurrent(contextHandle);Module.useWebGL=useWebGL;Browser.moduleContextCreatedCallbacks.forEach((function(callback){callback()}));Browser.init()}return ctx}),destroyContext:(function(canvas,useWebGL,setInModule){}),fullscreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullscreen:(function(lockPointer,resizeCanvas,vrDevice){Browser.lockPointer=lockPointer;Browser.resizeCanvas=resizeCanvas;Browser.vrDevice=vrDevice;if(typeof Browser.lockPointer==="undefined")Browser.lockPointer=true;if(typeof Browser.resizeCanvas==="undefined")Browser.resizeCanvas=false;if(typeof Browser.vrDevice==="undefined")Browser.vrDevice=null;var canvas=Module["canvas"];function fullscreenChange(){Browser.isFullscreen=false;var canvasContainer=canvas.parentNode;if((document["fullscreenElement"]||document["mozFullScreenElement"]||document["msFullscreenElement"]||document["webkitFullscreenElement"]||document["webkitCurrentFullScreenElement"])===canvasContainer){canvas.exitFullscreen=document["exitFullscreen"]||document["cancelFullScreen"]||document["mozCancelFullScreen"]||document["msExitFullscreen"]||document["webkitCancelFullScreen"]||(function(){});canvas.exitFullscreen=canvas.exitFullscreen.bind(document);if(Browser.lockPointer)canvas.requestPointerLock();Browser.isFullscreen=true;if(Browser.resizeCanvas){Browser.setFullscreenCanvasSize()}else{Browser.updateCanvasDimensions(canvas)}}else{canvasContainer.parentNode.insertBefore(canvas,canvasContainer);canvasContainer.parentNode.removeChild(canvasContainer);if(Browser.resizeCanvas){Browser.setWindowedCanvasSize()}else{Browser.updateCanvasDimensions(canvas)}}if(Module["onFullScreen"])Module["onFullScreen"](Browser.isFullscreen);if(Module["onFullscreen"])Module["onFullscreen"](Browser.isFullscreen)}if(!Browser.fullscreenHandlersInstalled){Browser.fullscreenHandlersInstalled=true;document.addEventListener("fullscreenchange",fullscreenChange,false);document.addEventListener("mozfullscreenchange",fullscreenChange,false);document.addEventListener("webkitfullscreenchange",fullscreenChange,false);document.addEventListener("MSFullscreenChange",fullscreenChange,false)}var canvasContainer=document.createElement("div");canvas.parentNode.insertBefore(canvasContainer,canvas);canvasContainer.appendChild(canvas);canvasContainer.requestFullscreen=canvasContainer["requestFullscreen"]||canvasContainer["mozRequestFullScreen"]||canvasContainer["msRequestFullscreen"]||(canvasContainer["webkitRequestFullscreen"]?(function(){canvasContainer["webkitRequestFullscreen"](Element["ALLOW_KEYBOARD_INPUT"])}):null)||(canvasContainer["webkitRequestFullScreen"]?(function(){canvasContainer["webkitRequestFullScreen"](Element["ALLOW_KEYBOARD_INPUT"])}):null);if(vrDevice){canvasContainer.requestFullscreen({vrDisplay:vrDevice})}else{canvasContainer.requestFullscreen()}}),requestFullScreen:(function(lockPointer,resizeCanvas,vrDevice){err("Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead.");Browser.requestFullScreen=(function(lockPointer,resizeCanvas,vrDevice){return Browser.requestFullscreen(lockPointer,resizeCanvas,vrDevice)});return Browser.requestFullscreen(lockPointer,resizeCanvas,vrDevice)}),nextRAF:0,fakeRequestAnimationFrame:(function(func){var now=Date.now();if(Browser.nextRAF===0){Browser.nextRAF=now+1e3/60}else{while(now+2>=Browser.nextRAF){Browser.nextRAF+=1e3/60}}var delay=Math.max(Browser.nextRAF-now,0);setTimeout(func,delay)}),requestAnimationFrame:function requestAnimationFrame(func){if(typeof window==="undefined"){Browser.fakeRequestAnimationFrame(func)}else{if(!window.requestAnimationFrame){window.requestAnimationFrame=window["requestAnimationFrame"]||window["mozRequestAnimationFrame"]||window["webkitRequestAnimationFrame"]||window["msRequestAnimationFrame"]||window["oRequestAnimationFrame"]||Browser.fakeRequestAnimationFrame}window.requestAnimationFrame(func)}},safeCallback:(function(func){return(function(){if(!ABORT)return func.apply(null,arguments)})}),allowAsyncCallbacks:true,queuedAsyncCallbacks:[],pauseAsyncCallbacks:(function(){Browser.allowAsyncCallbacks=false}),resumeAsyncCallbacks:(function(){Browser.allowAsyncCallbacks=true;if(Browser.queuedAsyncCallbacks.length>0){var callbacks=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[];callbacks.forEach((function(func){func()}))}}),safeRequestAnimationFrame:(function(func){return Browser.requestAnimationFrame((function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}else{Browser.queuedAsyncCallbacks.push(func)}}))}),safeSetTimeout:(function(func,timeout){Module["noExitRuntime"]=true;return setTimeout((function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}else{Browser.queuedAsyncCallbacks.push(func)}}),timeout)}),safeSetInterval:(function(func,timeout){Module["noExitRuntime"]=true;return setInterval((function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}}),timeout)}),getMimetype:(function(name){return{"jpg":"image/jpeg","jpeg":"image/jpeg","png":"image/png","bmp":"image/bmp","ogg":"audio/ogg","wav":"audio/wav","mp3":"audio/mpeg"}[name.substr(name.lastIndexOf(".")+1)]}),getUserMedia:(function(func){if(!window.getUserMedia){window.getUserMedia=navigator["getUserMedia"]||navigator["mozGetUserMedia"]}window.getUserMedia(func)}),getMovementX:(function(event){return event["movementX"]||event["mozMovementX"]||event["webkitMovementX"]||0}),getMovementY:(function(event){return event["movementY"]||event["mozMovementY"]||event["webkitMovementY"]||0}),getMouseWheelDelta:(function(event){var delta=0;switch(event.type){case"DOMMouseScroll":delta=event.detail;break;case"mousewheel":delta=event.wheelDelta;break;case"wheel":delta=event["deltaY"];break;default:throw"unrecognized mouse wheel event: "+event.type}return delta}),mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:(function(event){if(Browser.pointerLock){if(event.type!="mousemove"&&"mozMovementX"in event){Browser.mouseMovementX=Browser.mouseMovementY=0}else{Browser.mouseMovementX=Browser.getMovementX(event);Browser.mouseMovementY=Browser.getMovementY(event)}if(typeof SDL!="undefined"){Browser.mouseX=SDL.mouseX+Browser.mouseMovementX;Browser.mouseY=SDL.mouseY+Browser.mouseMovementY}else{Browser.mouseX+=Browser.mouseMovementX;Browser.mouseY+=Browser.mouseMovementY}}else{var rect=Module["canvas"].getBoundingClientRect();var cw=Module["canvas"].width;var ch=Module["canvas"].height;var scrollX=typeof window.scrollX!=="undefined"?window.scrollX:window.pageXOffset;var scrollY=typeof window.scrollY!=="undefined"?window.scrollY:window.pageYOffset;if(event.type==="touchstart"||event.type==="touchend"||event.type==="touchmove"){var touch=event.touch;if(touch===undefined){return}var adjustedX=touch.pageX-(scrollX+rect.left);var adjustedY=touch.pageY-(scrollY+rect.top);adjustedX=adjustedX*(cw/rect.width);adjustedY=adjustedY*(ch/rect.height);var coords={x:adjustedX,y:adjustedY};if(event.type==="touchstart"){Browser.lastTouches[touch.identifier]=coords;Browser.touches[touch.identifier]=coords}else if(event.type==="touchend"||event.type==="touchmove"){var last=Browser.touches[touch.identifier];if(!last)last=coords;Browser.lastTouches[touch.identifier]=last;Browser.touches[touch.identifier]=coords}return}var x=event.pageX-(scrollX+rect.left);var y=event.pageY-(scrollY+rect.top);x=x*(cw/rect.width);y=y*(ch/rect.height);Browser.mouseMovementX=x-Browser.mouseX;Browser.mouseMovementY=y-Browser.mouseY;Browser.mouseX=x;Browser.mouseY=y}}),asyncLoad:(function(url,onload,onerror,noRunDep){var dep=!noRunDep?getUniqueRunDependency("al "+url):"";Module["readAsync"](url,(function(arrayBuffer){assert(arrayBuffer,'Loading data file "'+url+'" failed (no arrayBuffer).');onload(new Uint8Array(arrayBuffer));if(dep)removeRunDependency(dep)}),(function(event){if(onerror){onerror()}else{throw'Loading data file "'+url+'" failed.'}}));if(dep)addRunDependency(dep)}),resizeListeners:[],updateResizeListeners:(function(){var canvas=Module["canvas"];Browser.resizeListeners.forEach((function(listener){listener(canvas.width,canvas.height)}))}),setCanvasSize:(function(width,height,noUpdates){var canvas=Module["canvas"];Browser.updateCanvasDimensions(canvas,width,height);if(!noUpdates)Browser.updateResizeListeners()}),windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:(function(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen>>2];flags=flags|8388608;HEAP32[SDL.screen>>2]=flags}Browser.updateCanvasDimensions(Module["canvas"]);Browser.updateResizeListeners()}),setWindowedCanvasSize:(function(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen>>2];flags=flags&~8388608;HEAP32[SDL.screen>>2]=flags}Browser.updateCanvasDimensions(Module["canvas"]);Browser.updateResizeListeners()}),updateCanvasDimensions:(function(canvas,wNative,hNative){if(wNative&&hNative){canvas.widthNative=wNative;canvas.heightNative=hNative}else{wNative=canvas.widthNative;hNative=canvas.heightNative}var w=wNative;var h=hNative;if(Module["forcedAspectRatio"]&&Module["forcedAspectRatio"]>0){if(w/h>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(canvas.GLctxObject.GLctx.VIEWPORT);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=JSEvents.findCanvasEventTarget(target);if(canvas)return _emscripten_set_canvas_element_size_calling_thread(target,width,height);else return _emscripten_set_canvas_element_size_main_thread(target,width,height)}function emscripten_set_canvas_element_size_js(target,width,height){if(typeof target==="string"){var stackTop=stackSave();var targetInt=stackAlloc(target.length+1);stringToUTF8(target,targetInt,target.length+1);var ret=_emscripten_set_canvas_element_size(targetInt,width,height);stackRestore(stackTop);return ret}else{return _emscripten_set_canvas_element_size(target,width,height)}}function _emscripten_get_canvas_element_size_calling_thread(target,width,height){var canvas=JSEvents.findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){var w=HEAP32[canvas.canvasSharedPtr>>2];var h=HEAP32[canvas.canvasSharedPtr+4>>2];HEAP32[width>>2]=w;HEAP32[height>>2]=h}else if(canvas.offscreenCanvas){HEAP32[width>>2]=canvas.offscreenCanvas.width;HEAP32[height>>2]=canvas.offscreenCanvas.height}else if(!canvas.controlTransferredOffscreen){HEAP32[width>>2]=canvas.width;HEAP32[height>>2]=canvas.height}else{return-4}return 0}function _emscripten_get_canvas_element_size_main_thread(target,width,height){return _emscripten_get_canvas_element_size_calling_thread(target,width,height)}function _emscripten_get_canvas_element_size(target,width,height){var canvas=JSEvents.findCanvasEventTarget(target);if(canvas)return _emscripten_get_canvas_element_size_calling_thread(target,width,height);else return _emscripten_get_canvas_element_size_main_thread(target,width,height)}function emscripten_get_canvas_element_size_js(target){var stackTop=stackSave();var w=stackAlloc(8);var h=w+4;if(typeof target==="string"){var targetInt=stackAlloc(target.length+1);stringToUTF8(target,targetInt,target.length+1);target=targetInt}var ret=_emscripten_get_canvas_element_size(target,w,h);var size=[HEAP32[w>>2],HEAP32[h>>2]];stackRestore(stackTop);return size}var JSEvents={keyEvent:0,mouseEvent:0,wheelEvent:0,uiEvent:0,focusEvent:0,deviceOrientationEvent:0,deviceMotionEvent:0,fullscreenChangeEvent:0,pointerlockChangeEvent:0,visibilityChangeEvent:0,touchEvent:0,lastGamepadState:null,lastGamepadStateFrame:null,numGamepadsConnected:0,previousFullscreenElement:null,previousScreenX:null,previousScreenY:null,removeEventListenersRegistered:false,_onGamepadConnected:(function(){++JSEvents.numGamepadsConnected}),_onGamepadDisconnected:(function(){--JSEvents.numGamepadsConnected}),staticInit:(function(){if(typeof window!=="undefined"){window.addEventListener("gamepadconnected",JSEvents._onGamepadConnected);window.addEventListener("gamepaddisconnected",JSEvents._onGamepadDisconnected);var firstState=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():null;if(firstState){JSEvents.numGamepadsConnected=firstState.length}}}),removeAllEventListeners:(function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[];window.removeEventListener("gamepadconnected",JSEvents._onGamepadConnected);window.removeEventListener("gamepaddisconnected",JSEvents._onGamepadDisconnected)}),registerRemoveEventListeners:(function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}}),findEventTarget:(function(target){try{if(!target)return window;if(typeof target==="number")target=Pointer_stringify(target);if(target==="#window")return window;else if(target==="#document")return document;else if(target==="#screen")return window.screen;else if(target==="#canvas")return Module["canvas"];return typeof target==="string"?document.getElementById(target):target}catch(e){return null}}),findCanvasEventTarget:(function(target){if(typeof target==="number")target=Pointer_stringify(target);if(!target||target==="#canvas"){if(typeof GL!=="undefined"&&GL.offscreenCanvases["canvas"])return GL.offscreenCanvases["canvas"];return Module["canvas"]}if(typeof GL!=="undefined"&&GL.offscreenCanvases[target])return GL.offscreenCanvases[target];return JSEvents.findEventTarget(target)}),deferredCalls:[],deferCall:(function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort((function(x,y){return x.precedence0}),removeAllHandlersOnTarget:(function(target,eventTypeString){for(var i=0;i>2]=e.location;HEAP32[keyEventData+68>>2]=e.ctrlKey;HEAP32[keyEventData+72>>2]=e.shiftKey;HEAP32[keyEventData+76>>2]=e.altKey;HEAP32[keyEventData+80>>2]=e.metaKey;HEAP32[keyEventData+84>>2]=e.repeat;stringToUTF8(e.locale?e.locale:"",keyEventData+88,32);stringToUTF8(e.char?e.char:"",keyEventData+120,32);HEAP32[keyEventData+152>>2]=e.charCode;HEAP32[keyEventData+156>>2]=e.keyCode;HEAP32[keyEventData+160>>2]=e.which;if(Module["dynCall_iiii"](callbackfunc,eventTypeId,keyEventData,userData))e.preventDefault()});var eventHandler={target:JSEvents.findEventTarget(target),allowsDeferredCalls:JSEvents.isInternetExplorer()?false:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:keyEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),getBoundingClientRectOrZeros:(function(target){return target.getBoundingClientRect?target.getBoundingClientRect():{left:0,top:0}}),fillMouseEventData:(function(eventStruct,e,target){HEAPF64[eventStruct>>3]=JSEvents.tick();HEAP32[eventStruct+8>>2]=e.screenX;HEAP32[eventStruct+12>>2]=e.screenY;HEAP32[eventStruct+16>>2]=e.clientX;HEAP32[eventStruct+20>>2]=e.clientY;HEAP32[eventStruct+24>>2]=e.ctrlKey;HEAP32[eventStruct+28>>2]=e.shiftKey;HEAP32[eventStruct+32>>2]=e.altKey;HEAP32[eventStruct+36>>2]=e.metaKey;HEAP16[eventStruct+40>>1]=e.button;HEAP16[eventStruct+42>>1]=e.buttons;HEAP32[eventStruct+44>>2]=e["movementX"]||e["mozMovementX"]||e["webkitMovementX"]||e.screenX-JSEvents.previousScreenX;HEAP32[eventStruct+48>>2]=e["movementY"]||e["mozMovementY"]||e["webkitMovementY"]||e.screenY-JSEvents.previousScreenY;if(Module["canvas"]){var rect=Module["canvas"].getBoundingClientRect();HEAP32[eventStruct+60>>2]=e.clientX-rect.left;HEAP32[eventStruct+64>>2]=e.clientY-rect.top}else{HEAP32[eventStruct+60>>2]=0;HEAP32[eventStruct+64>>2]=0}if(target){var rect=JSEvents.getBoundingClientRectOrZeros(target);HEAP32[eventStruct+52>>2]=e.clientX-rect.left;HEAP32[eventStruct+56>>2]=e.clientY-rect.top}else{HEAP32[eventStruct+52>>2]=0;HEAP32[eventStruct+56>>2]=0}if(e.type!=="wheel"&&e.type!=="mousewheel"){JSEvents.previousScreenX=e.screenX;JSEvents.previousScreenY=e.screenY}}),registerMouseEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.mouseEvent)JSEvents.mouseEvent=_malloc(72);target=JSEvents.findEventTarget(target);var mouseEventHandlerFunc=(function(event){var e=event||window.event;JSEvents.fillMouseEventData(JSEvents.mouseEvent,e,target);if(Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.mouseEvent,userData))e.preventDefault()});var eventHandler={target:target,allowsDeferredCalls:eventTypeString!="mousemove"&&eventTypeString!="mouseenter"&&eventTypeString!="mouseleave",eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:mouseEventHandlerFunc,useCapture:useCapture};if(JSEvents.isInternetExplorer()&&eventTypeString=="mousedown")eventHandler.allowsDeferredCalls=false;JSEvents.registerOrRemoveHandler(eventHandler)}),registerWheelEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.wheelEvent)JSEvents.wheelEvent=_malloc(104);target=JSEvents.findEventTarget(target);var wheelHandlerFunc=(function(event){var e=event||window.event;var wheelEvent=JSEvents.wheelEvent;JSEvents.fillMouseEventData(wheelEvent,e,target);HEAPF64[wheelEvent+72>>3]=e["deltaX"];HEAPF64[wheelEvent+80>>3]=e["deltaY"];HEAPF64[wheelEvent+88>>3]=e["deltaZ"];HEAP32[wheelEvent+96>>2]=e["deltaMode"];if(Module["dynCall_iiii"](callbackfunc,eventTypeId,wheelEvent,userData))e.preventDefault()});var mouseWheelHandlerFunc=(function(event){var e=event||window.event;JSEvents.fillMouseEventData(JSEvents.wheelEvent,e,target);HEAPF64[JSEvents.wheelEvent+72>>3]=e["wheelDeltaX"]||0;HEAPF64[JSEvents.wheelEvent+80>>3]=-(e["wheelDeltaY"]?e["wheelDeltaY"]:e["wheelDelta"]);HEAPF64[JSEvents.wheelEvent+88>>3]=0;HEAP32[JSEvents.wheelEvent+96>>2]=0;var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.wheelEvent,userData);if(shouldCancel){e.preventDefault()}});var eventHandler={target:target,allowsDeferredCalls:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:eventTypeString=="wheel"?wheelHandlerFunc:mouseWheelHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),pageScrollPos:(function(){if(window.pageXOffset>0||window.pageYOffset>0){return[window.pageXOffset,window.pageYOffset]}if(typeof document.documentElement.scrollLeft!=="undefined"||typeof document.documentElement.scrollTop!=="undefined"){return[document.documentElement.scrollLeft,document.documentElement.scrollTop]}return[document.body.scrollLeft|0,document.body.scrollTop|0]}),registerUiEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.uiEvent)JSEvents.uiEvent=_malloc(36);if(eventTypeString=="scroll"&&!target){target=document}else{target=JSEvents.findEventTarget(target)}var uiEventHandlerFunc=(function(event){var e=event||window.event;if(e.target!=target){return}var scrollPos=JSEvents.pageScrollPos();var uiEvent=JSEvents.uiEvent;HEAP32[uiEvent>>2]=e.detail;HEAP32[uiEvent+4>>2]=document.body.clientWidth;HEAP32[uiEvent+8>>2]=document.body.clientHeight;HEAP32[uiEvent+12>>2]=window.innerWidth;HEAP32[uiEvent+16>>2]=window.innerHeight;HEAP32[uiEvent+20>>2]=window.outerWidth;HEAP32[uiEvent+24>>2]=window.outerHeight;HEAP32[uiEvent+28>>2]=scrollPos[0];HEAP32[uiEvent+32>>2]=scrollPos[1];if(Module["dynCall_iiii"](callbackfunc,eventTypeId,uiEvent,userData))e.preventDefault()});var eventHandler={target:target,allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:uiEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),getNodeNameForTarget:(function(target){if(!target)return"";if(target==window)return"#window";if(target==window.screen)return"#screen";return target&&target.nodeName?target.nodeName:""}),registerFocusEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.focusEvent)JSEvents.focusEvent=_malloc(256);var focusEventHandlerFunc=(function(event){var e=event||window.event;var nodeName=JSEvents.getNodeNameForTarget(e.target);var id=e.target.id?e.target.id:"";var focusEvent=JSEvents.focusEvent;stringToUTF8(nodeName,focusEvent+0,128);stringToUTF8(id,focusEvent+128,128);if(Module["dynCall_iiii"](callbackfunc,eventTypeId,focusEvent,userData))e.preventDefault()});var eventHandler={target:JSEvents.findEventTarget(target),allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:focusEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),tick:(function(){if(window["performance"]&&window["performance"]["now"])return window["performance"]["now"]();else return Date.now()}),fillDeviceOrientationEventData:(function(eventStruct,e,target){HEAPF64[eventStruct>>3]=JSEvents.tick();HEAPF64[eventStruct+8>>3]=e.alpha;HEAPF64[eventStruct+16>>3]=e.beta;HEAPF64[eventStruct+24>>3]=e.gamma;HEAP32[eventStruct+32>>2]=e.absolute}),registerDeviceOrientationEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.deviceOrientationEvent)JSEvents.deviceOrientationEvent=_malloc(40);var deviceOrientationEventHandlerFunc=(function(event){var e=event||window.event;JSEvents.fillDeviceOrientationEventData(JSEvents.deviceOrientationEvent,e,target);if(Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.deviceOrientationEvent,userData))e.preventDefault()});var eventHandler={target:JSEvents.findEventTarget(target),allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:deviceOrientationEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),fillDeviceMotionEventData:(function(eventStruct,e,target){HEAPF64[eventStruct>>3]=JSEvents.tick();HEAPF64[eventStruct+8>>3]=e.acceleration.x;HEAPF64[eventStruct+16>>3]=e.acceleration.y;HEAPF64[eventStruct+24>>3]=e.acceleration.z;HEAPF64[eventStruct+32>>3]=e.accelerationIncludingGravity.x;HEAPF64[eventStruct+40>>3]=e.accelerationIncludingGravity.y;HEAPF64[eventStruct+48>>3]=e.accelerationIncludingGravity.z;HEAPF64[eventStruct+56>>3]=e.rotationRate.alpha;HEAPF64[eventStruct+64>>3]=e.rotationRate.beta;HEAPF64[eventStruct+72>>3]=e.rotationRate.gamma}),registerDeviceMotionEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.deviceMotionEvent)JSEvents.deviceMotionEvent=_malloc(80);var deviceMotionEventHandlerFunc=(function(event){var e=event||window.event;JSEvents.fillDeviceMotionEventData(JSEvents.deviceMotionEvent,e,target);if(Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.deviceMotionEvent,userData))e.preventDefault()});var eventHandler={target:JSEvents.findEventTarget(target),allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:deviceMotionEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),screenOrientation:(function(){if(!window.screen)return undefined;return window.screen.orientation||window.screen.mozOrientation||window.screen.webkitOrientation||window.screen.msOrientation}),fillOrientationChangeEventData:(function(eventStruct,e){var orientations=["portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];var orientations2=["portrait","portrait","landscape","landscape"];var orientationString=JSEvents.screenOrientation();var orientation=orientations.indexOf(orientationString);if(orientation==-1){orientation=orientations2.indexOf(orientationString)}HEAP32[eventStruct>>2]=1<>2]=window.orientation}),registerOrientationChangeEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.orientationChangeEvent)JSEvents.orientationChangeEvent=_malloc(8);if(!target){target=window.screen}else{target=JSEvents.findEventTarget(target)}var orientationChangeEventHandlerFunc=(function(event){var e=event||window.event;var orientationChangeEvent=JSEvents.orientationChangeEvent;JSEvents.fillOrientationChangeEventData(orientationChangeEvent,e);if(Module["dynCall_iiii"](callbackfunc,eventTypeId,orientationChangeEvent,userData))e.preventDefault()});if(eventTypeString=="orientationchange"&&window.screen.mozOrientation!==undefined){eventTypeString="mozorientationchange"}var eventHandler={target:target,allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:orientationChangeEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),fullscreenEnabled:(function(){return document.fullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled||document.msFullscreenEnabled}),fillFullscreenChangeEventData:(function(eventStruct,e){var fullscreenElement=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement;var isFullscreen=!!fullscreenElement;HEAP32[eventStruct>>2]=isFullscreen;HEAP32[eventStruct+4>>2]=JSEvents.fullscreenEnabled();var reportedElement=isFullscreen?fullscreenElement:JSEvents.previousFullscreenElement;var nodeName=JSEvents.getNodeNameForTarget(reportedElement);var id=reportedElement&&reportedElement.id?reportedElement.id:"";stringToUTF8(nodeName,eventStruct+8,128);stringToUTF8(id,eventStruct+136,128);HEAP32[eventStruct+264>>2]=reportedElement?reportedElement.clientWidth:0;HEAP32[eventStruct+268>>2]=reportedElement?reportedElement.clientHeight:0;HEAP32[eventStruct+272>>2]=screen.width;HEAP32[eventStruct+276>>2]=screen.height;if(isFullscreen){JSEvents.previousFullscreenElement=fullscreenElement}}),registerFullscreenChangeEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.fullscreenChangeEvent)JSEvents.fullscreenChangeEvent=_malloc(280);if(!target)target=document;else target=JSEvents.findEventTarget(target);var fullscreenChangeEventhandlerFunc=(function(event){var e=event||window.event;var fullscreenChangeEvent=JSEvents.fullscreenChangeEvent;JSEvents.fillFullscreenChangeEventData(fullscreenChangeEvent,e);if(Module["dynCall_iiii"](callbackfunc,eventTypeId,fullscreenChangeEvent,userData))e.preventDefault()});var eventHandler={target:target,allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:fullscreenChangeEventhandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),resizeCanvasForFullscreen:(function(target,strategy){var restoreOldStyle=__registerRestoreOldStyle(target);var cssWidth=strategy.softFullscreen?window.innerWidth:screen.width;var cssHeight=strategy.softFullscreen?window.innerHeight:screen.height;var rect=target.getBoundingClientRect();var windowedCssWidth=rect.right-rect.left;var windowedCssHeight=rect.bottom-rect.top;var canvasSize=emscripten_get_canvas_element_size_js(target.id);var windowedRttWidth=canvasSize[0];var windowedRttHeight=canvasSize[1];if(strategy.scaleMode==3){__setLetterbox(target,(cssHeight-windowedCssHeight)/2,(cssWidth-windowedCssWidth)/2);cssWidth=windowedCssWidth;cssHeight=windowedCssHeight}else if(strategy.scaleMode==2){if(cssWidth*windowedRttHeight>2]=isPointerlocked;var nodeName=JSEvents.getNodeNameForTarget(pointerLockElement);var id=pointerLockElement&&pointerLockElement.id?pointerLockElement.id:"";stringToUTF8(nodeName,eventStruct+4,128);stringToUTF8(id,eventStruct+132,128)}),registerPointerlockChangeEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.pointerlockChangeEvent)JSEvents.pointerlockChangeEvent=_malloc(260);if(!target)target=document;else target=JSEvents.findEventTarget(target);var pointerlockChangeEventHandlerFunc=(function(event){var e=event||window.event;var pointerlockChangeEvent=JSEvents.pointerlockChangeEvent;JSEvents.fillPointerlockChangeEventData(pointerlockChangeEvent,e);if(Module["dynCall_iiii"](callbackfunc,eventTypeId,pointerlockChangeEvent,userData))e.preventDefault()});var eventHandler={target:target,allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:pointerlockChangeEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),registerPointerlockErrorEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){if(!target)target=document;else target=JSEvents.findEventTarget(target);var pointerlockErrorEventHandlerFunc=(function(event){var e=event||window.event;if(Module["dynCall_iiii"](callbackfunc,eventTypeId,0,userData))e.preventDefault()});var eventHandler={target:target,allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:pointerlockErrorEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),requestPointerLock:(function(target){if(target.requestPointerLock){target.requestPointerLock()}else if(target.mozRequestPointerLock){target.mozRequestPointerLock()}else if(target.webkitRequestPointerLock){target.webkitRequestPointerLock()}else if(target.msRequestPointerLock){target.msRequestPointerLock()}else{if(document.body.requestPointerLock||document.body.mozRequestPointerLock||document.body.webkitRequestPointerLock||document.body.msRequestPointerLock){return-3}else{return-1}}return 0}),fillVisibilityChangeEventData:(function(eventStruct,e){var visibilityStates=["hidden","visible","prerender","unloaded"];var visibilityState=visibilityStates.indexOf(document.visibilityState);HEAP32[eventStruct>>2]=document.hidden;HEAP32[eventStruct+4>>2]=visibilityState}),registerVisibilityChangeEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.visibilityChangeEvent)JSEvents.visibilityChangeEvent=_malloc(8);if(!target)target=document;else target=JSEvents.findEventTarget(target);var visibilityChangeEventHandlerFunc=(function(event){var e=event||window.event;var visibilityChangeEvent=JSEvents.visibilityChangeEvent;JSEvents.fillVisibilityChangeEventData(visibilityChangeEvent,e);if(Module["dynCall_iiii"](callbackfunc,eventTypeId,visibilityChangeEvent,userData))e.preventDefault()});var eventHandler={target:target,allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:visibilityChangeEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),registerTouchEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.touchEvent)JSEvents.touchEvent=_malloc(1684);target=JSEvents.findEventTarget(target);var touchEventHandlerFunc=(function(event){var e=event||window.event;var touches={};for(var i=0;i>2]=e.ctrlKey;HEAP32[ptr+8>>2]=e.shiftKey;HEAP32[ptr+12>>2]=e.altKey;HEAP32[ptr+16>>2]=e.metaKey;ptr+=20;var canvasRect=Module["canvas"]?Module["canvas"].getBoundingClientRect():undefined;var targetRect=JSEvents.getBoundingClientRectOrZeros(target);var numTouches=0;for(var i in touches){var t=touches[i];HEAP32[ptr>>2]=t.identifier;HEAP32[ptr+4>>2]=t.screenX;HEAP32[ptr+8>>2]=t.screenY;HEAP32[ptr+12>>2]=t.clientX;HEAP32[ptr+16>>2]=t.clientY;HEAP32[ptr+20>>2]=t.pageX;HEAP32[ptr+24>>2]=t.pageY;HEAP32[ptr+28>>2]=t.changed;HEAP32[ptr+32>>2]=t.onTarget;if(canvasRect){HEAP32[ptr+44>>2]=t.clientX-canvasRect.left;HEAP32[ptr+48>>2]=t.clientY-canvasRect.top}else{HEAP32[ptr+44>>2]=0;HEAP32[ptr+48>>2]=0}HEAP32[ptr+36>>2]=t.clientX-targetRect.left;HEAP32[ptr+40>>2]=t.clientY-targetRect.top;ptr+=52;if(++numTouches>=32){break}}HEAP32[touchEvent>>2]=numTouches;if(Module["dynCall_iiii"](callbackfunc,eventTypeId,touchEvent,userData))e.preventDefault()});var eventHandler={target:target,allowsDeferredCalls:eventTypeString=="touchstart"||eventTypeString=="touchend",eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:touchEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),fillGamepadEventData:(function(eventStruct,e){HEAPF64[eventStruct>>3]=e.timestamp;for(var i=0;i>3]=e.axes[i]}for(var i=0;i>3]=e.buttons[i].value}else{HEAPF64[eventStruct+i*8+528>>3]=e.buttons[i]}}for(var i=0;i>2]=e.buttons[i].pressed}else{HEAP32[eventStruct+i*4+1040>>2]=e.buttons[i]==1}}HEAP32[eventStruct+1296>>2]=e.connected;HEAP32[eventStruct+1300>>2]=e.index;HEAP32[eventStruct+8>>2]=e.axes.length;HEAP32[eventStruct+12>>2]=e.buttons.length;stringToUTF8(e.id,eventStruct+1304,64);stringToUTF8(e.mapping,eventStruct+1368,64)}),registerGamepadEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.gamepadEvent)JSEvents.gamepadEvent=_malloc(1432);var gamepadEventHandlerFunc=(function(event){var e=event||window.event;var gamepadEvent=JSEvents.gamepadEvent;JSEvents.fillGamepadEventData(gamepadEvent,e.gamepad);if(Module["dynCall_iiii"](callbackfunc,eventTypeId,gamepadEvent,userData))e.preventDefault()});var eventHandler={target:JSEvents.findEventTarget(target),allowsDeferredCalls:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:gamepadEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),registerBeforeUnloadEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){var beforeUnloadEventHandlerFunc=(function(event){var e=event||window.event;var confirmationMessage=Module["dynCall_iiii"](callbackfunc,eventTypeId,0,userData);if(confirmationMessage){confirmationMessage=Pointer_stringify(confirmationMessage)}if(confirmationMessage){e.preventDefault();e.returnValue=confirmationMessage;return confirmationMessage}});var eventHandler={target:JSEvents.findEventTarget(target),allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:beforeUnloadEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),battery:(function(){return navigator.battery||navigator.mozBattery||navigator.webkitBattery}),fillBatteryEventData:(function(eventStruct,e){HEAPF64[eventStruct>>3]=e.chargingTime;HEAPF64[eventStruct+8>>3]=e.dischargingTime;HEAPF64[eventStruct+16>>3]=e.level;HEAP32[eventStruct+24>>2]=e.charging}),registerBatteryEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.batteryEvent)JSEvents.batteryEvent=_malloc(32);var batteryEventHandlerFunc=(function(event){var e=event||window.event;var batteryEvent=JSEvents.batteryEvent;JSEvents.fillBatteryEventData(batteryEvent,JSEvents.battery());if(Module["dynCall_iiii"](callbackfunc,eventTypeId,batteryEvent,userData))e.preventDefault()});var eventHandler={target:JSEvents.findEventTarget(target),allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:batteryEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),registerWebGlEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!target)target=Module["canvas"];var webGlEventHandlerFunc=(function(event){var e=event||window.event;if(Module["dynCall_iiii"](callbackfunc,eventTypeId,0,userData))e.preventDefault()});var eventHandler={target:JSEvents.findEventTarget(target),allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:webGlEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)})};var __currentFullscreenStrategy={};function _emscripten_exit_fullscreen(){if(typeof JSEvents.fullscreenEnabled()==="undefined")return-1;JSEvents.removeDeferredCalls(JSEvents.requestFullscreen);if(document.exitFullscreen){document.exitFullscreen()}else if(document.msExitFullscreen){document.msExitFullscreen()}else if(document.mozCancelFullScreen){document.mozCancelFullScreen()}else if(document.webkitExitFullscreen){document.webkitExitFullscreen()}else{return-1}if(__currentFullscreenStrategy.canvasResizedCallback){Module["dynCall_iiii"](__currentFullscreenStrategy.canvasResizedCallback,37,0,__currentFullscreenStrategy.canvasResizedCallbackUserData)}return 0}function _emscripten_exit_pointerlock(){JSEvents.removeDeferredCalls(JSEvents.requestPointerLock);if(document.exitPointerLock){document.exitPointerLock()}else if(document.msExitPointerLock){document.msExitPointerLock()}else if(document.mozExitPointerLock){document.mozExitPointerLock()}else if(document.webkitExitPointerLock){document.webkitExitPointerLock()}else{return-1}return 0}function _emscripten_get_fullscreen_status(fullscreenStatus){if(typeof JSEvents.fullscreenEnabled()==="undefined")return-1;JSEvents.fillFullscreenChangeEventData(fullscreenStatus);return 0}function __emscripten_sample_gamepad_data(){if(!JSEvents.numGamepadsConnected)return;if(Browser.mainLoop.currentFrameNumber!==JSEvents.lastGamepadStateFrame||!Browser.mainLoop.currentFrameNumber){JSEvents.lastGamepadState=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads:null;JSEvents.lastGamepadStateFrame=Browser.mainLoop.currentFrameNumber}}function _emscripten_get_gamepad_status(index,gamepadState){__emscripten_sample_gamepad_data();if(!JSEvents.lastGamepadState)return-1;if(index<0||index>=JSEvents.lastGamepadState.length)return-5;if(!JSEvents.lastGamepadState[index])return-7;JSEvents.fillGamepadEventData(gamepadState,JSEvents.lastGamepadState[index]);return 0}function _emscripten_get_main_loop_timing(mode,value){if(mode)HEAP32[mode>>2]=Browser.mainLoop.timingMode;if(value)HEAP32[value>>2]=Browser.mainLoop.timingValue}function _emscripten_get_num_gamepads(){if(!JSEvents.numGamepadsConnected)return 0;__emscripten_sample_gamepad_data();if(!JSEvents.lastGamepadState)return-1;return JSEvents.lastGamepadState.length}function _emscripten_has_threading_support(){return 0}function _emscripten_html5_remove_all_event_listeners(){JSEvents.removeAllEventListeners()}function _emscripten_is_webgl_context_lost(target){if(!Module.ctx)return true;return Module.ctx.isContextLost()}function __reallyNegative(x){return x<0||x===0&&1/x===-Infinity}function __formatString(format,varargs){assert((varargs&3)===0);var textIndex=format;var argIndex=varargs;function prepVararg(ptr,type){if(type==="double"||type==="i64"){if(ptr&7){assert((ptr&7)===4);ptr+=4}}else{assert((ptr&3)===0)}return ptr}function getNextArg(type){var ret;argIndex=prepVararg(argIndex,type);if(type==="double"){ret=HEAPF64[argIndex>>3];argIndex+=8}else if(type=="i64"){ret=[HEAP32[argIndex>>2],HEAP32[argIndex+4>>2]];argIndex+=8}else{assert((argIndex&3)===0);type="i32";ret=HEAP32[argIndex>>2];argIndex+=4}return ret}var ret=[];var curr,next,currArg;while(1){var startTextIndex=textIndex;curr=HEAP8[textIndex>>0];if(curr===0)break;next=HEAP8[textIndex+1>>0];if(curr==37){var flagAlwaysSigned=false;var flagLeftAlign=false;var flagAlternative=false;var flagZeroPad=false;var flagPadSign=false;flagsLoop:while(1){switch(next){case 43:flagAlwaysSigned=true;break;case 45:flagLeftAlign=true;break;case 35:flagAlternative=true;break;case 48:if(flagZeroPad){break flagsLoop}else{flagZeroPad=true;break};case 32:flagPadSign=true;break;default:break flagsLoop}textIndex++;next=HEAP8[textIndex+1>>0]}var width=0;if(next==42){width=getNextArg("i32");textIndex++;next=HEAP8[textIndex+1>>0]}else{while(next>=48&&next<=57){width=width*10+(next-48);textIndex++;next=HEAP8[textIndex+1>>0]}}var precisionSet=false,precision=-1;if(next==46){precision=0;precisionSet=true;textIndex++;next=HEAP8[textIndex+1>>0];if(next==42){precision=getNextArg("i32");textIndex++}else{while(1){var precisionChr=HEAP8[textIndex+1>>0];if(precisionChr<48||precisionChr>57)break;precision=precision*10+(precisionChr-48);textIndex++}}next=HEAP8[textIndex+1>>0]}if(precision<0){precision=6;precisionSet=false}var argSize;switch(String.fromCharCode(next)){case"h":var nextNext=HEAP8[textIndex+2>>0];if(nextNext==104){textIndex++;argSize=1}else{argSize=2}break;case"l":var nextNext=HEAP8[textIndex+2>>0];if(nextNext==108){textIndex++;argSize=8}else{argSize=4}break;case"L":case"q":case"j":argSize=8;break;case"z":case"t":case"I":argSize=4;break;default:argSize=null}if(argSize)textIndex++;next=HEAP8[textIndex+1>>0];switch(String.fromCharCode(next)){case"d":case"i":case"u":case"o":case"x":case"X":case"p":{var signed=next==100||next==105;argSize=argSize||4;currArg=getNextArg("i"+argSize*8);var origArg=currArg;var argText;if(argSize==8){currArg=makeBigInt(currArg[0],currArg[1],next==117)}if(argSize<=4){var limit=Math.pow(256,argSize)-1;currArg=(signed?reSign:unSign)(currArg&limit,argSize*8)}var currAbsArg=Math.abs(currArg);var prefix="";if(next==100||next==105){if(argSize==8&&typeof i64Math==="object")argText=i64Math.stringify(origArg[0],origArg[1],null);else argText=reSign(currArg,8*argSize,1).toString(10)}else if(next==117){if(argSize==8&&typeof i64Math==="object")argText=i64Math.stringify(origArg[0],origArg[1],true);else argText=unSign(currArg,8*argSize,1).toString(10);currArg=Math.abs(currArg)}else if(next==111){argText=(flagAlternative?"0":"")+currAbsArg.toString(8)}else if(next==120||next==88){prefix=flagAlternative&&currArg!=0?"0x":"";if(argSize==8&&typeof i64Math==="object"){if(origArg[1]){argText=(origArg[1]>>>0).toString(16);var lower=(origArg[0]>>>0).toString(16);while(lower.length<8)lower="0"+lower;argText+=lower}else{argText=(origArg[0]>>>0).toString(16)}}else if(currArg<0){currArg=-currArg;argText=(currAbsArg-1).toString(16);var buffer=[];for(var i=0;i=0){if(flagAlwaysSigned){prefix="+"+prefix}else if(flagPadSign){prefix=" "+prefix}}if(argText.charAt(0)=="-"){prefix="-"+prefix;argText=argText.substr(1)}while(prefix.length+argText.lengthexponent&&exponent>=-4){next=(next==103?"f":"F").charCodeAt(0);precision-=exponent+1}else{next=(next==103?"e":"E").charCodeAt(0);precision--}effectivePrecision=Math.min(precision,20)}if(next==101||next==69){argText=currArg.toExponential(effectivePrecision);if(/[eE][-+]\d$/.test(argText)){argText=argText.slice(0,-1)+"0"+argText.slice(-1)}}else if(next==102||next==70){argText=currArg.toFixed(effectivePrecision);if(currArg===0&&__reallyNegative(currArg)){argText="-"+argText}}var parts=argText.split("e");if(isGeneral&&!flagAlternative){while(parts[0].length>1&&parts[0].indexOf(".")!=-1&&(parts[0].slice(-1)=="0"||parts[0].slice(-1)==".")){parts[0]=parts[0].slice(0,-1)}}else{if(flagAlternative&&argText.indexOf(".")==-1)parts[0]+=".";while(precision>effectivePrecision++)parts[0]+="0"}argText=parts[0]+(parts.length>1?"e"+parts[1]:"");if(next==69)argText=argText.toUpperCase();if(currArg>=0){if(flagAlwaysSigned){argText="+"+argText}else if(flagPadSign){argText=" "+argText}}}while(argText.length>0])}}else{ret=ret.concat(intArrayFromString("(null)".substr(0,argLength),true))}if(flagLeftAlign){while(argLength0){ret.push(32)}if(!flagLeftAlign)ret.push(getNextArg("i8"));break};case"n":{var ptr=getNextArg("i32*");HEAP32[ptr>>2]=ret.length;break};case"%":{ret.push(curr);break};default:{for(var i=startTextIndex;i>0])}}}textIndex+=2}else{ret.push(curr);textIndex+=1}}return ret}function __emscripten_traverse_stack(args){if(!args||!args.callee||!args.callee.name){return[null,"",""]}var funstr=args.callee.toString();var funcname=args.callee.name;var str="(";var first=true;for(var i in args){var a=args[i];if(!first){str+=", "}first=false;if(typeof a==="number"||typeof a==="string"){str+=a}else{str+="("+typeof a+")"}}str+=")";var caller=args.callee.caller;args=caller?caller.arguments:[];if(first)str="";return[args,funcname,str]}function _emscripten_get_callstack_js(flags){var callstack=jsStackTrace();var iThisFunc=callstack.lastIndexOf("_emscripten_log");var iThisFunc2=callstack.lastIndexOf("_emscripten_get_callstack");var iNextLine=callstack.indexOf("\n",Math.max(iThisFunc,iThisFunc2))+1;callstack=callstack.slice(iNextLine);if(flags&8&&typeof emscripten_source_map==="undefined"){warnOnce('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.');flags^=8;flags|=16}var stack_args=null;if(flags&128){stack_args=__emscripten_traverse_stack(arguments);while(stack_args[1].indexOf("_emscripten_")>=0)stack_args=__emscripten_traverse_stack(stack_args[0])}var lines=callstack.split("\n");callstack="";var newFirefoxRe=new RegExp("\\s*(.*?)@(.*?):([0-9]+):([0-9]+)");var firefoxRe=new RegExp("\\s*(.*?)@(.*):(.*)(:(.*))?");var chromeRe=new RegExp("\\s*at (.*?) \\((.*):(.*):(.*)\\)");for(var l in lines){var line=lines[l];var jsSymbolName="";var file="";var lineno=0;var column=0;var parts=chromeRe.exec(line);if(parts&&parts.length==5){jsSymbolName=parts[1];file=parts[2];lineno=parts[3];column=parts[4]}else{parts=newFirefoxRe.exec(line);if(!parts)parts=firefoxRe.exec(line);if(parts&&parts.length>=4){jsSymbolName=parts[1];file=parts[2];lineno=parts[3];column=parts[4]|0}else{callstack+=line+"\n";continue}}var cSymbolName=flags&32?demangle(jsSymbolName):jsSymbolName;if(!cSymbolName){cSymbolName=jsSymbolName}var haveSourceMap=false;if(flags&8){var orig=emscripten_source_map.originalPositionFor({line:lineno,column:column});haveSourceMap=orig&&orig.source;if(haveSourceMap){if(flags&64){orig.source=orig.source.substring(orig.source.replace(/\\/g,"/").lastIndexOf("/")+1)}callstack+=" at "+cSymbolName+" ("+orig.source+":"+orig.line+":"+orig.column+")\n"}}if(flags&16||!haveSourceMap){if(flags&64){file=file.substring(file.replace(/\\/g,"/").lastIndexOf("/")+1)}callstack+=(haveSourceMap?" = "+jsSymbolName:" at "+cSymbolName)+" ("+file+":"+lineno+":"+column+")\n"}if(flags&128&&stack_args[0]){if(stack_args[1]==jsSymbolName&&stack_args[2].length>0){callstack=callstack.replace(/\s+$/,"");callstack+=" with values: "+stack_args[1]+stack_args[2]+"\n"}stack_args=__emscripten_traverse_stack(stack_args[0])}}callstack=callstack.replace(/\s+$/,"");return callstack}function _emscripten_log_js(flags,str){if(flags&24){str=str.replace(/\s+$/,"");str+=(str.length>0?"\n":"")+_emscripten_get_callstack_js(flags)}if(flags&1){if(flags&4){console.error(str)}else if(flags&2){console.warn(str)}else{console.log(str)}}else if(flags&6){err(str)}else{out(str)}}function _emscripten_log(flags,varargs){var format=HEAP32[varargs>>2];varargs+=4;var str="";if(format){var result=__formatString(format,varargs);for(var i=0;i>2];if(len<0){frag=Pointer_stringify(HEAP32[string+i*4>>2])}else{frag=Pointer_stringify(HEAP32[string+i*4>>2],len)}}else{frag=Pointer_stringify(HEAP32[string+i*4>>2])}source+=frag}return source}),createContext:(function(canvas,webGLContextAttributes){if(typeof webGLContextAttributes["majorVersion"]==="undefined"&&typeof webGLContextAttributes["minorVersion"]==="undefined"){if(typeof WebGL2RenderingContext!=="undefined")webGLContextAttributes["majorVersion"]=2;else webGLContextAttributes["majorVersion"]=1;webGLContextAttributes["minorVersion"]=0}var ctx;var errorInfo="?";function onContextCreationError(event){errorInfo=event.statusMessage||errorInfo}webGLContextAttributes["powerPreference"]="high-performance";try{canvas.addEventListener("webglcontextcreationerror",onContextCreationError,false);try{if(webGLContextAttributes["majorVersion"]==1&&webGLContextAttributes["minorVersion"]==0){ctx=canvas.getContext("webgl",webGLContextAttributes)||canvas.getContext("experimental-webgl",webGLContextAttributes)}else if(webGLContextAttributes["majorVersion"]==2&&webGLContextAttributes["minorVersion"]==0){ctx=canvas.getContext("webgl2",webGLContextAttributes)}else{throw"Unsupported WebGL context version "+majorVersion+"."+minorVersion+"!"}}finally{canvas.removeEventListener("webglcontextcreationerror",onContextCreationError,false)}if(!ctx)throw":("}catch(e){out("Could not create canvas: "+[errorInfo,e,JSON.stringify(webGLContextAttributes)]);return 0}if(!ctx)return 0;var context=GL.registerContext(ctx,webGLContextAttributes);return context}),registerContext:(function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle>>2]=webGLContextAttributes["explicitSwapControl"];var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes["majorVersion"],GLctx:ctx};function getChromeVersion(){var raw=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);return raw?parseInt(raw[2],10):false}context.supportsWebGL2EntryPoints=context.version>=2&&(getChromeVersion()===false||getChromeVersion()>=58);if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes["enableExtensionsByDefault"]==="undefined"||webGLContextAttributes["enableExtensionsByDefault"]){GL.initExtensions(context)}if(webGLContextAttributes["renderViaOffscreenBackBuffer"]){return 0}return handle}),makeContextCurrent:(function(contextHandle){if(!contextHandle){GLctx=Module.ctx=GL.currentContext=null;return true}var context=GL.contexts[contextHandle];if(!context){return false}GLctx=Module.ctx=context.GLctx;GL.currentContext=context;return true}),getContext:(function(contextHandle){return GL.contexts[contextHandle]}),deleteContext:(function(contextHandle){if(!contextHandle)return;if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle]);GL.contexts[contextHandle]=null}),initExtensions:(function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;context.maxVertexAttribs=GLctx.getParameter(GLctx.MAX_VERTEX_ATTRIBS);if(context.version<2){var instancedArraysExt=GLctx.getExtension("ANGLE_instanced_arrays");if(instancedArraysExt){GLctx["vertexAttribDivisor"]=(function(index,divisor){instancedArraysExt["vertexAttribDivisorANGLE"](index,divisor)});GLctx["drawArraysInstanced"]=(function(mode,first,count,primcount){instancedArraysExt["drawArraysInstancedANGLE"](mode,first,count,primcount)});GLctx["drawElementsInstanced"]=(function(mode,count,type,indices,primcount){instancedArraysExt["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)})}var vaoExt=GLctx.getExtension("OES_vertex_array_object");if(vaoExt){GLctx["createVertexArray"]=(function(){return vaoExt["createVertexArrayOES"]()});GLctx["deleteVertexArray"]=(function(vao){vaoExt["deleteVertexArrayOES"](vao)});GLctx["bindVertexArray"]=(function(vao){vaoExt["bindVertexArrayOES"](vao)});GLctx["isVertexArray"]=(function(vao){return vaoExt["isVertexArrayOES"](vao)})}var drawBuffersExt=GLctx.getExtension("WEBGL_draw_buffers");if(drawBuffersExt){GLctx["drawBuffers"]=(function(n,bufs){drawBuffersExt["drawBuffersWEBGL"](n,bufs)})}}GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query");var automaticallyEnabledExtensions=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","EXT_frag_depth","WEBGL_draw_buffers","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","EXT_blend_minmax","EXT_shader_texture_lod","EXT_texture_norm16","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_sRGB","WEBGL_compressed_texture_etc1","EXT_disjoint_timer_query","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_astc","EXT_color_buffer_float","WEBGL_compressed_texture_s3tc_srgb","EXT_disjoint_timer_query_webgl2","WEBKIT_WEBGL_compressed_texture_pvrtc"];var exts=GLctx.getSupportedExtensions();if(exts&&exts.length>0){GLctx.getSupportedExtensions().forEach((function(ext){if(automaticallyEnabledExtensions.indexOf(ext)!=-1){GLctx.getExtension(ext)}}))}}),populateUniformTable:(function(program){var p=GL.programs[program];GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var ptable=GL.programInfos[program];var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,GLctx.ACTIVE_UNIFORMS);for(var i=0;i>2];contextAttributes["depth"]=!!HEAP32[attributes+4>>2];contextAttributes["stencil"]=!!HEAP32[attributes+8>>2];contextAttributes["antialias"]=!!HEAP32[attributes+12>>2];contextAttributes["premultipliedAlpha"]=!!HEAP32[attributes+16>>2];contextAttributes["preserveDrawingBuffer"]=!!HEAP32[attributes+20>>2];contextAttributes["preferLowPowerToHighPerformance"]=!!HEAP32[attributes+24>>2];contextAttributes["failIfMajorPerformanceCaveat"]=!!HEAP32[attributes+28>>2];contextAttributes["majorVersion"]=HEAP32[attributes+32>>2];contextAttributes["minorVersion"]=HEAP32[attributes+36>>2];contextAttributes["explicitSwapControl"]=HEAP32[attributes+44>>2];contextAttributes["proxyContextToMainThread"]=HEAP32[attributes+48>>2];contextAttributes["renderViaOffscreenBackBuffer"]=HEAP32[attributes+52>>2];target=Pointer_stringify(target);var canvas;if((!target||target==="#canvas")&&Module["canvas"]){canvas=Module["canvas"].id&&GL.offscreenCanvases[Module["canvas"].id]?GL.offscreenCanvases[Module["canvas"].id].offscreenCanvas||JSEvents.findEventTarget(Module["canvas"].id):Module["canvas"]}else{canvas=GL.offscreenCanvases[target]?GL.offscreenCanvases[target].offscreenCanvas:JSEvents.findEventTarget(target)}if(!canvas){return 0}if(contextAttributes["explicitSwapControl"]){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(){return _emscripten_webgl_do_create_context.apply(null,arguments)}function _emscripten_webgl_destroy_context_calling_thread(contextHandle){GL.deleteContext(contextHandle)}function _emscripten_webgl_destroy_context(){return _emscripten_webgl_destroy_context_calling_thread.apply(null,arguments)}function _emscripten_webgl_enable_extension_calling_thread(contextHandle,extension){var context=GL.getContext(contextHandle);var extString=Pointer_stringify(extension);if(extString.indexOf("GL_")==0)extString=extString.substr(3);var ext=context.GLctx.getExtension(extString);return ext?1:0}function _emscripten_webgl_enable_extension(){return _emscripten_webgl_enable_extension_calling_thread.apply(null,arguments)}function _emscripten_webgl_do_get_current_context(){return GL.currentContext?GL.currentContext.handle:0}function _emscripten_webgl_get_current_context(){return _emscripten_webgl_do_get_current_context.apply(null,arguments)}function _emscripten_webgl_init_context_attributes(attributes){HEAP32[attributes>>2]=1;HEAP32[attributes+4>>2]=1;HEAP32[attributes+8>>2]=0;HEAP32[attributes+12>>2]=1;HEAP32[attributes+16>>2]=1;HEAP32[attributes+20>>2]=0;HEAP32[attributes+24>>2]=0;HEAP32[attributes+28>>2]=0;HEAP32[attributes+32>>2]=1;HEAP32[attributes+36>>2]=0;HEAP32[attributes+40>>2]=1;HEAP32[attributes+44>>2]=0;HEAP32[attributes+48>>2]=0;HEAP32[attributes+52>>2]=0}function _emscripten_webgl_make_context_current(contextHandle){var success=GL.makeContextCurrent(contextHandle);return success?0:-5}function __exit(status){exit(status)}function _exit(status){__exit(status)}function _flock(fd,operation){return 0}function _getaddrinfo(node,service,hint,out){var addr=0;var port=0;var flags=0;var family=0;var type=0;var proto=0;var ai;function allocaddrinfo(family,type,proto,canon,addr,port){var sa,salen,ai;var res;salen=family===10?28:16;addr=family===10?__inet_ntop6_raw(addr):__inet_ntop4_raw(addr);sa=_malloc(salen);res=__write_sockaddr(sa,family,addr,port);assert(!res.errno);ai=_malloc(32);HEAP32[ai+4>>2]=family;HEAP32[ai+8>>2]=type;HEAP32[ai+12>>2]=proto;HEAP32[ai+24>>2]=canon;HEAP32[ai+20>>2]=sa;if(family===10){HEAP32[ai+16>>2]=28}else{HEAP32[ai+16>>2]=16}HEAP32[ai+28>>2]=0;return ai}if(hint){flags=HEAP32[hint>>2];family=HEAP32[hint+4>>2];type=HEAP32[hint+8>>2];proto=HEAP32[hint+12>>2]}if(type&&!proto){proto=type===2?17:6}if(!type&&proto){type=proto===17?2:1}if(proto===0){proto=6}if(type===0){type=1}if(!node&&!service){return-2}if(flags&~(1|2|4|1024|8|16|32)){return-1}if(hint!==0&&HEAP32[hint>>2]&2&&!node){return-1}if(flags&32){return-2}if(type!==0&&type!==1&&type!==2){return-7}if(family!==0&&family!==2&&family!==10){return-6}if(service){service=Pointer_stringify(service);port=parseInt(service,10);if(isNaN(port)){if(flags&1024){return-2}return-8}}if(!node){if(family===0){family=2}if((flags&1)===0){if(family===2){addr=_htonl(2130706433)}else{addr=[0,0,0,1]}}ai=allocaddrinfo(family,type,proto,null,addr,port);HEAP32[out>>2]=ai;return 0}node=Pointer_stringify(node);addr=__inet_pton4_raw(node);if(addr!==null){if(family===0||family===2){family=2}else if(family===10&&flags&8){addr=[0,0,_htonl(65535),addr];family=10}else{return-2}}else{addr=__inet_pton6_raw(node);if(addr!==null){if(family===0||family===10){family=10}else{return-2}}}if(addr!=null){ai=allocaddrinfo(family,type,proto,node,addr,port);HEAP32[out>>2]=ai;return 0}if(flags&4){return-2}node=DNS.lookup_name(node);addr=__inet_pton4_raw(node);if(family===0){family=2}else if(family===10){addr=[0,0,_htonl(65535),addr]}ai=allocaddrinfo(family,type,proto,null,addr,port);HEAP32[out>>2]=ai;return 0}function _getenv(name){if(name===0)return 0;name=Pointer_stringify(name);if(!ENV.hasOwnProperty(name))return 0;if(_getenv.ret)_free(_getenv.ret);_getenv.ret=allocateUTF8(ENV[name]);return _getenv.ret}function _gethostbyname(name){name=Pointer_stringify(name);var ret=_malloc(20);var nameBuf=_malloc(name.length+1);stringToUTF8(name,nameBuf,name.length+1);HEAP32[ret>>2]=nameBuf;var aliasesBuf=_malloc(4);HEAP32[aliasesBuf>>2]=0;HEAP32[ret+4>>2]=aliasesBuf;var afinet=2;HEAP32[ret+8>>2]=afinet;HEAP32[ret+12>>2]=4;var addrListBuf=_malloc(12);HEAP32[addrListBuf>>2]=addrListBuf+8;HEAP32[addrListBuf+4>>2]=0;HEAP32[addrListBuf+8>>2]=__inet_pton4_raw(DNS.lookup_name(name));HEAP32[ret+16>>2]=addrListBuf;return ret}function _gethostbyaddr(addr,addrlen,type){if(type!==2){___setErrNo(ERRNO_CODES.EAFNOSUPPORT);return null}addr=HEAP32[addr>>2];var host=__inet_ntop4_raw(addr);var lookup=DNS.lookup_addr(host);if(lookup){host=lookup}var hostp=allocate(intArrayFromString(host),"i8",ALLOC_STACK);return _gethostbyname(hostp)}function _getnameinfo(sa,salen,node,nodelen,serv,servlen,flags){var info=__read_sockaddr(sa,salen);if(info.errno){return-6}var port=info.port;var addr=info.addr;var overflowed=false;if(node&&nodelen){var lookup;if(flags&1||!(lookup=DNS.lookup_addr(addr))){if(flags&8){return-2}}else{addr=lookup}var numBytesWrittenExclNull=stringToUTF8(addr,node,nodelen);if(numBytesWrittenExclNull+1>=nodelen){overflowed=true}}if(serv&&servlen){port=""+port;var numBytesWrittenExclNull=stringToUTF8(port,serv,servlen);if(numBytesWrittenExclNull+1>=servlen){overflowed=true}}if(overflowed){return-12}return 0}function _getpagesize(){return PAGE_SIZE}function _getpwuid(uid){return 0}function _gettimeofday(ptr){var now=Date.now();HEAP32[ptr>>2]=now/1e3|0;HEAP32[ptr+4>>2]=now%1e3*1e3|0;return 0}function _glActiveTexture(x0){GLctx["activeTexture"](x0)}function _glAttachShader(program,shader){GLctx.attachShader(GL.programs[program],GL.shaders[shader])}function _glBeginQuery(target,id){GLctx["beginQuery"](target,id?GL.queries[id]:null)}function _glBeginTransformFeedback(x0){GLctx["beginTransformFeedback"](x0)}function _glBindAttribLocation(program,index,name){name=Pointer_stringify(name);GLctx.bindAttribLocation(GL.programs[program],index,name)}function _glBindBuffer(target,buffer){var bufferObj=buffer?GL.buffers[buffer]:null;if(target==35051){GLctx.currentPixelPackBufferBinding=buffer}else if(target==35052){GLctx.currentPixelUnpackBufferBinding=buffer}GLctx.bindBuffer(target,bufferObj)}function _glBindBufferBase(target,index,buffer){var bufferObj=buffer?GL.buffers[buffer]:null;GLctx["bindBufferBase"](target,index,bufferObj)}function _glBindBufferRange(target,index,buffer,offset,ptrsize){var bufferObj=buffer?GL.buffers[buffer]:null;GLctx["bindBufferRange"](target,index,bufferObj,offset,ptrsize)}function _glBindFramebuffer(target,framebuffer){GLctx.bindFramebuffer(target,framebuffer?GL.framebuffers[framebuffer]:null)}function _glBindRenderbuffer(target,renderbuffer){GLctx.bindRenderbuffer(target,renderbuffer?GL.renderbuffers[renderbuffer]:null)}function _glBindSampler(unit,sampler){GLctx["bindSampler"](unit,sampler?GL.samplers[sampler]:null)}function _glBindTexture(target,texture){GLctx.bindTexture(target,texture?GL.textures[texture]:null)}function _glBindTransformFeedback(target,id){var transformFeedback=id?GL.transformFeedbacks[id]:null;if(id&&!transformFeedback){GL.recordError(1282);return}GLctx["bindTransformFeedback"](target,transformFeedback)}function _glBindVertexArray(vao){GLctx["bindVertexArray"](GL.vaos[vao])}function _glBlendEquation(x0){GLctx["blendEquation"](x0)}function _glBlendEquationSeparate(x0,x1){GLctx["blendEquationSeparate"](x0,x1)}function _glBlendFuncSeparate(x0,x1,x2,x3){GLctx["blendFuncSeparate"](x0,x1,x2,x3)}function _glBlitFramebuffer(x0,x1,x2,x3,x4,x5,x6,x7,x8,x9){GLctx["blitFramebuffer"](x0,x1,x2,x3,x4,x5,x6,x7,x8,x9)}function _glBufferData(target,size,data,usage){if(!data){GLctx.bufferData(target,size,usage)}else{if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.bufferData(target,HEAPU8,usage,data,size);return}GLctx.bufferData(target,HEAPU8.subarray(data,data+size),usage)}}function _glBufferSubData(target,offset,size,data){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.bufferSubData(target,offset,HEAPU8,data,size);return}GLctx.bufferSubData(target,offset,HEAPU8.subarray(data,data+size))}function _glCheckFramebufferStatus(x0){return GLctx["checkFramebufferStatus"](x0)}function _glClear(x0){GLctx["clear"](x0)}function _glClearBufferfi(x0,x1,x2,x3){GLctx["clearBufferfi"](x0,x1,x2,x3)}function _glClearBufferfv(buffer,drawbuffer,value){GLctx["clearBufferfv"](buffer,drawbuffer,HEAPF32,value>>2)}function _glClearBufferuiv(buffer,drawbuffer,value){GLctx["clearBufferuiv"](buffer,drawbuffer,HEAPU32,value>>2)}function _glClearColor(x0,x1,x2,x3){GLctx["clearColor"](x0,x1,x2,x3)}function _glClearDepthf(x0){GLctx["clearDepth"](x0)}function _glClearStencil(x0){GLctx["clearStencil"](x0)}function _glClientWaitSync(sync,flags,timeoutLo,timeoutHi){timeoutLo=timeoutLo>>>0;timeoutHi=timeoutHi>>>0;var timeout=timeoutLo==4294967295&&timeoutHi==4294967295?-1:makeBigInt(timeoutLo,timeoutHi,true);return GLctx.clientWaitSync(GL.syncs[sync],flags,timeout)}function _glColorMask(red,green,blue,alpha){GLctx.colorMask(!!red,!!green,!!blue,!!alpha)}function _glCompileShader(shader){GLctx.compileShader(GL.shaders[shader])}function _glCompressedTexImage2D(target,level,internalFormat,width,height,border,imageSize,data){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx["compressedTexImage2D"](target,level,internalFormat,width,height,border,HEAPU8,data,imageSize);return}GLctx["compressedTexImage2D"](target,level,internalFormat,width,height,border,data?HEAPU8.subarray(data,data+imageSize):null)}function _glCompressedTexImage3D(target,level,internalFormat,width,height,depth,border,imageSize,data){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx["compressedTexImage3D"](target,level,internalFormat,width,height,depth,border,HEAPU8,data,imageSize)}else{GLctx["compressedTexImage3D"](target,level,internalFormat,width,height,depth,border,data?HEAPU8.subarray(data,data+imageSize):null)}}function _glCompressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,imageSize,data){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx["compressedTexSubImage2D"](target,level,xoffset,yoffset,width,height,format,HEAPU8,data,imageSize);return}GLctx["compressedTexSubImage2D"](target,level,xoffset,yoffset,width,height,format,data?HEAPU8.subarray(data,data+imageSize):null)}function _glCompressedTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,imageSize,data){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx["compressedTexSubImage3D"](target,level,xoffset,yoffset,zoffset,width,height,depth,format,HEAPU8,data,imageSize)}else{GLctx["compressedTexSubImage3D"](target,level,xoffset,yoffset,zoffset,width,height,depth,format,data?HEAPU8.subarray(data,data+imageSize):null)}}function _glCopyBufferSubData(x0,x1,x2,x3,x4){GLctx["copyBufferSubData"](x0,x1,x2,x3,x4)}function _glCopyTexImage2D(x0,x1,x2,x3,x4,x5,x6,x7){GLctx["copyTexImage2D"](x0,x1,x2,x3,x4,x5,x6,x7)}function _glCopyTexSubImage2D(x0,x1,x2,x3,x4,x5,x6,x7){GLctx["copyTexSubImage2D"](x0,x1,x2,x3,x4,x5,x6,x7)}function _glCreateProgram(){var id=GL.getNewId(GL.programs);var program=GLctx.createProgram();program.name=id;GL.programs[id]=program;return id}function _glCreateShader(shaderType){var id=GL.getNewId(GL.shaders);GL.shaders[id]=GLctx.createShader(shaderType);return id}function _glCullFace(x0){GLctx["cullFace"](x0)}function _glDeleteBuffers(n,buffers){for(var i=0;i>2];var buffer=GL.buffers[id];if(!buffer)continue;GLctx.deleteBuffer(buffer);buffer.name=0;GL.buffers[id]=null;if(id==GL.currArrayBuffer)GL.currArrayBuffer=0;if(id==GL.currElementArrayBuffer)GL.currElementArrayBuffer=0}}function _glDeleteFramebuffers(n,framebuffers){for(var i=0;i>2];var framebuffer=GL.framebuffers[id];if(!framebuffer)continue;GLctx.deleteFramebuffer(framebuffer);framebuffer.name=0;GL.framebuffers[id]=null}}function _glDeleteProgram(id){if(!id)return;var program=GL.programs[id];if(!program){GL.recordError(1281);return}GLctx.deleteProgram(program);program.name=0;GL.programs[id]=null;GL.programInfos[id]=null}function _glDeleteQueries(n,ids){for(var i=0;i>2];var query=GL.queries[id];if(!query)continue;GLctx["deleteQuery"](query);GL.queries[id]=null}}function _glDeleteRenderbuffers(n,renderbuffers){for(var i=0;i>2];var renderbuffer=GL.renderbuffers[id];if(!renderbuffer)continue;GLctx.deleteRenderbuffer(renderbuffer);renderbuffer.name=0;GL.renderbuffers[id]=null}}function _glDeleteSamplers(n,samplers){for(var i=0;i>2];var sampler=GL.samplers[id];if(!sampler)continue;GLctx["deleteSampler"](sampler);sampler.name=0;GL.samplers[id]=null}}function _glDeleteShader(id){if(!id)return;var shader=GL.shaders[id];if(!shader){GL.recordError(1281);return}GLctx.deleteShader(shader);GL.shaders[id]=null}function _glDeleteSync(id){if(!id)return;var sync=GL.syncs[id];if(!sync){GL.recordError(1281);return}GLctx.deleteSync(sync);sync.name=0;GL.syncs[id]=null}function _glDeleteTextures(n,textures){for(var i=0;i>2];var texture=GL.textures[id];if(!texture)continue;GLctx.deleteTexture(texture);texture.name=0;GL.textures[id]=null}}function _glDeleteTransformFeedbacks(n,ids){for(var i=0;i>2];var transformFeedback=GL.transformFeedbacks[id];if(!transformFeedback)continue;GLctx["deleteTransformFeedback"](transformFeedback);transformFeedback.name=0;GL.transformFeedbacks[id]=null}}function _glDeleteVertexArrays(n,vaos){for(var i=0;i>2];GLctx["deleteVertexArray"](GL.vaos[id]);GL.vaos[id]=null}}function _glDepthFunc(x0){GLctx["depthFunc"](x0)}function _glDepthMask(flag){GLctx.depthMask(!!flag)}function _glDetachShader(program,shader){GLctx.detachShader(GL.programs[program],GL.shaders[shader])}function _glDisable(x0){GLctx["disable"](x0)}function _glDisableVertexAttribArray(index){GLctx.disableVertexAttribArray(index)}function _glDrawArrays(mode,first,count){GLctx.drawArrays(mode,first,count)}function _glDrawArraysInstanced(mode,first,count,primcount){GLctx["drawArraysInstanced"](mode,first,count,primcount)}function _glDrawBuffers(n,bufs){var bufArray=GL.tempFixedLengthArray[n];for(var i=0;i>2]}GLctx["drawBuffers"](bufArray)}function _glDrawElements(mode,count,type,indices){GLctx.drawElements(mode,count,type,indices)}function _glDrawElementsInstanced(mode,count,type,indices,primcount){GLctx["drawElementsInstanced"](mode,count,type,indices,primcount)}function _glEnable(x0){GLctx["enable"](x0)}function _glEnableVertexAttribArray(index){GLctx.enableVertexAttribArray(index)}function _glEndQuery(x0){GLctx["endQuery"](x0)}function _glEndTransformFeedback(){GLctx["endTransformFeedback"]()}function _glFenceSync(condition,flags){var sync=GLctx.fenceSync(condition,flags);if(sync){var id=GL.getNewId(GL.syncs);sync.name=id;GL.syncs[id]=sync;return id}else{return 0}}function _glFinish(){GLctx["finish"]()}function _glFlush(){GLctx["flush"]()}function emscriptenWebGLGetBufferBinding(target){switch(target){case 34962:target=34964;break;case 34963:target=34965;break;case 35051:target=35053;break;case 35052:target=35055;break;case 35982:target=35983;break;case 36662:target=36662;break;case 36663:target=36663;break;case 35345:target=35368;break}var buffer=GLctx.getParameter(target);if(buffer)return buffer.name|0;else return 0}function emscriptenWebGLValidateMapBufferTarget(target){switch(target){case 34962:case 34963:case 36662:case 36663:case 35051:case 35052:case 35882:case 35982:case 35345:return true;default:return false}}function _glFlushMappedBufferRange(target,offset,length){if(!emscriptenWebGLValidateMapBufferTarget(target)){GL.recordError(1280);err("GL_INVALID_ENUM in glFlushMappedBufferRange");return}var mapping=GL.mappedBuffers[emscriptenWebGLGetBufferBinding(target)];if(!mapping){GL.recordError(1282);Module.printError("buffer was never mapped in glFlushMappedBufferRange");return}if(!(mapping.access&16)){GL.recordError(1282);Module.printError("buffer was not mapped with GL_MAP_FLUSH_EXPLICIT_BIT in glFlushMappedBufferRange");return}if(offset<0||length<0||offset+length>mapping.length){GL.recordError(1281);Module.printError("invalid range in glFlushMappedBufferRange");return}GLctx.bufferSubData(target,mapping.offset,HEAPU8.subarray(mapping.mem+offset,mapping.mem+offset+length))}function _glFramebufferRenderbuffer(target,attachment,renderbuffertarget,renderbuffer){GLctx.framebufferRenderbuffer(target,attachment,renderbuffertarget,GL.renderbuffers[renderbuffer])}function _glFramebufferTexture2D(target,attachment,textarget,texture,level){GLctx.framebufferTexture2D(target,attachment,textarget,GL.textures[texture],level)}function _glFramebufferTextureLayer(target,attachment,texture,level,layer){GLctx.framebufferTextureLayer(target,attachment,GL.textures[texture],level,layer)}function _glFrontFace(x0){GLctx["frontFace"](x0)}function _glGenBuffers(n,buffers){for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.buffers);buffer.name=id;GL.buffers[id]=buffer;HEAP32[buffers+i*4>>2]=id}}function _glGenFramebuffers(n,ids){for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.framebuffers);framebuffer.name=id;GL.framebuffers[id]=framebuffer;HEAP32[ids+i*4>>2]=id}}function _glGenQueries(n,ids){for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.queries);query.name=id;GL.queries[id]=query;HEAP32[ids+i*4>>2]=id}}function _glGenRenderbuffers(n,renderbuffers){for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.renderbuffers);renderbuffer.name=id;GL.renderbuffers[id]=renderbuffer;HEAP32[renderbuffers+i*4>>2]=id}}function _glGenSamplers(n,samplers){for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.samplers);sampler.name=id;GL.samplers[id]=sampler;HEAP32[samplers+i*4>>2]=id}}function _glGenTextures(n,textures){for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.textures);texture.name=id;GL.textures[id]=texture;HEAP32[textures+i*4>>2]=id}}function _glGenTransformFeedbacks(n,ids){for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.transformFeedbacks);transformFeedback.name=id;GL.transformFeedbacks[id]=transformFeedback;HEAP32[ids+i*4>>2]=id}}function _glGenVertexArrays(n,arrays){for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.vaos);vao.name=id;GL.vaos[id]=vao;HEAP32[arrays+i*4>>2]=id}}function _glGenerateMipmap(x0){GLctx["generateMipmap"](x0)}function _glGetActiveAttrib(program,index,bufSize,length,size,type,name){program=GL.programs[program];var info=GLctx.getActiveAttrib(program,index);if(!info)return;if(bufSize>0&&name){var numBytesWrittenExclNull=stringToUTF8(info.name,name,bufSize);if(length)HEAP32[length>>2]=numBytesWrittenExclNull}else{if(length)HEAP32[length>>2]=0}if(size)HEAP32[size>>2]=info.size;if(type)HEAP32[type>>2]=info.type}function _glGetActiveUniform(program,index,bufSize,length,size,type,name){program=GL.programs[program];var info=GLctx.getActiveUniform(program,index);if(!info)return;if(bufSize>0&&name){var numBytesWrittenExclNull=stringToUTF8(info.name,name,bufSize);if(length)HEAP32[length>>2]=numBytesWrittenExclNull}else{if(length)HEAP32[length>>2]=0}if(size)HEAP32[size>>2]=info.size;if(type)HEAP32[type>>2]=info.type}function _glGetActiveUniformBlockName(program,uniformBlockIndex,bufSize,length,uniformBlockName){program=GL.programs[program];var result=GLctx["getActiveUniformBlockName"](program,uniformBlockIndex);if(!result)return;if(uniformBlockName&&bufSize>0){var numBytesWrittenExclNull=stringToUTF8(result,uniformBlockName,bufSize);if(length)HEAP32[length>>2]=numBytesWrittenExclNull}else{if(length)HEAP32[length>>2]=0}}function _glGetActiveUniformBlockiv(program,uniformBlockIndex,pname,params){if(!params){GL.recordError(1281);return}program=GL.programs[program];switch(pname){case 35393:var name=GLctx["getActiveUniformBlockName"](program,uniformBlockIndex);HEAP32[params>>2]=name.length+1;return;default:var result=GLctx["getActiveUniformBlockParameter"](program,uniformBlockIndex,pname);if(!result)return;if(typeof result=="number"){HEAP32[params>>2]=result}else{for(var i=0;i>2]=result[i]}}}}function _glGetActiveUniformsiv(program,uniformCount,uniformIndices,pname,params){if(!params){GL.recordError(1281);return}if(uniformCount>0&&uniformIndices==0){GL.recordError(1281);return}program=GL.programs[program];var ids=[];for(var i=0;i>2])}var result=GLctx["getActiveUniforms"](program,ids,pname);if(!result)return;var len=result.length;for(var i=0;i>2]=result[i]}}function _glGetAttribLocation(program,name){return GLctx.getAttribLocation(GL.programs[program],Pointer_stringify(name))}function _glGetError(){if(GL.lastError){var error=GL.lastError;GL.lastError=0;return error}else{return GLctx.getError()}}function _glGetFramebufferAttachmentParameteriv(target,attachment,pname,params){var result=GLctx.getFramebufferAttachmentParameter(target,attachment,pname);if(result instanceof WebGLRenderbuffer||result instanceof WebGLTexture){result=result.name|0}HEAP32[params>>2]=result}function emscriptenWebGLGetIndexed(target,index,data,type){if(!data){GL.recordError(1281);return}var result=GLctx["getIndexedParameter"](target,index);var ret;switch(typeof result){case"boolean":ret=result?1:0;break;case"number":ret=result;break;case"object":if(result===null){switch(target){case 35983:case 35368:ret=0;break;default:{GL.recordError(1280);return}}}else if(result instanceof WebGLBuffer){ret=result.name|0}else{GL.recordError(1280);return}break;default:GL.recordError(1280);return}switch(type){case"Integer64":tempI64=[ret>>>0,(tempDouble=ret,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[data>>2]=tempI64[0],HEAP32[data+4>>2]=tempI64[1];break;case"Integer":HEAP32[data>>2]=ret;break;case"Float":HEAPF32[data>>2]=ret;break;case"Boolean":HEAP8[data>>0]=ret?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+type}}function _glGetIntegeri_v(target,index,data){emscriptenWebGLGetIndexed(target,index,data,"Integer")}function emscriptenWebGLGet(name_,p,type){if(!p){GL.recordError(1281);return}var ret=undefined;switch(name_){case 36346:ret=1;break;case 36344:if(type!=="Integer"&&type!=="Integer64"){GL.recordError(1280)}return;case 34814:case 36345:ret=0;break;case 34466:var formats=GLctx.getParameter(34467);ret=formats.length;break;case 33309:if(GLctx.canvas.GLctxObject.version<2){GL.recordError(1282);return}var exts=GLctx.getSupportedExtensions();ret=2*exts.length;break;case 33307:case 33308:if(GLctx.canvas.GLctxObject.version<2){GL.recordError(1280);return}ret=name_==33307?3:0;break}if(ret===undefined){var result=GLctx.getParameter(name_);switch(typeof result){case"number":ret=result;break;case"boolean":ret=result?1:0;break;case"string":GL.recordError(1280);return;case"object":if(result===null){switch(name_){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 35097:case 36389:case 34068:{ret=0;break};default:{GL.recordError(1280);return}}}else if(result instanceof Float32Array||result instanceof Uint32Array||result instanceof Int32Array||result instanceof Array){for(var i=0;i>2]=result[i];break;case"Float":HEAPF32[p+i*4>>2]=result[i];break;case"Boolean":HEAP8[p+i>>0]=result[i]?1:0;break;default:throw"internal glGet error, bad type: "+type}}return}else if(result instanceof WebGLBuffer||result instanceof WebGLProgram||result instanceof WebGLFramebuffer||result instanceof WebGLRenderbuffer||result instanceof WebGLQuery||result instanceof WebGLSampler||result instanceof WebGLSync||result instanceof WebGLTransformFeedback||result instanceof WebGLVertexArrayObject||result instanceof WebGLTexture){ret=result.name|0}else{GL.recordError(1280);return}break;default:GL.recordError(1280);return}}switch(type){case"Integer64":tempI64=[ret>>>0,(tempDouble=ret,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[p>>2]=tempI64[0],HEAP32[p+4>>2]=tempI64[1];break;case"Integer":HEAP32[p>>2]=ret;break;case"Float":HEAPF32[p>>2]=ret;break;case"Boolean":HEAP8[p>>0]=ret?1:0;break;default:throw"internal glGet error, bad type: "+type}}function _glGetIntegerv(name_,p){emscriptenWebGLGet(name_,p,"Integer")}function _glGetInternalformativ(target,internalformat,pname,bufSize,params){if(bufSize<0){GL.recordError(1281);return}var samples=GLctx["getInternalformatParameter"](target,internalformat,32937);if(!samples){GL.recordError(1280);return}switch(pname){case 32937:var n=Math.min(bufSize,samples.length);for(var i=0;i>2]=v}break;case 37760:if(bufSize>1){var v=samples.length;HEAP32[params>>2]=v}break;default:GL.recordError(1280)}}function _glGetProgramBinary(program,bufSize,length,binaryFormat,binary){GL.recordError(1282)}function _glGetProgramInfoLog(program,maxLength,length,infoLog){var log=GLctx.getProgramInfoLog(GL.programs[program]);if(log===null)log="(unknown error)";if(maxLength>0&&infoLog){var numBytesWrittenExclNull=stringToUTF8(log,infoLog,maxLength);if(length)HEAP32[length>>2]=numBytesWrittenExclNull}else{if(length)HEAP32[length>>2]=0}}function _glGetProgramiv(program,pname,p){if(!p){GL.recordError(1281);return}if(program>=GL.counter){GL.recordError(1281);return}var ptable=GL.programInfos[program];if(!ptable){GL.recordError(1282);return}if(pname==35716){var log=GLctx.getProgramInfoLog(GL.programs[program]);if(log===null)log="(unknown error)";HEAP32[p>>2]=log.length+1}else if(pname==35719){HEAP32[p>>2]=ptable.maxUniformLength}else if(pname==35722){if(ptable.maxAttributeLength==-1){program=GL.programs[program];var numAttribs=GLctx.getProgramParameter(program,GLctx.ACTIVE_ATTRIBUTES);ptable.maxAttributeLength=0;for(var i=0;i>2]=ptable.maxAttributeLength}else if(pname==35381){if(ptable.maxUniformBlockNameLength==-1){program=GL.programs[program];var numBlocks=GLctx.getProgramParameter(program,GLctx.ACTIVE_UNIFORM_BLOCKS);ptable.maxUniformBlockNameLength=0;for(var i=0;i>2]=ptable.maxUniformBlockNameLength}else{HEAP32[p>>2]=GLctx.getProgramParameter(GL.programs[program],pname)}}function _glGetRenderbufferParameteriv(target,pname,params){if(!params){GL.recordError(1281);return}HEAP32[params>>2]=GLctx.getRenderbufferParameter(target,pname)}function _glGetShaderInfoLog(shader,maxLength,length,infoLog){var log=GLctx.getShaderInfoLog(GL.shaders[shader]);if(log===null)log="(unknown error)";if(maxLength>0&&infoLog){var numBytesWrittenExclNull=stringToUTF8(log,infoLog,maxLength);if(length)HEAP32[length>>2]=numBytesWrittenExclNull}else{if(length)HEAP32[length>>2]=0}}function _glGetShaderPrecisionFormat(shaderType,precisionType,range,precision){var result=GLctx.getShaderPrecisionFormat(shaderType,precisionType);HEAP32[range>>2]=result.rangeMin;HEAP32[range+4>>2]=result.rangeMax;HEAP32[precision>>2]=result.precision}function _glGetShaderSource(shader,bufSize,length,source){var result=GLctx.getShaderSource(GL.shaders[shader]);if(!result)return;if(bufSize>0&&source){var numBytesWrittenExclNull=stringToUTF8(result,source,bufSize);if(length)HEAP32[length>>2]=numBytesWrittenExclNull}else{if(length)HEAP32[length>>2]=0}}function _glGetShaderiv(shader,pname,p){if(!p){GL.recordError(1281);return}if(pname==35716){var log=GLctx.getShaderInfoLog(GL.shaders[shader]);if(log===null)log="(unknown error)";HEAP32[p>>2]=log.length+1}else if(pname==35720){var source=GLctx.getShaderSource(GL.shaders[shader]);var sourceLength=source===null||source.length==0?0:source.length+1;HEAP32[p>>2]=sourceLength}else{HEAP32[p>>2]=GLctx.getShaderParameter(GL.shaders[shader],pname)}}function _glGetString(name_){if(GL.stringCache[name_])return GL.stringCache[name_];var ret;switch(name_){case 7936:case 7937:case 37445:case 37446:ret=allocate(intArrayFromString(GLctx.getParameter(name_)),"i8",ALLOC_NORMAL);break;case 7938:var glVersion=GLctx.getParameter(GLctx.VERSION);if(GLctx.canvas.GLctxObject.version>=2)glVersion="OpenGL ES 3.0 ("+glVersion+")";else{glVersion="OpenGL ES 2.0 ("+glVersion+")"}ret=allocate(intArrayFromString(glVersion),"i8",ALLOC_NORMAL);break;case 7939:var exts=GLctx.getSupportedExtensions();var gl_exts=[];for(var i=0;i=stringiCache.length){GL.recordError(1281);return 0}return stringiCache[index]}switch(name){case 7939:var exts=GLctx.getSupportedExtensions();var gl_exts=[];for(var i=0;i=stringiCache.length){GL.recordError(1281);return 0}return stringiCache[index];default:GL.recordError(1280);return 0}}function _glGetTexParameteriv(target,pname,params){if(!params){GL.recordError(1281);return}HEAP32[params>>2]=GLctx.getTexParameter(target,pname)}function _glGetUniformBlockIndex(program,uniformBlockName){program=GL.programs[program];uniformBlockName=Pointer_stringify(uniformBlockName);return GLctx["getUniformBlockIndex"](program,uniformBlockName)}function _glGetUniformIndices(program,uniformCount,uniformNames,uniformIndices){if(!uniformIndices){GL.recordError(1281);return}if(uniformCount>0&&(uniformNames==0||uniformIndices==0)){GL.recordError(1281);return}program=GL.programs[program];var names=[];for(var i=0;i>2]));var result=GLctx["getUniformIndices"](program,names);if(!result)return;var len=result.length;for(var i=0;i>2]=result[i]}}function _glGetUniformLocation(program,name){name=Pointer_stringify(name);var arrayOffset=0;if(name.indexOf("]",name.length-1)!==-1){var ls=name.lastIndexOf("[");var arrayIndex=name.slice(ls+1,-1);if(arrayIndex.length>0){arrayOffset=parseInt(arrayIndex);if(arrayOffset<0){return-1}}name=name.slice(0,ls)}var ptable=GL.programInfos[program];if(!ptable){return-1}var utable=ptable.uniforms;var uniformInfo=utable[name];if(uniformInfo&&arrayOffset>2]=data;break;case"Float":HEAPF32[params>>2]=data;break;default:throw"internal emscriptenWebGLGetUniform() error, bad type: "+type}}else{for(var i=0;i>2]=data[i];break;case"Float":HEAPF32[params+i*4>>2]=data[i];break;default:throw"internal emscriptenWebGLGetUniform() error, bad type: "+type}}}}function _glGetUniformiv(program,location,params){emscriptenWebGLGetUniform(program,location,params,"Integer")}function emscriptenWebGLGetVertexAttrib(index,pname,params,type){if(!params){GL.recordError(1281);return}var data=GLctx.getVertexAttrib(index,pname);if(pname==34975){HEAP32[params>>2]=data["name"]}else if(typeof data=="number"||typeof data=="boolean"){switch(type){case"Integer":HEAP32[params>>2]=data;break;case"Float":HEAPF32[params>>2]=data;break;case"FloatToInteger":HEAP32[params>>2]=Math.fround(data);break;default:throw"internal emscriptenWebGLGetVertexAttrib() error, bad type: "+type}}else{for(var i=0;i>2]=data[i];break;case"Float":HEAPF32[params+i*4>>2]=data[i];break;case"FloatToInteger":HEAP32[params+i*4>>2]=Math.fround(data[i]);break;default:throw"internal emscriptenWebGLGetVertexAttrib() error, bad type: "+type}}}}function _glGetVertexAttribiv(index,pname,params){emscriptenWebGLGetVertexAttrib(index,pname,params,"FloatToInteger")}function _glInvalidateFramebuffer(target,numAttachments,attachments){var list=GL.tempFixedLengthArray[numAttachments];for(var i=0;i>2]}GLctx["invalidateFramebuffer"](target,list)}function _glIsEnabled(x0){return GLctx["isEnabled"](x0)}function _glIsVertexArray(array){var vao=GL.vaos[array];if(!vao)return 0;return GLctx["isVertexArray"](vao)}function _glLinkProgram(program){GLctx.linkProgram(GL.programs[program]);GL.programInfos[program]=null;GL.populateUniformTable(program)}function _glMapBufferRange(target,offset,length,access){if(access!=26&&access!=10){err("glMapBufferRange is only supported when access is MAP_WRITE|INVALIDATE_BUFFER");return 0}if(!emscriptenWebGLValidateMapBufferTarget(target)){GL.recordError(1280);err("GL_INVALID_ENUM in glMapBufferRange");return 0}var mem=_malloc(length);if(!mem)return 0;GL.mappedBuffers[emscriptenWebGLGetBufferBinding(target)]={offset:offset,length:length,mem:mem,access:access};return mem}function _glPixelStorei(pname,param){if(pname==3333){GL.packAlignment=param}else if(pname==3317){GL.unpackAlignment=param}GLctx.pixelStorei(pname,param)}function _glPolygonOffset(x0,x1){GLctx["polygonOffset"](x0,x1)}function _glProgramBinary(program,binaryFormat,binary,length){GL.recordError(1280)}function _glProgramParameteri(program,pname,value){GL.recordError(1280)}function _glReadBuffer(x0){GLctx["readBuffer"](x0)}function emscriptenWebGLComputeImageSize(width,height,sizePerPixel,alignment){function roundedToNextMultipleOf(x,y){return Math.floor((x+y-1)/y)*y}var plainRowSize=width*sizePerPixel;var alignedRowSize=roundedToNextMultipleOf(plainRowSize,alignment);return height<=0?0:(height-1)*alignedRowSize+plainRowSize}function emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,internalFormat){var sizePerPixel;var numChannels;switch(format){case 6406:case 6409:case 6402:case 6403:case 36244:numChannels=1;break;case 6410:case 33319:case 33320:numChannels=2;break;case 6407:case 35904:case 36248:numChannels=3;break;case 6408:case 35906:case 36249:numChannels=4;break;default:GL.recordError(1280);return null}switch(type){case 5121:case 5120:sizePerPixel=numChannels*1;break;case 5123:case 36193:case 5131:case 5122:sizePerPixel=numChannels*2;break;case 5125:case 5126:case 5124:sizePerPixel=numChannels*4;break;case 34042:case 35902:case 33640:case 35899:case 34042:sizePerPixel=4;break;case 33635:case 32819:case 32820:sizePerPixel=2;break;default:GL.recordError(1280);return null}var bytes=emscriptenWebGLComputeImageSize(width,height,sizePerPixel,GL.unpackAlignment);switch(type){case 5120:return HEAP8.subarray(pixels,pixels+bytes);case 5121:return HEAPU8.subarray(pixels,pixels+bytes);case 5122:return HEAP16.subarray(pixels>>1,pixels+bytes>>1);case 5124:return HEAP32.subarray(pixels>>2,pixels+bytes>>2);case 5126:return HEAPF32.subarray(pixels>>2,pixels+bytes>>2);case 5125:case 34042:case 35902:case 33640:case 35899:case 34042:return HEAPU32.subarray(pixels>>2,pixels+bytes>>2);case 5123:case 33635:case 32819:case 32820:case 36193:case 5131:return HEAPU16.subarray(pixels>>1,pixels+bytes>>1);default:GL.recordError(1280);return null}}function emscriptenWebGLGetHeapForType(type){switch(type){case 5120:return HEAP8;case 5121:return HEAPU8;case 5122:return HEAP16;case 5123:case 33635:case 32819:case 32820:case 36193:case 5131:return HEAPU16;case 5124:return HEAP32;case 5125:case 34042:case 35902:case 33640:case 35899:case 34042:return HEAPU32;case 5126:return HEAPF32;default:return null}}function emscriptenWebGLGetShiftForType(type){switch(type){case 5120:case 5121:return 0;case 5122:case 5123:case 33635:case 32819:case 32820:case 36193:case 5131:return 1;case 5124:case 5126:case 5125:case 34042:case 35902:case 33640:case 35899:case 34042:return 2;default:return 0}}function _glReadPixels(x,y,width,height,format,type,pixels){if(GL.currentContext.supportsWebGL2EntryPoints){if(GLctx.currentPixelPackBufferBinding){GLctx.readPixels(x,y,width,height,format,type,pixels)}else{GLctx.readPixels(x,y,width,height,format,type,emscriptenWebGLGetHeapForType(type),pixels>>emscriptenWebGLGetShiftForType(type))}return}var pixelData=emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,format);if(!pixelData){GL.recordError(1280);return}GLctx.readPixels(x,y,width,height,format,type,pixelData)}function _glRenderbufferStorage(x0,x1,x2,x3){GLctx["renderbufferStorage"](x0,x1,x2,x3)}function _glRenderbufferStorageMultisample(x0,x1,x2,x3,x4){GLctx["renderbufferStorageMultisample"](x0,x1,x2,x3,x4)}function _glSamplerParameteri(sampler,pname,param){GLctx["samplerParameteri"](sampler?GL.samplers[sampler]:null,pname,param)}function _glScissor(x0,x1,x2,x3){GLctx["scissor"](x0,x1,x2,x3)}function _glShaderSource(shader,count,string,length){var source=GL.getSource(shader,count,string,length);GLctx.shaderSource(GL.shaders[shader],source)}function _glStencilFuncSeparate(x0,x1,x2,x3){GLctx["stencilFuncSeparate"](x0,x1,x2,x3)}function _glStencilMask(x0){GLctx["stencilMask"](x0)}function _glStencilOpSeparate(x0,x1,x2,x3){GLctx["stencilOpSeparate"](x0,x1,x2,x3)}function _glTexImage2D(target,level,internalFormat,width,height,border,format,type,pixels){if(GL.currentContext.supportsWebGL2EntryPoints){if(GLctx.currentPixelUnpackBufferBinding){GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,pixels)}else if(pixels!=0){GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,emscriptenWebGLGetHeapForType(type),pixels>>emscriptenWebGLGetShiftForType(type))}else{GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,null)}return}var pixelData=null;if(pixels)pixelData=emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,internalFormat);GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,pixelData)}function _glTexImage3D(target,level,internalFormat,width,height,depth,border,format,type,pixels){if(GLctx.currentPixelUnpackBufferBinding){GLctx["texImage3D"](target,level,internalFormat,width,height,depth,border,format,type,pixels)}else if(pixels!=0){GLctx["texImage3D"](target,level,internalFormat,width,height,depth,border,format,type,emscriptenWebGLGetHeapForType(type),pixels>>emscriptenWebGLGetShiftForType(type))}else{GLctx["texImage3D"](target,level,internalFormat,width,height,depth,border,format,type,null)}}function _glTexParameterf(x0,x1,x2){GLctx["texParameterf"](x0,x1,x2)}function _glTexParameteri(x0,x1,x2){GLctx["texParameteri"](x0,x1,x2)}function _glTexParameteriv(target,pname,params){var param=HEAP32[params>>2];GLctx.texParameteri(target,pname,param)}function _glTexStorage2D(x0,x1,x2,x3,x4){GLctx["texStorage2D"](x0,x1,x2,x3,x4)}function _glTexStorage3D(x0,x1,x2,x3,x4,x5){GLctx["texStorage3D"](x0,x1,x2,x3,x4,x5)}function _glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixels){if(GL.currentContext.supportsWebGL2EntryPoints){if(GLctx.currentPixelUnpackBufferBinding){GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixels)}else if(pixels!=0){GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,emscriptenWebGLGetHeapForType(type),pixels>>emscriptenWebGLGetShiftForType(type))}else{GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,null)}return}var pixelData=null;if(pixels)pixelData=emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,0);GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixelData)}function _glTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,pixels){if(GLctx.currentPixelUnpackBufferBinding){GLctx["texSubImage3D"](target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,pixels)}else if(pixels!=0){GLctx["texSubImage3D"](target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,emscriptenWebGLGetHeapForType(type),pixels>>emscriptenWebGLGetShiftForType(type))}else{GLctx["texSubImage3D"](target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,null)}}function _glTransformFeedbackVaryings(program,count,varyings,bufferMode){program=GL.programs[program];var vars=[];for(var i=0;i>2]));GLctx["transformFeedbackVaryings"](program,vars,bufferMode)}function _glUniform1fv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform1fv(GL.uniforms[location],HEAPF32,value>>2,count);return}var view;if(count<=GL.MINI_TEMP_BUFFER_SIZE){view=GL.miniTempBufferViews[count-1];for(var i=0;i>2]}}else{view=HEAPF32.subarray(value>>2,value+count*4>>2)}GLctx.uniform1fv(GL.uniforms[location],view)}function _glUniform1i(location,v0){GLctx.uniform1i(GL.uniforms[location],v0)}function _glUniform1iv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform1iv(GL.uniforms[location],HEAP32,value>>2,count);return}GLctx.uniform1iv(GL.uniforms[location],HEAP32.subarray(value>>2,value+count*4>>2))}function _glUniform1uiv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform1uiv(GL.uniforms[location],HEAPU32,value>>2,count)}else{GLctx.uniform1uiv(GL.uniforms[location],HEAPU32.subarray(value>>2,value+count*4>>2))}}function _glUniform2fv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform2fv(GL.uniforms[location],HEAPF32,value>>2,count*2);return}var view;if(2*count<=GL.MINI_TEMP_BUFFER_SIZE){view=GL.miniTempBufferViews[2*count-1];for(var i=0;i<2*count;i+=2){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2]}}else{view=HEAPF32.subarray(value>>2,value+count*8>>2)}GLctx.uniform2fv(GL.uniforms[location],view)}function _glUniform2iv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform2iv(GL.uniforms[location],HEAP32,value>>2,count*2);return}GLctx.uniform2iv(GL.uniforms[location],HEAP32.subarray(value>>2,value+count*8>>2))}function _glUniform2uiv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform2uiv(GL.uniforms[location],HEAPU32,value>>2,count*2)}else{GLctx.uniform2uiv(GL.uniforms[location],HEAPU32.subarray(value>>2,value+count*8>>2))}}function _glUniform3fv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform3fv(GL.uniforms[location],HEAPF32,value>>2,count*3);return}var view;if(3*count<=GL.MINI_TEMP_BUFFER_SIZE){view=GL.miniTempBufferViews[3*count-1];for(var i=0;i<3*count;i+=3){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2]}}else{view=HEAPF32.subarray(value>>2,value+count*12>>2)}GLctx.uniform3fv(GL.uniforms[location],view)}function _glUniform3iv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform3iv(GL.uniforms[location],HEAP32,value>>2,count*3);return}GLctx.uniform3iv(GL.uniforms[location],HEAP32.subarray(value>>2,value+count*12>>2))}function _glUniform3uiv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform3uiv(GL.uniforms[location],HEAPU32,value>>2,count*3)}else{GLctx.uniform3uiv(GL.uniforms[location],HEAPU32.subarray(value>>2,value+count*12>>2))}}function _glUniform4fv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform4fv(GL.uniforms[location],HEAPF32,value>>2,count*4);return}var view;if(4*count<=GL.MINI_TEMP_BUFFER_SIZE){view=GL.miniTempBufferViews[4*count-1];for(var i=0;i<4*count;i+=4){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2];view[i+3]=HEAPF32[value+(4*i+12)>>2]}}else{view=HEAPF32.subarray(value>>2,value+count*16>>2)}GLctx.uniform4fv(GL.uniforms[location],view)}function _glUniform4iv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform4iv(GL.uniforms[location],HEAP32,value>>2,count*4);return}GLctx.uniform4iv(GL.uniforms[location],HEAP32.subarray(value>>2,value+count*16>>2))}function _glUniform4uiv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform4uiv(GL.uniforms[location],HEAPU32,value>>2,count*4)}else{GLctx.uniform4uiv(GL.uniforms[location],HEAPU32.subarray(value>>2,value+count*16>>2))}}function _glUniformBlockBinding(program,uniformBlockIndex,uniformBlockBinding){program=GL.programs[program];GLctx["uniformBlockBinding"](program,uniformBlockIndex,uniformBlockBinding)}function _glUniformMatrix3fv(location,count,transpose,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniformMatrix3fv(GL.uniforms[location],!!transpose,HEAPF32,value>>2,count*9);return}var view;if(9*count<=GL.MINI_TEMP_BUFFER_SIZE){view=GL.miniTempBufferViews[9*count-1];for(var i=0;i<9*count;i+=9){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2];view[i+3]=HEAPF32[value+(4*i+12)>>2];view[i+4]=HEAPF32[value+(4*i+16)>>2];view[i+5]=HEAPF32[value+(4*i+20)>>2];view[i+6]=HEAPF32[value+(4*i+24)>>2];view[i+7]=HEAPF32[value+(4*i+28)>>2];view[i+8]=HEAPF32[value+(4*i+32)>>2]}}else{view=HEAPF32.subarray(value>>2,value+count*36>>2)}GLctx.uniformMatrix3fv(GL.uniforms[location],!!transpose,view)}function _glUniformMatrix4fv(location,count,transpose,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniformMatrix4fv(GL.uniforms[location],!!transpose,HEAPF32,value>>2,count*16);return}var view;if(16*count<=GL.MINI_TEMP_BUFFER_SIZE){view=GL.miniTempBufferViews[16*count-1];for(var i=0;i<16*count;i+=16){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2];view[i+3]=HEAPF32[value+(4*i+12)>>2];view[i+4]=HEAPF32[value+(4*i+16)>>2];view[i+5]=HEAPF32[value+(4*i+20)>>2];view[i+6]=HEAPF32[value+(4*i+24)>>2];view[i+7]=HEAPF32[value+(4*i+28)>>2];view[i+8]=HEAPF32[value+(4*i+32)>>2];view[i+9]=HEAPF32[value+(4*i+36)>>2];view[i+10]=HEAPF32[value+(4*i+40)>>2];view[i+11]=HEAPF32[value+(4*i+44)>>2];view[i+12]=HEAPF32[value+(4*i+48)>>2];view[i+13]=HEAPF32[value+(4*i+52)>>2];view[i+14]=HEAPF32[value+(4*i+56)>>2];view[i+15]=HEAPF32[value+(4*i+60)>>2]}}else{view=HEAPF32.subarray(value>>2,value+count*64>>2)}GLctx.uniformMatrix4fv(GL.uniforms[location],!!transpose,view)}function _glUnmapBuffer(target){if(!emscriptenWebGLValidateMapBufferTarget(target)){GL.recordError(1280);err("GL_INVALID_ENUM in glUnmapBuffer");return 0}var buffer=emscriptenWebGLGetBufferBinding(target);var mapping=GL.mappedBuffers[buffer];if(!mapping){GL.recordError(1282);Module.printError("buffer was never mapped in glUnmapBuffer");return 0}GL.mappedBuffers[buffer]=null;if(!(mapping.access&16))if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.bufferSubData(target,mapping.offset,HEAPU8,mapping.mem,mapping.length)}else{GLctx.bufferSubData(target,mapping.offset,HEAPU8.subarray(mapping.mem,mapping.mem+mapping.length))}_free(mapping.mem);return 1}function _glUseProgram(program){GLctx.useProgram(program?GL.programs[program]:null)}function _glValidateProgram(program){GLctx.validateProgram(GL.programs[program])}function _glVertexAttrib4f(x0,x1,x2,x3,x4){GLctx["vertexAttrib4f"](x0,x1,x2,x3,x4)}function _glVertexAttrib4fv(index,v){GLctx.vertexAttrib4f(index,HEAPF32[v>>2],HEAPF32[v+4>>2],HEAPF32[v+8>>2],HEAPF32[v+12>>2])}function _glVertexAttribIPointer(index,size,type,stride,ptr){var cb=GL.currentContext.clientBuffers[index];if(!GL.currArrayBuffer){cb.size=size;cb.type=type;cb.normalized=false;cb.stride=stride;cb.ptr=ptr;cb.clientside=true;return}cb.clientside=false;GLctx.vertexAttribIPointer(index,size,type,stride,ptr)}function _glVertexAttribPointer(index,size,type,normalized,stride,ptr){GLctx.vertexAttribPointer(index,size,type,!!normalized,stride,ptr)}function _glViewport(x0,x1,x2,x3){GLctx["viewport"](x0,x1,x2,x3)}var ___tm_current=STATICTOP;STATICTOP+=48;var ___tm_timezone=allocate(intArrayFromString("GMT"),"i8",ALLOC_STATIC);function _gmtime_r(time,tmPtr){var date=new Date(HEAP32[time>>2]*1e3);HEAP32[tmPtr>>2]=date.getUTCSeconds();HEAP32[tmPtr+4>>2]=date.getUTCMinutes();HEAP32[tmPtr+8>>2]=date.getUTCHours();HEAP32[tmPtr+12>>2]=date.getUTCDate();HEAP32[tmPtr+16>>2]=date.getUTCMonth();HEAP32[tmPtr+20>>2]=date.getUTCFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getUTCDay();HEAP32[tmPtr+36>>2]=0;HEAP32[tmPtr+32>>2]=0;var start=Date.UTC(date.getUTCFullYear(),0,1,0,0,0,0);var yday=(date.getTime()-start)/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+40>>2]=___tm_timezone;return tmPtr}function _gmtime(time){return _gmtime_r(time,___tm_current)}function _inet_addr(ptr){var addr=__inet_pton4_raw(Pointer_stringify(ptr));if(addr===null){return-1}return addr}var _llvm_ceil_f32=Math_ceil;var _llvm_ceil_f64=Math_ceil;function _llvm_copysign_f64(x,y){return y<0||y===0&&1/y<0?-Math_abs(x):Math_abs(x)}function _llvm_cttz_i32(x){x=x|0;return(x?31-(Math_clz32(x^x-1)|0)|0:32)|0}function _llvm_eh_typeid_for(type){return type}function _llvm_exp2_f32(x){return Math.pow(2,x)}var _llvm_fabs_f32=Math_abs;var _llvm_fabs_f64=Math_abs;var _llvm_floor_f32=Math_floor;var _llvm_floor_f64=Math_floor;function _llvm_log10_f32(x){return Math.log(x)/Math.LN10}function _llvm_log2_f32(x){return Math.log(x)/Math.LN2}var _llvm_pow_f64=Math_pow;var _llvm_sqrt_f32=Math_sqrt;function _llvm_trap(){abort("trap!")}var _llvm_trunc_f32=Math_trunc;function _tzset(){if(_tzset.called)return;_tzset.called=true;HEAP32[__get_timezone()>>2]=(new Date).getTimezoneOffset()*60;var currentYear=(new Date).getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);HEAP32[__get_daylight()>>2]=Number(winter.getTimezoneOffset()!=summer.getTimezoneOffset());function extractZone(date){var match=date.toTimeString().match(/\(([A-Za-z ]+)\)$/);return match?match[1]:"GMT"}var winterName=extractZone(winter);var summerName=extractZone(summer);var winterNamePtr=allocate(intArrayFromString(winterName),"i8",ALLOC_NORMAL);var summerNamePtr=allocate(intArrayFromString(summerName),"i8",ALLOC_NORMAL);if(summer.getTimezoneOffset()>2]=winterNamePtr;HEAP32[__get_tzname()+4>>2]=summerNamePtr}else{HEAP32[__get_tzname()>>2]=summerNamePtr;HEAP32[__get_tzname()+4>>2]=winterNamePtr}}function _localtime_r(time,tmPtr){_tzset();var date=new Date(HEAP32[time>>2]*1e3);HEAP32[tmPtr>>2]=date.getSeconds();HEAP32[tmPtr+4>>2]=date.getMinutes();HEAP32[tmPtr+8>>2]=date.getHours();HEAP32[tmPtr+12>>2]=date.getDate();HEAP32[tmPtr+16>>2]=date.getMonth();HEAP32[tmPtr+20>>2]=date.getFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getDay();var start=new Date(date.getFullYear(),0,1);var yday=(date.getTime()-start.getTime())/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+36>>2]=-(date.getTimezoneOffset()*60);var summerOffset=(new Date(date.getFullYear(),6,1)).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;HEAP32[tmPtr+32>>2]=dst;var zonePtr=HEAP32[__get_tzname()+(dst?4:0)>>2];HEAP32[tmPtr+40>>2]=zonePtr;return tmPtr}function _localtime(time){return _localtime_r(time,___tm_current)}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest);return dest}function _mktime(tmPtr){_tzset();var date=new Date(HEAP32[tmPtr+20>>2]+1900,HEAP32[tmPtr+16>>2],HEAP32[tmPtr+12>>2],HEAP32[tmPtr+8>>2],HEAP32[tmPtr+4>>2],HEAP32[tmPtr>>2],0);var dst=HEAP32[tmPtr+32>>2];var guessedOffset=date.getTimezoneOffset();var start=new Date(date.getFullYear(),0,1);var summerOffset=(new Date(date.getFullYear(),6,1)).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dstOffset=Math.min(winterOffset,summerOffset);if(dst<0){HEAP32[tmPtr+32>>2]=Number(summerOffset!=winterOffset&&dstOffset==guessedOffset)}else if(dst>0!=(dstOffset==guessedOffset)){var nonDstOffset=Math.max(winterOffset,summerOffset);var trueOffset=dst>0?dstOffset:nonDstOffset;date.setTime(date.getTime()+(trueOffset-guessedOffset)*6e4)}HEAP32[tmPtr+24>>2]=date.getDay();var yday=(date.getTime()-start.getTime())/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;return date.getTime()/1e3|0}function _usleep(useconds){var msec=useconds/1e3;if((ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&self["performance"]&&self["performance"]["now"]){var start=self["performance"]["now"]();while(self["performance"]["now"]()-start>2];var nanoseconds=HEAP32[rqtp+4>>2];if(rmtp!==0){HEAP32[rmtp>>2]=0;HEAP32[rmtp+4>>2]=0}return _usleep(seconds*1e6+nanoseconds/1e3)}function _pthread_cond_destroy(){return 0}function _pthread_cond_init(){return 0}function _pthread_cond_timedwait(){return 0}function _pthread_cond_wait(){return 0}var PTHREAD_SPECIFIC={};function _pthread_getspecific(key){return PTHREAD_SPECIFIC[key]||0}var PTHREAD_SPECIFIC_NEXT_KEY=1;function _pthread_key_create(key,destructor){if(key==0){return ERRNO_CODES.EINVAL}HEAP32[key>>2]=PTHREAD_SPECIFIC_NEXT_KEY;PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY]=0;PTHREAD_SPECIFIC_NEXT_KEY++;return 0}function _pthread_key_delete(key){if(key in PTHREAD_SPECIFIC){delete PTHREAD_SPECIFIC[key];return 0}return ERRNO_CODES.EINVAL}function _pthread_mutex_destroy(){}function _pthread_mutex_init(){}function _pthread_mutexattr_destroy(){}function _pthread_mutexattr_init(){}function _pthread_mutexattr_setprotocol(){}function _pthread_mutexattr_settype(){}function _pthread_once(ptr,func){if(!_pthread_once.seen)_pthread_once.seen={};if(ptr in _pthread_once.seen)return;Module["dynCall_v"](func);_pthread_once.seen[ptr]=1}function _pthread_setspecific(key,value){if(!(key in PTHREAD_SPECIFIC)){return ERRNO_CODES.EINVAL}PTHREAD_SPECIFIC[key]=value;return 0}function _sched_yield(){return 0}function _setenv(envname,envval,overwrite){if(envname===0){___setErrNo(ERRNO_CODES.EINVAL);return-1}var name=Pointer_stringify(envname);var val=Pointer_stringify(envval);if(name===""||name.indexOf("=")!==-1){___setErrNo(ERRNO_CODES.EINVAL);return-1}if(ENV.hasOwnProperty(name)&&!overwrite)return 0;ENV[name]=val;___buildEnvironment(__get_environ());return 0}function _sigaction(signum,act,oldact){return 0}function _sigemptyset(set){HEAP32[set>>2]=0;return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]);return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?Pointer_stringify(tm_zone):""};var pattern=Pointer_stringify(format);var EXPANSION_RULES_1={"%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"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":(function(date){return WEEKDAYS[date.tm_wday].substring(0,3)}),"%A":(function(date){return WEEKDAYS[date.tm_wday]}),"%b":(function(date){return MONTHS[date.tm_mon].substring(0,3)}),"%B":(function(date){return MONTHS[date.tm_mon]}),"%C":(function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)}),"%d":(function(date){return leadingNulls(date.tm_mday,2)}),"%e":(function(date){return leadingSomething(date.tm_mday,2," ")}),"%g":(function(date){return getWeekBasedYear(date).toString().substring(2)}),"%G":(function(date){return getWeekBasedYear(date)}),"%H":(function(date){return leadingNulls(date.tm_hour,2)}),"%I":(function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)}),"%j":(function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)}),"%m":(function(date){return leadingNulls(date.tm_mon+1,2)}),"%M":(function(date){return leadingNulls(date.tm_min,2)}),"%n":(function(){return"\n"}),"%p":(function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}}),"%S":(function(date){return leadingNulls(date.tm_sec,2)}),"%t":(function(){return"\t"}),"%u":(function(date){var day=new Date(date.tm_year+1900,date.tm_mon+1,date.tm_mday,0,0,0,0);return day.getDay()||7}),"%U":(function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"}),"%V":(function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)}),"%Z":(function(date){return date.tm_zone}),"%%":(function(){return"%"})};for(var rule in EXPANSION_RULES_2){if(pattern.indexOf(rule)>=0){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _sysconf(name){switch(name){case 30:return PAGE_SIZE;case 85:var maxHeapSize=2*1024*1024*1024-65536;return maxHeapSize/PAGE_SIZE;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:return 200809;case 79:return 0;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:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}___setErrNo(ERRNO_CODES.EINVAL);return-1}function _time(ptr){var ret=Date.now()/1e3|0;if(ptr){HEAP32[ptr>>2]=ret}return ret}function _unsetenv(name){if(name===0){___setErrNo(ERRNO_CODES.EINVAL);return-1}name=Pointer_stringify(name);if(name===""||name.indexOf("=")!==-1){___setErrNo(ERRNO_CODES.EINVAL);return-1}if(ENV.hasOwnProperty(name)){delete ENV[name];___buildEnvironment(__get_environ())}return 0}function _utime(path,times){var time;if(times){var offset=4;time=HEAP32[times+offset>>2];time*=1e3}else{time=Date.now()}path=Pointer_stringify(path);try{FS.utime(path,time,time);return 0}catch(e){FS.handleFSError(e);return-1}}FS.staticInit();__ATINIT__.unshift((function(){if(!Module["noFSInit"]&&!FS.init.initialized)FS.init()}));__ATMAIN__.push((function(){FS.ignorePermissions=false}));__ATEXIT__.push((function(){FS.quit()}));Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;__ATINIT__.unshift((function(){TTY.init()}));__ATEXIT__.push((function(){TTY.shutdown()}));if(ENVIRONMENT_IS_NODE){var fs=require("fs");var NODEJS_PATH=require("path");NODEFS.staticInit()}__ATINIT__.push((function(){SOCKFS.root=FS.mount(SOCKFS,{},null)}));__ATINIT__.push((function(){PIPEFS.root=FS.mount(PIPEFS,{},null)}));if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function _emscripten_get_now_actual(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else if(typeof self==="object"&&self["performance"]&&typeof self["performance"]["now"]==="function"){_emscripten_get_now=(function(){return self["performance"]["now"]()})}else if(typeof performance==="object"&&typeof performance["now"]==="function"){_emscripten_get_now=(function(){return performance["now"]()})}else{_emscripten_get_now=Date.now}Module["requestFullScreen"]=function Module_requestFullScreen(lockPointer,resizeCanvas,vrDevice){err("Module.requestFullScreen is deprecated. Please call Module.requestFullscreen instead.");Module["requestFullScreen"]=Module["requestFullscreen"];Browser.requestFullScreen(lockPointer,resizeCanvas,vrDevice)};Module["requestFullscreen"]=function Module_requestFullscreen(lockPointer,resizeCanvas,vrDevice){Browser.requestFullscreen(lockPointer,resizeCanvas,vrDevice)};Module["requestAnimationFrame"]=function Module_requestAnimationFrame(func){Browser.requestAnimationFrame(func)};Module["setCanvasSize"]=function Module_setCanvasSize(width,height,noUpdates){Browser.setCanvasSize(width,height,noUpdates)};Module["pauseMainLoop"]=function Module_pauseMainLoop(){Browser.mainLoop.pause()};Module["resumeMainLoop"]=function Module_resumeMainLoop(){Browser.mainLoop.resume()};Module["getUserMedia"]=function Module_getUserMedia(){Browser.getUserMedia()};Module["createContext"]=function Module_createContext(canvas,useWebGL,setInModule,webGLContextAttributes){return Browser.createContext(canvas,useWebGL,setInModule,webGLContextAttributes)};JSEvents.staticInit();var GLctx;GL.init();DYNAMICTOP_PTR=staticAlloc(4);STACK_BASE=STACKTOP=alignMemory(STATICTOP);STACK_MAX=STACK_BASE+TOTAL_STACK;DYNAMIC_BASE=alignMemory(STACK_MAX);HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;staticSealed=true;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}Module["wasmTableSize"]=57042;Module["wasmMaxTableSize"]=57042;function invoke_dddi(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_dddi"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ddi(index,a1,a2){var sp=stackSave();try{return Module["dynCall_ddi"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_dfi(index,a1,a2){var sp=stackSave();try{return Module["dynCall_dfi"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_di(index,a1){var sp=stackSave();try{return Module["dynCall_di"](index,a1)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_diddi(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_diddi"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_didi(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_didi"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_dii(index,a1,a2){var sp=stackSave();try{return Module["dynCall_dii"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_diii(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_diii"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_diiii(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_diiii"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_dji(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_dji"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_f(index){var sp=stackSave();try{return Module["dynCall_f"](index)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fdi(index,a1,a2){var sp=stackSave();try{return Module["dynCall_fdi"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ff(index,a1){var sp=stackSave();try{return Module["dynCall_ff"](index,a1)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fff(index,a1,a2){var sp=stackSave();try{return Module["dynCall_fff"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ffffi(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_ffffi"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fffi(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_fffi"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fffifffi(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return Module["dynCall_fffifffi"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ffi(index,a1,a2){var sp=stackSave();try{return Module["dynCall_ffi"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fi(index,a1){var sp=stackSave();try{return Module["dynCall_fi"](index,a1)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fif(index,a1,a2){var sp=stackSave();try{return Module["dynCall_fif"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiff(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_fiff"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiffi(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_fiffi"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fifi(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_fifi"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fifii(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_fifii"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fii(index,a1,a2){var sp=stackSave();try{return Module["dynCall_fii"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiif(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_fiif"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiifi(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_fiifi"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiifii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return Module["dynCall_fiifii"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_fiii"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_fiiii"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiiiif(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return Module["dynCall_fiiiif"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiiiiiifiifif(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12){var sp=stackSave();try{return Module["dynCall_fiiiiiifiifif"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiiiiiifiiiif(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12){var sp=stackSave();try{return Module["dynCall_fiiiiiifiiiif"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fji(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_fji"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_i(index){var sp=stackSave();try{return Module["dynCall_i"](index)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_idi(index,a1,a2){var sp=stackSave();try{return Module["dynCall_idi"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_idiii(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_idiii"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ifffi(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_ifffi"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iffi(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_iffi"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ifi(index,a1,a2){var sp=stackSave();try{return Module["dynCall_ifi"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ifiii(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_ifiii"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ii(index,a1){var sp=stackSave();try{return Module["dynCall_ii"](index,a1)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iidi(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_iidi"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iidii(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_iidii"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iif(index,a1,a2){var sp=stackSave();try{return Module["dynCall_iif"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iifff(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_iifff"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iifffi(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return Module["dynCall_iifffi"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiffi(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_iiffi"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiffiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return Module["dynCall_iiffiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iifi(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_iifi"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iifii(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_iifii"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iifiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return Module["dynCall_iifiii"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iifiiiijii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{return Module["dynCall_iifiiiijii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return Module["dynCall_iii"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiif(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_iiif"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiff(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_iiiff"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiifi(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_iiifi"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiifii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return Module["dynCall_iiifii"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiifiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return Module["dynCall_iiifiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiifiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return Module["dynCall_iiifiiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_iiii"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiifffffi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{return Module["dynCall_iiiifffffi"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiifffffii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{return Module["dynCall_iiiifffffii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiifffiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{return Module["dynCall_iiiifffiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiifi(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return Module["dynCall_iiiifi"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiifii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return Module["dynCall_iiiifii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiifiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return Module["dynCall_iiiifiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiifiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{return Module["dynCall_iiiifiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiifiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{return Module["dynCall_iiiifiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_iiiii"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiifi(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return Module["dynCall_iiiiifi"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiifiii(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{return Module["dynCall_iiiiifiii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiifiiiiif(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return Module["dynCall_iiiiifiiiiif"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return Module["dynCall_iiiiii"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiifff(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{return Module["dynCall_iiiiiifff"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiifffiiifiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{return Module["dynCall_iiiiiifffiiifiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiffiiiiiiiiiffffiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23){var sp=stackSave();try{return Module["dynCall_iiiiiiffiiiiiiiiiffffiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiffiiiiiiiiiffffiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24){var sp=stackSave();try{return Module["dynCall_iiiiiiffiiiiiiiiiffffiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiffiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22){var sp=stackSave();try{return Module["dynCall_iiiiiiffiiiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiifiif(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{return Module["dynCall_iiiiiifiif"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiifiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{return Module["dynCall_iiiiiifiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return Module["dynCall_iiiiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiifiif(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{return Module["dynCall_iiiiiiifiif"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return Module["dynCall_iiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{return Module["dynCall_iiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{return Module["dynCall_iiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{return Module["dynCall_iiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return Module["dynCall_iiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12){var sp=stackSave();try{return Module["dynCall_iiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13){var sp=stackSave();try{return Module["dynCall_iiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiijjiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13){var sp=stackSave();try{return Module["dynCall_iiiiiiijjiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiijjiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12){var sp=stackSave();try{return Module["dynCall_iiiiiijjiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiij(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return Module["dynCall_iiiiij"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiji(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return Module["dynCall_iiiiiji"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiij(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return Module["dynCall_iiiij"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiji(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return Module["dynCall_iiiiji"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiijii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return Module["dynCall_iiiijii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiijiii(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{return Module["dynCall_iiiijiii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiij(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_iiij"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiji(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return Module["dynCall_iiiji"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiijii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return Module["dynCall_iiijii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiijiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return Module["dynCall_iiijiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiijji(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return Module["dynCall_iiijji"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iij(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_iij"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiji(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_iiji"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iijii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return Module["dynCall_iijii"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iijiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return Module["dynCall_iijiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iijiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return Module["dynCall_iijiiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iijiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{return Module["dynCall_iijiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iijji(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return Module["dynCall_iijji"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iijjii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return Module["dynCall_iijjii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iijjiii(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{return Module["dynCall_iijjiii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iijjji(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{return Module["dynCall_iijjji"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ij(index,a1,a2){var sp=stackSave();try{return Module["dynCall_ij"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iji(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_iji"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ijiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return Module["dynCall_ijiii"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ijj(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_ijj"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ijji(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return Module["dynCall_ijji"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_j(index){var sp=stackSave();try{return Module["dynCall_j"](index)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jdi(index,a1,a2){var sp=stackSave();try{return Module["dynCall_jdi"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jdii(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_jdii"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jfi(index,a1,a2){var sp=stackSave();try{return Module["dynCall_jfi"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ji(index,a1){var sp=stackSave();try{return Module["dynCall_ji"](index,a1)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jidi(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_jidi"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jidii(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_jidii"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jii(index,a1,a2){var sp=stackSave();try{return Module["dynCall_jii"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jiii(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_jiii"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_jiiii"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return Module["dynCall_jiiiii"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return Module["dynCall_jiiiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{return Module["dynCall_jiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jiiji(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return Module["dynCall_jiiji"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jiji(index,a1,a2,a3,a4){var sp=stackSave();try{return Module["dynCall_jiji"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jijii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return Module["dynCall_jijii"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jijiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return Module["dynCall_jijiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jijj(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return Module["dynCall_jijj"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jijji(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return Module["dynCall_jijji"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jji(index,a1,a2,a3){var sp=stackSave();try{return Module["dynCall_jji"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_v(index){var sp=stackSave();try{Module["dynCall_v"](index)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vd(index,a1){var sp=stackSave();try{Module["dynCall_vd"](index,a1)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vf(index,a1){var sp=stackSave();try{Module["dynCall_vf"](index,a1)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vff(index,a1,a2){var sp=stackSave();try{Module["dynCall_vff"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vfff(index,a1,a2,a3){var sp=stackSave();try{Module["dynCall_vfff"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vffff(index,a1,a2,a3,a4){var sp=stackSave();try{Module["dynCall_vffff"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vffffi(index,a1,a2,a3,a4,a5){var sp=stackSave();try{Module["dynCall_vffffi"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vfffi(index,a1,a2,a3,a4){var sp=stackSave();try{Module["dynCall_vfffi"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vfi(index,a1,a2){var sp=stackSave();try{Module["dynCall_vfi"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{Module["dynCall_vi"](index,a1)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vid(index,a1,a2){var sp=stackSave();try{Module["dynCall_vid"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vidd(index,a1,a2,a3){var sp=stackSave();try{Module["dynCall_vidd"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vidi(index,a1,a2,a3){var sp=stackSave();try{Module["dynCall_vidi"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vif(index,a1,a2){var sp=stackSave();try{Module["dynCall_vif"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viff(index,a1,a2,a3){var sp=stackSave();try{Module["dynCall_viff"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vifff(index,a1,a2,a3,a4){var sp=stackSave();try{Module["dynCall_vifff"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viffff(index,a1,a2,a3,a4,a5){var sp=stackSave();try{Module["dynCall_viffff"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viffffi(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_viffffi"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viffffii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{Module["dynCall_viffffii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viffffiifffiiiiif(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16){var sp=stackSave();try{Module["dynCall_viffffiifffiiiiif"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vifffi(index,a1,a2,a3,a4,a5){var sp=stackSave();try{Module["dynCall_vifffi"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vifffii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_vifffii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viffi(index,a1,a2,a3,a4){var sp=stackSave();try{Module["dynCall_viffi"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viffii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{Module["dynCall_viffii"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viffiifffffiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13){var sp=stackSave();try{Module["dynCall_viffiifffffiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viffiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_viffiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viffiiiif(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{Module["dynCall_viffiiiif"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vifi(index,a1,a2,a3){var sp=stackSave();try{Module["dynCall_vifi"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vifii(index,a1,a2,a3,a4){var sp=stackSave();try{Module["dynCall_vifii"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vifiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_vifiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vifijii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{Module["dynCall_vifijii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{Module["dynCall_vii"](index,a1,a2)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viid(index,a1,a2,a3){var sp=stackSave();try{Module["dynCall_viid"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viidi(index,a1,a2,a3,a4){var sp=stackSave();try{Module["dynCall_viidi"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viidii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{Module["dynCall_viidii"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viif(index,a1,a2,a3){var sp=stackSave();try{Module["dynCall_viif"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiff(index,a1,a2,a3,a4){var sp=stackSave();try{Module["dynCall_viiff"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viifff(index,a1,a2,a3,a4,a5){var sp=stackSave();try{Module["dynCall_viifff"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viifffi(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_viifffi"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiffi(index,a1,a2,a3,a4,a5){var sp=stackSave();try{Module["dynCall_viiffi"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiffii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_viiffii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viifi(index,a1,a2,a3,a4){var sp=stackSave();try{Module["dynCall_viifi"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viifii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{Module["dynCall_viifii"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viifiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_viifiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viifiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{Module["dynCall_viifiiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{Module["dynCall_viii"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiidi(index,a1,a2,a3,a4,a5){var sp=stackSave();try{Module["dynCall_viiidi"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiif(index,a1,a2,a3,a4){var sp=stackSave();try{Module["dynCall_viiif"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiifffi(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{Module["dynCall_viiifffi"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiffi(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_viiiffi"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiffii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{Module["dynCall_viiiffii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiifi(index,a1,a2,a3,a4,a5){var sp=stackSave();try{Module["dynCall_viiifi"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiififfi(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{Module["dynCall_viiififfi"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiififi(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{Module["dynCall_viiififi"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiifii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_viiifii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiifiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{Module["dynCall_viiifiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiifiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{Module["dynCall_viiifiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{Module["dynCall_viiii"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiif(index,a1,a2,a3,a4,a5){var sp=stackSave();try{Module["dynCall_viiiif"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiifi(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_viiiifi"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiifii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{Module["dynCall_viiiifii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiifiiiiif(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{Module["dynCall_viiiifiiiiif"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{Module["dynCall_viiiii"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiif(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_viiiiif"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiffi(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{Module["dynCall_viiiiiffi"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiffii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{Module["dynCall_viiiiiffii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiifi(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{Module["dynCall_viiiiifi"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_viiiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiif(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{Module["dynCall_viiiiiif"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{Module["dynCall_viiiiiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiifi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{Module["dynCall_viiiiiiifi"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{Module["dynCall_viiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{Module["dynCall_viiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{Module["dynCall_viiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{Module["dynCall_viiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiiifii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14){var sp=stackSave();try{Module["dynCall_viiiiiiiiiiifii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12){var sp=stackSave();try{Module["dynCall_viiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13){var sp=stackSave();try{Module["dynCall_viiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14){var sp=stackSave();try{Module["dynCall_viiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{Module["dynCall_viiiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18){var sp=stackSave();try{Module["dynCall_viiiiiiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiij(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_viiiij"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiijiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{Module["dynCall_viiiijiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiijjiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{Module["dynCall_viiiijjiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiji(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_viiiji"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiijji(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{Module["dynCall_viiijji"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiijjii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{Module["dynCall_viiijjii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiijjiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{Module["dynCall_viiijjiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viij(index,a1,a2,a3,a4){var sp=stackSave();try{Module["dynCall_viij"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiji(index,a1,a2,a3,a4,a5){var sp=stackSave();try{Module["dynCall_viiji"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_viijii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijiijiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{Module["dynCall_viijiijiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijijii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{Module["dynCall_viijijii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijijiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{Module["dynCall_viijijiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijijj(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{Module["dynCall_viijijj"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijj(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_viijj"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijji(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{Module["dynCall_viijji"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijjii(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{Module["dynCall_viijjii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijjiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{Module["dynCall_viijjiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijjji(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{Module["dynCall_viijjji"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vij(index,a1,a2,a3){var sp=stackSave();try{Module["dynCall_vij"](index,a1,a2,a3)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viji(index,a1,a2,a3,a4){var sp=stackSave();try{Module["dynCall_viji"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vijii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{Module["dynCall_vijii"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vijiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_vijiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vijiji(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{Module["dynCall_vijiji"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vijijji(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{Module["dynCall_vijijji"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vijji(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_vijji"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vijjii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{Module["dynCall_vijjii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vjii(index,a1,a2,a3,a4){var sp=stackSave();try{Module["dynCall_vjii"](index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vjiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{Module["dynCall_vjiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vjji(index,a1,a2,a3,a4,a5){var sp=stackSave();try{Module["dynCall_vjji"](index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}Module.asmGlobalArg={};Module.asmLibraryArg={"abort":abort,"assert":assert,"enlargeMemory":enlargeMemory,"getTotalMemory":getTotalMemory,"abortOnCannotGrowMemory":abortOnCannotGrowMemory,"invoke_dddi":invoke_dddi,"invoke_ddi":invoke_ddi,"invoke_dfi":invoke_dfi,"invoke_di":invoke_di,"invoke_diddi":invoke_diddi,"invoke_didi":invoke_didi,"invoke_dii":invoke_dii,"invoke_diii":invoke_diii,"invoke_diiii":invoke_diiii,"invoke_dji":invoke_dji,"invoke_f":invoke_f,"invoke_fdi":invoke_fdi,"invoke_ff":invoke_ff,"invoke_fff":invoke_fff,"invoke_ffffi":invoke_ffffi,"invoke_fffi":invoke_fffi,"invoke_fffifffi":invoke_fffifffi,"invoke_ffi":invoke_ffi,"invoke_fi":invoke_fi,"invoke_fif":invoke_fif,"invoke_fiff":invoke_fiff,"invoke_fiffi":invoke_fiffi,"invoke_fifi":invoke_fifi,"invoke_fifii":invoke_fifii,"invoke_fii":invoke_fii,"invoke_fiif":invoke_fiif,"invoke_fiifi":invoke_fiifi,"invoke_fiifii":invoke_fiifii,"invoke_fiii":invoke_fiii,"invoke_fiiii":invoke_fiiii,"invoke_fiiiif":invoke_fiiiif,"invoke_fiiiiiifiifif":invoke_fiiiiiifiifif,"invoke_fiiiiiifiiiif":invoke_fiiiiiifiiiif,"invoke_fji":invoke_fji,"invoke_i":invoke_i,"invoke_idi":invoke_idi,"invoke_idiii":invoke_idiii,"invoke_ifffi":invoke_ifffi,"invoke_iffi":invoke_iffi,"invoke_ifi":invoke_ifi,"invoke_ifiii":invoke_ifiii,"invoke_ii":invoke_ii,"invoke_iidi":invoke_iidi,"invoke_iidii":invoke_iidii,"invoke_iif":invoke_iif,"invoke_iifff":invoke_iifff,"invoke_iifffi":invoke_iifffi,"invoke_iiffi":invoke_iiffi,"invoke_iiffiii":invoke_iiffiii,"invoke_iifi":invoke_iifi,"invoke_iifii":invoke_iifii,"invoke_iifiii":invoke_iifiii,"invoke_iifiiiijii":invoke_iifiiiijii,"invoke_iii":invoke_iii,"invoke_iiif":invoke_iiif,"invoke_iiiff":invoke_iiiff,"invoke_iiifi":invoke_iiifi,"invoke_iiifii":invoke_iiifii,"invoke_iiifiii":invoke_iiifiii,"invoke_iiifiiii":invoke_iiifiiii,"invoke_iiii":invoke_iiii,"invoke_iiiifffffi":invoke_iiiifffffi,"invoke_iiiifffffii":invoke_iiiifffffii,"invoke_iiiifffiii":invoke_iiiifffiii,"invoke_iiiifi":invoke_iiiifi,"invoke_iiiifii":invoke_iiiifii,"invoke_iiiifiii":invoke_iiiifiii,"invoke_iiiifiiii":invoke_iiiifiiii,"invoke_iiiifiiiii":invoke_iiiifiiiii,"invoke_iiiii":invoke_iiiii,"invoke_iiiiifi":invoke_iiiiifi,"invoke_iiiiifiii":invoke_iiiiifiii,"invoke_iiiiifiiiiif":invoke_iiiiifiiiiif,"invoke_iiiiii":invoke_iiiiii,"invoke_iiiiiifff":invoke_iiiiiifff,"invoke_iiiiiifffiiifiii":invoke_iiiiiifffiiifiii,"invoke_iiiiiiffiiiiiiiiiffffiii":invoke_iiiiiiffiiiiiiiiiffffiii,"invoke_iiiiiiffiiiiiiiiiffffiiii":invoke_iiiiiiffiiiiiiiiiffffiiii,"invoke_iiiiiiffiiiiiiiiiiiiiii":invoke_iiiiiiffiiiiiiiiiiiiiii,"invoke_iiiiiifiif":invoke_iiiiiifiif,"invoke_iiiiiifiii":invoke_iiiiiifiii,"invoke_iiiiiii":invoke_iiiiiii,"invoke_iiiiiiifiif":invoke_iiiiiiifiif,"invoke_iiiiiiii":invoke_iiiiiiii,"invoke_iiiiiiiii":invoke_iiiiiiiii,"invoke_iiiiiiiiii":invoke_iiiiiiiiii,"invoke_iiiiiiiiiii":invoke_iiiiiiiiiii,"invoke_iiiiiiiiiiii":invoke_iiiiiiiiiiii,"invoke_iiiiiiiiiiiii":invoke_iiiiiiiiiiiii,"invoke_iiiiiiiiiiiiii":invoke_iiiiiiiiiiiiii,"invoke_iiiiiiijjiii":invoke_iiiiiiijjiii,"invoke_iiiiiijjiii":invoke_iiiiiijjiii,"invoke_iiiiij":invoke_iiiiij,"invoke_iiiiiji":invoke_iiiiiji,"invoke_iiiij":invoke_iiiij,"invoke_iiiiji":invoke_iiiiji,"invoke_iiiijii":invoke_iiiijii,"invoke_iiiijiii":invoke_iiiijiii,"invoke_iiij":invoke_iiij,"invoke_iiiji":invoke_iiiji,"invoke_iiijii":invoke_iiijii,"invoke_iiijiii":invoke_iiijiii,"invoke_iiijji":invoke_iiijji,"invoke_iij":invoke_iij,"invoke_iiji":invoke_iiji,"invoke_iijii":invoke_iijii,"invoke_iijiii":invoke_iijiii,"invoke_iijiiii":invoke_iijiiii,"invoke_iijiiiiiii":invoke_iijiiiiiii,"invoke_iijji":invoke_iijji,"invoke_iijjii":invoke_iijjii,"invoke_iijjiii":invoke_iijjiii,"invoke_iijjji":invoke_iijjji,"invoke_ij":invoke_ij,"invoke_iji":invoke_iji,"invoke_ijiii":invoke_ijiii,"invoke_ijj":invoke_ijj,"invoke_ijji":invoke_ijji,"invoke_j":invoke_j,"invoke_jdi":invoke_jdi,"invoke_jdii":invoke_jdii,"invoke_jfi":invoke_jfi,"invoke_ji":invoke_ji,"invoke_jidi":invoke_jidi,"invoke_jidii":invoke_jidii,"invoke_jii":invoke_jii,"invoke_jiii":invoke_jiii,"invoke_jiiii":invoke_jiiii,"invoke_jiiiii":invoke_jiiiii,"invoke_jiiiiii":invoke_jiiiiii,"invoke_jiiiiiiiiii":invoke_jiiiiiiiiii,"invoke_jiiji":invoke_jiiji,"invoke_jiji":invoke_jiji,"invoke_jijii":invoke_jijii,"invoke_jijiii":invoke_jijiii,"invoke_jijj":invoke_jijj,"invoke_jijji":invoke_jijji,"invoke_jji":invoke_jji,"invoke_v":invoke_v,"invoke_vd":invoke_vd,"invoke_vf":invoke_vf,"invoke_vff":invoke_vff,"invoke_vfff":invoke_vfff,"invoke_vffff":invoke_vffff,"invoke_vffffi":invoke_vffffi,"invoke_vfffi":invoke_vfffi,"invoke_vfi":invoke_vfi,"invoke_vi":invoke_vi,"invoke_vid":invoke_vid,"invoke_vidd":invoke_vidd,"invoke_vidi":invoke_vidi,"invoke_vif":invoke_vif,"invoke_viff":invoke_viff,"invoke_vifff":invoke_vifff,"invoke_viffff":invoke_viffff,"invoke_viffffi":invoke_viffffi,"invoke_viffffii":invoke_viffffii,"invoke_viffffiifffiiiiif":invoke_viffffiifffiiiiif,"invoke_vifffi":invoke_vifffi,"invoke_vifffii":invoke_vifffii,"invoke_viffi":invoke_viffi,"invoke_viffii":invoke_viffii,"invoke_viffiifffffiii":invoke_viffiifffffiii,"invoke_viffiii":invoke_viffiii,"invoke_viffiiiif":invoke_viffiiiif,"invoke_vifi":invoke_vifi,"invoke_vifii":invoke_vifii,"invoke_vifiiii":invoke_vifiiii,"invoke_vifijii":invoke_vifijii,"invoke_vii":invoke_vii,"invoke_viid":invoke_viid,"invoke_viidi":invoke_viidi,"invoke_viidii":invoke_viidii,"invoke_viif":invoke_viif,"invoke_viiff":invoke_viiff,"invoke_viifff":invoke_viifff,"invoke_viifffi":invoke_viifffi,"invoke_viiffi":invoke_viiffi,"invoke_viiffii":invoke_viiffii,"invoke_viifi":invoke_viifi,"invoke_viifii":invoke_viifii,"invoke_viifiii":invoke_viifiii,"invoke_viifiiii":invoke_viifiiii,"invoke_viii":invoke_viii,"invoke_viiidi":invoke_viiidi,"invoke_viiif":invoke_viiif,"invoke_viiifffi":invoke_viiifffi,"invoke_viiiffi":invoke_viiiffi,"invoke_viiiffii":invoke_viiiffii,"invoke_viiifi":invoke_viiifi,"invoke_viiififfi":invoke_viiififfi,"invoke_viiififi":invoke_viiififi,"invoke_viiifii":invoke_viiifii,"invoke_viiifiii":invoke_viiifiii,"invoke_viiifiiiii":invoke_viiifiiiii,"invoke_viiii":invoke_viiii,"invoke_viiiif":invoke_viiiif,"invoke_viiiifi":invoke_viiiifi,"invoke_viiiifii":invoke_viiiifii,"invoke_viiiifiiiiif":invoke_viiiifiiiiif,"invoke_viiiii":invoke_viiiii,"invoke_viiiiif":invoke_viiiiif,"invoke_viiiiiffi":invoke_viiiiiffi,"invoke_viiiiiffii":invoke_viiiiiffii,"invoke_viiiiifi":invoke_viiiiifi,"invoke_viiiiii":invoke_viiiiii,"invoke_viiiiiif":invoke_viiiiiif,"invoke_viiiiiii":invoke_viiiiiii,"invoke_viiiiiiifi":invoke_viiiiiiifi,"invoke_viiiiiiii":invoke_viiiiiiii,"invoke_viiiiiiiii":invoke_viiiiiiiii,"invoke_viiiiiiiiii":invoke_viiiiiiiiii,"invoke_viiiiiiiiiii":invoke_viiiiiiiiiii,"invoke_viiiiiiiiiiifii":invoke_viiiiiiiiiiifii,"invoke_viiiiiiiiiiii":invoke_viiiiiiiiiiii,"invoke_viiiiiiiiiiiii":invoke_viiiiiiiiiiiii,"invoke_viiiiiiiiiiiiii":invoke_viiiiiiiiiiiiii,"invoke_viiiiiiiiiiiiiii":invoke_viiiiiiiiiiiiiii,"invoke_viiiiiiiiiiiiiiiiii":invoke_viiiiiiiiiiiiiiiiii,"invoke_viiiij":invoke_viiiij,"invoke_viiiijiiii":invoke_viiiijiiii,"invoke_viiiijjiii":invoke_viiiijjiii,"invoke_viiiji":invoke_viiiji,"invoke_viiijji":invoke_viiijji,"invoke_viiijjii":invoke_viiijjii,"invoke_viiijjiii":invoke_viiijjiii,"invoke_viij":invoke_viij,"invoke_viiji":invoke_viiji,"invoke_viijii":invoke_viijii,"invoke_viijiijiii":invoke_viijiijiii,"invoke_viijijii":invoke_viijijii,"invoke_viijijiii":invoke_viijijiii,"invoke_viijijj":invoke_viijijj,"invoke_viijj":invoke_viijj,"invoke_viijji":invoke_viijji,"invoke_viijjii":invoke_viijjii,"invoke_viijjiii":invoke_viijjiii,"invoke_viijjji":invoke_viijjji,"invoke_vij":invoke_vij,"invoke_viji":invoke_viji,"invoke_vijii":invoke_vijii,"invoke_vijiii":invoke_vijiii,"invoke_vijiji":invoke_vijiji,"invoke_vijijji":invoke_vijijji,"invoke_vijji":invoke_vijji,"invoke_vijjii":invoke_vijjii,"invoke_vjii":invoke_vjii,"invoke_vjiiii":invoke_vjiiii,"invoke_vjji":invoke_vjji,"_GetFileName":_GetFileName,"_JS_Cursor_SetImage":_JS_Cursor_SetImage,"_JS_Cursor_SetShow":_JS_Cursor_SetShow,"_JS_Eval_ClearInterval":_JS_Eval_ClearInterval,"_JS_Eval_SetInterval":_JS_Eval_SetInterval,"_JS_FileSystem_Initialize":_JS_FileSystem_Initialize,"_JS_FileSystem_Sync":_JS_FileSystem_Sync,"_JS_Log_Dump":_JS_Log_Dump,"_JS_Log_StackTrace":_JS_Log_StackTrace,"_JS_Sound_Create_Channel":_JS_Sound_Create_Channel,"_JS_Sound_GetLength":_JS_Sound_GetLength,"_JS_Sound_GetLoadState":_JS_Sound_GetLoadState,"_JS_Sound_Init":_JS_Sound_Init,"_JS_Sound_Load":_JS_Sound_Load,"_JS_Sound_Load_PCM":_JS_Sound_Load_PCM,"_JS_Sound_Play":_JS_Sound_Play,"_JS_Sound_ReleaseInstance":_JS_Sound_ReleaseInstance,"_JS_Sound_ResumeIfNeeded":_JS_Sound_ResumeIfNeeded,"_JS_Sound_Set3D":_JS_Sound_Set3D,"_JS_Sound_SetListenerOrientation":_JS_Sound_SetListenerOrientation,"_JS_Sound_SetListenerPosition":_JS_Sound_SetListenerPosition,"_JS_Sound_SetLoop":_JS_Sound_SetLoop,"_JS_Sound_SetLoopPoints":_JS_Sound_SetLoopPoints,"_JS_Sound_SetPitch":_JS_Sound_SetPitch,"_JS_Sound_SetPosition":_JS_Sound_SetPosition,"_JS_Sound_SetVolume":_JS_Sound_SetVolume,"_JS_Sound_Stop":_JS_Sound_Stop,"_JS_SystemInfo_GetCanvasClientSize":_JS_SystemInfo_GetCanvasClientSize,"_JS_SystemInfo_GetDocumentURL":_JS_SystemInfo_GetDocumentURL,"_JS_SystemInfo_GetGPUInfo":_JS_SystemInfo_GetGPUInfo,"_JS_SystemInfo_GetMatchWebGLToCanvasSize":_JS_SystemInfo_GetMatchWebGLToCanvasSize,"_JS_SystemInfo_GetMemory":_JS_SystemInfo_GetMemory,"_JS_SystemInfo_GetOS":_JS_SystemInfo_GetOS,"_JS_SystemInfo_GetPreferredDevicePixelRatio":_JS_SystemInfo_GetPreferredDevicePixelRatio,"_JS_SystemInfo_GetScreenSize":_JS_SystemInfo_GetScreenSize,"_JS_SystemInfo_HasCursorLock":_JS_SystemInfo_HasCursorLock,"_JS_SystemInfo_HasFullscreen":_JS_SystemInfo_HasFullscreen,"_JS_SystemInfo_HasWebGL":_JS_SystemInfo_HasWebGL,"_JS_UNETWebSockets_AddHost":_JS_UNETWebSockets_AddHost,"_JS_UNETWebSockets_HostsContainingMessagesCleanHost":_JS_UNETWebSockets_HostsContainingMessagesCleanHost,"_JS_UNETWebSockets_HostsContainingMessagesPush":_JS_UNETWebSockets_HostsContainingMessagesPush,"_JS_UNETWebSockets_Init":_JS_UNETWebSockets_Init,"_JS_UNETWebSockets_IsHostCorrect":_JS_UNETWebSockets_IsHostCorrect,"_JS_UNETWebSockets_IsHostReadyToConnect":_JS_UNETWebSockets_IsHostReadyToConnect,"_JS_UNETWebSockets_SocketCleanEvnt":_JS_UNETWebSockets_SocketCleanEvnt,"_JS_UNETWebSockets_SocketCleanEvntFromHost":_JS_UNETWebSockets_SocketCleanEvntFromHost,"_JS_UNETWebSockets_SocketClose":_JS_UNETWebSockets_SocketClose,"_JS_UNETWebSockets_SocketCreate":_JS_UNETWebSockets_SocketCreate,"_JS_UNETWebSockets_SocketRecvEvntBuff":_JS_UNETWebSockets_SocketRecvEvntBuff,"_JS_UNETWebSockets_SocketRecvEvntBuffFromHost":_JS_UNETWebSockets_SocketRecvEvntBuffFromHost,"_JS_UNETWebSockets_SocketRecvEvntBuffLength":_JS_UNETWebSockets_SocketRecvEvntBuffLength,"_JS_UNETWebSockets_SocketRecvEvntBuffLengthFromHost":_JS_UNETWebSockets_SocketRecvEvntBuffLengthFromHost,"_JS_UNETWebSockets_SocketRecvEvntHost":_JS_UNETWebSockets_SocketRecvEvntHost,"_JS_UNETWebSockets_SocketRecvEvntType":_JS_UNETWebSockets_SocketRecvEvntType,"_JS_UNETWebSockets_SocketRecvEvntTypeFromHost":_JS_UNETWebSockets_SocketRecvEvntTypeFromHost,"_JS_UNETWebSockets_SocketSend":_JS_UNETWebSockets_SocketSend,"_JS_UNETWebSockets_SocketStop":_JS_UNETWebSockets_SocketStop,"_JS_WebRequest_Abort":_JS_WebRequest_Abort,"_JS_WebRequest_Create":_JS_WebRequest_Create,"_JS_WebRequest_GetResponseHeaders":_JS_WebRequest_GetResponseHeaders,"_JS_WebRequest_Release":_JS_WebRequest_Release,"_JS_WebRequest_Send":_JS_WebRequest_Send,"_JS_WebRequest_SetProgressHandler":_JS_WebRequest_SetProgressHandler,"_JS_WebRequest_SetRequestHeader":_JS_WebRequest_SetRequestHeader,"_JS_WebRequest_SetResponseHandler":_JS_WebRequest_SetResponseHandler,"_JS_WebRequest_SetTimeout":_JS_WebRequest_SetTimeout,"__ZSt18uncaught_exceptionv":__ZSt18uncaught_exceptionv,"___atomic_compare_exchange_8":___atomic_compare_exchange_8,"___atomic_fetch_add_8":___atomic_fetch_add_8,"___buildEnvironment":___buildEnvironment,"___cxa_allocate_exception":___cxa_allocate_exception,"___cxa_begin_catch":___cxa_begin_catch,"___cxa_end_catch":___cxa_end_catch,"___cxa_find_matching_catch":___cxa_find_matching_catch,"___cxa_find_matching_catch_2":___cxa_find_matching_catch_2,"___cxa_find_matching_catch_3":___cxa_find_matching_catch_3,"___cxa_find_matching_catch_4":___cxa_find_matching_catch_4,"___cxa_free_exception":___cxa_free_exception,"___cxa_pure_virtual":___cxa_pure_virtual,"___cxa_rethrow":___cxa_rethrow,"___cxa_throw":___cxa_throw,"___gxx_personality_v0":___gxx_personality_v0,"___lock":___lock,"___map_file":___map_file,"___resumeException":___resumeException,"___setErrNo":___setErrNo,"___syscall10":___syscall10,"___syscall102":___syscall102,"___syscall122":___syscall122,"___syscall140":___syscall140,"___syscall142":___syscall142,"___syscall145":___syscall145,"___syscall146":___syscall146,"___syscall15":___syscall15,"___syscall168":___syscall168,"___syscall183":___syscall183,"___syscall192":___syscall192,"___syscall193":___syscall193,"___syscall195":___syscall195,"___syscall196":___syscall196,"___syscall197":___syscall197,"___syscall199":___syscall199,"___syscall202":___syscall202,"___syscall220":___syscall220,"___syscall221":___syscall221,"___syscall268":___syscall268,"___syscall3":___syscall3,"___syscall33":___syscall33,"___syscall38":___syscall38,"___syscall39":___syscall39,"___syscall4":___syscall4,"___syscall40":___syscall40,"___syscall42":___syscall42,"___syscall5":___syscall5,"___syscall54":___syscall54,"___syscall6":___syscall6,"___syscall63":___syscall63,"___syscall77":___syscall77,"___syscall85":___syscall85,"___syscall91":___syscall91,"___unlock":___unlock,"__addDays":__addDays,"__arraySum":__arraySum,"__emscripten_do_request_fullscreen":__emscripten_do_request_fullscreen,"__emscripten_sample_gamepad_data":__emscripten_sample_gamepad_data,"__emscripten_traverse_stack":__emscripten_traverse_stack,"__exit":__exit,"__formatString":__formatString,"__inet_ntop4_raw":__inet_ntop4_raw,"__inet_ntop6_raw":__inet_ntop6_raw,"__inet_pton4_raw":__inet_pton4_raw,"__inet_pton6_raw":__inet_pton6_raw,"__isLeapYear":__isLeapYear,"__read_sockaddr":__read_sockaddr,"__reallyNegative":__reallyNegative,"__setLetterbox":__setLetterbox,"__write_sockaddr":__write_sockaddr,"_abort":_abort,"_atexit":_atexit,"_clock":_clock,"_clock_getres":_clock_getres,"_clock_gettime":_clock_gettime,"_difftime":_difftime,"_dlclose":_dlclose,"_dlopen":_dlopen,"_dlsym":_dlsym,"_emscripten_asm_const_i":_emscripten_asm_const_i,"_emscripten_asm_const_ii":_emscripten_asm_const_ii,"_emscripten_asm_const_sync_on_main_thread_i":_emscripten_asm_const_sync_on_main_thread_i,"_emscripten_cancel_main_loop":_emscripten_cancel_main_loop,"_emscripten_exit_fullscreen":_emscripten_exit_fullscreen,"_emscripten_exit_pointerlock":_emscripten_exit_pointerlock,"_emscripten_get_callstack_js":_emscripten_get_callstack_js,"_emscripten_get_canvas_element_size":_emscripten_get_canvas_element_size,"_emscripten_get_canvas_element_size_calling_thread":_emscripten_get_canvas_element_size_calling_thread,"_emscripten_get_canvas_element_size_main_thread":_emscripten_get_canvas_element_size_main_thread,"_emscripten_get_fullscreen_status":_emscripten_get_fullscreen_status,"_emscripten_get_gamepad_status":_emscripten_get_gamepad_status,"_emscripten_get_main_loop_timing":_emscripten_get_main_loop_timing,"_emscripten_get_now":_emscripten_get_now,"_emscripten_get_now_is_monotonic":_emscripten_get_now_is_monotonic,"_emscripten_get_now_res":_emscripten_get_now_res,"_emscripten_get_num_gamepads":_emscripten_get_num_gamepads,"_emscripten_has_threading_support":_emscripten_has_threading_support,"_emscripten_html5_remove_all_event_listeners":_emscripten_html5_remove_all_event_listeners,"_emscripten_is_webgl_context_lost":_emscripten_is_webgl_context_lost,"_emscripten_log":_emscripten_log,"_emscripten_log_js":_emscripten_log_js,"_emscripten_longjmp":_emscripten_longjmp,"_emscripten_memcpy_big":_emscripten_memcpy_big,"_emscripten_num_logical_cores":_emscripten_num_logical_cores,"_emscripten_request_fullscreen":_emscripten_request_fullscreen,"_emscripten_request_pointerlock":_emscripten_request_pointerlock,"_emscripten_set_blur_callback_on_thread":_emscripten_set_blur_callback_on_thread,"_emscripten_set_canvas_element_size":_emscripten_set_canvas_element_size,"_emscripten_set_canvas_element_size_calling_thread":_emscripten_set_canvas_element_size_calling_thread,"_emscripten_set_canvas_element_size_main_thread":_emscripten_set_canvas_element_size_main_thread,"_emscripten_set_dblclick_callback_on_thread":_emscripten_set_dblclick_callback_on_thread,"_emscripten_set_devicemotion_callback_on_thread":_emscripten_set_devicemotion_callback_on_thread,"_emscripten_set_deviceorientation_callback_on_thread":_emscripten_set_deviceorientation_callback_on_thread,"_emscripten_set_focus_callback_on_thread":_emscripten_set_focus_callback_on_thread,"_emscripten_set_fullscreenchange_callback_on_thread":_emscripten_set_fullscreenchange_callback_on_thread,"_emscripten_set_gamepadconnected_callback_on_thread":_emscripten_set_gamepadconnected_callback_on_thread,"_emscripten_set_gamepaddisconnected_callback_on_thread":_emscripten_set_gamepaddisconnected_callback_on_thread,"_emscripten_set_keydown_callback_on_thread":_emscripten_set_keydown_callback_on_thread,"_emscripten_set_keypress_callback_on_thread":_emscripten_set_keypress_callback_on_thread,"_emscripten_set_keyup_callback_on_thread":_emscripten_set_keyup_callback_on_thread,"_emscripten_set_main_loop":_emscripten_set_main_loop,"_emscripten_set_main_loop_timing":_emscripten_set_main_loop_timing,"_emscripten_set_mousedown_callback_on_thread":_emscripten_set_mousedown_callback_on_thread,"_emscripten_set_mousemove_callback_on_thread":_emscripten_set_mousemove_callback_on_thread,"_emscripten_set_mouseup_callback_on_thread":_emscripten_set_mouseup_callback_on_thread,"_emscripten_set_touchcancel_callback_on_thread":_emscripten_set_touchcancel_callback_on_thread,"_emscripten_set_touchend_callback_on_thread":_emscripten_set_touchend_callback_on_thread,"_emscripten_set_touchmove_callback_on_thread":_emscripten_set_touchmove_callback_on_thread,"_emscripten_set_touchstart_callback_on_thread":_emscripten_set_touchstart_callback_on_thread,"_emscripten_set_wheel_callback_on_thread":_emscripten_set_wheel_callback_on_thread,"_emscripten_webgl_create_context":_emscripten_webgl_create_context,"_emscripten_webgl_destroy_context":_emscripten_webgl_destroy_context,"_emscripten_webgl_destroy_context_calling_thread":_emscripten_webgl_destroy_context_calling_thread,"_emscripten_webgl_do_create_context":_emscripten_webgl_do_create_context,"_emscripten_webgl_do_get_current_context":_emscripten_webgl_do_get_current_context,"_emscripten_webgl_enable_extension":_emscripten_webgl_enable_extension,"_emscripten_webgl_enable_extension_calling_thread":_emscripten_webgl_enable_extension_calling_thread,"_emscripten_webgl_get_current_context":_emscripten_webgl_get_current_context,"_emscripten_webgl_init_context_attributes":_emscripten_webgl_init_context_attributes,"_emscripten_webgl_make_context_current":_emscripten_webgl_make_context_current,"_exit":_exit,"_flock":_flock,"_getaddrinfo":_getaddrinfo,"_getenv":_getenv,"_gethostbyaddr":_gethostbyaddr,"_gethostbyname":_gethostbyname,"_getnameinfo":_getnameinfo,"_getpagesize":_getpagesize,"_getpwuid":_getpwuid,"_gettimeofday":_gettimeofday,"_glActiveTexture":_glActiveTexture,"_glAttachShader":_glAttachShader,"_glBeginQuery":_glBeginQuery,"_glBeginTransformFeedback":_glBeginTransformFeedback,"_glBindAttribLocation":_glBindAttribLocation,"_glBindBuffer":_glBindBuffer,"_glBindBufferBase":_glBindBufferBase,"_glBindBufferRange":_glBindBufferRange,"_glBindFramebuffer":_glBindFramebuffer,"_glBindRenderbuffer":_glBindRenderbuffer,"_glBindSampler":_glBindSampler,"_glBindTexture":_glBindTexture,"_glBindTransformFeedback":_glBindTransformFeedback,"_glBindVertexArray":_glBindVertexArray,"_glBlendEquation":_glBlendEquation,"_glBlendEquationSeparate":_glBlendEquationSeparate,"_glBlendFuncSeparate":_glBlendFuncSeparate,"_glBlitFramebuffer":_glBlitFramebuffer,"_glBufferData":_glBufferData,"_glBufferSubData":_glBufferSubData,"_glCheckFramebufferStatus":_glCheckFramebufferStatus,"_glClear":_glClear,"_glClearBufferfi":_glClearBufferfi,"_glClearBufferfv":_glClearBufferfv,"_glClearBufferuiv":_glClearBufferuiv,"_glClearColor":_glClearColor,"_glClearDepthf":_glClearDepthf,"_glClearStencil":_glClearStencil,"_glClientWaitSync":_glClientWaitSync,"_glColorMask":_glColorMask,"_glCompileShader":_glCompileShader,"_glCompressedTexImage2D":_glCompressedTexImage2D,"_glCompressedTexImage3D":_glCompressedTexImage3D,"_glCompressedTexSubImage2D":_glCompressedTexSubImage2D,"_glCompressedTexSubImage3D":_glCompressedTexSubImage3D,"_glCopyBufferSubData":_glCopyBufferSubData,"_glCopyTexImage2D":_glCopyTexImage2D,"_glCopyTexSubImage2D":_glCopyTexSubImage2D,"_glCreateProgram":_glCreateProgram,"_glCreateShader":_glCreateShader,"_glCullFace":_glCullFace,"_glDeleteBuffers":_glDeleteBuffers,"_glDeleteFramebuffers":_glDeleteFramebuffers,"_glDeleteProgram":_glDeleteProgram,"_glDeleteQueries":_glDeleteQueries,"_glDeleteRenderbuffers":_glDeleteRenderbuffers,"_glDeleteSamplers":_glDeleteSamplers,"_glDeleteShader":_glDeleteShader,"_glDeleteSync":_glDeleteSync,"_glDeleteTextures":_glDeleteTextures,"_glDeleteTransformFeedbacks":_glDeleteTransformFeedbacks,"_glDeleteVertexArrays":_glDeleteVertexArrays,"_glDepthFunc":_glDepthFunc,"_glDepthMask":_glDepthMask,"_glDetachShader":_glDetachShader,"_glDisable":_glDisable,"_glDisableVertexAttribArray":_glDisableVertexAttribArray,"_glDrawArrays":_glDrawArrays,"_glDrawArraysInstanced":_glDrawArraysInstanced,"_glDrawBuffers":_glDrawBuffers,"_glDrawElements":_glDrawElements,"_glDrawElementsInstanced":_glDrawElementsInstanced,"_glEnable":_glEnable,"_glEnableVertexAttribArray":_glEnableVertexAttribArray,"_glEndQuery":_glEndQuery,"_glEndTransformFeedback":_glEndTransformFeedback,"_glFenceSync":_glFenceSync,"_glFinish":_glFinish,"_glFlush":_glFlush,"_glFlushMappedBufferRange":_glFlushMappedBufferRange,"_glFramebufferRenderbuffer":_glFramebufferRenderbuffer,"_glFramebufferTexture2D":_glFramebufferTexture2D,"_glFramebufferTextureLayer":_glFramebufferTextureLayer,"_glFrontFace":_glFrontFace,"_glGenBuffers":_glGenBuffers,"_glGenFramebuffers":_glGenFramebuffers,"_glGenQueries":_glGenQueries,"_glGenRenderbuffers":_glGenRenderbuffers,"_glGenSamplers":_glGenSamplers,"_glGenTextures":_glGenTextures,"_glGenTransformFeedbacks":_glGenTransformFeedbacks,"_glGenVertexArrays":_glGenVertexArrays,"_glGenerateMipmap":_glGenerateMipmap,"_glGetActiveAttrib":_glGetActiveAttrib,"_glGetActiveUniform":_glGetActiveUniform,"_glGetActiveUniformBlockName":_glGetActiveUniformBlockName,"_glGetActiveUniformBlockiv":_glGetActiveUniformBlockiv,"_glGetActiveUniformsiv":_glGetActiveUniformsiv,"_glGetAttribLocation":_glGetAttribLocation,"_glGetError":_glGetError,"_glGetFramebufferAttachmentParameteriv":_glGetFramebufferAttachmentParameteriv,"_glGetIntegeri_v":_glGetIntegeri_v,"_glGetIntegerv":_glGetIntegerv,"_glGetInternalformativ":_glGetInternalformativ,"_glGetProgramBinary":_glGetProgramBinary,"_glGetProgramInfoLog":_glGetProgramInfoLog,"_glGetProgramiv":_glGetProgramiv,"_glGetRenderbufferParameteriv":_glGetRenderbufferParameteriv,"_glGetShaderInfoLog":_glGetShaderInfoLog,"_glGetShaderPrecisionFormat":_glGetShaderPrecisionFormat,"_glGetShaderSource":_glGetShaderSource,"_glGetShaderiv":_glGetShaderiv,"_glGetString":_glGetString,"_glGetStringi":_glGetStringi,"_glGetTexParameteriv":_glGetTexParameteriv,"_glGetUniformBlockIndex":_glGetUniformBlockIndex,"_glGetUniformIndices":_glGetUniformIndices,"_glGetUniformLocation":_glGetUniformLocation,"_glGetUniformiv":_glGetUniformiv,"_glGetVertexAttribiv":_glGetVertexAttribiv,"_glInvalidateFramebuffer":_glInvalidateFramebuffer,"_glIsEnabled":_glIsEnabled,"_glIsVertexArray":_glIsVertexArray,"_glLinkProgram":_glLinkProgram,"_glMapBufferRange":_glMapBufferRange,"_glPixelStorei":_glPixelStorei,"_glPolygonOffset":_glPolygonOffset,"_glProgramBinary":_glProgramBinary,"_glProgramParameteri":_glProgramParameteri,"_glReadBuffer":_glReadBuffer,"_glReadPixels":_glReadPixels,"_glRenderbufferStorage":_glRenderbufferStorage,"_glRenderbufferStorageMultisample":_glRenderbufferStorageMultisample,"_glSamplerParameteri":_glSamplerParameteri,"_glScissor":_glScissor,"_glShaderSource":_glShaderSource,"_glStencilFuncSeparate":_glStencilFuncSeparate,"_glStencilMask":_glStencilMask,"_glStencilOpSeparate":_glStencilOpSeparate,"_glTexImage2D":_glTexImage2D,"_glTexImage3D":_glTexImage3D,"_glTexParameterf":_glTexParameterf,"_glTexParameteri":_glTexParameteri,"_glTexParameteriv":_glTexParameteriv,"_glTexStorage2D":_glTexStorage2D,"_glTexStorage3D":_glTexStorage3D,"_glTexSubImage2D":_glTexSubImage2D,"_glTexSubImage3D":_glTexSubImage3D,"_glTransformFeedbackVaryings":_glTransformFeedbackVaryings,"_glUniform1fv":_glUniform1fv,"_glUniform1i":_glUniform1i,"_glUniform1iv":_glUniform1iv,"_glUniform1uiv":_glUniform1uiv,"_glUniform2fv":_glUniform2fv,"_glUniform2iv":_glUniform2iv,"_glUniform2uiv":_glUniform2uiv,"_glUniform3fv":_glUniform3fv,"_glUniform3iv":_glUniform3iv,"_glUniform3uiv":_glUniform3uiv,"_glUniform4fv":_glUniform4fv,"_glUniform4iv":_glUniform4iv,"_glUniform4uiv":_glUniform4uiv,"_glUniformBlockBinding":_glUniformBlockBinding,"_glUniformMatrix3fv":_glUniformMatrix3fv,"_glUniformMatrix4fv":_glUniformMatrix4fv,"_glUnmapBuffer":_glUnmapBuffer,"_glUseProgram":_glUseProgram,"_glValidateProgram":_glValidateProgram,"_glVertexAttrib4f":_glVertexAttrib4f,"_glVertexAttrib4fv":_glVertexAttrib4fv,"_glVertexAttribIPointer":_glVertexAttribIPointer,"_glVertexAttribPointer":_glVertexAttribPointer,"_glViewport":_glViewport,"_gmtime":_gmtime,"_gmtime_r":_gmtime_r,"_inet_addr":_inet_addr,"_llvm_ceil_f32":_llvm_ceil_f32,"_llvm_ceil_f64":_llvm_ceil_f64,"_llvm_copysign_f64":_llvm_copysign_f64,"_llvm_cttz_i32":_llvm_cttz_i32,"_llvm_eh_typeid_for":_llvm_eh_typeid_for,"_llvm_exp2_f32":_llvm_exp2_f32,"_llvm_fabs_f32":_llvm_fabs_f32,"_llvm_fabs_f64":_llvm_fabs_f64,"_llvm_floor_f32":_llvm_floor_f32,"_llvm_floor_f64":_llvm_floor_f64,"_llvm_log10_f32":_llvm_log10_f32,"_llvm_log2_f32":_llvm_log2_f32,"_llvm_pow_f64":_llvm_pow_f64,"_llvm_sqrt_f32":_llvm_sqrt_f32,"_llvm_trap":_llvm_trap,"_llvm_trunc_f32":_llvm_trunc_f32,"_localtime":_localtime,"_localtime_r":_localtime_r,"_longjmp":_longjmp,"_mktime":_mktime,"_nanosleep":_nanosleep,"_pthread_cond_destroy":_pthread_cond_destroy,"_pthread_cond_init":_pthread_cond_init,"_pthread_cond_timedwait":_pthread_cond_timedwait,"_pthread_cond_wait":_pthread_cond_wait,"_pthread_getspecific":_pthread_getspecific,"_pthread_key_create":_pthread_key_create,"_pthread_key_delete":_pthread_key_delete,"_pthread_mutex_destroy":_pthread_mutex_destroy,"_pthread_mutex_init":_pthread_mutex_init,"_pthread_mutexattr_destroy":_pthread_mutexattr_destroy,"_pthread_mutexattr_init":_pthread_mutexattr_init,"_pthread_mutexattr_setprotocol":_pthread_mutexattr_setprotocol,"_pthread_mutexattr_settype":_pthread_mutexattr_settype,"_pthread_once":_pthread_once,"_pthread_setspecific":_pthread_setspecific,"_sched_yield":_sched_yield,"_setenv":_setenv,"_sigaction":_sigaction,"_sigemptyset":_sigemptyset,"_strftime":_strftime,"_sysconf":_sysconf,"_time":_time,"_tzset":_tzset,"_unsetenv":_unsetenv,"_usleep":_usleep,"_utime":_utime,"emscriptenWebGLComputeImageSize":emscriptenWebGLComputeImageSize,"emscriptenWebGLGet":emscriptenWebGLGet,"emscriptenWebGLGetBufferBinding":emscriptenWebGLGetBufferBinding,"emscriptenWebGLGetHeapForType":emscriptenWebGLGetHeapForType,"emscriptenWebGLGetIndexed":emscriptenWebGLGetIndexed,"emscriptenWebGLGetShiftForType":emscriptenWebGLGetShiftForType,"emscriptenWebGLGetTexPixelData":emscriptenWebGLGetTexPixelData,"emscriptenWebGLGetUniform":emscriptenWebGLGetUniform,"emscriptenWebGLGetVertexAttrib":emscriptenWebGLGetVertexAttrib,"emscriptenWebGLValidateMapBufferTarget":emscriptenWebGLValidateMapBufferTarget,"emscripten_get_canvas_element_size_js":emscripten_get_canvas_element_size_js,"emscripten_set_canvas_element_size_js":emscripten_set_canvas_element_size_js,"DYNAMICTOP_PTR":DYNAMICTOP_PTR,"tempDoublePtr":tempDoublePtr,"ABORT":ABORT,"STACKTOP":STACKTOP,"STACK_MAX":STACK_MAX};var asm=Module["asm"](Module.asmGlobalArg,Module.asmLibraryArg,buffer);Module["asm"]=asm;var _SendMessage=Module["_SendMessage"]=(function(){return Module["asm"]["_SendMessage"].apply(null,arguments)});var _SendMessageFloat=Module["_SendMessageFloat"]=(function(){return Module["asm"]["_SendMessageFloat"].apply(null,arguments)});var _SendMessageString=Module["_SendMessageString"]=(function(){return Module["asm"]["_SendMessageString"].apply(null,arguments)});var _SetFullscreen=Module["_SetFullscreen"]=(function(){return Module["asm"]["_SetFullscreen"].apply(null,arguments)});var __GLOBAL__sub_I_AIScriptingClasses_cpp=Module["__GLOBAL__sub_I_AIScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_AIScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_AccessibilityScriptingClasses_cpp=Module["__GLOBAL__sub_I_AccessibilityScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_AccessibilityScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_AndroidJNIScriptingClasses_cpp=Module["__GLOBAL__sub_I_AndroidJNIScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_AndroidJNIScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_AnimationClip_cpp=Module["__GLOBAL__sub_I_AnimationClip_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_AnimationClip_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_AnimationScriptingClasses_cpp=Module["__GLOBAL__sub_I_AnimationScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_AnimationScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_AssetBundleFileSystem_cpp=Module["__GLOBAL__sub_I_AssetBundleFileSystem_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_AssetBundleFileSystem_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_AssetBundleScriptingClasses_cpp=Module["__GLOBAL__sub_I_AssetBundleScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_AssetBundleScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_AudioScriptingClasses_cpp=Module["__GLOBAL__sub_I_AudioScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_AudioScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_ClothScriptingClasses_cpp=Module["__GLOBAL__sub_I_ClothScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_ClothScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_DirectorScriptingClasses_cpp=Module["__GLOBAL__sub_I_DirectorScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_DirectorScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_External_ProphecySDK_BlitOperations_1_cpp=Module["__GLOBAL__sub_I_External_ProphecySDK_BlitOperations_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_External_ProphecySDK_BlitOperations_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_External_Yoga_Yoga_0_cpp=Module["__GLOBAL__sub_I_External_Yoga_Yoga_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_External_Yoga_Yoga_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_External_il2cpp_builds_external_baselib_Platforms_WebGL_Source_0_cpp=Module["__GLOBAL__sub_I_External_il2cpp_builds_external_baselib_Platforms_WebGL_Source_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_External_il2cpp_builds_external_baselib_Platforms_WebGL_Source_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_GUITexture_cpp=Module["__GLOBAL__sub_I_GUITexture_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_GUITexture_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_GfxDeviceNull_cpp=Module["__GLOBAL__sub_I_GfxDeviceNull_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_GfxDeviceNull_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_GridScriptingClasses_cpp=Module["__GLOBAL__sub_I_GridScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_GridScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_IMGUIScriptingClasses_cpp=Module["__GLOBAL__sub_I_IMGUIScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_IMGUIScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_InputLegacyScriptingClasses_cpp=Module["__GLOBAL__sub_I_InputLegacyScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_InputLegacyScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_InputScriptingClasses_cpp=Module["__GLOBAL__sub_I_InputScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_InputScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_LogAssert_cpp=Module["__GLOBAL__sub_I_LogAssert_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_LogAssert_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Lump_libil2cpp_gc_cpp=Module["__GLOBAL__sub_I_Lump_libil2cpp_gc_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Lump_libil2cpp_gc_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Lump_libil2cpp_icalls_cpp=Module["__GLOBAL__sub_I_Lump_libil2cpp_icalls_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Lump_libil2cpp_icalls_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Lump_libil2cpp_metadata_cpp=Module["__GLOBAL__sub_I_Lump_libil2cpp_metadata_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Lump_libil2cpp_metadata_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Lump_libil2cpp_mono_cpp=Module["__GLOBAL__sub_I_Lump_libil2cpp_mono_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Lump_libil2cpp_mono_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Lump_libil2cpp_os_cpp=Module["__GLOBAL__sub_I_Lump_libil2cpp_os_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Lump_libil2cpp_os_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Lump_libil2cpp_utils_cpp=Module["__GLOBAL__sub_I_Lump_libil2cpp_utils_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Lump_libil2cpp_utils_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Lump_libil2cpp_vm_cpp=Module["__GLOBAL__sub_I_Lump_libil2cpp_vm_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Lump_libil2cpp_vm_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Lump_libil2cpp_vm_utils_cpp=Module["__GLOBAL__sub_I_Lump_libil2cpp_vm_utils_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Lump_libil2cpp_vm_utils_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Mesh_cpp=Module["__GLOBAL__sub_I_Mesh_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Mesh_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Animation_0_cpp=Module["__GLOBAL__sub_I_Modules_Animation_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Animation_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Animation_2_cpp=Module["__GLOBAL__sub_I_Modules_Animation_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Animation_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Animation_7_cpp=Module["__GLOBAL__sub_I_Modules_Animation_7_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Animation_7_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Animation_Constraints_0_cpp=Module["__GLOBAL__sub_I_Modules_Animation_Constraints_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Animation_Constraints_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_AssetBundle_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_AssetBundle_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_AssetBundle_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Audio_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_Audio_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Audio_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Audio_Public_1_cpp=Module["__GLOBAL__sub_I_Modules_Audio_Public_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Audio_Public_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Audio_Public_3_cpp=Module["__GLOBAL__sub_I_Modules_Audio_Public_3_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Audio_Public_3_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Audio_Public_ScriptBindings_1_cpp=Module["__GLOBAL__sub_I_Modules_Audio_Public_ScriptBindings_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Audio_Public_ScriptBindings_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Audio_Public_sound_0_cpp=Module["__GLOBAL__sub_I_Modules_Audio_Public_sound_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Audio_Public_sound_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Cloth_0_cpp=Module["__GLOBAL__sub_I_Modules_Cloth_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Cloth_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_DSPGraph_Public_1_cpp=Module["__GLOBAL__sub_I_Modules_DSPGraph_Public_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_DSPGraph_Public_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Grid_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_Grid_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Grid_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_IMGUI_0_cpp=Module["__GLOBAL__sub_I_Modules_IMGUI_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_IMGUI_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_IMGUI_1_cpp=Module["__GLOBAL__sub_I_Modules_IMGUI_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_IMGUI_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Input_Private_0_cpp=Module["__GLOBAL__sub_I_Modules_Input_Private_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Input_Private_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_ParticleSystem_0_cpp=Module["__GLOBAL__sub_I_Modules_ParticleSystem_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_ParticleSystem_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Physics2D_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_Physics2D_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Physics2D_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Physics2D_Public_1_cpp=Module["__GLOBAL__sub_I_Modules_Physics2D_Public_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Physics2D_Public_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Physics_0_cpp=Module["__GLOBAL__sub_I_Modules_Physics_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Physics_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Physics_2_cpp=Module["__GLOBAL__sub_I_Modules_Physics_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Physics_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Profiler_Public_1_cpp=Module["__GLOBAL__sub_I_Modules_Profiler_Public_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Profiler_Public_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Profiler_Runtime_1_cpp=Module["__GLOBAL__sub_I_Modules_Profiler_Runtime_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Profiler_Runtime_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Subsystems_0_cpp=Module["__GLOBAL__sub_I_Modules_Subsystems_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Subsystems_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Terrain_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_Terrain_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Terrain_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Terrain_Public_1_cpp=Module["__GLOBAL__sub_I_Modules_Terrain_Public_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Terrain_Public_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Terrain_Public_2_cpp=Module["__GLOBAL__sub_I_Modules_Terrain_Public_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Terrain_Public_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Terrain_Public_3_cpp=Module["__GLOBAL__sub_I_Modules_Terrain_Public_3_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Terrain_Public_3_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Terrain_VR_0_cpp=Module["__GLOBAL__sub_I_Modules_Terrain_VR_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Terrain_VR_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_TextCore_Native_FontEngine_0_cpp=Module["__GLOBAL__sub_I_Modules_TextCore_Native_FontEngine_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_TextCore_Native_FontEngine_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_TextRendering_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_TextRendering_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_TextRendering_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Tilemap_0_cpp=Module["__GLOBAL__sub_I_Modules_Tilemap_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Tilemap_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Tilemap_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_Tilemap_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Tilemap_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_UI_0_cpp=Module["__GLOBAL__sub_I_Modules_UI_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_UI_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_UI_1_cpp=Module["__GLOBAL__sub_I_Modules_UI_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_UI_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_UI_2_cpp=Module["__GLOBAL__sub_I_Modules_UI_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_UI_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_UnityWebRequest_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_UnityWebRequest_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_UnityWebRequest_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_VFX_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_VFX_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_VFX_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_VFX_Public_1_cpp=Module["__GLOBAL__sub_I_Modules_VFX_Public_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_VFX_Public_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_VFX_Public_Systems_0_cpp=Module["__GLOBAL__sub_I_Modules_VFX_Public_Systems_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_VFX_Public_Systems_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_VR_0_cpp=Module["__GLOBAL__sub_I_Modules_VR_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_VR_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_VR_1_cpp=Module["__GLOBAL__sub_I_Modules_VR_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_VR_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Video_Public_Base_0_cpp=Module["__GLOBAL__sub_I_Modules_Video_Public_Base_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Video_Public_Base_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_XR_0_cpp=Module["__GLOBAL__sub_I_Modules_XR_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_XR_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_XR_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_XR_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_XR_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_XR_Stats_0_cpp=Module["__GLOBAL__sub_I_Modules_XR_Stats_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_XR_Stats_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_XR_Subsystems_Display_0_cpp=Module["__GLOBAL__sub_I_Modules_XR_Subsystems_Display_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_XR_Subsystems_Display_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_XR_Subsystems_Input_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_XR_Subsystems_Input_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_XR_Subsystems_Input_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_XR_Subsystems_Input_Public_1_cpp=Module["__GLOBAL__sub_I_Modules_XR_Subsystems_Input_Public_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_XR_Subsystems_Input_Public_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_XR_Subsystems_Meshing_0_cpp=Module["__GLOBAL__sub_I_Modules_XR_Subsystems_Meshing_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_XR_Subsystems_Meshing_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_XR_Tracing_0_cpp=Module["__GLOBAL__sub_I_Modules_XR_Tracing_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_XR_Tracing_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_ParticleSystemScriptingClasses_cpp=Module["__GLOBAL__sub_I_ParticleSystemScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_ParticleSystemScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Physics2DScriptingClasses_cpp=Module["__GLOBAL__sub_I_Physics2DScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Physics2DScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_PhysicsQuery_cpp=Module["__GLOBAL__sub_I_PhysicsQuery_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_PhysicsQuery_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_PhysicsScriptingClasses_cpp=Module["__GLOBAL__sub_I_PhysicsScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_PhysicsScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_PlatformDependent_WebGL_External_baselib_builds_Source_0_cpp=Module["__GLOBAL__sub_I_PlatformDependent_WebGL_External_baselib_builds_Source_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_PlatformDependent_WebGL_External_baselib_builds_Source_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_PlatformDependent_WebGL_Source_0_cpp=Module["__GLOBAL__sub_I_PlatformDependent_WebGL_Source_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_PlatformDependent_WebGL_Source_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_PlatformDependent_WebGL_Source_2_cpp=Module["__GLOBAL__sub_I_PlatformDependent_WebGL_Source_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_PlatformDependent_WebGL_Source_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_PluginInterfaceVR_cpp=Module["__GLOBAL__sub_I_PluginInterfaceVR_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_PluginInterfaceVR_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_2D_Renderer_0_cpp=Module["__GLOBAL__sub_I_Runtime_2D_Renderer_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_2D_Renderer_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_2D_Sorting_0_cpp=Module["__GLOBAL__sub_I_Runtime_2D_Sorting_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_2D_Sorting_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_2D_SpriteAtlas_0_cpp=Module["__GLOBAL__sub_I_Runtime_2D_SpriteAtlas_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_2D_SpriteAtlas_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Allocator_2_cpp=Module["__GLOBAL__sub_I_Runtime_Allocator_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Allocator_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Application_0_cpp=Module["__GLOBAL__sub_I_Runtime_Application_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Application_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_BaseClasses_0_cpp=Module["__GLOBAL__sub_I_Runtime_BaseClasses_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_BaseClasses_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_BaseClasses_1_cpp=Module["__GLOBAL__sub_I_Runtime_BaseClasses_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_BaseClasses_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_BaseClasses_2_cpp=Module["__GLOBAL__sub_I_Runtime_BaseClasses_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_BaseClasses_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_BaseClasses_3_cpp=Module["__GLOBAL__sub_I_Runtime_BaseClasses_3_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_BaseClasses_3_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Burst_0_cpp=Module["__GLOBAL__sub_I_Runtime_Burst_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Burst_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_0_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_1_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_2_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_6_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_6_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_6_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_7_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_7_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_7_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_8_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_8_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_8_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_Culling_0_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_Culling_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_Culling_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_RenderLoops_0_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_RenderLoops_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_RenderLoops_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_RenderLoops_2_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_RenderLoops_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_RenderLoops_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Containers_0_cpp=Module["__GLOBAL__sub_I_Runtime_Containers_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Containers_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Core_Callbacks_0_cpp=Module["__GLOBAL__sub_I_Runtime_Core_Callbacks_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Core_Callbacks_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Director_Core_1_cpp=Module["__GLOBAL__sub_I_Runtime_Director_Core_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Director_Core_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Export_Unsafe_0_cpp=Module["__GLOBAL__sub_I_Runtime_Export_Unsafe_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Export_Unsafe_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_File_0_cpp=Module["__GLOBAL__sub_I_Runtime_File_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_File_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Geometry_2_cpp=Module["__GLOBAL__sub_I_Runtime_Geometry_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Geometry_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_GfxDevice_1_cpp=Module["__GLOBAL__sub_I_Runtime_GfxDevice_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_GfxDevice_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_GfxDevice_2_cpp=Module["__GLOBAL__sub_I_Runtime_GfxDevice_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_GfxDevice_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_GfxDevice_3_cpp=Module["__GLOBAL__sub_I_Runtime_GfxDevice_3_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_GfxDevice_3_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_GfxDevice_4_cpp=Module["__GLOBAL__sub_I_Runtime_GfxDevice_4_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_GfxDevice_4_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_GfxDevice_5_cpp=Module["__GLOBAL__sub_I_Runtime_GfxDevice_5_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_GfxDevice_5_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_GfxDevice_opengles_0_cpp=Module["__GLOBAL__sub_I_Runtime_GfxDevice_opengles_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_GfxDevice_opengles_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_0_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_10_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_10_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_10_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_11_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_11_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_11_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_1_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_2_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_4_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_4_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_4_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_5_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_5_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_5_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_6_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_6_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_6_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_8_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_8_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_8_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_Billboard_0_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_Billboard_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_Billboard_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_CommandBuffer_0_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_CommandBuffer_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_CommandBuffer_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_LOD_0_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_LOD_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_LOD_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_Mesh_0_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_Mesh_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_Mesh_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_Mesh_1_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_Mesh_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_Mesh_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_Mesh_2_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_Mesh_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_Mesh_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_Mesh_4_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_Mesh_4_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_Mesh_4_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_Mesh_5_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_Mesh_5_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_Mesh_5_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_ScriptableRenderLoop_0_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_ScriptableRenderLoop_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_ScriptableRenderLoop_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Input_0_cpp=Module["__GLOBAL__sub_I_Runtime_Input_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Input_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Interfaces_0_cpp=Module["__GLOBAL__sub_I_Runtime_Interfaces_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Interfaces_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Interfaces_1_cpp=Module["__GLOBAL__sub_I_Runtime_Interfaces_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Interfaces_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Interfaces_2_cpp=Module["__GLOBAL__sub_I_Runtime_Interfaces_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Interfaces_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Jobs_0_cpp=Module["__GLOBAL__sub_I_Runtime_Jobs_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Jobs_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Jobs_1_cpp=Module["__GLOBAL__sub_I_Runtime_Jobs_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Jobs_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Jobs_Internal_1_cpp=Module["__GLOBAL__sub_I_Runtime_Jobs_Internal_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Jobs_Internal_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Jobs_ScriptBindings_0_cpp=Module["__GLOBAL__sub_I_Runtime_Jobs_ScriptBindings_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Jobs_ScriptBindings_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Math_2_cpp=Module["__GLOBAL__sub_I_Runtime_Math_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Math_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Math_Random_0_cpp=Module["__GLOBAL__sub_I_Runtime_Math_Random_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Math_Random_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Misc_0_cpp=Module["__GLOBAL__sub_I_Runtime_Misc_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Misc_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Misc_2_cpp=Module["__GLOBAL__sub_I_Runtime_Misc_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Misc_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Misc_4_cpp=Module["__GLOBAL__sub_I_Runtime_Misc_4_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Misc_4_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Misc_5_cpp=Module["__GLOBAL__sub_I_Runtime_Misc_5_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Misc_5_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Modules_0_cpp=Module["__GLOBAL__sub_I_Runtime_Modules_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Modules_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Mono_2_cpp=Module["__GLOBAL__sub_I_Runtime_Mono_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Mono_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Mono_SerializationBackend_DirectMemoryAccess_0_cpp=Module["__GLOBAL__sub_I_Runtime_Mono_SerializationBackend_DirectMemoryAccess_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Mono_SerializationBackend_DirectMemoryAccess_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Mono_SerializationBackend_DirectMemoryAccess_1_cpp=Module["__GLOBAL__sub_I_Runtime_Mono_SerializationBackend_DirectMemoryAccess_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Mono_SerializationBackend_DirectMemoryAccess_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_PluginInterface_0_cpp=Module["__GLOBAL__sub_I_Runtime_PluginInterface_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_PluginInterface_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_PreloadManager_0_cpp=Module["__GLOBAL__sub_I_Runtime_PreloadManager_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_PreloadManager_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Profiler_0_cpp=Module["__GLOBAL__sub_I_Runtime_Profiler_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Profiler_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Profiler_2_cpp=Module["__GLOBAL__sub_I_Runtime_Profiler_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Profiler_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Profiler_ExternalGPUProfiler_0_cpp=Module["__GLOBAL__sub_I_Runtime_Profiler_ExternalGPUProfiler_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Profiler_ExternalGPUProfiler_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Profiler_ScriptBindings_0_cpp=Module["__GLOBAL__sub_I_Runtime_Profiler_ScriptBindings_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Profiler_ScriptBindings_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_SceneManager_0_cpp=Module["__GLOBAL__sub_I_Runtime_SceneManager_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_SceneManager_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_ScriptingBackend_Il2Cpp_0_cpp=Module["__GLOBAL__sub_I_Runtime_ScriptingBackend_Il2Cpp_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_ScriptingBackend_Il2Cpp_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Scripting_0_cpp=Module["__GLOBAL__sub_I_Runtime_Scripting_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Scripting_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Scripting_2_cpp=Module["__GLOBAL__sub_I_Runtime_Scripting_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Scripting_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Scripting_3_cpp=Module["__GLOBAL__sub_I_Runtime_Scripting_3_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Scripting_3_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Scripting_APIUpdating_0_cpp=Module["__GLOBAL__sub_I_Runtime_Scripting_APIUpdating_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Scripting_APIUpdating_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Serialize_1_cpp=Module["__GLOBAL__sub_I_Runtime_Serialize_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Serialize_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Serialize_2_cpp=Module["__GLOBAL__sub_I_Runtime_Serialize_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Serialize_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Serialize_TransferFunctions_0_cpp=Module["__GLOBAL__sub_I_Runtime_Serialize_TransferFunctions_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Serialize_TransferFunctions_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Serialize_TransferFunctions_1_cpp=Module["__GLOBAL__sub_I_Runtime_Serialize_TransferFunctions_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Serialize_TransferFunctions_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Shaders_1_cpp=Module["__GLOBAL__sub_I_Runtime_Shaders_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Shaders_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Shaders_3_cpp=Module["__GLOBAL__sub_I_Runtime_Shaders_3_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Shaders_3_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Shaders_GpuPrograms_0_cpp=Module["__GLOBAL__sub_I_Runtime_Shaders_GpuPrograms_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Shaders_GpuPrograms_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Shaders_ShaderImpl_2_cpp=Module["__GLOBAL__sub_I_Runtime_Shaders_ShaderImpl_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Shaders_ShaderImpl_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Transform_0_cpp=Module["__GLOBAL__sub_I_Runtime_Transform_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Transform_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Transform_1_cpp=Module["__GLOBAL__sub_I_Runtime_Transform_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Transform_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Utilities_2_cpp=Module["__GLOBAL__sub_I_Runtime_Utilities_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Utilities_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Utilities_5_cpp=Module["__GLOBAL__sub_I_Runtime_Utilities_5_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Utilities_5_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Utilities_6_cpp=Module["__GLOBAL__sub_I_Runtime_Utilities_6_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Utilities_6_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Utilities_7_cpp=Module["__GLOBAL__sub_I_Runtime_Utilities_7_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Utilities_7_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Utilities_9_cpp=Module["__GLOBAL__sub_I_Runtime_Utilities_9_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Utilities_9_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Video_0_cpp=Module["__GLOBAL__sub_I_Runtime_Video_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Video_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_VirtualFileSystem_0_cpp=Module["__GLOBAL__sub_I_Runtime_VirtualFileSystem_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_VirtualFileSystem_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Shader_cpp=Module["__GLOBAL__sub_I_Shader_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Shader_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Shadows_cpp=Module["__GLOBAL__sub_I_Shadows_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Shadows_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_ShapeModule_cpp=Module["__GLOBAL__sub_I_ShapeModule_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_ShapeModule_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_SubsystemsScriptingClasses_cpp=Module["__GLOBAL__sub_I_SubsystemsScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_SubsystemsScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_SwInterCollision_cpp=Module["__GLOBAL__sub_I_SwInterCollision_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_SwInterCollision_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_SwSolverKernel_cpp=Module["__GLOBAL__sub_I_SwSolverKernel_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_SwSolverKernel_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_TemplateInstantiations_cpp=Module["__GLOBAL__sub_I_TemplateInstantiations_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_TemplateInstantiations_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_TerrainScriptingClasses_cpp=Module["__GLOBAL__sub_I_TerrainScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_TerrainScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_TextCoreScriptingClasses_cpp=Module["__GLOBAL__sub_I_TextCoreScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_TextCoreScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_TextRenderingScriptingClasses_cpp=Module["__GLOBAL__sub_I_TextRenderingScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_TextRenderingScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_TilemapScriptingClasses_cpp=Module["__GLOBAL__sub_I_TilemapScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_TilemapScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_UIElementsNativeScriptingClasses_cpp=Module["__GLOBAL__sub_I_UIElementsNativeScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_UIElementsNativeScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_UIScriptingClasses_cpp=Module["__GLOBAL__sub_I_UIScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_UIScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_UVModule_cpp=Module["__GLOBAL__sub_I_UVModule_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_UVModule_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_UnityAdsSettings_cpp=Module["__GLOBAL__sub_I_UnityAdsSettings_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_UnityAdsSettings_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_UnityAnalyticsScriptingClasses_cpp=Module["__GLOBAL__sub_I_UnityAnalyticsScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_UnityAnalyticsScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_UnityWebRequestScriptingClasses_cpp=Module["__GLOBAL__sub_I_UnityWebRequestScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_UnityWebRequestScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_VFXScriptingClasses_cpp=Module["__GLOBAL__sub_I_VFXScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_VFXScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_VRScriptingClasses_cpp=Module["__GLOBAL__sub_I_VRScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_VRScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_VideoScriptingClasses_cpp=Module["__GLOBAL__sub_I_VideoScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_VideoScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_VisualEffectAsset_cpp=Module["__GLOBAL__sub_I_VisualEffectAsset_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_VisualEffectAsset_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Wind_cpp=Module["__GLOBAL__sub_I_Wind_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Wind_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_XRAudio_cpp=Module["__GLOBAL__sub_I_XRAudio_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_XRAudio_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_XRPreInit_cpp=Module["__GLOBAL__sub_I_XRPreInit_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_XRPreInit_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_XRScriptingClasses_cpp=Module["__GLOBAL__sub_I_XRScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_XRScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_XRWindowsLocatableCamera_cpp=Module["__GLOBAL__sub_I_XRWindowsLocatableCamera_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_XRWindowsLocatableCamera_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_artifacts_WebGL_codegenerator_0_cpp=Module["__GLOBAL__sub_I_artifacts_WebGL_codegenerator_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_artifacts_WebGL_codegenerator_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_nvcloth_src_0_cpp=Module["__GLOBAL__sub_I_nvcloth_src_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_nvcloth_src_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_nvcloth_src_1_cpp=Module["__GLOBAL__sub_I_nvcloth_src_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_nvcloth_src_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_umbra_cpp=Module["__GLOBAL__sub_I_umbra_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_umbra_cpp"].apply(null,arguments)});var ___cxa_can_catch=Module["___cxa_can_catch"]=(function(){return Module["asm"]["___cxa_can_catch"].apply(null,arguments)});var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=(function(){return Module["asm"]["___cxa_is_pointer_type"].apply(null,arguments)});var ___cxx_global_var_init=Module["___cxx_global_var_init"]=(function(){return Module["asm"]["___cxx_global_var_init"].apply(null,arguments)});var ___cxx_global_var_init_104=Module["___cxx_global_var_init_104"]=(function(){return Module["asm"]["___cxx_global_var_init_104"].apply(null,arguments)});var ___cxx_global_var_init_131=Module["___cxx_global_var_init_131"]=(function(){return Module["asm"]["___cxx_global_var_init_131"].apply(null,arguments)});var ___cxx_global_var_init_18=Module["___cxx_global_var_init_18"]=(function(){return Module["asm"]["___cxx_global_var_init_18"].apply(null,arguments)});var ___cxx_global_var_init_18_1180=Module["___cxx_global_var_init_18_1180"]=(function(){return Module["asm"]["___cxx_global_var_init_18_1180"].apply(null,arguments)});var ___cxx_global_var_init_19=Module["___cxx_global_var_init_19"]=(function(){return Module["asm"]["___cxx_global_var_init_19"].apply(null,arguments)});var ___cxx_global_var_init_20=Module["___cxx_global_var_init_20"]=(function(){return Module["asm"]["___cxx_global_var_init_20"].apply(null,arguments)});var ___cxx_global_var_init_23=Module["___cxx_global_var_init_23"]=(function(){return Module["asm"]["___cxx_global_var_init_23"].apply(null,arguments)});var ___cxx_global_var_init_3785=Module["___cxx_global_var_init_3785"]=(function(){return Module["asm"]["___cxx_global_var_init_3785"].apply(null,arguments)});var ___cxx_global_var_init_7752=Module["___cxx_global_var_init_7752"]=(function(){return Module["asm"]["___cxx_global_var_init_7752"].apply(null,arguments)});var ___cxx_global_var_init_89=Module["___cxx_global_var_init_89"]=(function(){return Module["asm"]["___cxx_global_var_init_89"].apply(null,arguments)});var ___cxx_global_var_init_8909=Module["___cxx_global_var_init_8909"]=(function(){return Module["asm"]["___cxx_global_var_init_8909"].apply(null,arguments)});var ___cxx_global_var_init_9=Module["___cxx_global_var_init_9"]=(function(){return Module["asm"]["___cxx_global_var_init_9"].apply(null,arguments)});var ___cxx_global_var_init_9305=Module["___cxx_global_var_init_9305"]=(function(){return Module["asm"]["___cxx_global_var_init_9305"].apply(null,arguments)});var ___emscripten_environ_constructor=Module["___emscripten_environ_constructor"]=(function(){return Module["asm"]["___emscripten_environ_constructor"].apply(null,arguments)});var ___errno_location=Module["___errno_location"]=(function(){return Module["asm"]["___errno_location"].apply(null,arguments)});var __get_daylight=Module["__get_daylight"]=(function(){return Module["asm"]["__get_daylight"].apply(null,arguments)});var __get_environ=Module["__get_environ"]=(function(){return Module["asm"]["__get_environ"].apply(null,arguments)});var __get_timezone=Module["__get_timezone"]=(function(){return Module["asm"]["__get_timezone"].apply(null,arguments)});var __get_tzname=Module["__get_tzname"]=(function(){return Module["asm"]["__get_tzname"].apply(null,arguments)});var _emscripten_replace_memory=Module["_emscripten_replace_memory"]=(function(){return Module["asm"]["_emscripten_replace_memory"].apply(null,arguments)});var _free=Module["_free"]=(function(){return Module["asm"]["_free"].apply(null,arguments)});var _htonl=Module["_htonl"]=(function(){return Module["asm"]["_htonl"].apply(null,arguments)});var _htons=Module["_htons"]=(function(){return Module["asm"]["_htons"].apply(null,arguments)});var _i64Add=Module["_i64Add"]=(function(){return Module["asm"]["_i64Add"].apply(null,arguments)});var _llvm_bswap_i16=Module["_llvm_bswap_i16"]=(function(){return Module["asm"]["_llvm_bswap_i16"].apply(null,arguments)});var _llvm_bswap_i32=Module["_llvm_bswap_i32"]=(function(){return Module["asm"]["_llvm_bswap_i32"].apply(null,arguments)});var _llvm_ctlz_i64=Module["_llvm_ctlz_i64"]=(function(){return Module["asm"]["_llvm_ctlz_i64"].apply(null,arguments)});var _llvm_ctpop_i32=Module["_llvm_ctpop_i32"]=(function(){return Module["asm"]["_llvm_ctpop_i32"].apply(null,arguments)});var _llvm_maxnum_f32=Module["_llvm_maxnum_f32"]=(function(){return Module["asm"]["_llvm_maxnum_f32"].apply(null,arguments)});var _llvm_maxnum_f64=Module["_llvm_maxnum_f64"]=(function(){return Module["asm"]["_llvm_maxnum_f64"].apply(null,arguments)});var _llvm_minnum_f32=Module["_llvm_minnum_f32"]=(function(){return Module["asm"]["_llvm_minnum_f32"].apply(null,arguments)});var _llvm_round_f32=Module["_llvm_round_f32"]=(function(){return Module["asm"]["_llvm_round_f32"].apply(null,arguments)});var _main=Module["_main"]=(function(){return Module["asm"]["_main"].apply(null,arguments)});var _malloc=Module["_malloc"]=(function(){return Module["asm"]["_malloc"].apply(null,arguments)});var _memalign=Module["_memalign"]=(function(){return Module["asm"]["_memalign"].apply(null,arguments)});var _memcpy=Module["_memcpy"]=(function(){return Module["asm"]["_memcpy"].apply(null,arguments)});var _memmove=Module["_memmove"]=(function(){return Module["asm"]["_memmove"].apply(null,arguments)});var _memset=Module["_memset"]=(function(){return Module["asm"]["_memset"].apply(null,arguments)});var _ntohs=Module["_ntohs"]=(function(){return Module["asm"]["_ntohs"].apply(null,arguments)});var _pthread_cond_broadcast=Module["_pthread_cond_broadcast"]=(function(){return Module["asm"]["_pthread_cond_broadcast"].apply(null,arguments)});var _pthread_mutex_lock=Module["_pthread_mutex_lock"]=(function(){return Module["asm"]["_pthread_mutex_lock"].apply(null,arguments)});var _pthread_mutex_unlock=Module["_pthread_mutex_unlock"]=(function(){return Module["asm"]["_pthread_mutex_unlock"].apply(null,arguments)});var _realloc=Module["_realloc"]=(function(){return Module["asm"]["_realloc"].apply(null,arguments)});var _saveSetjmp=Module["_saveSetjmp"]=(function(){return Module["asm"]["_saveSetjmp"].apply(null,arguments)});var _sbrk=Module["_sbrk"]=(function(){return Module["asm"]["_sbrk"].apply(null,arguments)});var _strlen=Module["_strlen"]=(function(){return Module["asm"]["_strlen"].apply(null,arguments)});var _testSetjmp=Module["_testSetjmp"]=(function(){return Module["asm"]["_testSetjmp"].apply(null,arguments)});var establishStackSpace=Module["establishStackSpace"]=(function(){return Module["asm"]["establishStackSpace"].apply(null,arguments)});var getTempRet0=Module["getTempRet0"]=(function(){return Module["asm"]["getTempRet0"].apply(null,arguments)});var runPostSets=Module["runPostSets"]=(function(){return Module["asm"]["runPostSets"].apply(null,arguments)});var setTempRet0=Module["setTempRet0"]=(function(){return Module["asm"]["setTempRet0"].apply(null,arguments)});var setThrew=Module["setThrew"]=(function(){return Module["asm"]["setThrew"].apply(null,arguments)});var stackAlloc=Module["stackAlloc"]=(function(){return Module["asm"]["stackAlloc"].apply(null,arguments)});var stackRestore=Module["stackRestore"]=(function(){return Module["asm"]["stackRestore"].apply(null,arguments)});var stackSave=Module["stackSave"]=(function(){return Module["asm"]["stackSave"].apply(null,arguments)});var dynCall_dddi=Module["dynCall_dddi"]=(function(){return Module["asm"]["dynCall_dddi"].apply(null,arguments)});var dynCall_ddi=Module["dynCall_ddi"]=(function(){return Module["asm"]["dynCall_ddi"].apply(null,arguments)});var dynCall_dfi=Module["dynCall_dfi"]=(function(){return Module["asm"]["dynCall_dfi"].apply(null,arguments)});var dynCall_di=Module["dynCall_di"]=(function(){return Module["asm"]["dynCall_di"].apply(null,arguments)});var dynCall_diddi=Module["dynCall_diddi"]=(function(){return Module["asm"]["dynCall_diddi"].apply(null,arguments)});var dynCall_didi=Module["dynCall_didi"]=(function(){return Module["asm"]["dynCall_didi"].apply(null,arguments)});var dynCall_dii=Module["dynCall_dii"]=(function(){return Module["asm"]["dynCall_dii"].apply(null,arguments)});var dynCall_diii=Module["dynCall_diii"]=(function(){return Module["asm"]["dynCall_diii"].apply(null,arguments)});var dynCall_diiii=Module["dynCall_diiii"]=(function(){return Module["asm"]["dynCall_diiii"].apply(null,arguments)});var dynCall_dji=Module["dynCall_dji"]=(function(){return Module["asm"]["dynCall_dji"].apply(null,arguments)});var dynCall_f=Module["dynCall_f"]=(function(){return Module["asm"]["dynCall_f"].apply(null,arguments)});var dynCall_fdi=Module["dynCall_fdi"]=(function(){return Module["asm"]["dynCall_fdi"].apply(null,arguments)});var dynCall_ff=Module["dynCall_ff"]=(function(){return Module["asm"]["dynCall_ff"].apply(null,arguments)});var dynCall_fff=Module["dynCall_fff"]=(function(){return Module["asm"]["dynCall_fff"].apply(null,arguments)});var dynCall_ffffi=Module["dynCall_ffffi"]=(function(){return Module["asm"]["dynCall_ffffi"].apply(null,arguments)});var dynCall_fffi=Module["dynCall_fffi"]=(function(){return Module["asm"]["dynCall_fffi"].apply(null,arguments)});var dynCall_fffifffi=Module["dynCall_fffifffi"]=(function(){return Module["asm"]["dynCall_fffifffi"].apply(null,arguments)});var dynCall_ffi=Module["dynCall_ffi"]=(function(){return Module["asm"]["dynCall_ffi"].apply(null,arguments)});var dynCall_fi=Module["dynCall_fi"]=(function(){return Module["asm"]["dynCall_fi"].apply(null,arguments)});var dynCall_fif=Module["dynCall_fif"]=(function(){return Module["asm"]["dynCall_fif"].apply(null,arguments)});var dynCall_fiff=Module["dynCall_fiff"]=(function(){return Module["asm"]["dynCall_fiff"].apply(null,arguments)});var dynCall_fiffi=Module["dynCall_fiffi"]=(function(){return Module["asm"]["dynCall_fiffi"].apply(null,arguments)});var dynCall_fifi=Module["dynCall_fifi"]=(function(){return Module["asm"]["dynCall_fifi"].apply(null,arguments)});var dynCall_fifii=Module["dynCall_fifii"]=(function(){return Module["asm"]["dynCall_fifii"].apply(null,arguments)});var dynCall_fii=Module["dynCall_fii"]=(function(){return Module["asm"]["dynCall_fii"].apply(null,arguments)});var dynCall_fiif=Module["dynCall_fiif"]=(function(){return Module["asm"]["dynCall_fiif"].apply(null,arguments)});var dynCall_fiifi=Module["dynCall_fiifi"]=(function(){return Module["asm"]["dynCall_fiifi"].apply(null,arguments)});var dynCall_fiifii=Module["dynCall_fiifii"]=(function(){return Module["asm"]["dynCall_fiifii"].apply(null,arguments)});var dynCall_fiii=Module["dynCall_fiii"]=(function(){return Module["asm"]["dynCall_fiii"].apply(null,arguments)});var dynCall_fiiii=Module["dynCall_fiiii"]=(function(){return Module["asm"]["dynCall_fiiii"].apply(null,arguments)});var dynCall_fiiiif=Module["dynCall_fiiiif"]=(function(){return Module["asm"]["dynCall_fiiiif"].apply(null,arguments)});var dynCall_fiiiiiifiifif=Module["dynCall_fiiiiiifiifif"]=(function(){return Module["asm"]["dynCall_fiiiiiifiifif"].apply(null,arguments)});var dynCall_fiiiiiifiiiif=Module["dynCall_fiiiiiifiiiif"]=(function(){return Module["asm"]["dynCall_fiiiiiifiiiif"].apply(null,arguments)});var dynCall_fji=Module["dynCall_fji"]=(function(){return Module["asm"]["dynCall_fji"].apply(null,arguments)});var dynCall_i=Module["dynCall_i"]=(function(){return Module["asm"]["dynCall_i"].apply(null,arguments)});var dynCall_idi=Module["dynCall_idi"]=(function(){return Module["asm"]["dynCall_idi"].apply(null,arguments)});var dynCall_idiii=Module["dynCall_idiii"]=(function(){return Module["asm"]["dynCall_idiii"].apply(null,arguments)});var dynCall_ifffi=Module["dynCall_ifffi"]=(function(){return Module["asm"]["dynCall_ifffi"].apply(null,arguments)});var dynCall_iffi=Module["dynCall_iffi"]=(function(){return Module["asm"]["dynCall_iffi"].apply(null,arguments)});var dynCall_ifi=Module["dynCall_ifi"]=(function(){return Module["asm"]["dynCall_ifi"].apply(null,arguments)});var dynCall_ifiii=Module["dynCall_ifiii"]=(function(){return Module["asm"]["dynCall_ifiii"].apply(null,arguments)});var dynCall_ii=Module["dynCall_ii"]=(function(){return Module["asm"]["dynCall_ii"].apply(null,arguments)});var dynCall_iidi=Module["dynCall_iidi"]=(function(){return Module["asm"]["dynCall_iidi"].apply(null,arguments)});var dynCall_iidii=Module["dynCall_iidii"]=(function(){return Module["asm"]["dynCall_iidii"].apply(null,arguments)});var dynCall_iif=Module["dynCall_iif"]=(function(){return Module["asm"]["dynCall_iif"].apply(null,arguments)});var dynCall_iifff=Module["dynCall_iifff"]=(function(){return Module["asm"]["dynCall_iifff"].apply(null,arguments)});var dynCall_iifffi=Module["dynCall_iifffi"]=(function(){return Module["asm"]["dynCall_iifffi"].apply(null,arguments)});var dynCall_iiffi=Module["dynCall_iiffi"]=(function(){return Module["asm"]["dynCall_iiffi"].apply(null,arguments)});var dynCall_iiffiii=Module["dynCall_iiffiii"]=(function(){return Module["asm"]["dynCall_iiffiii"].apply(null,arguments)});var dynCall_iifi=Module["dynCall_iifi"]=(function(){return Module["asm"]["dynCall_iifi"].apply(null,arguments)});var dynCall_iifii=Module["dynCall_iifii"]=(function(){return Module["asm"]["dynCall_iifii"].apply(null,arguments)});var dynCall_iifiii=Module["dynCall_iifiii"]=(function(){return Module["asm"]["dynCall_iifiii"].apply(null,arguments)});var dynCall_iifiiiijii=Module["dynCall_iifiiiijii"]=(function(){return Module["asm"]["dynCall_iifiiiijii"].apply(null,arguments)});var dynCall_iii=Module["dynCall_iii"]=(function(){return Module["asm"]["dynCall_iii"].apply(null,arguments)});var dynCall_iiif=Module["dynCall_iiif"]=(function(){return Module["asm"]["dynCall_iiif"].apply(null,arguments)});var dynCall_iiiff=Module["dynCall_iiiff"]=(function(){return Module["asm"]["dynCall_iiiff"].apply(null,arguments)});var dynCall_iiifi=Module["dynCall_iiifi"]=(function(){return Module["asm"]["dynCall_iiifi"].apply(null,arguments)});var dynCall_iiifii=Module["dynCall_iiifii"]=(function(){return Module["asm"]["dynCall_iiifii"].apply(null,arguments)});var dynCall_iiifiii=Module["dynCall_iiifiii"]=(function(){return Module["asm"]["dynCall_iiifiii"].apply(null,arguments)});var dynCall_iiifiiii=Module["dynCall_iiifiiii"]=(function(){return Module["asm"]["dynCall_iiifiiii"].apply(null,arguments)});var dynCall_iiii=Module["dynCall_iiii"]=(function(){return Module["asm"]["dynCall_iiii"].apply(null,arguments)});var dynCall_iiiifffffi=Module["dynCall_iiiifffffi"]=(function(){return Module["asm"]["dynCall_iiiifffffi"].apply(null,arguments)});var dynCall_iiiifffffii=Module["dynCall_iiiifffffii"]=(function(){return Module["asm"]["dynCall_iiiifffffii"].apply(null,arguments)});var dynCall_iiiifffiii=Module["dynCall_iiiifffiii"]=(function(){return Module["asm"]["dynCall_iiiifffiii"].apply(null,arguments)});var dynCall_iiiifi=Module["dynCall_iiiifi"]=(function(){return Module["asm"]["dynCall_iiiifi"].apply(null,arguments)});var dynCall_iiiifii=Module["dynCall_iiiifii"]=(function(){return Module["asm"]["dynCall_iiiifii"].apply(null,arguments)});var dynCall_iiiifiii=Module["dynCall_iiiifiii"]=(function(){return Module["asm"]["dynCall_iiiifiii"].apply(null,arguments)});var dynCall_iiiifiiii=Module["dynCall_iiiifiiii"]=(function(){return Module["asm"]["dynCall_iiiifiiii"].apply(null,arguments)});var dynCall_iiiifiiiii=Module["dynCall_iiiifiiiii"]=(function(){return Module["asm"]["dynCall_iiiifiiiii"].apply(null,arguments)});var dynCall_iiiii=Module["dynCall_iiiii"]=(function(){return Module["asm"]["dynCall_iiiii"].apply(null,arguments)});var dynCall_iiiiifi=Module["dynCall_iiiiifi"]=(function(){return Module["asm"]["dynCall_iiiiifi"].apply(null,arguments)});var dynCall_iiiiifiii=Module["dynCall_iiiiifiii"]=(function(){return Module["asm"]["dynCall_iiiiifiii"].apply(null,arguments)});var dynCall_iiiiifiiiiif=Module["dynCall_iiiiifiiiiif"]=(function(){return Module["asm"]["dynCall_iiiiifiiiiif"].apply(null,arguments)});var dynCall_iiiiii=Module["dynCall_iiiiii"]=(function(){return Module["asm"]["dynCall_iiiiii"].apply(null,arguments)});var dynCall_iiiiiifff=Module["dynCall_iiiiiifff"]=(function(){return Module["asm"]["dynCall_iiiiiifff"].apply(null,arguments)});var dynCall_iiiiiifffiiifiii=Module["dynCall_iiiiiifffiiifiii"]=(function(){return Module["asm"]["dynCall_iiiiiifffiiifiii"].apply(null,arguments)});var dynCall_iiiiiiffiiiiiiiiiffffiii=Module["dynCall_iiiiiiffiiiiiiiiiffffiii"]=(function(){return Module["asm"]["dynCall_iiiiiiffiiiiiiiiiffffiii"].apply(null,arguments)});var dynCall_iiiiiiffiiiiiiiiiffffiiii=Module["dynCall_iiiiiiffiiiiiiiiiffffiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiffiiiiiiiiiffffiiii"].apply(null,arguments)});var dynCall_iiiiiiffiiiiiiiiiiiiiii=Module["dynCall_iiiiiiffiiiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiffiiiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiifiif=Module["dynCall_iiiiiifiif"]=(function(){return Module["asm"]["dynCall_iiiiiifiif"].apply(null,arguments)});var dynCall_iiiiiifiii=Module["dynCall_iiiiiifiii"]=(function(){return Module["asm"]["dynCall_iiiiiifiii"].apply(null,arguments)});var dynCall_iiiiiii=Module["dynCall_iiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiii"].apply(null,arguments)});var dynCall_iiiiiiifiif=Module["dynCall_iiiiiiifiif"]=(function(){return Module["asm"]["dynCall_iiiiiiifiif"].apply(null,arguments)});var dynCall_iiiiiiii=Module["dynCall_iiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiii=Module["dynCall_iiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiiii=Module["dynCall_iiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiiiii=Module["dynCall_iiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiiiiii=Module["dynCall_iiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiiiiiii=Module["dynCall_iiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiiiiiiii=Module["dynCall_iiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiijjiii=Module["dynCall_iiiiiiijjiii"]=(function(){return Module["asm"]["dynCall_iiiiiiijjiii"].apply(null,arguments)});var dynCall_iiiiiijjiii=Module["dynCall_iiiiiijjiii"]=(function(){return Module["asm"]["dynCall_iiiiiijjiii"].apply(null,arguments)});var dynCall_iiiiij=Module["dynCall_iiiiij"]=(function(){return Module["asm"]["dynCall_iiiiij"].apply(null,arguments)});var dynCall_iiiiiji=Module["dynCall_iiiiiji"]=(function(){return Module["asm"]["dynCall_iiiiiji"].apply(null,arguments)});var dynCall_iiiij=Module["dynCall_iiiij"]=(function(){return Module["asm"]["dynCall_iiiij"].apply(null,arguments)});var dynCall_iiiiji=Module["dynCall_iiiiji"]=(function(){return Module["asm"]["dynCall_iiiiji"].apply(null,arguments)});var dynCall_iiiijii=Module["dynCall_iiiijii"]=(function(){return Module["asm"]["dynCall_iiiijii"].apply(null,arguments)});var dynCall_iiiijiii=Module["dynCall_iiiijiii"]=(function(){return Module["asm"]["dynCall_iiiijiii"].apply(null,arguments)});var dynCall_iiij=Module["dynCall_iiij"]=(function(){return Module["asm"]["dynCall_iiij"].apply(null,arguments)});var dynCall_iiiji=Module["dynCall_iiiji"]=(function(){return Module["asm"]["dynCall_iiiji"].apply(null,arguments)});var dynCall_iiijii=Module["dynCall_iiijii"]=(function(){return Module["asm"]["dynCall_iiijii"].apply(null,arguments)});var dynCall_iiijiii=Module["dynCall_iiijiii"]=(function(){return Module["asm"]["dynCall_iiijiii"].apply(null,arguments)});var dynCall_iiijji=Module["dynCall_iiijji"]=(function(){return Module["asm"]["dynCall_iiijji"].apply(null,arguments)});var dynCall_iij=Module["dynCall_iij"]=(function(){return Module["asm"]["dynCall_iij"].apply(null,arguments)});var dynCall_iiji=Module["dynCall_iiji"]=(function(){return Module["asm"]["dynCall_iiji"].apply(null,arguments)});var dynCall_iijii=Module["dynCall_iijii"]=(function(){return Module["asm"]["dynCall_iijii"].apply(null,arguments)});var dynCall_iijiii=Module["dynCall_iijiii"]=(function(){return Module["asm"]["dynCall_iijiii"].apply(null,arguments)});var dynCall_iijiiii=Module["dynCall_iijiiii"]=(function(){return Module["asm"]["dynCall_iijiiii"].apply(null,arguments)});var dynCall_iijiiiiiii=Module["dynCall_iijiiiiiii"]=(function(){return Module["asm"]["dynCall_iijiiiiiii"].apply(null,arguments)});var dynCall_iijji=Module["dynCall_iijji"]=(function(){return Module["asm"]["dynCall_iijji"].apply(null,arguments)});var dynCall_iijjii=Module["dynCall_iijjii"]=(function(){return Module["asm"]["dynCall_iijjii"].apply(null,arguments)});var dynCall_iijjiii=Module["dynCall_iijjiii"]=(function(){return Module["asm"]["dynCall_iijjiii"].apply(null,arguments)});var dynCall_iijjji=Module["dynCall_iijjji"]=(function(){return Module["asm"]["dynCall_iijjji"].apply(null,arguments)});var dynCall_ij=Module["dynCall_ij"]=(function(){return Module["asm"]["dynCall_ij"].apply(null,arguments)});var dynCall_iji=Module["dynCall_iji"]=(function(){return Module["asm"]["dynCall_iji"].apply(null,arguments)});var dynCall_ijiii=Module["dynCall_ijiii"]=(function(){return Module["asm"]["dynCall_ijiii"].apply(null,arguments)});var dynCall_ijj=Module["dynCall_ijj"]=(function(){return Module["asm"]["dynCall_ijj"].apply(null,arguments)});var dynCall_ijji=Module["dynCall_ijji"]=(function(){return Module["asm"]["dynCall_ijji"].apply(null,arguments)});var dynCall_j=Module["dynCall_j"]=(function(){return Module["asm"]["dynCall_j"].apply(null,arguments)});var dynCall_jdi=Module["dynCall_jdi"]=(function(){return Module["asm"]["dynCall_jdi"].apply(null,arguments)});var dynCall_jdii=Module["dynCall_jdii"]=(function(){return Module["asm"]["dynCall_jdii"].apply(null,arguments)});var dynCall_jfi=Module["dynCall_jfi"]=(function(){return Module["asm"]["dynCall_jfi"].apply(null,arguments)});var dynCall_ji=Module["dynCall_ji"]=(function(){return Module["asm"]["dynCall_ji"].apply(null,arguments)});var dynCall_jidi=Module["dynCall_jidi"]=(function(){return Module["asm"]["dynCall_jidi"].apply(null,arguments)});var dynCall_jidii=Module["dynCall_jidii"]=(function(){return Module["asm"]["dynCall_jidii"].apply(null,arguments)});var dynCall_jii=Module["dynCall_jii"]=(function(){return Module["asm"]["dynCall_jii"].apply(null,arguments)});var dynCall_jiii=Module["dynCall_jiii"]=(function(){return Module["asm"]["dynCall_jiii"].apply(null,arguments)});var dynCall_jiiii=Module["dynCall_jiiii"]=(function(){return Module["asm"]["dynCall_jiiii"].apply(null,arguments)});var dynCall_jiiiii=Module["dynCall_jiiiii"]=(function(){return Module["asm"]["dynCall_jiiiii"].apply(null,arguments)});var dynCall_jiiiiii=Module["dynCall_jiiiiii"]=(function(){return Module["asm"]["dynCall_jiiiiii"].apply(null,arguments)});var dynCall_jiiiiiiiiii=Module["dynCall_jiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_jiiiiiiiiii"].apply(null,arguments)});var dynCall_jiiji=Module["dynCall_jiiji"]=(function(){return Module["asm"]["dynCall_jiiji"].apply(null,arguments)});var dynCall_jiji=Module["dynCall_jiji"]=(function(){return Module["asm"]["dynCall_jiji"].apply(null,arguments)});var dynCall_jijii=Module["dynCall_jijii"]=(function(){return Module["asm"]["dynCall_jijii"].apply(null,arguments)});var dynCall_jijiii=Module["dynCall_jijiii"]=(function(){return Module["asm"]["dynCall_jijiii"].apply(null,arguments)});var dynCall_jijj=Module["dynCall_jijj"]=(function(){return Module["asm"]["dynCall_jijj"].apply(null,arguments)});var dynCall_jijji=Module["dynCall_jijji"]=(function(){return Module["asm"]["dynCall_jijji"].apply(null,arguments)});var dynCall_jji=Module["dynCall_jji"]=(function(){return Module["asm"]["dynCall_jji"].apply(null,arguments)});var dynCall_v=Module["dynCall_v"]=(function(){return Module["asm"]["dynCall_v"].apply(null,arguments)});var dynCall_vd=Module["dynCall_vd"]=(function(){return Module["asm"]["dynCall_vd"].apply(null,arguments)});var dynCall_vf=Module["dynCall_vf"]=(function(){return Module["asm"]["dynCall_vf"].apply(null,arguments)});var dynCall_vff=Module["dynCall_vff"]=(function(){return Module["asm"]["dynCall_vff"].apply(null,arguments)});var dynCall_vfff=Module["dynCall_vfff"]=(function(){return Module["asm"]["dynCall_vfff"].apply(null,arguments)});var dynCall_vffff=Module["dynCall_vffff"]=(function(){return Module["asm"]["dynCall_vffff"].apply(null,arguments)});var dynCall_vffffi=Module["dynCall_vffffi"]=(function(){return Module["asm"]["dynCall_vffffi"].apply(null,arguments)});var dynCall_vfffi=Module["dynCall_vfffi"]=(function(){return Module["asm"]["dynCall_vfffi"].apply(null,arguments)});var dynCall_vfi=Module["dynCall_vfi"]=(function(){return Module["asm"]["dynCall_vfi"].apply(null,arguments)});var dynCall_vi=Module["dynCall_vi"]=(function(){return Module["asm"]["dynCall_vi"].apply(null,arguments)});var dynCall_vid=Module["dynCall_vid"]=(function(){return Module["asm"]["dynCall_vid"].apply(null,arguments)});var dynCall_vidd=Module["dynCall_vidd"]=(function(){return Module["asm"]["dynCall_vidd"].apply(null,arguments)});var dynCall_vidi=Module["dynCall_vidi"]=(function(){return Module["asm"]["dynCall_vidi"].apply(null,arguments)});var dynCall_vif=Module["dynCall_vif"]=(function(){return Module["asm"]["dynCall_vif"].apply(null,arguments)});var dynCall_viff=Module["dynCall_viff"]=(function(){return Module["asm"]["dynCall_viff"].apply(null,arguments)});var dynCall_vifff=Module["dynCall_vifff"]=(function(){return Module["asm"]["dynCall_vifff"].apply(null,arguments)});var dynCall_viffff=Module["dynCall_viffff"]=(function(){return Module["asm"]["dynCall_viffff"].apply(null,arguments)});var dynCall_viffffi=Module["dynCall_viffffi"]=(function(){return Module["asm"]["dynCall_viffffi"].apply(null,arguments)});var dynCall_viffffii=Module["dynCall_viffffii"]=(function(){return Module["asm"]["dynCall_viffffii"].apply(null,arguments)});var dynCall_viffffiifffiiiiif=Module["dynCall_viffffiifffiiiiif"]=(function(){return Module["asm"]["dynCall_viffffiifffiiiiif"].apply(null,arguments)});var dynCall_vifffi=Module["dynCall_vifffi"]=(function(){return Module["asm"]["dynCall_vifffi"].apply(null,arguments)});var dynCall_vifffii=Module["dynCall_vifffii"]=(function(){return Module["asm"]["dynCall_vifffii"].apply(null,arguments)});var dynCall_viffi=Module["dynCall_viffi"]=(function(){return Module["asm"]["dynCall_viffi"].apply(null,arguments)});var dynCall_viffii=Module["dynCall_viffii"]=(function(){return Module["asm"]["dynCall_viffii"].apply(null,arguments)});var dynCall_viffiifffffiii=Module["dynCall_viffiifffffiii"]=(function(){return Module["asm"]["dynCall_viffiifffffiii"].apply(null,arguments)});var dynCall_viffiii=Module["dynCall_viffiii"]=(function(){return Module["asm"]["dynCall_viffiii"].apply(null,arguments)});var dynCall_viffiiiif=Module["dynCall_viffiiiif"]=(function(){return Module["asm"]["dynCall_viffiiiif"].apply(null,arguments)});var dynCall_vifi=Module["dynCall_vifi"]=(function(){return Module["asm"]["dynCall_vifi"].apply(null,arguments)});var dynCall_vifii=Module["dynCall_vifii"]=(function(){return Module["asm"]["dynCall_vifii"].apply(null,arguments)});var dynCall_vifiiii=Module["dynCall_vifiiii"]=(function(){return Module["asm"]["dynCall_vifiiii"].apply(null,arguments)});var dynCall_vifijii=Module["dynCall_vifijii"]=(function(){return Module["asm"]["dynCall_vifijii"].apply(null,arguments)});var dynCall_vii=Module["dynCall_vii"]=(function(){return Module["asm"]["dynCall_vii"].apply(null,arguments)});var dynCall_viid=Module["dynCall_viid"]=(function(){return Module["asm"]["dynCall_viid"].apply(null,arguments)});var dynCall_viidi=Module["dynCall_viidi"]=(function(){return Module["asm"]["dynCall_viidi"].apply(null,arguments)});var dynCall_viidii=Module["dynCall_viidii"]=(function(){return Module["asm"]["dynCall_viidii"].apply(null,arguments)});var dynCall_viif=Module["dynCall_viif"]=(function(){return Module["asm"]["dynCall_viif"].apply(null,arguments)});var dynCall_viiff=Module["dynCall_viiff"]=(function(){return Module["asm"]["dynCall_viiff"].apply(null,arguments)});var dynCall_viifff=Module["dynCall_viifff"]=(function(){return Module["asm"]["dynCall_viifff"].apply(null,arguments)});var dynCall_viifffi=Module["dynCall_viifffi"]=(function(){return Module["asm"]["dynCall_viifffi"].apply(null,arguments)});var dynCall_viiffi=Module["dynCall_viiffi"]=(function(){return Module["asm"]["dynCall_viiffi"].apply(null,arguments)});var dynCall_viiffii=Module["dynCall_viiffii"]=(function(){return Module["asm"]["dynCall_viiffii"].apply(null,arguments)});var dynCall_viifi=Module["dynCall_viifi"]=(function(){return Module["asm"]["dynCall_viifi"].apply(null,arguments)});var dynCall_viifii=Module["dynCall_viifii"]=(function(){return Module["asm"]["dynCall_viifii"].apply(null,arguments)});var dynCall_viifiii=Module["dynCall_viifiii"]=(function(){return Module["asm"]["dynCall_viifiii"].apply(null,arguments)});var dynCall_viifiiii=Module["dynCall_viifiiii"]=(function(){return Module["asm"]["dynCall_viifiiii"].apply(null,arguments)});var dynCall_viii=Module["dynCall_viii"]=(function(){return Module["asm"]["dynCall_viii"].apply(null,arguments)});var dynCall_viiidi=Module["dynCall_viiidi"]=(function(){return Module["asm"]["dynCall_viiidi"].apply(null,arguments)});var dynCall_viiif=Module["dynCall_viiif"]=(function(){return Module["asm"]["dynCall_viiif"].apply(null,arguments)});var dynCall_viiifffi=Module["dynCall_viiifffi"]=(function(){return Module["asm"]["dynCall_viiifffi"].apply(null,arguments)});var dynCall_viiiffi=Module["dynCall_viiiffi"]=(function(){return Module["asm"]["dynCall_viiiffi"].apply(null,arguments)});var dynCall_viiiffii=Module["dynCall_viiiffii"]=(function(){return Module["asm"]["dynCall_viiiffii"].apply(null,arguments)});var dynCall_viiifi=Module["dynCall_viiifi"]=(function(){return Module["asm"]["dynCall_viiifi"].apply(null,arguments)});var dynCall_viiififfi=Module["dynCall_viiififfi"]=(function(){return Module["asm"]["dynCall_viiififfi"].apply(null,arguments)});var dynCall_viiififi=Module["dynCall_viiififi"]=(function(){return Module["asm"]["dynCall_viiififi"].apply(null,arguments)});var dynCall_viiifii=Module["dynCall_viiifii"]=(function(){return Module["asm"]["dynCall_viiifii"].apply(null,arguments)});var dynCall_viiifiii=Module["dynCall_viiifiii"]=(function(){return Module["asm"]["dynCall_viiifiii"].apply(null,arguments)});var dynCall_viiifiiiii=Module["dynCall_viiifiiiii"]=(function(){return Module["asm"]["dynCall_viiifiiiii"].apply(null,arguments)});var dynCall_viiii=Module["dynCall_viiii"]=(function(){return Module["asm"]["dynCall_viiii"].apply(null,arguments)});var dynCall_viiiif=Module["dynCall_viiiif"]=(function(){return Module["asm"]["dynCall_viiiif"].apply(null,arguments)});var dynCall_viiiifi=Module["dynCall_viiiifi"]=(function(){return Module["asm"]["dynCall_viiiifi"].apply(null,arguments)});var dynCall_viiiifii=Module["dynCall_viiiifii"]=(function(){return Module["asm"]["dynCall_viiiifii"].apply(null,arguments)});var dynCall_viiiifiiiiif=Module["dynCall_viiiifiiiiif"]=(function(){return Module["asm"]["dynCall_viiiifiiiiif"].apply(null,arguments)});var dynCall_viiiii=Module["dynCall_viiiii"]=(function(){return Module["asm"]["dynCall_viiiii"].apply(null,arguments)});var dynCall_viiiiif=Module["dynCall_viiiiif"]=(function(){return Module["asm"]["dynCall_viiiiif"].apply(null,arguments)});var dynCall_viiiiiffi=Module["dynCall_viiiiiffi"]=(function(){return Module["asm"]["dynCall_viiiiiffi"].apply(null,arguments)});var dynCall_viiiiiffii=Module["dynCall_viiiiiffii"]=(function(){return Module["asm"]["dynCall_viiiiiffii"].apply(null,arguments)});var dynCall_viiiiifi=Module["dynCall_viiiiifi"]=(function(){return Module["asm"]["dynCall_viiiiifi"].apply(null,arguments)});var dynCall_viiiiii=Module["dynCall_viiiiii"]=(function(){return Module["asm"]["dynCall_viiiiii"].apply(null,arguments)});var dynCall_viiiiiif=Module["dynCall_viiiiiif"]=(function(){return Module["asm"]["dynCall_viiiiiif"].apply(null,arguments)});var dynCall_viiiiiii=Module["dynCall_viiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiii"].apply(null,arguments)});var dynCall_viiiiiiifi=Module["dynCall_viiiiiiifi"]=(function(){return Module["asm"]["dynCall_viiiiiiifi"].apply(null,arguments)});var dynCall_viiiiiiii=Module["dynCall_viiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiii=Module["dynCall_viiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiii=Module["dynCall_viiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiiii=Module["dynCall_viiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiiiifii=Module["dynCall_viiiiiiiiiiifii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiiifii"].apply(null,arguments)});var dynCall_viiiiiiiiiiii=Module["dynCall_viiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiiiiii=Module["dynCall_viiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiiiiiii=Module["dynCall_viiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiiiiiiii=Module["dynCall_viiiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiiiiiiiiiii=Module["dynCall_viiiiiiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_viiiij=Module["dynCall_viiiij"]=(function(){return Module["asm"]["dynCall_viiiij"].apply(null,arguments)});var dynCall_viiiijiiii=Module["dynCall_viiiijiiii"]=(function(){return Module["asm"]["dynCall_viiiijiiii"].apply(null,arguments)});var dynCall_viiiijjiii=Module["dynCall_viiiijjiii"]=(function(){return Module["asm"]["dynCall_viiiijjiii"].apply(null,arguments)});var dynCall_viiiji=Module["dynCall_viiiji"]=(function(){return Module["asm"]["dynCall_viiiji"].apply(null,arguments)});var dynCall_viiijji=Module["dynCall_viiijji"]=(function(){return Module["asm"]["dynCall_viiijji"].apply(null,arguments)});var dynCall_viiijjii=Module["dynCall_viiijjii"]=(function(){return Module["asm"]["dynCall_viiijjii"].apply(null,arguments)});var dynCall_viiijjiii=Module["dynCall_viiijjiii"]=(function(){return Module["asm"]["dynCall_viiijjiii"].apply(null,arguments)});var dynCall_viij=Module["dynCall_viij"]=(function(){return Module["asm"]["dynCall_viij"].apply(null,arguments)});var dynCall_viiji=Module["dynCall_viiji"]=(function(){return Module["asm"]["dynCall_viiji"].apply(null,arguments)});var dynCall_viijii=Module["dynCall_viijii"]=(function(){return Module["asm"]["dynCall_viijii"].apply(null,arguments)});var dynCall_viijiijiii=Module["dynCall_viijiijiii"]=(function(){return Module["asm"]["dynCall_viijiijiii"].apply(null,arguments)});var dynCall_viijijii=Module["dynCall_viijijii"]=(function(){return Module["asm"]["dynCall_viijijii"].apply(null,arguments)});var dynCall_viijijiii=Module["dynCall_viijijiii"]=(function(){return Module["asm"]["dynCall_viijijiii"].apply(null,arguments)});var dynCall_viijijj=Module["dynCall_viijijj"]=(function(){return Module["asm"]["dynCall_viijijj"].apply(null,arguments)});var dynCall_viijj=Module["dynCall_viijj"]=(function(){return Module["asm"]["dynCall_viijj"].apply(null,arguments)});var dynCall_viijji=Module["dynCall_viijji"]=(function(){return Module["asm"]["dynCall_viijji"].apply(null,arguments)});var dynCall_viijjii=Module["dynCall_viijjii"]=(function(){return Module["asm"]["dynCall_viijjii"].apply(null,arguments)});var dynCall_viijjiii=Module["dynCall_viijjiii"]=(function(){return Module["asm"]["dynCall_viijjiii"].apply(null,arguments)});var dynCall_viijjji=Module["dynCall_viijjji"]=(function(){return Module["asm"]["dynCall_viijjji"].apply(null,arguments)});var dynCall_vij=Module["dynCall_vij"]=(function(){return Module["asm"]["dynCall_vij"].apply(null,arguments)});var dynCall_viji=Module["dynCall_viji"]=(function(){return Module["asm"]["dynCall_viji"].apply(null,arguments)});var dynCall_vijii=Module["dynCall_vijii"]=(function(){return Module["asm"]["dynCall_vijii"].apply(null,arguments)});var dynCall_vijiii=Module["dynCall_vijiii"]=(function(){return Module["asm"]["dynCall_vijiii"].apply(null,arguments)});var dynCall_vijiji=Module["dynCall_vijiji"]=(function(){return Module["asm"]["dynCall_vijiji"].apply(null,arguments)});var dynCall_vijijji=Module["dynCall_vijijji"]=(function(){return Module["asm"]["dynCall_vijijji"].apply(null,arguments)});var dynCall_vijji=Module["dynCall_vijji"]=(function(){return Module["asm"]["dynCall_vijji"].apply(null,arguments)});var dynCall_vijjii=Module["dynCall_vijjii"]=(function(){return Module["asm"]["dynCall_vijjii"].apply(null,arguments)});var dynCall_vjii=Module["dynCall_vjii"]=(function(){return Module["asm"]["dynCall_vjii"].apply(null,arguments)});var dynCall_vjiiii=Module["dynCall_vjiiii"]=(function(){return Module["asm"]["dynCall_vjiiii"].apply(null,arguments)});var dynCall_vjji=Module["dynCall_vjji"]=(function(){return Module["asm"]["dynCall_vjji"].apply(null,arguments)});Module["asm"]=asm;Module["ccall"]=ccall;Module["cwrap"]=cwrap;Module["stackTrace"]=stackTrace;Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}ExitStatus.prototype=new Error;ExitStatus.prototype.constructor=ExitStatus;var initialStackTop;var calledMain=false;dependenciesFulfilled=function runCaller(){if(!Module["calledRun"])run();if(!Module["calledRun"])dependenciesFulfilled=runCaller};Module["callMain"]=function callMain(args){args=args||[];ensureInitRuntime();var argc=args.length+1;var argv=stackAlloc((argc+1)*4);HEAP32[argv>>2]=allocateUTF8OnStack(Module["thisProgram"]);for(var i=1;i>2)+i]=allocateUTF8OnStack(args[i-1])}HEAP32[(argv>>2)+argc]=0;try{var ret=Module["_main"](argc,argv,0);exit(ret,true)}catch(e){if(e instanceof ExitStatus){return}else if(e=="SimulateInfiniteLoop"){Module["noExitRuntime"]=true;return}else{var toLog=e;if(e&&typeof e==="object"&&e.stack){toLog=[e,e.stack]}err("exception thrown: "+toLog);Module["quit"](1,e)}}finally{calledMain=true}};function run(args){args=args||Module["arguments"];if(runDependencies>0){return}preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(Module["_main"]&&shouldRunNow)Module["callMain"](args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout((function(){setTimeout((function(){Module["setStatus"]("")}),1);doRun()}),1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){if(implicit&&Module["noExitRuntime"]&&status===0){return}if(Module["noExitRuntime"]){}else{ABORT=true;EXITSTATUS=status;STACKTOP=initialStackTop;exitRuntime();if(Module["onExit"])Module["onExit"](status)}Module["quit"](status,new ExitStatus(status))}function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(what!==undefined){out(what);err(what);what=JSON.stringify(what)}else{what=""}ABORT=true;EXITSTATUS=1;throw"abort("+what+"). Build with -s ASSERTIONS=1 for more info."}Module["abort"]=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"]){shouldRunNow=false}Module["noExitRuntime"]=true;run() - - - - -} diff --git a/Build/Demo.loader.js b/Build/Demo.loader.js deleted file mode 100644 index 78fdaee..0000000 --- a/Build/Demo.loader.js +++ /dev/null @@ -1 +0,0 @@ -function createUnityInstance(e,t,r){function n(e){var t="unhandledrejection"==e.type&&"object"==typeof e.reason?e.reason:"object"==typeof e.error?e.error:null,r=t?t.toString():"string"==typeof e.message?e.message:"string"==typeof e.reason?e.reason:"";if(t&&"string"==typeof t.stack&&(r+="\n"+t.stack.substring(t.stack.lastIndexOf(r,0)?0:r.length).replace(/(^\n*|\n*$)/g,"")),r&&l.stackTraceRegExp&&l.stackTraceRegExp.test(r)){var n=e instanceof ErrorEvent?e.filename:t&&"string"==typeof t.fileName?t.fileName:t&&"string"==typeof t.sourceURL?t.sourceURL:"",o=e instanceof ErrorEvent?e.lineno:t&&"number"==typeof t.lineNumber?t.lineNumber:t&&"number"==typeof t.line?t.line:0;a(r,n,o)}}function o(e){e.preventDefault()}function a(e,t,r){if(l.startupErrorHandler)return void l.startupErrorHandler(e,t,r);if(!(l.errorHandler&&l.errorHandler(e,t,r)||(console.log("Invoking error handler due to\n"+e),"function"==typeof dump&&dump("Invoking error handler due to\n"+e),e.indexOf("UnknownError")!=-1||e.indexOf("Program terminated with exit(0)")!=-1||a.didShowErrorMessage))){var e="An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:\n"+e;e.indexOf("DISABLE_EXCEPTION_CATCHING")!=-1?e="An exception has occurred, but exception handling has been disabled in this build. If you are the developer of this content, enable exceptions in your project WebGL player settings to be able to catch the exception or see the stack trace.":e.indexOf("Cannot enlarge memory arrays")!=-1?e="Out of memory. If you are the developer of this content, try allocating more memory to your WebGL build in the WebGL player settings.":e.indexOf("Invalid array buffer length")==-1&&e.indexOf("Invalid typed array length")==-1&&e.indexOf("out of memory")==-1&&e.indexOf("could not allocate memory")==-1||(e="The browser could not allocate enough memory for the WebGL content. If you are the developer of this content, try allocating less memory to your WebGL build in the WebGL player settings."),alert(e),a.didShowErrorMessage=!0}}function s(e,t){if("symbolsUrl"!=e){var n=l.downloadProgress[e];n||(n=l.downloadProgress[e]={started:!1,finished:!1,lengthComputable:!1,total:0,loaded:0}),"object"!=typeof t||"progress"!=t.type&&"load"!=t.type||(n.started||(n.started=!0,n.lengthComputable=t.lengthComputable,n.total=t.total),n.loaded=t.loaded,"load"==t.type&&(n.finished=!0));var o=0,a=0,s=0,i=0,d=0;for(var e in l.downloadProgress){var n=l.downloadProgress[e];if(!n.started)return 0;s++,n.lengthComputable?(o+=n.loaded,a+=n.total,i++):n.finished||d++}var u=s?(s-d-(a?i*(a-o)/a:0))/s:0;r(.9*u)}}function i(e){return new Promise(function(t,r){s(e);var n=l.companyName&&l.productName?new l.XMLHttpRequest({companyName:l.companyName,productName:l.productName,cacheControl:l.cacheControl(l[e])}):new XMLHttpRequest;n.open("GET",l[e]),n.responseType="arraybuffer",n.addEventListener("progress",function(t){s(e,t)}),n.addEventListener("load",function(r){s(e,r),t(new Uint8Array(n.response))}),n.send()})}function d(){return new Promise(function(e,t){var r=document.createElement("script");r.src=l.frameworkUrl,r.onload=function(){var t=unityFramework;unityFramework=null,r.onload=null,e(t)},document.body.appendChild(r),l.deinitializers.push(function(){document.body.removeChild(r)})})}function u(){d().then(function(e){e(l)});var e=i("dataUrl");l.preRun.push(function(){l.addRunDependency("dataUrl"),e.then(function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=0,n="UnityWebData1.0\0";if(!String.fromCharCode.apply(null,e.subarray(r,r+n.length))==n)throw"unknown data format";r+=n.length;var o=t.getUint32(r,!0);for(r+=4;r0;u=c,c=d.indexOf("/",u)+1)l.FS_createPath(d.substring(0,u),d.substring(u,c-1),!0,!0);l.FS_createDataFile(d,null,e.subarray(a,a+s),!0,!0,!0)}l.removeRunDependency("dataUrl")})})}r=r||function(){};var l={canvas:e,webglContextAttributes:{preserveDrawingBuffer:!1},cacheControl:function(e){return e==l.dataUrl?"must-revalidate":"no-store"},streamingAssetsUrl:"StreamingAssets",downloadProgress:{},deinitializers:[],intervals:{},setInterval:function(e,t){var r=window.setInterval(e,t);return this.intervals[r]=!0,r},clearInterval:function(e){delete this.intervals[e],window.clearInterval(e)},preRun:[],postRun:[],print:function(e){console.log(e)},printErr:function(e){console.error(e)},locateFile:function(e){return"build.wasm"==e?this.codeUrl:e},disabledCanvasEvents:["contextmenu","dragstart"]};for(var c in t)l[c]=t[c];l.streamingAssetsUrl=new URL(l.streamingAssetsUrl,document.URL).href;var f=l.disabledCanvasEvents.slice();f.forEach(function(t){e.addEventListener(t,o)}),window.addEventListener("error",n),window.addEventListener("unhandledrejection",n);var p={Module:l,SetFullscreen:function(){return l.SetFullscreen?l.SetFullscreen.apply(l,arguments):void l.print("Failed to set Fullscreen mode: Player not loaded yet.")},SendMessage:function(){return l.SendMessage?l.SendMessage.apply(l,arguments):void l.print("Failed to execute SendMessage: Player not loaded yet.")},Quit:function(){return new Promise(function(t,r){l.shouldQuit=!0,l.onQuit=t,f.forEach(function(t){e.removeEventListener(t,o)}),window.removeEventListener("error",n),window.removeEventListener("unhandledrejection",n)})}};return l.SystemInfo=function(){function e(e,t,r){return e=RegExp(e,"i").exec(t),e&&e[r]}for(var t,r,n,o,a,s,i=navigator.userAgent+" ",d=[["Firefox","Firefox"],["OPR","Opera"],["Edg","Edge"],["SamsungBrowser","Samsung Browser"],["Trident","Internet Explorer"],["MSIE","Internet Explorer"],["Chrome","Chrome"],["CriOS","Chrome on iOS Safari"],["FxiOS","Firefox on iOS Safari"],["Safari","Safari"]],u=0;u 0; folder = folderNext, folderNext = path.indexOf("/", folder) + 1) - Module.FS_createPath(path.substring(0, folder), path.substring(folder, folderNext - 1), true, true); - Module.FS_createDataFile(path, null, data.subarray(offset, offset + size), true, true, true); - } - Module.removeRunDependency("dataUrl"); - }); - }); - } - - return new Promise(function (resolve, reject) { - if (!Module.SystemInfo.hasWebGL) { - reject("Your browser does not support WebGL."); - } else if (!Module.SystemInfo.hasWasm) { - reject("Your browser does not support WebAssembly."); - } else { - if (Module.SystemInfo.hasWebGL == 1) - Module.print("Warning: Your browser does not support \"WebGL 2.0\" Graphics API, switching to \"WebGL 1.0\""); - Module.startupErrorHandler = reject; - onProgress(0); - Module.postRun.push(function () { - onProgress(1); - delete Module.startupErrorHandler; - resolve(unityInstance); - }); - loadBuild(); - } - }); -} diff --git a/TemplateData/favicon.ico b/TemplateData/favicon.ico deleted file mode 100644 index dd6bf7e..0000000 Binary files a/TemplateData/favicon.ico and /dev/null differ diff --git a/TemplateData/fullscreen-button.png b/TemplateData/fullscreen-button.png deleted file mode 100644 index e7b6496..0000000 Binary files a/TemplateData/fullscreen-button.png and /dev/null differ diff --git a/TemplateData/progress-bar-empty-dark.png b/TemplateData/progress-bar-empty-dark.png deleted file mode 100644 index d01612f..0000000 Binary files a/TemplateData/progress-bar-empty-dark.png and /dev/null differ diff --git a/TemplateData/progress-bar-empty-light.png b/TemplateData/progress-bar-empty-light.png deleted file mode 100644 index 593a329..0000000 Binary files a/TemplateData/progress-bar-empty-light.png and /dev/null differ diff --git a/TemplateData/progress-bar-full-dark.png b/TemplateData/progress-bar-full-dark.png deleted file mode 100644 index c432c86..0000000 Binary files a/TemplateData/progress-bar-full-dark.png and /dev/null differ diff --git a/TemplateData/progress-bar-full-light.png b/TemplateData/progress-bar-full-light.png deleted file mode 100644 index e683131..0000000 Binary files a/TemplateData/progress-bar-full-light.png and /dev/null differ diff --git a/TemplateData/style.css b/TemplateData/style.css deleted file mode 100644 index f29885f..0000000 --- a/TemplateData/style.css +++ /dev/null @@ -1,16 +0,0 @@ -body { padding: 0; margin: 0 } -#unity-container { position: absolute } -#unity-container.unity-desktop { left: 50%; top: 50%; transform: translate(-50%, -50%) } -#unity-container.unity-mobile { width: 100%; height: 100% } -#unity-canvas { background: #231F20 } -.unity-mobile #unity-canvas { width: 100%; height: 100% } -#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none } -#unity-logo { width: 154px; height: 130px; background: url('unity-logo-dark.png') no-repeat center } -#unity-progress-bar-empty { width: 141px; height: 18px; margin-top: 10px; background: url('progress-bar-empty-dark.png') no-repeat center } -#unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-dark.png') no-repeat center } -#unity-footer { position: relative } -.unity-mobile #unity-footer { display: none } -#unity-webgl-logo { float:left; width: 204px; height: 38px; background: url('webgl-logo.png') no-repeat center } -#unity-build-title { float: right; margin-right: 10px; line-height: 38px; font-family: arial; font-size: 18px } -#unity-fullscreen-button { float: right; width: 38px; height: 38px; background: url('fullscreen-button.png') no-repeat center } -#unity-mobile-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none } diff --git a/TemplateData/unity-logo-dark.png b/TemplateData/unity-logo-dark.png deleted file mode 100644 index 597665d..0000000 Binary files a/TemplateData/unity-logo-dark.png and /dev/null differ diff --git a/TemplateData/unity-logo-light.png b/TemplateData/unity-logo-light.png deleted file mode 100644 index ad281ab..0000000 Binary files a/TemplateData/unity-logo-light.png and /dev/null differ diff --git a/TemplateData/webgl-logo.png b/TemplateData/webgl-logo.png deleted file mode 100644 index ed9efa2..0000000 Binary files a/TemplateData/webgl-logo.png and /dev/null differ diff --git a/__game-scripts.js b/__game-scripts.js new file mode 100644 index 0000000..c95c175 --- /dev/null +++ b/__game-scripts.js @@ -0,0 +1 @@ +var Mouse=pc.createScript("mouse"),Selected=0;Mouse.attributes.add("redMaterial",{type:"asset",assetType:"material"}),Mouse.attributes.add("greenMaterial",{type:"asset",assetType:"material"}),Mouse.attributes.add("blueMaterial",{type:"asset",assetType:"material"}),Mouse.prototype.initialize=function(){this.pos=new pc.Vec3,this.app.mouse.disableContextMenu(),this.app.mouse.on(pc.EVENT_MOUSEMOVE,this.onMouseMove,this),this.app.mouse.on(pc.EVENT_MOUSEDOWN,this.onMouseDown,this),this.app.mouse.on(pc.EVENT_MOUSEUP,this.onMouseUp,this)},Mouse.prototype.onMouseMove=function(t){if(1==Selected){this.app.graphicsDevice.canvas.clientWidth;var e=this.app.graphicsDevice.canvas.clientHeight,s=(e-t.y)/e*16;console.log("depth: = "+s);var o=this.entity.getPosition();this.app.root.findByName("Camera").camera.screenToWorld(t.x,t.y,s,this.pos),this.entity.setPosition(this.pos.x,o.y,this.pos.z),this.entity.getPosition().z>3&&this.entity.setPosition(this.pos.x,o.y,3),console.log(this.pos)}},Mouse.prototype.onMouseDown=function(t){t.button===pc.MOUSEBUTTON_LEFT&&(Selected=1)},Mouse.prototype.onMouseUp=function(t){t.button===pc.MOUSEBUTTON_LEFT&&(Selected=0)};var Touch=pc.createScript("touch"),LastX=0,LastY=0,dx=0,dy=0;Touch.prototype.initialize=function(){this.pos=new pc.Vec3,this.cameraEntity=this.app.root.findByName("Camera");var t=this.app.touch;t&&(t.on(pc.EVENT_TOUCHSTART,this.onTouchStart,this),t.on(pc.EVENT_TOUCHMOVE,this.onTouchMove,this),t.on(pc.EVENT_TOUCHEND,this.onTouchEnd,this),t.on(pc.EVENT_TOUCHCANCEL,this.onTouchCancel,this)),this.on("destroy",(function(){t.off(pc.EVENT_TOUCHSTART,this.onTouchStart,this),t.off(pc.EVENT_TOUCHMOVE,this.onTouchMove,this),t.off(pc.EVENT_TOUCHEND,this.onTouchEnd,this),t.off(pc.EVENT_TOUCHCANCEL,this.onTouchCancel,this)}),this)},Touch.prototype.updateFromScreen=function(t){this.app.graphicsDevice.canvas.clientWidth;var o=this.app.graphicsDevice.canvas.clientHeight,e=(o-t.y)/o*16;console.log("depth: = "+e);var i=this.entity.getPosition();this.app.root.findByName("Camera").camera.screenToWorld(t.x,t.y,e,this.pos),this.entity.setPosition(this.pos.x,i.y,this.pos.z),this.entity.getPosition().z>3&&this.entity.setPosition(this.pos.x,i.y,3),console.log(this.pos)},Touch.prototype.onTouchStart=function(t){1===t.touches.length&&this.updateFromScreen(t.touches[0]),t.event.preventDefault()},Touch.prototype.onTouchMove=function(t){this.updateFromScreen(t.touches[0]),t.event.preventDefault()},Touch.prototype.onTouchEnd=function(t){t.event.preventDefault()},Touch.prototype.onTouchCancel=function(t){t.event.preventDefault()}; \ No newline at end of file diff --git a/__loading__.js b/__loading__.js new file mode 100644 index 0000000..627a013 --- /dev/null +++ b/__loading__.js @@ -0,0 +1,112 @@ +pc.script.createLoadingScreen(function (app) { + var showSplash = function () { + // splash wrapper + var wrapper = document.createElement('div'); + wrapper.id = 'application-splash-wrapper'; + document.body.appendChild(wrapper); + + // splash + var splash = document.createElement('div'); + splash.id = 'application-splash'; + wrapper.appendChild(splash); + splash.style.display = 'none'; + + var logo = document.createElement('img'); + logo.src = ASSET_PREFIX + 'logo.png'; + splash.appendChild(logo); + logo.onload = function () { + splash.style.display = 'block'; + }; + + var container = document.createElement('div'); + container.id = 'progress-bar-container'; + splash.appendChild(container); + + var bar = document.createElement('div'); + bar.id = 'progress-bar'; + container.appendChild(bar); + + }; + + var hideSplash = function () { + var splash = document.getElementById('application-splash-wrapper'); + splash.parentElement.removeChild(splash); + }; + + var setProgress = function (value) { + var bar = document.getElementById('progress-bar'); + if (bar) { + value = Math.min(1, Math.max(0, value)); + bar.style.width = value * 100 + '%'; + } + }; + + var createCss = function () { + var css = [ + 'body {', + ' background-color: #283538;', + '}', + + '#application-splash-wrapper {', + ' position: absolute;', + ' top: 0;', + ' left: 0;', + ' height: 100%;', + ' width: 100%;', + ' background-color: #283538;', + '}', + + '#application-splash {', + ' position: absolute;', + ' top: calc(50% - 28px);', + ' width: 264px;', + ' left: calc(50% - 132px);', + '}', + + '#application-splash img {', + ' width: 100%;', + '}', + + '#progress-bar-container {', + ' margin: 20px auto 0 auto;', + ' height: 2px;', + ' width: 100%;', + ' background-color: #1d292c;', + '}', + + '#progress-bar {', + ' width: 0%;', + ' height: 100%;', + ' background-color: #f60;', + '}', + '@media (max-width: 480px) {', + ' #application-splash {', + ' width: 170px;', + ' left: calc(50% - 85px);', + ' }', + '}' + + ].join('\n'); + + var style = document.createElement('style'); + style.type = 'text/css'; + if (style.styleSheet) { + style.styleSheet.cssText = css; + } else { + style.appendChild(document.createTextNode(css)); + } + + document.head.appendChild(style); + }; + + + createCss(); + + showSplash(); + + app.on('preload:end', function () { + app.off('preload:progress'); + }); + app.on('preload:progress', setProgress); + app.on('start', hideSplash); +}); diff --git a/__modules__.js b/__modules__.js new file mode 100644 index 0000000..757ebd7 --- /dev/null +++ b/__modules__.js @@ -0,0 +1,70 @@ +var loadModules = function (modules, urlPrefix, doneCallback) { + + // check for wasm module support + function wasmSupported() { + try { + if (typeof WebAssembly === "object" && typeof WebAssembly.instantiate === "function") { + const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00)); + if (module instanceof WebAssembly.Module) + return new WebAssembly.Instance(module) instanceof WebAssembly.Instance; + } + } catch (e) { } + return false; + } + + // load a script + function loadScriptAsync(url, doneCallback) { + var tag = document.createElement('script'); + tag.onload = function () { + doneCallback(); + }; + tag.onerror = function () { + throw new Error('failed to load ' + url); + }; + tag.async = true; + tag.src = url; + tag.crossOrigin = 'anonymous'; + document.head.appendChild(tag); + } + + // load and initialize a wasm module + function loadWasmModuleAsync(moduleName, jsUrl, binaryUrl, doneCallback) { + loadScriptAsync(jsUrl, function () { + var lib = window[moduleName]; + window[moduleName + 'Lib'] = lib; + lib({ locateFile: function () { return binaryUrl; } } ).then( function (instance) { + window[moduleName] = instance; + doneCallback(); + }); + }); + } + + if (typeof modules === "undefined" || modules.length === 0) { + // caller may depend on callback behaviour being async + setTimeout(doneCallback); + } else { + var asyncCounter = modules.length; + var asyncCallback = function () { + asyncCounter--; + if (asyncCounter === 0) { + doneCallback(); + } + }; + + var wasm = wasmSupported(); + modules.forEach(function (m) { + if (!m.hasOwnProperty('preload') || m.preload) { + if (wasm) { + loadWasmModuleAsync(m.moduleName, urlPrefix + m.glueUrl, urlPrefix + m.wasmUrl, asyncCallback); + } else { + if (!m.fallbackUrl) { + throw new Error('wasm not supported and no fallback supplied for module ' + m.moduleName); + } + loadWasmModuleAsync(m.moduleName, urlPrefix + m.fallbackUrl, "", asyncCallback); + } + } else { + asyncCallback(); + } + }); + } +}; diff --git a/__settings__.js b/__settings__.js new file mode 100644 index 0000000..201ab9a --- /dev/null +++ b/__settings__.js @@ -0,0 +1,21 @@ +ASSET_PREFIX = ""; +SCRIPT_PREFIX = ""; +SCENE_PATH = "1390892.json"; +CONTEXT_OPTIONS = { + 'antialias': true, + 'alpha': false, + 'preserveDrawingBuffer': false, + 'preferWebGl2': true, + 'powerPreference': "default" +}; +SCRIPTS = [ 77854887, 78097772 ]; +CONFIG_FILENAME = "config.json"; +INPUT_SETTINGS = { + useKeyboard: true, + useMouse: true, + useGamepads: false, + useTouch: true +}; +pc.script.legacy = false; +PRELOAD_MODULES = [ +]; diff --git a/__start__.js b/__start__.js new file mode 100644 index 0000000..aa0f35d --- /dev/null +++ b/__start__.js @@ -0,0 +1,218 @@ +(function() { + // Shared Lib + var CANVAS_ID = 'application-canvas'; + + // Needed as we will have edge cases for particlar versions of iOS + // returns null if not iOS + var getIosVersion = function () { + if (/iP(hone|od|ad)/.test(navigator.platform)) { + var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/); + var version = [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)]; + return version; + } + + return null; + }; + + var lastWindowHeight = window.innerHeight; + var lastWindowWidth = window.innerWidth; + var windowSizeChangeIntervalHandler = null; + + var pcBootstrap = { + reflowHandler: null, + iosVersion: getIosVersion(), + + createCanvas: function () { + canvas = document.createElement('canvas'); + canvas.setAttribute('id', CANVAS_ID); + canvas.setAttribute('tabindex', 0); + // canvas.style.visibility = 'hidden'; + + // Disable I-bar cursor on click+drag + canvas.onselectstart = function () { return false; }; + + document.body.appendChild(canvas); + + return canvas; + }, + + resizeCanvas: function (app, canvas) { + canvas.style.width = ''; + canvas.style.height = ''; + app.resizeCanvas(canvas.width, canvas.height); + + var fillMode = app._fillMode; + + if (fillMode == pc.FILLMODE_NONE || fillMode == pc.FILLMODE_KEEP_ASPECT) { + if ((fillMode == pc.FILLMODE_NONE && canvas.clientHeight < window.innerHeight) || (canvas.clientWidth / canvas.clientHeight >= window.innerWidth / window.innerHeight)) { + canvas.style.marginTop = Math.floor((window.innerHeight - canvas.clientHeight) / 2) + 'px'; + } else { + canvas.style.marginTop = ''; + } + } + + lastWindowHeight = window.innerHeight; + lastWindowWidth = window.innerWidth; + + // Work around when in landscape to work on iOS 12 otherwise + // the content is under the URL bar at the top + if (this.iosVersion && this.iosVersion[0] <= 12) { + window.scrollTo(0, 0); + } + }, + + reflow: function (app, canvas) { + this.resizeCanvas(app, canvas); + + // Poll for size changes as the window inner height can change after the resize event for iOS + // Have one tab only, and rotrait to portrait -> landscape -> portrait + if (windowSizeChangeIntervalHandler === null) { + windowSizeChangeIntervalHandler = setInterval(function () { + if (lastWindowHeight !== window.innerHeight || lastWindowWidth !== window.innerWidth) { + this.resizeCanvas(app, canvas); + } + }.bind(this), 100); + + // Don't want to do this all the time so stop polling after some short time + setTimeout(function() { + if (!!windowSizeChangeIntervalHandler) { + clearInterval(windowSizeChangeIntervalHandler); + windowSizeChangeIntervalHandler = null; + } + }, 2000); + } + } + }; + + // Expose the reflow to users so that they can override the existing + // reflow logic if need be + window.pcBootstrap = pcBootstrap; +})(); + + +(function () { + var canvas, devices, app; + + var createInputDevices = function (canvas) { + var devices = { + elementInput: new pc.ElementInput(canvas, { + useMouse: INPUT_SETTINGS.useMouse, + useTouch: INPUT_SETTINGS.useTouch + }), + keyboard: INPUT_SETTINGS.useKeyboard ? new pc.Keyboard(window) : null, + mouse: INPUT_SETTINGS.useMouse ? new pc.Mouse(canvas) : null, + gamepads: INPUT_SETTINGS.useGamepads ? new pc.GamePads() : null, + touch: INPUT_SETTINGS.useTouch && pc.platform.touch ? new pc.TouchDevice(canvas) : null + }; + + return devices; + }; + + var configureCss = function (fillMode, width, height) { + // Configure resolution and resize event + if (canvas.classList) { + canvas.classList.add('fill-mode-' + fillMode); + } + + // css media query for aspect ratio changes + var css = "@media screen and (min-aspect-ratio: " + width + "/" + height + ") {"; + css += " #application-canvas.fill-mode-KEEP_ASPECT {"; + css += " width: auto;"; + css += " height: 100%;"; + css += " margin: 0 auto;"; + css += " }"; + css += "}"; + + // append css to style + if (document.head.querySelector) { + document.head.querySelector('style').innerHTML += css; + } + }; + + var displayError = function (html) { + var div = document.createElement('div'); + + div.innerHTML = [ + '', + ' ', + ' ', + ' ', + ' ' + html + '', + ' ', + ' ', + ' ', + '' + ].join('\n'); + + document.body.appendChild(div); + }; + + canvas = pcBootstrap.createCanvas(); + devices = createInputDevices(canvas); + + try { + app = new pc.Application(canvas, { + elementInput: devices.elementInput, + keyboard: devices.keyboard, + mouse: devices.mouse, + gamepads: devices.gamepads, + touch: devices.touch, + graphicsDeviceOptions: window.CONTEXT_OPTIONS, + assetPrefix: window.ASSET_PREFIX || "", + scriptPrefix: window.SCRIPT_PREFIX || "", + scriptsOrder: window.SCRIPTS || [] + }); + } catch (e) { + if (e instanceof pc.UnsupportedBrowserError) { + displayError('This page requires a browser that supports WebGL.' + + 'Click here to find out more.'); + } else if (e instanceof pc.ContextCreationError) { + displayError("It doesn't appear your computer can support WebGL." + + 'Click here for more information.'); + } else { + displayError('Could not initialize application. Error: ' + e); + } + + return; + } + + var configure = function () { + app.configure(CONFIG_FILENAME, function (err) { + if (err) { + console.error(err); + } + + configureCss(app._fillMode, app._width, app._height); + + // do the first reflow after a timeout because of + // iOS showing a squished iframe sometimes + setTimeout(function () { + pcBootstrap.reflow(app, canvas); + pcBootstrap.reflowHandler = function() { pcBootstrap.reflow(app, canvas); }; + + window.addEventListener('resize', pcBootstrap.reflowHandler, false); + window.addEventListener('orientationchange', pcBootstrap.reflowHandler, false); + + app.preload(function (err) { + if (err) { + console.error(err); + } + + app.loadScene(SCENE_PATH, function (err, scene) { + if (err) { + console.error(err); + } + + app.start(); + }); + }); + }); + }); + }; + + if (PRELOAD_MODULES.length > 0) { + loadModules(PRELOAD_MODULES, ASSET_PREFIX, configure); + } else { + configure(); + } +})(); diff --git a/assets/css/reset.css b/assets/css/reset.css deleted file mode 100644 index 80dab86..0000000 --- a/assets/css/reset.css +++ /dev/null @@ -1 +0,0 @@ -* { margin:0;padding:0;border:0;outline:0;text-decoration:none;font-weight:inherit;font-style:inherit;color:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;list-style:none;border-collapse:collapse;border-spacing:0; -webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;} diff --git a/assets/css/style.css b/assets/css/style.css deleted file mode 100644 index 0fec500..0000000 --- a/assets/css/style.css +++ /dev/null @@ -1,78 +0,0 @@ -/* demo */ - -* { - font-family: monospace; -} - -body { - background: #000; - color: #999; - font-size: 17px; -} - -a { - color: #ccc; - text-decoration: underline; -} - -.info { - width:100%; - padding:12px; - box-sizing: border-box; -} - -/* webgl layout */ - -.webgl-wrapper { - display: inline-block; - width: 100%; - max-width: 1280px; /* remove this line for full width */ - position: relative; -} - -.webgl-content { - position:absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; -} - -#unityContainer { - width: 100%; height: 100%; -} - -.webgl-content * { - border: 0; - margin: 0; - padding: 0; -} - -#unityContainer canvas { - width:100%; - height:100%; - top:0; - left:0; -} - -/* this element makes sure we preserve 16:9 aspect ratio */ - -.aspect { - margin-top: calc(100% / 960 * 600); -} - -/* progress bar */ - -.webgl-content .logo, .progress {position: absolute; left: 50%; top: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);} -.webgl-content .logo {background: url('../images/progressLogo.Light.png') no-repeat center / contain; width: 154px; height: 130px;} -.webgl-content .progress {height: 18px; width: 141px; margin-top: 90px;} -.webgl-content .progress .empty {background: url('../images/progressEmpty.Light.png') no-repeat right / cover; float: right; width: 100%; height: 100%; display: inline-block;} -.webgl-content .progress .full {background: url('../images/progressFull.Light.png') no-repeat left / cover; float: left; width: 0%; height: 100%; display: inline-block;} -.webgl-content .logo.Dark {background-image: url('../images/progressLogo.Dark.png');} -.webgl-content .progress.Dark .empty {background-image: url('../images/progressEmpty.Dark.png');} -.webgl-content .progress.Dark .full {background-image: url('../images/progressFull.Dark.png');} -.webgl-content .footer {margin-top: 5px; height: 38px; line-height: 38px; font-family: Helvetica, Verdana, Arial, sans-serif; font-size: 18px;} -.webgl-content .footer .webgl-logo, .title, .fullscreen {height: 100%; display: inline-block; background: transparent center no-repeat;} -.webgl-content .footer .webgl-logo {background-image: url('../images/webgl-logo.png'); width: 204px; float: left;} -.webgl-content .footer .title {margin-right: 10px; float: right;} -.webgl-content .footer .fullscreen {background-image: url('../images/fullscreen.png'); width: 38px; float: right; cursor:pointer;} diff --git a/config.json b/config.json new file mode 100644 index 0000000..74951ed --- /dev/null +++ b/config.json @@ -0,0 +1 @@ +{"application_properties":{"i18nAssets":[],"useTouch":true,"layerOrder":[{"layer":0,"enabled":true,"transparent":false},{"layer":1,"enabled":true,"transparent":false},{"layer":2,"enabled":true,"transparent":false},{"layer":0,"enabled":true,"transparent":true},{"layer":3,"enabled":true,"transparent":false},{"layer":3,"enabled":true,"transparent":true},{"layer":4,"enabled":true,"transparent":true}],"externalScripts":[],"height":720,"vr":false,"useModelV2":false,"antiAlias":true,"layers":{"0":{"transparentSortMode":3,"opaqueSortMode":2,"name":"World"},"1":{"transparentSortMode":3,"opaqueSortMode":2,"name":"Depth"},"2":{"transparentSortMode":3,"opaqueSortMode":0,"name":"Skybox"},"3":{"transparentSortMode":3,"opaqueSortMode":0,"name":"Immediate"},"4":{"transparentSortMode":1,"opaqueSortMode":1,"name":"UI"}},"width":1280,"useDevicePixelRatio":false,"useKeyboard":true,"maxAssetRetries":5,"powerPreference":"default","batchGroups":[],"preserveDrawingBuffer":false,"useLegacyScripts":false,"fillMode":"KEEP_ASPECT","scripts":[77854887,78097772],"useMouse":true,"use3dPhysics":false,"transparentCanvas":false,"resolutionMode":"AUTO","loadingScreenScript":null,"preferWebGl2":true,"useGamepads":false,"libraries":[]},"scenes":[{"name":"Untitled","url":"1390892.json"}],"assets":{"77854887":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"mouse.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"mouse":{"attributesOrder":["redMaterial","greenMaterial","blueMaterial"],"attributes":{"redMaterial":{"type":"asset","assetType":"material"},"greenMaterial":{"type":"asset","assetType":"material"},"blueMaterial":{"type":"asset","assetType":"material"}}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":2575,"hash":"15ca00d7cda515c2f42e3180bc4a1311","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"6021d437-4dbd-40f5-a372-00a12c720923","same_as_backup":1,"checkpoint_id":"6e6c346c-6835-4fff-8602-e4a42a28d353","id":"77854887"},"77855246":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"New Material","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[0,0.3764705882352941,1],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"checkpoint_id":"6e6c346c-6835-4fff-8602-e4a42a28d353","id":"77855246"},"77855249":{"tags":[],"name":"New Material","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[1,0,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","checkpoint_id":"6e6c346c-6835-4fff-8602-e4a42a28d353","id":"77855249"},"77855250":{"tags":[],"name":"New Material","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[0.3333333333333333,1,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacity":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","checkpoint_id":"6e6c346c-6835-4fff-8602-e4a42a28d353","id":"77855250"},"78072763":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"loonie1.png","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"png","type":"Bilevel","width":500,"height":500,"alpha":true,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"loonie1.png","size":179080,"hash":"549278f659af3330a068eeab4953f01b","variants":{},"url":"files/assets/78072763/1/loonie1.png"},"region":"eu-west-1","i18n":{},"immutable_backup":"18691b30-4b08-4f1a-af0e-de96e176d2ec","same_as_backup":1,"checkpoint_id":"6e6c346c-6835-4fff-8602-e4a42a28d353","id":"78072763"},"78072855":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"New Material","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"ambient":[0,0,0],"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuse":[1,1,1],"diffuseMap":78072763,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specular":[0.23,0.23,0.23],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"shininess":32,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissive":[0,0,0],"emissiveMap":78072763,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1.33,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0.432,"alphaFade":1,"opacity":1,"opacityMap":78072763,"opacityMapChannel":"a","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"shader":"blinn","useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"region":"eu-west-1","i18n":{},"checkpoint_id":"6e6c346c-6835-4fff-8602-e4a42a28d353","id":"78072855"},"78097772":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"touch.js","revision":1,"preload":true,"exclude":false,"meta":null,"data":{"scripts":{"touch":{"attributesOrder":[],"attributes":{}}},"loading":false,"loadingType":0},"type":"script","file":{"filename":"__game-scripts.js","size":2575,"hash":"15ca00d7cda515c2f42e3180bc4a1311","url":"__game-scripts.js"},"region":"eu-west-1","i18n":{},"immutable_backup":"c6060765-9bdb-4332-ac5e-d8361ddadbb9","same_as_backup":0,"checkpoint_id":"6e6c346c-6835-4fff-8602-e4a42a28d353","id":"78097772"},"78181705":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Wdparq2.jpg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":true,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":351,"height":351,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"Wdparq2.jpg","size":63706,"hash":"2095a6d326c917be6886f7e49298c039","variants":{},"url":"files/assets/78181705/1/Wdparq2.jpg"},"region":"eu-west-1","i18n":{},"id":"78181705"},"78181706":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"robe2.jpg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":298,"height":298,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"robe2.jpg","size":18470,"hash":"3508e1085ab2dc004e38257685c02922","variants":{},"url":"files/assets/78181706/1/robe2.jpg"},"region":"eu-west-1","i18n":{},"id":"78181706"},"78181707":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"ceilingbump.jpg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":283,"height":403,"alpha":false,"depth":8,"srgb":false,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"ceilingbump.jpg","size":115965,"hash":"c78e303aa89c57fb464518c819f327b6","variants":{},"url":"files/assets/78181707/1/ceilingbump.jpg"},"region":"eu-west-1","i18n":{},"id":"78181707"},"78181708":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"walls.jpg","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":983,"height":662,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"walls.jpg","size":79678,"hash":"8959016d8864904b03e3c778260cee6f","variants":{},"url":"files/assets/78181708/1/walls.jpg"},"region":"eu-west-1","i18n":{},"id":"78181708"},"78181709":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"CARPTTAN.JPG","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":512,"height":512,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"CARPTTAN.JPG","size":250224,"hash":"1d7c8fb9403e175e294aa0a14e290a54","variants":{},"url":"files/assets/78181709/1/CARPTTAN.JPG"},"region":"eu-west-1","i18n":{},"id":"78181709"},"78181710":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"livingroom.max","revision":1,"preload":true,"exclude":false,"meta":null,"data":null,"type":"binary","file":{"filename":"livingroom.max","size":302592,"hash":"444dd36a95b616a14e030148af5cda69","url":"files/assets/78181710/1/livingroom.max"},"region":"eu-west-1","i18n":{},"id":"78181710"},"78181711":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"BURLOAK.JPG","revision":1,"preload":true,"exclude":false,"meta":{"compress":{"alpha":false,"normals":false,"dxt":false,"pvr":false,"pvrBpp":4,"etc1":false,"etc2":false,"basis":false,"quality":128,"compressionMode":"etc"},"format":"jpeg","type":"Bilevel","width":756,"height":512,"alpha":false,"depth":8,"srgb":true,"interlaced":false},"data":{"addressu":"repeat","addressv":"repeat","minfilter":"linear_mip_linear","magfilter":"linear","anisotropy":1,"rgbm":false,"mipmaps":true},"type":"texture","file":{"filename":"BURLOAK.JPG","size":189060,"hash":"3a7de42744d470c97f33b53c1b3eef7b","variants":{},"url":"files/assets/78181711/1/BURLOAK.JPG"},"region":"eu-west-1","i18n":{},"id":"78181711"},"78181751":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Take 001.glb","revision":1,"preload":true,"region":"eu-west-1","meta":{"name":"Take 001","duration":0},"data":null,"type":"animation","file":{"hash":"cb00af4e5637090a638f86273312a910","size":13688,"filename":"Take 001.glb","url":"files/assets/78181751/1/Take%20001.glb"},"i18n":{},"id":"78181751"},"78181752":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"01 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":0},"data":{"shader":"blinn","ambient":[0.588235,0.588235,0.588235],"diffuse":[0.588235,0.588235,0.588235],"diffuseMap":null,"diffuseMapOffset":[0,0],"diffuseMapTiling":[1,1],"specular":[0,0,0],"shininess":1.81818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMapChannel":"rgb","diffuseMapUv":0,"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"id":"78181752"},"78181753":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"02 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":3},"data":{"shader":"blinn","ambient":[0.588235,0.588235,0.588235],"diffuse":[0.588235,0.588235,0.588235],"diffuseMap":null,"diffuseMapOffset":[0,0],"diffuseMapTiling":[1,1],"specular":[0,0,0],"shininess":18.1818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMapChannel":"rgb","diffuseMapUv":0,"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"id":"78181753"},"78181754":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"13 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":1},"data":{"shader":"blinn","ambient":[0.588235,0.588235,0.588235],"diffuse":[0.588235,0.588235,0.588235],"diffuseMap":78181705,"diffuseMapOffset":[-0.35,-0.7],"diffuseMapTiling":[1.7,2.4],"specular":[0,0,0],"shininess":18.1818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMapChannel":"rgb","diffuseMapUv":0,"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"id":"78181754"},"78181756":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"14 - Defaultwall","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":2},"data":{"shader":"blinn","ambient":[0.588235,0.588235,0.588235],"diffuse":[0.588235,0.588235,0.588235],"diffuseMap":78181708,"diffuseMapOffset":[4.17233e-7,0],"diffuseMapTiling":[0.999999,1],"specular":[0,0,0],"shininess":18.1818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMapChannel":"rgb","diffuseMapUv":0,"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"id":"78181756"},"78181757":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"07 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":6},"data":{"shader":"blinn","ambient":[1,1,0.960784],"diffuse":[1,1,0.960784],"specular":[0,0,0],"shininess":18.1818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"id":"78181757"},"78181758":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"15 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":8},"data":{"shader":"blinn","ambient":[0.686275,0.423529,0.192157],"diffuse":[0.686275,0.423529,0.192157],"specular":[0,0,0],"shininess":18.1818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"id":"78181758"},"78181759":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"14 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":7},"data":{"shader":"blinn","ambient":[0.588235,0.588235,0.588235],"diffuse":[0.588235,0.588235,0.588235],"diffuseMap":null,"diffuseMapOffset":[0,0],"diffuseMapTiling":[1,1],"specular":[0,0,0],"shininess":18.1818,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMapChannel":"rgb","diffuseMapUv":0,"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"id":"78181759"},"78181760":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"08 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":5},"data":{"shader":"blinn","ambient":[1,0.729412,0],"diffuse":[1,0.729412,0],"specular":[0.31132,0.31132,0.31132],"shininess":90.9091,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"id":"78181760"},"78181761":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"03 - Default","revision":1,"preload":true,"region":"eu-west-1","meta":{"index":4},"data":{"shader":"blinn","ambient":[1,1,1],"diffuse":[1,1,1],"specular":[1.6045,1.6045,1.6045],"shininess":90.9091,"emissive":[0,0,0],"opacity":1,"ambientTint":false,"aoMap":null,"aoMapChannel":"r","aoMapUv":0,"aoMapTiling":[1,1],"aoMapOffset":[0,0],"diffuseMap":null,"diffuseMapChannel":"rgb","diffuseMapUv":0,"diffuseMapTiling":[1,1],"diffuseMapOffset":[0,0],"specularMap":null,"specularMapChannel":"rgb","specularMapUv":0,"specularMapTiling":[1,1],"specularMapOffset":[0,0],"specularAntialias":true,"occludeSpecular":1,"enableGGXSpecular":false,"anisotropy":0,"useMetalness":false,"metalness":1,"metalnessMap":null,"metalnessMapChannel":"r","metalnessMapUv":0,"metalnessMapTiling":[1,1],"metalnessMapOffset":[0,0],"conserveEnergy":true,"glossMap":null,"glossMapChannel":"r","glossMapUv":0,"glossMapTiling":[1,1],"glossMapOffset":[0,0],"clearCoat":0,"clearCoatMap":null,"clearCoatMapChannel":"r","clearCoatMapUv":0,"clearCoatMapTiling":[1,1],"clearCoatMapOffset":[0,0],"clearCoatVertexColor":false,"clearCoatVertexColorChannel":"r","clearCoatGlossiness":1,"clearCoatGlossMap":null,"clearCoatGlossMapChannel":"r","clearCoatGlossMapUv":0,"clearCoatGlossMapTiling":[1,1],"clearCoatGlossMapOffset":[0,0],"clearCoatGlossVertexColor":false,"clearCoatGlossVertexColorChannel":"r","clearCoatBumpiness":1,"clearCoatNormalMap":null,"clearCoatNormalMapUv":0,"clearCoatNormalMapTiling":[1,1],"clearCoatNormalMapOffset":[0,0],"fresnelModel":0,"emissiveMap":null,"emissiveMapChannel":"rgb","emissiveMapUv":0,"emissiveMapTiling":[1,1],"emissiveMapOffset":[0,0],"emissiveIntensity":1,"normalMap":null,"normalMapTiling":[1,1],"normalMapOffset":[0,0],"normalMapUv":0,"bumpMapFactor":1,"heightMap":null,"heightMapChannel":"r","heightMapUv":0,"heightMapTiling":[1,1],"heightMapOffset":[0,0],"heightMapFactor":1,"alphaToCoverage":false,"alphaTest":0,"alphaFade":1,"opacityMap":null,"opacityMapChannel":"r","opacityMapUv":0,"opacityMapTiling":[1,1],"opacityMapOffset":[0,0],"opacityFadesSpecular":true,"reflectivity":1,"refraction":0,"refractionIndex":0.6666666666666666,"sphereMap":null,"cubeMap":null,"cubeMapProjection":0,"cubeMapProjectionBox":{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]},"lightMap":null,"lightMapChannel":"rgb","lightMapUv":1,"lightMapTiling":[1,1],"lightMapOffset":[0,0],"depthTest":true,"depthWrite":true,"cull":1,"blendType":3,"useFog":true,"useLighting":true,"useSkybox":true,"useGammaTonemap":true,"aoMapVertexColor":false,"diffuseMapVertexColor":false,"emissiveMapVertexColor":false,"specularMapVertexColor":false,"metalnessMapVertexColor":false,"opacityMapVertexColor":false,"glossMapVertexColor":false,"lightMapVertexColor":false,"diffuseMapTint":false,"specularMapTint":false,"emissiveMapTint":false,"metalnessMapTint":false},"type":"material","file":null,"i18n":{},"id":"78181761"},"78181762":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":0},"type":"render","file":null,"i18n":{},"id":"78181762"},"78181763":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box02","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":1},"type":"render","file":null,"i18n":{},"id":"78181763"},"78181764":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box03","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":2},"type":"render","file":null,"i18n":{},"id":"78181764"},"78181765":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box04","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":3},"type":"render","file":null,"i18n":{},"id":"78181765"},"78181766":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box05","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":4},"type":"render","file":null,"i18n":{},"id":"78181766"},"78181767":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box06","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":5},"type":"render","file":null,"i18n":{},"id":"78181767"},"78181768":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box07","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":11646,"triangles":15932,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":6},"type":"render","file":null,"i18n":{},"id":"78181768"},"78181769":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":391,"triangles":704,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":7},"type":"render","file":null,"i18n":{},"id":"78181769"},"78181770":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"C-Ext01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":56,"triangles":28,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":8},"type":"render","file":null,"i18n":{},"id":"78181770"},"78181771":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box08","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":406,"triangles":212,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":9},"type":"render","file":null,"i18n":{},"id":"78181771"},"78181772":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Sphere01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1412,"triangles":2300,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":10},"type":"render","file":null,"i18n":{},"id":"78181772"},"78181773":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Cylinder01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":79,"triangles":72,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":11},"type":"render","file":null,"i18n":{},"id":"78181773"},"78181774":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Sphere02","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":71,"triangles":80,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":12},"type":"render","file":null,"i18n":{},"id":"78181774"},"78181775":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Line01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1503,"triangles":1572,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":13},"type":"render","file":null,"i18n":{},"id":"78181775"},"78181776":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box09","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":14},"type":"render","file":null,"i18n":{},"id":"78181776"},"78181777":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box10","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":15},"type":"render","file":null,"i18n":{},"id":"78181777"},"78181778":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box11","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":16},"type":"render","file":null,"i18n":{},"id":"78181778"},"78181779":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box12","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":17},"type":"render","file":null,"i18n":{},"id":"78181779"},"78181780":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box13","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181755,"renderIndex":18},"type":"render","file":null,"i18n":{},"id":"78181780"},"78181876":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"livingroom.glb","revision":1,"preload":true,"region":"eu-west-1","meta":null,"data":{},"type":"container","file":{"hash":"78e748bf3b30b70fc9d4b74e36d22e8d","size":815580,"filename":"livingroom.glb","url":"files/assets/78181876/1/livingroom.glb"},"i18n":{},"id":"78181876"},"78181877":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":0},"type":"render","file":null,"i18n":{},"id":"78181877"},"78181878":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box02","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":1},"type":"render","file":null,"i18n":{},"id":"78181878"},"78181879":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box03","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":658,"triangles":768,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":2},"type":"render","file":null,"i18n":{},"id":"78181879"},"78181880":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box04","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":3},"type":"render","file":null,"i18n":{},"id":"78181880"},"78181881":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box05","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":4},"type":"render","file":null,"i18n":{},"id":"78181881"},"78181882":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box06","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":652,"triangles":764,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":5},"type":"render","file":null,"i18n":{},"id":"78181882"},"78181883":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box07","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":11646,"triangles":15932,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":6},"type":"render","file":null,"i18n":{},"id":"78181883"},"78181884":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Plane01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":391,"triangles":704,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":7},"type":"render","file":null,"i18n":{},"id":"78181884"},"78181885":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"C-Ext01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":56,"triangles":28,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":8},"type":"render","file":null,"i18n":{},"id":"78181885"},"78181886":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Sphere01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1412,"triangles":2300,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":10},"type":"render","file":null,"i18n":{},"id":"78181886"},"78181887":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box08","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":406,"triangles":212,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":9},"type":"render","file":null,"i18n":{},"id":"78181887"},"78181888":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Cylinder01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":79,"triangles":72,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":11},"type":"render","file":null,"i18n":{},"id":"78181888"},"78181889":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Sphere02","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":71,"triangles":80,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":12},"type":"render","file":null,"i18n":{},"id":"78181889"},"78181890":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Line01","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":1503,"triangles":1572,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":13},"type":"render","file":null,"i18n":{},"id":"78181890"},"78181891":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box09","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":14},"type":"render","file":null,"i18n":{},"id":"78181891"},"78181892":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box10","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":15},"type":"render","file":null,"i18n":{},"id":"78181892"},"78181893":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box11","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":16},"type":"render","file":null,"i18n":{},"id":"78181893"},"78181894":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box12","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":17},"type":"render","file":null,"i18n":{},"id":"78181894"},"78181895":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"Box13","revision":1,"preload":true,"region":"eu-west-1","meta":{"meshes":1,"skinned":false,"vertices":126,"triangles":84,"attributes":{"POSITION":1,"NORMAL":1,"TEXCOORD_0":1}},"data":{"containerAsset":78181876,"renderIndex":18},"type":"render","file":null,"i18n":{},"id":"78181895"},"78181896":{"branch_id":"f2fea7d7-b6ec-4f66-8727-2db38175fd78","tags":[],"name":"livingroom","revision":1,"preload":true,"region":"eu-west-1","meta":{"containerAsset":78181876},"data":{"entities":{"992e38f0-dd22-4fe8-843f-5c80f0b4190f":{"enabled":true,"tags":[],"children":["cf173562-138d-43de-b497-644f7ffe4239"],"position":[0,0,0],"rotation":[0,0,0],"scale":[0.01,0.01,0.01],"resource_id":"992e38f0-dd22-4fe8-843f-5c80f0b4190f","name":"RootNode","components":{},"parent":null},"cf173562-138d-43de-b497-644f7ffe4239":{"enabled":true,"tags":[],"children":["19b78e10-9bec-4619-80ff-e761bd368e6e","f637845d-7f0e-416e-a2da-27a804b90a26","624e755c-e008-4e38-a4ae-e189b9e6af0e","8fd046ca-9bf2-4996-a426-d5f6f336a65b","235f5a54-087f-4b74-bcb8-e92fb0454a6f","92d77773-aa8e-4faa-a639-619c285b76f1","0e2a3a2c-7ef9-48a5-94f8-425b169eb692","9ea5ecb4-e90e-41e7-8464-9700435c402b","7a7196e1-59de-4cee-831f-db20924f5a99","03051ef6-4f3a-438e-9160-a8aea926e2d0","3ce4c2c1-7a99-4730-a57c-346004bc1485","90839ae3-cc29-477f-a88e-53fb57152250","04a75aae-eb81-4d94-8678-29e91bc7ff75","26ac5c6d-406a-4e21-b3ce-6e451befe8e9","0ca19a72-2469-4446-b3d5-d341756117d3","afce77e7-aca3-481a-b7ad-35126ffafcde","1dbd7266-a1ce-4993-a0c0-14bc38ef3479","d5b5339a-94b6-4efa-822b-9c5c7997f1e1","232324a7-b6aa-4551-a098-bc9ea317773c","1346743e-6c0f-4290-9590-f6e6b64494a1","8a26cc25-f015-4fc5-8cfc-d2366cd0ec11","8f969715-c24b-40d4-a640-80340cc8ddaf","71743733-1689-447d-b55b-ef36a1f9832f"],"position":[0,0,0],"rotation":[0,0,0],"scale":[2.54,2.54,2.54],"resource_id":"cf173562-138d-43de-b497-644f7ffe4239","name":"Fbx_Root","components":{},"parent":"992e38f0-dd22-4fe8-843f-5c80f0b4190f"},"19b78e10-9bec-4619-80ff-e761bd368e6e":{"enabled":true,"tags":[],"children":[],"position":[-7.74598,38.4319,30.0512],"rotation":[0,0,14.3003],"scale":[1.07852,1.07852,1.07852],"resource_id":"19b78e10-9bec-4619-80ff-e761bd368e6e","name":"Box01","components":{"render":{"enabled":true,"type":"asset","asset":78181877,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"f637845d-7f0e-416e-a2da-27a804b90a26":{"enabled":true,"tags":[],"children":[],"position":[-7.74598,38.4319,96.2053],"rotation":[0,0,14.3003],"scale":[1.07852,1.07852,-1.07852],"resource_id":"f637845d-7f0e-416e-a2da-27a804b90a26","name":"Box02","components":{"render":{"enabled":true,"type":"asset","asset":78181878,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"624e755c-e008-4e38-a4ae-e189b9e6af0e":{"enabled":true,"tags":[],"children":[],"position":[-19.7797,35.3645,160.262],"rotation":[0,0,14.3003],"scale":[-1.07852,1.07852,-1.07852],"resource_id":"624e755c-e008-4e38-a4ae-e189b9e6af0e","name":"Box03","components":{"render":{"enabled":true,"type":"asset","asset":78181879,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"8fd046ca-9bf2-4996-a426-d5f6f336a65b":{"enabled":true,"tags":[],"children":[],"position":[8.67342,31.0299,-2.24907],"rotation":[90,0,0],"scale":[1.07852,1.07852,1.07852],"resource_id":"8fd046ca-9bf2-4996-a426-d5f6f336a65b","name":"Box04","components":{"render":{"enabled":true,"type":"asset","asset":78181880,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"235f5a54-087f-4b74-bcb8-e92fb0454a6f":{"enabled":true,"tags":[],"children":[],"position":[8.67342,31.0299,64.5707],"rotation":[90,0,0],"scale":[1.07852,1.07852,1.07852],"resource_id":"235f5a54-087f-4b74-bcb8-e92fb0454a6f","name":"Box05","components":{"render":{"enabled":true,"type":"asset","asset":78181881,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"92d77773-aa8e-4faa-a639-619c285b76f1":{"enabled":true,"tags":[],"children":[],"position":[8.67342,31.0299,131.359],"rotation":[90,0,0],"scale":[1.07852,1.07852,1.07852],"resource_id":"92d77773-aa8e-4faa-a639-619c285b76f1","name":"Box06","components":{"render":{"enabled":true,"type":"asset","asset":78181882,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"0e2a3a2c-7ef9-48a5-94f8-425b169eb692":{"enabled":true,"tags":[],"children":[],"position":[-0.578045,3.58283,-15.3967],"rotation":[90,0,0],"scale":[1,1,1],"resource_id":"0e2a3a2c-7ef9-48a5-94f8-425b169eb692","name":"Box07","components":{"render":{"enabled":true,"type":"asset","asset":78181883,"materialAssets":[78181752],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"9ea5ecb4-e90e-41e7-8464-9700435c402b":{"enabled":true,"tags":[],"children":[],"position":[129.593,0,84.7355],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"9ea5ecb4-e90e-41e7-8464-9700435c402b","name":"Plane01","components":{"render":{"enabled":true,"type":"asset","asset":78181884,"materialAssets":[78181754],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"7a7196e1-59de-4cee-831f-db20924f5a99":{"enabled":true,"tags":[],"children":[],"position":[385.604,0,-284.937],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"7a7196e1-59de-4cee-831f-db20924f5a99","name":"C-Ext01","components":{"render":{"enabled":true,"type":"asset","asset":78181885,"materialAssets":[78181756],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"03051ef6-4f3a-438e-9160-a8aea926e2d0":{"enabled":true,"tags":[],"children":[],"position":[-0.0364215,-0.117522,-46.2227],"rotation":[0,0,0],"scale":[0.945135,0.945135,0.945135],"resource_id":"03051ef6-4f3a-438e-9160-a8aea926e2d0","name":"Box08","components":{"render":{"enabled":true,"type":"asset","asset":78181887,"materialAssets":[78181753],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"3ce4c2c1-7a99-4730-a57c-346004bc1485":{"enabled":true,"tags":[],"children":[],"position":[-12.6914,51.191,-45.6799],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"3ce4c2c1-7a99-4730-a57c-346004bc1485","name":"Sphere01","components":{"render":{"enabled":true,"type":"asset","asset":78181886,"materialAssets":[78181761],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"90839ae3-cc29-477f-a88e-53fb57152250":{"enabled":true,"tags":[],"children":[],"position":[-12.745,67.1823,-45.5833],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"90839ae3-cc29-477f-a88e-53fb57152250","name":"Cylinder01","components":{"render":{"enabled":true,"type":"asset","asset":78181888,"materialAssets":[78181760],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"04a75aae-eb81-4d94-8678-29e91bc7ff75":{"enabled":true,"tags":[],"children":[],"position":[-12.6219,79.6286,-45.6129],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"04a75aae-eb81-4d94-8678-29e91bc7ff75","name":"Sphere02","components":{"render":{"enabled":true,"type":"asset","asset":78181889,"materialAssets":[78181757],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"26ac5c6d-406a-4e21-b3ce-6e451befe8e9":{"enabled":true,"tags":[],"children":[],"position":[-12.5626,77.3243,-55.9246],"rotation":[90,-90,0],"scale":[1,1,1],"resource_id":"26ac5c6d-406a-4e21-b3ce-6e451befe8e9","name":"Line01","components":{"render":{"enabled":true,"type":"asset","asset":78181890,"materialAssets":[78181759],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"0ca19a72-2469-4446-b3d5-d341756117d3":{"enabled":true,"tags":[],"children":[],"position":[22.6662,0,-33.2917],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"0ca19a72-2469-4446-b3d5-d341756117d3","name":"Box09","components":{"render":{"enabled":true,"type":"asset","asset":78181891,"materialAssets":[78181758],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"afce77e7-aca3-481a-b7ad-35126ffafcde":{"enabled":true,"tags":[],"children":[],"position":[22.6133,0,-38.6055],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"afce77e7-aca3-481a-b7ad-35126ffafcde","name":"Box10","components":{"render":{"enabled":true,"type":"asset","asset":78181892,"materialAssets":[78181758],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"1dbd7266-a1ce-4993-a0c0-14bc38ef3479":{"enabled":true,"tags":[],"children":[],"position":[21.9913,0,-42.9339],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"1dbd7266-a1ce-4993-a0c0-14bc38ef3479","name":"Box11","components":{"render":{"enabled":true,"type":"asset","asset":78181893,"materialAssets":[78181758],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"d5b5339a-94b6-4efa-822b-9c5c7997f1e1":{"enabled":true,"tags":[],"children":[],"position":[21.3003,0,-45.9494],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"d5b5339a-94b6-4efa-822b-9c5c7997f1e1","name":"Box12","components":{"render":{"enabled":true,"type":"asset","asset":78181894,"materialAssets":[78181758],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"232324a7-b6aa-4551-a098-bc9ea317773c":{"enabled":true,"tags":[],"children":[],"position":[20.5984,0,-49.921],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"232324a7-b6aa-4551-a098-bc9ea317773c","name":"Box13","components":{"render":{"enabled":true,"type":"asset","asset":78181895,"materialAssets":[78181758],"layers":[0],"batchGroupId":null,"castShadows":true,"castShadowsLightmap":true,"receiveShadows":true,"lightmapped":false,"lightmapSizeMultiplier":1,"castShadowsLightMap":true,"lightMapped":false,"lightMapSizeMultiplier":1,"isStatic":false,"rootBone":null}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"1346743e-6c0f-4290-9590-f6e6b64494a1":{"enabled":true,"tags":[],"children":[],"position":[-12.5328,80.4621,-45.5371],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"1346743e-6c0f-4290-9590-f6e6b64494a1","name":"Omni01","components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":1.17,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"8a26cc25-f015-4fc5-8cfc-d2366cd0ec11":{"enabled":true,"tags":[],"children":[],"position":[127.84,180.989,-13.2821],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"8a26cc25-f015-4fc5-8cfc-d2366cd0ec11","name":"Omni02","components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":0.269,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"8f969715-c24b-40d4-a640-80340cc8ddaf":{"enabled":true,"tags":[],"children":[],"position":[151.448,178.646,280.302],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"8f969715-c24b-40d4-a640-80340cc8ddaf","name":"Omni03","components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":0.2214,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"},"71743733-1689-447d-b55b-ef36a1f9832f":{"enabled":true,"tags":[],"children":[],"position":[151.448,304.742,75.99],"rotation":[0,0,0],"scale":[1,1,1],"resource_id":"71743733-1689-447d-b55b-ef36a1f9832f","name":"Omni04","components":{"light":{"enabled":true,"type":"point","bake":false,"bakeArea":0,"bakeNumSamples":1,"bakeDir":true,"affectDynamic":true,"affectLightmapped":false,"color":[1,1,0.921569],"intensity":0.2214,"castShadows":false,"shadowUpdateMode":2,"shadowType":0,"vsmBlurMode":1,"vsmBlurSize":11,"vsmBias":0.01,"shadowDistance":16,"shadowResolution":1024,"numCascades":1,"cascadeDistribution":0.5,"shadowBias":0.2,"normalOffsetBias":0.05,"range":8,"falloffMode":0,"innerConeAngle":40,"outerConeAngle":45,"shape":0,"cookieAsset":null,"cookieIntensity":1,"cookieFalloff":true,"cookieChannel":"rgb","cookieAngle":0,"cookieScale":[1,1],"cookieOffset":[0,0],"isStatic":false,"layers":[0]}},"parent":"cf173562-138d-43de-b497-644f7ffe4239"}}},"type":"template","file":null,"i18n":{},"id":"78181896"}}} \ No newline at end of file diff --git a/files/assets/78072763/1/loonie1.png b/files/assets/78072763/1/loonie1.png new file mode 100644 index 0000000..43cec3b Binary files /dev/null and b/files/assets/78072763/1/loonie1.png differ diff --git a/files/assets/78181705/1/Wdparq2.jpg b/files/assets/78181705/1/Wdparq2.jpg new file mode 100644 index 0000000..137a407 Binary files /dev/null and b/files/assets/78181705/1/Wdparq2.jpg differ diff --git a/files/assets/78181706/1/robe2.jpg b/files/assets/78181706/1/robe2.jpg new file mode 100644 index 0000000..a4a1462 Binary files /dev/null and b/files/assets/78181706/1/robe2.jpg differ diff --git a/files/assets/78181707/1/ceilingbump.jpg b/files/assets/78181707/1/ceilingbump.jpg new file mode 100644 index 0000000..5f24228 Binary files /dev/null and b/files/assets/78181707/1/ceilingbump.jpg differ diff --git a/files/assets/78181708/1/walls.jpg b/files/assets/78181708/1/walls.jpg new file mode 100644 index 0000000..1ccc0fe Binary files /dev/null and b/files/assets/78181708/1/walls.jpg differ diff --git a/files/assets/78181709/1/CARPTTAN.JPG b/files/assets/78181709/1/CARPTTAN.JPG new file mode 100644 index 0000000..f924231 Binary files /dev/null and b/files/assets/78181709/1/CARPTTAN.JPG differ diff --git a/files/assets/78181710/1/livingroom.max b/files/assets/78181710/1/livingroom.max new file mode 100644 index 0000000..131eba2 Binary files /dev/null and b/files/assets/78181710/1/livingroom.max differ diff --git a/files/assets/78181711/1/BURLOAK.JPG b/files/assets/78181711/1/BURLOAK.JPG new file mode 100644 index 0000000..482e440 Binary files /dev/null and b/files/assets/78181711/1/BURLOAK.JPG differ diff --git a/files/assets/78181751/1/Take 001.glb b/files/assets/78181751/1/Take 001.glb new file mode 100644 index 0000000..4cfe184 Binary files /dev/null and b/files/assets/78181751/1/Take 001.glb differ diff --git a/files/assets/78181876/1/livingroom.glb b/files/assets/78181876/1/livingroom.glb new file mode 100644 index 0000000..ec5bee0 Binary files /dev/null and b/files/assets/78181876/1/livingroom.glb differ diff --git a/index.html b/index.html index cd44ab1..47a9812 100644 --- a/index.html +++ b/index.html @@ -1,72 +1,17 @@ - - - - - - - - - - - - - Furnit1 - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + FurnitureDemo + + + + + + + diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..bb25c22 Binary files /dev/null and b/logo.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..5835264 --- /dev/null +++ b/manifest.json @@ -0,0 +1 @@ +{"short_name":"FurnitureDemo","name":"FurnitureDemo","start_url":"","display":"fullscreen","icons":[{"src":"thumbs/180.jpg","sizes":"180x180","type":"image/jpeg"},{"src":"thumbs/360.jpg","sizes":"360x360","type":"image/jpeg"},{"src":"thumbs/540.jpg","sizes":"540x540","type":"image/jpeg"},{"src":"thumbs/720.jpg","sizes":"720x720","type":"image/jpeg"}]} \ No newline at end of file diff --git a/playcanvas-stable.min.js b/playcanvas-stable.min.js new file mode 100644 index 0000000..f5aeef1 --- /dev/null +++ b/playcanvas-stable.min.js @@ -0,0 +1,6 @@ +/** + * @license + * PlayCanvas Engine v1.52.6 revision 2409b8a86 + * Copyright 2011-2022 PlayCanvas Ltd. All rights reserved. + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pc={})}(this,(function(t){"use strict";Array.prototype.fill||Object.defineProperty(Array.prototype,"fill",{value:function(t){if(null==this)throw new TypeError("this is null or not defined");for(var e=Object(this),i=e.length>>>0,n=arguments[1],s=n>>0,a=s<0?Math.max(i+s,0):Math.min(s,i),r=arguments[2],o=void 0===r?i:r>>0,h=o<0?Math.max(i+o,0):Math.min(o,i);a>>0;if("function"!=typeof t)throw TypeError("predicate must be a function");for(var n=arguments[1],s=0;s>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var n=arguments[1],s=0;s0)-(t<0)||+t}),void 0===Number.isFinite&&(Number.isFinite=function(t){return"number"==typeof t&&isFinite(t)}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),n=1;nthis.length)&&(e=this.length),this.substring(e-t.length,e)===t}),String.prototype.includes||(String.prototype.includes=function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}),String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return this.substr(!e||e<0?0:+e,t.length)===t}),Int8Array.prototype.fill||(Int8Array.prototype.fill=Array.prototype.fill),Uint8Array.prototype.fill||(Uint8Array.prototype.fill=Array.prototype.fill),Uint8ClampedArray.prototype.fill||(Uint8ClampedArray.prototype.fill=Array.prototype.fill),Int16Array.prototype.fill||(Int16Array.prototype.fill=Array.prototype.fill),Uint16Array.prototype.fill||(Uint16Array.prototype.fill=Array.prototype.fill),Int32Array.prototype.fill||(Int32Array.prototype.fill=Array.prototype.fill),Uint32Array.prototype.fill||(Uint32Array.prototype.fill=Array.prototype.fill),Float32Array.prototype.fill||(Float32Array.prototype.fill=Array.prototype.fill);var e={};function i(t,i){var n;e[t]=!0,void 0!==i&&(n=i,window.console&&window.console.error&&window.console.error(n))}var n=function t(e){var i=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(var n=0;n0?a=a.slice(0,a.length-2):(r>0&&a.push(p.delimiter),a.push(n[r])));return s=a.join(""),e||s[0]!==p.delimiter||(s=s.slice(1)),i&&s[s.length-1]!==p.delimiter&&(s+=p.delimiter),s},split:function(t){var e=t.split(p.delimiter),i=e.slice(e.length-1)[0];return[e.slice(0,e.length-1).join(p.delimiter),i]},getBasename:function(t){return p.split(t)[1]},getDirectory:function(t){var e=t.split(p.delimiter);return e.slice(0,e.length-1).join(p.delimiter)},getExtension:function(t){var e=t.split("?")[0].split(".").pop();return e!==t?"."+e:""},isRelativePath:function(t){return"/"!==t.charAt(0)&&null===t.match(/:\/\//)},extractPath:function(t){var e="",i=t.split("/"),n=0;if(i.length>1)if(p.isRelativePath(t))if("."===i[0])for(n=0;n0),S="getGamepads"in navigator,w="undefined"!=typeof Worker;try{var M=Object.defineProperty({},"passive",{get:function(){return T=!0,!1}});window.addEventListener("testpassive",null,M),window.removeEventListener("testpassive",null,M)}catch(t){}}var C="undefined"!=typeof window?"browser":"node",E={environment:C,global:"browser"===C?window:global,browser:"browser"===C,desktop:m,mobile:_,ios:x,android:y,windows:g,xbox:v,gamepads:S,touch:b,workers:w,passiveEvents:T},P="abcdefghijklmnopqrstuvwxyz",R="ABCDEFGHIJKLMNOPQRSTUVWXYZ",I=55296,L=127462,D=127487,k=65024,O=65039;function F(t,e){void 0===e&&(e=0);var i=t.length;if(e<0||e>=i)return null;var n=t.charCodeAt(e);if(i>1&&n>=I&&n<=56319){var s=t.charCodeAt(e+1);if(s>=56320&&s<=57343)return{code:1024*(n-I)+s-56320+65536,long:!0}}return{code:n,long:!1}}function B(t,e,i){if(!t)return!1;var n=F(t);if(n){var s=n.code;return s>=e&&s<=i}return!1}function N(t,e){if(e===t.length-1)return 1;if(B(t[e],I,56319)){var i=t.substring(e,e+2),n=t.substring(e+2,e+4);return B(n,127995,127999)||B(i,L,D)&&B(n,L,D)?4:B(n,k,O)?3:2}return B(t[e+1],k,O)?2:1}var U={ASCII_LOWERCASE:P,ASCII_UPPERCASE:R,ASCII_LETTERS:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",format:function(t){for(var e=1;e65535?[55296+(e>>10),e%1024+56320]:[t],n.push(String.fromCharCode.apply(null,i));return n.join("")}},z=function(){function t(){this._list=[],this._index={}}var e=t.prototype;return e.push=function(t,e){if(this._index[t])throw Error("Key already in index "+t);var i=this._list.push(e)-1;this._index[t]=i},e.has=function(t){return void 0!==this._index[t]},e.get=function(t){var e=this._index[t];return void 0!==e?this._list[e]:null},e.remove=function(t){var e=this._index[t];if(void 0!==e){for(t in this._list.splice(e,1),delete this._index[t],this._index){var i=this._index[t];i>e&&(this._index[t]=i-1)}return!0}return!1},e.list=function(){return this._list},e.clear=function(){for(var t in this._list.length=0,this._index)delete this._index[t]},t}();function V(t,e){for(var i=0;it.length)&&(e=t.length);for(var i=0,n=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}}}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 K=function(){function t(t){this.arraybuffer=t,this.dataView=new DataView(t),this.offset=0,this.stack=[]}var e=t.prototype;return e.reset=function(t){void 0===t&&(t=0),this.offset=t},e.skip=function(t){this.offset+=t},e.align=function(t){this.offset=this.offset+t-1&~(t-1)},e._inc=function(t){return this.offset+=t,this.offset-t},e.readChar=function(){return String.fromCharCode(this.dataView.getUint8(this.offset++))},e.readChars=function(t){for(var e="",i=0;i=t.byteLength);){var i=String.fromCharCode(this.readU8());if("\n"===i)break;e+=i}return e},W(t,[{key:"remainingBytes",get:function(){return this.dataView.byteLength-this.offset}}]),t}(),Z=function(){function t(t){this.items=[],this.length=0,this.loopIndex=-1,this._sortBy=t.sortBy,this._sortHandler=this._doSort.bind(this)}var e=t.prototype;return e._binarySearch=function(t){for(var e,i,n=0,s=this.items.length-1,a=t[this._sortBy];n<=s;)e=Math.floor((n+s)/2),(i=this.items[e][this._sortBy])<=a?n=e+1:i>a&&(s=e-1);return n},e._doSort=function(t,e){var i=this._sortBy;return t[i]-e[i]},e.insert=function(t){var e=this._binarySearch(t);this.items.splice(e,0,t),this.length++,this.loopIndex>=e&&this.loopIndex++},e.append=function(t){this.items.push(t),this.length++},e.remove=function(t){var e=this.items.indexOf(t);e<0||(this.items.splice(e,1),this.length--,this.loopIndex>=e&&this.loopIndex--)},e.sort=function(){var t=this.loopIndex>=0?this.items[this.loopIndex]:null;this.items.sort(this._sortHandler),null!==t&&(this.loopIndex=this.items.indexOf(t))},t}(),$=function(t){function e(e){var i;return(i=t.call(this)||this)._index={},i._list=[],i._parent=e,i}H(e,t);var i=e.prototype;return i.add=function(){var t=!1,e=this._processArguments(arguments,!0);if(!e.length)return t;for(var i=0;i=i?i:t<=e?e:t},intToBytes24:function(t){return[t>>16&255,t>>8&255,255&t]},intToBytes32:function(t){return[t>>24&255,t>>16&255,t>>8&255,255&t]},bytesToInt24:function(t,e,i){return t.length&&(i=t[2],e=t[1],t=t[0]),t<<16|e<<8|i},bytesToInt32:function(t,e,i,n){return t.length&&(n=t[3],i=t[2],e=t[1],t=t[0]),(t<<24|e<<16|i<<8|n)>>>0},lerp:function(t,e,i){return t+(e-t)*it.clamp(i,0,1)},lerpAngle:function(t,e,i){return e-t>180&&(e-=360),e-t<-180&&(e+=360),it.lerp(t,e,it.clamp(i,0,1))},powerOfTwo:function(t){return 0!==t&&!(t&t-1)},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},random:function(t,e){var i=e-t;return Math.random()*i+t},smoothstep:function(t,e,i){return i<=t?0:i>=e?1:(i=(i-t)/(e-t))*i*(3-2*i)},smootherstep:function(t,e,i){return i<=t?0:i>=e?1:(i=(i-t)/(e-t))*i*i*(i*(6*i-15)+10)},roundUp:function(t,e){return 0===e?t:Math.ceil(t/e)*e},between:function(t,e,i,n){var s=Math.min(e,i),a=Math.max(e,i);return n?t>=s&&t<=a:t>s&&t=0?t.ResponseType.ARRAY_BUFFER:".xml"===n?t.ResponseType.DOCUMENT:t.ResponseType.TEXT},e._isBinaryContentType=function(e){return[t.ContentType.MP4,t.ContentType.WAV,t.ContentType.OGG,t.ContentType.MP3,t.ContentType.BIN,t.ContentType.DDS,t.ContentType.BASIS,t.ContentType.GLB].indexOf(e)>=0},e._onReadyStateChange=function(t,e,i,n){if(4===n.readyState)switch(n.status){case 0:n.responseURL&&n.responseURL.startsWith("file:///")?this._onSuccess(t,e,i,n):this._onError(t,e,i,n);break;case 200:case 201:case 206:case 304:this._onSuccess(t,e,i,n);break;default:this._onError(t,e,i,n)}},e._onSuccess=function(e,i,n,s){var a,r,o=s.getResponseHeader("Content-Type");o&&(r=o.split(";")[0].trim());try{a=r===t.ContentType.JSON||i.split("?")[0].endsWith(".json")?JSON.parse(s.responseText):this._isBinaryContentType(r)||s.responseType===t.ResponseType.ARRAY_BUFFER||s.responseType===t.ResponseType.BLOB||s.responseType===t.ResponseType.JSON?s.response:s.responseType===t.ResponseType.DOCUMENT||r===t.ContentType.XML?s.responseXML:s.responseText,n.callback(null,a)}catch(t){n.callback(t)}},e._onError=function(e,i,n,s){var a=this;if(!n.retrying)if(n.retry&&n.retries7?e=it.intToBytes32(i):(e=it.intToBytes24(i))[3]=255,this.set(e[0]/255,e[1]/255,e[2]/255,e[3]/255),this},e.toString=function(t){var e="#"+((1<<24)+(Math.round(255*this.r)<<16)+(Math.round(255*this.g)<<8)+Math.round(255*this.b)).toString(16).slice(1);if(!0===t){var i=Math.round(255*this.a).toString(16);this.a<16/255?e+="0"+i:e+=i}return e},t}();at.BLACK=Object.freeze(new at(0,0,0,1)),at.BLUE=Object.freeze(new at(0,0,1,1)),at.CYAN=Object.freeze(new at(0,1,1,1)),at.GRAY=Object.freeze(new at(.5,.5,.5,1)),at.GREEN=Object.freeze(new at(0,1,0,1)),at.MAGENTA=Object.freeze(new at(1,0,1,1)),at.RED=Object.freeze(new at(1,0,0,1)),at.WHITE=Object.freeze(new at(1,1,1,1)),at.YELLOW=Object.freeze(new at(1,1,0,1));var rt=function(){function t(t,e){void 0===e&&(e=0),this._curve=t,this._left=-1/0,this._right=1/0,this._recip=0,this._p0=0,this._p1=0,this._m0=0,this._m1=0,this._reset(e)}var e=t.prototype;return e.evaluate=function(t,e){var i;void 0===e&&(e=!1),(e||t=this._right)&&this._reset(t);var n=this._curve.type;if(5===n)i=this._p0;else{var s=0===this._recip?0:(t-this._left)*this._recip;i=0===n?it.lerp(this._p0,this._p1,s):1===n?it.lerp(this._p0,this._p1,s*s*(3-2*s)):this._evaluateHermite(this._p0,this._p1,this._m0,this._m1,s)}return i},e._reset=function(t){var e=this._curve.keys,i=e.length;if(i)if(t=e[i-1][0])this._left=e[i-1][0],this._right=1/0,this._recip=0,this._p0=this._p1=e[i-1][1],this._m0=this._m1=0;else{for(var n=0;t>=e[n+1][0];)n++;this._left=e[n][0],this._right=e[n+1][0];var s=1/(this._right-this._left);this._recip=isFinite(s)?s:0,this._p0=e[n][1],this._p1=e[n+1][1],this._isHermite()&&this._calcTangents(e,n)}else this._left=-1/0,this._right=1/0,this._recip=0,this._p0=this._p1=this._m0=this._m1=0},e._isHermite=function(){return 2===this._curve.type||3===this._curve.type||4===this._curve.type},e._calcTangents=function(t,e){var i,n,s=t[e],a=t[e+1];if(i=0===e?[t[0][0]+(t[0][0]-t[1][0]),t[0][1]+(t[0][1]-t[1][1])]:t[e-1],n=e===t.length-2?[t[e+1][0]+(t[e+1][0]-t[e][0]),t[e+1][1]+(t[e+1][1]-t[e][1])]:t[e+2],4===this._curve.type){var r=2*(a[0]-s[0])/(a[0]-i[0]),o=2*(a[0]-s[0])/(n[0]-s[0]);this._m0=this._curve.tension*(isFinite(r)?r:0)*(a[1]-i[1]),this._m1=this._curve.tension*(isFinite(o)?o:0)*(n[1]-s[1])}else{var h=(a[0]-s[0])/(s[0]-i[0]),l=(a[0]-s[0])/(n[0]-a[0]),c=s[1]+(i[1]-s[1])*(isFinite(h)?h:0),u=a[1]+(n[1]-a[1])*(isFinite(l)?l:0),d=2===this._curve.type?.5:this._curve.tension;this._m0=d*(a[1]-c),this._m1=d*(u-s[1])}},e._evaluateHermite=function(t,e,i,n,s){var a=s*s,r=s+s,o=1-s,h=o*o;return t*((1+r)*h)+i*(s*h)+e*(a*(3-r))+n*(a*(s-1))},t}(),ot=function(){function t(t){if(this.keys=[],this.type=1,this.tension=.5,this._eval=new rt(this),t)for(var e=0;et);s++);var a=[t,e];return this.keys.splice(s,0,a),a},e.get=function(t){return this.keys[t]},e.sort=function(){this.keys.sort((function(t,e){return t[0]-e[0]}))},e.value=function(t){return this._eval.evaluate(t,!0)},e.closest=function(t){for(var e=this.keys,i=e.length,n=2,s=null,a=0;a=r))break;n=r,s=e[a]}return s},e.clone=function(){var e=new t;return e.keys=l(e.keys,this.keys),e.type=this.type,e.tension=this.tension,e},e.quantize=function(t){t=Math.max(t,2);var e=new Float32Array(t),i=1/(t-1);e[0]=this._eval.evaluate(0,!0);for(var n=1;n1)for(var t=0;t0){var e=1/Math.sqrt(t);this.x*=e,this.y*=e,this.z*=e}return this},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},e.min=function(t){return t.xthis.x&&(this.x=t.x),t.y>this.y&&(this.y=t.y),t.z>this.z&&(this.z=t.z),this},e.project=function(t){var e=(this.x*t.x+this.y*t.y+this.z*t.z)/(t.x*t.x+t.y*t.y+t.z*t.z);return this.x=t.x*e,this.y=t.y*e,this.z=t.z*e,this},e.set=function(t,e,i){return this.x=t,this.y=e,this.z=i,this},e.sub=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},e.sub2=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},e.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this},e.toString=function(){return"["+this.x+", "+this.y+", "+this.z+"]"},t}();lt.ZERO=Object.freeze(new lt(0,0,0)),lt.ONE=Object.freeze(new lt(1,1,1)),lt.UP=Object.freeze(new lt(0,1,0)),lt.DOWN=Object.freeze(new lt(0,-1,0)),lt.RIGHT=Object.freeze(new lt(1,0,0)),lt.LEFT=Object.freeze(new lt(-1,0,0)),lt.FORWARD=Object.freeze(new lt(0,0,-1)),lt.BACK=Object.freeze(new lt(0,0,1));var ct=function(){function t(){var t=new Float32Array(9);t[0]=t[4]=t[8]=1,this.data=t}var e=t.prototype;return e.clone=function(){return(new t).copy(this)},e.copy=function(t){var e=t.data,i=this.data;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],this},e.set=function(t){var e=this.data;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},e.equals=function(t){var e=this.data,i=t.data;return e[0]===i[0]&&e[1]===i[1]&&e[2]===i[2]&&e[3]===i[3]&&e[4]===i[4]&&e[5]===i[5]&&e[6]===i[6]&&e[7]===i[7]&&e[8]===i[8]},e.isIdentity=function(){var t=this.data;return 1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&1===t[4]&&0===t[5]&&0===t[6]&&0===t[7]&&1===t[8]},e.setIdentity=function(){var t=this.data;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},e.toString=function(){for(var t="[",e=0;e<9;e++)t+=this.data[e],t+=8!==e?", ":"";return t+="]"},e.transpose=function(){var t,e=this.data;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},e.setFromMat4=function(t){var e=t.data,i=this.data;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},e.transformVector=function(t,e){void 0===e&&(e=new lt);var i=this.data,n=t.x,s=t.y,a=t.z;return e.x=n*i[0]+s*i[3]+a*i[6],e.y=n*i[1]+s*i[4]+a*i[7],e.z=n*i[2]+s*i[5]+a*i[8],e},t}();ct.IDENTITY=Object.freeze(new ct),ct.ZERO=Object.freeze((new ct).set([0,0,0,0,0,0,0,0,0]));var ut=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),2===t.length?(this.x=t[0],this.y=t[1]):(this.x=t,this.y=e)}var e=t.prototype;return e.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.add2=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},e.addScalar=function(t){return this.x+=t,this.y+=t,this},e.clone=function(){return new t(this.x,this.y)},e.copy=function(t){return this.x=t.x,this.y=t.y,this},e.cross=function(t){return this.x*t.y-this.y*t.x},e.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},e.div=function(t){return this.x/=t.x,this.y/=t.y,this},e.div2=function(t,e){return this.x=t.x/e.x,this.y=t.y/e.y,this},e.divScalar=function(t){return this.x/=t,this.y/=t,this},e.dot=function(t){return this.x*t.x+this.y*t.y},e.equals=function(t){return this.x===t.x&&this.y===t.y},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.lengthSq=function(){return this.x*this.x+this.y*this.y},e.lerp=function(t,e,i){return this.x=t.x+i*(e.x-t.x),this.y=t.y+i*(e.y-t.y),this},e.mul=function(t){return this.x*=t.x,this.y*=t.y,this},e.mul2=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this},e.mulScalar=function(t){return this.x*=t,this.y*=t,this},e.normalize=function(){var t=this.x*this.x+this.y*this.y;if(t>0){var e=1/Math.sqrt(t);this.x*=e,this.y*=e}return this},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},e.min=function(t){return t.xthis.x&&(this.x=t.x),t.y>this.y&&(this.y=t.y),this},e.set=function(t,e){return this.x=t,this.y=e,this},e.sub=function(t){return this.x-=t.x,this.y-=t.y,this},e.sub2=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},e.subScalar=function(t){return this.x-=t,this.y-=t,this},e.toString=function(){return"["+this.x+", "+this.y+"]"},t.angleRad=function(t,e){return Math.atan2(t.x*e.y-t.y*e.x,t.x*e.x+t.y*e.y)},t}();ut.ZERO=Object.freeze(new ut(0,0)),ut.ONE=Object.freeze(new ut(1,1)),ut.UP=Object.freeze(new ut(0,1)),ut.DOWN=Object.freeze(new ut(0,-1)),ut.RIGHT=Object.freeze(new ut(1,0)),ut.LEFT=Object.freeze(new ut(-1,0));var dt=function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),4===t.length?(this.x=t[0],this.y=t[1],this.z=t[2],this.w=t[3]):(this.x=t,this.y=e,this.z=i,this.w=n)}var e=t.prototype;return e.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},e.add2=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},e.addScalar=function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},e.clone=function(){return new t(this.x,this.y,this.z,this.w)},e.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.div=function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this},e.div2=function(t,e){return this.x=t.x/e.x,this.y=t.y/e.y,this.z=t.z/e.z,this.w=t.w/e.w,this},e.divScalar=function(t){return this.x/=t,this.y/=t,this.z/=t,this.w/=t,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},e.equals=function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.lerp=function(t,e,i){return this.x=t.x+i*(e.x-t.x),this.y=t.y+i*(e.y-t.y),this.z=t.z+i*(e.z-t.z),this.w=t.w+i*(e.w-t.w),this},e.mul=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this},e.mul2=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this.w=t.w*e.w,this},e.mulScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},e.normalize=function(){var t=this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w;if(t>0){var e=1/Math.sqrt(t);this.x*=e,this.y*=e,this.z*=e,this.w*=e}return this},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},e.min=function(t){return t.xthis.x&&(this.x=t.x),t.y>this.y&&(this.y=t.y),t.z>this.z&&(this.z=t.z),t.w>this.w&&(this.w=t.w),this},e.set=function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this},e.sub=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this},e.sub2=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},e.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},e.toString=function(){return"["+this.x+", "+this.y+", "+this.z+", "+this.w+"]"},t}();dt.ZERO=Object.freeze(new dt(0,0,0,0)),dt.ONE=Object.freeze(new dt(1,1,1,1));var ft=new ut,pt=new lt,mt=new lt,_t=new lt,gt=new lt,vt=function(){function t(){var t=new Float32Array(16);t[0]=t[5]=t[10]=t[15]=1,this.data=t}t._getPerspectiveHalfSize=function(t,e,i,n,s){s?(t.x=n*Math.tan(e*Math.PI/360),t.y=t.x/i):(t.y=n*Math.tan(e*Math.PI/360),t.x=t.y*i)};var e=t.prototype;return e.add2=function(t,e){var i=t.data,n=e.data,s=this.data;return s[0]=i[0]+n[0],s[1]=i[1]+n[1],s[2]=i[2]+n[2],s[3]=i[3]+n[3],s[4]=i[4]+n[4],s[5]=i[5]+n[5],s[6]=i[6]+n[6],s[7]=i[7]+n[7],s[8]=i[8]+n[8],s[9]=i[9]+n[9],s[10]=i[10]+n[10],s[11]=i[11]+n[11],s[12]=i[12]+n[12],s[13]=i[13]+n[13],s[14]=i[14]+n[14],s[15]=i[15]+n[15],this},e.add=function(t){return this.add2(this,t)},e.clone=function(){return(new t).copy(this)},e.copy=function(t){var e=t.data,i=this.data;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],this},e.equals=function(t){var e=this.data,i=t.data;return e[0]===i[0]&&e[1]===i[1]&&e[2]===i[2]&&e[3]===i[3]&&e[4]===i[4]&&e[5]===i[5]&&e[6]===i[6]&&e[7]===i[7]&&e[8]===i[8]&&e[9]===i[9]&&e[10]===i[10]&&e[11]===i[11]&&e[12]===i[12]&&e[13]===i[13]&&e[14]===i[14]&&e[15]===i[15]},e.isIdentity=function(){var t=this.data;return 1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]&&0===t[8]&&0===t[9]&&1===t[10]&&0===t[11]&&0===t[12]&&0===t[13]&&0===t[14]&&1===t[15]},e.mul2=function(t,e){var i,n,s,a,r=t.data,o=e.data,h=this.data,l=r[0],c=r[1],u=r[2],d=r[3],f=r[4],p=r[5],m=r[6],_=r[7],g=r[8],v=r[9],y=r[10],x=r[11],b=r[12],S=r[13],w=r[14],T=r[15];return i=o[0],n=o[1],s=o[2],a=o[3],h[0]=l*i+f*n+g*s+b*a,h[1]=c*i+p*n+v*s+S*a,h[2]=u*i+m*n+y*s+w*a,h[3]=d*i+_*n+x*s+T*a,i=o[4],n=o[5],s=o[6],a=o[7],h[4]=l*i+f*n+g*s+b*a,h[5]=c*i+p*n+v*s+S*a,h[6]=u*i+m*n+y*s+w*a,h[7]=d*i+_*n+x*s+T*a,i=o[8],n=o[9],s=o[10],a=o[11],h[8]=l*i+f*n+g*s+b*a,h[9]=c*i+p*n+v*s+S*a,h[10]=u*i+m*n+y*s+w*a,h[11]=d*i+_*n+x*s+T*a,i=o[12],n=o[13],s=o[14],a=o[15],h[12]=l*i+f*n+g*s+b*a,h[13]=c*i+p*n+v*s+S*a,h[14]=u*i+m*n+y*s+w*a,h[15]=d*i+_*n+x*s+T*a,this},e.mulAffine2=function(t,e){var i,n,s,a=t.data,r=e.data,o=this.data,h=a[0],l=a[1],c=a[2],u=a[4],d=a[5],f=a[6],p=a[8],m=a[9],_=a[10],g=a[12],v=a[13],y=a[14];return i=r[0],n=r[1],s=r[2],o[0]=h*i+u*n+p*s,o[1]=l*i+d*n+m*s,o[2]=c*i+f*n+_*s,o[3]=0,i=r[4],n=r[5],s=r[6],o[4]=h*i+u*n+p*s,o[5]=l*i+d*n+m*s,o[6]=c*i+f*n+_*s,o[7]=0,i=r[8],n=r[9],s=r[10],o[8]=h*i+u*n+p*s,o[9]=l*i+d*n+m*s,o[10]=c*i+f*n+_*s,o[11]=0,i=r[12],n=r[13],s=r[14],o[12]=h*i+u*n+p*s+g,o[13]=l*i+d*n+m*s+v,o[14]=c*i+f*n+_*s+y,o[15]=1,this},e.mul=function(t){return this.mul2(this,t)},e.transformPoint=function(t,e){void 0===e&&(e=new lt);var i=this.data,n=t.x,s=t.y,a=t.z;return e.x=n*i[0]+s*i[4]+a*i[8]+i[12],e.y=n*i[1]+s*i[5]+a*i[9]+i[13],e.z=n*i[2]+s*i[6]+a*i[10]+i[14],e},e.transformVector=function(t,e){void 0===e&&(e=new lt);var i=this.data,n=t.x,s=t.y,a=t.z;return e.x=n*i[0]+s*i[4]+a*i[8],e.y=n*i[1]+s*i[5]+a*i[9],e.z=n*i[2]+s*i[6]+a*i[10],e},e.transformVec4=function(t,e){void 0===e&&(e=new dt);var i=this.data,n=t.x,s=t.y,a=t.z,r=t.w;return e.x=n*i[0]+s*i[4]+a*i[8]+r*i[12],e.y=n*i[1]+s*i[5]+a*i[9]+r*i[13],e.z=n*i[2]+s*i[6]+a*i[10]+r*i[14],e.w=n*i[3]+s*i[7]+a*i[11]+r*i[15],e},e.setLookAt=function(t,e,i){_t.sub2(t,e).normalize(),mt.copy(i).normalize(),pt.cross(mt,_t).normalize(),mt.cross(_t,pt);var n=this.data;return n[0]=pt.x,n[1]=pt.y,n[2]=pt.z,n[3]=0,n[4]=mt.x,n[5]=mt.y,n[6]=mt.z,n[7]=0,n[8]=_t.x,n[9]=_t.y,n[10]=_t.z,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this},e.setFrustum=function(t,e,i,n,s,a){var r=2*s,o=e-t,h=n-i,l=a-s,c=this.data;return c[0]=r/o,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=r/h,c[6]=0,c[7]=0,c[8]=(e+t)/o,c[9]=(n+i)/h,c[10]=(-a-s)/l,c[11]=-1,c[12]=0,c[13]=0,c[14]=-r*a/l,c[15]=0,this},e.setPerspective=function(e,i,n,s,a){return t._getPerspectiveHalfSize(ft,e,i,n,a),this.setFrustum(-ft.x,ft.x,-ft.y,ft.y,n,s)},e.setOrtho=function(t,e,i,n,s,a){var r=this.data;return r[0]=2/(e-t),r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=2/(n-i),r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-2/(a-s),r[11]=0,r[12]=-(e+t)/(e-t),r[13]=-(n+i)/(n-i),r[14]=-(a+s)/(a-s),r[15]=1,this},e.setFromAxisAngle=function(t,e){e*=it.DEG_TO_RAD;var i=t.x,n=t.y,s=t.z,a=Math.cos(e),r=Math.sin(e),o=1-a,h=o*i,l=o*n,c=this.data;return c[0]=h*i+a,c[1]=h*n+r*s,c[2]=h*s-r*n,c[3]=0,c[4]=h*n-r*s,c[5]=l*n+a,c[6]=l*s+r*i,c[7]=0,c[8]=h*s+r*n,c[9]=l*s-i*r,c[10]=o*s*s+a,c[11]=0,c[12]=0,c[13]=0,c[14]=0,c[15]=1,this},e.setTranslate=function(t,e,i){var n=this.data;return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=t,n[13]=e,n[14]=i,n[15]=1,this},e.setScale=function(t,e,i){var n=this.data;return n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=e,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=i,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this},e.setViewport=function(t,e,i,n){var s=this.data;return s[0]=.5*i,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=.5*n,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=.5,s[11]=0,s[12]=t+.5*i,s[13]=e+.5*n,s[14]=.5,s[15]=1,this},e.invert=function(){var t=this.data,e=t[0],i=t[1],n=t[2],s=t[3],a=t[4],r=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],m=t[14],_=t[15],g=e*r-i*a,v=e*o-n*a,y=e*h-s*a,x=i*o-n*r,b=i*h-s*r,S=n*h-s*o,w=l*p-c*f,T=l*m-u*f,A=l*_-d*f,M=c*m-u*p,C=c*_-d*p,E=u*_-d*m,P=g*E-v*C+y*M+x*A-b*T+S*w;if(0===P)this.setIdentity();else{var R=1/P;t[0]=(r*E-o*C+h*M)*R,t[1]=(-i*E+n*C-s*M)*R,t[2]=(p*S-m*b+_*x)*R,t[3]=(-c*S+u*b-d*x)*R,t[4]=(-a*E+o*A-h*T)*R,t[5]=(e*E-n*A+s*T)*R,t[6]=(-f*S+m*y-_*v)*R,t[7]=(l*S-u*y+d*v)*R,t[8]=(a*C-r*A+h*w)*R,t[9]=(-e*C+i*A-s*w)*R,t[10]=(f*b-p*y+_*g)*R,t[11]=(-l*b+c*y-d*g)*R,t[12]=(-a*M+r*T-o*w)*R,t[13]=(e*M-i*T+n*w)*R,t[14]=(-f*x+p*v-m*g)*R,t[15]=(l*x-c*v+u*g)*R}return this},e.set=function(t){var e=this.data;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},e.setIdentity=function(){var t=this.data;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},e.setTRS=function(t,e,i){var n=e.x,s=e.y,a=e.z,r=e.w,o=i.x,h=i.y,l=i.z,c=n+n,u=s+s,d=a+a,f=n*c,p=n*u,m=n*d,_=s*u,g=s*d,v=a*d,y=r*c,x=r*u,b=r*d,S=this.data;return S[0]=(1-(_+v))*o,S[1]=(p+b)*o,S[2]=(m-x)*o,S[3]=0,S[4]=(p-b)*h,S[5]=(1-(f+v))*h,S[6]=(g+y)*h,S[7]=0,S[8]=(m+x)*l,S[9]=(g-y)*l,S[10]=(1-(f+_))*l,S[11]=0,S[12]=t.x,S[13]=t.y,S[14]=t.z,S[15]=1,this},e.transpose=function(){var t,e=this.data;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},e.invertTo3x3=function(t){var e=this.data,i=t.data,n=e[0],s=e[1],a=e[2],r=e[4],o=e[5],h=e[6],l=e[8],c=e[9],u=e[10],d=u*o-h*c,f=-u*s+a*c,p=h*s-a*o,m=-u*r+h*l,_=u*n-a*l,g=-h*n+a*r,v=c*r-o*l,y=-c*n+s*l,x=o*n-s*r,b=n*d+s*m+a*v;if(0===b)return this;var S=1/b;return i[0]=S*d,i[1]=S*f,i[2]=S*p,i[3]=S*m,i[4]=S*_,i[5]=S*g,i[6]=S*v,i[7]=S*y,i[8]=S*x,this},e.getTranslation=function(t){return void 0===t&&(t=new lt),t.set(this.data[12],this.data[13],this.data[14])},e.getX=function(t){return void 0===t&&(t=new lt),t.set(this.data[0],this.data[1],this.data[2])},e.getY=function(t){return void 0===t&&(t=new lt),t.set(this.data[4],this.data[5],this.data[6])},e.getZ=function(t){return void 0===t&&(t=new lt),t.set(this.data[8],this.data[9],this.data[10])},e.getScale=function(t){return void 0===t&&(t=new lt),this.getX(pt),this.getY(mt),this.getZ(_t),t.set(pt.length(),mt.length(),_t.length()),t},e.setFromEulerAngles=function(t,e,i){t*=it.DEG_TO_RAD,e*=it.DEG_TO_RAD,i*=it.DEG_TO_RAD;var n=Math.sin(-t),s=Math.cos(-t),a=Math.sin(-e),r=Math.cos(-e),o=Math.sin(-i),h=Math.cos(-i),l=this.data;return l[0]=r*h,l[1]=-r*o,l[2]=a,l[3]=0,l[4]=s*o+h*n*a,l[5]=s*h-n*a*o,l[6]=-r*n,l[7]=0,l[8]=n*o-s*h*a,l[9]=h*n+s*a*o,l[10]=s*r,l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,this},e.getEulerAngles=function(t){void 0===t&&(t=new lt),this.getScale(gt);var e=gt.x,i=gt.y,n=gt.z;if(0===e||0===i||0===n)return t.set(0,0,0);var s,a,r=this.data,o=Math.asin(-r[2]/e),h=.5*Math.PI;return o-h?(s=Math.atan2(r[6]/i,r[10]/n),a=Math.atan2(r[1]/e,r[0]/e)):(a=0,s=-Math.atan2(r[4]/i,r[5]/i)):(a=0,s=Math.atan2(r[4]/i,r[5]/i)),t.set(s,o,a).mulScalar(it.RAD_TO_DEG)},e.toString=function(){for(var t="[",e=0;e<16;e+=1)t+=this.data[e],t+=15!==e?", ":"";return t+="]"},t}();vt.IDENTITY=Object.freeze(new vt),vt.ZERO=Object.freeze((new vt).set([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]));var yt=function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),4===t.length?(this.x=t[0],this.y=t[1],this.z=t[2],this.w=t[3]):(this.x=t,this.y=e,this.z=i,this.w=n)}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y,this.z,this.w)},e.conjugate=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},e.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.equals=function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},e.getAxisAngle=function(t){var e=2*Math.acos(this.w),i=Math.sin(e/2);return 0!==i?(t.x=this.x/i,t.y=this.y/i,t.z=this.z/i,(t.x<0||t.y<0||t.z<0)&&(t.x*=-1,t.y*=-1,t.z*=-1,e*=-1)):(t.x=1,t.y=0,t.z=0),e*it.RAD_TO_DEG},e.getEulerAngles=function(t){var e,i,n;void 0===t&&(t=new lt);var s=this.x,a=this.y,r=this.z,o=this.w,h=2*(o*a-s*r);return h<=-.99999?(e=2*Math.atan2(s,o),i=-Math.PI/2,n=0):h>=.99999?(e=2*Math.atan2(s,o),i=Math.PI/2,n=0):(e=Math.atan2(2*(o*s+a*r),1-2*(s*s+a*a)),i=Math.asin(h),n=Math.atan2(2*(o*r+s*a),1-2*(a*a+r*r))),t.set(e,i,n).mulScalar(it.RAD_TO_DEG)},e.invert=function(){return this.conjugate().normalize()},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.mul=function(t){var e=this.x,i=this.y,n=this.z,s=this.w,a=t.x,r=t.y,o=t.z,h=t.w;return this.x=s*a+e*h+i*o-n*r,this.y=s*r+i*h+n*a-e*o,this.z=s*o+n*h+e*r-i*a,this.w=s*h-e*a-i*r-n*o,this},e.mul2=function(t,e){var i=t.x,n=t.y,s=t.z,a=t.w,r=e.x,o=e.y,h=e.z,l=e.w;return this.x=a*r+i*l+n*h-s*o,this.y=a*o+n*l+s*r-i*h,this.z=a*h+s*l+i*o-n*r,this.w=a*l-i*r-n*o-s*h,this},e.normalize=function(){var t=this.length();return 0===t?(this.x=this.y=this.z=0,this.w=1):(t=1/t,this.x*=t,this.y*=t,this.z*=t,this.w*=t),this},e.set=function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this},e.setFromAxisAngle=function(t,e){e*=.5*it.DEG_TO_RAD;var i=Math.sin(e),n=Math.cos(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=n,this},e.setFromEulerAngles=function(t,e,i){var n=.5*it.DEG_TO_RAD;t*=n,e*=n,i*=n;var s=Math.sin(t),a=Math.cos(t),r=Math.sin(e),o=Math.cos(e),h=Math.sin(i),l=Math.cos(i);return this.x=s*o*l-a*r*h,this.y=a*r*l+s*o*h,this.z=a*o*h-s*r*l,this.w=a*o*l+s*r*h,this},e.setFromMat4=function(t){var e,i,n,s,a,r,o,h,l,c,u,d,f,p;if(e=(t=t.data)[0],i=t[1],n=t[2],s=t[4],a=t[5],r=t[6],o=t[8],h=t[9],l=t[10],0===(d=e*e+i*i+n*n))return this;if(d=1/Math.sqrt(d),0===(f=s*s+a*a+r*r))return this;if(f=1/Math.sqrt(f),0===(p=o*o+h*h+l*l))return this;i*=d,n*=d,s*=f,r*=f,o*=p=1/Math.sqrt(p),h*=p;var m=(e*=d)+(a*=f)+(l*=p);return m>=0?(c=Math.sqrt(m+1),this.w=.5*c,c=.5/c,this.x=(r-h)*c,this.y=(o-n)*c,this.z=(i-s)*c):e>a?e>l?(u=e-(a+l)+1,u=Math.sqrt(u),this.x=.5*u,u=.5/u,this.w=(r-h)*u,this.y=(i+s)*u,this.z=(n+o)*u):(u=l-(e+a)+1,u=Math.sqrt(u),this.z=.5*u,u=.5/u,this.w=(i-s)*u,this.x=(o+n)*u,this.y=(h+r)*u):a>l?(u=a-(l+e)+1,u=Math.sqrt(u),this.y=.5*u,u=.5/u,this.w=(o-n)*u,this.z=(r+h)*u,this.x=(s+i)*u):(u=l-(e+a)+1,u=Math.sqrt(u),this.z=.5*u,u=.5/u,this.w=(i-s)*u,this.x=(o+n)*u,this.y=(h+r)*u),this},e.slerp=function(t,e,i){var n=t.x,s=t.y,a=t.z,r=t.w,o=e.x,h=e.y,l=e.z,c=e.w,u=r*c+n*o+s*h+a*l;if(u<0&&(c=-c,o=-o,h=-h,l=-l,u=-u),Math.abs(u)>=1)return this.w=r,this.x=n,this.y=s,this.z=a,this;var d=Math.acos(u),f=Math.sqrt(1-u*u);if(Math.abs(f)<.001)return this.w=.5*r+.5*c,this.x=.5*n+.5*o,this.y=.5*s+.5*h,this.z=.5*a+.5*l,this;var p=Math.sin((1-i)*d)/f,m=Math.sin(i*d)/f;return this.w=r*p+c*m,this.x=n*p+o*m,this.y=s*p+h*m,this.z=a*p+l*m,this},e.transformVector=function(t,e){void 0===e&&(e=new lt);var i=t.x,n=t.y,s=t.z,a=this.x,r=this.y,o=this.z,h=this.w,l=h*i+r*s-o*n,c=h*n+o*i-a*s,u=h*s+a*n-r*i,d=-a*i-r*n-o*s;return e.x=l*h+d*-a+c*-o-u*-r,e.y=c*h+d*-r+u*-a-l*-o,e.z=u*h+d*-o+l*-r-c*-a,e},e.toString=function(){return"["+this.x+", "+this.y+", "+this.z+", "+this.w+"]"},t}();yt.IDENTITY=Object.freeze(new yt(0,0,0,1)),yt.ZERO=Object.freeze(new yt(0,0,0,0));var xt=new lt,bt=new lt,St=new lt,wt=new lt,Tt=new lt,At=function(){function t(t,e){void 0===t&&(t=new lt),void 0===e&&(e=new lt(.5,.5,.5)),this.center=t,this.halfExtents=e,this._min=new lt,this._max=new lt}var e=t.prototype;return e.add=function(t){var e=this.center,i=e.x,n=e.y,s=e.z,a=this.halfExtents,r=a.x,o=a.y,h=a.z,l=i-r,c=i+r,u=n-o,d=n+o,f=s-h,p=s+h,m=t.center,_=m.x,g=m.y,v=m.z,y=t.halfExtents,x=y.x,b=y.y,S=y.z,w=_-x,T=_+x,A=g-b,M=g+b,C=v-S,E=v+S;wc&&(c=T),Ad&&(d=M),Cp&&(p=E),e.x=.5*(l+c),e.y=.5*(u+d),e.z=.5*(f+p),a.x=.5*(c-l),a.y=.5*(d-u),a.z=.5*(p-f)},e.copy=function(t){this.center.copy(t.center),this.halfExtents.copy(t.halfExtents)},e.clone=function(){return new t(this.center.clone(),this.halfExtents.clone())},e.intersects=function(t){var e=this.getMax(),i=this.getMin(),n=t.getMax(),s=t.getMin();return i.x<=n.x&&e.x>=s.x&&i.y<=n.y&&e.y>=s.y&&i.z<=n.z&&e.z>=s.z},e._intersectsRay=function(t,e){var i=xt.copy(this.getMin()).sub(t.origin),n=bt.copy(this.getMax()).sub(t.origin),s=t.direction;0===s.x?(i.x=i.x<0?-Number.MAX_VALUE:Number.MAX_VALUE,n.x=n.x<0?-Number.MAX_VALUE:Number.MAX_VALUE):(i.x/=s.x,n.x/=s.x),0===s.y?(i.y=i.y<0?-Number.MAX_VALUE:Number.MAX_VALUE,n.y=n.y<0?-Number.MAX_VALUE:Number.MAX_VALUE):(i.y/=s.y,n.y/=s.y),0===s.z?(i.z=i.z<0?-Number.MAX_VALUE:Number.MAX_VALUE,n.z=n.z<0?-Number.MAX_VALUE:Number.MAX_VALUE):(i.z/=s.z,n.z/=s.z);var a=St.set(Math.min(i.x,n.x),Math.min(i.y,n.y),Math.min(i.z,n.z)),r=wt.set(Math.max(i.x,n.x),Math.max(i.y,n.y),Math.max(i.z,n.z)),o=Math.min(Math.min(r.x,r.y),r.z),h=Math.max(Math.max(a.x,a.y),a.z),l=o>=h&&h>=0;return l&&e.copy(t.direction).mulScalar(h).add(t.origin),l},e._fastIntersectsRay=function(t){var e=xt,i=bt,n=St,s=wt,a=Tt,r=t.direction;return e.sub2(t.origin,this.center),s.set(Math.abs(e.x),Math.abs(e.y),Math.abs(e.z)),n.mul2(e,r),!(s.x>this.halfExtents.x&&n.x>=0)&&(!(s.y>this.halfExtents.y&&n.y>=0)&&(!(s.z>this.halfExtents.z&&n.z>=0)&&(a.set(Math.abs(r.x),Math.abs(r.y),Math.abs(r.z)),i.cross(r,e),i.set(Math.abs(i.x),Math.abs(i.y),Math.abs(i.z)),!(i.x>this.halfExtents.y*a.z+this.halfExtents.z*a.y)&&(!(i.y>this.halfExtents.x*a.z+this.halfExtents.z*a.x)&&!(i.z>this.halfExtents.x*a.y+this.halfExtents.y*a.x)))))},e.intersectsRay=function(t,e){return e?this._intersectsRay(t,e):this._fastIntersectsRay(t)},e.setMinMax=function(t,e){this.center.add2(e,t).mulScalar(.5),this.halfExtents.sub2(e,t).mulScalar(.5)},e.getMin=function(){return this._min.copy(this.center).sub(this.halfExtents)},e.getMax=function(){return this._max.copy(this.center).add(this.halfExtents)},e.containsPoint=function(t){var e=this.getMin(),i=this.getMax();return!(t.xi.x||t.yi.y||t.zi.z)},e.setFromTransformedAabb=function(t,e,i){void 0===i&&(i=!1);var n=t.center,s=t.halfExtents,a=e.data,r=a[0],o=a[4],h=a[8],l=a[1],c=a[5],u=a[9],d=a[2],f=a[6],p=a[10];if(i){var m=r*r+o*o+h*h;if(m>0){var _=1/Math.sqrt(m);r*=_,o*=_,h*=_}if((m=l*l+c*c+u*u)>0){var g=1/Math.sqrt(m);l*=g,c*=g,u*=g}if((m=d*d+f*f+p*p)>0){var v=1/Math.sqrt(m);d*=v,f*=v,p*=v}}this.center.set(a[12]+r*n.x+o*n.y+h*n.z,a[13]+l*n.x+c*n.y+u*n.z,a[14]+d*n.x+f*n.y+p*n.z),this.halfExtents.set(Math.abs(r)*s.x+Math.abs(o)*s.y+Math.abs(h)*s.z,Math.abs(l)*s.x+Math.abs(c)*s.y+Math.abs(u)*s.z,Math.abs(d)*s.x+Math.abs(f)*s.y+Math.abs(p)*s.z)},e.compute=function(t,e){if((e=void 0===e?t.length/3:e)>0){for(var i=xt.set(t[0],t[1],t[2]),n=bt.set(t[0],t[1],t[2]),s=1;sn.x&&(n.x=a),r>n.y&&(n.y=r),o>n.z&&(n.z=o)}this.setMinMax(i,n)}},e.intersectsBoundingSphere=function(t){return this._distanceToBoundingSphereSq(t)<=t.radius*t.radius},e._distanceToBoundingSphereSq=function(t){for(var e=this.getMin(),i=this.getMax(),n=0,s=["x","y","z"],a=0;a<3;++a){var r=0,o=t.center[s[a]],h=e[s[a]],l=i[s[a]],c=0;ol&&(r+=(c=o-l)*c),n+=r}return n},e._expand=function(t,e){xt.add2(this.getMin(),t),bt.add2(this.getMax(),e),this.setMinMax(xt,bt)},t}(),Mt=new lt,Ct=new lt,Et=function(){function t(t,e){void 0===t&&(t=new lt),void 0===e&&(e=.5),this.center=t,this.radius=e}var e=t.prototype;return e.containsPoint=function(t){var e=Mt.sub2(t,this.center).lengthSq(),i=this.radius;return e0&&n>0)return!1;var a=n*n-s;if(a<0)return!1;var r=Math.abs(-n-Math.sqrt(a));return e&&e.copy(t.direction).mulScalar(r).add(t.origin),!0},e.intersectsBoundingSphere=function(t){Mt.sub2(t.center,this.center);var e=t.radius+this.radius;return Mt.lengthSq()<=e*e},t}(),Pt="none",Rt="linear",It={0:"PCF3",1:"VSM8",2:"VSM16",3:"VSM32",4:"PCF5",5:"PCF1"},Lt=128,Dt=256,kt=1024,Ot=2048,Ft=4096,Bt=8192,Nt=18,Ut=[new lt,new lt,new lt,new lt,new lt,new lt,new lt,new lt],zt=function(){function t(){this.planes=[];for(var t=0;t<6;t++)this.planes[t]=[]}var e=t.prototype;return e.setFromMat4=function(t){var e,i=t.data,n=this.planes;(e=n[0])[0]=i[3]-i[0],e[1]=i[7]-i[4],e[2]=i[11]-i[8],e[3]=i[15]-i[12];var s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s,(e=n[1])[0]=i[3]+i[0],e[1]=i[7]+i[4],e[2]=i[11]+i[8],e[3]=i[15]+i[12],s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s,(e=n[2])[0]=i[3]+i[1],e[1]=i[7]+i[5],e[2]=i[11]+i[9],e[3]=i[15]+i[13],s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s,(e=n[3])[0]=i[3]-i[1],e[1]=i[7]-i[5],e[2]=i[11]-i[9],e[3]=i[15]-i[13],s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s,(e=n[4])[0]=i[3]-i[2],e[1]=i[7]-i[6],e[2]=i[11]-i[10],e[3]=i[15]-i[14],s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s,(e=n[5])[0]=i[3]+i[2],e[1]=i[7]+i[6],e[2]=i[11]+i[10],e[3]=i[15]+i[14],s=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),e[0]/=s,e[1]/=s,e[2]/=s,e[3]/=s},e.containsPoint=function(t){var e,i;for(e=0;e<6;e++)if((i=this.planes[e])[0]*t.x+i[1]*t.y+i[2]*t.z+i[3]<=0)return!1;return!0},e.containsSphere=function(t){var e,i,n,s=0,a=t.radius,r=t.center,o=r.x,h=r.y,l=r.z,c=this.planes;for(i=0;i<6;i++){if((e=(n=c[i])[0]*o+n[1]*h+n[2]*l+n[3])<=-a)return 0;e>a&&s++}return 6===s?2:1},t.getPoints=function(t,e,i){e=e||t._nearClip,i=i||t._farClip;var n=t._fov*Math.PI/180,s=0===t._projection?Math.tan(n/2)*e:t._orthoHeight,a=s*t._aspectRatio,r=Ut;return r[0].x=a,r[0].y=-s,r[0].z=-e,r[1].x=a,r[1].y=s,r[1].z=-e,r[2].x=-a,r[2].y=s,r[2].z=-e,r[3].x=-a,r[3].y=-s,r[3].z=-e,0===t._projection&&(a=(s=Math.tan(n/2)*i)*t._aspectRatio),r[4].x=a,r[4].y=-s,r[4].z=-i,r[5].x=a,r[5].y=s,r[5].z=-i,r[6].x=-a,r[6].y=s,r[6].z=-i,r[7].x=-a,r[7].y=-s,r[7].z=-i,r},t}(),Vt=function(){function t(t,e){void 0===t&&(t=new lt),void 0===e&&(e=new lt(0,0,-1)),this.origin=t,this.direction=e}return t.prototype.set=function(t,e){return this.origin.copy(t),this.direction.copy(e),this},t}(),Wt=new Vt,Gt=new lt,Ht=new Et,Xt=new vt,qt=function(){function t(t,e){void 0===t&&(t=new vt),void 0===e&&(e=new lt(.5,.5,.5)),this.halfExtents=e,this._modelTransform=t.clone().invert(),this._worldTransform=t.clone(),this._aabb=new At(new lt,this.halfExtents)}var e=t.prototype;return e.intersectsRay=function(t,e){if(this._modelTransform.transformPoint(t.origin,Wt.origin),this._modelTransform.transformVector(t.direction,Wt.direction),e){var i=this._aabb._intersectsRay(Wt,e);return Xt.copy(this._modelTransform).invert().transformPoint(e,e),i}return this._aabb._fastIntersectsRay(Wt)},e.containsPoint=function(t){return this._modelTransform.transformPoint(t,Gt),this._aabb.containsPoint(Gt)},e.intersectsBoundingSphere=function(t){return this._modelTransform.transformPoint(t.center,Ht.center),Ht.radius=t.radius,!!this._aabb.intersectsBoundingSphere(Ht)},W(t,[{key:"worldTransform",get:function(){return this._worldTransform},set:function(t){this._worldTransform.copy(t),this._modelTransform.copy(t).invert()}}]),t}(),jt=new lt,Yt=function(){function t(t,e){void 0===t&&(t=new lt),void 0===e&&(e=new lt(0,0,1)),this.normal=e,this.point=t}var e=t.prototype;return e.intersectsLine=function(t,e,i){var n=-this.normal.dot(this.point),s=this.normal.dot(t)+n,a=s/(s-(this.normal.dot(e)+n)),r=a>=0&&a<=1;return r&&i&&i.lerp(t,e,a),r},e.intersectsRay=function(t,e){var i=jt.sub2(this.point,t.origin),n=this.normal.dot(i)/this.normal.dot(t.direction),s=n>=0;return s&&e&&e.copy(t.direction).mulScalar(n).add(t.origin),s},t}(),Kt=10,Zt=11,$t=12,Qt=13,Jt=14,te=16,ee=17,ie=21,ne=24,se=25,ae="POSITION",re="NORMAL",oe="TANGENT",he="BLENDWEIGHT",le="BLENDINDICES",ce="COLOR",ue="TEXCOORD",de="TEXCOORD0",fe="TEXCOORD1",pe="TEXCOORD2",me="TEXCOORD3",_e="TEXCOORD4",ge="TEXCOORD5",ve="TEXCOORD6",ye="TEXCOORD7",xe="ATTR",be="ATTR0",Se="ATTR1",we="ATTR2",Te="ATTR3",Ae="ATTR4",Me="ATTR5",Ce="ATTR6",Ee="ATTR7",Pe="ATTR8",Re="ATTR9",Ie="ATTR10",Le="ATTR11",De="ATTR12",ke="ATTR13",Oe="ATTR14",Fe="ATTR15",Be="default",Ne="rgbm",Ue="rgbe",ze="swizzleGGGR",Ve="none",We="cube",Ge="equirect",He="octahedral",Xe=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array],qe=[1,1,2,2,4,4,4],je={Int8Array:0,Uint8Array:1,Int16Array:2,Uint16Array:3,Int32Array:4,Uint32Array:5,Float32Array:6},Ye=[Uint8Array,Uint16Array,Uint32Array],Ke=[1,2,4],Ze={POSITION:0,NORMAL:1,BLENDWEIGHT:2,BLENDINDICES:3,COLOR:4,TEXCOORD0:5,TEXCOORD1:6,TEXCOORD2:7,TEXCOORD3:8,TEXCOORD4:9,TEXCOORD5:10,TEXCOORD6:11,TEXCOORD7:12,TANGENT:13,ATTR0:0,ATTR1:1,ATTR2:2,ATTR3:3,ATTR4:4,ATTR5:5,ATTR6:6,ATTR7:7,ATTR8:8,ATTR9:9,ATTR10:10,ATTR11:11,ATTR12:12,ATTR13:13,ATTR14:14,ATTR15:15},$e=0,Qe=function(){function t(t,e,i,n,s){void 0===n&&(n=0),this.device=t,this.format=e,this.numVertices=i,this.usage=n,this.id=$e++,this.impl=t.createVertexBufferImpl(this,e),this.instancing=!1,this.numBytes=e.verticesByteSize?e.verticesByteSize:e.size*i,t._vram.vb+=this.numBytes,s?this.setData(s):this.storage=new ArrayBuffer(this.numBytes),this.device.buffers.push(this)}var e=t.prototype;return e.destroy=function(){var t=this.device,e=t.buffers.indexOf(this);-1!==e&&t.buffers.splice(e,1),this.impl.destroy(t),t._vram.vb-=this.storage.byteLength},e.loseContext=function(){this.impl.loseContext()},e.getFormat=function(){return this.format},e.getUsage=function(){return this.usage},e.getNumVertices=function(){return this.numVertices},e.lock=function(){return this.storage},e.unlock=function(){this.impl.unlock(this)},e.setData=function(t){return t.byteLength===this.numBytes&&(this.storage=t,this.unlock(),!0)},t}();function Je(t){for(var e=0,i=0,n=t.length;i 0.5) {\n\t\tif (dAtten > 0.00001) {\n\t\t\tdirLm.xyz = dirLm.xyz * 2.0 - vec3(1.0);\n\t\t\tdAtten = saturate(dAtten);\n\t\t\tgl_FragColor.rgb = normalize(dLightDirNormW.xyz*dAtten + dirLm.xyz*dirLm.w) * 0.5 + vec3(0.5);\n\t\t\tgl_FragColor.a = dirLm.w + dAtten;\n\t\t\tgl_FragColor.a = max(gl_FragColor.a, 1.0 / 255.0);\n\t\t} else {\n\t\t\tgl_FragColor = dirLm;\n\t\t}\n\t} else {\n\t\tgl_FragColor.rgb = dirLm.xyz;\n\t\tgl_FragColor.a = max(dirLm.w, dAtten > 0.00001? (1.0/255.0) : 0.0);\n\t}\n",bakeLmEndPS:"\tgl_FragColor.rgb = dDiffuseLight;\n\tgl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(0.5));\n\tgl_FragColor.rgb /= 8.0;\n\tgl_FragColor.a = clamp( max( max( gl_FragColor.r, gl_FragColor.g ), max( gl_FragColor.b, 1.0 / 255.0 ) ), 0.0,1.0 );\n\tgl_FragColor.a = ceil(gl_FragColor.a * 255.0) / 255.0;\n\tgl_FragColor.rgb /= gl_FragColor.a;\n",basePS:"uniform vec3 view_position;\nuniform vec3 light_globalAmbient;\nfloat square(float x) {\n\treturn x*x;\n}\nfloat saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\nvec3 saturate(vec3 x) {\n\treturn clamp(x, vec3(0.0), vec3(1.0));\n}\n",baseVS:"attribute vec3 vertex_position;\nattribute vec3 vertex_normal;\nattribute vec4 vertex_tangent;\nattribute vec2 vertex_texCoord0;\nattribute vec2 vertex_texCoord1;\nattribute vec4 vertex_color;\nuniform mat4 matrix_viewProjection;\nuniform mat4 matrix_model;\nuniform mat3 matrix_normal;\nvec3 dPositionW;\nmat4 dModelMatrix;\nmat3 dNormalMatrix;\n",baseNineSlicedPS:"#define NINESLICED\nvarying vec2 vMask;\nvarying vec2 vTiledUv;\nuniform mediump vec4 innerOffset;\nuniform mediump vec2 outerScale;\nuniform mediump vec4 atlasRect;\nvec2 nineSlicedUv;\n",baseNineSlicedVS:"#define NINESLICED\nvarying vec2 vMask;\nvarying vec2 vTiledUv;\nuniform mediump vec4 innerOffset;\nuniform mediump vec2 outerScale;\nuniform mediump vec4 atlasRect;\n",baseNineSlicedTiledPS:"#define NINESLICED\n#define NINESLICETILED\nvarying vec2 vMask;\nvarying vec2 vTiledUv;\nuniform mediump vec4 innerOffset;\nuniform mediump vec2 outerScale;\nuniform mediump vec4 atlasRect;\nvec2 nineSlicedUv;\n",biasConstPS:"#define SHADOWBIAS\nfloat getShadowBias(float resolution, float maxBias) {\n\treturn maxBias;\n}\n",blurVSMPS:"varying vec2 vUv0;\nuniform sampler2D source;\nuniform vec2 pixelOffset;\n#ifdef GAUSS\nuniform float weight[SAMPLES];\n#endif\n#ifdef PACKED\nfloat decodeFloatRG(vec2 rg) {\n\treturn rg.y*(1.0/255.0) + rg.x;\n}\nvec2 encodeFloatRG( float v ) {\n\tvec2 enc = vec2(1.0, 255.0) * v;\n\tenc = fract(enc);\n\tenc -= enc.yy * vec2(1.0/255.0, 1.0/255.0);\n\treturn enc;\n}\n#endif\nvoid main(void) {\n\tvec3 moments = vec3(0.0);\n\tvec2 uv = vUv0 - pixelOffset * (float(SAMPLES) * 0.5);\n\tfor (int i=0; i shadowZ ? 1.0 : 0.0;\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF3) || defined(CLUSTER_SHADOW_TYPE_PCF5)\n\tfloat getShadowOmniClusteredPCF3(sampler2D shadowMap, vec4 shadowParams, vec3 omniAtlasViewport, float shadowEdgePixels, vec3 dir) {\n\t\tfloat shadowTextureResolution = shadowParams.x;\n\t\tvec2 uv = getCubemapAtlasCoordinates(omniAtlasViewport, shadowEdgePixels, shadowTextureResolution, dir);\n\t\tfloat shadowZ = length(dir) * shadowParams.w + shadowParams.z;\n\t\tdShadowCoord = vec3(uv, shadowZ);\n\t\treturn getShadowPCF3x3(shadowMap, shadowParams.xyz);\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF5)\n\tfloat getShadowOmniClusteredPCF5(sampler2D shadowMap, vec4 shadowParams, vec3 omniAtlasViewport, float shadowEdgePixels, vec3 dir) {\n\t\treturn getShadowOmniClusteredPCF3(shadowMap, shadowParams, omniAtlasViewport, shadowEdgePixels, dir);\n\t}\n\t#endif\n#endif\n#ifdef GL2\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF1)\n\tfloat getShadowSpotClusteredPCF1(sampler2DShadow shadowMap, vec4 shadowParams) {\n\t\treturn texture(shadowMap, dShadowCoord);\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF3)\n\tfloat getShadowSpotClusteredPCF3(sampler2DShadow shadowMap, vec4 shadowParams) {\n\t\treturn getShadowSpotPCF3x3(shadowMap, shadowParams);\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF5)\n\tfloat getShadowSpotClusteredPCF5(sampler2DShadow shadowMap, vec4 shadowParams) {\n\t\treturn getShadowPCF5x5(shadowMap, shadowParams.xyz);\n\t}\n\t#endif\n#else\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF1)\n\tfloat getShadowSpotClusteredPCF1(sampler2D shadowMap, vec4 shadowParams) {\n\t\tfloat depth = unpackFloat(texture2D(shadowMap, dShadowCoord.xy));\n\t\treturn depth > dShadowCoord.z ? 1.0 : 0.0;\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF3) || defined(CLUSTER_SHADOW_TYPE_PCF5)\n\tfloat getShadowSpotClusteredPCF3(sampler2D shadowMap, vec4 shadowParams) {\n\t\treturn getShadowSpotPCF3x3(shadowMap, shadowParams);\n\t}\n\t#endif\n\t#if defined(CLUSTER_SHADOW_TYPE_PCF5)\n\tfloat getShadowSpotClusteredPCF5(sampler2D shadowMap, vec4 shadowParams) {\n\t\treturn getShadowSpotClusteredPCF3(shadowMap, shadowParams);\n\t}\n\t#endif\n#endif\n",clusteredLightUtilsPS:"vec2 getCubemapFaceCoordinates(const vec3 dir, out float faceIndex, out vec2 tileOffset)\n{\n\tvec3 vAbs = abs(dir);\n\tfloat ma;\n\tvec2 uv;\n\tif (vAbs.z >= vAbs.x && vAbs.z >= vAbs.y) {\n\t\tfaceIndex = dir.z < 0.0 ? 5.0 : 4.0;\n\t\tma = 0.5 / vAbs.z;\n\t\tuv = vec2(dir.z < 0.0 ? -dir.x : dir.x, -dir.y);\n\t\ttileOffset.x = 2.0;\n\t\ttileOffset.y = dir.z < 0.0 ? 1.0 : 0.0;\n\t} else if(vAbs.y >= vAbs.x) {\n\t\tfaceIndex = dir.y < 0.0 ? 3.0 : 2.0;\n\t\tma = 0.5 / vAbs.y;\n\t\tuv = vec2(dir.x, dir.y < 0.0 ? -dir.z : dir.z);\n\t\ttileOffset.x = 1.0;\n\t\ttileOffset.y = dir.y < 0.0 ? 1.0 : 0.0;\n\t} else {\n\t\tfaceIndex = dir.x < 0.0 ? 1.0 : 0.0;\n\t\tma = 0.5 / vAbs.x;\n\t\tuv = vec2(dir.x < 0.0 ? dir.z : -dir.z, -dir.y);\n\t\ttileOffset.x = 0.0;\n\t\ttileOffset.y = dir.x < 0.0 ? 1.0 : 0.0;\n\t}\n\treturn uv * ma + 0.5;\n}\nvec2 getCubemapAtlasCoordinates(const vec3 omniAtlasViewport, float shadowEdgePixels, float shadowTextureResolution, const vec3 dir) {\n\tfloat faceIndex;\n\tvec2 tileOffset;\n\tvec2 uv = getCubemapFaceCoordinates(dir, faceIndex, tileOffset);\n\tfloat atlasFaceSize = omniAtlasViewport.z;\n\tfloat tileSize = shadowTextureResolution * atlasFaceSize;\n\tfloat offset = shadowEdgePixels / tileSize;\n\tuv = uv * vec2(1.0 - offset * 2.0) + vec2(offset * 1.0);\n\tuv *= atlasFaceSize;\n\tuv += tileOffset * atlasFaceSize;\n\tuv += omniAtlasViewport.xy;\n\treturn uv;\n}\n",clusteredLightPS:"uniform sampler2D clusterWorldTexture;\nuniform sampler2D lightsTexture8;\nuniform highp sampler2D lightsTextureFloat;\n#ifdef CLUSTER_SHADOWS\n\t#ifdef GL2\n\t\tuniform sampler2DShadow shadowAtlasTexture;\n\t#else\n\t\tuniform sampler2D shadowAtlasTexture;\n\t#endif\n#endif\n#ifdef CLUSTER_COOKIES\n\tuniform sampler2D cookieAtlasTexture;\n#endif\nuniform float clusterPixelsPerCell;\nuniform vec3 clusterCellsCountByBoundsSize;\nuniform vec4 lightsTextureInvSize;\nuniform vec3 clusterTextureSize;\nuniform vec3 clusterBoundsMin;\nuniform vec3 clusterBoundsDelta;\nuniform vec3 clusterCellsDot;\nuniform vec3 clusterCellsMax;\nuniform vec2 clusterCompressionLimit0;\nuniform vec2 shadowAtlasParams;\nfloat LTCLightValuesEvaluated = 0.0;\nstruct ClusterLightData {\n\tfloat lightV;\n\tfloat type;\n\tfloat shape;\n\tvec3 halfWidth;\n\tvec3 halfHeight;\n\tfloat falloffMode;\n\tfloat castShadows;\n\tfloat shadowBias;\n\tfloat shadowNormalBias;\n\tvec3 position;\n\tvec3 direction;\n\tfloat range;\n\tfloat innerConeAngleCos;\n\tfloat outerConeAngleCos;\n\tvec3 color;\n\tvec3 omniAtlasViewport;\n\tfloat cookie;\n\tfloat cookieRgb;\n\tfloat cookieIntensity;\n\tvec4 cookieChannelMask;\n\tfloat mask;\n};\nmat4 lightProjectionMatrix;\n#define isClusteredLightCastShadow(light) ( light.castShadows > 0.5 )\n#define isClusteredLightCookie(light) (light.cookie > 0.5 )\n#define isClusteredLightCookieRgb(light) (light.cookieRgb > 0.5 )\n#define isClusteredLightSpot(light) ( light.type > 0.5 )\n#define isClusteredLightFalloffLinear(light) ( light.falloffMode < 0.5 )\n#define isClusteredLightArea(light) ( light.shape > 0.1 )\n#define isClusteredLightRect(light) ( light.shape < 0.3 )\n#define isClusteredLightDisk(light) ( light.shape < 0.6 )\n#ifdef CLUSTER_MESH_DYNAMIC_LIGHTS\n\t#define acceptLightMask(light) ( light.mask < 0.75)\n#else\n\t#define acceptLightMask(light) ( light.mask > 0.25)\n#endif\nvec4 decodeClusterLowRange4Vec4(vec4 d0, vec4 d1, vec4 d2, vec4 d3) {\n\treturn vec4(\n\t\tbytes2floatRange4(d0, -2.0, 2.0),\n\t\tbytes2floatRange4(d1, -2.0, 2.0),\n\t\tbytes2floatRange4(d2, -2.0, 2.0),\n\t\tbytes2floatRange4(d3, -2.0, 2.0)\n\t);\n}\n#ifdef SUPPORTS_TEXLOD\n\t#define textureData(texture, uv) texture2DLodEXT(texture, uv, 0.0)\n#else\n\t#define textureData(texture, uv) texture2D(texture, uv)\n#endif\nvec4 sampleLightsTexture8(const ClusterLightData clusterLightData, float index) {\n\treturn textureData(lightsTexture8, vec2(index * lightsTextureInvSize.z, clusterLightData.lightV));\n}\nvec4 sampleLightTextureF(const ClusterLightData clusterLightData, float index) {\n\treturn textureData(lightsTextureFloat, vec2(index * lightsTextureInvSize.x, clusterLightData.lightV));\n}\nvoid decodeClusterLightCore(inout ClusterLightData clusterLightData, float lightIndex) {\n\tclusterLightData.lightV = (lightIndex + 0.5) * lightsTextureInvSize.w;\n\tvec4 lightInfo = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_FLAGS);\n\tclusterLightData.type = lightInfo.x;\n\tclusterLightData.shape = lightInfo.y;\n\tclusterLightData.falloffMode = lightInfo.z;\n\tclusterLightData.castShadows = lightInfo.w;\n\tvec4 colorA = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_COLOR_A);\n\tvec4 colorB = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_COLOR_B);\n\tclusterLightData.color = vec3(bytes2float2(colorA.xy), bytes2float2(colorA.zw), bytes2float2(colorB.xy)) * clusterCompressionLimit0.y;\n\tclusterLightData.cookie = colorB.z;\n\tclusterLightData.mask = colorB.w;\n\t#ifdef CLUSTER_TEXTURE_FLOAT\n\t\tvec4 lightPosRange = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_POSITION_RANGE);\n\t\tclusterLightData.position = lightPosRange.xyz;\n\t\tclusterLightData.range = lightPosRange.w;\n\t\tvec4 lightDir_Unused = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_SPOT_DIRECTION);\n\t\tclusterLightData.direction = lightDir_Unused.xyz;\n\t#else\n\t\tvec4 encPosX = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_POSITION_X);\n\t\tvec4 encPosY = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_POSITION_Y);\n\t\tvec4 encPosZ = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_POSITION_Z);\n\t\tclusterLightData.position = vec3(bytes2float4(encPosX), bytes2float4(encPosY), bytes2float4(encPosZ)) * clusterBoundsDelta + clusterBoundsMin;\n\t\tvec4 encRange = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_RANGE);\n\t\tclusterLightData.range = bytes2float4(encRange) * clusterCompressionLimit0.x;\n\t\tvec4 encDirX = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SPOT_DIRECTION_X);\n\t\tvec4 encDirY = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SPOT_DIRECTION_Y);\n\t\tvec4 encDirZ = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SPOT_DIRECTION_Z);\n\t\tclusterLightData.direction = vec3(bytes2float4(encDirX), bytes2float4(encDirY), bytes2float4(encDirZ)) * 2.0 - 1.0;\n\t#endif\n}\nvoid decodeClusterLightSpot(inout ClusterLightData clusterLightData) {\n\tvec4 coneAngle = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SPOT_ANGLES);\n\tclusterLightData.innerConeAngleCos = bytes2float2(coneAngle.xy) * 2.0 - 1.0;\n\tclusterLightData.outerConeAngleCos = bytes2float2(coneAngle.zw) * 2.0 - 1.0;\n}\nvoid decodeClusterLightOmniAtlasViewport(inout ClusterLightData clusterLightData) {\n\t#ifdef CLUSTER_TEXTURE_FLOAT\n\t\tclusterLightData.omniAtlasViewport = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_0).xyz;\n\t#else\n\t\tvec4 viewportA = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_ATLAS_VIEWPORT_A);\n\t\tvec4 viewportB = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_ATLAS_VIEWPORT_B);\n\t\tclusterLightData.omniAtlasViewport = vec3(bytes2float2(viewportA.xy), bytes2float2(viewportA.zw), bytes2float2(viewportB.xy));\n\t#endif\n}\nvoid decodeClusterLightAreaData(inout ClusterLightData clusterLightData) {\n\t#ifdef CLUSTER_TEXTURE_FLOAT\n\t\tclusterLightData.halfWidth = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_AREA_DATA_WIDTH).xyz;\n\t\tclusterLightData.halfHeight = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_AREA_DATA_HEIGHT).xyz;\n\t#else\n\t\tvec4 areaWidthX = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_WIDTH_X);\n\t\tvec4 areaWidthY = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_WIDTH_Y);\n\t\tvec4 areaWidthZ = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_WIDTH_Z);\n\t\tclusterLightData.halfWidth = vec3(mantissaExponent2Float(areaWidthX), mantissaExponent2Float(areaWidthY), mantissaExponent2Float(areaWidthZ));\n\t\tvec4 areaHeightX = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_HEIGHT_X);\n\t\tvec4 areaHeightY = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_HEIGHT_Y);\n\t\tvec4 areaHeightZ = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_AREA_DATA_HEIGHT_Z);\n\t\tclusterLightData.halfHeight = vec3(mantissaExponent2Float(areaHeightX), mantissaExponent2Float(areaHeightY), mantissaExponent2Float(areaHeightZ));\n\t#endif\n}\nvoid decodeClusterLightProjectionMatrixData(inout ClusterLightData clusterLightData) {\n\t#ifdef CLUSTER_TEXTURE_FLOAT\n\t\tvec4 m0 = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_0);\n\t\tvec4 m1 = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_1);\n\t\tvec4 m2 = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_2);\n\t\tvec4 m3 = sampleLightTextureF(clusterLightData, CLUSTER_TEXTURE_F_PROJ_MAT_3);\n\t#else\n\t\tvec4 m00 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_00);\n\t\tvec4 m01 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_01);\n\t\tvec4 m02 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_02);\n\t\tvec4 m03 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_03);\n\t\tvec4 m0 = decodeClusterLowRange4Vec4(m00, m01, m02, m03);\n\t\tvec4 m10 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_10);\n\t\tvec4 m11 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_11);\n\t\tvec4 m12 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_12);\n\t\tvec4 m13 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_13);\n\t\tvec4 m1 = decodeClusterLowRange4Vec4(m10, m11, m12, m13);\n\t\tvec4 m20 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_20);\n\t\tvec4 m21 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_21);\n\t\tvec4 m22 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_22);\n\t\tvec4 m23 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_23);\n\t\tvec4 m2 = decodeClusterLowRange4Vec4(m20, m21, m22, m23);\n\t\tvec4 m30 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_30);\n\t\tvec4 m31 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_31);\n\t\tvec4 m32 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_32);\n\t\tvec4 m33 = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_PROJ_MAT_33);\n\t\tvec4 m3 = vec4(mantissaExponent2Float(m30), mantissaExponent2Float(m31), mantissaExponent2Float(m32), mantissaExponent2Float(m33));\n\t#endif\n\tlightProjectionMatrix = mat4(m0, m1, m2, m3);\n}\nvoid decodeClusterLightShadowData(inout ClusterLightData clusterLightData) {\n\tvec4 biases = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_SHADOW_BIAS);\n\tclusterLightData.shadowBias = bytes2floatRange2(biases.xy, -1.0, 20.0),\n\tclusterLightData.shadowNormalBias = bytes2float2(biases.zw);\n}\nvoid decodeClusterLightCookieData(inout ClusterLightData clusterLightData) {\n\tvec4 cookieA = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_COOKIE_A);\n\tclusterLightData.cookieIntensity = cookieA.x;\n\tclusterLightData.cookieRgb = cookieA.y;\n\tclusterLightData.cookieChannelMask = sampleLightsTexture8(clusterLightData, CLUSTER_TEXTURE_8_COOKIE_B);\n}\nvoid evaluateLight(ClusterLightData light) {\n\tdAtten3 = vec3(1.0);\n\tgetLightDirPoint(light.position);\n\t#ifdef CLUSTER_AREALIGHTS\n\tif (isClusteredLightArea(light)) {\n\t\tdecodeClusterLightAreaData(light);\n\t\tif (LTCLightValuesEvaluated < 0.5) {\n\t\t\tLTCLightValuesEvaluated = 1.0;\n\t\t\tcalcLTCLightValues();\n\t\t}\n\t\tif (isClusteredLightRect(light)) {\n\t\t\tcalcRectLightValues(light.position, light.halfWidth, light.halfHeight);\n\t\t} else if (isClusteredLightDisk(light)) {\n\t\t\tcalcDiskLightValues(light.position, light.halfWidth, light.halfHeight);\n\t\t} else {\n\t\t\tcalcSphereLightValues(light.position, light.halfWidth, light.halfHeight);\n\t\t}\n\t\tdAtten = getFalloffWindow(light.range);\n\t} else\n\t#endif\n\t{\n\t\tif (isClusteredLightFalloffLinear(light))\n\t\t\tdAtten = getFalloffLinear(light.range);\n\t\telse\n\t\t\tdAtten = getFalloffInvSquared(light.range);\n\t}\n\tif (dAtten > 0.00001) {\n\t\t#ifdef CLUSTER_AREALIGHTS\n\t\tif (isClusteredLightArea(light)) {\n\t\t\tif (isClusteredLightRect(light)) {\n\t\t\t\tdAttenD = getRectLightDiffuse() * 16.0;\n\t\t\t} else if (isClusteredLightDisk(light)) {\n\t\t\t\tdAttenD = getDiskLightDiffuse() * 16.0;\n\t\t\t} else {\n\t\t\t\tdAttenD = getSphereLightDiffuse() * 16.0;\n\t\t\t}\n\t\t} else\n\t\t#endif\n\t\t{\n\t\t\tdAtten *= getLightDiffuse();\n\t\t}\n\t\tif (isClusteredLightSpot(light)) {\n\t\t\tdecodeClusterLightSpot(light);\n\t\t\tdAtten *= getSpotEffect(light.direction, light.innerConeAngleCos, light.outerConeAngleCos);\n\t\t}\n\t\t#if defined(CLUSTER_COOKIES) || defined(CLUSTER_SHADOWS)\n\t\tif (dAtten > 0.00001) {\n\t\t\tif (isClusteredLightCastShadow(light) || isClusteredLightCookie(light)) {\n\t\t\t\tif (isClusteredLightSpot(light)) {\n\t\t\t\t\tdecodeClusterLightProjectionMatrixData(light);\n\t\t\t\t} else {\n\t\t\t\t\tdecodeClusterLightOmniAtlasViewport(light);\n\t\t\t\t}\n\t\t\t\tfloat shadowTextureResolution = shadowAtlasParams.x;\n\t\t\t\tfloat shadowEdgePixels = shadowAtlasParams.y;\n\t\t\t\t#ifdef CLUSTER_COOKIES\n\t\t\t\tif (isClusteredLightCookie(light)) {\n\t\t\t\t\tdecodeClusterLightCookieData(light);\n\t\t\t\t\tif (isClusteredLightSpot(light)) {\n\t\t\t\t\t\tdAtten3 = getCookie2DClustered(cookieAtlasTexture, lightProjectionMatrix, vPositionW, light.cookieIntensity, isClusteredLightCookieRgb(light), light.cookieChannelMask);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdAtten3 = getCookieCubeClustered(cookieAtlasTexture, dLightDirW, light.cookieIntensity, isClusteredLightCookieRgb(light), light.cookieChannelMask, shadowTextureResolution, shadowEdgePixels, light.omniAtlasViewport);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#endif\n\t\t\t\t#ifdef CLUSTER_SHADOWS\n\t\t\t\tif (isClusteredLightCastShadow(light)) {\n\t\t\t\t\tdecodeClusterLightShadowData(light);\n\t\t\t\t\tvec4 shadowParams = vec4(shadowTextureResolution, light.shadowNormalBias, light.shadowBias, 1.0 / light.range);\n\t\t\t\t\tif (isClusteredLightSpot(light)) {\n\t\t\t\t\t\tgetShadowCoordPerspZbufferNormalOffset(lightProjectionMatrix, shadowParams);\n\t\t\t\t\t\t#if defined(CLUSTER_SHADOW_TYPE_PCF1)\n\t\t\t\t\t\t\tdAtten *= getShadowSpotClusteredPCF1(shadowAtlasTexture, shadowParams);\n\t\t\t\t\t\t#elif defined(CLUSTER_SHADOW_TYPE_PCF3)\n\t\t\t\t\t\t\tdAtten *= getShadowSpotClusteredPCF3(shadowAtlasTexture, shadowParams);\n\t\t\t\t\t\t#elif defined(CLUSTER_SHADOW_TYPE_PCF5)\n\t\t\t\t\t\t\tdAtten *= getShadowSpotClusteredPCF5(shadowAtlasTexture, shadowParams);\n\t\t\t\t\t\t#endif\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnormalOffsetPointShadow(shadowParams);\n\t\t\t\t\t\t#if defined(CLUSTER_SHADOW_TYPE_PCF1)\n\t\t\t\t\t\t\tdAtten *= getShadowOmniClusteredPCF1(shadowAtlasTexture, shadowParams, light.omniAtlasViewport, shadowEdgePixels, dLightDirW);\n\t\t\t\t\t\t#elif defined(CLUSTER_SHADOW_TYPE_PCF3)\n\t\t\t\t\t\t\tdAtten *= getShadowOmniClusteredPCF3(shadowAtlasTexture, shadowParams, light.omniAtlasViewport, shadowEdgePixels, dLightDirW);\n\t\t\t\t\t\t#elif defined(CLUSTER_SHADOW_TYPE_PCF5)\n\t\t\t\t\t\t\tdAtten *= getShadowOmniClusteredPCF5(shadowAtlasTexture, shadowParams, light.omniAtlasViewport, shadowEdgePixels, dLightDirW);\n\t\t\t\t\t\t#endif\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#endif\n\t\t\t}\n\t\t}\n\t\t#endif\n\t\t#ifdef CLUSTER_AREALIGHTS\n\t\tif (isClusteredLightArea(light)) {\n\t\t\t{\n\t\t\t\tvec3 areaDiffuse = (dAttenD * dAtten) * light.color * dAtten3;\n\t\t\t\t#if defined(CLUSTER_SPECULAR) && defined(CLUSTER_CONSERVE_ENERGY)\n\t\t\t\t\tareaDiffuse = mix(areaDiffuse, vec3(0), dLTCSpecFres);\n\t\t\t\t#endif\n\t\t\t\tdDiffuseLight += areaDiffuse;\n\t\t\t}\n\t\t\t#ifdef CLUSTER_SPECULAR\n\t\t\t\tfloat areaLightSpecular;\n\t\t\t\tif (isClusteredLightRect(light)) {\n\t\t\t\t\tareaLightSpecular = getRectLightSpecular();\n\t\t\t\t} else if (isClusteredLightDisk(light)) {\n\t\t\t\t\tareaLightSpecular = getDiskLightSpecular();\n\t\t\t\t} else {\n\t\t\t\t\tareaLightSpecular = getSphereLightSpecular();\n\t\t\t\t}\n\t\t\t\tdSpecularLight += dLTCSpecFres * areaLightSpecular * dAtten * light.color * dAtten3;\n\t\t\t\t#ifdef CLUSTER_CLEAR_COAT\n\t\t\t\t\tfloat areaLightSpecularCC;\n\t\t\t\t\tif (isClusteredLightRect(light)) {\n\t\t\t\t\t\tareaLightSpecularCC = getRectLightSpecularCC();\n\t\t\t\t\t} else if (isClusteredLightDisk(light)) {\n\t\t\t\t\t\tareaLightSpecularCC = getDiskLightSpecularCC();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tareaLightSpecularCC = getSphereLightSpecularCC();\n\t\t\t\t\t}\n\t\t\t\t\tccSpecularLight += ccLTCSpecFres * areaLightSpecularCC * dAtten * light.color\t* dAtten3;\n\t\t\t\t#endif\n\t\t\t#endif\n\t\t} else\n\t\t#endif\n\t\t{\n\t\t\t{\n\t\t\t\tvec3 punctualDiffuse = dAtten * light.color * dAtten3;\n\t\t\t\t#if defined(CLUSTER_AREALIGHTS) && defined(CLUSTER_SPECULAR) && defined(CLUSTER_CONSERVE_ENERGY)\n\t\t\t\t\tpunctualDiffuse = mix(punctualDiffuse, vec3(0), dSpecularity);\n\t\t\t\t#endif\n\t\t\t\tdDiffuseLight += punctualDiffuse;\n\t\t\t}\n\t\t\t#ifdef CLUSTER_SPECULAR\n\t\t\t\t{\n\t\t\t\t\tvec3 punctualSpecular = getLightSpecular() * dAtten * light.color * dAtten3;\n\t\t\t\t\t#if defined(CLUSTER_AREALIGHTS)\n\t\t\t\t\t\tpunctualSpecular *= dSpecularity;\n\t\t\t\t\t#endif\n\t\t\t\t\tdSpecularLight += punctualSpecular;\n\t\t\t\t}\n\t\t\t\t#ifdef CLUSTER_CLEAR_COAT\n\t\t\t\t\tvec3 punctualCC = getLightSpecularCC() * dAtten * light.color * dAtten3;\n\t\t\t\t\t#if defined(CLUSTER_AREALIGHTS)\n\t\t\t\t\t\tpunctualCC *= ccSpecularity;\n\t\t\t\t\t#endif\n\t\t\t\t\tccSpecularLight += punctualCC;\n\t\t\t\t#endif\n\t\t\t#endif\n\t\t}\n\t}\n}\nvoid evaluateClusterLight(float lightIndex) {\n\tClusterLightData clusterLightData;\n\tdecodeClusterLightCore(clusterLightData, lightIndex);\n\tif (acceptLightMask(clusterLightData))\n\t\tevaluateLight(clusterLightData);\n}\nvoid addClusteredLights() {\n\tvec3 cellCoords = floor((vPositionW - clusterBoundsMin) * clusterCellsCountByBoundsSize);\n\tif (!(any(lessThan(cellCoords, vec3(0.0))) || any(greaterThanEqual(cellCoords, clusterCellsMax)))) {\n\t\tfloat cellIndex = dot(clusterCellsDot, cellCoords);\n\t\tfloat clusterV = floor(cellIndex * clusterTextureSize.y);\n\t\tfloat clusterU = cellIndex - (clusterV * clusterTextureSize.x);\n\t\tclusterV = (clusterV + 0.5) * clusterTextureSize.z;\n\t\tconst float maxLightCells = 256.0 / 4.0;\n\t\tfor (float lightCellIndex = 0.5; lightCellIndex < maxLightCells; lightCellIndex++) {\n\t\t\tvec4 lightIndices = textureData(clusterWorldTexture, vec2(clusterTextureSize.y * (clusterU + lightCellIndex), clusterV));\n\t\t\tvec4 indices = lightIndices * 255.0;\n\t\t\tfor (int i = 0; i < 4; i++) {\n\t\t\t\tif (indices.x <= 0.0)\n\t\t\t\t\treturn;\n\t\t\t\tevaluateClusterLight(indices.x);\n\t\t\t\tindices = indices.yzwx;\n\t\t\t}\n\t\t\tif (lightCellIndex > clusterPixelsPerCell) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n",combineClearCoatPS:"vec3 combineColorCC() {\n\treturn combineColor()+(ccSpecularLight*ccSpecularity+ccReflection.rgb*ccSpecularity*ccReflection.a);\n}\n",combineDiffusePS:"vec3 combineColor() {\n\treturn dAlbedo * dDiffuseLight;\n}\n",combineDiffuseSpecularPS:"vec3 combineColor() {\n\treturn mix(dAlbedo * dDiffuseLight, dSpecularLight + dReflection.rgb * dReflection.a, dSpecularity);\n}\n",combineDiffuseSpecularNoConservePS:"vec3 combineColor() {\n\treturn dAlbedo * dDiffuseLight + (dSpecularLight + dReflection.rgb * dReflection.a) * dSpecularity;\n}\n",combineDiffuseSpecularNoReflPS:"vec3 combineColor() {\n\treturn dAlbedo * dDiffuseLight + dSpecularLight * dSpecularity;\n}\n",combineDiffuseSpecularNoReflSeparateAmbientPS:"uniform vec3 material_ambient;\nvec3 combineColor() {\n\treturn (dDiffuseLight - light_globalAmbient) * dAlbedo + dSpecularLight * dSpecularity + material_ambient * light_globalAmbient;\n}\n",combineDiffuseSpecularOldPS:"vec3 combineColor() {\n\treturn mix(dAlbedo * dDiffuseLight + dSpecularLight * dSpecularity, dReflection.rgb, dReflection.a);\n}\n",cookiePS:"vec4 getCookie2D(sampler2D tex, mat4 transform, float intensity) {\n\tvec4 projPos = transform * vec4(vPositionW, 1.0);\n\tprojPos.xy /= projPos.w;\n\treturn mix(vec4(1.0), texture2D(tex, projPos.xy), intensity);\n}\nvec4 getCookie2DClip(sampler2D tex, mat4 transform, float intensity) {\n\tvec4 projPos = transform * vec4(vPositionW, 1.0);\n\tprojPos.xy /= projPos.w;\n\tif (projPos.x < 0.0 || projPos.x > 1.0 || projPos.y < 0.0 || projPos.y > 1.0 || projPos.z < 0.0) return vec4(0.0);\n\treturn mix(vec4(1.0), texture2D(tex, projPos.xy), intensity);\n}\nvec4 getCookie2DXform(sampler2D tex, mat4 transform, float intensity, vec4 cookieMatrix, vec2 cookieOffset) {\n\tvec4 projPos = transform * vec4(vPositionW, 1.0);\n\tprojPos.xy /= projPos.w;\n\tprojPos.xy += cookieOffset;\n\tvec2 uv = mat2(cookieMatrix) * (projPos.xy-vec2(0.5)) + vec2(0.5);\n\treturn mix(vec4(1.0), texture2D(tex, uv), intensity);\n}\nvec4 getCookie2DClipXform(sampler2D tex, mat4 transform, float intensity, vec4 cookieMatrix, vec2 cookieOffset) {\n\tvec4 projPos = transform * vec4(vPositionW, 1.0);\n\tprojPos.xy /= projPos.w;\n\tprojPos.xy += cookieOffset;\n\tif (projPos.x < 0.0 || projPos.x > 1.0 || projPos.y < 0.0 || projPos.y > 1.0 || projPos.z < 0.0) return vec4(0.0);\n\tvec2 uv = mat2(cookieMatrix) * (projPos.xy-vec2(0.5)) + vec2(0.5);\n\treturn mix(vec4(1.0), texture2D(tex, uv), intensity);\n}\nvec4 getCookieCube(samplerCube tex, mat4 transform, float intensity) {\n\treturn mix(vec4(1.0), textureCube(tex, dLightDirNormW * mat3(transform)), intensity);\n}\n",cubeMapProjectBoxPS:"uniform vec3 envBoxMin, envBoxMax;\nvec3 cubeMapProject(vec3 nrdir) {\n\tnrdir = cubeMapRotate(nrdir);\n\tvec3 rbmax = (envBoxMax - vPositionW) / nrdir;\n\tvec3 rbmin = (envBoxMin - vPositionW) / nrdir;\n\tvec3 rbminmax;\n\trbminmax.x = nrdir.x>0.0? rbmax.x : rbmin.x;\n\trbminmax.y = nrdir.y>0.0? rbmax.y : rbmin.y;\n\trbminmax.z = nrdir.z>0.0? rbmax.z : rbmin.z;\n\tfloat fa = min(min(rbminmax.x, rbminmax.y), rbminmax.z);\n\tvec3 posonbox = vPositionW + nrdir * fa;\n\tvec3 envBoxPos = (envBoxMin + envBoxMax) * 0.5;\n\treturn normalize(posonbox - envBoxPos);\n}\n",cubeMapProjectNonePS:"vec3 cubeMapProject(vec3 dir) {\n\treturn cubeMapRotate(dir);\n}\n",cubeMapRotatePS:"#ifdef CUBEMAP_ROTATION\nuniform mat3 cubeMapRotationMatrix;\n#endif\nvec3 cubeMapRotate(vec3 refDir) {\n#ifdef CUBEMAP_ROTATION\n\treturn refDir * cubeMapRotationMatrix;\n#else\n\treturn refDir;\n#endif\n}\n",detailModesPS:"vec3 detailMode_mul(vec3 c1, vec3 c2) {\n\treturn c1 * c2;\n}\nvec3 detailMode_add(vec3 c1, vec3 c2) {\n\treturn c1 + c2;\n}\nvec3 detailMode_screen(vec3 c1, vec3 c2) {\n\treturn 1.0 - (1.0 - c1)*(1.0 - c2);\n}\nvec3 detailMode_overlay(vec3 c1, vec3 c2) {\n\treturn mix(1.0 - 2.0*(1.0 - c1)*(1.0 - c2), 2.0*c1*c2, step(c1, vec3(0.5)));\n}\nvec3 detailMode_min(vec3 c1, vec3 c2) {\n\treturn min(c1, c2);\n}\nvec3 detailMode_max(vec3 c1, vec3 c2) {\n\treturn max(c1, c2);\n}\n",diffusePS:"#ifdef MAPCOLOR\nuniform vec3 material_diffuse;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_diffuseMap;\n#endif\nvoid getAlbedo() {\n\tdAlbedo = vec3(1.0);\n\t#ifdef MAPCOLOR\n\tdAlbedo *= material_diffuse.rgb;\n\t#endif\n\t#ifdef MAPTEXTURE\n\tdAlbedo *= gammaCorrectInput(addAlbedoDetail(texture2D(texture_diffuseMap, $UV).$CH));\n\t#endif\n\t#ifdef MAPVERTEX\n\tdAlbedo *= gammaCorrectInput(saturate(vVertexColor.$VC));\n\t#endif\n}\n",diffuseDetailMapPS:"#ifdef MAPTEXTURE\nuniform sampler2D texture_diffuseDetailMap;\n#endif\nvec3 addAlbedoDetail(vec3 albedo) {\n\t#ifdef MAPTEXTURE\n\tvec3 albedoDetail = vec3(texture2D(texture_diffuseDetailMap, $UV).$CH);\n\treturn detailMode_$DETAILMODE(albedo, albedoDetail);\n\t#else\n\treturn albedo;\n\t#endif\n}\n",dilatePS:"#define SHADER_NAME Dilate\nvarying vec2 vUv0;\nuniform sampler2D source;\nuniform vec2 pixelOffset;\nvoid main(void) {\n\tvec4 c = texture2D(source, vUv0);\n\tc = c.a>0.0? c : texture2D(source, vUv0 - pixelOffset);\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(0, -pixelOffset.y));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(pixelOffset.x, -pixelOffset.y));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(-pixelOffset.x, 0));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(pixelOffset.x, 0));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(-pixelOffset.x, pixelOffset.y));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + vec2(0, pixelOffset.y));\n\tc = c.a>0.0? c : texture2D(source, vUv0 + pixelOffset);\n\tgl_FragColor = c;\n}\n",bilateralDeNoisePS:"#define SHADER_NAME BilateralDeNoise\nfloat normpdf3(in vec3 v, in float sigma) {\n\treturn 0.39894 * exp(-0.5 * dot(v, v) / (sigma * sigma)) / sigma;\n}\nvec3 decodeRGBM(vec4 rgbm) {\n\tvec3 color = (8.0 * rgbm.a) * rgbm.rgb;\n\treturn color * color;\n}\nfloat saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\nvec4 encodeRGBM(vec3 color) {\n\tvec4 encoded;\n\tencoded.rgb = pow(color.rgb, vec3(0.5));\n\tencoded.rgb *= 1.0 / 8.0;\n\tencoded.a = saturate( max( max( encoded.r, encoded.g ), max( encoded.b, 1.0 / 255.0 ) ) );\n\tencoded.a = ceil(encoded.a * 255.0) / 255.0;\n\tencoded.rgb /= encoded.a;\n\treturn encoded;\n}\n#define MSIZE 15\nvarying vec2 vUv0;\nuniform sampler2D source;\nuniform vec2 pixelOffset;\nuniform vec2 sigmas;\nuniform float bZnorm;\nuniform float kernel[MSIZE];\nvoid main(void) {\n\tvec4 pixelRgbm = texture2D(source, vUv0);\n\tif (pixelRgbm.a <= 0.0) {\n\t\tgl_FragColor = pixelRgbm;\n\t\treturn ;\n\t}\n\tfloat sigma = sigmas.x;\n\tfloat bSigma = sigmas.y;\n\tvec3 pixelHdr = decodeRGBM(pixelRgbm);\n\tvec3 accumulatedHdr = vec3(0.0);\n\tfloat accumulatedFactor = 0.0;\n\tconst int kSize = (MSIZE-1)/2;\n\tfor (int i = -kSize; i <= kSize; ++i) {\n\t\tfor (int j = -kSize; j <= kSize; ++j) {\n\t\t\tvec2 coord = vUv0 + vec2(float(i), float(j)) * pixelOffset;\n\t\t\tvec4 rgbm = texture2D(source, coord);\n\t\t\tif (rgbm.a > 0.0) {\n\t\t\t\tvec3 hdr = decodeRGBM(rgbm);\n\t\t\t\tfloat factor = kernel[kSize + j] * kernel[kSize + i];\n\t\t\t\tfactor *= normpdf3(hdr - pixelHdr, bSigma) * bZnorm;\n\t\t\t\taccumulatedHdr += factor * hdr;\n\t\t\t\taccumulatedFactor += factor;\n\t\t\t}\n\t\t}\n\t}\n\tgl_FragColor = encodeRGBM(accumulatedHdr / accumulatedFactor);\n}\n",decodePS:"vec3 decodeLinear(vec4 raw) {\n\treturn raw.rgb;\n}\nvec3 decodeGamma(vec4 raw) {\n\treturn pow(raw.xyz, vec3(2.2));\n}\nvec3 decodeRGBM(vec4 raw) {\n\tvec3 color = (8.0 * raw.a) * raw.rgb;\n\treturn color * color;\n}\nvec3 decodeRGBE(vec4 raw) {\n\tif (raw.a == 0.0) {\n\t\treturn vec3(0.0, 0.0, 0.0);\n\t} else {\n\t\treturn raw.xyz * pow(2.0, raw.w * 255.0 - 128.0);\n\t}\n}\nconst float PI = 3.141592653589793;\nvec2 toSpherical(vec3 dir) {\n\treturn vec2(dir.xz == vec2(0.0) ? 0.0 : atan(dir.x, dir.z), asin(dir.y));\n}\nvec2 toSphericalUv(vec3 dir) {\n\tvec2 uv = toSpherical(dir) / vec2(PI * 2.0, PI) + 0.5;\n\treturn vec2(uv.x, 1.0 - uv.y);\n}\nconst float atlasSize = 512.0;\nconst float seamSize = 1.0 / atlasSize;\nvec2 mapUv(vec2 uv, vec4 rect) {\n\treturn vec2(mix(rect.x + seamSize, rect.x + rect.z - seamSize, uv.x),\n\t\t\t\tmix(rect.y + seamSize, rect.y + rect.w - seamSize, uv.y));\n}\nvec2 mapRoughnessUv(vec2 uv, float level) {\n\tfloat t = 1.0 / exp2(level);\n\treturn mapUv(uv, vec4(0, 1.0 - t, t, t * 0.5));\n}\nvec2 mapMip(vec2 uv, float level) {\n\tfloat t = 1.0 / exp2(level);\n\treturn mapUv(uv, vec4(1.0 - t, 1.0 - t, t, t * 0.5));\n}\n",emissivePS:"#ifdef MAPCOLOR\nuniform vec3 material_emissive;\n#endif\n#ifdef MAPFLOAT\nuniform float material_emissiveIntensity;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_emissiveMap;\n#endif\nvec3 getEmission() {\n\tvec3 emission = vec3(1.0);\n\t#ifdef MAPFLOAT\n\temission *= material_emissiveIntensity;\n\t#endif\n\t#ifdef MAPCOLOR\n\temission *= material_emissive;\n\t#endif\n\t#ifdef MAPTEXTURE\n\temission *= $texture2DSAMPLE(texture_emissiveMap, $UV).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\temission *= gammaCorrectInput(saturate(vVertexColor.$VC));\n\t#endif\n\treturn emission;\n}\n",endPS:"\t#ifdef CLEARCOAT\n\tgl_FragColor.rgb = combineColorCC();\n\t#else\n\tgl_FragColor.rgb = combineColor();\n\t#endif\n\tgl_FragColor.rgb += getEmission();\n\tgl_FragColor.rgb = addFog(gl_FragColor.rgb);\n\t#ifndef HDR\n\tgl_FragColor.rgb = toneMap(gl_FragColor.rgb);\n\tgl_FragColor.rgb = gammaCorrectOutput(gl_FragColor.rgb);\n\t#endif\n",endVS:"\n",envConstPS:"vec3 processEnvironment(vec3 color) {\n\treturn color;\n}\n",envMultiplyPS:"uniform float skyboxIntensity;\nvec3 processEnvironment(vec3 color) {\n\treturn color * skyboxIntensity;\n}\n",extensionPS:"\n",extensionVS:"\n",falloffInvSquaredPS:"float getFalloffWindow(float lightRadius) {\n\tfloat sqrDist = dot(dLightDirW, dLightDirW);\n\tfloat invRadius = 1.0 / lightRadius;\n\treturn square( saturate( 1.0 - square( sqrDist * square(invRadius) ) ) );\n}\nfloat getFalloffInvSquared(float lightRadius) {\n\tfloat sqrDist = dot(dLightDirW, dLightDirW);\n\tfloat falloff = 1.0 / (sqrDist + 1.0);\n\tfloat invRadius = 1.0 / lightRadius;\n\tfalloff *= 16.0;\n\tfalloff *= square( saturate( 1.0 - square( sqrDist * square(invRadius) ) ) );\n\treturn falloff;\n}\n",falloffLinearPS:"float getFalloffLinear(float lightRadius) {\n\tfloat d = length(dLightDirW);\n\treturn max(((lightRadius - d) / lightRadius), 0.0);\n}\n",fixCubemapSeamsNonePS:"vec3 fixSeams(vec3 vec, float mipmapIndex) {\n\treturn vec;\n}\nvec3 fixSeams(vec3 vec) {\n\treturn vec;\n}\nvec3 fixSeamsStatic(vec3 vec, float invRecMipSize) {\n\treturn vec;\n}\nvec3 calcSeam(vec3 vec) {\n\treturn vec3(0);\n}\nvec3 applySeam(vec3 vec, vec3 seam, float scale) {\n\treturn vec;\n}\n",fixCubemapSeamsStretchPS:"vec3 fixSeams(vec3 vec, float mipmapIndex) {\n\tvec3 avec = abs(vec);\n\tfloat scale = 1.0 - exp2(mipmapIndex) / 128.0;\n\tfloat M = max(max(avec.x, avec.y), avec.z);\n\tif (avec.x != M) vec.x *= scale;\n\tif (avec.y != M) vec.y *= scale;\n\tif (avec.z != M) vec.z *= scale;\n\treturn vec;\n}\nvec3 fixSeams(vec3 vec) {\n\tvec3 avec = abs(vec);\n\tfloat scale = 1.0 - 1.0 / 128.0;\n\tfloat M = max(max(avec.x, avec.y), avec.z);\n\tif (avec.x != M) vec.x *= scale;\n\tif (avec.y != M) vec.y *= scale;\n\tif (avec.z != M) vec.z *= scale;\n\treturn vec;\n}\nvec3 fixSeamsStatic(vec3 vec, float invRecMipSize) {\n\tvec3 avec = abs(vec);\n\tfloat scale = invRecMipSize;\n\tfloat M = max(max(avec.x, avec.y), avec.z);\n\tif (avec.x != M) vec.x *= scale;\n\tif (avec.y != M) vec.y *= scale;\n\tif (avec.z != M) vec.z *= scale;\n\treturn vec;\n}\nvec3 calcSeam(vec3 vec) {\n\tvec3 avec = abs(vec);\n\tfloat M = max(avec.x, max(avec.y, avec.z));\n\treturn vec3(avec.x != M ? 1.0 : 0.0,\n\t\t\t\tavec.y != M ? 1.0 : 0.0,\n\t\t\t\tavec.z != M ? 1.0 : 0.0);\n}\nvec3 applySeam(vec3 vec, vec3 seam, float scale) {\n\treturn vec * (seam * -scale + vec3(1.0));\n}\n",floatUnpackingPS:"float bytes2float2(vec2 data) {\n\treturn dot(data, vec2(1.0, 1.0 / 255.0));\n}\nfloat bytes2float3(vec3 data) {\n\treturn dot(data, vec3(1.0, 1.0 / 255.0, 1.0 / 65025.0));\n}\nfloat bytes2float4(vec4 data) {\n\treturn dot(data, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n}\nfloat bytes2floatRange2(vec2 data, float min, float max) {\n\treturn mix(min, max, bytes2float2(data));\n}\nfloat bytes2floatRange3(vec3 data, float min, float max) {\n\treturn mix(min, max, bytes2float3(data));\n}\nfloat bytes2floatRange4(vec4 data, float min, float max) {\n\treturn mix(min, max, bytes2float4(data));\n}\nfloat mantissaExponent2Float(vec4 pack)\n{\n\tfloat value = bytes2floatRange3(pack.xyz, -1.0, 1.0);\n\tfloat exponent = floor(pack.w * 255.0 - 127.0);\n\treturn value * exp2(exponent);\n}\n",fogExpPS:"uniform vec3 fog_color;\nuniform float fog_density;\nfloat dBlendModeFogFactor = 1.0;\nvec3 addFog(vec3 color) {\n\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\tfloat fogFactor = exp(-depth * fog_density);\n\tfogFactor = clamp(fogFactor, 0.0, 1.0);\n\treturn mix(fog_color * dBlendModeFogFactor, color, fogFactor);\n}\n",fogExp2PS:"uniform vec3 fog_color;\nuniform float fog_density;\nfloat dBlendModeFogFactor = 1.0;\nvec3 addFog(vec3 color) {\n\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\tfloat fogFactor = exp(-depth * depth * fog_density * fog_density);\n\tfogFactor = clamp(fogFactor, 0.0, 1.0);\n\treturn mix(fog_color * dBlendModeFogFactor, color, fogFactor);\n}\n",fogLinearPS:"uniform vec3 fog_color;\nuniform float fog_start;\nuniform float fog_end;\nfloat dBlendModeFogFactor = 1.0;\nvec3 addFog(vec3 color) {\n\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\tfloat fogFactor = (fog_end - depth) / (fog_end - fog_start);\n\tfogFactor = clamp(fogFactor, 0.0, 1.0);\n\tfogFactor = gammaCorrectInput(fogFactor);\n\treturn mix(fog_color * dBlendModeFogFactor, color, fogFactor);\n}\n",fogNonePS:"float dBlendModeFogFactor = 1.0;\nvec3 addFog(vec3 color) {\n\treturn color;\n}\n",fresnelSchlickPS:"uniform float material_fresnelFactor;\nvoid getFresnel() {\n\tfloat fresnel = 1.0 - max(dot(dNormalW, dViewDirW), 0.0);\n\tfloat fresnel2 = fresnel * fresnel;\n\tfresnel *= fresnel2 * fresnel2;\n\tfresnel *= dGlossiness * dGlossiness;\n\tdSpecularity = dSpecularity + (1.0 - dSpecularity) * fresnel;\n\t#ifdef CLEARCOAT\n\tfresnel = 1.0 - max(dot(ccNormalW, dViewDirW), 0.0);\n\tfresnel2 = fresnel * fresnel;\n\tfresnel *= fresnel2 * fresnel2;\n\tfresnel *= ccGlossiness * ccGlossiness;\n\tccSpecularity = ccSpecularity + (1.0 - ccSpecularity) * fresnel;\n\t#endif\n}\n",fullscreenQuadPS:"varying vec2 vUv0;\nuniform sampler2D source;\nvoid main(void) {\n\tgl_FragColor = texture2D(source, vUv0);\n}\n",fullscreenQuadVS:"attribute vec2 vertex_position;\nvarying vec2 vUv0;\nvoid main(void)\n{\n\tgl_Position = vec4(vertex_position, 0.5, 1.0);\n\tvUv0 = vertex_position.xy*0.5+0.5;\n}\n",gamma1_0PS:"vec4 texture2DSRGB(sampler2D tex, vec2 uv) {\n\treturn texture2D(tex, uv);\n}\nvec4 texture2DSRGB(sampler2D tex, vec2 uv, float bias) {\n\treturn texture2D(tex, uv, bias);\n}\nvec4 textureCubeSRGB(samplerCube tex, vec3 uvw) {\n\treturn textureCube(tex, uvw);\n}\nvec3 gammaCorrectOutput(vec3 color) {\n\treturn color;\n}\nvec3 gammaCorrectInput(vec3 color) {\n\treturn color;\n}\nfloat gammaCorrectInput(float color) {\n\treturn color;\n}\nvec4 gammaCorrectInput(vec4 color) {\n\treturn color;\n}\n",gamma2_2PS:"vec3 gammaCorrectInput(vec3 color) {\n\treturn pow(color, vec3(2.2));\n}\nfloat gammaCorrectInput(float color) {\n\treturn pow(color, 2.2);\n}\nvec4 gammaCorrectInput(vec4 color) {\n\treturn vec4(pow(color.rgb, vec3(2.2)), color.a);\n}\nvec4 texture2DSRGB(sampler2D tex, vec2 uv) {\n\tvec4 rgba = texture2D(tex, uv);\n\trgba.rgb = gammaCorrectInput(rgba.rgb);\n\treturn rgba;\n}\nvec4 texture2DSRGB(sampler2D tex, vec2 uv, float bias) {\n\tvec4 rgba = texture2D(tex, uv, bias);\n\trgba.rgb = gammaCorrectInput(rgba.rgb);\n\treturn rgba;\n}\nvec4 textureCubeSRGB(samplerCube tex, vec3 uvw) {\n\tvec4 rgba = textureCube(tex, uvw);\n\trgba.rgb = gammaCorrectInput(rgba.rgb);\n\treturn rgba;\n}\nvec3 gammaCorrectOutput(vec3 color) {\n\t#ifdef HDR\n\treturn color;\n\t#else\n\tcolor += vec3(0.0000001);\n\treturn pow(color, vec3(0.45));\n\t#endif\n}\n",gles3PS:"#define varying in\nout highp vec4 pc_fragColor;\n#define gl_FragColor pc_fragColor\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad\n#define GL2\n#define SUPPORTS_TEXLOD\n",gles3VS:"#define attribute in\n#define varying out\n#define texture2D texture\n#define GL2\n#define VERTEXSHADER\n",glossPS:"#ifdef MAPFLOAT\nuniform float material_shininess;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_glossMap;\n#endif\nvoid getGlossiness() {\n\tdGlossiness = 1.0;\n\t#ifdef MAPFLOAT\n\tdGlossiness *= material_shininess;\n\t#endif\n\t#ifdef MAPTEXTURE\n\tdGlossiness *= texture2D(texture_glossMap, $UV).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\tdGlossiness *= saturate(vVertexColor.$VC);\n\t#endif\n\tdGlossiness += 0.0000001;\n}\n",instancingVS:"attribute vec4 instance_line1;\nattribute vec4 instance_line2;\nattribute vec4 instance_line3;\nattribute vec4 instance_line4;\n",lightDiffuseLambertPS:"float getLightDiffuse() {\n\treturn max(dot(dNormalW, -dLightDirNormW), 0.0);\n}\n",lightDirPointPS:"void getLightDirPoint(vec3 lightPosW) {\n\tdLightDirW = vPositionW - lightPosW;\n\tdLightDirNormW = normalize(dLightDirW);\n\tdLightPosW = lightPosW;\n}\n",lightmapDirPS:"uniform sampler2D texture_lightMap;\nuniform sampler2D texture_dirLightMap;\nvoid addLightMap() {\n\tvec3 color = $texture2DSAMPLE(texture_lightMap, $UV).$CH;\n\tvec3 dir = texture2D(texture_dirLightMap, $UV).xyz;\n\tif (dot(dir, vec3(1.0)) < 0.00001) {\n\t\tdDiffuseLight += color;\n\t} else {\n\t\tdLightDirNormW = normalize(dir * 2.0 - vec3(1.0));\n\t\tfloat vlight = saturate(dot(dLightDirNormW, -dVertexNormalW));\n\t\tfloat flight = saturate(dot(dLightDirNormW, -dNormalW));\n\t\tfloat nlight = (flight / max(vlight, 0.01)) * 0.5;\n\t\tdDiffuseLight += color * nlight * 2.0;\n\t}\n\tdSpecularLight += color * getLightSpecular();\n}\n",lightmapSinglePS:"#ifdef MAPTEXTURE\nuniform sampler2D texture_lightMap;\n#endif\nvoid addLightMap() {\n\tvec3 lm = vec3(1.0);\n\t#ifdef MAPTEXTURE\n\tlm *= $texture2DSAMPLE(texture_lightMap, $UV).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\tlm *= saturate(vVertexColor.$VC);\n\t#endif\n\tdDiffuseLight += lm;\n}\n",lightmapSingleVertPS:"void addLightMap() {\n\tdDiffuseLight += saturate(vVertexColor.$CH);\n}\n",lightSpecularAnisoGGXPS:"float calcLightSpecular(float tGlossiness, vec3 tNormalW) {\n\tfloat PI = 3.141592653589793;\n\tfloat roughness = max((1.0 - tGlossiness) * (1.0 - tGlossiness), 0.001);\n\tfloat anisotropy = material_anisotropy * roughness;\n\tfloat at = max((roughness + anisotropy), roughness / 4.0);\n\tfloat ab = max((roughness - anisotropy), roughness / 4.0);\n\tvec3 h = normalize(normalize(-dLightDirNormW) + normalize(dViewDirW));\n\tfloat NoH = dot(tNormalW, h);\n\tfloat ToH = dot(dTBN[0], h);\n\tfloat BoH = dot(dTBN[1], h);\n\tfloat a2 = at * ab;\n\tvec3 v = vec3(ab * ToH, at * BoH, a2 * NoH);\n\tfloat v2 = dot(v, v);\n\tfloat w2 = a2 / v2;\n\tfloat D = a2 * w2 * w2 * (1.0 / PI);\n\tfloat ToV = dot(dTBN[0], dViewDirW);\n\tfloat BoV = dot(dTBN[1], dViewDirW);\n\tfloat ToL = dot(dTBN[0], -dLightDirNormW);\n\tfloat BoL = dot(dTBN[1], -dLightDirNormW);\n\tfloat NoV = dot(tNormalW, dViewDirW);\n\tfloat NoL = dot(tNormalW, -dLightDirNormW);\n\tfloat lambdaV = NoL * length(vec3(at * ToV, ab * BoV, NoV));\n\tfloat lambdaL = NoV * length(vec3(at * ToL, ab * BoL, NoL));\n\tfloat G = 0.5 / (lambdaV + lambdaL);\n\treturn D * G;\n}\nfloat getLightSpecular() {\n\treturn calcLightSpecular(dGlossiness, dNormalW);\n}\nfloat getLightSpecularCC() {\n\treturn calcLightSpecular(ccGlossiness, ccNormalW);\n}\n",lightSpecularBlinnPS:"float calcLightSpecular(float tGlossiness, vec3 tNormalW) {\n\tvec3 h = normalize( -dLightDirNormW + dViewDirW );\n\tfloat nh = max( dot( h, tNormalW ), 0.0 );\n\tfloat specPow = exp2(tGlossiness * 11.0);\n\tspecPow = antiAliasGlossiness(specPow);\n\tspecPow = max(specPow, 0.0001);\n\treturn pow(nh, specPow) * (specPow + 2.0) / 8.0;\n}\nfloat getLightSpecular() {\n\treturn calcLightSpecular(dGlossiness, dNormalW);\n}\nfloat getLightSpecularCC() {\n\treturn calcLightSpecular(ccGlossiness, ccNormalW);\n}\n",lightSpecularPhongPS:"float calcLightSpecular(float tGlossiness, vec3 tReflDirW) {\n\tfloat specPow = tGlossiness;\n\tspecPow = antiAliasGlossiness(specPow);\n\treturn pow(max(dot(tReflDirW, -dLightDirNormW), 0.0), specPow + 0.0001);\n}\nfloat getLightSpecular() {\n\treturn calcLightSpecular(dGlossiness, dReflDirW);\n}\nfloat getLightSpecularCC() {\n\treturn calcLightSpecular(ccGlossiness, ccReflDirW);\n}\n",ltc:"mat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nstruct Coords {\n\tvec3 coord0;\n\tvec3 coord1;\n\tvec3 coord2;\n\tvec3 coord3;\n};\nfloat LTC_EvaluateRect( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in Coords rectCoords) {\n\tvec3 v1 = rectCoords.coord1 - rectCoords.coord0;\n\tvec3 v2 = rectCoords.coord3 - rectCoords.coord0;\n\tvec3 lightNormal = cross( v1, v2 );\n\tfloat factor = sign(-dot( lightNormal, P - rectCoords.coord0 ));\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 =\tfactor * cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords.coord0 - P );\n\tcoords[ 1 ] = mat * ( rectCoords.coord1 - P );\n\tcoords[ 2 ] = mat * ( rectCoords.coord2 - P );\n\tcoords[ 3 ] = mat * ( rectCoords.coord3 - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn result;\n}\nCoords dLTCCoords;\nCoords getLTCLightCoords(vec3 lightPos, vec3 halfWidth, vec3 halfHeight){\n\tCoords coords;\n\tcoords.coord0 = lightPos + halfWidth - halfHeight;\n\tcoords.coord1 = lightPos - halfWidth - halfHeight;\n\tcoords.coord2 = lightPos - halfWidth + halfHeight;\n\tcoords.coord3 = lightPos + halfWidth + halfHeight;\n\treturn coords;\n}\nfloat dSphereRadius;\nCoords getSphereLightCoords(vec3 lightPos, vec3 halfWidth, vec3 halfHeight){\n\tdSphereRadius = max(length(halfWidth), length(halfHeight));\n\tvec3 f = reflect(normalize(lightPos - view_position), vNormalW);\n\tvec3 w = normalize(cross(f, halfHeight));\n\tvec3 h = normalize(cross(f, w));\n\treturn getLTCLightCoords(lightPos, w * dSphereRadius, h * dSphereRadius);\n}\nvec2 dLTCUV;\n#ifdef CLEARCOAT\nvec2 ccLTCUV;\n#endif\nvec2 getLTCLightUV(float tGlossiness, vec3 tNormalW)\n{\n\tfloat roughness = max((1.0 - tGlossiness) * (1.0 - tGlossiness), 0.001);\n\treturn LTC_Uv( tNormalW, dViewDirW, roughness );\n}\nvec3 dLTCSpecFres;\n#ifdef CLEARCOAT\nvec3 ccLTCSpecFres;\n#endif\nvec3 getLTCLightSpecFres(vec2 uv, vec3 tSpecularity)\n{\n\tvec4 t2 = texture2D( areaLightsLutTex2, uv );\n\t#ifdef AREA_R8_G8_B8_A8_LUTS\n\tt2 *= vec4(0.693103,1,1,1);\n\tt2 += vec4(0.306897,0,0,0);\n\t#endif\n\treturn tSpecularity * t2.x + ( vec3( 1.0 ) - tSpecularity) * t2.y;\n}\nvoid calcLTCLightValues()\n{\n\tdLTCUV = getLTCLightUV(dGlossiness, dNormalW);\n\tdLTCSpecFres = getLTCLightSpecFres(dLTCUV, dSpecularityNoFres);\n#ifdef CLEARCOAT\n\tccLTCUV = getLTCLightUV(ccGlossiness, ccNormalW);\n\tccLTCSpecFres = getLTCLightSpecFres(ccLTCUV, vec3(ccSpecularityNoFres));\n#endif\n}\nvoid calcRectLightValues(vec3 lightPos, vec3 halfWidth, vec3 halfHeight)\n{\n\tdLTCCoords = getLTCLightCoords(lightPos, halfWidth, halfHeight);\n}\nvoid calcDiskLightValues(vec3 lightPos, vec3 halfWidth, vec3 halfHeight)\n{\n\tcalcRectLightValues(lightPos, halfWidth, halfHeight);\n}\nvoid calcSphereLightValues(vec3 lightPos, vec3 halfWidth, vec3 halfHeight)\n{\n\tdLTCCoords = getSphereLightCoords(lightPos, halfWidth, halfHeight);\n}\nvec3 SolveCubic(vec4 Coefficient)\n{\n\tfloat pi = 3.14159;\n\tCoefficient.xyz /= Coefficient.w;\n\tCoefficient.yz /= 3.0;\n\tfloat A = Coefficient.w;\n\tfloat B = Coefficient.z;\n\tfloat C = Coefficient.y;\n\tfloat D = Coefficient.x;\n\tvec3 Delta = vec3(\n\t\t-Coefficient.z * Coefficient.z + Coefficient.y,\n\t\t-Coefficient.y * Coefficient.z + Coefficient.x,\n\t\tdot(vec2(Coefficient.z, -Coefficient.y), Coefficient.xy)\n\t);\n\tfloat Discriminant = dot(vec2(4.0 * Delta.x, -Delta.y), Delta.zy);\n\tvec3 RootsA, RootsD;\n\tvec2 xlc, xsc;\n\t{\n\t\tfloat A_a = 1.0;\n\t\tfloat C_a = Delta.x;\n\t\tfloat D_a = -2.0 * B * Delta.x + Delta.y;\n\t\tfloat Theta = atan(sqrt(Discriminant), -D_a) / 3.0;\n\t\tfloat x_1a = 2.0 * sqrt(-C_a) * cos(Theta);\n\t\tfloat x_3a = 2.0 * sqrt(-C_a) * cos(Theta + (2.0 / 3.0) * pi);\n\t\tfloat xl;\n\t\tif ((x_1a + x_3a) > 2.0 * B)\n\t\t\txl = x_1a;\n\t\telse\n\t\t\txl = x_3a;\n\t\txlc = vec2(xl - B, A);\n\t}\n\t{\n\t\tfloat A_d = D;\n\t\tfloat C_d = Delta.z;\n\t\tfloat D_d = -D * Delta.y + 2.0 * C * Delta.z;\n\t\tfloat Theta = atan(D * sqrt(Discriminant), -D_d) / 3.0;\n\t\tfloat x_1d = 2.0 * sqrt(-C_d) * cos(Theta);\n\t\tfloat x_3d = 2.0 * sqrt(-C_d) * cos(Theta + (2.0 / 3.0) * pi);\n\t\tfloat xs;\n\t\tif (x_1d + x_3d < 2.0 * C)\n\t\t\txs = x_1d;\n\t\telse\n\t\t\txs = x_3d;\n\t\txsc = vec2(-D, xs + C);\n\t}\n\tfloat E =\txlc.y * xsc.y;\n\tfloat F = -xlc.x * xsc.y - xlc.y * xsc.x;\n\tfloat G =\txlc.x * xsc.x;\n\tvec2 xmc = vec2(C * F - B * G, -B * F + C * E);\n\tvec3 Root = vec3(xsc.x / xsc.y, xmc.x / xmc.y, xlc.x / xlc.y);\n\tif (Root.x < Root.y && Root.x < Root.z)\n\t\tRoot.xyz = Root.yxz;\n\telse if (Root.z < Root.x && Root.z < Root.y)\n\t\tRoot.xyz = Root.xzy;\n\treturn Root;\n}\nfloat LTC_EvaluateDisk(vec3 N, vec3 V, vec3 P, mat3 Minv, Coords points)\n{\n\tvec3 T1, T2;\n\tT1 = normalize(V - N * dot(V, N));\n\tT2 = cross(N, T1);\n\tmat3 R = transposeMat3( mat3( T1, T2, N ) );\n\tvec3 L_[ 3 ];\n\tL_[ 0 ] = R * ( points.coord0 - P );\n\tL_[ 1 ] = R * ( points.coord1 - P );\n\tL_[ 2 ] = R * ( points.coord2 - P );\n\tvec3 Lo_i = vec3(0);\n\tvec3 C\t= 0.5 * (L_[0] + L_[2]);\n\tvec3 V1 = 0.5 * (L_[1] - L_[2]);\n\tvec3 V2 = 0.5 * (L_[1] - L_[0]);\n\tC\t= Minv * C;\n\tV1 = Minv * V1;\n\tV2 = Minv * V2;\n\tfloat a, b;\n\tfloat d11 = dot(V1, V1);\n\tfloat d22 = dot(V2, V2);\n\tfloat d12 = dot(V1, V2);\n\tif (abs(d12) / sqrt(d11 * d22) > 0.0001)\n\t{\n\t\tfloat tr = d11 + d22;\n\t\tfloat det = -d12 * d12 + d11 * d22;\n\t\tdet = sqrt(det);\n\t\tfloat u = 0.5 * sqrt(tr - 2.0 * det);\n\t\tfloat v = 0.5 * sqrt(tr + 2.0 * det);\n\t\tfloat e_max = (u + v) * (u + v);\n\t\tfloat e_min = (u - v) * (u - v);\n\t\tvec3 V1_, V2_;\n\t\tif (d11 > d22)\n\t\t{\n\t\t\tV1_ = d12 * V1 + (e_max - d11) * V2;\n\t\t\tV2_ = d12 * V1 + (e_min - d11) * V2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tV1_ = d12*V2 + (e_max - d22)*V1;\n\t\t\tV2_ = d12*V2 + (e_min - d22)*V1;\n\t\t}\n\t\ta = 1.0 / e_max;\n\t\tb = 1.0 / e_min;\n\t\tV1 = normalize(V1_);\n\t\tV2 = normalize(V2_);\n\t}\n\telse\n\t{\n\t\ta = 1.0 / dot(V1, V1);\n\t\tb = 1.0 / dot(V2, V2);\n\t\tV1 *= sqrt(a);\n\t\tV2 *= sqrt(b);\n\t}\n\tvec3 V3 = cross(V1, V2);\n\tif (dot(C, V3) < 0.0)\n\t\tV3 *= -1.0;\n\tfloat L\t= dot(V3, C);\n\tfloat x0 = dot(V1, C) / L;\n\tfloat y0 = dot(V2, C) / L;\n\tfloat E1 = inversesqrt(a);\n\tfloat E2 = inversesqrt(b);\n\ta *= L * L;\n\tb *= L * L;\n\tfloat c0 = a * b;\n\tfloat c1 = a * b * (1.0 + x0 * x0 + y0 * y0) - a - b;\n\tfloat c2 = 1.0 - a * (1.0 + x0 * x0) - b * (1.0 + y0 * y0);\n\tfloat c3 = 1.0;\n\tvec3 roots = SolveCubic(vec4(c0, c1, c2, c3));\n\tfloat e1 = roots.x;\n\tfloat e2 = roots.y;\n\tfloat e3 = roots.z;\n\tvec3 avgDir = vec3(a * x0 / (a - e2), b * y0 / (b - e2), 1.0);\n\tmat3 rotate = mat3(V1, V2, V3);\n\tavgDir = rotate * avgDir;\n\tavgDir = normalize(avgDir);\n\tfloat L1 = sqrt(-e2 / e3);\n\tfloat L2 = sqrt(-e2 / e1);\n\tfloat formFactor = L1 * L2 * inversesqrt((1.0 + L1 * L1) * (1.0 + L2 * L2));\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tvec2 uv = vec2(avgDir.z * 0.5 + 0.5, formFactor);\n\tuv = uv*LUT_SCALE + LUT_BIAS;\n\tfloat scale = texture2D( areaLightsLutTex2, uv ).w;\n\treturn formFactor*scale;\n}\nfloat getRectLightDiffuse() {\n\treturn LTC_EvaluateRect( dNormalW, dViewDirW, vPositionW, mat3( 1.0 ), dLTCCoords );\n}\nfloat getDiskLightDiffuse() {\n\treturn LTC_EvaluateDisk( dNormalW, dViewDirW, vPositionW, mat3( 1.0 ), dLTCCoords );\n}\nfloat getSphereLightDiffuse() {\n\tfloat falloff = dSphereRadius / (dot(dLightDirW, dLightDirW) + dSphereRadius);\n\treturn getLightDiffuse()*falloff;\n}\nmat3 getLTCLightInvMat(vec2 uv)\n{\n\tvec4 t1 = texture2D( areaLightsLutTex1, uv );\n\t#ifdef AREA_R8_G8_B8_A8_LUTS\n\tt1 *= vec4(1.001, 0.3239, 0.60437568, 1.0);\n\tt1 += vec4(0.0, -0.2976, -0.01381, 0.0);\n\t#endif\n\treturn mat3(\n\t\tvec3( t1.x, 0, t1.y ),\n\t\tvec3(\t0, 1,\t0 ),\n\t\tvec3( t1.z, 0, t1.w )\n\t);\n}\nfloat calcRectLightSpecular(vec3 tNormalW, vec2 uv) {\n\tmat3 mInv = getLTCLightInvMat(uv);\n\treturn LTC_EvaluateRect( tNormalW, dViewDirW, vPositionW, mInv, dLTCCoords );\n}\nfloat getRectLightSpecular() {\n\treturn calcRectLightSpecular(dNormalW, dLTCUV);\n}\n#ifdef CLEARCOAT\nfloat getRectLightSpecularCC() {\n\treturn calcRectLightSpecular(ccNormalW, ccLTCUV);\n}\n#endif\nfloat calcDiskLightSpecular(vec3 tNormalW, vec2 uv) {\n\tmat3 mInv = getLTCLightInvMat(uv);\n\treturn LTC_EvaluateDisk( tNormalW, dViewDirW, vPositionW, mInv, dLTCCoords );\n}\nfloat getDiskLightSpecular() {\n\treturn calcDiskLightSpecular(dNormalW, dLTCUV);\n}\n#ifdef CLEARCOAT\nfloat getDiskLightSpecularCC() {\n\treturn calcDiskLightSpecular(ccNormalW, ccLTCUV);\n}\n#endif\nfloat getSphereLightSpecular() {\n\treturn calcDiskLightSpecular(dNormalW, dLTCUV);\n}\n#ifdef CLEARCOAT\nfloat getSphereLightSpecularCC() {\n\treturn calcDiskLightSpecular(ccNormalW, ccLTCUV);\n}\n#endif\n",metalnessPS:"void processMetalness(float metalness) {\n\tconst float dielectricF0 = 0.04;\n\tdSpecularity = mix(vec3(dielectricF0), dAlbedo, metalness);\n\tdAlbedo *= 1.0 - metalness;\n}\n#ifdef MAPFLOAT\nuniform float material_metalness;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_metalnessMap;\n#endif\nvoid getSpecularity() {\n\tfloat metalness = 1.0;\n\t#ifdef MAPFLOAT\n\tmetalness *= material_metalness;\n\t#endif\n\t#ifdef MAPTEXTURE\n\tmetalness *= texture2D(texture_metalnessMap, $UV).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\tmetalness *= saturate(vVertexColor.$VC);\n\t#endif\n\tprocessMetalness(metalness);\n}\n",msdfPS:"uniform sampler2D texture_msdfMap;\n#ifdef GL_OES_standard_derivatives\n#define USE_FWIDTH\n#endif\n#ifdef GL2\n#define USE_FWIDTH\n#endif\nfloat median(float r, float g, float b) {\n\treturn max(min(r, g), min(max(r, g), b));\n}\nfloat map (float min, float max, float v) {\n\treturn (v - min) / (max - min);\n}\nuniform float font_sdfIntensity;\nuniform float font_pxrange;\nuniform float font_textureWidth;\nuniform vec4 outline_color;\nuniform float outline_thickness;\nuniform vec4 shadow_color;\nuniform vec2 shadow_offset;\nvec4 applyMsdf(vec4 color) {\n\tvec3 tsample = texture2D(texture_msdfMap, vUv0).rgb;\n\tvec2 uvShdw = vUv0 - shadow_offset;\n\tvec3 ssample = texture2D(texture_msdfMap, uvShdw).rgb;\n\tfloat sigDist = median(tsample.r, tsample.g, tsample.b);\n\tfloat sigDistShdw = median(ssample.r, ssample.g, ssample.b);\n\tfloat smoothingMax = 0.2;\n\t#ifdef USE_FWIDTH\n\tvec2 w = fwidth(vUv0);\n\tfloat smoothing = clamp(w.x * font_textureWidth / font_pxrange, 0.0, smoothingMax);\n\t#else\n\tfloat font_size = 16.0;\n\tfloat smoothing = clamp(font_pxrange / font_size, 0.0, smoothingMax);\n\t#endif\n\tfloat mapMin = 0.05;\n\tfloat mapMax = clamp(1.0 - font_sdfIntensity, mapMin, 1.0);\n\tfloat sigDistInner = map(mapMin, mapMax, sigDist);\n\tfloat sigDistOutline = map(mapMin, mapMax, sigDist + outline_thickness);\n\tsigDistShdw = map(mapMin, mapMax, sigDistShdw + outline_thickness);\n\tfloat center = 0.5;\n\tfloat inside = smoothstep(center-smoothing, center+smoothing, sigDistInner);\n\tfloat outline = smoothstep(center-smoothing, center+smoothing, sigDistOutline);\n\tfloat shadow = smoothstep(center-smoothing, center+smoothing, sigDistShdw);\n\tvec4 tcolor = (outline > inside) ? outline * vec4(outline_color.a * outline_color.rgb, outline_color.a) : vec4(0.0);\n\ttcolor = mix(tcolor, color, inside);\n\tvec4 scolor = (shadow > outline) ? shadow * vec4(shadow_color.a * shadow_color.rgb, shadow_color.a) : tcolor;\n\ttcolor = mix(scolor, tcolor, outline);\n\treturn tcolor;\n}\n",normalVS:"#ifdef MORPHING_TEXTURE_BASED_NORMAL\nuniform highp sampler2D morphNormalTex;\n#endif\nvec3 getNormal() {\n\t#ifdef SKIN\n\tdNormalMatrix = mat3(dModelMatrix[0].xyz, dModelMatrix[1].xyz, dModelMatrix[2].xyz);\n\t#elif defined(INSTANCING)\n\tdNormalMatrix = mat3(instance_line1.xyz, instance_line2.xyz, instance_line3.xyz);\n\t#else\n\tdNormalMatrix = matrix_normal;\n\t#endif\n\tvec3 tempNormal = vertex_normal;\n\t#ifdef MORPHING\n\t#ifdef MORPHING_NRM03\n\ttempNormal += morph_weights_a[0] * morph_nrm0;\n\ttempNormal += morph_weights_a[1] * morph_nrm1;\n\ttempNormal += morph_weights_a[2] * morph_nrm2;\n\ttempNormal += morph_weights_a[3] * morph_nrm3;\n\t#endif\n\t#ifdef MORPHING_NRM47\n\ttempNormal += morph_weights_b[0] * morph_nrm4;\n\ttempNormal += morph_weights_b[1] * morph_nrm5;\n\ttempNormal += morph_weights_b[2] * morph_nrm6;\n\ttempNormal += morph_weights_b[3] * morph_nrm7;\n\t#endif\n\t#endif\n\t#ifdef MORPHING_TEXTURE_BASED_NORMAL\n\tvec2 morphUV = getTextureMorphCoords();\n\tvec3 morphNormal = texture2D(morphNormalTex, morphUV).xyz;\n\ttempNormal += morphNormal;\n\t#endif\n\treturn normalize(dNormalMatrix * tempNormal);\n}\n",normalDetailMapPS:"#ifdef MAPTEXTURE\nuniform sampler2D texture_normalDetailMap;\nuniform float material_normalDetailMapBumpiness;\nvec3 blendNormals(vec3 n1, vec3 n2) {\n\tn1 += vec3(0, 0, 1);\n\tn2 *= vec3(-1, -1, 1);\n\treturn normalize(n1*dot(n1, n2)/n1.z - n2);\n}\n#endif\nvec3 addNormalDetail(vec3 normalMap) {\n\t#ifdef MAPTEXTURE\n\tvec3 normalDetailMap = unpackNormal(texture2D(texture_normalDetailMap, $UV));\n\tnormalDetailMap = normalize(mix(vec3(0.0, 0.0, 1.0), normalDetailMap, material_normalDetailMapBumpiness));\n\treturn blendNormals(normalMap, normalDetailMap);\n\t#else\n\treturn normalMap;\n\t#endif\n}\n",normalInstancedVS:"vec3 getNormal() {\n\tdNormalMatrix = mat3(instance_line1.xyz, instance_line2.xyz, instance_line3.xyz);\n\treturn normalize(dNormalMatrix * vertex_normal);\n}\n",normalMapPS:"uniform sampler2D texture_normalMap;\nuniform float material_bumpiness;\nvoid getNormal() {\n\tvec3 normalMap = unpackNormal(texture2D(texture_normalMap, $UV));\n\tnormalMap = normalize(mix(vec3(0.0, 0.0, 1.0), normalMap, material_bumpiness));\n\tdNormalMap = addNormalDetail(normalMap);\n\tdNormalW = dTBN * dNormalMap;\n}\n",normalMapFastPS:"uniform sampler2D texture_normalMap;\nvoid getNormal() {\n\tvec3 normalMap = unpackNormal(texture2D(texture_normalMap, $UV));\n\tdNormalMap = addNormalDetail(normalMap);\n\tdNormalW = dTBN * dNormalMap;\n}\n",normalSkinnedVS:"vec3 getNormal() {\n\tdNormalMatrix = mat3(dModelMatrix[0].xyz, dModelMatrix[1].xyz, dModelMatrix[2].xyz);\n\treturn normalize(dNormalMatrix * vertex_normal);\n}\n",normalVertexPS:"void getNormal() {\n\tdNormalW = normalize(dVertexNormalW);\n}\n",normalXYPS:"vec3 unpackNormal(vec4 nmap) {\n\tvec3 normal;\n\tnormal.xy = nmap.wy * 2.0 - 1.0;\n\tnormal.z = sqrt(1.0 - saturate(dot(normal.xy, normal.xy)));\n\treturn normal;\n}\n",normalXYZPS:"vec3 unpackNormal(vec4 nmap) {\n\treturn nmap.xyz * 2.0 - 1.0;\n}\n",opacityPS:"#ifdef MAPFLOAT\nuniform float material_opacity;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_opacityMap;\n#endif\nvoid getOpacity() {\n\tdAlpha = 1.0;\n\t#ifdef MAPFLOAT\n\tdAlpha *= material_opacity;\n\t#endif\n\t#ifdef MAPTEXTURE\n\tdAlpha *= texture2D(texture_opacityMap, $UV).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\tdAlpha *= clamp(vVertexColor.$VC, 0.0, 1.0);\n\t#endif\n}\n",outputAlphaPS:"gl_FragColor.a = dAlpha;\n",outputAlphaOpaquePS:"gl_FragColor.a = 1.0;\n",outputAlphaPremulPS:"gl_FragColor.rgb *= dAlpha;\ngl_FragColor.a = dAlpha;\n",outputCubemapPS:"varying vec2 vUv0;\nuniform samplerCube source;\nuniform vec4 params;\nfloat saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\nvec4 encodeRGBM(vec4 color) {\n\tcolor.rgb = pow(color.rgb, vec3(0.5));\n\tcolor.rgb *= 1.0 / 8.0;\n\tcolor.a = saturate( max( max( color.r, color.g ), max( color.b, 1.0 / 255.0 ) ) );\n\tcolor.a = ceil(color.a * 255.0) / 255.0;\n\tcolor.rgb /= color.a;\n\treturn color;\n}\nvoid main(void) {\n\tvec2 st = vUv0 * 2.0 - 1.0;\n\tfloat face = params.x;\n\tvec3 vec;\n\tif (face==0.0) {\n\t\tvec = vec3(1, -st.y, -st.x);\n\t} else if (face==1.0) {\n\t\tvec = vec3(-1, -st.y, st.x);\n\t} else if (face==2.0) {\n\t\tvec = vec3(st.x, 1, st.y);\n\t} else if (face==3.0) {\n\t\tvec = vec3(st.x, -1, -st.y);\n\t} else if (face==4.0) {\n\t\tvec = vec3(st.x, -st.y, 1);\n\t} else {\n\t\tvec = vec3(-st.x, -st.y, -1);\n\t}\n\tgl_FragColor = textureCube(source, vec);\n\tif (params.w >= 2.0) gl_FragColor = encodeRGBM(gl_FragColor);\n}\n",outputTex2DPS:"varying vec2 vUv0;\nuniform sampler2D source;\nvoid main(void) {\n\tgl_FragColor = texture2D(source, vUv0);\n}\n",packDepthPS:"vec4 packFloat(float depth) {\n\tconst vec4 bit_shift = vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0);\n\tconst vec4 bit_mask\t= vec4(0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0);\n\tvec4 res = mod(depth * bit_shift * vec4(255), vec4(256) ) / vec4(255);\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\n",packDepthMaskPS:"vec4 packFloat(float depth) {\n\tconst vec4 bit_shift = vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0);\n\tconst vec4 bit_mask\t= vec4(0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0);\n\tvec4 res = mod(depth * bit_shift * vec4(255), vec4(256) ) / vec4(255);\n\tres.x = 0.0;\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\n",parallaxPS:"uniform sampler2D texture_heightMap;\nuniform float material_heightMapFactor;\nvoid getParallax() {\n\tfloat parallaxScale = material_heightMapFactor;\n\tfloat height = texture2D(texture_heightMap, $UV).$CH;\n\theight = height * parallaxScale - parallaxScale*0.5;\n\tvec3 viewDirT = dViewDirW * dTBN;\n\tviewDirT.z += 0.42;\n\tdUvOffset = height * (viewDirT.xy / viewDirT.z);\n}\n",particlePS:"varying vec4 texCoordsAlphaLife;\nuniform sampler2D colorMap;\nuniform sampler2D colorParam;\nuniform float graphSampleSize;\nuniform float graphNumSamples;\n#ifndef CAMERAPLANES\n#define CAMERAPLANES\nuniform vec4 camera_params;\n#endif\nuniform float softening;\nuniform float colorMult;\nfloat saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\n#ifndef UNPACKFLOAT\n#define UNPACKFLOAT\nfloat unpackFloat(vec4 rgbaDepth) {\n\tconst vec4 bitShift = vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0);\n\tfloat depth = dot(rgbaDepth, bitShift);\n\treturn depth;\n}\n#endif\nvoid main(void) {\n\tvec4 tex\t= texture2DSRGB(colorMap, vec2(texCoordsAlphaLife.x, 1.0 - texCoordsAlphaLife.y));\n\tvec4 ramp = texture2DSRGB(colorParam, vec2(texCoordsAlphaLife.w, 0.0));\n\tramp.rgb *= colorMult;\n\tramp.a += texCoordsAlphaLife.z;\n\tvec3 rgb = tex.rgb * ramp.rgb;\n\tfloat a\t= tex.a * ramp.a;\n",particleVS:"vec3 unpack3NFloats(float src) {\n\tfloat r = fract(src);\n\tfloat g = fract(src * 256.0);\n\tfloat b = fract(src * 65536.0);\n\treturn vec3(r, g, b);\n}\nfloat saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\nvec4 tex1Dlod_lerp(highp sampler2D tex, vec2 tc) {\n\treturn mix( texture2D(tex,tc), texture2D(tex,tc + graphSampleSize), fract(tc.x*graphNumSamples) );\n}\nvec4 tex1Dlod_lerp(highp sampler2D tex, vec2 tc, out vec3 w) {\n\tvec4 a = texture2D(tex,tc);\n\tvec4 b = texture2D(tex,tc + graphSampleSize);\n\tfloat c = fract(tc.x*graphNumSamples);\n\tvec3 unpackedA = unpack3NFloats(a.w);\n\tvec3 unpackedB = unpack3NFloats(b.w);\n\tw = mix(unpackedA, unpackedB, c);\n\treturn mix(a, b, c);\n}\nvec2 rotate(vec2 quadXY, float pRotation, out mat2 rotMatrix) {\n\tfloat c = cos(pRotation);\n\tfloat s = sin(pRotation);\n\tmat2 m = mat2(c, -s, s, c);\n\trotMatrix = m;\n\treturn m * quadXY;\n}\nvec3 billboard(vec3 InstanceCoords, vec2 quadXY) {\n\t#ifdef SCREEN_SPACE\n\t\tvec3 pos = vec3(-1, 0, 0) * quadXY.x + vec3(0, -1, 0) * quadXY.y;\n\t#else\n\t\tvec3 pos = -matrix_viewInverse[0].xyz * quadXY.x + -matrix_viewInverse[1].xyz * quadXY.y;\n\t#endif\n\treturn pos;\n}\nvec3 customFace(vec3 InstanceCoords, vec2 quadXY) {\n\tvec3 pos = faceTangent * quadXY.x + faceBinorm * quadXY.y;\n\treturn pos;\n}\nvec2 safeNormalize(vec2 v) {\n\tfloat l = length(v);\n\treturn (l > 1e-06) ? v / l : v;\n}\nvoid main(void) {\n\tvec3 meshLocalPos = particle_vertexData.xyz;\n\tfloat id = floor(particle_vertexData.w);\n\tfloat rndFactor = fract(sin(id + 1.0 + seed));\n\tvec3 rndFactor3 = vec3(rndFactor, fract(rndFactor*10.0), fract(rndFactor*100.0));\n\tfloat uv = id / numParticlesPot;\n\treadInput(uv);\n#ifdef LOCAL_SPACE\n\tinVel = mat3(matrix_model) * inVel;\n#endif\n\tvec2 velocityV = safeNormalize((mat3(matrix_view) * inVel).xy);\n\tfloat particleLifetime = lifetime;\n\tif (inLife <= 0.0 || inLife > particleLifetime || !inShow) meshLocalPos = vec3(0.0);\n\tvec2 quadXY = meshLocalPos.xy;\n\tfloat nlife = clamp(inLife / particleLifetime, 0.0, 1.0);\n\tvec3 paramDiv;\n\tvec4 params = tex1Dlod_lerp(internalTex2, vec2(nlife, 0), paramDiv);\n\tfloat scale = params.y;\n\tfloat scaleDiv = paramDiv.x;\n\tfloat alphaDiv = paramDiv.z;\n\tscale += (scaleDiv * 2.0 - 1.0) * scaleDivMult * fract(rndFactor*10000.0);\n#ifndef USE_MESH\n\ttexCoordsAlphaLife = vec4(quadXY * -0.5 + 0.5, (alphaDiv * 2.0 - 1.0) * alphaDivMult * fract(rndFactor*1000.0), nlife);\n#else\n\ttexCoordsAlphaLife = vec4(particle_uv, (alphaDiv * 2.0 - 1.0) * alphaDivMult * fract(rndFactor*1000.0), nlife);\n#endif\n\tvec3 particlePos = inPos;\n\tvec3 particlePosMoved = vec3(0.0);\n\tmat2 rotMatrix;\n",particleAnimFrameClampVS:"\tfloat animFrame = min(floor(texCoordsAlphaLife.w * animTexParams.y) + animTexParams.x, animTexParams.z);\n",particleAnimFrameLoopVS:"\tfloat animFrame = floor(mod(texCoordsAlphaLife.w * animTexParams.y + animTexParams.x, animTexParams.z + 1.0));\n",particleAnimTexVS:"\tfloat animationIndex;\n\tif (animTexIndexParams.y == 1.0) {\n\t\tanimationIndex = floor((animTexParams.w + 1.0) * rndFactor3.z) * (animTexParams.z + 1.0);\n\t} else {\n\t\tanimationIndex = animTexIndexParams.x * (animTexParams.z + 1.0);\n\t}\n\tfloat atlasX = (animationIndex + animFrame) * animTexTilesParams.x;\n\tfloat atlasY = 1.0 - floor(atlasX + 1.0) * animTexTilesParams.y;\n\tatlasX = fract(atlasX);\n\ttexCoordsAlphaLife.xy *= animTexTilesParams.xy;\n\ttexCoordsAlphaLife.xy += vec2(atlasX, atlasY);\n",particleInputFloatPS:"void readInput(float uv) {\n\tvec4 tex = texture2D(particleTexIN, vec2(uv, 0.25));\n\tvec4 tex2 = texture2D(particleTexIN, vec2(uv, 0.75));\n\tinPos = tex.xyz;\n\tinVel = tex2.xyz;\n\tinAngle = (tex.w < 0.0? -tex.w : tex.w) - 1000.0;\n\tinShow = tex.w >= 0.0;\n\tinLife = tex2.w;\n}\n",particleInputRgba8PS:"#define PI2 6.283185307179586\nuniform vec3 inBoundsSize;\nuniform vec3 inBoundsCenter;\nuniform float maxVel;\nfloat decodeFloatRG(vec2 rg) {\n\treturn rg.y*(1.0/255.0) + rg.x;\n}\nfloat decodeFloatRGBA( vec4 rgba ) {\n\treturn dot( rgba, vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/160581375.0) );\n}\nvoid readInput(float uv) {\n\tvec4 tex0 = texture2D(particleTexIN, vec2(uv, 0.125));\n\tvec4 tex1 = texture2D(particleTexIN, vec2(uv, 0.375));\n\tvec4 tex2 = texture2D(particleTexIN, vec2(uv, 0.625));\n\tvec4 tex3 = texture2D(particleTexIN, vec2(uv, 0.875));\n\tinPos = vec3(decodeFloatRG(tex0.rg), decodeFloatRG(tex0.ba), decodeFloatRG(tex1.rg));\n\tinPos = (inPos - vec3(0.5)) * inBoundsSize + inBoundsCenter;\n\tinVel = tex2.xyz;\n\tinVel = (inVel - vec3(0.5)) * maxVel;\n\tinAngle = decodeFloatRG(tex1.ba) * PI2;\n\tinShow = tex2.a > 0.5;\n\tinLife = decodeFloatRGBA(tex3);\n\tfloat maxNegLife = max(lifetime, (numParticles - 1.0) * (rate+rateDiv));\n\tfloat maxPosLife = lifetime+1.0;\n\tinLife = inLife * (maxNegLife + maxPosLife) - maxNegLife;\n}\n",particleOutputFloatPS:"void writeOutput() {\n\tif (gl_FragCoord.y<1.0) {\n\t\tgl_FragColor = vec4(outPos, (outAngle + 1000.0) * visMode);\n\t} else {\n\t\tgl_FragColor = vec4(outVel, outLife);\n\t}\n}\n",particleOutputRgba8PS:"uniform vec3 outBoundsMul;\nuniform vec3 outBoundsAdd;\nvec2 encodeFloatRG( float v ) {\n\tvec2 enc = vec2(1.0, 255.0) * v;\n\tenc = fract(enc);\n\tenc -= enc.yy * vec2(1.0/255.0, 1.0/255.0);\n\treturn enc;\n}\nvec4 encodeFloatRGBA( float v ) {\n\tvec4 enc = vec4(1.0, 255.0, 65025.0, 160581375.0) * v;\n\tenc = fract(enc);\n\tenc -= enc.yzww * vec4(1.0/255.0,1.0/255.0,1.0/255.0,0.0);\n\treturn enc;\n}\nvoid writeOutput() {\n\toutPos = outPos * outBoundsMul + outBoundsAdd;\n\toutAngle = fract(outAngle / PI2);\n\toutVel = (outVel / maxVel) + vec3(0.5);\n\tfloat maxNegLife = max(lifetime, (numParticles - 1.0) * (rate+rateDiv));\n\tfloat maxPosLife = lifetime+1.0;\n\toutLife = (outLife + maxNegLife) / (maxNegLife + maxPosLife);\n\tif (gl_FragCoord.y < 1.0) {\n\t\tgl_FragColor = vec4(encodeFloatRG(outPos.x), encodeFloatRG(outPos.y));\n\t} else if (gl_FragCoord.y < 2.0) {\n\t\tgl_FragColor = vec4(encodeFloatRG(outPos.z), encodeFloatRG(outAngle));\n\t} else if (gl_FragCoord.y < 3.0) {\n\t\tgl_FragColor = vec4(outVel, visMode*0.5+0.5);\n\t} else {\n\t\tgl_FragColor = encodeFloatRGBA(outLife);\n\t}\n}\n",particleUpdaterAABBPS:"uniform mat3 spawnBounds;\nuniform vec3 spawnPosInnerRatio;\nvec3 calcSpawnPosition(vec3 inBounds, float rndFactor) {\n\tvec3 pos = inBounds - vec3(0.5);\n\tvec3 posAbs = abs(pos);\n\tvec3 maxPos = vec3(max(posAbs.x, max(posAbs.y, posAbs.z)));\n\tvec3 edge = maxPos + (vec3(0.5) - maxPos) * spawnPosInnerRatio;\n\tpos.x = edge.x * (maxPos.x == posAbs.x ? sign(pos.x) : 2.0 * pos.x);\n\tpos.y = edge.y * (maxPos.y == posAbs.y ? sign(pos.y) : 2.0 * pos.y);\n\tpos.z = edge.z * (maxPos.z == posAbs.z ? sign(pos.z) : 2.0 * pos.z);\n#ifndef LOCAL_SPACE\n\treturn emitterPos + spawnBounds * pos;\n#else\n\treturn spawnBounds * pos;\n#endif\n}\nvoid addInitialVelocity(inout vec3 localVelocity, vec3 inBounds) {\n\tlocalVelocity -= vec3(0, 0, initialVelocity);\n}\n",particleUpdaterEndPS:"\twriteOutput();\n}\n",particleUpdaterInitPS:"varying vec2 vUv0;\nuniform highp sampler2D particleTexIN;\nuniform highp sampler2D internalTex0;\nuniform highp sampler2D internalTex1;\nuniform highp sampler2D internalTex2;\nuniform highp sampler2D internalTex3;\nuniform mat3 emitterMatrix, emitterMatrixInv;\nuniform vec3 emitterScale;\nuniform vec3 emitterPos, frameRandom, localVelocityDivMult, velocityDivMult;\nuniform float delta, rate, rateDiv, lifetime, numParticles, rotSpeedDivMult, radialSpeedDivMult, seed;\nuniform float startAngle, startAngle2;\nuniform float initialVelocity;\nuniform float graphSampleSize;\nuniform float graphNumSamples;\nvec3 inPos;\nvec3 inVel;\nfloat inAngle;\nbool inShow;\nfloat inLife;\nfloat visMode;\nvec3 outPos;\nvec3 outVel;\nfloat outAngle;\nbool outShow;\nfloat outLife;\n",particleUpdaterNoRespawnPS:"\tif (outLife >= lifetime) {\n\t\toutLife -= max(lifetime, (numParticles - 1.0) * particleRate);\n\t\tvisMode = -1.0;\n\t}\n",particleUpdaterOnStopPS:"\tvisMode = outLife < 0.0? -1.0: visMode;\n",particleUpdaterRespawnPS:"\tif (outLife >= lifetime) {\n\t\toutLife -= max(lifetime, (numParticles - 1.0) * particleRate);\n\t\tvisMode = 1.0;\n\t}\n\tvisMode = outLife < 0.0? 1.0: visMode;\n",particleUpdaterSpherePS:"uniform float spawnBoundsSphere;\nuniform float spawnBoundsSphereInnerRatio;\nvec3 calcSpawnPosition(vec3 inBounds, float rndFactor) {\n\tfloat rnd4 = fract(rndFactor * 1000.0);\n\tvec3 norm = normalize(inBounds.xyz - vec3(0.5));\n\tfloat r = rnd4 * (1.0 - spawnBoundsSphereInnerRatio) + spawnBoundsSphereInnerRatio;\n#ifndef LOCAL_SPACE\n\treturn emitterPos + norm * r * spawnBoundsSphere;\n#else\n\treturn norm * r * spawnBoundsSphere;\n#endif\n}\nvoid addInitialVelocity(inout vec3 localVelocity, vec3 inBounds) {\n\tlocalVelocity += normalize(inBounds - vec3(0.5)) * initialVelocity;\n}\n",particleUpdaterStartPS:"float saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\nvec3 unpack3NFloats(float src) {\n\tfloat r = fract(src);\n\tfloat g = fract(src * 256.0);\n\tfloat b = fract(src * 65536.0);\n\treturn vec3(r, g, b);\n}\nvec3 tex1Dlod_lerp(highp sampler2D tex, vec2 tc, out vec3 w) {\n\tvec4 a = texture2D(tex, tc);\n\tvec4 b = texture2D(tex, tc + graphSampleSize);\n\tfloat c = fract(tc.x * graphNumSamples);\n\tvec3 unpackedA = unpack3NFloats(a.w);\n\tvec3 unpackedB = unpack3NFloats(b.w);\n\tw = mix(unpackedA, unpackedB, c);\n\treturn mix(a.xyz, b.xyz, c);\n}\n#define HASHSCALE4 vec4(1031, .1030, .0973, .1099)\nvec4 hash41(float p) {\n\tvec4 p4 = fract(vec4(p) * HASHSCALE4);\n\tp4 += dot(p4, p4.wzxy+19.19);\n\treturn fract(vec4((p4.x + p4.y)*p4.z, (p4.x + p4.z)*p4.y, (p4.y + p4.z)*p4.w, (p4.z + p4.w)*p4.x));\n}\nvoid main(void) {\n\tif (gl_FragCoord.x > numParticles) discard;\n\treadInput(vUv0.x);\n\tvisMode = inShow? 1.0 : -1.0;\n\tvec4 rndFactor = hash41(gl_FragCoord.x + seed);\n\tfloat particleRate = rate + rateDiv * rndFactor.x;\n\toutLife = inLife + delta;\n\tfloat nlife = clamp(outLife / lifetime, 0.0, 1.0);\n\tvec3 localVelocityDiv;\n\tvec3 velocityDiv;\n\tvec3 paramDiv;\n\tvec3 localVelocity = tex1Dlod_lerp(internalTex0, vec2(nlife, 0), localVelocityDiv);\n\tvec3 velocity =\t\ttex1Dlod_lerp(internalTex1, vec2(nlife, 0), velocityDiv);\n\tvec3 params =\t\ttex1Dlod_lerp(internalTex2, vec2(nlife, 0), paramDiv);\n\tfloat rotSpeed = params.x;\n\tfloat rotSpeedDiv = paramDiv.y;\n\tvec3 radialParams = tex1Dlod_lerp(internalTex3, vec2(nlife, 0), paramDiv);\n\tfloat radialSpeed = radialParams.x;\n\tfloat radialSpeedDiv = radialParams.y;\n\tbool respawn = inLife <= 0.0 || outLife >= lifetime;\n\tinPos = respawn ? calcSpawnPosition(rndFactor.xyz, rndFactor.x) : inPos;\n\tinAngle = respawn ? mix(startAngle, startAngle2, rndFactor.x) : inAngle;\n#ifndef LOCAL_SPACE\n\tvec3 radialVel = inPos - emitterPos;\n#else\n\tvec3 radialVel = inPos;\n#endif\n\tradialVel = (dot(radialVel, radialVel) > 1.0E-8) ? radialSpeed * normalize(radialVel) : vec3(0.0);\n\tradialVel += (radialSpeedDiv * vec3(2.0) - vec3(1.0)) * radialSpeedDivMult * rndFactor.xyz;\n\tlocalVelocity +=\t(localVelocityDiv * vec3(2.0) - vec3(1.0)) * localVelocityDivMult * rndFactor.xyz;\n\tvelocity +=\t\t (velocityDiv * vec3(2.0) - vec3(1.0)) * velocityDivMult * rndFactor.xyz;\n\trotSpeed +=\t\t (rotSpeedDiv * 2.0 - 1.0) * rotSpeedDivMult * rndFactor.y;\n\taddInitialVelocity(localVelocity, rndFactor.xyz);\n#ifndef LOCAL_SPACE\n\toutVel = emitterMatrix * localVelocity + (radialVel + velocity) * emitterScale;\n#else\n\toutVel = (localVelocity + radialVel) / emitterScale + emitterMatrixInv * velocity;\n#endif\n\toutPos = inPos + outVel * delta;\n\toutAngle = inAngle + rotSpeed * delta;\n",particle_billboardVS:"\tquadXY = rotate(quadXY, inAngle, rotMatrix);\n\tvec3 localPos = billboard(particlePos, quadXY);\n",particle_blendAddPS:"\tdBlendModeFogFactor = 0.0;\n\trgb *= saturate(gammaCorrectInput(max(a, 0.0)));\n\tif ((rgb.r + rgb.g + rgb.b) < 0.000001) discard;\n",particle_blendMultiplyPS:"\trgb = mix(vec3(1.0), rgb, vec3(a));\n\tif (rgb.r + rgb.g + rgb.b > 2.99) discard;\n",particle_blendNormalPS:"\tif (a < 0.01) discard;\n",particle_cpuVS:"attribute vec4 particle_vertexData;\nattribute vec4 particle_vertexData2;\nattribute vec4 particle_vertexData3;\nattribute float particle_vertexData4;\n#ifndef USE_MESH\n#define VDATA5TYPE vec2\n#else\n#define VDATA5TYPE vec4\n#endif\nattribute VDATA5TYPE particle_vertexData5;\nuniform mat4 matrix_viewProjection;\nuniform mat4 matrix_model;\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\nuniform mat3 matrix_normal;\nuniform mat4 matrix_viewInverse;\nuniform float numParticles;\nuniform float lifetime;\nuniform float stretch;\nuniform float seed;\nuniform vec3 wrapBounds, emitterScale, faceTangent, faceBinorm;\nuniform sampler2D texLifeAndSourcePosOUT;\nuniform highp sampler2D internalTex0;\nuniform highp sampler2D internalTex1;\nuniform highp sampler2D internalTex2;\nuniform vec3 emitterPos;\nvarying vec4 texCoordsAlphaLife;\nvec2 rotate(vec2 quadXY, float pRotation, out mat2 rotMatrix)\n{\n\tfloat c = cos(pRotation);\n\tfloat s = sin(pRotation);\n\tmat2 m = mat2(c, -s, s, c);\n\trotMatrix = m;\n\treturn m * quadXY;\n}\nvec3 billboard(vec3 InstanceCoords, vec2 quadXY)\n{\n\tvec3 pos = -matrix_viewInverse[0].xyz * quadXY.x + -matrix_viewInverse[1].xyz * quadXY.y;\n\treturn pos;\n}\nvec3 customFace(vec3 InstanceCoords, vec2 quadXY)\n{\n\tvec3 pos = faceTangent * quadXY.x + faceBinorm * quadXY.y;\n\treturn pos;\n}\nvoid main(void)\n{\n\tvec3 particlePos = particle_vertexData.xyz;\n\tvec3 inPos = particlePos;\n\tvec3 vertPos = particle_vertexData3.xyz;\n\tvec3 inVel = vec3(particle_vertexData2.w, particle_vertexData3.w, particle_vertexData5.x);\n\tfloat id = floor(particle_vertexData4);\n\tfloat rndFactor = fract(sin(id + 1.0 + seed));\n\tvec3 rndFactor3 = vec3(rndFactor, fract(rndFactor*10.0), fract(rndFactor*100.0));\n#ifdef LOCAL_SPACE\n\tinVel = mat3(matrix_model) * inVel;\n#endif\n\tvec2 velocityV = normalize((mat3(matrix_view) * inVel).xy);\n\tvec2 quadXY = vertPos.xy;\n#ifdef USE_MESH\n\ttexCoordsAlphaLife = vec4(particle_vertexData5.zw, particle_vertexData2.z, particle_vertexData.w);\n#else\n\ttexCoordsAlphaLife = vec4(quadXY * -0.5 + 0.5, particle_vertexData2.z, particle_vertexData.w);\n#endif\n\tmat2 rotMatrix;\n\tfloat inAngle = particle_vertexData2.x;\n\tvec3 particlePosMoved = vec3(0.0);\n\tvec3 meshLocalPos = particle_vertexData3.xyz;\n",particle_cpu_endVS:"\tlocalPos *= particle_vertexData2.y * emitterScale;\n\tlocalPos += particlePos;\n\tgl_Position = matrix_viewProjection * vec4(localPos, 1.0);\n",particle_customFaceVS:"\tquadXY = rotate(quadXY, inAngle, rotMatrix);\n\tvec3 localPos = customFace(particlePos, quadXY);\n",particle_endPS:"\trgb = addFog(rgb);\n\trgb = toneMap(rgb);\n\trgb = gammaCorrectOutput(rgb);\n\tgl_FragColor = vec4(rgb, a);\n}\n",particle_endVS:"\tlocalPos *= scale * emitterScale;\n\tlocalPos += particlePos;\n\t#ifdef SCREEN_SPACE\n\tgl_Position = vec4(localPos.x, localPos.y, 0.0, 1.0);\n\t#else\n\tgl_Position = matrix_viewProjection * vec4(localPos.xyz, 1.0);\n\t#endif\n",particle_halflambertPS:"\tvec3 negNormal = normal*0.5+0.5;\n\tvec3 posNormal = -normal*0.5+0.5;\n\tnegNormal *= negNormal;\n\tposNormal *= posNormal;\n",particle_initVS:"attribute vec4 particle_vertexData;\n#ifdef USE_MESH\nattribute vec2 particle_uv;\n#endif\nuniform mat4 matrix_viewProjection;\nuniform mat4 matrix_model;\nuniform mat3 matrix_normal;\nuniform mat4 matrix_viewInverse;\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\nuniform float numParticles, numParticlesPot;\nuniform float graphSampleSize;\nuniform float graphNumSamples;\nuniform float stretch;\nuniform vec3 wrapBounds;\nuniform vec3 emitterScale, emitterPos, faceTangent, faceBinorm;\nuniform float rate, rateDiv, lifetime, deltaRandomnessStatic, scaleDivMult, alphaDivMult, seed, delta;\nuniform sampler2D particleTexOUT, particleTexIN;\nuniform highp sampler2D internalTex0;\nuniform highp sampler2D internalTex1;\nuniform highp sampler2D internalTex2;\n#ifndef CAMERAPLANES\n#define CAMERAPLANES\nuniform vec4 camera_params;\n#endif\nvarying vec4 texCoordsAlphaLife;\nvec3 inPos;\nvec3 inVel;\nfloat inAngle;\nbool inShow;\nfloat inLife;\n",particle_lambertPS:"\tvec3 negNormal = max(normal, vec3(0.0));\n\tvec3 posNormal = max(-normal, vec3(0.0));\n",particle_lightingPS:"\tvec3 light = negNormal.x*lightCube[0] + posNormal.x*lightCube[1] +\n\t\t\t\t\t\tnegNormal.y*lightCube[2] + posNormal.y*lightCube[3] +\n\t\t\t\t\t\tnegNormal.z*lightCube[4] + posNormal.z*lightCube[5];\n\trgb *= light;\n",particle_localShiftVS:"\tparticlePos = (matrix_model * vec4(particlePos, 1.0)).xyz;\n",particle_meshVS:"\tvec3 localPos = meshLocalPos;\n\tlocalPos.xy = rotate(localPos.xy, inAngle, rotMatrix);\n\tlocalPos.yz = rotate(localPos.yz, inAngle, rotMatrix);\n\tbillboard(particlePos, quadXY);\n",particle_normalVS:"\tNormal = normalize(localPos + matrix_viewInverse[2].xyz);\n",particle_normalMapPS:"\tvec3 normalMap = normalize(texture2D(normalMap, vec2(texCoordsAlphaLife.x, 1.0 - texCoordsAlphaLife.y)).xyz * 2.0 - 1.0);\n\tvec3 normal = ParticleMat * normalMap;\n",particle_pointAlongVS:"\tinAngle = atan(velocityV.x, velocityV.y);\n",particle_softPS:"\tfloat depth = getLinearScreenDepth();\n\tfloat particleDepth = vDepth;\n\tfloat depthDiff = saturate(abs(particleDepth - depth) * softening);\n\ta *= depthDiff;\n",particle_softVS:"\tvDepth = getLinearDepth(localPos);\n",particle_stretchVS:"\tvec3 moveDir = inVel * stretch;\n\tvec3 posPrev = particlePos - moveDir;\n\tposPrev += particlePosMoved;\n\tvec2 centerToVertexV = normalize((mat3(matrix_view) * localPos).xy);\n\tfloat interpolation = dot(-velocityV, centerToVertexV) * 0.5 + 0.5;\n\tparticlePos = mix(particlePos, posPrev, interpolation);\n",particle_TBNVS:"\tmat3 rot3 = mat3(rotMatrix[0][0], rotMatrix[0][1], 0.0, rotMatrix[1][0], rotMatrix[1][1], 0.0, 0.0, 0.0, 1.0);\n\tParticleMat = mat3(-matrix_viewInverse[0].xyz, -matrix_viewInverse[1].xyz, matrix_viewInverse[2].xyz) * rot3;\n",particle_wrapVS:"\tvec3 origParticlePos = particlePos;\n\tparticlePos -= matrix_model[3].xyz;\n\tparticlePos = mod(particlePos, wrapBounds) - wrapBounds * 0.5;\n\tparticlePos += matrix_model[3].xyz;\n\tparticlePosMoved = particlePos - origParticlePos;\n",precisionTestPS:"void main(void) {\n\tgl_FragColor = vec4(2147483648.0);\n}\n",precisionTest2PS:"uniform sampler2D source;\nvec4 packFloat(float depth) {\n\tconst vec4 bit_shift = vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0);\n\tconst vec4 bit_mask\t= vec4(0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0);\n\tvec4 res = mod(depth * bit_shift * vec4(255), vec4(256) ) / vec4(255);\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main(void) {\n\tfloat c = texture2D(source, vec2(0.0)).r;\n\tfloat diff = abs(c - 2147483648.0) / 2147483648.0;\n\tgl_FragColor = packFloat(diff);\n}\n",reflDirPS:"void getReflDir() {\n\tdReflDirW = normalize(-reflect(dViewDirW, dNormalW));\n}\n",reflDirAnisoPS:"void getReflDir() {\n\tfloat roughness = sqrt(1.0 - min(dGlossiness, 1.0));\n\tfloat anisotropy = material_anisotropy * roughness;\n\tvec3 anisotropicDirection = anisotropy >= 0.0 ? dTBN[1] : dTBN[0];\n\tvec3 anisotropicTangent = cross(anisotropicDirection, dViewDirW);\n\tvec3 anisotropicNormal = cross(anisotropicTangent, anisotropicDirection);\n\tvec3 bentNormal = normalize(mix(normalize(dNormalW), normalize(anisotropicNormal), anisotropy));\n\tdReflDirW = reflect(-dViewDirW, bentNormal);\n}\n",reflectionCCPS:"#ifdef CLEARCOAT\nuniform float material_clearCoatReflectivity;\nvoid addReflectionCC() {\n\tccReflection += vec4(calcReflection(ccReflDirW, ccGlossiness), material_clearCoatReflectivity);\n}\n#endif\n",reflectionCubePS:"uniform samplerCube texture_cubeMap;\nuniform float material_reflectivity;\nvec3 calcReflection(vec3 tReflDirW, float tGlossiness) {\n\tvec3 lookupVec = fixSeams(cubeMapProject(tReflDirW));\n\tlookupVec.x *= -1.0;\n\treturn $DECODE(textureCube(texture_cubeMap, lookupVec));\n}\nvoid addReflection() {\n\tdReflection += vec4(calcReflection(dReflDirW, dGlossiness), material_reflectivity);\n}\n",reflectionEnvPS:"#ifndef ENV_ATLAS\n#define ENV_ATLAS\nuniform sampler2D texture_envAtlas;\n#endif\nuniform float material_reflectivity;\nfloat shinyMipLevel(vec2 uv) {\n\tvec2 dx = dFdx(uv);\n\tvec2 dy = dFdy(uv);\n\tvec2 uv2 = vec2(fract(uv.x + 0.5), uv.y);\n\tvec2 dx2 = dFdx(uv2);\n\tvec2 dy2 = dFdy(uv2);\n\tfloat maxd = min(max(dot(dx, dx), dot(dy, dy)), max(dot(dx2, dx2), dot(dy2, dy2)));\n\treturn clamp(0.5 * log2(maxd) - 1.0, 0.0, 6.0);\n}\nvec3 calcReflection(vec3 tReflDirW, float tGlossiness) {\n\tvec3 dir = cubeMapProject(tReflDirW) * vec3(-1.0, 1.0, 1.0);\n\tvec2 uv = toSphericalUv(dir);\n\tfloat level = saturate(1.0 - tGlossiness) * 5.0;\n\tfloat ilevel = floor(level);\n\tfloat level2 = shinyMipLevel(uv * atlasSize);\n\tfloat ilevel2 = floor(level2);\n\tvec2 uv0, uv1;\n\tfloat weight;\n\tif (ilevel == 0.0) {\n\t\tuv0 = mapMip(uv, ilevel2);\n\t\tuv1 = mapMip(uv, ilevel2 + 1.0);\n\t\tweight = level2 - ilevel2;\n\t} else {\n\t\tuv0 = uv1 = mapRoughnessUv(uv, ilevel);\n\t\tweight = 0.0;\n\t}\n\tvec3 linearA = $DECODE(texture2D(texture_envAtlas, uv0));\n\tvec3 linearB = $DECODE(texture2D(texture_envAtlas, uv1));\n\tvec3 linear0 = mix(linearA, linearB, weight);\n\tvec3 linear1 = $DECODE(texture2D(texture_envAtlas, mapRoughnessUv(uv, ilevel + 1.0)));\n\treturn processEnvironment(mix(linear0, linear1, level - ilevel));\n}\nvoid addReflection() {\n\tdReflection += vec4(calcReflection(dReflDirW, dGlossiness), material_reflectivity);\n}\n",reflectionSpherePS:"#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\nuniform sampler2D texture_sphereMap;\nuniform float material_reflectivity;\nvec3 calcReflection(vec3 tReflDirW, float tGlossiness) {\n\tvec3 reflDirV = (mat3(matrix_view) * tReflDirW).xyz;\n\tfloat m = 2.0 * sqrt( dot(reflDirV.xy, reflDirV.xy) + (reflDirV.z+1.0)*(reflDirV.z+1.0) );\n\tvec2 sphereMapUv = reflDirV.xy / m + 0.5;\n\treturn $DECODE(texture2D(texture_sphereMap, sphereMapUv));\n}\nvoid addReflection() {\n\tdReflection += vec4(calcReflection(dReflDirW, dGlossiness), material_reflectivity);\n}\n",reflectionSphereLowPS:"uniform sampler2D texture_sphereMap;\nuniform float material_reflectivity;\nvec3 calcReflection(vec3 tReflDirW, float tGlossiness) {\n\tvec3 reflDirV = vNormalV;\n\tvec2 sphereMapUv = reflDirV.xy * 0.5 + 0.5;\n\treturn $DECODE(texture2D(texture_sphereMap, sphereMapUv));\n}\nvoid addReflection() {\n\tdReflection += vec4(calcReflection(dReflDirW, dGlossiness), material_reflectivity);\n}\n",refractionPS:"uniform float material_refraction, material_refractionIndex;\nvec3 refract2(vec3 viewVec, vec3 Normal, float IOR) {\n\tfloat vn = dot(viewVec, Normal);\n\tfloat k = 1.0 - IOR * IOR * (1.0 - vn * vn);\n\tvec3 refrVec = IOR * viewVec - (IOR * vn + sqrt(k)) * Normal;\n\treturn refrVec;\n}\nvoid addRefraction() {\n\tvec3 tmp = dReflDirW;\n\tvec4 tmp2 = dReflection;\n\tdReflection = vec4(0.0);\n\tdReflDirW = refract2(-dViewDirW, dNormalW, material_refractionIndex);\n\taddReflection();\n\tdDiffuseLight = mix(dDiffuseLight, dReflection.rgb * dAlbedo, material_refraction);\n\tdReflDirW = tmp;\n\tdReflection = tmp2;\n}\n",reprojectPS:"varying vec2 vUv0;\nuniform sampler2D sourceTex;\nuniform samplerCube sourceCube;\nuniform sampler2D samplesTex;\nuniform vec2 samplesTexInverseSize;\nuniform vec4 params;\nuniform vec2 params2;\nfloat targetFace() { return params.x; }\nfloat specularPower() { return params.y; }\nfloat sourceCubeSeamScale() { return params.z; }\nfloat targetCubeSeamScale() { return params.w; }\nfloat targetTotalPixels() { return params2.x; }\nfloat sourceTotalPixels() { return params2.y; }\nfloat PI = 3.141592653589793;\nfloat saturate(float x) {\n\treturn clamp(x, 0.0, 1.0);\n}\nvec3 decodeLinear(vec4 source) {\n\treturn source.rgb;\n}\nvec4 encodeLinear(vec3 source) {\n\treturn vec4(source, 1.0);\n}\nvec3 decodeGamma(vec4 source) {\n\treturn pow(source.xyz, vec3(2.2));\n}\nvec4 encodeGamma(vec3 source) {\n\treturn vec4(pow(source + 0.0000001, vec3(1.0 / 2.2)), 1.0);\n}\nvec3 decodeRGBM(vec4 rgbm) {\n\tvec3 color = (8.0 * rgbm.a) * rgbm.rgb;\n\treturn color * color;\n}\nvec4 encodeRGBM(vec3 source) {\n\tvec4 result;\n\tresult.rgb = pow(source.rgb, vec3(0.5));\n\tresult.rgb *= 1.0 / 8.0;\n\tresult.a = saturate( max( max( result.r, result.g ), max( result.b, 1.0 / 255.0 ) ) );\n\tresult.a = ceil(result.a * 255.0) / 255.0;\n\tresult.rgb /= result.a;\n\treturn result;\n}\nvec3 decodeRGBE(vec4 source) {\n\tif (source.a == 0.0) {\n\t\treturn vec3(0.0, 0.0, 0.0);\n\t} else {\n\t\treturn source.xyz * pow(2.0, source.w * 255.0 - 128.0);\n\t}\n}\nvec4 encodeRGBE(vec3 source) {\n\tfloat maxVal = max(source.x, max(source.y, source.z));\n\tif (maxVal < 1e-32) {\n\t\treturn vec4(0, 0, 0, 0);\n\t} else {\n\t\tfloat e = ceil(log2(maxVal));\n\t\treturn vec4(source / pow(2.0, e), (e + 128.0) / 255.0);\n\t}\n}\nvec3 modifySeams(vec3 dir, float scale) {\n\tvec3 adir = abs(dir);\n\tfloat M = max(max(adir.x, adir.y), adir.z);\n\treturn dir / M * vec3(\n\t\tadir.x == M ? 1.0 : scale,\n\t\tadir.y == M ? 1.0 : scale,\n\t\tadir.z == M ? 1.0 : scale\n\t);\n}\nvec2 toSpherical(vec3 dir) {\n\treturn vec2(dir.xz == vec2(0.0) ? 0.0 : atan(dir.x, dir.z), asin(dir.y));\n}\nvec3 fromSpherical(vec2 uv) {\n\treturn vec3(cos(uv.y) * sin(uv.x),\n\t\t\t\tsin(uv.y),\n\t\t\t\tcos(uv.y) * cos(uv.x));\n}\nvec3 getDirectionEquirect() {\n\treturn fromSpherical((vec2(vUv0.x, 1.0 - vUv0.y) * 2.0 - 1.0) * vec2(PI, PI * 0.5));\n}\nvec4 sampleEquirect(vec2 sph) {\n\tvec2 uv = sph / vec2(PI * 2.0, PI) + 0.5;\n\treturn texture2D(sourceTex, vec2(uv.x, 1.0 - uv.y));\n}\nvec4 sampleEquirect(vec3 dir) {\n\treturn sampleEquirect(toSpherical(dir));\n}\nvec4 sampleCubemap(vec3 dir) {\n\treturn textureCube(sourceCube, modifySeams(dir, 1.0 - sourceCubeSeamScale()));\n}\nvec4 sampleCubemap(vec2 sph) {\n\treturn sampleCubemap(fromSpherical(sph));\n}\nvec4 sampleEquirect(vec2 sph, float mipLevel) {\n\tvec2 uv = sph / vec2(PI * 2.0, PI) + 0.5;\n#ifdef SUPPORTS_TEXLOD\n\treturn texture2DLodEXT(sourceTex, vec2(uv.x, 1.0 - uv.y), mipLevel);\n#else\n\treturn texture2D(sourceTex, vec2(uv.x, 1.0 - uv.y));\n#endif\n}\nvec4 sampleEquirect(vec3 dir, float mipLevel) {\n\treturn sampleEquirect(toSpherical(dir), mipLevel);\n}\nvec4 sampleCubemap(vec3 dir, float mipLevel) {\n#ifdef SUPPORTS_TEXLOD\n\treturn textureCubeLodEXT(sourceCube, modifySeams(dir, 1.0 - exp2(mipLevel) * sourceCubeSeamScale()), mipLevel);\n#else\n\treturn textureCube(sourceCube, modifySeams(dir, 1.0 - exp2(mipLevel) * sourceCubeSeamScale()));\n#endif\n}\nvec4 sampleCubemap(vec2 sph, float mipLevel) {\n\treturn sampleCubemap(fromSpherical(sph), mipLevel);\n}\nfloat signNotZero(float k){\n\treturn(k >= 0.0) ? 1.0 : -1.0;\n}\nvec2 signNotZero(vec2 v) {\n\treturn vec2(signNotZero(v.x), signNotZero(v.y));\n}\nvec3 octDecode(vec2 o) {\n\tvec3 v = vec3(o.x, 1.0 - abs(o.x) - abs(o.y), o.y);\n\tif (v.y < 0.0) {\n\t\tv.xz = (1.0 - abs(v.zx)) * signNotZero(v.xz);\n\t}\n\treturn normalize(v);\n}\nvec3 getDirectionOctahedral() {\n\treturn octDecode(vec2(vUv0.x, 1.0 - vUv0.y) * 2.0 - 1.0);\n}\nvec2 octEncode(in vec3 v) {\n\tfloat l1norm = abs(v.x) + abs(v.y) + abs(v.z);\n\tvec2 result = v.xz * (1.0 / l1norm);\n\tif (v.y < 0.0) {\n\t\tresult = (1.0 - abs(result.yx)) * signNotZero(result.xy);\n\t}\n\treturn result;\n}\nvec4 sampleOctahedral(vec3 dir) {\n\tvec2 uv = octEncode(dir) * 0.5 + 0.5;\n\treturn texture2D(sourceTex, vec2(uv.x, 1.0 - uv.y));\n}\nvec4 sampleOctahedral(vec2 sph) {\n\treturn sampleOctahedral(fromSpherical(sph));\n}\nvec4 sampleOctahedral(vec3 dir, float mipLevel) {\n\tvec2 uv = octEncode(dir) * 0.5 + 0.5;\n#ifdef SUPPORTS_TEXLOD\n\treturn texture2DLodEXT(sourceTex, vec2(uv.x, 1.0 - uv.y), mipLevel);\n#else\n\treturn texture2D(sourceTex, vec2(uv.x, 1.0 - uv.y));\n#endif\n}\nvec4 sampleOctahedral(vec2 sph, float mipLevel) {\n\treturn sampleOctahedral(fromSpherical(sph), mipLevel);\n}\nvec3 getDirectionCubemap() {\n\tvec2 st = vUv0 * 2.0 - 1.0;\n\tfloat face = targetFace();\n\tvec3 vec;\n\tif (face == 0.0) {\n\t\tvec = vec3(1, -st.y, -st.x);\n\t} else if (face == 1.0) {\n\t\tvec = vec3(-1, -st.y, st.x);\n\t} else if (face == 2.0) {\n\t\tvec = vec3(st.x, 1, st.y);\n\t} else if (face == 3.0) {\n\t\tvec = vec3(st.x, -1, -st.y);\n\t} else if (face == 4.0) {\n\t\tvec = vec3(st.x, -st.y, 1);\n\t} else {\n\t\tvec = vec3(-st.x, -st.y, -1);\n\t}\n\treturn normalize(modifySeams(vec, 1.0 / (1.0 - targetCubeSeamScale())));\n}\nmat3 matrixFromVector(vec3 n) {\n\tfloat a = 1.0 / (1.0 + n.z);\n\tfloat b = -n.x * n.y * a;\n\tvec3 b1 = vec3(1.0 - n.x * n.x * a, b, -n.x);\n\tvec3 b2 = vec3(b, 1.0 - n.y * n.y * a, -n.y);\n\treturn mat3(b1, b2, n);\n}\nmat3 matrixFromVectorSlow(vec3 n) {\n\tvec3 up = (1.0 - abs(n.y) <= 0.0000001) ? vec3(0.0, 0.0, n.y > 0.0 ? 1.0 : -1.0) : vec3(0.0, 1.0, 0.0);\n\tvec3 x = normalize(cross(up, n));\n\tvec3 y = cross(n, x);\n\treturn mat3(x, y, n);\n}\nvec4 reproject() {\n\tif (NUM_SAMPLES <= 1) {\n\t\treturn ENCODE_FUNC(DECODE_FUNC(SOURCE_FUNC(TARGET_FUNC())));\n\t} else {\n\t\tvec2 sph = toSpherical(TARGET_FUNC());\n\t\tvec2 sphu = dFdx(sph);\n\t\tvec2 sphv = dFdy(sph);\n\t\tconst float NUM_SAMPLES_SQRT = sqrt(float(NUM_SAMPLES));\n\t\tvec3 result = vec3(0.0);\n\t\tfor (float u = 0.0; u < NUM_SAMPLES_SQRT; ++u) {\n\t\t\tfor (float v = 0.0; v < NUM_SAMPLES_SQRT; ++v) {\n\t\t\t\tresult += DECODE_FUNC(SOURCE_FUNC(sph +\n\t\t\t\t\t\t\t\t\t\t\t\t\tsphu * (u / NUM_SAMPLES_SQRT - 0.5) +\n\t\t\t\t\t\t\t\t\t\t\t\t\tsphv * (v / NUM_SAMPLES_SQRT - 0.5)));\n\t\t\t}\n\t\t}\n\t\treturn ENCODE_FUNC(result / (NUM_SAMPLES_SQRT * NUM_SAMPLES_SQRT));\n\t}\n}\nvec4 unpackFloat = vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0);\nvoid unpackSample(int i, out vec3 L, out float mipLevel) {\n\tfloat u = (float(i * 4) + 0.5) * samplesTexInverseSize.x;\n\tfloat v = (floor(u) + 0.5) * samplesTexInverseSize.y;\n\tvec4 raw;\n\traw.x = dot(texture2D(samplesTex, vec2(u, v)), unpackFloat); u += samplesTexInverseSize.x;\n\traw.y = dot(texture2D(samplesTex, vec2(u, v)), unpackFloat); u += samplesTexInverseSize.x;\n\traw.z = dot(texture2D(samplesTex, vec2(u, v)), unpackFloat); u += samplesTexInverseSize.x;\n\traw.w = dot(texture2D(samplesTex, vec2(u, v)), unpackFloat);\n\tL.xyz = raw.xyz * 2.0 - 1.0;\n\tmipLevel = raw.w * 8.0;\n}\nvec4 prefilterSamples() {\n\tmat3 vecSpace = matrixFromVectorSlow(TARGET_FUNC());\n\tvec3 L;\n\tfloat mipLevel;\n\tvec3 result = vec3(0.0);\n\tfloat totalWeight = 0.0;\n\tfor (int i = 0; i < NUM_SAMPLES; ++i) {\n\t\tunpackSample(i, L, mipLevel);\n\t\tresult += DECODE_FUNC(SOURCE_FUNC(vecSpace * L, mipLevel)) * L.z;\n\t\ttotalWeight += L.z;\n\t}\n\treturn ENCODE_FUNC(result / totalWeight);\n}\nvec4 prefilterSamplesUnweighted() {\n\tmat3 vecSpace = matrixFromVectorSlow(TARGET_FUNC());\n\tvec3 L;\n\tfloat mipLevel;\n\tvec3 result = vec3(0.0);\n\tfloat totalWeight = 0.0;\n\tfor (int i = 0; i < NUM_SAMPLES; ++i) {\n\t\tunpackSample(i, L, mipLevel);\n\t\tresult += DECODE_FUNC(SOURCE_FUNC(vecSpace * L, mipLevel));\n\t}\n\treturn ENCODE_FUNC(result / float(NUM_SAMPLES));\n}\nvoid main(void) {\n\tgl_FragColor = PROCESS_FUNC();\n}\n",rgbmPS:"vec3 texture2DRGBM(sampler2D tex, vec2 uv) {\n\treturn decodeRGBM(texture2D(tex, uv));\n}\nvec3 textureCubeRGBM(samplerCube tex, vec3 uvw) {\n\treturn decodeRGBM(textureCube(tex, uvw));\n}\n",screenDepthPS:"uniform highp sampler2D uDepthMap;\n#ifndef SCREENSIZE\n#define SCREENSIZE\nuniform vec4 uScreenSize;\n#endif\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\n#ifndef CAMERAPLANES\n#define CAMERAPLANES\nuniform vec4 camera_params;\n#endif\n#ifdef GL2\nfloat linearizeDepth(float z) {\n\tz = z * 2.0 - 1.0;\n\treturn 1.0 / (camera_params.z * z + camera_params.w);\n}\n#else\n#ifndef UNPACKFLOAT\n#define UNPACKFLOAT\nfloat unpackFloat(vec4 rgbaDepth) {\n\tconst vec4 bitShift = vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0);\n\treturn dot(rgbaDepth, bitShift);\n}\n#endif\n#endif\nfloat getLinearScreenDepth(vec2 uv) {\n\t#ifdef GL2\n\treturn linearizeDepth(texture2D(uDepthMap, uv).r) * camera_params.y;\n\t#else\n\treturn unpackFloat(texture2D(uDepthMap, uv)) * camera_params.y;\n\t#endif\n}\n#ifndef VERTEXSHADER\nfloat getLinearScreenDepth() {\n\tvec2 uv = gl_FragCoord.xy * uScreenSize.zw;\n\treturn getLinearScreenDepth(uv);\n}\n#endif\nfloat getLinearDepth(vec3 pos) {\n\treturn -(matrix_view * vec4(pos, 1.0)).z;\n}\n",shadowCascadesPS:"const float maxCascades = 4.0;\nmat4 cascadeShadowMat;\nvoid getShadowCascadeMatrix(mat4 shadowMatrixPalette[4], float shadowCascadeDistances[4], float shadowCascadeCount) {\n\tfloat depth = 1.0 / gl_FragCoord.w;\n\tfloat cascadeIndex = 0.0;\n\tfor (float i = 0.0; i < maxCascades; i++) {\n\t\tif (depth < shadowCascadeDistances[int(i)]) {\n\t\t\tcascadeIndex = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\tcascadeIndex = min(cascadeIndex, shadowCascadeCount - 1.0);\n\t#ifdef GL2\n\t\tcascadeShadowMat = shadowMatrixPalette[int(cascadeIndex)];\n\t#else\n\t\tif (cascadeIndex == 0.0) {\n\t\t\tcascadeShadowMat = shadowMatrixPalette[0];\n\t\t}\n\t\telse if (cascadeIndex == 1.0) {\n\t\t\tcascadeShadowMat = shadowMatrixPalette[1];\n\t\t}\n\t\telse if (cascadeIndex == 2.0) {\n\t\t\tcascadeShadowMat = shadowMatrixPalette[2];\n\t\t}\n\t\telse {\n\t\t\tcascadeShadowMat = shadowMatrixPalette[3];\n\t\t}\n\t#endif\n}\nvoid fadeShadow(float shadowCascadeDistances[4]) {\n\tfloat depth = 1.0 / gl_FragCoord.w;\n\tif (depth > shadowCascadeDistances[int(maxCascades - 1.0)]) {\n\t\tdShadowCoord.z = -9999999.0;\n\t}\n}\n",shadowCommonPS:"void normalOffsetPointShadow(vec4 shadowParams) {\n\tfloat distScale = length(dLightDirW);\n\tvec3 wPos = vPositionW + dVertexNormalW * shadowParams.y * clamp(1.0 - dot(dVertexNormalW, -dLightDirNormW), 0.0, 1.0) * distScale;\n\tvec3 dir = wPos - dLightPosW;\n\tdLightDirW = dir;\n}\n",shadowCoordPS:"void _getShadowCoordOrtho(mat4 shadowMatrix, vec3 shadowParams, vec3 wPos) {\n\tdShadowCoord = (shadowMatrix * vec4(wPos, 1.0)).xyz;\n\tdShadowCoord.z = saturate(dShadowCoord.z) - 0.0001;\n\t#ifdef SHADOWBIAS\n\tdShadowCoord.z += getShadowBias(shadowParams.x, shadowParams.z);\n\t#endif\n}\nvoid _getShadowCoordPersp(mat4 shadowMatrix, vec4 shadowParams, vec3 wPos) {\n\tvec4 projPos = shadowMatrix * vec4(wPos, 1.0);\n\tprojPos.xy /= projPos.w;\n\tdShadowCoord.xy = projPos.xy;\n\tdShadowCoord.z = length(dLightDirW) * shadowParams.w;\n\t#ifdef SHADOWBIAS\n\tdShadowCoord.z += getShadowBias(shadowParams.x, shadowParams.z);\n\t#endif\n}\nvoid getShadowCoordOrtho(mat4 shadowMatrix, vec3 shadowParams) {\n\t_getShadowCoordOrtho(shadowMatrix, shadowParams, vPositionW);\n}\nvoid getShadowCoordPersp(mat4 shadowMatrix, vec4 shadowParams) {\n\t_getShadowCoordPersp(shadowMatrix, shadowParams, vPositionW);\n}\nvoid getShadowCoordPerspNormalOffset(mat4 shadowMatrix, vec4 shadowParams) {\n\tfloat distScale = abs(dot(vPositionW - dLightPosW, dLightDirNormW));\n\tvec3 wPos = vPositionW + dVertexNormalW * shadowParams.y * clamp(1.0 - dot(dVertexNormalW, -dLightDirNormW), 0.0, 1.0) * distScale;\n\t_getShadowCoordPersp(shadowMatrix, shadowParams, wPos);\n}\nvoid getShadowCoordOrthoNormalOffset(mat4 shadowMatrix, vec3 shadowParams) {\n\tvec3 wPos = vPositionW + dVertexNormalW * shadowParams.y * clamp(1.0 - dot(dVertexNormalW, -dLightDirNormW), 0.0, 1.0);\n\t_getShadowCoordOrtho(shadowMatrix, shadowParams, wPos);\n}\n",shadowCoordPerspZbufferPS:"void _getShadowCoordPerspZbuffer(mat4 shadowMatrix, vec4 shadowParams, vec3 wPos) {\n\tvec4 projPos = shadowMatrix * vec4(wPos, 1.0);\n\tprojPos.xyz /= projPos.w;\n\tdShadowCoord = projPos.xyz;\n}\nvoid getShadowCoordPerspZbufferNormalOffset(mat4 shadowMatrix, vec4 shadowParams) {\n\tfloat distScale = abs(dot(vPositionW - dLightPosW, dLightDirNormW));\n\tvec3 wPos = vPositionW + dVertexNormalW * shadowParams.y * clamp(1.0 - dot(dVertexNormalW, -dLightDirNormW), 0.0, 1.0) * distScale;\n\t_getShadowCoordPerspZbuffer(shadowMatrix, shadowParams, wPos);\n}\nvoid getShadowCoordPerspZbuffer(mat4 shadowMatrix, vec4 shadowParams) {\n\t_getShadowCoordPerspZbuffer(shadowMatrix, shadowParams, vPositionW);\n}\n",shadowEVSMPS:"float VSM$(sampler2D tex, vec2 texCoords, float resolution, float Z, float vsmBias, float exponent) {\n\tvec3 moments = texture2D(tex, texCoords).xyz;\n\treturn calculateEVSM(moments, Z, vsmBias, exponent);\n}\nfloat getShadowVSM$(sampler2D shadowMap, vec3 shadowParams, float exponent) {\n\treturn VSM$(shadowMap, dShadowCoord.xy, shadowParams.x, dShadowCoord.z, shadowParams.y, exponent);\n}\nfloat getShadowSpotVSM$(sampler2D shadowMap, vec4 shadowParams, float exponent) {\n\treturn VSM$(shadowMap, dShadowCoord.xy, shadowParams.x, length(dLightDirW) * shadowParams.w + shadowParams.z, shadowParams.y, exponent);\n}\n",shadowEVSMnPS:"float VSM$(sampler2D tex, vec2 texCoords, float resolution, float Z, float vsmBias, float exponent) {\n\tfloat pixelSize = 1.0 / resolution;\n\ttexCoords -= vec2(pixelSize);\n\tvec3 s00 = texture2D(tex, texCoords).xyz;\n\tvec3 s10 = texture2D(tex, texCoords + vec2(pixelSize, 0)).xyz;\n\tvec3 s01 = texture2D(tex, texCoords + vec2(0, pixelSize)).xyz;\n\tvec3 s11 = texture2D(tex, texCoords + vec2(pixelSize)).xyz;\n\tvec2 fr = fract(texCoords * resolution);\n\tvec3 h0 = mix(s00, s10, fr.x);\n\tvec3 h1 = mix(s01, s11, fr.x);\n\tvec3 moments = mix(h0, h1, fr.y);\n\treturn calculateEVSM(moments, Z, vsmBias, exponent);\n}\nfloat getShadowVSM$(sampler2D shadowMap, vec3 shadowParams, float exponent) {\n\treturn VSM$(shadowMap, dShadowCoord.xy, shadowParams.x, dShadowCoord.z, shadowParams.y, exponent);\n}\nfloat getShadowSpotVSM$(sampler2D shadowMap, vec4 shadowParams, float exponent) {\n\treturn VSM$(shadowMap, dShadowCoord.xy, shadowParams.x, length(dLightDirW) * shadowParams.w + shadowParams.z, shadowParams.y, exponent);\n}\n",shadowStandardPS:"vec3 lessThan2(vec3 a, vec3 b) {\n\treturn clamp((b - a)*1000.0, 0.0, 1.0);\n}\n#ifndef UNPACKFLOAT\n#define UNPACKFLOAT\nfloat unpackFloat(vec4 rgbaDepth) {\n\tconst vec4 bitShift = vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0);\n\treturn dot(rgbaDepth, bitShift);\n}\n#endif\n#ifdef GL2\nfloat _getShadowPCF3x3(sampler2DShadow shadowMap, vec3 shadowParams) {\n\tfloat z = dShadowCoord.z;\n\tvec2 uv = dShadowCoord.xy * shadowParams.x;\n\tfloat shadowMapSizeInv = 1.0 / shadowParams.x;\n\tvec2 base_uv = floor(uv + 0.5);\n\tfloat s = (uv.x + 0.5 - base_uv.x);\n\tfloat t = (uv.y + 0.5 - base_uv.y);\n\tbase_uv -= vec2(0.5);\n\tbase_uv *= shadowMapSizeInv;\n\tfloat sum = 0.0;\n\tfloat uw0 = (3.0 - 2.0 * s);\n\tfloat uw1 = (1.0 + 2.0 * s);\n\tfloat u0 = (2.0 - s) / uw0 - 1.0;\n\tfloat u1 = s / uw1 + 1.0;\n\tfloat vw0 = (3.0 - 2.0 * t);\n\tfloat vw1 = (1.0 + 2.0 * t);\n\tfloat v0 = (2.0 - t) / vw0 - 1.0;\n\tfloat v1 = t / vw1 + 1.0;\n\tu0 = u0 * shadowMapSizeInv + base_uv.x;\n\tv0 = v0 * shadowMapSizeInv + base_uv.y;\n\tu1 = u1 * shadowMapSizeInv + base_uv.x;\n\tv1 = v1 * shadowMapSizeInv + base_uv.y;\n\tsum += uw0 * vw0 * texture(shadowMap, vec3(u0, v0, z));\n\tsum += uw1 * vw0 * texture(shadowMap, vec3(u1, v0, z));\n\tsum += uw0 * vw1 * texture(shadowMap, vec3(u0, v1, z));\n\tsum += uw1 * vw1 * texture(shadowMap, vec3(u1, v1, z));\n\tsum *= 1.0f / 16.0;\n\treturn sum;\n}\nfloat getShadowPCF3x3(sampler2DShadow shadowMap, vec3 shadowParams) {\n\treturn _getShadowPCF3x3(shadowMap, shadowParams);\n}\nfloat getShadowSpotPCF3x3(sampler2DShadow shadowMap, vec4 shadowParams) {\n\treturn _getShadowPCF3x3(shadowMap, shadowParams.xyz);\n}\n#else\nfloat _xgetShadowPCF3x3(mat3 depthKernel, sampler2D shadowMap, vec3 shadowParams) {\n\tmat3 shadowKernel;\n\tvec3 shadowCoord = dShadowCoord;\n\tvec3 shadowZ = vec3(shadowCoord.z);\n\tshadowKernel[0] = vec3(greaterThan(depthKernel[0], shadowZ));\n\tshadowKernel[1] = vec3(greaterThan(depthKernel[1], shadowZ));\n\tshadowKernel[2] = vec3(greaterThan(depthKernel[2], shadowZ));\n\tvec2 fractionalCoord = fract( shadowCoord.xy * shadowParams.x );\n\tshadowKernel[0] = mix(shadowKernel[0], shadowKernel[1], fractionalCoord.x);\n\tshadowKernel[1] = mix(shadowKernel[1], shadowKernel[2], fractionalCoord.x);\n\tvec4 shadowValues;\n\tshadowValues.x = mix(shadowKernel[0][0], shadowKernel[0][1], fractionalCoord.y);\n\tshadowValues.y = mix(shadowKernel[0][1], shadowKernel[0][2], fractionalCoord.y);\n\tshadowValues.z = mix(shadowKernel[1][0], shadowKernel[1][1], fractionalCoord.y);\n\tshadowValues.w = mix(shadowKernel[1][1], shadowKernel[1][2], fractionalCoord.y);\n\treturn dot( shadowValues, vec4( 1.0 ) ) * 0.25;\n}\nfloat _getShadowPCF3x3(sampler2D shadowMap, vec3 shadowParams) {\n\tvec3 shadowCoord = dShadowCoord;\n\tfloat xoffset = 1.0 / shadowParams.x;\n\tfloat dx0 = -xoffset;\n\tfloat dx1 = xoffset;\n\tmat3 depthKernel;\n\tdepthKernel[0][0] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx0, dx0)));\n\tdepthKernel[0][1] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx0, 0.0)));\n\tdepthKernel[0][2] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx0, dx1)));\n\tdepthKernel[1][0] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(0.0, dx0)));\n\tdepthKernel[1][1] = unpackFloat(texture2D(shadowMap, shadowCoord.xy));\n\tdepthKernel[1][2] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(0.0, dx1)));\n\tdepthKernel[2][0] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx1, dx0)));\n\tdepthKernel[2][1] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx1, 0.0)));\n\tdepthKernel[2][2] = unpackFloat(texture2D(shadowMap, shadowCoord.xy + vec2(dx1, dx1)));\n\treturn _xgetShadowPCF3x3(depthKernel, shadowMap, shadowParams);\n}\nfloat getShadowPCF3x3(sampler2D shadowMap, vec3 shadowParams) {\n\treturn _getShadowPCF3x3(shadowMap, shadowParams);\n}\nfloat getShadowSpotPCF3x3(sampler2D shadowMap, vec4 shadowParams) {\n\treturn _getShadowPCF3x3(shadowMap, shadowParams.xyz);\n}\n#endif\nfloat _getShadowPoint(samplerCube shadowMap, vec4 shadowParams, vec3 dir) {\n\tvec3 tc = normalize(dir);\n\tvec3 tcAbs = abs(tc);\n\tvec4 dirX = vec4(1,0,0, tc.x);\n\tvec4 dirY = vec4(0,1,0, tc.y);\n\tfloat majorAxisLength = tc.z;\n\tif ((tcAbs.x > tcAbs.y) && (tcAbs.x > tcAbs.z)) {\n\t\tdirX = vec4(0,0,1, tc.z);\n\t\tdirY = vec4(0,1,0, tc.y);\n\t\tmajorAxisLength = tc.x;\n\t} else if ((tcAbs.y > tcAbs.x) && (tcAbs.y > tcAbs.z)) {\n\t\tdirX = vec4(1,0,0, tc.x);\n\t\tdirY = vec4(0,0,1, tc.z);\n\t\tmajorAxisLength = tc.y;\n\t}\n\tfloat shadowParamsInFaceSpace = ((1.0/shadowParams.x) * 2.0) * abs(majorAxisLength);\n\tvec3 xoffset = (dirX.xyz * shadowParamsInFaceSpace);\n\tvec3 yoffset = (dirY.xyz * shadowParamsInFaceSpace);\n\tvec3 dx0 = -xoffset;\n\tvec3 dy0 = -yoffset;\n\tvec3 dx1 = xoffset;\n\tvec3 dy1 = yoffset;\n\tmat3 shadowKernel;\n\tmat3 depthKernel;\n\tdepthKernel[0][0] = unpackFloat(textureCube(shadowMap, tc + dx0 + dy0));\n\tdepthKernel[0][1] = unpackFloat(textureCube(shadowMap, tc + dx0));\n\tdepthKernel[0][2] = unpackFloat(textureCube(shadowMap, tc + dx0 + dy1));\n\tdepthKernel[1][0] = unpackFloat(textureCube(shadowMap, tc + dy0));\n\tdepthKernel[1][1] = unpackFloat(textureCube(shadowMap, tc));\n\tdepthKernel[1][2] = unpackFloat(textureCube(shadowMap, tc + dy1));\n\tdepthKernel[2][0] = unpackFloat(textureCube(shadowMap, tc + dx1 + dy0));\n\tdepthKernel[2][1] = unpackFloat(textureCube(shadowMap, tc + dx1));\n\tdepthKernel[2][2] = unpackFloat(textureCube(shadowMap, tc + dx1 + dy1));\n\tvec3 shadowZ = vec3(length(dir) * shadowParams.w + shadowParams.z);\n\tshadowKernel[0] = vec3(lessThan2(depthKernel[0], shadowZ));\n\tshadowKernel[1] = vec3(lessThan2(depthKernel[1], shadowZ));\n\tshadowKernel[2] = vec3(lessThan2(depthKernel[2], shadowZ));\n\tvec2 uv = (vec2(dirX.w, dirY.w) / abs(majorAxisLength)) * 0.5;\n\tvec2 fractionalCoord = fract( uv * shadowParams.x );\n\tshadowKernel[0] = mix(shadowKernel[0], shadowKernel[1], fractionalCoord.x);\n\tshadowKernel[1] = mix(shadowKernel[1], shadowKernel[2], fractionalCoord.x);\n\tvec4 shadowValues;\n\tshadowValues.x = mix(shadowKernel[0][0], shadowKernel[0][1], fractionalCoord.y);\n\tshadowValues.y = mix(shadowKernel[0][1], shadowKernel[0][2], fractionalCoord.y);\n\tshadowValues.z = mix(shadowKernel[1][0], shadowKernel[1][1], fractionalCoord.y);\n\tshadowValues.w = mix(shadowKernel[1][1], shadowKernel[1][2], fractionalCoord.y);\n\treturn 1.0 - dot( shadowValues, vec4( 1.0 ) ) * 0.25;\n}\nfloat getShadowPointPCF3x3(samplerCube shadowMap, vec4 shadowParams) {\n\treturn _getShadowPoint(shadowMap, shadowParams, dLightDirW);\n}\n",shadowStandardGL2PS:"float _getShadowPCF5x5(sampler2DShadow shadowMap, vec3 shadowParams) {\n\tfloat z = dShadowCoord.z;\n\tvec2 uv = dShadowCoord.xy * shadowParams.x;\n\tfloat shadowMapSizeInv = 1.0 / shadowParams.x;\n\tvec2 base_uv = floor(uv + 0.5);\n\tfloat s = (uv.x + 0.5 - base_uv.x);\n\tfloat t = (uv.y + 0.5 - base_uv.y);\n\tbase_uv -= vec2(0.5);\n\tbase_uv *= shadowMapSizeInv;\n\tfloat uw0 = (4.0 - 3.0 * s);\n\tfloat uw1 = 7.0;\n\tfloat uw2 = (1.0 + 3.0 * s);\n\tfloat u0 = (3.0 - 2.0 * s) / uw0 - 2.0;\n\tfloat u1 = (3.0 + s) / uw1;\n\tfloat u2 = s / uw2 + 2.0;\n\tfloat vw0 = (4.0 - 3.0 * t);\n\tfloat vw1 = 7.0;\n\tfloat vw2 = (1.0 + 3.0 * t);\n\tfloat v0 = (3.0 - 2.0 * t) / vw0 - 2.0;\n\tfloat v1 = (3.0 + t) / vw1;\n\tfloat v2 = t / vw2 + 2.0;\n\tfloat sum = 0.0;\n\tu0 = u0 * shadowMapSizeInv + base_uv.x;\n\tv0 = v0 * shadowMapSizeInv + base_uv.y;\n\tu1 = u1 * shadowMapSizeInv + base_uv.x;\n\tv1 = v1 * shadowMapSizeInv + base_uv.y;\n\tu2 = u2 * shadowMapSizeInv + base_uv.x;\n\tv2 = v2 * shadowMapSizeInv + base_uv.y;\n\tsum += uw0 * vw0 * texture(shadowMap, vec3(u0, v0, z));\n\tsum += uw1 * vw0 * texture(shadowMap, vec3(u1, v0, z));\n\tsum += uw2 * vw0 * texture(shadowMap, vec3(u2, v0, z));\n\tsum += uw0 * vw1 * texture(shadowMap, vec3(u0, v1, z));\n\tsum += uw1 * vw1 * texture(shadowMap, vec3(u1, v1, z));\n\tsum += uw2 * vw1 * texture(shadowMap, vec3(u2, v1, z));\n\tsum += uw0 * vw2 * texture(shadowMap, vec3(u0, v2, z));\n\tsum += uw1 * vw2 * texture(shadowMap, vec3(u1, v2, z));\n\tsum += uw2 * vw2 * texture(shadowMap, vec3(u2, v2, z));\n\tsum *= 1.0f / 144.0;\n\tsum = gammaCorrectInput(sum);\n\tsum = saturate(sum);\n\treturn sum;\n}\nfloat getShadowPCF5x5(sampler2DShadow shadowMap, vec3 shadowParams) {\n\treturn _getShadowPCF5x5(shadowMap, shadowParams);\n}\nfloat getShadowSpotPCF5x5(sampler2DShadow shadowMap, vec4 shadowParams) {\n\treturn _getShadowPCF5x5(shadowMap, shadowParams.xyz);\n}\n",shadowVSM8PS:"float calculateVSM8(vec3 moments, float Z, float vsmBias) {\n\tfloat VSMBias = vsmBias;\n\tfloat depthScale = VSMBias * Z;\n\tfloat minVariance1 = depthScale * depthScale;\n\treturn chebyshevUpperBound(moments.xy, Z, minVariance1, 0.1);\n}\nfloat decodeFloatRG(vec2 rg) {\n\treturn rg.y*(1.0/255.0) + rg.x;\n}\nfloat VSM8(sampler2D tex, vec2 texCoords, float resolution, float Z, float vsmBias, float exponent) {\n\tvec4 c = texture2D(tex, texCoords);\n\tvec3 moments = vec3(decodeFloatRG(c.xy), decodeFloatRG(c.zw), 0.0);\n\treturn calculateVSM8(moments, Z, vsmBias);\n}\nfloat getShadowVSM8(sampler2D shadowMap, vec3 shadowParams, float exponent) {\n\treturn VSM8(shadowMap, dShadowCoord.xy, shadowParams.x, dShadowCoord.z, shadowParams.y, 0.0);\n}\nfloat getShadowSpotVSM8(sampler2D shadowMap, vec4 shadowParams, float exponent) {\n\treturn VSM8(shadowMap, dShadowCoord.xy, shadowParams.x, length(dLightDirW) * shadowParams.w + shadowParams.z, shadowParams.y, 0.0);\n}\n",shadowVSM_commonPS:"float linstep(float a, float b, float v) {\n\treturn saturate((v - a) / (b - a));\n}\nfloat reduceLightBleeding(float pMax, float amount) {\n\t return linstep(amount, 1.0, pMax);\n}\nfloat chebyshevUpperBound(vec2 moments, float mean, float minVariance, float lightBleedingReduction) {\n\tfloat variance = moments.y - (moments.x * moments.x);\n\tvariance = max(variance, minVariance);\n\tfloat d = mean - moments.x;\n\tfloat pMax = variance / (variance + (d * d));\n\tpMax = reduceLightBleeding(pMax, lightBleedingReduction);\n\treturn (mean <= moments.x ? 1.0 : pMax);\n}\nfloat calculateEVSM(vec3 moments, float Z, float vsmBias, float exponent) {\n\tZ = 2.0 * Z - 1.0;\n\tfloat warpedDepth = exp(exponent * Z);\n\tmoments.xy += vec2(warpedDepth, warpedDepth*warpedDepth) * (1.0 - moments.z);\n\tfloat VSMBias = vsmBias;\n\tfloat depthScale = VSMBias * exponent * warpedDepth;\n\tfloat minVariance1 = depthScale * depthScale;\n\treturn chebyshevUpperBound(moments.xy, warpedDepth, minVariance1, 0.1);\n}\n",skinBatchConstVS:"attribute float vertex_boneIndices;\nuniform vec4 matrix_pose[BONE_LIMIT * 3];\nmat4 getBoneMatrix(const in float i) {\n\tvec4 v1 = matrix_pose[int(3.0 * i)];\n\tvec4 v2 = matrix_pose[int(3.0 * i + 1.0)];\n\tvec4 v3 = matrix_pose[int(3.0 * i + 2.0)];\n\treturn mat4(\n\t\tv1.x, v2.x, v3.x, 0,\n\t\tv1.y, v2.y, v3.y, 0,\n\t\tv1.z, v2.z, v3.z, 0,\n\t\tv1.w, v2.w, v3.w, 1\n\t);\n}\n",skinBatchTexVS:"attribute float vertex_boneIndices;\nuniform highp sampler2D texture_poseMap;\nuniform vec4 texture_poseMapSize;\nmat4 getBoneMatrix(const in float i) {\n\tfloat j = i * 3.0;\n\tfloat dx = texture_poseMapSize.z;\n\tfloat dy = texture_poseMapSize.w;\n\tfloat y = floor(j * dx);\n\tfloat x = j - (y * texture_poseMapSize.x);\n\ty = dy * (y + 0.5);\n\tvec4 v1 = texture2D(texture_poseMap, vec2(dx * (x + 0.5), y));\n\tvec4 v2 = texture2D(texture_poseMap, vec2(dx * (x + 1.5), y));\n\tvec4 v3 = texture2D(texture_poseMap, vec2(dx * (x + 2.5), y));\n\treturn mat4(\n\t\tv1.x, v2.x, v3.x, 0,\n\t\tv1.y, v2.y, v3.y, 0,\n\t\tv1.z, v2.z, v3.z, 0,\n\t\tv1.w, v2.w, v3.w, 1\n\t);\n}\n",skinConstVS:"attribute vec4 vertex_boneWeights;\nattribute vec4 vertex_boneIndices;\nuniform vec4 matrix_pose[BONE_LIMIT * 3];\nvoid getBoneMatrix(const in float i, out vec4 v1, out vec4 v2, out vec4 v3) {\n\tv1 = matrix_pose[int(3.0 * i)];\n\tv2 = matrix_pose[int(3.0 * i + 1.0)];\n\tv3 = matrix_pose[int(3.0 * i + 2.0)];\n}\nmat4 getSkinMatrix(const in vec4 indices, const in vec4 weights) {\n\tvec4 a1, a2, a3;\n\tgetBoneMatrix(indices.x, a1, a2, a3);\n\tvec4 b1, b2, b3;\n\tgetBoneMatrix(indices.y, b1, b2, b3);\n\tvec4 c1, c2, c3;\n\tgetBoneMatrix(indices.z, c1, c2, c3);\n\tvec4 d1, d2, d3;\n\tgetBoneMatrix(indices.w, d1, d2, d3);\n\tvec4 v1 = a1 * weights.x + b1 * weights.y + c1 * weights.z + d1 * weights.w;\n\tvec4 v2 = a2 * weights.x + b2 * weights.y + c2 * weights.z + d2 * weights.w;\n\tvec4 v3 = a3 * weights.x + b3 * weights.y + c3 * weights.z + d3 * weights.w;\n\tfloat one = dot(weights, vec4(1.0));\n\treturn mat4(\n\t\tv1.x, v2.x, v3.x, 0,\n\t\tv1.y, v2.y, v3.y, 0,\n\t\tv1.z, v2.z, v3.z, 0,\n\t\tv1.w, v2.w, v3.w, one\n\t);\n}\n",skinTexVS:"attribute vec4 vertex_boneWeights;\nattribute vec4 vertex_boneIndices;\nuniform highp sampler2D texture_poseMap;\nuniform vec4 texture_poseMapSize;\nvoid getBoneMatrix(const in float i, out vec4 v1, out vec4 v2, out vec4 v3) {\n\tfloat j = i * 3.0;\n\tfloat dx = texture_poseMapSize.z;\n\tfloat dy = texture_poseMapSize.w;\n\tfloat y = floor(j * dx);\n\tfloat x = j - (y * texture_poseMapSize.x);\n\ty = dy * (y + 0.5);\n\tv1 = texture2D(texture_poseMap, vec2(dx * (x + 0.5), y));\n\tv2 = texture2D(texture_poseMap, vec2(dx * (x + 1.5), y));\n\tv3 = texture2D(texture_poseMap, vec2(dx * (x + 2.5), y));\n}\nmat4 getSkinMatrix(const in vec4 indices, const in vec4 weights) {\n\tvec4 a1, a2, a3;\n\tgetBoneMatrix(indices.x, a1, a2, a3);\n\tvec4 b1, b2, b3;\n\tgetBoneMatrix(indices.y, b1, b2, b3);\n\tvec4 c1, c2, c3;\n\tgetBoneMatrix(indices.z, c1, c2, c3);\n\tvec4 d1, d2, d3;\n\tgetBoneMatrix(indices.w, d1, d2, d3);\n\tvec4 v1 = a1 * weights.x + b1 * weights.y + c1 * weights.z + d1 * weights.w;\n\tvec4 v2 = a2 * weights.x + b2 * weights.y + c2 * weights.z + d2 * weights.w;\n\tvec4 v3 = a3 * weights.x + b3 * weights.y + c3 * weights.z + d3 * weights.w;\n\tfloat one = dot(weights, vec4(1.0));\n\treturn mat4(\n\t\tv1.x, v2.x, v3.x, 0,\n\t\tv1.y, v2.y, v3.y, 0,\n\t\tv1.z, v2.z, v3.z, 0,\n\t\tv1.w, v2.w, v3.w, one\n\t);\n}\n",skyboxEnvPS:"varying vec3 vViewDir;\nuniform sampler2D texture_envAtlas;\nuniform float mipLevel;\nvoid main(void) {\n\tvec3 dir = vViewDir * vec3(-1.0, 1.0, 1.0);\n\tvec2 uv = toSphericalUv(normalize(dir));\n\tvec3 linear = $DECODE(texture2D(texture_envAtlas, mapRoughnessUv(uv, mipLevel)));\n\tgl_FragColor = vec4(gammaCorrectOutput(toneMap(processEnvironment(linear))), 1.0);\n}\n",skyboxHDRPS:"varying vec3 vViewDir;\nuniform samplerCube texture_cubeMap;\nvoid main(void) {\n\tvec3 dir=vViewDir;\n\tdir.x *= -1.0;\n\tvec3 color = processEnvironment($textureCubeSAMPLE(texture_cubeMap, fixSeamsStatic(dir, $FIXCONST)).rgb);\n\tcolor = toneMap(color);\n\tcolor = gammaCorrectOutput(color);\n\tgl_FragColor = vec4(color, 1.0);\n}\n",skyboxVS:"attribute vec3 aPosition;\n#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\nuniform mat4 matrix_projectionSkybox;\nuniform mat3 cubeMapRotationMatrix;\nvarying vec3 vViewDir;\nvoid main(void) {\n\tmat4 view = matrix_view;\n\tview[3][0] = view[3][1] = view[3][2] = 0.0;\n\tgl_Position = matrix_projectionSkybox * view * vec4(aPosition, 1.0);\n\tgl_Position.z = gl_Position.w - 0.00001;\n\tvViewDir = aPosition * cubeMapRotationMatrix;\n}\n",specularPS:"#ifdef MAPCOLOR\nuniform vec3 material_specular;\n#endif\n#ifdef MAPTEXTURE\nuniform sampler2D texture_specularMap;\n#endif\nvoid getSpecularity() {\n\tdSpecularity = vec3(1.0);\n\t#ifdef MAPCOLOR\n\tdSpecularity *= material_specular;\n\t#endif\n\t#ifdef MAPTEXTURE\n\tdSpecularity *= texture2D(texture_specularMap, $UV).$CH;\n\t#endif\n\t#ifdef MAPVERTEX\n\tdSpecularity *= saturate(vVertexColor.$VC);\n\t#endif\n}\n",specularAaNonePS:"float antiAliasGlossiness(float power) {\n\treturn power;\n}\n",specularAaToksvigPS:"float antiAliasGlossiness(float power) {\n\tfloat rlen = 1.0 / saturate(length(dNormalMap));\n\tfloat toksvig = 1.0 / (1.0 + power * (rlen - 1.0));\n\treturn power * mix(1.0, toksvig, material_bumpiness);\n}\n",specularAaToksvigFastPS:"float antiAliasGlossiness(float power) {\n\tfloat rlen = 1.0 / saturate(length(dNormalMap));\n\tfloat toksvig = 1.0 / (1.0 + power * (rlen - 1.0));\n\treturn power * toksvig;\n}\n",spotPS:"float getSpotEffect(vec3 lightSpotDirW, float lightInnerConeAngle, float lightOuterConeAngle) {\n\tfloat cosAngle = dot(dLightDirNormW, lightSpotDirW);\n\treturn smoothstep(lightOuterConeAngle, lightInnerConeAngle, cosAngle);\n}\n",startPS:"void main(void) {\n\tdDiffuseLight = vec3(0);\n\tdSpecularLight = vec3(0);\n\tdReflection = vec4(0);\n\tdSpecularity = vec3(0);\n\t#ifdef CLEARCOAT\n\tccSpecularLight = vec3(0);\n\tccReflection = vec4(0);\n\t#endif\n",startVS:"void main(void) {\n\tgl_Position = getPosition();\n",startNineSlicedPS:"\tnineSlicedUv = vUv0;\n\tnineSlicedUv.y = 1.0 - nineSlicedUv.y;\n",startNineSlicedTiledPS:"\tvec2 tileMask = step(vMask, vec2(0.99999));\n\tvec2 tileSize = 0.5 * (innerOffset.xy + innerOffset.zw);\n\tvec2 tileScale = vec2(1.0) / (vec2(1.0) - tileSize);\n\tvec2 clampedUv = mix(innerOffset.xy * 0.5, vec2(1.0) - innerOffset.zw * 0.5, fract((vTiledUv - tileSize) * tileScale));\n\tclampedUv = clampedUv * atlasRect.zw + atlasRect.xy;\n\tnineSlicedUv = vUv0 * tileMask + clampedUv * (vec2(1.0) - tileMask);\n\tnineSlicedUv.y = 1.0 - nineSlicedUv.y;\n",storeEVSMPS:"float exponent = VSM_EXPONENT;\ndepth = 2.0 * depth - 1.0;\ndepth =\texp(exponent * depth);\ngl_FragColor = vec4(depth, depth*depth, 1.0, 1.0);\n",tangentBinormalVS:"vec3 getTangent() {\n\treturn normalize(dNormalMatrix * vertex_tangent.xyz);\n}\nvec3 getBinormal() {\n\treturn cross(vNormalW, vTangentW) * vertex_tangent.w;\n}\nvec3 getObjectSpaceUp() {\n\treturn normalize(dNormalMatrix * vec3(0, 1, 0));\n}\n",TBNPS:"void getTBN() {\n\tdTBN = mat3(normalize(dTangentW), normalize(dBinormalW), normalize(dVertexNormalW));\n}\n",TBNderivativePS:"uniform float tbnBasis;\nvoid getTBN() {\n\tvec2 uv = $UV;\n\tvec3 dp1 = dFdx( vPositionW );\n\tvec3 dp2 = dFdy( vPositionW );\n\tvec2 duv1 = dFdx( uv );\n\tvec2 duv2 = dFdy( uv );\n\tvec3 dp2perp = cross( dp2, dVertexNormalW );\n\tvec3 dp1perp = cross( dVertexNormalW, dp1 );\n\tvec3 T = dp2perp * duv1.x + dp1perp * duv2.x;\n\tvec3 B = dp2perp * duv1.y + dp1perp * duv2.y;\n\tfloat denom = max( dot(T,T), dot(B,B) );\n\tfloat invmax = (denom == 0.0) ? 0.0 : tbnBasis / sqrt( denom );\n\tdTBN = mat3(T * invmax, -B * invmax, dVertexNormalW );\n}\n",TBNfastPS:"void getTBN() {\n\tdTBN = mat3(dTangentW, dBinormalW, dVertexNormalW);\n}\n",TBNObjectSpacePS:"void getTBN() {\n\tvec3 B = cross(dVertexNormalW, vObjectSpaceUpW);\n\tvec3 T = cross(dVertexNormalW, B);\n\tif (dot(B,B)==0.0)\n\t{\n\t\tfloat major=max(max(dVertexNormalW.x, dVertexNormalW.y),dVertexNormalW.z);\n\t\tif (dVertexNormalW.x==major)\n\t\t{\n\t\t\tB=cross(dVertexNormalW, vec3(0,1,0));\n\t\t\tT=cross(dVertexNormalW, B);\n\t\t}\n\t\telse if (dVertexNormalW.y==major)\n\t\t{\n\t\t\tB=cross(dVertexNormalW, vec3(0,0,1));\n\t\t\tT=cross(dVertexNormalW, B);\n\t\t}\n\t\telse if (dVertexNormalW.z==major)\n\t\t{\n\t\t\tB=cross(dVertexNormalW, vec3(1,0,0));\n\t\t\tT=cross(dVertexNormalW, B);\n\t\t}\n\t}\n\tdTBN = mat3(normalize(T), normalize(B), normalize(dVertexNormalW));\n}\n",tonemappingAcesPS:"uniform float exposure;\nvec3 toneMap(vec3 color) {\n\tfloat tA = 2.51;\n\tfloat tB = 0.03;\n\tfloat tC = 2.43;\n\tfloat tD = 0.59;\n\tfloat tE = 0.14;\n\tvec3 x = color * exposure;\n\treturn (x*(tA*x+tB))/(x*(tC*x+tD)+tE);\n}\n",tonemappingAces2PS:"uniform float exposure;\nconst mat3 ACESInputMat = mat3(\n\t0.59719, 0.35458, 0.04823,\n\t0.07600, 0.90834, 0.01566,\n\t0.02840, 0.13383, 0.83777\n);\nconst mat3 ACESOutputMat = mat3(\n\t 1.60475, -0.53108, -0.07367,\n\t-0.10208,\t1.10813, -0.00605,\n\t-0.00327, -0.07276,\t1.07602\n);\nvec3 RRTAndODTFit(vec3 v) {\n\tvec3 a = v * (v + 0.0245786) - 0.000090537;\n\tvec3 b = v * (0.983729 * v + 0.4329510) + 0.238081;\n\treturn a / b;\n}\nvec3 toneMap(vec3 color) {\n\tcolor *= exposure;\n\tcolor = color * ACESInputMat;\n\tcolor = RRTAndODTFit(color);\n\tcolor = color * ACESOutputMat;\n\tcolor = clamp(color, 0.0, 1.0);\n\treturn color;\n}\n",tonemappingFilmicPS:"const float A =\t0.15;\nconst float B =\t0.50;\nconst float C =\t0.10;\nconst float D =\t0.20;\nconst float E =\t0.02;\nconst float F =\t0.30;\nconst float W =\t11.2;\nuniform float exposure;\nvec3 uncharted2Tonemap(vec3 x) {\n\t return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;\n}\nvec3 toneMap(vec3 color) {\n\tcolor = uncharted2Tonemap(color * exposure);\n\tvec3 whiteScale = 1.0 / uncharted2Tonemap(vec3(W,W,W));\n\tcolor = color * whiteScale;\n\treturn color;\n}\n",tonemappingHejlPS:"uniform float exposure;\nvec3 toneMap(vec3 color) {\n\tcolor *= exposure;\n\tconst float\tA = 0.22, B = 0.3, C = .1, D = 0.2, E = .01, F = 0.3;\n\tconst float Scl = 1.25;\n\tvec3 h = max( vec3(0.0), color - vec3(0.004) );\n\treturn (h*((Scl*A)*h+Scl*vec3(C*B,C*B,C*B))+Scl*vec3(D*E,D*E,D*E)) / (h*(A*h+vec3(B,B,B))+vec3(D*F,D*F,D*F)) - Scl*vec3(E/F,E/F,E/F);\n}\n",tonemappingLinearPS:"uniform float exposure;\nvec3 toneMap(vec3 color) {\n\treturn color * exposure;\n}\n",tonemappingNonePS:"vec3 toneMap(vec3 color) {\n\treturn color;\n}\n",transformVS:"#ifdef PIXELSNAP\nuniform vec4 uScreenSize;\n#endif\n#ifdef MORPHING\nuniform vec4 morph_weights_a;\nuniform vec4 morph_weights_b;\n#endif\n#ifdef MORPHING_TEXTURE_BASED\nuniform vec4 morph_tex_params;\nvec2 getTextureMorphCoords() {\n\tfloat vertexId = morph_vertex_id;\n\tvec2 textureSize = morph_tex_params.xy;\n\tvec2 invTextureSize = morph_tex_params.zw;\n\tfloat morphGridV = floor(vertexId * invTextureSize.x);\n\tfloat morphGridU = vertexId - (morphGridV * textureSize.x);\n\treturn (vec2(morphGridU, morphGridV) * invTextureSize) + (0.5 * invTextureSize);\n}\n#endif\n#ifdef MORPHING_TEXTURE_BASED_POSITION\nuniform highp sampler2D morphPositionTex;\n#endif\nmat4 getModelMatrix() {\n\t#ifdef DYNAMICBATCH\n\treturn getBoneMatrix(vertex_boneIndices);\n\t#elif defined(SKIN)\n\treturn matrix_model * getSkinMatrix(vertex_boneIndices, vertex_boneWeights);\n\t#elif defined(INSTANCING)\n\treturn mat4(instance_line1, instance_line2, instance_line3, instance_line4);\n\t#else\n\treturn matrix_model;\n\t#endif\n}\nvec4 getPosition() {\n\tdModelMatrix = getModelMatrix();\n\tvec3 localPos = vertex_position;\n\t#ifdef NINESLICED\n\tlocalPos.xz *= outerScale;\n\tvec2 positiveUnitOffset = clamp(vertex_position.xz, vec2(0.0), vec2(1.0));\n\tvec2 negativeUnitOffset = clamp(-vertex_position.xz, vec2(0.0), vec2(1.0));\n\tlocalPos.xz += (-positiveUnitOffset * innerOffset.xy + negativeUnitOffset * innerOffset.zw) * vertex_texCoord0.xy;\n\tvTiledUv = (localPos.xz - outerScale + innerOffset.xy) * -0.5 + 1.0;\n\tlocalPos.xz *= -0.5;\n\tlocalPos = localPos.xzy;\n\t#endif\n\t#ifdef MORPHING\n\t#ifdef MORPHING_POS03\n\tlocalPos.xyz += morph_weights_a[0] * morph_pos0;\n\tlocalPos.xyz += morph_weights_a[1] * morph_pos1;\n\tlocalPos.xyz += morph_weights_a[2] * morph_pos2;\n\tlocalPos.xyz += morph_weights_a[3] * morph_pos3;\n\t#endif\n\t#ifdef MORPHING_POS47\n\tlocalPos.xyz += morph_weights_b[0] * morph_pos4;\n\tlocalPos.xyz += morph_weights_b[1] * morph_pos5;\n\tlocalPos.xyz += morph_weights_b[2] * morph_pos6;\n\tlocalPos.xyz += morph_weights_b[3] * morph_pos7;\n\t#endif\n\t#endif\n\t#ifdef MORPHING_TEXTURE_BASED_POSITION\n\tvec2 morphUV = getTextureMorphCoords();\n\tvec3 morphPos = texture2D(morphPositionTex, morphUV).xyz;\n\tlocalPos += morphPos;\n\t#endif\n\tvec4 posW = dModelMatrix * vec4(localPos, 1.0);\n\t#ifdef SCREENSPACE\n\tposW.zw = vec2(0.0, 1.0);\n\t#endif\n\tdPositionW = posW.xyz;\n\tvec4 screenPos;\n\t#ifdef UV1LAYOUT\n\tscreenPos = vec4(vertex_texCoord1.xy * 2.0 - 1.0, 0.5, 1);\n\t#else\n\t#ifdef SCREENSPACE\n\tscreenPos = posW;\n\t#else\n\tscreenPos = matrix_viewProjection * posW;\n\t#endif\n\t#ifdef PIXELSNAP\n\tscreenPos.xy = (screenPos.xy * 0.5) + 0.5;\n\tscreenPos.xy *= uScreenSize.xy;\n\tscreenPos.xy = floor(screenPos.xy);\n\tscreenPos.xy *= uScreenSize.zw;\n\tscreenPos.xy = (screenPos.xy * 2.0) - 1.0;\n\t#endif\n\t#endif\n\treturn screenPos;\n}\nvec3 getWorldPosition() {\n\treturn dPositionW;\n}\n",transformDeclVS:"attribute vec3 vertex_position;\nuniform mat4 matrix_model;\nuniform mat4 matrix_viewProjection;\nvec3 dPositionW;\nmat4 dModelMatrix;\n",uv0VS:"#ifdef NINESLICED\nvec2 getUv0() {\n\tvec2 uv = vertex_position.xz;\n\tvec2 positiveUnitOffset = clamp(vertex_position.xz, vec2(0.0), vec2(1.0));\n\tvec2 negativeUnitOffset = clamp(-vertex_position.xz, vec2(0.0), vec2(1.0));\n\tuv += (-positiveUnitOffset * innerOffset.xy + negativeUnitOffset * innerOffset.zw) * vertex_texCoord0.xy;\n\tuv = uv * -0.5 + 0.5;\n\tuv = uv * atlasRect.zw + atlasRect.xy;\n\tvMask = vertex_texCoord0.xy;\n\treturn uv;\n}\n#else\nvec2 getUv0() {\n\treturn vertex_texCoord0;\n}\n#endif\n",uv1VS:"vec2 getUv1() {\n\treturn vertex_texCoord1;\n}\n",viewDirPS:"void getViewDir() {\n\tdViewDirW = normalize(view_position - vPositionW);\n}\n",viewNormalVS:"#ifndef VIEWMATRIX\n#define VIEWMATRIX\nuniform mat4 matrix_view;\n#endif\nvec3 getViewNormal() {\n\treturn mat3(matrix_view) * vNormalW;\n}\n"};function oi(t,e){return e||(e=ri),1===t||2===t?e.gamma2_2PS?e.gamma2_2PS:ri.gamma2_2PS:3===t?"#define HDR\n"+(e.gamma2_2PS?e.gamma2_2PS:ri.gamma2_2PS):e.gamma1_0PS?e.gamma1_0PS:ri.gamma1_0PS}function hi(t,e){return e||(e=ri),1===t?e.tonemappingFilmicPS?e.tonemappingFilmicPS:ri.tonemappingFilmicPS:0===t?e.tonemappingLinearPS?e.tonemappingLinearPS:ri.tonemappingLinearPS:2===t?e.tonemappingHejlPS?e.tonemappingHejlPS:ri.tonemappingHejlPS:3===t?e.tonemappingAcesPS?e.tonemappingAcesPS:ri.tonemappingAcesPS:4===t?e.tonemappingAces2PS?e.tonemappingAces2PS:ri.tonemappingAces2PS:e.tonemapingNonePS?e.tonemapingNonePS:ri.tonemappingNonePS}function li(t,e){return e||(e=ri),"linear"===t?e.fogLinearPS?e.fogLinearPS:ri.fogLinearPS:"exp"===t?e.fogExpPS?e.fogExpPS:ri.fogExpPS:"exp2"===t?e.fogExp2PS?e.fogExp2PS:ri.fogExp2PS:e.fogNonePS?e.fogNonePS:ri.fogNonePS}function ci(t,e){return e||(e=ri),t.supportsBoneTextures?e.skinTexVS:"#define BONE_LIMIT "+t.getBoneLimit()+"\n"+e.skinConstVS}function ui(t){var e="precision "+t.precision+" float;\n";return t.webgl2&&(e+="#ifdef GL2\nprecision "+t.precision+" sampler2DShadow;\n#endif\n"),e}function di(t){return t.webgl2?"#version 300 es\n":""}function fi(){return"void main(void) {gl_FragColor = vec4(0.0);}"}function pi(){return"void main(void)\n{\n"}function mi(){return"}\n"}var _i={vertex_position:ae,vertex_normal:re,vertex_tangent:oe,vertex_texCoord0:de,vertex_texCoord1:fe,vertex_texCoord2:pe,vertex_texCoord3:me,vertex_texCoord4:_e,vertex_texCoord5:ge,vertex_texCoord6:ve,vertex_texCoord7:ye,vertex_color:ce,vertex_boneIndices:le,vertex_boneWeights:he};function gi(t){for(var e={},i=0,n=t.indexOf("attribute");n>=0&&!(n>0&&"/"===t[n-1]);){var s=t.indexOf(";",n),a=t.lastIndexOf(" ",s),r=t.substr(a+1,s-(a+1)),o=_i[r];void 0!==o?e[r]=o:(e[r]="ATTR"+i,i++),n=t.indexOf("attribute",n+1)}return e}function vi(t,e,i,n,s,a){void 0===s&&(s=!1),void 0===a&&(a="");var r=t.programLib._cache,o=r[n];if(void 0!==o)return o;i=ui(t)+"\n"+(i||"void main(void) {gl_FragColor = vec4(0.0);}");var h=gi(e);return t.webgl2&&(e=di(t)+ri.gles3VS+e,i=di(t)+ri.gles3PS+i),r[n]=new ai(t,{attributes:h,vshader:e,fshader:a+i,useTransformFeedback:s}),r[n]}ri.collectAttribs=gi,ri.createShader=function(t,e,i,n){void 0===n&&(n=!1);var s=ri[e],a=ui(t)+"\n"+ri[i],r=gi(s);return t.webgl2&&(s=di(t)+ri.gles3VS+s,a=di(t)+ri.gles3PS+a),new ai(t,{attributes:r,vshader:s,fshader:a,useTransformFeedback:n})},ri.createShaderFromCode=vi;var yi=function(){function t(){this.globalId=0,this.revision=0}var e=t.prototype;return e.equals=function(t){return this.globalId===t.globalId&&this.revision===t.revision},e.copy=function(t){this.globalId=t.globalId,this.revision=t.revision},e.reset=function(){this.globalId=0,this.revision=0},t}(),xi=0,bi=function(){function t(){xi++,this.version=new yi,this.version.globalId=xi}return t.prototype.increment=function(){this.version.revision++},t}(),Si=function(){function t(t){this.name=t,this.value=null,this.versionObject=new bi}var e=t.prototype;return e.setValue=function(t){this.value=t,this.versionObject.increment()},e.getValue=function(){return this.value},t}(),wi=function(){function t(t){this.name=t,this.variables=new Map}var e=t.prototype;return e.resolve=function(t){return this.variables.has(t)||this.variables.set(t,new Si(t)),this.variables.get(t)},e.removeValue=function(t){for(var e in this.variables){var i=this.variables[e];i.value===t&&(i.value=null)}},t}(),Ti={generateKey:function(t){var e="basic";return t.fog&&(e+="_fog"),t.alphaTest&&(e+="_atst"),t.vertexColors&&(e+="_vcol"),t.diffuseMap&&(e+="_diff"),t.skin&&(e+="_skin"),t.screenSpace&&(e+="_ss"),t.useInstancing&&(e+="_inst"),t.useMorphPosition&&(e+="_morphp"),t.useMorphNormal&&(e+="_morphn"),t.useMorphTextureBased&&(e+="_morpht"),e+="_"+t.pass},createShaderDefinition:function(t,e){var i={vertex_position:ae};e.skin&&(i.vertex_boneWeights=he,i.vertex_boneIndices=le),e.vertexColors&&(i.vertex_color=ce),e.diffuseMap&&(i.vertex_texCoord0=de);var n="";n+=ri.transformDeclVS,e.skin?(n+=ci(t),n+=ri.transformSkinnedVS):n+=ri.transformVS,e.vertexColors&&(n+="attribute vec4 vertex_color;\n",n+="varying vec4 vColor;\n"),e.diffuseMap&&(n+="attribute vec2 vertex_texCoord0;\n",n+="varying vec2 vUv0;\n"),2===e.pass&&(n+="varying float vDepth;\n",n+="#ifndef VIEWMATRIX\n",n+="#define VIEWMATRIX\n",n+="uniform mat4 matrix_view;\n",n+="#endif\n",n+="#ifndef CAMERAPLANES\n",n+="#define CAMERAPLANES\n",n+="uniform vec4 camera_params;\n\n",n+="#endif\n"),n+="void main(void)\n{\n",n+="\t gl_Position = getPosition();\n",2===e.pass&&(n+="\t\tvDepth = -(matrix_view * vec4(getWorldPosition(),1.0)).z * camera_params.x;\n"),e.vertexColors&&(n+="\t\tvColor = vertex_color;\n"),e.diffuseMap&&(n+="\t\tvUv0 = vertex_texCoord0;\n");var s=n+="}\n";return n=ui(t),e.vertexColors?n+="varying vec4 vColor;\n":n+="uniform vec4 uColor;\n",e.diffuseMap&&(n+="varying vec2 vUv0;\n",n+="uniform sampler2D texture_diffuseMap;\n"),e.fog&&(n+=li(e.fog)),e.alphatest&&(n+=ri.alphaTestPS),2===e.pass&&(n+="varying float vDepth;\n",n+=ri.packDepthPS),n+="void main(void)\n{\n",e.vertexColors?n+="\t\tgl_FragColor = vColor;\n":n+="\t\tgl_FragColor = uColor;\n",e.diffuseMap&&(n+="\t\tgl_FragColor *= texture2D(texture_diffuseMap, vUv0);\n"),e.alphatest&&(n+="\t alphaTest(gl_FragColor.a);\n"),e.pass!==Nt&&(2===e.pass?n+="\t\tgl_FragColor = packFloat(vDepth);\n":e.fog&&(n+="\t glFragColor.rgb = addFog(gl_FragColor.rgb);\n")),{attributes:i,vshader:s,fshader:n+="}\n"}}},Ai={generateKey:function(t){var e="particle";for(var i in t)t.hasOwnProperty(i)&&(e+=t[i]);return e},_animTex:function(t){var e="";return e+=t.animTexLoop?ri.particleAnimFrameLoopVS:ri.particleAnimFrameClampVS,e+=ri.particleAnimTexVS},createShaderDefinition:function(t,e){var i="",n=ui(t)+"\n";n+="#define PARTICLE\n",t.webgl2&&(i+="#define GL2\n",n+="#define GL2\n"),i+="#define VERTEXSHADER\n",e.mesh&&(i+="#define USE_MESH\n"),e.localSpace&&(i+="#define LOCAL_SPACE\n"),e.screenSpace&&(i+="#define SCREEN_SPACE\n"),e.animTex&&(i+="\nuniform vec2 animTexTilesParams;\n"),e.animTex&&(i+="\nuniform vec4 animTexParams;\n"),e.animTex&&(i+="\nuniform vec2 animTexIndexParams;\n"),2===e.normal&&(i+="\nvarying mat3 ParticleMat;\n"),1===e.normal&&(i+="\nvarying vec3 Normal;\n"),e.soft&&(i+="\nvarying float vDepth;\n");var s=e.customFace?ri.particle_customFaceVS:ri.particle_billboardVS;return e.useCpu?(e.soft>0&&(i+=ri.screenDepthPS),i+=ri.particle_cpuVS,e.localSpace&&(i+=ri.particle_localShiftVS),e.animTex&&(i+=this._animTex(e)),e.alignToMotion&&(i+=ri.particle_pointAlongVS),i+=e.mesh?ri.particle_meshVS:s,1===e.normal&&(i+=ri.particle_normalVS),2===e.normal&&(i+=ri.particle_TBNVS),e.stretch>0&&(i+=ri.particle_stretchVS),i+=ri.particle_cpu_endVS,e.soft>0&&(i+=ri.particle_softVS)):(i+=ri.particle_initVS,i+=e.pack8?ri.particleInputRgba8PS:ri.particleInputFloatPS,e.soft>0&&(i+=ri.screenDepthPS),i+=ri.particleVS,e.localSpace&&(i+=ri.particle_localShiftVS),e.animTex&&(i+=this._animTex(e)),e.wrap&&(i+=ri.particle_wrapVS),e.alignToMotion&&(i+=ri.particle_pointAlongVS),i+=e.mesh?ri.particle_meshVS:s,1===e.normal&&(i+=ri.particle_normalVS),2===e.normal&&(i+=ri.particle_TBNVS),e.stretch>0&&(i+=ri.particle_stretchVS),i+=ri.particle_endVS,e.soft>0&&(i+=ri.particle_softVS)),i+="}\n",e.normal>0&&(1===e.normal?n+="\nvarying vec3 Normal;\n":2===e.normal&&(n+="\nvarying mat3 ParticleMat;\n"),n+="\nuniform vec3 lightCube[6];\n"),e.soft&&(n+="\nvarying float vDepth;\n"),0===e.normal&&"none"===e.fog&&(e.srgb=!1),n+=oi(e.gamma),n+=hi(e.toneMap),"linear"===e.fog?n+=ri.fogLinearPS:"exp"===e.fog?n+=ri.fogExpPS:"exp2"===e.fog?n+=ri.fogExp2PS:n+=ri.fogNonePS,2===e.normal&&(n+="\nuniform sampler2D normalMap;\n"),e.soft>0&&(n+=ri.screenDepthPS),n+=ri.particlePS,e.soft>0&&(n+=ri.particle_softPS),1===e.normal&&(n+="\nvec3 normal = Normal;\n"),2===e.normal&&(n+=ri.particle_normalMapPS),e.normal>0&&(n+=e.halflambert?ri.particle_halflambertPS:ri.particle_lambertPS),e.normal>0&&(n+=ri.particle_lightingPS),2===e.blend?n+=ri.particle_blendNormalPS:1===e.blend?n+=ri.particle_blendAddPS:5===e.blend&&(n+=ri.particle_blendMultiplyPS),n+=ri.particle_endPS,{attributes:gi(i),vshader:i,fshader:n}}},Mi={generateKey:function(t){return"cubemap"===t.type?"skybox-"+t.type+"-"+t.rgbm+"-"+t.hdr+"-"+t.fixSeams+"-"+t.toneMapping+"-"+t.gamma+"-"+t.useIntensity+"-"+t.mip:"skybox-"+t.type+"-"+t.encoding+"-"+t.useIntensity+"-"+t.gamma+"-"+t.toneMapping},createShaderDefinition:function(t,e){var i;if("cubemap"===e.type){i=ui(t),i+=e.mip?ri.fixCubemapSeamsStretchPS:ri.fixCubemapSeamsNonePS,i+=e.useIntensity?ri.envMultiplyPS:ri.envConstPS,i+=oi(e.gamma),i+=hi(e.toneMapping),i+=ri.decodePS,i+=ri.rgbmPS,i+=ri.skyboxHDRPS.replace(/\$textureCubeSAMPLE/g,e.rgbm?"textureCubeRGBM":e.hdr?"textureCube":"textureCubeSRGB").replace(/\$FIXCONST/g,1-1/[128,64,16,8,4,2][e.mip]+"")}else{i=ui(t),i+=e.useIntensity?ri.envMultiplyPS:ri.envConstPS,i+=oi(e.gamma),i+=hi(e.toneMapping),i+=ri.decodePS,i+=ri.skyboxEnvPS.replace(/\$DECODE/g,{rgbm:"decodeRGBM",rgbe:"decodeRGBE",linear:"decodeLinear"}[e.encoding]||"decodeGamma")}return{attributes:{aPosition:ae},vshader:ri.skyboxVS,fshader:i}}},Ci=1/255,Ei=new Float32Array(1),Pi=new Int32Array(Ei.buffer),Ri=function(){function t(){}return t.float2Half=function(t){Ei[0]=t;var e=Pi[0],i=e>>16&32768,n=e>>12&2047,s=e>>23&255;return s<103?i:s>142?(i|=31744,i|=(255===s?0:1)&&8388607&e):s<113?i|=((n|=2048)>>114-s)+(n>>113-s&1):(i|=s-112<<10|n>>1,i+=1&n)},t.float2Bytes=function(t,e,i,n){var s=255*t%1;if(e[i+0]=Math.round(255*(t%1-Ci*s)),n>1){var a=65025*t%1;if(e[i+1]=Math.round(255*(s-Ci*a)),n>2){var r=16581375*t%1;e[i+2]=Math.round(255*(a-Ci*r)),n>3&&(e[i+3]=Math.round(255*r))}}},t.float2BytesRange=function(e,i,n,s,a,r){e=it.clamp((e-s)/(a-s),0,1),t.float2Bytes(e,i,n,r)},t.float2MantissaExponent=function(e,i,n,s){var a=Math.floor(Math.log2(Math.abs(e)))+1;e/=Math.pow(2,a),t.float2BytesRange(e,i,n,-1,1,s-1),i[n+s-1]=Math.round(a+127)},t}(),Ii=null,Li=null,Di=function(){function t(t,e){this.device=t,this.name=null,this._width=4,this._height=4,this._depth=1,this._format=7,this.type=Be,this.projection=Ve,this._cubemap=!1,this._volume=!1,this.fixCubemapSeams=!1,this._flipY=!1,this._premultiplyAlpha=!1,this._isRenderTarget=!1,this._mipmaps=!0,this._minFilter=5,this._magFilter=1,this._anisotropy=1,this._addressU=0,this._addressV=0,this._addressW=0,this._compareOnRead=!1,this._compareFunc=1,void 0!==e&&(void 0!==e.name&&(this.name=e.name),this._width=void 0!==e.width?e.width:this._width,this._height=void 0!==e.height?e.height:this._height,this._format=void 0!==e.format?e.format:this._format,e.hasOwnProperty("type")?this.type=e.type:e.hasOwnProperty("rgbm")?this.type=e.rgbm?Ne:Be:e.hasOwnProperty("swizzleGGGR")&&(this.type=e.swizzleGGGR?ze:Be),void 0!==e.mipmaps?this._mipmaps=e.mipmaps:this._mipmaps=void 0!==e.autoMipmap?e.autoMipmap:this._mipmaps,this._levels=e.levels,this._cubemap=void 0!==e.cubemap?e.cubemap:this._cubemap,this.fixCubemapSeams=void 0!==e.fixCubemapSeams?e.fixCubemapSeams:this.fixCubemapSeams,this._cubemap?this.projection=We:e.projection&&e.projection!==We&&(this.projection=e.projection),this._minFilter=void 0!==e.minFilter?e.minFilter:this._minFilter,this._magFilter=void 0!==e.magFilter?e.magFilter:this._magFilter,this._anisotropy=void 0!==e.anisotropy?e.anisotropy:this._anisotropy,this._addressU=void 0!==e.addressU?e.addressU:this._addressU,this._addressV=void 0!==e.addressV?e.addressV:this._addressV,this._compareOnRead=void 0!==e.compareOnRead?e.compareOnRead:this._compareOnRead,this._compareFunc=void 0!==e._compareFunc?e._compareFunc:this._compareFunc,this._flipY=void 0!==e.flipY?e.flipY:this._flipY,this._premultiplyAlpha=void 0!==e.premultiplyAlpha?e.premultiplyAlpha:this._premultiplyAlpha,t.webgl2&&(this._depth=void 0!==e.depth?e.depth:this._depth,this._volume=void 0!==e.volume?e.volume:this._volume,this._addressW=void 0!==e.addressW?e.addressW:this._addressW)),this._compressed=8===this._format||9===this._format||this._format===Kt||this._format>=ie,this._invalid=!1,this._lockedLevel=-1,this._levels||(this._levels=this._cubemap?[[null,null,null,null,null,null]]:[null]),this.dirtyAll(),this._gpuSize=0,this.impl=t.createTextureImpl(this),t.textures.push(this)}var e=t.prototype;return e.destroy=function(){if(this.device){var t=this.device,e=t.textures.indexOf(this);-1!==e&&t.textures.splice(e,1),t.scope.removeValue(this),this.impl.destroy(t),this.adjustVramSizeTracking(t._vram,-this._gpuSize),this._levels=null,this.device=null}},e.loseContext=function(){this.impl.loseContext(),this.dirtyAll()},e.adjustVramSizeTracking=function(t,e){t.tex+=e},t.calcGpuSize=function(t,e,i,n,s,a){Ii||((Ii=[])[0]=1,Ii[1]=1,Ii[2]=2,Ii[3]=2,Ii[4]=2,Ii[5]=2,Ii[6]=4,Ii[7]=4,Ii[11]=8,Ii[12]=8,Ii[13]=16,Ii[14]=16,Ii[15]=4,Ii[16]=4,Ii[17]=4,Ii[18]=4,Ii[19]=4,Ii[20]=4),Li||((Li=[])[21]=8,Li[22]=8,Li[24]=8,Li[25]=8,Li[26]=8,Li[27]=8,Li[8]=8,Li[29]=8,Li[23]=16,Li[9]=16,Li[10]=16,Li[28]=16,Li[30]=16);for(var r=Ii.hasOwnProperty(n)?Ii[n]:0,o=Li.hasOwnProperty(n)?Li[n]:0,h=0;;){if(r>0)h+=t*e*i*r;else{var l=Math.floor((t+3)/4),c=Math.floor((e+3)/4),u=Math.floor((i+3)/4);n!==ne&&n!==se||(l=Math.max(Math.floor(l/2),1)),h+=l*c*u*o}if(!s||1===t&&1===e&&1===i)break;t=Math.max(Math.floor(t/2),1),e=Math.max(Math.floor(e/2),1),i=Math.max(Math.floor(i/2),1)}return h*(a?6:1)},e.dirtyAll=function(){this._levelsUpdated=this._cubemap?[[!0,!0,!0,!0,!0,!0]]:[!0],this._needsUpload=!0,this._needsMipmapsUpload=this._mipmaps,this._mipmapsUploaded=!1,this._parameterFlags=255},e.lock=function(t){if(void 0===t&&(t={}),void 0===t.level&&(t.level=0),void 0===t.face&&(t.face=0),void 0===t.mode&&(t.mode=2),this._lockedLevel=t.level,null===this._levels[t.level])switch(this._format){case 0:case 1:this._levels[t.level]=new Uint8Array(this._width*this._height*this._depth);break;case 2:this._levels[t.level]=new Uint8Array(this._width*this._height*this._depth*2);break;case 3:case 4:case 5:this._levels[t.level]=new Uint16Array(this._width*this._height*this._depth);break;case 6:this._levels[t.level]=new Uint8Array(this._width*this._height*this._depth*3);break;case 7:this._levels[t.level]=new Uint8Array(this._width*this._height*this._depth*4);break;case 8:this._levels[t.level]=new Uint8Array(Math.floor((this._width+3)/4)*Math.floor((this._height+3)/4)*8*this._depth);break;case 9:case Kt:this._levels[t.level]=new Uint8Array(Math.floor((this._width+3)/4)*Math.floor((this._height+3)/4)*16*this._depth);break;case Zt:this._levels[t.level]=new Uint16Array(this._width*this._height*this._depth*3);break;case Qt:this._levels[t.level]=new Float32Array(this._width*this._height*this._depth*3);break;case $t:this._levels[t.level]=new Uint16Array(this._width*this._height*this._depth*4);break;case Jt:this._levels[t.level]=new Float32Array(this._width*this._height*this._depth*4)}return this._levels[t.level]},e.setSource=function(t,e){void 0===e&&(e=0);var i,n,s=!1;if(this._cubemap){if(t[0]){i=t[0].width||0,n=t[0].height||0;for(var a=0;a<6;a++){var r=t[a];if(!r||r.width!==i||r.height!==n||!this.device._isBrowserInterface(r)){s=!0;break}}}else s=!0;if(!s)for(var o=0;o<6;o++)this._levels[e][o]!==t[o]&&(this._levelsUpdated[e][o]=!0)}else this.device._isBrowserInterface(t)||(s=!0),s||(t!==this._levels[e]&&(this._levelsUpdated[e]=!0),i=t.width,n=t.height);if(s)if(this._width=4,this._height=4,this._cubemap)for(var h=0;h<6;h++)this._levels[e][h]=null,this._levelsUpdated[e][h]=!0;else this._levels[e]=null,this._levelsUpdated[e]=!0;else 0===e&&(this._width=i,this._height=n),this._levels[e]=t;this._invalid===s&&s||(this._invalid=s,this.upload())},e.getSource=function(t){return void 0===t&&(t=0),this._levels[t]},e.unlock=function(){this._lockedLevel,this.upload(),this._lockedLevel=-1},e.upload=function(){this._needsUpload=!0,this._needsMipmapsUpload=this._mipmaps},e.getDds=function(){for(var t=128,e=0;this._levels[e];){if(this.cubemap)for(var i=0;i<6;i++){if(!this._levels[e][i])return;var n=this._levels[e][i].length;if(!n)return;t+=n}else{var s=this._levels[e].length;if(!s)return;t+=s}t+=this._levels[e].length,e++}var a=new ArrayBuffer(t),r=new Uint32Array(a,0,32),o=528391;this._levels.length>1&&(o|=131072);var h=4096;this._levels.length>1&&(h|=4194304),(this._levels.length>1||this.cubemap)&&(h|=8);var l=this.cubemap?65024:0;r[0]=542327876,r[1]=124,r[2]=o,r[3]=this.height,r[4]=this.width,r[5]=this.width*this.height*4,r[6]=0,r[7]=this._levels.length;for(var c=0;c<11;c++)r[8+c]=0;r[19]=32,r[20]=65,r[21]=0,r[22]=32,r[23]=16711680,r[24]=65280,r[25]=255,r[26]=4278190080,r[27]=h,r[28]=l,r[29]=0,r[30]=0,r[31]=0;var u=128;if(this.cubemap)for(var d=0;d<6;d++)for(var f=0;f=0?t.insertChild(this,e):t.addChild(this))},i.setLocalEulerAngles=function(t,e,i){t instanceof lt?this.localRotation.setFromEulerAngles(t.x,t.y,t.z):this.localRotation.setFromEulerAngles(t,e,i),this._dirtyLocal||this._dirtifyLocal()},i.setLocalPosition=function(t,e,i){t instanceof lt?this.localPosition.copy(t):this.localPosition.set(t,e,i),this._dirtyLocal||this._dirtifyLocal()},i.setLocalRotation=function(t,e,i,n){t instanceof yt?this.localRotation.copy(t):this.localRotation.set(t,e,i,n),this._dirtyLocal||this._dirtifyLocal()},i.setLocalScale=function(t,e,i){t instanceof lt?this.localScale.copy(t):this.localScale.set(t,e,i),this._dirtyLocal||this._dirtifyLocal()},i._dirtifyLocal=function(){this._dirtyLocal||(this._dirtyLocal=!0,this._dirtyWorld||this._dirtifyWorld())},i._unfreezeParentToRoot=function(){for(var t=this._parent;t;)t._frozen=!1,t=t._parent},i._dirtifyWorld=function(){this._dirtyWorld||this._unfreezeParentToRoot(),this._dirtifyWorldInternal()},i._dirtifyWorldInternal=function(){if(!this._dirtyWorld){this._frozen=!1,this._dirtyWorld=!0;for(var t=0;t8?t.FORMAT_FLOAT:t.FORMAT_8BIT,t.initShaderDefines()},t.createTexture=function(t,e,i,n,s){return new Di(t,{name:s,width:e,height:i,mipmaps:!1,format:n,addressU:1,addressV:1,type:Be,magFilter:0,minFilter:0,anisotropy:1})};var e=t.prototype;return e.destroy=function(){this.lightsTexture8&&(this.lightsTexture8.destroy(),this.lightsTexture8=null),this.lightsTextureFloat&&(this.lightsTextureFloat.destroy(),this.lightsTextureFloat=null)},e.setCompressionRanges=function(t,e){this.invMaxColorValue=1/e,this.invMaxAttenuation=1/t},e.setBounds=function(t,e){this.boundsMin.copy(t),this.boundsDelta.copy(e)},e.uploadTextures=function(){this.lightsTextureFloat&&(this.lightsTextureFloat.lock().set(this.lightsFloat),this.lightsTextureFloat.unlock()),this.lightsTexture8.lock().set(this.lights8),this.lightsTexture8.unlock()},e.updateUniforms=function(){this._lightsTexture8Id.setValue(this.lightsTexture8),t.lightTextureFormat===t.FORMAT_FLOAT&&this._lightsTextureFloatId.setValue(this.lightsTextureFloat),this._lightsTextureInvSizeId.setValue(this._lightsTextureInvSizeData)},e.getSpotDirection=function(t,e){e._node.getWorldTransform().getY(t).mulScalar(-1),t.normalize()},e.getLightAreaSizes=function(t){var e=t._node.getWorldTransform();return e.transformVector(hn,rn),on[0]=rn.x,on[1]=rn.y,on[2]=rn.z,e.transformVector(ln,rn),on[3]=rn.x,on[4]=rn.y,on[5]=rn.z,on},e.addLightDataFlags=function(t,e,i,n,s){t[e+0]=n?255:0,t[e+1]=64*i._shape,t[e+2]=255*i._falloffMode,t[e+3]=s?255:0},e.addLightDataColor=function(t,e,i,n,s){var a=this.invMaxColorValue,r=n?i._linearFinalColor:i._finalColor;Ri.float2Bytes(r[0]*a,t,e+0,2),Ri.float2Bytes(r[1]*a,t,e+2,2),Ri.float2Bytes(r[2]*a,t,e+4,2),t[e+6]=s?255:0;var o=!!(1&i.mask),h=!!(2&i.mask);t[e+7]=o&&h?127:h?255:0},e.addLightDataSpotAngles=function(t,e,i){Ri.float2Bytes(.499999*i._innerConeAngleCos+.5,t,e+0,2),Ri.float2Bytes(.499999*i._outerConeAngleCos+.5,t,e+2,2)},e.addLightDataShadowBias=function(t,e,i){var n=i.getRenderData(null,0),s=i._getUniformBiasValues(n);Ri.float2BytesRange(s.bias,t,e,-1,20,2),Ri.float2Bytes(s.normalBias,t,e+2,2)},e.addLightDataPositionRange=function(t,e,i,n){var s=rn.sub2(n,this.boundsMin).div(this.boundsDelta);Ri.float2Bytes(s.x,t,e+0,4),Ri.float2Bytes(s.y,t,e+4,4),Ri.float2Bytes(s.z,t,e+8,4),Ri.float2Bytes(i.attenuationEnd*this.invMaxAttenuation,t,e+12,4)},e.addLightDataSpotDirection=function(t,e,i){this.getSpotDirection(rn,i),Ri.float2Bytes(.499999*rn.x+.5,t,e+0,4),Ri.float2Bytes(.499999*rn.y+.5,t,e+4,4),Ri.float2Bytes(.499999*rn.z+.5,t,e+8,4)},e.addLightDataLightProjMatrix=function(t,e,i){for(var n=i.data,s=0;s<12;s++)Ri.float2BytesRange(n[s],t,e+4*s,-2,2,4);for(var a=12;a<16;a++)Ri.float2MantissaExponent(n[a],t,e+4*a,4)},e.addLightDataCookies=function(t,e,i){var n="rgb"===i._cookieChannel;if(t[e+0]=Math.floor(255*i.cookieIntensity),t[e+1]=n?255:0,!n){var s=i._cookieChannel;t[e+4]="rrr"===s?255:0,t[e+5]="ggg"===s?255:0,t[e+6]="bbb"===s?255:0,t[e+7]="aaa"===s?255:0}},e.addLightAtlasViewport=function(t,e,i){Ri.float2Bytes(i.x,t,e+0,2),Ri.float2Bytes(i.y,t,e+2,2),Ri.float2Bytes(i.z/3,t,e+4,2)},e.addLightAreaSizes=function(t,e,i){for(var n=this.getLightAreaSizes(i),s=0;s<6;s++)Ri.float2MantissaExponent(n[s],t,e+4*s,4)},e.addLightData=function(e,i,n){var s=2===e._type,a=e.atlasViewportAllocated,r=this.cookiesEnabled&&!!e._cookie&&a,o=this.areaLightsEnabled&&0!==e.shape,h=this.shadowsEnabled&&e.castShadows&&a,l=e._node.getPosition(),c=null,u=null;s?h?c=e.getRenderData(null,0).shadowMatrix:r&&(c=an.evalSpotCookieMatrix(e)):(h||r)&&(u=e.atlasViewport);var d=this.lights8,f=i*this.lightsTexture8.width*4;if(this.addLightDataFlags(d,f+4*cn.FLAGS,e,s,h),this.addLightDataColor(d,f+4*cn.COLOR_A,e,n,r),s&&this.addLightDataSpotAngles(d,f+4*cn.SPOT_ANGLES,e),e.castShadows&&this.addLightDataShadowBias(d,f+4*cn.SHADOW_BIAS,e),r&&this.addLightDataCookies(d,f+4*cn.COOKIE_A,e),t.lightTextureFormat===t.FORMAT_FLOAT){var p=this.lightsFloat,m=i*this.lightsTextureFloat.width*4;if(p[m+4*un.POSITION_RANGE+0]=l.x,p[m+4*un.POSITION_RANGE+1]=l.y,p[m+4*un.POSITION_RANGE+2]=l.z,p[m+4*un.POSITION_RANGE+3]=e.attenuationEnd,s&&(this.getSpotDirection(rn,e),p[m+4*un.SPOT_DIRECTION+0]=rn.x,p[m+4*un.SPOT_DIRECTION+1]=rn.y,p[m+4*un.SPOT_DIRECTION+2]=rn.z),c)for(var _=c.data,g=0;g<16;g++)p[m+4*un.PROJ_MAT_0+g]=_[g];if(u&&(p[m+4*un.ATLAS_VIEWPORT+0]=u.x,p[m+4*un.ATLAS_VIEWPORT+1]=u.y,p[m+4*un.ATLAS_VIEWPORT+2]=u.z/3),o){var v=this.getLightAreaSizes(e);p[m+4*un.AREA_DATA_WIDTH+0]=v[0],p[m+4*un.AREA_DATA_WIDTH+1]=v[1],p[m+4*un.AREA_DATA_WIDTH+2]=v[2],p[m+4*un.AREA_DATA_HEIGHT+0]=v[3],p[m+4*un.AREA_DATA_HEIGHT+1]=v[4],p[m+4*un.AREA_DATA_HEIGHT+2]=v[5]}}else this.addLightDataPositionRange(d,f+4*cn.POSITION_X,e,l),s&&this.addLightDataSpotDirection(d,f+4*cn.SPOT_DIRECTION_X,e),c&&this.addLightDataLightProjMatrix(d,f+4*cn.PROJ_MAT_00,c),u&&this.addLightAtlasViewport(d,f+4*cn.ATLAS_VIEWPORT_A,u),o&&this.addLightAreaSizes(d,f+4*cn.AREA_DATA_WIDTH_X,e)},t}();dn.FORMAT_FLOAT=0,dn.FORMAT_8BIT=1,dn.lightTextureFormat=dn.FORMAT_8BIT,dn.shaderDefines="";var fn=[],pn={rgbm:"decodeRGBM",rgbe:"decodeRGBE",linear:"decodeLinear"},mn={optionsContext:{},optionsContextMin:{},generateKey:function(t){var e,i=function(t){var e=[];for(var i in t)t.hasOwnProperty(i)&&"chunks"!==i&&"lights"!==i&&e.push(i);return e.sort()};t===this.optionsContextMin?(this.propsMin||(this.propsMin=i(t)),e=this.propsMin):t===this.optionsContext?(this.props||(this.props=i(t)),e=this.props):e=i(t);for(var n="standard",s=0;s0){if(fn[t]e.length){for(var i=e,n=i.charAt(i.length-1),s=fn[t]-i.length,a=0;a1&&(a+="getShadowCascadeMatrix(light"+n+"_shadowMatrixPalette, light"+n+"_shadowCascadeDistances, light"+n+"_shadowCascadeCount);\n",e="(cascadeShadowMat, "+i+");\n"),a+=s+e,a+="fadeShadow(light"+n+"_shadowCascadeDistances);\n"},_nonPointShadowMapProjection:function(t,e,i,n,s){var a="("+i+", "+n+");\n";return!e._normalOffsetBias||e._isVsm?2===e._type?e._isPcf&&(t.webgl2||t.extStandardDerivatives)?"\t\t\t getShadowCoordPerspZbuffer"+a:"\t\t\t getShadowCoordPersp"+a:this._directionalShadowMapProjection(e,a,n,s,"getShadowCoordOrtho"):2===e._type?e._isPcf&&(t.webgl2||t.extStandardDerivatives)?"\t\t\t getShadowCoordPerspZbufferNormalOffset"+a:"\t\t\t getShadowCoordPerspNormalOffset"+a:this._directionalShadowMapProjection(e,a,n,s,"getShadowCoordOrthoNormalOffset")},_addVaryingIfNeeded:function(t,e,i){return t.indexOf(i)>=0?"varying "+e+" "+i+";\n":""},_getLightSourceShapeString:function(t){switch(t){case 1:return"Rect";case 2:return"Disk";case 3:return"Sphere";default:return""}},_getPassDefineString:function(t){return t===Nt?"#define PICK_PASS\n":2===t?"#define DEPTH_PASS\n":t>=3&&t<=17?"#define SHADOW_PASS\n":""},_vsAddTransformCode:function(t,e,i,n){return t+=i.transformVS},_vsAddBaseCode:function(t,e,i,n){return t+=i.baseVS,1!==n.nineSlicedMode&&2!==n.nineSlicedMode||(t+=i.baseNineSlicedVS),t},_fsAddBaseCode:function(t,e,i,n){return t+=i.basePS,1===n.nineSlicedMode?t+=i.baseNineSlicedPS:2===n.nineSlicedMode&&(t+=i.baseNineSlicedTiledPS),t},_decodeFunc:function(t){return pn[t]||"decodeGamma"},_fsAddStartCode:function(t,e,i,n){return t+=i.startPS,1===n.nineSlicedMode?t+=i.startNineSlicedPS:2===n.nineSlicedMode&&(t+=i.startNineSlicedTiledPS),t},_buildShadowPassFragmentCode:function(t,e,i,n,s){var a=n.pass-3,r=Math.floor(a/6),o=a-6*r;return e.extStandardDerivatives&&!e.webgl2&&(t+="uniform vec2 polygonOffset;\n"),3===o?e.textureFloatHighPrecision?t+="#define VSM_EXPONENT 15.0\n\n":t+="#define VSM_EXPONENT 5.54\n\n":2===o&&(t+="#define VSM_EXPONENT 5.54\n\n"),0!==r&&(t+="uniform vec3 view_position;\n",t+="uniform float light_radius;\n"),t+=s,n.alphaTest&&(t+="float dAlpha;\n",t+=this._addMap("opacity","opacityPS",n,i),t+=i.alphaTestPS),0!==o||e.webgl2&&1!==r?1===o&&(t+="vec2 encodeFloatRG( float v ) {\n",t+="\t\tvec2 enc = vec2(1.0, 255.0) * v;\n",t+="\t\tenc = fract(enc);\n",t+="\t\tenc -= enc.yy * vec2(1.0/255.0, 1.0/255.0);\n",t+="\t\treturn enc;\n",t+="}\n\n"):t+=i.packDepthPS,t+="void main(void)\n{\n",n.alphaTest&&(t+="\t getOpacity();\n",t+="\t alphaTest(dAlpha);\n"),t+=1===r||(1===o||2===o||3===o)&&0!==r?"\t float depth = min(distance(view_position, vPositionW) / light_radius, 0.99999);\n":"\t float depth = gl_FragCoord.z;\n",0!==o||e.webgl2&&(1!==r||n.clusteredLightingEnabled)?0===o||4===o?(t+="\t gl_FragColor = vec4(1.0);\n",n.clusteredLightingEnabled&&1===r&&e.webgl2&&(t+="\t gl_FragDepth = depth;\n")):t+=1===o?"\t gl_FragColor = vec4(encodeFloatRG(depth), encodeFloatRG(depth*depth));\n":i.storeEVSMPS:e.extStandardDerivatives&&!e.webgl2?(t+="\t float minValue = 2.3374370500153186e-10; //(1.0 / 255.0) / (256.0 * 256.0 * 256.0);\n",t+="\t depth += polygonOffset.x * max(abs(dFdx(depth)), abs(dFdy(depth))) + minValue * polygonOffset.y;\n",t+="\t gl_FragColor = packFloat(depth);\n"):t+="\t gl_FragColor = packFloat(depth);\n",t+="}\n"},createShaderDefinition:function(t,e){var i=e.lights.length>0;e.dirLightMap&&(i=!0),e.clusteredLightingEnabled&&(i=!0),0===e.shadingModel?(e.fresnelModel=0,e.specularAntialias=!1,e.ambientSH=!1):e.fresnelModel=0===e.fresnelModel?2:e.fresnelModel;var n=!!e.reflectionSource;e.useSpecular||(e.specularMap=e.glossMap=null);var s=e.pass>=3&&e.pass<=17,a=i||n||e.ambientSH||e.heightMap||e.enableGGXSpecular||e.clusteredLightingEnabled&&!s||e.clearCoatNormalMap;this.options=e;var r,o,h="",l="",c="",u=ri,d={vertex_position:ae};if(e.chunks){var f={};for(var p in u)u.hasOwnProperty(p)&&(e.chunks[p]?((o=e.chunks[p]).indexOf("vertex_normal")>=0&&(d.vertex_normal=re),o.indexOf("vertex_tangent")>=0&&(d.vertex_tangent=oe),o.indexOf("vertex_texCoord0")>=0&&(d.vertex_texCoord0=de),o.indexOf("vertex_texCoord1")>=0&&(d.vertex_texCoord1=fe),o.indexOf("vertex_color")>=0&&(d.vertex_color=ce),o.indexOf("vertex_boneWeights")>=0&&(d.vertex_boneWeights=he),o.indexOf("vertex_boneIndices")>=0&&(d.vertex_boneIndices=le),f[p]=o):f[p]=u[p]);u=f}h+=this._getPassDefineString(e.pass),h=this._vsAddBaseCode(h,t,u,e),l+="\t vPositionW\t\t= getWorldPosition();\n",2===e.pass&&(h+="varying float vDepth;\n",h+="#ifndef VIEWMATRIX\n",h+="#define VIEWMATRIX\n",h+="uniform mat4 matrix_view;\n",h+="#endif\n",h+="#ifndef CAMERAPLANES\n",h+="#define CAMERAPLANES\n",h+="uniform vec4 camera_params;\n\n",h+="#endif\n",l+="\t\tvDepth = -(matrix_view * vec4(vPositionW,1.0)).z * camera_params.x;\n"),e.useInstancing&&(d.instance_line1=De,d.instance_line2=ke,d.instance_line3=Oe,d.instance_line4=Fe,h+=u.instancingVS),a&&(d.vertex_normal=re,l+="\t vNormalW = getNormal();\n","sphereMap"===e.reflectionSource&&t.fragmentUniformsCount<=16&&(h+=u.viewNormalVS,l+="\t vNormalV\t\t= getViewNormal();\n"),(e.heightMap||e.normalMap||e.enableGGXSpecular)&&e.hasTangents?(d.vertex_tangent=oe,h+=u.tangentBinormalVS,l+="\t vTangentW\t = getTangent();\n",l+="\t vBinormalW\t= getBinormal();\n"):e.enableGGXSpecular&&(h+=u.tangentBinormalVS,l+="\t vObjectSpaceUpW\t= getObjectSpaceUp();\n"));var m=[],_=[];for(var g in fn){var v=g+"Map";if(e[g+"VertexColor"]){var y=g+"VertexColorChannel";e[y]=this._correctChannel(g,e[y])}if(e[v]){var x=v+"Channel",b=v+"Transform",S=v+"Uv";e[S]=Math.min(e[S],1),e[x]=this._correctChannel(g,e[x]);var w=e[S];m[w]=!0,_[w]=_[w]||e[v]&&!e[b]}}e.forceUv1&&(m[1]=!0,_[1]=void 0===_[1]||_[1]);for(var T=0;T<2;T++)m[T]&&(d["vertex_texCoord"+T]="TEXCOORD"+T,h+=u["uv"+T+"VS"],l+="\t vec2 uv"+T+" = getUv"+T+"();\n"),_[T]&&(l+="\t vUv"+T+" = uv"+T+";\n");var A=[h,c,l,[]];for(var M in fn){var C=M+"Map";if(e[C]){var E=C+"Transform";if(e[E]){var P=C+"Uv";this._setMapTransform(A,M,e[E],e[P])}}}h=A[0],c=A[1],l=A[2],e.vertexColors&&(d.vertex_color=ce,l+="\t vVertexColor = vertex_color;\n"),(e.useMorphPosition||e.useMorphNormal)&&(e.useMorphTextureBased?(h+="#define MORPHING_TEXTURE_BASED\n",e.useMorphPosition&&(h+="#define MORPHING_TEXTURE_BASED_POSITION\n"),e.useMorphNormal&&(h+="#define MORPHING_TEXTURE_BASED_NORMAL\n"),d.morph_vertex_id=Fe,h+="attribute float morph_vertex_id;\n"):(h+="#define MORPHING\n",e.useMorphPosition?(d.morph_pos0=Pe,d.morph_pos1=Re,d.morph_pos2=Ie,d.morph_pos3=Le,h+="#define MORPHING_POS03\n",h+="attribute vec3 morph_pos0;\n",h+="attribute vec3 morph_pos1;\n",h+="attribute vec3 morph_pos2;\n",h+="attribute vec3 morph_pos3;\n"):e.useMorphNormal&&(d.morph_nrm0=Pe,d.morph_nrm1=Re,d.morph_nrm2=Ie,d.morph_nrm3=Le,h+="#define MORPHING_NRM03\n",h+="attribute vec3 morph_nrm0;\n",h+="attribute vec3 morph_nrm1;\n",h+="attribute vec3 morph_nrm2;\n",h+="attribute vec3 morph_nrm3;\n"),e.useMorphNormal?(d.morph_nrm4=De,d.morph_nrm5=ke,d.morph_nrm6=Oe,d.morph_nrm7=Fe,h+="#define MORPHING_NRM47\n",h+="attribute vec3 morph_nrm4;\n",h+="attribute vec3 morph_nrm5;\n",h+="attribute vec3 morph_nrm6;\n",h+="attribute vec3 morph_nrm7;\n"):(d.morph_pos4=De,d.morph_pos5=ke,d.morph_pos6=Oe,d.morph_pos7=Fe,h+="#define MORPHING_POS47\n",h+="attribute vec3 morph_pos4;\n",h+="attribute vec3 morph_pos5;\n",h+="attribute vec3 morph_pos6;\n",h+="attribute vec3 morph_pos7;\n"))),e.skin?(d.vertex_boneWeights=he,d.vertex_boneIndices=le,h+=ci(t,u),h+="#define SKIN\n"):e.useInstancing&&(h+="#define INSTANCING\n"),e.screenSpace&&(h+="#define SCREENSPACE\n"),e.pixelSnap&&(h+="#define PIXELSNAP\n"),h=this._vsAddTransformCode(h,t,u,e),a&&(h+=u.normalVS),h+="\n",h+=u.startVS,h+=l,h+=u.endVS;var R=h+="}",I=c;c="",c+=this._addVaryingIfNeeded(h,"vec4","vVertexColor"),c+=this._addVaryingIfNeeded(h,"vec3","vPositionW"),c+=this._addVaryingIfNeeded(h,"vec3","vNormalV"),c+=this._addVaryingIfNeeded(h,"vec3","vNormalW"),c+=this._addVaryingIfNeeded(h,"vec3","vTangentW"),c+=this._addVaryingIfNeeded(h,"vec3","vBinormalW"),c+=this._addVaryingIfNeeded(h,"vec3","vObjectSpaceUpW"),c+=this._addVaryingIfNeeded(h,"vec2","vUv0"),c+=this._addVaryingIfNeeded(h,"vec2","vUv1"),R=(c+=I)+R;var L="";if(t.webgl2?(L=di(t),u.extensionVS&&(L+=u.extensionVS+"\n"),R=L+u.gles3VS+R):(u.extensionVS&&(L=u.extensionVS+"\n"),R=L+R),e.forceFragmentPrecision&&"highp"!==e.forceFragmentPrecision&&"mediump"!==e.forceFragmentPrecision&&"lowp"!==e.forceFragmentPrecision&&(e.forceFragmentPrecision=null),e.forceFragmentPrecision&&("highp"===e.forceFragmentPrecision&&"highp"!==t.maxPrecision&&(e.forceFragmentPrecision="mediump"),"mediump"===e.forceFragmentPrecision&&"lowp"===t.maxPrecision&&(e.forceFragmentPrecision="lowp")),h="",t.webgl2&&(h+=di(t)),t.webgl2||(t.extStandardDerivatives&&(h+="#extension GL_OES_standard_derivatives : enable\n"),t.extTextureLod&&(h+="#extension GL_EXT_shader_texture_lod : enable\n",h+="#define SUPPORTS_TEXLOD\n")),u.extensionPS&&(h+=u.extensionPS+"\n"),t.webgl2&&(h+=u.gles3PS),h+=e.forceFragmentPrecision?"precision "+e.forceFragmentPrecision+" float;\n\n":ui(t),h+=this._getPassDefineString(e.pass),e.pass===Nt)return h+="uniform vec4 uColor;\n",h+=c,e.alphaTest&&(h+="float dAlpha;\n",h+=this._addMap("opacity","opacityPS",e,u),h+=u.alphaTestPS),h+="void main(void)\n{\n",e.alphaTest&&(h+="\t getOpacity();\n",h+="\t alphaTest(dAlpha);\n"),h+="\t\tgl_FragColor = uColor;\n",{attributes:d,vshader:R,fshader:h+="}\n"};if(2===e.pass)return h+="varying float vDepth;\n",h+=c,h+=u.packDepthPS,e.alphaTest&&(h+="float dAlpha;\n",h+=this._addMap("opacity","opacityPS",e,u),h+=u.alphaTestPS),h+="void main(void)\n{\n",e.alphaTest&&(h+="\t getOpacity();\n",h+="\t alphaTest(dAlpha);\n"),h+="\t\tgl_FragColor = packFloat(vDepth);\n",{attributes:d,vshader:R,fshader:h+="}\n"};if(s)return{attributes:d,vshader:R,fshader:this._buildShadowPassFragmentCode(h,t,u,e,c)};if(e.customFragmentShader)return{attributes:d,vshader:R,fshader:h+e.customFragmentShader,tag:1};h+=c,h=this._fsAddBaseCode(h,t,u,e),e.detailModes&&(h+=u.detailModesPS);var D=h;h="",e.clearCoat>0&&(h+="#define CLEARCOAT\n",h+="#define CLUSTER_CLEAR_COAT\n"),!1===e.opacityFadesSpecular&&(h+="uniform float material_alphaFade;\n");var k,O=0,F=[],B=!1,N=!1,U=!1,z=e.lights.some((function(t){return t._shape&&0!==t._shape}));e.clusteredLightingEnabled&&e.clusteredLightingAreaLightsEnabled&&(z=!0),7===t.areaLightLutFormat?(h+="#define AREA_R8_G8_B8_A8_LUTS\n",h+="#define AREA_LUTS_PRECISION lowp\n"):h+="#define AREA_LUTS_PRECISION highp\n",(z||e.clusteredLightingEnabled)&&(h+="#define AREA_LIGHTS\n",h+="uniform AREA_LUTS_PRECISION sampler2D areaLightsLutTex1;\n",h+="uniform AREA_LUTS_PRECISION sampler2D areaLightsLutTex2;\n");for(var V=0;V0?u.cubeMapProjectBoxPS:u.cubeMapProjectNonePS,h+=e.skyboxIntensity?u.envMultiplyPS:u.envConstPS),e.diffuseDetail&&(h+=this._addMap("diffuseDetail","diffuseDetailMapPS",e,u)),h+=this._addMap("diffuse","diffusePS",e,u),(3!==e.blendType||e.alphaTest||e.alphaToCoverage)&&(h+=this._addMap("opacity","opacityPS",e,u)),h+=this._addMap("emissive","emissivePS",e,u,e.emissiveFormat),i&&e.useSpecular||n){e.specularAntialias&&e.normalMap?e.normalizeNormalMap&&a?h+=u.specularAaToksvigPS:h+=u.specularAaToksvigFastPS:h+=u.specularAaNonePS;var j=e.useMetalness?"metalness":"specular";h+=this._addMap(j,j+"PS",e,u),h+=this._addMap("gloss","glossPS",e,u),2===e.fresnelModel&&(h+=u.fresnelSchlickPS)}if(e.clearCoat>0&&(h+=this._addMap("clearCoat","clearCoatPS",e,u),h+=this._addMap("clearCoatGloss","clearCoatGlossPS",e,u),h+=this._addMap("clearCoatNormal","clearCoatNormalPS",e,u)),e.heightMap){if(!e.normalMap){var Y=this._getUvSourceExpression("heightMapTransform","heightMapUv",e);e.hasTangents||(k=k.replace(/\$UV/g,Y)),h+=k}h+=this._addMap("height","parallaxPS",e,u)}var K=e.aoMap||e.aoVertexColor;if(K&&(h+=this._addMap("ao","aoPS",e,u),e.occludeSpecular&&(1===e.occludeSpecular?h+=e.occludeSpecularFloat?u.aoSpecOccSimplePS:u.aoSpecOccConstSimplePS:h+=e.occludeSpecularFloat?u.aoSpecOccPS:u.aoSpecOccConstPS)),"envAtlas"===e.reflectionSource)h+=u.reflectionEnvPS.replace(/\$DECODE/g,this._decodeFunc(e.reflectionEncoding));else if("cubeMap"===e.reflectionSource)h+=e.fixSeams?u.fixCubemapSeamsStretchPS:u.fixCubemapSeamsNonePS,h+=u.reflectionCubePS.replace(/\$DECODE/g,this._decodeFunc(e.reflectionEncoding));else if("sphereMap"===e.reflectionSource){h+=(t.fragmentUniformsCount>16?u.reflectionSpherePS:u.reflectionSphereLowPS).replace(/\$DECODE/g,this._decodeFunc(e.reflectionEncoding))}n&&(e.clearCoat>0&&(h+=u.reflectionCCPS),e.refraction&&(h+=u.refractionPS)),e.clusteredLightingEnabled&&(h+=u.clusteredLightUtilsPS,h+=u.clusteredLightCookiesPS,F[0]=!0,F[4]=!0,U=!0),(O>0||e.clusteredLightingEnabled)&&(B&&(h+=u.shadowCascadesPS),F[0]&&(h+=u.shadowStandardPS),F[4]&&t.webgl2&&(h+=u.shadowStandardGL2PS),N&&(h+=u.shadowVSM_commonPS,F[1]&&(h+=u.shadowVSM8PS),F[2]&&(h+=t.extTextureHalfFloatLinear?u.shadowEVSMPS.replace(/\$/g,"16"):u.shadowEVSMnPS.replace(/\$/g,"16")),F[3]&&(h+=t.extTextureFloatLinear?u.shadowEVSMPS.replace(/\$/g,"32"):u.shadowEVSMnPS.replace(/\$/g,"32"))),t.webgl2||t.extStandardDerivatives||(h+=u.biasConstPS),h+=u.shadowCoordPS+u.shadowCommonPS,U&&(h+=u.shadowCoordPerspZbufferPS)),e.enableGGXSpecular&&(h+="uniform float material_anisotropy;\n"),i&&(h+=u.lightDiffuseLambertPS,(z||e.clusteredLightingEnabled)&&(h+=u.ltc)),h+="\n";var Z=!1;e.useSpecular?(h+="#define CLUSTER_SPECULAR\n",e.conserveEnergy&&(h+="#define CLUSTER_CONSERVE_ENERGY\n"),i&&(h+=0===e.shadingModel?u.lightSpecularPhongPS:e.enableGGXSpecular?u.lightSpecularAnisoGGXPS:u.lightSpecularBlinnPS),e.fresnelModel>0?e.conserveEnergy&&!z?h+=u.combineDiffuseSpecularPS:h+=u.combineDiffuseSpecularNoConservePS:n?h+=u.combineDiffuseSpecularOldPS:e.diffuseMap?h+=u.combineDiffuseSpecularNoReflPS:(h+=u.combineDiffuseSpecularNoReflSeparateAmbientPS,Z=!0)):h+=u.combineDiffusePS,e.clearCoat>0&&(h+=u.combineClearCoatPS);var $=!0;if(e.lightMap||e.lightVertexColor){var Q=e.dirLightMap&&e.useSpecular?"lightmapDirPS":"lightmapSinglePS";h+=this._addMap("light",Q,e,u,e.lightMapFormat),$=e.lightMapWithoutAmbient}$&&("ambientSH"===e.ambientSource?h+=u.ambientSHPS:"envAtlas"===e.ambientSource?h+=u.ambientEnvPS.replace(/\$DECODE/g,this._decodeFunc(e.ambientEncoding)):h+=u.ambientConstantPS),e.ambientTint&&!Z&&(h+="uniform vec3 material_ambient;\n"),e.alphaTest&&(h+=u.alphaTestPS),e.msdf&&(h+=u.msdfPS),a&&(h+=u.viewDirPS,e.useSpecular&&(h+=e.enableGGXSpecular?u.reflDirAnisoPS:u.reflDirPS));var J,tt=!1,et=!1,it=!1,nt=!1,st=!1;e.clusteredLightingEnabled&&i&&(nt=!0,tt=!0,et=!0,st=!0,h+=u.floatUnpackingPS,e.lightMaskDynamic&&(h+="\n#define CLUSTER_MESH_DYNAMIC_LIGHTS"),e.clusteredLightingCookiesEnabled&&(h+="\n#define CLUSTER_COOKIES"),e.clusteredLightingShadowsEnabled&&!e.noShadow&&(h+="\n#define CLUSTER_SHADOWS",h+="\n#define CLUSTER_SHADOW_TYPE_"+It[e.clusteredLightingShadowType]),e.clusteredLightingAreaLightsEnabled&&(h+="\n#define CLUSTER_AREALIGHTS"),h+=dn.shaderDefines,h+=u.clusteredLightShadowsPS,h+=u.clusteredLightPS),e.twoSidedLighting&&(h+="uniform float twoSidedLightingNegScaleFactor;\n"),h=this._fsAddStartCode(h,t,u,e),a&&(e.hasTangents||!t.extStandardDerivatives||e.fastTbn?e.twoSidedLighting?h+="\t dVertexNormalW = gl_FrontFacing ? vNormalW * twoSidedLightingNegScaleFactor : -vNormalW * twoSidedLightingNegScaleFactor;\n":h+="\t dVertexNormalW = vNormalW;\n":e.twoSidedLighting?h+="\t dVertexNormalW = normalize(gl_FrontFacing ? vNormalW * twoSidedLightingNegScaleFactor : -vNormalW * twoSidedLightingNegScaleFactor);\n":h+="\t dVertexNormalW = normalize(vNormalW);\n",(e.heightMap||e.normalMap)&&e.hasTangents&&(e.twoSidedLighting?(h+="\t dTangentW = gl_FrontFacing ? vTangentW * twoSidedLightingNegScaleFactor : -vTangentW * twoSidedLightingNegScaleFactor;\n",h+="\t dBinormalW = gl_FrontFacing ? vBinormalW * twoSidedLightingNegScaleFactor : -vBinormalW * twoSidedLightingNegScaleFactor;\n"):(h+="\t dTangentW = vTangentW;\n",h+="\t dBinormalW = vBinormalW;\n")));var at=!1;3!==e.blendType||e.alphaTest||e.alphaToCoverage?e.heightMap&&e.opacityMap?at=!0:(h+="\t getOpacity();\n",e.alphaTest&&(h+="\t alphaTest(dAlpha);\n")):h+="\t dAlpha = 1.0;\n";var rt=!1;if(a&&(h+="\t getViewDir();\n",(e.heightMap||e.normalMap||e.clearCoatNormalMap||e.enableGGXSpecular)&&(h+="\t getTBN();\n"),e.heightMap&&(h+="\t getParallax();\n"),at&&(h+="\t getOpacity();\n",e.alphaTest&&(h+="\t alphaTest(dAlpha);\n")),h+="\t getNormal();\n",e.useSpecular&&(i&&e.enableGGXSpecular&&(h+="\t getGlossiness();\n",rt=!0),h+="\t getReflDir();\n")),h+="\t getAlbedo();\n",e.clearCoat>0&&(h+="\t getClearCoat();\n",h+="\t getClearCoatGlossiness();\n",h+="\t getClearCoatNormal();\n"),(i&&e.useSpecular||n)&&(h+="\t getSpecularity();\n",rt||(h+="\t getGlossiness();\n"),z&&(h+="\t #ifdef AREA_LIGHTS\n",h+="\t dSpecularityNoFres = dSpecularity;\n",h+="\t #ifdef CLEARCOAT\n",h+="\t ccSpecularityNoFres = ccSpecularity;\n",h+="\t #endif\n",h+="\t #endif\n"),e.fresnelModel>0&&(h+="\t getFresnel();\n")),$&&(h+="\t addAmbient();\n",e.separateAmbient&&(h+="\n\t\t\t\t\t\t\t\t\t\tvec3 dAmbientLight = dDiffuseLight;\n\t\t\t\t\t\t\t\t\t\tdDiffuseLight = vec3(0);\n\t\t\t\t\t\t\t\t")),e.ambientTint&&!Z&&(h+="\t dDiffuseLight *= material_ambient;\n"),K&&!e.occludeDirect&&(h+="\t\tapplyAO();\n"),(e.lightMap||e.lightVertexColor)&&(h+="\t addLightMap();\n"),i||n){n&&(e.clearCoat>0&&(h+="\t addReflectionCC();\n"),h+="\t addReflection();\n"),z&&(h+="\t ccReflection.rgb *= ccSpecularity;\n",h+="\t dReflection.rgb *= dSpecularity;\n",h+="\t dSpecularLight *= dSpecularity;\n",h+="\t float roughness = max((1.0 - dGlossiness) * (1.0 - dGlossiness), 0.001);\n",h+="\t calcLTCLightValues();\n");for(var ot=0;ot 0.00001) {\n",2===lt&&(J&&!ht._cookieFalloff||(h+="\t\t\t dAtten *= getSpotEffect(light"+ot+"_direction, light"+ot+"_innerConeAngle, light"+ot+"_outerConeAngle);\n",nt=!0))),h+=0!==ct?0===lt?"\t\t\t dAttenD = getLightDiffuse();\n":"\t\t\t dAttenD = get"+ut+"LightDiffuse() * 16.0;\n":"\t\t\t dAtten *= getLightDiffuse();\n",ht.castShadows&&!e.noShadow){var dt=null,ft=void 0;if(1===ht._shadowType?(dt="VSM8",ft="0.0"):2===ht._shadowType?(dt="VSM16",ft="5.54"):3===ht._shadowType?(dt="VSM32",ft=t.textureFloatHighPrecision?"15.0":"5.54"):dt=4===ht._shadowType?"PCF5x5":"PCF3x3",null!==dt)if(1===lt)r="(light"+ot+"_shadowMap, light"+ot+"_shadowParams);\n",ht._normalOffsetBias&&(h+="\t\t\t normalOffsetPointShadow(light"+ot+"_shadowParams);\n"),h+="\t\t\t dAtten *= getShadowPoint"+dt+r;else{var pt="light"+ot+"_shadowMatrix",mt="light"+ot+"_shadowParams";h+=this._nonPointShadowMapProjection(t,e.lights[ot],pt,mt,ot),2===lt&&(dt="Spot"+dt),h+="\t\t\t dAtten *= getShadow"+dt+"(light"+ot+"_shadowMap, light"+ot+"_shadowParams"+(ht._isVsm?", "+ft:"")+");\n"}}0!==ct?e.conserveEnergy&&e.useSpecular?h+="\t\t\t dDiffuseLight += mix((dAttenD * dAtten) * light"+ot+"_color"+(J?" * dAtten3":"")+", vec3(0), dLTCSpecFres);\n":h+="\t\t\t dDiffuseLight += (dAttenD * dAtten) * light"+ot+"_color"+(J?" * dAtten3":"")+";\n":z&&e.conserveEnergy&&e.useSpecular?h+="\t\t\t dDiffuseLight += mix(dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+", vec3(0), dSpecularity);\n":h+="\t\t\t dDiffuseLight += dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n",0!==ct?(e.clearCoat>0&&(h+="\t\t\t ccSpecularLight += ccLTCSpecFres * get"+ut+"LightSpecularCC() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n"),e.useSpecular&&(h+="\t\t\t dSpecularLight += dLTCSpecFres * get"+ut+"LightSpecular() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n")):z?(e.clearCoat>0&&(h+="\t\t\t ccSpecularLight += ccSpecularity * getLightSpecularCC() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n"),e.useSpecular&&(h+="\t\t\t dSpecularLight += dSpecularity * getLightSpecular() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n")):(e.clearCoat>0&&(h+="\t\t\t ccSpecularLight += getLightSpecularCC() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n"),e.useSpecular&&(h+="\t\t\t dSpecularLight += getLightSpecular() * dAtten * light"+ot+"_color"+(J?" * dAtten3":"")+";\n")),0!==lt&&(h+="\t }\n"),h+="\n"}}e.clusteredLightingEnabled&&i&&(et=!0,it=!0,tt=!0,h+="\t addClusteredLights();\n"),z&&(e.clearCoat>0&&(h+="\t ccSpecularity = 1.0;\n"),e.useSpecular&&(h+="\t dSpecularity = vec3(1);\n")),n&&e.refraction&&(h+="\t addRefraction();\n")}h+="\n",K&&(e.occludeDirect&&(h+="\t\tapplyAO();\n"),e.occludeSpecular&&(h+="\t\toccludeSpecular();\n")),!1===e.opacityFadesSpecular&&(2!==e.blendType&&4!==e.blendType||(h+="float specLum = dot((dSpecularLight + dReflection.rgb * dReflection.a) * dSpecularity, vec3( 0.2126, 0.7152, 0.0722 ));\n",h+="#ifdef CLEARCOAT\n specLum += dot(ccSpecularLight * ccSpecularity + ccReflection.rgb * ccReflection.a * ccSpecularity, vec3( 0.2126, 0.7152, 0.0722 ));\n#endif\n",h+="dAlpha = clamp(dAlpha + gammaCorrectInput(specLum), 0.0, 1.0);\n"),h+="dAlpha *= material_alphaFade;\n"),h+=u.endPS,2===e.blendType||6===e.blendType||e.alphaToCoverage?h+=u.outputAlphaPS:4===e.blendType?h+=u.outputAlphaPremulPS:h+=u.outputAlphaOpaquePS,e.msdf&&(h+="\t gl_FragColor = applyMsdf(gl_FragColor);\n"),h+="\n",h+="}\n",tt&&(h=u.lightDirPointPS+h),et&&(h=u.falloffLinearPS+h),it&&(h=u.falloffInvSquaredPS+h),nt&&(h=u.spotPS+h),st&&(h=u.cookiePS+h);var _t="";return h.includes("dReflection")&&(_t+="vec4 dReflection;\n"),h.includes("dTBN")&&(_t+="mat3 dTBN;\n"),h.includes("dAlbedo")&&(_t+="vec3 dAlbedo;\n"),h.includes("dEmission")&&(_t+="vec3 dEmission;\n"),h.includes("dNormalW")&&(_t+="vec3 dNormalW;\n"),h.includes("dVertexNormalW")&&(_t+="vec3 dVertexNormalW;\n"),h.includes("dTangentW")&&(_t+="vec3 dTangentW;\n"),h.includes("dBinormalW")&&(_t+="vec3 dBinormalW;\n"),h.includes("dViewDirW")&&(_t+="vec3 dViewDirW;\n"),h.includes("dReflDirW")&&(_t+="vec3 dReflDirW;\n"),h.includes("dDiffuseLight")&&(_t+="vec3 dDiffuseLight;\n"),h.includes("dSpecularLight")&&(_t+="vec3 dSpecularLight;\n"),h.includes("dLightDirNormW")&&(_t+="vec3 dLightDirNormW;\n"),h.includes("dLightDirW")&&(_t+="vec3 dLightDirW;\n"),h.includes("dLightPosW")&&(_t+="vec3 dLightPosW;\n"),h.includes("dShadowCoord")&&(_t+="vec3 dShadowCoord;\n"),h.includes("dNormalMap")&&(_t+="vec3 dNormalMap;\n"),h.includes("dSpecularity")&&(_t+="vec3 dSpecularity;\n"),h.includes("dSpecularityNoFres")&&(_t+="vec3 dSpecularityNoFres;\n"),h.includes("dUvOffset")&&(_t+="vec2 dUvOffset;\n"),h.includes("dGlossiness")&&(_t+="float dGlossiness;\n"),h.includes("dAlpha")&&(_t+="float dAlpha;\n"),h.includes("dAtten")&&(_t+="float dAtten;\n"),h.includes("dAttenD")&&(_t+="float dAttenD;\n"),h.includes("dAtten3")&&(_t+="vec3 dAtten3;\n"),h.includes("dAo")&&(_t+="float dAo;\n"),h.includes("dMsdf")&&(_t+="vec4 dMsdf;\n"),h.includes("ccReflection")&&(_t+="vec4 ccReflection;\n"),h.includes("ccNormalW")&&(_t+="vec3 ccNormalW;\n"),h.includes("ccReflDirW")&&(_t+="vec3 ccReflDirW;\n"),h.includes("ccSpecularLight")&&(_t+="vec3 ccSpecularLight;\n"),h.includes("ccSpecularity")&&(_t+="float ccSpecularity;\n"),h.includes("ccSpecularityNoFres")&&(_t+="float ccSpecularityNoFres;\n"),h.includes("ccGlossiness")&&(_t+="float ccGlossiness;\n"),{attributes:d,vshader:R,fshader:h=D+_t+h,tag:1}}},_n={begin:pi,dummyFragmentCode:fi,end:mi,fogCode:li,gammaCode:oi,precisionCode:ui,skinCode:ci,tonemapCode:hi,versionCode:di,basic:Ti,particle:Ai,skybox:Mi,standard:mn},gn=2.399963229728653,vn=function(t,e,i){var n=e*gn,s=Math.sqrt(e)/Math.sqrt(i);t.x=s*Math.cos(n),t.y=s*Math.sin(n)},yn=function(t,e,i,n,s){void 0===n&&(n=0),void 0===s&&(s=1),n=1-2*n,s=1-2*s;var a=it.lerp(n,s,e/i),r=Math.sqrt(1-a*a),o=gn*e;t.x=Math.cos(o)*r,t.y=a,t.z=Math.sin(o)*r},xn=function(t){var e=(t<<16|t>>>16)>>>0;return 2.3283064365386963e-10*(e=((16711935&(e=((252645135&(e=((858993459&(e=((1431655765&e)<<1|(2863311530&e)>>>1)>>>0))<<2|(3435973836&e)>>>2)>>>0))<<4|(4042322160&e)>>>4)>>>0))<<8|(4278255360&e)>>>8)>>>0)},bn=function(t){switch(t.type){case Ne:return"RGBM";case Ue:return"RGBE";default:switch(t.format){case Zt:case Qt:case $t:case Jt:return"Linear";default:return"Gamma"}}},Sn=function(t){switch(t===Ve&&(t=Ge),t){case We:return"Cubemap";case Ge:return"Equirect";case He:return"Octahedral"}},wn=function(t,e,i){if(t<=0)e[i+0]=0,e[i+1]=0,e[i+2]=0,e[i+3]=0;else if(t>=1)e[i+0]=255,e[i+1]=0,e[i+2]=0,e[i+3]=0;else{var n=1*t%1,s=255*t%1,a=65025*t%1,r=16581375*t%1;n-=s/255,s-=a/255,a-=r/255,e[i+0]=Math.min(255,Math.floor(256*n)),e[i+1]=Math.min(255,Math.floor(256*s)),e[i+2]=Math.min(255,Math.floor(256*a)),e[i+3]=Math.min(255,Math.floor(256*r))}},Tn=function(t,e,i,n){var s=2*i*Math.PI,a=Math.pow(1-e,1/(n+1)),r=Math.sqrt(1-a*a);t.set(Math.cos(s)*r,Math.sin(s)*r,a).normalize()},An=function(t,e,i){var n=2*i*Math.PI,s=Math.sqrt(1-e),a=Math.sqrt(e);t.set(Math.cos(n)*a,Math.sin(n)*a,s).normalize()},Mn=function(t,e,i,n){var s=2*i*Math.PI,a=Math.sqrt((1-e)/(1+(n*n-1)*e)),r=Math.sqrt(1-a*a);t.set(Math.cos(s)*r,Math.sin(s)*r,a).normalize()},Cn=function(t,e){var i=t*e,n=e/(1-t*t+i*i);return n*n*(1/Math.PI)},En={16:{2:26,8:20,32:17,128:16,512:16},32:{2:53,8:40,32:34,128:32,512:32},128:{2:214,8:163,32:139,128:130,512:128},1024:{2:1722,8:1310,32:1114,128:1041,512:1025}},Pn=function(t,e,i){for(var n=i/t,s=1-Math.log2(e)/11,a=s*s,r=new lt,o=new lt,h=new lt(0,0,1),l=[],c=function(t,e){var i=En[t];return i&&i[e]||t}(t,e),u=0;u0){var f=Cn(Math.min(1,d),a)/4+.001,p=.5*Math.log2(n/f);l.push(o.x,o.y,o.z,p)}}for(;l.length<4*t;)l.push(0,0,0,0);return l},Rn=function(t,e,i){var n=function(t){for(var e=t.length,i=Math.min(e,512),n=Math.ceil(e/i),s=new Uint8Array(i*n*4),a=0,r=0;r>2*o),rect:s,seamPixels:1}),s.y+=s.w,s.z=Math.max(1,Math.floor(.5*s.z)),s.w=Math.max(1,Math.floor(.5*s.w));return s.set(128,384,64,32),Un(t,n,{numSamples:(null==e?void 0:e.numSamples)||2048,distribution:"lambert",rect:s,seamPixels:1}),n},t.generatePrefilteredAtlas=function(t,e){for(var i=t[0].device,n=(null==e?void 0:e.target)||new Di(i,{width:512,height:512,format:7,type:Ne,projection:Ge,addressU:1,addressV:1,mipmaps:!1}),s=new dt(0,0,512,256),a=zn(n.width,n.height),r=0;r0,t.forceFragmentPrecision=i.forceFragmentPrecision||"",t.chunks=i.chunks||"",t.blendType=i.blendType,t.forceUv1=i.forceUv1,t.separateAmbient=!1,t.screenSpace=n&&0!=(n&Dt),t.skin=n&&0!=(2&n),t.useInstancing=n&&0!=(32&n),t.useMorphPosition=n&&0!=(n&kt),t.useMorphNormal=n&&0!=(n&Ot),t.useMorphTextureBased=n&&0!=(n&Ft),t.nineSlicedMode=i.nineSlicedMode||0,e.clusteredLightingEnabled&&(t.clusteredLightingEnabled=!0,t.clusteredLightingCookiesEnabled=e.lighting.cookiesEnabled,t.clusteredLightingShadowsEnabled=e.lighting.shadowsEnabled,t.clusteredLightingShadowType=e.lighting.shadowType,t.clusteredLightingAreaLightsEnabled=e.lighting.areaLightsEnabled)},e._updateUVOptions=function(t,e,i,n){var s=!1,a=!1,r=!1;for(var o in i&&(s=0!=(4&i),a=0!=(8&i),r=0!=(16&i)),t.vertexColors=!1,this._mapXForms=[],fn)this._updateTexOptions(t,e,o,s,a,r,n);this._mapXForms=null},e._updateMinOptions=function(t,e){t.opacityTint=1!==e.opacity&&3!==e.blendType,t.lights=[]},e._updateMaterialOptions=function(t,e){var i,n=(e.diffuseTint||!e.diffuseMap&&!e.diffuseVertexColor)&&jn(e.diffuse),s=!!(e.useMetalness||e.specularMap||e.sphereMap||e.cubeMap||(i=e.specular,0!==i.r||0!==i.g||0!==i.b)||e.enableGGXSpecular||e.clearCoat>0),a=s&&!e.useMetalness&&(e.specularTint||!e.specularMap&&!e.specularVertexColor)&&jn(e.specular),r=!e.emissiveMap||jn(e.emissive)&&e.emissiveTint,o=1!==e.emissiveIntensity,h=!!e.normalMap&&(e.normalMap.format===Kt||e.normalMap.type===ze);t.opacityTint=1!==e.opacity&&3!==e.blendType?1:0,t.blendMapsWithColors=!0,t.ambientTint=e.ambientTint,t.diffuseTint=n?2:0,t.specularTint=a?2:0,t.metalnessTint=e.useMetalness&&e.metalness<1?1:0,t.glossTint=1,t.emissiveTint=(r?2:0)+(o?1:0),t.alphaToCoverage=e.alphaToCoverage,t.normalizeNormalMap=e.normalizeNormalMap,t.ambientSH=!!e.ambientSH,t.useSpecular=s,t.emissiveFormat=e.emissiveMap?e.emissiveMap.type===Ne?1:e.emissiveMap.format===Jt?2:0:null,t.lightMapFormat=e.lightMap?e.lightMap.type===Ne?1:e.lightMap.format===Jt?2:0:null,t.specularAntialias=e.specularAntialias&&!!e.normalMap&&!!e.normalMap.mipmaps&&!h,t.conserveEnergy=e.conserveEnergy,t.opacityFadesSpecular=e.opacityFadesSpecular,t.alphaFade=e.alphaFade,t.occludeSpecular=e.occludeSpecular,t.occludeSpecularFloat=1!==e.occludeSpecularIntensity,t.occludeDirect=e.occludeDirect,t.shadingModel=e.shadingModel,t.fresnelModel=e.fresnelModel,t.packedNormal=h,t.fastTbn=e.fastTbn,t.cubeMapProjection=e.cubeMapProjection,t.customFragmentShader=e.customFragmentShader,t.refraction=!!e.refraction,t.useMetalness=e.useMetalness,t.enableGGXSpecular=e.enableGGXSpecular,t.msdf=!!e.msdfMap,t.twoSidedLighting=e.twoSidedLighting,t.pixelSnap=e.pixelSnap,t.aoMapUv=e.aoUvSet,t.diffuseDetail=!!e.diffuseMap,t.normalDetail=!!e.normalMap,t.diffuseDetailMode=e.diffuseDetailMode,t.detailModes=!!t.diffuseDetail,t.clearCoat=!!e.clearCoat,t.clearCoatTint=1!==e.clearCoat?1:0,t.clearCoatGlossiness=!!e.clearCoatGlossiness,t.clearCoatGlossTint=1!==e.clearCoatGlossiness?1:0},e._updateEnvOptions=function(t,e,i,n){t.fog=i.useFog?n.fog:"none",t.gamma=i.useGammaTonemap?n.gammaCorrection:0,t.toneMap=i.useGammaTonemap?n.toneMapping:-1,t.useRgbm=i.emissiveMap&&i.emissiveMap.type===Ne||i.lightMap&&i.lightMap.type===Ne,t.fixSeams=!!i.cubeMap&&i.cubeMap.fixCubemapSeams;var s=0===i.shadingModel,a=!1;if(i.envAtlas&&!s?(t.reflectionSource="envAtlas",t.reflectionEncoding=i.envAtlas.encoding):i.cubeMap?(t.reflectionSource="cubeMap",t.reflectionEncoding=i.cubeMap.encoding):i.sphereMap?(t.reflectionSource="sphereMap",t.reflectionEncoding=i.sphereMap.encoding):i.useSkybox&&n.envAtlas&&!s?(t.reflectionSource="envAtlas",t.reflectionEncoding=n.envAtlas.encoding,a=!0):(t.reflectionSource=null,t.reflectionEncoding=null),i.ambientSH&&!s)t.ambientSource="ambientSH",t.ambientEncoding=null;else{var r=i.envAtlas||(i.useSkybox&&n.envAtlas?n.envAtlas:null);r&&!s?(t.ambientSource="envAtlas",t.ambientEncoding=r.encoding):(t.ambientSource="constant",t.ambientEncoding=null)}t.skyboxIntensity=a&&1!==n.skyboxIntensity,t.useCubeMapRotation=a&&n.skyboxRotation&&!n.skyboxRotation.equals(yt.IDENTITY)},e._updateLightOptions=function(t,e,i,n,s){if(t.lightMap=!1,t.lightMapChannel="",t.lightMapUv=0,t.lightMapTransform=0,t.lightMapWithoutAmbient=!1,t.dirLightMap=!1,i&&(t.noShadow=0!=(1&i),0!=(64&i)&&(t.lightMapFormat=1,t.lightMap=!0,t.lightMapChannel="rgb",t.lightMapUv=1,t.lightMapTransform=0,t.lightMapWithoutAmbient=!e.lightMap,t.useRgbm=!0,0!=(i&Lt)&&(t.dirLightMap=!0),0!=(i&Bt)&&(t.lightMapWithoutAmbient=!1))),e.useLighting){var a=[],r=i?i>>16:1;t.lightMaskDynamic=!!(1&r),n&&(this._collectLights(0,n[0],a,r),this._collectLights(1,n[1],a,r,s),this._collectLights(2,n[2],a,r,s)),t.lights=a}else t.lights=[];0===t.lights.length&&(t.noShadow=!0)},e._updateTexOptions=function(t,e,i,n,s,a,r){var o=i+"Map",h=i+"VertexColor",l=i+"VertexColorChannel",c=o+"Channel",u=o+"Transform",d=o+"Uv";"light"!==i&&(t[o]=!1,t[c]="",t[u]=0,t[d]=0),t[h]=!1,t[l]="";var f="opacity"===i;if(f&&3===e.blendType&&0===e.alphaTest&&!e.alphaToCoverage)return t;if((!r||f)&&("height"!==i&&e[h]&&a&&(t[h]=e[h],t[l]=e[l],t.vertexColors=!0),e[o])){var p=!0;0!==e[d]||n||(p=!1),1!==e[d]||s||(p=!1),p&&(t[o]=!!e[o],t[u]=this._getMapTransformID(e.getUniform(u),e[d]),t[c]=e[c],t[d]=e[d])}},e._collectLights=function(t,e,i,n,s){for(var a=0;a0&&(this._setParameter("material_clearCoat",this.clearCoat),this._setParameter("material_clearCoatGlossiness",this.clearCoatGlossiness),this._setParameter("material_clearCoatReflectivity",this.clearCoat),this._setParameter("material_clearCoatBumpiness",this.clearCoatBumpiness)),this._setParameter("material_shininess",n("shininess")),this.emissiveMap&&!this.emissiveTint||this._setParameter("material_emissive",n("emissive")),1!==this.emissiveIntensity&&this._setParameter("material_emissiveIntensity",this.emissiveIntensity),this.refraction>0&&(this._setParameter("material_refraction",this.refraction),this._setParameter("material_refractionIndex",this.refractionIndex)),this._setParameter("material_opacity",this.opacity),!1===this.opacityFadesSpecular&&this._setParameter("material_alphaFade",this.alphaFade),this.occludeSpecular&&this._setParameter("material_occludeSpecularIntensity",this.occludeSpecularIntensity),1===this.cubeMapProjection&&this._setParameter(n("cubeMapProjectionBox")),fn)this._updateMap(s);this.ambientSH&&this._setParameter("ambientSH[0]",this.ambientSH),this.normalMap&&this._setParameter("material_bumpiness",this.bumpiness),this.normalMap&&this.normalDetailMap&&this._setParameter("material_normalDetailMapBumpiness",this.normalDetailMapBumpiness),this.heightMap&&this._setParameter("material_heightMapFactor",n("heightMapFactor")),this.cubeMap&&this._setParameter("texture_cubeMap",this.cubeMap),this.sphereMap&&this._setParameter("texture_sphereMap",this.sphereMap),this._setParameter("material_reflectivity",this.reflectivity),this._processParameters("_activeParams"),this._dirtyShader&&(this.shader=null,this.clearVariants())},i.updateEnvUniforms=function(t,e){var i=this.envAtlas||(this.useSkybox?e.envAtlas:null);i&&(this._setParameter("texture_envAtlas",i),this.useSkybox&&!e.skyboxRotation.equals(yt.IDENTITY)&&e._skyboxRotationMat3&&this._setParameter("cubeMapRotationMatrix",e._skyboxRotationMat3.data)),this._processParameters("_activeLightingParams")},i.updateShader=function(t,e,i,n,s,a){this.updateEnvUniforms(t,e);var r=s>1&&s<=Nt,o=r?mn.optionsContextMin:mn.optionsContext;r?this.shaderOptBuilder.updateMinRef(o,t,e,this,i,n,s,a):this.shaderOptBuilder.updateRef(o,t,e,this,i,n,s,a),this.onUpdateShader&&(o=this.onUpdateShader(o));var h=t.getProgramLibrary();this.shader=h.getProgram("standard",o),i||(this.clearVariants(),this.variants[0]=this.shader),this._dirtyShader=!1},i.destroy=function(){for(var e in this._assetReferences)this._assetReferences[e]._unbind();this._assetReferences=null,t.prototype.destroy.call(this)},W(e,[{key:"chunks",get:function(){return this._dirtyShader=!0,this._chunks},set:function(t){this._dirtyShader=!0,this._chunks=t}}]),e}(Xn);ns.TEXTURE_PARAMETERS=Zn,ns.CUBEMAP_PARAMETERS=Qn;var ss=function(t,e){es[t]=e},as=function(t,e,i,n){Object.defineProperty(ns.prototype,t,{get:n||function(){return this["_"+t]},set:i}),ts[t]={value:e}},rs=function(t){return t.defaultValue&&t.defaultValue.clone?function(t){var e="_"+t.name,i=t.dirtyShaderFunc||function(){return!0};as(t.name,(function(){return t.defaultValue.clone()}),(function(t){var n=this[e];n.equals(t)||(this._dirtyShader=this._dirtyShader||i(n,t),this[e]=n.copy(t))}),t.getterFunc)}(t):function(t){var e="_"+t.name,i=t.dirtyShaderFunc||function(){return!0};as(t.name,(function(){return t.defaultValue}),(function(t){var n=this[e];n!==t&&(this._dirtyShader=this._dirtyShader||i(n,t),this[e]=t)}),t.getterFunc)}(t)};function os(t,e,i,n,s,a){fn[t]=i,rs({name:t+"Map",defaultValue:null,dirtyShaderFunc:function(t,e){return!!t!=!!e||t&&(t.type!==e.type||t.fixCubemapSeams!==e.fixCubemapSeams||t.format!==e.format)}}),rs({name:t+"MapTiling",defaultValue:new ut(1,1)}),rs({name:t+"MapOffset",defaultValue:new ut(0,0)}),rs({name:t+"MapRotation",defaultValue:0}),rs({name:t+"MapUv",defaultValue:e}),i>0&&rs({name:t+"MapChannel",defaultValue:n||(i>1?"rgb":"g")}),s&&(rs({name:t+"VertexColor",defaultValue:!1}),i>0&&rs({name:t+"VertexColorChannel",defaultValue:n||(i>1?"rgb":"g")})),a&&rs({name:t+"Mode",defaultValue:"mul"});var r=t+"MapTiling",o=t+"MapOffset",h=t+"MapRotation",l=t+"MapTransform";ss(l,(function(t,e,i){var n=t[r],s=t[o],a=t[h];if(1===n.x&&1===n.y&&0===s.x&&0===s.y&&0===a)return null;var c=t._allocUniform(l,(function(){return[{name:"texture_"+l+"0",value:new Float32Array(3)},{name:"texture_"+l+"1",value:new Float32Array(3)}]})),u=Math.cos(a*it.DEG_TO_RAD),d=Math.sin(a*it.DEG_TO_RAD),f=c[0].value;f[0]=u*n.x,f[1]=-d*n.y,f[2]=s.x;var p=c[1].value;return p[0]=d*n.x,p[1]=u*n.y,p[2]=1-n.y-s.y,c}))}function hs(t,e){rs({name:t,defaultValue:e,getterFunc:function(){return this._dirtyShader=!0,this["_"+t]}}),ss(t,(function(e,i,n){var s=e._allocUniform(t,(function(){return new Float32Array(3)})),a=e[t];return e.useGammaTonemap&&n.gammaCorrection?(s[0]=Math.pow(a.r,2.2),s[1]=Math.pow(a.g,2.2),s[2]=Math.pow(a.b,2.2)):(s[0]=a.r,s[1]=a.g,s[2]=a.b),s}))}function ls(t,e,i){rs({name:t,defaultValue:e,dirtyShaderFunc:function(t,e){return(0===t||1===t)!=(0===e||1===e)}}),ss(t,i)}function cs(t,e){rs({name:t,defaultValue:null,dirtyShaderFunc:function(t,e){return!!t==!!e}}),ss(t,e)}function us(t,e){rs({name:t,defaultValue:e})}!function(){hs("ambient",new at(.7,.7,.7)),hs("diffuse",new at(1,1,1)),hs("specular",new at(0,0,0)),hs("emissive",new at(0,0,0)),ls("emissiveIntensity",1),ls("shininess",25,(function(t,e,i){return 0===t.shadingModel?Math.pow(2,.01*t.shininess*11):.01*t.shininess})),ls("heightMapFactor",1,(function(t,e,i){return.025*t.heightMapFactor})),ls("opacity",1),ls("alphaFade",1),ls("alphaTest",0),ls("bumpiness",1),ls("normalDetailMapBumpiness",1),ls("reflectivity",1),ls("occludeSpecularIntensity",1),ls("refraction",0),ls("refractionIndex",1/1.5),ls("metalness",1),ls("anisotropy",0),ls("clearCoat",0),ls("clearCoatGlossiness",1),ls("clearCoatBumpiness",1),ls("aoUvSet",0,null),cs("ambientSH"),cs("cubeMapProjectionBox",(function(t,e,i){var n=t._allocUniform("cubeMapProjectionBox",(function(){return[{name:"envBoxMin",value:new Float32Array(3)},{name:"envBoxMax",value:new Float32Array(3)}]})),s=t.cubeMapProjectionBox.getMin(),a=n[0].value;a[0]=s.x,a[1]=s.y,a[2]=s.z;var r=t.cubeMapProjectionBox.getMax(),o=n[1].value;return o[0]=r.x,o[1]=r.y,o[2]=r.z,n})),us("ambientTint",!1),us("diffuseTint",!1),us("specularTint",!1),us("emissiveTint",!1),us("fastTbn",!1),us("specularAntialias",!1),us("useMetalness",!1),us("enableGGXSpecular",!1),us("occludeDirect",!1),us("normalizeNormalMap",!0),us("conserveEnergy",!0),us("opacityFadesSpecular",!0),us("occludeSpecular",1),us("shadingModel",1),us("fresnelModel",2),us("cubeMapProjection",0),us("customFragmentShader",null),us("forceFragmentPrecision",null),us("useFog",!0),us("useLighting",!0),us("useGammaTonemap",!0),us("useSkybox",!0),us("forceUv1",!1),us("pixelSnap",!1),us("twoSidedLighting",!1),us("nineSlicedMode",void 0),os("diffuse",0,3,"",!0),os("specular",0,3,"",!0),os("emissive",0,3,"",!0),os("normal",0,-1,"",!1),os("metalness",0,1,"",!0),os("gloss",0,1,"",!0),os("opacity",0,1,"a",!0),os("height",0,1,"",!1),os("ao",0,1,"",!0),os("light",1,3,"",!0),os("msdf",0,3,"",!1),os("diffuseDetail",0,3,"",!1,!0),os("normalDetail",0,-1,"",!1),os("clearCoat",0,1,"",!0),os("clearCoatGloss",0,1,"",!0),os("clearCoatNormal",0,-1,"",!1),cs("cubeMap"),cs("sphereMap"),cs("envAtlas");var t=[null,null,null,null,null,null];as("prefilteredCubemaps",(function(){return t.slice()}),(function(t){var e=this._prefilteredCubemaps;t=t||[];for(var i=!1,n=!0,s=0;s<6;++s){var a=t[s]||null;e[s]!==a&&(e[s]=a,i=!0),n=n&&!!e[s]}i&&(n?this.envAtlas=Vn.generatePrefilteredAtlas(e,{target:this.envAtlas}):this.envAtlas&&(this.envAtlas.destroy(),this.envAtlas=null),this._dirtyShader=!0)}),(function(){return this._prefilteredCubemaps}))}();var ds=function(){function t(t){this._device=t,this._cache={},this._generators={},this._isClearingCache=!1,this._precached=!1,this._programsCollection=[],this._defaultStdMatOption={},this._defaultStdMatOptionMin={};var e=new ns;e.shaderOptBuilder.updateRef(this._defaultStdMatOption,t,{},e,null,[],0,null,null),e.shaderOptBuilder.updateMinRef(this._defaultStdMatOptionMin,t,{},e,null,[],3,null,null)}var e=t.prototype;return e.register=function(t,e){this.isRegistered(t)||(this._generators[t]=e)},e.unregister=function(t){this.isRegistered(t)&&delete this._generators[t]},e.isRegistered=function(t){return void 0!==this._generators[t]},e.getProgram=function(t,e){var i=this._generators[t];if(void 0===i)return null;var n=this._device,s=i.generateKey(e),a=this._cache[s];if(!a){var r;e.lights&&(r=e.lights,e.lights=r.map((function(t){var e=t.clone?t.clone():t;return e.key=t.key,e}))),this.storeNewProgram(t,e),e.lights&&(e.lights=r),this._precached&&console.warn("ProgramLibrary#getProgram: Cache miss for shader "+t+" key "+s+" after shaders precaching");var o=i.createShaderDefinition(n,e);a=this._cache[s]=new ai(n,o)}return a},e.storeNewProgram=function(t,e){var i={};if("standard"===t){var n=this._getDefaultStdMatOptions(e.pass);for(var s in e)(e.hasOwnProperty(s)&&n[s]!==e[s]||"pass"===s)&&(i[s]=e[s])}else i=e;this._programsCollection.push(JSON.stringify({name:t,options:i}))},e.dumpPrograms=function(){var t="let device = pc.app ? pc.app.graphicsDevice : pc.Application.getApplication().graphicsDevice;\n";t+="let shaders = [",this._programsCollection[0]&&(t+="\n\t"+this._programsCollection[0]);for(var e=1;e1&&t<=Nt?this._defaultStdMatOptionMin:this._defaultStdMatOption},e.precompile=function(t){if(t)for(var e=new Array(t.length),i=0;ie)if(ArrayBuffer.isView(t))t=t.subarray(0,e),i.set(t);else for(var n=0;nthis.vertexBuffer.numVertices&&(i=this.vertexBuffer.numVertices);var s=n.numComponents;if(this.vertexBuffer.getFormat().interleaved)for(var a=0,r=0;ri*s){var o=i*s;if(ArrayBuffer.isView(e))e=e.subarray(0,o),n.array.set(e);else for(var h=0;he||n>e){var s=e/Math.max(i,n),a=Math.floor(i*s),r=Math.floor(n*s),o=document.createElement("canvas");return o.width=a,o.height=r,o.getContext("2d").drawImage(t,0,0,i,n,0,0,a,r),o}return t}var qs=function(){function t(){this._glTexture=null,this._glTarget=void 0,this._glFormat=void 0,this._glInternalFormat=void 0,this._glPixelType=void 0}var e=t.prototype;return e.destroy=function(t){if(this._glTexture){for(var e=0;et.maxCubeMapSize||h.height>t.maxCubeMapSize)&&(h=Xs(h,t.maxCubeMapSize),0===a&&(e._width=h.width,e._height=h.height)),t.setUnpackFlipY(!1),t.setUnpackPremultiplyAlpha(e._premultiplyAlpha),i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+o,a,this._glInternalFormat,this._glFormat,this._glPixelType,h)}}else for(s=1/Math.pow(2,a),o=0;o<6;o++)if(e._levelsUpdated[0][o]){var l=n[o];e._compressed?i.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+o,a,this._glInternalFormat,Math.max(e._width*s,1),Math.max(e._height*s,1),0,l):(t.setUnpackFlipY(!1),t.setUnpackPremultiplyAlpha(e._premultiplyAlpha),i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+o,a,this._glInternalFormat,Math.max(e._width*s,1),Math.max(e._height*s,1),0,this._glFormat,this._glPixelType,l))}}else e._volume?(s=1/Math.pow(2,a),e._compressed?i.compressedTexImage3D(i.TEXTURE_3D,a,this._glInternalFormat,Math.max(e._width*s,1),Math.max(e._height*s,1),Math.max(e._depth*s,1),0,n):(t.setUnpackFlipY(!1),t.setUnpackPremultiplyAlpha(e._premultiplyAlpha),i.texImage3D(i.TEXTURE_3D,a,this._glInternalFormat,Math.max(e._width*s,1),Math.max(e._height*s,1),Math.max(e._depth*s,1),0,this._glFormat,this._glPixelType,n))):(t._isBrowserInterface(n)?(n instanceof HTMLImageElement&&(n.width>t.maxTextureSize||n.height>t.maxTextureSize)&&(n=Xs(n,t.maxTextureSize),0===a&&(e._width=n.width,e._height=n.height)),t.setUnpackFlipY(e._flipY),t.setUnpackPremultiplyAlpha(e._premultiplyAlpha),i.texImage2D(i.TEXTURE_2D,a,this._glInternalFormat,this._glFormat,this._glPixelType,n)):(s=1/Math.pow(2,a),e._compressed?i.compressedTexImage2D(i.TEXTURE_2D,a,this._glInternalFormat,Math.max(Math.floor(e._width*s),1),Math.max(Math.floor(e._height*s),1),0,n):(t.setUnpackFlipY(!1),t.setUnpackPremultiplyAlpha(e._premultiplyAlpha),i.texImage2D(i.TEXTURE_2D,a,this._glInternalFormat,Math.max(e._width*s,1),Math.max(e._height*s,1),0,this._glFormat,this._glPixelType,n))),e._mipmapsUploaded=0!==a);a++}else a++;if(e._needsUpload)if(e._cubemap)for(var c=0;c<6;c++)e._levelsUpdated[0][c]=!1;else e._levelsUpdated[0]=!1;!e._compressed&&e._mipmaps&&e._needsMipmapsUpload&&(e.pot||t.webgl2)&&1===e._levels.length&&(i.generateMipmap(this._glTarget),e._mipmapsUploaded=!0),e._gpuSize&&e.adjustVramSizeTracking(t._vram,-e._gpuSize),e._gpuSize=e.gpuSize,e.adjustVramSizeTracking(t._vram,e._gpuSize)}},t}();function js(t,e){var i=!0,n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,2,2,0,t.RGBA,e,null);var s=t.createFramebuffer();return t.bindFramebuffer(t.FRAMEBUFFER,s),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0),t.checkFramebufferStatus(t.FRAMEBUFFER)!==t.FRAMEBUFFER_COMPLETE&&(i=!1),t.bindTexture(t.TEXTURE_2D,null),t.deleteTexture(n),t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteFramebuffer(s),i}var Ys,Ks=function(t){function e(e,i){var n;if(void 0===i&&(i={}),(n=t.call(this,e)||this).gl=void 0,n.webgl2=void 0,n.defaultFramebuffer=null,n.updateClientRect(),n.contextLost=!1,n._contextLostHandler=function(t){t.preventDefault(),n.contextLost=!0,n.loseContext(),n.fire("devicelost")},n._contextRestoredHandler=function(){n.restoreContext(),n.contextLost=!1,n.fire("devicerestored")},i.stencil=!0,i.powerPreference||(i.powerPreference="high-performance"),"undefined"!=typeof navigator){var a=navigator.userAgent;a.includes("AppleWebKit")&&(a.includes("15.4")||a.includes("15_4"))&&(i.antialias=!1)}for(var r=void 0===i.preferWebGl2||i.preferWebGl2?["webgl2","webgl","experimental-webgl"]:["webgl","experimental-webgl"],o=null,h=0;h0;var _=n.vertexUniformsCount;return _-=16,_-=8,_-=1,_-=16,n.boneLimit=Math.floor(_/3),n.boneLimit=Math.min(n.boneLimit,128),"Mali-450 MP"===n.unmaskedRenderer&&(n.boneLimit=34),n.constantTexSource=n.scope.resolve("source"),n.extTextureFloat?n.webgl2?n.textureFloatRenderable=!!n.extColorBufferFloat:n.textureFloatRenderable=js(o,o.FLOAT):n.textureFloatRenderable=!1,n.extColorBufferHalfFloat?n.textureHalfFloatRenderable=!!n.extColorBufferHalfFloat:n.extTextureHalfFloat?n.webgl2?n.textureHalfFloatRenderable=!!n.extColorBufferFloat:n.textureHalfFloatRenderable=js(o,n.extTextureHalfFloat.HALF_FLOAT_OES):n.textureHalfFloatRenderable=!1,n.supportsMorphTargetTexturesCore="highp"===n.maxPrecision&&n.maxVertexTextures>=2,n._textureFloatHighPrecision=void 0,n._textureHalfFloatUpdatable=void 0,n.grabPassAvailable=!0,n.grabPass=new Us(q(n),i.alpha),n.grabPass.create(),n.areaLightLutFormat=7,n.extTextureHalfFloat&&n.textureHalfFloatUpdatable&&n.extTextureHalfFloatLinear?n.areaLightLutFormat=$t:n.extTextureFloat&&n.extTextureFloatLinear&&(n.areaLightLutFormat=Jt),n}H(e,t);var i=e.prototype;return i.destroy=function(){t.prototype.destroy.call(this);var e=this.gl;this.grabPass.destroy(),this.webgl2&&this.feedback&&e.deleteTransformFeedback(this.feedback),this.clearShaderCache(),this.clearVertexArrayObjectCache(),this.canvas.removeEventListener("webglcontextlost",this._contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this._contextRestoredHandler,!1),this._contextLostHandler=null,this._contextRestoredHandler=null,this.gl=null,t.prototype.postDestroy.call(this)},i.createVertexBufferImpl=function(t,e){return new Vs},i.createIndexBufferImpl=function(t){return new Ws(t)},i.createShaderImpl=function(t){return new Hs(t)},i.createTextureImpl=function(t){return new qs(t)},i.getPrecision=function(){var t=this.gl,e="highp";if(t.getShaderPrecisionFormat){var i=t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT),n=t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT),s=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT),a=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT),r=i.precision>0&&s.precision>0,o=n.precision>0&&a.precision>0;r||(e=o?"mediump":"lowp")}return e},i.initializeExtensions=function(){var t=this.gl,e=t.getSupportedExtensions(),i=function(){for(var i=0;i1&&this.webgl2)){if(t._glDepthBuffer||(t._glDepthBuffer=e.createRenderbuffer()),e.bindRenderbuffer(e.RENDERBUFFER,t._glDepthBuffer),t._stencil)e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t._glDepthBuffer);else{var s=this.webgl2?e.DEPTH_COMPONENT32F:e.DEPTH_COMPONENT16;e.renderbufferStorage(e.RENDERBUFFER,s,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t._glDepthBuffer)}e.bindRenderbuffer(e.RENDERBUFFER,null)}}this.webgl2&&t._samples>1&&(t._glResolveFrameBuffer=t._glFrameBuffer,t._glFrameBuffer=e.createFramebuffer(),this.setFramebuffer(t._glFrameBuffer),i&&(t._glMsaaColorBuffer||(t._glMsaaColorBuffer=e.createRenderbuffer()),e.bindRenderbuffer(e.RENDERBUFFER,t._glMsaaColorBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,t._samples,i.impl._glInternalFormat,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,t._glMsaaColorBuffer)),t._depth&&(t._glMsaaDepthBuffer||(t._glMsaaDepthBuffer=e.createRenderbuffer()),e.bindRenderbuffer(e.RENDERBUFFER,t._glMsaaDepthBuffer),t._stencil?(e.renderbufferStorageMultisample(e.RENDERBUFFER,t._samples,e.DEPTH24_STENCIL8,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t._glMsaaDepthBuffer)):(e.renderbufferStorageMultisample(e.RENDERBUFFER,t._samples,e.DEPTH_COMPONENT32F,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t._glMsaaDepthBuffer)))),this.targets.push(t)}},i.getCopyShader=function(){if(!this._copyShader){var t=ri.fullscreenQuadVS,e=ri.outputTex2DPS;this._copyShader=vi(this,t,e,"outputTex2D")}return this._copyShader},i.updateBegin=function(){if(this.boundVao=null,this._tempEnableSafariTextureUnitWorkaround)for(var t=0;t1&&e.autoResolve&&e.resolve()}},i.setUnpackFlipY=function(t){if(this.unpackFlipY!==t){this.unpackFlipY=t;var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t)}},i.setUnpackPremultiplyAlpha=function(t){if(this.unpackPremultiplyAlpha!==t){this.unpackPremultiplyAlpha=t;var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t)}},i.activeTexture=function(t){this.textureUnit!==t&&(this.gl.activeTexture(this.gl.TEXTURE0+t),this.textureUnit=t)},i.bindTexture=function(t){var e=t.impl,i=e._glTarget,n=e._glTexture,s=this.textureUnit,a=this.targetToSlot[i];this.textureUnits[s][a]!==n&&(this.gl.bindTexture(i,n),this.textureUnits[s][a]=n)},i.bindTextureOnUnit=function(t,e){var i=t.impl,n=i._glTarget,s=i._glTexture,a=this.targetToSlot[n];this.textureUnits[e][a]!==s&&(this.activeTexture(e),this.gl.bindTexture(n,s),this.textureUnits[e][a]=s)},i.setTextureParameters=function(t){var e=this.gl,i=t._parameterFlags,n=t.impl._glTarget;if(1&i){var s=t._minFilter;(!t.pot&&!this.webgl2||!t._mipmaps||t._compressed&&1===t._levels.length)&&(2===s||3===s?s=0:4!==s&&5!==s||(s=1)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,this.glFilter[s])}if(2&i&&e.texParameteri(n,e.TEXTURE_MAG_FILTER,this.glFilter[t._magFilter]),4&i&&(this.webgl2?e.texParameteri(n,e.TEXTURE_WRAP_S,this.glAddress[t._addressU]):e.texParameteri(n,e.TEXTURE_WRAP_S,this.glAddress[t.pot?t._addressU:1])),8&i&&(this.webgl2?e.texParameteri(n,e.TEXTURE_WRAP_T,this.glAddress[t._addressV]):e.texParameteri(n,e.TEXTURE_WRAP_T,this.glAddress[t.pot?t._addressV:1])),16&i&&this.webgl2&&e.texParameteri(n,e.TEXTURE_WRAP_R,this.glAddress[t._addressW]),32&i&&this.webgl2&&e.texParameteri(n,e.TEXTURE_COMPARE_MODE,t._compareOnRead?e.COMPARE_REF_TO_TEXTURE:e.NONE),64&i&&this.webgl2&&e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,this.glComparison[t._compareFunc]),128&i){var a=this.extTextureFilterAnisotropic;a&&e.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.max(1,Math.min(Math.round(t._anisotropy),this.maxAnisotropy)))}},i.setTexture=function(t,e){(t.impl._glTexture||t.impl.initialize(this,t),t._parameterFlags>0||t._needsUpload||t._needsMipmapsUpload||t===this.grabPass.texture)?(this.activeTexture(e),this.bindTexture(t),t._parameterFlags&&(this.setTextureParameters(t),t._parameterFlags=0),t===this.grabPass.texture&&this.grabPass.prepareTexture()||!t._needsUpload&&!t._needsMipmapsUpload||(t.impl.upload(this,t),t._needsUpload=!1,t._needsMipmapsUpload=!1)):this.bindTextureOnUnit(t,e)},i.createVertexArray=function(t){var e,i,n=t.length>1;if(n){e="";for(var s=0;s0?u.drawElementsInstanced(b,S,T,A,e):u.drawElements(b,S,T,A)}else{var M=t.base;e>0?u.drawArraysInstanced(b,M,S,e):u.drawArrays(b,M,S)}this.webgl2&&this.transformFeedbackBuffer&&(u.endTransformFeedback(),u.bindBufferBase(u.TRANSFORM_FEEDBACK_BUFFER,0,null)),this._drawCallsPerFrame++}},i.clear=function(t){var e=this.defaultClearOptions,i=null==(t=t||e).flags?e.flags:t.flags;if(0!==i){var n=this.gl;if(1&i){var s=null==t.color?e.color:t.color;this.setClearColor(s[0],s[1],s[2],s[3])}if(2&i){var a=null==t.depth?e.depth:t.depth;this.setClearDepth(a),this.depthWrite||n.depthMask(!0)}if(4&i){var r=null==t.stencil?e.stencil:t.stencil;this.setClearStencil(r)}n.clear(this.glClearFlag[i]),2&i&&(this.depthWrite||n.depthMask(!1))}},i.readPixels=function(t,e,i,n,s){var a=this.gl;a.readPixels(t,e,i,n,a.RGBA,a.UNSIGNED_BYTE,s)},i.setClearDepth=function(t){t!==this.clearDepth&&(this.gl.clearDepth(t),this.clearDepth=t)},i.setClearColor=function(t,e,i,n){t===this.clearRed&&e===this.clearGreen&&i===this.clearBlue&&n===this.clearAlpha||(this.gl.clearColor(t,e,i,n),this.clearRed=t,this.clearGreen=e,this.clearBlue=i,this.clearAlpha=n)},i.setClearStencil=function(t){t!==this.clearStencil&&(this.gl.clearStencil(t),this.clearStencil=t)},i.getDepthTest=function(){return this.depthTest},i.setDepthTest=function(t){if(this.depthTest!==t){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.depthTest=t}},i.setDepthFunc=function(t){this.depthFunc!==t&&(this.gl.depthFunc(this.glComparison[t]),this.depthFunc=t)},i.getDepthWrite=function(){return this.depthWrite},i.setDepthWrite=function(t){this.depthWrite!==t&&(this.gl.depthMask(t),this.depthWrite=t)},i.setColorWrite=function(t,e,i,n){this.writeRed===t&&this.writeGreen===e&&this.writeBlue===i&&this.writeAlpha===n||(this.gl.colorMask(t,e,i,n),this.writeRed=t,this.writeGreen=e,this.writeBlue=i,this.writeAlpha=n)},i.setAlphaToCoverage=function(t){this.webgl2&&this.alphaToCoverage!==t&&(this.alphaToCoverage=t,t?this.gl.enable(this.gl.SAMPLE_ALPHA_TO_COVERAGE):this.gl.disable(this.gl.SAMPLE_ALPHA_TO_COVERAGE))},i.setTransformFeedbackBuffer=function(t){if(this.transformFeedbackBuffer!==t&&(this.transformFeedbackBuffer=t,this.webgl2)){var e=this.gl;t?(this.feedback||(this.feedback=e.createTransformFeedback()),e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,this.feedback)):e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null)}},i.setRaster=function(t){this.raster!==t&&(this.raster=t,this.webgl2&&(t?this.gl.disable(this.gl.RASTERIZER_DISCARD):this.gl.enable(this.gl.RASTERIZER_DISCARD)))},i.setDepthBias=function(t){this.depthBiasEnabled!==t&&(this.depthBiasEnabled=t,t?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL))},i.setDepthBiasValues=function(t,e){this.gl.polygonOffset(e,t)},i.getBlending=function(){return this.blending},i.setBlending=function(t){if(this.blending!==t){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.blending=t}},i.setStencilTest=function(t){if(this.stencil!==t){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.stencil=t}},i.setStencilFunc=function(t,e,i){this.stencilFuncFront===t&&this.stencilRefFront===e&&this.stencilMaskFront===i&&this.stencilFuncBack===t&&this.stencilRefBack===e&&this.stencilMaskBack===i||(this.gl.stencilFunc(this.glComparison[t],e,i),this.stencilFuncFront=this.stencilFuncBack=t,this.stencilRefFront=this.stencilRefBack=e,this.stencilMaskFront=this.stencilMaskBack=i)},i.setStencilFuncFront=function(t,e,i){if(this.stencilFuncFront!==t||this.stencilRefFront!==e||this.stencilMaskFront!==i){var n=this.gl;n.stencilFuncSeparate(n.FRONT,this.glComparison[t],e,i),this.stencilFuncFront=t,this.stencilRefFront=e,this.stencilMaskFront=i}},i.setStencilFuncBack=function(t,e,i){if(this.stencilFuncBack!==t||this.stencilRefBack!==e||this.stencilMaskBack!==i){var n=this.gl;n.stencilFuncSeparate(n.BACK,this.glComparison[t],e,i),this.stencilFuncBack=t,this.stencilRefBack=e,this.stencilMaskBack=i}},i.setStencilOperation=function(t,e,i,n){this.stencilFailFront===t&&this.stencilZfailFront===e&&this.stencilZpassFront===i&&this.stencilFailBack===t&&this.stencilZfailBack===e&&this.stencilZpassBack===i||(this.gl.stencilOp(this.glStencilOp[t],this.glStencilOp[e],this.glStencilOp[i]),this.stencilFailFront=this.stencilFailBack=t,this.stencilZfailFront=this.stencilZfailBack=e,this.stencilZpassFront=this.stencilZpassBack=i),this.stencilWriteMaskFront===n&&this.stencilWriteMaskBack===n||(this.gl.stencilMask(n),this.stencilWriteMaskFront=n,this.stencilWriteMaskBack=n)},i.setStencilOperationFront=function(t,e,i,n){this.stencilFailFront===t&&this.stencilZfailFront===e&&this.stencilZpassFront===i||(this.gl.stencilOpSeparate(this.gl.FRONT,this.glStencilOp[t],this.glStencilOp[e],this.glStencilOp[i]),this.stencilFailFront=t,this.stencilZfailFront=e,this.stencilZpassFront=i),this.stencilWriteMaskFront!==n&&(this.gl.stencilMaskSeparate(this.gl.FRONT,n),this.stencilWriteMaskFront=n)},i.setStencilOperationBack=function(t,e,i,n){this.stencilFailBack===t&&this.stencilZfailBack===e&&this.stencilZpassBack===i||(this.gl.stencilOpSeparate(this.gl.BACK,this.glStencilOp[t],this.glStencilOp[e],this.glStencilOp[i]),this.stencilFailBack=t,this.stencilZfailBack=e,this.stencilZpassBack=i),this.stencilWriteMaskBack!==n&&(this.gl.stencilMaskSeparate(this.gl.BACK,n),this.stencilWriteMaskBack=n)},i.setBlendFunction=function(t,e){(this.blendSrc!==t||this.blendDst!==e||this.separateAlphaBlend)&&(this.gl.blendFunc(this.glBlendFunction[t],this.glBlendFunction[e]),this.blendSrc=t,this.blendDst=e,this.separateAlphaBlend=!1)},i.setBlendFunctionSeparate=function(t,e,i,n){this.blendSrc===t&&this.blendDst===e&&this.blendSrcAlpha===i&&this.blendDstAlpha===n&&this.separateAlphaBlend||(this.gl.blendFuncSeparate(this.glBlendFunction[t],this.glBlendFunction[e],this.glBlendFunction[i],this.glBlendFunction[n]),this.blendSrc=t,this.blendDst=e,this.blendSrcAlpha=i,this.blendDstAlpha=n,this.separateAlphaBlend=!0)},i.setBlendEquation=function(t){(this.blendEquation!==t||this.separateAlphaEquation)&&(this.gl.blendEquation(this.glBlendEquation[t]),this.blendEquation=t,this.separateAlphaEquation=!1)},i.setBlendEquationSeparate=function(t,e){this.blendEquation===t&&this.blendAlphaEquation===e&&this.separateAlphaEquation||(this.gl.blendEquationSeparate(this.glBlendEquation[t],this.glBlendEquation[e]),this.blendEquation=t,this.blendAlphaEquation=e,this.separateAlphaEquation=!0)},i.setCullMode=function(t){if(this.cullMode!==t){if(0===t)this.gl.disable(this.gl.CULL_FACE);else{0===this.cullMode&&this.gl.enable(this.gl.CULL_FACE);var e=this.glCull[t];this.cullFace!==e&&(this.gl.cullFace(e),this.cullFace=e)}this.cullMode=t}},i.getCullMode=function(){return this.cullMode},i.setIndexBuffer=function(t){this.indexBuffer=t},i.setVertexBuffer=function(t){t&&this.vertexBuffers.push(t)},i.setShader=function(t){if(t!==this.shader){if(t.failed)return!1;if(!t.ready&&!t.impl.postLink(this,t))return t.failed=!0,!1;this.shader=t,this.gl.useProgram(t.impl.glProgram),this.attributesInvalidated=!0}return!0},i.getHdrFormat=function(){return this.textureHalfFloatRenderable?$t:this.textureFloatRenderable?Jt:7},i.getBoneLimit=function(){return this.boneLimit},i.setBoneLimit=function(t){this.boneLimit=t},i.clearShaderCache=function(){var t=this.gl;for(var e in this.fragmentShaderCache)t.deleteShader(this.fragmentShaderCache[e]),delete this.fragmentShaderCache[e];for(var i in this.vertexShaderCache)t.deleteShader(this.vertexShaderCache[i]),delete this.vertexShaderCache[i];this.programLib.clearCache()},i.clearVertexArrayObjectCache=function(){var t=this.gl;this._vaoMap.forEach((function(e,i,n){t.deleteVertexArray(e)})),this._vaoMap.clear()},i.removeShaderFromCache=function(t){this.programLib.removeFromCache(t)},W(e,[{key:"width",get:function(){return this.gl.drawingBufferWidth||this.canvas.width}},{key:"height",get:function(){return this.gl.drawingBufferHeight||this.canvas.height}},{key:"fullscreen",get:function(){return!!document.fullscreenElement},set:function(t){t?this.gl.canvas.requestFullscreen():document.exitFullscreen()}},{key:"textureFloatHighPrecision",get:function(){return void 0===this._textureFloatHighPrecision&&(this._textureFloatHighPrecision=function(t){if(!t.textureFloatRenderable)return!1;var e=vi(t,ri.fullscreenQuadVS,ri.precisionTestPS,"ptest1"),i=vi(t,ri.fullscreenQuadVS,ri.precisionTest2PS,"ptest2"),n={format:Jt,width:1,height:1,mipmaps:!1,minFilter:0,magFilter:0},s=new Di(t,n);s.name="testFHP";var a=new _s({colorBuffer:s,depth:!1});si(t,a,e),n.format=7;var r=new Di(t,n);r.name="testFHP";var o=new _s({colorBuffer:r,depth:!1});t.constantTexSource.setValue(s),si(t,o,i);var h=t.activeFramebuffer;t.setFramebuffer(o._glFrameBuffer);var l=new Uint8Array(4);t.readPixels(0,0,1,1,l),t.setFramebuffer(h);var c=l[0]/255/16777216+l[1]/255/65536+l[2]/255/256+l[3]/255;return s.destroy(),a.destroy(),r.destroy(),o.destroy(),0===c}(this)),this._textureFloatHighPrecision}},{key:"textureHalfFloatUpdatable",get:function(){return void 0===this._textureHalfFloatUpdatable&&(this.webgl2?this._textureHalfFloatUpdatable=!0:this._textureHalfFloatUpdatable=function(t,e){var i=!0,n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE);var s=new Uint16Array(16);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,2,2,0,t.RGBA,e,s),t.getError()!==t.NO_ERROR&&(i=!1,console.log("Above error related to HALF_FLOAT_OES can be ignored, it was triggered by testing half float texture support")),t.bindTexture(t.TEXTURE_2D,null),t.deleteTexture(n),i}(this.gl,this.extTextureHalfFloat.HALF_FLOAT_OES)),this._textureHalfFloatUpdatable}}]),e}(ps),Zs=function(){function t(){this._refCount=0}var e=t.prototype;return e.incRefCount=function(){this._refCount++},e.decRefCount=function(){this._refCount--},W(t,[{key:"refCount",get:function(){return this._refCount}}]),t}();function $s(){return Ys}function Qs(t){Ys=t}var Js=0,ta=function(){function t(){this.initDefaults()}var e=t.prototype;return e.initDefaults=function(){this.recreate=!1,this.verticesUsage=0,this.indicesUsage=0,this.maxVertices=0,this.maxIndices=0,this.vertexCount=0,this.indexCount=0,this.vertexStreamsUpdated=!1,this.indexStreamUpdated=!1,this.vertexStreamDictionary={},this.indices=null},e._changeVertexCount=function(t,e){this.vertexCount||(this.vertexCount=t)},t}();ta.DEFAULT_COMPONENTS_POSITION=3,ta.DEFAULT_COMPONENTS_NORMAL=3,ta.DEFAULT_COMPONENTS_UV=2,ta.DEFAULT_COMPONENTS_COLORS=4;var ea=function(t,e,i,n){this.data=t,this.componentCount=e,this.dataType=i,this.dataTypeNormalize=n},ia=function(t){function e(e){var i;return(i=t.call(this)||this).id=Js++,i.device=e||$s().graphicsDevice,i.vertexBuffer=null,i.indexBuffer=[null],i.primitive=[{type:0,base:0,count:0}],i.skin=null,i._morph=null,i._geometryData=null,i._aabb=new At,i.boneAabb=null,i}H(e,t);var i=e.prototype;return i.destroy=function(){var t=this.morph;t&&(this.morph=null,t.refCount<1&&t.destroy()),this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBuffer=null);for(var e=0;e0){var b=g.array[g.index+x];if(u[b]=!0,e=m.array[m.index],i=m.array[m.index+1],n=m.array[m.index+2],s=c[b],(a=l[b]).x>e&&(a.x=e),a.y>i&&(a.y=i),a.z>n&&(a.z=n),s.xS&&(a.x=S),a.y>w&&(a.y=w),a.z>T&&(a.z=T),s.x0&&this.indexBuffer[0]&&(this._geometryData.indexCount=this.indexBuffer[0].numIndices,this._geometryData.maxIndices=this.indexBuffer[0].numIndices))},i.clear=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this._initGeometryData(),this._geometryData.initDefaults(),this._geometryData.recreate=!0,this._geometryData.maxVertices=i,this._geometryData.maxIndices=n,this._geometryData.verticesUsage=t?0:1,this._geometryData.indicesUsage=e?0:1},i.setVertexStream=function(t,e,i,n,s,a){void 0===s&&(s=6),void 0===a&&(a=!1),this._initGeometryData();var r=n||e.length/i;this._geometryData._changeVertexCount(r,t),this._geometryData.vertexStreamsUpdated=!0,this._geometryData.vertexStreamDictionary[t]=new ea(e,i,s,a)},i.getVertexStream=function(t,e){var i=0,n=!1;if(this._geometryData){var s=this._geometryData.vertexStreamDictionary[t];s&&(n=!0,i=this._geometryData.vertexCount,ArrayBuffer.isView(e)?e.set(s.data):(e.length=0,e.push(s.data)))}n||this.vertexBuffer&&(i=new Ds(this.vertexBuffer).readData(t,e));return i},i.setPositions=function(t,e,i){void 0===e&&(e=ta.DEFAULT_COMPONENTS_POSITION),this.setVertexStream(ae,t,e,i,6,!1)},i.setNormals=function(t,e,i){void 0===e&&(e=ta.DEFAULT_COMPONENTS_NORMAL),this.setVertexStream(re,t,e,i,6,!1)},i.setUvs=function(t,e,i,n){void 0===i&&(i=ta.DEFAULT_COMPONENTS_UV),this.setVertexStream(ue+t,e,i,n,6,!1)},i.setColors=function(t,e,i){void 0===e&&(e=ta.DEFAULT_COMPONENTS_COLORS),this.setVertexStream(ce,t,e,i,6,!1)},i.setColors32=function(t,e){this.setVertexStream(ce,t,ta.DEFAULT_COMPONENTS_COLORS,e,1,!0)},i.setIndices=function(t,e){this._initGeometryData(),this._geometryData.indexStreamUpdated=!0,this._geometryData.indices=t,this._geometryData.indexCount=e||t.length},i.getPositions=function(t){return this.getVertexStream(ae,t)},i.getNormals=function(t){return this.getVertexStream(re,t)},i.getUvs=function(t,e){return this.getVertexStream(ue+t,e)},i.getColors=function(t){return this.getVertexStream(ce,t)},i.getIndices=function(t){var e=0;if(this._geometryData&&this._geometryData.indices){var i=this._geometryData.indices;e=this._geometryData.indexCount,ArrayBuffer.isView(t)?t.set(i):(t.length=0,t.push(i))}else{if(this.indexBuffer.length>0&&this.indexBuffer[0])e=this.indexBuffer[0].readData(t)}return e},i.update=function(t,e){if(void 0===t&&(t=4),void 0===e&&(e=!0),this._geometryData){if(e){var i=this._geometryData.vertexStreamDictionary.POSITION;i&&3===i.componentCount&&this._aabb.compute(i.data,this._geometryData.vertexCount)}var n=this._geometryData.recreate;this._geometryData.vertexCount>this._geometryData.maxVertices&&(n=!0,this._geometryData.maxVertices=this._geometryData.vertexCount),n&&this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBuffer=null);var s=this._geometryData.recreate;this._geometryData.indexCount>this._geometryData.maxIndices&&(s=!0,this._geometryData.maxIndices=this._geometryData.indexCount),s&&this.indexBuffer.length>0&&this.indexBuffer[0]&&(this.indexBuffer[0].destroy(),this.indexBuffer[0]=null),this._geometryData.vertexStreamsUpdated&&this._updateVertexBuffer(),this._geometryData.indexStreamUpdated&&this._updateIndexBuffer(),this.primitive[0].type=t,this.indexBuffer.length>0&&this.indexBuffer[0]?this._geometryData.indexStreamUpdated&&(this.primitive[0].count=this._geometryData.indexCount,this.primitive[0].indexed=!0):this._geometryData.vertexStreamsUpdated&&(this.primitive[0].count=this._geometryData.vertexCount,this.primitive[0].indexed=!1),this._geometryData.vertexCount=0,this._geometryData.indexCount=0,this._geometryData.vertexStreamsUpdated=!1,this._geometryData.indexStreamUpdated=!1,this._geometryData.recreate=!1,this.updateRenderStates()}},i._buildVertexFormat=function(t){var e=[];for(var i in this._geometryData.vertexStreamDictionary){var n=this._geometryData.vertexStreamDictionary[i];e.push({semantic:i,components:n.componentCount,type:n.dataType,normalize:n.dataTypeNormalize})}return new ti(this.device,e,t)},i._updateVertexBuffer=function(){if(!this.vertexBuffer){var t=this._geometryData.maxVertices,e=this._buildVertexFormat(t);this.vertexBuffer=new Qe(this.device,e,t,this._geometryData.verticesUsage)}var i=new Ds(this.vertexBuffer),n=this._geometryData.vertexCount;for(var s in this._geometryData.vertexStreamDictionary){var a=this._geometryData.vertexStreamDictionary[s];i.writeData(s,a.data,n),delete this._geometryData.vertexStreamDictionary[s]}i.end()},i._updateIndexBuffer=function(){if(this.indexBuffer.length<=0||!this.indexBuffer[0]){var t=this._geometryData.maxVertices>65535?2:1;this.indexBuffer[0]=new ys(this.device,t,this._geometryData.maxIndices,this._geometryData.indicesUsage)}var e=this._geometryData.indices;e&&(this.indexBuffer[0].writeData(e,this._geometryData.indexCount),this._geometryData.indices=null)},i.prepareRenderState=function(t){1===t?this.generateWireframe():2===t&&(this.primitive[2]={type:0,base:0,count:this.vertexBuffer?this.vertexBuffer.numVertices:0,indexed:!1})},i.updateRenderStates=function(){this.primitive[2]&&this.prepareRenderState(2),this.primitive[1]&&this.prepareRenderState(1)},i.generateWireframe=function(){this._destroyIndexBuffer(1);var t,e=[];if(this.indexBuffer.length>0&&this.indexBuffer[0]){for(var i=[[0,1],[1,2],[2,0]],n=this.primitive[0].base,s=this.primitive[0].count,a=this.indexBuffer[0],r=new Ye[a.format](a.storage),o={},h=n;hu?u<<16|c:c<<16|u;void 0===o[d]&&(o[d]=0,e.push(c,u))}t=a.format}else{for(var f=0;f65535?2:1}var p=new ys(this.vertexBuffer.device,t,e.length);new Ye[p.format](p.storage).set(e),p.unlock(),this.primitive[1]={type:1,base:0,count:e.length,indexed:!0},this.indexBuffer[1]=p},W(e,[{key:"morph",get:function(){return this._morph},set:function(t){t!==this._morph&&(this._morph&&this._morph.decRefCount(),this._morph=t,t&&t.incRefCount())}},{key:"aabb",get:function(){return this._aabb},set:function(t){this._aabb=t}}]),e}(Zs),na=4/64,sa=.875,aa=[];function ra(t,e){for(var i=e.length/3,n=t.length/3,s=new lt,a=new lt,r=new lt,o=new lt,h=new lt,l=new lt,c=[],u=0;u0)for(var v=0;v<=n;v++)for(var y=0;y<=s;y++){var x=y/s*2*Math.PI-Math.PI,b=Math.sin(x),S=Math.cos(x);u.set(b*t,-i/2,S*t),c.set(b*e,i/2,S*e),o.lerp(u,c,v/n),h.sub2(c,u).normalize(),d.set(S,0,-b),l.cross(d,h).normalize(),f.push(o.x,o.y,o.z),p.push(l.x,l.y,l.z);var w=y/s,T=v/n;m.push(w,1-T);var A=T;if(T=w,w=(w=A)*sa+na,T=T*sa+na,w/=3,_.push(w,1-T),v0)for(var dt=0;dt1&&g.push(r,r+dt,r+dt-1)}if(r+=s,e>0)for(var yt=0;yt1&&g.push(r,r+yt-1,r+yt)}}return{positions:f,normals:p,uvs:m,uvs1:_,indices:g}}function ua(t,e){var i=e&&(e.radius||e.baseRadius);i=void 0!==i?i:.5;var n=e&&void 0!==e.height?e.height:1,s=e&&void 0!==e.heightSegments?e.heightSegments:5,a=e&&void 0!==e.capSegments?e.capSegments:20,r=!(!e||void 0===e.calculateTangents)&&e.calculateTangents,o=ca(i,i,n,s,a,!1);return r&&(o.tangents=oa(o.positions,o.normals,o.uvs,o.indices)),ha(t,o.positions,o)}function da(t,e){var i=e&&void 0!==e.radius?e.radius:.3,n=e&&void 0!==e.height?e.height:1,s=e&&void 0!==e.heightSegments?e.heightSegments:1,a=e&&void 0!==e.sides?e.sides:20,r=!(!e||void 0===e.calculateTangents)&&e.calculateTangents,o=ca(i,i,n-2*i,s,a,!0);return r&&(o.tangents=oa(o.positions,o.normals,o.uvs,o.indices)),ha(t,o.positions,o)}function fa(t,e){var i=e&&void 0!==e.baseRadius?e.baseRadius:.5,n=e&&void 0!==e.peakRadius?e.peakRadius:0,s=e&&void 0!==e.height?e.height:1,a=e&&void 0!==e.heightSegments?e.heightSegments:5,r=e&&void 0!==e.capSegments?e.capSegments:18,o=!(!e||void 0===e.calculateTangents)&&e.calculateTangents,h=ca(i,n,s,a,r,!1);return o&&(h.tangents=oa(h.positions,h.normals,h.uvs,h.indices)),ha(t,h.positions,h)}function pa(t,e){for(var i=e&&void 0!==e.radius?e.radius:.5,n=e&&void 0!==e.latitudeBands?e.latitudeBands:16,s=e&&void 0!==e.longitudeBands?e.longitudeBands:16,a=!(!e||void 0===e.calculateTangents)&&e.calculateTangents,r=[],o=[],h=[],l=[],c=0;c<=n;c++)for(var u=c*Math.PI/n,d=Math.sin(u),f=Math.cos(u),p=0;p<=s;p++){var m=2*p*Math.PI/s-Math.PI/2,_=Math.sin(m),g=Math.cos(m)*d,v=f,y=_*d,x=1-p/s,b=1-c/n;r.push(g*i,v*i,y*i),o.push(g,v,y),h.push(x,1-b)}for(var S=0;S=0;i--)this.matrices[i].mulAffine2(ba,this.bones[i].getWorldTransform()),this.matrices[i].mulAffine2(this.matrices[i],this.skin.inverseBindPose[i])}},e.updateMatrices=function(t,e){this._updateBeforeCull&&this._updateMatrices(t,e)},e.updateMatrixPalette=function(t,e){this._updateMatrices(t,e);for(var i=this.matrixPalette,n=this.bones.length,s=0;s>16},set:function(t){var e=65535&this._shaderDefs;this._shaderDefs=e|t<<16,this._shader[0]=null,this._shader[1]=null}},{key:"instancingCount",get:function(){return this.instancingData?this.instancingData.count:0},set:function(t){this.instancingData&&(this.instancingData.count=t)}}]),t}();function Da(t,e,i,n){return(15&t)<<27|(3===e?1:0)<<26|(i?1:0)<<25|(33554431&n)<<0}function ka(t,e){if(t&&!e)return!1;if(!t&&e)return!1;if((t=t.data)===(e=e.data))return!0;if(t instanceof Float32Array&&e instanceof Float32Array){if(t.length!==e.length)return!1;for(var i=0;i=0?1:-1}var Wa=function(){function t(t,e,i){this.device=t,this.rootNode=e,this.scene=i,this._init=!1,this._batchGroups={},this._batchGroupCounter=0,this._batchList=[],this._dirtyGroups=[]}var e=t.prototype;return e.destroy=function(){this.device=null,this.rootNode=null,this.scene=null,this._batchGroups={},this._batchList=[],this._dirtyGroups=[]},e.addGroup=function(t,e,i,n,s){if(void 0===n&&(n=this._batchGroupCounter,this._batchGroupCounter++),!this._batchGroups[n]){var a=new xa(n,t,e,i,s);return this._batchGroups[n]=a,a}},e.removeGroup=function(t){if(this._batchGroups[t]){for(var e=[],i=0;i=0&&(n._obj[t].splice(s,1),this.markGroupDirty(e))}},e._extractRender=function(t,e,i,n){if(t.render){if(t.render.isStatic){for(var s=this.scene.drawCalls,a=t.render.meshInstances,r=0;r=0&&e.push(a[o])}else e=n[t.render.batchGroupId]=e.concat(t.render.meshInstances);t.render.removeFromLayers()}return e},e._extractModel=function(t,e,i,n){if(t.model&&t.model.model){if(t.model.isStatic){for(var s=this.scene.drawCalls,a=t.model.meshInstances,r=0;r=0&&e.push(a[o])}else e=n[t.model.batchGroupId]=e.concat(t.model.meshInstances);t.model.removeModelFromLayers()}return e},e._extractElement=function(t,e,i){if(t.element){var n=!1;t.element._text&&t.element._text._model.meshInstances.length>0?(e.push(t.element._text._model.meshInstances[0]),t.element.removeModelFromLayers(t.element._text._model),n=!0):t.element._image&&(e.push(t.element._image._renderable.meshInstance),t.element.removeModelFromLayers(t.element._image._renderable.model),t.element._image._renderable.unmaskMeshInstance&&(e.push(t.element._image._renderable.unmaskMeshInstance),t.element._image._renderable.unmaskMeshInstance.stencilFront&&t.element._image._renderable.unmaskMeshInstance.stencilBack||(t.element._dirtifyMask(),t.element._onPrerender())),n=!0),n&&(i._ui=!0)}},e._collectAndRemoveMeshInstances=function(t,e){for(var i=0;i0;){u[d]=[p[0]],f=[];var _=p[0].material,g=p[0].layer,v=p[0]._shaderDefs,y=p[0].parameters,x=p[0].stencilFront,b=p[0]._staticLightList,S=p[0].mesh.vertexBuffer.getNumVertices(),w=p[0].drawOrder;h.copy(p[0].aabb);var T=Va(p[0]),A=p[0].mesh.vertexBuffer.format.batchingHash,M=p[0].mesh.primitive[0].indexed;c=null;for(var C=1;C=r){f=f.concat(p.slice(C));break}if(_!==E.material||g!==E.layer||A!==E.mesh.vertexBuffer.format.batchingHash||M!==E.mesh.primitive[0].indexed||v!==E._shaderDefs||S+E.mesh.vertexBuffer.getNumVertices()>o)m(E);else if(l.copy(h),l.add(E.aabb),l.halfExtents.x>a||l.halfExtents.y>a||l.halfExtents.z>a)m(E);else if(!x||(s=E.stencilFront)&&x.func===s.func&&x.zpass===s.zpass)if(T===Va(E))if(Oa(y,E.parameters)){var P=E._staticLightList;if(b&&P){if(!Fa(b,P)){m(E);continue}}else if(b||P){m(E);continue}n&&c&&c.intersects(E.aabb)&&E.drawOrder!==w?m(E):(h.add(E.aabb),S+=E.mesh.vertexBuffer.getNumVertices(),u[d].push(E))}else m(E);else m(E);else m(E)}d++,p=f}return u},e.collectBatchedMeshData=function(t,e){for(var i=null,n=0,s=0,a=null,r=0;r=3)if(s===ae)for(var A=0;A0&&a.setIndices(b),a.update(4,!1),e&&((p=p.clone()).chunks.transformVS=this.transformVS,p.chunks.skinTexVS=this.skinTexVS,p.chunks.skinConstVS=this.skinConstVS,p.update());var R=new La(a,p,this.rootNode);R.castShadow=h.origMeshInstances[0].castShadow,R.parameters=h.origMeshInstances[0].parameters,R.isStatic=h.origMeshInstances[0].isStatic,R.layer=h.origMeshInstances[0].layer,R._staticLightList=h.origMeshInstances[0]._staticLightList,R._shaderDefs=h.origMeshInstances[0]._shaderDefs,R.cull=h.origMeshInstances[0].cull;var I=this._batchGroups[i];if(I&&I._ui&&(R.cull=!1),e){for(var L=[],D=0;D0&&this.generate(this._dirtyGroups);for(var t=0;t0&&r){if(!(n1){e.copy(t[1].min),i.copy(t[1].max);for(var n=2;n1?this.shaderCube:this.shader2d,a=this.device;n>1&&this.initInvViewProjMatrices(),this.blitTextureId.setValue(e.cookie);for(var r=0;r1){var o=Za.z/3,h=this.lightTextureAtlas.cubeSlotsOffsets[r];Za.x+=o*h.x,Za.y+=o*h.y,Za.z=o,Za.w=o,this.invViewProjId.setValue(t._invViewProjMatrices[r].data)}Za.mulScalar(i.colorBuffer.width),si(a,i,s,Za)}}},W(t,[{key:"shader2d",get:function(){return this.getShader("blitShader2d","\n\t\tvarying vec2 uv0;\n\t\tuniform sampler2D blitTexture;\n\t\tvoid main(void) {\n\t\t\t\tgl_FragColor = texture2D(blitTexture, uv0);\n\t\t}")}},{key:"shaderCube",get:function(){return this.getShader("blitShaderCube","\n\t\tvarying vec2 uv0;\n\t\tuniform samplerCube blitTexture;\n\t\tuniform mat4 invViewProj;\n\t\tvoid main(void) {\n\t\t\t\tvec4 projPos = vec4(uv0 * 2.0 - 1.0, 0.5, 1.0);\n\t\t\t\tvec4 worldPos = invViewProj * projPos;\n\t\t\t\tgl_FragColor = textureCube(blitTexture, worldPos.xyz);\n\t\t}")}}]),t}();$a._invViewProjMatrices=null;var Qa=function(){function t(t,e){this.texture=t,this.cached=!1,this.renderTargets=e}return t.prototype.destroy=function(){this.texture&&(this.texture.destroy(),this.texture=null);for(var t=this.renderTargets,e=0;e1)for(var h=1/o,l=0;l1)for(var f=0;f0){for(var s=this.slots,a=0;as&&(s=r)}return or.min=n,or.max=s,or}function lr(t,e){return Math.exp(-t*t/(2*e*e))}var cr=new At,ur=new vt,dr=new vt,fr=new Float32Array(2),pr=new dt(1,1,0,0),mr={r:1,g:2,b:3,a:4},_r=new lt,gr=new vt;function vr(t){var e=t.material,i=t.skinInstance?10:0,n=0;if(e.opacityMap){var s=e.opacityMapChannel;s&&(n=mr[s])}return i+n}var yr=function(){function t(t,e){this.device=t.device,this.forwardRenderer=t,this.lightTextureAtlas=e;var i=this.device.scope;this.polygonOffsetId=i.resolve("polygonOffset"),this.polygonOffset=new Float32Array(2),this.sourceId=i.resolve("source"),this.pixelOffsetId=i.resolve("pixelOffset"),this.weightId=i.resolve("weight[0]"),this.blurVsmShaderCode=[ri.blurVSMPS,"#define GAUSS\n"+ri.blurVSMPS];var n="#define PACKED\n";this.blurPackedVsmShaderCode=[n+this.blurVsmShaderCode[0],n+this.blurVsmShaderCode[1]],this.blurVsmShader=[{},{}],this.blurPackedVsmShader=[{},{}],this.blurVsmWeights={},this.shadowMapLightRadiusId=i.resolve("light_radius"),this.shadowMapCache=new ar}var e=t.prototype;return e.destroy=function(){this.shadowMapCache.destroy(),this.shadowMapCache=null},t.createShadowCamera=function(t,e,i,n){var s=an.create("ShadowCamera",i,n);return s.clearColor=e>=1&&e<=3?new at(0,0,0,0):new at(1,1,1,1),s.clearDepthBuffer=!0,s.clearStencilBuffer=!1,s},t.setShadowCameraSettings=function(t,e,i,n,s){var a=4===i||0===i&&e.webgl2;1!==n||s||(a=!1),t.clearColorBuffer=!a},e.cullShadowCasters=function(t,e,i){for(var n=0,s=t.length,a=0;ap&&(p=_)}var g=o.right,v=o.up,y=o.forward,x=.25*t._shadowResolution/p,b=Math.ceil(_r.dot(v)*x)/x,S=Math.ceil(_r.dot(g)*x)/x,w=v.mulScalar(b),T=g.mulScalar(S),A=_r.dot(y),M=y.mulScalar(A);_r.add2(w,T).add(M),o.setPosition(_r),o.translateLocal(0,0,1e6),r.nearClip=0,r.farClip=2e6,r.orthoHeight=p,this.forwardRenderer.updateCameraFrustum(r),this.cullShadowCasters(e,a.visibleCasters,r);for(var C=!0,E=a.visibleCasters,P=0;P1)this.forwardRenderer.scene.clusteredLightingEnabled&&0!==s||this.applyVsmBlur(e,i);this.restoreRenderState(n)}},e.getVsmBlurShader=function(t,e,i){var n=(t?this.blurPackedVsmShader:this.blurVsmShader)[e][i];if(!n){this.blurVsmWeights[i]=function(t){t>25&&(t=25);for(var e=(t-1)/6,i=.5*(t-1),n=new Array(t),s=0,a=0;aU&&(U=H),X>z&&(z=X),q>V&&(V=q)}var j=6*O;p[j]=F,p[j+1]=B,p[j+2]=N,p[j+3]=U,p[j+4]=z,p[j+5]=V}for(var Y=0;Y=Z.x&&p[tt+1]<=$.y&&p[tt+4]>=Z.y&&p[tt+2]<=$.z&&p[tt+5]>=Z.z&&(d[J]|=Q,k=!0)}}if(k){for(var et={},it=0;itft&&(ft=yt),xt>pt&&(pt=xt),bt>mt&&(mt=bt)}h.set(ct,ut,dt),l.set(ft,pt,mt);var St=new At;St.setMinMax(h,l);var wt=new ia(e);wt.vertexBuffer=w,wt.indexBuffer[0]=ht,wt.primitive[0].type=4,wt.primitive[0].base=0,wt.primitive[0].count=ot.length,wt.primitive[0].indexed=!0,wt.aabb=St;var Tt=new La(wt,g.material,g.node);Tt.isStatic=g.isStatic,Tt.visible=g.visible,Tt.layer=g.layer,Tt.castShadow=g.castShadow,Tt._receiveShadow=g._receiveShadow,Tt.cull=g.cull,Tt.pick=g.pick,Tt.mask=g.mask,Tt.parameters=g.parameters,Tt._shaderDefs=g._shaderDefs,Tt._staticSource=g,g._staticLightList?Tt._staticLightList=g._staticLightList:Tt._staticLightList=[];for(var Mt=0;Mt0&&(this._instancedDrawCalls++,t.setVertexBuffer(Mr.vertexBuffer),t.draw(i.primitive[n],Mr.count)):(Cr=e.node.worldTransform,this.modelMatrixId.setValue(Cr.data),s&&(Er=e.node.normalMatrix,e.node._dirtyNormal&&(Cr.invertTo3x3(Er),Er.transpose(),e.node._dirtyNormal=!1),this.normalMatrixId.setValue(Er.data)),t.draw(i.primitive[n]))},e.drawInstance2=function(t,e,i,n){(Mr=e.instancingData)?Mr.count>0&&(this._instancedDrawCalls++,t.draw(i.primitive[n],Mr.count,!0)):t.draw(i.primitive[n],void 0,!0)},e.renderShadows=function(t,e){var i=this.scene.clusteredLightingEnabled,n=this.device;n.grabPassAvailable=!1;for(var s=0;s0&&n.cull<3){i.flipFaces&&(a*=-1),e&&(a*=-1);var r=i.node.worldTransform;r.getX(Qr),r.getY(Jr),r.getZ(to),Qr.cross(Qr,Jr),Qr.dot(to)<0&&(a*=-1)}s=a<0?2===n.cull?1:2:n.cull}if(this.device.setCullMode(s),0===s&&0===n.cull){var o=i.node.worldTransform;o.getX(Qr),o.getY(Jr),o.getZ(to),Qr.cross(Qr,Jr),Qr.dot(to)<0?this.twoSidedLightingNegScaleFactorId.setValue(-1):this.twoSidedLightingNegScaleFactorId.setValue(1)}},e.setVertexBuffers=function(t,e){t.setVertexBuffer(e.vertexBuffer)},e.setMorphing=function(t,e){if(e)if(e.morph.useTextureMorph)t.setVertexBuffer(e.morph.vertexBufferIds),this.morphPositionTex.setValue(e.texturePositions),this.morphNormalTex.setValue(e.textureNormals),this.morphTexParams.setValue(e._textureParams);else{for(var i=0;i0&&this.renderShadows(h.directionalLights,f.camera),c.enabled&&t.subLayerEnabled[l]){if(f&&(f.frameBegin(h.renderTarget),h.firstCameraUse&&f.onPreRender&&f.onPreRender()),!u&&c.onPreRenderOpaque?c.onPreRenderOpaque(d):u&&c.onPreRenderTransparent&&c.onPreRenderTransparent(d),c._preRenderCalledForCameras&1<=0&&r._shaderVersion!==i&&(r.updateShader!==Xn.prototype.updateShader&&(r.clearVariants(),r.shader=null),r._shaderVersion=i)}this.passThrough||(this._dirty=!0)},e.removeMeshInstanceFromArray=function(t,e){for(var i=-1,n=0,s=e.length,a=0;a=0)break}i>=0&&e.splice(i,n)},e.removeMeshInstances=function(t,e){for(var i=this.opaqueMeshInstances,n=this.transparentMeshInstances,s=this.shadowCasters,a=0;a=0&&s.splice(o,1)}}this._dirty=!0},e.clearMeshInstances=function(t){(0!==this.opaqueMeshInstances.length||0!==this.transparentMeshInstances.length||!t&&0!==this.shadowCasters.length)&&(this.opaqueMeshInstances.length=0,this.transparentMeshInstances.length=0,t||(this.shadowCasters.length=0),this.passThrough||(this._dirty=!0))},e.addLight=function(t){var e=t.light;this._lightsSet.has(e)||(this._lightsSet.add(e),0!==e.type&&this._clusteredLightsSet.add(e),this._lights.push(e),this._dirtyLights=!0,this._generateLightHash())},e.removeLight=function(t){var e=t.light;this._lightsSet.has(e)&&(this._lightsSet.delete(e),0!==e.type&&this._clusteredLightsSet.delete(e),this._lights.splice(this._lights.indexOf(e),1),this._dirtyLights=!0,this._generateLightHash())},e.clearLights=function(){this._lightsSet.clear(),this._clusteredLightsSet.clear(),this._lights.length=0,this._dirtyLights=!0},e.addShadowCasters=function(t){for(var e=this.shadowCasters,i=0;i=0&&e.splice(n,1)}this._dirtyLights=!0},e._generateLightHash=function(){if(this._lights.length>0){this._lights.sort(ho);for(var t="",e="",i=0;i=0||(this.cameras.push(t),this._dirtyCameras=!0)},e.removeCamera=function(t){var e=this.cameras.indexOf(t);e>=0&&(this.cameras.splice(e,1),this._dirtyCameras=!0,this.instances.delete(e))},e.clearCameras=function(){this.cameras.length=0,this._dirtyCameras=!0},e._calculateSortDistances=function(t,e,i,n){for(var s=0;s=0&&!this.directionalLightsSet.has(s)){this.directionalLightsSet.add(s),this.directionalLights.push(s);var r=i.indexOf(s);this.directionalLightsIndices.push(r)}}},t}(),vo=function(){function t(){this.shadowCastersSet=new Set,this.shadowCastersList=[]}var e=t.prototype;return e.clearShadowCasters=function(){this.shadowCastersSet.clear(),this.shadowCastersList.length=0},e.addShadowCasters=function(t){for(var e=0;e1&&_o(this.cameras);for(var _=[],g=0,v=0;v0&&y.layers.indexOf(A.id)>=0){_.push(A),w||A.id!==y.disablePostEffectsLayer||(w=!0,S&&(S.triggerPostprocess=!0));var M=A.cameras.indexOf(y);M>=0&&(S=this.addRenderAction(this._renderActions,g,A,T,M,x,w),g++,x=!1)}}b=0;u--)if(t[u].camera===l&&t[u].renderTarget===h){c=!0;break}var d=a||!c,f=!!d&&l.clearColorBuffer,p=!!d&&l.clearDepthBuffer,m=!!d&&l.clearStencilBuffer;return f|=i.clearColorBuffer,p|=i.clearDepthBuffer,m|=i.clearStencilBuffer,r&&l.postEffectsEnabled&&(h=null),o.reset(),o.triggerPostprocess=!1,o.layerIndex=n,o.cameraIndex=s,o.camera=l,o.renderTarget=h,o.clearColor=f,o.clearDepth=p,o.clearStencil=m,o.firstCameraUse=a,o.lastCameraUse=!1,o},i.propagateRenderTarget=function(t,e){for(var i=t;i>=0;i--){var n=this._renderActions[i],s=this.layerList[n.layerIndex];if(n.renderTarget&&1!==s.id)break;if(1!==s.id){var a=null==n?void 0:n.camera.camera;if(a&&(!e.camera.rect.equals(a.rect)||!e.camera.scissorRect.equals(a.scissorRect)))break;n.renderTarget=e.renderTarget}}},i._logRenderActions=function(){},i._isLayerAdded=function(t){return this.layerList.indexOf(t)>=0},i._isSublayerAdded=function(t,e){for(var i=0;i=0;)this.layerList.splice(e,1),this.subLayerList.splice(e,1),this.subLayerEnabled.splice(e,1),e=this.layerList.indexOf(t),this._dirty=!0,this._dirtyLights=!0,this._dirtyCameras=!0,this.fire("remove",t);var i=this.layerList.length;this._updateOpaqueOrder(0,i-1),this._updateTransparentOrder(0,i-1)},i.pushOpaque=function(t){this._isSublayerAdded(t,!1)||(this.layerList.push(t),this._opaqueOrder[t.id]=this.subLayerList.push(!1)-1,this.subLayerEnabled.push(!0),this._dirty=!0,this._dirtyLights=!0,this._dirtyCameras=!0,this.fire("add",t))},i.insertOpaque=function(t,e){if(!this._isSublayerAdded(t,!1)){this.layerList.splice(e,0,t),this.subLayerList.splice(e,0,!1);var i=this.subLayerList.length;this._updateOpaqueOrder(e,i-1),this.subLayerEnabled.splice(e,0,!0),this._dirty=!0,this._dirtyLights=!0,this._dirtyCameras=!0,this.fire("add",t)}},i.removeOpaque=function(t){for(var e=0,i=this.layerList.length;e=1?(r[0]=Math.pow(e,2.2)*s,r[1]=Math.pow(i,2.2)*s,r[2]=Math.pow(n,2.2)*s):(r[0]=Math.pow(a[0],2.2),r[1]=Math.pow(a[1],2.2),r[2]=Math.pow(a[2],2.2))},e.setColor=function(){1===arguments.length?this._color.set(arguments[0].r,arguments[0].g,arguments[0].b):3===arguments.length&&this._color.set(arguments[0],arguments[1],arguments[2]),this._updateFinalColor()},e.updateShadow=function(){2!==this.shadowUpdateMode&&(this.shadowUpdateMode=1)},e.layersDirty=function(){var t;null!=(t=this._scene)&&t.layers&&(this._scene.layers._dirtyLights=!0)},e.updateKey=function(){var t=this._type<<29|(this._castShadows?1:0)<<28|this._shadowType<<25|this._falloffMode<<23|(0!==this._normalOffsetBias?1:0)<<22|(this._cookie?1:0)<<21|(this._cookieFalloff?1:0)<<20|Mo[this._cookieChannel.charAt(0)]<<18|(this._cookieTransform?1:0)<<12|this._shape<<10|this.numCascades-1<<8;3===this._cookieChannel.length&&(t|=Mo[this._cookieChannel.charAt(1)]<<16,t|=Mo[this._cookieChannel.charAt(2)]<<14),t!==this.key&&null!==this._scene&&this.layersDirty(),this.key=t},W(t,[{key:"numCascades",get:function(){return this.cascades.length},set:function(t){this.cascades&&this.numCascades==t||(this.cascades=Co[t-1],this._shadowMatrixPalette=new Float32Array(64),this._shadowCascadeDistances=new Float32Array(4),this._destroyShadowMap(),this.updateKey())}},{key:"shadowMap",get:function(){return this._shadowMap},set:function(t){this._shadowMap!==t&&(this._destroyShadowMap(),this._shadowMap=t)}},{key:"numShadowFaces",get:function(){var t=this._type;return 0===t?this.numCascades:1===t?6:1}},{key:"type",get:function(){return this._type},set:function(t){if(this._type!==t){this._type=t,this._destroyShadowMap(),this.updateKey();var e=this._shadowType;this._shadowType=null,this.shadowType=e}}},{key:"shape",get:function(){return this._shape},set:function(t){if(this._shape!==t){this._shape=t,this._destroyShadowMap(),this.updateKey();var e=this._shadowType;this._shadowType=null,this.shadowType=e}}},{key:"shadowType",get:function(){return this._shadowType},set:function(t){if(this._shadowType!==t){var e=this.device;1===this._type&&(t=0),4!==t||e.webgl2||(t=0),3!==t||e.textureFloatRenderable||(t=2),2!==t||e.textureHalfFloatRenderable||(t=1),this._isVsm=t>=1&&t<=3,this._isPcf=4===t||0===t,this._shadowType=t,this._destroyShadowMap(),this.updateKey()}}},{key:"enabled",get:function(){return this._enabled},set:function(t){this._enabled!==t&&(this._enabled=t,this.layersDirty())}},{key:"castShadows",get:function(){return this._castShadows&&4!==this.mask&&0!==this.mask},set:function(t){this._castShadows!==t&&(this._castShadows=t,this._destroyShadowMap(),this.layersDirty(),this.updateKey())}},{key:"shadowResolution",get:function(){return this._shadowResolution},set:function(t){this._shadowResolution!==t&&(t=1===this._type?Math.min(t,this.device.maxCubeMapSize):Math.min(t,this.device.maxTextureSize),this._shadowResolution=t,this._destroyShadowMap())}},{key:"vsmBlurSize",get:function(){return this._vsmBlurSize},set:function(t){this._vsmBlurSize!==t&&(t%2==0&&t++,this._vsmBlurSize=t)}},{key:"normalOffsetBias",get:function(){return this._normalOffsetBias},set:function(t){this._normalOffsetBias!==t&&((!this._normalOffsetBias&&t||this._normalOffsetBias&&!t)&&this.updateKey(),this._normalOffsetBias=t)}},{key:"falloffMode",get:function(){return this._falloffMode},set:function(t){this._falloffMode!==t&&(this._falloffMode=t,this.updateKey())}},{key:"innerConeAngle",get:function(){return this._innerConeAngle},set:function(t){this._innerConeAngle!==t&&(this._innerConeAngle=t,this._innerConeAngleCos=Math.cos(t*Math.PI/180))}},{key:"outerConeAngle",get:function(){return this._outerConeAngle},set:function(t){this._outerConeAngle!==t&&(this._outerConeAngle=t,this._outerConeAngleCos=Math.cos(t*Math.PI/180))}},{key:"intensity",get:function(){return this._intensity},set:function(t){this._intensity!==t&&(this._intensity=t,this._updateFinalColor())}},{key:"cookieMatrix",get:function(){return this._cookieMatrix||(this._cookieMatrix=new vt),this._cookieMatrix}},{key:"atlasViewport",get:function(){return this._atlasViewport||(this._atlasViewport=new dt(0,0,1,1)),this._atlasViewport}},{key:"cookie",get:function(){return this._cookie},set:function(t){this._cookie!==t&&(this._cookie=t,this.updateKey())}},{key:"cookieFalloff",get:function(){return this._cookieFalloff},set:function(t){this._cookieFalloff!==t&&(this._cookieFalloff=t,this.updateKey())}},{key:"cookieChannel",get:function(){return this._cookieChannel},set:function(t){if(this._cookieChannel!==t){if(t.length<3)for(var e=t.charAt(t.length-1),i=3-t.length,n=0;n0){var n=i.bakeArea;vn(ko,t,e),ko.mulScalar(.5*n),i._node.rotateLocal(ko.x,0,ko.y)}i._node.getWorldTransform();var s=this.scene.gammaCorrection?2.2:1,a=Math.pow(this.intensity,s);i.intensity=Math.pow(a/e,1/s)},W(e,[{key:"numVirtualLights",get:function(){return 0===this.light.type?this.light.bakeNumSamples:1}}]),e}(Do),Fo=function(){function t(){}return t.createTexture=function(t,e,i){var n=new Di(t,{width:i,height:i,format:e,addressU:1,addressV:1,type:Be,magFilter:1,minFilter:0,anisotropy:1});return n.name="AreaLightLUT",n},t.setUniforms=function(t,e,i){t.scope.resolve("areaLightsLutTex1").setValue(e),t.scope.resolve("areaLightsLutTex2").setValue(i)},t.createPlaceholder=function(e){var i=t.createTexture(e,7,2);i.lock().fill(0),i.unlock(),t.setUniforms(e,i,i)},t.set=function(e,i){function n(e,i,n){var s=t.createTexture(e,n,64);return s.lock().set(i),s.unlock(),s.upload(),s}function s(t,e,i){for(var n=t.length,s=new Float32Array(n),a=0;af)return!1;this.morphTextureWidth=p,this.morphTextureHeight=m;var _=!1,g=3,v=Ri.float2Half;this._textureFormat===e.FORMAT_HALF_FLOAT&&(_=!0,g=4);for(var y=this.morphTextureWidth*this.morphTextureHeight*g,x=_?new Uint16Array(y):new Float32Array(y),b=0;b0&&(e+="varying vec2 uv0;\nuniform highp float morphFactor["+t+"];\n");for(var i=0;i=this.maxSubmitCount&&(s(a,r),a=0,r=!0))}(a>0||0===o&&!this.zeroTextures)&&s(a,r)},e._updateTextureMorph=function(){this.device,(this._activeTargets.length>0||!this.zeroTextures)&&(this._updateTextureRenderTarget(this.rtPositions,"texturePositions"),this._updateTextureRenderTarget(this.rtNormals,"textureNormals"),this.zeroTextures=0===this._activeTargets.length)},e._updateVertexMorph=function(){for(var t=this.maxSubmitCount,e=0;e1e-5){this._activeTargets.length<=e&&(this._activeTargets[e]={});var s=this._activeTargets[e++];s.absWeight=n,s.weight=this.getWeight(i),s.target=t[i]}}this._activeTargets.length=e;var a=this.morph.maxActiveTargets;this._activeTargets.length>a&&(this._activeTargets.sort((function(t,e){return t.absWeight0&&this.material.transparent===e&&(this.mesh.setPositions(this.positions),this.mesh.setColors(this.colors),this.mesh.update(1,!1),this.meshInstance||(this.meshInstance=new La(this.mesh,this.material,zo)),this.positions.length=0,this.colors.length=0,t.list.push(this.meshInstance),t.length++)},t}(),Wo=function(){function t(t){this.device=t,this.map=new Map}var e=t.prototype;return e.getBatch=function(t,e){var i=this.map.get(t);return i||(i=new Vo(this.device,t,e),this.map.set(t,i)),i},e.onPreRender=function(t,e){this.map.forEach((function(i){i.onPreRender(t,e)}))},t}(),Go=[],Ho=function(){function t(t){this.device=t,this.quadMesh=null,this.textureShader=null,this.depthTextureShader=null,this.cubeLocalPos=null,this.cubeWorldPos=null,this.batchesMap=new Map,this.allBatches=new Set,this.updatedLayers=new Set,this._materialDepth=null,this._materialNoDepth=null,this.layerMeshInstances=new Map}var e=t.prototype;return e.createMaterial=function(t){var e=new va;return e.vertexColors=!0,e.blend=!0,e.blendType=2,e.depthTest=t,e.update(),e},e.getBatch=function(t,e){var i=this.batchesMap.get(t);i||(i=new Wo(this.device),this.batchesMap.set(t,i)),this.allBatches.add(i);var n=e?this.materialDepth:this.materialNoDepth;return i.getBatch(n,t)},t.getTextureVS=function(){return"\n\t\t\t\t\t\tattribute vec2 aPosition;\n\t\t\t\t\t\tuniform mat4 matrix_model;\n\t\t\t\t\t\tvarying vec2 uv0;\n\t\t\t\t\t\tvoid main(void) {\n\t\t\t\t\t\t\t\tgl_Position = matrix_model * vec4(aPosition, 0, 1);\n\t\t\t\t\t\t\t\tuv0 = aPosition.xy + 0.5;\n\t\t\t\t\t\t}\n\t\t\t\t"},e.getTextureShader=function(){if(!this.textureShader){var e={attributes:{aPosition:ae},vshader:t.getTextureVS(),fshader:"\n\t\t\t\t\t\t\t\t\t\tprecision lowp float;\n\t\t\t\t\t\t\t\t\t\tvarying vec2 uv0;\n\t\t\t\t\t\t\t\t\t\tuniform sampler2D colorMap;\n\t\t\t\t\t\t\t\t\t\tvoid main (void) {\n\t\t\t\t\t\t\t\t\t\t\t\tgl_FragColor = vec4(texture2D(colorMap, uv0).xyz, 1);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t"};this.textureShader=new ai(this.device,e)}return this.textureShader},e.getDepthTextureShader=function(){if(!this.depthTextureShader){var e=this.device.webgl2?"#define GL2":"",i={attributes:{aPosition:ae},vshader:t.getTextureVS(),fshader:"\n\t\t\t\t\t\t\t\t\t\tprecision "+this.device.precision+" float;\n\t\t\t\t\t\t\t\t\t\t"+e+"\n\t\t\t\t\t\t\t\t\t\t"+ri.screenDepthPS+"\n\t\t\t\t\t\t\t\t\t\tvarying vec2 uv0;\n\t\t\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\t\t\t\t\t\t\t\tfloat depth = getLinearScreenDepth(uv0) * camera_params.x;\n\t\t\t\t\t\t\t\t\t\t\t\tgl_FragColor = vec4(vec3(depth), 1.0);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t"};this.depthTextureShader=new ai(this.device,i)}return this.depthTextureShader},e.getQuadMesh=function(){return this.quadMesh||(this.quadMesh=new ia(this.device),this.quadMesh.setPositions([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),this.quadMesh.update(5)),this.quadMesh},e.drawMesh=function(t,e,i,n,s){if(!n){var a=this.getGraphNode(e);n=new La(i,t,a)}var r=this.layerMeshInstances.get(s);r||(r=[],this.layerMeshInstances.set(s,r)),r.push(n)},e.drawWireAlignedBox=function(t,e,i,n,s){Go.push(t.x,t.y,t.z,t.x,e.y,t.z,t.x,e.y,t.z,e.x,e.y,t.z,e.x,e.y,t.z,e.x,t.y,t.z,e.x,t.y,t.z,t.x,t.y,t.z,t.x,t.y,e.z,t.x,e.y,e.z,t.x,e.y,e.z,e.x,e.y,e.z,e.x,e.y,e.z,e.x,t.y,e.z,e.x,t.y,e.z,t.x,t.y,e.z,t.x,t.y,t.z,t.x,t.y,e.z,t.x,e.y,t.z,t.x,e.y,e.z,e.x,e.y,t.z,e.x,e.y,e.z,e.x,t.y,t.z,e.x,t.y,e.z),this.getBatch(s,n).addLinesArrays(Go,i),Go.length=0},e.drawWireSphere=function(t,e,i,n,s,a){for(var r=2*Math.PI/n,o=0,h=0;h=0},i.getModels=function(t){return this._models},W(e,[{key:"defaultDrawLayer",get:function(){return this.layers.getLayerById(3)}},{key:"ambientBakeNumSamples",get:function(){return this._ambientBakeNumSamples},set:function(t){this._ambientBakeNumSamples=it.clamp(Math.floor(t),1,255)}},{key:"ambientBakeSpherePart",get:function(){return this._ambientBakeSpherePart},set:function(t){this._ambientBakeSpherePart=it.clamp(t,.001,1)}},{key:"clusteredLightingEnabled",get:function(){return this._clusteredLightingEnabled},set:function(t){!this._clusteredLightingEnabled||t?this._clusteredLightingEnabled=t:console.error("Turning off enabled clustered lighting is not currently supported")}},{key:"drawCalls",get:function(){var t=this.layers._meshInstances;return t.length||(this.layers._update(this.device,this.clusteredLightingEnabled),t=this.layers._meshInstances),t},set:function(t){}},{key:"envAtlas",get:function(){return this._envAtlas},set:function(t){t!==this._envAtlas&&(this._envAtlas=t,this.updateShaders=!0)}},{key:"fog",get:function(){return this._fog},set:function(t){t!==this._fog&&(this._fog=t,this.updateShaders=!0)}},{key:"gammaCorrection",get:function(){return this._gammaCorrection},set:function(t){t!==this._gammaCorrection&&(this._gammaCorrection=t,this.updateShaders=!0)}},{key:"layers",get:function(){return this._layers},set:function(t){var e=this._layers;this._layers=t,this.fire("set:layers",e,t)}},{key:"lighting",get:function(){return this._lightingParams}},{key:"lightmapFilterRange",get:function(){return this._lightmapFilterRange},set:function(t){this._lightmapFilterRange=Math.max(t,.001)}},{key:"lightmapFilterSmoothness",get:function(){return this._lightmapFilterSmoothness},set:function(t){this._lightmapFilterSmoothness=Math.max(t,.001)}},{key:"prefilteredCubemaps",get:function(){return this._prefilteredCubemaps},set:function(t){var e=this._prefilteredCubemaps;t=t||[];for(var i=!1,n=!0,s=0;s<6;++s){var a=t[s]||null;e[s]!==a&&(e[s]=a,i=!0),n=n&&!!e[s]}i&&(this._resetSkyboxModel(),n?(this._internalEnvAtlas=Vn.generatePrefilteredAtlas(e,{target:this._internalEnvAtlas}),this._envAtlas||(this.envAtlas=this._internalEnvAtlas)):this._internalEnvAtlas&&(this._envAtlas===this._internalEnvAtlas&&(this.envAtlas=null),this._internalEnvAtlas.destroy(),this._internalEnvAtlas=null))}},{key:"skybox",get:function(){return this._skyboxCubeMap},set:function(t){t!==this._skyboxCubeMap&&(this._skyboxCubeMap=t,this._resetSkyboxModel())}},{key:"skyboxIntensity",get:function(){return this._skyboxIntensity},set:function(t){t!==this._skyboxIntensity&&(this._skyboxIntensity=t,this._resetSkyboxModel())}},{key:"skyboxMip",get:function(){return this._skyboxMip},set:function(t){t!==this._skyboxMip&&(this._skyboxMip=t,this._resetSkyboxModel())}},{key:"skyboxRotation",get:function(){return this._skyboxRotation},set:function(t){this._skyboxRotation.equals(t)||(this._skyboxRotation.copy(t),this._resetSkyboxModel())}},{key:"toneMapping",get:function(){return this._toneMapping},set:function(t){t!==this._toneMapping&&(this._toneMapping=t,this.updateShaders=!0)}}]),e}(u);function qo(){return!("undefined"==typeof AudioContext&&"undefined"==typeof webkitAudioContext)}var jo=function(){function t(t,e,i){if(void 0===i&&(i={}),this.volume=void 0===i.volume?1:i.volume,this.loop=void 0!==i.loop&&i.loop,this.pitch=void 0===i.pitch?1:i.pitch,this.sound=e,this.paused=!1,this.suspended=!1,this.manager=t,this.source=null,qo()){this.startTime=0,this.startOffset=0;var n=t.context;this.gain=n.createGain()}else e.audio&&(this.source=e.audio.cloneNode(!1),this.source.pause())}var e=t.prototype;return e.getVolume=function(){return this.volume},e.getLoop=function(){return this.loop},e.setLoop=function(t){this.loop=t,this.source&&(this.source.loop=t)},e.getPitch=function(){return this.pitch},e.onManagerVolumeChange=function(){this.setVolume(this.getVolume())},e.onManagerSuspend=function(){this.isPlaying()&&!this.suspended&&(this.suspended=!0,this.pause())},e.onManagerResume=function(){this.suspended&&(this.suspended=!1,this.unpause())},e.play=function(){if(this.source)throw new Error("Call stop() before calling play()");this._createSource(),this.source&&(this.startTime=this.manager.context.currentTime,this.source.start(0,this.startOffset%this.source.buffer.duration),this.setVolume(this.volume),this.setLoop(this.loop),this.setPitch(this.pitch),this.manager.on("volumechange",this.onManagerVolumeChange,this),this.manager.on("suspend",this.onManagerSuspend,this),this.manager.on("resume",this.onManagerResume,this),this.manager.suspended&&this.onManagerSuspend())},e.pause=function(){this.source&&(this.paused=!0,this.startOffset+=this.manager.context.currentTime-this.startTime,this.source.stop(0),this.source=null)},e.unpause=function(){!this.source&&this.paused?(this._createSource(),this.source&&(this.startTime=this.manager.context.currentTime,this.source.start(0,this.startOffset%this.source.buffer.duration),this.setVolume(this.volume),this.setLoop(this.loop),this.setPitch(this.pitch),this.paused=!1)):console.warn("Call pause() before unpausing.")},e.stop=function(){this.source&&(this.source.stop(0),this.source=null),this.manager.off("volumechange",this.onManagerVolumeChange,this),this.manager.off("suspend",this.onManagerSuspend,this),this.manager.off("resume",this.onManagerResume,this)},e.setVolume=function(t){t=it.clamp(t,0,1),this.volume=t,this.gain&&(this.gain.gain.value=t*this.manager.volume)},e.setPitch=function(t){this.pitch=t,this.source&&(this.source.playbackRate.value=t)},e.isPlaying=function(){return!this.paused&&this.source.playbackState===this.source.PLAYING_STATE},e.getDuration=function(){return this.source?this.source.buffer.duration:0},e._createSource=function(){var t=this.manager.context;this.sound.buffer&&(this.source=t.createBufferSource(),this.source.buffer=this.sound.buffer,this.source.connect(this.gain),this.gain.connect(t.destination),this.loop||(this.source.onended=this.pause.bind(this)))},t}();qo()||Object.assign(jo.prototype,{play:function(){this.source&&(this.paused=!1,this.setVolume(this.volume),this.setLoop(this.loop),this.setPitch(this.pitch),this.source.play()),this.manager.on("volumechange",this.onManagerVolumeChange,this),this.manager.on("suspend",this.onManagerSuspend,this),this.manager.on("resume",this.onManagerResume,this),this.manager.suspended&&this.onManagerSuspend()},pause:function(){this.source&&(this.paused=!0,this.source.pause())},unpause:function(){this.source&&(this.paused=!1,this.source.play())},stop:function(){this.source&&this.source.pause(),this.manager.off("volumechange",this.onManagerVolumeChange,this),this.manager.off("suspend",this.onManagerSuspend,this),this.manager.off("resume",this.onManagerResume,this)},setVolume:function(t){t=it.clamp(t,0,1),this.volume=t,this.source&&(this.source.volume=t*this.manager.volume)},setPitch:function(t){this.pitch=t,this.source&&(this.source.playbackRate=t)},getDuration:function(){return this.source&&!isNaN(this.source.duration)?this.source.duration:0},isPlaying:function(){return!this.source.paused}});var Yo="linear",Ko="inverse",Zo="exponential",$o=function(t){function e(e,i,n){var s;return(s=t.call(this,e,i,n)||this).position=new lt,s.velocity=new lt,qo()?s.panner=e.context.createPanner():(s.maxDistance=1e4,s.minDistance=1,s.rollOffFactor=1,s.distanceModel=Ko),s}H(e,t);var i=e.prototype;return i.getPosition=function(){return this.position},i.setPosition=function(t){this.position.copy(t);var e=this.panner;"positionX"in e?(e.positionX.value=t.x,e.positionY.value=t.y,e.positionZ.value=t.z):e.setPosition&&e.setPosition(t.x,t.y,t.z)},i.getVelocity=function(){return this.velocity},i.setVelocity=function(t){this.velocity.copy(t)},i.getMaxDistance=function(){return this.panner.maxDistance},i.setMaxDistance=function(t){this.panner.maxDistance=t},i.getMinDistance=function(){return this.panner.refDistance},i.setMinDistance=function(t){this.panner.refDistance=t},i.getRollOffFactor=function(){return this.panner.rolloffFactor},i.setRollOffFactor=function(t){this.panner.rolloffFactor=t},i.getDistanceModel=function(){return this.panner.distanceModel},i.setDistanceModel=function(t){this.panner.distanceModel=t},i._createSource=function(){var t=this.manager.context;this.source=t.createBufferSource(),this.source.buffer=this.sound.buffer,this.source.connect(this.panner),this.panner.connect(this.gain),this.gain.connect(t.destination),this.loop||(this.source.onended=this.pause.bind(this))},e}(jo);if(!qo()){var Qo=new lt;Object.assign($o.prototype,{setPosition:function(t){if(this.position.copy(t),this.source){var e=function(t,e,i,n,s,a){var r=(Qo=Qo.sub2(t,e)).length();if(rn)return 0;var o=0;return a===Yo?o=1-s*(r-i)/(n-i):a===Ko?o=i/(i+s*(r-i)):a===Zo&&(o=Math.pow(r/i,-s)),it.clamp(o,0,1)}(this.manager.listener.getPosition(),this.position,this.minDistance,this.maxDistance,this.rollOffFactor,this.distanceModel),i=this.getVolume();this.source.volume=i*e}},getMaxDistance:function(){return this.maxDistance},setMaxDistance:function(t){this.maxDistance=t},getMinDistance:function(){return this.minDistance},setMinDistance:function(t){this.minDistance=t},getRollOffFactor:function(){return this.rollOffFactor},setRollOffFactor:function(t){this.rollOffFactor=t},getDistanceModel:function(){return this.distanceModel},setDistanceModel:function(t){this.distanceModel=t}})}var Jo=function(){function t(t){this._manager=t,this.position=new lt,this.velocity=new lt,this.orientation=new vt}var e=t.prototype;return e.getPosition=function(){return this.position},e.setPosition=function(t){this.position.copy(t);var e=this.listener;e&&("positionX"in e?(e.positionX.value=t.x,e.positionY.value=t.y,e.positionZ.value=t.z):e.setPosition&&e.setPosition(t.x,t.y,t.z))},e.getVelocity=function(){return this.velocity},e.setVelocity=function(t){},e.setOrientation=function(t){this.orientation.copy(t);var e=this.listener;if(e){var i=t.data;"forwardX"in e?(e.forwardX.value=-i[8],e.forwardY.value=-i[9],e.forwardZ.value=-i[10],e.upX.value=i[4],e.upY.value=i[5],e.upZ.value=i[6]):e.setOrientation&&e.setOrientation(-i[8],-i[9],-i[10],i[4],i[5],i[6])}},e.getOrientation=function(){return this.orientation},W(t,[{key:"listener",get:function(){var t=this._manager.context;return t?t.listener:null}}]),t}(),th="running",eh="suspended",ih="interrupted",nh=["click","contextmenu","auxclick","dblclick","mousedown","mouseup","pointerup","touchend","keydown","keyup"],sh=function(t){function e(e){var i;return(i=t.call(this)||this)._context=null,i._state="not created",i._forceWebAudioApi=e.forceWebAudioApi,i._resumeContext=null,i._resumeContextAttached=!1,i._unlock=null,i._unlockAttached=!1,qo()||i._forceWebAudioApi?i._addAudioContextUserInteractionListeners():console.warn("No support for 3D audio found"),i.listener=new Jo(q(i)),i._volume=1,i.suspended=!1,i}H(e,t);var i=e.prototype;return i.suspend=function(){this.suspended=!0,this.fire("suspend")},i.resume=function(){this.suspended=!1,this.fire("resume"),!this.context||this._state!==ih&&this._state!==eh||this._safelyResumeContext()},i.destroy=function(){var t=this;this._resumeContext&&this._resumeContextAttached&&nh.forEach((function(e){window.removeEventListener(e,t._resumeContext)})),this._unlock&&this._unlockAttached&&window.removeEventListener("touchend",this._unlock),this.fire("destroy"),this._context&&this._context.close&&(this._context.close(),this._context=null)},i.playSound=function(t,e){void 0===e&&(e={});var i=null;return jo&&(i=new jo(this,t,e)).play(),i},i.playSound3d=function(t,e,i){void 0===i&&(i={});var n=null;return $o&&((n=new $o(this,t,i)).setPosition(e),i.volume&&n.setVolume(i.volume),i.loop&&n.setLoop(i.loop),i.maxDistance&&n.setMaxDistance(i.maxDistance),i.minDistance&&n.setMinDistance(i.minDistance),i.rollOffFactor&&n.setRollOffFactor(i.rollOffFactor),i.distanceModel&&n.setDistanceModel(i.distanceModel),n.play()),n},i._safelyResumeContext=function(){var t=this;this._context&&this._context.resume().then((function(){t._context.state!==th&&t._addAudioContextUserInteractionListeners()})).catch((function(){t._addAudioContextUserInteractionListeners()}))},i._addAudioContextUserInteractionListeners=function(){var t=this;this._resumeContext||(this._resumeContext=function(){t.context&&t.context.state!==th?t.context.resume():(nh.forEach((function(e){window.removeEventListener(e,t._resumeContext)})),t._resumeContextAttached=!1)}),this._resumeContextAttached||(nh.forEach((function(e){window.addEventListener(e,t._resumeContext)})),this._resumeContextAttached=!0),E.ios&&(this._unlock||(this._unlock=function(){window.removeEventListener("touchend",t._unlock),t._unlockAttached=!1;var e=t.context;if(e){var i=e.createBuffer(1,1,44100),n=e.createBufferSource();n.buffer=i,n.connect(e.destination),n.start(0),n.disconnect()}}),this._unlockAttached||(window.addEventListener("touchend",this._unlock),this._unlockAttached=!0))},W(e,[{key:"volume",get:function(){return this._volume},set:function(t){t=it.clamp(t,0,1),this._volume=t,this.fire("volumechange",t)}},{key:"context",get:function(){var t=this;return this._context||(qo()||this._forceWebAudioApi)&&("undefined"!=typeof AudioContext?this._context=new AudioContext:"undefined"!=typeof webkitAudioContext&&(this._context=new webkitAudioContext),this._context&&(this._state=this._context.state,this._context.onstatechange=function(){t._context&&(t._state!==ih&&t._state!==eh||t._safelyResumeContext(),t._state=t._context.state)})),this._context}}]),e}(u),ah=function(t,e,i,n){this.time=t,this.position=e,this.rotation=i,this.scale=n},rh=function(){this._name="",this._keys=[]},oh=function(){function t(){this.name="",this.duration=0,this._nodes=[],this._nodeDict={}}var e=t.prototype;return e.getNode=function(t){return this._nodeDict[t]},e.addNode=function(t){this._nodes.push(t),this._nodeDict[t._name]=t},W(t,[{key:"nodes",get:function(){return this._nodes}}]),t}(),hh=function(){function t(t){2===arguments.length&&(t=arguments[1]),this.options=t,this._name=t.name,this._defaultWeight=t.defaultWeight||0,this.aabb=t.aabb,this.aabb||(this.aabb=new At,t.deltaPositions&&this.aabb.compute(t.deltaPositions)),this.deltaPositions=t.deltaPositions}var e=t.prototype;return e._postInit=function(){this.options=null},e._initVertexBuffers=function(t){var e=this.options;this._vertexBufferPositions=this._createVertexBuffer(t,e.deltaPositions,e.deltaPositionsType),this._vertexBufferNormals=this._createVertexBuffer(t,e.deltaNormals,e.deltaNormalsType),this._vertexBufferPositions&&(this.deltaPositions=this._vertexBufferPositions.lock())},e._createVertexBuffer=function(t,e,i){return void 0===i&&(i=6),e?new Qe(t,new ti(t,[{semantic:be,components:3,type:i}]),e.length/3,0,e):null},e._setTexture=function(t,e){this[t]=e},e.destroy=function(){this._vertexBufferPositions&&(this._vertexBufferPositions.destroy(),this._vertexBufferPositions=null),this._vertexBufferNormals&&(this._vertexBufferNormals.destroy(),this._vertexBufferNormals=null),this.texturePositions&&(this.texturePositions.destroy(),this.texturePositions=null),this.textureNormals&&(this.textureNormals.destroy(),this.textureNormals=null)},W(t,[{key:"name",get:function(){return this._name}},{key:"defaultWeight",get:function(){return this._defaultWeight}},{key:"morphPositions",get:function(){return!!this._vertexBufferPositions||!!this.texturePositions}},{key:"morphNormals",get:function(){return!!this._vertexBufferNormals||!!this.textureNormals}}]),t}(),lh=function(t,e,i){this.device=t,this.inverseBindPose=e,this.boneNames=i},ch=function(t){function e(){var e;return(e=t.call(this)||this)._meshes=null,e}H(e,t);var i=e.prototype;return i.destroy=function(){this.meshes=null},i.decRefMeshes=function(){if(this._meshes)for(var t=this._meshes.length,e=0;e=0&&t<=1?0:1})),vh(["fr","pt"],(function(t){return t>=0&&t<2?0:1})),vh(["da"],(function(t){return 1===t||!Number.isInteger(t)&&t>=0&&t<=1?0:1})),vh(["de","en","it","el","es","tr","fi","sv","nb","no","ur"],(function(t){return 1===t?0:1})),vh(["ru","uk"],(function(t){if(Number.isInteger(t)){var e=t%10,i=t%100;if(1===e&&11!==i)return 0;if(e>=2&&e<=4&&(i<12||i>14))return 1;if(0===e||e>=5&&e<=9||i>=11&&i<=14)return 2}return 3})),vh(["pl"],(function(t){if(Number.isInteger(t)){if(1===t)return 0;var e=t%10,i=t%100;if(e>=2&&e<=4&&(i<12||i>14))return 1;if(e>=0&&e<=1||e>=5&&e<=9||i>=12&&i<=14)return 2}return 3})),vh(["ar"],(function(t){if(0===t)return 0;if(1===t)return 1;if(2===t)return 2;if(Number.isInteger(t)){var e=t%100;if(e>=3&&e<=10)return 3;if(e>=11&&e<=99)return 4}return 5}));var bh=gh[yh(mh)];function Sh(t){return gh[t]||bh}var wh=new RegExp("^\\s*(?:(?:[a-z]+[a-z0-9\\-\\+\\.]*:)?//|data:|blob:)","i"),Th=function(){function t(t,e,i,n,s,a){this.url=t||"",this.filename=e||"",this.hash=void 0===i?null:i,this.size=void 0===n?null:n,this.opt=void 0===s?null:s,this.contents=a||null}return t.prototype.equals=function(t){return this.url===t.url&&this.filename===t.filename&&this.hash===t.hash&&this.size===t.size&&this.opt===t.opt&&this.contents===t.contents},t}(),Ah=-1,Mh={pvr:"extCompressedTexturePVRTC",dxt:"extCompressedTextureS3TC",etc2:"extCompressedTextureETC",etc1:"extCompressedTextureETC1",basis:"canvas"},Ch=["pvr","dxt","etc2","etc1","basis"],Eh=function(t){function e(e,i,n,s,a){var r;return(r=t.call(this)||this)._id=Ah--,r.name=e||"",r.type=i,r.tags=new $(q(r)),r._preload=!1,r._file=null,r._data=s||{},r.options=a||{},r._resources=[],r._i18n={},r.loaded=!1,r.loading=!1,r.registry=null,n&&(r.file=n),r}H(e,t);var i=e.prototype;return i.getFileUrl=function(){var t=this.file;if(!t||!t.url)return null;var e=t.url;if(this.registry&&this.registry.prefix&&!wh.test(e)&&(e=this.registry.prefix+e),"script"!==this.type&&t.hash){var i=-1!==e.indexOf("?")?"&":"?";e+=i+"t="+t.hash}return e},i.getAbsoluteUrl=function(t){if(t.startsWith("blob:")||t.startsWith("data:"))return t;var e=p.getDirectory(this.file.url);return p.join(e,t)},i.getLocalizedAssetId=function(t){return t=xh(t,this._i18n),this._i18n[t]||null},i.addLocalizedAssetId=function(t,e){this._i18n[t]=e,this.fire("add:localized",t,e)},i.removeLocalizedAssetId=function(t){var e=this._i18n[t];e&&(delete this._i18n[t],this.fire("remove:localized",t,e))},i.ready=function(t,e){e=e||this,this.resource?t.call(e,this):this.once("load",(function(i){t.call(e,i)}))},i.reload=function(){this.loaded&&(this.loaded=!1,this.registry.load(this))},i.unload=function(){if(this.loaded||0!==this._resources.length){this.fire("unload",this),this.registry.fire("unload:"+this.id,this);var t=this._resources;this.resources=[],this.loaded=!1,this.file&&this.registry._loader.clearCache(this.getFileUrl(),this.type);for(var e=0;e0,maxRetries:n},e)},W(e,[{key:"id",get:function(){return this._id},set:function(t){this._id=t}},{key:"file",get:function(){return this._file},set:function(t){var e=this;if(t&&t.variants&&-1!==["texture","textureatlas","bundle"].indexOf(this.type)){var i,n,s=(null==(i=this.registry)||null==(n=i._loader)?void 0:n._app)||$s(),a=null==s?void 0:s.graphicsDevice;if(a)for(var r=function(i,n){var r=Ch[i];if(t.variants[r]&&a[Mh[r]])return t=t.variants[r],"break";if(s.enableBundles){var o=s.bundles.listBundlesForAsset(e);if(o&&o.find((function(t){var e;return null==t||null==(e=t.file)?void 0:e.variants[r]})))return"break"}},o=0,h=Ch.length;o=0){var a=n[s];a.decRefCount(),0===a.refCount&&(n.splice(s,1),n.length||t._skinInstanceCache.delete(i),e&&(e.destroy(),a.skinInstance=null))}}}}},t}();Rh._skinInstanceCache=new Map;var Ih,Lh=function(){function t(e,i,n,s){for(var a=function(e,s,a){var r=t.createAsset(i.name,e,s,a);return n.add(r),r},r=[],o=0;o0&&o(n,Float32Array,1),s.length>0&&o(s,Uint16Array,65535),a.length>0&&o(a,Uint8Array,255)}(y),y.unlock(),y},qh=new vt,jh=new lt,Yh=function(t,e,i,n,s,a,r){var o=[];return e.primitives.forEach((function(h){var l,c,u,d=null,f=!0;if(h.hasOwnProperty("extensions")){var p=h.extensions;if(p.hasOwnProperty("KHR_draco_mesh_compression")){var m=window.DracoDecoderModule;if(m){var _=p.KHR_draco_mesh_compression;if(_.hasOwnProperty("attributes")){var g=n[_.bufferView],v=new m.DecoderBuffer;v.Init(g,g.length);var y,x,b=new m.Decoder,S=b.GetEncodedGeometryType(v);switch(S){case m.POINT_CLOUD:l=0,y=new m.PointCloud,x=b.DecodeBufferToPointCloud(v,y);break;case m.TRIANGULAR_MESH:l=4,y=new m.Mesh,x=b.DecodeBufferToMesh(v,y);break;case m.INVALID_GEOMETRY_TYPE:}if(!x||!x.ok()||0==y.ptr)return void s("Failed to decode draco compressed asset: "+(x?x.error_msg():"Mesh asset - invalid draco compressed geometry type: "+S));var w=y.num_faces();if(S===m.TRIANGULAR_MESH){var T=y.num_points()>65535,A=(u=3*w)*(T?4:2),M=m._malloc(A);T?(b.GetTrianglesUInt32Array(y,A,M),d=new Uint32Array(m.HEAPU32.buffer,M,u).slice()):(b.GetTrianglesUInt16Array(y,A,M),d=new Uint16Array(m.HEAPU16.buffer,M,u).slice()),m._free(M)}c=function(t,e,i,n,s,a,r){var o=e.num_points(),h=function(t){var i,a,r,h,l=n.GetAttributeByUniqueId(e,t),c=o*l.num_components();switch(l.data_type()){case s.DT_UINT8:h=1,r=1,i=s._malloc(c*r),n.GetAttributeDataArrayForAllPoints(e,l,s.DT_UINT8,c*r,i),a=new Uint8Array(s.HEAPU8.buffer,i,c).slice();break;case s.DT_UINT16:h=3,r=2,i=s._malloc(c*r),n.GetAttributeDataArrayForAllPoints(e,l,s.DT_UINT16,c*r,i),a=new Uint16Array(s.HEAPU16.buffer,i,c).slice();break;case s.DT_FLOAT32:default:h=6,r=4,i=s._malloc(c*r),n.GetAttributeDataArrayForAllPoints(e,l,s.DT_FLOAT32,c*r,i),a=new Float32Array(s.HEAPF32.buffer,i,c).slice()}return s._free(i),{values:a,numComponents:l.num_components(),componentSizeInBytes:r,storageType:h,normalized:l.normalized()}},l={},c=i.attributes;for(var u in c)if(c.hasOwnProperty(u)&&Nh.hasOwnProperty(u)){var d=Nh[u],f=h(c[u]),p=f.numComponents*f.componentSizeInBytes;l[d]={values:f.values,buffer:f.values.buffer,size:p,offset:0,stride:p,count:o,components:f.numComponents,type:f.storageType,normalize:f.normalized}}return l.hasOwnProperty(re)||Gh(l,a),Xh(t,l,r)}(t,y,_,b,m,d,a),m.destroy(y),m.destroy(b),m.destroy(v),f=!1}}}}c||(d=h.hasOwnProperty("indices")?zh(i[h.indices],n,!0):null,c=function(t,e,i,n,s,a,r){var o={},h=[];for(var l in e)e.hasOwnProperty(l)&&Nh.hasOwnProperty(l)&&(o[l]=e[l],h.push(l+":"+e[l]));h.sort();var c=h.join(),u=r[c];if(!u){var d={};for(var f in o){var p=n[e[f]],m=zh(p,s),_=s[p.bufferView],g=Nh[f],v=Oh(p.type)*Bh(p.componentType),y=_.hasOwnProperty("byteStride")?_.byteStride:v;d[g]={buffer:m.buffer,size:v,offset:m.byteOffset,stride:y,count:p.count,components:Oh(p.type),type:Fh(p.componentType),normalize:p.normalized}}d.hasOwnProperty(re)||Gh(d,i),u=Xh(t,d,a),r[c]=u}return u}(t,h.attributes,d,i,n,a,r),l=function(t){if(!t.hasOwnProperty("mode"))return 4;switch(t.mode){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;case 4:return 4;case 5:return 5;case 6:return 6;default:return 4}}(h));var C=null;if(c){if((C=new ia(t)).vertexBuffer=c,C.primitive[0].type=l,C.primitive[0].base=0,C.primitive[0].indexed=null!==d,null!==d){var E;2!==(E=d instanceof Uint8Array?0:d instanceof Uint16Array?1:2)||t.extUintElement||(E=1,d=new Uint16Array(d));var P=new ys(t,E,d.length,0,d);C.indexBuffer[0]=P,C.primitive[0].count=d.length}else C.primitive[0].count=c.numVertices;C.materialIndex=h.material;var R=i[h.attributes.POSITION];if(C.aabb=Wh(R),f&&h.hasOwnProperty("targets")){var I=[];h.targets.forEach((function(t,s){var a={};t.hasOwnProperty("POSITION")&&(R=i[t.POSITION],a.deltaPositions=Vh(R,n),a.deltaPositionsType=6,a.aabb=Wh(R)),t.hasOwnProperty("NORMAL")&&(R=i[t.NORMAL],a.deltaNormals=Vh(R,n),a.deltaNormalsType=6),e.hasOwnProperty("extras")&&e.extras.hasOwnProperty("targetNames")?a.name=e.extras.targetNames[s]:a.name=s.toString(10),e.hasOwnProperty("weights")&&(a.defaultWeight=e.weights[s]),I.push(new hh(a))})),C.morph=new Bo(I,t)}}o.push(C)})),o},Kh=function(t,e,i){var n,s,a=["#ifdef MAPFLOAT","uniform float material_shininess;","#endif","","#ifdef MAPTEXTURE","uniform sampler2D texture_glossMap;","#endif","","void getGlossiness() {","\t\tdGlossiness = 1.0;","","#ifdef MAPFLOAT","\t\tdGlossiness *= material_shininess;","#endif","","#ifdef MAPTEXTURE","\t\tdGlossiness *= texture2D(texture_glossMap, $UV).$CH;","#endif","","#ifdef MAPVERTEX","\t\tdGlossiness *= saturate(vVertexColor.$VC);","#endif","","\t\tdGlossiness = 1.0 - dGlossiness;","","\t\tdGlossiness += 0.0000001;","}"].join("\n"),r=["#ifdef MAPCOLOR","uniform vec3 material_specular;","#endif","","#ifdef MAPTEXTURE","uniform sampler2D texture_specularMap;","#endif","","void getSpecularity() {","\t\tdSpecularity = vec3(1.0);","","\t\t#ifdef MAPCOLOR","\t\t\t\tdSpecularity *= material_specular;","\t\t#endif","","\t\t#ifdef MAPTEXTURE","\t\t\t\tvec3 srgb = texture2D(texture_specularMap, $UV).$CH;","\t\t\t\tdSpecularity *= vec3(pow(srgb.r, 2.2), pow(srgb.g, 2.2), pow(srgb.b, 2.2));","\t\t#endif","","\t\t#ifdef MAPVERTEX","\t\t\t\tdSpecularity *= saturate(vVertexColor.$VC);","\t\t#endif","}"].join("\n"),o=["#ifdef MAPFLOAT","uniform float material_clearCoatGlossiness;","#endif","","#ifdef MAPTEXTURE","uniform sampler2D texture_clearCoatGlossMap;","#endif","","void getClearCoatGlossiness() {","\t\tccGlossiness = 1.0;","","#ifdef MAPFLOAT","\t\tccGlossiness *= material_clearCoatGlossiness;","#endif","","#ifdef MAPTEXTURE","\t\tccGlossiness *= texture2D(texture_clearCoatGlossMap, $UV).$CH;","#endif","","#ifdef MAPVERTEX","\t\tccGlossiness *= saturate(vVertexColor.$VC);","#endif","","\t\tccGlossiness = 1.0 - ccGlossiness;","","\t\tccGlossiness += 0.0000001;","}"].join("\n"),h=[0,0],l=[1,1],c=function(t,e,i){var n,s,a=t.texCoord;if(a)for(s=0;s0?i.name=t.name:i.name="node_"+e,t.hasOwnProperty("matrix")&&(qh.data.set(t.matrix),qh.getTranslation(jh),i.setLocalPosition(jh),qh.getEulerAngles(jh),i.setLocalEulerAngles(jh),qh.getScale(jh),i.setLocalScale(jh)),t.hasOwnProperty("rotation")){var n=t.rotation;i.setLocalRotation(n[0],n[1],n[2],n[3])}if(t.hasOwnProperty("translation")){var s=t.translation;i.setLocalPosition(s[0],s[1],s[2])}if(t.hasOwnProperty("scale")){var a=t.scale;i.setLocalScale(a[0],a[1],a[2])}return i},$h=function(t,e){var i="orthographic"===t.type?1:0,n=1===i?t.orthographic:t.perspective,s={enabled:!1,projection:i,nearClip:n.znear,aspectRatioMode:0};n.zfar&&(s.farClip=n.zfar),1===i?(s.orthoHeight=.5*n.ymag,n.ymag&&(s.aspectRatioMode=1,s.aspectRatio=n.xmag/n.ymag)):(s.fov=n.yfov*it.RAD_TO_DEG,n.aspectRatio&&(s.aspectRatioMode=1,s.aspectRatio=n.aspectRatio));var a=new Pv(t.name);return a.addComponent("camera",s),a},Qh=function(t,e){var i={enabled:!1,type:"point"===t.type?"omni":t.type,color:t.hasOwnProperty("color")?new at(t.color):at.WHITE,range:t.hasOwnProperty("range")?t.range:9999,falloffMode:1,intensity:t.hasOwnProperty("intensity")?it.clamp(t.intensity,0,2):1};t.hasOwnProperty("spot")&&(i.innerConeAngle=t.spot.hasOwnProperty("innerConeAngle")?t.spot.innerConeAngle*it.RAD_TO_DEG:0,i.outerConeAngle=t.spot.hasOwnProperty("outerConeAngle")?t.spot.outerConeAngle*it.RAD_TO_DEG:Math.PI/4);var n=new Pv(e.name);return n.rotateLocal(90,0,0),n.addComponent("light",i),n},Jh=function(t,e,i,n){if(!e.hasOwnProperty("skins")||0===e.skins.length)return[];var s=new Map;return e.skins.map((function(a){return function(t,e,i,n,s,a){var r,o,h,l=e.joints,c=l.length,u=[];if(e.hasOwnProperty("inverseBindMatrices")){var d=e.inverseBindMatrices,f=zh(i[d],n,!0),p=[];for(r=0;r0){var s=i&&i.camera&&i.camera.preprocess,a=i&&i.camera&&i.camera.process||$h,r=i&&i.camera&&i.camera.postprocess;t.nodes.forEach((function(i,o){if(i.hasOwnProperty("camera")){var h=t.cameras[i.camera];if(h){s&&s(h);var l=a(h,e[o]);r&&r(h,l),l&&(n||(n=new Map),n.set(i,l))}}}))}return n}(e,l,s),f=tl(e,l,i,s),p=function(t,e,i,n){if(!t.hasOwnProperty("materials")||0===t.materials.length)return[];var s=i&&i.material&&i.material.preprocess,a=i&&i.material&&i.material.process||Kh,r=i&&i.material&&i.material.postprocess;return t.materials.map((function(t){s&&s(t);var i=a(t,e,n);return r&&r(t,i),i}))}(e,n.map((function(t){return t.resource})),s,h),m=function(t,e,i,n,s){if(!e.hasOwnProperty("meshes")||0===e.meshes.length||!e.hasOwnProperty("accessors")||0===e.accessors.length||!e.hasOwnProperty("bufferViews")||0===e.bufferViews.length)return[];var a={};return e.meshes.map((function(r){return Yh(t,r,e.accessors,i,n,s,a)}))}(t,e,i,a,h),_=Jh(t,e,l,i),g=[],v=0;vi.byteLength)e("Invalid length found in glb header. Found "+a);else{for(var r=[],o=12;oi.byteLength)throw new Error("Invalid chunk length found in glb. Found "+h);var l=i.getUint32(o+4,!0),c=new Uint8Array(i.buffer,i.byteOffset+o+8,h);r.push({length:h,type:l,data:c}),o+=h+8}1===r.length||2===r.length?1313821514===r[0].type?r.length>1&&5130562!==r[1].type?e("Invalid chunk type found in glb file. Expected 0x004E4942, found 0x"+r[1].type.toString(16)):e(null,{gltfChunk:r[0].data,binaryChunk:2===r.length?r[1].data:null}):e("Invalid chunk type found in glb file. Expected 0x4E4F534A, found 0x"+r[0].type.toString(16)):e("Invalid number of chunks found in glb file.")}else e("Invalid version number found in glb header. Expected 2, found "+s);else e("Invalid magic number found in glb header. Expected 0x46546C67, found 0x"+n.toString(16))}(e,i):i(null,{gltfChunk:e,binaryChunk:null})},rl=function(t,e,i,n){var s=[],a=i&&i.bufferView&&i.bufferView.preprocess,r=i&&i.bufferView&&i.bufferView.processAsync||function(t,e,i){i(null,null)},o=i&&i.bufferView&&i.bufferView.postprocess,h=t.bufferViews?t.bufferViews.length:0;if(h)for(var l=function(e,i){var a=t.bufferViews[e];a.hasOwnProperty("byteStride")&&(i.byteStride=a.byteStride),s[e]=i,o&&o(a,i),0==--h&&n(null,s)},c=0;c=0?t.split("?")[0]:t},e.load=function(e,i,n){var s=this;Eh.fetchArrayBuffer(e.load,(function(a,r){a?i(a):t.parseAsync(s._getUrlWithoutParams(e.original),p.extractPath(e.load),r,s._device,n.registry,n.options,(function(t,e){t?i(t):i(null,new Lh(e,n,s._assets,s._defaultMaterial))}))}),n,this._maxRetries)},e.open=function(t,e,i){return e},e.patch=function(t,e){},t}(),hl=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i={retry:this.maxRetries>0,maxRetries:this.maxRetries};(t.load.startsWith("blob:")||t.load.startsWith("data:"))&&(".glb"===p.getExtension(t.original).toLowerCase()?i.responseType=nt.ResponseType.ARRAY_BUFFER:i.responseType=nt.ResponseType.JSON),st.get(t.load,i,(function(i,n){i?e("Error loading animation resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){if(".glb"===p.getExtension(t).toLowerCase()){var i=ol.parse("filename.glb",e,null);if(i){var n=i.animations;return i.destroy(),n}return null}return this["_parseAnimationV"+e.animation.version](e)},e.patch=function(t,e){},e._parseAnimationV3=function(t){var e=t.animation,i=new oh;i.name=e.name,i.duration=e.duration;for(var n=0;n0,maxRetries:this.maxRetries};t.load.startsWith("blob:")&&(i.responseType=nt.ResponseType.JSON),st.get(t.load,i,(function(i,n){i?e("Error loading animation clip resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){var i=e.name,n=e.duration,s=e.inputs.map((function(t){return new dh(1,t)})),a=e.outputs.map((function(t){return new dh(t.components,t.data)})),r=e.curves.map((function(t){return new uh([t.path],t.inputIndex,t.outputIndex,t.interpolation)}));return new ph(i,n,s,a,r)},e.patch=function(t,e){},t}(),cl=function(){function t(t){if(this._layers=[],this._parameters={},Array.isArray(t.layers))this._layers=t.layers;else for(var e in t.layers){for(var i=t.layers[e],n={name:i.name,blendType:i.blendType,weight:i.weight,states:[],transitions:[]},s=0;s0,maxRetries:this.maxRetries};t.load.startsWith("blob:")&&(i.responseType=nt.ResponseType.JSON),st.get(t.load,i,(function(i,n){i?e("Error loading animation state graph resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return new cl(e)},e.patch=function(t,e){},t}(),dl=function(){function t(t){this.audio=void 0,this.buffer=void 0,t instanceof Audio?this.audio=t:this.buffer=t}return W(t,[{key:"duration",get:function(){var t=0;return this.buffer?t=this.buffer.duration:this.audio&&(t=this.audio.duration),t||0}}]),t}(),fl=function(){if("undefined"==typeof window)return!1;var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(e>0)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);if(t.indexOf("Trident/")>0){var i=t.indexOf("rv:");return parseInt(t.substring(i+3,t.indexOf(".",i)),10)}return!1}(),pl={".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/x-wav",".mp4a":"audio/mp4",".m4a":"audio/mp4",".mp4":"audio/mp4",".aac":"audio/aac"},ml=function(){function t(t){this.manager=t,this.maxRetries=0}var e=t.prototype;return e._isSupported=function(t){var e=p.getExtension(t);return!!pl[e]},e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i=function(i){var n="Error loading audio url: "+t.original;i&&(n+=": "+(i.message||i)),console.warn(n),e(n)};if(this._createSound){if(!this._isSupported(t.original))return void i("Audio format for "+t.original+" not supported");this._createSound(t.load,(function(t){e(null,new dl(t))}),i)}else i(null)},e.open=function(t,e){return e},e.patch=function(t,e){},e._createSound=function(t,e,i){if(qo()){var n=this.manager;if(!n.context)return void i("Audio manager has no audio context");var s={retry:this.maxRetries>0,maxRetries:this.maxRetries};(t.startsWith("blob:")||t.startsWith("data:"))&&(s.responseType=nt.ResponseType.ARRAY_BUFFER),st.get(t,s,(function(t,s){t?i(t):n.context.decodeAudioData(s,e,i)}))}else{var a=null;try{a=new Audio}catch(t){return void i("No support for Audio element")}fl&&document.body.appendChild(a);a.onerror=function(){a.onerror=null,fl&&document.body.removeChild(a),i()},a.addEventListener("canplaythrough",(function t(){a.removeEventListener("canplaythrough",t),fl&&document.body.removeChild(a),e(a)})),a.src=t}},t}(),_l=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t}),st.get(t.load,{responseType:nt.ResponseType.ARRAY_BUFFER,retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(i,n){i?e("Error loading binary resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}(),gl=function(){function t(t){this._blobUrls={};for(var e=0,i=t.length;e=s)throw new Error("Invalid PAX header data format.");var l=parseInt(e.decode(new Uint8Array(t,i+r,h-r)),10),c=e.decode(new Uint8Array(t,i+h+1,l-(h-r)-2)).split("=");if(2!==c.length)throw new Error("Invalid PAX header data format.");0===c[1].length&&(c[1]=null),o.push({name:c[0],value:c[1]}),r+=l}return new n(o)},n.prototype.applyHeader=function(t){for(var e=0;e0&&(a=p.trim()+a.trim())}var m={name:a,start:l,size:o,url:c};return this._globalPaxHeader&&this._globalPaxHeader.applyHeader(m),this._paxHeader&&(this._paxHeader.applyHeader(m),this._paxHeader=null),m},s.prototype.untar=function(t){if(!e)return console.error("Cannot untar because TextDecoder interface is not available for this platform."),[];for(var i=[];this._hasNext();){var n=this._readNextFile();n&&(t&&n.name&&(n.name=t+n.name),i.push(n))}return i},t&&(self.onmessage=function(t){var e=t.data.id;try{var i=new s(t.data.arrayBuffer).untar(t.data.prefix);postMessage({id:e,files:i,arrayBuffer:t.data.arrayBuffer},[t.data.arrayBuffer])}catch(t){postMessage({id:e,error:t.toString()})}})}var yl=null;var xl=function(){function t(t){this._requestId=0,this._pendingRequests={},this._filenamePrefix=t,this._worker=new Worker(function(){if(!yl){var t="("+vl.toString()+")(true)\n\n",e=new Blob([t],{type:"application/javascript"});yl=URL.createObjectURL(e)}return yl}()),this._worker.addEventListener("message",this._onMessage.bind(this))}var e=t.prototype;return e._onMessage=function(t){var e=t.data.id;if(this._pendingRequests[e]){var i=this._pendingRequests[e];if(delete this._pendingRequests[e],t.data.error)i(t.data.error);else{for(var n=t.data.arrayBuffer,s=0,a=t.data.files.length;s0},e.destroy=function(){this._worker&&(this._worker.terminate(),this._worker=null,this._pendingRequests=null)},t}();vl();var bl=function(){function t(t){this._assets=t,this._worker=null,this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i=this;st.get(t.load,{responseType:nt.ResponseType.ARRAY_BUFFER,retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(n,s){if(n)e("Error loading bundle resource "+t.original+": "+n);else try{i._untar(s,e)}catch(i){e("Error loading bundle resource "+t.original+": "+i)}}))},e._untar=function(t,e){var i=this;if(E.workers)i._worker||(i._worker=new xl(i._assets.prefix)),i._worker.untar(t,(function(t,n){e(t,n),i._worker.hasPendingRequests()||(i._worker.destroy(),i._worker=null)}));else{var n=new Ih(t).untar(i._assets.prefix);e(null,n)}},e.open=function(t,e){return new gl(e)},e.patch=function(t,e){},t}(),Sl=function(){function t(){}var e=t.prototype;return e.instantiateModelEntity=function(t){return null},e.instantiateRenderEntity=function(t){return null},t}(),wl=function(){function t(t,e){this.glbParser=new ol(t,e,0),this.parsers={}}var e=t.prototype;return e._getUrlWithoutParams=function(t){return t.indexOf("?")>=0?t.split("?")[0]:t},e._getParser=function(t){var e=t?p.getExtension(this._getUrlWithoutParams(t)).toLowerCase().replace(".",""):null;return this.parsers[e]||this.glbParser},e.load=function(t,e,i){"string"==typeof t&&(t={load:t,original:t}),this._getParser(t.original).load(t,e,i)},e.open=function(t,e,i){return this._getParser(t).open(t,e,i)},e.patch=function(t,e){},t}(),Tl=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t}),st.get(t.load,{retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(i,n){i?e("Error loading css resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}();var Al=function(){function t(t,e,i){this._device=t,this._registry=e,this._loader=i}var e=t.prototype;return e.load=function(t,e,i){this.loadAssets(i,e)},e.open=function(t,e,i){return i?i.resource:null},e.patch=function(t,e){this.loadAssets(t,(function(i,n){i&&(e.fire("error",t),e.fire("error:"+t.id,i,t),t.fire("error",t))}))},e.getAssetIds=function(t){var e=[];if(e[0]=t.file,(t.loadFaces||!t.file)&&t.data&&t.data.textures)for(var i=0;i<6;++i)e[i+1]=t.data.textures[i];else e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=null;return e},e.compareAssetIds=function(t,e){return t&&e?parseInt(t,10)===t||"string"==typeof t?t===e:t.url===e.url:null!==t==(null!==e)},e.update=function(t,e,i){var n,s,a,r=t.data||{},o=t._handlerState.assets,h=t._resources,l=[null,null,null,null,null,null,null],c=function(){return r.hasOwnProperty("type")?r.type:r.hasOwnProperty("rgbm")?r.rgbm?Ne:Be:null};if(t.loaded&&i[0]===o[0])l[1]=h[1]||null,l[2]=h[2]||null,l[3]=h[3]||null,l[4]=h[4]||null,l[5]=h[5]||null,l[6]=h[6]||null;else if(i[0])for(n=i[0].resource,a=0;a<6;++a)l[a+1]=new Di(this._device,{name:t.name+"_prelitCubemap"+(n.width>>a),cubemap:!0,type:c()||n.type,width:n.width>>a,height:n.height>>a,format:n.format,levels:[n._levels[a]],fixCubemapSeams:!0,addressU:1,addressV:1,mipmaps:0===a});var u=i.slice(1);if(t.loaded&&this.cmpArrays(u,o.slice(1)))l[0]=h[0]||null;else if(-1===u.indexOf(null)){var d=u.map((function(t){return t.resource})),f=[];for(s=0;s0,maxRetries:this.maxRetries},(function(i,s){if(i)e("Error loading font resource: "+t.original+" ["+i+"]");else{var a=Rl(s);n._loadTextures(t.load.replace(".json",".png"),a,(function(t,i){if(t)return e(t);e(null,{data:a,textures:i})}))}})):(i&&i.data&&(i.data=Rl(i.data)),this._loadTextures(t.load,i&&i.data,e))},e._loadTextures=function(t,e,i){for(var n=e.info.maps.length,s=0,a=null,r=new Array(n),o=this._loader,h=function(e){var h=function(t,o){if(!a){if(t)return a=t,i(t);o.upload(),r[e]=o,++s===n&&i(null,r)}};0===e?o.load(t,"texture",h):o.load(t.replace(".png",e+".png"),"texture",h)},l=0;l0,maxRetries:e},(function(e,n){if(e){var s="Error while loading scene JSON "+t.original;e.message?(s+=": "+e.message,e.stack&&(s+="\n"+e.stack)):s+=": "+e,i(s)}else i(e,n)}))},Nl=function(){function t(t){this._app=t,this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){Bl(t,this.maxRetries,e)},e.open=function(t,e){this._app.systems.script.preloading=!0;var i=new Fl(this._app,!1).parse(e);return this._app.systems.script.preloading=!1,i},t}(),Ul=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t}),st.get(t.load,{retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(i,n){i?e("Error loading html resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}(),zl=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i={retry:this.maxRetries>0,maxRetries:this.maxRetries};t.load.startsWith("blob:")&&(i.responseType=nt.ResponseType.JSON),st.get(t.load,i,(function(i,n){i?e("Error loading JSON resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}(),Vl=function(){function t(t,e,i,n,s){this.propertyName=t,this.parent=e,this._scope=s,this._registry=i,this.id=null,this.url=null,this.asset=null,this._onAssetLoad=n.load,this._onAssetAdd=n.add,this._onAssetRemove=n.remove,this._onAssetUnload=n.unload}var e=t.prototype;return e._bind=function(){this.id&&(this._onAssetLoad&&this._registry.on("load:"+this.id,this._onLoad,this),this._onAssetAdd&&this._registry.once("add:"+this.id,this._onAdd,this),this._onAssetRemove&&this._registry.on("remove:"+this.id,this._onRemove,this),this._onAssetUnload&&this._registry.on("unload:"+this.id,this._onUnload,this)),this.url&&(this._onAssetLoad&&this._registry.on("load:url:"+this.url,this._onLoad,this),this._onAssetAdd&&this._registry.once("add:url:"+this.url,this._onAdd,this),this._onAssetRemove&&this._registry.on("remove:url:"+this.url,this._onRemove,this))},e._unbind=function(){this.id&&(this._onAssetLoad&&this._registry.off("load:"+this.id,this._onLoad,this),this._onAssetAdd&&this._registry.off("add:"+this.id,this._onAdd,this),this._onAssetRemove&&this._registry.off("remove:"+this.id,this._onRemove,this),this._onAssetUnload&&this._registry.off("unload:"+this.id,this._onUnload,this)),this.url&&(this._onAssetLoad&&this._registry.off("load:"+this.url,this._onLoad,this),this._onAssetAdd&&this._registry.off("add:"+this.url,this._onAdd,this),this._onAssetRemove&&this._registry.off("remove:"+this.url,this._onRemove,this))},e._onLoad=function(t){this._onAssetLoad.call(this._scope,this.propertyName,this.parent,t)},e._onAdd=function(t){this.asset=t,this._onAssetAdd.call(this._scope,this.propertyName,this.parent,t)},e._onRemove=function(t){this._onAssetRemove.call(this._scope,this.propertyName,this.parent,t),this.asset=null},e._onUnload=function(t){this._onAssetUnload.call(this._scope,this.propertyName,this.parent,t)},W(t,[{key:"id",get:function(){return this._id},set:function(t){if(this.url)throw Error("Can't set id and url");this._unbind(),this._id=t,this.asset=this._registry.get(this._id),this._bind()}},{key:"url",get:function(){return this._url},set:function(t){if(this.id)throw Error("Can't set id and url");this._unbind(),this._url=t,this.asset=this._registry.getByUrl(this._url),this._bind()}}]),t}(),Wl=function(){function t(){this.removeInvalid=!0,this.valid=!0,this.enumValidators={occludeSpecular:this._createEnumValidator([0,1,2]),cull:this._createEnumValidator([0,1,2,3]),blendType:this._createEnumValidator([0,1,2,3,4,5,6,7,8,9,10]),shadingModel:this._createEnumValidator([0,1])}}var e=t.prototype;return e.setInvalid=function(t,e){this.valid=!1,this.removeInvalid&&delete e[t]},e.validate=function(t){var e=Kn,i="path"===t.mappingFormat;for(var n in t){var s=e[n];if(s)if(s.startsWith("enum")){var a=s.split(":")[1];this.enumValidators[a]&&(this.enumValidators[a](t[n])||this.setInvalid(n,t))}else if("number"===s)"number"!=typeof t[n]&&this.setInvalid(n,t);else if("boolean"===s)"boolean"!=typeof t[n]&&this.setInvalid(n,t);else if("string"===s)"string"!=typeof t[n]&&this.setInvalid(n,t);else if("vec2"===s)t[n]instanceof Array&&2===t[n].length||this.setInvalid(n,t);else if("rgb"===s)t[n]instanceof Array&&3===t[n].length||this.setInvalid(n,t);else if("texture"===s)i?"string"!=typeof t[n]&&null!==t[n]&&(t[n]instanceof Di||this.setInvalid(n,t)):"number"!=typeof t[n]&&null!==t[n]&&(t[n]instanceof Di||this.setInvalid(n,t));else if("boundingbox"===s)t[n].center&&t[n].center instanceof Array&&3===t[n].center.length||this.setInvalid(n,t),t[n].halfExtents&&t[n].halfExtents instanceof Array&&3===t[n].halfExtents.length||this.setInvalid(n,t);else if("cubemap"===s)"number"!=typeof t[n]&&null!==t[n]&&void 0!==t[n]&&(t[n]instanceof Di&&t[n].cubemap||this.setInvalid(n,t));else if("chunks"===s)for(var r=Object.keys(t[n]),o=0;o=0}},t}(),Gl=function(){function t(){this._validator=null}var e=t.prototype;return e.parse=function(t){var e=this.migrate(t),i=this._validate(e),n=new ns;return this.initialize(n,i),n},e.initialize=function(t,e){for(var i in e.validated||(e=this._validate(e)),e.chunks&&(t.chunks=G({},e.chunks)),e){var n=Kn[i],s=e[i];if("vec2"===n)t[i]=new ut(s[0],s[1]);else if("rgb"===n)t[i]=new at(s[0],s[1],s[2]);else if("texture"===n)s instanceof Di?t[i]=s:t[i]instanceof Di&&"number"==typeof s&&s>0||(t[i]=null);else if("cubemap"===n)s instanceof Di?t[i]=s:t[i]instanceof Di&&"number"==typeof s&&s>0||(t[i]=null),"cubeMap"!==i||s||(t.prefilteredCubemaps=null);else if("boundingbox"===n){var a=new lt(s.center[0],s.center[1],s.center[2]),r=new lt(s.halfExtents[0],s.halfExtents[1],s.halfExtents[2]);t[i]=new At(a,r)}else t[i]=e[i]}t.update()},e.migrate=function(t){var e;void 0===t.shadingModel&&("blinn"===t.shader?t.shadingModel=1:t.shadingModel=0),t.shader&&delete t.shader,t.mapping_format&&(t.mappingFormat=t.mapping_format,delete t.mapping_format);var i=[["bumpMapFactor","bumpiness"],["aoUvSet","aoMapUv"],["aoMapVertexColor","aoVertexColor"],["diffuseMapVertexColor","diffuseVertexColor"],["emissiveMapVertexColor","emissiveVertexColor"],["specularMapVertexColor","specularVertexColor"],["metalnessMapVertexColor","metalnessVertexColor"],["opacityMapVertexColor","opacityVertexColor"],["glossMapVertexColor","glossVertexColor"],["lightMapVertexColor","lightVertexColor"],["diffuseMapTint","diffuseTint"],["specularMapTint","specularTint"],["emissiveMapTint","emissiveTint"],["metalnessMapTint","metalnessTint"]];for(e=0;e0,maxRetries:this.maxRetries},(function(i,n){i?e&&e("Error loading material: "+t.original+" ["+i+"]"):e&&(n._engine=!0,e(null,n))}))},e.open=function(t,e){var i=this._parser.parse(e);return e._engine&&(i._data=e,delete e._engine),i},e._createPlaceholders=function(){this._placeholderTextures={};var t={white:[255,255,255,255],gray:[128,128,128,255],black:[0,0,0,255],normal:[128,128,255,255]};for(var e in t)if(t.hasOwnProperty(e)){this._placeholderTextures[e]=new Di(this._device,{width:2,height:2,format:7}),this._placeholderTextures[e].name="placeholder";for(var i=this._placeholderTextures[e].lock(),n=0;n<4;n++)for(var s=0;s<4;s++)i[4*n+s]=t[e][s];this._placeholderTextures[e].unlock()}},e.patch=function(t,e){t.resource._data&&(t._data=t.resource._data,delete t.resource._data),t.data.name=t.name,t.resource.name=t.name,this._bindAndAssignAssets(t,e),t.off("unload",this._onAssetUnload,this),t.on("unload",this._onAssetUnload,this)},e._onAssetUnload=function(t){delete t.data.parameters,delete t.data.chunks,delete t.data.name},e._assignTexture=function(t,e,i){e.resource[t]=i},e._getPlaceholderTexture=function(t){this._placeholderTextures||this._createPlaceholders();var e=Hl[t];return this._placeholderTextures[e]},e._assignPlaceholderTexture=function(t,e){e.resource[t]=this._getPlaceholderTexture(t,e)},e._onTextureLoad=function(t,e,i){this._assignTexture(t,e,i.resource),e.resource.update()},e._onTextureAdd=function(t,e,i){this._assets.load(i)},e._onTextureRemoveOrUnload=function(t,e,i){var n=e.resource;n&&e.resource[t]===i.resource&&(this._assignPlaceholderTexture(t,e),n.update())},e._assignCubemap=function(t,e,i){e.resource[t]=i[0],"cubeMap"===t&&(e.resource.prefilteredCubemaps=i.slice(1))},e._onCubemapLoad=function(t,e,i){this._assignCubemap(t,e,i.resources),this._parser.initialize(e.resource,e.data)},e._onCubemapAdd=function(t,e,i){0===e.data.shadingModel&&(e.loadFaces=!0),this._assets.load(i)},e._onCubemapRemoveOrUnload=function(t,e,i){var n=e.resource;e.data.prefilteredCubeMap128===i.resources[1]&&(this._assignCubemap(t,e,[null,null,null,null,null,null,null]),n.update())},e._bindAndAssignAssets=function(t,e){var i,n,s,a=this._parser.migrate(t.data),r=t.resource,o="path"===a.mappingFormat,h=Zn;for(i=0;i0){for(var c=i.blendIndices.data[4*h+l],u=!0,d=0;dn)return!1;for(var f=0;f=0;n--)if(l[n].boneNames.length>i){var f=l.splice(n,1)[0],p=[];for(s=0;s=0;a--)u[a].mesh===_.originalMesh&&(u.push({mesh:o,node:u[a].node}),e&&e.push({material:e[a].material,path:e[a].path}));for(s=0;s=0;a--)u[a].mesh===_.originalMesh&&(u.splice(a,1),e&&e.splice(a,1))}!function(t){for(var e=t.vertices,i=t.skins,n=t.meshes,s=t.meshInstances,a=0;a0&&Kl(s,null,this._device.getBoneLimit());for(i=0;i0&&(h>65535&&this._device.extUintElement?(s=new ys(this._device,2,r),a=new Uint32Array(s.lock())):(s=new ys(this._device,1,r),a=new Uint16Array(s.lock()))),{buffer:s,data:a}},e._parseMeshes=function(t,e,i,n,s,a){for(var r=t.model,o=[],h=0,l=0;l0,maxRetries:this.maxRetries};(t.load.startsWith("blob:")||t.load.startsWith("data:"))&&(".glb"===p.getExtension(t.original).toLowerCase()?i.responseType=nt.ResponseType.ARRAY_BUFFER:i.responseType=nt.ResponseType.JSON),st.get(t.load,i,(function(i,n){e&&(i?e("Error loading model: "+t.original+" ["+i+"]"):e(null,n))}))},e.open=function(t,e){for(var i=0;i0?console.assert("Script Ordering Error. Contact support@playcanvas.com"):t._types.push(e)};var e=t.prototype;return e.load=function(e,i){var n=this;"string"==typeof e&&(e={load:e,original:e});var s=this;hc.app=this._app,this._loadScript(e.load,(function(e,a,r){if(e)i(e);else if(hc.legacy){var o=null;t._types.length&&(o=t._types.pop()),o?n._scripts[a]=o:o=null,i(null,o,r)}else{for(var h={},l=0;l0,maxRetries:this.maxRetries},(function(i,n){i?e("Error loading shader resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}(),uc=[0,0,1,0,0,1,0,0,1,0,0,1],dc=[0,1,3,2,3,1],fc=function(t){function e(e,i){var n;return(n=t.call(this)||this)._device=e,n._pixelsPerUnit=i&&void 0!==i.pixelsPerUnit?i.pixelsPerUnit:1,n._renderMode=i&&void 0!==i.renderMode?i.renderMode:0,n._atlas=i&&void 0!==i.atlas?i.atlas:null,n._frameKeys=i&&void 0!==i.frameKeys?i.frameKeys:null,n._meshes=[],n._updatingProperties=!1,n._meshesDirty=!1,n._atlas&&n._frameKeys&&n._createMeshes(),n}H(e,t);var i=e.prototype;return i._createMeshes=function(){for(var t=this._meshes.length,e=0;e0,maxRetries:this.maxRetries},(function(t,i){t?e(t):e(null,i)}))},e.open=function(t,e){var i=new fc(this._device);return t&&(i.__data=e),i},e.patch=function(t,e){var i=t.resource;if(i.__data&&(t.data.pixelsPerUnit=i.__data.pixelsPerUnit,t.data.renderMode=i.__data.renderMode,t.data.frameKeys=i.__data.frameKeys,i.__data.textureAtlasAsset)){var n=e.getByUrl(i.__data.textureAtlasAsset);n?t.data.textureAtlasAsset=n.id:console.warn("Could not find textureatlas with url: "+i.__data.textureAtlasAsset)}i.startUpdate(),i.renderMode=t.data.renderMode,i.pixelsPerUnit=t.data.pixelsPerUnit,i.frameKeys=t.data.frameKeys,this._updateAtlas(t),i.endUpdate(),t.off("change",this._onAssetChange,this),t.on("change",this._onAssetChange,this)},e._updateAtlas=function(t){var e=t.resource;if(t.data.textureAtlasAsset){this._assets.off("load:"+t.data.textureAtlasAsset,mc,t),this._assets.on("load:"+t.data.textureAtlasAsset,mc,t);var i=this._assets.get(t.data.textureAtlasAsset);i&&i.resource?e.atlas=i.resource:i?this._assets.load(i):(this._assets.off("add:"+t.data.textureAtlasAsset,_c,t),this._assets.on("add:"+t.data.textureAtlasAsset,_c,t))}else e.atlas=null},e._onAssetChange=function(t,e,i,n){"data"===e&&i&&i.textureAtlasAsset&&n&&i.textureAtlasAsset!==n.textureAtlasAsset&&(this._assets.off("load:"+n.textureAtlasAsset,mc,t),this._assets.off("add:"+n.textureAtlasAsset,_c,t))},t}(),vc=function(){function t(t,e){this._app=t,this._data=e,this._templateRoot=null}var e=t.prototype;return e.instantiate=function(){return this._templateRoot||this._parseTemplate(),this._templateRoot.clone()},e._parseTemplate=function(){var t=new Fl(this._app,!0);this._templateRoot=t.parse(this._data)},t}(),yc=function(){function t(t){this._app=t,this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i={retry:this.maxRetries>0,maxRetries:this.maxRetries};st.get(t.load,i,(function(i,n){i?e("Error requesting template: "+t.original):e(i,n)}))},e.open=function(t,e){return new vc(this._app,e)},t}(),xc=function(){function t(){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t}),st.get(t.load,{retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(i,n){i?e("Error loading text resource: "+t.original+" ["+i+"]"):e(null,n)}))},e.open=function(t,e){return e},e.patch=function(t,e){},t}(),bc=function(t){function e(){var e;return(e=t.call(this)||this)._texture=null,e._frames=null,e}H(e,t);var i=e.prototype;return i.setFrame=function(t,e){var i=this._frames[t];i?(i.rect.copy(e.rect),i.pivot.copy(e.pivot),i.border.copy(e.border)):(i={rect:e.rect.clone(),pivot:e.pivot.clone(),border:e.border.clone()},this._frames[t]=i),this.fire("set:frame",t.toString(),i)},i.removeFrame=function(t){var e=this._frames[t];e&&(delete this._frames[t],this.fire("remove:frame",t.toString(),e))},i.destroy=function(){this._texture&&this._texture.destroy()},W(e,[{key:"texture",get:function(){return this._texture},set:function(t){this._texture=t,this.fire("set:texture",t)}},{key:"frames",get:function(){return this._frames},set:function(t){this._frames=t,this.fire("set:frames",t)}}]),e}(u),Sc={repeat:0,clamp:1,mirror:2},wc={nearest:0,linear:1,nearest_mip_nearest:2,linear_mip_nearest:4,nearest_mip_linear:3,linear_mip_linear:5},Tc=/^data\.frames\.(\d+)$/,Ac=function(){function t(t){this._loader=t,this.maxRetries=0}var e=t.prototype;return e.load=function(t,e){"string"==typeof t&&(t={load:t,original:t});var i=this,n=this._loader.getHandler("texture");if(".json"!==p.getExtension(t.original))return n.load(t,e);st.get(t.load,{retry:this.maxRetries>0,maxRetries:this.maxRetries},(function(n,s){if(n)e(n);else{var a=t.original.replace(".json",".png");i._loader.load(a,"texture",(function(t,i){t?e(t):e(null,{data:s,texture:i})}))}}))},e.open=function(t,e){var i=new bc;if(e.texture&&e.data)i.texture=e.texture,i.__data=e.data;else{var n=this._loader.getHandler("texture").open(t,e);if(!n)return null;i.texture=n}return i},e.patch=function(t,e){t.resource.__data&&(void 0!==t.resource.__data.minfilter&&(t.data.minfilter=t.resource.__data.minfilter),void 0!==t.resource.__data.magfilter&&(t.data.magfilter=t.resource.__data.magfilter),void 0!==t.resource.__data.addressu&&(t.data.addressu=t.resource.__data.addressu),void 0!==t.resource.__data.addressv&&(t.data.addressv=t.resource.__data.addressv),void 0!==t.resource.__data.mipmaps&&(t.data.mipmaps=t.resource.__data.mipmaps),void 0!==t.resource.__data.anisotropy&&(t.data.anisotropy=t.resource.__data.anisotropy),void 0!==t.resource.__data.rgbm&&(t.data.rgbm=!!t.resource.__data.rgbm),t.data.frames=t.resource.__data.frames,delete t.resource.__data);var i=t.resource.texture;if(i&&(i.name=t.name,t.data.hasOwnProperty("minfilter")&&i.minFilter!==wc[t.data.minfilter]&&(i.minFilter=wc[t.data.minfilter]),t.data.hasOwnProperty("magfilter")&&i.magFilter!==wc[t.data.magfilter]&&(i.magFilter=wc[t.data.magfilter]),t.data.hasOwnProperty("addressu")&&i.addressU!==Sc[t.data.addressu]&&(i.addressU=Sc[t.data.addressu]),t.data.hasOwnProperty("addressv")&&i.addressV!==Sc[t.data.addressv]&&(i.addressV=Sc[t.data.addressv]),t.data.hasOwnProperty("mipmaps")&&i.mipmaps!==t.data.mipmaps&&(i.mipmaps=t.data.mipmaps),t.data.hasOwnProperty("anisotropy")&&i.anisotropy!==t.data.anisotropy&&(i.anisotropy=t.data.anisotropy),t.data.hasOwnProperty("rgbm"))){var n=t.data.rgbm?Ne:Be;i.type!==n&&(i.type=n)}t.resource.texture=i;var s={};for(var a in t.data.frames){var r=t.data.frames[a];s[a]={rect:new dt(r.rect),pivot:new ut(r.pivot),border:new dt(r.border)}}t.resource.frames=s,t.off("change",this._onAssetChange,this),t.on("change",this._onAssetChange,this)},e._onAssetChange=function(t,e,i){var n;if("data"===e||"data.frames"===e){var s={};for(var a in i.frames)n=i.frames[a],s[a]={rect:new dt(n.rect),pivot:new ut(n.pivot),border:new dt(n.border)};t.resource.frames=s}else{var r=e.match(Tc);if(r){var o=r[1];i?(t.resource.frames[o]?((n=t.resource.frames[o]).rect.set(i.rect[0],i.rect[1],i.rect[2],i.rect[3]),n.pivot.set(i.pivot[0],i.pivot[1]),n.border.set(i.border[0],i.border[1],i.border[2],i.border[3])):t.resource.frames[o]={rect:new dt(i.rect),pivot:new ut(i.pivot),border:new dt(i.border)},t.resource.fire("set:frame",o,t.resource.frames[o])):t.resource.frames[o]&&(delete t.resource.frames[o],t.resource.fire("remove:frame",o))}}},t}();function Mc(){var t,e,i,n=0,s=1,a=2,r=3,o=8,h=9,l=10,c=11,u=12,d=13,f=14,p=16,m={astc:l,dxt:a,etc1:n,etc2:n,pvr:o,atc:c,none:f},_={astc:l,dxt:r,etc1:p,etc2:s,pvr:h,atc:u,none:p},g=21,v=22,y=23,x=8,b=10,S=26,w=27,T=28,A=29,M=30,C=7,E=3,P=5,R=function(t,e){switch(t){case n:return e.formats.etc1?g:v;case s:return y;case a:return x;case r:return b;case o:return S;case h:return w;case l:return T;case c:return A;case u:return M;case d:return C;case f:return E;case p:return P}},I=function(t){for(var e=function(t,e){var i=t*(2/255)-1,n=e*(2/255)-1,s=Math.sqrt(1-Math.min(1,i*i+n*n));return Math.max(0,Math.min(255,Math.floor(.5*(s+1)*255)))},i=0;i>3}return e},D=function(){return"undefined"!=typeof performance?performance.now():0},k=function(t,n,s){if(s){if(t.formats.astc)return"astc"}else if(n){if(t.formats.etc2)return"etc2"}else if(t.formats.etc1||t.formats.etc2)return"etc1";return function(e){for(var i=0;i0?this.clients.shift().run(s):this.queue.push(s)}},e.enqueueClient=function(t){this.queue.length>0?t.run(this.queue.shift()):this.clients.push(t)},e.handleResponse=function(t,e,i){var n=this.callbacks[t];if(e)for(var s=0;s0&&++r<=o){var i=100*Math.pow(2,r);console.log("Error loading Texture from: '"+e+"' - Retrying in "+i+"ms...");var h=t.indexOf("?")>=0?"&":"?";a=setTimeout((function(){s.src=t+h+"retry="+Date.now(),a=null}),i)}else n("Error loading Texture from: '"+e+"'")},s.src=t},e._loadImageBitmap=function(t,e,i,n){var s={cache:!0,responseType:"blob",retry:this.maxRetries>0,maxRetries:this.maxRetries};st.get(t,s,(function(t,e){t?n(t):createImageBitmap(e,{premultiplyAlpha:"none"}).then((function(t){n(null,t)})).catch((function(t){n(t)}))}))},t}(),zc=[1481919403,3140563232,169478669],Vc={33776:8,33778:9,33779:Kt,36196:ie,37492:22,37496:23,35840:26,35841:ne,35842:27,35843:se,32849:6,32856:7,35905:19,35907:20,35898:18,34843:Zt,34842:$t};var Wc=function(){function t(t){this.maxRetries=0}var e=t.prototype;return e.load=function(t,e,i){Eh.fetchArrayBuffer(t.load,e,i,this.maxRetries)},e.open=function(t,e,i){var n=this.parse(e);if(!n)return null;var s=new Di(i,{name:t,addressU:n.cubemap?1:0,addressV:n.cubemap?1:0,width:n.width,height:n.height,format:n.format,cubemap:n.cubemap,levels:n.levels});return s.upload(),s},e.parse=function(t){var e=new Uint32Array(t);if(zc[0]!==e[0]||zc[1]!==e[1]||zc[2]!==e[2])return null;var i={endianness:e[3],glType:e[4],glTypeSize:e[5],glFormat:e[6],glInternalFormat:e[7],glBaseInternalFormat:e[8],pixelWidth:e[9],pixelHeight:e[10],pixelDepth:e[11],numberOfArrayElements:e[12],numberOfFaces:e[13],numberOfMipmapLevels:e[14],bytesOfKeyValueData:e[15]};if(i.pixelDepth>1)return null;if(0!==i.numberOfArrayElements)return null;var n=Vc[i.glInternalFormat];if(void 0===n)return null;for(var s,a,r,o=16+i.bytesOfKeyValueData/4,h=i.numberOfFaces>1,l=[],c=0;c<(i.numberOfMipmapLevels||1);c++){var u=e[o++];h&&l.push([]);for(var d=h?l[c]:l,f=0;f<(h?6:1);++f)d.push((s=t,a=4*o,r=u,18===n?new Uint32Array(s,a,r/4):new Uint8Array(s,a,r))),o+=u+3>>2}return{format:n,width:i.pixelWidth,height:i.pixelHeight,levels:l,cubemap:h}},t}(),Gc=166,Hc=function(){function t(t,e){this.maxRetries=0,this.device=e}var e=t.prototype;return e.load=function(t,e,i){var n=this;Eh.fetchArrayBuffer(t.load,(function(s,a){s?e(s,a):n.parse(a,t,e,i)}),i,this.maxRetries)},e.open=function(t,e,i){var n=new Di(i,{name:t,addressU:e.cubemap?1:0,addressV:e.cubemap?1:0,width:e.width,height:e.height,format:e.format,cubemap:e.cubemap,levels:e.levels});return n.upload(),n},e.parse=function(t,e,i,n){var s=new K(t),a=[s.readU32be(),s.readU32be(),s.readU32be()];if(2873840728!==a[0]||540160187!==a[1]||218765834!==a[2])return null;for(var r={vkFormat:s.readU32(),typeSize:s.readU32(),pixelWidth:s.readU32(),pixelHeight:s.readU32(),pixelDepth:s.readU32(),layerCount:s.readU32(),faceCount:s.readU32(),levelCount:s.readU32(),supercompressionScheme:s.readU32()},o={dfdByteOffset:s.readU32(),dfdByteLength:s.readU32(),kvdByteOffset:s.readU32(),kvdByteLength:s.readU32(),sgdByteOffset:s.readU64(),sgdByteLength:s.readU64()},h=[],l=0;l1});for(var b,S=128,w=u?6:1,T=l===d?8:16,A=0;A32767)return this._readPixelsFlat(t,e,i);var s=[0,0,0,0];if(t.readArray(s),2!==s[0]||2!==s[1]||0!=(128&s[2]))return t.skip(-4),this._readPixelsFlat(t,e,i);var a,r,o,h,l,c,u=new ArrayBuffer(e*i*4),d=new Uint8Array(u),f=n?0:4*e*(i-1);for(r=0;r128){if(a+(l-=128)>e)return null;for(c=t.readU8(),o=0;oe)return null;for(o=0;o=0?t.split("?")[0]:t},e._getParser=function(t){var e=p.getExtension(this._getUrlWithoutParams(t)).toLowerCase().replace(".","");return this.parsers[e]||this.imgParser},e.load=function(t,e,i){"string"==typeof t&&(t={load:t,original:t}),this._getParser(t.original).load(t,e,i)},e.open=function(t,e,i){if(t){var n=this._getParser(t).open(t,e,this._device);return null===n?n=new Di(this._device,{width:4,height:4,format:6}):(!function(t){var e=Math.log2(Math.max(t._width,t._height))+1;if(!(7!==t._format&&t._format!==Jt||t._volume||t._compressed||1===t._levels.length||t._levels.length===e||(i=t._cubemap?t._levels[0][0]:t._levels[0],i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement))){for(var i,n=function(t,e,i){for(var n=Math.max(1,t>>1),s=Math.max(1,e>>1),a=new i.constructor(n*s*4),r=Math.floor(t/n),o=Math.floor(e/s),h=r*o,l=0;l>s-1),r=Math.max(1,t._height>>s-1);if(t._cubemap){for(var o=[],h=0;h<6;++h)o.push(n(a,r,t._levels[s-1][h]));t._levels.push(o)}else t._levels.push(n(a,r,t._levels[s-1]))}t._levelsUpdated=t._cubemap?[[!0,!0,!0,!0,!0,!0]]:[!0]}}(n),e.unswizzledGGGR&&(i.file.variants.basis.opt&=-9)),n}},e.patch=function(t,e){var i=t.resource;if(i){t.name&&t.name.length>0&&(i.name=t.name);var n=t.data;n.hasOwnProperty("minfilter")&&(i.minFilter=Yc[n.minfilter]),n.hasOwnProperty("magfilter")&&(i.magFilter=Yc[n.magfilter]),i.cubemap||(n.hasOwnProperty("addressu")&&(i.addressU=jc[n.addressu]),n.hasOwnProperty("addressv")&&(i.addressV=jc[n.addressv])),n.hasOwnProperty("mipmaps")&&(i.mipmaps=n.mipmaps),n.hasOwnProperty("anisotropy")&&(i.anisotropy=n.anisotropy),n.hasOwnProperty("flipY")&&(i.flipY=!!n.flipY),n.hasOwnProperty("type")?i.type=Kc[n.type]:n.hasOwnProperty("rgbm")&&n.rgbm?i.type=Ne:t.file&&0!=(8&t.file.opt)&&(i.type=ze)}},W(t,[{key:"crossOrigin",get:function(){return this.imgParser.crossOrigin},set:function(t){this.imgParser.crossOrigin=t}},{key:"maxRetries",get:function(){return this.imgParser.maxRetries},set:function(t){for(var e in this.imgParser.maxRetries=t,this.parsers)this.parsers.hasOwnProperty(e)&&(this.parsers[e].maxRetries=t)}}]),t}(),Qc=function(){function t(t){void 0===t&&(t=null),this._index={},this._key=t}var e=t.prototype;return e.addItem=function(t){for(var e,i=Y(t.tags._list);!(e=i()).done;){var n=e.value;this.add(n,t)}},e.removeItem=function(t){for(var e,i=Y(t.tags._list);!(e=i()).done;){var n=e.value;this.remove(n,t)}},e.add=function(t,e){this._index[t]&&-1!==this._index[t].list.indexOf(e)||(this._index[t]||(this._index[t]={list:[]},this._key&&(this._index[t].keys={})),this._index[t].list.push(e),this._key&&(this._index[t].keys[e[this._key]]=e))},e.remove=function(t,e){if(this._index[t]&&(!this._key||this._index[t].keys[e[this._key]])){var i=this._index[t].list.indexOf(e);-1!==i&&(this._index[t].list.splice(i,1),this._key&&delete this._index[t].keys[e[this._key]],0===this._index[t].list.length&&delete this._index[t])}},e.find=function(t){for(var e,i,n,s,a,r=this,o={},h=[],l=function(t,e){return r._index[t].list.length-r._index[e].list.length},c=0;c0?i[0]:null},e}(u),tu=function(){function t(t){this._assets=t,this._bundleAssets={},this._assetsInBundles={},this._urlsInBundles={},this._fileRequests={},this._assets.on("add",this._onAssetAdded,this),this._assets.on("remove",this._onAssetRemoved,this)}var e=t.prototype;return e._onAssetAdded=function(t){if("bundle"===t.type){this._bundleAssets[t.id]=t,this._registerBundleEventListeners(t.id);for(var e=0,i=t.data.assets.length;e=3&&i.length<=4){for(var u=0;u