Index: imaps-frontend/node_modules/@webassemblyjs/helper-wasm-section/lib/create.js
===================================================================
--- imaps-frontend/node_modules/@webassemblyjs/helper-wasm-section/lib/create.js	(revision 79a03170cdde4e801d12257ee86723774970427b)
+++ imaps-frontend/node_modules/@webassemblyjs/helper-wasm-section/lib/create.js	(revision 79a03170cdde4e801d12257ee86723774970427b)
@@ -0,0 +1,123 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.createEmptySection = createEmptySection;
+
+var _wasmGen = require("@webassemblyjs/wasm-gen");
+
+var _helperBuffer = require("@webassemblyjs/helper-buffer");
+
+var _helperWasmBytecode = _interopRequireDefault(require("@webassemblyjs/helper-wasm-bytecode"));
+
+var t = _interopRequireWildcard(require("@webassemblyjs/ast"));
+
+function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
+
+function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
+
+function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
+
+function findLastSection(ast, forSection) {
+  var targetSectionId = _helperWasmBytecode["default"].sections[forSection]; // $FlowIgnore: metadata can not be empty
+
+  var moduleSections = ast.body[0].metadata.sections;
+  var lastSection;
+  var lastId = 0;
+
+  for (var i = 0, len = moduleSections.length; i < len; i++) {
+    var section = moduleSections[i]; // Ignore custom section since they can actually occur everywhere
+
+    if (section.section === "custom") {
+      continue;
+    }
+
+    var sectionId = _helperWasmBytecode["default"].sections[section.section];
+
+    if (targetSectionId > lastId && targetSectionId < sectionId) {
+      return lastSection;
+    }
+
+    lastId = sectionId;
+    lastSection = section;
+  }
+
+  return lastSection;
+}
+
+function createEmptySection(ast, uint8Buffer, section) {
+  // previous section after which we are going to insert our section
+  var lastSection = findLastSection(ast, section);
+  var start, end;
+  /**
+   * It's the first section
+   */
+
+  if (lastSection == null || lastSection.section === "custom") {
+    start = 8
+    /* wasm header size */
+    ;
+    end = start;
+  } else {
+    start = lastSection.startOffset + lastSection.size.value + 1;
+    end = start;
+  } // section id
+
+
+  start += 1;
+  var sizeStartLoc = {
+    line: -1,
+    column: start
+  };
+  var sizeEndLoc = {
+    line: -1,
+    column: start + 1
+  }; // 1 byte for the empty vector
+
+  var size = t.withLoc(t.numberLiteralFromRaw(1), sizeEndLoc, sizeStartLoc);
+  var vectorOfSizeStartLoc = {
+    line: -1,
+    column: sizeEndLoc.column
+  };
+  var vectorOfSizeEndLoc = {
+    line: -1,
+    column: sizeEndLoc.column + 1
+  };
+  var vectorOfSize = t.withLoc(t.numberLiteralFromRaw(0), vectorOfSizeEndLoc, vectorOfSizeStartLoc);
+  var sectionMetadata = t.sectionMetadata(section, start, size, vectorOfSize);
+  var sectionBytes = (0, _wasmGen.encodeNode)(sectionMetadata);
+  uint8Buffer = (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start - 1, end, sectionBytes); // Add section into the AST for later lookups
+
+  if (_typeof(ast.body[0].metadata) === "object") {
+    // $FlowIgnore: metadata can not be empty
+    ast.body[0].metadata.sections.push(sectionMetadata);
+    t.sortSectionMetadata(ast.body[0]);
+  }
+  /**
+   * Update AST
+   */
+  // Once we hit our section every that is after needs to be shifted by the delta
+
+
+  var deltaBytes = +sectionBytes.length;
+  var encounteredSection = false;
+  t.traverse(ast, {
+    SectionMetadata: function SectionMetadata(path) {
+      if (path.node.section === section) {
+        encounteredSection = true;
+        return;
+      }
+
+      if (encounteredSection === true) {
+        t.shiftSection(ast, path.node, deltaBytes);
+      }
+    }
+  });
+  return {
+    uint8Buffer: uint8Buffer,
+    sectionMetadata: sectionMetadata
+  };
+}
Index: imaps-frontend/node_modules/@webassemblyjs/helper-wasm-section/lib/index.js
===================================================================
--- imaps-frontend/node_modules/@webassemblyjs/helper-wasm-section/lib/index.js	(revision 79a03170cdde4e801d12257ee86723774970427b)
+++ imaps-frontend/node_modules/@webassemblyjs/helper-wasm-section/lib/index.js	(revision 79a03170cdde4e801d12257ee86723774970427b)
@@ -0,0 +1,35 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+Object.defineProperty(exports, "resizeSectionByteSize", {
+  enumerable: true,
+  get: function get() {
+    return _resize.resizeSectionByteSize;
+  }
+});
+Object.defineProperty(exports, "resizeSectionVecSize", {
+  enumerable: true,
+  get: function get() {
+    return _resize.resizeSectionVecSize;
+  }
+});
+Object.defineProperty(exports, "createEmptySection", {
+  enumerable: true,
+  get: function get() {
+    return _create.createEmptySection;
+  }
+});
+Object.defineProperty(exports, "removeSections", {
+  enumerable: true,
+  get: function get() {
+    return _remove.removeSections;
+  }
+});
+
+var _resize = require("./resize");
+
+var _create = require("./create");
+
+var _remove = require("./remove");
Index: imaps-frontend/node_modules/@webassemblyjs/helper-wasm-section/lib/remove.js
===================================================================
--- imaps-frontend/node_modules/@webassemblyjs/helper-wasm-section/lib/remove.js	(revision 79a03170cdde4e801d12257ee86723774970427b)
+++ imaps-frontend/node_modules/@webassemblyjs/helper-wasm-section/lib/remove.js	(revision 79a03170cdde4e801d12257ee86723774970427b)
@@ -0,0 +1,45 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.removeSections = removeSections;
+
+var _ast = require("@webassemblyjs/ast");
+
+var _helperBuffer = require("@webassemblyjs/helper-buffer");
+
+function removeSections(ast, uint8Buffer, section) {
+  var sectionMetadatas = (0, _ast.getSectionMetadatas)(ast, section);
+
+  if (sectionMetadatas.length === 0) {
+    throw new Error("Section metadata not found");
+  }
+
+  return sectionMetadatas.reverse().reduce(function (uint8Buffer, sectionMetadata) {
+    var startsIncludingId = sectionMetadata.startOffset - 1;
+    var ends = section === "start" ? sectionMetadata.size.loc.end.column + 1 : sectionMetadata.startOffset + sectionMetadata.size.value + 1;
+    var delta = -(ends - startsIncludingId);
+    /**
+     * update AST
+     */
+    // Once we hit our section every that is after needs to be shifted by the delta
+
+    var encounteredSection = false;
+    (0, _ast.traverse)(ast, {
+      SectionMetadata: function SectionMetadata(path) {
+        if (path.node.section === section) {
+          encounteredSection = true;
+          return path.remove();
+        }
+
+        if (encounteredSection === true) {
+          (0, _ast.shiftSection)(ast, path.node, delta);
+        }
+      }
+    }); // replacement is nothing
+
+    var replacement = [];
+    return (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, startsIncludingId, ends, replacement);
+  }, uint8Buffer);
+}
Index: imaps-frontend/node_modules/@webassemblyjs/helper-wasm-section/lib/resize.js
===================================================================
--- imaps-frontend/node_modules/@webassemblyjs/helper-wasm-section/lib/resize.js	(revision 79a03170cdde4e801d12257ee86723774970427b)
+++ imaps-frontend/node_modules/@webassemblyjs/helper-wasm-section/lib/resize.js	(revision 79a03170cdde4e801d12257ee86723774970427b)
@@ -0,0 +1,90 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.resizeSectionByteSize = resizeSectionByteSize;
+exports.resizeSectionVecSize = resizeSectionVecSize;
+
+var _wasmGen = require("@webassemblyjs/wasm-gen");
+
+var _ast = require("@webassemblyjs/ast");
+
+var _helperBuffer = require("@webassemblyjs/helper-buffer");
+
+function resizeSectionByteSize(ast, uint8Buffer, section, deltaBytes) {
+  var sectionMetadata = (0, _ast.getSectionMetadata)(ast, section);
+
+  if (typeof sectionMetadata === "undefined") {
+    throw new Error("Section metadata not found");
+  }
+
+  if (typeof sectionMetadata.size.loc === "undefined") {
+    throw new Error("SectionMetadata " + section + " has no loc");
+  } // keep old node location to be overriden
+
+
+  var start = sectionMetadata.size.loc.start.column;
+  var end = sectionMetadata.size.loc.end.column;
+  var newSectionSize = sectionMetadata.size.value + deltaBytes;
+  var newBytes = (0, _wasmGen.encodeU32)(newSectionSize);
+  /**
+   * update AST
+   */
+
+  sectionMetadata.size.value = newSectionSize;
+  var oldu32EncodedLen = end - start;
+  var newu32EncodedLen = newBytes.length; // the new u32 has a different encoded length
+
+  if (newu32EncodedLen !== oldu32EncodedLen) {
+    var deltaInSizeEncoding = newu32EncodedLen - oldu32EncodedLen;
+    sectionMetadata.size.loc.end.column = start + newu32EncodedLen;
+    deltaBytes += deltaInSizeEncoding; // move the vec size pointer size the section size is now smaller
+
+    sectionMetadata.vectorOfSize.loc.start.column += deltaInSizeEncoding;
+    sectionMetadata.vectorOfSize.loc.end.column += deltaInSizeEncoding;
+  } // Once we hit our section every that is after needs to be shifted by the delta
+
+
+  var encounteredSection = false;
+  (0, _ast.traverse)(ast, {
+    SectionMetadata: function SectionMetadata(path) {
+      if (path.node.section === section) {
+        encounteredSection = true;
+        return;
+      }
+
+      if (encounteredSection === true) {
+        (0, _ast.shiftSection)(ast, path.node, deltaBytes);
+      }
+    }
+  });
+  return (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start, end, newBytes);
+}
+
+function resizeSectionVecSize(ast, uint8Buffer, section, deltaElements) {
+  var sectionMetadata = (0, _ast.getSectionMetadata)(ast, section);
+
+  if (typeof sectionMetadata === "undefined") {
+    throw new Error("Section metadata not found");
+  }
+
+  if (typeof sectionMetadata.vectorOfSize.loc === "undefined") {
+    throw new Error("SectionMetadata " + section + " has no loc");
+  } // Section has no vector
+
+
+  if (sectionMetadata.vectorOfSize.value === -1) {
+    return uint8Buffer;
+  } // keep old node location to be overriden
+
+
+  var start = sectionMetadata.vectorOfSize.loc.start.column;
+  var end = sectionMetadata.vectorOfSize.loc.end.column;
+  var newValue = sectionMetadata.vectorOfSize.value + deltaElements;
+  var newBytes = (0, _wasmGen.encodeU32)(newValue); // Update AST
+
+  sectionMetadata.vectorOfSize.value = newValue;
+  sectionMetadata.vectorOfSize.loc.end.column = start + newBytes.length;
+  return (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start, end, newBytes);
+}
