UNPKG

next

Version:

The React Framework

1 lines • 2.58 MB
(function(){var v={60485:function(v,I){"use strict";Object.defineProperty(I,"__esModule",{value:true});I.cloneNode=cloneNode;function cloneNode(v){return Object.assign({},v)}},65008:function(v,I,P){"use strict";Object.defineProperty(I,"__esModule",{value:true});var R={numberLiteralFromRaw:true,withLoc:true,withRaw:true,funcParam:true,indexLiteral:true,memIndexLiteral:true,instruction:true,objectInstruction:true,traverse:true,signatures:true,cloneNode:true,moduleContextFromModuleAST:true};Object.defineProperty(I,"numberLiteralFromRaw",{enumerable:true,get:function get(){return L.numberLiteralFromRaw}});Object.defineProperty(I,"withLoc",{enumerable:true,get:function get(){return L.withLoc}});Object.defineProperty(I,"withRaw",{enumerable:true,get:function get(){return L.withRaw}});Object.defineProperty(I,"funcParam",{enumerable:true,get:function get(){return L.funcParam}});Object.defineProperty(I,"indexLiteral",{enumerable:true,get:function get(){return L.indexLiteral}});Object.defineProperty(I,"memIndexLiteral",{enumerable:true,get:function get(){return L.memIndexLiteral}});Object.defineProperty(I,"instruction",{enumerable:true,get:function get(){return L.instruction}});Object.defineProperty(I,"objectInstruction",{enumerable:true,get:function get(){return L.objectInstruction}});Object.defineProperty(I,"traverse",{enumerable:true,get:function get(){return q.traverse}});Object.defineProperty(I,"signatures",{enumerable:true,get:function get(){return K.signatures}});Object.defineProperty(I,"cloneNode",{enumerable:true,get:function get(){return ge.cloneNode}});Object.defineProperty(I,"moduleContextFromModuleAST",{enumerable:true,get:function get(){return be.moduleContextFromModuleAST}});var $=P(6881);Object.keys($).forEach((function(v){if(v==="default"||v==="__esModule")return;if(Object.prototype.hasOwnProperty.call(R,v))return;if(v in I&&I[v]===$[v])return;Object.defineProperty(I,v,{enumerable:true,get:function get(){return $[v]}})}));var L=P(72882);var q=P(87786);var K=P(10644);var ae=P(89095);Object.keys(ae).forEach((function(v){if(v==="default"||v==="__esModule")return;if(Object.prototype.hasOwnProperty.call(R,v))return;if(v in I&&I[v]===ae[v])return;Object.defineProperty(I,v,{enumerable:true,get:function get(){return ae[v]}})}));var ge=P(60485);var be=P(89711)},72882:function(v,I,P){"use strict";Object.defineProperty(I,"__esModule",{value:true});I.numberLiteralFromRaw=numberLiteralFromRaw;I.instruction=instruction;I.objectInstruction=objectInstruction;I.withLoc=withLoc;I.withRaw=withRaw;I.funcParam=funcParam;I.indexLiteral=indexLiteral;I.memIndexLiteral=memIndexLiteral;var R=P(98260);var $=P(6881);function numberLiteralFromRaw(v){var I=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"i32";var P=v;if(typeof v==="string"){v=v.replace(/_/g,"")}if(typeof v==="number"){return(0,$.numberLiteral)(v,String(P))}else{switch(I){case"i32":{return(0,$.numberLiteral)((0,R.parse32I)(v),String(P))}case"u32":{return(0,$.numberLiteral)((0,R.parseU32)(v),String(P))}case"i64":{return(0,$.longNumberLiteral)((0,R.parse64I)(v),String(P))}case"f32":{return(0,$.floatLiteral)((0,R.parse32F)(v),(0,R.isNanLiteral)(v),(0,R.isInfLiteral)(v),String(P))}default:{return(0,$.floatLiteral)((0,R.parse64F)(v),(0,R.isNanLiteral)(v),(0,R.isInfLiteral)(v),String(P))}}}}function instruction(v){var I=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var P=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return(0,$.instr)(v,undefined,I,P)}function objectInstruction(v,I){var P=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var R=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};return(0,$.instr)(v,I,P,R)}function withLoc(v,I,P){var R={start:P,end:I};v.loc=R;return v}function withRaw(v,I){v.raw=I;return v}function funcParam(v,I){return{id:I,valtype:v}}function indexLiteral(v){var I=numberLiteralFromRaw(v,"u32");return I}function memIndexLiteral(v){var I=numberLiteralFromRaw(v,"u32");return I}},98935:function(v,I){"use strict";Object.defineProperty(I,"__esModule",{value:true});I.createPath=createPath;function ownKeys(v,I){var P=Object.keys(v);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(v);if(I){R=R.filter((function(I){return Object.getOwnPropertyDescriptor(v,I).enumerable}))}P.push.apply(P,R)}return P}function _objectSpread(v){for(var I=1;I<arguments.length;I++){var P=arguments[I]!=null?arguments[I]:{};if(I%2){ownKeys(Object(P),true).forEach((function(I){_defineProperty(v,I,P[I])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(v,Object.getOwnPropertyDescriptors(P))}else{ownKeys(Object(P)).forEach((function(I){Object.defineProperty(v,I,Object.getOwnPropertyDescriptor(P,I))}))}}return v}function _defineProperty(v,I,P){if(I in v){Object.defineProperty(v,I,{value:P,enumerable:true,configurable:true,writable:true})}else{v[I]=P}return v}function findParent(v,I){var P=v.parentPath;if(P==null){throw new Error("node is root")}var R=P;while(I(R)!==false){if(R.parentPath==null){return null}R=R.parentPath}return R.node}function insertBefore(v,I){return insert(v,I)}function insertAfter(v,I){return insert(v,I,1)}function insert(v,I){var P=v.node,R=v.inList,$=v.parentPath,L=v.parentKey;var q=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(!R){throw new Error("inList"+" error: "+("insert can only be used for nodes that are within lists"||0))}if(!($!=null)){throw new Error("parentPath != null"+" error: "+("Can not remove root node"||0))}var K=$.node[L];var ae=K.findIndex((function(v){return v===P}));K.splice(ae+q,0,I)}function remove(v){var I=v.node,P=v.parentKey,R=v.parentPath;if(!(R!=null)){throw new Error("parentPath != null"+" error: "+("Can not remove root node"||0))}var $=R.node;var L=$[P];if(Array.isArray(L)){$[P]=L.filter((function(v){return v!==I}))}else{delete $[P]}I._deleted=true}function stop(v){v.shouldStop=true}function replaceWith(v,I){var P=v.parentPath.node;var R=P[v.parentKey];if(Array.isArray(R)){var $=R.findIndex((function(I){return I===v.node}));R.splice($,1,I)}else{P[v.parentKey]=I}v.node._deleted=true;v.node=I}function bindNodeOperations(v,I){var P=Object.keys(v);var R={};P.forEach((function(P){R[P]=v[P].bind(null,I)}));return R}function createPathOperations(v){return bindNodeOperations({findParent:findParent,replaceWith:replaceWith,remove:remove,insertBefore:insertBefore,insertAfter:insertAfter,stop:stop},v)}function createPath(v){var I=_objectSpread({},v);Object.assign(I,createPathOperations(I));return I}},6881:function(v,I){"use strict";Object.defineProperty(I,"__esModule",{value:true});I.module=_module;I.moduleMetadata=moduleMetadata;I.moduleNameMetadata=moduleNameMetadata;I.functionNameMetadata=functionNameMetadata;I.localNameMetadata=localNameMetadata;I.binaryModule=binaryModule;I.quoteModule=quoteModule;I.sectionMetadata=sectionMetadata;I.producersSectionMetadata=producersSectionMetadata;I.producerMetadata=producerMetadata;I.producerMetadataVersionedName=producerMetadataVersionedName;I.loopInstruction=loopInstruction;I.instr=instr;I.ifInstruction=ifInstruction;I.stringLiteral=stringLiteral;I.numberLiteral=numberLiteral;I.longNumberLiteral=longNumberLiteral;I.floatLiteral=floatLiteral;I.elem=elem;I.indexInFuncSection=indexInFuncSection;I.valtypeLiteral=valtypeLiteral;I.typeInstruction=typeInstruction;I.start=start;I.globalType=globalType;I.leadingComment=leadingComment;I.blockComment=blockComment;I.data=data;I.global=global;I.table=table;I.memory=memory;I.funcImportDescr=funcImportDescr;I.moduleImport=moduleImport;I.moduleExportDescr=moduleExportDescr;I.moduleExport=moduleExport;I.limit=limit;I.signature=signature;I.program=program;I.identifier=identifier;I.blockInstruction=blockInstruction;I.callInstruction=callInstruction;I.callIndirectInstruction=callIndirectInstruction;I.byteArray=byteArray;I.func=func;I.internalBrUnless=internalBrUnless;I.internalGoto=internalGoto;I.internalCallExtern=internalCallExtern;I.internalEndAndReturn=internalEndAndReturn;I.assertInternalCallExtern=I.assertInternalGoto=I.assertInternalBrUnless=I.assertFunc=I.assertByteArray=I.assertCallIndirectInstruction=I.assertCallInstruction=I.assertBlockInstruction=I.assertIdentifier=I.assertProgram=I.assertSignature=I.assertLimit=I.assertModuleExport=I.assertModuleExportDescr=I.assertModuleImport=I.assertFuncImportDescr=I.assertMemory=I.assertTable=I.assertGlobal=I.assertData=I.assertBlockComment=I.assertLeadingComment=I.assertGlobalType=I.assertStart=I.assertTypeInstruction=I.assertValtypeLiteral=I.assertIndexInFuncSection=I.assertElem=I.assertFloatLiteral=I.assertLongNumberLiteral=I.assertNumberLiteral=I.assertStringLiteral=I.assertIfInstruction=I.assertInstr=I.assertLoopInstruction=I.assertProducerMetadataVersionedName=I.assertProducerMetadata=I.assertProducersSectionMetadata=I.assertSectionMetadata=I.assertQuoteModule=I.assertBinaryModule=I.assertLocalNameMetadata=I.assertFunctionNameMetadata=I.assertModuleNameMetadata=I.assertModuleMetadata=I.assertModule=I.isIntrinsic=I.isImportDescr=I.isNumericLiteral=I.isExpression=I.isInstruction=I.isBlock=I.isNode=I.isInternalEndAndReturn=I.isInternalCallExtern=I.isInternalGoto=I.isInternalBrUnless=I.isFunc=I.isByteArray=I.isCallIndirectInstruction=I.isCallInstruction=I.isBlockInstruction=I.isIdentifier=I.isProgram=I.isSignature=I.isLimit=I.isModuleExport=I.isModuleExportDescr=I.isModuleImport=I.isFuncImportDescr=I.isMemory=I.isTable=I.isGlobal=I.isData=I.isBlockComment=I.isLeadingComment=I.isGlobalType=I.isStart=I.isTypeInstruction=I.isValtypeLiteral=I.isIndexInFuncSection=I.isElem=I.isFloatLiteral=I.isLongNumberLiteral=I.isNumberLiteral=I.isStringLiteral=I.isIfInstruction=I.isInstr=I.isLoopInstruction=I.isProducerMetadataVersionedName=I.isProducerMetadata=I.isProducersSectionMetadata=I.isSectionMetadata=I.isQuoteModule=I.isBinaryModule=I.isLocalNameMetadata=I.isFunctionNameMetadata=I.isModuleNameMetadata=I.isModuleMetadata=I.isModule=void 0;I.nodeAndUnionTypes=I.unionTypesMap=I.assertInternalEndAndReturn=void 0;function _typeof(v){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(v){return typeof v}}else{_typeof=function _typeof(v){return v&&typeof Symbol==="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v}}return _typeof(v)}function isTypeOf(v){return function(I){return I.type===v}}function assertTypeOf(v){return function(I){return function(){if(!(I.type===v)){throw new Error("n.type === t"+" error: "+(undefined||"unknown"))}}()}}function _module(v,I,P){if(v!==null&&v!==undefined){if(!(typeof v==="string")){throw new Error('typeof id === "string"'+" error: "+("Argument id must be of type string, given: "+_typeof(v)||0))}}if(!(_typeof(I)==="object"&&typeof I.length!=="undefined")){throw new Error('typeof fields === "object" && typeof fields.length !== "undefined"'+" error: "+(undefined||"unknown"))}var R={type:"Module",id:v,fields:I};if(typeof P!=="undefined"){R.metadata=P}return R}function moduleMetadata(v,I,P,R){if(!(_typeof(v)==="object"&&typeof v.length!=="undefined")){throw new Error('typeof sections === "object" && typeof sections.length !== "undefined"'+" error: "+(undefined||"unknown"))}if(I!==null&&I!==undefined){if(!(_typeof(I)==="object"&&typeof I.length!=="undefined")){throw new Error('typeof functionNames === "object" && typeof functionNames.length !== "undefined"'+" error: "+(undefined||"unknown"))}}if(P!==null&&P!==undefined){if(!(_typeof(P)==="object"&&typeof P.length!=="undefined")){throw new Error('typeof localNames === "object" && typeof localNames.length !== "undefined"'+" error: "+(undefined||"unknown"))}}if(R!==null&&R!==undefined){if(!(_typeof(R)==="object"&&typeof R.length!=="undefined")){throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"'+" error: "+(undefined||"unknown"))}}var $={type:"ModuleMetadata",sections:v};if(typeof I!=="undefined"&&I.length>0){$.functionNames=I}if(typeof P!=="undefined"&&P.length>0){$.localNames=P}if(typeof R!=="undefined"&&R.length>0){$.producers=R}return $}function moduleNameMetadata(v){if(!(typeof v==="string")){throw new Error('typeof value === "string"'+" error: "+("Argument value must be of type string, given: "+_typeof(v)||0))}var I={type:"ModuleNameMetadata",value:v};return I}function functionNameMetadata(v,I){if(!(typeof v==="string")){throw new Error('typeof value === "string"'+" error: "+("Argument value must be of type string, given: "+_typeof(v)||0))}if(!(typeof I==="number")){throw new Error('typeof index === "number"'+" error: "+("Argument index must be of type number, given: "+_typeof(I)||0))}var P={type:"FunctionNameMetadata",value:v,index:I};return P}function localNameMetadata(v,I,P){if(!(typeof v==="string")){throw new Error('typeof value === "string"'+" error: "+("Argument value must be of type string, given: "+_typeof(v)||0))}if(!(typeof I==="number")){throw new Error('typeof localIndex === "number"'+" error: "+("Argument localIndex must be of type number, given: "+_typeof(I)||0))}if(!(typeof P==="number")){throw new Error('typeof functionIndex === "number"'+" error: "+("Argument functionIndex must be of type number, given: "+_typeof(P)||0))}var R={type:"LocalNameMetadata",value:v,localIndex:I,functionIndex:P};return R}function binaryModule(v,I){if(v!==null&&v!==undefined){if(!(typeof v==="string")){throw new Error('typeof id === "string"'+" error: "+("Argument id must be of type string, given: "+_typeof(v)||0))}}if(!(_typeof(I)==="object"&&typeof I.length!=="undefined")){throw new Error('typeof blob === "object" && typeof blob.length !== "undefined"'+" error: "+(undefined||"unknown"))}var P={type:"BinaryModule",id:v,blob:I};return P}function quoteModule(v,I){if(v!==null&&v!==undefined){if(!(typeof v==="string")){throw new Error('typeof id === "string"'+" error: "+("Argument id must be of type string, given: "+_typeof(v)||0))}}if(!(_typeof(I)==="object"&&typeof I.length!=="undefined")){throw new Error('typeof string === "object" && typeof string.length !== "undefined"'+" error: "+(undefined||"unknown"))}var P={type:"QuoteModule",id:v,string:I};return P}function sectionMetadata(v,I,P,R){if(!(typeof I==="number")){throw new Error('typeof startOffset === "number"'+" error: "+("Argument startOffset must be of type number, given: "+_typeof(I)||0))}var $={type:"SectionMetadata",section:v,startOffset:I,size:P,vectorOfSize:R};return $}function producersSectionMetadata(v){if(!(_typeof(v)==="object"&&typeof v.length!=="undefined")){throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"'+" error: "+(undefined||"unknown"))}var I={type:"ProducersSectionMetadata",producers:v};return I}function producerMetadata(v,I,P){if(!(_typeof(v)==="object"&&typeof v.length!=="undefined")){throw new Error('typeof language === "object" && typeof language.length !== "undefined"'+" error: "+(undefined||"unknown"))}if(!(_typeof(I)==="object"&&typeof I.length!=="undefined")){throw new Error('typeof processedBy === "object" && typeof processedBy.length !== "undefined"'+" error: "+(undefined||"unknown"))}if(!(_typeof(P)==="object"&&typeof P.length!=="undefined")){throw new Error('typeof sdk === "object" && typeof sdk.length !== "undefined"'+" error: "+(undefined||"unknown"))}var R={type:"ProducerMetadata",language:v,processedBy:I,sdk:P};return R}function producerMetadataVersionedName(v,I){if(!(typeof v==="string")){throw new Error('typeof name === "string"'+" error: "+("Argument name must be of type string, given: "+_typeof(v)||0))}if(!(typeof I==="string")){throw new Error('typeof version === "string"'+" error: "+("Argument version must be of type string, given: "+_typeof(I)||0))}var P={type:"ProducerMetadataVersionedName",name:v,version:I};return P}function loopInstruction(v,I,P){if(!(_typeof(P)==="object"&&typeof P.length!=="undefined")){throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"'+" error: "+(undefined||"unknown"))}var R={type:"LoopInstruction",id:"loop",label:v,resulttype:I,instr:P};return R}function instr(v,I,P,R){if(!(typeof v==="string")){throw new Error('typeof id === "string"'+" error: "+("Argument id must be of type string, given: "+_typeof(v)||0))}if(!(_typeof(P)==="object"&&typeof P.length!=="undefined")){throw new Error('typeof args === "object" && typeof args.length !== "undefined"'+" error: "+(undefined||"unknown"))}var $={type:"Instr",id:v,args:P};if(typeof I!=="undefined"){$.object=I}if(typeof R!=="undefined"&&Object.keys(R).length!==0){$.namedArgs=R}return $}function ifInstruction(v,I,P,R,$){if(!(_typeof(I)==="object"&&typeof I.length!=="undefined")){throw new Error('typeof test === "object" && typeof test.length !== "undefined"'+" error: "+(undefined||"unknown"))}if(!(_typeof(R)==="object"&&typeof R.length!=="undefined")){throw new Error('typeof consequent === "object" && typeof consequent.length !== "undefined"'+" error: "+(undefined||"unknown"))}if(!(_typeof($)==="object"&&typeof $.length!=="undefined")){throw new Error('typeof alternate === "object" && typeof alternate.length !== "undefined"'+" error: "+(undefined||"unknown"))}var L={type:"IfInstruction",id:"if",testLabel:v,test:I,result:P,consequent:R,alternate:$};return L}function stringLiteral(v){if(!(typeof v==="string")){throw new Error('typeof value === "string"'+" error: "+("Argument value must be of type string, given: "+_typeof(v)||0))}var I={type:"StringLiteral",value:v};return I}function numberLiteral(v,I){if(!(typeof v==="number")){throw new Error('typeof value === "number"'+" error: "+("Argument value must be of type number, given: "+_typeof(v)||0))}if(!(typeof I==="string")){throw new Error('typeof raw === "string"'+" error: "+("Argument raw must be of type string, given: "+_typeof(I)||0))}var P={type:"NumberLiteral",value:v,raw:I};return P}function longNumberLiteral(v,I){if(!(typeof I==="string")){throw new Error('typeof raw === "string"'+" error: "+("Argument raw must be of type string, given: "+_typeof(I)||0))}var P={type:"LongNumberLiteral",value:v,raw:I};return P}function floatLiteral(v,I,P,R){if(!(typeof v==="number")){throw new Error('typeof value === "number"'+" error: "+("Argument value must be of type number, given: "+_typeof(v)||0))}if(I!==null&&I!==undefined){if(!(typeof I==="boolean")){throw new Error('typeof nan === "boolean"'+" error: "+("Argument nan must be of type boolean, given: "+_typeof(I)||0))}}if(P!==null&&P!==undefined){if(!(typeof P==="boolean")){throw new Error('typeof inf === "boolean"'+" error: "+("Argument inf must be of type boolean, given: "+_typeof(P)||0))}}if(!(typeof R==="string")){throw new Error('typeof raw === "string"'+" error: "+("Argument raw must be of type string, given: "+_typeof(R)||0))}var $={type:"FloatLiteral",value:v,raw:R};if(I===true){$.nan=true}if(P===true){$.inf=true}return $}function elem(v,I,P){if(!(_typeof(I)==="object"&&typeof I.length!=="undefined")){throw new Error('typeof offset === "object" && typeof offset.length !== "undefined"'+" error: "+(undefined||"unknown"))}if(!(_typeof(P)==="object"&&typeof P.length!=="undefined")){throw new Error('typeof funcs === "object" && typeof funcs.length !== "undefined"'+" error: "+(undefined||"unknown"))}var R={type:"Elem",table:v,offset:I,funcs:P};return R}function indexInFuncSection(v){var I={type:"IndexInFuncSection",index:v};return I}function valtypeLiteral(v){var I={type:"ValtypeLiteral",name:v};return I}function typeInstruction(v,I){var P={type:"TypeInstruction",id:v,functype:I};return P}function start(v){var I={type:"Start",index:v};return I}function globalType(v,I){var P={type:"GlobalType",valtype:v,mutability:I};return P}function leadingComment(v){if(!(typeof v==="string")){throw new Error('typeof value === "string"'+" error: "+("Argument value must be of type string, given: "+_typeof(v)||0))}var I={type:"LeadingComment",value:v};return I}function blockComment(v){if(!(typeof v==="string")){throw new Error('typeof value === "string"'+" error: "+("Argument value must be of type string, given: "+_typeof(v)||0))}var I={type:"BlockComment",value:v};return I}function data(v,I,P){var R={type:"Data",memoryIndex:v,offset:I,init:P};return R}function global(v,I,P){if(!(_typeof(I)==="object"&&typeof I.length!=="undefined")){throw new Error('typeof init === "object" && typeof init.length !== "undefined"'+" error: "+(undefined||"unknown"))}var R={type:"Global",globalType:v,init:I,name:P};return R}function table(v,I,P,R){if(!(I.type==="Limit")){throw new Error('limits.type === "Limit"'+" error: "+("Argument limits must be of type Limit, given: "+I.type||0))}if(R!==null&&R!==undefined){if(!(_typeof(R)==="object"&&typeof R.length!=="undefined")){throw new Error('typeof elements === "object" && typeof elements.length !== "undefined"'+" error: "+(undefined||"unknown"))}}var $={type:"Table",elementType:v,limits:I,name:P};if(typeof R!=="undefined"&&R.length>0){$.elements=R}return $}function memory(v,I){var P={type:"Memory",limits:v,id:I};return P}function funcImportDescr(v,I){var P={type:"FuncImportDescr",id:v,signature:I};return P}function moduleImport(v,I,P){if(!(typeof v==="string")){throw new Error('typeof module === "string"'+" error: "+("Argument module must be of type string, given: "+_typeof(v)||0))}if(!(typeof I==="string")){throw new Error('typeof name === "string"'+" error: "+("Argument name must be of type string, given: "+_typeof(I)||0))}var R={type:"ModuleImport",module:v,name:I,descr:P};return R}function moduleExportDescr(v,I){var P={type:"ModuleExportDescr",exportType:v,id:I};return P}function moduleExport(v,I){if(!(typeof v==="string")){throw new Error('typeof name === "string"'+" error: "+("Argument name must be of type string, given: "+_typeof(v)||0))}var P={type:"ModuleExport",name:v,descr:I};return P}function limit(v,I,P){if(!(typeof v==="number")){throw new Error('typeof min === "number"'+" error: "+("Argument min must be of type number, given: "+_typeof(v)||0))}if(I!==null&&I!==undefined){if(!(typeof I==="number")){throw new Error('typeof max === "number"'+" error: "+("Argument max must be of type number, given: "+_typeof(I)||0))}}if(P!==null&&P!==undefined){if(!(typeof P==="boolean")){throw new Error('typeof shared === "boolean"'+" error: "+("Argument shared must be of type boolean, given: "+_typeof(P)||0))}}var R={type:"Limit",min:v};if(typeof I!=="undefined"){R.max=I}if(P===true){R.shared=true}return R}function signature(v,I){if(!(_typeof(v)==="object"&&typeof v.length!=="undefined")){throw new Error('typeof params === "object" && typeof params.length !== "undefined"'+" error: "+(undefined||"unknown"))}if(!(_typeof(I)==="object"&&typeof I.length!=="undefined")){throw new Error('typeof results === "object" && typeof results.length !== "undefined"'+" error: "+(undefined||"unknown"))}var P={type:"Signature",params:v,results:I};return P}function program(v){if(!(_typeof(v)==="object"&&typeof v.length!=="undefined")){throw new Error('typeof body === "object" && typeof body.length !== "undefined"'+" error: "+(undefined||"unknown"))}var I={type:"Program",body:v};return I}function identifier(v,I){if(!(typeof v==="string")){throw new Error('typeof value === "string"'+" error: "+("Argument value must be of type string, given: "+_typeof(v)||0))}if(I!==null&&I!==undefined){if(!(typeof I==="string")){throw new Error('typeof raw === "string"'+" error: "+("Argument raw must be of type string, given: "+_typeof(I)||0))}}var P={type:"Identifier",value:v};if(typeof I!=="undefined"){P.raw=I}return P}function blockInstruction(v,I,P){if(!(_typeof(I)==="object"&&typeof I.length!=="undefined")){throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"'+" error: "+(undefined||"unknown"))}var R={type:"BlockInstruction",id:"block",label:v,instr:I,result:P};return R}function callInstruction(v,I,P){if(I!==null&&I!==undefined){if(!(_typeof(I)==="object"&&typeof I.length!=="undefined")){throw new Error('typeof instrArgs === "object" && typeof instrArgs.length !== "undefined"'+" error: "+(undefined||"unknown"))}}var R={type:"CallInstruction",id:"call",index:v};if(typeof I!=="undefined"&&I.length>0){R.instrArgs=I}if(typeof P!=="undefined"){R.numeric=P}return R}function callIndirectInstruction(v,I){if(I!==null&&I!==undefined){if(!(_typeof(I)==="object"&&typeof I.length!=="undefined")){throw new Error('typeof intrs === "object" && typeof intrs.length !== "undefined"'+" error: "+(undefined||"unknown"))}}var P={type:"CallIndirectInstruction",id:"call_indirect",signature:v};if(typeof I!=="undefined"&&I.length>0){P.intrs=I}return P}function byteArray(v){if(!(_typeof(v)==="object"&&typeof v.length!=="undefined")){throw new Error('typeof values === "object" && typeof values.length !== "undefined"'+" error: "+(undefined||"unknown"))}var I={type:"ByteArray",values:v};return I}function func(v,I,P,R,$){if(!(_typeof(P)==="object"&&typeof P.length!=="undefined")){throw new Error('typeof body === "object" && typeof body.length !== "undefined"'+" error: "+(undefined||"unknown"))}if(R!==null&&R!==undefined){if(!(typeof R==="boolean")){throw new Error('typeof isExternal === "boolean"'+" error: "+("Argument isExternal must be of type boolean, given: "+_typeof(R)||0))}}var L={type:"Func",name:v,signature:I,body:P};if(R===true){L.isExternal=true}if(typeof $!=="undefined"){L.metadata=$}return L}function internalBrUnless(v){if(!(typeof v==="number")){throw new Error('typeof target === "number"'+" error: "+("Argument target must be of type number, given: "+_typeof(v)||0))}var I={type:"InternalBrUnless",target:v};return I}function internalGoto(v){if(!(typeof v==="number")){throw new Error('typeof target === "number"'+" error: "+("Argument target must be of type number, given: "+_typeof(v)||0))}var I={type:"InternalGoto",target:v};return I}function internalCallExtern(v){if(!(typeof v==="number")){throw new Error('typeof target === "number"'+" error: "+("Argument target must be of type number, given: "+_typeof(v)||0))}var I={type:"InternalCallExtern",target:v};return I}function internalEndAndReturn(){var v={type:"InternalEndAndReturn"};return v}var P=isTypeOf("Module");I.isModule=P;var R=isTypeOf("ModuleMetadata");I.isModuleMetadata=R;var $=isTypeOf("ModuleNameMetadata");I.isModuleNameMetadata=$;var L=isTypeOf("FunctionNameMetadata");I.isFunctionNameMetadata=L;var q=isTypeOf("LocalNameMetadata");I.isLocalNameMetadata=q;var K=isTypeOf("BinaryModule");I.isBinaryModule=K;var ae=isTypeOf("QuoteModule");I.isQuoteModule=ae;var ge=isTypeOf("SectionMetadata");I.isSectionMetadata=ge;var be=isTypeOf("ProducersSectionMetadata");I.isProducersSectionMetadata=be;var xe=isTypeOf("ProducerMetadata");I.isProducerMetadata=xe;var ve=isTypeOf("ProducerMetadataVersionedName");I.isProducerMetadataVersionedName=ve;var Ce=isTypeOf("LoopInstruction");I.isLoopInstruction=Ce;var Ne=isTypeOf("Instr");I.isInstr=Ne;var He=isTypeOf("IfInstruction");I.isIfInstruction=He;var Qe=isTypeOf("StringLiteral");I.isStringLiteral=Qe;var Je=isTypeOf("NumberLiteral");I.isNumberLiteral=Je;var Ve=isTypeOf("LongNumberLiteral");I.isLongNumberLiteral=Ve;var Ke=isTypeOf("FloatLiteral");I.isFloatLiteral=Ke;var Ye=isTypeOf("Elem");I.isElem=Ye;var Xe=isTypeOf("IndexInFuncSection");I.isIndexInFuncSection=Xe;var Ze=isTypeOf("ValtypeLiteral");I.isValtypeLiteral=Ze;var et=isTypeOf("TypeInstruction");I.isTypeInstruction=et;var tt=isTypeOf("Start");I.isStart=tt;var nt=isTypeOf("GlobalType");I.isGlobalType=nt;var st=isTypeOf("LeadingComment");I.isLeadingComment=st;var rt=isTypeOf("BlockComment");I.isBlockComment=rt;var ot=isTypeOf("Data");I.isData=ot;var it=isTypeOf("Global");I.isGlobal=it;var at=isTypeOf("Table");I.isTable=at;var ct=isTypeOf("Memory");I.isMemory=ct;var lt=isTypeOf("FuncImportDescr");I.isFuncImportDescr=lt;var ut=isTypeOf("ModuleImport");I.isModuleImport=ut;var pt=isTypeOf("ModuleExportDescr");I.isModuleExportDescr=pt;var dt=isTypeOf("ModuleExport");I.isModuleExport=dt;var ft=isTypeOf("Limit");I.isLimit=ft;var ht=isTypeOf("Signature");I.isSignature=ht;var mt=isTypeOf("Program");I.isProgram=mt;var gt=isTypeOf("Identifier");I.isIdentifier=gt;var yt=isTypeOf("BlockInstruction");I.isBlockInstruction=yt;var bt=isTypeOf("CallInstruction");I.isCallInstruction=bt;var xt=isTypeOf("CallIndirectInstruction");I.isCallIndirectInstruction=xt;var kt=isTypeOf("ByteArray");I.isByteArray=kt;var vt=isTypeOf("Func");I.isFunc=vt;var wt=isTypeOf("InternalBrUnless");I.isInternalBrUnless=wt;var Ct=isTypeOf("InternalGoto");I.isInternalGoto=Ct;var Et=isTypeOf("InternalCallExtern");I.isInternalCallExtern=Et;var At=isTypeOf("InternalEndAndReturn");I.isInternalEndAndReturn=At;var St=function isNode(v){return P(v)||R(v)||$(v)||L(v)||q(v)||K(v)||ae(v)||ge(v)||be(v)||xe(v)||ve(v)||Ce(v)||Ne(v)||He(v)||Qe(v)||Je(v)||Ve(v)||Ke(v)||Ye(v)||Xe(v)||Ze(v)||et(v)||tt(v)||nt(v)||st(v)||rt(v)||ot(v)||it(v)||at(v)||ct(v)||lt(v)||ut(v)||pt(v)||dt(v)||ft(v)||ht(v)||mt(v)||gt(v)||yt(v)||bt(v)||xt(v)||kt(v)||vt(v)||wt(v)||Ct(v)||Et(v)||At(v)};I.isNode=St;var _t=function isBlock(v){return Ce(v)||yt(v)||vt(v)};I.isBlock=_t;var It=function isInstruction(v){return Ce(v)||Ne(v)||He(v)||et(v)||yt(v)||bt(v)||xt(v)};I.isInstruction=It;var Pt=function isExpression(v){return Ne(v)||Qe(v)||Je(v)||Ve(v)||Ke(v)||Ze(v)||gt(v)};I.isExpression=Pt;var Mt=function isNumericLiteral(v){return Je(v)||Ve(v)||Ke(v)};I.isNumericLiteral=Mt;var Ot=function isImportDescr(v){return nt(v)||at(v)||ct(v)||lt(v)};I.isImportDescr=Ot;var Dt=function isIntrinsic(v){return wt(v)||Ct(v)||Et(v)||At(v)};I.isIntrinsic=Dt;var Rt=assertTypeOf("Module");I.assertModule=Rt;var Tt=assertTypeOf("ModuleMetadata");I.assertModuleMetadata=Tt;var $t=assertTypeOf("ModuleNameMetadata");I.assertModuleNameMetadata=$t;var Ft=assertTypeOf("FunctionNameMetadata");I.assertFunctionNameMetadata=Ft;var jt=assertTypeOf("LocalNameMetadata");I.assertLocalNameMetadata=jt;var Nt=assertTypeOf("BinaryModule");I.assertBinaryModule=Nt;var Lt=assertTypeOf("QuoteModule");I.assertQuoteModule=Lt;var Bt=assertTypeOf("SectionMetadata");I.assertSectionMetadata=Bt;var qt=assertTypeOf("ProducersSectionMetadata");I.assertProducersSectionMetadata=qt;var zt=assertTypeOf("ProducerMetadata");I.assertProducerMetadata=zt;var Ut=assertTypeOf("ProducerMetadataVersionedName");I.assertProducerMetadataVersionedName=Ut;var Gt=assertTypeOf("LoopInstruction");I.assertLoopInstruction=Gt;var Ht=assertTypeOf("Instr");I.assertInstr=Ht;var Wt=assertTypeOf("IfInstruction");I.assertIfInstruction=Wt;var Qt=assertTypeOf("StringLiteral");I.assertStringLiteral=Qt;var Jt=assertTypeOf("NumberLiteral");I.assertNumberLiteral=Jt;var Vt=assertTypeOf("LongNumberLiteral");I.assertLongNumberLiteral=Vt;var Kt=assertTypeOf("FloatLiteral");I.assertFloatLiteral=Kt;var Yt=assertTypeOf("Elem");I.assertElem=Yt;var Xt=assertTypeOf("IndexInFuncSection");I.assertIndexInFuncSection=Xt;var Zt=assertTypeOf("ValtypeLiteral");I.assertValtypeLiteral=Zt;var en=assertTypeOf("TypeInstruction");I.assertTypeInstruction=en;var tn=assertTypeOf("Start");I.assertStart=tn;var nn=assertTypeOf("GlobalType");I.assertGlobalType=nn;var sn=assertTypeOf("LeadingComment");I.assertLeadingComment=sn;var rn=assertTypeOf("BlockComment");I.assertBlockComment=rn;var on=assertTypeOf("Data");I.assertData=on;var an=assertTypeOf("Global");I.assertGlobal=an;var cn=assertTypeOf("Table");I.assertTable=cn;var ln=assertTypeOf("Memory");I.assertMemory=ln;var un=assertTypeOf("FuncImportDescr");I.assertFuncImportDescr=un;var pn=assertTypeOf("ModuleImport");I.assertModuleImport=pn;var dn=assertTypeOf("ModuleExportDescr");I.assertModuleExportDescr=dn;var hn=assertTypeOf("ModuleExport");I.assertModuleExport=hn;var mn=assertTypeOf("Limit");I.assertLimit=mn;var gn=assertTypeOf("Signature");I.assertSignature=gn;var yn=assertTypeOf("Program");I.assertProgram=yn;var bn=assertTypeOf("Identifier");I.assertIdentifier=bn;var xn=assertTypeOf("BlockInstruction");I.assertBlockInstruction=xn;var kn=assertTypeOf("CallInstruction");I.assertCallInstruction=kn;var vn=assertTypeOf("CallIndirectInstruction");I.assertCallIndirectInstruction=vn;var wn=assertTypeOf("ByteArray");I.assertByteArray=wn;var Cn=assertTypeOf("Func");I.assertFunc=Cn;var En=assertTypeOf("InternalBrUnless");I.assertInternalBrUnless=En;var An=assertTypeOf("InternalGoto");I.assertInternalGoto=An;var Sn=assertTypeOf("InternalCallExtern");I.assertInternalCallExtern=Sn;var _n=assertTypeOf("InternalEndAndReturn");I.assertInternalEndAndReturn=_n;var In={Module:["Node"],ModuleMetadata:["Node"],ModuleNameMetadata:["Node"],FunctionNameMetadata:["Node"],LocalNameMetadata:["Node"],BinaryModule:["Node"],QuoteModule:["Node"],SectionMetadata:["Node"],ProducersSectionMetadata:["Node"],ProducerMetadata:["Node"],ProducerMetadataVersionedName:["Node"],LoopInstruction:["Node","Block","Instruction"],Instr:["Node","Expression","Instruction"],IfInstruction:["Node","Instruction"],StringLiteral:["Node","Expression"],NumberLiteral:["Node","NumericLiteral","Expression"],LongNumberLiteral:["Node","NumericLiteral","Expression"],FloatLiteral:["Node","NumericLiteral","Expression"],Elem:["Node"],IndexInFuncSection:["Node"],ValtypeLiteral:["Node","Expression"],TypeInstruction:["Node","Instruction"],Start:["Node"],GlobalType:["Node","ImportDescr"],LeadingComment:["Node"],BlockComment:["Node"],Data:["Node"],Global:["Node"],Table:["Node","ImportDescr"],Memory:["Node","ImportDescr"],FuncImportDescr:["Node","ImportDescr"],ModuleImport:["Node"],ModuleExportDescr:["Node"],ModuleExport:["Node"],Limit:["Node"],Signature:["Node"],Program:["Node"],Identifier:["Node","Expression"],BlockInstruction:["Node","Block","Instruction"],CallInstruction:["Node","Instruction"],CallIndirectInstruction:["Node","Instruction"],ByteArray:["Node"],Func:["Node","Block"],InternalBrUnless:["Node","Intrinsic"],InternalGoto:["Node","Intrinsic"],InternalCallExtern:["Node","Intrinsic"],InternalEndAndReturn:["Node","Intrinsic"]};I.unionTypesMap=In;var Pn=["Module","ModuleMetadata","ModuleNameMetadata","FunctionNameMetadata","LocalNameMetadata","BinaryModule","QuoteModule","SectionMetadata","ProducersSectionMetadata","ProducerMetadata","ProducerMetadataVersionedName","LoopInstruction","Instr","IfInstruction","StringLiteral","NumberLiteral","LongNumberLiteral","FloatLiteral","Elem","IndexInFuncSection","ValtypeLiteral","TypeInstruction","Start","GlobalType","LeadingComment","BlockComment","Data","Global","Table","Memory","FuncImportDescr","ModuleImport","ModuleExportDescr","ModuleExport","Limit","Signature","Program","Identifier","BlockInstruction","CallInstruction","CallIndirectInstruction","ByteArray","Func","InternalBrUnless","InternalGoto","InternalCallExtern","InternalEndAndReturn","Node","Block","Instruction","Expression","NumericLiteral","ImportDescr","Intrinsic"];I.nodeAndUnionTypes=Pn},10644:function(v,I){"use strict";Object.defineProperty(I,"__esModule",{value:true});I.signatures=void 0;function sign(v,I){return[v,I]}var P="u32";var R="i32";var $="i64";var L="f32";var q="f64";var K=function vector(v){var I=[v];I.vector=true;return I};var ae={unreachable:sign([],[]),nop:sign([],[]),br:sign([P],[]),br_if:sign([P],[]),br_table:sign(K(P),[]),return:sign([],[]),call:sign([P],[]),call_indirect:sign([P],[])};var ge={drop:sign([],[]),select:sign([],[])};var be={get_local:sign([P],[]),set_local:sign([P],[]),tee_local:sign([P],[]),get_global:sign([P],[]),set_global:sign([P],[])};var xe={"i32.load":sign([P,P],[R]),"i64.load":sign([P,P],[]),"f32.load":sign([P,P],[]),"f64.load":sign([P,P],[]),"i32.load8_s":sign([P,P],[R]),"i32.load8_u":sign([P,P],[R]),"i32.load16_s":sign([P,P],[R]),"i32.load16_u":sign([P,P],[R]),"i64.load8_s":sign([P,P],[$]),"i64.load8_u":sign([P,P],[$]),"i64.load16_s":sign([P,P],[$]),"i64.load16_u":sign([P,P],[$]),"i64.load32_s":sign([P,P],[$]),"i64.load32_u":sign([P,P],[$]),"i32.store":sign([P,P],[]),"i64.store":sign([P,P],[]),"f32.store":sign([P,P],[]),"f64.store":sign([P,P],[]),"i32.store8":sign([P,P],[]),"i32.store16":sign([P,P],[]),"i64.store8":sign([P,P],[]),"i64.store16":sign([P,P],[]),"i64.store32":sign([P,P],[]),current_memory:sign([],[]),grow_memory:sign([],[])};var ve={"i32.const":sign([R],[R]),"i64.const":sign([$],[$]),"f32.const":sign([L],[L]),"f64.const":sign([q],[q]),"i32.eqz":sign([R],[R]),"i32.eq":sign([R,R],[R]),"i32.ne":sign([R,R],[R]),"i32.lt_s":sign([R,R],[R]),"i32.lt_u":sign([R,R],[R]),"i32.gt_s":sign([R,R],[R]),"i32.gt_u":sign([R,R],[R]),"i32.le_s":sign([R,R],[R]),"i32.le_u":sign([R,R],[R]),"i32.ge_s":sign([R,R],[R]),"i32.ge_u":sign([R,R],[R]),"i64.eqz":sign([$],[$]),"i64.eq":sign([$,$],[R]),"i64.ne":sign([$,$],[R]),"i64.lt_s":sign([$,$],[R]),"i64.lt_u":sign([$,$],[R]),"i64.gt_s":sign([$,$],[R]),"i64.gt_u":sign([$,$],[R]),"i64.le_s":sign([$,$],[R]),"i64.le_u":sign([$,$],[R]),"i64.ge_s":sign([$,$],[R]),"i64.ge_u":sign([$,$],[R]),"f32.eq":sign([L,L],[R]),"f32.ne":sign([L,L],[R]),"f32.lt":sign([L,L],[R]),"f32.gt":sign([L,L],[R]),"f32.le":sign([L,L],[R]),"f32.ge":sign([L,L],[R]),"f64.eq":sign([q,q],[R]),"f64.ne":sign([q,q],[R]),"f64.lt":sign([q,q],[R]),"f64.gt":sign([q,q],[R]),"f64.le":sign([q,q],[R]),"f64.ge":sign([q,q],[R]),"i32.clz":sign([R],[R]),"i32.ctz":sign([R],[R]),"i32.popcnt":sign([R],[R]),"i32.add":sign([R,R],[R]),"i32.sub":sign([R,R],[R]),"i32.mul":sign([R,R],[R]),"i32.div_s":sign([R,R],[R]),"i32.div_u":sign([R,R],[R]),"i32.rem_s":sign([R,R],[R]),"i32.rem_u":sign([R,R],[R]),"i32.and":sign([R,R],[R]),"i32.or":sign([R,R],[R]),"i32.xor":sign([R,R],[R]),"i32.shl":sign([R,R],[R]),"i32.shr_s":sign([R,R],[R]),"i32.shr_u":sign([R,R],[R]),"i32.rotl":sign([R,R],[R]),"i32.rotr":sign([R,R],[R]),"i64.clz":sign([$],[$]),"i64.ctz":sign([$],[$]),"i64.popcnt":sign([$],[$]),"i64.add":sign([$,$],[$]),"i64.sub":sign([$,$],[$]),"i64.mul":sign([$,$],[$]),"i64.div_s":sign([$,$],[$]),"i64.div_u":sign([$,$],[$]),"i64.rem_s":sign([$,$],[$]),"i64.rem_u":sign([$,$],[$]),"i64.and":sign([$,$],[$]),"i64.or":sign([$,$],[$]),"i64.xor":sign([$,$],[$]),"i64.shl":sign([$,$],[$]),"i64.shr_s":sign([$,$],[$]),"i64.shr_u":sign([$,$],[$]),"i64.rotl":sign([$,$],[$]),"i64.rotr":sign([$,$],[$]),"f32.abs":sign([L],[L]),"f32.neg":sign([L],[L]),"f32.ceil":sign([L],[L]),"f32.floor":sign([L],[L]),"f32.trunc":sign([L],[L]),"f32.nearest":sign([L],[L]),"f32.sqrt":sign([L],[L]),"f32.add":sign([L,L],[L]),"f32.sub":sign([L,L],[L]),"f32.mul":sign([L,L],[L]),"f32.div":sign([L,L],[L]),"f32.min":sign([L,L],[L]),"f32.max":sign([L,L],[L]),"f32.copysign":sign([L,L],[L]),"f64.abs":sign([q],[q]),"f64.neg":sign([q],[q]),"f64.ceil":sign([q],[q]),"f64.floor":sign([q],[q]),"f64.trunc":sign([q],[q]),"f64.nearest":sign([q],[q]),"f64.sqrt":sign([q],[q]),"f64.add":sign([q,q],[q]),"f64.sub":sign([q,q],[q]),"f64.mul":sign([q,q],[q]),"f64.div":sign([q,q],[q]),"f64.min":sign([q,q],[q]),"f64.max":sign([q,q],[q]),"f64.copysign":sign([q,q],[q]),"i32.wrap/i64":sign([$],[R]),"i32.trunc_s/f32":sign([L],[R]),"i32.trunc_u/f32":sign([L],[R]),"i32.trunc_s/f64":sign([L],[R]),"i32.trunc_u/f64":sign([q],[R]),"i64.extend_s/i32":sign([R],[$]),"i64.extend_u/i32":sign([R],[$]),"i64.trunc_s/f32":sign([L],[$]),"i64.trunc_u/f32":sign([L],[$]),"i64.trunc_s/f64":sign([q],[$]),"i64.trunc_u/f64":sign([q],[$]),"f32.convert_s/i32":sign([R],[L]),"f32.convert_u/i32":sign([R],[L]),"f32.convert_s/i64":sign([$],[L]),"f32.convert_u/i64":sign([$],[L]),"f32.demote/f64":sign([q],[L]),"f64.convert_s/i32":sign([R],[q]),"f64.convert_u/i32":sign([R],[q]),"f64.convert_s/i64":sign([$],[q]),"f64.convert_u/i64":sign([$],[q]),"f64.promote/f32":sign([L],[q]),"i32.reinterpret/f32":sign([L],[R]),"i64.reinterpret/f64":sign([q],[$]),"f32.reinterpret/i32":sign([R],[L]),"f64.reinterpret/i64":sign([$],[q])};var Ce=Object.assign({},ae,ge,be,xe,ve);I.signatures=Ce},89711:function(v,I,P){"use strict";Object.defineProperty(I,"__esModule",{value:true});I.moduleContextFromModuleAST=moduleContextFromModuleAST;I.ModuleContext=void 0;var R=P(6881);function _classCallCheck(v,I){if(!(v instanceof I)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(v,I){for(var P=0;P<I.length;P++){var R=I[P];R.enumerable=R.enumerable||false;R.configurable=true;if("value"in R)R.writable=true;Object.defineProperty(v,R.key,R)}}function _createClass(v,I,P){if(I)_defineProperties(v.prototype,I);if(P)_defineProperties(v,P);return v}function moduleContextFromModuleAST(v){var I=new $;if(!(v.type==="Module")){throw new Error('m.type === "Module"'+" error: "+(undefined||"unknown"))}v.fields.forEach((function(v){switch(v.type){case"Start":{I.setStart(v.index);break}case"TypeInstruction":{I.addType(v);break}case"Func":{I.addFunction(v);break}case"Global":{I.defineGlobal(v);break}case"ModuleImport":{switch(v.descr.type){case"GlobalType":{I.importGlobal(v.descr.valtype,v.descr.mutability);break}case"Memory":{I.addMemory(v.descr.limits.min,v.descr.limits.max);break}case"FuncImportDescr":{I.importFunction(v.descr);break}case"Table":{break}default:throw new Error("Unsupported ModuleImport of type "+JSON.stringify(v.descr.type))}break}case"Memory":{I.addMemory(v.limits.min,v.limits.max);break}}}));return I}var $=function(){function ModuleContext(){_classCallCheck(this,ModuleContext);this.funcs=[];this.funcsOffsetByIdentifier=[];this.types=[];this.globals=[];this.globalsOffsetByIdentifier=[];this.mems=[];this.locals=[];this.labels=[];this["return"]=[];this.debugName="unknown";this.start=null}_createClass(ModuleContext,[{key:"setStart",value:function setStart(v){this.start=v.value}},{key:"getStart",value:function getStart(){return this.start}},{key:"newContext",value:function newContext(v,I){this.locals=[];this.labels=[I];this["return"]=I;this.debugName=v}},{key:"addFunction",value:function addFunction(v){var I=v.signature||{},P=I.params,R=P===void 0?[]:P,$=I.results,L=$===void 0?[]:$;R=R.map((function(v){return v.valtype}));this.funcs.push({args:R,result:L});if(typeof v.name!=="undefined"){this.funcsOffsetByIdentifier[v.name.value]=this.funcs.length-1}}},{key:"importFunction",value:function importFunction(v){if((0,R.isSignature)(v.signature)){var I=v.signature,P=I.params,$=I.results;P=P.map((function(v){return v.valtype}));this.funcs.push({args:P,result:$})}else{if(!(0,R.isNumberLiteral)(v.signature)){throw new Error("isNumberLiteral(funcimport.signature)"+" error: "+(undefined||"unknown"))}var L=v.signature.value;if(!this.hasType(L)){throw new Error("this.hasType(typeId)"+" error: "+(undefined||"unknown"))}var q=this.getType(L);this.funcs.push({args:q.params.map((function(v){return v.valtype})),result:q.results})}if(typeof v.id!=="undefined"){this.funcsOffsetByIdentifier[v.id.value]=this.funcs.length-1}}},{key:"hasFunction",value:function hasFunction(v){return typeof this.getFunction(v)!=="undefined"}},{key:"getFunction",value:function getFunction(v){if(typeof v!=="number"){throw new Error("getFunction only supported for number index")}return this.funcs[v]}},{key:"getFunctionOffsetByIdentifier",value:function getFunctionOffsetByIdentifier(v){if(!(typeof v==="string")){throw new Error('typeof name === "string"'+" error: "+(undefined||"unknown"))}return this.funcsOffsetByIdentifier[v]}},{key:"addLabel",value:function addLabel(v){this.labels.unshift(v)}},{key:"hasLabel",value:function hasLabel(v){return this.labels.length>v&&v>=0}},{key:"getLabel",value:function getLabel(v){return this.labels[v]}},{key:"popLabel",value:function popLabel(){this.labels.shift()}},{key:"hasLocal",value:function hasLocal(v){return typeof this.getLocal(v)!=="undefined"}},{key:"getLocal",value:function getLocal(v){return this.locals[v]}},{key:"addLocal",value:function addLocal(v){this.locals.push(v)}},{key:"addType",value:function addType(v){if(!(v.functype.type==="Signature")){throw new Error('type.functype.type === "Signature"'+" error: "+(undefined||"unknown"))}this.types.push(v.functype)}},{key:"hasType",value:function hasType(v){return this.types[v]!==undefined}},{key:"getType",value:function getType(v){return this.types[v]}},{key:"hasGlobal",value:function hasGlobal(v){return this.globals.length>v&&v>=0}},{key:"getGlobal",value:function getGlobal(v){return this.globals[v].type}},{key:"getGlobalOffsetByIdentifier",value:function getGlobalOffsetByIdentifier(v){if(!(typeof v==="string")){throw new Error('typeof name === "string"'+" error: "+(undefined||"unknown"))}return this.globalsOffsetByIdentifier[v]}},{key:"defineGlobal",value:function defineGlobal(v){var I=v.globalType.valtype;var P=v.globalType.mutability;this.globals.push({type:I,mutability:P});if(typeof v.name!=="undefined"){this.globalsOffsetByIdentifier[v.name.value]=this.globals.length-1}}},{key:"importGlobal",value:function importGlobal(v,I){this.globals.push({type:v,mutability:I})}},{key:"isMutableGlobal",value:function isMutableGlobal(v){return this.globals[v].mutability==="var"}},{key:"isImmutableGlobal",value:function isImmutableGlobal(v){return this.globals[v].mutability==="const"}},{key:"hasMemory",value:function hasMemory(v){return this.mems.length>v&&v>=0}},{key:"addMemory",value:function addMemory(v,I){this.mems.push({min:v,max:I})}},{key:"getMemory",value:function getMemory(v){return this.mems[v]}}]);return ModuleContext}();I.ModuleContext=$},87786:function(v,I,P){"use strict";Object.defineProperty(I,"__esModule",{value:true});I.traverse=traverse;var R=P(98935);var $=P(6881);function walk(v,I){var P=false;function innerWalk(v,I){if(P){return}var $=v.node;if($===undefined){console.warn("traversing with an empty context");return}if($._deleted===true){return}var L=(0,R.createPath)(v);I($.type,L);if(L.shouldStop){P=true;return}Object.keys($).forEach((function(v){var P=$[v];if(P===null||P===undefined){return}var R=Array.isArray(P)?P:[P];R.forEach((function(R){if(typeof R.type==="string"){var $={node:R,parentKey:v,parentPath:L,shouldStop:false,inList:Array.isArray(P)};innerWalk($,I)}}))}))}innerWalk(v,I)}var L=function noop(){};function traverse(v,I){var P=arguments.length>2&&arguments[2]!==undefined?arguments[2]:L;var R=arguments.length>3&&arguments[3]!==undefined?arguments[3]:L;Object.keys(I).forEach((function(v){if(!$.nodeAndUnionTypes.includes(v)){throw new Error("Unexpected visitor ".concat(v))}}));var q={node:v,inList:false,shouldStop:false,parentPath:null,parentKey:null};walk(q,(function(v,L){if(typeof I[v]==="function"){P(v,L);I[v](L);R(v,L)}var q=$.unionTypesMap[v];if(!q){throw new Error("Unexpected node type ".concat(v))}q.forEach((function(v){if(typeof I[v]==="function"){P(v,L);I[v](L);R(v,L)}}))}))}},89095:function(v,I,P){"use strict";Object.defineProperty(I,"__esModule",{value:true});I.isAnonymous=isAnonymous;I.getSectionMetadata=getSectionMetadata;I.getSectionMetadatas=getSectionMetadatas;I.sortSectionMetadata=sortSectionMetadata;I.orderedInsertNode=orderedInsertNode;I.assertHasLoc=assertHasLoc;I.getEndOfSection=getEndOfSection;I.shiftLoc=shiftLoc;I.shiftSection=shiftSection;I.signatureForOpcode=signatureForOpcode;I.getUniqueNameGenerator=getUniqueNameGenerator;I.getStartByteOffset=getStartByteOffset;I.getEndByteOffset=getEndByteOffset;I.getFunctionBeginingByteOffset=getFunctionBeginingByteOffset;I.getEndBlockByteOffset=getEndBlockByteOffset;I.getStartBlockByteOffset=getStartBlockByteOffset;var R=P(10644);var $=P(87786);var L=_interopRequireWildcard(P(39622));function _getRequireWildcardCache(v){if(typeof WeakMap!=="function")return null;var I=new WeakMap;var P=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(v){return v?P:I})(v)}function _interopRequireWildcard(v,I){if(!I&&v&&v.__esModule){return v}if(v===null||_typeof(v)!=="object"&&typeof v!=="function"){return{default:v}}var P=_getRequireWildcardCache(I);if(P&&P.has(v)){return P.get(v)}var R={};var $=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var L in v){if(L!=="default"&&Object.prototype.hasOwnProperty.call(v,L)){var q=$?Object.getOwnPropertyDescriptor(v,L):null;if(q&&(q.get||q.set)){Object.defineProperty(R,L,q)}else{R[L]=v[L]}}}R["default"]=v;if(P){P.set(v,R)}return R}function _slicedToArray(v,I){return _arrayWithHoles(v)||_iterableToArrayLimit(v,I)||_unsupportedIterableToArray(v,I)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(v,I){if(!v)return;if(typeof v==="string")return _arrayLikeToArray(v,I);var P=Object.prototype.toString.call(v).slice(8,-1);if(P==="Object"&&v.constructor)P=v.constructor.name;if(P==="Map"||P==="Set")return Array.from(v);if(P==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P))return _arrayLikeToArray(v,I)}function _arrayLikeToArray(v,I){if(I==null||I>v.length)I=v.length;for(var P=0,R=new Array(I);P<I;P++){R[P]=v[P]}return R}function _iterableToArrayLimit(v,I){var P=v==null?null:typeof Symbol!=="undefined"&&v[Symbol.iterator]||v["@@iterator"];if(P==null)return;var R=[];var $=true;var L=false;var q,K;try{for(P=P.call(v);!($=(q=P.next()).done);$=true){R.push(q.value);if(I&&R.length===I)break}}catch(v){L=true;K=v}finally{try{if(!$&&P["return"]!=null)P["return"]()}finally{if(L)throw K}}return R}function _arrayWithHoles(v){if(Array.isArray(v))return v}function _typeof(v){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(v){return typeof v}}else{_typeof=function _typeof(v){return v&&typeof Symbol==="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v}}return _typeof(v)}function isAnonymous(v){return v.raw===""}function getSectionMetadata(v,I){var P;(0,$.traverse)(v,{SectionMetadata:function(v){function SectionMetadata(I){return v.apply(this,arguments)}SectionMetadata.toString=function(){return v.toString()};return SectionMetadata}((function(v){var R=v.node;if(R.section===I){P=R}}))});return P}function getSectionMetadatas(v,I){var P=[];(0,$.traverse)(v,{SectionMetadata:function(v){function SectionMetadata(I){return v.apply(this,arguments)}SectionMetadata.toString=function(){return v.toString()};return SectionMetadata}((function(v){var R=v.node;if(R.section===I){P.push(R)}}))});return P}function sortSectionMetadata(v){if(v.metadata=