PDF.js version: 3.5.141

These two properties should be marked as not mandatory as they are initialized if not present
if (
      document.visibilityState === "hidden" ||
      !this.container.offsetParent ||
      this._getVisiblePages().views.length === 0
    ) {
      return Promise.resolve();
    }
    
    
    const visibilityChangePromise = new Promise(resolve => {
      this.#onVisibilityChange = () => {
        if (document.visibilityState !== "hidden") {
          return;
        }
        resolve();
        document.removeEventListener(
          "visibilitychange",
          this.#onVisibilityChange
        );
        this.#onVisibilityChange = null;
      };
      document.addEventListener("visibilitychange", this.#onVisibilityChange);
    });
    return Promise.race([
      this._onePageRenderedCapability.promise,
      visibilityChangePromise,
    ]);
  }
  async getAllText() {