shadow$provide.module$node_modules$pixi_DOT_js$lib$rendering$renderers$autoDetectRenderer = function(global, require, module, exports) {
  var isWebGLSupported = require("module$node_modules$pixi_DOT_js$lib$utils$browser$isWebGLSupported"), isWebGPUSupported = require("module$node_modules$pixi_DOT_js$lib$utils$browser$isWebGPUSupported"), AbstractRenderer = require("module$node_modules$pixi_DOT_js$lib$rendering$renderers$shared$system$AbstractRenderer");
  "use strict";
  const renderPriority = ["webgl", "webgpu", "canvas"];
  exports.autoDetectRenderer = async function(options) {
    let preferredOrder = [];
    options.preference ? Array.isArray(options.preference) ? preferredOrder = options.preference.slice() : (preferredOrder.push(options.preference), renderPriority.forEach(item => {
      item !== options.preference && preferredOrder.push(item);
    })) : preferredOrder = renderPriority.slice();
    var finalOptions = {};
    for (let i = 0; i < preferredOrder.length; i++) {
      const rendererType = preferredOrder[i];
      if ("webgpu" === rendererType && await isWebGPUSupported.isWebGPUSupported()) {
        ({WebGPURenderer:finalOptions} = await Promise.resolve().then(function() {
          return require("module$node_modules$pixi_DOT_js$lib$rendering$renderers$gpu$WebGPURenderer");
        }));
        var RendererClass = finalOptions;
        finalOptions = {...options, ...options.webgpu};
        break;
      } else if ("webgl" === rendererType && isWebGLSupported.isWebGLSupported(options.failIfMajorPerformanceCaveat ?? AbstractRenderer.AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat)) {
        ({WebGLRenderer:finalOptions} = await Promise.resolve().then(function() {
          return require("module$node_modules$pixi_DOT_js$lib$rendering$renderers$gl$WebGLRenderer");
        }));
        RendererClass = finalOptions;
        finalOptions = {...options, ...options.webgl};
        break;
      } else if ("canvas" === rendererType) {
        ({CanvasRenderer:finalOptions} = await Promise.resolve().then(function() {
          return require("module$node_modules$pixi_DOT_js$lib$rendering$renderers$canvas$CanvasRenderer");
        }));
        RendererClass = finalOptions;
        finalOptions = {...options, ...options.canvasOptions};
        break;
      }
    }
    delete finalOptions.webgpu;
    delete finalOptions.webgl;
    delete finalOptions.canvasOptions;
    if (!RendererClass) {
      throw Error("No available renderer for the current environment");
    }
    RendererClass = new RendererClass();
    await RendererClass.init(finalOptions);
    return RendererClass;
  };
};

//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$rendering$renderers$autoDetectRenderer.js.map
