function apiPageModeToSidebarView(mode) {
  switch (mode) {
    case "UseNone":
      return SidebarView.NONE;
    case "UseThumbs":
      return SidebarView.THUMBS;
    case "UseOutlines":
      return SidebarView.OUTLINE;
    case "UseAttachments":
      return SidebarView.ATTACHMENTS;
    case "UseOC":
      return SidebarView.LAYERS;
  }
  return SidebarView.NONE; // Default value.
}
Converts API PageMode values to the format used by `PDFSidebar`.
NOTE: There's also a "FullScreen" parameter which is not possible to support,
      since the Fullscreen API used in browsers requires that entering
      fullscreen mode only occurs as a result of a user-initiated event.
@param {string} mode - The API PageMode value.
@returns {number} A value from {SidebarView}.