_uiAdd(ui, isRecurse) {
    _a.log("trace", "Ui:_uiManager:add", "Starting _uiAdd")();
    ui.components.forEach((compToAdd, i) => {
      _a.log("trace", `Ui:_uiAdd:components-forEach:${i}`, "Component to add: ", compToAdd)();
      let newEl;
      switch (compToAdd.type) {
        // If trying to insert raw html, wrap in a div
        case "html": {
          compToAdd.ns = "html";
          newEl = _a.doc.createElement("div");
          break;
        }
        // If trying to insert raw svg, need to create in namespace
        case "svg": {
          compToAdd.ns = "svg";
          newEl = _a.doc.createElementNS("http://www.w3.org/2000/svg", "svg");
          break;
        }
        default: {
          compToAdd.ns = "dom";
          newEl = _a.doc.createElement(compToAdd.type);
          break;
        }
      }
      if (!compToAdd.slot && ui.payload) compToAdd.slot = ui.payload;
      this._uiComposeComponent(newEl, compToAdd);
      let elParent;
      if (compToAdd.parentEl) {
        elParent = compToAdd.parentEl;
      } else if (ui.parentEl) {
        elParent = ui.parentEl;
      } else if (compToAdd.parent) {
        elParent = _a.doc.querySelector(compToAdd.parent);
      } else if (ui.parent) {
        elParent = _a.doc.querySelector(ui.parent);
      }
      if (!elParent) {
        _a.log("info", "Ui:_uiAdd", "No parent found, adding to body")();
        elParent = _a.doc.querySelector("body");
      }
      if (compToAdd.position && compToAdd.position === "first") {
        elParent.insertBefore(newEl, elParent.firstChild);
      } else if (compToAdd.position && Number.isInteger(Number(compToAdd.position))) {
        elParent.insertBefore(newEl, elParent.children[compToAdd.position]);
      } else {
        elParent.appendChild(newEl);
      }
      if (compToAdd.components) {
        this._uiExtendEl(newEl, compToAdd.components, compToAdd.ns);
      }
    });
  }
Handle incoming msg._ui add requests
@param {*} ui Standardised msg._ui property object. Note that payload and topic are appended to this object
@param {boolean} isRecurse Is this a recursive call?