Initial
This commit is contained in:
21
resources/app/node_modules/@pixi/assets/LICENSE
generated
vendored
Normal file
21
resources/app/node_modules/@pixi/assets/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2013-2023 Mathew Groves, Chad Engler
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
21
resources/app/node_modules/@pixi/assets/lib/AssetExtension.js
generated
vendored
Normal file
21
resources/app/node_modules/@pixi/assets/lib/AssetExtension.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core");
|
||||
const assetKeyMap = {
|
||||
loader: core.ExtensionType.LoadParser,
|
||||
resolver: core.ExtensionType.ResolveParser,
|
||||
cache: core.ExtensionType.CacheParser,
|
||||
detection: core.ExtensionType.DetectionParser
|
||||
};
|
||||
core.extensions.handle(core.ExtensionType.Asset, (extension) => {
|
||||
const ref = extension.ref;
|
||||
Object.entries(assetKeyMap).filter(([key]) => !!ref[key]).forEach(([key, type]) => core.extensions.add(Object.assign(
|
||||
ref[key],
|
||||
// Allow the function to optionally define it's own
|
||||
// ExtensionMetadata, the use cases here is priority for LoaderParsers
|
||||
{ extension: ref[key].extension ?? type }
|
||||
)));
|
||||
}, (extension) => {
|
||||
const ref = extension.ref;
|
||||
Object.keys(assetKeyMap).filter((key) => !!ref[key]).forEach((key) => core.extensions.remove(ref[key]));
|
||||
});
|
||||
//# sourceMappingURL=AssetExtension.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/AssetExtension.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/AssetExtension.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"AssetExtension.js","sources":["../src/AssetExtension.ts"],"sourcesContent":["import { extensions, ExtensionType } from '@pixi/core';\n\nimport type { CacheParser } from './cache';\nimport type { FormatDetectionParser } from './detections';\nimport type { LoaderParser } from './loader';\nimport type { ResolveURLParser } from './resolver';\n\nconst assetKeyMap = {\n loader: ExtensionType.LoadParser,\n resolver: ExtensionType.ResolveParser,\n cache: ExtensionType.CacheParser,\n detection: ExtensionType.DetectionParser,\n};\n\ntype AssetType = keyof typeof assetKeyMap;\n\n/**\n * This developer convenience object allows developers to group\n * together the various asset parsers into a single object.\n * @memberof PIXI\n */\ninterface AssetExtension<ASSET = any, META_DATA = any>\n{\n extension: ExtensionType.Asset,\n loader?: Partial<LoaderParser<ASSET, META_DATA>>,\n resolver?: Partial<ResolveURLParser>,\n cache?: Partial<CacheParser<ASSET>>,\n detection?: Partial<FormatDetectionParser>,\n}\n\n// Split the Asset extension into it's various parts\n// these are handled in the Assets.ts file\nextensions.handle(ExtensionType.Asset, (extension) =>\n{\n const ref = extension.ref as AssetExtension;\n\n Object.entries(assetKeyMap)\n .filter(([key]) => !!ref[key as AssetType])\n .forEach(([key, type]) => extensions.add(Object.assign(\n ref[key as AssetType],\n // Allow the function to optionally define it's own\n // ExtensionMetadata, the use cases here is priority for LoaderParsers\n { extension: ref[key as AssetType].extension ?? type },\n )));\n}, (extension) =>\n{\n const ref = extension.ref as AssetExtension;\n\n Object.keys(assetKeyMap)\n .filter((key) => !!ref[key as AssetType])\n .forEach((key) => extensions.remove(ref[key as AssetType]));\n});\n\nexport type { AssetExtension };\n"],"names":["ExtensionType","extensions"],"mappings":";;AAOA,MAAM,cAAc;AAAA,EAChB,QAAQA,KAAc,cAAA;AAAA,EACtB,UAAUA,KAAc,cAAA;AAAA,EACxB,OAAOA,KAAc,cAAA;AAAA,EACrB,WAAWA,KAAc,cAAA;AAC7B;AAoBAC,KAAA,WAAW,OAAOD,KAAAA,cAAc,OAAO,CAAC,cACxC;AACI,QAAM,MAAM,UAAU;AAEf,SAAA,QAAQ,WAAW,EACrB,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,GAAgB,CAAC,EACzC,QAAQ,CAAC,CAAC,KAAK,IAAI,MAAMC,KAAW,WAAA,IAAI,OAAO;AAAA,IAC5C,IAAI,GAAgB;AAAA;AAAA;AAAA,IAGpB,EAAE,WAAW,IAAI,GAAgB,EAAE,aAAa,KAAK;AAAA,EACxD,CAAA,CAAC;AACV,GAAG,CAAC,cACJ;AACI,QAAM,MAAM,UAAU;AAEf,SAAA,KAAK,WAAW,EAClB,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,GAAgB,CAAC,EACvC,QAAQ,CAAC,QAAQA,KAAA,WAAW,OAAO,IAAI,GAAgB,CAAC,CAAC;AAClE,CAAC;"}
|
||||
20
resources/app/node_modules/@pixi/assets/lib/AssetExtension.mjs
generated
vendored
Normal file
20
resources/app/node_modules/@pixi/assets/lib/AssetExtension.mjs
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import { ExtensionType, extensions } from "@pixi/core";
|
||||
const assetKeyMap = {
|
||||
loader: ExtensionType.LoadParser,
|
||||
resolver: ExtensionType.ResolveParser,
|
||||
cache: ExtensionType.CacheParser,
|
||||
detection: ExtensionType.DetectionParser
|
||||
};
|
||||
extensions.handle(ExtensionType.Asset, (extension) => {
|
||||
const ref = extension.ref;
|
||||
Object.entries(assetKeyMap).filter(([key]) => !!ref[key]).forEach(([key, type]) => extensions.add(Object.assign(
|
||||
ref[key],
|
||||
// Allow the function to optionally define it's own
|
||||
// ExtensionMetadata, the use cases here is priority for LoaderParsers
|
||||
{ extension: ref[key].extension ?? type }
|
||||
)));
|
||||
}, (extension) => {
|
||||
const ref = extension.ref;
|
||||
Object.keys(assetKeyMap).filter((key) => !!ref[key]).forEach((key) => extensions.remove(ref[key]));
|
||||
});
|
||||
//# sourceMappingURL=AssetExtension.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/AssetExtension.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/AssetExtension.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"AssetExtension.mjs","sources":["../src/AssetExtension.ts"],"sourcesContent":["import { extensions, ExtensionType } from '@pixi/core';\n\nimport type { CacheParser } from './cache';\nimport type { FormatDetectionParser } from './detections';\nimport type { LoaderParser } from './loader';\nimport type { ResolveURLParser } from './resolver';\n\nconst assetKeyMap = {\n loader: ExtensionType.LoadParser,\n resolver: ExtensionType.ResolveParser,\n cache: ExtensionType.CacheParser,\n detection: ExtensionType.DetectionParser,\n};\n\ntype AssetType = keyof typeof assetKeyMap;\n\n/**\n * This developer convenience object allows developers to group\n * together the various asset parsers into a single object.\n * @memberof PIXI\n */\ninterface AssetExtension<ASSET = any, META_DATA = any>\n{\n extension: ExtensionType.Asset,\n loader?: Partial<LoaderParser<ASSET, META_DATA>>,\n resolver?: Partial<ResolveURLParser>,\n cache?: Partial<CacheParser<ASSET>>,\n detection?: Partial<FormatDetectionParser>,\n}\n\n// Split the Asset extension into it's various parts\n// these are handled in the Assets.ts file\nextensions.handle(ExtensionType.Asset, (extension) =>\n{\n const ref = extension.ref as AssetExtension;\n\n Object.entries(assetKeyMap)\n .filter(([key]) => !!ref[key as AssetType])\n .forEach(([key, type]) => extensions.add(Object.assign(\n ref[key as AssetType],\n // Allow the function to optionally define it's own\n // ExtensionMetadata, the use cases here is priority for LoaderParsers\n { extension: ref[key as AssetType].extension ?? type },\n )));\n}, (extension) =>\n{\n const ref = extension.ref as AssetExtension;\n\n Object.keys(assetKeyMap)\n .filter((key) => !!ref[key as AssetType])\n .forEach((key) => extensions.remove(ref[key as AssetType]));\n});\n\nexport type { AssetExtension };\n"],"names":[],"mappings":";AAOA,MAAM,cAAc;AAAA,EAChB,QAAQ,cAAc;AAAA,EACtB,UAAU,cAAc;AAAA,EACxB,OAAO,cAAc;AAAA,EACrB,WAAW,cAAc;AAC7B;AAoBA,WAAW,OAAO,cAAc,OAAO,CAAC,cACxC;AACI,QAAM,MAAM,UAAU;AAEf,SAAA,QAAQ,WAAW,EACrB,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,GAAgB,CAAC,EACzC,QAAQ,CAAC,CAAC,KAAK,IAAI,MAAM,WAAW,IAAI,OAAO;AAAA,IAC5C,IAAI,GAAgB;AAAA;AAAA;AAAA,IAGpB,EAAE,WAAW,IAAI,GAAgB,EAAE,aAAa,KAAK;AAAA,EACxD,CAAA,CAAC;AACV,GAAG,CAAC,cACJ;AACI,QAAM,MAAM,UAAU;AAEf,SAAA,KAAK,WAAW,EAClB,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,GAAgB,CAAC,EACvC,QAAQ,CAAC,QAAQ,WAAW,OAAO,IAAI,GAAgB,CAAC,CAAC;AAClE,CAAC;"}
|
||||
328
resources/app/node_modules/@pixi/assets/lib/Assets.js
generated
vendored
Normal file
328
resources/app/node_modules/@pixi/assets/lib/Assets.js
generated
vendored
Normal file
@@ -0,0 +1,328 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core"), BackgroundLoader = require("./BackgroundLoader.js"), Cache = require("./cache/Cache.js"), Loader = require("./loader/Loader.js");
|
||||
require("./loader/parsers/index.js");
|
||||
var Resolver = require("./resolver/Resolver.js"), convertToList = require("./utils/convertToList.js"), isSingleItem = require("./utils/isSingleItem.js"), loadTextures = require("./loader/parsers/textures/loadTextures.js");
|
||||
class AssetsClass {
|
||||
constructor() {
|
||||
this._detections = [], this._initialized = !1, this.resolver = new Resolver.Resolver(), this.loader = new Loader.Loader(), this.cache = Cache.Cache, this._backgroundLoader = new BackgroundLoader.BackgroundLoader(this.loader), this._backgroundLoader.active = !0, this.reset();
|
||||
}
|
||||
/**
|
||||
* Best practice is to call this function before any loading commences
|
||||
* Initiating is the best time to add any customization to the way things are loaded.
|
||||
*
|
||||
* you do not need to call this for the Asset class to work, only if you want to set any initial properties
|
||||
* @param options - options to initialize the Asset manager with
|
||||
*/
|
||||
async init(options = {}) {
|
||||
if (this._initialized) {
|
||||
console.warn("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");
|
||||
return;
|
||||
}
|
||||
if (this._initialized = !0, options.defaultSearchParams && this.resolver.setDefaultSearchParams(options.defaultSearchParams), options.basePath && (this.resolver.basePath = options.basePath), options.bundleIdentifier && this.resolver.setBundleIdentifier(options.bundleIdentifier), options.manifest) {
|
||||
let manifest = options.manifest;
|
||||
typeof manifest == "string" && (manifest = await this.load(manifest)), this.resolver.addManifest(manifest);
|
||||
}
|
||||
const resolutionPref = options.texturePreference?.resolution ?? 1, resolution = typeof resolutionPref == "number" ? [resolutionPref] : resolutionPref, formats = await this._detectFormats({
|
||||
preferredFormats: options.texturePreference?.format,
|
||||
skipDetections: options.skipDetections,
|
||||
detections: this._detections
|
||||
});
|
||||
this.resolver.prefer({
|
||||
params: {
|
||||
format: formats,
|
||||
resolution
|
||||
}
|
||||
}), options.preferences && this.setPreferences(options.preferences);
|
||||
}
|
||||
add(aliases, srcs, data, format, loadParser) {
|
||||
this.resolver.add(aliases, srcs, data, format, loadParser);
|
||||
}
|
||||
async load(urls, onProgress) {
|
||||
this._initialized || await this.init();
|
||||
const singleAsset = isSingleItem.isSingleItem(urls), urlArray = convertToList.convertToList(urls).map((url) => {
|
||||
if (typeof url != "string") {
|
||||
const aliases = this.resolver.getAlias(url);
|
||||
return aliases.some((alias) => !this.resolver.hasKey(alias)) && this.add(url), Array.isArray(aliases) ? aliases[0] : aliases;
|
||||
}
|
||||
return this.resolver.hasKey(url) || this.add({ alias: url, src: url }), url;
|
||||
}), resolveResults = this.resolver.resolve(urlArray), out = await this._mapLoadToResolve(resolveResults, onProgress);
|
||||
return singleAsset ? out[urlArray[0]] : out;
|
||||
}
|
||||
/**
|
||||
* This adds a bundle of assets in one go so that you can load them as a group.
|
||||
* For example you could add a bundle for each screen in you pixi app
|
||||
* @example
|
||||
* import { Assets } from 'pixi.js';
|
||||
*
|
||||
* Assets.addBundle('animals', {
|
||||
* bunny: 'bunny.png',
|
||||
* chicken: 'chicken.png',
|
||||
* thumper: 'thumper.png',
|
||||
* });
|
||||
*
|
||||
* const assets = await Assets.loadBundle('animals');
|
||||
* @param bundleId - the id of the bundle to add
|
||||
* @param assets - a record of the asset or assets that will be chosen from when loading via the specified key
|
||||
*/
|
||||
addBundle(bundleId, assets) {
|
||||
this.resolver.addBundle(bundleId, assets);
|
||||
}
|
||||
/**
|
||||
* Bundles are a way to load multiple assets at once.
|
||||
* If a manifest has been provided to the init function then you can load a bundle, or bundles.
|
||||
* you can also add bundles via `addBundle`
|
||||
* @example
|
||||
* import { Assets } from 'pixi.js';
|
||||
*
|
||||
* // Manifest Example
|
||||
* const manifest = {
|
||||
* bundles: [
|
||||
* {
|
||||
* name: 'load-screen',
|
||||
* assets: [
|
||||
* {
|
||||
* alias: 'background',
|
||||
* src: 'sunset.png',
|
||||
* },
|
||||
* {
|
||||
* alias: 'bar',
|
||||
* src: 'load-bar.{png,webp}',
|
||||
* },
|
||||
* ],
|
||||
* },
|
||||
* {
|
||||
* name: 'game-screen',
|
||||
* assets: [
|
||||
* {
|
||||
* alias: 'character',
|
||||
* src: 'robot.png',
|
||||
* },
|
||||
* {
|
||||
* alias: 'enemy',
|
||||
* src: 'bad-guy.png',
|
||||
* },
|
||||
* ],
|
||||
* },
|
||||
* ]
|
||||
* };
|
||||
*
|
||||
* await Assets.init({ manifest });
|
||||
*
|
||||
* // Load a bundle...
|
||||
* loadScreenAssets = await Assets.loadBundle('load-screen');
|
||||
* // Load another bundle...
|
||||
* gameScreenAssets = await Assets.loadBundle('game-screen');
|
||||
* @param bundleIds - the bundle id or ids to load
|
||||
* @param onProgress - Optional function that is called when progress on asset loading is made.
|
||||
* The function is passed a single parameter, `progress`, which represents the percentage (0.0 - 1.0)
|
||||
* of the assets loaded. Do not use this function to detect when assets are complete and available,
|
||||
* instead use the Promise returned by this function.
|
||||
* @returns all the bundles assets or a hash of assets for each bundle specified
|
||||
*/
|
||||
async loadBundle(bundleIds, onProgress) {
|
||||
this._initialized || await this.init();
|
||||
let singleAsset = !1;
|
||||
typeof bundleIds == "string" && (singleAsset = !0, bundleIds = [bundleIds]);
|
||||
const resolveResults = this.resolver.resolveBundle(bundleIds), out = {}, keys = Object.keys(resolveResults);
|
||||
let count = 0, total = 0;
|
||||
const _onProgress = () => {
|
||||
onProgress?.(++count / total);
|
||||
}, promises = keys.map((bundleId) => {
|
||||
const resolveResult = resolveResults[bundleId];
|
||||
return total += Object.keys(resolveResult).length, this._mapLoadToResolve(resolveResult, _onProgress).then((resolveResult2) => {
|
||||
out[bundleId] = resolveResult2;
|
||||
});
|
||||
});
|
||||
return await Promise.all(promises), singleAsset ? out[bundleIds[0]] : out;
|
||||
}
|
||||
/**
|
||||
* Initiate a background load of some assets. It will passively begin to load these assets in the background.
|
||||
* So when you actually come to loading them you will get a promise that resolves to the loaded assets immediately
|
||||
*
|
||||
* An example of this might be that you would background load game assets after your inital load.
|
||||
* then when you got to actually load your game screen assets when a player goes to the game - the loading
|
||||
* would already have stared or may even be complete, saving you having to show an interim load bar.
|
||||
* @example
|
||||
* import { Assets } from 'pixi.js';
|
||||
*
|
||||
* Assets.backgroundLoad('bunny.png');
|
||||
*
|
||||
* // later on in your app...
|
||||
* await Assets.loadBundle('bunny.png'); // Will resolve quicker as loading may have completed!
|
||||
* @param urls - the url / urls you want to background load
|
||||
*/
|
||||
async backgroundLoad(urls) {
|
||||
this._initialized || await this.init(), typeof urls == "string" && (urls = [urls]);
|
||||
const resolveResults = this.resolver.resolve(urls);
|
||||
this._backgroundLoader.add(Object.values(resolveResults));
|
||||
}
|
||||
/**
|
||||
* Initiate a background of a bundle, works exactly like backgroundLoad but for bundles.
|
||||
* this can only be used if the loader has been initiated with a manifest
|
||||
* @example
|
||||
* import { Assets } from 'pixi.js';
|
||||
*
|
||||
* await Assets.init({
|
||||
* manifest: {
|
||||
* bundles: [
|
||||
* {
|
||||
* name: 'load-screen',
|
||||
* assets: [...],
|
||||
* },
|
||||
* ...
|
||||
* ],
|
||||
* },
|
||||
* });
|
||||
*
|
||||
* Assets.backgroundLoadBundle('load-screen');
|
||||
*
|
||||
* // Later on in your app...
|
||||
* await Assets.loadBundle('load-screen'); // Will resolve quicker as loading may have completed!
|
||||
* @param bundleIds - the bundleId / bundleIds you want to background load
|
||||
*/
|
||||
async backgroundLoadBundle(bundleIds) {
|
||||
this._initialized || await this.init(), typeof bundleIds == "string" && (bundleIds = [bundleIds]);
|
||||
const resolveResults = this.resolver.resolveBundle(bundleIds);
|
||||
Object.values(resolveResults).forEach((resolveResult) => {
|
||||
this._backgroundLoader.add(Object.values(resolveResult));
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Only intended for development purposes.
|
||||
* This will wipe the resolver and caches.
|
||||
* You will need to reinitialize the Asset
|
||||
*/
|
||||
reset() {
|
||||
this.resolver.reset(), this.loader.reset(), this.cache.reset(), this._initialized = !1;
|
||||
}
|
||||
get(keys) {
|
||||
if (typeof keys == "string")
|
||||
return Cache.Cache.get(keys);
|
||||
const assets = {};
|
||||
for (let i = 0; i < keys.length; i++)
|
||||
assets[i] = Cache.Cache.get(keys[i]);
|
||||
return assets;
|
||||
}
|
||||
/**
|
||||
* helper function to map resolved assets back to loaded assets
|
||||
* @param resolveResults - the resolve results from the resolver
|
||||
* @param onProgress - the progress callback
|
||||
*/
|
||||
async _mapLoadToResolve(resolveResults, onProgress) {
|
||||
const resolveArray = Object.values(resolveResults), resolveKeys = Object.keys(resolveResults);
|
||||
this._backgroundLoader.active = !1;
|
||||
const loadedAssets = await this.loader.load(resolveArray, onProgress);
|
||||
this._backgroundLoader.active = !0;
|
||||
const out = {};
|
||||
return resolveArray.forEach((resolveResult, i) => {
|
||||
const asset = loadedAssets[resolveResult.src], keys = [resolveResult.src];
|
||||
resolveResult.alias && keys.push(...resolveResult.alias), out[resolveKeys[i]] = asset, Cache.Cache.set(keys, asset);
|
||||
}), out;
|
||||
}
|
||||
/**
|
||||
* Unload an asset or assets. As the Assets class is responsible for creating the assets via the `load` function
|
||||
* this will make sure to destroy any assets and release them from memory.
|
||||
* Once unloaded, you will need to load the asset again.
|
||||
*
|
||||
* Use this to help manage assets if you find that you have a large app and you want to free up memory.
|
||||
*
|
||||
* - it's up to you as the developer to make sure that textures are not actively being used when you unload them,
|
||||
* Pixi won't break but you will end up with missing assets. Not a good look for the user!
|
||||
* @example
|
||||
* import { Assets } from 'pixi.js';
|
||||
*
|
||||
* // Load a URL:
|
||||
* const myImageTexture = await Assets.load('http://some.url.com/image.png'); // => returns a texture
|
||||
*
|
||||
* await Assets.unload('http://some.url.com/image.png')
|
||||
*
|
||||
* // myImageTexture will be destroyed now.
|
||||
*
|
||||
* // Unload multiple assets:
|
||||
* const textures = await Assets.unload(['thumper', 'chicko']);
|
||||
* @param urls - the urls to unload
|
||||
*/
|
||||
async unload(urls) {
|
||||
this._initialized || await this.init();
|
||||
const urlArray = convertToList.convertToList(urls).map((url) => typeof url != "string" ? url.src : url), resolveResults = this.resolver.resolve(urlArray);
|
||||
await this._unloadFromResolved(resolveResults);
|
||||
}
|
||||
/**
|
||||
* Bundles are a way to manage multiple assets at once.
|
||||
* this will unload all files in a bundle.
|
||||
*
|
||||
* once a bundle has been unloaded, you need to load it again to have access to the assets.
|
||||
* @example
|
||||
* import { Assets } from 'pixi.js';
|
||||
*
|
||||
* Assets.addBundle({
|
||||
* 'thumper': 'http://some.url.com/thumper.png',
|
||||
* })
|
||||
*
|
||||
* const assets = await Assets.loadBundle('thumper');
|
||||
*
|
||||
* // Now to unload...
|
||||
*
|
||||
* await Assets.unloadBundle('thumper');
|
||||
*
|
||||
* // All assets in the assets object will now have been destroyed and purged from the cache
|
||||
* @param bundleIds - the bundle id or ids to unload
|
||||
*/
|
||||
async unloadBundle(bundleIds) {
|
||||
this._initialized || await this.init(), bundleIds = convertToList.convertToList(bundleIds);
|
||||
const resolveResults = this.resolver.resolveBundle(bundleIds), promises = Object.keys(resolveResults).map((bundleId) => this._unloadFromResolved(resolveResults[bundleId]));
|
||||
await Promise.all(promises);
|
||||
}
|
||||
async _unloadFromResolved(resolveResult) {
|
||||
const resolveArray = Object.values(resolveResult);
|
||||
resolveArray.forEach((resolveResult2) => {
|
||||
Cache.Cache.remove(resolveResult2.src);
|
||||
}), await this.loader.unload(resolveArray);
|
||||
}
|
||||
/**
|
||||
* Detects the supported formats for the browser, and returns an array of supported formats, respecting
|
||||
* the users preferred formats order.
|
||||
* @param options - the options to use when detecting formats
|
||||
* @param options.preferredFormats - the preferred formats to use
|
||||
* @param options.skipDetections - if we should skip the detections altogether
|
||||
* @param options.detections - the detections to use
|
||||
* @returns - the detected formats
|
||||
*/
|
||||
async _detectFormats(options) {
|
||||
let formats = [];
|
||||
options.preferredFormats && (formats = Array.isArray(options.preferredFormats) ? options.preferredFormats : [options.preferredFormats]);
|
||||
for (const detection of options.detections)
|
||||
options.skipDetections || await detection.test() ? formats = await detection.add(formats) : options.skipDetections || (formats = await detection.remove(formats));
|
||||
return formats = formats.filter((format, index) => formats.indexOf(format) === index), formats;
|
||||
}
|
||||
/** All the detection parsers currently added to the Assets class. */
|
||||
get detections() {
|
||||
return this._detections;
|
||||
}
|
||||
/**
|
||||
* @deprecated since 7.2.0
|
||||
* @see {@link Assets.setPreferences}
|
||||
*/
|
||||
get preferWorkers() {
|
||||
return loadTextures.loadTextures.config.preferWorkers;
|
||||
}
|
||||
set preferWorkers(value) {
|
||||
core.utils.deprecation("7.2.0", "Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."), this.setPreferences({ preferWorkers: value });
|
||||
}
|
||||
/**
|
||||
* General setter for preferences. This is a helper function to set preferences on all parsers.
|
||||
* @param preferences - the preferences to set
|
||||
*/
|
||||
setPreferences(preferences) {
|
||||
this.loader.parsers.forEach((parser) => {
|
||||
parser.config && Object.keys(parser.config).filter((key) => key in preferences).forEach((key) => {
|
||||
parser.config[key] = preferences[key];
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
const Assets = new AssetsClass();
|
||||
core.extensions.handleByList(core.ExtensionType.LoadParser, Assets.loader.parsers).handleByList(core.ExtensionType.ResolveParser, Assets.resolver.parsers).handleByList(core.ExtensionType.CacheParser, Assets.cache.parsers).handleByList(core.ExtensionType.DetectionParser, Assets.detections);
|
||||
exports.Assets = Assets;
|
||||
exports.AssetsClass = AssetsClass;
|
||||
//# sourceMappingURL=Assets.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/Assets.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/Assets.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
335
resources/app/node_modules/@pixi/assets/lib/Assets.mjs
generated
vendored
Normal file
335
resources/app/node_modules/@pixi/assets/lib/Assets.mjs
generated
vendored
Normal file
@@ -0,0 +1,335 @@
|
||||
import { utils, extensions, ExtensionType } from "@pixi/core";
|
||||
import { BackgroundLoader } from "./BackgroundLoader.mjs";
|
||||
import { Cache } from "./cache/Cache.mjs";
|
||||
import { Loader } from "./loader/Loader.mjs";
|
||||
import "./loader/parsers/index.mjs";
|
||||
import { Resolver } from "./resolver/Resolver.mjs";
|
||||
import { convertToList } from "./utils/convertToList.mjs";
|
||||
import { isSingleItem } from "./utils/isSingleItem.mjs";
|
||||
import { loadTextures } from "./loader/parsers/textures/loadTextures.mjs";
|
||||
class AssetsClass {
|
||||
constructor() {
|
||||
this._detections = [], this._initialized = !1, this.resolver = new Resolver(), this.loader = new Loader(), this.cache = Cache, this._backgroundLoader = new BackgroundLoader(this.loader), this._backgroundLoader.active = !0, this.reset();
|
||||
}
|
||||
/**
|
||||
* Best practice is to call this function before any loading commences
|
||||
* Initiating is the best time to add any customization to the way things are loaded.
|
||||
*
|
||||
* you do not need to call this for the Asset class to work, only if you want to set any initial properties
|
||||
* @param options - options to initialize the Asset manager with
|
||||
*/
|
||||
async init(options = {}) {
|
||||
if (this._initialized) {
|
||||
console.warn("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");
|
||||
return;
|
||||
}
|
||||
if (this._initialized = !0, options.defaultSearchParams && this.resolver.setDefaultSearchParams(options.defaultSearchParams), options.basePath && (this.resolver.basePath = options.basePath), options.bundleIdentifier && this.resolver.setBundleIdentifier(options.bundleIdentifier), options.manifest) {
|
||||
let manifest = options.manifest;
|
||||
typeof manifest == "string" && (manifest = await this.load(manifest)), this.resolver.addManifest(manifest);
|
||||
}
|
||||
const resolutionPref = options.texturePreference?.resolution ?? 1, resolution = typeof resolutionPref == "number" ? [resolutionPref] : resolutionPref, formats = await this._detectFormats({
|
||||
preferredFormats: options.texturePreference?.format,
|
||||
skipDetections: options.skipDetections,
|
||||
detections: this._detections
|
||||
});
|
||||
this.resolver.prefer({
|
||||
params: {
|
||||
format: formats,
|
||||
resolution
|
||||
}
|
||||
}), options.preferences && this.setPreferences(options.preferences);
|
||||
}
|
||||
add(aliases, srcs, data, format, loadParser) {
|
||||
this.resolver.add(aliases, srcs, data, format, loadParser);
|
||||
}
|
||||
async load(urls, onProgress) {
|
||||
this._initialized || await this.init();
|
||||
const singleAsset = isSingleItem(urls), urlArray = convertToList(urls).map((url) => {
|
||||
if (typeof url != "string") {
|
||||
const aliases = this.resolver.getAlias(url);
|
||||
return aliases.some((alias) => !this.resolver.hasKey(alias)) && this.add(url), Array.isArray(aliases) ? aliases[0] : aliases;
|
||||
}
|
||||
return this.resolver.hasKey(url) || this.add({ alias: url, src: url }), url;
|
||||
}), resolveResults = this.resolver.resolve(urlArray), out = await this._mapLoadToResolve(resolveResults, onProgress);
|
||||
return singleAsset ? out[urlArray[0]] : out;
|
||||
}
|
||||
/**
|
||||
* This adds a bundle of assets in one go so that you can load them as a group.
|
||||
* For example you could add a bundle for each screen in you pixi app
|
||||
* @example
|
||||
* import { Assets } from 'pixi.js';
|
||||
*
|
||||
* Assets.addBundle('animals', {
|
||||
* bunny: 'bunny.png',
|
||||
* chicken: 'chicken.png',
|
||||
* thumper: 'thumper.png',
|
||||
* });
|
||||
*
|
||||
* const assets = await Assets.loadBundle('animals');
|
||||
* @param bundleId - the id of the bundle to add
|
||||
* @param assets - a record of the asset or assets that will be chosen from when loading via the specified key
|
||||
*/
|
||||
addBundle(bundleId, assets) {
|
||||
this.resolver.addBundle(bundleId, assets);
|
||||
}
|
||||
/**
|
||||
* Bundles are a way to load multiple assets at once.
|
||||
* If a manifest has been provided to the init function then you can load a bundle, or bundles.
|
||||
* you can also add bundles via `addBundle`
|
||||
* @example
|
||||
* import { Assets } from 'pixi.js';
|
||||
*
|
||||
* // Manifest Example
|
||||
* const manifest = {
|
||||
* bundles: [
|
||||
* {
|
||||
* name: 'load-screen',
|
||||
* assets: [
|
||||
* {
|
||||
* alias: 'background',
|
||||
* src: 'sunset.png',
|
||||
* },
|
||||
* {
|
||||
* alias: 'bar',
|
||||
* src: 'load-bar.{png,webp}',
|
||||
* },
|
||||
* ],
|
||||
* },
|
||||
* {
|
||||
* name: 'game-screen',
|
||||
* assets: [
|
||||
* {
|
||||
* alias: 'character',
|
||||
* src: 'robot.png',
|
||||
* },
|
||||
* {
|
||||
* alias: 'enemy',
|
||||
* src: 'bad-guy.png',
|
||||
* },
|
||||
* ],
|
||||
* },
|
||||
* ]
|
||||
* };
|
||||
*
|
||||
* await Assets.init({ manifest });
|
||||
*
|
||||
* // Load a bundle...
|
||||
* loadScreenAssets = await Assets.loadBundle('load-screen');
|
||||
* // Load another bundle...
|
||||
* gameScreenAssets = await Assets.loadBundle('game-screen');
|
||||
* @param bundleIds - the bundle id or ids to load
|
||||
* @param onProgress - Optional function that is called when progress on asset loading is made.
|
||||
* The function is passed a single parameter, `progress`, which represents the percentage (0.0 - 1.0)
|
||||
* of the assets loaded. Do not use this function to detect when assets are complete and available,
|
||||
* instead use the Promise returned by this function.
|
||||
* @returns all the bundles assets or a hash of assets for each bundle specified
|
||||
*/
|
||||
async loadBundle(bundleIds, onProgress) {
|
||||
this._initialized || await this.init();
|
||||
let singleAsset = !1;
|
||||
typeof bundleIds == "string" && (singleAsset = !0, bundleIds = [bundleIds]);
|
||||
const resolveResults = this.resolver.resolveBundle(bundleIds), out = {}, keys = Object.keys(resolveResults);
|
||||
let count = 0, total = 0;
|
||||
const _onProgress = () => {
|
||||
onProgress?.(++count / total);
|
||||
}, promises = keys.map((bundleId) => {
|
||||
const resolveResult = resolveResults[bundleId];
|
||||
return total += Object.keys(resolveResult).length, this._mapLoadToResolve(resolveResult, _onProgress).then((resolveResult2) => {
|
||||
out[bundleId] = resolveResult2;
|
||||
});
|
||||
});
|
||||
return await Promise.all(promises), singleAsset ? out[bundleIds[0]] : out;
|
||||
}
|
||||
/**
|
||||
* Initiate a background load of some assets. It will passively begin to load these assets in the background.
|
||||
* So when you actually come to loading them you will get a promise that resolves to the loaded assets immediately
|
||||
*
|
||||
* An example of this might be that you would background load game assets after your inital load.
|
||||
* then when you got to actually load your game screen assets when a player goes to the game - the loading
|
||||
* would already have stared or may even be complete, saving you having to show an interim load bar.
|
||||
* @example
|
||||
* import { Assets } from 'pixi.js';
|
||||
*
|
||||
* Assets.backgroundLoad('bunny.png');
|
||||
*
|
||||
* // later on in your app...
|
||||
* await Assets.loadBundle('bunny.png'); // Will resolve quicker as loading may have completed!
|
||||
* @param urls - the url / urls you want to background load
|
||||
*/
|
||||
async backgroundLoad(urls) {
|
||||
this._initialized || await this.init(), typeof urls == "string" && (urls = [urls]);
|
||||
const resolveResults = this.resolver.resolve(urls);
|
||||
this._backgroundLoader.add(Object.values(resolveResults));
|
||||
}
|
||||
/**
|
||||
* Initiate a background of a bundle, works exactly like backgroundLoad but for bundles.
|
||||
* this can only be used if the loader has been initiated with a manifest
|
||||
* @example
|
||||
* import { Assets } from 'pixi.js';
|
||||
*
|
||||
* await Assets.init({
|
||||
* manifest: {
|
||||
* bundles: [
|
||||
* {
|
||||
* name: 'load-screen',
|
||||
* assets: [...],
|
||||
* },
|
||||
* ...
|
||||
* ],
|
||||
* },
|
||||
* });
|
||||
*
|
||||
* Assets.backgroundLoadBundle('load-screen');
|
||||
*
|
||||
* // Later on in your app...
|
||||
* await Assets.loadBundle('load-screen'); // Will resolve quicker as loading may have completed!
|
||||
* @param bundleIds - the bundleId / bundleIds you want to background load
|
||||
*/
|
||||
async backgroundLoadBundle(bundleIds) {
|
||||
this._initialized || await this.init(), typeof bundleIds == "string" && (bundleIds = [bundleIds]);
|
||||
const resolveResults = this.resolver.resolveBundle(bundleIds);
|
||||
Object.values(resolveResults).forEach((resolveResult) => {
|
||||
this._backgroundLoader.add(Object.values(resolveResult));
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Only intended for development purposes.
|
||||
* This will wipe the resolver and caches.
|
||||
* You will need to reinitialize the Asset
|
||||
*/
|
||||
reset() {
|
||||
this.resolver.reset(), this.loader.reset(), this.cache.reset(), this._initialized = !1;
|
||||
}
|
||||
get(keys) {
|
||||
if (typeof keys == "string")
|
||||
return Cache.get(keys);
|
||||
const assets = {};
|
||||
for (let i = 0; i < keys.length; i++)
|
||||
assets[i] = Cache.get(keys[i]);
|
||||
return assets;
|
||||
}
|
||||
/**
|
||||
* helper function to map resolved assets back to loaded assets
|
||||
* @param resolveResults - the resolve results from the resolver
|
||||
* @param onProgress - the progress callback
|
||||
*/
|
||||
async _mapLoadToResolve(resolveResults, onProgress) {
|
||||
const resolveArray = Object.values(resolveResults), resolveKeys = Object.keys(resolveResults);
|
||||
this._backgroundLoader.active = !1;
|
||||
const loadedAssets = await this.loader.load(resolveArray, onProgress);
|
||||
this._backgroundLoader.active = !0;
|
||||
const out = {};
|
||||
return resolveArray.forEach((resolveResult, i) => {
|
||||
const asset = loadedAssets[resolveResult.src], keys = [resolveResult.src];
|
||||
resolveResult.alias && keys.push(...resolveResult.alias), out[resolveKeys[i]] = asset, Cache.set(keys, asset);
|
||||
}), out;
|
||||
}
|
||||
/**
|
||||
* Unload an asset or assets. As the Assets class is responsible for creating the assets via the `load` function
|
||||
* this will make sure to destroy any assets and release them from memory.
|
||||
* Once unloaded, you will need to load the asset again.
|
||||
*
|
||||
* Use this to help manage assets if you find that you have a large app and you want to free up memory.
|
||||
*
|
||||
* - it's up to you as the developer to make sure that textures are not actively being used when you unload them,
|
||||
* Pixi won't break but you will end up with missing assets. Not a good look for the user!
|
||||
* @example
|
||||
* import { Assets } from 'pixi.js';
|
||||
*
|
||||
* // Load a URL:
|
||||
* const myImageTexture = await Assets.load('http://some.url.com/image.png'); // => returns a texture
|
||||
*
|
||||
* await Assets.unload('http://some.url.com/image.png')
|
||||
*
|
||||
* // myImageTexture will be destroyed now.
|
||||
*
|
||||
* // Unload multiple assets:
|
||||
* const textures = await Assets.unload(['thumper', 'chicko']);
|
||||
* @param urls - the urls to unload
|
||||
*/
|
||||
async unload(urls) {
|
||||
this._initialized || await this.init();
|
||||
const urlArray = convertToList(urls).map((url) => typeof url != "string" ? url.src : url), resolveResults = this.resolver.resolve(urlArray);
|
||||
await this._unloadFromResolved(resolveResults);
|
||||
}
|
||||
/**
|
||||
* Bundles are a way to manage multiple assets at once.
|
||||
* this will unload all files in a bundle.
|
||||
*
|
||||
* once a bundle has been unloaded, you need to load it again to have access to the assets.
|
||||
* @example
|
||||
* import { Assets } from 'pixi.js';
|
||||
*
|
||||
* Assets.addBundle({
|
||||
* 'thumper': 'http://some.url.com/thumper.png',
|
||||
* })
|
||||
*
|
||||
* const assets = await Assets.loadBundle('thumper');
|
||||
*
|
||||
* // Now to unload...
|
||||
*
|
||||
* await Assets.unloadBundle('thumper');
|
||||
*
|
||||
* // All assets in the assets object will now have been destroyed and purged from the cache
|
||||
* @param bundleIds - the bundle id or ids to unload
|
||||
*/
|
||||
async unloadBundle(bundleIds) {
|
||||
this._initialized || await this.init(), bundleIds = convertToList(bundleIds);
|
||||
const resolveResults = this.resolver.resolveBundle(bundleIds), promises = Object.keys(resolveResults).map((bundleId) => this._unloadFromResolved(resolveResults[bundleId]));
|
||||
await Promise.all(promises);
|
||||
}
|
||||
async _unloadFromResolved(resolveResult) {
|
||||
const resolveArray = Object.values(resolveResult);
|
||||
resolveArray.forEach((resolveResult2) => {
|
||||
Cache.remove(resolveResult2.src);
|
||||
}), await this.loader.unload(resolveArray);
|
||||
}
|
||||
/**
|
||||
* Detects the supported formats for the browser, and returns an array of supported formats, respecting
|
||||
* the users preferred formats order.
|
||||
* @param options - the options to use when detecting formats
|
||||
* @param options.preferredFormats - the preferred formats to use
|
||||
* @param options.skipDetections - if we should skip the detections altogether
|
||||
* @param options.detections - the detections to use
|
||||
* @returns - the detected formats
|
||||
*/
|
||||
async _detectFormats(options) {
|
||||
let formats = [];
|
||||
options.preferredFormats && (formats = Array.isArray(options.preferredFormats) ? options.preferredFormats : [options.preferredFormats]);
|
||||
for (const detection of options.detections)
|
||||
options.skipDetections || await detection.test() ? formats = await detection.add(formats) : options.skipDetections || (formats = await detection.remove(formats));
|
||||
return formats = formats.filter((format, index) => formats.indexOf(format) === index), formats;
|
||||
}
|
||||
/** All the detection parsers currently added to the Assets class. */
|
||||
get detections() {
|
||||
return this._detections;
|
||||
}
|
||||
/**
|
||||
* @deprecated since 7.2.0
|
||||
* @see {@link Assets.setPreferences}
|
||||
*/
|
||||
get preferWorkers() {
|
||||
return loadTextures.config.preferWorkers;
|
||||
}
|
||||
set preferWorkers(value) {
|
||||
utils.deprecation("7.2.0", "Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."), this.setPreferences({ preferWorkers: value });
|
||||
}
|
||||
/**
|
||||
* General setter for preferences. This is a helper function to set preferences on all parsers.
|
||||
* @param preferences - the preferences to set
|
||||
*/
|
||||
setPreferences(preferences) {
|
||||
this.loader.parsers.forEach((parser) => {
|
||||
parser.config && Object.keys(parser.config).filter((key) => key in preferences).forEach((key) => {
|
||||
parser.config[key] = preferences[key];
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
const Assets = new AssetsClass();
|
||||
extensions.handleByList(ExtensionType.LoadParser, Assets.loader.parsers).handleByList(ExtensionType.ResolveParser, Assets.resolver.parsers).handleByList(ExtensionType.CacheParser, Assets.cache.parsers).handleByList(ExtensionType.DetectionParser, Assets.detections);
|
||||
export {
|
||||
Assets,
|
||||
AssetsClass
|
||||
};
|
||||
//# sourceMappingURL=Assets.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/Assets.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/Assets.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
45
resources/app/node_modules/@pixi/assets/lib/BackgroundLoader.js
generated
vendored
Normal file
45
resources/app/node_modules/@pixi/assets/lib/BackgroundLoader.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
class BackgroundLoader {
|
||||
/**
|
||||
* @param loader
|
||||
* @param verbose - should the loader log to the console
|
||||
*/
|
||||
constructor(loader, verbose = !1) {
|
||||
this._loader = loader, this._assetList = [], this._isLoading = !1, this._maxConcurrent = 1, this.verbose = verbose;
|
||||
}
|
||||
/**
|
||||
* Adds an array of assets to load.
|
||||
* @param assetUrls - assets to load
|
||||
*/
|
||||
add(assetUrls) {
|
||||
assetUrls.forEach((a) => {
|
||||
this._assetList.push(a);
|
||||
}), this.verbose && console.log("[BackgroundLoader] assets: ", this._assetList), this._isActive && !this._isLoading && this._next();
|
||||
}
|
||||
/**
|
||||
* Loads the next set of assets. Will try to load as many assets as it can at the same time.
|
||||
*
|
||||
* The max assets it will try to load at one time will be 4.
|
||||
*/
|
||||
async _next() {
|
||||
if (this._assetList.length && this._isActive) {
|
||||
this._isLoading = !0;
|
||||
const toLoad = [], toLoadAmount = Math.min(this._assetList.length, this._maxConcurrent);
|
||||
for (let i = 0; i < toLoadAmount; i++)
|
||||
toLoad.push(this._assetList.pop());
|
||||
await this._loader.load(toLoad), this._isLoading = !1, this._next();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Activate/Deactivate the loading. If set to true then it will immediately continue to load the next asset.
|
||||
* @returns whether the class is active
|
||||
*/
|
||||
get active() {
|
||||
return this._isActive;
|
||||
}
|
||||
set active(value) {
|
||||
this._isActive !== value && (this._isActive = value, value && !this._isLoading && this._next());
|
||||
}
|
||||
}
|
||||
exports.BackgroundLoader = BackgroundLoader;
|
||||
//# sourceMappingURL=BackgroundLoader.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/BackgroundLoader.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/BackgroundLoader.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BackgroundLoader.js","sources":["../src/BackgroundLoader.ts"],"sourcesContent":["import type { Loader } from './loader/Loader';\nimport type { ResolvedAsset } from './types';\n\n/**\n * Quietly Loads assets in the background.\n * @memberof PIXI\n */\nexport class BackgroundLoader\n{\n /** Whether or not the loader should continue loading. */\n private _isActive: boolean;\n\n /** Assets to load. */\n private readonly _assetList: ResolvedAsset[];\n\n /** Whether or not the loader is loading. */\n private _isLoading: boolean;\n\n /** Number of assets to load at a time. */\n private readonly _maxConcurrent: number;\n\n /** Should the loader log to the console. */\n public verbose: boolean;\n private readonly _loader: Loader;\n\n /**\n * @param loader\n * @param verbose - should the loader log to the console\n */\n constructor(loader: Loader, verbose = false)\n {\n this._loader = loader;\n this._assetList = [];\n this._isLoading = false;\n this._maxConcurrent = 1;\n this.verbose = verbose;\n }\n\n /**\n * Adds an array of assets to load.\n * @param assetUrls - assets to load\n */\n public add(assetUrls: ResolvedAsset[]): void\n {\n assetUrls.forEach((a) =>\n {\n this._assetList.push(a);\n });\n\n if (this.verbose)\n {\n // eslint-disable-next-line no-console\n console.log('[BackgroundLoader] assets: ', this._assetList);\n }\n\n if (this._isActive && !this._isLoading)\n {\n this._next();\n }\n }\n\n /**\n * Loads the next set of assets. Will try to load as many assets as it can at the same time.\n *\n * The max assets it will try to load at one time will be 4.\n */\n private async _next(): Promise<void>\n {\n if (this._assetList.length && this._isActive)\n {\n this._isLoading = true;\n\n const toLoad = [];\n\n const toLoadAmount = Math.min(this._assetList.length, this._maxConcurrent);\n\n for (let i = 0; i < toLoadAmount; i++)\n {\n toLoad.push(this._assetList.pop());\n }\n\n await this._loader.load(toLoad);\n\n this._isLoading = false;\n\n this._next();\n }\n }\n\n /**\n * Activate/Deactivate the loading. If set to true then it will immediately continue to load the next asset.\n * @returns whether the class is active\n */\n get active(): boolean\n {\n return this._isActive;\n }\n\n set active(value: boolean)\n {\n if (this._isActive === value) return;\n\n this._isActive = value;\n\n if (value && !this._isLoading)\n {\n this._next();\n }\n }\n}\n"],"names":[],"mappings":";AAOO,MAAM,iBACb;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBI,YAAY,QAAgB,UAAU,IACtC;AACI,SAAK,UAAU,QACf,KAAK,aAAa,CAAC,GACnB,KAAK,aAAa,IAClB,KAAK,iBAAiB,GACtB,KAAK,UAAU;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMO,IAAI,WACX;AACc,cAAA,QAAQ,CAAC,MACnB;AACS,WAAA,WAAW,KAAK,CAAC;AAAA,IAAA,CACzB,GAEG,KAAK,WAGL,QAAQ,IAAI,+BAA+B,KAAK,UAAU,GAG1D,KAAK,aAAa,CAAC,KAAK,cAExB,KAAK;EAEb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAc,QACd;AACI,QAAI,KAAK,WAAW,UAAU,KAAK,WACnC;AACI,WAAK,aAAa;AAEZ,YAAA,SAAS,CAAA,GAET,eAAe,KAAK,IAAI,KAAK,WAAW,QAAQ,KAAK,cAAc;AAEhE,eAAA,IAAI,GAAG,IAAI,cAAc;AAE9B,eAAO,KAAK,KAAK,WAAW,IAAK,CAAA;AAG/B,YAAA,KAAK,QAAQ,KAAK,MAAM,GAE9B,KAAK,aAAa,IAElB,KAAK,MAAM;AAAA,IACf;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,SACJ;AACI,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAI,OAAO,OACX;AACQ,SAAK,cAAc,UAEvB,KAAK,YAAY,OAEb,SAAS,CAAC,KAAK,cAEf,KAAK,MAAM;AAAA,EAEnB;AACJ;;"}
|
||||
46
resources/app/node_modules/@pixi/assets/lib/BackgroundLoader.mjs
generated
vendored
Normal file
46
resources/app/node_modules/@pixi/assets/lib/BackgroundLoader.mjs
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
class BackgroundLoader {
|
||||
/**
|
||||
* @param loader
|
||||
* @param verbose - should the loader log to the console
|
||||
*/
|
||||
constructor(loader, verbose = !1) {
|
||||
this._loader = loader, this._assetList = [], this._isLoading = !1, this._maxConcurrent = 1, this.verbose = verbose;
|
||||
}
|
||||
/**
|
||||
* Adds an array of assets to load.
|
||||
* @param assetUrls - assets to load
|
||||
*/
|
||||
add(assetUrls) {
|
||||
assetUrls.forEach((a) => {
|
||||
this._assetList.push(a);
|
||||
}), this.verbose && console.log("[BackgroundLoader] assets: ", this._assetList), this._isActive && !this._isLoading && this._next();
|
||||
}
|
||||
/**
|
||||
* Loads the next set of assets. Will try to load as many assets as it can at the same time.
|
||||
*
|
||||
* The max assets it will try to load at one time will be 4.
|
||||
*/
|
||||
async _next() {
|
||||
if (this._assetList.length && this._isActive) {
|
||||
this._isLoading = !0;
|
||||
const toLoad = [], toLoadAmount = Math.min(this._assetList.length, this._maxConcurrent);
|
||||
for (let i = 0; i < toLoadAmount; i++)
|
||||
toLoad.push(this._assetList.pop());
|
||||
await this._loader.load(toLoad), this._isLoading = !1, this._next();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Activate/Deactivate the loading. If set to true then it will immediately continue to load the next asset.
|
||||
* @returns whether the class is active
|
||||
*/
|
||||
get active() {
|
||||
return this._isActive;
|
||||
}
|
||||
set active(value) {
|
||||
this._isActive !== value && (this._isActive = value, value && !this._isLoading && this._next());
|
||||
}
|
||||
}
|
||||
export {
|
||||
BackgroundLoader
|
||||
};
|
||||
//# sourceMappingURL=BackgroundLoader.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/BackgroundLoader.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/BackgroundLoader.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BackgroundLoader.mjs","sources":["../src/BackgroundLoader.ts"],"sourcesContent":["import type { Loader } from './loader/Loader';\nimport type { ResolvedAsset } from './types';\n\n/**\n * Quietly Loads assets in the background.\n * @memberof PIXI\n */\nexport class BackgroundLoader\n{\n /** Whether or not the loader should continue loading. */\n private _isActive: boolean;\n\n /** Assets to load. */\n private readonly _assetList: ResolvedAsset[];\n\n /** Whether or not the loader is loading. */\n private _isLoading: boolean;\n\n /** Number of assets to load at a time. */\n private readonly _maxConcurrent: number;\n\n /** Should the loader log to the console. */\n public verbose: boolean;\n private readonly _loader: Loader;\n\n /**\n * @param loader\n * @param verbose - should the loader log to the console\n */\n constructor(loader: Loader, verbose = false)\n {\n this._loader = loader;\n this._assetList = [];\n this._isLoading = false;\n this._maxConcurrent = 1;\n this.verbose = verbose;\n }\n\n /**\n * Adds an array of assets to load.\n * @param assetUrls - assets to load\n */\n public add(assetUrls: ResolvedAsset[]): void\n {\n assetUrls.forEach((a) =>\n {\n this._assetList.push(a);\n });\n\n if (this.verbose)\n {\n // eslint-disable-next-line no-console\n console.log('[BackgroundLoader] assets: ', this._assetList);\n }\n\n if (this._isActive && !this._isLoading)\n {\n this._next();\n }\n }\n\n /**\n * Loads the next set of assets. Will try to load as many assets as it can at the same time.\n *\n * The max assets it will try to load at one time will be 4.\n */\n private async _next(): Promise<void>\n {\n if (this._assetList.length && this._isActive)\n {\n this._isLoading = true;\n\n const toLoad = [];\n\n const toLoadAmount = Math.min(this._assetList.length, this._maxConcurrent);\n\n for (let i = 0; i < toLoadAmount; i++)\n {\n toLoad.push(this._assetList.pop());\n }\n\n await this._loader.load(toLoad);\n\n this._isLoading = false;\n\n this._next();\n }\n }\n\n /**\n * Activate/Deactivate the loading. If set to true then it will immediately continue to load the next asset.\n * @returns whether the class is active\n */\n get active(): boolean\n {\n return this._isActive;\n }\n\n set active(value: boolean)\n {\n if (this._isActive === value) return;\n\n this._isActive = value;\n\n if (value && !this._isLoading)\n {\n this._next();\n }\n }\n}\n"],"names":[],"mappings":"AAOO,MAAM,iBACb;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBI,YAAY,QAAgB,UAAU,IACtC;AACI,SAAK,UAAU,QACf,KAAK,aAAa,CAAC,GACnB,KAAK,aAAa,IAClB,KAAK,iBAAiB,GACtB,KAAK,UAAU;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMO,IAAI,WACX;AACc,cAAA,QAAQ,CAAC,MACnB;AACS,WAAA,WAAW,KAAK,CAAC;AAAA,IAAA,CACzB,GAEG,KAAK,WAGL,QAAQ,IAAI,+BAA+B,KAAK,UAAU,GAG1D,KAAK,aAAa,CAAC,KAAK,cAExB,KAAK;EAEb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAc,QACd;AACI,QAAI,KAAK,WAAW,UAAU,KAAK,WACnC;AACI,WAAK,aAAa;AAEZ,YAAA,SAAS,CAAA,GAET,eAAe,KAAK,IAAI,KAAK,WAAW,QAAQ,KAAK,cAAc;AAEhE,eAAA,IAAI,GAAG,IAAI,cAAc;AAE9B,eAAO,KAAK,KAAK,WAAW,IAAK,CAAA;AAG/B,YAAA,KAAK,QAAQ,KAAK,MAAM,GAE9B,KAAK,aAAa,IAElB,KAAK,MAAM;AAAA,IACf;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,SACJ;AACI,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAI,OAAO,OACX;AACQ,SAAK,cAAc,UAEvB,KAAK,YAAY,OAEb,SAAS,CAAC,KAAK,cAEf,KAAK,MAAM;AAAA,EAEnB;AACJ;"}
|
||||
31
resources/app/node_modules/@pixi/assets/lib/_virtual/checkImageBitmap.worker.js
generated
vendored
Normal file
31
resources/app/node_modules/@pixi/assets/lib/_virtual/checkImageBitmap.worker.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: !0 });
|
||||
const WORKER_CODE = `(function() {
|
||||
"use strict";
|
||||
const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";
|
||||
async function checkImageBitmap() {
|
||||
try {
|
||||
if (typeof createImageBitmap != "function")
|
||||
return !1;
|
||||
const imageBlob = await (await fetch(WHITE_PNG)).blob(), imageBitmap = await createImageBitmap(imageBlob);
|
||||
return imageBitmap.width === 1 && imageBitmap.height === 1;
|
||||
} catch {
|
||||
return !1;
|
||||
}
|
||||
}
|
||||
checkImageBitmap().then((result) => {
|
||||
self.postMessage(result);
|
||||
});
|
||||
})();
|
||||
`;
|
||||
let WORKER_URL = null;
|
||||
class WorkerInstance {
|
||||
constructor() {
|
||||
WORKER_URL || (WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: "application/javascript" }))), this.worker = new Worker(WORKER_URL);
|
||||
}
|
||||
}
|
||||
WorkerInstance.revokeObjectURL = function() {
|
||||
WORKER_URL && (URL.revokeObjectURL(WORKER_URL), WORKER_URL = null);
|
||||
};
|
||||
exports.default = WorkerInstance;
|
||||
//# sourceMappingURL=checkImageBitmap.worker.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/_virtual/checkImageBitmap.worker.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/_virtual/checkImageBitmap.worker.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"checkImageBitmap.worker.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
||||
31
resources/app/node_modules/@pixi/assets/lib/_virtual/checkImageBitmap.worker.mjs
generated
vendored
Normal file
31
resources/app/node_modules/@pixi/assets/lib/_virtual/checkImageBitmap.worker.mjs
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
const WORKER_CODE = `(function() {
|
||||
"use strict";
|
||||
const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";
|
||||
async function checkImageBitmap() {
|
||||
try {
|
||||
if (typeof createImageBitmap != "function")
|
||||
return !1;
|
||||
const imageBlob = await (await fetch(WHITE_PNG)).blob(), imageBitmap = await createImageBitmap(imageBlob);
|
||||
return imageBitmap.width === 1 && imageBitmap.height === 1;
|
||||
} catch {
|
||||
return !1;
|
||||
}
|
||||
}
|
||||
checkImageBitmap().then((result) => {
|
||||
self.postMessage(result);
|
||||
});
|
||||
})();
|
||||
`;
|
||||
let WORKER_URL = null;
|
||||
class WorkerInstance {
|
||||
constructor() {
|
||||
WORKER_URL || (WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: "application/javascript" }))), this.worker = new Worker(WORKER_URL);
|
||||
}
|
||||
}
|
||||
WorkerInstance.revokeObjectURL = function() {
|
||||
WORKER_URL && (URL.revokeObjectURL(WORKER_URL), WORKER_URL = null);
|
||||
};
|
||||
export {
|
||||
WorkerInstance as default
|
||||
};
|
||||
//# sourceMappingURL=checkImageBitmap.worker.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/_virtual/checkImageBitmap.worker.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/_virtual/checkImageBitmap.worker.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"checkImageBitmap.worker.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
||||
40
resources/app/node_modules/@pixi/assets/lib/_virtual/loadImageBitmap.worker.js
generated
vendored
Normal file
40
resources/app/node_modules/@pixi/assets/lib/_virtual/loadImageBitmap.worker.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: !0 });
|
||||
const WORKER_CODE = `(function() {
|
||||
"use strict";
|
||||
async function loadImageBitmap(url) {
|
||||
const response = await fetch(url);
|
||||
if (!response.ok)
|
||||
throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \${response.status} \${response.statusText}\`);
|
||||
const imageBlob = await response.blob();
|
||||
return await createImageBitmap(imageBlob);
|
||||
}
|
||||
self.onmessage = async (event) => {
|
||||
try {
|
||||
const imageBitmap = await loadImageBitmap(event.data.data[0]);
|
||||
self.postMessage({
|
||||
data: imageBitmap,
|
||||
uuid: event.data.uuid,
|
||||
id: event.data.id
|
||||
}, [imageBitmap]);
|
||||
} catch (e) {
|
||||
self.postMessage({
|
||||
error: e,
|
||||
uuid: event.data.uuid,
|
||||
id: event.data.id
|
||||
});
|
||||
}
|
||||
};
|
||||
})();
|
||||
`;
|
||||
let WORKER_URL = null;
|
||||
class WorkerInstance {
|
||||
constructor() {
|
||||
WORKER_URL || (WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: "application/javascript" }))), this.worker = new Worker(WORKER_URL);
|
||||
}
|
||||
}
|
||||
WorkerInstance.revokeObjectURL = function() {
|
||||
WORKER_URL && (URL.revokeObjectURL(WORKER_URL), WORKER_URL = null);
|
||||
};
|
||||
exports.default = WorkerInstance;
|
||||
//# sourceMappingURL=loadImageBitmap.worker.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/_virtual/loadImageBitmap.worker.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/_virtual/loadImageBitmap.worker.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"loadImageBitmap.worker.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
||||
40
resources/app/node_modules/@pixi/assets/lib/_virtual/loadImageBitmap.worker.mjs
generated
vendored
Normal file
40
resources/app/node_modules/@pixi/assets/lib/_virtual/loadImageBitmap.worker.mjs
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
const WORKER_CODE = `(function() {
|
||||
"use strict";
|
||||
async function loadImageBitmap(url) {
|
||||
const response = await fetch(url);
|
||||
if (!response.ok)
|
||||
throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \${response.status} \${response.statusText}\`);
|
||||
const imageBlob = await response.blob();
|
||||
return await createImageBitmap(imageBlob);
|
||||
}
|
||||
self.onmessage = async (event) => {
|
||||
try {
|
||||
const imageBitmap = await loadImageBitmap(event.data.data[0]);
|
||||
self.postMessage({
|
||||
data: imageBitmap,
|
||||
uuid: event.data.uuid,
|
||||
id: event.data.id
|
||||
}, [imageBitmap]);
|
||||
} catch (e) {
|
||||
self.postMessage({
|
||||
error: e,
|
||||
uuid: event.data.uuid,
|
||||
id: event.data.id
|
||||
});
|
||||
}
|
||||
};
|
||||
})();
|
||||
`;
|
||||
let WORKER_URL = null;
|
||||
class WorkerInstance {
|
||||
constructor() {
|
||||
WORKER_URL || (WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: "application/javascript" }))), this.worker = new Worker(WORKER_URL);
|
||||
}
|
||||
}
|
||||
WorkerInstance.revokeObjectURL = function() {
|
||||
WORKER_URL && (URL.revokeObjectURL(WORKER_URL), WORKER_URL = null);
|
||||
};
|
||||
export {
|
||||
WorkerInstance as default
|
||||
};
|
||||
//# sourceMappingURL=loadImageBitmap.worker.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/_virtual/loadImageBitmap.worker.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/_virtual/loadImageBitmap.worker.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"loadImageBitmap.worker.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
||||
86
resources/app/node_modules/@pixi/assets/lib/cache/Cache.js
generated
vendored
Normal file
86
resources/app/node_modules/@pixi/assets/lib/cache/Cache.js
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core");
|
||||
require("../utils/index.js");
|
||||
var convertToList = require("../utils/convertToList.js");
|
||||
class CacheClass {
|
||||
constructor() {
|
||||
this._parsers = [], this._cache = /* @__PURE__ */ new Map(), this._cacheMap = /* @__PURE__ */ new Map();
|
||||
}
|
||||
/** Clear all entries. */
|
||||
reset() {
|
||||
this._cacheMap.clear(), this._cache.clear();
|
||||
}
|
||||
/**
|
||||
* Check if the key exists
|
||||
* @param key - The key to check
|
||||
*/
|
||||
has(key) {
|
||||
return this._cache.has(key);
|
||||
}
|
||||
/**
|
||||
* Fetch entry by key
|
||||
* @param key - The key of the entry to get
|
||||
*/
|
||||
get(key) {
|
||||
const result = this._cache.get(key);
|
||||
return result || console.warn(`[Assets] Asset id ${key} was not found in the Cache`), result;
|
||||
}
|
||||
/**
|
||||
* Set a value by key or keys name
|
||||
* @param key - The key or keys to set
|
||||
* @param value - The value to store in the cache or from which cacheable assets will be derived.
|
||||
*/
|
||||
set(key, value) {
|
||||
const keys = convertToList.convertToList(key);
|
||||
let cacheableAssets;
|
||||
for (let i = 0; i < this.parsers.length; i++) {
|
||||
const parser = this.parsers[i];
|
||||
if (parser.test(value)) {
|
||||
cacheableAssets = parser.getCacheableAssets(keys, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
cacheableAssets || (cacheableAssets = {}, keys.forEach((key2) => {
|
||||
cacheableAssets[key2] = value;
|
||||
}));
|
||||
const cacheKeys = Object.keys(cacheableAssets), cachedAssets = {
|
||||
cacheKeys,
|
||||
keys
|
||||
};
|
||||
if (keys.forEach((key2) => {
|
||||
this._cacheMap.set(key2, cachedAssets);
|
||||
}), cacheKeys.forEach((key2) => {
|
||||
this._cache.has(key2) && this._cache.get(key2) !== value && console.warn("[Cache] already has key:", key2), this._cache.set(key2, cacheableAssets[key2]);
|
||||
}), value instanceof core.Texture) {
|
||||
const texture = value;
|
||||
keys.forEach((key2) => {
|
||||
texture.baseTexture !== core.Texture.EMPTY.baseTexture && core.BaseTexture.addToCache(texture.baseTexture, key2), core.Texture.addToCache(texture, key2);
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Remove entry by key
|
||||
*
|
||||
* This function will also remove any associated alias from the cache also.
|
||||
* @param key - The key of the entry to remove
|
||||
*/
|
||||
remove(key) {
|
||||
if (!this._cacheMap.has(key)) {
|
||||
console.warn(`[Assets] Asset id ${key} was not found in the Cache`);
|
||||
return;
|
||||
}
|
||||
const cacheMap = this._cacheMap.get(key);
|
||||
cacheMap.cacheKeys.forEach((key2) => {
|
||||
this._cache.delete(key2);
|
||||
}), cacheMap.keys.forEach((key2) => {
|
||||
this._cacheMap.delete(key2);
|
||||
});
|
||||
}
|
||||
/** All loader parsers registered */
|
||||
get parsers() {
|
||||
return this._parsers;
|
||||
}
|
||||
}
|
||||
const Cache = new CacheClass();
|
||||
exports.Cache = Cache;
|
||||
//# sourceMappingURL=Cache.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/cache/Cache.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/cache/Cache.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
87
resources/app/node_modules/@pixi/assets/lib/cache/Cache.mjs
generated
vendored
Normal file
87
resources/app/node_modules/@pixi/assets/lib/cache/Cache.mjs
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
import { Texture, BaseTexture } from "@pixi/core";
|
||||
import "../utils/index.mjs";
|
||||
import { convertToList } from "../utils/convertToList.mjs";
|
||||
class CacheClass {
|
||||
constructor() {
|
||||
this._parsers = [], this._cache = /* @__PURE__ */ new Map(), this._cacheMap = /* @__PURE__ */ new Map();
|
||||
}
|
||||
/** Clear all entries. */
|
||||
reset() {
|
||||
this._cacheMap.clear(), this._cache.clear();
|
||||
}
|
||||
/**
|
||||
* Check if the key exists
|
||||
* @param key - The key to check
|
||||
*/
|
||||
has(key) {
|
||||
return this._cache.has(key);
|
||||
}
|
||||
/**
|
||||
* Fetch entry by key
|
||||
* @param key - The key of the entry to get
|
||||
*/
|
||||
get(key) {
|
||||
const result = this._cache.get(key);
|
||||
return result || console.warn(`[Assets] Asset id ${key} was not found in the Cache`), result;
|
||||
}
|
||||
/**
|
||||
* Set a value by key or keys name
|
||||
* @param key - The key or keys to set
|
||||
* @param value - The value to store in the cache or from which cacheable assets will be derived.
|
||||
*/
|
||||
set(key, value) {
|
||||
const keys = convertToList(key);
|
||||
let cacheableAssets;
|
||||
for (let i = 0; i < this.parsers.length; i++) {
|
||||
const parser = this.parsers[i];
|
||||
if (parser.test(value)) {
|
||||
cacheableAssets = parser.getCacheableAssets(keys, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
cacheableAssets || (cacheableAssets = {}, keys.forEach((key2) => {
|
||||
cacheableAssets[key2] = value;
|
||||
}));
|
||||
const cacheKeys = Object.keys(cacheableAssets), cachedAssets = {
|
||||
cacheKeys,
|
||||
keys
|
||||
};
|
||||
if (keys.forEach((key2) => {
|
||||
this._cacheMap.set(key2, cachedAssets);
|
||||
}), cacheKeys.forEach((key2) => {
|
||||
this._cache.has(key2) && this._cache.get(key2) !== value && console.warn("[Cache] already has key:", key2), this._cache.set(key2, cacheableAssets[key2]);
|
||||
}), value instanceof Texture) {
|
||||
const texture = value;
|
||||
keys.forEach((key2) => {
|
||||
texture.baseTexture !== Texture.EMPTY.baseTexture && BaseTexture.addToCache(texture.baseTexture, key2), Texture.addToCache(texture, key2);
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Remove entry by key
|
||||
*
|
||||
* This function will also remove any associated alias from the cache also.
|
||||
* @param key - The key of the entry to remove
|
||||
*/
|
||||
remove(key) {
|
||||
if (!this._cacheMap.has(key)) {
|
||||
console.warn(`[Assets] Asset id ${key} was not found in the Cache`);
|
||||
return;
|
||||
}
|
||||
const cacheMap = this._cacheMap.get(key);
|
||||
cacheMap.cacheKeys.forEach((key2) => {
|
||||
this._cache.delete(key2);
|
||||
}), cacheMap.keys.forEach((key2) => {
|
||||
this._cacheMap.delete(key2);
|
||||
});
|
||||
}
|
||||
/** All loader parsers registered */
|
||||
get parsers() {
|
||||
return this._parsers;
|
||||
}
|
||||
}
|
||||
const Cache = new CacheClass();
|
||||
export {
|
||||
Cache
|
||||
};
|
||||
//# sourceMappingURL=Cache.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/cache/Cache.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/cache/Cache.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
resources/app/node_modules/@pixi/assets/lib/cache/CacheParser.js
generated
vendored
Normal file
2
resources/app/node_modules/@pixi/assets/lib/cache/CacheParser.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
//# sourceMappingURL=CacheParser.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/cache/CacheParser.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/cache/CacheParser.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CacheParser.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
||||
2
resources/app/node_modules/@pixi/assets/lib/cache/CacheParser.mjs
generated
vendored
Normal file
2
resources/app/node_modules/@pixi/assets/lib/cache/CacheParser.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
//# sourceMappingURL=CacheParser.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/cache/CacheParser.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/cache/CacheParser.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CacheParser.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
||||
6
resources/app/node_modules/@pixi/assets/lib/cache/index.js
generated
vendored
Normal file
6
resources/app/node_modules/@pixi/assets/lib/cache/index.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
var Cache = require("./Cache.js");
|
||||
require("./CacheParser.js");
|
||||
require("./parsers/index.js");
|
||||
exports.Cache = Cache.Cache;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/cache/index.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/cache/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
||||
7
resources/app/node_modules/@pixi/assets/lib/cache/index.mjs
generated
vendored
Normal file
7
resources/app/node_modules/@pixi/assets/lib/cache/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Cache } from "./Cache.mjs";
|
||||
import "./CacheParser.mjs";
|
||||
import "./parsers/index.mjs";
|
||||
export {
|
||||
Cache
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/cache/index.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/cache/index.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
||||
17
resources/app/node_modules/@pixi/assets/lib/cache/parsers/cacheTextureArray.js
generated
vendored
Normal file
17
resources/app/node_modules/@pixi/assets/lib/cache/parsers/cacheTextureArray.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core");
|
||||
const cacheTextureArray = {
|
||||
extension: core.ExtensionType.CacheParser,
|
||||
test: (asset) => Array.isArray(asset) && asset.every((t) => t instanceof core.Texture),
|
||||
getCacheableAssets: (keys, asset) => {
|
||||
const out = {};
|
||||
return keys.forEach((key) => {
|
||||
asset.forEach((item, i) => {
|
||||
out[key + (i === 0 ? "" : i + 1)] = item;
|
||||
});
|
||||
}), out;
|
||||
}
|
||||
};
|
||||
core.extensions.add(cacheTextureArray);
|
||||
exports.cacheTextureArray = cacheTextureArray;
|
||||
//# sourceMappingURL=cacheTextureArray.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/cache/parsers/cacheTextureArray.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/cache/parsers/cacheTextureArray.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"cacheTextureArray.js","sources":["../../../src/cache/parsers/cacheTextureArray.ts"],"sourcesContent":["import { extensions, ExtensionType, Texture } from '@pixi/core';\n\nimport type { CacheParser } from '../CacheParser';\n\nexport const cacheTextureArray: CacheParser<Texture[]> = {\n extension: ExtensionType.CacheParser,\n\n test: (asset: any[]) => Array.isArray(asset) && asset.every((t) => t instanceof Texture),\n\n getCacheableAssets: (keys: string[], asset: Texture[]) =>\n {\n const out: Record<string, Texture> = {};\n\n keys.forEach((key: string) =>\n {\n asset.forEach((item: Texture, i: number) =>\n {\n out[key + (i === 0 ? '' : i + 1)] = item;\n });\n });\n\n return out;\n }\n};\n\nextensions.add(cacheTextureArray);\n"],"names":["ExtensionType","Texture","extensions"],"mappings":";;AAIO,MAAM,oBAA4C;AAAA,EACrD,WAAWA,KAAc,cAAA;AAAA,EAEzB,MAAM,CAAC,UAAiB,MAAM,QAAQ,KAAK,KAAK,MAAM,MAAM,CAAC,MAAM,aAAaC,KAAAA,OAAO;AAAA,EAEvF,oBAAoB,CAAC,MAAgB,UACrC;AACI,UAAM,MAA+B,CAAA;AAEhC,WAAA,KAAA,QAAQ,CAAC,QACd;AACU,YAAA,QAAQ,CAAC,MAAe,MAC9B;AACI,YAAI,OAAO,MAAM,IAAI,KAAK,IAAI,EAAE,IAAI;AAAA,MAAA,CACvC;AAAA,IACJ,CAAA,GAEM;AAAA,EACX;AACJ;AAEAC,KAAAA,WAAW,IAAI,iBAAiB;;"}
|
||||
18
resources/app/node_modules/@pixi/assets/lib/cache/parsers/cacheTextureArray.mjs
generated
vendored
Normal file
18
resources/app/node_modules/@pixi/assets/lib/cache/parsers/cacheTextureArray.mjs
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import { ExtensionType, Texture, extensions } from "@pixi/core";
|
||||
const cacheTextureArray = {
|
||||
extension: ExtensionType.CacheParser,
|
||||
test: (asset) => Array.isArray(asset) && asset.every((t) => t instanceof Texture),
|
||||
getCacheableAssets: (keys, asset) => {
|
||||
const out = {};
|
||||
return keys.forEach((key) => {
|
||||
asset.forEach((item, i) => {
|
||||
out[key + (i === 0 ? "" : i + 1)] = item;
|
||||
});
|
||||
}), out;
|
||||
}
|
||||
};
|
||||
extensions.add(cacheTextureArray);
|
||||
export {
|
||||
cacheTextureArray
|
||||
};
|
||||
//# sourceMappingURL=cacheTextureArray.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/cache/parsers/cacheTextureArray.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/cache/parsers/cacheTextureArray.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"cacheTextureArray.mjs","sources":["../../../src/cache/parsers/cacheTextureArray.ts"],"sourcesContent":["import { extensions, ExtensionType, Texture } from '@pixi/core';\n\nimport type { CacheParser } from '../CacheParser';\n\nexport const cacheTextureArray: CacheParser<Texture[]> = {\n extension: ExtensionType.CacheParser,\n\n test: (asset: any[]) => Array.isArray(asset) && asset.every((t) => t instanceof Texture),\n\n getCacheableAssets: (keys: string[], asset: Texture[]) =>\n {\n const out: Record<string, Texture> = {};\n\n keys.forEach((key: string) =>\n {\n asset.forEach((item: Texture, i: number) =>\n {\n out[key + (i === 0 ? '' : i + 1)] = item;\n });\n });\n\n return out;\n }\n};\n\nextensions.add(cacheTextureArray);\n"],"names":[],"mappings":";AAIO,MAAM,oBAA4C;AAAA,EACrD,WAAW,cAAc;AAAA,EAEzB,MAAM,CAAC,UAAiB,MAAM,QAAQ,KAAK,KAAK,MAAM,MAAM,CAAC,MAAM,aAAa,OAAO;AAAA,EAEvF,oBAAoB,CAAC,MAAgB,UACrC;AACI,UAAM,MAA+B,CAAA;AAEhC,WAAA,KAAA,QAAQ,CAAC,QACd;AACU,YAAA,QAAQ,CAAC,MAAe,MAC9B;AACI,YAAI,OAAO,MAAM,IAAI,KAAK,IAAI,EAAE,IAAI;AAAA,MAAA,CACvC;AAAA,IACJ,CAAA,GAEM;AAAA,EACX;AACJ;AAEA,WAAW,IAAI,iBAAiB;"}
|
||||
4
resources/app/node_modules/@pixi/assets/lib/cache/parsers/index.js
generated
vendored
Normal file
4
resources/app/node_modules/@pixi/assets/lib/cache/parsers/index.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
var cacheTextureArray = require("./cacheTextureArray.js");
|
||||
exports.cacheTextureArray = cacheTextureArray.cacheTextureArray;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/cache/parsers/index.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/cache/parsers/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
||||
5
resources/app/node_modules/@pixi/assets/lib/cache/parsers/index.mjs
generated
vendored
Normal file
5
resources/app/node_modules/@pixi/assets/lib/cache/parsers/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { cacheTextureArray } from "./cacheTextureArray.mjs";
|
||||
export {
|
||||
cacheTextureArray
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/cache/parsers/index.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/cache/parsers/index.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
||||
3
resources/app/node_modules/@pixi/assets/lib/detections/index.js
generated
vendored
Normal file
3
resources/app/node_modules/@pixi/assets/lib/detections/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
require("./parsers/index.js");
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/index.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
||||
2
resources/app/node_modules/@pixi/assets/lib/detections/index.mjs
generated
vendored
Normal file
2
resources/app/node_modules/@pixi/assets/lib/detections/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import "./parsers/index.mjs";
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/index.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/index.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
||||
17
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectAvif.js
generated
vendored
Normal file
17
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectAvif.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core"), testImageFormat = require("../utils/testImageFormat.js");
|
||||
const detectAvif = {
|
||||
extension: {
|
||||
type: core.ExtensionType.DetectionParser,
|
||||
priority: 1
|
||||
},
|
||||
test: async () => testImageFormat.testImageFormat(
|
||||
// eslint-disable-next-line max-len
|
||||
"data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="
|
||||
),
|
||||
add: async (formats) => [...formats, "avif"],
|
||||
remove: async (formats) => formats.filter((f) => f !== "avif")
|
||||
};
|
||||
core.extensions.add(detectAvif);
|
||||
exports.detectAvif = detectAvif;
|
||||
//# sourceMappingURL=detectAvif.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectAvif.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectAvif.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"detectAvif.js","sources":["../../../src/detections/parsers/detectAvif.ts"],"sourcesContent":["import { extensions, ExtensionType } from '@pixi/core';\nimport { testImageFormat } from '../utils/testImageFormat';\n\nimport type { FormatDetectionParser } from '..';\n\nexport const detectAvif: FormatDetectionParser = {\n extension: {\n type: ExtensionType.DetectionParser,\n priority: 1,\n },\n test: async (): Promise<boolean> => testImageFormat(\n // eslint-disable-next-line max-len\n 'data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A='\n ),\n add: async (formats) => [...formats, 'avif'],\n remove: async (formats) => formats.filter((f) => f !== 'avif'),\n};\n\nextensions.add(detectAvif);\n"],"names":["ExtensionType","testImageFormat","extensions"],"mappings":";;AAKO,MAAM,aAAoC;AAAA,EAC7C,WAAW;AAAA,IACP,MAAMA,KAAc,cAAA;AAAA,IACpB,UAAU;AAAA,EACd;AAAA,EACA,MAAM,YAA8BC,gBAAA;AAAA;AAAA,IAEhC;AAAA,EACJ;AAAA,EACA,KAAK,OAAO,YAAY,CAAC,GAAG,SAAS,MAAM;AAAA,EAC3C,QAAQ,OAAO,YAAY,QAAQ,OAAO,CAAC,MAAM,MAAM,MAAM;AACjE;AAEAC,KAAAA,WAAW,IAAI,UAAU;;"}
|
||||
19
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectAvif.mjs
generated
vendored
Normal file
19
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectAvif.mjs
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { ExtensionType, extensions } from "@pixi/core";
|
||||
import { testImageFormat } from "../utils/testImageFormat.mjs";
|
||||
const detectAvif = {
|
||||
extension: {
|
||||
type: ExtensionType.DetectionParser,
|
||||
priority: 1
|
||||
},
|
||||
test: async () => testImageFormat(
|
||||
// eslint-disable-next-line max-len
|
||||
"data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="
|
||||
),
|
||||
add: async (formats) => [...formats, "avif"],
|
||||
remove: async (formats) => formats.filter((f) => f !== "avif")
|
||||
};
|
||||
extensions.add(detectAvif);
|
||||
export {
|
||||
detectAvif
|
||||
};
|
||||
//# sourceMappingURL=detectAvif.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectAvif.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectAvif.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"detectAvif.mjs","sources":["../../../src/detections/parsers/detectAvif.ts"],"sourcesContent":["import { extensions, ExtensionType } from '@pixi/core';\nimport { testImageFormat } from '../utils/testImageFormat';\n\nimport type { FormatDetectionParser } from '..';\n\nexport const detectAvif: FormatDetectionParser = {\n extension: {\n type: ExtensionType.DetectionParser,\n priority: 1,\n },\n test: async (): Promise<boolean> => testImageFormat(\n // eslint-disable-next-line max-len\n 'data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A='\n ),\n add: async (formats) => [...formats, 'avif'],\n remove: async (formats) => formats.filter((f) => f !== 'avif'),\n};\n\nextensions.add(detectAvif);\n"],"names":[],"mappings":";;AAKO,MAAM,aAAoC;AAAA,EAC7C,WAAW;AAAA,IACP,MAAM,cAAc;AAAA,IACpB,UAAU;AAAA,EACd;AAAA,EACA,MAAM,YAA8B;AAAA;AAAA,IAEhC;AAAA,EACJ;AAAA,EACA,KAAK,OAAO,YAAY,CAAC,GAAG,SAAS,MAAM;AAAA,EAC3C,QAAQ,OAAO,YAAY,QAAQ,OAAO,CAAC,MAAM,MAAM,MAAM;AACjE;AAEA,WAAW,IAAI,UAAU;"}
|
||||
14
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectDefaults.js
generated
vendored
Normal file
14
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectDefaults.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core");
|
||||
const imageFormats = ["png", "jpg", "jpeg"], detectDefaults = {
|
||||
extension: {
|
||||
type: core.ExtensionType.DetectionParser,
|
||||
priority: -1
|
||||
},
|
||||
test: () => Promise.resolve(!0),
|
||||
add: async (formats) => [...formats, ...imageFormats],
|
||||
remove: async (formats) => formats.filter((f) => !imageFormats.includes(f))
|
||||
};
|
||||
core.extensions.add(detectDefaults);
|
||||
exports.detectDefaults = detectDefaults;
|
||||
//# sourceMappingURL=detectDefaults.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectDefaults.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectDefaults.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"detectDefaults.js","sources":["../../../src/detections/parsers/detectDefaults.ts"],"sourcesContent":["import { extensions, ExtensionType } from '@pixi/core';\n\nimport type { FormatDetectionParser } from '..';\n\nconst imageFormats = ['png', 'jpg', 'jpeg'];\n\nexport const detectDefaults = {\n extension: {\n type: ExtensionType.DetectionParser,\n priority: -1,\n },\n test: (): Promise<boolean> => Promise.resolve(true),\n add: async (formats) => [...formats, ...imageFormats],\n remove: async (formats) => formats.filter((f) => !imageFormats.includes(f)),\n} as FormatDetectionParser;\n\nextensions.add(detectDefaults);\n"],"names":["ExtensionType","extensions"],"mappings":";;AAIA,MAAM,eAAe,CAAC,OAAO,OAAO,MAAM,GAE7B,iBAAiB;AAAA,EAC1B,WAAW;AAAA,IACP,MAAMA,KAAc,cAAA;AAAA,IACpB,UAAU;AAAA,EACd;AAAA,EACA,MAAM,MAAwB,QAAQ,QAAQ,EAAI;AAAA,EAClD,KAAK,OAAO,YAAY,CAAC,GAAG,SAAS,GAAG,YAAY;AAAA,EACpD,QAAQ,OAAO,YAAY,QAAQ,OAAO,CAAC,MAAM,CAAC,aAAa,SAAS,CAAC,CAAC;AAC9E;AAEAC,KAAAA,WAAW,IAAI,cAAc;;"}
|
||||
15
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectDefaults.mjs
generated
vendored
Normal file
15
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectDefaults.mjs
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { ExtensionType, extensions } from "@pixi/core";
|
||||
const imageFormats = ["png", "jpg", "jpeg"], detectDefaults = {
|
||||
extension: {
|
||||
type: ExtensionType.DetectionParser,
|
||||
priority: -1
|
||||
},
|
||||
test: () => Promise.resolve(!0),
|
||||
add: async (formats) => [...formats, ...imageFormats],
|
||||
remove: async (formats) => formats.filter((f) => !imageFormats.includes(f))
|
||||
};
|
||||
extensions.add(detectDefaults);
|
||||
export {
|
||||
detectDefaults
|
||||
};
|
||||
//# sourceMappingURL=detectDefaults.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectDefaults.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectDefaults.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"detectDefaults.mjs","sources":["../../../src/detections/parsers/detectDefaults.ts"],"sourcesContent":["import { extensions, ExtensionType } from '@pixi/core';\n\nimport type { FormatDetectionParser } from '..';\n\nconst imageFormats = ['png', 'jpg', 'jpeg'];\n\nexport const detectDefaults = {\n extension: {\n type: ExtensionType.DetectionParser,\n priority: -1,\n },\n test: (): Promise<boolean> => Promise.resolve(true),\n add: async (formats) => [...formats, ...imageFormats],\n remove: async (formats) => formats.filter((f) => !imageFormats.includes(f)),\n} as FormatDetectionParser;\n\nextensions.add(detectDefaults);\n"],"names":[],"mappings":";AAIA,MAAM,eAAe,CAAC,OAAO,OAAO,MAAM,GAE7B,iBAAiB;AAAA,EAC1B,WAAW;AAAA,IACP,MAAM,cAAc;AAAA,IACpB,UAAU;AAAA,EACd;AAAA,EACA,MAAM,MAAwB,QAAQ,QAAQ,EAAI;AAAA,EAClD,KAAK,OAAO,YAAY,CAAC,GAAG,SAAS,GAAG,YAAY;AAAA,EACpD,QAAQ,OAAO,YAAY,QAAQ,OAAO,CAAC,MAAM,CAAC,aAAa,SAAS,CAAC,CAAC;AAC9E;AAEA,WAAW,IAAI,cAAc;"}
|
||||
14
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectMp4.js
generated
vendored
Normal file
14
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectMp4.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core"), testVideoFormat = require("../utils/testVideoFormat.js");
|
||||
const detectMp4 = {
|
||||
extension: {
|
||||
type: core.ExtensionType.DetectionParser,
|
||||
priority: 0
|
||||
},
|
||||
test: async () => testVideoFormat.testVideoFormat("video/mp4"),
|
||||
add: async (formats) => [...formats, "mp4", "m4v"],
|
||||
remove: async (formats) => formats.filter((f) => f !== "mp4" && f !== "m4v")
|
||||
};
|
||||
core.extensions.add(detectMp4);
|
||||
exports.detectMp4 = detectMp4;
|
||||
//# sourceMappingURL=detectMp4.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectMp4.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectMp4.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"detectMp4.js","sources":["../../../src/detections/parsers/detectMp4.ts"],"sourcesContent":["import { extensions, ExtensionType } from '@pixi/core';\nimport { testVideoFormat } from '../utils/testVideoFormat';\n\nimport type { FormatDetectionParser } from '..';\n\nexport const detectMp4 = {\n extension: {\n type: ExtensionType.DetectionParser,\n priority: 0,\n },\n test: async (): Promise<boolean> => testVideoFormat('video/mp4'),\n add: async (formats) => [...formats, 'mp4', 'm4v'],\n remove: async (formats) => formats.filter((f) => f !== 'mp4' && f !== 'm4v'),\n} as FormatDetectionParser;\n\nextensions.add(detectMp4);\n"],"names":["ExtensionType","testVideoFormat","extensions"],"mappings":";;AAKO,MAAM,YAAY;AAAA,EACrB,WAAW;AAAA,IACP,MAAMA,KAAc,cAAA;AAAA,IACpB,UAAU;AAAA,EACd;AAAA,EACA,MAAM,YAA8BC,gBAAA,gBAAgB,WAAW;AAAA,EAC/D,KAAK,OAAO,YAAY,CAAC,GAAG,SAAS,OAAO,KAAK;AAAA,EACjD,QAAQ,OAAO,YAAY,QAAQ,OAAO,CAAC,MAAM,MAAM,SAAS,MAAM,KAAK;AAC/E;AAEAC,KAAAA,WAAW,IAAI,SAAS;;"}
|
||||
16
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectMp4.mjs
generated
vendored
Normal file
16
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectMp4.mjs
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { ExtensionType, extensions } from "@pixi/core";
|
||||
import { testVideoFormat } from "../utils/testVideoFormat.mjs";
|
||||
const detectMp4 = {
|
||||
extension: {
|
||||
type: ExtensionType.DetectionParser,
|
||||
priority: 0
|
||||
},
|
||||
test: async () => testVideoFormat("video/mp4"),
|
||||
add: async (formats) => [...formats, "mp4", "m4v"],
|
||||
remove: async (formats) => formats.filter((f) => f !== "mp4" && f !== "m4v")
|
||||
};
|
||||
extensions.add(detectMp4);
|
||||
export {
|
||||
detectMp4
|
||||
};
|
||||
//# sourceMappingURL=detectMp4.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectMp4.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectMp4.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"detectMp4.mjs","sources":["../../../src/detections/parsers/detectMp4.ts"],"sourcesContent":["import { extensions, ExtensionType } from '@pixi/core';\nimport { testVideoFormat } from '../utils/testVideoFormat';\n\nimport type { FormatDetectionParser } from '..';\n\nexport const detectMp4 = {\n extension: {\n type: ExtensionType.DetectionParser,\n priority: 0,\n },\n test: async (): Promise<boolean> => testVideoFormat('video/mp4'),\n add: async (formats) => [...formats, 'mp4', 'm4v'],\n remove: async (formats) => formats.filter((f) => f !== 'mp4' && f !== 'm4v'),\n} as FormatDetectionParser;\n\nextensions.add(detectMp4);\n"],"names":[],"mappings":";;AAKO,MAAM,YAAY;AAAA,EACrB,WAAW;AAAA,IACP,MAAM,cAAc;AAAA,IACpB,UAAU;AAAA,EACd;AAAA,EACA,MAAM,YAA8B,gBAAgB,WAAW;AAAA,EAC/D,KAAK,OAAO,YAAY,CAAC,GAAG,SAAS,OAAO,KAAK;AAAA,EACjD,QAAQ,OAAO,YAAY,QAAQ,OAAO,CAAC,MAAM,MAAM,SAAS,MAAM,KAAK;AAC/E;AAEA,WAAW,IAAI,SAAS;"}
|
||||
14
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectOgv.js
generated
vendored
Normal file
14
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectOgv.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core"), testVideoFormat = require("../utils/testVideoFormat.js");
|
||||
const detectOgv = {
|
||||
extension: {
|
||||
type: core.ExtensionType.DetectionParser,
|
||||
priority: 0
|
||||
},
|
||||
test: async () => testVideoFormat.testVideoFormat("video/ogg"),
|
||||
add: async (formats) => [...formats, "ogv"],
|
||||
remove: async (formats) => formats.filter((f) => f !== "ogv")
|
||||
};
|
||||
core.extensions.add(detectOgv);
|
||||
exports.detectOgv = detectOgv;
|
||||
//# sourceMappingURL=detectOgv.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectOgv.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectOgv.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"detectOgv.js","sources":["../../../src/detections/parsers/detectOgv.ts"],"sourcesContent":["import { extensions, ExtensionType } from '@pixi/core';\nimport { testVideoFormat } from '../utils/testVideoFormat';\n\nimport type { FormatDetectionParser } from '..';\n\nexport const detectOgv = {\n extension: {\n type: ExtensionType.DetectionParser,\n priority: 0,\n },\n test: async (): Promise<boolean> => testVideoFormat('video/ogg'),\n add: async (formats) => [...formats, 'ogv'],\n remove: async (formats) => formats.filter((f) => f !== 'ogv'),\n} as FormatDetectionParser;\n\nextensions.add(detectOgv);\n"],"names":["ExtensionType","testVideoFormat","extensions"],"mappings":";;AAKO,MAAM,YAAY;AAAA,EACrB,WAAW;AAAA,IACP,MAAMA,KAAc,cAAA;AAAA,IACpB,UAAU;AAAA,EACd;AAAA,EACA,MAAM,YAA8BC,gBAAA,gBAAgB,WAAW;AAAA,EAC/D,KAAK,OAAO,YAAY,CAAC,GAAG,SAAS,KAAK;AAAA,EAC1C,QAAQ,OAAO,YAAY,QAAQ,OAAO,CAAC,MAAM,MAAM,KAAK;AAChE;AAEAC,KAAAA,WAAW,IAAI,SAAS;;"}
|
||||
16
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectOgv.mjs
generated
vendored
Normal file
16
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectOgv.mjs
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { ExtensionType, extensions } from "@pixi/core";
|
||||
import { testVideoFormat } from "../utils/testVideoFormat.mjs";
|
||||
const detectOgv = {
|
||||
extension: {
|
||||
type: ExtensionType.DetectionParser,
|
||||
priority: 0
|
||||
},
|
||||
test: async () => testVideoFormat("video/ogg"),
|
||||
add: async (formats) => [...formats, "ogv"],
|
||||
remove: async (formats) => formats.filter((f) => f !== "ogv")
|
||||
};
|
||||
extensions.add(detectOgv);
|
||||
export {
|
||||
detectOgv
|
||||
};
|
||||
//# sourceMappingURL=detectOgv.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectOgv.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectOgv.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"detectOgv.mjs","sources":["../../../src/detections/parsers/detectOgv.ts"],"sourcesContent":["import { extensions, ExtensionType } from '@pixi/core';\nimport { testVideoFormat } from '../utils/testVideoFormat';\n\nimport type { FormatDetectionParser } from '..';\n\nexport const detectOgv = {\n extension: {\n type: ExtensionType.DetectionParser,\n priority: 0,\n },\n test: async (): Promise<boolean> => testVideoFormat('video/ogg'),\n add: async (formats) => [...formats, 'ogv'],\n remove: async (formats) => formats.filter((f) => f !== 'ogv'),\n} as FormatDetectionParser;\n\nextensions.add(detectOgv);\n"],"names":[],"mappings":";;AAKO,MAAM,YAAY;AAAA,EACrB,WAAW;AAAA,IACP,MAAM,cAAc;AAAA,IACpB,UAAU;AAAA,EACd;AAAA,EACA,MAAM,YAA8B,gBAAgB,WAAW;AAAA,EAC/D,KAAK,OAAO,YAAY,CAAC,GAAG,SAAS,KAAK;AAAA,EAC1C,QAAQ,OAAO,YAAY,QAAQ,OAAO,CAAC,MAAM,MAAM,KAAK;AAChE;AAEA,WAAW,IAAI,SAAS;"}
|
||||
14
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectWebm.js
generated
vendored
Normal file
14
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectWebm.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core"), testVideoFormat = require("../utils/testVideoFormat.js");
|
||||
const detectWebm = {
|
||||
extension: {
|
||||
type: core.ExtensionType.DetectionParser,
|
||||
priority: 0
|
||||
},
|
||||
test: async () => testVideoFormat.testVideoFormat("video/webm"),
|
||||
add: async (formats) => [...formats, "webm"],
|
||||
remove: async (formats) => formats.filter((f) => f !== "webm")
|
||||
};
|
||||
core.extensions.add(detectWebm);
|
||||
exports.detectWebm = detectWebm;
|
||||
//# sourceMappingURL=detectWebm.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectWebm.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectWebm.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"detectWebm.js","sources":["../../../src/detections/parsers/detectWebm.ts"],"sourcesContent":["import { extensions, ExtensionType } from '@pixi/core';\nimport { testVideoFormat } from '../utils/testVideoFormat';\n\nimport type { FormatDetectionParser } from '..';\n\nexport const detectWebm = {\n extension: {\n type: ExtensionType.DetectionParser,\n priority: 0,\n },\n test: async (): Promise<boolean> => testVideoFormat('video/webm'),\n add: async (formats) => [...formats, 'webm'],\n remove: async (formats) => formats.filter((f) => f !== 'webm'),\n} as FormatDetectionParser;\n\nextensions.add(detectWebm);\n"],"names":["ExtensionType","testVideoFormat","extensions"],"mappings":";;AAKO,MAAM,aAAa;AAAA,EACtB,WAAW;AAAA,IACP,MAAMA,KAAc,cAAA;AAAA,IACpB,UAAU;AAAA,EACd;AAAA,EACA,MAAM,YAA8BC,gBAAA,gBAAgB,YAAY;AAAA,EAChE,KAAK,OAAO,YAAY,CAAC,GAAG,SAAS,MAAM;AAAA,EAC3C,QAAQ,OAAO,YAAY,QAAQ,OAAO,CAAC,MAAM,MAAM,MAAM;AACjE;AAEAC,KAAAA,WAAW,IAAI,UAAU;;"}
|
||||
16
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectWebm.mjs
generated
vendored
Normal file
16
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectWebm.mjs
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { ExtensionType, extensions } from "@pixi/core";
|
||||
import { testVideoFormat } from "../utils/testVideoFormat.mjs";
|
||||
const detectWebm = {
|
||||
extension: {
|
||||
type: ExtensionType.DetectionParser,
|
||||
priority: 0
|
||||
},
|
||||
test: async () => testVideoFormat("video/webm"),
|
||||
add: async (formats) => [...formats, "webm"],
|
||||
remove: async (formats) => formats.filter((f) => f !== "webm")
|
||||
};
|
||||
extensions.add(detectWebm);
|
||||
export {
|
||||
detectWebm
|
||||
};
|
||||
//# sourceMappingURL=detectWebm.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectWebm.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectWebm.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"detectWebm.mjs","sources":["../../../src/detections/parsers/detectWebm.ts"],"sourcesContent":["import { extensions, ExtensionType } from '@pixi/core';\nimport { testVideoFormat } from '../utils/testVideoFormat';\n\nimport type { FormatDetectionParser } from '..';\n\nexport const detectWebm = {\n extension: {\n type: ExtensionType.DetectionParser,\n priority: 0,\n },\n test: async (): Promise<boolean> => testVideoFormat('video/webm'),\n add: async (formats) => [...formats, 'webm'],\n remove: async (formats) => formats.filter((f) => f !== 'webm'),\n} as FormatDetectionParser;\n\nextensions.add(detectWebm);\n"],"names":[],"mappings":";;AAKO,MAAM,aAAa;AAAA,EACtB,WAAW;AAAA,IACP,MAAM,cAAc;AAAA,IACpB,UAAU;AAAA,EACd;AAAA,EACA,MAAM,YAA8B,gBAAgB,YAAY;AAAA,EAChE,KAAK,OAAO,YAAY,CAAC,GAAG,SAAS,MAAM;AAAA,EAC3C,QAAQ,OAAO,YAAY,QAAQ,OAAO,CAAC,MAAM,MAAM,MAAM;AACjE;AAEA,WAAW,IAAI,UAAU;"}
|
||||
16
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectWebp.js
generated
vendored
Normal file
16
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectWebp.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core"), testImageFormat = require("../utils/testImageFormat.js");
|
||||
const detectWebp = {
|
||||
extension: {
|
||||
type: core.ExtensionType.DetectionParser,
|
||||
priority: 0
|
||||
},
|
||||
test: async () => testImageFormat.testImageFormat(
|
||||
"data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="
|
||||
),
|
||||
add: async (formats) => [...formats, "webp"],
|
||||
remove: async (formats) => formats.filter((f) => f !== "webp")
|
||||
};
|
||||
core.extensions.add(detectWebp);
|
||||
exports.detectWebp = detectWebp;
|
||||
//# sourceMappingURL=detectWebp.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectWebp.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectWebp.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"detectWebp.js","sources":["../../../src/detections/parsers/detectWebp.ts"],"sourcesContent":["import { extensions, ExtensionType } from '@pixi/core';\nimport { testImageFormat } from '../utils/testImageFormat';\n\nimport type { FormatDetectionParser } from '..';\n\nexport const detectWebp = {\n extension: {\n type: ExtensionType.DetectionParser,\n priority: 0,\n },\n test: async (): Promise<boolean> => testImageFormat(\n 'data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA='\n ),\n add: async (formats) => [...formats, 'webp'],\n remove: async (formats) => formats.filter((f) => f !== 'webp'),\n} as FormatDetectionParser;\n\nextensions.add(detectWebp);\n"],"names":["ExtensionType","testImageFormat","extensions"],"mappings":";;AAKO,MAAM,aAAa;AAAA,EACtB,WAAW;AAAA,IACP,MAAMA,KAAc,cAAA;AAAA,IACpB,UAAU;AAAA,EACd;AAAA,EACA,MAAM,YAA8BC,gBAAA;AAAA,IAChC;AAAA,EACJ;AAAA,EACA,KAAK,OAAO,YAAY,CAAC,GAAG,SAAS,MAAM;AAAA,EAC3C,QAAQ,OAAO,YAAY,QAAQ,OAAO,CAAC,MAAM,MAAM,MAAM;AACjE;AAEAC,KAAAA,WAAW,IAAI,UAAU;;"}
|
||||
18
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectWebp.mjs
generated
vendored
Normal file
18
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectWebp.mjs
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import { ExtensionType, extensions } from "@pixi/core";
|
||||
import { testImageFormat } from "../utils/testImageFormat.mjs";
|
||||
const detectWebp = {
|
||||
extension: {
|
||||
type: ExtensionType.DetectionParser,
|
||||
priority: 0
|
||||
},
|
||||
test: async () => testImageFormat(
|
||||
"data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="
|
||||
),
|
||||
add: async (formats) => [...formats, "webp"],
|
||||
remove: async (formats) => formats.filter((f) => f !== "webp")
|
||||
};
|
||||
extensions.add(detectWebp);
|
||||
export {
|
||||
detectWebp
|
||||
};
|
||||
//# sourceMappingURL=detectWebp.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectWebp.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/detectWebp.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"detectWebp.mjs","sources":["../../../src/detections/parsers/detectWebp.ts"],"sourcesContent":["import { extensions, ExtensionType } from '@pixi/core';\nimport { testImageFormat } from '../utils/testImageFormat';\n\nimport type { FormatDetectionParser } from '..';\n\nexport const detectWebp = {\n extension: {\n type: ExtensionType.DetectionParser,\n priority: 0,\n },\n test: async (): Promise<boolean> => testImageFormat(\n 'data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA='\n ),\n add: async (formats) => [...formats, 'webp'],\n remove: async (formats) => formats.filter((f) => f !== 'webp'),\n} as FormatDetectionParser;\n\nextensions.add(detectWebp);\n"],"names":[],"mappings":";;AAKO,MAAM,aAAa;AAAA,EACtB,WAAW;AAAA,IACP,MAAM,cAAc;AAAA,IACpB,UAAU;AAAA,EACd;AAAA,EACA,MAAM,YAA8B;AAAA,IAChC;AAAA,EACJ;AAAA,EACA,KAAK,OAAO,YAAY,CAAC,GAAG,SAAS,MAAM;AAAA,EAC3C,QAAQ,OAAO,YAAY,QAAQ,OAAO,CAAC,MAAM,MAAM,MAAM;AACjE;AAEA,WAAW,IAAI,UAAU;"}
|
||||
9
resources/app/node_modules/@pixi/assets/lib/detections/parsers/index.js
generated
vendored
Normal file
9
resources/app/node_modules/@pixi/assets/lib/detections/parsers/index.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
var detectAvif = require("./detectAvif.js"), detectWebp = require("./detectWebp.js"), detectDefaults = require("./detectDefaults.js"), detectWebm = require("./detectWebm.js"), detectMp4 = require("./detectMp4.js"), detectOgv = require("./detectOgv.js");
|
||||
exports.detectAvif = detectAvif.detectAvif;
|
||||
exports.detectWebp = detectWebp.detectWebp;
|
||||
exports.detectDefaults = detectDefaults.detectDefaults;
|
||||
exports.detectWebm = detectWebm.detectWebm;
|
||||
exports.detectMp4 = detectMp4.detectMp4;
|
||||
exports.detectOgv = detectOgv.detectOgv;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/index.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
||||
15
resources/app/node_modules/@pixi/assets/lib/detections/parsers/index.mjs
generated
vendored
Normal file
15
resources/app/node_modules/@pixi/assets/lib/detections/parsers/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { detectAvif } from "./detectAvif.mjs";
|
||||
import { detectWebp } from "./detectWebp.mjs";
|
||||
import { detectDefaults } from "./detectDefaults.mjs";
|
||||
import { detectWebm } from "./detectWebm.mjs";
|
||||
import { detectMp4 } from "./detectMp4.mjs";
|
||||
import { detectOgv } from "./detectOgv.mjs";
|
||||
export {
|
||||
detectAvif,
|
||||
detectDefaults,
|
||||
detectMp4,
|
||||
detectOgv,
|
||||
detectWebm,
|
||||
detectWebp
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/index.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/parsers/index.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
||||
24
resources/app/node_modules/@pixi/assets/lib/detections/utils/testImageFormat.js
generated
vendored
Normal file
24
resources/app/node_modules/@pixi/assets/lib/detections/utils/testImageFormat.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
async function testImageFormat(imageData) {
|
||||
if ("Image" in globalThis)
|
||||
return new Promise((resolve) => {
|
||||
const image = new Image();
|
||||
image.onload = () => {
|
||||
resolve(!0);
|
||||
}, image.onerror = () => {
|
||||
resolve(!1);
|
||||
}, image.src = imageData;
|
||||
});
|
||||
if ("createImageBitmap" in globalThis && "fetch" in globalThis) {
|
||||
try {
|
||||
const blob = await (await fetch(imageData)).blob();
|
||||
await createImageBitmap(blob);
|
||||
} catch {
|
||||
return !1;
|
||||
}
|
||||
return !0;
|
||||
}
|
||||
return !1;
|
||||
}
|
||||
exports.testImageFormat = testImageFormat;
|
||||
//# sourceMappingURL=testImageFormat.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/utils/testImageFormat.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/utils/testImageFormat.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"testImageFormat.js","sources":["../../../src/detections/utils/testImageFormat.ts"],"sourcesContent":["export async function testImageFormat(imageData: string): Promise<boolean>\n{\n // Some browsers currently do not support createImageBitmap with Blob, so new Image() is preferred when exist.\n // See https://caniuse.com/createimagebitmap for more information.\n\n if ('Image' in globalThis)\n {\n return new Promise<boolean>((resolve) =>\n {\n const image = new Image();\n\n image.onload = () =>\n {\n resolve(true);\n };\n image.onerror = () =>\n {\n resolve(false);\n };\n image.src = imageData;\n });\n }\n\n if ('createImageBitmap' in globalThis && 'fetch' in globalThis)\n {\n try\n {\n const blob = await (await fetch(imageData)).blob();\n\n await createImageBitmap(blob);\n }\n catch (e)\n {\n return false;\n }\n\n return true;\n }\n\n return false;\n}\n"],"names":[],"mappings":";AAAA,eAAsB,gBAAgB,WACtC;AAII,MAAI,WAAW;AAEJ,WAAA,IAAI,QAAiB,CAAC,YAC7B;AACU,YAAA,QAAQ,IAAI;AAElB,YAAM,SAAS,MACf;AACI,gBAAQ,EAAI;AAAA,MAAA,GAEhB,MAAM,UAAU,MAChB;AACI,gBAAQ,EAAK;AAAA,MAAA,GAEjB,MAAM,MAAM;AAAA,IAAA,CACf;AAGD,MAAA,uBAAuB,cAAc,WAAW,YACpD;AAEI,QAAA;AACI,YAAM,OAAO,OAAO,MAAM,MAAM,SAAS,GAAG;AAE5C,YAAM,kBAAkB,IAAI;AAAA,IAAA,QAGhC;AACW,aAAA;AAAA,IACX;AAEO,WAAA;AAAA,EACX;AAEO,SAAA;AACX;;"}
|
||||
25
resources/app/node_modules/@pixi/assets/lib/detections/utils/testImageFormat.mjs
generated
vendored
Normal file
25
resources/app/node_modules/@pixi/assets/lib/detections/utils/testImageFormat.mjs
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
async function testImageFormat(imageData) {
|
||||
if ("Image" in globalThis)
|
||||
return new Promise((resolve) => {
|
||||
const image = new Image();
|
||||
image.onload = () => {
|
||||
resolve(!0);
|
||||
}, image.onerror = () => {
|
||||
resolve(!1);
|
||||
}, image.src = imageData;
|
||||
});
|
||||
if ("createImageBitmap" in globalThis && "fetch" in globalThis) {
|
||||
try {
|
||||
const blob = await (await fetch(imageData)).blob();
|
||||
await createImageBitmap(blob);
|
||||
} catch {
|
||||
return !1;
|
||||
}
|
||||
return !0;
|
||||
}
|
||||
return !1;
|
||||
}
|
||||
export {
|
||||
testImageFormat
|
||||
};
|
||||
//# sourceMappingURL=testImageFormat.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/utils/testImageFormat.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/utils/testImageFormat.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"testImageFormat.mjs","sources":["../../../src/detections/utils/testImageFormat.ts"],"sourcesContent":["export async function testImageFormat(imageData: string): Promise<boolean>\n{\n // Some browsers currently do not support createImageBitmap with Blob, so new Image() is preferred when exist.\n // See https://caniuse.com/createimagebitmap for more information.\n\n if ('Image' in globalThis)\n {\n return new Promise<boolean>((resolve) =>\n {\n const image = new Image();\n\n image.onload = () =>\n {\n resolve(true);\n };\n image.onerror = () =>\n {\n resolve(false);\n };\n image.src = imageData;\n });\n }\n\n if ('createImageBitmap' in globalThis && 'fetch' in globalThis)\n {\n try\n {\n const blob = await (await fetch(imageData)).blob();\n\n await createImageBitmap(blob);\n }\n catch (e)\n {\n return false;\n }\n\n return true;\n }\n\n return false;\n}\n"],"names":[],"mappings":"AAAA,eAAsB,gBAAgB,WACtC;AAII,MAAI,WAAW;AAEJ,WAAA,IAAI,QAAiB,CAAC,YAC7B;AACU,YAAA,QAAQ,IAAI;AAElB,YAAM,SAAS,MACf;AACI,gBAAQ,EAAI;AAAA,MAAA,GAEhB,MAAM,UAAU,MAChB;AACI,gBAAQ,EAAK;AAAA,MAAA,GAEjB,MAAM,MAAM;AAAA,IAAA,CACf;AAGD,MAAA,uBAAuB,cAAc,WAAW,YACpD;AAEI,QAAA;AACI,YAAM,OAAO,OAAO,MAAM,MAAM,SAAS,GAAG;AAE5C,YAAM,kBAAkB,IAAI;AAAA,IAAA,QAGhC;AACW,aAAA;AAAA,IACX;AAEO,WAAA;AAAA,EACX;AAEO,SAAA;AACX;"}
|
||||
7
resources/app/node_modules/@pixi/assets/lib/detections/utils/testVideoFormat.js
generated
vendored
Normal file
7
resources/app/node_modules/@pixi/assets/lib/detections/utils/testVideoFormat.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
const inWorker = "WorkerGlobalScope" in globalThis && globalThis instanceof globalThis.WorkerGlobalScope;
|
||||
function testVideoFormat(mimeType) {
|
||||
return inWorker ? !1 : document.createElement("video").canPlayType(mimeType) !== "";
|
||||
}
|
||||
exports.testVideoFormat = testVideoFormat;
|
||||
//# sourceMappingURL=testVideoFormat.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/utils/testVideoFormat.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/utils/testVideoFormat.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"testVideoFormat.js","sources":["../../../src/detections/utils/testVideoFormat.ts"],"sourcesContent":["const inWorker = 'WorkerGlobalScope' in globalThis\n && globalThis instanceof (globalThis as any).WorkerGlobalScope;\n\nexport function testVideoFormat(mimeType: string): boolean\n{\n if (inWorker)\n {\n return false;\n }\n\n const video = document.createElement('video');\n\n return video.canPlayType(mimeType) !== '';\n}\n"],"names":[],"mappings":";AAAA,MAAM,WAAW,uBAAuB,cACjC,sBAAuB,WAAmB;AAE1C,SAAS,gBAAgB,UAChC;AACQ,SAAA,WAEO,KAGG,SAAS,cAAc,OAAO,EAE/B,YAAY,QAAQ,MAAM;AAC3C;;"}
|
||||
8
resources/app/node_modules/@pixi/assets/lib/detections/utils/testVideoFormat.mjs
generated
vendored
Normal file
8
resources/app/node_modules/@pixi/assets/lib/detections/utils/testVideoFormat.mjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
const inWorker = "WorkerGlobalScope" in globalThis && globalThis instanceof globalThis.WorkerGlobalScope;
|
||||
function testVideoFormat(mimeType) {
|
||||
return inWorker ? !1 : document.createElement("video").canPlayType(mimeType) !== "";
|
||||
}
|
||||
export {
|
||||
testVideoFormat
|
||||
};
|
||||
//# sourceMappingURL=testVideoFormat.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/detections/utils/testVideoFormat.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/detections/utils/testVideoFormat.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"testVideoFormat.mjs","sources":["../../../src/detections/utils/testVideoFormat.ts"],"sourcesContent":["const inWorker = 'WorkerGlobalScope' in globalThis\n && globalThis instanceof (globalThis as any).WorkerGlobalScope;\n\nexport function testVideoFormat(mimeType: string): boolean\n{\n if (inWorker)\n {\n return false;\n }\n\n const video = document.createElement('video');\n\n return video.canPlayType(mimeType) !== '';\n}\n"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB,cACjC,sBAAuB,WAAmB;AAE1C,SAAS,gBAAgB,UAChC;AACQ,SAAA,WAEO,KAGG,SAAS,cAAc,OAAO,EAE/B,YAAY,QAAQ,MAAM;AAC3C;"}
|
||||
38
resources/app/node_modules/@pixi/assets/lib/index.js
generated
vendored
Normal file
38
resources/app/node_modules/@pixi/assets/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
require("./AssetExtension.js");
|
||||
var Assets = require("./Assets.js");
|
||||
require("./cache/index.js");
|
||||
require("./detections/index.js");
|
||||
require("./loader/index.js");
|
||||
require("./resolver/index.js");
|
||||
require("./types.js");
|
||||
require("./utils/index.js");
|
||||
var Cache = require("./cache/Cache.js"), cacheTextureArray = require("./cache/parsers/cacheTextureArray.js"), detectAvif = require("./detections/parsers/detectAvif.js"), detectWebp = require("./detections/parsers/detectWebp.js"), detectDefaults = require("./detections/parsers/detectDefaults.js"), detectWebm = require("./detections/parsers/detectWebm.js"), detectMp4 = require("./detections/parsers/detectMp4.js"), detectOgv = require("./detections/parsers/detectOgv.js"), LoaderParser = require("./loader/parsers/LoaderParser.js"), loadJson = require("./loader/parsers/loadJson.js"), loadTxt = require("./loader/parsers/loadTxt.js"), loadWebFont = require("./loader/parsers/loadWebFont.js"), loadSVG = require("./loader/parsers/textures/loadSVG.js"), loadTextures = require("./loader/parsers/textures/loadTextures.js"), loadVideo = require("./loader/parsers/textures/loadVideo.js"), createTexture = require("./loader/parsers/textures/utils/createTexture.js"), resolveTextureUrl = require("./resolver/parsers/resolveTextureUrl.js"), checkDataUrl = require("./utils/checkDataUrl.js"), checkExtension = require("./utils/checkExtension.js"), convertToList = require("./utils/convertToList.js"), copySearchParams = require("./utils/copySearchParams.js"), createStringVariations = require("./utils/createStringVariations.js"), isSingleItem = require("./utils/isSingleItem.js");
|
||||
exports.Assets = Assets.Assets;
|
||||
exports.AssetsClass = Assets.AssetsClass;
|
||||
exports.Cache = Cache.Cache;
|
||||
exports.cacheTextureArray = cacheTextureArray.cacheTextureArray;
|
||||
exports.detectAvif = detectAvif.detectAvif;
|
||||
exports.detectWebp = detectWebp.detectWebp;
|
||||
exports.detectDefaults = detectDefaults.detectDefaults;
|
||||
exports.detectWebm = detectWebm.detectWebm;
|
||||
exports.detectMp4 = detectMp4.detectMp4;
|
||||
exports.detectOgv = detectOgv.detectOgv;
|
||||
exports.LoaderParserPriority = LoaderParser.LoaderParserPriority;
|
||||
exports.loadJson = loadJson.loadJson;
|
||||
exports.loadTxt = loadTxt.loadTxt;
|
||||
exports.getFontFamilyName = loadWebFont.getFontFamilyName;
|
||||
exports.loadWebFont = loadWebFont.loadWebFont;
|
||||
exports.loadSVG = loadSVG.loadSVG;
|
||||
exports.loadImageBitmap = loadTextures.loadImageBitmap;
|
||||
exports.loadTextures = loadTextures.loadTextures;
|
||||
exports.loadVideo = loadVideo.loadVideo;
|
||||
exports.createTexture = createTexture.createTexture;
|
||||
exports.resolveTextureUrl = resolveTextureUrl.resolveTextureUrl;
|
||||
exports.checkDataUrl = checkDataUrl.checkDataUrl;
|
||||
exports.checkExtension = checkExtension.checkExtension;
|
||||
exports.convertToList = convertToList.convertToList;
|
||||
exports.copySearchParams = copySearchParams.copySearchParams;
|
||||
exports.createStringVariations = createStringVariations.createStringVariations;
|
||||
exports.isSingleItem = isSingleItem.isSingleItem;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/index.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
||||
61
resources/app/node_modules/@pixi/assets/lib/index.mjs
generated
vendored
Normal file
61
resources/app/node_modules/@pixi/assets/lib/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
import "./AssetExtension.mjs";
|
||||
import { Assets, AssetsClass } from "./Assets.mjs";
|
||||
import "./cache/index.mjs";
|
||||
import "./detections/index.mjs";
|
||||
import "./loader/index.mjs";
|
||||
import "./resolver/index.mjs";
|
||||
import "./types.mjs";
|
||||
import "./utils/index.mjs";
|
||||
import { Cache } from "./cache/Cache.mjs";
|
||||
import { cacheTextureArray } from "./cache/parsers/cacheTextureArray.mjs";
|
||||
import { detectAvif } from "./detections/parsers/detectAvif.mjs";
|
||||
import { detectWebp } from "./detections/parsers/detectWebp.mjs";
|
||||
import { detectDefaults } from "./detections/parsers/detectDefaults.mjs";
|
||||
import { detectWebm } from "./detections/parsers/detectWebm.mjs";
|
||||
import { detectMp4 } from "./detections/parsers/detectMp4.mjs";
|
||||
import { detectOgv } from "./detections/parsers/detectOgv.mjs";
|
||||
import { LoaderParserPriority } from "./loader/parsers/LoaderParser.mjs";
|
||||
import { loadJson } from "./loader/parsers/loadJson.mjs";
|
||||
import { loadTxt } from "./loader/parsers/loadTxt.mjs";
|
||||
import { getFontFamilyName, loadWebFont } from "./loader/parsers/loadWebFont.mjs";
|
||||
import { loadSVG } from "./loader/parsers/textures/loadSVG.mjs";
|
||||
import { loadImageBitmap, loadTextures } from "./loader/parsers/textures/loadTextures.mjs";
|
||||
import { loadVideo } from "./loader/parsers/textures/loadVideo.mjs";
|
||||
import { createTexture } from "./loader/parsers/textures/utils/createTexture.mjs";
|
||||
import { resolveTextureUrl } from "./resolver/parsers/resolveTextureUrl.mjs";
|
||||
import { checkDataUrl } from "./utils/checkDataUrl.mjs";
|
||||
import { checkExtension } from "./utils/checkExtension.mjs";
|
||||
import { convertToList } from "./utils/convertToList.mjs";
|
||||
import { copySearchParams } from "./utils/copySearchParams.mjs";
|
||||
import { createStringVariations } from "./utils/createStringVariations.mjs";
|
||||
import { isSingleItem } from "./utils/isSingleItem.mjs";
|
||||
export {
|
||||
Assets,
|
||||
AssetsClass,
|
||||
Cache,
|
||||
LoaderParserPriority,
|
||||
cacheTextureArray,
|
||||
checkDataUrl,
|
||||
checkExtension,
|
||||
convertToList,
|
||||
copySearchParams,
|
||||
createStringVariations,
|
||||
createTexture,
|
||||
detectAvif,
|
||||
detectDefaults,
|
||||
detectMp4,
|
||||
detectOgv,
|
||||
detectWebm,
|
||||
detectWebp,
|
||||
getFontFamilyName,
|
||||
isSingleItem,
|
||||
loadImageBitmap,
|
||||
loadJson,
|
||||
loadSVG,
|
||||
loadTextures,
|
||||
loadTxt,
|
||||
loadVideo,
|
||||
loadWebFont,
|
||||
resolveTextureUrl
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/index.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/index.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
||||
96
resources/app/node_modules/@pixi/assets/lib/loader/Loader.js
generated
vendored
Normal file
96
resources/app/node_modules/@pixi/assets/lib/loader/Loader.js
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core");
|
||||
require("../utils/index.js");
|
||||
var isSingleItem = require("../utils/isSingleItem.js"), convertToList = require("../utils/convertToList.js");
|
||||
class Loader {
|
||||
constructor() {
|
||||
this._parsers = [], this._parsersValidated = !1, this.parsers = new Proxy(this._parsers, {
|
||||
set: (target, key, value) => (this._parsersValidated = !1, target[key] = value, !0)
|
||||
}), this.promiseCache = {};
|
||||
}
|
||||
/** function used for testing */
|
||||
reset() {
|
||||
this._parsersValidated = !1, this.promiseCache = {};
|
||||
}
|
||||
/**
|
||||
* Used internally to generate a promise for the asset to be loaded.
|
||||
* @param url - The URL to be loaded
|
||||
* @param data - any custom additional information relevant to the asset being loaded
|
||||
* @returns - a promise that will resolve to an Asset for example a Texture of a JSON object
|
||||
*/
|
||||
_getLoadPromiseAndParser(url, data) {
|
||||
const result = {
|
||||
promise: null,
|
||||
parser: null
|
||||
};
|
||||
return result.promise = (async () => {
|
||||
let asset = null, parser = null;
|
||||
if (data.loadParser && (parser = this._parserHash[data.loadParser], parser || console.warn(`[Assets] specified load parser "${data.loadParser}" not found while loading ${url}`)), !parser) {
|
||||
for (let i = 0; i < this.parsers.length; i++) {
|
||||
const parserX = this.parsers[i];
|
||||
if (parserX.load && parserX.test?.(url, data, this)) {
|
||||
parser = parserX;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!parser)
|
||||
return console.warn(`[Assets] ${url} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`), null;
|
||||
}
|
||||
asset = await parser.load(url, data, this), result.parser = parser;
|
||||
for (let i = 0; i < this.parsers.length; i++) {
|
||||
const parser2 = this.parsers[i];
|
||||
parser2.parse && parser2.parse && await parser2.testParse?.(asset, data, this) && (asset = await parser2.parse(asset, data, this) || asset, result.parser = parser2);
|
||||
}
|
||||
return asset;
|
||||
})(), result;
|
||||
}
|
||||
async load(assetsToLoadIn, onProgress) {
|
||||
this._parsersValidated || this._validateParsers();
|
||||
let count = 0;
|
||||
const assets = {}, singleAsset = isSingleItem.isSingleItem(assetsToLoadIn), assetsToLoad = convertToList.convertToList(assetsToLoadIn, (item) => ({
|
||||
alias: [item],
|
||||
src: item
|
||||
})), total = assetsToLoad.length, promises = assetsToLoad.map(async (asset) => {
|
||||
const url = core.utils.path.toAbsolute(asset.src);
|
||||
if (!assets[asset.src])
|
||||
try {
|
||||
this.promiseCache[url] || (this.promiseCache[url] = this._getLoadPromiseAndParser(url, asset)), assets[asset.src] = await this.promiseCache[url].promise, onProgress && onProgress(++count / total);
|
||||
} catch (e) {
|
||||
throw delete this.promiseCache[url], delete assets[asset.src], new Error(`[Loader.load] Failed to load ${url}.
|
||||
${e}`);
|
||||
}
|
||||
});
|
||||
return await Promise.all(promises), singleAsset ? assets[assetsToLoad[0].src] : assets;
|
||||
}
|
||||
/**
|
||||
* Unloads one or more assets. Any unloaded assets will be destroyed, freeing up memory for your app.
|
||||
* The parser that created the asset, will be the one that unloads it.
|
||||
* @example
|
||||
* // Single asset:
|
||||
* const asset = await Loader.load('cool.png');
|
||||
*
|
||||
* await Loader.unload('cool.png');
|
||||
*
|
||||
* console.log(asset.destroyed); // true
|
||||
* @param assetsToUnloadIn - urls that you want to unload, or a single one!
|
||||
*/
|
||||
async unload(assetsToUnloadIn) {
|
||||
const promises = convertToList.convertToList(assetsToUnloadIn, (item) => ({
|
||||
alias: [item],
|
||||
src: item
|
||||
})).map(async (asset) => {
|
||||
const url = core.utils.path.toAbsolute(asset.src), loadPromise = this.promiseCache[url];
|
||||
if (loadPromise) {
|
||||
const loadedAsset = await loadPromise.promise;
|
||||
delete this.promiseCache[url], loadPromise.parser?.unload?.(loadedAsset, asset, this);
|
||||
}
|
||||
});
|
||||
await Promise.all(promises);
|
||||
}
|
||||
/** validates our parsers, right now it only checks for name conflicts but we can add more here as required! */
|
||||
_validateParsers() {
|
||||
this._parsersValidated = !0, this._parserHash = this._parsers.filter((parser) => parser.name).reduce((hash, parser) => (hash[parser.name] && console.warn(`[Assets] loadParser name conflict "${parser.name}"`), { ...hash, [parser.name]: parser }), {});
|
||||
}
|
||||
}
|
||||
exports.Loader = Loader;
|
||||
//# sourceMappingURL=Loader.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/loader/Loader.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/loader/Loader.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
98
resources/app/node_modules/@pixi/assets/lib/loader/Loader.mjs
generated
vendored
Normal file
98
resources/app/node_modules/@pixi/assets/lib/loader/Loader.mjs
generated
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
import { utils } from "@pixi/core";
|
||||
import "../utils/index.mjs";
|
||||
import { isSingleItem } from "../utils/isSingleItem.mjs";
|
||||
import { convertToList } from "../utils/convertToList.mjs";
|
||||
class Loader {
|
||||
constructor() {
|
||||
this._parsers = [], this._parsersValidated = !1, this.parsers = new Proxy(this._parsers, {
|
||||
set: (target, key, value) => (this._parsersValidated = !1, target[key] = value, !0)
|
||||
}), this.promiseCache = {};
|
||||
}
|
||||
/** function used for testing */
|
||||
reset() {
|
||||
this._parsersValidated = !1, this.promiseCache = {};
|
||||
}
|
||||
/**
|
||||
* Used internally to generate a promise for the asset to be loaded.
|
||||
* @param url - The URL to be loaded
|
||||
* @param data - any custom additional information relevant to the asset being loaded
|
||||
* @returns - a promise that will resolve to an Asset for example a Texture of a JSON object
|
||||
*/
|
||||
_getLoadPromiseAndParser(url, data) {
|
||||
const result = {
|
||||
promise: null,
|
||||
parser: null
|
||||
};
|
||||
return result.promise = (async () => {
|
||||
let asset = null, parser = null;
|
||||
if (data.loadParser && (parser = this._parserHash[data.loadParser], parser || console.warn(`[Assets] specified load parser "${data.loadParser}" not found while loading ${url}`)), !parser) {
|
||||
for (let i = 0; i < this.parsers.length; i++) {
|
||||
const parserX = this.parsers[i];
|
||||
if (parserX.load && parserX.test?.(url, data, this)) {
|
||||
parser = parserX;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!parser)
|
||||
return console.warn(`[Assets] ${url} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`), null;
|
||||
}
|
||||
asset = await parser.load(url, data, this), result.parser = parser;
|
||||
for (let i = 0; i < this.parsers.length; i++) {
|
||||
const parser2 = this.parsers[i];
|
||||
parser2.parse && parser2.parse && await parser2.testParse?.(asset, data, this) && (asset = await parser2.parse(asset, data, this) || asset, result.parser = parser2);
|
||||
}
|
||||
return asset;
|
||||
})(), result;
|
||||
}
|
||||
async load(assetsToLoadIn, onProgress) {
|
||||
this._parsersValidated || this._validateParsers();
|
||||
let count = 0;
|
||||
const assets = {}, singleAsset = isSingleItem(assetsToLoadIn), assetsToLoad = convertToList(assetsToLoadIn, (item) => ({
|
||||
alias: [item],
|
||||
src: item
|
||||
})), total = assetsToLoad.length, promises = assetsToLoad.map(async (asset) => {
|
||||
const url = utils.path.toAbsolute(asset.src);
|
||||
if (!assets[asset.src])
|
||||
try {
|
||||
this.promiseCache[url] || (this.promiseCache[url] = this._getLoadPromiseAndParser(url, asset)), assets[asset.src] = await this.promiseCache[url].promise, onProgress && onProgress(++count / total);
|
||||
} catch (e) {
|
||||
throw delete this.promiseCache[url], delete assets[asset.src], new Error(`[Loader.load] Failed to load ${url}.
|
||||
${e}`);
|
||||
}
|
||||
});
|
||||
return await Promise.all(promises), singleAsset ? assets[assetsToLoad[0].src] : assets;
|
||||
}
|
||||
/**
|
||||
* Unloads one or more assets. Any unloaded assets will be destroyed, freeing up memory for your app.
|
||||
* The parser that created the asset, will be the one that unloads it.
|
||||
* @example
|
||||
* // Single asset:
|
||||
* const asset = await Loader.load('cool.png');
|
||||
*
|
||||
* await Loader.unload('cool.png');
|
||||
*
|
||||
* console.log(asset.destroyed); // true
|
||||
* @param assetsToUnloadIn - urls that you want to unload, or a single one!
|
||||
*/
|
||||
async unload(assetsToUnloadIn) {
|
||||
const promises = convertToList(assetsToUnloadIn, (item) => ({
|
||||
alias: [item],
|
||||
src: item
|
||||
})).map(async (asset) => {
|
||||
const url = utils.path.toAbsolute(asset.src), loadPromise = this.promiseCache[url];
|
||||
if (loadPromise) {
|
||||
const loadedAsset = await loadPromise.promise;
|
||||
delete this.promiseCache[url], loadPromise.parser?.unload?.(loadedAsset, asset, this);
|
||||
}
|
||||
});
|
||||
await Promise.all(promises);
|
||||
}
|
||||
/** validates our parsers, right now it only checks for name conflicts but we can add more here as required! */
|
||||
_validateParsers() {
|
||||
this._parsersValidated = !0, this._parserHash = this._parsers.filter((parser) => parser.name).reduce((hash, parser) => (hash[parser.name] && console.warn(`[Assets] loadParser name conflict "${parser.name}"`), { ...hash, [parser.name]: parser }), {});
|
||||
}
|
||||
}
|
||||
export {
|
||||
Loader
|
||||
};
|
||||
//# sourceMappingURL=Loader.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/loader/Loader.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/loader/Loader.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
resources/app/node_modules/@pixi/assets/lib/loader/index.js
generated
vendored
Normal file
3
resources/app/node_modules/@pixi/assets/lib/loader/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
require("./parsers/index.js");
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/loader/index.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/loader/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
||||
2
resources/app/node_modules/@pixi/assets/lib/loader/index.mjs
generated
vendored
Normal file
2
resources/app/node_modules/@pixi/assets/lib/loader/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import "./parsers/index.mjs";
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/loader/index.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/loader/index.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
||||
4
resources/app/node_modules/@pixi/assets/lib/loader/parsers/LoaderParser.js
generated
vendored
Normal file
4
resources/app/node_modules/@pixi/assets/lib/loader/parsers/LoaderParser.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
var LoaderParserPriority = /* @__PURE__ */ ((LoaderParserPriority2) => (LoaderParserPriority2[LoaderParserPriority2.Low = 0] = "Low", LoaderParserPriority2[LoaderParserPriority2.Normal = 1] = "Normal", LoaderParserPriority2[LoaderParserPriority2.High = 2] = "High", LoaderParserPriority2))(LoaderParserPriority || {});
|
||||
exports.LoaderParserPriority = LoaderParserPriority;
|
||||
//# sourceMappingURL=LoaderParser.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/loader/parsers/LoaderParser.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/loader/parsers/LoaderParser.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"LoaderParser.js","sources":["../../../src/loader/parsers/LoaderParser.ts"],"sourcesContent":["import type { ExtensionMetadata } from '@pixi/core';\nimport type { ResolvedAsset } from '../../types';\nimport type { Loader } from '../Loader';\n\n/**\n * The extension priority for loader parsers.\n * Helpful when managing multiple parsers that share the same extension test.\n * The higher priority parsers will be checked first.\n * @memberof PIXI\n * @enum {number}\n */\nexport enum LoaderParserPriority\n// eslint-disable-next-line @typescript-eslint/indent\n{\n /** Generic parsers: txt, json, webfonts */\n Low = 0,\n /** PixiJS assets with generic extensions: spritesheets, bitmapfonts */\n Normal = 1,\n /** Specific texture types: svg, png, ktx, dds, basis */\n High = 2,\n}\n\n/**\n * All functions are optional here. The flow:\n *\n * for every asset,\n *\n * 1. `parser.test()`: Test the asset url.\n * 2. `parser.load()`: If test passes call the load function with the url\n * 3. `parser.testParse()`: Test to see if the asset should be parsed by the plugin\n * 4. `parse.parse()`: If test is parsed, then run the parse function on the asset.\n *\n * some plugins may only be used for parsing,\n * some only for loading\n * and some for both!\n * @memberof PIXI\n */\nexport interface LoaderParser<ASSET = any, META_DATA = any, CONFIG = Record<string, any>>\n{\n extension?: ExtensionMetadata;\n\n /** A config to adjust the parser */\n config?: CONFIG;\n\n /** The name of the parser (this can be used when specifying loadParser in a ResolvedAsset) */\n name?: string;\n\n /**\n * each URL to load will be tested here,\n * if the test is passed the assets are loaded using the load function below.\n * Good place to test for things like file extensions!\n * @param url - The URL to test\n * @param resolvedAsset - Any custom additional information relevant to the asset being loaded\n * @param loader - The loader instance\n */\n test?: (url: string, resolvedAsset?: ResolvedAsset<META_DATA>, loader?: Loader) => boolean;\n\n /**\n * This is the promise that loads the URL provided\n * resolves with a loaded asset if returned by the parser.\n * @param url - The URL to load\n * @param resolvedAsset - Any custom additional information relevant to the asset being loaded\n * @param loader - The loader instance\n */\n load?: <T>(url: string, resolvedAsset?: ResolvedAsset<META_DATA>, loader?: Loader) => Promise<T>;\n\n /**\n * This function is used to test if the parse function should be run on the asset\n * If this returns true then parse is called with the asset\n * @param asset - The loaded asset data\n * @param resolvedAsset - Any custom additional information relevant to the asset being loaded\n * @param loader - The loader instance\n */\n testParse?: (asset: ASSET, resolvedAsset?: ResolvedAsset<META_DATA>, loader?: Loader) => Promise<boolean>;\n\n /**\n * Gets called on the asset it testParse passes. Useful to convert a raw asset into something more useful than\n * @param asset - The loaded asset data\n * @param resolvedAsset - Any custom additional information relevant to the asset being loaded\n * @param loader - The loader instance\n */\n parse?: <T>(asset: ASSET, resolvedAsset?: ResolvedAsset<META_DATA>, loader?: Loader) => Promise<T>;\n\n /**\n * If an asset is parsed using this parser, the unload function will be called when the user requests an asset\n * to be unloaded. This is useful for things like sounds or textures that can be unloaded from memory\n * @param asset - The asset to unload/destroy\n * @param resolvedAsset - Any custom additional information relevant to the asset being loaded\n * @param loader - The loader instance\n */\n unload?: (asset: ASSET, resolvedAsset?: ResolvedAsset<META_DATA>, loader?: Loader) => void;\n}\n"],"names":["LoaderParserPriority"],"mappings":";AAWO,IAAK,uBAAL,kBAAKA,2BAIRA,sBAAAA,sBAAA,MAAM,CAAN,IAAA,OAEAA,sBAAA,sBAAA,SAAS,KAAT,UAEAA,sBAAAA,sBAAA,OAAO,CAAA,IAAP,QARQA,wBAAA,wBAAA,CAAA,CAAA;;"}
|
||||
5
resources/app/node_modules/@pixi/assets/lib/loader/parsers/LoaderParser.mjs
generated
vendored
Normal file
5
resources/app/node_modules/@pixi/assets/lib/loader/parsers/LoaderParser.mjs
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
var LoaderParserPriority = /* @__PURE__ */ ((LoaderParserPriority2) => (LoaderParserPriority2[LoaderParserPriority2.Low = 0] = "Low", LoaderParserPriority2[LoaderParserPriority2.Normal = 1] = "Normal", LoaderParserPriority2[LoaderParserPriority2.High = 2] = "High", LoaderParserPriority2))(LoaderParserPriority || {});
|
||||
export {
|
||||
LoaderParserPriority
|
||||
};
|
||||
//# sourceMappingURL=LoaderParser.mjs.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/loader/parsers/LoaderParser.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/loader/parsers/LoaderParser.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"LoaderParser.mjs","sources":["../../../src/loader/parsers/LoaderParser.ts"],"sourcesContent":["import type { ExtensionMetadata } from '@pixi/core';\nimport type { ResolvedAsset } from '../../types';\nimport type { Loader } from '../Loader';\n\n/**\n * The extension priority for loader parsers.\n * Helpful when managing multiple parsers that share the same extension test.\n * The higher priority parsers will be checked first.\n * @memberof PIXI\n * @enum {number}\n */\nexport enum LoaderParserPriority\n// eslint-disable-next-line @typescript-eslint/indent\n{\n /** Generic parsers: txt, json, webfonts */\n Low = 0,\n /** PixiJS assets with generic extensions: spritesheets, bitmapfonts */\n Normal = 1,\n /** Specific texture types: svg, png, ktx, dds, basis */\n High = 2,\n}\n\n/**\n * All functions are optional here. The flow:\n *\n * for every asset,\n *\n * 1. `parser.test()`: Test the asset url.\n * 2. `parser.load()`: If test passes call the load function with the url\n * 3. `parser.testParse()`: Test to see if the asset should be parsed by the plugin\n * 4. `parse.parse()`: If test is parsed, then run the parse function on the asset.\n *\n * some plugins may only be used for parsing,\n * some only for loading\n * and some for both!\n * @memberof PIXI\n */\nexport interface LoaderParser<ASSET = any, META_DATA = any, CONFIG = Record<string, any>>\n{\n extension?: ExtensionMetadata;\n\n /** A config to adjust the parser */\n config?: CONFIG;\n\n /** The name of the parser (this can be used when specifying loadParser in a ResolvedAsset) */\n name?: string;\n\n /**\n * each URL to load will be tested here,\n * if the test is passed the assets are loaded using the load function below.\n * Good place to test for things like file extensions!\n * @param url - The URL to test\n * @param resolvedAsset - Any custom additional information relevant to the asset being loaded\n * @param loader - The loader instance\n */\n test?: (url: string, resolvedAsset?: ResolvedAsset<META_DATA>, loader?: Loader) => boolean;\n\n /**\n * This is the promise that loads the URL provided\n * resolves with a loaded asset if returned by the parser.\n * @param url - The URL to load\n * @param resolvedAsset - Any custom additional information relevant to the asset being loaded\n * @param loader - The loader instance\n */\n load?: <T>(url: string, resolvedAsset?: ResolvedAsset<META_DATA>, loader?: Loader) => Promise<T>;\n\n /**\n * This function is used to test if the parse function should be run on the asset\n * If this returns true then parse is called with the asset\n * @param asset - The loaded asset data\n * @param resolvedAsset - Any custom additional information relevant to the asset being loaded\n * @param loader - The loader instance\n */\n testParse?: (asset: ASSET, resolvedAsset?: ResolvedAsset<META_DATA>, loader?: Loader) => Promise<boolean>;\n\n /**\n * Gets called on the asset it testParse passes. Useful to convert a raw asset into something more useful than\n * @param asset - The loaded asset data\n * @param resolvedAsset - Any custom additional information relevant to the asset being loaded\n * @param loader - The loader instance\n */\n parse?: <T>(asset: ASSET, resolvedAsset?: ResolvedAsset<META_DATA>, loader?: Loader) => Promise<T>;\n\n /**\n * If an asset is parsed using this parser, the unload function will be called when the user requests an asset\n * to be unloaded. This is useful for things like sounds or textures that can be unloaded from memory\n * @param asset - The asset to unload/destroy\n * @param resolvedAsset - Any custom additional information relevant to the asset being loaded\n * @param loader - The loader instance\n */\n unload?: (asset: ASSET, resolvedAsset?: ResolvedAsset<META_DATA>, loader?: Loader) => void;\n}\n"],"names":["LoaderParserPriority"],"mappings":"AAWO,IAAK,uBAAL,kBAAKA,2BAIRA,sBAAAA,sBAAA,MAAM,CAAN,IAAA,OAEAA,sBAAA,sBAAA,SAAS,KAAT,UAEAA,sBAAAA,sBAAA,OAAO,CAAA,IAAP,QARQA,wBAAA,wBAAA,CAAA,CAAA;"}
|
||||
58
resources/app/node_modules/@pixi/assets/lib/loader/parsers/WorkerManager.js
generated
vendored
Normal file
58
resources/app/node_modules/@pixi/assets/lib/loader/parsers/WorkerManager.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
var checkImageBitmap_worker = require("../../_virtual/checkImageBitmap.worker.js"), loadImageBitmap_worker = require("../../_virtual/loadImageBitmap.worker.js");
|
||||
let UUID = 0, MAX_WORKERS;
|
||||
class WorkerManagerClass {
|
||||
constructor() {
|
||||
this._initialized = !1, this._createdWorkers = 0, this.workerPool = [], this.queue = [], this.resolveHash = {};
|
||||
}
|
||||
isImageBitmapSupported() {
|
||||
return this._isImageBitmapSupported !== void 0 ? this._isImageBitmapSupported : (this._isImageBitmapSupported = new Promise((resolve) => {
|
||||
const { worker } = new checkImageBitmap_worker.default();
|
||||
worker.addEventListener("message", (event) => {
|
||||
worker.terminate(), checkImageBitmap_worker.default.revokeObjectURL(), resolve(event.data);
|
||||
});
|
||||
}), this._isImageBitmapSupported);
|
||||
}
|
||||
loadImageBitmap(src) {
|
||||
return this._run("loadImageBitmap", [src]);
|
||||
}
|
||||
async _initWorkers() {
|
||||
this._initialized || (this._initialized = !0);
|
||||
}
|
||||
getWorker() {
|
||||
MAX_WORKERS === void 0 && (MAX_WORKERS = navigator.hardwareConcurrency || 4);
|
||||
let worker = this.workerPool.pop();
|
||||
return !worker && this._createdWorkers < MAX_WORKERS && (this._createdWorkers++, worker = new loadImageBitmap_worker.default().worker, worker.addEventListener("message", (event) => {
|
||||
this.complete(event.data), this.returnWorker(event.target), this.next();
|
||||
})), worker;
|
||||
}
|
||||
returnWorker(worker) {
|
||||
this.workerPool.push(worker);
|
||||
}
|
||||
complete(data) {
|
||||
data.error !== void 0 ? this.resolveHash[data.uuid].reject(data.error) : this.resolveHash[data.uuid].resolve(data.data), this.resolveHash[data.uuid] = null;
|
||||
}
|
||||
async _run(id, args) {
|
||||
await this._initWorkers();
|
||||
const promise = new Promise((resolve, reject) => {
|
||||
this.queue.push({ id, arguments: args, resolve, reject });
|
||||
});
|
||||
return this.next(), promise;
|
||||
}
|
||||
next() {
|
||||
if (!this.queue.length)
|
||||
return;
|
||||
const worker = this.getWorker();
|
||||
if (!worker)
|
||||
return;
|
||||
const toDo = this.queue.pop(), id = toDo.id;
|
||||
this.resolveHash[UUID] = { resolve: toDo.resolve, reject: toDo.reject }, worker.postMessage({
|
||||
data: toDo.arguments,
|
||||
uuid: UUID++,
|
||||
id
|
||||
});
|
||||
}
|
||||
}
|
||||
const WorkerManager = new WorkerManagerClass();
|
||||
exports.WorkerManager = WorkerManager;
|
||||
//# sourceMappingURL=WorkerManager.js.map
|
||||
1
resources/app/node_modules/@pixi/assets/lib/loader/parsers/WorkerManager.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/assets/lib/loader/parsers/WorkerManager.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
60
resources/app/node_modules/@pixi/assets/lib/loader/parsers/WorkerManager.mjs
generated
vendored
Normal file
60
resources/app/node_modules/@pixi/assets/lib/loader/parsers/WorkerManager.mjs
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
import WorkerInstance from "../../_virtual/checkImageBitmap.worker.mjs";
|
||||
import WorkerInstance$1 from "../../_virtual/loadImageBitmap.worker.mjs";
|
||||
let UUID = 0, MAX_WORKERS;
|
||||
class WorkerManagerClass {
|
||||
constructor() {
|
||||
this._initialized = !1, this._createdWorkers = 0, this.workerPool = [], this.queue = [], this.resolveHash = {};
|
||||
}
|
||||
isImageBitmapSupported() {
|
||||
return this._isImageBitmapSupported !== void 0 ? this._isImageBitmapSupported : (this._isImageBitmapSupported = new Promise((resolve) => {
|
||||
const { worker } = new WorkerInstance();
|
||||
worker.addEventListener("message", (event) => {
|
||||
worker.terminate(), WorkerInstance.revokeObjectURL(), resolve(event.data);
|
||||
});
|
||||
}), this._isImageBitmapSupported);
|
||||
}
|
||||
loadImageBitmap(src) {
|
||||
return this._run("loadImageBitmap", [src]);
|
||||
}
|
||||
async _initWorkers() {
|
||||
this._initialized || (this._initialized = !0);
|
||||
}
|
||||
getWorker() {
|
||||
MAX_WORKERS === void 0 && (MAX_WORKERS = navigator.hardwareConcurrency || 4);
|
||||
let worker = this.workerPool.pop();
|
||||
return !worker && this._createdWorkers < MAX_WORKERS && (this._createdWorkers++, worker = new WorkerInstance$1().worker, worker.addEventListener("message", (event) => {
|
||||
this.complete(event.data), this.returnWorker(event.target), this.next();
|
||||
})), worker;
|
||||
}
|
||||
returnWorker(worker) {
|
||||
this.workerPool.push(worker);
|
||||
}
|
||||
complete(data) {
|
||||
data.error !== void 0 ? this.resolveHash[data.uuid].reject(data.error) : this.resolveHash[data.uuid].resolve(data.data), this.resolveHash[data.uuid] = null;
|
||||
}
|
||||
async _run(id, args) {
|
||||
await this._initWorkers();
|
||||
const promise = new Promise((resolve, reject) => {
|
||||
this.queue.push({ id, arguments: args, resolve, reject });
|
||||
});
|
||||
return this.next(), promise;
|
||||
}
|
||||
next() {
|
||||
if (!this.queue.length)
|
||||
return;
|
||||
const worker = this.getWorker();
|
||||
if (!worker)
|
||||
return;
|
||||
const toDo = this.queue.pop(), id = toDo.id;
|
||||
this.resolveHash[UUID] = { resolve: toDo.resolve, reject: toDo.reject }, worker.postMessage({
|
||||
data: toDo.arguments,
|
||||
uuid: UUID++,
|
||||
id
|
||||
});
|
||||
}
|
||||
}
|
||||
const WorkerManager = new WorkerManagerClass();
|
||||
export {
|
||||
WorkerManager
|
||||
};
|
||||
//# sourceMappingURL=WorkerManager.mjs.map
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user