Since #12241 we have notifications for this when the user navigates away from the viewer, but we do not yet warn when switching documents, which means that if you call e.g. `PDFViewerApplication.open` with a new document (or directly call `BaseViewer.setDocument` when using the viewer components standalone) there won't be any warning about losing form data. This should be addressed.
}
        generatorId = generator.replace(/[ .-]/g, "_");
        return true;
      });
    }
    let formType = null;
    if (info.IsXFAPresent) {
      formType = "xfa";
    } else if (info.IsAcroFormPresent) {
      formType = "acroform";
    }
    this.externalServices.reportTelemetry({
      type: "documentInfo",
      version: versionId,
      generator: generatorId,
      formType,
    });
    this.eventBus.dispatch("metadataloaded", { source: this });
  },
  /**
   * @private
   */
  async _initializePageLabels(pdfDocument) {
    const labels = await pdfDocument.getPageLabels();
    if (pdfDocument !== this.pdfDocument) {
      return; 
    }
    if (!labels || AppOptions.get("disablePageLabels")) {
      return;
    }