async doRoute(routeSource) {
    if (this.safety > 10)
      throw new Error("\u{1F6AB} [uibrouter:doRoute] Safety protocol triggered, too many route bounces");
    if (!this.config.routes || this.config.routes < 1)
      return;
    if (!routeSource)
      routeSource = this.config.defaultRoute;
    const container = this.routeContainerEl;
    if (!container)
      throw new Error("[uibrouter:doRoute] Cannot route, has router.setup() been called yet?");
    const currentHash = this.keepHashFromUrl(window.location.hash);
    if (!routeSource)
      routeSource = currentHash;
    let newRouteId, oldRouteId;
    if (typeof routeSource === "string") {
      newRouteId = this.keepHashFromUrl(routeSource);
      oldRouteId = currentHash;
      if (newRouteId === "" && this.config.defaultRoute)
        newRouteId = this.config.defaultRoute;
      if (newRouteId !== currentHash) {
        window.location.hash = `#${newRouteId}`;
        return;
      }
    } else if (routeSource.type === "hashchange") {
      const newUrl = routeSource.newURL;
      if (newUrl.includes("#")) {
        oldRouteId = this.keepHashFromUrl(routeSource.oldURL);
        newRouteId = this.keepHashFromUrl(newUrl);
      } else
        return;
    } else {
      oldRouteId = currentHash;
      try {
        newRouteId = this.keepHashFromUrl(routeSource.target.attributes.href.value);
      } catch (e) {
        throw new Error("[uibrouter:doRoute] No valid route found. Event.target does not have an href attribute");
      }
    }
    let routeShown = false;
    if (!newRouteId || !this.routeIds.has(newRouteId)) {
      document.dispatchEvent(new CustomEvent("uibrouter:route-change-failed", { detail: { newRouteId, oldRouteId } }));
      if (this.uibuilder)
        uibuilder.set("uibrouter", "route change failed");
      if (newRouteId === oldRouteId)
        oldRouteId = "";
      console.error(`[uibrouter:doRoute] No valid route found. Either pass a valid route name or an event from an element having an href of '#${newRouteId}'. Route id requested: '${newRouteId}'`);
      this.safety++;
      this.doRoute(oldRouteId || "");
      return;
    }
    if (this.config.hide) {
      if (oldRouteId) {
        const oldContent = document.querySelector(`div[data-route="${oldRouteId}"]`);
        if (oldContent)
          oldContent.style.display = "none";
      }
      const content = document.querySelector(`div[data-route="${newRouteId}"]`);
      if (content) {
        content.style.removeProperty("display");
        routeShown = true;
      } else {
        try {
          routeShown = await this.loadRoute(newRouteId);
        } catch (e) {
          console.error("[uibrouter:doRoute] ", e);
          routeShown = false;
        }
      }
    } else {
      container.replaceChildren();
      try {
        routeShown = await this.loadRoute(newRouteId);
      } catch (e) {
        console.error("[uibrouter:doRoute] ", e);
        routeShown = false;
      }
    }
    if (routeShown === false) {
      document.dispatchEvent(new CustomEvent("uibrouter:route-change-failed", { detail: { newRouteId, oldRouteId } }));
      if (this.uibuilder)
        uibuilder.set("uibrouter", "route change failed");
      if (newRouteId === oldRouteId)
        oldRouteId = "";
      console.error(`[uibrouter:doRoute] Route content for '${newRouteId}' could not be shown, reverting to old route '${oldRouteId}'`);
      this.safety++;
      this.doRoute(oldRouteId || "");
      return;
    }
    this.safety = 0;
    if (this.config.templateUnload)
      this.unloadTemplate(oldRouteId);
    this.currentRouteId = newRouteId;
    this.previousRouteId = oldRouteId;
    container.dataset.currentRoute = newRouteId;
    this.setCurrentMenuItems();
    document.dispatchEvent(new CustomEvent("uibrouter:route-changed", { detail: { newRouteId, oldRouteId } }));
    this._uibRouteChange(newRouteId);
  }
Process a routing request
All errors throw so make sure to try/catch calls to this method.
@param {PointerEvent|MouseEvent|HashChangeEvent|TouchEvent|string} routeSource Either string containing route id or DOM Event object either click/touch on element containing `href="#routeid"` or Hash URL change event