shadow$provide.module$node_modules$pixi_DOT_js$lib$assets$loader$parsers$textures$loadTextures = function(global, require, module, exports) {
  async function loadImageBitmap(url, asset) {
    const response = await adapter.DOMAdapter.get().fetch(url);
    if (!response.ok) {
      throw Error(`[loadImageBitmap] Failed to fetch ${url}: ${response.status} ${response.statusText}`);
    }
    url = await response.blob();
    return "premultiplied-alpha" === asset?.data?.alphaMode ? createImageBitmap(url, {premultiplyAlpha:"none"}) : createImageBitmap(url);
  }
  var adapter = require("module$node_modules$pixi_DOT_js$lib$environment$adapter");
  global = require("module$node_modules$pixi_DOT_js$lib$extensions$Extensions");
  var ImageSource = require("module$node_modules$pixi_DOT_js$lib$rendering$renderers$shared$texture$sources$ImageSource"), getResolutionOfUrl = require("module$node_modules$pixi_DOT_js$lib$utils$network$getResolutionOfUrl"), checkDataUrl = require("module$node_modules$pixi_DOT_js$lib$assets$utils$checkDataUrl"), checkExtension = require("module$node_modules$pixi_DOT_js$lib$assets$utils$checkExtension"), WorkerManager = require("module$node_modules$pixi_DOT_js$lib$assets$loader$workers$WorkerManager");
  module = require("module$node_modules$pixi_DOT_js$lib$assets$loader$parsers$LoaderParser");
  var createTexture = require("module$node_modules$pixi_DOT_js$lib$assets$loader$parsers$textures$utils$createTexture");
  "use strict";
  const validImageExtensions = [".jpeg", ".jpg", ".png", ".webp", ".avif"], validImageMIMEs = ["image/jpeg", "image/png", "image/webp", "image/avif"];
  require = {name:"loadTextures", id:"texture", extension:{type:global.ExtensionType.LoadParser, priority:module.LoaderParserPriority.High, name:"loadTextures"}, config:{preferWorkers:!0, preferCreateImageBitmap:!0, crossOrigin:"anonymous"}, test(url) {
    return checkDataUrl.checkDataUrl(url, validImageMIMEs) || checkExtension.checkExtension(url, validImageExtensions);
  }, async load(url, asset, loader) {
    let src = null;
    src = globalThis.createImageBitmap && this.config.preferCreateImageBitmap ? this.config.preferWorkers && await WorkerManager.WorkerManager.isImageBitmapSupported() ? await WorkerManager.WorkerManager.loadImageBitmap(url, asset) : await loadImageBitmap(url, asset) : await new Promise((resolve, reject) => {
      src = adapter.DOMAdapter.get().createImage();
      src.crossOrigin = this.config.crossOrigin;
      src.src = url;
      src.complete ? resolve(src) : (src.onload = () => {
        resolve(src);
      }, src.onerror = reject);
    });
    asset = new ImageSource.ImageSource({resource:src, alphaMode:"premultiply-alpha-on-upload", resolution:asset.data?.resolution || getResolutionOfUrl.getResolutionOfUrl(url), ...asset.data});
    return createTexture.createTexture(asset, loader, url);
  }, unload(texture) {
    texture.destroy(!0);
  }};
  exports.loadImageBitmap = loadImageBitmap;
  exports.loadTextures = require;
};

//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$assets$loader$parsers$textures$loadTextures.js.map
