shadow$provide.module$node_modules$pixi_DOT_js$lib$app$ResizePlugin = function(global, require, module, exports) {
  global = require("module$node_modules$pixi_DOT_js$lib$extensions$Extensions");
  "use strict";
  class ResizePlugin {
    static init(options) {
      Object.defineProperty(this, "resizeTo", {configurable:!0, set(dom) {
        globalThis.removeEventListener("resize", this.queueResize);
        if (this._resizeTo = dom) {
          globalThis.addEventListener("resize", this.queueResize), this.resize();
        }
      }, get() {
        return this._resizeTo;
      }});
      this.queueResize = () => {
        this._resizeTo && (this._cancelResize(), this._resizeId = requestAnimationFrame(() => this.resize()));
      };
      this._cancelResize = () => {
        this._resizeId && (cancelAnimationFrame(this._resizeId), this._resizeId = null);
      };
      this.resize = () => {
        if (this._resizeTo) {
          this._cancelResize();
          if (this._resizeTo === globalThis.window) {
            var width = globalThis.innerWidth;
            var height = globalThis.innerHeight;
          } else {
            const {clientWidth, clientHeight} = this._resizeTo;
            width = clientWidth;
            height = clientHeight;
          }
          this.renderer.resize(width, height);
          this.render();
        }
      };
      this._resizeTo = this._resizeId = null;
      this.resizeTo = options.resizeTo || null;
    }
    static destroy() {
      globalThis.removeEventListener("resize", this.queueResize);
      this._cancelResize();
      this.resize = this.resizeTo = this.queueResize = this._cancelResize = null;
    }
  }
  ResizePlugin.extension = global.ExtensionType.Application;
  exports.ResizePlugin = ResizePlugin;
};

//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$app$ResizePlugin.js.map
