pixi.js 7.3.0-rc → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pixi.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * pixi.js - v7.3.0-rc
3
- * Compiled Wed, 12 Jul 2023 19:26:10 UTC
2
+ * pixi.js - v7.3.0
3
+ * Compiled Mon, 18 Sep 2023 15:35:01 UTC
4
4
  *
5
5
  * pixi.js is licensed under the MIT License.
6
6
  * http://www.opensource.org/licenses/mit-license
@@ -1010,7 +1010,7 @@ Deprecated since v${version}`), console.warn(stack))), warnings[message] = !0;
1010
1010
  return replaceAll(path2, "\\", "/");
1011
1011
  },
1012
1012
  /**
1013
- * Checks if the path is a URL
1013
+ * Checks if the path is a URL e.g. http://, https://
1014
1014
  * @param path - The path to check
1015
1015
  */
1016
1016
  isUrl(path2) {
@@ -1024,26 +1024,31 @@ Deprecated since v${version}`), console.warn(stack))), warnings[message] = !0;
1024
1024
  return /^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(path2);
1025
1025
  },
1026
1026
  /**
1027
- * Checks if the path has a protocol e.g. http://
1027
+ * Checks if the path is a blob URL
1028
+ * @param path - The path to check
1029
+ */
1030
+ isBlobUrl(path2) {
1031
+ return path2.startsWith("blob:");
1032
+ },
1033
+ /**
1034
+ * Checks if the path has a protocol e.g. http://, https://, file:///, data:, blob:, C:/
1028
1035
  * This will return true for windows file paths
1029
1036
  * @param path - The path to check
1030
1037
  */
1031
1038
  hasProtocol(path2) {
1032
- return /^[^/:]+:\//.test(this.toPosix(path2));
1039
+ return /^[^/:]+:/.test(this.toPosix(path2));
1033
1040
  },
1034
1041
  /**
1035
- * Returns the protocol of the path e.g. http://, C:/, file:///
1042
+ * Returns the protocol of the path e.g. http://, https://, file:///, data:, blob:, C:/
1036
1043
  * @param path - The path to get the protocol from
1037
1044
  */
1038
1045
  getProtocol(path2) {
1039
1046
  assertPath(path2), path2 = this.toPosix(path2);
1040
- let protocol = "";
1041
- const isFile = /^file:\/\/\//.exec(path2), isHttp = /^[^/:]+:\/\//.exec(path2), isWindows = /^[^/:]+:\//.exec(path2);
1042
- if (isFile || isHttp || isWindows) {
1043
- const arr = (isFile == null ? void 0 : isFile[0]) || (isHttp == null ? void 0 : isHttp[0]) || (isWindows == null ? void 0 : isWindows[0]);
1044
- protocol = arr, path2 = path2.slice(arr.length);
1045
- }
1046
- return protocol;
1047
+ const matchFile = /^file:\/\/\//.exec(path2);
1048
+ if (matchFile)
1049
+ return matchFile[0];
1050
+ const matchProtocol = /^[^/:]+:\/{0,2}/.exec(path2);
1051
+ return matchProtocol ? matchProtocol[0] : "";
1047
1052
  },
1048
1053
  /**
1049
1054
  * Converts URL to an absolute path.
@@ -1055,18 +1060,21 @@ Deprecated since v${version}`), console.warn(stack))), warnings[message] = !0;
1055
1060
  * @param customRootUrl - The root URL to use
1056
1061
  */
1057
1062
  toAbsolute(url2, customBaseUrl, customRootUrl) {
1058
- if (this.isDataUrl(url2))
1063
+ if (assertPath(url2), this.isDataUrl(url2) || this.isBlobUrl(url2))
1059
1064
  return url2;
1060
1065
  const baseUrl = removeUrlParams(this.toPosix(customBaseUrl != null ? customBaseUrl : settings.ADAPTER.getBaseUrl())), rootUrl = removeUrlParams(this.toPosix(customRootUrl != null ? customRootUrl : this.rootname(baseUrl)));
1061
- return assertPath(url2), url2 = this.toPosix(url2), url2.startsWith("/") ? path.join(rootUrl, url2.slice(1)) : this.isAbsolute(url2) ? url2 : this.join(baseUrl, url2);
1066
+ return url2 = this.toPosix(url2), url2.startsWith("/") ? path.join(rootUrl, url2.slice(1)) : this.isAbsolute(url2) ? url2 : this.join(baseUrl, url2);
1062
1067
  },
1063
1068
  /**
1064
1069
  * Normalizes the given path, resolving '..' and '.' segments
1065
1070
  * @param path - The path to normalize
1066
1071
  */
1067
1072
  normalize(path2) {
1068
- if (path2 = this.toPosix(path2), assertPath(path2), path2.length === 0)
1073
+ if (assertPath(path2), path2.length === 0)
1069
1074
  return ".";
1075
+ if (this.isDataUrl(path2) || this.isBlobUrl(path2))
1076
+ return path2;
1077
+ path2 = this.toPosix(path2);
1070
1078
  let protocol = "";
1071
1079
  const isAbsolute = path2.startsWith("/");
1072
1080
  this.hasProtocol(path2) && (protocol = this.rootname(path2), path2 = path2.slice(protocol.length));
@@ -2772,7 +2780,7 @@ else `), i2 < maxIfs - 1 && (src += `if(test == ${i2}.0){}`);
2772
2780
  * @fires PIXI.BaseTexture#destroyed
2773
2781
  */
2774
2782
  destroy() {
2775
- this.resource && (this.resource.unbind(this), this.resource.internal && this.resource.destroy(), this.resource = null), this.cacheId && (delete BaseTextureCache[this.cacheId], delete TextureCache[this.cacheId], this.cacheId = null), this.dispose(), _BaseTexture2.removeFromCache(this), this.textureCacheIds = null, this.destroyed = !0, this.emit("destroyed", this);
2783
+ this.resource && (this.resource.unbind(this), this.resource.internal && this.resource.destroy(), this.resource = null), this.cacheId && (delete BaseTextureCache[this.cacheId], delete TextureCache[this.cacheId], this.cacheId = null), this.valid = !1, this.dispose(), _BaseTexture2.removeFromCache(this), this.textureCacheIds = null, this.destroyed = !0, this.emit("destroyed", this), this.removeAllListeners();
2776
2784
  }
2777
2785
  /**
2778
2786
  * Frees the texture from WebGL memory without destroying this texture object.
@@ -6005,7 +6013,7 @@ void main(void)
6005
6013
  * @param borders - Default borders used for 9-slice scaling. See {@link PIXI.NineSlicePlane}
6006
6014
  */
6007
6015
  constructor(baseTexture, frame, orig, trim, rotate, anchor, borders) {
6008
- if (super(), this.noFrame = !1, frame || (this.noFrame = !0, frame = new Rectangle(0, 0, 1, 1)), baseTexture instanceof Texture && (baseTexture = baseTexture.baseTexture), this.baseTexture = baseTexture, this._frame = frame, this.trim = trim, this.valid = !1, this._uvs = DEFAULT_UVS, this.uvMatrix = null, this.orig = orig || frame, this._rotate = Number(rotate || 0), rotate === !0)
6016
+ if (super(), this.noFrame = !1, frame || (this.noFrame = !0, frame = new Rectangle(0, 0, 1, 1)), baseTexture instanceof Texture && (baseTexture = baseTexture.baseTexture), this.baseTexture = baseTexture, this._frame = frame, this.trim = trim, this.valid = !1, this.destroyed = !1, this._uvs = DEFAULT_UVS, this.uvMatrix = null, this.orig = orig || frame, this._rotate = Number(rotate || 0), rotate === !0)
6009
6017
  this._rotate = 2;
6010
6018
  else if (this._rotate % 2 !== 0)
6011
6019
  throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");
@@ -6038,6 +6046,7 @@ void main(void)
6038
6046
  /**
6039
6047
  * Destroys this texture
6040
6048
  * @param [destroyBase=false] - Whether to destroy the base texture as well
6049
+ * @fires PIXI.Texture#destroyed
6041
6050
  */
6042
6051
  destroy(destroyBase) {
6043
6052
  if (this.baseTexture) {
@@ -6047,7 +6056,7 @@ void main(void)
6047
6056
  }
6048
6057
  this.baseTexture.off("loaded", this.onBaseTextureUpdated, this), this.baseTexture.off("update", this.onBaseTextureUpdated, this), this.baseTexture = null;
6049
6058
  }
6050
- this._frame = null, this._uvs = null, this.trim = null, this.orig = null, this.valid = !1, Texture.removeFromCache(this), this.textureCacheIds = null;
6059
+ this._frame = null, this._uvs = null, this.trim = null, this.orig = null, this.valid = !1, Texture.removeFromCache(this), this.textureCacheIds = null, this.destroyed = !0, this.emit("destroyed", this), this.removeAllListeners();
6051
6060
  }
6052
6061
  /**
6053
6062
  * Creates a new texture object that acts the same as this one.
@@ -8283,7 +8292,7 @@ void main(void)
8283
8292
  */
8284
8293
  run(options) {
8285
8294
  const { renderer } = this;
8286
- renderer.runners.init.emit(renderer.options), options.hello && console.log(`PixiJS 7.3.0-rc - ${renderer.rendererLogId} - https://pixijs.com`), renderer.resize(renderer.screen.width, renderer.screen.height);
8295
+ renderer.runners.init.emit(renderer.options), options.hello && console.log(`PixiJS 7.3.0 - ${renderer.rendererLogId} - https://pixijs.com`), renderer.resize(renderer.screen.width, renderer.screen.height);
8287
8296
  }
8288
8297
  destroy() {
8289
8298
  }
@@ -9070,7 +9079,7 @@ void main(void)
9070
9079
  * @default PIXI.settings.RESOLUTION
9071
9080
  * @memberof PIXI.settings.RENDER_OPTIONS
9072
9081
  */
9073
- resolution: settings.RESOLUTION,
9082
+ resolution: void 0,
9074
9083
  /**
9075
9084
  * {@link PIXI.IRendererOptions.autoDensity}
9076
9085
  * @default false
@@ -10580,11 +10589,14 @@ void main(void)
10580
10589
  * @param {number} [options.updateFPS=0] - How many times a second to update the texture from the video.
10581
10590
  * Leave at 0 to update at every render.
10582
10591
  * @param {boolean} [options.crossorigin=true] - Load image using cross origin
10592
+ * @param {boolean} [options.loop=false] - Loops the video
10593
+ * @param {boolean} [options.muted=false] - Mutes the video audio, useful for autoplay
10594
+ * @param {boolean} [options.playsinline=true] - Prevents opening the video on mobile devices
10583
10595
  */
10584
10596
  constructor(source, options) {
10585
10597
  if (options = options || {}, !(source instanceof HTMLVideoElement)) {
10586
10598
  const videoElement = document.createElement("video");
10587
- videoElement.setAttribute("preload", "auto"), videoElement.setAttribute("webkit-playsinline", ""), videoElement.setAttribute("playsinline", ""), typeof source == "string" && (source = [source]);
10599
+ options.autoLoad !== !1 && videoElement.setAttribute("preload", "auto"), options.playsinline !== !1 && (videoElement.setAttribute("webkit-playsinline", ""), videoElement.setAttribute("playsinline", "")), options.muted === !0 && (videoElement.setAttribute("muted", ""), videoElement.muted = !0), options.loop === !0 && videoElement.setAttribute("loop", ""), options.autoPlay !== !1 && videoElement.setAttribute("autoplay", ""), typeof source == "string" && (source = [source]);
10588
10600
  const firstSrc = source[0].src || source[0];
10589
10601
  BaseImageResource.crossOrigin(videoElement, firstSrc, options.crossorigin);
10590
10602
  for (let i2 = 0; i2 < source.length; ++i2) {
@@ -10592,11 +10604,11 @@ void main(void)
10592
10604
  let { src, mime } = source[i2];
10593
10605
  if (src = src || source[i2], src.startsWith("data:"))
10594
10606
  mime = src.slice(5, src.indexOf(";"));
10595
- else {
10607
+ else if (!src.startsWith("blob:")) {
10596
10608
  const baseSrc = src.split("?").shift().toLowerCase(), ext = baseSrc.slice(baseSrc.lastIndexOf(".") + 1);
10597
10609
  mime = mime || _VideoResource2.MIME_TYPES[ext] || `video/${ext}`;
10598
10610
  }
10599
- sourceElement.src = src, sourceElement.type = mime, videoElement.appendChild(sourceElement);
10611
+ sourceElement.src = src, mime && (sourceElement.type = mime), videoElement.appendChild(sourceElement);
10600
10612
  }
10601
10613
  source = videoElement;
10602
10614
  }
@@ -10750,7 +10762,7 @@ void main(void)
10750
10762
  this.disposeRunner.emit(this, !1);
10751
10763
  }
10752
10764
  }
10753
- const VERSION = "7.3.0-rc";
10765
+ const VERSION = "7.3.0";
10754
10766
  class Bounds {
10755
10767
  constructor() {
10756
10768
  this.minX = 1 / 0, this.minY = 1 / 0, this.maxX = -1 / 0, this.maxY = -1 / 0, this.rect = null, this.updateID = -1;
@@ -11019,9 +11031,10 @@ void main(void)
11019
11031
  * @returns - The rectangular bounding area.
11020
11032
  */
11021
11033
  getLocalBounds(rect) {
11034
+ var _a2;
11022
11035
  rect || (this._localBoundsRect || (this._localBoundsRect = new Rectangle()), rect = this._localBoundsRect), this._localBounds || (this._localBounds = new Bounds());
11023
11036
  const transformRef = this.transform, parentRef = this.parent;
11024
- this.parent = null, this.transform = this._tempDisplayObjectParent.transform;
11037
+ this.parent = null, this._tempDisplayObjectParent.worldAlpha = (_a2 = parentRef == null ? void 0 : parentRef.worldAlpha) != null ? _a2 : 1, this.transform = this._tempDisplayObjectParent.transform;
11025
11038
  const worldBounds = this._bounds, worldBoundsID = this._boundsID;
11026
11039
  this._bounds = this._localBounds;
11027
11040
  const bounds = this.getBounds(!1, rect);
@@ -11320,9 +11333,10 @@ void main(void)
11320
11333
  return children[0];
11321
11334
  }
11322
11335
  /**
11323
- * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
11324
- * @param {PIXI.DisplayObject} child - The child to add
11325
- * @param {number} index - The index to place the child in
11336
+ * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown.
11337
+ * If the child is already in this container, it will be moved to the specified index.
11338
+ * @param {PIXI.DisplayObject} child - The child to add.
11339
+ * @param {number} index - The absolute index where the child will be positioned at the end of the operation.
11326
11340
  * @returns {PIXI.DisplayObject} The child that was added.
11327
11341
  */
11328
11342
  addChildAt(child, index2) {
@@ -14309,8 +14323,9 @@ void main()
14309
14323
  * @param nativeEvent - The native mouse/pointer/touch event.
14310
14324
  */
14311
14325
  onPointerDown(nativeEvent) {
14312
- if (!this.features.click || (this.rootBoundary.rootTarget = this.renderer.lastObjectRendered, this.supportsTouchEvents && nativeEvent.pointerType === "touch"))
14326
+ if (!this.features.click)
14313
14327
  return;
14328
+ this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
14314
14329
  const events = this.normalizeToPointerData(nativeEvent);
14315
14330
  this.autoPreventDefault && events[0].isNormalized && (nativeEvent.cancelable || !("cancelable" in nativeEvent)) && nativeEvent.preventDefault();
14316
14331
  for (let i2 = 0, j2 = events.length; i2 < j2; i2++) {
@@ -14324,9 +14339,9 @@ void main()
14324
14339
  * @param nativeEvent - The native mouse/pointer/touch events.
14325
14340
  */
14326
14341
  onPointerMove(nativeEvent) {
14327
- if (!this.features.move || (this.rootBoundary.rootTarget = this.renderer.lastObjectRendered, this.supportsTouchEvents && nativeEvent.pointerType === "touch"))
14342
+ if (!this.features.move)
14328
14343
  return;
14329
- EventsTicker.pointerMoved();
14344
+ this.rootBoundary.rootTarget = this.renderer.lastObjectRendered, EventsTicker.pointerMoved();
14330
14345
  const normalizedEvents = this.normalizeToPointerData(nativeEvent);
14331
14346
  for (let i2 = 0, j2 = normalizedEvents.length; i2 < j2; i2++) {
14332
14347
  const event = this.bootstrapEvent(this.rootPointerEvent, normalizedEvents[i2]);
@@ -14339,8 +14354,9 @@ void main()
14339
14354
  * @param nativeEvent - The native mouse/pointer/touch event.
14340
14355
  */
14341
14356
  onPointerUp(nativeEvent) {
14342
- if (!this.features.click || (this.rootBoundary.rootTarget = this.renderer.lastObjectRendered, this.supportsTouchEvents && nativeEvent.pointerType === "touch"))
14357
+ if (!this.features.click)
14343
14358
  return;
14359
+ this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
14344
14360
  let target = nativeEvent.target;
14345
14361
  nativeEvent.composedPath && nativeEvent.composedPath().length > 0 && (target = nativeEvent.composedPath()[0]);
14346
14362
  const outside = target !== this.domElement ? "outside" : "", normalizedEvents = this.normalizeToPointerData(nativeEvent);
@@ -14355,8 +14371,9 @@ void main()
14355
14371
  * @param nativeEvent - The native mouse/pointer/touch event.
14356
14372
  */
14357
14373
  onPointerOverOut(nativeEvent) {
14358
- if (!this.features.click || (this.rootBoundary.rootTarget = this.renderer.lastObjectRendered, this.supportsTouchEvents && nativeEvent.pointerType === "touch"))
14374
+ if (!this.features.click)
14359
14375
  return;
14376
+ this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
14360
14377
  const normalizedEvents = this.normalizeToPointerData(nativeEvent);
14361
14378
  for (let i2 = 0, j2 = normalizedEvents.length; i2 < j2; i2++) {
14362
14379
  const event = this.bootstrapEvent(this.rootPointerEvent, normalizedEvents[i2]);
@@ -14389,7 +14406,7 @@ void main()
14389
14406
  return;
14390
14407
  EventsTicker.addTickerListener();
14391
14408
  const style = this.domElement.style;
14392
- style && (globalThis.navigator.msPointerEnabled ? (style.msContentZooming = "none", style.msTouchAction = "none") : this.supportsPointerEvents && (style.touchAction = "none")), this.supportsPointerEvents ? (globalThis.document.addEventListener("pointermove", this.onPointerMove, !0), this.domElement.addEventListener("pointerdown", this.onPointerDown, !0), this.domElement.addEventListener("pointerleave", this.onPointerOverOut, !0), this.domElement.addEventListener("pointerover", this.onPointerOverOut, !0), globalThis.addEventListener("pointerup", this.onPointerUp, !0)) : (globalThis.document.addEventListener("mousemove", this.onPointerMove, !0), this.domElement.addEventListener("mousedown", this.onPointerDown, !0), this.domElement.addEventListener("mouseout", this.onPointerOverOut, !0), this.domElement.addEventListener("mouseover", this.onPointerOverOut, !0), globalThis.addEventListener("mouseup", this.onPointerUp, !0)), this.supportsTouchEvents && (this.domElement.addEventListener("touchstart", this.onPointerDown, !0), this.domElement.addEventListener("touchend", this.onPointerUp, !0), this.domElement.addEventListener("touchmove", this.onPointerMove, !0)), this.domElement.addEventListener("wheel", this.onWheel, {
14409
+ style && (globalThis.navigator.msPointerEnabled ? (style.msContentZooming = "none", style.msTouchAction = "none") : this.supportsPointerEvents && (style.touchAction = "none")), this.supportsPointerEvents ? (globalThis.document.addEventListener("pointermove", this.onPointerMove, !0), this.domElement.addEventListener("pointerdown", this.onPointerDown, !0), this.domElement.addEventListener("pointerleave", this.onPointerOverOut, !0), this.domElement.addEventListener("pointerover", this.onPointerOverOut, !0), globalThis.addEventListener("pointerup", this.onPointerUp, !0)) : (globalThis.document.addEventListener("mousemove", this.onPointerMove, !0), this.domElement.addEventListener("mousedown", this.onPointerDown, !0), this.domElement.addEventListener("mouseout", this.onPointerOverOut, !0), this.domElement.addEventListener("mouseover", this.onPointerOverOut, !0), globalThis.addEventListener("mouseup", this.onPointerUp, !0), this.supportsTouchEvents && (this.domElement.addEventListener("touchstart", this.onPointerDown, !0), this.domElement.addEventListener("touchend", this.onPointerUp, !0), this.domElement.addEventListener("touchmove", this.onPointerMove, !0))), this.domElement.addEventListener("wheel", this.onWheel, {
14393
14410
  passive: !0,
14394
14411
  capture: !0
14395
14412
  }), this.eventsAdded = !0;
@@ -14400,7 +14417,7 @@ void main()
14400
14417
  return;
14401
14418
  EventsTicker.removeTickerListener();
14402
14419
  const style = this.domElement.style;
14403
- globalThis.navigator.msPointerEnabled ? (style.msContentZooming = "", style.msTouchAction = "") : this.supportsPointerEvents && (style.touchAction = ""), this.supportsPointerEvents ? (globalThis.document.removeEventListener("pointermove", this.onPointerMove, !0), this.domElement.removeEventListener("pointerdown", this.onPointerDown, !0), this.domElement.removeEventListener("pointerleave", this.onPointerOverOut, !0), this.domElement.removeEventListener("pointerover", this.onPointerOverOut, !0), globalThis.removeEventListener("pointerup", this.onPointerUp, !0)) : (globalThis.document.removeEventListener("mousemove", this.onPointerMove, !0), this.domElement.removeEventListener("mousedown", this.onPointerDown, !0), this.domElement.removeEventListener("mouseout", this.onPointerOverOut, !0), this.domElement.removeEventListener("mouseover", this.onPointerOverOut, !0), globalThis.removeEventListener("mouseup", this.onPointerUp, !0)), this.supportsTouchEvents && (this.domElement.removeEventListener("touchstart", this.onPointerDown, !0), this.domElement.removeEventListener("touchend", this.onPointerUp, !0), this.domElement.removeEventListener("touchmove", this.onPointerMove, !0)), this.domElement.removeEventListener("wheel", this.onWheel, !0), this.domElement = null, this.eventsAdded = !1;
14420
+ globalThis.navigator.msPointerEnabled ? (style.msContentZooming = "", style.msTouchAction = "") : this.supportsPointerEvents && (style.touchAction = ""), this.supportsPointerEvents ? (globalThis.document.removeEventListener("pointermove", this.onPointerMove, !0), this.domElement.removeEventListener("pointerdown", this.onPointerDown, !0), this.domElement.removeEventListener("pointerleave", this.onPointerOverOut, !0), this.domElement.removeEventListener("pointerover", this.onPointerOverOut, !0), globalThis.removeEventListener("pointerup", this.onPointerUp, !0)) : (globalThis.document.removeEventListener("mousemove", this.onPointerMove, !0), this.domElement.removeEventListener("mousedown", this.onPointerDown, !0), this.domElement.removeEventListener("mouseout", this.onPointerOverOut, !0), this.domElement.removeEventListener("mouseover", this.onPointerOverOut, !0), globalThis.removeEventListener("mouseup", this.onPointerUp, !0), this.supportsTouchEvents && (this.domElement.removeEventListener("touchstart", this.onPointerDown, !0), this.domElement.removeEventListener("touchend", this.onPointerUp, !0), this.domElement.removeEventListener("touchmove", this.onPointerMove, !0))), this.domElement.removeEventListener("wheel", this.onWheel, !0), this.domElement = null, this.eventsAdded = !1;
14404
14421
  }
14405
14422
  /**
14406
14423
  * Maps x and y coords from a DOM object and maps them correctly to the PixiJS view. The
@@ -14849,12 +14866,12 @@ void main()
14849
14866
  _internalEventMode: void 0,
14850
14867
  /**
14851
14868
  * Enable interaction events for the DisplayObject. Touch, pointer and mouse.
14852
- * This now replaces the `interactive` property
14853
- * There is 5 types of interaction settings:
14869
+ * This now replaces the `interactive` property.
14870
+ * There are 5 types of interaction settings:
14854
14871
  * - `'none'`: Ignores all interaction events, even on its children.
14855
14872
  * - `'passive'`: Does not emit events and ignores all hit testing on itself and non-interactive children.
14856
14873
  * Interactive children will still emit events.
14857
- * - `'auto'`: Does not emit events and but is hit tested if parent is interactive. Same as `interactive = false` in v7
14874
+ * - `'auto'`: Does not emit events but is hit tested if parent is interactive. Same as `interactive = false` in v7
14858
14875
  * - `'static'`: Emit events and is hit tested. Same as `interaction = true` in v7
14859
14876
  * - `'dynamic'`: Emits events and is hit tested but will also receive mock interaction events fired from a ticker to
14860
14877
  * allow for interaction when the mouse isn't moving
@@ -15626,7 +15643,7 @@ ${e2}`);
15626
15643
  const url2 = path.toAbsolute(asset.src), loadPromise = this.promiseCache[url2];
15627
15644
  if (loadPromise) {
15628
15645
  const loadedAsset = await loadPromise.promise;
15629
- (_b = (_a2 = loadPromise.parser) == null ? void 0 : _a2.unload) == null || _b.call(_a2, loadedAsset, asset, this), delete this.promiseCache[url2];
15646
+ delete this.promiseCache[url2], (_b = (_a2 = loadPromise.parser) == null ? void 0 : _a2.unload) == null || _b.call(_a2, loadedAsset, asset, this);
15630
15647
  }
15631
15648
  });
15632
15649
  await Promise.all(promises);
@@ -15853,9 +15870,13 @@ ${e2}`);
15853
15870
  const WorkerManager = new WorkerManagerClass();
15854
15871
  function createTexture(base, loader, url2) {
15855
15872
  base.resource.internal = !0;
15856
- const texture = new Texture(base);
15857
- return texture.baseTexture.once("destroyed", () => {
15873
+ const texture = new Texture(base), unload = () => {
15858
15874
  delete loader.promiseCache[url2], Cache.has(url2) && Cache.remove(url2);
15875
+ };
15876
+ return texture.baseTexture.once("destroyed", () => {
15877
+ url2 in loader.promiseCache && (console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."), unload());
15878
+ }), texture.once("destroyed", () => {
15879
+ base.destroyed || (console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."), unload());
15859
15880
  }), texture;
15860
15881
  }
15861
15882
  var __defProp$7 = Object.defineProperty, __getOwnPropSymbols$7 = Object.getOwnPropertySymbols, __hasOwnProp$7 = Object.prototype.hasOwnProperty, __propIsEnum$7 = Object.prototype.propertyIsEnumerable, __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __spreadValues$7 = (a2, b2) => {
@@ -15972,15 +15993,24 @@ ${e2}`);
15972
15993
  },
15973
15994
  async load(url2, loadAsset, loader) {
15974
15995
  var _a2;
15975
- const options = __spreadValues$5({
15976
- autoPlay: this.config.defaultAutoPlay
15977
- }, (_a2 = loadAsset == null ? void 0 : loadAsset.data) == null ? void 0 : _a2.resourceOptions), src = new VideoResource(url2, options);
15978
- await src.load();
15979
- const base = new BaseTexture(src, __spreadValues$5({
15980
- alphaMode: await detectVideoAlphaMode(),
15981
- resolution: getResolutionOfUrl(url2)
15982
- }, loadAsset == null ? void 0 : loadAsset.data));
15983
- return base.resource.src = url2, createTexture(base, loader, url2);
15996
+ let texture;
15997
+ const blob = await (await settings.ADAPTER.fetch(url2)).blob(), blobURL = URL.createObjectURL(blob);
15998
+ try {
15999
+ const options = __spreadValues$5({
16000
+ autoPlay: this.config.defaultAutoPlay
16001
+ }, (_a2 = loadAsset == null ? void 0 : loadAsset.data) == null ? void 0 : _a2.resourceOptions), src = new VideoResource(blobURL, options);
16002
+ await src.load();
16003
+ const base = new BaseTexture(src, __spreadValues$5({
16004
+ alphaMode: await detectVideoAlphaMode(),
16005
+ resolution: getResolutionOfUrl(url2)
16006
+ }, loadAsset == null ? void 0 : loadAsset.data));
16007
+ base.resource.src = url2, texture = createTexture(base, loader, url2), texture.baseTexture.once("destroyed", () => {
16008
+ URL.revokeObjectURL(blobURL);
16009
+ });
16010
+ } catch (e2) {
16011
+ throw URL.revokeObjectURL(blobURL), e2;
16012
+ }
16013
+ return texture;
15984
16014
  },
15985
16015
  unload(texture) {
15986
16016
  texture.destroy(!0);
@@ -22170,7 +22200,7 @@ void main(void)
22170
22200
  */
22171
22201
  static test(data) {
22172
22202
  const xml = data;
22173
- return "getElementsByTagName" in xml && xml.getElementsByTagName("page").length && xml.getElementsByTagName("info")[0].getAttribute("face") !== null;
22203
+ return typeof data != "string" && "getElementsByTagName" in data && xml.getElementsByTagName("page").length && xml.getElementsByTagName("info")[0].getAttribute("face") !== null;
22174
22204
  }
22175
22205
  /**
22176
22206
  * Convert the XML into BitmapFontData that we can use.